@redocly/cli 2.56.1 → 2.58.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/README.md +2 -0
- package/THIRD_PARTY_NOTICES +44 -22
- package/lib/chunks/2523PDUF.js +160 -0
- package/lib/chunks/{5CEXCXYZ.js → 252ZXXJ7.js} +1 -1
- package/lib/chunks/{VUKQLVFA.js → 2ERUBDSZ.js} +1 -1
- package/lib/chunks/{DCVTFQBO.js → 2LDRZLQD.js} +1 -1
- package/lib/chunks/{7ARFLNUA.js → 3QTDDZ3U.js} +1 -1
- package/lib/chunks/{IRZBI5PN.js → 3RJ5Q24M.js} +1 -1
- package/lib/chunks/{PJRRECUU.js → 3TNSVCBC.js} +1 -1
- package/lib/chunks/3TRGOJ74.js +9 -0
- package/lib/chunks/{CXUJFJ3V.js → 46SNGFKM.js} +1 -1
- package/lib/chunks/4BCJL2BX.js +13 -0
- package/lib/chunks/5WKNTF7W.js +22 -0
- package/lib/chunks/{I6CD22RU.js → 65C4QORD.js} +1 -1
- package/lib/chunks/{6BC7FVBU.js → 6ESHHDEM.js} +1 -1
- package/lib/chunks/{VMGZLFL4.js → 6G6YWZOW.js} +1 -1
- package/lib/chunks/{Z22TFV6U.js → 6HHP5O4K.js} +1 -1
- package/lib/chunks/{MRVYTOFX.js → 6XXDGMQI.js} +1 -1
- package/lib/chunks/{2KLHD2U7.js → 7BM3QKWP.js} +1 -1
- package/lib/chunks/{FUETBXGV.js → 7HX6H6PZ.js} +1 -1
- package/lib/chunks/{2M6C5LHI.js → 7KZRKMQI.js} +1 -1
- package/lib/chunks/{OGD5QBKV.js → ABUS6H76.js} +1 -1
- package/lib/chunks/{VD6XNXNY.js → BNAH4YGC.js} +1 -1
- package/lib/chunks/{DLPIGJ4V.js → BZNIB4HL.js} +1 -1
- package/lib/chunks/{35XUUJLG.js → C6B5SYPM.js} +1 -1
- package/lib/chunks/{HJZMPHXS.js → D2IJWX6B.js} +1 -1
- package/lib/chunks/{FX2A3GCS.js → DVJIGHFR.js} +1 -1
- package/lib/chunks/{I7GIWE3P.js → EPFKYDYC.js} +1 -1
- package/lib/chunks/ERFOEXTV.js +9 -0
- package/lib/chunks/{MS356BQ6.js → FBHTM4LH.js} +1 -1
- package/lib/chunks/{XJ7LVK2B.js → FIMSBOF2.js} +1 -1
- package/lib/chunks/{ALAAZCRE.js → GDFQSHUE.js} +1 -1
- package/lib/chunks/H4VN2RX3.js +7 -0
- package/lib/chunks/{TWIJOWYT.js → H7Z35EAH.js} +1 -1
- package/lib/chunks/JF6HX6A6.js +7 -0
- package/lib/chunks/{HDOITPQ3.js → JPHYX7OV.js} +1 -1
- package/lib/chunks/{ZCIVIBWW.js → JXAUEF5V.js} +1 -1
- package/lib/chunks/{BNT5BXON.js → LIAO3NFX.js} +1 -1
- package/lib/chunks/{W5WXQVTO.js → LWTH3K75.js} +1 -1
- package/lib/chunks/{NV7DJMMF.js → M4JX2FBY.js} +1 -1
- package/lib/chunks/ML6MFXCA.js +7 -0
- package/lib/chunks/MT5H2R3P.js +193 -0
- package/lib/chunks/{UVP374Z3.js → MWJGFN4Y.js} +1 -1
- package/lib/chunks/N6VRECSO.js +34 -0
- package/lib/chunks/{MU74CSJJ.js → NRU2WFMW.js} +2 -2
- package/lib/chunks/NSNQAVBA.js +17 -0
- package/lib/chunks/{5TJ3WQMW.js → NYQDTPTE.js} +1 -1
- package/lib/chunks/OJE7THLM.js +31 -0
- package/lib/chunks/{SRIYNICE.js → OQ2G774U.js} +1 -1
- package/lib/chunks/{ISV7E3WY.js → PB256IKB.js} +2 -2
- package/lib/chunks/{A5VZWAMI.js → PWVCTNVT.js} +1 -1
- package/lib/chunks/{MB5P3K2R.js → PZEYEOIF.js} +1 -1
- package/lib/chunks/{E5XZY3Q2.js → QXUO5IQJ.js} +1 -1
- package/lib/chunks/{3W3OLLTF.js → QZJD7SST.js} +1 -1
- package/lib/chunks/{25UBBA3J.js → R5A3H7N2.js} +1 -1
- package/lib/chunks/{IXUAYOCK.js → ROE2PM62.js} +1 -1
- package/lib/chunks/{P6LCRZC4.js → RREAI5RF.js} +1 -1
- package/lib/chunks/{MTHNGTMB.js → SXYE4UNQ.js} +1 -1
- package/lib/chunks/T2G7FRCU.js +23 -0
- package/lib/chunks/{OKP4XLDY.js → T6HGKHGP.js} +1 -1
- package/lib/chunks/{T3LLCSAJ.js → TAEOWXJJ.js} +1 -1
- package/lib/chunks/{D7OG7544.js → TTWBJ74O.js} +1 -1
- package/lib/chunks/{2UTQDU6B.js → U4WMP25Y.js} +1 -1
- package/lib/chunks/{XACYMDME.js → V34PUN4E.js} +1 -1
- package/lib/chunks/{R5EOHC5A.js → VNSAGJ2H.js} +1 -1
- package/lib/chunks/{IGD6TJGQ.js → WFGS4GSF.js} +3 -3
- package/lib/chunks/{YW2GBLJX.js → WSDNWUOV.js} +1 -1
- package/lib/chunks/{QAC4XUNG.js → X5U3XCIW.js} +1 -1
- package/lib/chunks/XARQ5LTM.js +15 -0
- package/lib/chunks/{7QLACFLT.js → YFBPBQ7G.js} +1 -1
- package/lib/chunks/{VCODEISK.js → YLFY2DKU.js} +1 -1
- package/lib/chunks/{VTGQPPGI.js → YMMEOUYX.js} +1 -1
- package/lib/chunks/{JO2R43LS.js → YPT2KQ2K.js} +1 -1
- package/lib/chunks/{XJSNA6VQ.js → YTAL3SI4.js} +2 -2
- package/lib/chunks/index.aff +205 -0
- package/lib/chunks/index.dic +49569 -0
- 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 +66 -61
- package/package.json +1 -1
- package/lib/chunks/DJ2P263F.js +0 -22
- package/lib/chunks/G47ZYA3C.js +0 -9
- package/lib/chunks/HSBHQBL2.js +0 -30
- package/lib/chunks/M3P4YXWZ.js +0 -7
- package/lib/chunks/MGBZEDQJ.js +0 -45
- package/lib/chunks/PIMM4UUT.js +0 -9
- package/lib/chunks/RAZQQ2DW.js +0 -13
- package/lib/chunks/XXP75TZV.js +0 -11
- package/lib/chunks/ZOVYQ36P.js +0 -193
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 Vn,f as ee}from"./chunks/U5DIFWGH.js";import{c as Bn}from"./chunks/4PTNG4EI.js";import{a as Xn}from"./chunks/25UBBA3J.js";import{a as xa,b as Qn,c as Zn}from"./chunks/GHSNC2OX.js";import{a as Jn,c as Vt,d as Rr,e as ti,g as ri}from"./chunks/TZMWTSOQ.js";import{a as Fe,b as kn,c as Hn}from"./chunks/I7GIWE3P.js";import{a as ei}from"./chunks/QAC4XUNG.js";import{a as Ra}from"./chunks/LRUXN6H5.js";import{a as Yn,t as Kn}from"./chunks/MGBZEDQJ.js";import{C as Fn,F as zn,P as Un,T as xr,X as ne,Y as Ht,Z as Gn,a as Dn,c as we,ca as xe,da as Wn,t as Mn}from"./chunks/ZOVYQ36P.js";import"./chunks/NEWT5A6S.js";import{a as Ue,c as z,e as Pt}from"./chunks/RFWIIJFG.js";var wt=z((od,ni)=>{"use strict";var va="2.0.0",ja=Number.MAX_SAFE_INTEGER||9007199254740991,$a=16,Ia=250,Pa=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ni.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:$a,MAX_SAFE_BUILD_LENGTH:Ia,MAX_SAFE_INTEGER:ja,RELEASE_TYPES:Pa,SEMVER_SPEC_VERSION:va,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Lt=z((ad,ii)=>{"use strict";var La=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};ii.exports=La});var Ot=z((Ge,si)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:vr,MAX_SAFE_BUILD_LENGTH:Na,MAX_LENGTH:Ta}=wt(),qa=Lt();Ge=si.exports={};var Da=Ge.re=[],Ma=Ge.safeRe=[],x=Ge.src=[],Fa=Ge.safeSrc=[],R=Ge.t={},za=0,jr="[a-zA-Z0-9-]",Ua=[["\\s",1],["\\d",Ta],[jr,Na]],Ga=r=>{for(let[e,t]of Ua)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},G=(r,e,t)=>{let n=Ga(e),i=za++;qa(r,i,e),R[r]=i,x[i]=e,Fa[i]=n,Da[i]=new RegExp(e,t?"g":void 0),Ma[i]=new RegExp(n,t?"g":void 0)};G("NUMERICIDENTIFIER","0|[1-9]\\d*");G("NUMERICIDENTIFIERLOOSE","\\d+");G("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${jr}*`);G("MAINVERSION",`(${x[R.NUMERICIDENTIFIER]})\\.(${x[R.NUMERICIDENTIFIER]})\\.(${x[R.NUMERICIDENTIFIER]})`);G("MAINVERSIONLOOSE",`(${x[R.NUMERICIDENTIFIERLOOSE]})\\.(${x[R.NUMERICIDENTIFIERLOOSE]})\\.(${x[R.NUMERICIDENTIFIERLOOSE]})`);G("PRERELEASEIDENTIFIER",`(?:${x[R.NONNUMERICIDENTIFIER]}|${x[R.NUMERICIDENTIFIER]})`);G("PRERELEASEIDENTIFIERLOOSE",`(?:${x[R.NONNUMERICIDENTIFIER]}|${x[R.NUMERICIDENTIFIERLOOSE]})`);G("PRERELEASE",`(?:-(${x[R.PRERELEASEIDENTIFIER]}(?:\\.${x[R.PRERELEASEIDENTIFIER]})*))`);G("PRERELEASELOOSE",`(?:-?(${x[R.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${x[R.PRERELEASEIDENTIFIERLOOSE]})*))`);G("BUILDIDENTIFIER",`${jr}+`);G("BUILD",`(?:\\+(${x[R.BUILDIDENTIFIER]}(?:\\.${x[R.BUILDIDENTIFIER]})*))`);G("FULLPLAIN",`v?${x[R.MAINVERSION]}${x[R.PRERELEASE]}?${x[R.BUILD]}?`);G("FULL",`^${x[R.FULLPLAIN]}$`);G("LOOSEPLAIN",`[v=\\s]*${x[R.MAINVERSIONLOOSE]}${x[R.PRERELEASELOOSE]}?${x[R.BUILD]}?`);G("LOOSE",`^${x[R.LOOSEPLAIN]}$`);G("GTLT","((?:<|>)?=?)");G("XRANGEIDENTIFIERLOOSE",`${x[R.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);G("XRANGEIDENTIFIER",`${x[R.NUMERICIDENTIFIER]}|x|X|\\*`);G("XRANGEPLAIN",`[v=\\s]*(${x[R.XRANGEIDENTIFIER]})(?:\\.(${x[R.XRANGEIDENTIFIER]})(?:\\.(${x[R.XRANGEIDENTIFIER]})(?:${x[R.PRERELEASE]})?${x[R.BUILD]}?)?)?`);G("XRANGEPLAINLOOSE",`[v=\\s]*(${x[R.XRANGEIDENTIFIERLOOSE]})(?:\\.(${x[R.XRANGEIDENTIFIERLOOSE]})(?:\\.(${x[R.XRANGEIDENTIFIERLOOSE]})(?:${x[R.PRERELEASELOOSE]})?${x[R.BUILD]}?)?)?`);G("XRANGE",`^${x[R.GTLT]}\\s*${x[R.XRANGEPLAIN]}$`);G("XRANGELOOSE",`^${x[R.GTLT]}\\s*${x[R.XRANGEPLAINLOOSE]}$`);G("COERCEPLAIN",`(^|[^\\d])(\\d{1,${vr}})(?:\\.(\\d{1,${vr}}))?(?:\\.(\\d{1,${vr}}))?`);G("COERCE",`${x[R.COERCEPLAIN]}(?:$|[^\\d])`);G("COERCEFULL",x[R.COERCEPLAIN]+`(?:${x[R.PRERELEASE]})?(?:${x[R.BUILD]})?(?:$|[^\\d])`);G("COERCERTL",x[R.COERCE],!0);G("COERCERTLFULL",x[R.COERCEFULL],!0);G("LONETILDE","(?:~>?)");G("TILDETRIM",`(\\s*)${x[R.LONETILDE]}\\s+`,!0);Ge.tildeTrimReplace="$1~";G("TILDE",`^${x[R.LONETILDE]}${x[R.XRANGEPLAIN]}$`);G("TILDELOOSE",`^${x[R.LONETILDE]}${x[R.XRANGEPLAINLOOSE]}$`);G("LONECARET","(?:\\^)");G("CARETTRIM",`(\\s*)${x[R.LONECARET]}\\s+`,!0);Ge.caretTrimReplace="$1^";G("CARET",`^${x[R.LONECARET]}${x[R.XRANGEPLAIN]}$`);G("CARETLOOSE",`^${x[R.LONECARET]}${x[R.XRANGEPLAINLOOSE]}$`);G("COMPARATORLOOSE",`^${x[R.GTLT]}\\s*(${x[R.LOOSEPLAIN]})$|^$`);G("COMPARATOR",`^${x[R.GTLT]}\\s*(${x[R.FULLPLAIN]})$|^$`);G("COMPARATORTRIM",`(\\s*)${x[R.GTLT]}\\s*(${x[R.LOOSEPLAIN]}|${x[R.XRANGEPLAIN]})`,!0);Ge.comparatorTrimReplace="$1$2$3";G("HYPHENRANGE",`^\\s*(${x[R.XRANGEPLAIN]})\\s+-\\s+(${x[R.XRANGEPLAIN]})\\s*$`);G("HYPHENRANGELOOSE",`^\\s*(${x[R.XRANGEPLAINLOOSE]})\\s+-\\s+(${x[R.XRANGEPLAINLOOSE]})\\s*$`);G("STAR","(<|>)?=?\\s*\\*");G("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");G("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Bt=z((cd,oi)=>{"use strict";var Wa=Object.freeze({loose:!0}),ka=Object.freeze({}),Ha=r=>r?typeof r!="object"?Wa:r:ka;oi.exports=Ha});var $r=z((ld,li)=>{"use strict";var ai=/^[0-9]+$/,ci=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=ai.test(r),n=ai.test(e);return t&&n&&(r=+r,e=+e),r===e?0:t&&!n?-1:n&&!t?1:r<e?-1:1},Va=(r,e)=>ci(e,r);li.exports={compareIdentifiers:ci,rcompareIdentifiers:Va}});var me=z((ud,fi)=>{"use strict";var Yt=Lt(),{MAX_LENGTH:ui,MAX_SAFE_INTEGER:Kt}=wt(),{safeRe:Xt,t:Jt}=Ot(),Ba=Bt(),{compareIdentifiers:Ir}=$r(),Ya=(r,e)=>{let t=e.split(".");if(t.length>r.length)return!1;for(let n=0;n<t.length;n++)if(Ir(r[n],t[n])!==0)return!1;return!0},Pr=class r{constructor(e,t){if(t=Ba(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>ui)throw new TypeError(`version is longer than ${ui} characters`);Yt("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?Xt[Jt.LOOSE]:Xt[Jt.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>Kt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Kt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Kt||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<Kt)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(Yt("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(Yt("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 Ir(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(Yt("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 Ir(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?Xt[Jt.PRERELEASELOOSE]:Xt[Jt.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]),Ya(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}};fi.exports=Pr});var Qe=z((fd,pi)=>{"use strict";var di=me(),Ka=(r,e,t=!1)=>{if(r instanceof di)return r;try{return new di(r,e)}catch(n){if(!t)return null;throw n}};pi.exports=Ka});var mi=z((dd,hi)=>{"use strict";var Xa=Qe(),Ja=(r,e)=>{let t=Xa(r,e);return t?t.version:null};hi.exports=Ja});var yi=z((pd,gi)=>{"use strict";var Qa=Qe(),Za=(r,e)=>{let t=Qa(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};gi.exports=Za});var wi=z((hd,Ei)=>{"use strict";var bi=me(),ec=(r,e,t,n,i)=>{typeof t=="string"&&(i=n,n=t,t=void 0);try{return new bi(r instanceof bi?r.version:r,t).inc(e,n,i).version}catch{return null}};Ei.exports=ec});var _i=z((md,Ai)=>{"use strict";var Oi=Qe(),tc=(r,e)=>{let t=Oi(r,null,!0),n=Oi(e,null,!0),i=t.compare(n);if(i===0)return null;let s=i>0,o=s?t:n,c=s?n:t,u=!!o.prerelease.length;if(!!c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(c.compareMain(o)===0)return c.minor&&!c.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"};Ai.exports=tc});var Ci=z((gd,Si)=>{"use strict";var rc=me(),nc=(r,e)=>new rc(r,e).major;Si.exports=nc});var Ri=z((yd,xi)=>{"use strict";var ic=me(),sc=(r,e)=>new ic(r,e).minor;xi.exports=sc});var ji=z((bd,vi)=>{"use strict";var oc=me(),ac=(r,e)=>new oc(r,e).patch;vi.exports=ac});var Ii=z((Ed,$i)=>{"use strict";var cc=Qe(),lc=(r,e)=>{let t=cc(r,e);return t&&t.prerelease.length?t.prerelease:null};$i.exports=lc});var Ie=z((wd,Li)=>{"use strict";var Pi=me(),uc=(r,e,t)=>new Pi(r,t).compare(new Pi(e,t));Li.exports=uc});var Ti=z((Od,Ni)=>{"use strict";var fc=Ie(),dc=(r,e,t)=>fc(e,r,t);Ni.exports=dc});var Di=z((Ad,qi)=>{"use strict";var pc=Ie(),hc=(r,e)=>pc(r,e,!0);qi.exports=hc});var Qt=z((_d,Fi)=>{"use strict";var Mi=me(),mc=(r,e,t)=>{let n=new Mi(r,t),i=new Mi(e,t);return n.compare(i)||n.compareBuild(i)};Fi.exports=mc});var Ui=z((Sd,zi)=>{"use strict";var gc=Qt(),yc=(r,e)=>r.sort((t,n)=>gc(t,n,e));zi.exports=yc});var Wi=z((Cd,Gi)=>{"use strict";var bc=Qt(),Ec=(r,e)=>r.sort((t,n)=>bc(n,t,e));Gi.exports=Ec});var Nt=z((xd,ki)=>{"use strict";var wc=Ie(),Oc=(r,e,t)=>wc(r,e,t)>0;ki.exports=Oc});var Zt=z((Rd,Hi)=>{"use strict";var Ac=Ie(),_c=(r,e,t)=>Ac(r,e,t)<0;Hi.exports=_c});var Lr=z((vd,Vi)=>{"use strict";var Sc=Ie(),Cc=(r,e,t)=>Sc(r,e,t)===0;Vi.exports=Cc});var Nr=z((jd,Bi)=>{"use strict";var xc=Ie(),Rc=(r,e,t)=>xc(r,e,t)!==0;Bi.exports=Rc});var er=z(($d,Yi)=>{"use strict";var vc=Ie(),jc=(r,e,t)=>vc(r,e,t)>=0;Yi.exports=jc});var tr=z((Id,Ki)=>{"use strict";var $c=Ie(),Ic=(r,e,t)=>$c(r,e,t)<=0;Ki.exports=Ic});var Tr=z((Pd,Xi)=>{"use strict";var Pc=Lr(),Lc=Nr(),Nc=Nt(),Tc=er(),qc=Zt(),Dc=tr(),Mc=(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 Pc(r,t,n);case"!=":return Lc(r,t,n);case">":return Nc(r,t,n);case">=":return Tc(r,t,n);case"<":return qc(r,t,n);case"<=":return Dc(r,t,n);default:throw new TypeError(`Invalid operator: ${e}`)}};Xi.exports=Mc});var Qi=z((Ld,Ji)=>{"use strict";var Fc=me(),zc=Qe(),{safeRe:rr,t:nr}=Ot(),Uc=(r,e)=>{if(r instanceof Fc)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?rr[nr.COERCEFULL]:rr[nr.COERCE]);else{let u=e.includePrerelease?rr[nr.COERCERTLFULL]:rr[nr.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]}`:"",c=e.includePrerelease&&t[6]?`+${t[6]}`:"";return zc(`${n}.${i}.${s}${o}${c}`,e)};Ji.exports=Uc});var es=z((Nd,Zi)=>{"use strict";var Gc=Qe(),Wc=wt(),kc=me(),Hc=(r,e,t)=>{if(!Wc.RELEASE_TYPES.includes(e))return null;let n=Vc(r,t);return n&&Bc(n,e)},Vc=(r,e)=>{let t=r instanceof kc?r.version:r;return Gc(t,e)},Bc=(r,e)=>{if(Yc(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()},Yc=r=>r.startsWith("pre");Zi.exports=Hc});var rs=z((Td,ts)=>{"use strict";var qr=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}};ts.exports=qr});var Pe=z((qd,os)=>{"use strict";var Kc=/\s+/g,Dr=class r{constructor(e,t){if(t=Jc(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof Mr)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(Kc," "),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=>!is(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&&ol(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(sl,"");let n=((this.options.includePrerelease&&nl)|(this.options.loose&&il))+":"+e,i=ns.get(n);if(i)return i;let s=this.options.loose,o=s?Oe[ge.HYPHENRANGELOOSE]:Oe[ge.HYPHENRANGE];e=e.replace(o,yl(this.options.includePrerelease)),te("hyphen replace",e),e=e.replace(Oe[ge.COMPARATORTRIM],el),te("comparator trim",e),e=e.replace(Oe[ge.TILDETRIM],tl),te("tilde trim",e),e=e.replace(Oe[ge.CARETTRIM],rl),te("caret trim",e);let c=e.split(" ").map(l=>al(l,this.options)).join(" ").split(/\s+/).map(l=>gl(l,this.options));s&&(c=c.filter(l=>(te("loose invalid filter",l,this.options),!!l.match(Oe[ge.COMPARATORLOOSE])))),te("range list",c);let u=new Map,p=c.map(l=>new Mr(l,this.options));for(let l of p){if(is(l))return[l];u.set(l.value,l)}u.size>1&&u.has("")&&u.delete("");let h=[...u.values()];return ns.set(n,h),h}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>ss(n,t)&&e.set.some(i=>ss(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 Qc(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(bl(this.set[t],e,this.options))return!0;return!1}};os.exports=Dr;var Xc=rs(),ns=new Xc,Jc=Bt(),Mr=Tt(),te=Lt(),Qc=me(),{safeRe:Oe,src:Zc,t:ge,comparatorTrimReplace:el,tildeTrimReplace:tl,caretTrimReplace:rl}=Ot(),{FLAG_INCLUDE_PRERELEASE:nl,FLAG_LOOSE:il}=wt(),sl=new RegExp(Zc[ge.BUILD],"g"),is=r=>r.value==="<0.0.0-0",ol=r=>r.value==="",ss=(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},al=(r,e)=>(r=r.replace(Oe[ge.BUILD],""),te("comp",r,e),r=fl(r,e),te("caret",r),r=ll(r,e),te("tildes",r),r=pl(r,e),te("xrange",r),r=ml(r,e),te("stars",r),r),de=r=>!r||r.toLowerCase()==="x"||r==="*",cl=(r,e,t)=>de(r)&&!de(e)||de(e)&&t&&!de(t),ll=(r,e)=>r.trim().split(/\s+/).map(t=>ul(t,e)).join(" "),ul=(r,e)=>{let t=e.loose?Oe[ge.TILDELOOSE]:Oe[ge.TILDE],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,c,u)=>{te("tilde",r,i,s,o,c,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(c)?p=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:u?(te("replaceTilde pr",u),p=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`):p=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`,te("tilde return",p),p})},fl=(r,e)=>r.trim().split(/\s+/).map(t=>dl(t,e)).join(" "),dl=(r,e)=>{te("caret",r,e);let t=e.loose?Oe[ge.CARETLOOSE]:Oe[ge.CARET],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,c,u)=>{te("caret",r,i,s,o,c,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(c)?s==="0"?p=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`:u?(te("replaceCaret pr",u),s==="0"?o==="0"?p=`>=${s}.${o}.${c}-${u} <${s}.${o}.${+c+1}-0`:p=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${c}-${u} <${+s+1}.0.0-0`):(te("no pr"),s==="0"?o==="0"?p=`>=${s}.${o}.${c} <${s}.${o}.${+c+1}-0`:p=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${c} <${+s+1}.0.0-0`),te("caret return",p),p})},pl=(r,e)=>(te("replaceXRanges",r,e),r.split(/\s+/).map(t=>hl(t,e)).join(" ")),hl=(r,e)=>{r=r.trim();let t=e.loose?Oe[ge.XRANGELOOSE]:Oe[ge.XRANGE];return r.replace(t,(n,i,s,o,c,u)=>{if(te("xRange",r,n,i,s,o,c,u),cl(s,o,c))return r;let p=de(s),h=p||de(o),l=h||de(c),b=l;return i==="="&&b&&(i=""),u=e.includePrerelease?"-0":"",p?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&b?(h&&(o=0),c=0,i===">"?(i=">=",h?(s=+s+1,o=0,c=0):(o=+o+1,c=0)):i==="<="&&(i="<",h?s=+s+1:o=+o+1),i==="<"&&(u="-0"),n=`${i+s}.${o}.${c}${u}`):h?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:l&&(n=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`),te("xRange return",n),n})},ml=(r,e)=>(te("replaceStars",r,e),r.trim().replace(Oe[ge.STAR],"")),gl=(r,e)=>(te("replaceGTE0",r,e),r.trim().replace(Oe[e.includePrerelease?ge.GTE0PRE:ge.GTE0],"")),yl=r=>(e,t,n,i,s,o,c,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()),bl=(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(te(r[n].semver),r[n].semver!==Mr.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 Tt=z((Dd,ds)=>{"use strict";var qt=Symbol("SemVer ANY"),Ur=class r{static get ANY(){return qt}constructor(e,t){if(t=as(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),zr("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===qt?this.value="":this.value=this.operator+this.semver.version,zr("comp",this)}parse(e){let t=this.options.loose?cs[ls.COMPARATORLOOSE]:cs[ls.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 us(n[2],this.options.loose):this.semver=qt}toString(){return this.value}test(e){if(zr("Comparator.test",e,this.options.loose),this.semver===qt||e===qt)return!0;if(typeof e=="string")try{e=new us(e,this.options)}catch{return!1}return Fr(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 fs(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new fs(this.value,t).test(e.semver):(t=as(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("=")||Fr(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Fr(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};ds.exports=Ur;var as=Bt(),{safeRe:cs,t:ls}=Ot(),Fr=Tr(),zr=Lt(),us=me(),fs=Pe()});var Dt=z((Md,ps)=>{"use strict";var El=Pe(),wl=(r,e,t)=>{try{e=new El(e,t)}catch{return!1}return e.test(r)};ps.exports=wl});var ms=z((Fd,hs)=>{"use strict";var Ol=Pe(),Al=(r,e)=>new Ol(r,e).set.map(t=>t.map(n=>n.value).join(" ").trim().split(" "));hs.exports=Al});var ys=z((zd,gs)=>{"use strict";var _l=me(),Sl=Pe(),Cl=(r,e,t)=>{let n=null,i=null,s=null;try{s=new Sl(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new _l(n,t))}),n};gs.exports=Cl});var Es=z((Ud,bs)=>{"use strict";var xl=me(),Rl=Pe(),vl=(r,e,t)=>{let n=null,i=null,s=null;try{s=new Rl(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new xl(n,t))}),n};bs.exports=vl});var As=z((Gd,Os)=>{"use strict";var Gr=me(),jl=Pe(),ws=Nt(),$l=(r,e)=>{r=new jl(r,e);let t=new Gr("0.0.0");if(r.test(t)||(t=new Gr("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 c=new Gr(o.semver.version);switch(o.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!s||ws(c,s))&&(s=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||ws(t,s))&&(t=s)}return t&&r.test(t)?t:null};Os.exports=$l});var Ss=z((Wd,_s)=>{"use strict";var Il=Pe(),Pl=(r,e)=>{try{return new Il(r,e).range||"*"}catch{return null}};_s.exports=Pl});var ir=z((kd,vs)=>{"use strict";var Ll=me(),Rs=Tt(),{ANY:Nl}=Rs,Tl=Pe(),ql=Dt(),Cs=Nt(),xs=Zt(),Dl=tr(),Ml=er(),Fl=(r,e,t,n)=>{r=new Ll(r,n),e=new Tl(e,n);let i,s,o,c,u;switch(t){case">":i=Cs,s=Dl,o=xs,c=">",u=">=";break;case"<":i=xs,s=Ml,o=Cs,c="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ql(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===Nl&&(m=new Rs(">=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===c||l.operator===u||(!b.operator||b.operator===c)&&s(r,b.semver))return!1;if(b.operator===u&&o(r,b.semver))return!1}return!0};vs.exports=Fl});var $s=z((Hd,js)=>{"use strict";var zl=ir(),Ul=(r,e,t)=>zl(r,e,">",t);js.exports=Ul});var Ps=z((Vd,Is)=>{"use strict";var Gl=ir(),Wl=(r,e,t)=>Gl(r,e,"<",t);Is.exports=Wl});var Ts=z((Bd,Ns)=>{"use strict";var Ls=Pe(),kl=(r,e,t)=>(r=new Ls(r,t),e=new Ls(e,t),r.intersects(e,t));Ns.exports=kl});var Ds=z((Yd,qs)=>{"use strict";var Hl=Dt(),Vl=Ie();qs.exports=(r,e,t)=>{let n=[],i=null,s=null,o=r.sort((h,l)=>Vl(h,l,t));for(let h of o)Hl(h,e,t)?(s=h,i||(i=h)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let c=[];for(let[h,l]of n)h===l?c.push(h):!l&&h===o[0]?c.push("*"):l?h===o[0]?c.push(`<=${l}`):c.push(`${h} - ${l}`):c.push(`>=${h}`);let u=c.join(" || "),p=typeof e.raw=="string"?e.raw:String(e);return u.length<p.length?u:e}});var Ws=z((Kd,Gs)=>{"use strict";var Ms=Pe(),Hr=Tt(),{ANY:Wr}=Hr,kr=Dt(),Vr=Ie(),Bl=(r,e,t={})=>{if(r===e)return!0;r=new Ms(r,t),e=new Ms(e,t);let n=!1;e:for(let i of r.set){for(let s of e.set){let o=Kl(i,s,t);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},Yl=[new Hr(">=0.0.0-0")],Fs=[new Hr(">=0.0.0")],Kl=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===Wr){if(e.length===1&&e[0].semver===Wr)return!0;t.includePrerelease?r=Yl:r=Fs}if(e.length===1&&e[0].semver===Wr){if(t.includePrerelease)return!0;e=Fs}let n=new Set,i,s;for(let m of r)m.operator===">"||m.operator===">="?i=zs(i,m,t):m.operator==="<"||m.operator==="<="?s=Us(s,m,t):n.add(m.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Vr(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&&!kr(m,String(i),t)||s&&!kr(m,String(s),t))return null;for(let w of e)if(!kr(m,String(w),t))return!1;return!0}let c,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(c=zs(i,m,t),c===m&&c!==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=Us(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)},zs=(r,e,t)=>{if(!r)return e;let n=Vr(r.semver,e.semver,t);return n>0?r:n<0||e.operator===">"&&r.operator===">="?e:r},Us=(r,e,t)=>{if(!r)return e;let n=Vr(r.semver,e.semver,t);return n<0?r:n>0||e.operator==="<"&&r.operator==="<="?e:r};Gs.exports=Bl});var sr=z((Xd,Vs)=>{"use strict";var Br=Ot(),ks=wt(),Xl=me(),Hs=$r(),Jl=Qe(),Ql=mi(),Zl=yi(),eu=wi(),tu=_i(),ru=Ci(),nu=Ri(),iu=ji(),su=Ii(),ou=Ie(),au=Ti(),cu=Di(),lu=Qt(),uu=Ui(),fu=Wi(),du=Nt(),pu=Zt(),hu=Lr(),mu=Nr(),gu=er(),yu=tr(),bu=Tr(),Eu=Qi(),wu=es(),Ou=Tt(),Au=Pe(),_u=Dt(),Su=ms(),Cu=ys(),xu=Es(),Ru=As(),vu=Ss(),ju=ir(),$u=$s(),Iu=Ps(),Pu=Ts(),Lu=Ds(),Nu=Ws();Vs.exports={parse:Jl,valid:Ql,clean:Zl,inc:eu,diff:tu,major:ru,minor:nu,patch:iu,prerelease:su,compare:ou,rcompare:au,compareLoose:cu,compareBuild:lu,sort:uu,rsort:fu,gt:du,lt:pu,eq:hu,neq:mu,gte:gu,lte:yu,cmp:bu,coerce:Eu,truncate:wu,Comparator:Ou,Range:Au,satisfies:_u,toComparators:Su,maxSatisfying:Cu,minSatisfying:xu,minVersion:Ru,validRange:vu,outside:ju,gtr:$u,ltr:Iu,intersects:Pu,simplifyRange:Lu,subset:Nu,SemVer:Xl,re:Br.re,src:Br.src,tokens:Br.t,SEMVER_SPEC_VERSION:ks.SEMVER_SPEC_VERSION,RELEASE_TYPES:ks.RELEASE_TYPES,compareIdentifiers:Hs.compareIdentifiers,rcompareIdentifiers:Hs.rcompareIdentifiers}});var Bs=Pt(sr(),1);import*as Yr from"node:process";try{let r=Hn?.node;typeof r=="string"&&!Bs.satisfies(Yr.version,r)&&ne.warn(`
|
|
9
|
-
\u26A0\uFE0F Warning: failed to satisfy expected node version. Expected: "${r}", Current "${
|
|
8
|
+
import{a as Pa,b as ri,c as ni}from"./chunks/GHSNC2OX.js";import{a as Jn,f as te}from"./chunks/U5DIFWGH.js";import{c as Qn}from"./chunks/4PTNG4EI.js";import{a as ei}from"./chunks/R5A3H7N2.js";import{a as ii}from"./chunks/X5U3XCIW.js";import{a as Zn}from"./chunks/N6VRECSO.js";import{a as La}from"./chunks/LRUXN6H5.js";import{a as ti,c as Yt,d as $r,e as si,g as oi}from"./chunks/TZMWTSOQ.js";import{a as Fe,b as Kn,c as Xn}from"./chunks/EPFKYDYC.js";import{N as Gn,Q as kn,_ as Ht,a as zn,c as we,ca as jr,ga as X,ha as Vt,ia as Wn,l as vr,ma as Oe,na as Bt,qa as Hn,t as Un,ta as Vn,ua as Bn,za as Yn}from"./chunks/MT5H2R3P.js";import"./chunks/NEWT5A6S.js";import{a as Ue,c as z,e as Pt}from"./chunks/RFWIIJFG.js";var wt=z((pd,ai)=>{"use strict";var Na="2.0.0",Ta=Number.MAX_SAFE_INTEGER||9007199254740991,Da=16,qa=250,Ma=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ai.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Da,MAX_SAFE_BUILD_LENGTH:qa,MAX_SAFE_INTEGER:Ta,RELEASE_TYPES:Ma,SEMVER_SPEC_VERSION:Na,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Lt=z((hd,ci)=>{"use strict";var Fa=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};ci.exports=Fa});var Ot=z((Ge,li)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Ir,MAX_SAFE_BUILD_LENGTH:za,MAX_LENGTH:Ua}=wt(),Ga=Lt();Ge=li.exports={};var ka=Ge.re=[],Wa=Ge.safeRe=[],C=Ge.src=[],Ha=Ge.safeSrc=[],x=Ge.t={},Va=0,Pr="[a-zA-Z0-9-]",Ba=[["\\s",1],["\\d",Ua],[Pr,za]],Ya=r=>{for(let[e,t]of Ba)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},k=(r,e,t)=>{let n=Ya(e),i=Va++;Ga(r,i,e),x[r]=i,C[i]=e,Ha[i]=n,ka[i]=new RegExp(e,t?"g":void 0),Wa[i]=new RegExp(n,t?"g":void 0)};k("NUMERICIDENTIFIER","0|[1-9]\\d*");k("NUMERICIDENTIFIERLOOSE","\\d+");k("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Pr}*`);k("MAINVERSION",`(${C[x.NUMERICIDENTIFIER]})\\.(${C[x.NUMERICIDENTIFIER]})\\.(${C[x.NUMERICIDENTIFIER]})`);k("MAINVERSIONLOOSE",`(${C[x.NUMERICIDENTIFIERLOOSE]})\\.(${C[x.NUMERICIDENTIFIERLOOSE]})\\.(${C[x.NUMERICIDENTIFIERLOOSE]})`);k("PRERELEASEIDENTIFIER",`(?:${C[x.NONNUMERICIDENTIFIER]}|${C[x.NUMERICIDENTIFIER]})`);k("PRERELEASEIDENTIFIERLOOSE",`(?:${C[x.NONNUMERICIDENTIFIER]}|${C[x.NUMERICIDENTIFIERLOOSE]})`);k("PRERELEASE",`(?:-(${C[x.PRERELEASEIDENTIFIER]}(?:\\.${C[x.PRERELEASEIDENTIFIER]})*))`);k("PRERELEASELOOSE",`(?:-?(${C[x.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${C[x.PRERELEASEIDENTIFIERLOOSE]})*))`);k("BUILDIDENTIFIER",`${Pr}+`);k("BUILD",`(?:\\+(${C[x.BUILDIDENTIFIER]}(?:\\.${C[x.BUILDIDENTIFIER]})*))`);k("FULLPLAIN",`v?${C[x.MAINVERSION]}${C[x.PRERELEASE]}?${C[x.BUILD]}?`);k("FULL",`^${C[x.FULLPLAIN]}$`);k("LOOSEPLAIN",`[v=\\s]*${C[x.MAINVERSIONLOOSE]}${C[x.PRERELEASELOOSE]}?${C[x.BUILD]}?`);k("LOOSE",`^${C[x.LOOSEPLAIN]}$`);k("GTLT","((?:<|>)?=?)");k("XRANGEIDENTIFIERLOOSE",`${C[x.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);k("XRANGEIDENTIFIER",`${C[x.NUMERICIDENTIFIER]}|x|X|\\*`);k("XRANGEPLAIN",`[v=\\s]*(${C[x.XRANGEIDENTIFIER]})(?:\\.(${C[x.XRANGEIDENTIFIER]})(?:\\.(${C[x.XRANGEIDENTIFIER]})(?:${C[x.PRERELEASE]})?${C[x.BUILD]}?)?)?`);k("XRANGEPLAINLOOSE",`[v=\\s]*(${C[x.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[x.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[x.XRANGEIDENTIFIERLOOSE]})(?:${C[x.PRERELEASELOOSE]})?${C[x.BUILD]}?)?)?`);k("XRANGE",`^${C[x.GTLT]}\\s*${C[x.XRANGEPLAIN]}$`);k("XRANGELOOSE",`^${C[x.GTLT]}\\s*${C[x.XRANGEPLAINLOOSE]}$`);k("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Ir}})(?:\\.(\\d{1,${Ir}}))?(?:\\.(\\d{1,${Ir}}))?`);k("COERCE",`${C[x.COERCEPLAIN]}(?:$|[^\\d])`);k("COERCEFULL",C[x.COERCEPLAIN]+`(?:${C[x.PRERELEASE]})?(?:${C[x.BUILD]})?(?:$|[^\\d])`);k("COERCERTL",C[x.COERCE],!0);k("COERCERTLFULL",C[x.COERCEFULL],!0);k("LONETILDE","(?:~>?)");k("TILDETRIM",`(\\s*)${C[x.LONETILDE]}\\s+`,!0);Ge.tildeTrimReplace="$1~";k("TILDE",`^${C[x.LONETILDE]}${C[x.XRANGEPLAIN]}$`);k("TILDELOOSE",`^${C[x.LONETILDE]}${C[x.XRANGEPLAINLOOSE]}$`);k("LONECARET","(?:\\^)");k("CARETTRIM",`(\\s*)${C[x.LONECARET]}\\s+`,!0);Ge.caretTrimReplace="$1^";k("CARET",`^${C[x.LONECARET]}${C[x.XRANGEPLAIN]}$`);k("CARETLOOSE",`^${C[x.LONECARET]}${C[x.XRANGEPLAINLOOSE]}$`);k("COMPARATORLOOSE",`^${C[x.GTLT]}\\s*(${C[x.LOOSEPLAIN]})$|^$`);k("COMPARATOR",`^${C[x.GTLT]}\\s*(${C[x.FULLPLAIN]})$|^$`);k("COMPARATORTRIM",`(\\s*)${C[x.GTLT]}\\s*(${C[x.LOOSEPLAIN]}|${C[x.XRANGEPLAIN]})`,!0);Ge.comparatorTrimReplace="$1$2$3";k("HYPHENRANGE",`^\\s*(${C[x.XRANGEPLAIN]})\\s+-\\s+(${C[x.XRANGEPLAIN]})\\s*$`);k("HYPHENRANGELOOSE",`^\\s*(${C[x.XRANGEPLAINLOOSE]})\\s+-\\s+(${C[x.XRANGEPLAINLOOSE]})\\s*$`);k("STAR","(<|>)?=?\\s*\\*");k("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");k("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Kt=z((md,ui)=>{"use strict";var Ka=Object.freeze({loose:!0}),Xa=Object.freeze({}),Ja=r=>r?typeof r!="object"?Ka:r:Xa;ui.exports=Ja});var Lr=z((gd,pi)=>{"use strict";var fi=/^[0-9]+$/,di=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=fi.test(r),n=fi.test(e);return t&&n&&(r=+r,e=+e),r===e?0:t&&!n?-1:n&&!t?1:r<e?-1:1},Qa=(r,e)=>di(e,r);pi.exports={compareIdentifiers:di,rcompareIdentifiers:Qa}});var me=z((yd,mi)=>{"use strict";var Xt=Lt(),{MAX_LENGTH:hi,MAX_SAFE_INTEGER:Jt}=wt(),{safeRe:Qt,t:Zt}=Ot(),Za=Kt(),{compareIdentifiers:Nr}=Lr(),ec=(r,e)=>{let t=e.split(".");if(t.length>r.length)return!1;for(let n=0;n<t.length;n++)if(Nr(r[n],t[n])!==0)return!1;return!0},Tr=class r{constructor(e,t){if(t=Za(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>hi)throw new TypeError(`version is longer than ${hi} characters`);Xt("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?Qt[Zt.LOOSE]:Qt[Zt.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>Jt||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Jt||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Jt||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<Jt)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(Xt("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(Xt("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 Nr(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(Xt("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 Nr(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?Qt[Zt.PRERELEASELOOSE]:Qt[Zt.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]),ec(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}};mi.exports=Tr});var Qe=z((bd,yi)=>{"use strict";var gi=me(),tc=(r,e,t=!1)=>{if(r instanceof gi)return r;try{return new gi(r,e)}catch(n){if(!t)return null;throw n}};yi.exports=tc});var Ei=z((Ed,bi)=>{"use strict";var rc=Qe(),nc=(r,e)=>{let t=rc(r,e);return t?t.version:null};bi.exports=nc});var Oi=z((wd,wi)=>{"use strict";var ic=Qe(),sc=(r,e)=>{let t=ic(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};wi.exports=sc});var Si=z((Od,_i)=>{"use strict";var Ai=me(),oc=(r,e,t,n,i)=>{typeof t=="string"&&(i=n,n=t,t=void 0);try{return new Ai(r instanceof Ai?r.version:r,t).inc(e,n,i).version}catch{return null}};_i.exports=oc});var Ri=z((Ad,xi)=>{"use strict";var Ci=Qe(),ac=(r,e)=>{let t=Ci(r,null,!0),n=Ci(e,null,!0),i=t.compare(n);if(i===0)return null;let s=i>0,o=s?t:n,c=s?n:t,u=!!o.prerelease.length;if(!!c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(c.compareMain(o)===0)return c.minor&&!c.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"};xi.exports=ac});var ji=z((_d,vi)=>{"use strict";var cc=me(),lc=(r,e)=>new cc(r,e).major;vi.exports=lc});var Ii=z((Sd,$i)=>{"use strict";var uc=me(),fc=(r,e)=>new uc(r,e).minor;$i.exports=fc});var Li=z((Cd,Pi)=>{"use strict";var dc=me(),pc=(r,e)=>new dc(r,e).patch;Pi.exports=pc});var Ti=z((xd,Ni)=>{"use strict";var hc=Qe(),mc=(r,e)=>{let t=hc(r,e);return t&&t.prerelease.length?t.prerelease:null};Ni.exports=mc});var Ie=z((Rd,qi)=>{"use strict";var Di=me(),gc=(r,e,t)=>new Di(r,t).compare(new Di(e,t));qi.exports=gc});var Fi=z((vd,Mi)=>{"use strict";var yc=Ie(),bc=(r,e,t)=>yc(e,r,t);Mi.exports=bc});var Ui=z((jd,zi)=>{"use strict";var Ec=Ie(),wc=(r,e)=>Ec(r,e,!0);zi.exports=wc});var er=z(($d,ki)=>{"use strict";var Gi=me(),Oc=(r,e,t)=>{let n=new Gi(r,t),i=new Gi(e,t);return n.compare(i)||n.compareBuild(i)};ki.exports=Oc});var Hi=z((Id,Wi)=>{"use strict";var Ac=er(),_c=(r,e)=>r.sort((t,n)=>Ac(t,n,e));Wi.exports=_c});var Bi=z((Pd,Vi)=>{"use strict";var Sc=er(),Cc=(r,e)=>r.sort((t,n)=>Sc(n,t,e));Vi.exports=Cc});var Nt=z((Ld,Yi)=>{"use strict";var xc=Ie(),Rc=(r,e,t)=>xc(r,e,t)>0;Yi.exports=Rc});var tr=z((Nd,Ki)=>{"use strict";var vc=Ie(),jc=(r,e,t)=>vc(r,e,t)<0;Ki.exports=jc});var Dr=z((Td,Xi)=>{"use strict";var $c=Ie(),Ic=(r,e,t)=>$c(r,e,t)===0;Xi.exports=Ic});var qr=z((Dd,Ji)=>{"use strict";var Pc=Ie(),Lc=(r,e,t)=>Pc(r,e,t)!==0;Ji.exports=Lc});var rr=z((qd,Qi)=>{"use strict";var Nc=Ie(),Tc=(r,e,t)=>Nc(r,e,t)>=0;Qi.exports=Tc});var nr=z((Md,Zi)=>{"use strict";var Dc=Ie(),qc=(r,e,t)=>Dc(r,e,t)<=0;Zi.exports=qc});var Mr=z((Fd,es)=>{"use strict";var Mc=Dr(),Fc=qr(),zc=Nt(),Uc=rr(),Gc=tr(),kc=nr(),Wc=(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 Mc(r,t,n);case"!=":return Fc(r,t,n);case">":return zc(r,t,n);case">=":return Uc(r,t,n);case"<":return Gc(r,t,n);case"<=":return kc(r,t,n);default:throw new TypeError(`Invalid operator: ${e}`)}};es.exports=Wc});var rs=z((zd,ts)=>{"use strict";var Hc=me(),Vc=Qe(),{safeRe:ir,t:sr}=Ot(),Bc=(r,e)=>{if(r instanceof Hc)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?ir[sr.COERCEFULL]:ir[sr.COERCE]);else{let u=e.includePrerelease?ir[sr.COERCERTLFULL]:ir[sr.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]}`:"",c=e.includePrerelease&&t[6]?`+${t[6]}`:"";return Vc(`${n}.${i}.${s}${o}${c}`,e)};ts.exports=Bc});var is=z((Ud,ns)=>{"use strict";var Yc=Qe(),Kc=wt(),Xc=me(),Jc=(r,e,t)=>{if(!Kc.RELEASE_TYPES.includes(e))return null;let n=Qc(r,t);return n&&Zc(n,e)},Qc=(r,e)=>{let t=r instanceof Xc?r.version:r;return Yc(t,e)},Zc=(r,e)=>{if(el(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()},el=r=>r.startsWith("pre");ns.exports=Jc});var os=z((Gd,ss)=>{"use strict";var Fr=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}};ss.exports=Fr});var Pe=z((kd,us)=>{"use strict";var tl=/\s+/g,zr=class r{constructor(e,t){if(t=nl(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof Ur)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(tl," "),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=>!cs(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&&dl(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(fl,"");let n=((this.options.includePrerelease&&ll)|(this.options.loose&&ul))+":"+e,i=as.get(n);if(i)return i;let s=this.options.loose,o=s?Ae[ge.HYPHENRANGELOOSE]:Ae[ge.HYPHENRANGE];e=e.replace(o,_l(this.options.includePrerelease)),re("hyphen replace",e),e=e.replace(Ae[ge.COMPARATORTRIM],ol),re("comparator trim",e),e=e.replace(Ae[ge.TILDETRIM],al),re("tilde trim",e),e=e.replace(Ae[ge.CARETTRIM],cl),re("caret trim",e);let c=e.split(" ").map(l=>pl(l,this.options)).join(" ").split(/\s+/).map(l=>Al(l,this.options));s&&(c=c.filter(l=>(re("loose invalid filter",l,this.options),!!l.match(Ae[ge.COMPARATORLOOSE])))),re("range list",c);let u=new Map,p=c.map(l=>new Ur(l,this.options));for(let l of p){if(cs(l))return[l];u.set(l.value,l)}u.size>1&&u.has("")&&u.delete("");let h=[...u.values()];return as.set(n,h),h}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>ls(n,t)&&e.set.some(i=>ls(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 il(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(Sl(this.set[t],e,this.options))return!0;return!1}};us.exports=zr;var rl=os(),as=new rl,nl=Kt(),Ur=Tt(),re=Lt(),il=me(),{safeRe:Ae,src:sl,t:ge,comparatorTrimReplace:ol,tildeTrimReplace:al,caretTrimReplace:cl}=Ot(),{FLAG_INCLUDE_PRERELEASE:ll,FLAG_LOOSE:ul}=wt(),fl=new RegExp(sl[ge.BUILD],"g"),cs=r=>r.value==="<0.0.0-0",dl=r=>r.value==="",ls=(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},pl=(r,e)=>(r=r.replace(Ae[ge.BUILD],""),re("comp",r,e),r=yl(r,e),re("caret",r),r=ml(r,e),re("tildes",r),r=El(r,e),re("xrange",r),r=Ol(r,e),re("stars",r),r),de=r=>!r||r.toLowerCase()==="x"||r==="*",hl=(r,e,t)=>de(r)&&!de(e)||de(e)&&t&&!de(t),ml=(r,e)=>r.trim().split(/\s+/).map(t=>gl(t,e)).join(" "),gl=(r,e)=>{let t=e.loose?Ae[ge.TILDELOOSE]:Ae[ge.TILDE],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,c,u)=>{re("tilde",r,i,s,o,c,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(c)?p=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:u?(re("replaceTilde pr",u),p=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`):p=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`,re("tilde return",p),p})},yl=(r,e)=>r.trim().split(/\s+/).map(t=>bl(t,e)).join(" "),bl=(r,e)=>{re("caret",r,e);let t=e.loose?Ae[ge.CARETLOOSE]:Ae[ge.CARET],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,c,u)=>{re("caret",r,i,s,o,c,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(c)?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}.${c}-${u} <${s}.${o}.${+c+1}-0`:p=`>=${s}.${o}.${c}-${u} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${c}-${u} <${+s+1}.0.0-0`):(re("no pr"),s==="0"?o==="0"?p=`>=${s}.${o}.${c} <${s}.${o}.${+c+1}-0`:p=`>=${s}.${o}.${c} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${c} <${+s+1}.0.0-0`),re("caret return",p),p})},El=(r,e)=>(re("replaceXRanges",r,e),r.split(/\s+/).map(t=>wl(t,e)).join(" ")),wl=(r,e)=>{r=r.trim();let t=e.loose?Ae[ge.XRANGELOOSE]:Ae[ge.XRANGE];return r.replace(t,(n,i,s,o,c,u)=>{if(re("xRange",r,n,i,s,o,c,u),hl(s,o,c))return r;let p=de(s),h=p||de(o),l=h||de(c),b=l;return i==="="&&b&&(i=""),u=e.includePrerelease?"-0":"",p?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&b?(h&&(o=0),c=0,i===">"?(i=">=",h?(s=+s+1,o=0,c=0):(o=+o+1,c=0)):i==="<="&&(i="<",h?s=+s+1:o=+o+1),i==="<"&&(u="-0"),n=`${i+s}.${o}.${c}${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})},Ol=(r,e)=>(re("replaceStars",r,e),r.trim().replace(Ae[ge.STAR],"")),Al=(r,e)=>(re("replaceGTE0",r,e),r.trim().replace(Ae[e.includePrerelease?ge.GTE0PRE:ge.GTE0],"")),_l=r=>(e,t,n,i,s,o,c,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()),Sl=(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!==Ur.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 Tt=z((Wd,gs)=>{"use strict";var Dt=Symbol("SemVer ANY"),Wr=class r{static get ANY(){return Dt}constructor(e,t){if(t=fs(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===Dt?this.value="":this.value=this.operator+this.semver.version,kr("comp",this)}parse(e){let t=this.options.loose?ds[ps.COMPARATORLOOSE]:ds[ps.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 hs(n[2],this.options.loose):this.semver=Dt}toString(){return this.value}test(e){if(kr("Comparator.test",e,this.options.loose),this.semver===Dt||e===Dt)return!0;if(typeof e=="string")try{e=new hs(e,this.options)}catch{return!1}return Gr(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 ms(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new ms(this.value,t).test(e.semver):(t=fs(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("=")||Gr(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Gr(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};gs.exports=Wr;var fs=Kt(),{safeRe:ds,t:ps}=Ot(),Gr=Mr(),kr=Lt(),hs=me(),ms=Pe()});var qt=z((Hd,ys)=>{"use strict";var Cl=Pe(),xl=(r,e,t)=>{try{e=new Cl(e,t)}catch{return!1}return e.test(r)};ys.exports=xl});var Es=z((Vd,bs)=>{"use strict";var Rl=Pe(),vl=(r,e)=>new Rl(r,e).set.map(t=>t.map(n=>n.value).join(" ").trim().split(" "));bs.exports=vl});var Os=z((Bd,ws)=>{"use strict";var jl=me(),$l=Pe(),Il=(r,e,t)=>{let n=null,i=null,s=null;try{s=new $l(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new jl(n,t))}),n};ws.exports=Il});var _s=z((Yd,As)=>{"use strict";var Pl=me(),Ll=Pe(),Nl=(r,e,t)=>{let n=null,i=null,s=null;try{s=new Ll(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Pl(n,t))}),n};As.exports=Nl});var xs=z((Kd,Cs)=>{"use strict";var Hr=me(),Tl=Pe(),Ss=Nt(),Dl=(r,e)=>{r=new Tl(r,e);let t=new Hr("0.0.0");if(r.test(t)||(t=new Hr("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 c=new Hr(o.semver.version);switch(o.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!s||Ss(c,s))&&(s=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||Ss(t,s))&&(t=s)}return t&&r.test(t)?t:null};Cs.exports=Dl});var vs=z((Xd,Rs)=>{"use strict";var ql=Pe(),Ml=(r,e)=>{try{return new ql(r,e).range||"*"}catch{return null}};Rs.exports=Ml});var or=z((Jd,Ps)=>{"use strict";var Fl=me(),Is=Tt(),{ANY:zl}=Is,Ul=Pe(),Gl=qt(),js=Nt(),$s=tr(),kl=nr(),Wl=rr(),Hl=(r,e,t,n)=>{r=new Fl(r,n),e=new Ul(e,n);let i,s,o,c,u;switch(t){case">":i=js,s=kl,o=$s,c=">",u=">=";break;case"<":i=$s,s=Wl,o=js,c="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Gl(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(g=>{g.semver===zl&&(g=new Is(">=0.0.0")),l=l||g,b=b||g,i(g.semver,l.semver,n)?l=g:o(g.semver,b.semver,n)&&(b=g)}),l.operator===c||l.operator===u||(!b.operator||b.operator===c)&&s(r,b.semver))return!1;if(b.operator===u&&o(r,b.semver))return!1}return!0};Ps.exports=Hl});var Ns=z((Qd,Ls)=>{"use strict";var Vl=or(),Bl=(r,e,t)=>Vl(r,e,">",t);Ls.exports=Bl});var Ds=z((Zd,Ts)=>{"use strict";var Yl=or(),Kl=(r,e,t)=>Yl(r,e,"<",t);Ts.exports=Kl});var Fs=z((ep,Ms)=>{"use strict";var qs=Pe(),Xl=(r,e,t)=>(r=new qs(r,t),e=new qs(e,t),r.intersects(e,t));Ms.exports=Xl});var Us=z((tp,zs)=>{"use strict";var Jl=qt(),Ql=Ie();zs.exports=(r,e,t)=>{let n=[],i=null,s=null,o=r.sort((h,l)=>Ql(h,l,t));for(let h of o)Jl(h,e,t)?(s=h,i||(i=h)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let c=[];for(let[h,l]of n)h===l?c.push(h):!l&&h===o[0]?c.push("*"):l?h===o[0]?c.push(`<=${l}`):c.push(`${h} - ${l}`):c.push(`>=${h}`);let u=c.join(" || "),p=typeof e.raw=="string"?e.raw:String(e);return u.length<p.length?u:e}});var Bs=z((rp,Vs)=>{"use strict";var Gs=Pe(),Yr=Tt(),{ANY:Vr}=Yr,Br=qt(),Kr=Ie(),Zl=(r,e,t={})=>{if(r===e)return!0;r=new Gs(r,t),e=new Gs(e,t);let n=!1;e:for(let i of r.set){for(let s of e.set){let o=tu(i,s,t);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},eu=[new Yr(">=0.0.0-0")],ks=[new Yr(">=0.0.0")],tu=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===Vr){if(e.length===1&&e[0].semver===Vr)return!0;t.includePrerelease?r=eu:r=ks}if(e.length===1&&e[0].semver===Vr){if(t.includePrerelease)return!0;e=ks}let n=new Set,i,s;for(let g of r)g.operator===">"||g.operator===">="?i=Ws(i,g,t):g.operator==="<"||g.operator==="<="?s=Hs(s,g,t):n.add(g.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Kr(i.semver,s.semver,t),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let g of n){if(i&&!Br(g,String(i),t)||s&&!Br(g,String(s),t))return null;for(let w of e)if(!Br(g,String(w),t))return!1;return!0}let c,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 g of e){if(h=h||g.operator===">"||g.operator===">=",p=p||g.operator==="<"||g.operator==="<=",i){if(b&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===b.major&&g.semver.minor===b.minor&&g.semver.patch===b.patch&&(b=!1),g.operator===">"||g.operator===">="){if(c=Ws(i,g,t),c===g&&c!==i)return!1}else if(i.operator===">="&&!g.test(i.semver))return!1}if(s){if(l&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===l.major&&g.semver.minor===l.minor&&g.semver.patch===l.patch&&(l=!1),g.operator==="<"||g.operator==="<="){if(u=Hs(s,g,t),u===g&&u!==s)return!1}else if(s.operator==="<="&&!g.test(s.semver))return!1}if(!g.operator&&(s||i)&&o!==0)return!1}return!(i&&p&&!s&&o!==0||s&&h&&!i&&o!==0||b||l)},Ws=(r,e,t)=>{if(!r)return e;let n=Kr(r.semver,e.semver,t);return n>0?r:n<0||e.operator===">"&&r.operator===">="?e:r},Hs=(r,e,t)=>{if(!r)return e;let n=Kr(r.semver,e.semver,t);return n<0?r:n>0||e.operator==="<"&&r.operator==="<="?e:r};Vs.exports=Zl});var ar=z((np,Xs)=>{"use strict";var Xr=Ot(),Ys=wt(),ru=me(),Ks=Lr(),nu=Qe(),iu=Ei(),su=Oi(),ou=Si(),au=Ri(),cu=ji(),lu=Ii(),uu=Li(),fu=Ti(),du=Ie(),pu=Fi(),hu=Ui(),mu=er(),gu=Hi(),yu=Bi(),bu=Nt(),Eu=tr(),wu=Dr(),Ou=qr(),Au=rr(),_u=nr(),Su=Mr(),Cu=rs(),xu=is(),Ru=Tt(),vu=Pe(),ju=qt(),$u=Es(),Iu=Os(),Pu=_s(),Lu=xs(),Nu=vs(),Tu=or(),Du=Ns(),qu=Ds(),Mu=Fs(),Fu=Us(),zu=Bs();Xs.exports={parse:nu,valid:iu,clean:su,inc:ou,diff:au,major:cu,minor:lu,patch:uu,prerelease:fu,compare:du,rcompare:pu,compareLoose:hu,compareBuild:mu,sort:gu,rsort:yu,gt:bu,lt:Eu,eq:wu,neq:Ou,gte:Au,lte:_u,cmp:Su,coerce:Cu,truncate:xu,Comparator:Ru,Range:vu,satisfies:ju,toComparators:$u,maxSatisfying:Iu,minSatisfying:Pu,minVersion:Lu,validRange:Nu,outside:Tu,gtr:Du,ltr:qu,intersects:Mu,simplifyRange:Fu,subset:zu,SemVer:ru,re:Xr.re,src:Xr.src,tokens:Xr.t,SEMVER_SPEC_VERSION:Ys.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ys.RELEASE_TYPES,compareIdentifiers:Ks.compareIdentifiers,rcompareIdentifiers:Ks.rcompareIdentifiers}});var Js=Pt(ar(),1);import*as Jr from"node:process";try{let r=Xn?.node;typeof r=="string"&&!Js.satisfies(Jr.version,r)&&X.warn(`
|
|
9
|
+
\u26A0\uFE0F Warning: failed to satisfy expected node version. Expected: "${r}", Current "${Jr.version}"
|
|
10
10
|
|
|
11
|
-
`)}catch{}var
|
|
11
|
+
`)}catch{}var $a=Pt(Pa(),1);import*as Ia from"node:path";import{notStrictEqual as ff,strictEqual as df}from"assert";var Uu={right:Vu,center:Bu},Gu=0,cr=1,ku=2,lr=3,Qr=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&&Re.stringWidth(i[0])>n&&(n=Math.min(Math.floor(this.width*.5),Re.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=Re.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,c)=>{let{width:u}=e[c],p=this.negatePadding(e[c]),h=o;if(p>Re.stringWidth(o)&&(h+=" ".repeat(p-Re.stringWidth(o))),e[c].align&&e[c].align!=="left"&&this.wrap){let b=
|
|
13
|
+
`)}rowToString(e,t){return this.rasterize(e).forEach((n,i)=>{let s="";n.forEach((o,c)=>{let{width:u}=e[c],p=this.negatePadding(e[c]),h=o;if(p>Re.stringWidth(o)&&(h+=" ".repeat(p-Re.stringWidth(o))),e[c].align&&e[c].align!=="left"&&this.wrap){let b=Uu[e[c].align];h=b(h,p),Re.stringWidth(h)<p&&(h+=" ".repeat((u||0)-Re.stringWidth(h)-1))}let l=e[c].padding||[0,0,0,0];l[lr]&&(s+=" ".repeat(l[lr])),s+=Qs(e[c],h,"| "),s+=h,s+=Qs(e[c],h," |"),l[cr]&&(s+=" ".repeat(l[cr])),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=Re.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=Re.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 Jr(r){return Ks(r,{stringWidth:e=>[...e].length,stripAnsi:Xr,wrap:Js})}import{dirname as Qs,resolve as Zs}from"path";import{readdirSync as Gu,statSync as Wu}from"fs";function eo(r,e){let t=Zs(".",r),n;for(Wu(t).isDirectory()||(t=Qs(t));;){if(n=e(t,Gu(t)),n)return Zs(t,n);if(t=Qs(n=t),n===t)break}}import{inspect as af}from"util";import{readFileSync as cf}from"fs";import{fileURLToPath as po}from"url";import{format as Hu}from"util";import{readFileSync as Vu}from"fs";import{normalize as Bu,resolve as Yu}from"path";function ot(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 cr(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 lr(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 to(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 Le;(function(r){r.BOOLEAN="boolean",r.STRING="string",r.NUMBER="number",r.ARRAY="array"})(Le||(Le={}));var Ve,ur=class{constructor(e){Ve=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=to(e),s=ku(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),c=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),w=n.__||Ve.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:[]},C=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,A=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(f){let g=typeof f=="object"?f.key:f,O=Object.keys(f).map(function(E){return{boolean:"bools",string:"strings",number:"numbers"}[E]}).filter(Boolean).pop();O&&(d[O][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)})),It(n.key,s,n.default,d.arrays),Object.keys(c).forEach(function(f){(d.aliases[f]||[]).forEach(function(g){c[g]=c[f]})});let S=null;Cr();let k=[],W=Object.assign(Object.create(null),{_:[]}),Ce={};for(let f=0;f<i.length;f++){let g=i[f],O=g.replace(/^-{3,}/,"---"),E,y,v,j,D,pe;if(g!=="--"&&X(g))Ye(g);else if(O.match(/---+(=|$)/)){Ye(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=Xe(f,j[1],i,j[2]):T(j[1],d.nargs)!==!1?f=Ke(f,j[1],i,j[2]):V(j[1],j[2]));else if(g.match(A)&&o["boolean-negation"])j=g.match(A),j!==null&&Array.isArray(j)&&j.length>=2&&(y=j[1],V(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=Xe(f,y,i):T(y,d.nargs)!==!1?f=Ke(f,y,i):(D=i[f+1],D!==void 0&&(!D.match(/^-/)||D.match(C))&&!T(y,d.bools)&&!T(y,d.counts)||/^(true|false)$/.test(D)?(V(y,D),f++):V(y,B(y))));else if(g.match(/^-.\..+=/))j=g.match(/^-([^=]+)=([\s\S]*)$/),j!==null&&Array.isArray(j)&&j.length>=3&&V(j[1],j[2]);else if(g.match(/^-.\..+/)&&!g.match(C))D=i[f+1],j=g.match(/^-(.\..+)/),j!==null&&Array.isArray(j)&&j.length>=2&&(y=j[1],D!==void 0&&!D.match(/^-/)&&!T(y,d.bools)&&!T(y,d.counts)?(V(y,D),f++):V(y,B(y)));else if(g.match(/^-[^-]+/)&&!g.match(C)){v=g.slice(1,-1).split(""),E=!1;for(let Ee=0;Ee<v.length;Ee++){if(D=g.slice(Ee+2),v[Ee+1]&&v[Ee+1]==="="){pe=g.slice(Ee+3),y=v[Ee],T(y,d.arrays)?f=Xe(f,y,i,pe):T(y,d.nargs)!==!1?f=Ke(f,y,i,pe):V(y,pe),E=!0;break}if(D==="-"){V(v[Ee],D);continue}if(/[A-Za-z]/.test(v[Ee])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(D)&&T(D,d.bools)===!1){V(v[Ee],D),E=!0;break}if(v[Ee+1]&&v[Ee+1].match(/\W/)){V(v[Ee],D),E=!0;break}else V(v[Ee],B(v[Ee]))}y=g.slice(-1)[0],!E&&y!=="-"&&(T(y,d.arrays)?f=Xe(f,y,i):T(y,d.nargs)!==!1?f=Ke(f,y,i):(D=i[f+1],D!==void 0&&(!/^(-|--)[^-]/.test(D)||D.match(C))&&!T(y,d.bools)&&!T(y,d.counts)||/^(true|false)$/.test(D)?(V(y,D),f++):V(y,B(y))))}else if(g.match(/^-[0-9]$/)&&g.match(C)&&T(g.slice(1),d.bools))y=g.slice(1),V(y,B(y));else if(g==="--"){k=i.slice(f+1);break}else if(o["halt-at-non-option"]){k=i.slice(f);break}else Ye(g)}se(W,!0),se(W,!1),N(W),Z(),Je(W,d.aliases,c,!0),Y(W),o["set-placeholder-key"]&&ue(W),Object.keys(d.counts).forEach(function(f){J(W,f.split("."))||V(f,0)}),h&&k.length&&(W[l]=[]),k.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=>ot(g)).join(".")],delete W[f]});function Ye(f){let g=_("_",f);(typeof g=="string"||typeof g=="number")&&W._.push(g)}function Ke(f,g,O,E){let y,v=T(g,d.nargs);if(v=typeof v!="number"||isNaN(v)?1:v,v===0)return fe(E)||(S=Error(w("Argument unexpected for: %s",g))),V(g,B(g)),f;let j=fe(E)?0:1;if(o["nargs-eats-options"])O.length-(f+1)+j<v&&(S=Error(w("Not enough arguments following: %s",g))),j=v;else{for(y=f+1;y<O.length&&(!O[y].match(/^-[^0-9]/)||O[y].match(C)||X(O[y]));y++)j++;j<v&&(S=Error(w("Not enough arguments following: %s",g)))}let D=Math.min(j,v);for(!fe(E)&&D>0&&(V(g,E),D--),y=f+1;y<D+f+1;y++)V(g,O[y]);return f+D}function Xe(f,g,O,E){let y=[],v=E||O[f+1],j=T(g,d.nargs);if(T(g,d.bools)&&!/^(true|false)$/.test(v))y.push(!0);else if(fe(v)||fe(E)&&/^-/.test(v)&&!C.test(v)&&!X(v)){if(c[g]!==void 0){let D=c[g];y=Array.isArray(D)?D:[D]}}else{fe(E)||y.push(I(g,E));for(let D=f+1;D<O.length&&!(!o["greedy-arrays"]&&y.length>0||j&&typeof j=="number"&&y.length>=j||(v=O[D],/^-/.test(v)&&!C.test(v)&&!X(v)));D++)f=D,y.push(I(g,v))}return typeof j=="number"&&(j&&y.length<j||isNaN(j)&&y.length===0)&&(S=Error(w("Not enough arguments following: %s",g))),V(g,y),f}function V(f,g){if(/-/.test(f)&&o["camel-case-expansion"]){let y=f.split(".").map(function(v){return ot(v)}).join(".");ke(f,y)}let O=I(f,g),E=f.split(".");He(W,E,O),d.aliases[f]&&d.aliases[f].forEach(function(y){let v=y.split(".");He(W,v,O)}),E.length>1&&o["dot-notation"]&&(d.aliases[E[0]]||[]).forEach(function(y){let v=y.split("."),j=[].concat(E);j.shift(),v=v.concat(j),(d.aliases[f]||[]).includes(v.join("."))||He(W,v,O)}),T(f,d.normalize)&&!T(f,d.arrays)&&[f].concat(d.aliases[f]||[]).forEach(function(v){Object.defineProperty(Ce,v,{enumerable:!0,get(){return g},set(j){g=typeof j=="string"?Ve.normalize(j):j}})})}function ke(f,g){d.aliases[f]&&d.aliases[f].length||(d.aliases[f]=[g],b[g]=!0),d.aliases[g]&&d.aliases[g].length||ke(g,f)}function I(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 O=Array.isArray(g)?g.map(function(E){return _(f,E)}):_(f,g);return T(f,d.counts)&&(fe(O)||typeof O=="boolean")&&(O=Qr()),T(f,d.normalize)&&T(f,d.arrays)&&(Array.isArray(g)?O=g.map(E=>Ve.normalize(E)):O=Ve.normalize(g)),O}function _(f,g){return!o["parse-positional-numbers"]&&f==="_"||!T(f,d.strings)&&!T(f,d.bools)&&!Array.isArray(g)&&(lr(g)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${g}`)))||!fe(g)&&T(f,d.numbers))&&(g=Number(g)),g}function N(f){let g=Object.create(null);Je(g,d.aliases,c),Object.keys(d.configs).forEach(function(O){let E=f[O]||g[O];if(E)try{let y=null,v=Ve.resolve(Ve.cwd(),E),j=d.configs[O];if(typeof j=="function"){try{y=j(v)}catch(D){y=D}if(y instanceof Error){S=y;return}}else y=Ve.require(v);F(y)}catch(y){y.name==="PermissionDenied"?S=y:f[O]&&(S=Error(w("Invalid JSON config file: %s",E)))}})}function F(f,g){Object.keys(f).forEach(function(O){let E=f[O],y=g?g+"."+O:O;typeof E=="object"&&E!==null&&!Array.isArray(E)&&o["dot-notation"]?F(E,y):(!J(W,y.split("."))||T(y,d.arrays)&&o["combine-arrays"])&&V(y,E)})}function Z(){typeof u<"u"&&u.forEach(function(f){F(f)})}function se(f,g){if(typeof p>"u")return;let O=typeof p=="string"?p:"",E=Ve.env();Object.keys(E).forEach(function(y){if(O===""||y.lastIndexOf(O,0)===0){let v=y.split("__").map(function(j,D){return D===0&&(j=j.substring(O.length)),ot(j)});(g&&d.configs[v.join(".")]||!g)&&!J(f,v)&&V(v.join("."),E[y])}})}function Y(f){let g,O=new Set;Object.keys(f).forEach(function(E){if(!O.has(E)&&(g=T(E,d.coercions),typeof g=="function"))try{let y=_(E,g(f[E]));[].concat(d.aliases[E]||[],E).forEach(v=>{O.add(v),f[v]=y})}catch(y){S=y}})}function ue(f){return d.keys.forEach(g=>{~g.indexOf(".")||typeof f[g]>"u"&&(f[g]=void 0)}),f}function Je(f,g,O,E=!1){Object.keys(O).forEach(function(y){J(f,y.split("."))||(He(f,y.split("."),O[y]),E&&(m[y]=!0),(g[y]||[]).forEach(function(v){J(f,v.split("."))||He(f,v.split("."),O[y])}))})}function J(f,g){let O=f;o["dot-notation"]||(g=[g.join(".")]),g.slice(0,-1).forEach(function(y){O=O[y]||{}});let E=g[g.length-1];return typeof O!="object"?!1:E in O}function He(f,g,O){let E=f;o["dot-notation"]||(g=[g.join(".")]),g.slice(0,-1).forEach(function(pe){pe=ro(pe),typeof E=="object"&&E[pe]===void 0&&(E[pe]={}),typeof E[pe]!="object"||Array.isArray(E[pe])?(Array.isArray(E[pe])?E[pe].push({}):E[pe]=[E[pe],{}],E=E[pe][E[pe].length-1]):E=E[pe]});let y=ro(g[g.length-1]),v=T(g.join("."),d.arrays),j=Array.isArray(O),D=o["duplicate-arguments-array"];!D&&T(y,d.nargs)&&(D=!0,(!fe(E[y])&&d.nargs[y]===1||Array.isArray(E[y])&&E[y].length===d.nargs[y])&&(E[y]=void 0)),O===Qr()?E[y]=Qr(E[y]):Array.isArray(E[y])?D&&v&&j?E[y]=o["flatten-duplicate-arrays"]?E[y].concat(O):(Array.isArray(E[y][0])?E[y]:[E[y]]).concat([O]):!D&&!!v==!!j?E[y]=O:E[y]=E[y].concat([O]):E[y]===void 0&&v?E[y]=j?O:[O]:D&&!(E[y]===void 0||T(y,d.counts)||T(y,d.bools))?E[y]=[E[y],O]:E[y]=O}function It(...f){f.forEach(function(g){Object.keys(g||{}).forEach(function(O){d.aliases[O]||(d.aliases[O]=[].concat(s[O]||[]),d.aliases[O].concat(O).forEach(function(E){if(/-/.test(E)&&o["camel-case-expansion"]){let y=ot(E);y!==O&&d.aliases[O].indexOf(y)===-1&&(d.aliases[O].push(y),b[y]=!0)}}),d.aliases[O].concat(O).forEach(function(E){if(E.length>1&&/[A-Z]/.test(E)&&o["camel-case-expansion"]){let y=cr(E,"-");y!==O&&d.aliases[O].indexOf(y)===-1&&(d.aliases[O].push(y),b[y]=!0)}}),d.aliases[O].forEach(function(E){d.aliases[E]=[O].concat(d.aliases[O].filter(function(y){return E!==y}))}))})})}function T(f,g){let O=[].concat(d.aliases[f]||[],f),E=Object.keys(g),y=O.find(v=>E.includes(v));return y?g[y]:!1}function Et(f){let g=Object.keys(d);return[].concat(g.map(E=>d[E])).some(function(E){return Array.isArray(E)?E.includes(f):E[f]})}function qn(f,...g){return[].concat(...g).some(function(E){let y=f.match(E);return y&&Et(y[1])})}function q(f){if(f.match(C)||!f.match(/^-[^-]+/))return!1;let g=!0,O,E=f.slice(1).split("");for(let y=0;y<E.length;y++){if(O=f.slice(y+2),!Et(E[y])){g=!1;break}if(E[y+1]&&E[y+1]==="="||O==="-"||/[A-Za-z]/.test(E[y])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(O)||E[y+1]&&E[y+1].match(/\W/))break}return g}function X(f){return o["unknown-options-as-args"]&&K(f)}function K(f){return f=f.replace(/^-{3,}/,"--"),f.match(C)||q(f)?!1:!qn(f,/^-+([^=]+?)=[\s\S]*$/,A,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function B(f){return!T(f,d.bools)&&!T(f,d.counts)&&`${f}`in c?c[f]:le(_e(f))}function le(f){return{[Le.BOOLEAN]:!0,[Le.STRING]:"",[Le.NUMBER]:void 0,[Le.ARRAY]:[]}[f]}function _e(f){let g=Le.BOOLEAN;return T(f,d.strings)?g=Le.STRING:T(f,d.numbers)?g=Le.NUMBER:T(f,d.bools)?g=Le.BOOLEAN:T(f,d.arrays)&&(g=Le.ARRAY),g}function fe(f){return f===void 0}function Cr(){Object.keys(d.counts).find(f=>T(f,d.arrays)?(S=Error(w("Invalid configuration: %s, opts.count excludes opts.array.",f)),!0):T(f,d.nargs)?(S=Error(w("Invalid configuration: %s, opts.count excludes opts.narg.",f)),!0):!1)}return{aliases:Object.assign({},d.aliases),argv:Object.assign(Ce,W),configuration:o,defaulted:Object.assign({},m),error:S,newAliases:Object.assign({},b)}}};function ku(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(c){return e[s].indexOf(c)!==-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,c,u){return u.indexOf(o)===c});let s=i.pop();s!==void 0&&typeof s=="string"&&(t[s]=i)}),t}function Qr(r){return r!==void 0?r+1:1}function ro(r){return r==="__proto__"?"___proto___":r}var no=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])<no)throw Error(`yargs parser supports a minimum Node.js version of ${no}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Ku=process?process.env:{},io=new ur({cwd:process.cwd,env:()=>Ku,format:Hu,normalize:Bu,resolve:Yu,require:r=>{if(typeof Ue<"u")return Ue(r);if(r.match(/\.json$/))return Vu(r,"utf8");throw Error("only .json config files are supported in ESM")}}),Mt=function(e,t){return io.parse(e.slice(),t).argv};Mt.detailed=function(r,e){return io.parse(r.slice(),e)};Mt.camelCase=ot;Mt.decamelize=cr;Mt.looksLikeNumber=lr;var Zr=Mt;import{basename as lf,dirname as uf,extname as ff,relative as df,resolve as uo}from"path";function so(){return Xu()?0:1}function Xu(){return Ju()&&!process.defaultApp}function Ju(){return!!process.versions.electron}function en(r){return r.slice(so()+1)}function oo(){return process.argv[so()]}var re=class r extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace(this,r)}};import{readFileSync as Qu,statSync as Zu,writeFile as ef}from"fs";import{format as tf}from"util";import{resolve as rf}from"path";var ao={fs:{readFileSync:Qu,writeFile:ef},format:tf,resolve:rf,exists:r=>{try{return Zu(r).isFile()}catch{return!1}}};var ze,tn=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 c=[o];return~o.indexOf("%d")&&c.push(i),ze.format.apply(ze.format,c.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),c=JSON.stringify(this.cache[i],null,2);ze.fs.writeFile(o,c,"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 co(r,e){ze=e;let t=new tn(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 nf=r=>co(r,ao),lo=nf;var pf="require is not supported by ESM",fo="loading a directory of commands is not supported yet for ESM",hf=po(import.meta.url).split("node_modules")[0],mf=po(import.meta.url),rn={assert:{notStrictEqual:sf,strictEqual:of},cliui:Jr,findUp:eo,getEnv:r=>process.env[r],inspect:af,getCallerFile:()=>{throw new re(fo)},getProcessArgvBin:oo,mainFilename:hf||process.cwd(),Parser:Zr,path:{basename:lf,dirname:uf,extname:ff,relative:df,resolve:uo},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:cf,require:()=>{throw new re(pf)},requireDirectory:()=>{throw new re(fo)},stringWidth:r=>[...r].length,y18n:lo({directory:uo(mf,"../../../locales"),updateFiles:!1})};function Ae(r,e,t,n){t.assert.notStrictEqual(r,e,n)}function nn(r,e){e.assert.strictEqual(typeof r,"string")}function At(r){return Object.keys(r)}function ie(r){return!!r&&!!r.then&&typeof r.then=="function"}function Ze(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,c)=>{let u=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&c===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 gf=["first","second","third","fourth","fifth","sixth"];function $(r,e,t){function n(){return typeof r=="object"?[{demanded:[],optional:[]},r,e]:[Ze(`cmd ${r}`),e,t]}try{let i=0,[s,o,c]=n(),u=[].slice.call(o);for(;u.length&&u[u.length-1]===void 0;)u.pop();let p=c||u.length;if(p<s.demanded.length)throw new re(`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 re(`Too many arguments provided. Expected max ${h} but received ${p}.`);s.demanded.forEach(l=>{let b=u.shift(),m=ho(b);l.cmd.filter(d=>d===m||d==="*").length===0&&mo(m,l.cmd,i),i+=1}),s.optional.forEach(l=>{if(u.length===0)return;let b=u.shift(),m=ho(b);l.cmd.filter(d=>d===m||d==="*").length===0&&mo(m,l.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function ho(r){return Array.isArray(r)?"array":r===null?"null":typeof r}function mo(r,e,t){throw new re(`Invalid ${gf[t]||"manyith"} argument. Expected ${e.join(" or ")} but received ${r}.`)}var fr=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,n=!0){if($("<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 go(r){return r?r.map(e=>(e.applyBeforeValidation=!1,e)):[]}function at(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,c])=>Object.assign(o,c));{let o=s(i,e);return ie(o)?o.then(c=>Object.assign(i,c)):Object.assign(i,o)}},r)}function ct(r,e,t=n=>{throw n}){try{let n=yf(r)?r():r;return ie(n)?n.then(i=>e(i)):e(n)}catch(n){return t(n)}}function yf(r){return typeof r=="function"}function sn(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 _t=/(^\*)|(^\$0)/,on=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,c,u)=>{let p=s(o,c,u);if(p){if(this.requireCache.has(c))return p;this.requireCache.add(c),this.addHandler(p)}return p},this.shim.requireDirectory({require:t,filename:n},e,i)}addHandler(e,t,n,i,s,o){let c=[],u=go(s);if(i=i||(()=>{}),Array.isArray(e))if(bf(e))[e,...c]=e;else for(let p of e)this.addHandler(p);else if(wf(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(yo(n)){this.addHandler([e].concat(c),t,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let p=Ze(e);c=c.map(b=>Ze(b).cmd);let h=!1,l=[p.cmd].concat(c).filter(b=>_t.test(b)?(h=!0,!1):!0);l.length===0&&h&&l.push("$0"),h&&(p.cmd=l[0],c=l.slice(1),e=e.replace(_t,p.cmd)),c.forEach(b=>{this.aliasMap[b]=p.cmd}),t!==!1&&this.usage.command(e,t,h,c,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 c=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(c.original));let l=this.applyBuilderUpdateUsageAndParse(h,c,t,n.aliases,p,i,s,o);return ie(l)?l.then(b=>this.applyMiddlewareAndGetResult(h,c,b.innerArgv,u,s,b.aliases,t)):this.applyMiddlewareAndGetResult(h,c,l.innerArgv,u,s,l.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,n,i,s,o,c,u){let p=t.builder,h=n;if(dr(p)){let l=p(n.getInternalMethods().reset(i),u);if(ie(l))return l.then(b=>(h=Eo(b)?b:n,this.parseAndUpdateUsage(e,t,h,s,o,c)))}else Ef(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,c)}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 c=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return ie(c)?c.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:c}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){let n=_t.test(t.original)?t.original.replace(_t,"").trim():t.original,i=e.filter(s=>!_t.test(s));return i.push(n),`$0 ${i.join(" ")}`}applyMiddlewareAndGetResult(e,t,n,i,s,o,c){let u={};if(s)return n;c.getInternalMethods().getHasOutput()||(u=this.populatePositionals(t,n,i,c));let p=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares);if(n=at(n,c,p,!0),!c.getInternalMethods().getHasOutput()){let h=c.getInternalMethods().runValidation(o,u,c.parsed.error,e);n=ct(n,l=>(h(l),l))}if(t.handler&&!c.getInternalMethods().getHasOutput()){c.getInternalMethods().setHasOutput();let h=!!c.getOptions().configuration["populate--"];c.getInternalMethods().postProcess(n,h,!1,!1),n=at(n,c,p,!1),n=ct(n,l=>{let b=t.handler(l);return ie(b)?b.then(()=>l):l}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),ie(n)&&!c.getInternalMethods().hasParseCallback()&&n.catch(l=>{try{c.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),c={};for(this.validation.positionalCount(s.length,t._.length);s.length;){let u=s.shift();this.populatePositional(u,t,c)}for(;o.length;){let u=o.shift();this.populatePositional(u,t,c)}return t._=n.commands.concat(t._.map(u=>""+u)),this.postProcessPositionals(t,c,this.cmdToParseOptions(e.original),i),c}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=Ze(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 c=Object.assign({},s.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:c}));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=_t.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(dr(t))return t(e,!0);yo(t)||Object.keys(t).forEach(n=>{e.option(n,t[n])})}moduleName(e){let t=sn(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;Ae(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();Ae(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 bo(r,e,t,n){return new on(r,e,t,n)}function yo(r){return typeof r=="object"&&!!r.builder&&typeof r.handler=="function"}function bf(r){return r.every(e=>typeof e=="string")}function dr(r){return typeof r=="function"}function Ef(r){return typeof r=="object"}function wf(r){return typeof r=="object"&&!Array.isArray(r)}function et(r={},e=()=>!0){let t={};return At(r).forEach(n=>{e(n,r[n])&&(t[n]=r[n])}),t}function tt(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 Of(r){return typeof r=="boolean"}function Oo(r,e){let t=e.y18n.__,n={},i=[];n.failFn=function(_){i.push(_)};let s=null,o=!0;n.showHelpOnFail=function(_=!0,N){function F(){return typeof _=="string"?[!0,_]:[_,N]}let[Z,se]=F();return s=se,o=Z,n};let c=!1;n.fail=function(_,N){let F=r.getInternalMethods().getLoggerInstance();if(i.length)for(let Z=i.length-1;Z>=0;--Z){let se=i[Z];if(Of(se)){if(N)throw N;if(_)throw Error(_)}else se(_,N,n)}else{if(r.getExitProcess()&&tt(!0),c||(c=!0,o&&(r.showHelp("error"),F.error()),(_||N)&&F.error(_||N),s&&((_||N)&&F.error(""),F.error(s))),N=N||new re(_),r.getExitProcess())return r.exit(1);if(r.getInternalMethods().hasParseCallback())return r.exit(1,N);throw N}};let u=[],p=!1;n.usage=(I,_)=>I===null?(p=!0,u=[],n):(p=!1,u.push([I,_||""]),n),n.getUsage=()=>u,n.getUsageDisabled=()=>p,n.getPositionalGroupName=()=>t("Positionals:");let h=[];n.example=(I,_)=>{h.push([I,_||""])};let l=[];n.command=function(_,N,F,Z,se=!1){F&&(l=l.map(Y=>(Y[2]=!1,Y))),l.push([_,N||"",F,Z,se])},n.getCommands=()=>l;let b={};n.describe=function(_,N){Array.isArray(_)?_.forEach(F=>{n.describe(F,N)}):typeof _=="object"?Object.keys(_).forEach(F=>{n.describe(F,_[F])}):b[_]=N},n.getDescriptions=()=>b;let m=[];n.epilog=I=>{m.push(I)};let w=!1,d;n.wrap=I=>{w=!0,d=I};function C(){return w||(d=Xe(),w=!0),d}let A="__yargsString__:";n.deferY18nLookup=I=>A+I,n.help=function(){if(W)return W;k();let _=r.customScriptName?r.$0:e.path.basename(r.$0),N=r.getDemandedOptions(),F=r.getDemandedCommands(),Z=r.getDeprecatedOptions(),se=r.getGroups(),Y=r.getOptions(),ue=[];ue=ue.concat(Object.keys(b)),ue=ue.concat(Object.keys(N)),ue=ue.concat(Object.keys(F)),ue=ue.concat(Object.keys(Y.default)),ue=ue.filter(Ye),ue=Object.keys(ue.reduce((q,X)=>(X!=="_"&&(q[X]=!0),q),{}));let Je=C(),J=e.cliui({width:Je,wrap:!!Je});if(!p){if(u.length)u.forEach(q=>{J.div(`${q[0].replace(/\$0/g,_)}`),q[1]&&J.div({text:`${q[1]}`,padding:[1,0,0,0]})}),J.div();else if(l.length){let q=null;F._?q=`${_} <${t("command")}>
|
|
17
|
-
`:
|
|
18
|
-
`,
|
|
19
|
-
`);
|
|
20
|
-
`)}return
|
|
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[Gu]||0).fill("")),i.push(...new Array(s.padding[ku]||0).fill(""))),i.forEach((c,u)=>{t[u]||t.push([]);let p=t[u];for(let h=0;h<o;h++)p[h]===void 0&&p.push("");p.push(c)})}),t}negatePadding(e){let t=e.width||0;return e.padding&&(t-=(e.padding[lr]||0)+(e.padding[cr]||0)),e.border&&(t-=4),t}columnWidths(e){if(!this.wrap)return e.map(o=>o.width||Re.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,c)=>o===void 0?Math.max(s,Wu(e[c])):o)}};function Qs(r,e,t){return r.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?t:" ":""}function Wu(r){let e=r.padding||[],t=1+(e[lr]||0)+(e[cr]||0);return r.border?t+4:t}function Hu(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Vu(r,e){r=r.trim();let t=Re.stringWidth(r);return t<e?" ".repeat(e-t)+r:r}function Bu(r,e){r=r.trim();let t=Re.stringWidth(r);return t>=e?r:" ".repeat(e-t>>1)+r}var Re;function Zs(r,e){return Re=e,new Qr({width:r?.width||Hu(),wrap:r?.wrap})}var eo=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function Zr(r){return r.replace(eo,"")}function to(r,e){let[t,n]=r.match(eo)||["",""];r=Zr(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 en(r){return Zs(r,{stringWidth:e=>[...e].length,stripAnsi:Zr,wrap:to})}import{dirname as ro,resolve as no}from"path";import{readdirSync as Yu,statSync as Ku}from"fs";function io(r,e){let t=no(".",r),n;for(Ku(t).isDirectory()||(t=ro(t));;){if(n=e(t,Yu(t)),n)return no(t,n);if(t=ro(n=t),n===t)break}}import{inspect as pf}from"util";import{readFileSync as hf}from"fs";import{fileURLToPath as yo}from"url";import{format as Ju}from"util";import{readFileSync as Qu}from"fs";import{normalize as Zu,resolve as ef}from"path";function ot(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 ur(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 fr(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 so(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 Le;(function(r){r.BOOLEAN="boolean",r.STRING="string",r.NUMBER="number",r.ARRAY="array"})(Le||(Le={}));var Ve,dr=class{constructor(e){Ve=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=so(e),s=Xu(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),c=Object.assign(Object.create(null),n.default),u=n.configObjects||[],p=n.envPrefix,h=o["populate--"],l=h?"--":"_",b=Object.create(null),g=Object.create(null),w=n.__||Ve.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 m=typeof f=="object"?f.key:f,O=Object.keys(f).map(function(E){return{boolean:"bools",string:"strings",number:"numbers"}[E]}).filter(Boolean).pop();O&&(d[O][m]=!0),d.arrays[m]=!0,d.keys.push(m)}),[].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,m])=>{typeof m=="number"&&(d.nargs[f]=m,d.keys.push(f))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([f,m])=>{typeof m=="function"&&(d.coercions[f]=m,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,m])=>{(typeof m=="boolean"||typeof m=="function")&&(d.configs[f]=m)})),It(n.key,s,n.default,d.arrays),Object.keys(c).forEach(function(f){(d.aliases[f]||[]).forEach(function(m){c[m]=c[f]})});let A=null;Rr();let G=[],W=Object.assign(Object.create(null),{_:[]}),xe={};for(let f=0;f<i.length;f++){let m=i[f],O=m.replace(/^-{3,}/,"---"),E,y,R,v,q,pe;if(m!=="--"&&J(m))Ye(m);else if(O.match(/---+(=|$)/)){Ye(m);continue}else if(m.match(/^--.+=/)||!o["short-option-groups"]&&m.match(/^-.+=/))v=m.match(/^--?([^=]+)=([\s\S]*)$/),v!==null&&Array.isArray(v)&&v.length>=3&&(T(v[1],d.arrays)?f=Xe(f,v[1],i,v[2]):T(v[1],d.nargs)!==!1?f=Ke(f,v[1],i,v[2]):V(v[1],v[2]));else if(m.match(N)&&o["boolean-negation"])v=m.match(N),v!==null&&Array.isArray(v)&&v.length>=2&&(y=v[1],V(y,T(y,d.arrays)?[!1]:!1));else if(m.match(/^--.+/)||!o["short-option-groups"]&&m.match(/^-[^-]+/))v=m.match(/^--?(.+)/),v!==null&&Array.isArray(v)&&v.length>=2&&(y=v[1],T(y,d.arrays)?f=Xe(f,y,i):T(y,d.nargs)!==!1?f=Ke(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)?(V(y,q),f++):V(y,B(y))));else if(m.match(/^-.\..+=/))v=m.match(/^-([^=]+)=([\s\S]*)$/),v!==null&&Array.isArray(v)&&v.length>=3&&V(v[1],v[2]);else if(m.match(/^-.\..+/)&&!m.match(S))q=i[f+1],v=m.match(/^-(.\..+)/),v!==null&&Array.isArray(v)&&v.length>=2&&(y=v[1],q!==void 0&&!q.match(/^-/)&&!T(y,d.bools)&&!T(y,d.counts)?(V(y,q),f++):V(y,B(y)));else if(m.match(/^-[^-]+/)&&!m.match(S)){R=m.slice(1,-1).split(""),E=!1;for(let Ee=0;Ee<R.length;Ee++){if(q=m.slice(Ee+2),R[Ee+1]&&R[Ee+1]==="="){pe=m.slice(Ee+3),y=R[Ee],T(y,d.arrays)?f=Xe(f,y,i,pe):T(y,d.nargs)!==!1?f=Ke(f,y,i,pe):V(y,pe),E=!0;break}if(q==="-"){V(R[Ee],q);continue}if(/[A-Za-z]/.test(R[Ee])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(q)&&T(q,d.bools)===!1){V(R[Ee],q),E=!0;break}if(R[Ee+1]&&R[Ee+1].match(/\W/)){V(R[Ee],q),E=!0;break}else V(R[Ee],B(R[Ee]))}y=m.slice(-1)[0],!E&&y!=="-"&&(T(y,d.arrays)?f=Xe(f,y,i):T(y,d.nargs)!==!1?f=Ke(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)?(V(y,q),f++):V(y,B(y))))}else if(m.match(/^-[0-9]$/)&&m.match(S)&&T(m.slice(1),d.bools))y=m.slice(1),V(y,B(y));else if(m==="--"){G=i.slice(f+1);break}else if(o["halt-at-non-option"]){G=i.slice(f);break}else Ye(m)}se(W,!0),se(W,!1),L(W),ee(),Je(W,d.aliases,c,!0),Y(W),o["set-placeholder-key"]&&ue(W),Object.keys(d.counts).forEach(function(f){Z(W,f.split("."))||V(f,0)}),h&&G.length&&(W[l]=[]),G.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(m=>ot(m)).join(".")],delete W[f]});function Ye(f){let m=_("_",f);(typeof m=="string"||typeof m=="number")&&W._.push(m)}function Ke(f,m,O,E){let y,R=T(m,d.nargs);if(R=typeof R!="number"||isNaN(R)?1:R,R===0)return fe(E)||(A=Error(w("Argument unexpected for: %s",m))),V(m,B(m)),f;let v=fe(E)?0:1;if(o["nargs-eats-options"])O.length-(f+1)+v<R&&(A=Error(w("Not enough arguments following: %s",m))),v=R;else{for(y=f+1;y<O.length&&(!O[y].match(/^-[^0-9]/)||O[y].match(S)||J(O[y]));y++)v++;v<R&&(A=Error(w("Not enough arguments following: %s",m)))}let q=Math.min(v,R);for(!fe(E)&&q>0&&(V(m,E),q--),y=f+1;y<q+f+1;y++)V(m,O[y]);return f+q}function Xe(f,m,O,E){let y=[],R=E||O[f+1],v=T(m,d.nargs);if(T(m,d.bools)&&!/^(true|false)$/.test(R))y.push(!0);else if(fe(R)||fe(E)&&/^-/.test(R)&&!S.test(R)&&!J(R)){if(c[m]!==void 0){let q=c[m];y=Array.isArray(q)?q:[q]}}else{fe(E)||y.push($(m,E));for(let q=f+1;q<O.length&&!(!o["greedy-arrays"]&&y.length>0||v&&typeof v=="number"&&y.length>=v||(R=O[q],/^-/.test(R)&&!S.test(R)&&!J(R)));q++)f=q,y.push($(m,R))}return typeof v=="number"&&(v&&y.length<v||isNaN(v)&&y.length===0)&&(A=Error(w("Not enough arguments following: %s",m))),V(m,y),f}function V(f,m){if(/-/.test(f)&&o["camel-case-expansion"]){let y=f.split(".").map(function(R){return ot(R)}).join(".");We(f,y)}let O=$(f,m),E=f.split(".");He(W,E,O),d.aliases[f]&&d.aliases[f].forEach(function(y){let R=y.split(".");He(W,R,O)}),E.length>1&&o["dot-notation"]&&(d.aliases[E[0]]||[]).forEach(function(y){let R=y.split("."),v=[].concat(E);v.shift(),R=R.concat(v),(d.aliases[f]||[]).includes(R.join("."))||He(W,R,O)}),T(f,d.normalize)&&!T(f,d.arrays)&&[f].concat(d.aliases[f]||[]).forEach(function(R){Object.defineProperty(xe,R,{enumerable:!0,get(){return m},set(v){m=typeof v=="string"?Ve.normalize(v):v}})})}function We(f,m){d.aliases[f]&&d.aliases[f].length||(d.aliases[f]=[m],b[m]=!0),d.aliases[m]&&d.aliases[m].length||We(m,f)}function $(f,m){typeof m=="string"&&(m[0]==="'"||m[0]==='"')&&m[m.length-1]===m[0]&&(m=m.substring(1,m.length-1)),(T(f,d.bools)||T(f,d.counts))&&typeof m=="string"&&(m=m==="true");let O=Array.isArray(m)?m.map(function(E){return _(f,E)}):_(f,m);return T(f,d.counts)&&(fe(O)||typeof O=="boolean")&&(O=tn()),T(f,d.normalize)&&T(f,d.arrays)&&(Array.isArray(m)?O=m.map(E=>Ve.normalize(E)):O=Ve.normalize(m)),O}function _(f,m){return!o["parse-positional-numbers"]&&f==="_"||!T(f,d.strings)&&!T(f,d.bools)&&!Array.isArray(m)&&(fr(m)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${m}`)))||!fe(m)&&T(f,d.numbers))&&(m=Number(m)),m}function L(f){let m=Object.create(null);Je(m,d.aliases,c),Object.keys(d.configs).forEach(function(O){let E=f[O]||m[O];if(E)try{let y=null,R=Ve.resolve(Ve.cwd(),E),v=d.configs[O];if(typeof v=="function"){try{y=v(R)}catch(q){y=q}if(y instanceof Error){A=y;return}}else y=Ve.require(R);F(y)}catch(y){y.name==="PermissionDenied"?A=y:f[O]&&(A=Error(w("Invalid JSON config file: %s",E)))}})}function F(f,m){Object.keys(f).forEach(function(O){let E=f[O],y=m?m+"."+O:O;typeof E=="object"&&E!==null&&!Array.isArray(E)&&o["dot-notation"]?F(E,y):(!Z(W,y.split("."))||T(y,d.arrays)&&o["combine-arrays"])&&V(y,E)})}function ee(){typeof u<"u"&&u.forEach(function(f){F(f)})}function se(f,m){if(typeof p>"u")return;let O=typeof p=="string"?p:"",E=Ve.env();Object.keys(E).forEach(function(y){if(O===""||y.lastIndexOf(O,0)===0){let R=y.split("__").map(function(v,q){return q===0&&(v=v.substring(O.length)),ot(v)});(m&&d.configs[R.join(".")]||!m)&&!Z(f,R)&&V(R.join("."),E[y])}})}function Y(f){let m,O=new Set;Object.keys(f).forEach(function(E){if(!O.has(E)&&(m=T(E,d.coercions),typeof m=="function"))try{let y=_(E,m(f[E]));[].concat(d.aliases[E]||[],E).forEach(R=>{O.add(R),f[R]=y})}catch(y){A=y}})}function ue(f){return d.keys.forEach(m=>{~m.indexOf(".")||typeof f[m]>"u"&&(f[m]=void 0)}),f}function Je(f,m,O,E=!1){Object.keys(O).forEach(function(y){Z(f,y.split("."))||(He(f,y.split("."),O[y]),E&&(g[y]=!0),(m[y]||[]).forEach(function(R){Z(f,R.split("."))||He(f,R.split("."),O[y])}))})}function Z(f,m){let O=f;o["dot-notation"]||(m=[m.join(".")]),m.slice(0,-1).forEach(function(y){O=O[y]||{}});let E=m[m.length-1];return typeof O!="object"?!1:E in O}function He(f,m,O){let E=f;o["dot-notation"]||(m=[m.join(".")]),m.slice(0,-1).forEach(function(pe){pe=oo(pe),typeof E=="object"&&E[pe]===void 0&&(E[pe]={}),typeof E[pe]!="object"||Array.isArray(E[pe])?(Array.isArray(E[pe])?E[pe].push({}):E[pe]=[E[pe],{}],E=E[pe][E[pe].length-1]):E=E[pe]});let y=oo(m[m.length-1]),R=T(m.join("."),d.arrays),v=Array.isArray(O),q=o["duplicate-arguments-array"];!q&&T(y,d.nargs)&&(q=!0,(!fe(E[y])&&d.nargs[y]===1||Array.isArray(E[y])&&E[y].length===d.nargs[y])&&(E[y]=void 0)),O===tn()?E[y]=tn(E[y]):Array.isArray(E[y])?q&&R&&v?E[y]=o["flatten-duplicate-arrays"]?E[y].concat(O):(Array.isArray(E[y][0])?E[y]:[E[y]]).concat([O]):!q&&!!R==!!v?E[y]=O:E[y]=E[y].concat([O]):E[y]===void 0&&R?E[y]=v?O:[O]:q&&!(E[y]===void 0||T(y,d.counts)||T(y,d.bools))?E[y]=[E[y],O]:E[y]=O}function It(...f){f.forEach(function(m){Object.keys(m||{}).forEach(function(O){d.aliases[O]||(d.aliases[O]=[].concat(s[O]||[]),d.aliases[O].concat(O).forEach(function(E){if(/-/.test(E)&&o["camel-case-expansion"]){let y=ot(E);y!==O&&d.aliases[O].indexOf(y)===-1&&(d.aliases[O].push(y),b[y]=!0)}}),d.aliases[O].concat(O).forEach(function(E){if(E.length>1&&/[A-Z]/.test(E)&&o["camel-case-expansion"]){let y=ur(E,"-");y!==O&&d.aliases[O].indexOf(y)===-1&&(d.aliases[O].push(y),b[y]=!0)}}),d.aliases[O].forEach(function(E){d.aliases[E]=[O].concat(d.aliases[O].filter(function(y){return E!==y}))}))})})}function T(f,m){let O=[].concat(d.aliases[f]||[],f),E=Object.keys(m),y=O.find(R=>E.includes(R));return y?m[y]:!1}function Et(f){let m=Object.keys(d);return[].concat(m.map(E=>d[E])).some(function(E){return Array.isArray(E)?E.includes(f):E[f]})}function Fn(f,...m){return[].concat(...m).some(function(E){let y=f.match(E);return y&&Et(y[1])})}function D(f){if(f.match(S)||!f.match(/^-[^-]+/))return!1;let m=!0,O,E=f.slice(1).split("");for(let y=0;y<E.length;y++){if(O=f.slice(y+2),!Et(E[y])){m=!1;break}if(E[y+1]&&E[y+1]==="="||O==="-"||/[A-Za-z]/.test(E[y])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(O)||E[y+1]&&E[y+1].match(/\W/))break}return m}function J(f){return o["unknown-options-as-args"]&&K(f)}function K(f){return f=f.replace(/^-{3,}/,"--"),f.match(S)||D(f)?!1:!Fn(f,/^-+([^=]+?)=[\s\S]*$/,N,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function B(f){return!T(f,d.bools)&&!T(f,d.counts)&&`${f}`in c?c[f]:le(Se(f))}function le(f){return{[Le.BOOLEAN]:!0,[Le.STRING]:"",[Le.NUMBER]:void 0,[Le.ARRAY]:[]}[f]}function Se(f){let m=Le.BOOLEAN;return T(f,d.strings)?m=Le.STRING:T(f,d.numbers)?m=Le.NUMBER:T(f,d.bools)?m=Le.BOOLEAN:T(f,d.arrays)&&(m=Le.ARRAY),m}function fe(f){return f===void 0}function Rr(){Object.keys(d.counts).find(f=>T(f,d.arrays)?(A=Error(w("Invalid configuration: %s, opts.count excludes opts.array.",f)),!0):T(f,d.nargs)?(A=Error(w("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({},g),error:A,newAliases:Object.assign({},b)}}};function Xu(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(c){return e[s].indexOf(c)!==-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,c,u){return u.indexOf(o)===c});let s=i.pop();s!==void 0&&typeof s=="string"&&(t[s]=i)}),t}function tn(r){return r!==void 0?r+1:1}function oo(r){return r==="__proto__"?"___proto___":r}var ao=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])<ao)throw Error(`yargs parser supports a minimum Node.js version of ${ao}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var tf=process?process.env:{},co=new dr({cwd:process.cwd,env:()=>tf,format:Ju,normalize:Zu,resolve:ef,require:r=>{if(typeof Ue<"u")return Ue(r);if(r.match(/\.json$/))return Qu(r,"utf8");throw Error("only .json config files are supported in ESM")}}),Mt=function(e,t){return co.parse(e.slice(),t).argv};Mt.detailed=function(r,e){return co.parse(r.slice(),e)};Mt.camelCase=ot;Mt.decamelize=ur;Mt.looksLikeNumber=fr;var rn=Mt;import{basename as mf,dirname as gf,extname as yf,relative as bf,resolve as mo}from"path";function lo(){return rf()?0:1}function rf(){return nf()&&!process.defaultApp}function nf(){return!!process.versions.electron}function nn(r){return r.slice(lo()+1)}function uo(){return process.argv[lo()]}var ne=class r extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace(this,r)}};import{readFileSync as sf,statSync as of,writeFile as af}from"fs";import{format as cf}from"util";import{resolve as lf}from"path";var fo={fs:{readFileSync:sf,writeFile:af},format:cf,resolve:lf,exists:r=>{try{return of(r).isFile()}catch{return!1}}};var ze,sn=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 c=[o];return~o.indexOf("%d")&&c.push(i),ze.format.apply(ze.format,c.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),c=JSON.stringify(this.cache[i],null,2);ze.fs.writeFile(o,c,"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 po(r,e){ze=e;let t=new sn(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 uf=r=>po(r,fo),ho=uf;var Ef="require is not supported by ESM",go="loading a directory of commands is not supported yet for ESM",wf=yo(import.meta.url).split("node_modules")[0],Of=yo(import.meta.url),on={assert:{notStrictEqual:ff,strictEqual:df},cliui:en,findUp:io,getEnv:r=>process.env[r],inspect:pf,getCallerFile:()=>{throw new ne(go)},getProcessArgvBin:uo,mainFilename:wf||process.cwd(),Parser:rn,path:{basename:mf,dirname:gf,extname:yf,relative:bf,resolve:mo},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:hf,require:()=>{throw new ne(Ef)},requireDirectory:()=>{throw new ne(go)},stringWidth:r=>[...r].length,y18n:ho({directory:mo(Of,"../../../locales"),updateFiles:!1})};function _e(r,e,t,n){t.assert.notStrictEqual(r,e,n)}function an(r,e){e.assert.strictEqual(typeof r,"string")}function At(r){return Object.keys(r)}function ie(r){return!!r&&!!r.then&&typeof r.then=="function"}function Ze(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,c)=>{let u=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&c===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 Af=["first","second","third","fourth","fifth","sixth"];function j(r,e,t){function n(){return typeof r=="object"?[{demanded:[],optional:[]},r,e]:[Ze(`cmd ${r}`),e,t]}try{let i=0,[s,o,c]=n(),u=[].slice.call(o);for(;u.length&&u[u.length-1]===void 0;)u.pop();let p=c||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(),g=bo(b);l.cmd.filter(d=>d===g||d==="*").length===0&&Eo(g,l.cmd,i),i+=1}),s.optional.forEach(l=>{if(u.length===0)return;let b=u.shift(),g=bo(b);l.cmd.filter(d=>d===g||d==="*").length===0&&Eo(g,l.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function bo(r){return Array.isArray(r)?"array":r===null?"null":typeof r}function Eo(r,e,t){throw new ne(`Invalid ${Af[t]||"manyith"} argument. Expected ${e.join(" or ")} but received ${r}.`)}var pr=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,n=!0){if(j("<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 wo(r){return r?r.map(e=>(e.applyBeforeValidation=!1,e)):[]}function at(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,c])=>Object.assign(o,c));{let o=s(i,e);return ie(o)?o.then(c=>Object.assign(i,c)):Object.assign(i,o)}},r)}function ct(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 cn(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 _t=/(^\*)|(^\$0)/,ln=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,c,u)=>{let p=s(o,c,u);if(p){if(this.requireCache.has(c))return p;this.requireCache.add(c),this.addHandler(p)}return p},this.shim.requireDirectory({require:t,filename:n},e,i)}addHandler(e,t,n,i,s,o){let c=[],u=wo(s);if(i=i||(()=>{}),Array.isArray(e))if(Sf(e))[e,...c]=e;else for(let p of e)this.addHandler(p);else if(xf(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(Oo(n)){this.addHandler([e].concat(c),t,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let p=Ze(e);c=c.map(b=>Ze(b).cmd);let h=!1,l=[p.cmd].concat(c).filter(b=>_t.test(b)?(h=!0,!1):!0);l.length===0&&h&&l.push("$0"),h&&(p.cmd=l[0],c=l.slice(1),e=e.replace(_t,p.cmd)),c.forEach(b=>{this.aliasMap[b]=p.cmd}),t!==!1&&this.usage.command(e,t,h,c,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 c=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(c.original));let l=this.applyBuilderUpdateUsageAndParse(h,c,t,n.aliases,p,i,s,o);return ie(l)?l.then(b=>this.applyMiddlewareAndGetResult(h,c,b.innerArgv,u,s,b.aliases,t)):this.applyMiddlewareAndGetResult(h,c,l.innerArgv,u,s,l.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,n,i,s,o,c,u){let p=t.builder,h=n;if(hr(p)){let l=p(n.getInternalMethods().reset(i),u);if(ie(l))return l.then(b=>(h=_o(b)?b:n,this.parseAndUpdateUsage(e,t,h,s,o,c)))}else Cf(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,c)}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 c=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return ie(c)?c.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:c}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){let n=_t.test(t.original)?t.original.replace(_t,"").trim():t.original,i=e.filter(s=>!_t.test(s));return i.push(n),`$0 ${i.join(" ")}`}applyMiddlewareAndGetResult(e,t,n,i,s,o,c){let u={};if(s)return n;c.getInternalMethods().getHasOutput()||(u=this.populatePositionals(t,n,i,c));let p=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares);if(n=at(n,c,p,!0),!c.getInternalMethods().getHasOutput()){let h=c.getInternalMethods().runValidation(o,u,c.parsed.error,e);n=ct(n,l=>(h(l),l))}if(t.handler&&!c.getInternalMethods().getHasOutput()){c.getInternalMethods().setHasOutput();let h=!!c.getOptions().configuration["populate--"];c.getInternalMethods().postProcess(n,h,!1,!1),n=at(n,c,p,!1),n=ct(n,l=>{let b=t.handler(l);return ie(b)?b.then(()=>l):l}),e||c.getInternalMethods().getUsageInstance().cacheHelpMessage(),ie(n)&&!c.getInternalMethods().hasParseCallback()&&n.catch(l=>{try{c.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),c={};for(this.validation.positionalCount(s.length,t._.length);s.length;){let u=s.shift();this.populatePositional(u,t,c)}for(;o.length;){let u=o.shift();this.populatePositional(u,t,c)}return t._=n.commands.concat(t._.map(u=>""+u)),this.postProcessPositionals(t,c,this.cmdToParseOptions(e.original),i),c}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=Ze(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 c=Object.assign({},s.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:c}));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=_t.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(hr(t))return t(e,!0);Oo(t)||Object.keys(t).forEach(n=>{e.option(n,t[n])})}moduleName(e){let t=cn(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;_e(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();_e(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 Ao(r,e,t,n){return new ln(r,e,t,n)}function Oo(r){return typeof r=="object"&&!!r.builder&&typeof r.handler=="function"}function Sf(r){return r.every(e=>typeof e=="string")}function hr(r){return typeof r=="function"}function Cf(r){return typeof r=="object"}function xf(r){return typeof r=="object"&&!Array.isArray(r)}function et(r={},e=()=>!0){let t={};return At(r).forEach(n=>{e(n,r[n])&&(t[n]=r[n])}),t}function tt(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 Rf(r){return typeof r=="boolean"}function Co(r,e){let t=e.y18n.__,n={},i=[];n.failFn=function(_){i.push(_)};let s=null,o=!0;n.showHelpOnFail=function(_=!0,L){function F(){return typeof _=="string"?[!0,_]:[_,L]}let[ee,se]=F();return s=se,o=ee,n};let c=!1;n.fail=function(_,L){let F=r.getInternalMethods().getLoggerInstance();if(i.length)for(let ee=i.length-1;ee>=0;--ee){let se=i[ee];if(Rf(se)){if(L)throw L;if(_)throw Error(_)}else se(_,L,n)}else{if(r.getExitProcess()&&tt(!0),c||(c=!0,o&&(r.showHelp("error"),F.error()),(_||L)&&F.error(_||L),s&&((_||L)&&F.error(""),F.error(s))),L=L||new ne(_),r.getExitProcess())return r.exit(1);if(r.getInternalMethods().hasParseCallback())return r.exit(1,L);throw L}};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(_,L,F,ee,se=!1){F&&(l=l.map(Y=>(Y[2]=!1,Y))),l.push([_,L||"",F,ee,se])},n.getCommands=()=>l;let b={};n.describe=function(_,L){Array.isArray(_)?_.forEach(F=>{n.describe(F,L)}):typeof _=="object"?Object.keys(_).forEach(F=>{n.describe(F,_[F])}):b[_]=L},n.getDescriptions=()=>b;let g=[];n.epilog=$=>{g.push($)};let w=!1,d;n.wrap=$=>{w=!0,d=$};function S(){return w||(d=Xe(),w=!0),d}let N="__yargsString__:";n.deferY18nLookup=$=>N+$,n.help=function(){if(W)return W;G();let _=r.customScriptName?r.$0:e.path.basename(r.$0),L=r.getDemandedOptions(),F=r.getDemandedCommands(),ee=r.getDeprecatedOptions(),se=r.getGroups(),Y=r.getOptions(),ue=[];ue=ue.concat(Object.keys(b)),ue=ue.concat(Object.keys(L)),ue=ue.concat(Object.keys(F)),ue=ue.concat(Object.keys(Y.default)),ue=ue.filter(Ye),ue=Object.keys(ue.reduce((D,J)=>(J!=="_"&&(D[J]=!0),D),{}));let Je=S(),Z=e.cliui({width:Je,wrap:!!Je});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
|
+
`: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(),J=D.commands.length?`${D.commands.join(" ")} `:"";r.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(l=l.sort((K,B)=>K[0].localeCompare(B[0]))),l.forEach(K=>{let B=`${_} ${J}${K[0].replace(/^\$0 ?/,"")}`;Z.span({text:B,padding:[0,2,0,2],width:A(l,Je,`${_}${J}`)+4},{text:K[1]});let le=[];K[2]&&le.push(`[${t("default")}]`),K[3]&&K[3].length&&le.push(`[${t("aliases:")} ${K[3].join(", ")}]`),K[4]&&(typeof K[4]=="string"?le.push(`[${t("deprecated: %s",K[4])}]`):le.push(`[${t("deprecated")}]`)),le.length?Z.div({text:le.join(" "),padding:[0,0,0,2],align:"right"}):Z.div()}),Z.div()}let He=(Object.keys(Y.alias)||[]).concat(Object.keys(r.parsed.newAliases)||[]);ue=ue.filter(D=>!r.parsed.newAliases[D]&&He.every(J=>(Y.alias[J]||[]).indexOf(D)===-1));let It=t("Options:");se[It]||(se[It]=[]),xe(ue,Y.alias,se,It);let T=D=>/^--/.test(mr(D)),Et=Object.keys(se).filter(D=>se[D].length>0).map(D=>{let J=se[D].filter(Ye).map(K=>{if(~He.indexOf(K))return K;for(let B=0,le;(le=He[B])!==void 0;B++)if(~(Y.alias[le]||[]).indexOf(K))return le;return K});return{groupName:D,normalizedKeys:J}}).filter(({normalizedKeys:D})=>D.length>0).map(({groupName:D,normalizedKeys:J})=>{let K=J.reduce((B,le)=>(B[le]=[le].concat(Y.alias[le]||[]).map(Se=>D===n.getPositionalGroupName()?Se:(/^[0-9]$/.test(Se)?~Y.boolean.indexOf(le)?"-":"--":Se.length>1?"--":"-")+Se).sort((Se,fe)=>T(Se)===T(fe)?0:T(Se)?1:-1).join(", "),B),{});return{groupName:D,normalizedKeys:J,switches:K}});if(Et.filter(({groupName:D})=>D!==n.getPositionalGroupName()).some(({normalizedKeys:D,switches:J})=>!D.every(K=>T(J[K])))&&Et.filter(({groupName:D})=>D!==n.getPositionalGroupName()).forEach(({normalizedKeys:D,switches:J})=>{D.forEach(K=>{T(J[K])&&(J[K]=vf(J[K],4))})}),Et.forEach(({groupName:D,normalizedKeys:J,switches:K})=>{Z.div(D),J.forEach(B=>{let le=K[B],Se=b[B]||"",fe=null;~Se.lastIndexOf(N)&&(Se=t(Se.substring(N.length))),~Y.boolean.indexOf(B)&&(fe=`[${t("boolean")}]`),~Y.count.indexOf(B)&&(fe=`[${t("count")}]`),~Y.string.indexOf(B)&&(fe=`[${t("string")}]`),~Y.normalize.indexOf(B)&&(fe=`[${t("string")}]`),~Y.array.indexOf(B)&&(fe=`[${t("array")}]`),~Y.number.indexOf(B)&&(fe=`[${t("number")}]`);let Rr=m=>typeof m=="string"?`[${t("deprecated: %s",m)}]`:`[${t("deprecated")}]`,f=[B in ee?Rr(ee[B]):null,fe,B in L?`[${t("required")}]`:null,Y.choices&&Y.choices[B]?`[${t("choices:")} ${n.stringifiedValues(Y.choices[B])}]`:null,Ke(Y.default[B],Y.defaultDescription[B])].filter(Boolean).join(" ");Z.span({text:mr(le),padding:[0,2,0,2+So(le)],width:A(K,Je)+4},Se),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:A(h,Je)+4},{text:D[1]})}),Z.div()),g.length>0){let D=g.map(J=>J.replace(/\$0/g,_)).join(`
|
|
19
|
+
`);Z.div(`${D}
|
|
20
|
+
`)}return Z.toString().replace(/\s*$/,"")};function A($,_,L){let F=0;return Array.isArray($)||($=Object.values($).map(ee=>[ee])),$.forEach(ee=>{F=Math.max(e.stringWidth(L?`${L} ${mr(ee[0])}`:mr(ee[0]))+So(ee[0]),F)}),_&&(F=Math.min(F,parseInt((_*.5).toString(),10))),F}function G(){let $=r.getDemandedOptions(),_=r.getOptions();(Object.keys(_.alias)||[]).forEach(L=>{_.alias[L].forEach(F=>{b[F]&&n.describe(L,b[F]),F in $&&r.demandOption(L,$[F]),~_.boolean.indexOf(F)&&r.boolean(L),~_.count.indexOf(F)&&r.count(L),~_.string.indexOf(F)&&r.string(L),~_.normalize.indexOf(F)&&r.normalize(L),~_.array.indexOf(F)&&r.array(L),~_.number.indexOf(F)&&r.number(L)})})}let W;n.cacheHelpMessage=function(){W=this.help()},n.clearCachedHelpMessage=function(){W=void 0},n.hasCachedHelpMessage=function(){return!!W};function xe($,_,L,F){let ee=[],se=null;return Object.keys(L).forEach(Y=>{ee=ee.concat(L[Y])}),$.forEach(Y=>{se=[Y].concat(_[Y]),se.some(ue=>ee.indexOf(ue)!==-1)||L[F].push(Y)}),ee}function Ye($){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(_,L){let F="",ee=L||", ",se=[].concat(_);return!_||!se.length||se.forEach(Y=>{F.length&&(F+=ee),F+=JSON.stringify(Y)}),F};function Ke($,_){let L=`[${t("default:")} `;if($===void 0&&!_)return null;if(_)L+=_;else switch(typeof $){case"string":L+=`"${$}"`;break;case"object":L+=JSON.stringify($);break;default:L+=$}return`${L}]`}function Xe(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let V=null;n.version=$=>{V=$},n.showVersion=$=>{let _=r.getInternalMethods().getLoggerInstance();$||($="error"),(typeof $=="function"?$:_[$])(V)},n.reset=function(_){return s=null,c=!1,u=[],p=!1,g=[],h=[],l=[],b=et(b,L=>!_[L]),n};let We=[];return n.freeze=function(){We.push({failMessage:s,failureOutput:c,usages:u,usageDisabled:p,epilogs:g,examples:h,commands:l,descriptions:b})},n.unfreeze=function(){let _=We.pop();_&&({failMessage:s,failureOutput:c,usages:u,usageDisabled:p,epilogs:g,examples:h,commands:l,descriptions:b}=_)},n}function un(r){return typeof r=="object"}function vf(r,e){return un(r)?{text:r.text,indentation:r.indentation+e}:{text:r,indentation:e}}function So(r){return un(r)?r.indentation:0}function mr(r){return un(r)?r.text:r}var xo=`###-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
|
+
`,Ro=`#compdef {{app_name}}
|
|
49
49
|
###-begin-{{app_name}}-completions-###
|
|
50
50
|
#
|
|
51
51
|
# yargs command completion script
|
|
@@ -64,89 +64,94 @@ _{{app_name}}_yargs_completions()
|
|
|
64
64
|
}
|
|
65
65
|
compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
66
66
|
###-end-{{app_name}}-completions-###
|
|
67
|
-
`;var
|
|
67
|
+
`;var fn=class{constructor(e,t,n,i){var s,o,c;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=(c=((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&&c!==void 0?c:!1}defaultCompletion(e,t,n,i){let s=this.command.getCommandHandlers();for(let c=0,u=e.length;c<u;++c)if(s[e[c]]&&s[e[c]].builder){let p=s[e[c]].builder;if(hr(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=Ze(s[0]).cmd;if(t.indexOf(o)===-1)if(!this.zshShell)e.push(o);else{let c=s[1]||"";e.push(o.replace(/:/g,"\\:")+":"+c)}})}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(c=>{let u=!!s.configuration["boolean-negation"]&&s.boolean.includes(c);!o.includes(c)&&!this.argsContainKey(t,n,c,u)&&(this.completeOptionKey(c,e,i),u&&s.default[c]&&this.completeOptionKey(`no-${c}`,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),c=!s(n)&&o(e)?"-":"--";if(!this.zshShell)t.push(c+e);else{let u=i[e]||"";t.push(c+`${e.replace(/:/g,"\\:")}:${u.replace("__yargsString__:","")}`)}}customCompletion(e,t,n,i){if(_e(this.customCompletionFunction,null,this.shim),$f(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 If(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?Ro:xo,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 vo(r,e,t,n){return new fn(r,e,t,n)}function $f(r){return r.length<3}function If(r){return r.length>3}function jo(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 $o=["$0","--","_"];function Io(r,e,t){let n=t.y18n.__,i=t.y18n.__n,s={};s.nonOptionCount=function(l){let b=r.getDemandedCommands(),w=l._.length+(l["--"]?l["--"].length:0)-r.getInternalMethods().getContext().commands.length;b._&&(w<b._.min||w>b._.max)&&(w<b._.min?b._.minMsg!==void 0?e.fail(b._.minMsg?b._.minMsg.replace(/\$0/g,w.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",w,w.toString(),b._.min.toString())):w>b._.max&&(b._.maxMsg!==void 0?e.fail(b._.maxMsg?b._.maxMsg.replace(/\$0/g,w.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",w,w.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 g=null;for(let w of Object.keys(b))(!Object.prototype.hasOwnProperty.call(l,w)||typeof l[w]>"u")&&(g=g||{},g[w]=b[w]);if(g){let w=[];for(let S of Object.keys(g)){let N=g[S];N&&w.indexOf(N)<0&&w.push(N)}let d=w.length?`
|
|
68
68
|
${w.join(`
|
|
69
|
-
`)}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(
|
|
70
|
-
${n("Argument: %s, Given: %s, Choices: %s",
|
|
71
|
-
`;b.forEach(w=>{m+=w}),e.fail(m)}};let u={};s.conflicts=function(l,b){$("<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((C,A)=>A.length-C.length);let w=null,d=1/0;for(let C=0,A;(A=b[C])!==void 0;C++){let S=Co(l,A);S<=3&&S<d&&(d=S,w=A)}w&&e.fail(n("Did you mean %s?",w))},s.reset=function(l){return o=et(o,b=>!l[b]),u=et(u,b=>!l[b]),s};let p=[];return s.freeze=function(){p.push({implied:o,conflicting:u})},s.unfreeze=function(){let l=p.pop();Ae(l,void 0,t),{implied:o,conflicting:u}=l},s}var ln=[],Ft;function zt(r,e,t,n){Ft=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=Rf(e,r.extends);else try{o=Ue.resolve(r.extends)}catch{return r}xf(o),ln.push(o),i=s?JSON.parse(Ft.readFileSync(o,"utf8")):Ue(r.extends),delete r.extends,i=zt(i,Ft.path.dirname(o),t,Ft)}return ln=[],t?vo(i,r):Object.assign({},i,r)}function xf(r){if(ln.indexOf(r)>-1)throw new re(`Circular extended configurations: '${r}'.`)}function Rf(r,e){return Ft.path.resolve(r,e)}function vo(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]=vo(r[i],e[i]):t[i]=e[i];return t}var P=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},a=function(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)},ce,lt,Ut,Ne,ve,hr,rt,ut,Te,mr,qe,We,je,De,St,he,L,gr,yr,$e,ft,Ct,dt,nt,br,M,pt,ht,mt,U,Be,oe;function Ho(r){return(e=[],t=r.process.cwd(),n)=>{let i=new wn(e,t,n,r);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var jo=Symbol("copyDoubleDash"),$o=Symbol("copyDoubleDash"),un=Symbol("deleteFromParserHintObject"),Io=Symbol("freeze"),Po=Symbol("getDollarZero"),gt=Symbol("getParserConfiguration"),fn=Symbol("guessLocale"),Lo=Symbol("guessVersion"),No=Symbol("parsePositionalNumbers"),dn=Symbol("pkgUp"),it=Symbol("populateParserHintArray"),xt=Symbol("populateParserHintSingleValueDictionary"),pn=Symbol("populateParserHintArrayDictionary"),hn=Symbol("populateParserHintDictionary"),mn=Symbol("sanitizeKey"),gn=Symbol("setKey"),yn=Symbol("unfreeze"),To=Symbol("validateAsync"),qo=Symbol("getCommandInstance"),Do=Symbol("getContext"),Mo=Symbol("getHasOutput"),Fo=Symbol("getLoggerInstance"),zo=Symbol("getParseContext"),Uo=Symbol("getUsageInstance"),Go=Symbol("getValidationInstance"),Er=Symbol("hasParseCallback"),yt=Symbol("postProcess"),Wo=Symbol("rebase"),bn=Symbol("reset"),Gt=Symbol("runYargsParserAndExecuteCommands"),En=Symbol("runValidation"),ko=Symbol("setHasOutput"),wn=class{constructor(e=[],t,n,i){this.customScriptName=!1,this.parsed=!1,ce.set(this,void 0),lt.set(this,void 0),Ut.set(this,{commands:[],fullCommands:[]}),Ne.set(this,null),ve.set(this,null),hr.set(this,"show-hidden"),rt.set(this,null),ut.set(this,!0),Te.set(this,!0),mr.set(this,[]),qe.set(this,void 0),We.set(this,{}),je.set(this,!1),De.set(this,null),St.set(this,void 0),he.set(this,""),L.set(this,void 0),gr.set(this,void 0),yr.set(this,{}),$e.set(this,null),ft.set(this,null),Ct.set(this,{}),dt.set(this,{}),nt.set(this,void 0),br.set(this,!1),M.set(this,void 0),pt.set(this,!1),ht.set(this,!1),mt.set(this,!1),U.set(this,void 0),Be.set(this,null),oe.set(this,void 0),P(this,M,i),P(this,nt,e),P(this,lt,t),P(this,gr,n),P(this,qe,new fr(this)),this.$0=this[Po](),this[bn](),P(this,ce,a(this,ce)),P(this,U,a(this,U)),P(this,oe,a(this,oe)),P(this,L,a(this,L)),a(this,L).showHiddenOpt=a(this,hr),P(this,St,this[$o]())}addHelpOpt(e,t){let n="help";return $("[string|boolean] [string]",[e,t],arguments.length),a(this,De)&&(this[un](a(this,De)),P(this,De,null)),e===!1&&t===void 0?this:(P(this,De,typeof e=="string"?e:n),this.boolean(a(this,De)),this.describe(a(this,De),t||a(this,U).deferY18nLookup("Show help")),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if($("[string|boolean] [string]",[e,t],arguments.length),e===!1&&t===void 0)return this;let n=typeof e=="string"?e:a(this,hr);return this.boolean(n),this.describe(n,t||a(this,U).deferY18nLookup("Show hidden options")),a(this,L).showHiddenOpt=n,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return $("<object|string|array> [string|array]",[e,t],arguments.length),this[pn](this.alias.bind(this),"alias",e,t),this}array(e){return $("<array|string>",[e],arguments.length),this[it]("array",e),this}boolean(e){return $("<array|string>",[e],arguments.length),this[it]("boolean",e),this}check(e,t){return $("<function> [boolean]",[e,t],arguments.length),this.middleware((n,i)=>ct(()=>e(n),s=>(s?(typeof s=="string"||s instanceof Error)&&a(this,U).fail(s.toString(),s):a(this,U).fail(a(this,M).y18n.__("Argument check failed: %s",e.toString())),n),s=>(a(this,U).fail(s.message?s.message:s.toString(),s),n)),!1,t),this}choices(e,t){return $("<object|string|array> [string|array]",[e,t],arguments.length),this[pn](this.choices.bind(this),"choices",e,t),this}coerce(e,t){if($("<object|string|array> [function]",[e,t],arguments.length),Array.isArray(e)){if(!t)throw new re("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 re("coerce callback must be provided");return a(this,L).key[e]=!0,a(this,qe).addCoerceMiddleware((n,i)=>{let s;return ct(()=>(s=i.getAliases(),t(n[e])),o=>{if(n[e]=o,s[e])for(let c of s[e])n[c]=o;return n},o=>{throw new re(o.message)})},e),this}conflicts(e,t){return $("<string|object> [string|array]",[e,t],arguments.length),a(this,oe).conflicts(e,t),this}config(e="config",t,n){return $("[object|string] [string|function] [function]",[e,t,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=zt(e,a(this,lt),this[gt]()["deep-merge-config"]||!1,a(this,M)),a(this,L).configObjects=(a(this,L).configObjects||[]).concat(e),this):(typeof t=="function"&&(n=t,t=void 0),this.describe(e,t||a(this,U).deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{a(this,L).config[i]=n||!0}),this)}completion(e,t,n){return $("[string] [string|boolean|function] [function]",[e,t,n],arguments.length),typeof t=="function"&&(n=t,t=void 0),P(this,ve,e||a(this,ve)||"completion"),!t&&t!==!1&&(t="generate completion script"),this.command(a(this,ve),t),n&&a(this,Ne).registerFunction(n),this}command(e,t,n,i,s,o){return $("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,n,i,s,o],arguments.length),a(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){$("<string> [object]",[e,t],arguments.length);let n=a(this,gr)||a(this,M).require;return a(this,ce).addDirectory(e,n,a(this,M).getCallerFile(),t),this}count(e){return $("<array|string>",[e],arguments.length),this[it]("count",e),this}default(e,t,n){return $("<object|string|array> [*] [string]",[e,t,n],arguments.length),n&&(nn(e,a(this,M)),a(this,L).defaultDescription[e]=n),typeof t=="function"&&(nn(e,a(this,M)),a(this,L).defaultDescription[e]||(a(this,L).defaultDescription[e]=a(this,U).functionDescription(t)),t=t.call()),this[xt](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 $("[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),a(this,L).demandedCommands._={min:e,max:t,minMsg:n,maxMsg:i},this}demand(e,t,n){return Array.isArray(t)?(t.forEach(i=>{Ae(n,!0,a(this,M)),this.demandOption(i,n)}),t=1/0):typeof t!="number"&&(n=t,t=1/0),typeof e=="number"?(Ae(n,!0,a(this,M)),this.demandCommand(e,t,n,n)):Array.isArray(e)?e.forEach(i=>{Ae(n,!0,a(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 $("<object|string|array> [string]",[e,t],arguments.length),this[xt](this.demandOption.bind(this),"demandedOptions",e,t),this}deprecateOption(e,t){return $("<string> [string|boolean]",[e,t],arguments.length),a(this,L).deprecatedOptions[e]=t,this}describe(e,t){return $("<object|string|array> [string]",[e,t],arguments.length),this[gn](e,!0),a(this,U).describe(e,t),this}detectLocale(e){return $("<boolean>",[e],arguments.length),P(this,ut,e),this}env(e){return $("[string|boolean]",[e],arguments.length),e===!1?delete a(this,L).envPrefix:a(this,L).envPrefix=e||"",this}epilogue(e){return $("<string>",[e],arguments.length),a(this,U).epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return $("<string|array> [string]",[e,t],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):a(this,U).example(e,t),this}exit(e,t){P(this,je,!0),P(this,rt,t),a(this,Te)&&a(this,M).process.exit(e)}exitProcess(e=!0){return $("[boolean]",[e],arguments.length),P(this,Te,e),this}fail(e){if($("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new re("Invalid first argument. Expected function or boolean 'false'");return a(this,U).failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return $("<array> [function]",[e,t],arguments.length),t?a(this,Ne).getCompletion(e,t):new Promise((n,i)=>{a(this,Ne).getCompletion(e,(s,o)=>{s?i(s):n(o)})})}getDemandedOptions(){return $([],0),a(this,L).demandedOptions}getDemandedCommands(){return $([],0),a(this,L).demandedCommands}getDeprecatedOptions(){return $([],0),a(this,L).deprecatedOptions}getDetectLocale(){return a(this,ut)}getExitProcess(){return a(this,Te)}getGroups(){return Object.assign({},a(this,We),a(this,dt))}getHelp(){if(P(this,je,!0),!a(this,U).hasCachedHelpMessage()){if(!this.parsed){let t=this[Gt](a(this,nt),void 0,void 0,0,!0);if(ie(t))return t.then(()=>a(this,U).help())}let e=a(this,ce).runDefaultBuilderOn(this);if(ie(e))return e.then(()=>a(this,U).help())}return Promise.resolve(a(this,U).help())}getOptions(){return a(this,L)}getStrict(){return a(this,pt)}getStrictCommands(){return a(this,ht)}getStrictOptions(){return a(this,mt)}global(e,t){return $("<string|array> [boolean]",[e,t],arguments.length),e=[].concat(e),t!==!1?a(this,L).local=a(this,L).local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{a(this,L).local.indexOf(n)===-1&&a(this,L).local.push(n)}),this}group(e,t){$("<string|array> <string>",[e,t],arguments.length);let n=a(this,dt)[t]||a(this,We)[t];a(this,dt)[t]&&delete a(this,dt)[t];let i={};return a(this,We)[t]=(n||[]).concat(e).filter(s=>i[s]?!1:i[s]=!0),this}hide(e){return $("<string>",[e],arguments.length),a(this,L).hiddenOptions.push(e),this}implies(e,t){return $("<string|object> [number|string|array]",[e,t],arguments.length),a(this,oe).implies(e,t),this}locale(e){return $("[string]",[e],arguments.length),e?(P(this,ut,!1),a(this,M).y18n.setLocale(e),this):(this[fn](),a(this,M).y18n.getLocale())}middleware(e,t,n){return a(this,qe).addMiddleware(e,!!t,n)}nargs(e,t){return $("<string|object|array> [number]",[e,t],arguments.length),this[xt](this.nargs.bind(this),"narg",e,t),this}normalize(e){return $("<array|string>",[e],arguments.length),this[it]("normalize",e),this}number(e){return $("<array|string>",[e],arguments.length),this[it]("number",e),this}option(e,t){if($("<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={}),a(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&&(a(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){$("[string|array] [function|boolean|object] [function]",[e,t,n],arguments.length),this[Io](),typeof e>"u"&&(e=a(this,nt)),typeof t=="object"&&(P(this,ft,t),t=n),typeof t=="function"&&(P(this,$e,t),t=!1),t||P(this,nt,e),a(this,$e)&&P(this,Te,!1);let i=this[Gt](e,!!t),s=this.parsed;return a(this,Ne).setParsed(this.parsed),ie(i)?i.then(o=>(a(this,$e)&&a(this,$e).call(this,a(this,rt),o,a(this,he)),o)).catch(o=>{throw a(this,$e)&&a(this,$e)(o,this.parsed.argv,a(this,he)),o}).finally(()=>{this[yn](),this.parsed=s}):(a(this,$e)&&a(this,$e).call(this,a(this,rt),i,a(this,he)),this[yn](),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 re(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return $("<object>",[e],arguments.length),P(this,yr,e),this}pkgConf(e,t){$("<string> [string]",[e,t],arguments.length);let n=null,i=this[dn](t||a(this,lt));return i[e]&&typeof i[e]=="object"&&(n=zt(i[e],t||a(this,lt),this[gt]()["deep-merge-config"]||!1,a(this,M)),a(this,L).configObjects=(a(this,L).configObjects||[]).concat(n)),this}positional(e,t){$("<string> <object>",[e,t],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=et(t,(o,c)=>{let u=n.indexOf(o)!==-1;return o==="type"&&["string","number","boolean"].indexOf(c)===-1&&(u=!1),u});let i=a(this,Ut).fullCommands[a(this,Ut).fullCommands.length-1],s=i?a(this,ce).cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return At(s).forEach(o=>{let c=s[o];Array.isArray(c)?c.indexOf(e)!==-1&&(t[o]=!0):c[e]&&!(o in t)&&(t[o]=c[e])}),this.group(e,a(this,U).getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return $("[boolean]",[e],arguments.length),P(this,br,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 $("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&a(this,L).narg[e]?this:(this[xt](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,t){return $("[string] [string]",[e,t],arguments.length),e=e||this.$0,a(this,St).log(a(this,Ne).generateCompletionScript(e,t||a(this,ve)||"completion")),this}showHelp(e){if($("[string|function]",[e],arguments.length),P(this,je,!0),!a(this,U).hasCachedHelpMessage()){if(!this.parsed){let n=this[Gt](a(this,nt),void 0,void 0,0,!0);if(ie(n))return n.then(()=>{a(this,U).showHelp(e)}),this}let t=a(this,ce).runDefaultBuilderOn(this);if(ie(t))return t.then(()=>{a(this,U).showHelp(e)}),this}return a(this,U).showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return $("[boolean|string] [string]",[e,t],arguments.length),a(this,U).showHelpOnFail(e,t),this}showVersion(e){return $("[string|function]",[e],arguments.length),a(this,U).showVersion(e),this}skipValidation(e){return $("<array|string>",[e],arguments.length),this[it]("skipValidation",e),this}strict(e){return $("[boolean]",[e],arguments.length),P(this,pt,e!==!1),this}strictCommands(e){return $("[boolean]",[e],arguments.length),P(this,ht,e!==!1),this}strictOptions(e){return $("[boolean]",[e],arguments.length),P(this,mt,e!==!1),this}string(e){return $("<array|string>",[e],arguments.length),this[it]("string",e),this}terminalWidth(){return $([],0),a(this,M).process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return $("<object>",[e],arguments.length),P(this,ut,!1),a(this,M).y18n.updateLocale(e),this}usage(e,t,n,i){if($("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,n,i],arguments.length),t!==void 0){if(Ae(e,null,a(this,M)),(e||"").match(/^\$0( |$)/))return this.command(e,t,n,i);throw new re(".usage() description must start with $0 if being used as alias for .command()")}else return a(this,U).usage(e),this}version(e,t,n){let i="version";if($("[boolean|string] [string] [string]",[e,t,n],arguments.length),a(this,Be)&&(this[un](a(this,Be)),a(this,U).version(void 0),P(this,Be,null)),arguments.length===0)n=this[Lo](),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 P(this,Be,typeof e=="string"?e:i),t=t||a(this,U).deferY18nLookup("Show version number"),a(this,U).version(n||void 0),this.boolean(a(this,Be)),this.describe(a(this,Be),t),this}wrap(e){return $("<number|null|undefined>",[e],arguments.length),a(this,U).wrap(e),this}[(ce=new WeakMap,lt=new WeakMap,Ut=new WeakMap,Ne=new WeakMap,ve=new WeakMap,hr=new WeakMap,rt=new WeakMap,ut=new WeakMap,Te=new WeakMap,mr=new WeakMap,qe=new WeakMap,We=new WeakMap,je=new WeakMap,De=new WeakMap,St=new WeakMap,he=new WeakMap,L=new WeakMap,gr=new WeakMap,yr=new WeakMap,$e=new WeakMap,ft=new WeakMap,Ct=new WeakMap,dt=new WeakMap,nt=new WeakMap,br=new WeakMap,M=new WeakMap,pt=new WeakMap,ht=new WeakMap,mt=new WeakMap,U=new WeakMap,Be=new WeakMap,oe=new WeakMap,jo)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[$o](){return{log:(...e)=>{this[Er]()||console.log(...e),P(this,je,!0),a(this,he).length&&P(this,he,a(this,he)+`
|
|
72
|
-
`),
|
|
73
|
-
`),
|
|
74
|
-
\u274C The ejectable generator sources are missing from ${
|
|
75
|
-
In a checkout of the CLI, build them first: npm run prepare -w ${
|
|
76
|
-
`)}function
|
|
69
|
+
`)}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(g).length,Object.keys(g).join(", ")+d))}},s.unknownArguments=function(l,b,g,w,d=!0){let S=r.getInternalMethods().getCommandInstance().getCommands(),N=[],A=r.getInternalMethods().getContext();Object.keys(l).forEach(G=>{$o.indexOf(G)===-1&&!Object.prototype.hasOwnProperty.call(g,G)&&!Object.prototype.hasOwnProperty.call(r.getInternalMethods().getParseContext(),G)&&!s.isValidAndSomeAliasIsNotNew(G,b)&&N.push(G)}),d&&(A.commands.length>0||S.length>0||w)&&l._.slice(A.commands.length).forEach(G=>{S.indexOf(""+G)===-1&&N.push(""+G)}),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(),g=[],w=r.getInternalMethods().getContext();return(w.commands.length>0||b.length>0)&&l._.slice(w.commands.length).forEach(d=>{b.indexOf(""+d)===-1&&g.push(""+d)}),g.length>0?(e.fail(i("Unknown command: %s","Unknown commands: %s",g.length,g.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(l,b){if(!Object.prototype.hasOwnProperty.call(b,l))return!1;let g=r.parsed.newAliases;return[l,...b[l]].some(w=>!Object.prototype.hasOwnProperty.call(g,w)||!g[l])},s.limitedChoices=function(l){let b=r.getOptions(),g={};if(!Object.keys(b.choices).length)return;Object.keys(l).forEach(S=>{$o.indexOf(S)===-1&&Object.prototype.hasOwnProperty.call(b.choices,S)&&[].concat(l[S]).forEach(N=>{b.choices[S].indexOf(N)===-1&&N!==void 0&&(g[S]=(g[S]||[]).concat(N))})});let w=Object.keys(g);if(!w.length)return;let d=n("Invalid values:");w.forEach(S=>{d+=`
|
|
70
|
+
${n("Argument: %s, Given: %s, Choices: %s",S,e.stringifiedValues(g[S]),e.stringifiedValues(b.choices[S]))}`}),e.fail(d)};let o={};s.implies=function(l,b){j("<string|object> [array|number|string]",[l,b],arguments.length),typeof l=="object"?Object.keys(l).forEach(g=>{s.implies(g,l[g])}):(r.global(l),o[l]||(o[l]=[]),Array.isArray(b)?b.forEach(g=>s.implies(l,g)):(_e(b,void 0,t),o[l].push(b)))},s.getImplied=function(){return o};function c(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(g=>{let w=g;(o[g]||[]).forEach(d=>{let S=w,N=d;S=c(l,S),d=c(l,d),S&&!d&&b.push(` ${w} -> ${N}`)})}),b.length){let g=`${n("Implications failed:")}
|
|
71
|
+
`;b.forEach(w=>{g+=w}),e.fail(g)}};let u={};s.conflicts=function(l,b){j("<string|object> [array|string]",[l,b],arguments.length),typeof l=="object"?Object.keys(l).forEach(g=>{s.conflicts(g,l[g])}):(r.global(l),u[l]||(u[l]=[]),Array.isArray(b)?b.forEach(g=>s.conflicts(l,g)):u[l].push(b))},s.getConflicting=()=>u,s.conflicting=function(l){Object.keys(l).forEach(b=>{u[b]&&u[b].forEach(g=>{g&&l[b]!==void 0&&l[g]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",b,g))})})},s.recommendCommands=function(l,b){b=b.sort((S,N)=>N.length-S.length);let w=null,d=1/0;for(let S=0,N;(N=b[S])!==void 0;S++){let A=jo(l,N);A<=3&&A<d&&(d=A,w=N)}w&&e.fail(n("Did you mean %s?",w))},s.reset=function(l){return o=et(o,b=>!l[b]),u=et(u,b=>!l[b]),s};let p=[];return s.freeze=function(){p.push({implied:o,conflicting:u})},s.unfreeze=function(){let l=p.pop();_e(l,void 0,t),{implied:o,conflicting:u}=l},s}var dn=[],Ft;function zt(r,e,t,n){Ft=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=Lf(e,r.extends);else try{o=Ue.resolve(r.extends)}catch{return r}Pf(o),dn.push(o),i=s?JSON.parse(Ft.readFileSync(o,"utf8")):Ue(r.extends),delete r.extends,i=zt(i,Ft.path.dirname(o),t,Ft)}return dn=[],t?Po(i,r):Object.assign({},i,r)}function Pf(r){if(dn.indexOf(r)>-1)throw new ne(`Circular extended configurations: '${r}'.`)}function Lf(r,e){return Ft.path.resolve(r,e)}function Po(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]=Po(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},a=function(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)},ce,lt,Ut,Ne,ve,gr,rt,ut,Te,yr,De,ke,je,qe,St,he,P,br,Er,$e,ft,Ct,dt,nt,wr,M,pt,ht,mt,U,Be,oe;function Ko(r){return(e=[],t=r.process.cwd(),n)=>{let i=new _n(e,t,n,r);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var Lo=Symbol("copyDoubleDash"),No=Symbol("copyDoubleDash"),pn=Symbol("deleteFromParserHintObject"),To=Symbol("freeze"),Do=Symbol("getDollarZero"),gt=Symbol("getParserConfiguration"),hn=Symbol("guessLocale"),qo=Symbol("guessVersion"),Mo=Symbol("parsePositionalNumbers"),mn=Symbol("pkgUp"),it=Symbol("populateParserHintArray"),xt=Symbol("populateParserHintSingleValueDictionary"),gn=Symbol("populateParserHintArrayDictionary"),yn=Symbol("populateParserHintDictionary"),bn=Symbol("sanitizeKey"),En=Symbol("setKey"),wn=Symbol("unfreeze"),Fo=Symbol("validateAsync"),zo=Symbol("getCommandInstance"),Uo=Symbol("getContext"),Go=Symbol("getHasOutput"),ko=Symbol("getLoggerInstance"),Wo=Symbol("getParseContext"),Ho=Symbol("getUsageInstance"),Vo=Symbol("getValidationInstance"),Or=Symbol("hasParseCallback"),yt=Symbol("postProcess"),Bo=Symbol("rebase"),On=Symbol("reset"),Gt=Symbol("runYargsParserAndExecuteCommands"),An=Symbol("runValidation"),Yo=Symbol("setHasOutput"),_n=class{constructor(e=[],t,n,i){this.customScriptName=!1,this.parsed=!1,ce.set(this,void 0),lt.set(this,void 0),Ut.set(this,{commands:[],fullCommands:[]}),Ne.set(this,null),ve.set(this,null),gr.set(this,"show-hidden"),rt.set(this,null),ut.set(this,!0),Te.set(this,!0),yr.set(this,[]),De.set(this,void 0),ke.set(this,{}),je.set(this,!1),qe.set(this,null),St.set(this,void 0),he.set(this,""),P.set(this,void 0),br.set(this,void 0),Er.set(this,{}),$e.set(this,null),ft.set(this,null),Ct.set(this,{}),dt.set(this,{}),nt.set(this,void 0),wr.set(this,!1),M.set(this,void 0),pt.set(this,!1),ht.set(this,!1),mt.set(this,!1),U.set(this,void 0),Be.set(this,null),oe.set(this,void 0),I(this,M,i),I(this,nt,e),I(this,lt,t),I(this,br,n),I(this,De,new pr(this)),this.$0=this[Do](),this[On](),I(this,ce,a(this,ce)),I(this,U,a(this,U)),I(this,oe,a(this,oe)),I(this,P,a(this,P)),a(this,P).showHiddenOpt=a(this,gr),I(this,St,this[No]())}addHelpOpt(e,t){let n="help";return j("[string|boolean] [string]",[e,t],arguments.length),a(this,qe)&&(this[pn](a(this,qe)),I(this,qe,null)),e===!1&&t===void 0?this:(I(this,qe,typeof e=="string"?e:n),this.boolean(a(this,qe)),this.describe(a(this,qe),t||a(this,U).deferY18nLookup("Show help")),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(j("[string|boolean] [string]",[e,t],arguments.length),e===!1&&t===void 0)return this;let n=typeof e=="string"?e:a(this,gr);return this.boolean(n),this.describe(n,t||a(this,U).deferY18nLookup("Show hidden options")),a(this,P).showHiddenOpt=n,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return j("<object|string|array> [string|array]",[e,t],arguments.length),this[gn](this.alias.bind(this),"alias",e,t),this}array(e){return j("<array|string>",[e],arguments.length),this[it]("array",e),this}boolean(e){return j("<array|string>",[e],arguments.length),this[it]("boolean",e),this}check(e,t){return j("<function> [boolean]",[e,t],arguments.length),this.middleware((n,i)=>ct(()=>e(n),s=>(s?(typeof s=="string"||s instanceof Error)&&a(this,U).fail(s.toString(),s):a(this,U).fail(a(this,M).y18n.__("Argument check failed: %s",e.toString())),n),s=>(a(this,U).fail(s.message?s.message:s.toString(),s),n)),!1,t),this}choices(e,t){return j("<object|string|array> [string|array]",[e,t],arguments.length),this[gn](this.choices.bind(this),"choices",e,t),this}coerce(e,t){if(j("<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 a(this,P).key[e]=!0,a(this,De).addCoerceMiddleware((n,i)=>{let s;return ct(()=>(s=i.getAliases(),t(n[e])),o=>{if(n[e]=o,s[e])for(let c of s[e])n[c]=o;return n},o=>{throw new ne(o.message)})},e),this}conflicts(e,t){return j("<string|object> [string|array]",[e,t],arguments.length),a(this,oe).conflicts(e,t),this}config(e="config",t,n){return j("[object|string] [string|function] [function]",[e,t,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=zt(e,a(this,lt),this[gt]()["deep-merge-config"]||!1,a(this,M)),a(this,P).configObjects=(a(this,P).configObjects||[]).concat(e),this):(typeof t=="function"&&(n=t,t=void 0),this.describe(e,t||a(this,U).deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{a(this,P).config[i]=n||!0}),this)}completion(e,t,n){return j("[string] [string|boolean|function] [function]",[e,t,n],arguments.length),typeof t=="function"&&(n=t,t=void 0),I(this,ve,e||a(this,ve)||"completion"),!t&&t!==!1&&(t="generate completion script"),this.command(a(this,ve),t),n&&a(this,Ne).registerFunction(n),this}command(e,t,n,i,s,o){return j("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,n,i,s,o],arguments.length),a(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){j("<string> [object]",[e,t],arguments.length);let n=a(this,br)||a(this,M).require;return a(this,ce).addDirectory(e,n,a(this,M).getCallerFile(),t),this}count(e){return j("<array|string>",[e],arguments.length),this[it]("count",e),this}default(e,t,n){return j("<object|string|array> [*] [string]",[e,t,n],arguments.length),n&&(an(e,a(this,M)),a(this,P).defaultDescription[e]=n),typeof t=="function"&&(an(e,a(this,M)),a(this,P).defaultDescription[e]||(a(this,P).defaultDescription[e]=a(this,U).functionDescription(t)),t=t.call()),this[xt](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 j("[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),a(this,P).demandedCommands._={min:e,max:t,minMsg:n,maxMsg:i},this}demand(e,t,n){return Array.isArray(t)?(t.forEach(i=>{_e(n,!0,a(this,M)),this.demandOption(i,n)}),t=1/0):typeof t!="number"&&(n=t,t=1/0),typeof e=="number"?(_e(n,!0,a(this,M)),this.demandCommand(e,t,n,n)):Array.isArray(e)?e.forEach(i=>{_e(n,!0,a(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 j("<object|string|array> [string]",[e,t],arguments.length),this[xt](this.demandOption.bind(this),"demandedOptions",e,t),this}deprecateOption(e,t){return j("<string> [string|boolean]",[e,t],arguments.length),a(this,P).deprecatedOptions[e]=t,this}describe(e,t){return j("<object|string|array> [string]",[e,t],arguments.length),this[En](e,!0),a(this,U).describe(e,t),this}detectLocale(e){return j("<boolean>",[e],arguments.length),I(this,ut,e),this}env(e){return j("[string|boolean]",[e],arguments.length),e===!1?delete a(this,P).envPrefix:a(this,P).envPrefix=e||"",this}epilogue(e){return j("<string>",[e],arguments.length),a(this,U).epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return j("<string|array> [string]",[e,t],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):a(this,U).example(e,t),this}exit(e,t){I(this,je,!0),I(this,rt,t),a(this,Te)&&a(this,M).process.exit(e)}exitProcess(e=!0){return j("[boolean]",[e],arguments.length),I(this,Te,e),this}fail(e){if(j("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new ne("Invalid first argument. Expected function or boolean 'false'");return a(this,U).failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return j("<array> [function]",[e,t],arguments.length),t?a(this,Ne).getCompletion(e,t):new Promise((n,i)=>{a(this,Ne).getCompletion(e,(s,o)=>{s?i(s):n(o)})})}getDemandedOptions(){return j([],0),a(this,P).demandedOptions}getDemandedCommands(){return j([],0),a(this,P).demandedCommands}getDeprecatedOptions(){return j([],0),a(this,P).deprecatedOptions}getDetectLocale(){return a(this,ut)}getExitProcess(){return a(this,Te)}getGroups(){return Object.assign({},a(this,ke),a(this,dt))}getHelp(){if(I(this,je,!0),!a(this,U).hasCachedHelpMessage()){if(!this.parsed){let t=this[Gt](a(this,nt),void 0,void 0,0,!0);if(ie(t))return t.then(()=>a(this,U).help())}let e=a(this,ce).runDefaultBuilderOn(this);if(ie(e))return e.then(()=>a(this,U).help())}return Promise.resolve(a(this,U).help())}getOptions(){return a(this,P)}getStrict(){return a(this,pt)}getStrictCommands(){return a(this,ht)}getStrictOptions(){return a(this,mt)}global(e,t){return j("<string|array> [boolean]",[e,t],arguments.length),e=[].concat(e),t!==!1?a(this,P).local=a(this,P).local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{a(this,P).local.indexOf(n)===-1&&a(this,P).local.push(n)}),this}group(e,t){j("<string|array> <string>",[e,t],arguments.length);let n=a(this,dt)[t]||a(this,ke)[t];a(this,dt)[t]&&delete a(this,dt)[t];let i={};return a(this,ke)[t]=(n||[]).concat(e).filter(s=>i[s]?!1:i[s]=!0),this}hide(e){return j("<string>",[e],arguments.length),a(this,P).hiddenOptions.push(e),this}implies(e,t){return j("<string|object> [number|string|array]",[e,t],arguments.length),a(this,oe).implies(e,t),this}locale(e){return j("[string]",[e],arguments.length),e?(I(this,ut,!1),a(this,M).y18n.setLocale(e),this):(this[hn](),a(this,M).y18n.getLocale())}middleware(e,t,n){return a(this,De).addMiddleware(e,!!t,n)}nargs(e,t){return j("<string|object|array> [number]",[e,t],arguments.length),this[xt](this.nargs.bind(this),"narg",e,t),this}normalize(e){return j("<array|string>",[e],arguments.length),this[it]("normalize",e),this}number(e){return j("<array|string>",[e],arguments.length),this[it]("number",e),this}option(e,t){if(j("<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={}),a(this,P).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&&(a(this,P).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){j("[string|array] [function|boolean|object] [function]",[e,t,n],arguments.length),this[To](),typeof e>"u"&&(e=a(this,nt)),typeof t=="object"&&(I(this,ft,t),t=n),typeof t=="function"&&(I(this,$e,t),t=!1),t||I(this,nt,e),a(this,$e)&&I(this,Te,!1);let i=this[Gt](e,!!t),s=this.parsed;return a(this,Ne).setParsed(this.parsed),ie(i)?i.then(o=>(a(this,$e)&&a(this,$e).call(this,a(this,rt),o,a(this,he)),o)).catch(o=>{throw a(this,$e)&&a(this,$e)(o,this.parsed.argv,a(this,he)),o}).finally(()=>{this[wn](),this.parsed=s}):(a(this,$e)&&a(this,$e).call(this,a(this,rt),i,a(this,he)),this[wn](),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 j("<object>",[e],arguments.length),I(this,Er,e),this}pkgConf(e,t){j("<string> [string]",[e,t],arguments.length);let n=null,i=this[mn](t||a(this,lt));return i[e]&&typeof i[e]=="object"&&(n=zt(i[e],t||a(this,lt),this[gt]()["deep-merge-config"]||!1,a(this,M)),a(this,P).configObjects=(a(this,P).configObjects||[]).concat(n)),this}positional(e,t){j("<string> <object>",[e,t],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=et(t,(o,c)=>{let u=n.indexOf(o)!==-1;return o==="type"&&["string","number","boolean"].indexOf(c)===-1&&(u=!1),u});let i=a(this,Ut).fullCommands[a(this,Ut).fullCommands.length-1],s=i?a(this,ce).cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return At(s).forEach(o=>{let c=s[o];Array.isArray(c)?c.indexOf(e)!==-1&&(t[o]=!0):c[e]&&!(o in t)&&(t[o]=c[e])}),this.group(e,a(this,U).getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return j("[boolean]",[e],arguments.length),I(this,wr,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 j("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&a(this,P).narg[e]?this:(this[xt](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,t){return j("[string] [string]",[e,t],arguments.length),e=e||this.$0,a(this,St).log(a(this,Ne).generateCompletionScript(e,t||a(this,ve)||"completion")),this}showHelp(e){if(j("[string|function]",[e],arguments.length),I(this,je,!0),!a(this,U).hasCachedHelpMessage()){if(!this.parsed){let n=this[Gt](a(this,nt),void 0,void 0,0,!0);if(ie(n))return n.then(()=>{a(this,U).showHelp(e)}),this}let t=a(this,ce).runDefaultBuilderOn(this);if(ie(t))return t.then(()=>{a(this,U).showHelp(e)}),this}return a(this,U).showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return j("[boolean|string] [string]",[e,t],arguments.length),a(this,U).showHelpOnFail(e,t),this}showVersion(e){return j("[string|function]",[e],arguments.length),a(this,U).showVersion(e),this}skipValidation(e){return j("<array|string>",[e],arguments.length),this[it]("skipValidation",e),this}strict(e){return j("[boolean]",[e],arguments.length),I(this,pt,e!==!1),this}strictCommands(e){return j("[boolean]",[e],arguments.length),I(this,ht,e!==!1),this}strictOptions(e){return j("[boolean]",[e],arguments.length),I(this,mt,e!==!1),this}string(e){return j("<array|string>",[e],arguments.length),this[it]("string",e),this}terminalWidth(){return j([],0),a(this,M).process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return j("<object>",[e],arguments.length),I(this,ut,!1),a(this,M).y18n.updateLocale(e),this}usage(e,t,n,i){if(j("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,n,i],arguments.length),t!==void 0){if(_e(e,null,a(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 a(this,U).usage(e),this}version(e,t,n){let i="version";if(j("[boolean|string] [string] [string]",[e,t,n],arguments.length),a(this,Be)&&(this[pn](a(this,Be)),a(this,U).version(void 0),I(this,Be,null)),arguments.length===0)n=this[qo](),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,Be,typeof e=="string"?e:i),t=t||a(this,U).deferY18nLookup("Show version number"),a(this,U).version(n||void 0),this.boolean(a(this,Be)),this.describe(a(this,Be),t),this}wrap(e){return j("<number|null|undefined>",[e],arguments.length),a(this,U).wrap(e),this}[(ce=new WeakMap,lt=new WeakMap,Ut=new WeakMap,Ne=new WeakMap,ve=new WeakMap,gr=new WeakMap,rt=new WeakMap,ut=new WeakMap,Te=new WeakMap,yr=new WeakMap,De=new WeakMap,ke=new WeakMap,je=new WeakMap,qe=new WeakMap,St=new WeakMap,he=new WeakMap,P=new WeakMap,br=new WeakMap,Er=new WeakMap,$e=new WeakMap,ft=new WeakMap,Ct=new WeakMap,dt=new WeakMap,nt=new WeakMap,wr=new WeakMap,M=new WeakMap,pt=new WeakMap,ht=new WeakMap,mt=new WeakMap,U=new WeakMap,Be=new WeakMap,oe=new WeakMap,Lo)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[No](){return{log:(...e)=>{this[Or]()||console.log(...e),I(this,je,!0),a(this,he).length&&I(this,he,a(this,he)+`
|
|
72
|
+
`),I(this,he,a(this,he)+e.join(" "))},error:(...e)=>{this[Or]()||console.error(...e),I(this,je,!0),a(this,he).length&&I(this,he,a(this,he)+`
|
|
73
|
+
`),I(this,he,a(this,he)+e.join(" "))}}}[pn](e){At(a(this,P)).forEach(t=>{if((i=>i==="configObjects")(t))return;let n=a(this,P)[t];Array.isArray(n)?~n.indexOf(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete a(this,U).getDescriptions()[e]}[To](){a(this,yr).push({options:a(this,P),configObjects:a(this,P).configObjects.slice(0),exitProcess:a(this,Te),groups:a(this,ke),strict:a(this,pt),strictCommands:a(this,ht),strictOptions:a(this,mt),completionCommand:a(this,ve),output:a(this,he),exitError:a(this,rt),hasOutput:a(this,je),parsed:this.parsed,parseFn:a(this,$e),parseContext:a(this,ft)}),a(this,U).freeze(),a(this,oe).freeze(),a(this,ce).freeze(),a(this,De).freeze()}[Do](){let e="",t;return/\b(node|iojs|electron)(\.exe)?$/.test(a(this,M).process.argv()[0])?t=a(this,M).process.argv().slice(1,2):t=a(this,M).process.argv().slice(0,1),e=t.map(n=>{let i=this[Bo](a(this,lt),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),a(this,M).getEnv("_")&&a(this,M).getProcessArgvBin()===a(this,M).getEnv("_")&&(e=a(this,M).getEnv("_").replace(`${a(this,M).path.dirname(a(this,M).process.execPath())}/`,"")),e}[gt](){return a(this,Er)}[hn](){if(!a(this,ut))return;let e=a(this,M).getEnv("LC_ALL")||a(this,M).getEnv("LC_MESSAGES")||a(this,M).getEnv("LANG")||a(this,M).getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[qo](){return this[mn]().version||"unknown"}[Mo](e){let t=e["--"]?e["--"]:e._;for(let n=0,i;(i=t[n])!==void 0;n++)a(this,M).Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(t[n]=Number(i));return e}[mn](e){let t=e||"*";if(a(this,Ct)[t])return a(this,Ct)[t];let n={};try{let i=e||a(this,M).mainFilename;!e&&a(this,M).path.extname(i)&&(i=a(this,M).path.dirname(i));let s=a(this,M).findUp(i,(o,c)=>{if(c.includes("package.json"))return"package.json"});_e(s,void 0,a(this,M)),n=JSON.parse(a(this,M).readFileSync(s,"utf8"))}catch{}return a(this,Ct)[t]=n||{},a(this,Ct)[t]}[it](e,t){t=[].concat(t),t.forEach(n=>{n=this[bn](n),a(this,P)[e].push(n)})}[xt](e,t,n,i){this[yn](e,t,n,i,(s,o,c)=>{a(this,P)[s][o]=c})}[gn](e,t,n,i){this[yn](e,t,n,i,(s,o,c)=>{a(this,P)[s][o]=(a(this,P)[s][o]||[]).concat(c)})}[yn](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 At(n))e(o,n[o]);else s(t,this[bn](n),i)}[bn](e){return e==="__proto__"?"___proto___":e}[En](e,t){return this[xt](this[En].bind(this),"key",e,t),this}[wn](){var e,t,n,i,s,o,c,u,p,h,l,b;let g=a(this,yr).pop();_e(g,void 0,a(this,M));let w;e=this,t=this,n=this,i=this,s=this,o=this,c=this,u=this,p=this,h=this,l=this,b=this,{options:{set value(d){I(e,P,d)}}.value,configObjects:w,exitProcess:{set value(d){I(t,Te,d)}}.value,groups:{set value(d){I(n,ke,d)}}.value,output:{set value(d){I(i,he,d)}}.value,exitError:{set value(d){I(s,rt,d)}}.value,hasOutput:{set value(d){I(o,je,d)}}.value,parsed:this.parsed,strict:{set value(d){I(c,pt,d)}}.value,strictCommands:{set value(d){I(u,ht,d)}}.value,strictOptions:{set value(d){I(p,mt,d)}}.value,completionCommand:{set value(d){I(h,ve,d)}}.value,parseFn:{set value(d){I(l,$e,d)}}.value,parseContext:{set value(d){I(b,ft,d)}}.value}=g,a(this,P).configObjects=w,a(this,U).unfreeze(),a(this,oe).unfreeze(),a(this,ce).unfreeze(),a(this,De).unfreeze()}[Fo](e,t){return ct(t,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[zo].bind(this),getContext:this[Uo].bind(this),getHasOutput:this[Go].bind(this),getLoggerInstance:this[ko].bind(this),getParseContext:this[Wo].bind(this),getParserConfiguration:this[gt].bind(this),getUsageInstance:this[Ho].bind(this),getValidationInstance:this[Vo].bind(this),hasParseCallback:this[Or].bind(this),postProcess:this[yt].bind(this),reset:this[On].bind(this),runValidation:this[An].bind(this),runYargsParserAndExecuteCommands:this[Gt].bind(this),setHasOutput:this[Yo].bind(this)}}[zo](){return a(this,ce)}[Uo](){return a(this,Ut)}[Go](){return a(this,je)}[ko](){return a(this,St)}[Wo](){return a(this,ft)||{}}[Ho](){return a(this,U)}[Vo](){return a(this,oe)}[Or](){return!!a(this,$e)}[yt](e,t,n,i){return n||ie(e)||(t||(e=this[Lo](e)),(this[gt]()["parse-positional-numbers"]||this[gt]()["parse-positional-numbers"]===void 0)&&(e=this[Mo](e)),i&&(e=at(e,this,a(this,De).getMiddleware(),!1))),e}[On](e={}){I(this,P,a(this,P)||{});let t={};t.local=a(this,P).local?a(this,P).local:[],t.configObjects=a(this,P).configObjects?a(this,P).configObjects:[];let n={};t.local.forEach(o=>{n[o]=!0,(e[o]||[]).forEach(c=>{n[c]=!0})}),Object.assign(a(this,dt),Object.keys(a(this,ke)).reduce((o,c)=>{let u=a(this,ke)[c].filter(p=>!(p in n));return u.length>0&&(o[c]=u),o},{})),I(this,ke,{});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]=(a(this,P)[o]||[]).filter(c=>!n[c])}),s.forEach(o=>{t[o]=et(a(this,P)[o],c=>!n[c])}),t.envPrefix=a(this,P).envPrefix,I(this,P,t),I(this,U,a(this,U)?a(this,U).reset(n):Co(this,a(this,M))),I(this,oe,a(this,oe)?a(this,oe).reset(n):Io(this,a(this,U),a(this,M))),I(this,ce,a(this,ce)?a(this,ce).reset():Ao(a(this,U),a(this,oe),a(this,De),a(this,M))),a(this,Ne)||I(this,Ne,vo(this,a(this,U),a(this,ce),a(this,M))),a(this,De).reset(),I(this,ve,null),I(this,he,""),I(this,rt,null),I(this,je,!1),this.parsed=!1,this}[Bo](e,t){return a(this,M).path.relative(e,t)}[Gt](e,t,n,i=0,s=!1){let o=!!n||s;e=e||a(this,nt),a(this,P).__=a(this,M).y18n.__,a(this,P).configuration=this[gt]();let c=!!a(this,P).configuration["populate--"],u=Object.assign({},a(this,P).configuration,{"populate--":!0}),p=a(this,M).Parser.detailed(e,Object.assign({},a(this,P),{configuration:{"parse-positional-numbers":!1,...u}})),h=Object.assign(p.argv,a(this,ft)),l,b=p.aliases,g=!1,w=!1;Object.keys(h).forEach(d=>{d===a(this,qe)&&h[d]?g=!0:d===a(this,Be)&&h[d]&&(w=!0)}),h.$0=this.$0,this.parsed=p,i===0&&a(this,U).clearCachedHelpMessage();try{if(this[hn](),t)return this[yt](h,c,!!n,!1);a(this,qe)&&~[a(this,qe)].concat(b[a(this,qe)]||[]).filter(G=>G.length>1).indexOf(""+h._[h._.length-1])&&(h._.pop(),g=!0);let d=a(this,ce).getCommands(),S=a(this,Ne).completionKey in h,N=g||S||s;if(h._.length){if(d.length){let A;for(let G=i||0,W;h._[G]!==void 0;G++)if(W=String(h._[G]),~d.indexOf(W)&&W!==a(this,ve)){let xe=a(this,ce).runCommand(W,this,p,G+1,s,g||w||s);return this[yt](xe,c,!!n,!1)}else if(!A&&W!==a(this,ve)){A=W;break}!a(this,ce).hasDefaultCommand()&&a(this,wr)&&A&&!N&&a(this,oe).recommendCommands(A,d)}a(this,ve)&&~h._.indexOf(a(this,ve))&&!S&&(a(this,Te)&&tt(!0),this.showCompletionScript(),this.exit(0))}if(a(this,ce).hasDefaultCommand()&&!N){let A=a(this,ce).runCommand(null,this,p,0,s,g||w||s);return this[yt](A,c,!!n,!1)}if(S){a(this,Te)&&tt(!0),e=[].concat(e);let A=e.slice(e.indexOf(`--${a(this,Ne).completionKey}`)+1);return a(this,Ne).getCompletion(A,(G,W)=>{if(G)throw new ne(G.message);(W||[]).forEach(xe=>{a(this,St).log(xe)}),this.exit(0)}),this[yt](h,!c,!!n,!1)}if(a(this,je)||(g?(a(this,Te)&&tt(!0),o=!0,this.showHelp("log"),this.exit(0)):w&&(a(this,Te)&&tt(!0),o=!0,a(this,U).showVersion("log"),this.exit(0))),!o&&a(this,P).skipValidation.length>0&&(o=Object.keys(h).some(A=>a(this,P).skipValidation.indexOf(A)>=0&&h[A]===!0)),!o){if(p.error)throw new ne(p.error.message);if(!S){let A=this[An](b,{},p.error);n||(l=at(h,this,a(this,De).getMiddleware(),!0)),l=this[Fo](A,l??h),ie(l)&&!n&&(l=l.then(()=>at(h,this,a(this,De).getMiddleware(),!1)))}}}catch(d){if(d instanceof ne)a(this,U).fail(d.message,d);else throw d}return this[yt](l??h,c,!!n,!0)}[An](e,t,n,i){e={...e},t={...t};let s={...this.getDemandedOptions()};return o=>{if(n)throw new ne(n.message);a(this,oe).nonOptionCount(o),a(this,oe).requiredArguments(o,s);let c=!1;a(this,ht)&&(c=a(this,oe).unknownCommands(o)),a(this,pt)&&!c?a(this,oe).unknownArguments(o,e,t,!!i):a(this,mt)&&a(this,oe).unknownArguments(o,e,{},!1,!1),a(this,oe).limitedChoices(o),a(this,oe).implications(o),a(this,oe).conflicting(o)}}[Yo](){I(this,je,!0)}};function _o(r){return!!r&&typeof r.getInternalMethods=="function"}var Nf=Ko(on),Xo=Nf;var bt=Pt(ar(),1);import{spawnSync as xn}from"node:child_process";import{existsSync as ye,mkdirSync as Rn,mkdtempSync as na,readdirSync as ia,readFileSync as be,realpathSync as Jo,rmSync as sa,statSync as Tf,writeFileSync as ae}from"node:fs";import{createRequire as Df}from"node:module";import{tmpdir as oa}from"node:os";import{dirname as kt,join as H,relative as Me,resolve as qf}from"node:path";import{fileURLToPath as Mf}from"node:url";var Rt=new Set(["python","go","php","typescript","zod","mock","swr","tanstack-query","transformers","cli"]),Qo=new Map([["tanstack-query-vue","vue"],["tanstack-query-svelte","svelte"],["tanstack-query-solid","solid"]]),Ce="@redocly/client-generator",Ff="https://redocly.com/docs/cli/commands/eject-generator",Sn="@redocly/openapi-core",Zo="<!-- redocly-generators:begin \u2014 managed by `redocly eject-generator`; content between markers is refreshed on eject -->",Cn="<!-- redocly-generators:end -->";function zf(){let r=Mf(new URL("./eject-assets/",import.meta.url));if(ye(H(r,"generators")))return r;let e=Df(import.meta.url).resolve(Ce),t=H(kt(e),"..","eject-assets");if(ye(H(t,"generators")))return t;throw new Oe(`
|
|
74
|
+
\u274C The ejectable generator sources are missing from ${Ce}.
|
|
75
|
+
In a checkout of the CLI, build them first: npm run prepare -w ${Ce}
|
|
76
|
+
`)}function ea(r,e){let t=H(process.cwd(),".claude","skills",r,"SKILL.md");return Rn(kt(t),{recursive:!0}),ae(t,be(H(e,"skills",r,"SKILL.md"),"utf-8"),"utf-8"),Me(process.cwd(),t)}function vn(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=`${Zo}
|
|
77
77
|
|
|
78
78
|
${t.join(`
|
|
79
79
|
`)}
|
|
80
80
|
|
|
81
|
-
${
|
|
82
|
-
`,i=H(r,"AGENTS.md");if(!ye(i)){ae(i,n,"utf-8");return}let s=be(i,"utf-8"),o=s.indexOf(
|
|
83
|
-
`);return}ae(i,s.slice(0,o)+n.trimEnd()+s.slice(c+
|
|
81
|
+
${Cn}
|
|
82
|
+
`,i=H(r,"AGENTS.md");if(!ye(i)){ae(i,n,"utf-8");return}let s=be(i,"utf-8"),o=s.indexOf(Zo),c=s.indexOf(Cn);if(o===-1||c===-1){X.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(c+Cn.length),"utf-8")}function jn(r,e,t){let n=na(H(oa(),"redocly-eject-merge-")),i={ours:H(n,".merge-ours"),base:H(n,".merge-base"),theirs:H(n,".merge-theirs")};ae(i.ours,r,"utf-8"),ae(i.base,e,"utf-8"),ae(i.theirs,t,"utf-8");let s=xn("git",["merge-file","-p","-L","yours","-L","ejected-from","-L","update",i.ours,i.base,i.theirs],{encoding:"utf-8"});if(sa(n,{recursive:!0,force:!0}),s.error||s.status===null)throw te.eject_generator_outcome="merge-tool-missing",new Oe("\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 Oe(`
|
|
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
|
|
86
|
-
`),0;let{merged:o,conflicts:c}=
|
|
87
|
-
`,"utf-8"),s}function
|
|
85
|
+
`);return{merged:s.stdout,conflicts:s.status}}function aa(r){return/Ejected from @redocly\/client-generator@(\S+)/.exec(r)?.[1]}function ca(r,e){let t=na(H(oa(),"redocly-eject-base-")),n=new Map;try{if(xn("npm",["pack",r,"--pack-destination",t],{encoding:"utf-8"}).status!==0)return n;let s=ia(t).find(o=>o.endsWith(".tgz"));if(s===void 0)return n;for(let o of e)xn("tar",["-xzf",H(t,s),"-C",t,o],{encoding:"utf-8"}).status===0&&n.set(o,be(H(t,o),"utf-8"));return n}finally{sa(t,{recursive:!0,force:!0})}}var ta=r=>`package/eject-assets/generators/${r}.mjs`,ra=(r,e)=>`package/eject-assets/generators/${r}/${e}`,vt=r=>`package/eject-assets/skills/${r}/SKILL.md`;function Uf(r,e){let t=H(r,"generators",e);if(!(!ye(t)||!Tf(t).isDirectory()))return ia(t).filter(n=>n.endsWith(".ts")).sort()}function Ar(r,e,t){let n=H(process.cwd(),".claude","skills",r,"SKILL.md"),i=be(H(e,"skills",r,"SKILL.md"),"utf-8");if(!ye(n))return Rn(kt(n),{recursive:!0}),ae(n,i,"utf-8"),0;let s=be(n,"utf-8");if(s===i)return 0;if(t===void 0)return ae(`${n}.new`,i,"utf-8"),X.warn(`${Me(process.cwd(),n)} was edited and has no merge base \u2014 the new skill is beside it as SKILL.md.new.
|
|
86
|
+
`),0;let{merged:o,conflicts:c}=jn(s,t,i);return ae(n,o,"utf-8"),c}function $n(r){return[...Rt].filter(e=>ye(H(r,`${e}.mjs`))||ye(H(r,e,"index.ts")))}function In(r,e=!1){let t=H(process.cwd(),"package.json");if(!ye(t))return"no-package-json";let n=be(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&&!(bt.validRange(h[u])!==null&&bt.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 c=/^([ \t]+)"/m.exec(n)?.[1]??" ";return ae(t,`${JSON.stringify(i,null,c)}
|
|
87
|
+
`,"utf-8"),s}function Gf(r,e,t,n,i){let s=Gn(e),o=we(s)&&we(s.apis)?s.apis:{};if(Object.values(o).some(c=>we(c)&&we(c.client)))return!1;if(n===-1){if(/^client:/m.test(e))return!1;let c=e===""||e.endsWith(`
|
|
88
88
|
`)?"":`
|
|
89
89
|
`;return ae(r,`${e}${c}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=c.findIndex(
|
|
95
|
-
`),"utf-8"),!0}if(!/^\s+generators:\s*$/.test(c[p]))return!1;let l=p,b=`${c[p].match(/^\s+/)[0]} `;for(let
|
|
96
|
-
`),"utf-8"),!0;l=
|
|
97
|
-
`),"utf-8"),!0}function
|
|
98
|
-
\u274C ${Me(process.cwd(),
|
|
93
|
+
`),"utf-8"),!0}function kf(r,e,t){if(r===void 0||!ye(r))return!1;let n=be(r,"utf-8"),i=g=>w=>w===g||w===`'${g}'`||w===`"${g}"`,s=i(e),o=i(t),c=n.split(`
|
|
94
|
+
`),u=c.findIndex(g=>/^client:\s*$/.test(g)),p=u===-1?-1:c.findIndex((g,w)=>w>u&&/^\s+generators:/.test(g));if(p!==-1&&c.slice(u+1,p).some(g=>/^\S/.test(g))&&(p=-1),p===-1)return Gf(r,n,c,u,t);let h=c[p].match(/^(\s+generators:\s*\[)(.*)\]\s*$/);if(h!==null){let g=h[2].split(",").map(d=>d.trim()).filter(d=>d!=="");if(g.some(o))return!0;let w=g.findIndex(s);return w===-1?g.push(t):g[w]=t,c[p]=`${h[1]}${g.join(", ")}]`,ae(r,c.join(`
|
|
95
|
+
`),"utf-8"),!0}if(!/^\s+generators:\s*$/.test(c[p]))return!1;let l=p,b=`${c[p].match(/^\s+/)[0]} `;for(let g=p+1;g<c.length;g++){if(/^\s*(#|$)/.test(c[g]))continue;let w=c[g].match(/^(\s+)- (.*?)\s*$/);if(w===null)break;let d=w[2].match(/\s+#.*$/)?.[0]??"",S=d===""?w[2]:w[2].slice(0,-d.length);if(o(S))return!0;if(s(S))return c[g]=`${w[1]}- ${t}${d}`,ae(r,c.join(`
|
|
96
|
+
`),"utf-8"),!0;l=g,b=w[1]}return c.splice(l+1,0,`${b}- ${t}`),ae(r,c.join(`
|
|
97
|
+
`),"utf-8"),!0}function Wf({name:r,files:e,toolkitVersion:t,assetsDir:n,dir:i,targetDir:s}){let o=H(s,"index.ts"),c=Me(process.cwd(),o)||o;if(!ye(o)){te.eject_generator_outcome="missing-target";let S=H(i,`${r}.mjs`);throw new Oe(ye(S)?`
|
|
98
|
+
\u274C ${Me(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: ${c} does not exist. Eject first.
|
|
101
|
-
`)}let u=
|
|
101
|
+
`)}let u=aa(be(o,"utf-8"));u!==void 0&&bt.valid(u)!==null&&(te.eject_generator_from_version=u),te.eject_generator_to_version=t;let p=u===t||u===void 0?new Map:ca(`${Ce}@${u}`,[...e.map(S=>ra(r,S)),vt("client-generators"),vt(`${r}-generator`)]);if(u===void 0)throw te.eject_generator_outcome="missing-base",new Oe(`
|
|
102
102
|
\u274C Could not read the version ${c} 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
|
|
105
|
-
`);continue}let
|
|
106
|
-
`);let w=h+b;
|
|
107
|
-
`)):
|
|
108
|
-
`)}function
|
|
104
|
+
`);let h=0;for(let S of e){let N=be(H(n,"generators",r,S),"utf-8"),A=H(s,S);if(!ye(A)){ae(A,N,"utf-8");continue}let G=be(A,"utf-8");if(G===N)continue;let W=u===t?N:p.get(ra(r,S));if(W===void 0){ae(`${A}.new`,N,"utf-8"),X.warn(`${Me(process.cwd(),A)} has no merge base in ${Ce}@${u} \u2014 the new file is beside it as ${S}.new.
|
|
105
|
+
`);continue}let xe=jn(G,W,N);ae(A,xe.merged,"utf-8"),h+=xe.conflicts}let l=S=>u===t?be(H(n,"skills",S,"SKILL.md"),"utf-8"):p.get(vt(S)),b=Ar("client-generators",n,l("client-generators"))+Ar(`${r}-generator`,n,l(`${r}-generator`));vn(i,$n(i));let g=In({[Ce]:t},!0);(g==="updated"||g==="added")&&X.info(`Set ${Ce} to ^${t} in package.json \u2014 run your installer.
|
|
106
|
+
`);let w=h+b;te.eject_generator_outcome=w>0?"conflicts":"success";let d=Me(process.cwd(),s)||s;w>0?(te.eject_generator_conflicts=w,X.warn(`Updated ${d} with ${w} conflict(s)${b>0?" (some in .claude/skills)":""} \u2014 resolve the <<<<<<< markers, then regenerate.
|
|
107
|
+
`)):X.info(`Updated ${d} cleanly.
|
|
108
|
+
`)}function Hf({name:r,asset:e,toolkitVersion:t,assetsDir:n,dir:i,target:s,printedTarget:o}){if(!ye(s))throw te.eject_generator_outcome="missing-target",new Oe(`
|
|
109
109
|
\u274C Nothing to update: ${o} does not exist. Eject first.
|
|
110
|
-
`);let c=H(i,".pristine",`${r}.mjs`),u=be(s,"utf-8"),p=
|
|
110
|
+
`);let c=H(i,".pristine",`${r}.mjs`),u=be(s,"utf-8"),p=aa(u);p!==void 0&&bt.valid(p)!==null&&(te.eject_generator_from_version=p),te.eject_generator_to_version=t;let h=ye(c)||p===t||p===void 0?new Map:ca(`${Ce}@${p}`,[ta(r),vt("client-generators"),vt(`${r}-generator`)]),l=ye(c)?be(c,"utf-8"):p===t?e:h.get(ta(r));if(l===void 0){te.eject_generator_outcome="missing-base";let A=`${s}.new`;throw ae(A,e,"utf-8"),new Oe(`
|
|
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
|
-
The current generator is written to ${Me(process.cwd(),
|
|
113
|
-
`)}let{merged:b,conflicts:
|
|
114
|
-
`);let w=
|
|
115
|
-
`);let
|
|
116
|
-
`)):
|
|
117
|
-
`)}var
|
|
112
|
+
The current generator is written to ${Me(process.cwd(),A)} \u2014 diff it against your copy and merge by hand.
|
|
113
|
+
`)}let{merged:b,conflicts:g}=jn(u,l,e);ae(s,b,"utf-8"),ye(c)&&X.info(`Used ${Me(process.cwd(),c)} as the merge base. Later updates read the version from the file's header, so you can delete that .pristine directory.
|
|
114
|
+
`);let w=A=>p===t?be(H(n,"skills",A,"SKILL.md"),"utf-8"):h.get(vt(A)),d=Ar("client-generators",n,w("client-generators"))+Ar(`${r}-generator`,n,w(`${r}-generator`));vn(i,$n(i));let S=In({[Ce]:t},!0);(S==="updated"||S==="added")&&X.info(`Set ${Ce} to ^${t} in package.json \u2014 run your installer.
|
|
115
|
+
`);let N=g+d;te.eject_generator_outcome=N>0?"conflicts":"success",N>0?(te.eject_generator_conflicts=N,X.warn(`Updated ${o} with ${N} conflict(s)${d>0?" (some in .claude/skills)":""} \u2014 resolve the <<<<<<< markers, then regenerate.
|
|
116
|
+
`)):X.info(`Updated ${o} cleanly.
|
|
117
|
+
`)}var la=async({argv:r,config:e})=>{let t=r.generator??"";te.eject_generator_action=r.update?"update":"eject",(Rt.has(t)||Qo.has(t))&&(te.eject_generator_name=t),te.eject_generator_outcome="unexpected-error";let n=Qo.get(t);if(n!==void 0){te.eject_generator_action="guidance",te.eject_generator_outcome="success",X.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
|
|
|
121
121
|
redocly eject-generator tanstack-query
|
|
122
122
|
# then in generators/tanstack-query/index.ts: run: tanstackQueryGenerator('${n}')
|
|
123
|
-
`);return}if(!Rt.has(t))throw
|
|
123
|
+
`);return}if(!Rt.has(t))throw te.eject_generator_outcome="unknown-generator",new Oe(`
|
|
124
124
|
\u274C Unknown generator "${t}". Ejectable generators: ${[...Rt].join(", ")}.
|
|
125
|
-
`);let i=
|
|
125
|
+
`);let i=zf(),s=Uf(i,t),{GENERATOR_VERSION:o}=await import("./chunks/SXYE4UNQ.js"),c=qf(r.dir??"./generators"),u=s===void 0?H(c,`${t}.mjs`):H(c,t,"index.ts"),p=Me(process.cwd(),u)||u;if(r.update){if(s===void 0){let A=be(H(i,"generators",`${t}.mjs`),"utf-8");Hf({name:t,asset:A,toolkitVersion:o,assetsDir:i,dir:c,target:u,printedTarget:p})}else Wf({name:t,files:s,toolkitVersion:o,assetsDir:i,dir:c,targetDir:H(c,t)});return}if(ye(u)&&!r.force)throw te.eject_generator_outcome="already-exists",new Oe(`
|
|
126
126
|
\u274C ${p} already exists. Use --update to merge the newer version in, or --force to overwrite.
|
|
127
|
-
`);
|
|
128
|
-
`+(w==="added"?`Added ${
|
|
129
|
-
`:w==="no-package-json"?`The ejected file imports its toolkit from ${
|
|
130
|
-
`:"")+(d?`It also imports ${
|
|
131
|
-
`:"")+(
|
|
127
|
+
`);Rn(kt(u),{recursive:!0});let h=s===void 0?[be(H(i,"generators",`${t}.mjs`),"utf-8")]:s.map(A=>be(H(i,"generators",t,A),"utf-8"));s===void 0?ae(u,h[0],"utf-8"):s.forEach((A,G)=>{ae(H(c,t,A),h[G],"utf-8")});let l=ea("client-generators",i),b=ea(`${t}-generator`,i);vn(c,$n(c));let g=`./${Me(e.configPath===void 0?process.cwd():Jo(kt(e.configPath)),Jo(u)).split("\\").join("/")}`,w=In({[Ce]:o}),d=h.some(A=>A.includes(`from "${Sn}"`)||A.includes(`from '${Sn}'`)),S=kf(e.configPath,t,g),N=s===void 0?p:Me(process.cwd(),H(c,t))+"/";X.info(`Ejected the "${t}" generator to ${N}.
|
|
128
|
+
`+(w==="added"?`Added ${Ce} to devDependencies (the ejected file imports its toolkit) \u2014 run your installer.
|
|
129
|
+
`:w==="no-package-json"?`The ejected file imports its toolkit from ${Ce} \u2014 install it: npm install --save-dev ${Ce}
|
|
130
|
+
`:"")+(d?`It also imports ${Sn} (a dependency of the toolkit) \u2014 add it explicitly if your package manager does not hoist.
|
|
131
|
+
`:"")+(S?`Added it to client.generators in ${Me(process.cwd(),e.configPath)} \u2014 the path to your copy replaces the built-in name.
|
|
132
132
|
`:`Point your config at the ${s===void 0?"file":"entry file"} \u2014 the path to your copy replaces the built-in name:
|
|
133
133
|
|
|
134
134
|
client:
|
|
135
135
|
generators:
|
|
136
|
-
- ${
|
|
136
|
+
- ${g}
|
|
137
137
|
|
|
138
138
|
`)+(s===void 0?"":`Running TypeScript generators uses Node's type stripping \u2014 Node 22.18 or 23.6 and newer.
|
|
139
139
|
`)+`Your agent's skills: ${b} (this generator's design) and ${l} (the toolkit).
|
|
140
140
|
|
|
141
|
-
Run it: redocly generate-client <api> --output <path>${
|
|
142
|
-
Edit ${
|
|
143
|
-
Reference: ${
|
|
144
|
-
`),
|
|
141
|
+
Run it: redocly generate-client <api> --output <path>${S?"":` --generator ${g}`}
|
|
142
|
+
Edit ${N} and run that again to see your change.
|
|
143
|
+
Reference: ${Ff}
|
|
144
|
+
`),te.eject_generator_outcome="success"};function fa(r){if(Array.isArray(r)){let e={};for(let t of r)if(t&&typeof t=="string"){let n=ua(t);Object.assign(e,n)}return Object.keys(e).length>0?e:void 0}if(!(!r||typeof r!="string"))return ua(r)}function ua(r){try{let e=JSON.parse(r);if(!we(e))throw new Error("mTLS config must be an object mapping domains to certificate configurations");for(let[t,n]of Object.entries(e)){if(!we(n))throw new Error(`mTLS config for domain "${t}" must be an object`);Pn(n,"clientCert",t,!0),Pn(n,"clientKey",t,!0),Pn(n,"caCert",t,!1)}return e}catch(e){throw e instanceof SyntaxError?new Error(`Invalid JSON for --mtls option: ${e.message}`):e}}function Pn(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`)}var da=Pt(ar(),1);import{existsSync as Vf,writeFileSync as Bf,readFileSync as Yf,statSync as Kf}from"node:fs";import{tmpdir as Ln}from"node:os";import{join as Nn}from"node:path";import*as Wt from"node:process";var _r=Pt(La(),1);var Sr=async(r,{timeout:e,...t}={})=>{let n=ri(),i=n&&!ni(r),s,o=e?{connect:{timeout:e}}:{};return i?s=new _r.ProxyAgent({uri:n,...o}):e&&(s=new _r.Agent(o)),await fetch(r,{signal:e?AbortSignal.timeout(e):void 0,...t,dispatcher:s})};var Tn="redocly-cli-version",Xf=1e3*60*60*12,pa=Wt.env.NODE_ENV==="test"||Wt.env.CI||!!Wt.env.LAMBDA_TASK_ROOT||Wt.env.REDOCLY_SUPPRESS_UPDATE_NOTICE==="true",ha=()=>{if(!pa)try{let r=Yf(Nn(Ln(),Tn)).toString();Jf(Fe,r)&&Zf(Fe,r)}catch{return}},Jf=(r,e)=>(0,da.compare)(r,e)<0,Qf=async r=>{let e=`http://registry.npmjs.org/${r}/latest`;try{return(await(await Sr(e,{timeout:Yt})).json()).version}catch{return}},ma=()=>{!ed()||pa||Qf(Kn).then(r=>{if(r){let e=Nn(Ln(),Tn);Bf(e,r)}}).catch(()=>{})},Zf=(r,e)=>{X.info(ei([`A new version of ${jr("Redocly CLI")} (${Ht(e)}) is available.`,`Update now: \`${jr("npm i -g @redocly/cli@latest")}\`.`,"Changelog: https://redocly.com/docs/cli/changelog/"]))},ed=()=>{try{let r=Nn(Ln(),Tn);if(!Vf(r))return!0;let e=new Date().getTime(),n=Kf(r).mtime.getTime();return e-n>=Xf}catch{return!1}};function ga(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 st(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 ya(r){return r?._?.[0]??""}async function ba(r,e,t){let n;try{n=await Hn({configPath:r.config,customExtends:r.extends,plugins:t})}catch(o){throw new Oe(`Failed to load the configuration file:
|
|
145
145
|
|
|
146
|
-
`)
|
|
147
|
-
`)
|
|
148
|
-
`)))}finally{if(process.env.REDOCLY_TELEMETRY!=="off"&&i!=="off"){let A=Math.round(performance.now()-t);await ba({config:u,argv:e,exit_code:n,execution_time:A,spec_version:s,spec_keyword:o,spec_full_version:c,respect_x_security_auth_types:[...p],respect_source_description_types:[...h],respect_criterion_object_types:[...l],lint_rules_with_errors:[...m],lint_rules_with_warnings:[...w],lint_rules_with_ignored_problems:[...d],generate_client:Vn,eject_generator:ee,bundle:ei})}process.once("beforeExit",()=>{process.exit(n)})}}}Sa.config({path:Ca.resolve(process.cwd(),"./.env")});fa();Vo(en(process.argv)).version("version","Show version number.",Fe).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/HDOITPQ3.js");Q(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/DLPIGJ4V.js");Q(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/PIMM4UUT.js");Q(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:"_"},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/CXUJFJ3V.js");Q(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/IXUAYOCK.js");Q(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:"Name of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"Name 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/2UTQDU6B.js");Q(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:"Name of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"Name 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:da},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/RAZQQ2DW.js");Q(e)(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/YW2GBLJX.js");Q(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:Yn},"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/TWIJOWYT.js");Q(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=>{Q()(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/5CEXCXYZ.js");Q(e)(r)}).command("logout","Clear your stored credentials.",r=>r,async r=>{let{handleLogout:e}=await import("./chunks/ALAAZCRE.js");Q(e)(r)}).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:Bn,default:"enterprise"},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:st("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"))&&ne.error(`Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.
|
|
149
|
-
`);let{previewProject:e}=await import("./chunks/VMGZLFL4.js");Q(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/R5EOHC5A.js");Q(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/VUKQLVFA.js");Q(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/I6CD22RU.js");Q(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:aa},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:st("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:st("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:st("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/ISV7E3WY.js");Q(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:st("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:st("max-workflows",!0)}}),async r=>{let{handleGenerateArazzo:e}=await import("./chunks/XJSNA6VQ.js");Q(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/IGD6TJGQ.js");Q(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 (${[...Rt].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=>{Q(sa)(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"},"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:st("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/VCODEISK.js");Q(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/HJZMPHXS.js");Q(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/Z22TFV6U.js");Q(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"},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/XXP75TZV.js");Q(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/OKP4XLDY.js");Q(e)(r)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([ua]).strict().argv;
|
|
146
|
+
- ${o.message}`)}if(r["lint-config"]==="off"||n.document===void 0)return n;let i=await Yn({config:n,severity:r["lint-config"]||"warn"}),s=Vn(i);if(Bn(i,{maxProblems:r["max-problems"],totals:s,version:e,command:"check-config"}),td(s,ya(r)),s.errors>0)throw new Bt("Config check failed.");return n}function td(r,e){r.errors>0?X.error(`\u274C Your config has ${r.errors} ${vr("error",r.errors)}.
|
|
147
|
+
`):r.warnings>0?X.warn(`\u26A0\uFE0F Your config has ${r.warnings} ${vr("warning",r.warnings)}.
|
|
148
|
+
`):e==="check-config"&&X.info(Ht(`\u2705 Your config is valid.
|
|
149
|
+
`))}import{execSync as rd}from"node:child_process";import*as $t from"node:fs";import{existsSync as nd,writeFileSync as id,readFileSync as Oa}from"node:fs";import*as Aa from"node:os";import{tmpdir as _a}from"node:os";import{dirname as wa,join as xr}from"node:path";async function Ea(r=Yt){try{return await Sr(ti,{timeout:r}),!0}catch{return!1}}var Cr="***";async function Sa({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:c,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:g,eject_generator:w,bundle:d}){try{if(!e||!await Ea(1e3))return;let{_:[N],$0:A,...G}=e,{RedoclyOAuthClient:W,getReuniteUrl:xe}=await import("./chunks/JF6HX6A6.js"),Ye=new W(Fe),Ke=xe(r,G.residency),Xe=await Ye.isAuthorized(Ke),V=dd();V||(V=`ann_${oi()}`,fd(V));let We=Vt(i),$=[{id:N,object:"command",uri:`urn:redocly:cli:command:${N}`,logged_in:Xe?"yes":"no",command:N,...cd(G,process.argv.slice(2)),node_version:process.version,npm_version:ud(),version:Fe,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:We==="arazzo1"&&c?.length?JSON.stringify(c):void 0,respect_source_description_types:We==="arazzo1"&&u?.length?JSON.stringify(u):void 0,respect_criterion_object_types:We==="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:g?.generate_client_builtin_generators?.length?JSON.stringify(g.generate_client_builtin_generators):void 0,generate_client_custom_generators_count:g?.generate_client_custom_generators_count,generate_client_toolkit_imports:g?.generate_client_toolkit_imports?.length?JSON.stringify(g.generate_client_toolkit_imports):void 0,generate_client_error_category:g?.generate_client_error_category,generate_client_ejected_generators:g?.generate_client_ejected_generators?.length?JSON.stringify(g.generate_client_ejected_generators):void 0,generate_client_composed_apis_count:g?.generate_client_composed_apis_count,eject_generator_action:w?.eject_generator_action,eject_generator_name:w?.eject_generator_name,eject_generator_outcome:w?.eject_generator_outcome,eject_generator_conflicts:w?.eject_generator_conflicts,eject_generator_from_version:w?.eject_generator_from_version,eject_generator_to_version:w?.eject_generator_to_version,bundle_overlays_count:d?.bundle_overlays_count}],_=si.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:Aa.platform(),actor:{id:V,object:"user",uri:""},category:"product",data:$}),{otelTelemetry:L}=await import("./chunks/6ESHHDEM.js");L.send(_)}catch{}}function Ca(r,e){for(let t of r.sourceDescriptions??[])t.type&&e.add(t.type)}function xa(r,e){for(let t of r.workflows??[]){jt(t.successActions,e),jt(t.failureActions,e);for(let n of t.steps??[])Ra(n.successCriteria,e),jt(n.onSuccess,e),jt(n.onFailure,e)}jt(Object.values(r.components?.successActions??{}),e),jt(Object.values(r.components?.failureActions??{}),e)}function jt(r,e){for(let t of r??[])Ra(t.criteria,e)}function Ra(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 va(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 c=s.type==="http"?s.scheme:s.type;c&&e.add(c)}let o=i.schemeName;o&&e.add(o)}}}function od(r){return $t.existsSync(r)&&$t.statSync(r).isFile()}function ad(r){return $t.existsSync(r)&&$t.statSync(r).isDirectory()}function Dn(r){return r&&(Un(r)?r.split("://")[0]+"://url":od(r)?r.replace(/.+\.([^.]+)$/,(e,t)=>"file-"+t):ad(r)?"folder":r)}function qn(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 ja(r,e){let t={};for(let[n,i]of Object.entries(r))e.includes(n)?t[n]=Cr:we(i)?t[n]=ja(i,e):t[n]=i;return t}function Mn(r,e,t=[]){if(Array.isArray(r))return r.forEach(n=>Mn(n,e,t)),t;if(we(r))for(let[n,i]of Object.entries(r))e.includes(n)&&typeof i=="string"?t.push(i):(we(i)||Array.isArray(i))&&Mn(i,e,t);return t}function cd(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]=Cr,n=qn(n,o,Cr);else if(typeof o=="string"){let c=Dn(o);i[s]=c,n=qn(n,o,c)}else if(Array.isArray(o)){i[s]=o.map(Dn);for(let c of o){let u=Dn(c);n.includes(c)&&(n=n.replaceAll(c,u))}}else if(we(o)){let c=Mn(o,t);for(let u of c)n=qn(n,u,Cr);i[s]=ja(o,t)}else i[s]=o;return{arguments:JSON.stringify(i),raw_input:n}}var ld=process.platform==="win32"?xr(wa(process.execPath),"node_modules","npm","package.json"):xr(wa(process.execPath),"..","lib","node_modules","npm","package.json");function ud(){try{return JSON.parse(Oa(ld,"utf8")).version}catch{}try{return rd("npm -v",{stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return"unknown"}}var fd=r=>{if(!(process.env.CI||!r))try{let t=xr(_a(),$r);id(t,r)}catch{}},dd=()=>{if(!process.env.CI)try{let e=xr(_a(),$r);return nd(e)?Oa(e).toString().trim():void 0}catch{return}};function Q(r,e={}){return async t=>{let n=performance.now(),i=2,s,o="unknown",c,u,p,h=new Set,l=new Set,b=new Set,g=({parsed:A,source:G})=>{if(o="unknown",c=void 0,u=void 0,G?.absoluteRef&&kn(G.absoluteRef)){o="graphql";return}try{o=Wn(A)}catch{o="unsupported"}we(A)&&(c=A?.openapi?"openapi":A?.swagger?"swagger":A?.asyncapi?"asyncapi":A?.arazzo?"arazzo":A?.overlay?"overlay":void 0,c&&(u=A[c]),Vt(o)==="arazzo1"&&(va(A,h),Ca(A,l),xa(A,b)))},w=new Set,d=new Set,S=new Set,N=A=>{for(let G of A)G.ignored?S.add(G.ruleId):G.severity==="error"?w.add(G.ruleId):G.severity==="warn"&&d.add(G.ruleId)};try{if(t.config&&!zn(t.config))throw new Oe("Please provide a valid path to the configuration file.");p=await ba(t,Fe,e.plugins),s=p.resolvedConfig.telemetry,i=1,typeof r=="function"&&await r({argv:t,config:p,version:Fe,collectSpecData:g,collectResults:N}),i=0}catch(A){A instanceof Bt||(A instanceof Oe?X.error(A.message+`
|
|
150
|
+
|
|
151
|
+
`):(X.error(`An unexpected error occurred. This is likely a bug that should be reported.
|
|
152
|
+
`),X.error(A instanceof Error?A.stack||A.message:String(A)),X.error(`
|
|
153
|
+
`)))}finally{if(process.env.REDOCLY_TELEMETRY!=="off"&&s!=="off"){let A=Math.round(performance.now()-n);await Sa({config:p,argv:t,exit_code:i,execution_time:A,spec_version:o,spec_keyword:c,spec_full_version:u,respect_x_security_auth_types:[...h],respect_source_description_types:[...l],respect_criterion_object_types:[...b],lint_rules_with_errors:[...w],lint_rules_with_warnings:[...d],lint_rules_with_ignored_problems:[...S],generate_client:Jn,eject_generator:te,bundle:ii})}process.once("beforeExit",()=>{process.exit(i)})}}}$a.config({path:Ia.resolve(process.cwd(),"./.env")});ma();Xo(nn(process.argv)).version("version","Show version number.",Fe).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/JPHYX7OV.js");Q(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/BZNIB4HL.js");Q(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/ERFOEXTV.js");Q(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:"_"},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/46SNGFKM.js");Q(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/ROE2PM62.js");Q(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/U4WMP25Y.js");Q(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:ga},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/4BCJL2BX.js");Q(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/2523PDUF.js"),{recheckPresetsPlugin:t}=await import("./chunks/WSDNWUOV.js");Q(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/XARQ5LTM.js");Q(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:Zn},"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/H7Z35EAH.js");Q(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=>{Q()(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/252ZXXJ7.js");Q(e)(r)}).command("logout","Clear your stored credentials.",r=>r,async r=>{let{handleLogout:e}=await import("./chunks/GDFQSHUE.js");Q(e)(r)}).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:Qn,default:"enterprise"},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:st("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"))&&X.error(`Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.
|
|
154
|
+
`);let{previewProject:e}=await import("./chunks/6G6YWZOW.js");Q(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/VNSAGJ2H.js");Q(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/2ERUBDSZ.js");Q(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/65C4QORD.js");Q(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:fa},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:st("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:st("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:st("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/PB256IKB.js");Q(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:st("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:st("max-workflows",!0)}}),async r=>{let{handleGenerateArazzo:e}=await import("./chunks/YTAL3SI4.js");Q(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/WFGS4GSF.js");Q(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 (${[...Rt].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=>{Q(la)(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"},"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:st("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/YLFY2DKU.js");Q(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/D2IJWX6B.js");Q(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/6HHP5O4K.js");Q(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/NSNQAVBA.js");Q(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/T6HGKHGP.js");Q(e)(r)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([ha]).strict().argv;
|
|
150
155
|
/*! Bundled license information:
|
|
151
156
|
|
|
152
157
|
yargs-parser/build/lib/string-utils.js:
|