@wispbit/local 1.0.39 → 1.0.40
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/cli-bundle.js +138 -121
- package/package.json +1 -1
package/cli-bundle.js
CHANGED
|
@@ -1,146 +1,163 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'module';import { fileURLToPath } from 'url';import { dirname } from 'path';const require = createRequire(import.meta.url);const __filename = fileURLToPath(import.meta.url);const __dirname = dirname(__filename);
|
|
3
|
-
var
|
|
4
|
-
`);let
|
|
5
|
-
`),n=n.replace(/\\r/g,"\r")),e[s]=n}return e}function db(t){let e=hu(t),r=_e.configDotenv({path:e});if(!r.parsed){let a=new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);throw a.code="MISSING_DATA",a}let i=uu(t).split(","),s=i.length,n;for(let a=0;a<s;a++)try{let o=i[a].trim(),c=yb(r,o);n=_e.decrypt(c.ciphertext,c.key);break}catch(o){if(a+1>=s)throw o}return _e.parse(n)}function mb(t){console.log(`[dotenv@${Vo}][INFO] ${t}`)}function gb(t){console.log(`[dotenv@${Vo}][WARN] ${t}`)}function Ks(t){console.log(`[dotenv@${Vo}][DEBUG] ${t}`)}function uu(t){return t&&t.DOTENV_KEY&&t.DOTENV_KEY.length>0?t.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function yb(t,e){let r;try{r=new URL(e)}catch(o){if(o.code==="ERR_INVALID_URL"){let c=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw c.code="INVALID_DOTENV_KEY",c}throw o}let i=r.password;if(!i){let o=new Error("INVALID_DOTENV_KEY: Missing key part");throw o.code="INVALID_DOTENV_KEY",o}let s=r.searchParams.get("environment");if(!s){let o=new Error("INVALID_DOTENV_KEY: Missing environment part");throw o.code="INVALID_DOTENV_KEY",o}let n=`DOTENV_VAULT_${s.toUpperCase()}`,a=t.parsed[n];if(!a){let o=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${n} in your .env.vault file.`);throw o.code="NOT_FOUND_DOTENV_ENVIRONMENT",o}return{ciphertext:a,key:i}}function hu(t){let e=null;if(t&&t.path&&t.path.length>0)if(Array.isArray(t.path))for(let r of t.path)qo.existsSync(r)&&(e=r.endsWith(".vault")?r:`${r}.vault`);else e=t.path.endsWith(".vault")?t.path:`${t.path}.vault`;else e=Wo.resolve(process.cwd(),".env.vault");return qo.existsSync(e)?e:null}function lu(t){return t[0]==="~"?Wo.join(lb.homedir(),t.slice(1)):t}function bb(t){mb("Loading env from encrypted .env.vault");let e=_e._parseVault(t),r=process.env;return t&&t.processEnv!=null&&(r=t.processEnv),_e.populate(r,e,t),{parsed:e}}function vb(t){let e=Wo.resolve(process.cwd(),".env"),r="utf8",i=!!(t&&t.debug);t&&t.encoding?r=t.encoding:i&&Ks("No encoding is specified. UTF-8 is used by default");let s=[e];if(t&&t.path)if(!Array.isArray(t.path))s=[lu(t.path)];else{s=[];for(let c of t.path)s.push(lu(c))}let n,a={};for(let c of s)try{let l=_e.parse(qo.readFileSync(c,{encoding:r}));_e.populate(a,l,t)}catch(l){i&&Ks(`Failed to load ${c} ${l.message}`),n=l}let o=process.env;return t&&t.processEnv!=null&&(o=t.processEnv),_e.populate(o,a,t),n?{parsed:a,error:n}:{parsed:a}}function wb(t){if(uu(t).length===0)return _e.configDotenv(t);let e=hu(t);return e?_e._configVault(t):(gb(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),_e.configDotenv(t))}function xb(t,e){let r=Buffer.from(e.slice(-64),"hex"),i=Buffer.from(t,"base64"),s=i.subarray(0,12),n=i.subarray(-16);i=i.subarray(12,-16);try{let a=ub.createDecipheriv("aes-256-gcm",r,s);return a.setAuthTag(n),`${a.update(i)}${a.final()}`}catch(a){let o=a instanceof RangeError,c=a.message==="Invalid key length",l=a.message==="Unsupported state or unable to authenticate data";if(o||c){let u=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw u.code="INVALID_DOTENV_KEY",u}else if(l){let u=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw u.code="DECRYPTION_FAILED",u}else throw a}}function Eb(t,e,r={}){let i=!!(r&&r.debug),s=!!(r&&r.override);if(typeof e!="object"){let n=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw n.code="OBJECT_REQUIRED",n}for(let n of Object.keys(e))Object.prototype.hasOwnProperty.call(t,n)?(s===!0&&(t[n]=e[n]),i&&Ks(s===!0?`"${n}" is already defined and WAS overwritten`:`"${n}" is already defined and was NOT overwritten`)):t[n]=e[n]}var _e={configDotenv:vb,_configVault:bb,_parseVault:db,config:wb,decrypt:xb,parse:pb,populate:Eb};At.exports.configDotenv=_e.configDotenv;At.exports._configVault=_e._configVault;At.exports._parseVault=_e._parseVault;At.exports.config=_e.config;At.exports.decrypt=_e.decrypt;At.exports.parse=_e.parse;At.exports.populate=_e.populate;At.exports=_e});var Wi=j((FT,Hh)=>{"use strict";var y1="2.0.0",b1=Number.MAX_SAFE_INTEGER||9007199254740991,v1=16,w1=250,x1=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Hh.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:v1,MAX_SAFE_BUILD_LENGTH:w1,MAX_SAFE_INTEGER:b1,RELEASE_TYPES:x1,SEMVER_SPEC_VERSION:y1,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Vi=j((NT,Kh)=>{"use strict";var E1=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Kh.exports=E1});var Xr=j((vt,Yh)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Ua,MAX_SAFE_BUILD_LENGTH:_1,MAX_LENGTH:S1}=Wi(),R1=Vi();vt=Yh.exports={};var C1=vt.re=[],A1=vt.safeRe=[],q=vt.src=[],L1=vt.safeSrc=[],W=vt.t={},O1=0,Ga="[a-zA-Z0-9-]",$1=[["\\s",1],["\\d",S1],[Ga,_1]],T1=t=>{for(let[e,r]of $1)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ie=(t,e,r)=>{let i=T1(e),s=O1++;R1(t,s,e),W[t]=s,q[s]=e,L1[s]=i,C1[s]=new RegExp(e,r?"g":void 0),A1[s]=new RegExp(i,r?"g":void 0)};ie("NUMERICIDENTIFIER","0|[1-9]\\d*");ie("NUMERICIDENTIFIERLOOSE","\\d+");ie("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Ga}*`);ie("MAINVERSION",`(${q[W.NUMERICIDENTIFIER]})\\.(${q[W.NUMERICIDENTIFIER]})\\.(${q[W.NUMERICIDENTIFIER]})`);ie("MAINVERSIONLOOSE",`(${q[W.NUMERICIDENTIFIERLOOSE]})\\.(${q[W.NUMERICIDENTIFIERLOOSE]})\\.(${q[W.NUMERICIDENTIFIERLOOSE]})`);ie("PRERELEASEIDENTIFIER",`(?:${q[W.NONNUMERICIDENTIFIER]}|${q[W.NUMERICIDENTIFIER]})`);ie("PRERELEASEIDENTIFIERLOOSE",`(?:${q[W.NONNUMERICIDENTIFIER]}|${q[W.NUMERICIDENTIFIERLOOSE]})`);ie("PRERELEASE",`(?:-(${q[W.PRERELEASEIDENTIFIER]}(?:\\.${q[W.PRERELEASEIDENTIFIER]})*))`);ie("PRERELEASELOOSE",`(?:-?(${q[W.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${q[W.PRERELEASEIDENTIFIERLOOSE]})*))`);ie("BUILDIDENTIFIER",`${Ga}+`);ie("BUILD",`(?:\\+(${q[W.BUILDIDENTIFIER]}(?:\\.${q[W.BUILDIDENTIFIER]})*))`);ie("FULLPLAIN",`v?${q[W.MAINVERSION]}${q[W.PRERELEASE]}?${q[W.BUILD]}?`);ie("FULL",`^${q[W.FULLPLAIN]}$`);ie("LOOSEPLAIN",`[v=\\s]*${q[W.MAINVERSIONLOOSE]}${q[W.PRERELEASELOOSE]}?${q[W.BUILD]}?`);ie("LOOSE",`^${q[W.LOOSEPLAIN]}$`);ie("GTLT","((?:<|>)?=?)");ie("XRANGEIDENTIFIERLOOSE",`${q[W.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ie("XRANGEIDENTIFIER",`${q[W.NUMERICIDENTIFIER]}|x|X|\\*`);ie("XRANGEPLAIN",`[v=\\s]*(${q[W.XRANGEIDENTIFIER]})(?:\\.(${q[W.XRANGEIDENTIFIER]})(?:\\.(${q[W.XRANGEIDENTIFIER]})(?:${q[W.PRERELEASE]})?${q[W.BUILD]}?)?)?`);ie("XRANGEPLAINLOOSE",`[v=\\s]*(${q[W.XRANGEIDENTIFIERLOOSE]})(?:\\.(${q[W.XRANGEIDENTIFIERLOOSE]})(?:\\.(${q[W.XRANGEIDENTIFIERLOOSE]})(?:${q[W.PRERELEASELOOSE]})?${q[W.BUILD]}?)?)?`);ie("XRANGE",`^${q[W.GTLT]}\\s*${q[W.XRANGEPLAIN]}$`);ie("XRANGELOOSE",`^${q[W.GTLT]}\\s*${q[W.XRANGEPLAINLOOSE]}$`);ie("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Ua}})(?:\\.(\\d{1,${Ua}}))?(?:\\.(\\d{1,${Ua}}))?`);ie("COERCE",`${q[W.COERCEPLAIN]}(?:$|[^\\d])`);ie("COERCEFULL",q[W.COERCEPLAIN]+`(?:${q[W.PRERELEASE]})?(?:${q[W.BUILD]})?(?:$|[^\\d])`);ie("COERCERTL",q[W.COERCE],!0);ie("COERCERTLFULL",q[W.COERCEFULL],!0);ie("LONETILDE","(?:~>?)");ie("TILDETRIM",`(\\s*)${q[W.LONETILDE]}\\s+`,!0);vt.tildeTrimReplace="$1~";ie("TILDE",`^${q[W.LONETILDE]}${q[W.XRANGEPLAIN]}$`);ie("TILDELOOSE",`^${q[W.LONETILDE]}${q[W.XRANGEPLAINLOOSE]}$`);ie("LONECARET","(?:\\^)");ie("CARETTRIM",`(\\s*)${q[W.LONECARET]}\\s+`,!0);vt.caretTrimReplace="$1^";ie("CARET",`^${q[W.LONECARET]}${q[W.XRANGEPLAIN]}$`);ie("CARETLOOSE",`^${q[W.LONECARET]}${q[W.XRANGEPLAINLOOSE]}$`);ie("COMPARATORLOOSE",`^${q[W.GTLT]}\\s*(${q[W.LOOSEPLAIN]})$|^$`);ie("COMPARATOR",`^${q[W.GTLT]}\\s*(${q[W.FULLPLAIN]})$|^$`);ie("COMPARATORTRIM",`(\\s*)${q[W.GTLT]}\\s*(${q[W.LOOSEPLAIN]}|${q[W.XRANGEPLAIN]})`,!0);vt.comparatorTrimReplace="$1$2$3";ie("HYPHENRANGE",`^\\s*(${q[W.XRANGEPLAIN]})\\s+-\\s+(${q[W.XRANGEPLAIN]})\\s*$`);ie("HYPHENRANGELOOSE",`^\\s*(${q[W.XRANGEPLAINLOOSE]})\\s+-\\s+(${q[W.XRANGEPLAINLOOSE]})\\s*$`);ie("STAR","(<|>)?=?\\s*\\*");ie("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ie("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var en=j((DT,Xh)=>{"use strict";var P1=Object.freeze({loose:!0}),I1=Object.freeze({}),F1=t=>t?typeof t!="object"?P1:t:I1;Xh.exports=F1});var za=j((MT,Qh)=>{"use strict";var Jh=/^[0-9]+$/,Zh=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=Jh.test(t),i=Jh.test(e);return r&&i&&(t=+t,e=+e),t===e?0:r&&!i?-1:i&&!r?1:t<e?-1:1},N1=(t,e)=>Zh(e,t);Qh.exports={compareIdentifiers:Zh,rcompareIdentifiers:N1}});var Ie=j((kT,tf)=>{"use strict";var tn=Vi(),{MAX_LENGTH:ef,MAX_SAFE_INTEGER:rn}=Wi(),{safeRe:sn,t:nn}=Xr(),D1=en(),{compareIdentifiers:qa}=za(),Wa=class t{constructor(e,r){if(r=D1(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.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>ef)throw new TypeError(`version is longer than ${ef} characters`);tn("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let i=e.trim().match(r.loose?sn[nn.LOOSE]:sn[nn.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>rn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>rn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>rn||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let n=+s;if(n>=0&&n<rn)return n}return s}):this.prerelease=[],this.build=i[5]?i[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(tn("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(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 t||(e=new t(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 r=0;do{let i=this.prerelease[r],s=e.prerelease[r];if(tn("prerelease compare",r,i,s),i===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(i===void 0)return-1;if(i===s)continue;return qa(i,s)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let i=this.build[r],s=e.build[r];if(tn("build compare",r,i,s),i===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(i===void 0)return-1;if(i===s)continue;return qa(i,s)}while(++r)}inc(e,r,i){if(e.startsWith("pre")){if(!r&&i===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let s=`-${r}`.match(this.options.loose?sn[nn.PRERELEASELOOSE]:sn[nn.PRERELEASE]);if(!s||s[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,i),this.inc("pre",r,i);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,i),this.inc("pre",r,i);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 s=Number(i)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);if(n===-1){if(r===this.prerelease.join(".")&&i===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let n=[r,s];i===!1&&(n=[r]),qa(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};tf.exports=Wa});var ar=j((jT,sf)=>{"use strict";var rf=Ie(),M1=(t,e,r=!1)=>{if(t instanceof rf)return t;try{return new rf(t,e)}catch(i){if(!r)return null;throw i}};sf.exports=M1});var of=j((BT,nf)=>{"use strict";var k1=ar(),j1=(t,e)=>{let r=k1(t,e);return r?r.version:null};nf.exports=j1});var cf=j((UT,af)=>{"use strict";var B1=ar(),U1=(t,e)=>{let r=B1(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};af.exports=U1});var hf=j((GT,uf)=>{"use strict";var lf=Ie(),G1=(t,e,r,i,s)=>{typeof r=="string"&&(s=i,i=r,r=void 0);try{return new lf(t instanceof lf?t.version:t,r).inc(e,i,s).version}catch{return null}};uf.exports=G1});var df=j((zT,pf)=>{"use strict";var ff=ar(),z1=(t,e)=>{let r=ff(t,null,!0),i=ff(e,null,!0),s=r.compare(i);if(s===0)return null;let n=s>0,a=n?r:i,o=n?i:r,c=!!a.prerelease.length;if(!!o.prerelease.length&&!c){if(!o.patch&&!o.minor)return"major";if(o.compareMain(a)===0)return o.minor&&!o.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"};pf.exports=z1});var gf=j((qT,mf)=>{"use strict";var q1=Ie(),W1=(t,e)=>new q1(t,e).major;mf.exports=W1});var bf=j((WT,yf)=>{"use strict";var V1=Ie(),H1=(t,e)=>new V1(t,e).minor;yf.exports=H1});var wf=j((VT,vf)=>{"use strict";var K1=Ie(),Y1=(t,e)=>new K1(t,e).patch;vf.exports=Y1});var Ef=j((HT,xf)=>{"use strict";var X1=ar(),J1=(t,e)=>{let r=X1(t,e);return r&&r.prerelease.length?r.prerelease:null};xf.exports=J1});var Ze=j((KT,Sf)=>{"use strict";var _f=Ie(),Z1=(t,e,r)=>new _f(t,r).compare(new _f(e,r));Sf.exports=Z1});var Cf=j((YT,Rf)=>{"use strict";var Q1=Ze(),ex=(t,e,r)=>Q1(e,t,r);Rf.exports=ex});var Lf=j((XT,Af)=>{"use strict";var tx=Ze(),rx=(t,e)=>tx(t,e,!0);Af.exports=rx});var on=j((JT,$f)=>{"use strict";var Of=Ie(),ix=(t,e,r)=>{let i=new Of(t,r),s=new Of(e,r);return i.compare(s)||i.compareBuild(s)};$f.exports=ix});var Pf=j((ZT,Tf)=>{"use strict";var sx=on(),nx=(t,e)=>t.sort((r,i)=>sx(r,i,e));Tf.exports=nx});var Ff=j((QT,If)=>{"use strict";var ox=on(),ax=(t,e)=>t.sort((r,i)=>ox(i,r,e));If.exports=ax});var Hi=j((eP,Nf)=>{"use strict";var cx=Ze(),lx=(t,e,r)=>cx(t,e,r)>0;Nf.exports=lx});var an=j((tP,Df)=>{"use strict";var ux=Ze(),hx=(t,e,r)=>ux(t,e,r)<0;Df.exports=hx});var Va=j((rP,Mf)=>{"use strict";var fx=Ze(),px=(t,e,r)=>fx(t,e,r)===0;Mf.exports=px});var Ha=j((iP,kf)=>{"use strict";var dx=Ze(),mx=(t,e,r)=>dx(t,e,r)!==0;kf.exports=mx});var cn=j((sP,jf)=>{"use strict";var gx=Ze(),yx=(t,e,r)=>gx(t,e,r)>=0;jf.exports=yx});var ln=j((nP,Bf)=>{"use strict";var bx=Ze(),vx=(t,e,r)=>bx(t,e,r)<=0;Bf.exports=vx});var Ka=j((oP,Uf)=>{"use strict";var wx=Va(),xx=Ha(),Ex=Hi(),_x=cn(),Sx=an(),Rx=ln(),Cx=(t,e,r,i)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return wx(t,r,i);case"!=":return xx(t,r,i);case">":return Ex(t,r,i);case">=":return _x(t,r,i);case"<":return Sx(t,r,i);case"<=":return Rx(t,r,i);default:throw new TypeError(`Invalid operator: ${e}`)}};Uf.exports=Cx});var zf=j((aP,Gf)=>{"use strict";var Ax=Ie(),Lx=ar(),{safeRe:un,t:hn}=Xr(),Ox=(t,e)=>{if(t instanceof Ax)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?un[hn.COERCEFULL]:un[hn.COERCE]);else{let c=e.includePrerelease?un[hn.COERCERTLFULL]:un[hn.COERCERTL],l;for(;(l=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let i=r[2],s=r[3]||"0",n=r[4]||"0",a=e.includePrerelease&&r[5]?`-${r[5]}`:"",o=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Lx(`${i}.${s}.${n}${a}${o}`,e)};Gf.exports=Ox});var Wf=j((cP,qf)=>{"use strict";var Ya=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(e,r)}return this}};qf.exports=Ya});var Qe=j((lP,Yf)=>{"use strict";var $x=/\s+/g,Xa=class t{constructor(e,r){if(r=Px(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Ja)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace($x," "),this.set=this.raw.split("||").map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let i=this.set[0];if(this.set=this.set.filter(s=>!Hf(s[0])),this.set.length===0)this.set=[i];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&jx(s[0])){this.set=[s];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 r=this.set[e];for(let i=0;i<r.length;i++)i>0&&(this.formatted+=" "),this.formatted+=r[i].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let i=((this.options.includePrerelease&&Mx)|(this.options.loose&&kx))+":"+e,s=Vf.get(i);if(s)return s;let n=this.options.loose,a=n?Ue[Fe.HYPHENRANGELOOSE]:Ue[Fe.HYPHENRANGE];e=e.replace(a,Yx(this.options.includePrerelease)),de("hyphen replace",e),e=e.replace(Ue[Fe.COMPARATORTRIM],Fx),de("comparator trim",e),e=e.replace(Ue[Fe.TILDETRIM],Nx),de("tilde trim",e),e=e.replace(Ue[Fe.CARETTRIM],Dx),de("caret trim",e);let o=e.split(" ").map(d=>Bx(d,this.options)).join(" ").split(/\s+/).map(d=>Kx(d,this.options));n&&(o=o.filter(d=>(de("loose invalid filter",d,this.options),!!d.match(Ue[Fe.COMPARATORLOOSE])))),de("range list",o);let c=new Map,l=o.map(d=>new Ja(d,this.options));for(let d of l){if(Hf(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return Vf.set(i,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(i=>Kf(i,r)&&e.set.some(s=>Kf(s,r)&&i.every(n=>s.every(a=>n.intersects(a,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Ix(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Xx(this.set[r],e,this.options))return!0;return!1}};Yf.exports=Xa;var Tx=Wf(),Vf=new Tx,Px=en(),Ja=Ki(),de=Vi(),Ix=Ie(),{safeRe:Ue,t:Fe,comparatorTrimReplace:Fx,tildeTrimReplace:Nx,caretTrimReplace:Dx}=Xr(),{FLAG_INCLUDE_PRERELEASE:Mx,FLAG_LOOSE:kx}=Wi(),Hf=t=>t.value==="<0.0.0-0",jx=t=>t.value==="",Kf=(t,e)=>{let r=!0,i=t.slice(),s=i.pop();for(;r&&i.length;)r=i.every(n=>s.intersects(n,e)),s=i.pop();return r},Bx=(t,e)=>(t=t.replace(Ue[Fe.BUILD],""),de("comp",t,e),t=zx(t,e),de("caret",t),t=Ux(t,e),de("tildes",t),t=Wx(t,e),de("xrange",t),t=Hx(t,e),de("stars",t),t),Ge=t=>!t||t.toLowerCase()==="x"||t==="*",Ux=(t,e)=>t.trim().split(/\s+/).map(r=>Gx(r,e)).join(" "),Gx=(t,e)=>{let r=e.loose?Ue[Fe.TILDELOOSE]:Ue[Fe.TILDE];return t.replace(r,(i,s,n,a,o)=>{de("tilde",t,i,s,n,a,o);let c;return Ge(s)?c="":Ge(n)?c=`>=${s}.0.0 <${+s+1}.0.0-0`:Ge(a)?c=`>=${s}.${n}.0 <${s}.${+n+1}.0-0`:o?(de("replaceTilde pr",o),c=`>=${s}.${n}.${a}-${o} <${s}.${+n+1}.0-0`):c=`>=${s}.${n}.${a} <${s}.${+n+1}.0-0`,de("tilde return",c),c})},zx=(t,e)=>t.trim().split(/\s+/).map(r=>qx(r,e)).join(" "),qx=(t,e)=>{de("caret",t,e);let r=e.loose?Ue[Fe.CARETLOOSE]:Ue[Fe.CARET],i=e.includePrerelease?"-0":"";return t.replace(r,(s,n,a,o,c)=>{de("caret",t,s,n,a,o,c);let l;return Ge(n)?l="":Ge(a)?l=`>=${n}.0.0${i} <${+n+1}.0.0-0`:Ge(o)?n==="0"?l=`>=${n}.${a}.0${i} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.0${i} <${+n+1}.0.0-0`:c?(de("replaceCaret pr",c),n==="0"?a==="0"?l=`>=${n}.${a}.${o}-${c} <${n}.${a}.${+o+1}-0`:l=`>=${n}.${a}.${o}-${c} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.${o}-${c} <${+n+1}.0.0-0`):(de("no pr"),n==="0"?a==="0"?l=`>=${n}.${a}.${o}${i} <${n}.${a}.${+o+1}-0`:l=`>=${n}.${a}.${o}${i} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.${o} <${+n+1}.0.0-0`),de("caret return",l),l})},Wx=(t,e)=>(de("replaceXRanges",t,e),t.split(/\s+/).map(r=>Vx(r,e)).join(" ")),Vx=(t,e)=>{t=t.trim();let r=e.loose?Ue[Fe.XRANGELOOSE]:Ue[Fe.XRANGE];return t.replace(r,(i,s,n,a,o,c)=>{de("xRange",t,i,s,n,a,o,c);let l=Ge(n),u=l||Ge(a),d=u||Ge(o),g=d;return s==="="&&g&&(s=""),c=e.includePrerelease?"-0":"",l?s===">"||s==="<"?i="<0.0.0-0":i="*":s&&g?(u&&(a=0),o=0,s===">"?(s=">=",u?(n=+n+1,a=0,o=0):(a=+a+1,o=0)):s==="<="&&(s="<",u?n=+n+1:a=+a+1),s==="<"&&(c="-0"),i=`${s+n}.${a}.${o}${c}`):u?i=`>=${n}.0.0${c} <${+n+1}.0.0-0`:d&&(i=`>=${n}.${a}.0${c} <${n}.${+a+1}.0-0`),de("xRange return",i),i})},Hx=(t,e)=>(de("replaceStars",t,e),t.trim().replace(Ue[Fe.STAR],"")),Kx=(t,e)=>(de("replaceGTE0",t,e),t.trim().replace(Ue[e.includePrerelease?Fe.GTE0PRE:Fe.GTE0],"")),Yx=t=>(e,r,i,s,n,a,o,c,l,u,d,g)=>(Ge(i)?r="":Ge(s)?r=`>=${i}.0.0${t?"-0":""}`:Ge(n)?r=`>=${i}.${s}.0${t?"-0":""}`:a?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Ge(l)?c="":Ge(u)?c=`<${+l+1}.0.0-0`:Ge(d)?c=`<${l}.${+u+1}.0-0`:g?c=`<=${l}.${u}.${d}-${g}`:t?c=`<${l}.${u}.${+d+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),Xx=(t,e,r)=>{for(let i=0;i<t.length;i++)if(!t[i].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let i=0;i<t.length;i++)if(de(t[i].semver),t[i].semver!==Ja.ANY&&t[i].semver.prerelease.length>0){let s=t[i].semver;if(s.major===e.major&&s.minor===e.minor&&s.patch===e.patch)return!0}return!1}return!0}});var Ki=j((uP,tp)=>{"use strict";var Yi=Symbol("SemVer ANY"),ec=class t{static get ANY(){return Yi}constructor(e,r){if(r=Xf(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Qa("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Yi?this.value="":this.value=this.operator+this.semver.version,Qa("comp",this)}parse(e){let r=this.options.loose?Jf[Zf.COMPARATORLOOSE]:Jf[Zf.COMPARATOR],i=e.match(r);if(!i)throw new TypeError(`Invalid comparator: ${e}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new Qf(i[2],this.options.loose):this.semver=Yi}toString(){return this.value}test(e){if(Qa("Comparator.test",e,this.options.loose),this.semver===Yi||e===Yi)return!0;if(typeof e=="string")try{e=new Qf(e,this.options)}catch{return!1}return Za(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new ep(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new ep(this.value,r).test(e.semver):(r=Xf(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.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("=")||Za(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Za(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};tp.exports=ec;var Xf=en(),{safeRe:Jf,t:Zf}=Xr(),Za=Ka(),Qa=Vi(),Qf=Ie(),ep=Qe()});var Xi=j((hP,rp)=>{"use strict";var Jx=Qe(),Zx=(t,e,r)=>{try{e=new Jx(e,r)}catch{return!1}return e.test(t)};rp.exports=Zx});var sp=j((fP,ip)=>{"use strict";var Qx=Qe(),eE=(t,e)=>new Qx(t,e).set.map(r=>r.map(i=>i.value).join(" ").trim().split(" "));ip.exports=eE});var op=j((pP,np)=>{"use strict";var tE=Ie(),rE=Qe(),iE=(t,e,r)=>{let i=null,s=null,n=null;try{n=new rE(e,r)}catch{return null}return t.forEach(a=>{n.test(a)&&(!i||s.compare(a)===-1)&&(i=a,s=new tE(i,r))}),i};np.exports=iE});var cp=j((dP,ap)=>{"use strict";var sE=Ie(),nE=Qe(),oE=(t,e,r)=>{let i=null,s=null,n=null;try{n=new nE(e,r)}catch{return null}return t.forEach(a=>{n.test(a)&&(!i||s.compare(a)===1)&&(i=a,s=new sE(i,r))}),i};ap.exports=oE});var hp=j((mP,up)=>{"use strict";var tc=Ie(),aE=Qe(),lp=Hi(),cE=(t,e)=>{t=new aE(t,e);let r=new tc("0.0.0");if(t.test(r)||(r=new tc("0.0.0-0"),t.test(r)))return r;r=null;for(let i=0;i<t.set.length;++i){let s=t.set[i],n=null;s.forEach(a=>{let o=new tc(a.semver.version);switch(a.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!n||lp(o,n))&&(n=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),n&&(!r||lp(r,n))&&(r=n)}return r&&t.test(r)?r:null};up.exports=cE});var pp=j((gP,fp)=>{"use strict";var lE=Qe(),uE=(t,e)=>{try{return new lE(t,e).range||"*"}catch{return null}};fp.exports=uE});var fn=j((yP,yp)=>{"use strict";var hE=Ie(),gp=Ki(),{ANY:fE}=gp,pE=Qe(),dE=Xi(),dp=Hi(),mp=an(),mE=ln(),gE=cn(),yE=(t,e,r,i)=>{t=new hE(t,i),e=new pE(e,i);let s,n,a,o,c;switch(r){case">":s=dp,n=mE,a=mp,o=">",c=">=";break;case"<":s=mp,n=gE,a=dp,o="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(dE(t,e,i))return!1;for(let l=0;l<e.set.length;++l){let u=e.set[l],d=null,g=null;if(u.forEach(h=>{h.semver===fE&&(h=new gp(">=0.0.0")),d=d||h,g=g||h,s(h.semver,d.semver,i)?d=h:a(h.semver,g.semver,i)&&(g=h)}),d.operator===o||d.operator===c||(!g.operator||g.operator===o)&&n(t,g.semver))return!1;if(g.operator===c&&a(t,g.semver))return!1}return!0};yp.exports=yE});var vp=j((bP,bp)=>{"use strict";var bE=fn(),vE=(t,e,r)=>bE(t,e,">",r);bp.exports=vE});var xp=j((vP,wp)=>{"use strict";var wE=fn(),xE=(t,e,r)=>wE(t,e,"<",r);wp.exports=xE});var Sp=j((wP,_p)=>{"use strict";var Ep=Qe(),EE=(t,e,r)=>(t=new Ep(t,r),e=new Ep(e,r),t.intersects(e,r));_p.exports=EE});var Cp=j((xP,Rp)=>{"use strict";var _E=Xi(),SE=Ze();Rp.exports=(t,e,r)=>{let i=[],s=null,n=null,a=t.sort((u,d)=>SE(u,d,r));for(let u of a)_E(u,e,r)?(n=u,s||(s=u)):(n&&i.push([s,n]),n=null,s=null);s&&i.push([s,null]);let o=[];for(let[u,d]of i)u===d?o.push(u):!d&&u===a[0]?o.push("*"):d?u===a[0]?o.push(`<=${d}`):o.push(`${u} - ${d}`):o.push(`>=${u}`);let c=o.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e}});var Pp=j((EP,Tp)=>{"use strict";var Ap=Qe(),ic=Ki(),{ANY:rc}=ic,Ji=Xi(),sc=Ze(),RE=(t,e,r={})=>{if(t===e)return!0;t=new Ap(t,r),e=new Ap(e,r);let i=!1;e:for(let s of t.set){for(let n of e.set){let a=AE(s,n,r);if(i=i||a!==null,a)continue e}if(i)return!1}return!0},CE=[new ic(">=0.0.0-0")],Lp=[new ic(">=0.0.0")],AE=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===rc){if(e.length===1&&e[0].semver===rc)return!0;r.includePrerelease?t=CE:t=Lp}if(e.length===1&&e[0].semver===rc){if(r.includePrerelease)return!0;e=Lp}let i=new Set,s,n;for(let h of t)h.operator===">"||h.operator===">="?s=Op(s,h,r):h.operator==="<"||h.operator==="<="?n=$p(n,h,r):i.add(h.semver);if(i.size>1)return null;let a;if(s&&n){if(a=sc(s.semver,n.semver,r),a>0)return null;if(a===0&&(s.operator!==">="||n.operator!=="<="))return null}for(let h of i){if(s&&!Ji(h,String(s),r)||n&&!Ji(h,String(n),r))return null;for(let p of e)if(!Ji(h,String(p),r))return!1;return!0}let o,c,l,u,d=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1,g=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;d&&d.prerelease.length===1&&n.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let h of e){if(u=u||h.operator===">"||h.operator===">=",l=l||h.operator==="<"||h.operator==="<=",s){if(g&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===g.major&&h.semver.minor===g.minor&&h.semver.patch===g.patch&&(g=!1),h.operator===">"||h.operator===">="){if(o=Op(s,h,r),o===h&&o!==s)return!1}else if(s.operator===">="&&!Ji(s.semver,String(h),r))return!1}if(n){if(d&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===d.major&&h.semver.minor===d.minor&&h.semver.patch===d.patch&&(d=!1),h.operator==="<"||h.operator==="<="){if(c=$p(n,h,r),c===h&&c!==n)return!1}else if(n.operator==="<="&&!Ji(n.semver,String(h),r))return!1}if(!h.operator&&(n||s)&&a!==0)return!1}return!(s&&l&&!n&&a!==0||n&&u&&!s&&a!==0||g||d)},Op=(t,e,r)=>{if(!t)return e;let i=sc(t.semver,e.semver,r);return i>0?t:i<0||e.operator===">"&&t.operator===">="?e:t},$p=(t,e,r)=>{if(!t)return e;let i=sc(t.semver,e.semver,r);return i<0?t:i>0||e.operator==="<"&&t.operator==="<="?e:t};Tp.exports=RE});var oc=j((_P,Np)=>{"use strict";var nc=Xr(),Ip=Wi(),LE=Ie(),Fp=za(),OE=ar(),$E=of(),TE=cf(),PE=hf(),IE=df(),FE=gf(),NE=bf(),DE=wf(),ME=Ef(),kE=Ze(),jE=Cf(),BE=Lf(),UE=on(),GE=Pf(),zE=Ff(),qE=Hi(),WE=an(),VE=Va(),HE=Ha(),KE=cn(),YE=ln(),XE=Ka(),JE=zf(),ZE=Ki(),QE=Qe(),e_=Xi(),t_=sp(),r_=op(),i_=cp(),s_=hp(),n_=pp(),o_=fn(),a_=vp(),c_=xp(),l_=Sp(),u_=Cp(),h_=Pp();Np.exports={parse:OE,valid:$E,clean:TE,inc:PE,diff:IE,major:FE,minor:NE,patch:DE,prerelease:ME,compare:kE,rcompare:jE,compareLoose:BE,compareBuild:UE,sort:GE,rsort:zE,gt:qE,lt:WE,eq:VE,neq:HE,gte:KE,lte:YE,cmp:XE,coerce:JE,Comparator:ZE,Range:QE,satisfies:e_,toComparators:t_,maxSatisfying:r_,minSatisfying:i_,minVersion:s_,validRange:n_,outside:o_,gtr:a_,ltr:c_,intersects:l_,simplifyRange:u_,subset:h_,SemVer:LE,re:nc.re,src:nc.src,tokens:nc.t,SEMVER_SPEC_VERSION:Ip.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ip.RELEASE_TYPES,compareIdentifiers:Fp.compareIdentifiers,rcompareIdentifiers:Fp.rcompareIdentifiers}});var Mp=j((SP,Dp)=>{function et(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}Dp.exports=et;et.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};et.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};et.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);else return!1;var i=this;return this._timer=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},r),this._options.unref&&this._timer.unref(),!0};et.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};et.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};et.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};et.prototype.start=et.prototype.try;et.prototype.errors=function(){return this._errors};et.prototype.attempts=function(){return this._attempts};et.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,i=0;i<this._errors.length;i++){var s=this._errors[i],n=s.message,a=(t[n]||0)+1;t[n]=a,a>=r&&(e=s,r=a)}return e}});var kp=j(cr=>{var f_=Mp();cr.operation=function(t){var e=cr.timeouts(t);return new f_(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};cr.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],s=0;s<e.retries;s++)i.push(this.createTimeout(s,e));return t&&t.forever&&!i.length&&i.push(this.createTimeout(s,e)),i.sort(function(n,a){return n-a}),i};cr.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,i=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return i=Math.min(i,e.maxTimeout),i};cr.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var i in t)typeof t[i]=="function"&&r.push(i)}for(var s=0;s<r.length;s++){var n=r[s],a=t[n];t[n]=function(c){var l=cr.operation(e),u=Array.prototype.slice.call(arguments,1),d=u.pop();u.push(function(g){l.retry(g)||(g&&(arguments[0]=l.mainError()),d.apply(this,arguments))}),l.attempt(function(){c.apply(t,u)})}.bind(t,a),t[n].options=e}}});var Bp=j((CP,jp)=>{jp.exports=kp()});var xc=j(Rr=>{Rr.parse=Rr.decode=BS;Rr.stringify=Rr.encode=dd;Rr.safe=ai;Rr.unsafe=_n;var wc=typeof process<"u"&&process.platform==="win32"?`\r
|
|
3
|
+
var i_=Object.create;var to=Object.defineProperty;var n_=Object.getOwnPropertyDescriptor;var o_=Object.getOwnPropertyNames;var a_=Object.getPrototypeOf,c_=Object.prototype.hasOwnProperty;var M=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var l_=(t,e)=>()=>(t&&(e=t(t=0)),e);var B=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),rc=(t,e)=>{for(var r in e)to(t,r,{get:e[r],enumerable:!0})},bf=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of o_(e))!c_.call(t,i)&&i!==r&&to(t,i,{get:()=>e[i],enumerable:!(s=n_(e,i))||s.enumerable});return t};var nt=(t,e,r)=>(r=t!=null?i_(a_(t)):{},bf(e||!t||!t.__esModule?to(r,"default",{value:t,enumerable:!0}):r,t)),u_=t=>bf(to({},"__esModule",{value:!0}),t);var kf=B((q2,N_)=>{N_.exports={name:"dotenv",version:"16.4.7",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var Mf=B((W2,Xt)=>{var ac=M("fs"),cc=M("path"),D_=M("os"),F_=M("crypto"),M_=kf(),lc=M_.version,j_=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function B_(t){let e={},r=t.toString();r=r.replace(/\r\n?/mg,`
|
|
4
|
+
`);let s;for(;(s=j_.exec(r))!=null;){let i=s[1],n=s[2]||"";n=n.trim();let a=n[0];n=n.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),a==='"'&&(n=n.replace(/\\n/g,`
|
|
5
|
+
`),n=n.replace(/\\r/g,"\r")),e[i]=n}return e}function U_(t){let e=Ff(t),r=ke.configDotenv({path:e});if(!r.parsed){let a=new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);throw a.code="MISSING_DATA",a}let s=Df(t).split(","),i=s.length,n;for(let a=0;a<i;a++)try{let o=s[a].trim(),c=q_(r,o);n=ke.decrypt(c.ciphertext,c.key);break}catch(o){if(a+1>=i)throw o}return ke.parse(n)}function G_(t){console.log(`[dotenv@${lc}][INFO] ${t}`)}function z_(t){console.log(`[dotenv@${lc}][WARN] ${t}`)}function no(t){console.log(`[dotenv@${lc}][DEBUG] ${t}`)}function Df(t){return t&&t.DOTENV_KEY&&t.DOTENV_KEY.length>0?t.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function q_(t,e){let r;try{r=new URL(e)}catch(o){if(o.code==="ERR_INVALID_URL"){let c=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw c.code="INVALID_DOTENV_KEY",c}throw o}let s=r.password;if(!s){let o=new Error("INVALID_DOTENV_KEY: Missing key part");throw o.code="INVALID_DOTENV_KEY",o}let i=r.searchParams.get("environment");if(!i){let o=new Error("INVALID_DOTENV_KEY: Missing environment part");throw o.code="INVALID_DOTENV_KEY",o}let n=`DOTENV_VAULT_${i.toUpperCase()}`,a=t.parsed[n];if(!a){let o=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${n} in your .env.vault file.`);throw o.code="NOT_FOUND_DOTENV_ENVIRONMENT",o}return{ciphertext:a,key:s}}function Ff(t){let e=null;if(t&&t.path&&t.path.length>0)if(Array.isArray(t.path))for(let r of t.path)ac.existsSync(r)&&(e=r.endsWith(".vault")?r:`${r}.vault`);else e=t.path.endsWith(".vault")?t.path:`${t.path}.vault`;else e=cc.resolve(process.cwd(),".env.vault");return ac.existsSync(e)?e:null}function Nf(t){return t[0]==="~"?cc.join(D_.homedir(),t.slice(1)):t}function W_(t){G_("Loading env from encrypted .env.vault");let e=ke._parseVault(t),r=process.env;return t&&t.processEnv!=null&&(r=t.processEnv),ke.populate(r,e,t),{parsed:e}}function V_(t){let e=cc.resolve(process.cwd(),".env"),r="utf8",s=!!(t&&t.debug);t&&t.encoding?r=t.encoding:s&&no("No encoding is specified. UTF-8 is used by default");let i=[e];if(t&&t.path)if(!Array.isArray(t.path))i=[Nf(t.path)];else{i=[];for(let c of t.path)i.push(Nf(c))}let n,a={};for(let c of i)try{let l=ke.parse(ac.readFileSync(c,{encoding:r}));ke.populate(a,l,t)}catch(l){s&&no(`Failed to load ${c} ${l.message}`),n=l}let o=process.env;return t&&t.processEnv!=null&&(o=t.processEnv),ke.populate(o,a,t),n?{parsed:a,error:n}:{parsed:a}}function Z_(t){if(Df(t).length===0)return ke.configDotenv(t);let e=Ff(t);return e?ke._configVault(t):(z_(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),ke.configDotenv(t))}function H_(t,e){let r=Buffer.from(e.slice(-64),"hex"),s=Buffer.from(t,"base64"),i=s.subarray(0,12),n=s.subarray(-16);s=s.subarray(12,-16);try{let a=F_.createDecipheriv("aes-256-gcm",r,i);return a.setAuthTag(n),`${a.update(s)}${a.final()}`}catch(a){let o=a instanceof RangeError,c=a.message==="Invalid key length",l=a.message==="Unsupported state or unable to authenticate data";if(o||c){let u=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw u.code="INVALID_DOTENV_KEY",u}else if(l){let u=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw u.code="DECRYPTION_FAILED",u}else throw a}}function K_(t,e,r={}){let s=!!(r&&r.debug),i=!!(r&&r.override);if(typeof e!="object"){let n=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw n.code="OBJECT_REQUIRED",n}for(let n of Object.keys(e))Object.prototype.hasOwnProperty.call(t,n)?(i===!0&&(t[n]=e[n]),s&&no(i===!0?`"${n}" is already defined and WAS overwritten`:`"${n}" is already defined and was NOT overwritten`)):t[n]=e[n]}var ke={configDotenv:V_,_configVault:W_,_parseVault:U_,config:Z_,decrypt:H_,parse:B_,populate:K_};Xt.exports.configDotenv=ke.configDotenv;Xt.exports._configVault=ke._configVault;Xt.exports._parseVault=ke._parseVault;Xt.exports.config=ke.config;Xt.exports.decrypt=ke.decrypt;Xt.exports.parse=ke.parse;Xt.exports.populate=ke.populate;Xt.exports=ke});var Hi=B((Ak,bd)=>{"use strict";var q1="2.0.0",W1=Number.MAX_SAFE_INTEGER||9007199254740991,V1=16,Z1=250,H1=["major","premajor","minor","preminor","patch","prepatch","prerelease"];bd.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:V1,MAX_SAFE_BUILD_LENGTH:Z1,MAX_SAFE_INTEGER:W1,RELEASE_TYPES:H1,SEMVER_SPEC_VERSION:q1,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Ki=B((Ck,_d)=>{"use strict";var K1=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};_d.exports=K1});var Vs=B((Ut,wd)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:il,MAX_SAFE_BUILD_LENGTH:Y1,MAX_LENGTH:J1}=Hi(),X1=Ki();Ut=wd.exports={};var Q1=Ut.re=[],eE=Ut.safeRe=[],K=Ut.src=[],tE=Ut.safeSrc=[],Y=Ut.t={},rE=0,nl="[a-zA-Z0-9-]",sE=[["\\s",1],["\\d",J1],[nl,Y1]],iE=t=>{for(let[e,r]of sE)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ue=(t,e,r)=>{let s=iE(e),i=rE++;X1(t,i,e),Y[t]=i,K[i]=e,tE[i]=s,Q1[i]=new RegExp(e,r?"g":void 0),eE[i]=new RegExp(s,r?"g":void 0)};ue("NUMERICIDENTIFIER","0|[1-9]\\d*");ue("NUMERICIDENTIFIERLOOSE","\\d+");ue("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${nl}*`);ue("MAINVERSION",`(${K[Y.NUMERICIDENTIFIER]})\\.(${K[Y.NUMERICIDENTIFIER]})\\.(${K[Y.NUMERICIDENTIFIER]})`);ue("MAINVERSIONLOOSE",`(${K[Y.NUMERICIDENTIFIERLOOSE]})\\.(${K[Y.NUMERICIDENTIFIERLOOSE]})\\.(${K[Y.NUMERICIDENTIFIERLOOSE]})`);ue("PRERELEASEIDENTIFIER",`(?:${K[Y.NONNUMERICIDENTIFIER]}|${K[Y.NUMERICIDENTIFIER]})`);ue("PRERELEASEIDENTIFIERLOOSE",`(?:${K[Y.NONNUMERICIDENTIFIER]}|${K[Y.NUMERICIDENTIFIERLOOSE]})`);ue("PRERELEASE",`(?:-(${K[Y.PRERELEASEIDENTIFIER]}(?:\\.${K[Y.PRERELEASEIDENTIFIER]})*))`);ue("PRERELEASELOOSE",`(?:-?(${K[Y.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${K[Y.PRERELEASEIDENTIFIERLOOSE]})*))`);ue("BUILDIDENTIFIER",`${nl}+`);ue("BUILD",`(?:\\+(${K[Y.BUILDIDENTIFIER]}(?:\\.${K[Y.BUILDIDENTIFIER]})*))`);ue("FULLPLAIN",`v?${K[Y.MAINVERSION]}${K[Y.PRERELEASE]}?${K[Y.BUILD]}?`);ue("FULL",`^${K[Y.FULLPLAIN]}$`);ue("LOOSEPLAIN",`[v=\\s]*${K[Y.MAINVERSIONLOOSE]}${K[Y.PRERELEASELOOSE]}?${K[Y.BUILD]}?`);ue("LOOSE",`^${K[Y.LOOSEPLAIN]}$`);ue("GTLT","((?:<|>)?=?)");ue("XRANGEIDENTIFIERLOOSE",`${K[Y.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ue("XRANGEIDENTIFIER",`${K[Y.NUMERICIDENTIFIER]}|x|X|\\*`);ue("XRANGEPLAIN",`[v=\\s]*(${K[Y.XRANGEIDENTIFIER]})(?:\\.(${K[Y.XRANGEIDENTIFIER]})(?:\\.(${K[Y.XRANGEIDENTIFIER]})(?:${K[Y.PRERELEASE]})?${K[Y.BUILD]}?)?)?`);ue("XRANGEPLAINLOOSE",`[v=\\s]*(${K[Y.XRANGEIDENTIFIERLOOSE]})(?:\\.(${K[Y.XRANGEIDENTIFIERLOOSE]})(?:\\.(${K[Y.XRANGEIDENTIFIERLOOSE]})(?:${K[Y.PRERELEASELOOSE]})?${K[Y.BUILD]}?)?)?`);ue("XRANGE",`^${K[Y.GTLT]}\\s*${K[Y.XRANGEPLAIN]}$`);ue("XRANGELOOSE",`^${K[Y.GTLT]}\\s*${K[Y.XRANGEPLAINLOOSE]}$`);ue("COERCEPLAIN",`(^|[^\\d])(\\d{1,${il}})(?:\\.(\\d{1,${il}}))?(?:\\.(\\d{1,${il}}))?`);ue("COERCE",`${K[Y.COERCEPLAIN]}(?:$|[^\\d])`);ue("COERCEFULL",K[Y.COERCEPLAIN]+`(?:${K[Y.PRERELEASE]})?(?:${K[Y.BUILD]})?(?:$|[^\\d])`);ue("COERCERTL",K[Y.COERCE],!0);ue("COERCERTLFULL",K[Y.COERCEFULL],!0);ue("LONETILDE","(?:~>?)");ue("TILDETRIM",`(\\s*)${K[Y.LONETILDE]}\\s+`,!0);Ut.tildeTrimReplace="$1~";ue("TILDE",`^${K[Y.LONETILDE]}${K[Y.XRANGEPLAIN]}$`);ue("TILDELOOSE",`^${K[Y.LONETILDE]}${K[Y.XRANGEPLAINLOOSE]}$`);ue("LONECARET","(?:\\^)");ue("CARETTRIM",`(\\s*)${K[Y.LONECARET]}\\s+`,!0);Ut.caretTrimReplace="$1^";ue("CARET",`^${K[Y.LONECARET]}${K[Y.XRANGEPLAIN]}$`);ue("CARETLOOSE",`^${K[Y.LONECARET]}${K[Y.XRANGEPLAINLOOSE]}$`);ue("COMPARATORLOOSE",`^${K[Y.GTLT]}\\s*(${K[Y.LOOSEPLAIN]})$|^$`);ue("COMPARATOR",`^${K[Y.GTLT]}\\s*(${K[Y.FULLPLAIN]})$|^$`);ue("COMPARATORTRIM",`(\\s*)${K[Y.GTLT]}\\s*(${K[Y.LOOSEPLAIN]}|${K[Y.XRANGEPLAIN]})`,!0);Ut.comparatorTrimReplace="$1$2$3";ue("HYPHENRANGE",`^\\s*(${K[Y.XRANGEPLAIN]})\\s+-\\s+(${K[Y.XRANGEPLAIN]})\\s*$`);ue("HYPHENRANGELOOSE",`^\\s*(${K[Y.XRANGEPLAINLOOSE]})\\s+-\\s+(${K[Y.XRANGEPLAINLOOSE]})\\s*$`);ue("STAR","(<|>)?=?\\s*\\*");ue("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ue("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var fo=B((Ok,xd)=>{"use strict";var nE=Object.freeze({loose:!0}),oE=Object.freeze({}),aE=t=>t?typeof t!="object"?nE:t:oE;xd.exports=aE});var ol=B((Tk,Rd)=>{"use strict";var Ed=/^[0-9]+$/,Sd=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let r=Ed.test(t),s=Ed.test(e);return r&&s&&(t=+t,e=+e),t===e?0:r&&!s?-1:s&&!r?1:t<e?-1:1},cE=(t,e)=>Sd(e,t);Rd.exports={compareIdentifiers:Sd,rcompareIdentifiers:cE}});var We=B((Lk,Cd)=>{"use strict";var ho=Ki(),{MAX_LENGTH:Ad,MAX_SAFE_INTEGER:po}=Hi(),{safeRe:mo,t:go}=Vs(),lE=fo(),{compareIdentifiers:al}=ol(),cl=class t{constructor(e,r){if(r=lE(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.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>Ad)throw new TypeError(`version is longer than ${Ad} characters`);ho("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let s=e.trim().match(r.loose?mo[go.LOOSE]:mo[go.FULL]);if(!s)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>po||this.major<0)throw new TypeError("Invalid major version");if(this.minor>po||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>po||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let n=+i;if(n>=0&&n<po)return n}return i}):this.prerelease=[],this.build=s[5]?s[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(ho("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(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 t||(e=new t(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 r=0;do{let s=this.prerelease[r],i=e.prerelease[r];if(ho("prerelease compare",r,s,i),s===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(s===void 0)return-1;if(s===i)continue;return al(s,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let s=this.build[r],i=e.build[r];if(ho("build compare",r,s,i),s===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(s===void 0)return-1;if(s===i)continue;return al(s,i)}while(++r)}inc(e,r,s){if(e.startsWith("pre")){if(!r&&s===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?mo[go.PRERELEASELOOSE]:mo[go.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,s);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,s);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,s),this.inc("pre",r,s);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,s),this.inc("pre",r,s);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(s)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let n=this.prerelease.length;for(;--n>=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);if(n===-1){if(r===this.prerelease.join(".")&&s===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let n=[r,i];s===!1&&(n=[r]),al(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Cd.exports=cl});var jr=B(($k,Td)=>{"use strict";var Od=We(),uE=(t,e,r=!1)=>{if(t instanceof Od)return t;try{return new Od(t,e)}catch(s){if(!r)return null;throw s}};Td.exports=uE});var $d=B((Pk,Ld)=>{"use strict";var fE=jr(),hE=(t,e)=>{let r=fE(t,e);return r?r.version:null};Ld.exports=hE});var Id=B((Ik,Pd)=>{"use strict";var dE=jr(),pE=(t,e)=>{let r=dE(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};Pd.exports=pE});var Dd=B((kk,Nd)=>{"use strict";var kd=We(),mE=(t,e,r,s,i)=>{typeof r=="string"&&(i=s,s=r,r=void 0);try{return new kd(t instanceof kd?t.version:t,r).inc(e,s,i).version}catch{return null}};Nd.exports=mE});var jd=B((Nk,Md)=>{"use strict";var Fd=jr(),gE=(t,e)=>{let r=Fd(t,null,!0),s=Fd(e,null,!0),i=r.compare(s);if(i===0)return null;let n=i>0,a=n?r:s,o=n?s:r,c=!!a.prerelease.length;if(!!o.prerelease.length&&!c){if(!o.patch&&!o.minor)return"major";if(o.compareMain(a)===0)return o.minor&&!o.patch?"minor":"patch"}let u=c?"pre":"";return r.major!==s.major?u+"major":r.minor!==s.minor?u+"minor":r.patch!==s.patch?u+"patch":"prerelease"};Md.exports=gE});var Ud=B((Dk,Bd)=>{"use strict";var yE=We(),vE=(t,e)=>new yE(t,e).major;Bd.exports=vE});var zd=B((Fk,Gd)=>{"use strict";var bE=We(),_E=(t,e)=>new bE(t,e).minor;Gd.exports=_E});var Wd=B((Mk,qd)=>{"use strict";var wE=We(),xE=(t,e)=>new wE(t,e).patch;qd.exports=xE});var Zd=B((jk,Vd)=>{"use strict";var EE=jr(),SE=(t,e)=>{let r=EE(t,e);return r&&r.prerelease.length?r.prerelease:null};Vd.exports=SE});var mt=B((Bk,Kd)=>{"use strict";var Hd=We(),RE=(t,e,r)=>new Hd(t,r).compare(new Hd(e,r));Kd.exports=RE});var Jd=B((Uk,Yd)=>{"use strict";var AE=mt(),CE=(t,e,r)=>AE(e,t,r);Yd.exports=CE});var Qd=B((Gk,Xd)=>{"use strict";var OE=mt(),TE=(t,e)=>OE(t,e,!0);Xd.exports=TE});var yo=B((zk,tp)=>{"use strict";var ep=We(),LE=(t,e,r)=>{let s=new ep(t,r),i=new ep(e,r);return s.compare(i)||s.compareBuild(i)};tp.exports=LE});var sp=B((qk,rp)=>{"use strict";var $E=yo(),PE=(t,e)=>t.sort((r,s)=>$E(r,s,e));rp.exports=PE});var np=B((Wk,ip)=>{"use strict";var IE=yo(),kE=(t,e)=>t.sort((r,s)=>IE(s,r,e));ip.exports=kE});var Yi=B((Vk,op)=>{"use strict";var NE=mt(),DE=(t,e,r)=>NE(t,e,r)>0;op.exports=DE});var vo=B((Zk,ap)=>{"use strict";var FE=mt(),ME=(t,e,r)=>FE(t,e,r)<0;ap.exports=ME});var ll=B((Hk,cp)=>{"use strict";var jE=mt(),BE=(t,e,r)=>jE(t,e,r)===0;cp.exports=BE});var ul=B((Kk,lp)=>{"use strict";var UE=mt(),GE=(t,e,r)=>UE(t,e,r)!==0;lp.exports=GE});var bo=B((Yk,up)=>{"use strict";var zE=mt(),qE=(t,e,r)=>zE(t,e,r)>=0;up.exports=qE});var _o=B((Jk,fp)=>{"use strict";var WE=mt(),VE=(t,e,r)=>WE(t,e,r)<=0;fp.exports=VE});var fl=B((Xk,hp)=>{"use strict";var ZE=ll(),HE=ul(),KE=Yi(),YE=bo(),JE=vo(),XE=_o(),QE=(t,e,r,s)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return ZE(t,r,s);case"!=":return HE(t,r,s);case">":return KE(t,r,s);case">=":return YE(t,r,s);case"<":return JE(t,r,s);case"<=":return XE(t,r,s);default:throw new TypeError(`Invalid operator: ${e}`)}};hp.exports=QE});var pp=B((Qk,dp)=>{"use strict";var eS=We(),tS=jr(),{safeRe:wo,t:xo}=Vs(),rS=(t,e)=>{if(t instanceof eS)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?wo[xo.COERCEFULL]:wo[xo.COERCE]);else{let c=e.includePrerelease?wo[xo.COERCERTLFULL]:wo[xo.COERCERTL],l;for(;(l=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;let s=r[2],i=r[3]||"0",n=r[4]||"0",a=e.includePrerelease&&r[5]?`-${r[5]}`:"",o=e.includePrerelease&&r[6]?`+${r[6]}`:"";return tS(`${s}.${i}.${n}${a}${o}`,e)};dp.exports=rS});var gp=B((eN,mp)=>{"use strict";var hl=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};mp.exports=hl});var gt=B((tN,_p)=>{"use strict";var sS=/\s+/g,dl=class t{constructor(e,r){if(r=nS(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof pl)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(sS," "),this.set=this.raw.split("||").map(s=>this.parseRange(s.trim())).filter(s=>s.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let s=this.set[0];if(this.set=this.set.filter(i=>!vp(i[0])),this.set.length===0)this.set=[s];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&hS(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 r=this.set[e];for(let s=0;s<r.length;s++)s>0&&(this.formatted+=" "),this.formatted+=r[s].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let s=((this.options.includePrerelease&&uS)|(this.options.loose&&fS))+":"+e,i=yp.get(s);if(i)return i;let n=this.options.loose,a=n?et[Ve.HYPHENRANGELOOSE]:et[Ve.HYPHENRANGE];e=e.replace(a,xS(this.options.includePrerelease)),Re("hyphen replace",e),e=e.replace(et[Ve.COMPARATORTRIM],aS),Re("comparator trim",e),e=e.replace(et[Ve.TILDETRIM],cS),Re("tilde trim",e),e=e.replace(et[Ve.CARETTRIM],lS),Re("caret trim",e);let o=e.split(" ").map(p=>dS(p,this.options)).join(" ").split(/\s+/).map(p=>wS(p,this.options));n&&(o=o.filter(p=>(Re("loose invalid filter",p,this.options),!!p.match(et[Ve.COMPARATORLOOSE])))),Re("range list",o);let c=new Map,l=o.map(p=>new pl(p,this.options));for(let p of l){if(vp(p))return[p];c.set(p.value,p)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return yp.set(s,u),u}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(s=>bp(s,r)&&e.set.some(i=>bp(i,r)&&s.every(n=>i.every(a=>n.intersects(a,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new oS(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(ES(this.set[r],e,this.options))return!0;return!1}};_p.exports=dl;var iS=gp(),yp=new iS,nS=fo(),pl=Ji(),Re=Ki(),oS=We(),{safeRe:et,t:Ve,comparatorTrimReplace:aS,tildeTrimReplace:cS,caretTrimReplace:lS}=Vs(),{FLAG_INCLUDE_PRERELEASE:uS,FLAG_LOOSE:fS}=Hi(),vp=t=>t.value==="<0.0.0-0",hS=t=>t.value==="",bp=(t,e)=>{let r=!0,s=t.slice(),i=s.pop();for(;r&&s.length;)r=s.every(n=>i.intersects(n,e)),i=s.pop();return r},dS=(t,e)=>(t=t.replace(et[Ve.BUILD],""),Re("comp",t,e),t=gS(t,e),Re("caret",t),t=pS(t,e),Re("tildes",t),t=vS(t,e),Re("xrange",t),t=_S(t,e),Re("stars",t),t),tt=t=>!t||t.toLowerCase()==="x"||t==="*",pS=(t,e)=>t.trim().split(/\s+/).map(r=>mS(r,e)).join(" "),mS=(t,e)=>{let r=e.loose?et[Ve.TILDELOOSE]:et[Ve.TILDE];return t.replace(r,(s,i,n,a,o)=>{Re("tilde",t,s,i,n,a,o);let c;return tt(i)?c="":tt(n)?c=`>=${i}.0.0 <${+i+1}.0.0-0`:tt(a)?c=`>=${i}.${n}.0 <${i}.${+n+1}.0-0`:o?(Re("replaceTilde pr",o),c=`>=${i}.${n}.${a}-${o} <${i}.${+n+1}.0-0`):c=`>=${i}.${n}.${a} <${i}.${+n+1}.0-0`,Re("tilde return",c),c})},gS=(t,e)=>t.trim().split(/\s+/).map(r=>yS(r,e)).join(" "),yS=(t,e)=>{Re("caret",t,e);let r=e.loose?et[Ve.CARETLOOSE]:et[Ve.CARET],s=e.includePrerelease?"-0":"";return t.replace(r,(i,n,a,o,c)=>{Re("caret",t,i,n,a,o,c);let l;return tt(n)?l="":tt(a)?l=`>=${n}.0.0${s} <${+n+1}.0.0-0`:tt(o)?n==="0"?l=`>=${n}.${a}.0${s} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.0${s} <${+n+1}.0.0-0`:c?(Re("replaceCaret pr",c),n==="0"?a==="0"?l=`>=${n}.${a}.${o}-${c} <${n}.${a}.${+o+1}-0`:l=`>=${n}.${a}.${o}-${c} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.${o}-${c} <${+n+1}.0.0-0`):(Re("no pr"),n==="0"?a==="0"?l=`>=${n}.${a}.${o}${s} <${n}.${a}.${+o+1}-0`:l=`>=${n}.${a}.${o}${s} <${n}.${+a+1}.0-0`:l=`>=${n}.${a}.${o} <${+n+1}.0.0-0`),Re("caret return",l),l})},vS=(t,e)=>(Re("replaceXRanges",t,e),t.split(/\s+/).map(r=>bS(r,e)).join(" ")),bS=(t,e)=>{t=t.trim();let r=e.loose?et[Ve.XRANGELOOSE]:et[Ve.XRANGE];return t.replace(r,(s,i,n,a,o,c)=>{Re("xRange",t,s,i,n,a,o,c);let l=tt(n),u=l||tt(a),p=u||tt(o),g=p;return i==="="&&g&&(i=""),c=e.includePrerelease?"-0":"",l?i===">"||i==="<"?s="<0.0.0-0":s="*":i&&g?(u&&(a=0),o=0,i===">"?(i=">=",u?(n=+n+1,a=0,o=0):(a=+a+1,o=0)):i==="<="&&(i="<",u?n=+n+1:a=+a+1),i==="<"&&(c="-0"),s=`${i+n}.${a}.${o}${c}`):u?s=`>=${n}.0.0${c} <${+n+1}.0.0-0`:p&&(s=`>=${n}.${a}.0${c} <${n}.${+a+1}.0-0`),Re("xRange return",s),s})},_S=(t,e)=>(Re("replaceStars",t,e),t.trim().replace(et[Ve.STAR],"")),wS=(t,e)=>(Re("replaceGTE0",t,e),t.trim().replace(et[e.includePrerelease?Ve.GTE0PRE:Ve.GTE0],"")),xS=t=>(e,r,s,i,n,a,o,c,l,u,p,g)=>(tt(s)?r="":tt(i)?r=`>=${s}.0.0${t?"-0":""}`:tt(n)?r=`>=${s}.${i}.0${t?"-0":""}`:a?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,tt(l)?c="":tt(u)?c=`<${+l+1}.0.0-0`:tt(p)?c=`<${l}.${+u+1}.0-0`:g?c=`<=${l}.${u}.${p}-${g}`:t?c=`<${l}.${u}.${+p+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),ES=(t,e,r)=>{for(let s=0;s<t.length;s++)if(!t[s].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let s=0;s<t.length;s++)if(Re(t[s].semver),t[s].semver!==pl.ANY&&t[s].semver.prerelease.length>0){let i=t[s].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var Ji=B((rN,Ap)=>{"use strict";var Xi=Symbol("SemVer ANY"),yl=class t{static get ANY(){return Xi}constructor(e,r){if(r=wp(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),gl("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Xi?this.value="":this.value=this.operator+this.semver.version,gl("comp",this)}parse(e){let r=this.options.loose?xp[Ep.COMPARATORLOOSE]:xp[Ep.COMPARATOR],s=e.match(r);if(!s)throw new TypeError(`Invalid comparator: ${e}`);this.operator=s[1]!==void 0?s[1]:"",this.operator==="="&&(this.operator=""),s[2]?this.semver=new Sp(s[2],this.options.loose):this.semver=Xi}toString(){return this.value}test(e){if(gl("Comparator.test",e,this.options.loose),this.semver===Xi||e===Xi)return!0;if(typeof e=="string")try{e=new Sp(e,this.options)}catch{return!1}return ml(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Rp(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Rp(this.value,r).test(e.semver):(r=wp(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.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("=")||ml(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||ml(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Ap.exports=yl;var wp=fo(),{safeRe:xp,t:Ep}=Vs(),ml=fl(),gl=Ki(),Sp=We(),Rp=gt()});var Qi=B((sN,Cp)=>{"use strict";var SS=gt(),RS=(t,e,r)=>{try{e=new SS(e,r)}catch{return!1}return e.test(t)};Cp.exports=RS});var Tp=B((iN,Op)=>{"use strict";var AS=gt(),CS=(t,e)=>new AS(t,e).set.map(r=>r.map(s=>s.value).join(" ").trim().split(" "));Op.exports=CS});var $p=B((nN,Lp)=>{"use strict";var OS=We(),TS=gt(),LS=(t,e,r)=>{let s=null,i=null,n=null;try{n=new TS(e,r)}catch{return null}return t.forEach(a=>{n.test(a)&&(!s||i.compare(a)===-1)&&(s=a,i=new OS(s,r))}),s};Lp.exports=LS});var Ip=B((oN,Pp)=>{"use strict";var $S=We(),PS=gt(),IS=(t,e,r)=>{let s=null,i=null,n=null;try{n=new PS(e,r)}catch{return null}return t.forEach(a=>{n.test(a)&&(!s||i.compare(a)===1)&&(s=a,i=new $S(s,r))}),s};Pp.exports=IS});var Dp=B((aN,Np)=>{"use strict";var vl=We(),kS=gt(),kp=Yi(),NS=(t,e)=>{t=new kS(t,e);let r=new vl("0.0.0");if(t.test(r)||(r=new vl("0.0.0-0"),t.test(r)))return r;r=null;for(let s=0;s<t.set.length;++s){let i=t.set[s],n=null;i.forEach(a=>{let o=new vl(a.semver.version);switch(a.operator){case">":o.prerelease.length===0?o.patch++:o.prerelease.push(0),o.raw=o.format();case"":case">=":(!n||kp(o,n))&&(n=o);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),n&&(!r||kp(r,n))&&(r=n)}return r&&t.test(r)?r:null};Np.exports=NS});var Mp=B((cN,Fp)=>{"use strict";var DS=gt(),FS=(t,e)=>{try{return new DS(t,e).range||"*"}catch{return null}};Fp.exports=FS});var Eo=B((lN,Gp)=>{"use strict";var MS=We(),Up=Ji(),{ANY:jS}=Up,BS=gt(),US=Qi(),jp=Yi(),Bp=vo(),GS=_o(),zS=bo(),qS=(t,e,r,s)=>{t=new MS(t,s),e=new BS(e,s);let i,n,a,o,c;switch(r){case">":i=jp,n=GS,a=Bp,o=">",c=">=";break;case"<":i=Bp,n=zS,a=jp,o="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(US(t,e,s))return!1;for(let l=0;l<e.set.length;++l){let u=e.set[l],p=null,g=null;if(u.forEach(f=>{f.semver===jS&&(f=new Up(">=0.0.0")),p=p||f,g=g||f,i(f.semver,p.semver,s)?p=f:a(f.semver,g.semver,s)&&(g=f)}),p.operator===o||p.operator===c||(!g.operator||g.operator===o)&&n(t,g.semver))return!1;if(g.operator===c&&a(t,g.semver))return!1}return!0};Gp.exports=qS});var qp=B((uN,zp)=>{"use strict";var WS=Eo(),VS=(t,e,r)=>WS(t,e,">",r);zp.exports=VS});var Vp=B((fN,Wp)=>{"use strict";var ZS=Eo(),HS=(t,e,r)=>ZS(t,e,"<",r);Wp.exports=HS});var Kp=B((hN,Hp)=>{"use strict";var Zp=gt(),KS=(t,e,r)=>(t=new Zp(t,r),e=new Zp(e,r),t.intersects(e,r));Hp.exports=KS});var Jp=B((dN,Yp)=>{"use strict";var YS=Qi(),JS=mt();Yp.exports=(t,e,r)=>{let s=[],i=null,n=null,a=t.sort((u,p)=>JS(u,p,r));for(let u of a)YS(u,e,r)?(n=u,i||(i=u)):(n&&s.push([i,n]),n=null,i=null);i&&s.push([i,null]);let o=[];for(let[u,p]of s)u===p?o.push(u):!p&&u===a[0]?o.push("*"):p?u===a[0]?o.push(`<=${p}`):o.push(`${u} - ${p}`):o.push(`>=${u}`);let c=o.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e}});var sm=B((pN,rm)=>{"use strict";var Xp=gt(),_l=Ji(),{ANY:bl}=_l,en=Qi(),wl=mt(),XS=(t,e,r={})=>{if(t===e)return!0;t=new Xp(t,r),e=new Xp(e,r);let s=!1;e:for(let i of t.set){for(let n of e.set){let a=eR(i,n,r);if(s=s||a!==null,a)continue e}if(s)return!1}return!0},QS=[new _l(">=0.0.0-0")],Qp=[new _l(">=0.0.0")],eR=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===bl){if(e.length===1&&e[0].semver===bl)return!0;r.includePrerelease?t=QS:t=Qp}if(e.length===1&&e[0].semver===bl){if(r.includePrerelease)return!0;e=Qp}let s=new Set,i,n;for(let f of t)f.operator===">"||f.operator===">="?i=em(i,f,r):f.operator==="<"||f.operator==="<="?n=tm(n,f,r):s.add(f.semver);if(s.size>1)return null;let a;if(i&&n){if(a=wl(i.semver,n.semver,r),a>0)return null;if(a===0&&(i.operator!==">="||n.operator!=="<="))return null}for(let f of s){if(i&&!en(f,String(i),r)||n&&!en(f,String(n),r))return null;for(let d of e)if(!en(f,String(d),r))return!1;return!0}let o,c,l,u,p=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1,g=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;p&&p.prerelease.length===1&&n.operator==="<"&&p.prerelease[0]===0&&(p=!1);for(let f of e){if(u=u||f.operator===">"||f.operator===">=",l=l||f.operator==="<"||f.operator==="<=",i){if(g&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===g.major&&f.semver.minor===g.minor&&f.semver.patch===g.patch&&(g=!1),f.operator===">"||f.operator===">="){if(o=em(i,f,r),o===f&&o!==i)return!1}else if(i.operator===">="&&!en(i.semver,String(f),r))return!1}if(n){if(p&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===p.major&&f.semver.minor===p.minor&&f.semver.patch===p.patch&&(p=!1),f.operator==="<"||f.operator==="<="){if(c=tm(n,f,r),c===f&&c!==n)return!1}else if(n.operator==="<="&&!en(n.semver,String(f),r))return!1}if(!f.operator&&(n||i)&&a!==0)return!1}return!(i&&l&&!n&&a!==0||n&&u&&!i&&a!==0||g||p)},em=(t,e,r)=>{if(!t)return e;let s=wl(t.semver,e.semver,r);return s>0?t:s<0||e.operator===">"&&t.operator===">="?e:t},tm=(t,e,r)=>{if(!t)return e;let s=wl(t.semver,e.semver,r);return s<0?t:s>0||e.operator==="<"&&t.operator==="<="?e:t};rm.exports=XS});var El=B((mN,om)=>{"use strict";var xl=Vs(),im=Hi(),tR=We(),nm=ol(),rR=jr(),sR=$d(),iR=Id(),nR=Dd(),oR=jd(),aR=Ud(),cR=zd(),lR=Wd(),uR=Zd(),fR=mt(),hR=Jd(),dR=Qd(),pR=yo(),mR=sp(),gR=np(),yR=Yi(),vR=vo(),bR=ll(),_R=ul(),wR=bo(),xR=_o(),ER=fl(),SR=pp(),RR=Ji(),AR=gt(),CR=Qi(),OR=Tp(),TR=$p(),LR=Ip(),$R=Dp(),PR=Mp(),IR=Eo(),kR=qp(),NR=Vp(),DR=Kp(),FR=Jp(),MR=sm();om.exports={parse:rR,valid:sR,clean:iR,inc:nR,diff:oR,major:aR,minor:cR,patch:lR,prerelease:uR,compare:fR,rcompare:hR,compareLoose:dR,compareBuild:pR,sort:mR,rsort:gR,gt:yR,lt:vR,eq:bR,neq:_R,gte:wR,lte:xR,cmp:ER,coerce:SR,Comparator:RR,Range:AR,satisfies:CR,toComparators:OR,maxSatisfying:TR,minSatisfying:LR,minVersion:$R,validRange:PR,outside:IR,gtr:kR,ltr:NR,intersects:DR,simplifyRange:FR,subset:MR,SemVer:tR,re:xl.re,src:xl.src,tokens:xl.t,SEMVER_SPEC_VERSION:im.SEMVER_SPEC_VERSION,RELEASE_TYPES:im.RELEASE_TYPES,compareIdentifiers:nm.compareIdentifiers,rcompareIdentifiers:nm.rcompareIdentifiers}});var cm=B((gN,am)=>{function yt(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}am.exports=yt;yt.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};yt.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};yt.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);else return!1;var s=this;return this._timer=setTimeout(function(){s._attempts++,s._operationTimeoutCb&&(s._timeout=setTimeout(function(){s._operationTimeoutCb(s._attempts)},s._operationTimeout),s._options.unref&&s._timeout.unref()),s._fn(s._attempts)},r),this._options.unref&&this._timer.unref(),!0};yt.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};yt.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};yt.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};yt.prototype.start=yt.prototype.try;yt.prototype.errors=function(){return this._errors};yt.prototype.attempts=function(){return this._attempts};yt.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,s=0;s<this._errors.length;s++){var i=this._errors[s],n=i.message,a=(t[n]||0)+1;t[n]=a,a>=r&&(e=i,r=a)}return e}});var lm=B(Br=>{var jR=cm();Br.operation=function(t){var e=Br.timeouts(t);return new jR(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};Br.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],i=0;i<e.retries;i++)s.push(this.createTimeout(i,e));return t&&t.forever&&!s.length&&s.push(this.createTimeout(i,e)),s.sort(function(n,a){return n-a}),s};Br.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,s=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return s=Math.min(s,e.maxTimeout),s};Br.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var s in t)typeof t[s]=="function"&&r.push(s)}for(var i=0;i<r.length;i++){var n=r[i],a=t[n];t[n]=function(c){var l=Br.operation(e),u=Array.prototype.slice.call(arguments,1),p=u.pop();u.push(function(g){l.retry(g)||(g&&(arguments[0]=l.mainError()),p.apply(this,arguments))}),l.attempt(function(){c.apply(t,u)})}.bind(t,a),t[n].options=e}}});var fm=B((vN,um)=>{um.exports=lm()});var Ml=B(ss=>{ss.parse=ss.decode=dC;ss.stringify=ss.encode=jm;ss.safe=si;ss.unsafe=ko;var Fl=typeof process<"u"&&process.platform==="win32"?`\r
|
|
6
6
|
`:`
|
|
7
|
-
`;function
|
|
8
|
-
`}):c&&typeof c=="object"?r.push(n):
|
|
9
|
-
`){l++,n=!1,o+=c(t,a,l),a=l;continue}else if(n===
|
|
10
|
-
`)n=!1,o+=c(t,a,l),a=l;else if(!n&&r+i==="/*"){o+=t.slice(a,l),a=l,n=yd,l++;continue}else if(n===yd&&r+i==="*/"){l++,n=!1,o+=c(t,a,l+1),a=l+1;continue}}}return o+(n?c(t.substr(a)):t.substr(a))}});var xd=j(ci=>{"use strict";var wd=D("fs"),zS=xc(),ns=D("path"),qS=vd(),WS=ci.parse=function(t){return/^\s*{/.test(t)?JSON.parse(qS(t)):zS.parse(t)},VS=ci.file=function(){var t=[].slice.call(arguments).filter(function(s){return s!=null});for(var e in t)if(typeof t[e]!="string")return;var r=ns.join.apply(null,t),i;try{return wd.readFileSync(r,"utf-8")}catch{return}},MI=ci.json=function(){var t=VS.apply(null,arguments);return t?WS(t):null},kI=ci.env=function(t,e){e=e||process.env;var r={},i=t.length;for(var s in e)if(s.toLowerCase().indexOf(t.toLowerCase())===0){for(var n=s.substring(i).split("__"),a;(a=n.indexOf(""))>-1;)n.splice(a,1);var o=r;n.forEach(function(l,u){!l||typeof o!="object"||(u===n.length-1&&(o[l]=e[s]),o[l]===void 0&&(o[l]={}),o=o[l])})}return r},jI=ci.find=function(){var t=ns.join.apply(null,[].slice.call(arguments));function e(r,i){var s=ns.join(r,i);try{return wd.statSync(s),s}catch{if(ns.dirname(r)!==r)return e(ns.dirname(r),i)}}return e(process.cwd(),t)}});var Ad=j((UI,Cd)=>{"use strict";function _d(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function Sd(t){if(t instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function Rd(t){var e=[];return t.forEach(function(r,i){typeof r=="object"&&r!==null?Array.isArray(r)?e[i]=Rd(r):_d(r)?e[i]=Sd(r):e[i]=_c({},r):e[i]=r}),e}function Ed(t,e){return e==="__proto__"?void 0:t[e]}var _c=Cd.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var t=arguments[0],e=Array.prototype.slice.call(arguments,1),r,i,s;return e.forEach(function(n){typeof n!="object"||n===null||Array.isArray(n)||Object.keys(n).forEach(function(a){if(i=Ed(t,a),r=Ed(n,a),r!==t)if(typeof r!="object"||r===null){t[a]=r;return}else if(Array.isArray(r)){t[a]=Rd(r);return}else if(_d(r)){t[a]=Sd(r);return}else if(typeof i!="object"||i===null||Array.isArray(i)){t[a]=_c({},r);return}else{t[a]=_c(i,r);return}})}),t}});var Td=j((GI,$d)=>{"use strict";function HS(t,e){var r=t;e.slice(0,-1).forEach(function(s){r=r[s]||{}});var i=e[e.length-1];return i in r}function Ld(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Od(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}$d.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(f){r.bools[f]=!0});var i={};function s(f){return i[f].some(function(v){return r.bools[v]})}Object.keys(e.alias||{}).forEach(function(f){i[f]=[].concat(e.alias[f]),i[f].forEach(function(v){i[v]=[f].concat(i[f].filter(function(E){return v!==E}))})}),[].concat(e.string).filter(Boolean).forEach(function(f){r.strings[f]=!0,i[f]&&[].concat(i[f]).forEach(function(v){r.strings[v]=!0})});var n=e.default||{},a={_:[]};function o(f,v){return r.allBools&&/^--[^=]+$/.test(v)||r.strings[f]||r.bools[f]||i[f]}function c(f,v,E){for(var _=f,O=0;O<v.length-1;O++){var C=v[O];if(Od(_,C))return;_[C]===void 0&&(_[C]={}),(_[C]===Object.prototype||_[C]===Number.prototype||_[C]===String.prototype)&&(_[C]={}),_[C]===Array.prototype&&(_[C]=[]),_=_[C]}var $=v[v.length-1];Od(_,$)||((_===Object.prototype||_===Number.prototype||_===String.prototype)&&(_={}),_===Array.prototype&&(_=[]),_[$]===void 0||r.bools[$]||typeof _[$]=="boolean"?_[$]=E:Array.isArray(_[$])?_[$].push(E):_[$]=[_[$],E])}function l(f,v,E){if(!(E&&r.unknownFn&&!o(f,E)&&r.unknownFn(E)===!1)){var _=!r.strings[f]&&Ld(v)?Number(v):v;c(a,f.split("."),_),(i[f]||[]).forEach(function(O){c(a,O.split("."),_)})}}Object.keys(r.bools).forEach(function(f){l(f,n[f]===void 0?!1:n[f])});var u=[];t.indexOf("--")!==-1&&(u=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var d=0;d<t.length;d++){var g=t[d],h,p;if(/^--.+=/.test(g)){var m=g.match(/^--([^=]+)=([\s\S]*)$/);h=m[1];var y=m[2];r.bools[h]&&(y=y!=="false"),l(h,y,g)}else if(/^--no-.+/.test(g))h=g.match(/^--no-(.+)/)[1],l(h,!1,g);else if(/^--.+/.test(g))h=g.match(/^--(.+)/)[1],p=t[d+1],p!==void 0&&!/^(-|--)[^-]/.test(p)&&!r.bools[h]&&!r.allBools&&(!i[h]||!s(h))?(l(h,p,g),d+=1):/^(true|false)$/.test(p)?(l(h,p==="true",g),d+=1):l(h,r.strings[h]?"":!0,g);else if(/^-[^-]+/.test(g)){for(var b=g.slice(1,-1).split(""),w=!1,x=0;x<b.length;x++){if(p=g.slice(x+2),p==="-"){l(b[x],p,g);continue}if(/[A-Za-z]/.test(b[x])&&p[0]==="="){l(b[x],p.slice(1),g),w=!0;break}if(/[A-Za-z]/.test(b[x])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(p)){l(b[x],p,g),w=!0;break}if(b[x+1]&&b[x+1].match(/\W/)){l(b[x],g.slice(x+2),g),w=!0;break}else l(b[x],r.strings[b[x]]?"":!0,g)}h=g.slice(-1)[0],!w&&h!=="-"&&(t[d+1]&&!/^(-|--)[^-]/.test(t[d+1])&&!r.bools[h]&&(!i[h]||!s(h))?(l(h,t[d+1],g),d+=1):t[d+1]&&/^(true|false)$/.test(t[d+1])?(l(h,t[d+1]==="true",g),d+=1):l(h,r.strings[h]?"":!0,g))}else if((!r.unknownFn||r.unknownFn(g)!==!1)&&a._.push(r.strings._||!Ld(g)?g:Number(g)),e.stopEarly){a._.push.apply(a._,t.slice(d+1));break}}return Object.keys(n).forEach(function(f){HS(a,f.split("."))||(c(a,f.split("."),n[f]),(i[f]||[]).forEach(function(v){c(a,v.split("."),n[f])}))}),e["--"]?a["--"]=u.slice():u.forEach(function(f){a._.push(f)}),a}});var Nd=j((zI,Fd)=>{var os=xd(),li=D("path").join,KS=Ad(),Pd="/etc",Id=process.platform==="win32",as=Id?process.env.USERPROFILE:process.env.HOME;Fd.exports=function(t,e,r,i){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=Td()(process.argv.slice(2))),e=(typeof e=="string"?os.json(e):e)||{},i=i||os.parse;var s=os.env(t+"_"),n=[e],a=[];function o(c){if(!(a.indexOf(c)>=0)){var l=os.file(c);l&&(n.push(i(l)),a.push(c))}}return Id||[li(Pd,t,"config"),li(Pd,t+"rc")].forEach(o),as&&[li(as,".config",t,"config"),li(as,".config",t),li(as,"."+t,"config"),li(as,"."+t+"rc")].forEach(o),o(os.find("."+t+"rc")),s.config&&o(s.config),r.config&&o(r.config),KS.apply(null,n.concat([s,r,a.length?{configs:a,config:a[a.length-1]}:void 0]))}});var kd=j((WI,Md)=>{var Ht=D("constants"),YS=process.cwd,Sn=null,XS=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Sn||(Sn=YS.call(process)),Sn};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Rc=process.chdir,process.chdir=function(t){Sn=null,Rc.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rc));var Rc;Md.exports=JS;function JS(t){Ht.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=n(t.chown),t.fchown=n(t.fchown),t.lchown=n(t.lchown),t.chmod=i(t.chmod),t.fchmod=i(t.fchmod),t.lchmod=i(t.lchmod),t.chownSync=a(t.chownSync),t.fchownSync=a(t.fchownSync),t.lchownSync=a(t.lchownSync),t.chmodSync=s(t.chmodSync),t.fchmodSync=s(t.fchmodSync),t.lchmodSync=s(t.lchmodSync),t.stat=o(t.stat),t.fstat=o(t.fstat),t.lstat=o(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(u,d,g){g&&process.nextTick(g)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,d,g,h){h&&process.nextTick(h)},t.lchownSync=function(){}),XS==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(u){function d(g,h,p){var m=Date.now(),y=0;u(g,h,function b(w){if(w&&(w.code==="EACCES"||w.code==="EPERM")&&Date.now()-m<6e4){setTimeout(function(){t.stat(h,function(x,f){x&&x.code==="ENOENT"?u(g,h,b):p(w)})},y),y<100&&(y+=10);return}p&&p(w)})}return Object.setPrototypeOf&&Object.setPrototypeOf(d,u),d})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(u){function d(g,h,p,m,y,b){var w;if(b&&typeof b=="function"){var x=0;w=function(f,v,E){if(f&&f.code==="EAGAIN"&&x<10)return x++,u.call(t,g,h,p,m,y,w);b.apply(this,arguments)}}return u.call(t,g,h,p,m,y,w)}return Object.setPrototypeOf&&Object.setPrototypeOf(d,u),d})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(u){return function(d,g,h,p,m){for(var y=0;;)try{return u.call(t,d,g,h,p,m)}catch(b){if(b.code==="EAGAIN"&&y<10){y++;continue}throw b}}})(t.readSync);function e(u){u.lchmod=function(d,g,h){u.open(d,Ht.O_WRONLY|Ht.O_SYMLINK,g,function(p,m){if(p){h&&h(p);return}u.fchmod(m,g,function(y){u.close(m,function(b){h&&h(y||b)})})})},u.lchmodSync=function(d,g){var h=u.openSync(d,Ht.O_WRONLY|Ht.O_SYMLINK,g),p=!0,m;try{m=u.fchmodSync(h,g),p=!1}finally{if(p)try{u.closeSync(h)}catch{}else u.closeSync(h)}return m}}function r(u){Ht.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(d,g,h,p){u.open(d,Ht.O_SYMLINK,function(m,y){if(m){p&&p(m);return}u.futimes(y,g,h,function(b){u.close(y,function(w){p&&p(b||w)})})})},u.lutimesSync=function(d,g,h){var p=u.openSync(d,Ht.O_SYMLINK),m,y=!0;try{m=u.futimesSync(p,g,h),y=!1}finally{if(y)try{u.closeSync(p)}catch{}else u.closeSync(p)}return m}):u.futimes&&(u.lutimes=function(d,g,h,p){p&&process.nextTick(p)},u.lutimesSync=function(){})}function i(u){return u&&function(d,g,h){return u.call(t,d,g,function(p){l(p)&&(p=null),h&&h.apply(this,arguments)})}}function s(u){return u&&function(d,g){try{return u.call(t,d,g)}catch(h){if(!l(h))throw h}}}function n(u){return u&&function(d,g,h,p){return u.call(t,d,g,h,function(m){l(m)&&(m=null),p&&p.apply(this,arguments)})}}function a(u){return u&&function(d,g,h){try{return u.call(t,d,g,h)}catch(p){if(!l(p))throw p}}}function o(u){return u&&function(d,g,h){typeof g=="function"&&(h=g,g=null);function p(m,y){y&&(y.uid<0&&(y.uid+=4294967296),y.gid<0&&(y.gid+=4294967296)),h&&h.apply(this,arguments)}return g?u.call(t,d,g,p):u.call(t,d,p)}}function c(u){return u&&function(d,g){var h=g?u.call(t,d,g):u.call(t,d);return h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),h}}function l(u){if(!u||u.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var Ud=j((VI,Bd)=>{var jd=D("stream").Stream;Bd.exports=ZS;function ZS(t){return{ReadStream:e,WriteStream:r};function e(i,s){if(!(this instanceof e))return new e(i,s);jd.call(this);var n=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,s=s||{};for(var a=Object.keys(s),o=0,c=a.length;o<c;o++){var l=a[o];this[l]=s[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){n._read()});return}t.open(this.path,this.flags,this.mode,function(u,d){if(u){n.emit("error",u),n.readable=!1;return}n.fd=d,n.emit("open",d),n._read()})}function r(i,s){if(!(this instanceof r))return new r(i,s);jd.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var n=Object.keys(s),a=0,o=n.length;a<o;a++){var c=n[a];this[c]=s[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var zd=j((HI,Gd)=>{"use strict";Gd.exports=eR;var QS=Object.getPrototypeOf||function(t){return t.__proto__};function eR(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:QS(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var Hd=j((KI,Lc)=>{var ve=D("fs"),tR=kd(),rR=Ud(),iR=zd(),Rn=D("util"),Te,An;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Te=Symbol.for("graceful-fs.queue"),An=Symbol.for("graceful-fs.previous")):(Te="___graceful-fs.queue",An="___graceful-fs.previous");function sR(){}function Vd(t,e){Object.defineProperty(t,Te,{get:function(){return e}})}var Cr=sR;Rn.debuglog?Cr=Rn.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Cr=function(){var t=Rn.format.apply(Rn,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
11
|
-
GFS4: `),console.error(t)});ve[Te]||(qd=global[Te]||[],Vd(ve,qd),ve.close=(function(t){function e(r,i){return t.call(ve,r,function(s){s||Wd(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(e,An,{value:t}),e})(ve.close),ve.closeSync=(function(t){function e(r){t.apply(ve,arguments),Wd()}return Object.defineProperty(e,An,{value:t}),e})(ve.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Cr(ve[Te]),D("assert").equal(ve[Te].length,0)}));var qd;global[Te]||Vd(global,ve[Te]);Lc.exports=Cc(iR(ve));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ve.__patched&&(Lc.exports=Cc(ve),ve.__patched=!0);function Cc(t){tR(t),t.gracefulify=Cc,t.createReadStream=v,t.createWriteStream=E;var e=t.readFile;t.readFile=r;function r(C,$,F){return typeof $=="function"&&(F=$,$=null),M(C,$,F);function M(I,Y,Z,G){return e(I,Y,function(V){V&&(V.code==="EMFILE"||V.code==="ENFILE")?ui([M,[I,Y,Z],V,G||Date.now(),Date.now()]):typeof Z=="function"&&Z.apply(this,arguments)})}}var i=t.writeFile;t.writeFile=s;function s(C,$,F,M){return typeof F=="function"&&(M=F,F=null),I(C,$,F,M);function I(Y,Z,G,V,se){return i(Y,Z,G,function(ee){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?ui([I,[Y,Z,G,V],ee,se||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var n=t.appendFile;n&&(t.appendFile=a);function a(C,$,F,M){return typeof F=="function"&&(M=F,F=null),I(C,$,F,M);function I(Y,Z,G,V,se){return n(Y,Z,G,function(ee){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?ui([I,[Y,Z,G,V],ee,se||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var o=t.copyFile;o&&(t.copyFile=c);function c(C,$,F,M){return typeof F=="function"&&(M=F,F=0),I(C,$,F,M);function I(Y,Z,G,V,se){return o(Y,Z,G,function(ee){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?ui([I,[Y,Z,G,V],ee,se||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}var l=t.readdir;t.readdir=d;var u=/^v[0-5]\./;function d(C,$,F){typeof $=="function"&&(F=$,$=null);var M=u.test(process.version)?function(Z,G,V,se){return l(Z,I(Z,G,V,se))}:function(Z,G,V,se){return l(Z,G,I(Z,G,V,se))};return M(C,$,F);function I(Y,Z,G,V){return function(se,ee){se&&(se.code==="EMFILE"||se.code==="ENFILE")?ui([M,[Y,Z,G],se,V||Date.now(),Date.now()]):(ee&&ee.sort&&ee.sort(),typeof G=="function"&&G.call(this,se,ee))}}}if(process.version.substr(0,4)==="v0.8"){var g=rR(t);b=g.ReadStream,x=g.WriteStream}var h=t.ReadStream;h&&(b.prototype=Object.create(h.prototype),b.prototype.open=w);var p=t.WriteStream;p&&(x.prototype=Object.create(p.prototype),x.prototype.open=f),Object.defineProperty(t,"ReadStream",{get:function(){return b},set:function(C){b=C},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return x},set:function(C){x=C},enumerable:!0,configurable:!0});var m=b;Object.defineProperty(t,"FileReadStream",{get:function(){return m},set:function(C){m=C},enumerable:!0,configurable:!0});var y=x;Object.defineProperty(t,"FileWriteStream",{get:function(){return y},set:function(C){y=C},enumerable:!0,configurable:!0});function b(C,$){return this instanceof b?(h.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}function w(){var C=this;O(C.path,C.flags,C.mode,function($,F){$?(C.autoClose&&C.destroy(),C.emit("error",$)):(C.fd=F,C.emit("open",F),C.read())})}function x(C,$){return this instanceof x?(p.apply(this,arguments),this):x.apply(Object.create(x.prototype),arguments)}function f(){var C=this;O(C.path,C.flags,C.mode,function($,F){$?(C.destroy(),C.emit("error",$)):(C.fd=F,C.emit("open",F))})}function v(C,$){return new t.ReadStream(C,$)}function E(C,$){return new t.WriteStream(C,$)}var _=t.open;t.open=O;function O(C,$,F,M){return typeof F=="function"&&(M=F,F=null),I(C,$,F,M);function I(Y,Z,G,V,se){return _(Y,Z,G,function(ee,we){ee&&(ee.code==="EMFILE"||ee.code==="ENFILE")?ui([I,[Y,Z,G,V],ee,se||Date.now(),Date.now()]):typeof V=="function"&&V.apply(this,arguments)})}}return t}function ui(t){Cr("ENQUEUE",t[0].name,t[1]),ve[Te].push(t),Ac()}var Cn;function Wd(){for(var t=Date.now(),e=0;e<ve[Te].length;++e)ve[Te][e].length>2&&(ve[Te][e][3]=t,ve[Te][e][4]=t);Ac()}function Ac(){if(clearTimeout(Cn),Cn=void 0,ve[Te].length!==0){var t=ve[Te].shift(),e=t[0],r=t[1],i=t[2],s=t[3],n=t[4];if(s===void 0)Cr("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-s>=6e4){Cr("TIMEOUT",e.name,r);var a=r.pop();typeof a=="function"&&a.call(null,i)}else{var o=Date.now()-n,c=Math.max(n-s,1),l=Math.min(c*1.2,100);o>=l?(Cr("RETRY",e.name,r),e.apply(null,r.concat([s]))):ve[Te].push(t)}Cn===void 0&&(Cn=setTimeout(Ac,0))}}});var Kd=j(hi=>{"use strict";var nR=hi&&hi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hi,"__esModule",{value:!0});hi.readCAFileSync=void 0;var oR=nR(Hd());function aR(t){try{let e=oR.default.readFileSync(t,"utf8"),r="-----END CERTIFICATE-----";return e.split(r).filter(s=>!!s.trim()).map(s=>`${s.trimLeft()}${r}`)}catch(e){if(e.code==="ENOENT")return;throw e}}hi.readCAFileSync=aR});var Yd=j(Ar=>{"use strict";var cR=Ar&&Ar.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,i,s)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),lR=Ar&&Ar.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cR(e,t,r)};Object.defineProperty(Ar,"__esModule",{value:!0});lR(Kd(),Ar)});var Zd=j((JI,Jd)=>{Jd.exports=Xd;function Lr(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function Xd(){this.list=[];var t=null;Object.defineProperty(this,"root",{get:function(){return t},set:function(e){t=e,this.list.length&&Lr(this.list[this.list.length-1],e)},enumerable:!0,configurable:!0})}Xd.prototype={get length(){return this.list.length},get keys(){var t=[];for(var e in this.list[0])t.push(e);return t},get snapshot(){var t={};return this.keys.forEach(function(e){t[e]=this.get(e)},this),t},get store(){return this.list[0]},push:function(t){return typeof t!="object"&&(t={valueOf:t}),this.list.length>=1&&Lr(this.list[this.list.length-1],t),Lr(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&Lr(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return Lr(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&Lr(this.list[0],this.root),this.list.shift()},get:function(t){return this.list[0][t]},set:function(t,e,r){return this.length||this.push({}),r&&this.list[0].hasOwnProperty(t)&&this.push({}),this.list[0][t]=e},forEach:function(t,e){for(var r in this.list[0])t.call(e,r,this.list[0][r])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){for(var t=this.list.splice.apply(this.list,arguments),e=0,r=this.list.length;e<r;e++)Lr(this.list[e],this.list[e+1]||this.root);return t}}});var rm=j((It,tm)=>{var Qd=Zd(),cs=D("path"),Ln=D("fs"),Oc=xc(),$c=D("events").EventEmitter,uR=D("url"),hR=D("http"),It=tm.exports=function(){for(var t=[].slice.call(arguments),e=new De;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?pR(r):r)}return e},ZI=It.find=function(){var t=cs.join.apply(null,[].slice.call(arguments));function e(r,i){var s=cs.join(r,i);try{return Ln.statSync(s),s}catch{if(cs.dirname(r)!==r)return e(cs.dirname(r),i)}}return e(__dirname,t)},fR=It.parse=function(t,e,r){if(t=""+t,r)if(r==="json")if(this.emit)try{return JSON.parse(t)}catch(i){this.emit("error",i)}else return JSON.parse(t);else return Oc.parse(t);else try{return JSON.parse(t)}catch{return Oc.parse(t)}},pR=It.json=function(){var t=[].slice.call(arguments).filter(function(i){return i!=null}),e=cs.join.apply(null,t),r;try{r=Ln.readFileSync(e,"utf-8")}catch{return}return fR(r,e,"json")},QI=It.env=function(t,e){e=e||process.env;var r={},i=t.length;for(var s in e)s.indexOf(t)===0&&(r[s.substring(i)]=e[s]);return r};It.ConfigChain=De;function De(){$c.apply(this),Qd.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var em={constructor:{value:De}};Object.keys($c.prototype).forEach(function(t){em[t]=Object.getOwnPropertyDescriptor($c.prototype,t)});De.prototype=Object.create(Qd.prototype,em);De.prototype.del=function(t,e){if(e){var r=this.sources[e];if(r=r&&r.data,!r)return this.emit("error",new Error("not found "+e));delete r[t]}else for(var i=0,s=this.list.length;i<s;i++)delete this.list[i][t];return this};De.prototype.set=function(t,e,r){var i;if(r){if(i=this.sources[r],i=i&&i.data,!i)return this.emit("error",new Error("not found "+r))}else if(i=this.list[0],!i)return this.emit("error",new Error("cannot set, no confs!"));return i[t]=e,this};De.prototype.get=function(t,e){return e?(e=this.sources[e],e&&(e=e.data),e&&Object.hasOwnProperty.call(e,t)?e[t]:void 0):this.list[0][t]};De.prototype.save=function(t,n,r){typeof n=="function"&&(r=n,n=null);var i=this.sources[t];if(!i||!(i.path||i.source)||!i.data)return this.emit("error",new Error("bad save target: "+t));if(i.source){var s=i.prefix||"";return Object.keys(i.data).forEach(function(o){i.source[s+o]=i.data[o]}),this}var n=n||i.type,a=i.data;return i.type==="json"?a=JSON.stringify(a):a=Oc.stringify(a),this._saving++,Ln.writeFile(i.path,a,"utf8",function(o){if(this._saving--,o)return r?r(o):this.emit("error",o);this._saving===0&&(r&&r(),this.emit("save"))}.bind(this)),this};De.prototype.addFile=function(t,e,r){r=r||t;var i={__source__:r};return this.sources[r]={path:t,type:e},this.push(i),this._await(),Ln.readFile(t,"utf8",function(s,n){s&&this.emit("error",s),this.addString(n,t,e,i)}.bind(this)),this};De.prototype.addEnv=function(t,e,r){r=r||"env";var i=It.env(t,e);return this.sources[r]={data:i,source:e,prefix:t},this.add(i,r)};De.prototype.addUrl=function(t,e,r){this._await();var i=uR.format(t);r=r||i;var s={__source__:r};return this.sources[r]={href:i,type:e},this.push(s),hR.request(t,function(n){var a=[],o=n.headers["content-type"];e||(e=o.indexOf("json")!==-1?"json":o.indexOf("ini")!==-1?"ini":i.match(/\.json$/)?"json":i.match(/\.ini$/)?"ini":null,s.type=e),n.on("data",a.push.bind(a)).on("end",function(){this.addString(Buffer.concat(a),i,e,s)}.bind(this)).on("error",this.emit.bind(this,"error"))}.bind(this)).on("error",this.emit.bind(this,"error")).end(),this};De.prototype.addString=function(t,e,r,i){return t=this.parse(t,e,r),this.add(t,i),this};De.prototype.add=function(t,e){if(e&&typeof e=="object"){var r=this.list.indexOf(e);if(r===-1)return this.emit("error",new Error("bad marker"));this.splice(r,1,t),e=e.__source__,this.sources[e]=this.sources[e]||{},this.sources[e].data=t,this._resolve()}else typeof e=="string"&&(this.sources[e]=this.sources[e]||{},this.sources[e].data=t),this._await(),this.push(t),process.nextTick(this._resolve.bind(this));return this};De.prototype.parse=It.parse;De.prototype._await=function(){this._awaiting++};De.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var sm=j((e2,im)=>{im.exports=function(t){let e=t.indexOf(":");if(e===-1)return Tc(t);let r=t.substr(0,e),i=t.substr(e+1);return`${Tc(r)}:${Tc(i)}`};function Tc(t){if(t=t.toLowerCase(),t==="_authtoken")return"_authToken";let e=t[0];for(let r=1;r<t.length;r++)e+=t[r]==="_"?"-":t[r];return e}});var nm=j(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.envReplace=void 0;var dR=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function mR(t,e){return t.replace(dR,gR.bind(null,e))}On.envReplace=mR;function gR(t,e,r,i){if(r.length%2)return e.slice((r.length+1)/2);let s=bR(t,i);if(s===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${s}`}var yR=/([^:-]+)(:?)-(.+)/;function bR(t,e){let r=e.match(yR);if(!r)return t[e];let[,i,s,n]=r;return Object.prototype.hasOwnProperty.call(t,i)?!t[i]&&s?n:t[i]:n}});var om=j($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.envReplace=void 0;var vR=nm();Object.defineProperty($n,"envReplace",{enumerable:!0,get:function(){return vR.envReplace}})});var am=j(ls=>{"use strict";var wR=D("fs"),Or=D("path"),{envReplace:Pc}=om(),xR=t=>typeof t!="string"?t:Pc(t,process.env),ER=(t,e,r)=>{if(typeof e!="string")return e;let i=[].concat(t[r]),s=i.indexOf(Or)!==-1,n=i.indexOf(Boolean)!==-1,a=i.indexOf(String)!==-1,o=i.indexOf(Number)!==-1;if(e=`${e}`.trim(),/^".*"$/.test(e))try{e=JSON.parse(e)}catch{throw new Error(`Failed parsing JSON config key ${r}: ${e}`)}if(n&&!a&&e==="")return!0;switch(e){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}return e=Pc(e,process.env),s&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=Or.resolve(process.env.HOME,e.substr(2))),e=Or.resolve(e)),o&&!isNaN(e)&&(e=Number(e)),e},_R=t=>{t=Or.resolve(t);let e=!1;for(;Or.basename(t)==="node_modules";)t=Or.dirname(t),e=!0;if(e)return t;let r=(i,s)=>{let n=/^[a-zA-Z]:(\\|\/)?$/;if(i==="/"||process.platform==="win32"&&n.test(i))return s;try{let a=wR.readdirSync(i);if(a.includes("node_modules")||a.includes("package.json")||a.includes("package.json5")||a.includes("package.yaml")||a.includes("pnpm-workspace.yaml"))return i;let o=Or.dirname(i);return o===i?s:r(o,s)}catch(a){if(i===s){if(a.code==="ENOENT")return s;throw a}return s}};return r(t,t)};ls.envReplace=Pc;ls.findPrefix=_R;ls.parseField=ER;ls.parseKey=xR});var um=j(lm=>{"use strict";var $r=D("path"),SR=D("stream").Stream,Tn=D("url"),RR=()=>{},CR=()=>[],cm=()=>{};lm.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:$r,cache:$r,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:$r,"global-style":Boolean,group:[Number,String],"https-proxy":[null,Tn],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":$r,"init-author-name":String,"init-author-email":String,"init-author-url":["",Tn],"init-license":String,"init-version":cm,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":CR(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:SR,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,cm],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:$r,production:Boolean,progress:Boolean,proxy:[null,!1,Tn],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,Tn],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:$r,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:$r,umask:RR,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var pm=j((n2,fm)=>{"use strict";var{readCAFileSync:AR}=Yd(),hm=D("fs"),Ic=D("path"),{ConfigChain:LR}=rm(),OR=sm(),Fc=am(),Nc=class extends LR{constructor(e,r){super(e),this.root=e,this._parseField=Fc.parseField.bind(null,r||um())}add(e,r){try{for(let[i,s]of Object.entries(e)){let n=Fc.parseKey(i);n!==i&&delete e[i],e[n]=this._parseField(s,n)}}catch(i){throw i}return super.add(e,r)}addFile(e,r){r=r||e;let i={__source__:r};this.sources[r]={path:e,type:"ini"},this.push(i),this._await();try{let s=hm.readFileSync(e,"utf8");this.addString(s,e,"ini",i)}catch(s){if(s.code==="ENOENT")this.add({},i);else if(s.code!=="EISDIR")return`Issue while reading "${e}". ${s.message}`}}addEnv(e){e=e||process.env;let r={};return Object.keys(e).filter(i=>/^npm_config_/i.test(i)).forEach(i=>{if(!e[i])return;let s=OR(i.substr(11)),n=e[i];r[s]=$R(s,n)}),super.addEnv("",r,"env")}loadPrefix(){let e=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:i=>{let s=this.get("global");this[s?"globalPrefix":"localPrefix"]=i},get:()=>this.get("global")?this.globalPrefix:this.localPrefix}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:i=>{this.set("prefix",i)},get:()=>Ic.resolve(this.get("prefix"))});let r;if(Object.defineProperty(this,"localPrefix",{enumerable:!0,set:i=>{r=i},get:()=>r}),Object.prototype.hasOwnProperty.call(e,"prefix"))r=Ic.resolve(e.prefix);else try{r=Fc.findPrefix(process.cwd())}catch(i){throw i}return r}loadCAFile(e){if(!e)return;let r=AR(e);r&&this.set("ca",r)}loadUser(){let e=this.root;if(this.get("global"))return;if(process.env.SUDO_UID){e.user=Number(process.env.SUDO_UID);return}let r=Ic.resolve(this.get("prefix"));try{let i=hm.statSync(r);e.user=i.uid}catch(i){if(i.code==="ENOENT")return;throw i}}};function $R(t,e){function r(i){return i.indexOf(`
|
|
7
|
+
`;function jm(t,e){var r=[],s="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var i=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(n,a,o){var c=t[n];c&&Array.isArray(c)?c.forEach(function(l){s+=si(n+"[]")+i+si(l)+`
|
|
8
|
+
`}):c&&typeof c=="object"?r.push(n):s+=si(n)+i+si(c)+Fl}),e.section&&s.length&&(s="["+si(e.section)+"]"+Fl+s),r.forEach(function(n,a,o){var c=Bm(n).join("\\."),l=(e.section?e.section+".":"")+c,u=jm(t[n],{section:l,whitespace:e.whitespace});s.length&&u.length&&(s+=Fl),s+=u}),s}function Bm(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function dC(t){var e={},r=e,s=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,n=t.split(/[\r\n]+/g);return n.forEach(function(a,o,c){if(!(!a||a.match(/^\s*[;#]/))){var l=a.match(i);if(l){if(l[1]!==void 0){if(s=ko(l[1]),s==="__proto__"){r={};return}r=e[s]=e[s]||{};return}var u=ko(l[2]);if(u!=="__proto__"){var p=l[3]?ko(l[4]):!0;switch(p){case"true":case"false":case"null":p=JSON.parse(p)}if(u.length>2&&u.slice(-2)==="[]"){if(u=u.substring(0,u.length-2),u==="__proto__")return;r[u]?Array.isArray(r[u])||(r[u]=[r[u]]):r[u]=[]}Array.isArray(r[u])?r[u].push(p):r[u]=p}}}}),Object.keys(e).filter(function(a,o,c){if(!e[a]||typeof e[a]!="object"||Array.isArray(e[a]))return!1;var l=Bm(a),u=e,p=l.pop(),g=p.replace(/\\\./g,".");return l.forEach(function(f,d,m){f!=="__proto__"&&((!u[f]||typeof u[f]!="object")&&(u[f]={}),u=u[f])}),u===e&&g===p?!1:(u[g]=e[a],!0)}).forEach(function(a,o,c){delete e[a]}),e}function Um(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function si(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&Um(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function ko(t,e){if(t=(t||"").trim(),Um(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,s="",i=0,n=t.length;i<n;i++){var a=t.charAt(i);if(r)"\\;#".indexOf(a)!==-1?s+=a:s+="\\"+a,r=!1;else{if(";#".indexOf(a)!==-1)break;a==="\\"?r=!0:s+=a}}return r&&(s+="\\"),s.trim()}return t}});var qm=B((OD,zm)=>{"use strict";var jl=1,Gm=2;function pC(){return""}function mC(t,e,r){return t.slice(e,r).replace(/\S/g," ")}zm.exports=function(t,e){e=e||{};for(var r,s,i=!1,n=!1,a=0,o="",c=e.whitespace===!1?pC:mC,l=0;l<t.length;l++){if(r=t[l],s=t[l+1],!n&&r==='"'){var u=t[l-1]==="\\"&&t[l-2]!=="\\";u||(i=!i)}if(!i){if(!n&&r+s==="//")o+=t.slice(a,l),a=l,n=jl,l++;else if(n===jl&&r+s===`\r
|
|
9
|
+
`){l++,n=!1,o+=c(t,a,l),a=l;continue}else if(n===jl&&r===`
|
|
10
|
+
`)n=!1,o+=c(t,a,l),a=l;else if(!n&&r+s==="/*"){o+=t.slice(a,l),a=l,n=Gm,l++;continue}else if(n===Gm&&r+s==="*/"){l++,n=!1,o+=c(t,a,l+1),a=l+1;continue}}}return o+(n?c(t.substr(a)):t.substr(a))}});var Vm=B(ii=>{"use strict";var Wm=M("fs"),gC=Ml(),ln=M("path"),yC=qm(),vC=ii.parse=function(t){return/^\s*{/.test(t)?JSON.parse(yC(t)):gC.parse(t)},bC=ii.file=function(){var t=[].slice.call(arguments).filter(function(i){return i!=null});for(var e in t)if(typeof t[e]!="string")return;var r=ln.join.apply(null,t),s;try{return Wm.readFileSync(r,"utf-8")}catch{return}},TD=ii.json=function(){var t=bC.apply(null,arguments);return t?vC(t):null},LD=ii.env=function(t,e){e=e||process.env;var r={},s=t.length;for(var i in e)if(i.toLowerCase().indexOf(t.toLowerCase())===0){for(var n=i.substring(s).split("__"),a;(a=n.indexOf(""))>-1;)n.splice(a,1);var o=r;n.forEach(function(l,u){!l||typeof o!="object"||(u===n.length-1&&(o[l]=e[i]),o[l]===void 0&&(o[l]={}),o=o[l])})}return r},$D=ii.find=function(){var t=ln.join.apply(null,[].slice.call(arguments));function e(r,s){var i=ln.join(r,s);try{return Wm.statSync(i),i}catch{if(ln.dirname(r)!==r)return e(ln.dirname(r),s)}}return e(process.cwd(),t)}});var Xm=B((ID,Jm)=>{"use strict";function Hm(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function Km(t){if(t instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function Ym(t){var e=[];return t.forEach(function(r,s){typeof r=="object"&&r!==null?Array.isArray(r)?e[s]=Ym(r):Hm(r)?e[s]=Km(r):e[s]=Bl({},r):e[s]=r}),e}function Zm(t,e){return e==="__proto__"?void 0:t[e]}var Bl=Jm.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var t=arguments[0],e=Array.prototype.slice.call(arguments,1),r,s,i;return e.forEach(function(n){typeof n!="object"||n===null||Array.isArray(n)||Object.keys(n).forEach(function(a){if(s=Zm(t,a),r=Zm(n,a),r!==t)if(typeof r!="object"||r===null){t[a]=r;return}else if(Array.isArray(r)){t[a]=Ym(r);return}else if(Hm(r)){t[a]=Km(r);return}else if(typeof s!="object"||s===null||Array.isArray(s)){t[a]=Bl({},r);return}else{t[a]=Bl(s,r);return}})}),t}});var rg=B((kD,tg)=>{"use strict";function _C(t,e){var r=t;e.slice(0,-1).forEach(function(i){r=r[i]||{}});var s=e[e.length-1];return s in r}function Qm(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function eg(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}tg.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(h){r.bools[h]=!0});var s={};function i(h){return s[h].some(function(b){return r.bools[b]})}Object.keys(e.alias||{}).forEach(function(h){s[h]=[].concat(e.alias[h]),s[h].forEach(function(b){s[b]=[h].concat(s[h].filter(function(x){return b!==x}))})}),[].concat(e.string).filter(Boolean).forEach(function(h){r.strings[h]=!0,s[h]&&[].concat(s[h]).forEach(function(b){r.strings[b]=!0})});var n=e.default||{},a={_:[]};function o(h,b){return r.allBools&&/^--[^=]+$/.test(b)||r.strings[h]||r.bools[h]||s[h]}function c(h,b,x){for(var E=h,L=0;L<b.length-1;L++){var A=b[L];if(eg(E,A))return;E[A]===void 0&&(E[A]={}),(E[A]===Object.prototype||E[A]===Number.prototype||E[A]===String.prototype)&&(E[A]={}),E[A]===Array.prototype&&(E[A]=[]),E=E[A]}var O=b[b.length-1];eg(E,O)||((E===Object.prototype||E===Number.prototype||E===String.prototype)&&(E={}),E===Array.prototype&&(E=[]),E[O]===void 0||r.bools[O]||typeof E[O]=="boolean"?E[O]=x:Array.isArray(E[O])?E[O].push(x):E[O]=[E[O],x])}function l(h,b,x){if(!(x&&r.unknownFn&&!o(h,x)&&r.unknownFn(x)===!1)){var E=!r.strings[h]&&Qm(b)?Number(b):b;c(a,h.split("."),E),(s[h]||[]).forEach(function(L){c(a,L.split("."),E)})}}Object.keys(r.bools).forEach(function(h){l(h,n[h]===void 0?!1:n[h])});var u=[];t.indexOf("--")!==-1&&(u=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var p=0;p<t.length;p++){var g=t[p],f,d;if(/^--.+=/.test(g)){var m=g.match(/^--([^=]+)=([\s\S]*)$/);f=m[1];var y=m[2];r.bools[f]&&(y=y!=="false"),l(f,y,g)}else if(/^--no-.+/.test(g))f=g.match(/^--no-(.+)/)[1],l(f,!1,g);else if(/^--.+/.test(g))f=g.match(/^--(.+)/)[1],d=t[p+1],d!==void 0&&!/^(-|--)[^-]/.test(d)&&!r.bools[f]&&!r.allBools&&(!s[f]||!i(f))?(l(f,d,g),p+=1):/^(true|false)$/.test(d)?(l(f,d==="true",g),p+=1):l(f,r.strings[f]?"":!0,g);else if(/^-[^-]+/.test(g)){for(var v=g.slice(1,-1).split(""),_=!1,w=0;w<v.length;w++){if(d=g.slice(w+2),d==="-"){l(v[w],d,g);continue}if(/[A-Za-z]/.test(v[w])&&d[0]==="="){l(v[w],d.slice(1),g),_=!0;break}if(/[A-Za-z]/.test(v[w])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(d)){l(v[w],d,g),_=!0;break}if(v[w+1]&&v[w+1].match(/\W/)){l(v[w],g.slice(w+2),g),_=!0;break}else l(v[w],r.strings[v[w]]?"":!0,g)}f=g.slice(-1)[0],!_&&f!=="-"&&(t[p+1]&&!/^(-|--)[^-]/.test(t[p+1])&&!r.bools[f]&&(!s[f]||!i(f))?(l(f,t[p+1],g),p+=1):t[p+1]&&/^(true|false)$/.test(t[p+1])?(l(f,t[p+1]==="true",g),p+=1):l(f,r.strings[f]?"":!0,g))}else if((!r.unknownFn||r.unknownFn(g)!==!1)&&a._.push(r.strings._||!Qm(g)?g:Number(g)),e.stopEarly){a._.push.apply(a._,t.slice(p+1));break}}return Object.keys(n).forEach(function(h){_C(a,h.split("."))||(c(a,h.split("."),n[h]),(s[h]||[]).forEach(function(b){c(a,b.split("."),n[h])}))}),e["--"]?a["--"]=u.slice():u.forEach(function(h){a._.push(h)}),a}});var og=B((ND,ng)=>{var un=Vm(),ni=M("path").join,wC=Xm(),sg="/etc",ig=process.platform==="win32",fn=ig?process.env.USERPROFILE:process.env.HOME;ng.exports=function(t,e,r,s){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=rg()(process.argv.slice(2))),e=(typeof e=="string"?un.json(e):e)||{},s=s||un.parse;var i=un.env(t+"_"),n=[e],a=[];function o(c){if(!(a.indexOf(c)>=0)){var l=un.file(c);l&&(n.push(s(l)),a.push(c))}}return ig||[ni(sg,t,"config"),ni(sg,t+"rc")].forEach(o),fn&&[ni(fn,".config",t,"config"),ni(fn,".config",t),ni(fn,"."+t,"config"),ni(fn,"."+t+"rc")].forEach(o),o(un.find("."+t+"rc")),i.config&&o(i.config),r.config&&o(r.config),wC.apply(null,n.concat([i,r,a.length?{configs:a,config:a[a.length-1]}:void 0]))}});var lg=B((FD,cg)=>{var xr=M("constants"),xC=process.cwd,No=null,EC=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return No||(No=xC.call(process)),No};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Gl=process.chdir,process.chdir=function(t){No=null,Gl.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Gl));var Gl;cg.exports=SC;function SC(t){xr.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=n(t.chown),t.fchown=n(t.fchown),t.lchown=n(t.lchown),t.chmod=s(t.chmod),t.fchmod=s(t.fchmod),t.lchmod=s(t.lchmod),t.chownSync=a(t.chownSync),t.fchownSync=a(t.fchownSync),t.lchownSync=a(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=o(t.stat),t.fstat=o(t.fstat),t.lstat=o(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(u,p,g){g&&process.nextTick(g)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,p,g,f){f&&process.nextTick(f)},t.lchownSync=function(){}),EC==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(u){function p(g,f,d){var m=Date.now(),y=0;u(g,f,function v(_){if(_&&(_.code==="EACCES"||_.code==="EPERM")&&Date.now()-m<6e4){setTimeout(function(){t.stat(f,function(w,h){w&&w.code==="ENOENT"?u(g,f,v):d(_)})},y),y<100&&(y+=10);return}d&&d(_)})}return Object.setPrototypeOf&&Object.setPrototypeOf(p,u),p})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(u){function p(g,f,d,m,y,v){var _;if(v&&typeof v=="function"){var w=0;_=function(h,b,x){if(h&&h.code==="EAGAIN"&&w<10)return w++,u.call(t,g,f,d,m,y,_);v.apply(this,arguments)}}return u.call(t,g,f,d,m,y,_)}return Object.setPrototypeOf&&Object.setPrototypeOf(p,u),p})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(u){return function(p,g,f,d,m){for(var y=0;;)try{return u.call(t,p,g,f,d,m)}catch(v){if(v.code==="EAGAIN"&&y<10){y++;continue}throw v}}})(t.readSync);function e(u){u.lchmod=function(p,g,f){u.open(p,xr.O_WRONLY|xr.O_SYMLINK,g,function(d,m){if(d){f&&f(d);return}u.fchmod(m,g,function(y){u.close(m,function(v){f&&f(y||v)})})})},u.lchmodSync=function(p,g){var f=u.openSync(p,xr.O_WRONLY|xr.O_SYMLINK,g),d=!0,m;try{m=u.fchmodSync(f,g),d=!1}finally{if(d)try{u.closeSync(f)}catch{}else u.closeSync(f)}return m}}function r(u){xr.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(p,g,f,d){u.open(p,xr.O_SYMLINK,function(m,y){if(m){d&&d(m);return}u.futimes(y,g,f,function(v){u.close(y,function(_){d&&d(v||_)})})})},u.lutimesSync=function(p,g,f){var d=u.openSync(p,xr.O_SYMLINK),m,y=!0;try{m=u.futimesSync(d,g,f),y=!1}finally{if(y)try{u.closeSync(d)}catch{}else u.closeSync(d)}return m}):u.futimes&&(u.lutimes=function(p,g,f,d){d&&process.nextTick(d)},u.lutimesSync=function(){})}function s(u){return u&&function(p,g,f){return u.call(t,p,g,function(d){l(d)&&(d=null),f&&f.apply(this,arguments)})}}function i(u){return u&&function(p,g){try{return u.call(t,p,g)}catch(f){if(!l(f))throw f}}}function n(u){return u&&function(p,g,f,d){return u.call(t,p,g,f,function(m){l(m)&&(m=null),d&&d.apply(this,arguments)})}}function a(u){return u&&function(p,g,f){try{return u.call(t,p,g,f)}catch(d){if(!l(d))throw d}}}function o(u){return u&&function(p,g,f){typeof g=="function"&&(f=g,g=null);function d(m,y){y&&(y.uid<0&&(y.uid+=4294967296),y.gid<0&&(y.gid+=4294967296)),f&&f.apply(this,arguments)}return g?u.call(t,p,g,d):u.call(t,p,d)}}function c(u){return u&&function(p,g){var f=g?u.call(t,p,g):u.call(t,p);return f&&(f.uid<0&&(f.uid+=4294967296),f.gid<0&&(f.gid+=4294967296)),f}}function l(u){if(!u||u.code==="ENOSYS")return!0;var p=!process.getuid||process.getuid()!==0;return!!(p&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var hg=B((MD,fg)=>{var ug=M("stream").Stream;fg.exports=RC;function RC(t){return{ReadStream:e,WriteStream:r};function e(s,i){if(!(this instanceof e))return new e(s,i);ug.call(this);var n=this;this.path=s,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var a=Object.keys(i),o=0,c=a.length;o<c;o++){var l=a[o];this[l]=i[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){n._read()});return}t.open(this.path,this.flags,this.mode,function(u,p){if(u){n.emit("error",u),n.readable=!1;return}n.fd=p,n.emit("open",p),n._read()})}function r(s,i){if(!(this instanceof r))return new r(s,i);ug.call(this),this.path=s,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var n=Object.keys(i),a=0,o=n.length;a<o;a++){var c=n[a];this[c]=i[c]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var pg=B((jD,dg)=>{"use strict";dg.exports=CC;var AC=Object.getPrototypeOf||function(t){return t.__proto__};function CC(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:AC(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var vg=B((BD,Wl)=>{var Le=M("fs"),OC=lg(),TC=hg(),LC=pg(),Do=M("util"),ze,Mo;typeof Symbol=="function"&&typeof Symbol.for=="function"?(ze=Symbol.for("graceful-fs.queue"),Mo=Symbol.for("graceful-fs.previous")):(ze="___graceful-fs.queue",Mo="___graceful-fs.previous");function $C(){}function yg(t,e){Object.defineProperty(t,ze,{get:function(){return e}})}var is=$C;Do.debuglog?is=Do.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(is=function(){var t=Do.format.apply(Do,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
11
|
+
GFS4: `),console.error(t)});Le[ze]||(mg=global[ze]||[],yg(Le,mg),Le.close=(function(t){function e(r,s){return t.call(Le,r,function(i){i||gg(),typeof s=="function"&&s.apply(this,arguments)})}return Object.defineProperty(e,Mo,{value:t}),e})(Le.close),Le.closeSync=(function(t){function e(r){t.apply(Le,arguments),gg()}return Object.defineProperty(e,Mo,{value:t}),e})(Le.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){is(Le[ze]),M("assert").equal(Le[ze].length,0)}));var mg;global[ze]||yg(global,Le[ze]);Wl.exports=zl(LC(Le));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Le.__patched&&(Wl.exports=zl(Le),Le.__patched=!0);function zl(t){OC(t),t.gracefulify=zl,t.createReadStream=b,t.createWriteStream=x;var e=t.readFile;t.readFile=r;function r(A,O,k){return typeof O=="function"&&(k=O,O=null),z(A,O,k);function z(P,H,re,W){return e(P,H,function(J){J&&(J.code==="EMFILE"||J.code==="ENFILE")?oi([z,[P,H,re],J,W||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}}var s=t.writeFile;t.writeFile=i;function i(A,O,k,z){return typeof k=="function"&&(z=k,k=null),P(A,O,k,z);function P(H,re,W,J,fe){return s(H,re,W,function(ne){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?oi([P,[H,re,W,J],ne,fe||Date.now(),Date.now()]):typeof J=="function"&&J.apply(this,arguments)})}}var n=t.appendFile;n&&(t.appendFile=a);function a(A,O,k,z){return typeof k=="function"&&(z=k,k=null),P(A,O,k,z);function P(H,re,W,J,fe){return n(H,re,W,function(ne){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?oi([P,[H,re,W,J],ne,fe||Date.now(),Date.now()]):typeof J=="function"&&J.apply(this,arguments)})}}var o=t.copyFile;o&&(t.copyFile=c);function c(A,O,k,z){return typeof k=="function"&&(z=k,k=0),P(A,O,k,z);function P(H,re,W,J,fe){return o(H,re,W,function(ne){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?oi([P,[H,re,W,J],ne,fe||Date.now(),Date.now()]):typeof J=="function"&&J.apply(this,arguments)})}}var l=t.readdir;t.readdir=p;var u=/^v[0-5]\./;function p(A,O,k){typeof O=="function"&&(k=O,O=null);var z=u.test(process.version)?function(re,W,J,fe){return l(re,P(re,W,J,fe))}:function(re,W,J,fe){return l(re,W,P(re,W,J,fe))};return z(A,O,k);function P(H,re,W,J){return function(fe,ne){fe&&(fe.code==="EMFILE"||fe.code==="ENFILE")?oi([z,[H,re,W],fe,J||Date.now(),Date.now()]):(ne&&ne.sort&&ne.sort(),typeof W=="function"&&W.call(this,fe,ne))}}}if(process.version.substr(0,4)==="v0.8"){var g=TC(t);v=g.ReadStream,w=g.WriteStream}var f=t.ReadStream;f&&(v.prototype=Object.create(f.prototype),v.prototype.open=_);var d=t.WriteStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=h),Object.defineProperty(t,"ReadStream",{get:function(){return v},set:function(A){v=A},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return w},set:function(A){w=A},enumerable:!0,configurable:!0});var m=v;Object.defineProperty(t,"FileReadStream",{get:function(){return m},set:function(A){m=A},enumerable:!0,configurable:!0});var y=w;Object.defineProperty(t,"FileWriteStream",{get:function(){return y},set:function(A){y=A},enumerable:!0,configurable:!0});function v(A,O){return this instanceof v?(f.apply(this,arguments),this):v.apply(Object.create(v.prototype),arguments)}function _(){var A=this;L(A.path,A.flags,A.mode,function(O,k){O?(A.autoClose&&A.destroy(),A.emit("error",O)):(A.fd=k,A.emit("open",k),A.read())})}function w(A,O){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function h(){var A=this;L(A.path,A.flags,A.mode,function(O,k){O?(A.destroy(),A.emit("error",O)):(A.fd=k,A.emit("open",k))})}function b(A,O){return new t.ReadStream(A,O)}function x(A,O){return new t.WriteStream(A,O)}var E=t.open;t.open=L;function L(A,O,k,z){return typeof k=="function"&&(z=k,k=null),P(A,O,k,z);function P(H,re,W,J,fe){return E(H,re,W,function(ne,$e){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?oi([P,[H,re,W,J],ne,fe||Date.now(),Date.now()]):typeof J=="function"&&J.apply(this,arguments)})}}return t}function oi(t){is("ENQUEUE",t[0].name,t[1]),Le[ze].push(t),ql()}var Fo;function gg(){for(var t=Date.now(),e=0;e<Le[ze].length;++e)Le[ze][e].length>2&&(Le[ze][e][3]=t,Le[ze][e][4]=t);ql()}function ql(){if(clearTimeout(Fo),Fo=void 0,Le[ze].length!==0){var t=Le[ze].shift(),e=t[0],r=t[1],s=t[2],i=t[3],n=t[4];if(i===void 0)is("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){is("TIMEOUT",e.name,r);var a=r.pop();typeof a=="function"&&a.call(null,s)}else{var o=Date.now()-n,c=Math.max(n-i,1),l=Math.min(c*1.2,100);o>=l?(is("RETRY",e.name,r),e.apply(null,r.concat([i]))):Le[ze].push(t)}Fo===void 0&&(Fo=setTimeout(ql,0))}}});var bg=B(ai=>{"use strict";var PC=ai&&ai.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ai,"__esModule",{value:!0});ai.readCAFileSync=void 0;var IC=PC(vg());function kC(t){try{let e=IC.default.readFileSync(t,"utf8"),r="-----END CERTIFICATE-----";return e.split(r).filter(i=>!!i.trim()).map(i=>`${i.trimLeft()}${r}`)}catch(e){if(e.code==="ENOENT")return;throw e}}ai.readCAFileSync=kC});var _g=B(ns=>{"use strict";var NC=ns&&ns.__createBinding||(Object.create?(function(t,e,r,s){s===void 0&&(s=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,i)}):(function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]})),DC=ns&&ns.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&NC(e,t,r)};Object.defineProperty(ns,"__esModule",{value:!0});DC(bg(),ns)});var Eg=B((zD,xg)=>{xg.exports=wg;function os(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function wg(){this.list=[];var t=null;Object.defineProperty(this,"root",{get:function(){return t},set:function(e){t=e,this.list.length&&os(this.list[this.list.length-1],e)},enumerable:!0,configurable:!0})}wg.prototype={get length(){return this.list.length},get keys(){var t=[];for(var e in this.list[0])t.push(e);return t},get snapshot(){var t={};return this.keys.forEach(function(e){t[e]=this.get(e)},this),t},get store(){return this.list[0]},push:function(t){return typeof t!="object"&&(t={valueOf:t}),this.list.length>=1&&os(this.list[this.list.length-1],t),os(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&os(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return os(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&os(this.list[0],this.root),this.list.shift()},get:function(t){return this.list[0][t]},set:function(t,e,r){return this.length||this.push({}),r&&this.list[0].hasOwnProperty(t)&&this.push({}),this.list[0][t]=e},forEach:function(t,e){for(var r in this.list[0])t.call(e,r,this.list[0][r])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){for(var t=this.list.splice.apply(this.list,arguments),e=0,r=this.list.length;e<r;e++)os(this.list[e],this.list[e+1]||this.root);return t}}});var Cg=B((ir,Ag)=>{var Sg=Eg(),hn=M("path"),jo=M("fs"),Vl=Ml(),Zl=M("events").EventEmitter,FC=M("url"),MC=M("http"),ir=Ag.exports=function(){for(var t=[].slice.call(arguments),e=new He;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?BC(r):r)}return e},qD=ir.find=function(){var t=hn.join.apply(null,[].slice.call(arguments));function e(r,s){var i=hn.join(r,s);try{return jo.statSync(i),i}catch{if(hn.dirname(r)!==r)return e(hn.dirname(r),s)}}return e(__dirname,t)},jC=ir.parse=function(t,e,r){if(t=""+t,r)if(r==="json")if(this.emit)try{return JSON.parse(t)}catch(s){this.emit("error",s)}else return JSON.parse(t);else return Vl.parse(t);else try{return JSON.parse(t)}catch{return Vl.parse(t)}},BC=ir.json=function(){var t=[].slice.call(arguments).filter(function(s){return s!=null}),e=hn.join.apply(null,t),r;try{r=jo.readFileSync(e,"utf-8")}catch{return}return jC(r,e,"json")},WD=ir.env=function(t,e){e=e||process.env;var r={},s=t.length;for(var i in e)i.indexOf(t)===0&&(r[i.substring(s)]=e[i]);return r};ir.ConfigChain=He;function He(){Zl.apply(this),Sg.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var Rg={constructor:{value:He}};Object.keys(Zl.prototype).forEach(function(t){Rg[t]=Object.getOwnPropertyDescriptor(Zl.prototype,t)});He.prototype=Object.create(Sg.prototype,Rg);He.prototype.del=function(t,e){if(e){var r=this.sources[e];if(r=r&&r.data,!r)return this.emit("error",new Error("not found "+e));delete r[t]}else for(var s=0,i=this.list.length;s<i;s++)delete this.list[s][t];return this};He.prototype.set=function(t,e,r){var s;if(r){if(s=this.sources[r],s=s&&s.data,!s)return this.emit("error",new Error("not found "+r))}else if(s=this.list[0],!s)return this.emit("error",new Error("cannot set, no confs!"));return s[t]=e,this};He.prototype.get=function(t,e){return e?(e=this.sources[e],e&&(e=e.data),e&&Object.hasOwnProperty.call(e,t)?e[t]:void 0):this.list[0][t]};He.prototype.save=function(t,n,r){typeof n=="function"&&(r=n,n=null);var s=this.sources[t];if(!s||!(s.path||s.source)||!s.data)return this.emit("error",new Error("bad save target: "+t));if(s.source){var i=s.prefix||"";return Object.keys(s.data).forEach(function(o){s.source[i+o]=s.data[o]}),this}var n=n||s.type,a=s.data;return s.type==="json"?a=JSON.stringify(a):a=Vl.stringify(a),this._saving++,jo.writeFile(s.path,a,"utf8",function(o){if(this._saving--,o)return r?r(o):this.emit("error",o);this._saving===0&&(r&&r(),this.emit("save"))}.bind(this)),this};He.prototype.addFile=function(t,e,r){r=r||t;var s={__source__:r};return this.sources[r]={path:t,type:e},this.push(s),this._await(),jo.readFile(t,"utf8",function(i,n){i&&this.emit("error",i),this.addString(n,t,e,s)}.bind(this)),this};He.prototype.addEnv=function(t,e,r){r=r||"env";var s=ir.env(t,e);return this.sources[r]={data:s,source:e,prefix:t},this.add(s,r)};He.prototype.addUrl=function(t,e,r){this._await();var s=FC.format(t);r=r||s;var i={__source__:r};return this.sources[r]={href:s,type:e},this.push(i),MC.request(t,function(n){var a=[],o=n.headers["content-type"];e||(e=o.indexOf("json")!==-1?"json":o.indexOf("ini")!==-1?"ini":s.match(/\.json$/)?"json":s.match(/\.ini$/)?"ini":null,i.type=e),n.on("data",a.push.bind(a)).on("end",function(){this.addString(Buffer.concat(a),s,e,i)}.bind(this)).on("error",this.emit.bind(this,"error"))}.bind(this)).on("error",this.emit.bind(this,"error")).end(),this};He.prototype.addString=function(t,e,r,s){return t=this.parse(t,e,r),this.add(t,s),this};He.prototype.add=function(t,e){if(e&&typeof e=="object"){var r=this.list.indexOf(e);if(r===-1)return this.emit("error",new Error("bad marker"));this.splice(r,1,t),e=e.__source__,this.sources[e]=this.sources[e]||{},this.sources[e].data=t,this._resolve()}else typeof e=="string"&&(this.sources[e]=this.sources[e]||{},this.sources[e].data=t),this._await(),this.push(t),process.nextTick(this._resolve.bind(this));return this};He.prototype.parse=ir.parse;He.prototype._await=function(){this._awaiting++};He.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var Tg=B((VD,Og)=>{Og.exports=function(t){let e=t.indexOf(":");if(e===-1)return Hl(t);let r=t.substr(0,e),s=t.substr(e+1);return`${Hl(r)}:${Hl(s)}`};function Hl(t){if(t=t.toLowerCase(),t==="_authtoken")return"_authToken";let e=t[0];for(let r=1;r<t.length;r++)e+=t[r]==="_"?"-":t[r];return e}});var Lg=B(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.envReplace=void 0;var UC=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function GC(t,e){return t.replace(UC,zC.bind(null,e))}Bo.envReplace=GC;function zC(t,e,r,s){if(r.length%2)return e.slice((r.length+1)/2);let i=WC(t,s);if(i===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${i}`}var qC=/([^:-]+)(:?)-(.+)/;function WC(t,e){let r=e.match(qC);if(!r)return t[e];let[,s,i,n]=r;return Object.prototype.hasOwnProperty.call(t,s)?!t[s]&&i?n:t[s]:n}});var $g=B(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.envReplace=void 0;var VC=Lg();Object.defineProperty(Uo,"envReplace",{enumerable:!0,get:function(){return VC.envReplace}})});var Pg=B(dn=>{"use strict";var ZC=M("fs"),as=M("path"),{envReplace:Kl}=$g(),HC=t=>typeof t!="string"?t:Kl(t,process.env),KC=(t,e,r)=>{if(typeof e!="string")return e;let s=[].concat(t[r]),i=s.indexOf(as)!==-1,n=s.indexOf(Boolean)!==-1,a=s.indexOf(String)!==-1,o=s.indexOf(Number)!==-1;if(e=`${e}`.trim(),/^".*"$/.test(e))try{e=JSON.parse(e)}catch{throw new Error(`Failed parsing JSON config key ${r}: ${e}`)}if(n&&!a&&e==="")return!0;switch(e){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}return e=Kl(e,process.env),i&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=as.resolve(process.env.HOME,e.substr(2))),e=as.resolve(e)),o&&!isNaN(e)&&(e=Number(e)),e},YC=t=>{t=as.resolve(t);let e=!1;for(;as.basename(t)==="node_modules";)t=as.dirname(t),e=!0;if(e)return t;let r=(s,i)=>{let n=/^[a-zA-Z]:(\\|\/)?$/;if(s==="/"||process.platform==="win32"&&n.test(s))return i;try{let a=ZC.readdirSync(s);if(a.includes("node_modules")||a.includes("package.json")||a.includes("package.json5")||a.includes("package.yaml")||a.includes("pnpm-workspace.yaml"))return s;let o=as.dirname(s);return o===s?i:r(o,i)}catch(a){if(s===i){if(a.code==="ENOENT")return i;throw a}return i}};return r(t,t)};dn.envReplace=Kl;dn.findPrefix=YC;dn.parseField=KC;dn.parseKey=HC});var Ng=B(kg=>{"use strict";var cs=M("path"),JC=M("stream").Stream,Go=M("url"),XC=()=>{},QC=()=>[],Ig=()=>{};kg.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:cs,cache:cs,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:cs,"global-style":Boolean,group:[Number,String],"https-proxy":[null,Go],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":cs,"init-author-name":String,"init-author-email":String,"init-author-url":["",Go],"init-license":String,"init-version":Ig,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":QC(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:JC,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,Ig],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:cs,production:Boolean,progress:Boolean,proxy:[null,!1,Go],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,Go],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:cs,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:cs,umask:XC,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var Mg=B((JD,Fg)=>{"use strict";var{readCAFileSync:eO}=_g(),Dg=M("fs"),Yl=M("path"),{ConfigChain:tO}=Cg(),rO=Tg(),Jl=Pg(),Xl=class extends tO{constructor(e,r){super(e),this.root=e,this._parseField=Jl.parseField.bind(null,r||Ng())}add(e,r){try{for(let[s,i]of Object.entries(e)){let n=Jl.parseKey(s);n!==s&&delete e[s],e[n]=this._parseField(i,n)}}catch(s){throw s}return super.add(e,r)}addFile(e,r){r=r||e;let s={__source__:r};this.sources[r]={path:e,type:"ini"},this.push(s),this._await();try{let i=Dg.readFileSync(e,"utf8");this.addString(i,e,"ini",s)}catch(i){if(i.code==="ENOENT")this.add({},s);else if(i.code!=="EISDIR")return`Issue while reading "${e}". ${i.message}`}}addEnv(e){e=e||process.env;let r={};return Object.keys(e).filter(s=>/^npm_config_/i.test(s)).forEach(s=>{if(!e[s])return;let i=rO(s.substr(11)),n=e[s];r[i]=sO(i,n)}),super.addEnv("",r,"env")}loadPrefix(){let e=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:s=>{let i=this.get("global");this[i?"globalPrefix":"localPrefix"]=s},get:()=>this.get("global")?this.globalPrefix:this.localPrefix}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:s=>{this.set("prefix",s)},get:()=>Yl.resolve(this.get("prefix"))});let r;if(Object.defineProperty(this,"localPrefix",{enumerable:!0,set:s=>{r=s},get:()=>r}),Object.prototype.hasOwnProperty.call(e,"prefix"))r=Yl.resolve(e.prefix);else try{r=Jl.findPrefix(process.cwd())}catch(s){throw s}return r}loadCAFile(e){if(!e)return;let r=eO(e);r&&this.set("ca",r)}loadUser(){let e=this.root;if(this.get("global"))return;if(process.env.SUDO_UID){e.user=Number(process.env.SUDO_UID);return}let r=Yl.resolve(this.get("prefix"));try{let s=Dg.statSync(r);e.user=s.uid}catch(s){if(s.code==="ENOENT")return;throw s}}};function sO(t,e){function r(s){return s.indexOf(`
|
|
12
12
|
|
|
13
|
-
`)?
|
|
13
|
+
`)?s.split(`
|
|
14
14
|
|
|
15
|
-
`):i.split(",")}switch(t){case"hoist-pattern":case"public-hoist-pattern":return r(e)}return e}fm.exports=Nc});var vm=j(bm=>{"use strict";var gm=D("os"),Ft=D("path"),ym=gm.tmpdir(),TR=process.getuid?process.getuid():process.pid,PR=()=>!0,dm=process.platform==="win32",mm={editor:()=>process.env.EDITOR||process.env.VISUAL||(dm?"notepad.exe":"vi"),shell:()=>dm?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},IR={fromString:()=>process.umask()},fi=gm.homedir();fi?process.env.HOME=fi:fi=Ft.resolve(ym,"npm-"+TR);var FR=process.platform==="win32"?"npm-cache":".npm",NR=process.platform==="win32"&&process.env.APPDATA||fi,DR=Ft.resolve(NR,FR),Pn,Tr;Object.defineProperty(bm,"defaults",{get:function(){return Pn||(process.env.PREFIX?Tr=process.env.PREFIX:process.platform==="win32"?Tr=Ft.dirname(process.execPath):(Tr=Ft.dirname(Ft.dirname(process.execPath)),process.env.DESTDIR&&(Tr=Ft.join(process.env.DESTDIR,Tr))),Pn={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:DR,"cache-lock-stale":6e4,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:mm.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:Ft.resolve(Tr,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":Ft.resolve(fi,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:Tr,production:process.env.NODE_ENV==="production",progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:900,"send-metrics":!1,shell:mm.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:ym,unicode:PR(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:Ft.resolve(fi,".npmrc"),umask:process.umask?process.umask():IR.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},Pn)}})});var xm=j((a2,Dc)=>{"use strict";var Pr=D("path"),MR=pm(),wm=vm();Dc.exports=(t,e,r)=>{let i=new MR(Object.assign({},wm.defaults,r),e);i.add(Object.assign({},t),"cli");let s=[],n=!1;if(D.resolve.paths){let l=D.resolve.paths("npm"),u;try{u=D.resolve("npm",{paths:l.slice(-1)})}catch{n=!0}u&&s.push(i.addFile(Pr.resolve(Pr.dirname(u),"..","npmrc"),"builtin"))}i.addEnv(),i.loadPrefix();let a=Pr.resolve(i.localPrefix,".npmrc"),o=i.get("userconfig");if(!i.get("global")&&a!==o?s.push(i.addFile(a,"project")):i.add({},"project"),i.get("workspace-prefix")&&i.get("workspace-prefix")!==a){let l=Pr.resolve(i.get("workspace-prefix"),".npmrc");s.push(i.addFile(l,"workspace"))}if(s.push(i.addFile(i.get("userconfig"),"user")),i.get("prefix")){let l=Pr.resolve(i.get("prefix"),"etc");i.root.globalconfig=Pr.resolve(l,"npmrc"),i.root.globalignorefile=Pr.resolve(l,"npmignore")}s.push(i.addFile(i.get("globalconfig"),"global")),i.loadUser();let c=i.get("cafile");return c&&i.loadCAFile(c),{config:i,warnings:s.filter(Boolean),failedToLoadBuiltInConfig:n}};Object.defineProperty(Dc.exports,"defaults",{get(){return wm.defaults},enumerable:!0})});var Om=j((l2,Lm)=>{var Em=xm(),_m=":_authToken",Sm=":_auth",Rm=":username",Cm=":_password";Lm.exports=function(){let e,r;arguments.length>=2?(e=arguments[0],r=Object.assign({},arguments[1])):typeof arguments[0]=="string"?e=arguments[0]:r=Object.assign({},arguments[0]),r=r||{};let i=r.npmrc;return r.npmrc=(r.npmrc?{config:{get:s=>i[s]}}:Em()).config,e=e||r.npmrc.get("registry")||Em.defaults.registry,Am(e,r)||jR(r.npmrc)};function kR(t,e){let r=new URL(e,new URL(t.startsWith("//")?`./${t}`:t,"resolve://"));if(r.protocol==="resolve:"){let{pathname:i,search:s,hash:n}=r;return i+s+n}return r.toString()}function Am(t,e){let r=t instanceof URL?t:new URL(t.startsWith("//")?`http:${t}`:t),i;for(;i!=="/"&&r.pathname!==i;){i=r.pathname||"/";let s="//"+r.host+i.replace(/\/$/,""),n=UR(s,e.npmrc);if(n)return n;if(!e.recursive)return/\/$/.test(t)?void 0:Am(new URL("./",r),e);r.pathname=kR(BR(i),"..")||"/"}}function jR(t){return t.get("_auth")?{token:In(t.get("_auth")),type:"Basic"}:void 0}function BR(t){return t[t.length-1]==="/"?t:t+"/"}function UR(t,e){let r=GR(e.get(t+_m)||e.get(t+"/"+_m));if(r)return r;let i=e.get(t+Rm)||e.get(t+"/"+Rm),s=e.get(t+Cm)||e.get(t+"/"+Cm),n=zR(i,s);if(n)return n;let a=qR(e.get(t+Sm)||e.get(t+"/"+Sm));if(a)return a}function In(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function GR(t){return t?{token:In(t),type:"Bearer"}:void 0}function zR(t,e){if(!t||!e)return;let r=Buffer.from(In(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function qR(t){return t?{token:In(t),type:"Basic"}:void 0}});var hg=j((U2,kn)=>{var Wm,Vm,Hm,Km,Ym,Xm,Jm,Zm,Qm,Mn,Kc,eg,tg,di,rg,ig,sg,ng,og,ag,cg,lg,ug;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){t(r(e,r(i)))}):typeof kn=="object"&&typeof kn.exports=="object"?t(r(e,r(kn.exports))):t(r(e));function r(i,s){return i!==e&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(n,a){return i[n]=s?s(n,a):a}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)i.hasOwnProperty(s)&&(r[s]=i[s])};Wm=function(r,i){e(r,i);function s(){this.constructor=r}r.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)},Vm=Object.assign||function(r){for(var i,s=1,n=arguments.length;s<n;s++){i=arguments[s];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a])}return r},Hm=function(r,i){var s={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&i.indexOf(n)<0&&(s[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(r);a<n.length;a++)i.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(r,n[a])&&(s[n[a]]=r[n[a]]);return s},Km=function(r,i,s,n){var a=arguments.length,o=a<3?i:n===null?n=Object.getOwnPropertyDescriptor(i,s):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,i,s,n);else for(var l=r.length-1;l>=0;l--)(c=r[l])&&(o=(a<3?c(o):a>3?c(i,s,o):c(i,s))||o);return a>3&&o&&Object.defineProperty(i,s,o),o},Ym=function(r,i){return function(s,n){i(s,n,r)}},Xm=function(r,i){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,i)},Jm=function(r,i,s,n){function a(o){return o instanceof s?o:new s(function(c){c(o)})}return new(s||(s=Promise))(function(o,c){function l(g){try{d(n.next(g))}catch(h){c(h)}}function u(g){try{d(n.throw(g))}catch(h){c(h)}}function d(g){g.done?o(g.value):a(g.value).then(l,u)}d((n=n.apply(r,i||[])).next())})},Zm=function(r,i){var s={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(d){return function(g){return u([d,g])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,a&&(o=d[0]&2?a.return:d[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,d[1])).done)return o;switch(a=0,o&&(d=[d[0]&2,o.value]),d[0]){case 0:case 1:o=d;break;case 4:return s.label++,{value:d[1],done:!1};case 5:s.label++,a=d[1],d=[0];continue;case 7:d=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(d[0]===6||d[0]===2)){s=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){s.label=d[1];break}if(d[0]===6&&s.label<o[1]){s.label=o[1],o=d;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(d);break}o[2]&&s.ops.pop(),s.trys.pop();continue}d=i.call(r,s)}catch(g){d=[6,g],a=0}finally{n=o=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}},ug=function(r,i,s,n){n===void 0&&(n=s),r[n]=i[s]},Qm=function(r,i){for(var s in r)s!=="default"&&!i.hasOwnProperty(s)&&(i[s]=r[s])},Mn=function(r){var i=typeof Symbol=="function"&&Symbol.iterator,s=i&&r[i],n=0;if(s)return s.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},Kc=function(r,i){var s=typeof Symbol=="function"&&r[Symbol.iterator];if(!s)return r;var n=s.call(r),a,o=[],c;try{for(;(i===void 0||i-- >0)&&!(a=n.next()).done;)o.push(a.value)}catch(l){c={error:l}}finally{try{a&&!a.done&&(s=n.return)&&s.call(n)}finally{if(c)throw c.error}}return o},eg=function(){for(var r=[],i=0;i<arguments.length;i++)r=r.concat(Kc(arguments[i]));return r},tg=function(){for(var r=0,i=0,s=arguments.length;i<s;i++)r+=arguments[i].length;for(var n=Array(r),a=0,i=0;i<s;i++)for(var o=arguments[i],c=0,l=o.length;c<l;c++,a++)n[a]=o[c];return n},di=function(r){return this instanceof di?(this.v=r,this):new di(r)},rg=function(r,i,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=s.apply(r,i||[]),a,o=[];return a={},c("next"),c("throw"),c("return"),a[Symbol.asyncIterator]=function(){return this},a;function c(p){n[p]&&(a[p]=function(m){return new Promise(function(y,b){o.push([p,m,y,b])>1||l(p,m)})})}function l(p,m){try{u(n[p](m))}catch(y){h(o[0][3],y)}}function u(p){p.value instanceof di?Promise.resolve(p.value.v).then(d,g):h(o[0][2],p)}function d(p){l("next",p)}function g(p){l("throw",p)}function h(p,m){p(m),o.shift(),o.length&&l(o[0][0],o[0][1])}},ig=function(r){var i,s;return i={},n("next"),n("throw",function(a){throw a}),n("return"),i[Symbol.iterator]=function(){return this},i;function n(a,o){i[a]=r[a]?function(c){return(s=!s)?{value:di(r[a](c)),done:a==="return"}:o?o(c):c}:o}},sg=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r[Symbol.asyncIterator],s;return i?i.call(r):(r=typeof Mn=="function"?Mn(r):r[Symbol.iterator](),s={},n("next"),n("throw"),n("return"),s[Symbol.asyncIterator]=function(){return this},s);function n(o){s[o]=r[o]&&function(c){return new Promise(function(l,u){c=r[o](c),a(l,u,c.done,c.value)})}}function a(o,c,l,u){Promise.resolve(u).then(function(d){o({value:d,done:l})},c)}},ng=function(r,i){return Object.defineProperty?Object.defineProperty(r,"raw",{value:i}):r.raw=i,r},og=function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var s in r)Object.hasOwnProperty.call(r,s)&&(i[s]=r[s]);return i.default=r,i},ag=function(r){return r&&r.__esModule?r:{default:r}},cg=function(r,i){if(!i.has(r))throw new TypeError("attempted to get private field on non-instance");return i.get(r)},lg=function(r,i,s){if(!i.has(r))throw new TypeError("attempted to set private field on non-instance");return i.set(r,s),s},t("__extends",Wm),t("__assign",Vm),t("__rest",Hm),t("__decorate",Km),t("__param",Ym),t("__metadata",Xm),t("__awaiter",Jm),t("__generator",Zm),t("__exportStar",Qm),t("__createBinding",ug),t("__values",Mn),t("__read",Kc),t("__spread",eg),t("__spreadArrays",tg),t("__await",di),t("__asyncGenerator",rg),t("__asyncDelegator",ig),t("__asyncValues",sg),t("__makeTemplateObject",ng),t("__importStar",og),t("__importDefault",ag),t("__classPrivateFieldGet",cg),t("__classPrivateFieldSet",lg)})});var pg={};jo(pg,{__assign:()=>pC,__asyncDelegator:()=>LC,__asyncGenerator:()=>AC,__asyncValues:()=>OC,__await:()=>CC,__awaiter:()=>bC,__classPrivateFieldGet:()=>IC,__classPrivateFieldSet:()=>FC,__createBinding:()=>xC,__decorate:()=>mC,__exportStar:()=>wC,__extends:()=>fC,__generator:()=>vC,__importDefault:()=>PC,__importStar:()=>TC,__makeTemplateObject:()=>$C,__metadata:()=>yC,__param:()=>gC,__read:()=>_C,__rest:()=>dC,__spread:()=>SC,__spreadArrays:()=>RC,__values:()=>EC});var fg,fC,pC,dC,mC,gC,yC,bC,vC,wC,xC,EC,_C,SC,RC,CC,AC,LC,OC,$C,TC,PC,IC,FC,dg=Dy(()=>{fg=We(hg(),1),{__extends:fC,__assign:pC,__rest:dC,__decorate:mC,__param:gC,__metadata:yC,__awaiter:bC,__generator:vC,__exportStar:wC,__createBinding:xC,__values:EC,__read:_C,__spread:SC,__spreadArrays:RC,__await:CC,__asyncGenerator:AC,__asyncDelegator:LC,__asyncValues:OC,__makeTemplateObject:$C,__importStar:TC,__importDefault:PC,__classPrivateFieldGet:IC,__classPrivateFieldSet:FC}=fg.default});var bg=j((G2,yg)=>{"use strict";var Yc=Object.defineProperty,NC=Object.getOwnPropertyDescriptor,DC=Object.getOwnPropertyNames,MC=Object.prototype.hasOwnProperty,kC=(t,e)=>{for(var r in e)Yc(t,r,{get:e[r],enumerable:!0})},jC=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of DC(e))!MC.call(t,s)&&s!==r&&Yc(t,s,{get:()=>e[s],enumerable:!(i=NC(e,s))||i.enumerable});return t},BC=t=>jC(Yc({},"__esModule",{value:!0}),t),mg={};kC(mg,{defaultDeserialize:()=>GC,defaultSerialize:()=>UC});yg.exports=BC(mg);var gg=D("buffer"),jn=(t,e=!0)=>{if(t==null)return"null";if(typeof t=="string")return JSON.stringify(e&&t.startsWith(":")?`:${t}`:t);if(gg.Buffer.isBuffer(t))return JSON.stringify(`:base64:${t.toString("base64")}`);if(t?.toJSON&&(t=t.toJSON()),typeof t=="object"){let r="",i=Array.isArray(t);r=i?"[":"{";let s=!0;for(let n in t){let a=typeof t[n]=="function"||!i&&t[n]===void 0;!Object.hasOwn(t,n)||a||(s||(r+=","),s=!1,i?r+=jn(t[n],e):t[n]!==void 0&&(r+=`${jn(n,!1)}:${jn(t[n],e)}`))}return r+=i?"]":"}",r}return JSON.stringify(t)},UC=t=>jn(t,!0),GC=t=>JSON.parse(t,(e,r)=>typeof r=="string"?r.startsWith(":base64:")?gg.Buffer.from(r.slice(8),"base64"):r.startsWith(":")?r.slice(1):r:r)});var vg=j(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.Field=void 0;ps.makeField=zC;var Bn=class{kv;key;defaults;constructor(e,r,i){this.kv=e,this.key=r,this.defaults=i}async get(e=this.defaults){return await this.kv.get(this.key)??e}getSync(e=this.defaults){if("getSync"in this.kv)return this.kv.getSync(this.key)??e;throw new Error("kv does not support getSync")}set(e,r){return this.kv.set(this.key,e,r)}delete(){return this.kv.delete(this.key)}};ps.Field=Bn;function zC(t,e,r){return new Bn(t,e,r)}});var _g=j(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.KeyvFile=Nt.defaultOpts=void 0;var mi=(dg(),My(pg)),qC=mi.__importStar(D("os")),Un=mi.__importStar(D("fs")),wg=mi.__importStar(D("fs/promises")),WC=mi.__importDefault(D("events")),xg=bg(),VC=mi.__importDefault(D("path"));mi.__exportStar(vg(),Nt);Nt.defaultOpts={deserialize:xg.defaultDeserialize,dialect:"redis",expiredCheckDelay:24*3600*1e3,filename:`${qC.tmpdir()}/keyv-file/default.json`,serialize:xg.defaultSerialize,writeDelay:100,checkFileLock:!1};function Eg(t){return typeof t=="number"}var Gn=class extends WC.default{ttlSupport=!0;namespace;opts;_data;_lastExpire;constructor(e){super(),this.opts=Object.assign({},Nt.defaultOpts,e),this.opts.checkFileLock&&this.acquireFileLock();try{let r=this.opts.deserialize(Un.readFileSync(this.opts.filename,"utf8"));if(!Array.isArray(r.cache)){let i=r.cache;r.cache=[];for(let s in i)i.hasOwnProperty(s)&&r.cache.push([s,i[s]])}this._data=new Map(r.cache),this._lastExpire=r.lastExpire}catch{this._data=new Map,this._lastExpire=Date.now()}}get _lockFile(){return this.opts.filename+".lock"}acquireFileLock(){try{let e=Un.openSync(this._lockFile,"wx");Un.closeSync(e),process.on("SIGINT",()=>{this.releaseFileLock(),process.exit(0)}),process.on("exit",()=>{this.releaseFileLock()})}catch(e){throw console.error("[keyv-file] There is another process using this file"),e}}releaseFileLock(){try{Un.unlinkSync(this._lockFile)}catch{}}async get(e){return this.getSync(e)}getSync(e){try{let r=this._data.get(e);if(r)if(this.isExpired(r)){this.delete(e);return}else return r.value;else return}catch{}}async getMany(e){return e.map(r=>this.getSync(r))}async set(e,r,i){return i===0&&(i=void 0),this._data.set(e,{expire:Eg(i)?Date.now()+i:void 0,value:r}),this.save()}async delete(e){let r=this._data.delete(e);return await this.save(),r}async deleteMany(e){let r=e.every(i=>this._data.delete(i));return await this.save(),r}async clear(){return this._data=new Map,this._lastExpire=Date.now(),this.save()}async has(e){return await this.get(e)!==void 0}isExpired(e){return Eg(e.expire)&&e.expire<=Date.now()}clearExpire(){let e=Date.now();if(!(e-this._lastExpire<=this.opts.expiredCheckDelay)){for(let r of this._data.keys()){let i=this._data.get(r);this.isExpired(i)&&this._data.delete(r)}this._lastExpire=e}}async saveToDisk(){let e=[];for(let[i,s]of this._data)e.push([i,s]);let r=this.opts.serialize({cache:e,lastExpire:this._lastExpire});return await wg.mkdir(VC.default.dirname(this.opts.filename),{recursive:!0}),wg.writeFile(this.opts.filename,r)}_savePromise;save(){return this.clearExpire(),this._savePromise?this._savePromise:(this._savePromise=new Promise((e,r)=>{setTimeout(()=>{this.saveToDisk().then(e,r).finally(()=>{this._savePromise=void 0})},this.opts.writeDelay)}),this._savePromise)}disconnect(){return Promise.resolve()}async*iterator(e){for(let[r,i]of this._data.entries())r!==void 0&&(!e||r.includes(e))&&(yield[r,i.value])}};Nt.KeyvFile=Gn;Nt.default=Gn});var Xc=j((Q2,Re)=>{var{createRequire:YC}=D("node:module");D=YC(__filename);var{readFileSync:XC}=D("node:fs"),ye=null,X=[],qn=()=>{let t=!1;return process.platform==="linux"&&(t=ZC(),t===null&&(t=QC()),t===null&&(t=eA())),t},JC=t=>t.includes("libc.musl-")||t.includes("ld-musl-"),ZC=()=>{try{return XC("/usr/bin/ldd","utf-8").includes("musl")}catch{return null}},QC=()=>{let t=null;return typeof process.report?.getReport=="function"&&(process.report.excludeNetwork=!0,t=process.report.getReport()),t?t.header&&t.header.glibcVersionRuntime?!1:!!(Array.isArray(t.sharedObjects)&&t.sharedObjects.some(JC)):null},eA=()=>{try{return D("child_process").execSync("ldd --version",{encoding:"utf8"}).includes("musl")}catch{return!1}};function tA(){if(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)try{ye=D(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)}catch(t){X.push(t)}else if(process.platform==="android")if(process.arch==="arm64"){try{return D("./ast-grep-napi.android-arm64.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-android-arm64")}catch(t){X.push(t)}}else if(process.arch==="arm"){try{return D("./ast-grep-napi.android-arm-eabi.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-android-arm-eabi")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on Android ${process.arch}`));else if(process.platform==="win32")if(process.arch==="x64"){try{return D("./ast-grep-napi.win32-x64-msvc.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-win32-x64-msvc")}catch(t){X.push(t)}}else if(process.arch==="ia32"){try{return D("./ast-grep-napi.win32-ia32-msvc.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-win32-ia32-msvc")}catch(t){X.push(t)}}else if(process.arch==="arm64"){try{return D("./ast-grep-napi.win32-arm64-msvc.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-win32-arm64-msvc")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));else if(process.platform==="darwin"){try{return D("./ast-grep-napi.darwin-universal.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-darwin-universal")}catch(t){X.push(t)}if(process.arch==="x64"){try{return D("./ast-grep-napi.darwin-x64.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-darwin-x64")}catch(t){X.push(t)}}else if(process.arch==="arm64"){try{return D("./ast-grep-napi.darwin-arm64.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-darwin-arm64")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))}else if(process.platform==="freebsd")if(process.arch==="x64"){try{return D("./ast-grep-napi.freebsd-x64.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-freebsd-x64")}catch(t){X.push(t)}}else if(process.arch==="arm64"){try{return D("./ast-grep-napi.freebsd-arm64.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-freebsd-arm64")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));else if(process.platform==="linux")if(process.arch==="x64")if(qn()){try{return D("./ast-grep-napi.linux-x64-musl.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-x64-musl")}catch(t){X.push(t)}}else{try{return D("./ast-grep-napi.linux-x64-gnu.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-x64-gnu")}catch(t){X.push(t)}}else if(process.arch==="arm64")if(qn()){try{return D("./ast-grep-napi.linux-arm64-musl.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm64-musl")}catch(t){X.push(t)}}else{try{return D("./ast-grep-napi.linux-arm64-gnu.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm64-gnu")}catch(t){X.push(t)}}else if(process.arch==="arm")if(qn()){try{return D("./ast-grep-napi.linux-arm-musleabihf.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm-musleabihf")}catch(t){X.push(t)}}else{try{return D("./ast-grep-napi.linux-arm-gnueabihf.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm-gnueabihf")}catch(t){X.push(t)}}else if(process.arch==="riscv64")if(qn()){try{return D("./ast-grep-napi.linux-riscv64-musl.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-riscv64-musl")}catch(t){X.push(t)}}else{try{return D("./ast-grep-napi.linux-riscv64-gnu.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-riscv64-gnu")}catch(t){X.push(t)}}else if(process.arch==="ppc64"){try{return D("./ast-grep-napi.linux-ppc64-gnu.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-ppc64-gnu")}catch(t){X.push(t)}}else if(process.arch==="s390x"){try{return D("./ast-grep-napi.linux-s390x-gnu.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-s390x-gnu")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));else if(process.platform==="openharmony")if(process.arch==="arm64"){try{return D("./ast-grep-napi.linux-arm64-ohos.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm64-ohos")}catch(t){X.push(t)}}else if(process.arch==="x64"){try{return D("./ast-grep-napi.linux-x64-ohos.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-x64-ohos")}catch(t){X.push(t)}}else if(process.arch==="arm"){try{return D("./ast-grep-napi.linux-arm-ohos.node")}catch(t){X.push(t)}try{return D("@ast-grep/napi-linux-arm-ohos")}catch(t){X.push(t)}}else X.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));else X.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))}ye=tA();if(!ye||process.env.NAPI_RS_FORCE_WASI){try{ye=D("./ast-grep-napi.wasi.cjs")}catch(t){process.env.NAPI_RS_FORCE_WASI&&X.push(t)}if(!ye)try{ye=D("@ast-grep/napi-wasm32-wasi")}catch(t){process.env.NAPI_RS_FORCE_WASI&&X.push(t)}}if(!ye)throw X.length>0?new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.",{cause:X}):new Error("Failed to load native binding");Re.exports=ye;Re.exports.SgNode=ye.SgNode;Re.exports.SgRoot=ye.SgRoot;Re.exports.findInFiles=ye.findInFiles;Re.exports.kind=ye.kind;Re.exports.Lang=ye.Lang;Re.exports.parse=ye.parse;Re.exports.parseAsync=ye.parseAsync;Re.exports.parseFiles=ye.parseFiles;Re.exports.pattern=ye.pattern;Re.exports.registerDynamicLanguage=ye.registerDynamicLanguage;Re.exports.css=ye.css;Re.exports.html=ye.html;Re.exports.js=ye.js;Re.exports.jsx=ye.jsx;Re.exports.ts=ye.ts;Re.exports.tsx=ye.tsx});var Pg=j((nF,Tg)=>{"use strict";Tg.exports=Og;function Og(t,e,r){t instanceof RegExp&&(t=Lg(t,r)),e instanceof RegExp&&(e=Lg(e,r));var i=$g(t,e,r);return i&&{start:i[0],end:i[1],pre:r.slice(0,i[0]),body:r.slice(i[0]+t.length,i[1]),post:r.slice(i[1]+e.length)}}function Lg(t,e){var r=e.match(t);return r?r[0]:null}Og.range=$g;function $g(t,e,r){var i,s,n,a,o,c=r.indexOf(t),l=r.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(t===e)return[c,l];for(i=[],n=r.length;u>=0&&!o;)u==c?(i.push(u),c=r.indexOf(t,u+1)):i.length==1?o=[i.pop(),l]:(s=i.pop(),s<n&&(n=s,a=l),l=r.indexOf(e,u+1)),u=c<l&&c>=0?c:l;i.length&&(o=[n,a])}return o}});var Bg=j((oF,jg)=>{var Ig=Pg();jg.exports=kA;var Fg="\0SLASH"+Math.random()+"\0",Ng="\0OPEN"+Math.random()+"\0",Qc="\0CLOSE"+Math.random()+"\0",Dg="\0COMMA"+Math.random()+"\0",Mg="\0PERIOD"+Math.random()+"\0";function Zc(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function DA(t){return t.split("\\\\").join(Fg).split("\\{").join(Ng).split("\\}").join(Qc).split("\\,").join(Dg).split("\\.").join(Mg)}function MA(t){return t.split(Fg).join("\\").split(Ng).join("{").split(Qc).join("}").split(Dg).join(",").split(Mg).join(".")}function kg(t){if(!t)return[""];var e=[],r=Ig("{","}",t);if(!r)return t.split(",");var i=r.pre,s=r.body,n=r.post,a=i.split(",");a[a.length-1]+="{"+s+"}";var o=kg(n);return n.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),e.push.apply(e,a),e}function kA(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),ms(DA(t),!0).map(MA)):[]}function jA(t){return"{"+t+"}"}function BA(t){return/^-?0\d/.test(t)}function UA(t,e){return t<=e}function GA(t,e){return t>=e}function ms(t,e){var r=[],i=Ig("{","}",t);if(!i)return[t];var s=i.pre,n=i.post.length?ms(i.post,!1):[""];if(/\$$/.test(i.pre))for(var a=0;a<n.length;a++){var o=s+"{"+i.body+"}"+n[a];r.push(o)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),u=c||l,d=i.body.indexOf(",")>=0;if(!u&&!d)return i.post.match(/,.*\}/)?(t=i.pre+"{"+i.body+Qc+i.post,ms(t)):[t];var g;if(u)g=i.body.split(/\.\./);else if(g=kg(i.body),g.length===1&&(g=ms(g[0],!1).map(jA),g.length===1))return n.map(function($){return i.pre+g[0]+$});var h;if(u){var p=Zc(g[0]),m=Zc(g[1]),y=Math.max(g[0].length,g[1].length),b=g.length==3?Math.abs(Zc(g[2])):1,w=UA,x=m<p;x&&(b*=-1,w=GA);var f=g.some(BA);h=[];for(var v=p;w(v,m);v+=b){var E;if(l)E=String.fromCharCode(v),E==="\\"&&(E="");else if(E=String(v),f){var _=y-E.length;if(_>0){var O=new Array(_+1).join("0");v<0?E="-"+O+E.slice(1):E=O+E}}h.push(E)}}else{h=[];for(var C=0;C<g.length;C++)h.push.apply(h,ms(g[C],!1))}for(var C=0;C<h.length;C++)for(var a=0;a<n.length;a++){var o=s+h[C]+n[a];(!e||u||o)&&r.push(o)}}return r}});var po=j((dN,fo)=>{function L0(t){return Array.isArray(t)?t:[t]}var hO=void 0,wl="",C0=" ",vl="\\",fO=/^\s+$/,pO=/(?:[^\\]|^)\\$/,dO=/^\\!/,mO=/^\\#/,gO=/\r?\n/g,yO=/^\.{0,2}\/|^\.{1,2}$/,bO=/\/$/,Ai="/",O0="node-ignore";typeof Symbol<"u"&&(O0=Symbol.for("node-ignore"));var $0=O0,Li=(t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),vO=/([0-z])-([0-z])/g,T0=()=>!1,wO=t=>t.replace(vO,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:wl),xO=t=>{let{length:e}=t;return t.slice(0,e-e%2)},EO=[[/^\uFEFF/,()=>wl],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?C0:wl)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+C0}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let i=r.replace(/\\\*/g,"[^\\/]*");return e+i}],[/\\\\\\(?=[$.|*+(){^])/g,()=>vl],[/\\\\/g,()=>vl],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,s)=>e===vl?`\\[${r}${xO(i)}${s}`:s==="]"&&i.length%2===0?`[${wO(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],_O=/(^|\\\/)?\\\*$/,Ts="regex",uo="checkRegex",A0="_",SO={[Ts](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[uo](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},RO=t=>EO.reduce((e,[r,i])=>e.replace(r,i.bind(t)),t),ho=t=>typeof t=="string",CO=t=>t&&ho(t)&&!fO.test(t)&&!pO.test(t)&&t.indexOf("#")!==0,AO=t=>t.split(gO).filter(Boolean),xl=class{constructor(e,r,i,s,n,a){this.pattern=e,this.mark=r,this.negative=n,Li(this,"body",i),Li(this,"ignoreCase",s),Li(this,"regexPrefix",a)}get regex(){let e=A0+Ts;return this[e]?this[e]:this._make(Ts,e)}get checkRegex(){let e=A0+uo;return this[e]?this[e]:this._make(uo,e)}_make(e,r){let i=this.regexPrefix.replace(_O,SO[e]),s=this.ignoreCase?new RegExp(i,"i"):new RegExp(i);return Li(this,r,s)}},LO=({pattern:t,mark:e},r)=>{let i=!1,s=t;s.indexOf("!")===0&&(i=!0,s=s.substr(1)),s=s.replace(dO,"!").replace(mO,"#");let n=RO(s);return new xl(t,e,s,r,i,n)},El=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[$0]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(ho(e)&&(e={pattern:e}),CO(e.pattern)){let r=LO(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,L0(ho(e)?AO(e):e).forEach(this._add,this),this._added}test(e,r,i){let s=!1,n=!1,a;this._rules.forEach(c=>{let{negative:l}=c;n===l&&s!==n||l&&!s&&!n&&!r||!c[i].test(e)||(s=!l,n=l,a=l?hO:c)});let o={ignored:s,unignored:n};return a&&(o.rule=a),o}},OO=(t,e)=>{throw new e(t)},kt=(t,e,r)=>ho(t)?t?kt.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),P0=t=>yO.test(t);kt.isNotRelative=P0;kt.convert=t=>t;var _l=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:i=!1}={}){Li(this,$0,!0),this._rules=new El(r),this._strictPathCheck=!i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,r,i,s){let n=e&&kt.convert(e);return kt(n,e,this._strictPathCheck?OO:T0),this._t(n,r,i,s)}checkIgnore(e){if(!bO.test(e))return this.test(e);let r=e.split(Ai).filter(Boolean);if(r.pop(),r.length){let i=this._t(r.join(Ai)+Ai,this._testCache,!0,r);if(i.ignored)return i}return this._rules.test(e,!1,uo)}_t(e,r,i,s){if(e in r)return r[e];if(s||(s=e.split(Ai).filter(Boolean)),s.pop(),!s.length)return r[e]=this._rules.test(e,i,Ts);let n=this._t(s.join(Ai)+Ai,r,i,s);return r[e]=n.ignored?n:this._rules.test(e,i,Ts)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return L0(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},Sl=t=>new _l(t),$O=t=>kt(t&&kt.convert(t),t,T0),I0=()=>{let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");kt.convert=t;let e=/^[a-z]:\//i;kt.isNotRelative=r=>e.test(r)||P0(r)};typeof process<"u"&&process.platform==="win32"&&I0();fo.exports=Sl;Sl.default=Sl;fo.exports.isPathValid=$O;Li(fo.exports,Symbol.for("setupWindows"),I0)});import*as Br from"fs/promises";import*as wy from"os";import*as ko from"path";var ky=20,jy=1,rr=1e6,Kl=1e6,By=-7,Uy=21,Gy=!1,Mi="[big.js] ",ir=Mi+"Invalid ",Ws=ir+"decimal places",zy=ir+"rounding mode",Yl=Mi+"Division by zero",ue={},bt=void 0,qy=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function Xl(){function t(e){var r=this;if(!(r instanceof t))return e===bt&&arguments.length===0?Xl():new t(e);if(e instanceof t)r.s=e.s,r.e=e.e,r.c=e.c.slice();else{if(typeof e!="string"){if(t.strict===!0&&typeof e!="bigint")throw TypeError(ir+"value");e=e===0&&1/e<0?"-0":String(e)}Wy(r,e)}r.constructor=t}return t.prototype=ue,t.DP=ky,t.RM=jy,t.NE=By,t.PE=Uy,t.strict=Gy,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}function Wy(t,e){var r,i,s;if(!qy.test(e))throw Error(ir+"number");for(t.s=e.charAt(0)=="-"?(e=e.slice(1),-1):1,(r=e.indexOf("."))>-1&&(e=e.replace(".","")),(i=e.search(/e/i))>0?(r<0&&(r=i),r+=+e.slice(i+1),e=e.substring(0,i)):r<0&&(r=e.length),s=e.length,i=0;i<s&&e.charAt(i)=="0";)++i;if(i==s)t.c=[t.e=0];else{for(;s>0&&e.charAt(--s)=="0";);for(t.e=r-i-1,t.c=[],r=0;i<=s;)t.c[r++]=+e.charAt(i++)}return t}function sr(t,e,r,i){var s=t.c;if(r===bt&&(r=t.constructor.RM),r!==0&&r!==1&&r!==2&&r!==3)throw Error(zy);if(e<1)i=r===3&&(i||!!s[0])||e===0&&(r===1&&s[0]>=5||r===2&&(s[0]>5||s[0]===5&&(i||s[1]!==bt))),s.length=1,i?(t.e=t.e-e+1,s[0]=1):s[0]=t.e=0;else if(e<s.length){if(i=r===1&&s[e]>=5||r===2&&(s[e]>5||s[e]===5&&(i||s[e+1]!==bt||s[e-1]&1))||r===3&&(i||!!s[0]),s.length=e,i){for(;++s[--e]>9;)if(s[e]=0,e===0){++t.e,s.unshift(1);break}}for(e=s.length;!s[--e];)s.pop()}return t}function nr(t,e,r){var i=t.e,s=t.c.join(""),n=s.length;if(e)s=s.charAt(0)+(n>1?"."+s.slice(1):"")+(i<0?"e":"e+")+i;else if(i<0){for(;++i;)s="0"+s;s="0."+s}else if(i>0)if(++i>n)for(i-=n;i--;)s+="0";else i<n&&(s=s.slice(0,i)+"."+s.slice(i));else n>1&&(s=s.charAt(0)+"."+s.slice(1));return t.s<0&&r?"-"+s:s}ue.abs=function(){var t=new this.constructor(this);return t.s=1,t};ue.cmp=function(t){var e,r=this,i=r.c,s=(t=new r.constructor(t)).c,n=r.s,a=t.s,o=r.e,c=t.e;if(!i[0]||!s[0])return i[0]?n:s[0]?-a:0;if(n!=a)return n;if(e=n<0,o!=c)return o>c^e?1:-1;for(a=(o=i.length)<(c=s.length)?o:c,n=-1;++n<a;)if(i[n]!=s[n])return i[n]>s[n]^e?1:-1;return o==c?0:o>c^e?1:-1};ue.div=function(t){var e=this,r=e.constructor,i=e.c,s=(t=new r(t)).c,n=e.s==t.s?1:-1,a=r.DP;if(a!==~~a||a<0||a>rr)throw Error(Ws);if(!s[0])throw Error(Yl);if(!i[0])return t.s=n,t.c=[t.e=0],t;var o,c,l,u,d,g=s.slice(),h=o=s.length,p=i.length,m=i.slice(0,o),y=m.length,b=t,w=b.c=[],x=0,f=a+(b.e=e.e-t.e)+1;for(b.s=n,n=f<0?0:f,g.unshift(0);y++<o;)m.push(0);do{for(l=0;l<10;l++){if(o!=(y=m.length))u=o>y?1:-1;else for(d=-1,u=0;++d<o;)if(s[d]!=m[d]){u=s[d]>m[d]?1:-1;break}if(u<0){for(c=y==o?s:g;y;){if(m[--y]<c[y]){for(d=y;d&&!m[--d];)m[d]=9;--m[d],m[y]+=10}m[y]-=c[y]}for(;!m[0];)m.shift()}else break}w[x++]=u?l:++l,m[0]&&u?m[y]=i[h]||0:m=[i[h]]}while((h++<p||m[0]!==bt)&&n--);return!w[0]&&x!=1&&(w.shift(),b.e--,f--),x>f&&sr(b,f,r.RM,m[0]!==bt),b};ue.eq=function(t){return this.cmp(t)===0};ue.gt=function(t){return this.cmp(t)>0};ue.gte=function(t){return this.cmp(t)>-1};ue.lt=function(t){return this.cmp(t)<0};ue.lte=function(t){return this.cmp(t)<1};ue.minus=ue.sub=function(t){var e,r,i,s,n=this,a=n.constructor,o=n.s,c=(t=new a(t)).s;if(o!=c)return t.s=-c,n.plus(t);var l=n.c.slice(),u=n.e,d=t.c,g=t.e;if(!l[0]||!d[0])return d[0]?t.s=-c:l[0]?t=new a(n):t.s=1,t;if(o=u-g){for((s=o<0)?(o=-o,i=l):(g=u,i=d),i.reverse(),c=o;c--;)i.push(0);i.reverse()}else for(r=((s=l.length<d.length)?l:d).length,o=c=0;c<r;c++)if(l[c]!=d[c]){s=l[c]<d[c];break}if(s&&(i=l,l=d,d=i,t.s=-t.s),(c=(r=d.length)-(e=l.length))>0)for(;c--;)l[e++]=0;for(c=e;r>o;){if(l[--r]<d[r]){for(e=r;e&&!l[--e];)l[e]=9;--l[e],l[r]+=10}l[r]-=d[r]}for(;l[--c]===0;)l.pop();for(;l[0]===0;)l.shift(),--g;return l[0]||(t.s=1,l=[g=0]),t.c=l,t.e=g,t};ue.mod=function(t){var e,r=this,i=r.constructor,s=r.s,n=(t=new i(t)).s;if(!t.c[0])throw Error(Yl);return r.s=t.s=1,e=t.cmp(r)==1,r.s=s,t.s=n,e?new i(r):(s=i.DP,n=i.RM,i.DP=i.RM=0,r=r.div(t),i.DP=s,i.RM=n,this.minus(r.times(t)))};ue.neg=function(){var t=new this.constructor(this);return t.s=-t.s,t};ue.plus=ue.add=function(t){var e,r,i,s=this,n=s.constructor;if(t=new n(t),s.s!=t.s)return t.s=-t.s,s.minus(t);var a=s.e,o=s.c,c=t.e,l=t.c;if(!o[0]||!l[0])return l[0]||(o[0]?t=new n(s):t.s=s.s),t;if(o=o.slice(),e=a-c){for(e>0?(c=a,i=l):(e=-e,i=o),i.reverse();e--;)i.push(0);i.reverse()}for(o.length-l.length<0&&(i=l,l=o,o=i),e=l.length,r=0;e;o[e]%=10)r=(o[--e]=o[e]+l[e]+r)/10|0;for(r&&(o.unshift(r),++c),e=o.length;o[--e]===0;)o.pop();return t.c=o,t.e=c,t};ue.pow=function(t){var e=this,r=new e.constructor("1"),i=r,s=t<0;if(t!==~~t||t<-Kl||t>Kl)throw Error(ir+"exponent");for(s&&(t=-t);t&1&&(i=i.times(e)),t>>=1,!!t;)e=e.times(e);return s?r.div(i):i};ue.prec=function(t,e){if(t!==~~t||t<1||t>rr)throw Error(ir+"precision");return sr(new this.constructor(this),t,e)};ue.round=function(t,e){if(t===bt)t=0;else if(t!==~~t||t<-rr||t>rr)throw Error(Ws);return sr(new this.constructor(this),t+this.e+1,e)};ue.sqrt=function(){var t,e,r,i=this,s=i.constructor,n=i.s,a=i.e,o=new s("0.5");if(!i.c[0])return new s(i);if(n<0)throw Error(Mi+"No square root");n=Math.sqrt(+nr(i,!0,!0)),n===0||n===1/0?(e=i.c.join(""),e.length+a&1||(e+="0"),n=Math.sqrt(e),a=((a+1)/2|0)-(a<0||a&1),t=new s((n==1/0?"5e":(n=n.toExponential()).slice(0,n.indexOf("e")+1))+a)):t=new s(n+""),a=t.e+(s.DP+=4);do r=t,t=o.times(r.plus(i.div(r)));while(r.c.slice(0,a).join("")!==t.c.slice(0,a).join(""));return sr(t,(s.DP-=4)+t.e+1,s.RM)};ue.times=ue.mul=function(t){var e,r=this,i=r.constructor,s=r.c,n=(t=new i(t)).c,a=s.length,o=n.length,c=r.e,l=t.e;if(t.s=r.s==t.s?1:-1,!s[0]||!n[0])return t.c=[t.e=0],t;for(t.e=c+l,a<o&&(e=s,s=n,n=e,l=a,a=o,o=l),e=new Array(l=a+o);l--;)e[l]=0;for(c=o;c--;){for(o=0,l=a+c;l>c;)o=e[l]+n[c]*s[l-c-1]+o,e[l--]=o%10,o=o/10|0;e[l]=o}for(o?++t.e:e.shift(),c=e.length;!e[--c];)e.pop();return t.c=e,t};ue.toExponential=function(t,e){var r=this,i=r.c[0];if(t!==bt){if(t!==~~t||t<0||t>rr)throw Error(Ws);for(r=sr(new r.constructor(r),++t,e);r.c.length<t;)r.c.push(0)}return nr(r,!0,!!i)};ue.toFixed=function(t,e){var r=this,i=r.c[0];if(t!==bt){if(t!==~~t||t<0||t>rr)throw Error(Ws);for(r=sr(new r.constructor(r),t+r.e+1,e),t=t+r.e+1;r.c.length<t;)r.c.push(0)}return nr(r,!1,!!i)};ue.toJSON=ue.toString=function(){var t=this,e=t.constructor;return nr(t,t.e<=e.NE||t.e>=e.PE,!!t.c[0])};typeof Symbol<"u"&&(ue[Symbol.for("nodejs.util.inspect.custom")]=ue.toJSON);ue.toNumber=function(){var t=+nr(this,!0,!0);if(this.constructor.strict===!0&&!this.eq(t.toString()))throw Error(Mi+"Imprecise conversion");return t};ue.toPrecision=function(t,e){var r=this,i=r.constructor,s=r.c[0];if(t!==bt){if(t!==~~t||t<1||t>rr)throw Error(ir+"precision");for(r=sr(new i(r),t,e);r.c.length<t;)r.c.push(0)}return nr(r,t<=r.e||r.e<=i.NE||r.e>=i.PE,!!s)};ue.valueOf=function(){var t=this,e=t.constructor;if(e.strict===!0)throw Error(Mi+"valueOf disallowed");return nr(t,t.e<=e.NE||t.e>=e.PE,!0)};var Vy=Xl(),Ke=Vy;var Jl=(t=0)=>e=>`\x1B[${e+t}m`,Zl=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Ql=(t=0)=>(e,r,i)=>`\x1B[${38+t};2;${e};${r};${i}m`,me={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},j$=Object.keys(me.modifier),Hy=Object.keys(me.color),Ky=Object.keys(me.bgColor),B$=[...Hy,...Ky];function Yy(){let t=new Map;for(let[e,r]of Object.entries(me)){for(let[i,s]of Object.entries(r))me[i]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[i]=me[i],t.set(s[0],s[1]);Object.defineProperty(me,e,{value:r,enumerable:!1})}return Object.defineProperty(me,"codes",{value:t,enumerable:!1}),me.color.close="\x1B[39m",me.bgColor.close="\x1B[49m",me.color.ansi=Jl(),me.color.ansi256=Zl(),me.color.ansi16m=Ql(),me.bgColor.ansi=Jl(10),me.bgColor.ansi256=Zl(10),me.bgColor.ansi16m=Ql(10),Object.defineProperties(me,{rgbToAnsi256:{value(e,r,i){return e===r&&r===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[i]=r;i.length===3&&(i=[...i].map(n=>n+n).join(""));let s=Number.parseInt(i,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>me.rgbToAnsi256(...me.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,i,s;if(e>=232)r=((e-232)*10+8)/255,i=r,s=r;else{e-=16;let o=e%36;r=Math.floor(e/36)/5,i=Math.floor(o/6)/5,s=o%6/5}let n=Math.max(r,i,s)*2;if(n===0)return 30;let a=30+(Math.round(s)<<2|Math.round(i)<<1|Math.round(r));return n===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,r,i)=>me.ansi256ToAnsi(me.rgbToAnsi256(e,r,i)),enumerable:!1},hexToAnsi:{value:e=>me.ansi256ToAnsi(me.hexToAnsi256(e)),enumerable:!1}}),me}var Xy=Yy(),ht=Xy;import Bo from"node:process";import Jy from"node:os";import eu from"node:tty";function Je(t,e=globalThis.Deno?globalThis.Deno.args:Bo.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(r+t),s=e.indexOf("--");return i!==-1&&(s===-1||i<s)}var{env:ge}=Bo,Vs;Je("no-color")||Je("no-colors")||Je("color=false")||Je("color=never")?Vs=0:(Je("color")||Je("colors")||Je("color=true")||Je("color=always"))&&(Vs=1);function Zy(){if("FORCE_COLOR"in ge)return ge.FORCE_COLOR==="true"?1:ge.FORCE_COLOR==="false"?0:ge.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(ge.FORCE_COLOR,10),3)}function Qy(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function eb(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let i=Zy();i!==void 0&&(Vs=i);let s=r?Vs:i;if(s===0)return 0;if(r){if(Je("color=16m")||Je("color=full")||Je("color=truecolor"))return 3;if(Je("color=256"))return 2}if("TF_BUILD"in ge&&"AGENT_NAME"in ge)return 1;if(t&&!e&&s===void 0)return 0;let n=s||0;if(ge.TERM==="dumb")return n;if(Bo.platform==="win32"){let a=Jy.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in ge)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(a=>a in ge)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in ge)||ge.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in ge)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ge.TEAMCITY_VERSION)?1:0;if(ge.COLORTERM==="truecolor"||ge.TERM==="xterm-kitty"||ge.TERM==="xterm-ghostty"||ge.TERM==="wezterm")return 3;if("TERM_PROGRAM"in ge){let a=Number.parseInt((ge.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ge.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ge.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(ge.TERM)||"COLORTERM"in ge?1:n}function tu(t,e={}){let r=eb(t,{streamIsTTY:t&&t.isTTY,...e});return Qy(r)}var tb={stdout:tu({isTTY:eu.isatty(1)}),stderr:tu({isTTY:eu.isatty(2)})},ru=tb;function iu(t,e,r){let i=t.indexOf(e);if(i===-1)return t;let s=e.length,n=0,a="";do a+=t.slice(n,i)+e+r,n=i+s,i=t.indexOf(e,n);while(i!==-1);return a+=t.slice(n),a}function su(t,e,r,i){let s=0,n="";do{let a=t[i-1]==="\r";n+=t.slice(s,a?i-1:i)+e+(a?`\r
|
|
15
|
+
`):s.split(",")}switch(t){case"hoist-pattern":case"public-hoist-pattern":return r(e)}return e}Fg.exports=Xl});var qg=B(zg=>{"use strict";var Ug=M("os"),nr=M("path"),Gg=Ug.tmpdir(),iO=process.getuid?process.getuid():process.pid,nO=()=>!0,jg=process.platform==="win32",Bg={editor:()=>process.env.EDITOR||process.env.VISUAL||(jg?"notepad.exe":"vi"),shell:()=>jg?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},oO={fromString:()=>process.umask()},ci=Ug.homedir();ci?process.env.HOME=ci:ci=nr.resolve(Gg,"npm-"+iO);var aO=process.platform==="win32"?"npm-cache":".npm",cO=process.platform==="win32"&&process.env.APPDATA||ci,lO=nr.resolve(cO,aO),zo,ls;Object.defineProperty(zg,"defaults",{get:function(){return zo||(process.env.PREFIX?ls=process.env.PREFIX:process.platform==="win32"?ls=nr.dirname(process.execPath):(ls=nr.dirname(nr.dirname(process.execPath)),process.env.DESTDIR&&(ls=nr.join(process.env.DESTDIR,ls))),zo={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:lO,"cache-lock-stale":6e4,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:Bg.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:nr.resolve(ls,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":nr.resolve(ci,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:ls,production:process.env.NODE_ENV==="production",progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:900,"send-metrics":!1,shell:Bg.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:Gg,unicode:nO(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:nr.resolve(ci,".npmrc"),umask:process.umask?process.umask():oO.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},zo)}})});var Vg=B((QD,Ql)=>{"use strict";var us=M("path"),uO=Mg(),Wg=qg();Ql.exports=(t,e,r)=>{let s=new uO(Object.assign({},Wg.defaults,r),e);s.add(Object.assign({},t),"cli");let i=[],n=!1;if(M.resolve.paths){let l=M.resolve.paths("npm"),u;try{u=M.resolve("npm",{paths:l.slice(-1)})}catch{n=!0}u&&i.push(s.addFile(us.resolve(us.dirname(u),"..","npmrc"),"builtin"))}s.addEnv(),s.loadPrefix();let a=us.resolve(s.localPrefix,".npmrc"),o=s.get("userconfig");if(!s.get("global")&&a!==o?i.push(s.addFile(a,"project")):s.add({},"project"),s.get("workspace-prefix")&&s.get("workspace-prefix")!==a){let l=us.resolve(s.get("workspace-prefix"),".npmrc");i.push(s.addFile(l,"workspace"))}if(i.push(s.addFile(s.get("userconfig"),"user")),s.get("prefix")){let l=us.resolve(s.get("prefix"),"etc");s.root.globalconfig=us.resolve(l,"npmrc"),s.root.globalignorefile=us.resolve(l,"npmignore")}i.push(s.addFile(s.get("globalconfig"),"global")),s.loadUser();let c=s.get("cafile");return c&&s.loadCAFile(c),{config:s,warnings:i.filter(Boolean),failedToLoadBuiltInConfig:n}};Object.defineProperty(Ql.exports,"defaults",{get(){return Wg.defaults},enumerable:!0})});var ey=B((tF,Qg)=>{var Zg=Vg(),Hg=":_authToken",Kg=":_auth",Yg=":username",Jg=":_password";Qg.exports=function(){let e,r;arguments.length>=2?(e=arguments[0],r=Object.assign({},arguments[1])):typeof arguments[0]=="string"?e=arguments[0]:r=Object.assign({},arguments[0]),r=r||{};let s=r.npmrc;return r.npmrc=(r.npmrc?{config:{get:i=>s[i]}}:Zg()).config,e=e||r.npmrc.get("registry")||Zg.defaults.registry,Xg(e,r)||hO(r.npmrc)};function fO(t,e){let r=new URL(e,new URL(t.startsWith("//")?`./${t}`:t,"resolve://"));if(r.protocol==="resolve:"){let{pathname:s,search:i,hash:n}=r;return s+i+n}return r.toString()}function Xg(t,e){let r=t instanceof URL?t:new URL(t.startsWith("//")?`http:${t}`:t),s;for(;s!=="/"&&r.pathname!==s;){s=r.pathname||"/";let i="//"+r.host+s.replace(/\/$/,""),n=pO(i,e.npmrc);if(n)return n;if(!e.recursive)return/\/$/.test(t)?void 0:Xg(new URL("./",r),e);r.pathname=fO(dO(s),"..")||"/"}}function hO(t){return t.get("_auth")?{token:qo(t.get("_auth")),type:"Basic"}:void 0}function dO(t){return t[t.length-1]==="/"?t:t+"/"}function pO(t,e){let r=mO(e.get(t+Hg)||e.get(t+"/"+Hg));if(r)return r;let s=e.get(t+Yg)||e.get(t+"/"+Yg),i=e.get(t+Jg)||e.get(t+"/"+Jg),n=gO(s,i);if(n)return n;let a=yO(e.get(t+Kg)||e.get(t+"/"+Kg));if(a)return a}function qo(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function mO(t){return t?{token:qo(t),type:"Bearer"}:void 0}function gO(t,e){if(!t||!e)return;let r=Buffer.from(qo(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function yO(t){return t?{token:qo(t),type:"Basic"}:void 0}});var Dy=B((IF,Ko)=>{var gy,yy,vy,by,_y,wy,xy,Ey,Sy,Ho,fu,Ry,Ay,ui,Cy,Oy,Ty,Ly,$y,Py,Iy,ky,Ny;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(s){t(r(e,r(s)))}):typeof Ko=="object"&&typeof Ko.exports=="object"?t(r(e,r(Ko.exports))):t(r(e));function r(s,i){return s!==e&&(typeof Object.create=="function"?Object.defineProperty(s,"__esModule",{value:!0}):s.__esModule=!0),function(n,a){return s[n]=i?i(n,a):a}}})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)s.hasOwnProperty(i)&&(r[i]=s[i])};gy=function(r,s){e(r,s);function i(){this.constructor=r}r.prototype=s===null?Object.create(s):(i.prototype=s.prototype,new i)},yy=Object.assign||function(r){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(r[a]=s[a])}return r},vy=function(r,s){var i={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&s.indexOf(n)<0&&(i[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(r);a<n.length;a++)s.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(r,n[a])&&(i[n[a]]=r[n[a]]);return i},by=function(r,s,i,n){var a=arguments.length,o=a<3?s:n===null?n=Object.getOwnPropertyDescriptor(s,i):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,s,i,n);else for(var l=r.length-1;l>=0;l--)(c=r[l])&&(o=(a<3?c(o):a>3?c(s,i,o):c(s,i))||o);return a>3&&o&&Object.defineProperty(s,i,o),o},_y=function(r,s){return function(i,n){s(i,n,r)}},wy=function(r,s){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,s)},xy=function(r,s,i,n){function a(o){return o instanceof i?o:new i(function(c){c(o)})}return new(i||(i=Promise))(function(o,c){function l(g){try{p(n.next(g))}catch(f){c(f)}}function u(g){try{p(n.throw(g))}catch(f){c(f)}}function p(g){g.done?o(g.value):a(g.value).then(l,u)}p((n=n.apply(r,s||[])).next())})},Ey=function(r,s){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,c;return c={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(p){return function(g){return u([p,g])}}function u(p){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,a&&(o=p[0]&2?a.return:p[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,p[1])).done)return o;switch(a=0,o&&(p=[p[0]&2,o.value]),p[0]){case 0:case 1:o=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,a=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(o=i.trys,!(o=o.length>0&&o[o.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!o||p[1]>o[0]&&p[1]<o[3])){i.label=p[1];break}if(p[0]===6&&i.label<o[1]){i.label=o[1],o=p;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(p);break}o[2]&&i.ops.pop(),i.trys.pop();continue}p=s.call(r,i)}catch(g){p=[6,g],a=0}finally{n=o=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},Ny=function(r,s,i,n){n===void 0&&(n=i),r[n]=s[i]},Sy=function(r,s){for(var i in r)i!=="default"&&!s.hasOwnProperty(i)&&(s[i]=r[i])},Ho=function(r){var s=typeof Symbol=="function"&&Symbol.iterator,i=s&&r[s],n=0;if(i)return i.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},fu=function(r,s){var i=typeof Symbol=="function"&&r[Symbol.iterator];if(!i)return r;var n=i.call(r),a,o=[],c;try{for(;(s===void 0||s-- >0)&&!(a=n.next()).done;)o.push(a.value)}catch(l){c={error:l}}finally{try{a&&!a.done&&(i=n.return)&&i.call(n)}finally{if(c)throw c.error}}return o},Ry=function(){for(var r=[],s=0;s<arguments.length;s++)r=r.concat(fu(arguments[s]));return r},Ay=function(){for(var r=0,s=0,i=arguments.length;s<i;s++)r+=arguments[s].length;for(var n=Array(r),a=0,s=0;s<i;s++)for(var o=arguments[s],c=0,l=o.length;c<l;c++,a++)n[a]=o[c];return n},ui=function(r){return this instanceof ui?(this.v=r,this):new ui(r)},Cy=function(r,s,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=i.apply(r,s||[]),a,o=[];return a={},c("next"),c("throw"),c("return"),a[Symbol.asyncIterator]=function(){return this},a;function c(d){n[d]&&(a[d]=function(m){return new Promise(function(y,v){o.push([d,m,y,v])>1||l(d,m)})})}function l(d,m){try{u(n[d](m))}catch(y){f(o[0][3],y)}}function u(d){d.value instanceof ui?Promise.resolve(d.value.v).then(p,g):f(o[0][2],d)}function p(d){l("next",d)}function g(d){l("throw",d)}function f(d,m){d(m),o.shift(),o.length&&l(o[0][0],o[0][1])}},Oy=function(r){var s,i;return s={},n("next"),n("throw",function(a){throw a}),n("return"),s[Symbol.iterator]=function(){return this},s;function n(a,o){s[a]=r[a]?function(c){return(i=!i)?{value:ui(r[a](c)),done:a==="return"}:o?o(c):c}:o}},Ty=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=r[Symbol.asyncIterator],i;return s?s.call(r):(r=typeof Ho=="function"?Ho(r):r[Symbol.iterator](),i={},n("next"),n("throw"),n("return"),i[Symbol.asyncIterator]=function(){return this},i);function n(o){i[o]=r[o]&&function(c){return new Promise(function(l,u){c=r[o](c),a(l,u,c.done,c.value)})}}function a(o,c,l,u){Promise.resolve(u).then(function(p){o({value:p,done:l})},c)}},Ly=function(r,s){return Object.defineProperty?Object.defineProperty(r,"raw",{value:s}):r.raw=s,r},$y=function(r){if(r&&r.__esModule)return r;var s={};if(r!=null)for(var i in r)Object.hasOwnProperty.call(r,i)&&(s[i]=r[i]);return s.default=r,s},Py=function(r){return r&&r.__esModule?r:{default:r}},Iy=function(r,s){if(!s.has(r))throw new TypeError("attempted to get private field on non-instance");return s.get(r)},ky=function(r,s,i){if(!s.has(r))throw new TypeError("attempted to set private field on non-instance");return s.set(r,i),i},t("__extends",gy),t("__assign",yy),t("__rest",vy),t("__decorate",by),t("__param",_y),t("__metadata",wy),t("__awaiter",xy),t("__generator",Ey),t("__exportStar",Sy),t("__createBinding",Ny),t("__values",Ho),t("__read",fu),t("__spread",Ry),t("__spreadArrays",Ay),t("__await",ui),t("__asyncGenerator",Cy),t("__asyncDelegator",Oy),t("__asyncValues",Ty),t("__makeTemplateObject",Ly),t("__importStar",$y),t("__importDefault",Py),t("__classPrivateFieldGet",Iy),t("__classPrivateFieldSet",ky)})});var My={};rc(My,{__assign:()=>BO,__asyncDelegator:()=>tT,__asyncGenerator:()=>eT,__asyncValues:()=>rT,__await:()=>QO,__awaiter:()=>WO,__classPrivateFieldGet:()=>oT,__classPrivateFieldSet:()=>aT,__createBinding:()=>HO,__decorate:()=>GO,__exportStar:()=>ZO,__extends:()=>jO,__generator:()=>VO,__importDefault:()=>nT,__importStar:()=>iT,__makeTemplateObject:()=>sT,__metadata:()=>qO,__param:()=>zO,__read:()=>YO,__rest:()=>UO,__spread:()=>JO,__spreadArrays:()=>XO,__values:()=>KO});var Fy,jO,BO,UO,GO,zO,qO,WO,VO,ZO,HO,KO,YO,JO,XO,QO,eT,tT,rT,sT,iT,nT,oT,aT,jy=l_(()=>{Fy=nt(Dy(),1),{__extends:jO,__assign:BO,__rest:UO,__decorate:GO,__param:zO,__metadata:qO,__awaiter:WO,__generator:VO,__exportStar:ZO,__createBinding:HO,__values:KO,__read:YO,__spread:JO,__spreadArrays:XO,__await:QO,__asyncGenerator:eT,__asyncDelegator:tT,__asyncValues:rT,__makeTemplateObject:sT,__importStar:iT,__importDefault:nT,__classPrivateFieldGet:oT,__classPrivateFieldSet:aT}=Fy.default});var zy=B((kF,Gy)=>{"use strict";var hu=Object.defineProperty,cT=Object.getOwnPropertyDescriptor,lT=Object.getOwnPropertyNames,uT=Object.prototype.hasOwnProperty,fT=(t,e)=>{for(var r in e)hu(t,r,{get:e[r],enumerable:!0})},hT=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of lT(e))!uT.call(t,i)&&i!==r&&hu(t,i,{get:()=>e[i],enumerable:!(s=cT(e,i))||s.enumerable});return t},dT=t=>hT(hu({},"__esModule",{value:!0}),t),By={};fT(By,{defaultDeserialize:()=>mT,defaultSerialize:()=>pT});Gy.exports=dT(By);var Uy=M("buffer"),Yo=(t,e=!0)=>{if(t==null)return"null";if(typeof t=="string")return JSON.stringify(e&&t.startsWith(":")?`:${t}`:t);if(Uy.Buffer.isBuffer(t))return JSON.stringify(`:base64:${t.toString("base64")}`);if(t?.toJSON&&(t=t.toJSON()),typeof t=="object"){let r="",s=Array.isArray(t);r=s?"[":"{";let i=!0;for(let n in t){let a=typeof t[n]=="function"||!s&&t[n]===void 0;!Object.hasOwn(t,n)||a||(i||(r+=","),i=!1,s?r+=Yo(t[n],e):t[n]!==void 0&&(r+=`${Yo(n,!1)}:${Yo(t[n],e)}`))}return r+=s?"]":"}",r}return JSON.stringify(t)},pT=t=>Yo(t,!0),mT=t=>JSON.parse(t,(e,r)=>typeof r=="string"?r.startsWith(":base64:")?Uy.Buffer.from(r.slice(8),"base64"):r.startsWith(":")?r.slice(1):r:r)});var qy=B(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.Field=void 0;yn.makeField=gT;var Jo=class{kv;key;defaults;constructor(e,r,s){this.kv=e,this.key=r,this.defaults=s}async get(e=this.defaults){return await this.kv.get(this.key)??e}getSync(e=this.defaults){if("getSync"in this.kv)return this.kv.getSync(this.key)??e;throw new Error("kv does not support getSync")}set(e,r){return this.kv.set(this.key,e,r)}delete(){return this.kv.delete(this.key)}};yn.Field=Jo;function gT(t,e,r){return new Jo(t,e,r)}});var Hy=B(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.KeyvFile=or.defaultOpts=void 0;var fi=(jy(),u_(My)),yT=fi.__importStar(M("os")),Xo=fi.__importStar(M("fs")),Wy=fi.__importStar(M("fs/promises")),vT=fi.__importDefault(M("events")),Vy=zy(),bT=fi.__importDefault(M("path"));fi.__exportStar(qy(),or);or.defaultOpts={deserialize:Vy.defaultDeserialize,dialect:"redis",expiredCheckDelay:24*3600*1e3,filename:`${yT.tmpdir()}/keyv-file/default.json`,serialize:Vy.defaultSerialize,writeDelay:100,checkFileLock:!1};function Zy(t){return typeof t=="number"}var Qo=class extends vT.default{ttlSupport=!0;namespace;opts;_data;_lastExpire;constructor(e){super(),this.opts=Object.assign({},or.defaultOpts,e),this.opts.checkFileLock&&this.acquireFileLock();try{let r=this.opts.deserialize(Xo.readFileSync(this.opts.filename,"utf8"));if(!Array.isArray(r.cache)){let s=r.cache;r.cache=[];for(let i in s)s.hasOwnProperty(i)&&r.cache.push([i,s[i]])}this._data=new Map(r.cache),this._lastExpire=r.lastExpire}catch{this._data=new Map,this._lastExpire=Date.now()}}get _lockFile(){return this.opts.filename+".lock"}acquireFileLock(){try{let e=Xo.openSync(this._lockFile,"wx");Xo.closeSync(e),process.on("SIGINT",()=>{this.releaseFileLock(),process.exit(0)}),process.on("exit",()=>{this.releaseFileLock()})}catch(e){throw console.error("[keyv-file] There is another process using this file"),e}}releaseFileLock(){try{Xo.unlinkSync(this._lockFile)}catch{}}async get(e){return this.getSync(e)}getSync(e){try{let r=this._data.get(e);if(r)if(this.isExpired(r)){this.delete(e);return}else return r.value;else return}catch{}}async getMany(e){return e.map(r=>this.getSync(r))}async set(e,r,s){return s===0&&(s=void 0),this._data.set(e,{expire:Zy(s)?Date.now()+s:void 0,value:r}),this.save()}async delete(e){let r=this._data.delete(e);return await this.save(),r}async deleteMany(e){let r=e.every(s=>this._data.delete(s));return await this.save(),r}async clear(){return this._data=new Map,this._lastExpire=Date.now(),this.save()}async has(e){return await this.get(e)!==void 0}isExpired(e){return Zy(e.expire)&&e.expire<=Date.now()}clearExpire(){let e=Date.now();if(!(e-this._lastExpire<=this.opts.expiredCheckDelay)){for(let r of this._data.keys()){let s=this._data.get(r);this.isExpired(s)&&this._data.delete(r)}this._lastExpire=e}}async saveToDisk(){let e=[];for(let[s,i]of this._data)e.push([s,i]);let r=this.opts.serialize({cache:e,lastExpire:this._lastExpire});return await Wy.mkdir(bT.default.dirname(this.opts.filename),{recursive:!0}),Wy.writeFile(this.opts.filename,r)}_savePromise;save(){return this.clearExpire(),this._savePromise?this._savePromise:(this._savePromise=new Promise((e,r)=>{setTimeout(()=>{this.saveToDisk().then(e,r).finally(()=>{this._savePromise=void 0})},this.opts.writeDelay)}),this._savePromise)}disconnect(){return Promise.resolve()}async*iterator(e){for(let[r,s]of this._data.entries())r!==void 0&&(!e||r.includes(e))&&(yield[r,s.value])}};or.KeyvFile=Qo;or.default=Qo});var du=B((WF,De)=>{var{createRequire:xT}=M("node:module");M=xT(__filename);var{readFileSync:ET}=M("node:fs"),Oe=null,te=[],ta=()=>{let t=!1;return process.platform==="linux"&&(t=RT(),t===null&&(t=AT()),t===null&&(t=CT())),t},ST=t=>t.includes("libc.musl-")||t.includes("ld-musl-"),RT=()=>{try{return ET("/usr/bin/ldd","utf-8").includes("musl")}catch{return null}},AT=()=>{let t=null;return typeof process.report?.getReport=="function"&&(process.report.excludeNetwork=!0,t=process.report.getReport()),t?t.header&&t.header.glibcVersionRuntime?!1:!!(Array.isArray(t.sharedObjects)&&t.sharedObjects.some(ST)):null},CT=()=>{try{return M("child_process").execSync("ldd --version",{encoding:"utf8"}).includes("musl")}catch{return!1}};function OT(){if(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)try{Oe=M(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)}catch(t){te.push(t)}else if(process.platform==="android")if(process.arch==="arm64"){try{return M("./ast-grep-napi.android-arm64.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-android-arm64")}catch(t){te.push(t)}}else if(process.arch==="arm"){try{return M("./ast-grep-napi.android-arm-eabi.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-android-arm-eabi")}catch(t){te.push(t)}}else te.push(new Error(`Unsupported architecture on Android ${process.arch}`));else if(process.platform==="win32")if(process.arch==="x64"){try{return M("./ast-grep-napi.win32-x64-msvc.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-win32-x64-msvc")}catch(t){te.push(t)}}else if(process.arch==="ia32"){try{return M("./ast-grep-napi.win32-ia32-msvc.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-win32-ia32-msvc")}catch(t){te.push(t)}}else if(process.arch==="arm64"){try{return M("./ast-grep-napi.win32-arm64-msvc.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-win32-arm64-msvc")}catch(t){te.push(t)}}else te.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));else if(process.platform==="darwin"){try{return M("./ast-grep-napi.darwin-universal.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-darwin-universal")}catch(t){te.push(t)}if(process.arch==="x64"){try{return M("./ast-grep-napi.darwin-x64.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-darwin-x64")}catch(t){te.push(t)}}else if(process.arch==="arm64"){try{return M("./ast-grep-napi.darwin-arm64.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-darwin-arm64")}catch(t){te.push(t)}}else te.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))}else if(process.platform==="freebsd")if(process.arch==="x64"){try{return M("./ast-grep-napi.freebsd-x64.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-freebsd-x64")}catch(t){te.push(t)}}else if(process.arch==="arm64"){try{return M("./ast-grep-napi.freebsd-arm64.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-freebsd-arm64")}catch(t){te.push(t)}}else te.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));else if(process.platform==="linux")if(process.arch==="x64")if(ta()){try{return M("./ast-grep-napi.linux-x64-musl.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-linux-x64-musl")}catch(t){te.push(t)}}else{try{return M("./ast-grep-napi.linux-x64-gnu.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-linux-x64-gnu")}catch(t){te.push(t)}}else if(process.arch==="arm64")if(ta()){try{return M("./ast-grep-napi.linux-arm64-musl.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-linux-arm64-musl")}catch(t){te.push(t)}}else{try{return M("./ast-grep-napi.linux-arm64-gnu.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-linux-arm64-gnu")}catch(t){te.push(t)}}else if(process.arch==="arm")if(ta()){try{return M("./ast-grep-napi.linux-arm-musleabihf.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-linux-arm-musleabihf")}catch(t){te.push(t)}}else{try{return M("./ast-grep-napi.linux-arm-gnueabihf.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-linux-arm-gnueabihf")}catch(t){te.push(t)}}else if(process.arch==="riscv64")if(ta()){try{return M("./ast-grep-napi.linux-riscv64-musl.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-linux-riscv64-musl")}catch(t){te.push(t)}}else{try{return M("./ast-grep-napi.linux-riscv64-gnu.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-linux-riscv64-gnu")}catch(t){te.push(t)}}else if(process.arch==="ppc64"){try{return M("./ast-grep-napi.linux-ppc64-gnu.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-linux-ppc64-gnu")}catch(t){te.push(t)}}else if(process.arch==="s390x"){try{return M("./ast-grep-napi.linux-s390x-gnu.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-linux-s390x-gnu")}catch(t){te.push(t)}}else te.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));else if(process.platform==="openharmony")if(process.arch==="arm64"){try{return M("./ast-grep-napi.linux-arm64-ohos.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-linux-arm64-ohos")}catch(t){te.push(t)}}else if(process.arch==="x64"){try{return M("./ast-grep-napi.linux-x64-ohos.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-linux-x64-ohos")}catch(t){te.push(t)}}else if(process.arch==="arm"){try{return M("./ast-grep-napi.linux-arm-ohos.node")}catch(t){te.push(t)}try{return M("@ast-grep/napi-linux-arm-ohos")}catch(t){te.push(t)}}else te.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));else te.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))}Oe=OT();if(!Oe||process.env.NAPI_RS_FORCE_WASI){try{Oe=M("./ast-grep-napi.wasi.cjs")}catch(t){process.env.NAPI_RS_FORCE_WASI&&te.push(t)}if(!Oe)try{Oe=M("@ast-grep/napi-wasm32-wasi")}catch(t){process.env.NAPI_RS_FORCE_WASI&&te.push(t)}}if(!Oe)throw te.length>0?new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.",{cause:te}):new Error("Failed to load native binding");De.exports=Oe;De.exports.SgNode=Oe.SgNode;De.exports.SgRoot=Oe.SgRoot;De.exports.findInFiles=Oe.findInFiles;De.exports.kind=Oe.kind;De.exports.Lang=Oe.Lang;De.exports.parse=Oe.parse;De.exports.parseAsync=Oe.parseAsync;De.exports.parseFiles=Oe.parseFiles;De.exports.pattern=Oe.pattern;De.exports.registerDynamicLanguage=Oe.registerDynamicLanguage;De.exports.css=Oe.css;De.exports.html=Oe.html;De.exports.js=Oe.js;De.exports.jsx=Oe.jsx;De.exports.ts=Oe.ts;De.exports.tsx=Oe.tsx});var s0=B((JF,r0)=>{"use strict";r0.exports=e0;function e0(t,e,r){t instanceof RegExp&&(t=Qy(t,r)),e instanceof RegExp&&(e=Qy(e,r));var s=t0(t,e,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+t.length,s[1]),post:r.slice(s[1]+e.length)}}function Qy(t,e){var r=e.match(t);return r?r[0]:null}e0.range=t0;function t0(t,e,r){var s,i,n,a,o,c=r.indexOf(t),l=r.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(t===e)return[c,l];for(s=[],n=r.length;u>=0&&!o;)u==c?(s.push(u),c=r.indexOf(t,u+1)):s.length==1?o=[s.pop(),l]:(i=s.pop(),i<n&&(n=i,a=l),l=r.indexOf(e,u+1)),u=c<l&&c>=0?c:l;s.length&&(o=[n,a])}return o}});var f0=B((XF,u0)=>{var i0=s0();u0.exports=fL;var n0="\0SLASH"+Math.random()+"\0",o0="\0OPEN"+Math.random()+"\0",gu="\0CLOSE"+Math.random()+"\0",a0="\0COMMA"+Math.random()+"\0",c0="\0PERIOD"+Math.random()+"\0";function mu(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function lL(t){return t.split("\\\\").join(n0).split("\\{").join(o0).split("\\}").join(gu).split("\\,").join(a0).split("\\.").join(c0)}function uL(t){return t.split(n0).join("\\").split(o0).join("{").split(gu).join("}").split(a0).join(",").split(c0).join(".")}function l0(t){if(!t)return[""];var e=[],r=i0("{","}",t);if(!r)return t.split(",");var s=r.pre,i=r.body,n=r.post,a=s.split(",");a[a.length-1]+="{"+i+"}";var o=l0(n);return n.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),e.push.apply(e,a),e}function fL(t){return t?(t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),bn(lL(t),!0).map(uL)):[]}function hL(t){return"{"+t+"}"}function dL(t){return/^-?0\d/.test(t)}function pL(t,e){return t<=e}function mL(t,e){return t>=e}function bn(t,e){var r=[],s=i0("{","}",t);if(!s)return[t];var i=s.pre,n=s.post.length?bn(s.post,!1):[""];if(/\$$/.test(s.pre))for(var a=0;a<n.length;a++){var o=i+"{"+s.body+"}"+n[a];r.push(o)}else{var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),u=c||l,p=s.body.indexOf(",")>=0;if(!u&&!p)return s.post.match(/,.*\}/)?(t=s.pre+"{"+s.body+gu+s.post,bn(t)):[t];var g;if(u)g=s.body.split(/\.\./);else if(g=l0(s.body),g.length===1&&(g=bn(g[0],!1).map(hL),g.length===1))return n.map(function(O){return s.pre+g[0]+O});var f;if(u){var d=mu(g[0]),m=mu(g[1]),y=Math.max(g[0].length,g[1].length),v=g.length==3?Math.abs(mu(g[2])):1,_=pL,w=m<d;w&&(v*=-1,_=mL);var h=g.some(dL);f=[];for(var b=d;_(b,m);b+=v){var x;if(l)x=String.fromCharCode(b),x==="\\"&&(x="");else if(x=String(b),h){var E=y-x.length;if(E>0){var L=new Array(E+1).join("0");b<0?x="-"+L+x.slice(1):x=L+x}}f.push(x)}}else{f=[];for(var A=0;A<g.length;A++)f.push.apply(f,bn(g[A],!1))}for(var A=0;A<f.length;A++)for(var a=0;a<n.length;a++){var o=i+f[A]+n[a];(!e||u||o)&&r.push(o)}}return r}});var Sa=B((oj,Ea)=>{function Q0(t){return Array.isArray(t)?t:[t]}var M$=void 0,Fu="",J0=" ",Du="\\",j$=/^\s+$/,B$=/(?:[^\\]|^)\\$/,U$=/^\\!/,G$=/^\\#/,z$=/\r?\n/g,q$=/^\.{0,2}\/|^\.{1,2}$/,W$=/\/$/,Ei="/",ev="node-ignore";typeof Symbol<"u"&&(ev=Symbol.for("node-ignore"));var tv=ev,Si=(t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),V$=/([0-z])-([0-z])/g,rv=()=>!1,Z$=t=>t.replace(V$,(e,r,s)=>r.charCodeAt(0)<=s.charCodeAt(0)?e:Fu),H$=t=>{let{length:e}=t;return t.slice(0,e-e%2)},K$=[[/^\uFEFF/,()=>Fu],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?J0:Fu)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+J0}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let s=r.replace(/\\\*/g,"[^\\/]*");return e+s}],[/\\\\\\(?=[$.|*+(){^])/g,()=>Du],[/\\\\/g,()=>Du],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,s,i)=>e===Du?`\\[${r}${H$(s)}${i}`:i==="]"&&s.length%2===0?`[${Z$(r)}${s}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],Y$=/(^|\\\/)?\\\*$/,Nn="regex",wa="checkRegex",X0="_",J$={[Nn](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[wa](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},X$=t=>K$.reduce((e,[r,s])=>e.replace(r,s.bind(t)),t),xa=t=>typeof t=="string",Q$=t=>t&&xa(t)&&!j$.test(t)&&!B$.test(t)&&t.indexOf("#")!==0,eP=t=>t.split(z$).filter(Boolean),Mu=class{constructor(e,r,s,i,n,a){this.pattern=e,this.mark=r,this.negative=n,Si(this,"body",s),Si(this,"ignoreCase",i),Si(this,"regexPrefix",a)}get regex(){let e=X0+Nn;return this[e]?this[e]:this._make(Nn,e)}get checkRegex(){let e=X0+wa;return this[e]?this[e]:this._make(wa,e)}_make(e,r){let s=this.regexPrefix.replace(Y$,J$[e]),i=this.ignoreCase?new RegExp(s,"i"):new RegExp(s);return Si(this,r,i)}},tP=({pattern:t,mark:e},r)=>{let s=!1,i=t;i.indexOf("!")===0&&(s=!0,i=i.substr(1)),i=i.replace(U$,"!").replace(G$,"#");let n=X$(i);return new Mu(t,e,i,r,s,n)},ju=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[tv]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(xa(e)&&(e={pattern:e}),Q$(e.pattern)){let r=tP(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,Q0(xa(e)?eP(e):e).forEach(this._add,this),this._added}test(e,r,s){let i=!1,n=!1,a;this._rules.forEach(c=>{let{negative:l}=c;n===l&&i!==n||l&&!i&&!n&&!r||!c[s].test(e)||(i=!l,n=l,a=l?M$:c)});let o={ignored:i,unignored:n};return a&&(o.rule=a),o}},rP=(t,e)=>{throw new e(t)},lr=(t,e,r)=>xa(t)?t?lr.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),sv=t=>q$.test(t);lr.isNotRelative=sv;lr.convert=t=>t;var Bu=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:s=!1}={}){Si(this,tv,!0),this._rules=new ju(r),this._strictPathCheck=!s,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,r,s,i){let n=e&&lr.convert(e);return lr(n,e,this._strictPathCheck?rP:rv),this._t(n,r,s,i)}checkIgnore(e){if(!W$.test(e))return this.test(e);let r=e.split(Ei).filter(Boolean);if(r.pop(),r.length){let s=this._t(r.join(Ei)+Ei,this._testCache,!0,r);if(s.ignored)return s}return this._rules.test(e,!1,wa)}_t(e,r,s,i){if(e in r)return r[e];if(i||(i=e.split(Ei).filter(Boolean)),i.pop(),!i.length)return r[e]=this._rules.test(e,s,Nn);let n=this._t(i.join(Ei)+Ei,r,s,i);return r[e]=n.ignored?n:this._rules.test(e,s,Nn)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return Q0(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},Uu=t=>new Bu(t),sP=t=>lr(t&&lr.convert(t),t,rv),iv=()=>{let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");lr.convert=t;let e=/^[a-z]:\//i;lr.isNotRelative=r=>e.test(r)||sv(r)};typeof process<"u"&&process.platform==="win32"&&iv();Ea.exports=Uu;Uu.default=Uu;Ea.exports.isPathValid=sP;Si(Ea.exports,Symbol.for("setupWindows"),iv)});import*as Ds from"fs/promises";import*as Zb from"os";import*as tc from"path";var f_=20,h_=1,kr=1e6,_f=1e6,d_=-7,p_=21,m_=!1,Bi="[big.js] ",Nr=Bi+"Invalid ",ro=Nr+"decimal places",g_=Nr+"rounding mode",wf=Bi+"Division by zero",we={},Bt=void 0,y_=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function xf(){function t(e){var r=this;if(!(r instanceof t))return e===Bt&&arguments.length===0?xf():new t(e);if(e instanceof t)r.s=e.s,r.e=e.e,r.c=e.c.slice();else{if(typeof e!="string"){if(t.strict===!0&&typeof e!="bigint")throw TypeError(Nr+"value");e=e===0&&1/e<0?"-0":String(e)}v_(r,e)}r.constructor=t}return t.prototype=we,t.DP=f_,t.RM=h_,t.NE=d_,t.PE=p_,t.strict=m_,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}function v_(t,e){var r,s,i;if(!y_.test(e))throw Error(Nr+"number");for(t.s=e.charAt(0)=="-"?(e=e.slice(1),-1):1,(r=e.indexOf("."))>-1&&(e=e.replace(".","")),(s=e.search(/e/i))>0?(r<0&&(r=s),r+=+e.slice(s+1),e=e.substring(0,s)):r<0&&(r=e.length),i=e.length,s=0;s<i&&e.charAt(s)=="0";)++s;if(s==i)t.c=[t.e=0];else{for(;i>0&&e.charAt(--i)=="0";);for(t.e=r-s-1,t.c=[],r=0;s<=i;)t.c[r++]=+e.charAt(s++)}return t}function Dr(t,e,r,s){var i=t.c;if(r===Bt&&(r=t.constructor.RM),r!==0&&r!==1&&r!==2&&r!==3)throw Error(g_);if(e<1)s=r===3&&(s||!!i[0])||e===0&&(r===1&&i[0]>=5||r===2&&(i[0]>5||i[0]===5&&(s||i[1]!==Bt))),i.length=1,s?(t.e=t.e-e+1,i[0]=1):i[0]=t.e=0;else if(e<i.length){if(s=r===1&&i[e]>=5||r===2&&(i[e]>5||i[e]===5&&(s||i[e+1]!==Bt||i[e-1]&1))||r===3&&(s||!!i[0]),i.length=e,s){for(;++i[--e]>9;)if(i[e]=0,e===0){++t.e,i.unshift(1);break}}for(e=i.length;!i[--e];)i.pop()}return t}function Fr(t,e,r){var s=t.e,i=t.c.join(""),n=i.length;if(e)i=i.charAt(0)+(n>1?"."+i.slice(1):"")+(s<0?"e":"e+")+s;else if(s<0){for(;++s;)i="0"+i;i="0."+i}else if(s>0)if(++s>n)for(s-=n;s--;)i+="0";else s<n&&(i=i.slice(0,s)+"."+i.slice(s));else n>1&&(i=i.charAt(0)+"."+i.slice(1));return t.s<0&&r?"-"+i:i}we.abs=function(){var t=new this.constructor(this);return t.s=1,t};we.cmp=function(t){var e,r=this,s=r.c,i=(t=new r.constructor(t)).c,n=r.s,a=t.s,o=r.e,c=t.e;if(!s[0]||!i[0])return s[0]?n:i[0]?-a:0;if(n!=a)return n;if(e=n<0,o!=c)return o>c^e?1:-1;for(a=(o=s.length)<(c=i.length)?o:c,n=-1;++n<a;)if(s[n]!=i[n])return s[n]>i[n]^e?1:-1;return o==c?0:o>c^e?1:-1};we.div=function(t){var e=this,r=e.constructor,s=e.c,i=(t=new r(t)).c,n=e.s==t.s?1:-1,a=r.DP;if(a!==~~a||a<0||a>kr)throw Error(ro);if(!i[0])throw Error(wf);if(!s[0])return t.s=n,t.c=[t.e=0],t;var o,c,l,u,p,g=i.slice(),f=o=i.length,d=s.length,m=s.slice(0,o),y=m.length,v=t,_=v.c=[],w=0,h=a+(v.e=e.e-t.e)+1;for(v.s=n,n=h<0?0:h,g.unshift(0);y++<o;)m.push(0);do{for(l=0;l<10;l++){if(o!=(y=m.length))u=o>y?1:-1;else for(p=-1,u=0;++p<o;)if(i[p]!=m[p]){u=i[p]>m[p]?1:-1;break}if(u<0){for(c=y==o?i:g;y;){if(m[--y]<c[y]){for(p=y;p&&!m[--p];)m[p]=9;--m[p],m[y]+=10}m[y]-=c[y]}for(;!m[0];)m.shift()}else break}_[w++]=u?l:++l,m[0]&&u?m[y]=s[f]||0:m=[s[f]]}while((f++<d||m[0]!==Bt)&&n--);return!_[0]&&w!=1&&(_.shift(),v.e--,h--),w>h&&Dr(v,h,r.RM,m[0]!==Bt),v};we.eq=function(t){return this.cmp(t)===0};we.gt=function(t){return this.cmp(t)>0};we.gte=function(t){return this.cmp(t)>-1};we.lt=function(t){return this.cmp(t)<0};we.lte=function(t){return this.cmp(t)<1};we.minus=we.sub=function(t){var e,r,s,i,n=this,a=n.constructor,o=n.s,c=(t=new a(t)).s;if(o!=c)return t.s=-c,n.plus(t);var l=n.c.slice(),u=n.e,p=t.c,g=t.e;if(!l[0]||!p[0])return p[0]?t.s=-c:l[0]?t=new a(n):t.s=1,t;if(o=u-g){for((i=o<0)?(o=-o,s=l):(g=u,s=p),s.reverse(),c=o;c--;)s.push(0);s.reverse()}else for(r=((i=l.length<p.length)?l:p).length,o=c=0;c<r;c++)if(l[c]!=p[c]){i=l[c]<p[c];break}if(i&&(s=l,l=p,p=s,t.s=-t.s),(c=(r=p.length)-(e=l.length))>0)for(;c--;)l[e++]=0;for(c=e;r>o;){if(l[--r]<p[r]){for(e=r;e&&!l[--e];)l[e]=9;--l[e],l[r]+=10}l[r]-=p[r]}for(;l[--c]===0;)l.pop();for(;l[0]===0;)l.shift(),--g;return l[0]||(t.s=1,l=[g=0]),t.c=l,t.e=g,t};we.mod=function(t){var e,r=this,s=r.constructor,i=r.s,n=(t=new s(t)).s;if(!t.c[0])throw Error(wf);return r.s=t.s=1,e=t.cmp(r)==1,r.s=i,t.s=n,e?new s(r):(i=s.DP,n=s.RM,s.DP=s.RM=0,r=r.div(t),s.DP=i,s.RM=n,this.minus(r.times(t)))};we.neg=function(){var t=new this.constructor(this);return t.s=-t.s,t};we.plus=we.add=function(t){var e,r,s,i=this,n=i.constructor;if(t=new n(t),i.s!=t.s)return t.s=-t.s,i.minus(t);var a=i.e,o=i.c,c=t.e,l=t.c;if(!o[0]||!l[0])return l[0]||(o[0]?t=new n(i):t.s=i.s),t;if(o=o.slice(),e=a-c){for(e>0?(c=a,s=l):(e=-e,s=o),s.reverse();e--;)s.push(0);s.reverse()}for(o.length-l.length<0&&(s=l,l=o,o=s),e=l.length,r=0;e;o[e]%=10)r=(o[--e]=o[e]+l[e]+r)/10|0;for(r&&(o.unshift(r),++c),e=o.length;o[--e]===0;)o.pop();return t.c=o,t.e=c,t};we.pow=function(t){var e=this,r=new e.constructor("1"),s=r,i=t<0;if(t!==~~t||t<-_f||t>_f)throw Error(Nr+"exponent");for(i&&(t=-t);t&1&&(s=s.times(e)),t>>=1,!!t;)e=e.times(e);return i?r.div(s):s};we.prec=function(t,e){if(t!==~~t||t<1||t>kr)throw Error(Nr+"precision");return Dr(new this.constructor(this),t,e)};we.round=function(t,e){if(t===Bt)t=0;else if(t!==~~t||t<-kr||t>kr)throw Error(ro);return Dr(new this.constructor(this),t+this.e+1,e)};we.sqrt=function(){var t,e,r,s=this,i=s.constructor,n=s.s,a=s.e,o=new i("0.5");if(!s.c[0])return new i(s);if(n<0)throw Error(Bi+"No square root");n=Math.sqrt(+Fr(s,!0,!0)),n===0||n===1/0?(e=s.c.join(""),e.length+a&1||(e+="0"),n=Math.sqrt(e),a=((a+1)/2|0)-(a<0||a&1),t=new i((n==1/0?"5e":(n=n.toExponential()).slice(0,n.indexOf("e")+1))+a)):t=new i(n+""),a=t.e+(i.DP+=4);do r=t,t=o.times(r.plus(s.div(r)));while(r.c.slice(0,a).join("")!==t.c.slice(0,a).join(""));return Dr(t,(i.DP-=4)+t.e+1,i.RM)};we.times=we.mul=function(t){var e,r=this,s=r.constructor,i=r.c,n=(t=new s(t)).c,a=i.length,o=n.length,c=r.e,l=t.e;if(t.s=r.s==t.s?1:-1,!i[0]||!n[0])return t.c=[t.e=0],t;for(t.e=c+l,a<o&&(e=i,i=n,n=e,l=a,a=o,o=l),e=new Array(l=a+o);l--;)e[l]=0;for(c=o;c--;){for(o=0,l=a+c;l>c;)o=e[l]+n[c]*i[l-c-1]+o,e[l--]=o%10,o=o/10|0;e[l]=o}for(o?++t.e:e.shift(),c=e.length;!e[--c];)e.pop();return t.c=e,t};we.toExponential=function(t,e){var r=this,s=r.c[0];if(t!==Bt){if(t!==~~t||t<0||t>kr)throw Error(ro);for(r=Dr(new r.constructor(r),++t,e);r.c.length<t;)r.c.push(0)}return Fr(r,!0,!!s)};we.toFixed=function(t,e){var r=this,s=r.c[0];if(t!==Bt){if(t!==~~t||t<0||t>kr)throw Error(ro);for(r=Dr(new r.constructor(r),t+r.e+1,e),t=t+r.e+1;r.c.length<t;)r.c.push(0)}return Fr(r,!1,!!s)};we.toJSON=we.toString=function(){var t=this,e=t.constructor;return Fr(t,t.e<=e.NE||t.e>=e.PE,!!t.c[0])};typeof Symbol<"u"&&(we[Symbol.for("nodejs.util.inspect.custom")]=we.toJSON);we.toNumber=function(){var t=+Fr(this,!0,!0);if(this.constructor.strict===!0&&!this.eq(t.toString()))throw Error(Bi+"Imprecise conversion");return t};we.toPrecision=function(t,e){var r=this,s=r.constructor,i=r.c[0];if(t!==Bt){if(t!==~~t||t<1||t>kr)throw Error(Nr+"precision");for(r=Dr(new s(r),t,e);r.c.length<t;)r.c.push(0)}return Fr(r,t<=r.e||r.e<=s.NE||r.e>=s.PE,!!i)};we.valueOf=function(){var t=this,e=t.constructor;if(e.strict===!0)throw Error(Bi+"valueOf disallowed");return Fr(t,t.e<=e.NE||t.e>=e.PE,!0)};var b_=xf(),lt=b_;var Ef=(t=0)=>e=>`\x1B[${e+t}m`,Sf=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Rf=(t=0)=>(e,r,s)=>`\x1B[${38+t};2;${e};${r};${s}m`,Ae={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},$2=Object.keys(Ae.modifier),__=Object.keys(Ae.color),w_=Object.keys(Ae.bgColor),P2=[...__,...w_];function x_(){let t=new Map;for(let[e,r]of Object.entries(Ae)){for(let[s,i]of Object.entries(r))Ae[s]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[s]=Ae[s],t.set(i[0],i[1]);Object.defineProperty(Ae,e,{value:r,enumerable:!1})}return Object.defineProperty(Ae,"codes",{value:t,enumerable:!1}),Ae.color.close="\x1B[39m",Ae.bgColor.close="\x1B[49m",Ae.color.ansi=Ef(),Ae.color.ansi256=Sf(),Ae.color.ansi16m=Rf(),Ae.bgColor.ansi=Ef(10),Ae.bgColor.ansi256=Sf(10),Ae.bgColor.ansi16m=Rf(10),Object.defineProperties(Ae,{rgbToAnsi256:{value(e,r,s){return e===r&&r===s?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(s/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[s]=r;s.length===3&&(s=[...s].map(n=>n+n).join(""));let i=Number.parseInt(s,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Ae.rgbToAnsi256(...Ae.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,s,i;if(e>=232)r=((e-232)*10+8)/255,s=r,i=r;else{e-=16;let o=e%36;r=Math.floor(e/36)/5,s=Math.floor(o/6)/5,i=o%6/5}let n=Math.max(r,s,i)*2;if(n===0)return 30;let a=30+(Math.round(i)<<2|Math.round(s)<<1|Math.round(r));return n===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,r,s)=>Ae.ansi256ToAnsi(Ae.rgbToAnsi256(e,r,s)),enumerable:!1},hexToAnsi:{value:e=>Ae.ansi256ToAnsi(Ae.hexToAnsi256(e)),enumerable:!1}}),Ae}var E_=x_(),Lt=E_;import sc from"node:process";import S_ from"node:os";import Af from"node:tty";function pt(t,e=globalThis.Deno?globalThis.Deno.args:sc.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",s=e.indexOf(r+t),i=e.indexOf("--");return s!==-1&&(i===-1||s<i)}var{env:Ce}=sc,so;pt("no-color")||pt("no-colors")||pt("color=false")||pt("color=never")?so=0:(pt("color")||pt("colors")||pt("color=true")||pt("color=always"))&&(so=1);function R_(){if("FORCE_COLOR"in Ce)return Ce.FORCE_COLOR==="true"?1:Ce.FORCE_COLOR==="false"?0:Ce.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Ce.FORCE_COLOR,10),3)}function A_(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function C_(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let s=R_();s!==void 0&&(so=s);let i=r?so:s;if(i===0)return 0;if(r){if(pt("color=16m")||pt("color=full")||pt("color=truecolor"))return 3;if(pt("color=256"))return 2}if("TF_BUILD"in Ce&&"AGENT_NAME"in Ce)return 1;if(t&&!e&&i===void 0)return 0;let n=i||0;if(Ce.TERM==="dumb")return n;if(sc.platform==="win32"){let a=S_.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in Ce)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(a=>a in Ce)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in Ce)||Ce.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Ce)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ce.TEAMCITY_VERSION)?1:0;if(Ce.COLORTERM==="truecolor"||Ce.TERM==="xterm-kitty"||Ce.TERM==="xterm-ghostty"||Ce.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Ce){let a=Number.parseInt((Ce.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ce.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ce.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ce.TERM)||"COLORTERM"in Ce?1:n}function Cf(t,e={}){let r=C_(t,{streamIsTTY:t&&t.isTTY,...e});return A_(r)}var O_={stdout:Cf({isTTY:Af.isatty(1)}),stderr:Cf({isTTY:Af.isatty(2)})},Of=O_;function Tf(t,e,r){let s=t.indexOf(e);if(s===-1)return t;let i=e.length,n=0,a="";do a+=t.slice(n,s)+e+r,n=s+i,s=t.indexOf(e,n);while(s!==-1);return a+=t.slice(n),a}function Lf(t,e,r,s){let i=0,n="";do{let a=t[s-1]==="\r";n+=t.slice(i,a?s-1:s)+e+(a?`\r
|
|
16
16
|
`:`
|
|
17
|
-
`)+r,s
|
|
18
|
-
`,
|
|
19
|
-
`);return n!==-1&&(e=su(e,s,i,n)),i+e+s};Object.defineProperties(ji.prototype,qr);var ab=ji(),X$=ji({level:ou?ou.level:0});var S=ab;var xy=We(fu(),1);import Ba from"node:process";import mh,{format as _b}from"util";import{resolve as Sb,normalize as Rb}from"path";import{readFileSync as Cb}from"fs";import gh,{createRequire as pu}from"node:module";import Gt from"node:path";import Ab from"node:process";import Lb,{fileURLToPath as yh}from"node:url";import bh from"node:fs";import Da from"url";function zi(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",i=!1,s=t.match(/^-+/);for(let n=s?s[0].length:0;n<t.length;n++){let a=t.charAt(n);i&&(i=!1,a=a.toUpperCase()),n!==0&&(a==="-"||a==="_")?i=!0:a!=="-"&&a!=="_"&&(r+=a)}return r}}function vh(t,e){let r=t.toLowerCase();e=e||"-";let i="";for(let s=0;s<t.length;s++){let n=r.charAt(s),a=t.charAt(s);n!==a&&s>0?i+=`${e}${r.charAt(s)}`:i+=a}return i}function wh(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Ob(t){if(Array.isArray(t))return t.map(a=>typeof a!="string"?a+"":a);t=t.trim();let e=0,r=null,i=null,s=null,n=[];for(let a=0;a<t.length;a++){if(r=i,i=t.charAt(a),i===" "&&!s){r!==" "&&e++;continue}i===s?s=null:(i==="'"||i==='"')&&!s&&(s=i),n[e]||(n[e]=""),n[e]+=i}return n}var ft;(function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"})(ft||(ft={}));var Lt,Pa=class{constructor(e){Lt=e}parse(e,r){let i=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},r),s=Ob(e),n=typeof e=="string",a=$b(Object.assign(Object.create(null),i.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},i.configuration),c=Object.assign(Object.create(null),i.default),l=i.configObjects||[],u=i.envPrefix,d=o["populate--"],g=d?"--":"_",h=Object.create(null),p=Object.create(null),m=i.__||Lt.format,y={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},b=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,w=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(i.array||[]).filter(Boolean).forEach(function(R){let L=typeof R=="object"?R.key:R,k=Object.keys(R).map(function(P){return{boolean:"bools",string:"strings",number:"numbers"}[P]}).filter(Boolean).pop();k&&(y[k][L]=!0),y.arrays[L]=!0,y.keys.push(L)}),[].concat(i.boolean||[]).filter(Boolean).forEach(function(R){y.bools[R]=!0,y.keys.push(R)}),[].concat(i.string||[]).filter(Boolean).forEach(function(R){y.strings[R]=!0,y.keys.push(R)}),[].concat(i.number||[]).filter(Boolean).forEach(function(R){y.numbers[R]=!0,y.keys.push(R)}),[].concat(i.count||[]).filter(Boolean).forEach(function(R){y.counts[R]=!0,y.keys.push(R)}),[].concat(i.normalize||[]).filter(Boolean).forEach(function(R){y.normalize[R]=!0,y.keys.push(R)}),typeof i.narg=="object"&&Object.entries(i.narg).forEach(([R,L])=>{typeof L=="number"&&(y.nargs[R]=L,y.keys.push(R))}),typeof i.coerce=="object"&&Object.entries(i.coerce).forEach(([R,L])=>{typeof L=="function"&&(y.coercions[R]=L,y.keys.push(R))}),typeof i.config<"u"&&(Array.isArray(i.config)||typeof i.config=="string"?[].concat(i.config).filter(Boolean).forEach(function(R){y.configs[R]=!0}):typeof i.config=="object"&&Object.entries(i.config).forEach(([R,L])=>{(typeof L=="boolean"||typeof L=="function")&&(y.configs[R]=L)})),Ur(i.key,a,i.default,y.arrays),Object.keys(c).forEach(function(R){(y.aliases[R]||[]).forEach(function(L){c[L]=c[R]})});let x=null;$y();let f=[],v=Object.assign(Object.create(null),{_:[]}),E={};for(let R=0;R<s.length;R++){let L=s[R],k=L.replace(/^-{3,}/,"---"),P,A,H,z,J,Se;if(L!=="--"&&/^-/.test(L)&&zs(L))_(L);else if(k.match(/^---+(=|$)/)){_(L);continue}else if(L.match(/^--.+=/)||!o["short-option-groups"]&&L.match(/^-.+=/))z=L.match(/^--?([^=]+)=([\s\S]*)$/),z!==null&&Array.isArray(z)&&z.length>=3&&(re(z[1],y.arrays)?R=C(R,z[1],s,z[2]):re(z[1],y.nargs)!==!1?R=O(R,z[1],s,z[2]):$(z[1],z[2],!0));else if(L.match(w)&&o["boolean-negation"])z=L.match(w),z!==null&&Array.isArray(z)&&z.length>=2&&(A=z[1],$(A,re(A,y.arrays)?[!1]:!1));else if(L.match(/^--.+/)||!o["short-option-groups"]&&L.match(/^-[^-]+/))z=L.match(/^--?(.+)/),z!==null&&Array.isArray(z)&&z.length>=2&&(A=z[1],re(A,y.arrays)?R=C(R,A,s):re(A,y.nargs)!==!1?R=O(R,A,s):(J=s[R+1],J!==void 0&&(!J.match(/^-/)||J.match(b))&&!re(A,y.bools)&&!re(A,y.counts)||/^(true|false)$/.test(J)?($(A,J),R++):$(A,Gr(A))));else if(L.match(/^-.\..+=/))z=L.match(/^-([^=]+)=([\s\S]*)$/),z!==null&&Array.isArray(z)&&z.length>=3&&$(z[1],z[2]);else if(L.match(/^-.\..+/)&&!L.match(b))J=s[R+1],z=L.match(/^-(.\..+)/),z!==null&&Array.isArray(z)&&z.length>=2&&(A=z[1],J!==void 0&&!J.match(/^-/)&&!re(A,y.bools)&&!re(A,y.counts)?($(A,J),R++):$(A,Gr(A)));else if(L.match(/^-[^-]+/)&&!L.match(b)){H=L.slice(1,-1).split(""),P=!1;for(let Be=0;Be<H.length;Be++){if(J=L.slice(Be+2),H[Be+1]&&H[Be+1]==="="){Se=L.slice(Be+3),A=H[Be],re(A,y.arrays)?R=C(R,A,s,Se):re(A,y.nargs)!==!1?R=O(R,A,s,Se):$(A,Se),P=!0;break}if(J==="-"){$(H[Be],J);continue}if(/[A-Za-z]/.test(H[Be])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(J)&&re(J,y.bools)===!1){$(H[Be],J),P=!0;break}if(H[Be+1]&&H[Be+1].match(/\W/)){$(H[Be],J),P=!0;break}else $(H[Be],Gr(H[Be]))}A=L.slice(-1)[0],!P&&A!=="-"&&(re(A,y.arrays)?R=C(R,A,s):re(A,y.nargs)!==!1?R=O(R,A,s):(J=s[R+1],J!==void 0&&(!/^(-|--)[^-]/.test(J)||J.match(b))&&!re(A,y.bools)&&!re(A,y.counts)||/^(true|false)$/.test(J)?($(A,J),R++):$(A,Gr(A))))}else if(L.match(/^-[0-9]$/)&&L.match(b)&&re(L.slice(1),y.bools))A=L.slice(1),$(A,Gr(A));else if(L==="--"){f=s.slice(R+1);break}else if(o["halt-at-non-option"]){f=s.slice(R);break}else _(L)}V(v,!0),V(v,!1),Y(v),G(),we(v,y.aliases,c,!0),se(v),o["set-placeholder-key"]&&ee(v),Object.keys(y.counts).forEach(function(R){xe(v,R.split("."))||$(R,0)}),d&&f.length&&(v[g]=[]),f.forEach(function(R){v[g].push(R)}),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(v).filter(R=>R!=="--"&&R.includes("-")).forEach(R=>{delete v[R]}),o["strip-aliased"]&&[].concat(...Object.keys(a).map(R=>a[R])).forEach(R=>{o["camel-case-expansion"]&&R.includes("-")&&delete v[R.split(".").map(L=>zi(L)).join(".")],delete v[R]});function _(R){let L=I("_",R);(typeof L=="string"||typeof L=="number")&&v._.push(L)}function O(R,L,k,P){let A,H=re(L,y.nargs);if(H=typeof H!="number"||isNaN(H)?1:H,H===0)return Ct(P)||(x=Error(m("Argument unexpected for: %s",L))),$(L,Gr(L)),R;let z=Ct(P)?0:1;if(o["nargs-eats-options"])k.length-(R+1)+z<H&&(x=Error(m("Not enough arguments following: %s",L))),z=H;else{for(A=R+1;A<k.length&&(!k[A].match(/^-[^0-9]/)||k[A].match(b)||zs(k[A]));A++)z++;z<H&&(x=Error(m("Not enough arguments following: %s",L)))}let J=Math.min(z,H);for(!Ct(P)&&J>0&&($(L,P),J--),A=R+1;A<J+R+1;A++)$(L,k[A]);return R+J}function C(R,L,k,P){let A=[],H=P||k[R+1],z=re(L,y.nargs);if(re(L,y.bools)&&!/^(true|false)$/.test(H))A.push(!0);else if(Ct(H)||Ct(P)&&/^-/.test(H)&&!b.test(H)&&!zs(H)){if(c[L]!==void 0){let J=c[L];A=Array.isArray(J)?J:[J]}}else{Ct(P)||A.push(M(L,P,!0));for(let J=R+1;J<k.length&&!(!o["greedy-arrays"]&&A.length>0||z&&typeof z=="number"&&A.length>=z||(H=k[J],/^-/.test(H)&&!b.test(H)&&!zs(H)));J++)R=J,A.push(M(L,H,n))}return typeof z=="number"&&(z&&A.length<z||isNaN(z)&&A.length===0)&&(x=Error(m("Not enough arguments following: %s",L))),$(L,A),R}function $(R,L,k=n){if(/-/.test(R)&&o["camel-case-expansion"]){let H=R.split(".").map(function(z){return zi(z)}).join(".");F(R,H)}let P=M(R,L,k),A=R.split(".");Oe(v,A,P),y.aliases[R]&&y.aliases[R].forEach(function(H){let z=H.split(".");Oe(v,z,P)}),A.length>1&&o["dot-notation"]&&(y.aliases[A[0]]||[]).forEach(function(H){let z=H.split("."),J=[].concat(A);J.shift(),z=z.concat(J),(y.aliases[R]||[]).includes(z.join("."))||Oe(v,z,P)}),re(R,y.normalize)&&!re(R,y.arrays)&&[R].concat(y.aliases[R]||[]).forEach(function(z){Object.defineProperty(E,z,{enumerable:!0,get(){return L},set(J){L=typeof J=="string"?Lt.normalize(J):J}})})}function F(R,L){y.aliases[R]&&y.aliases[R].length||(y.aliases[R]=[L],h[L]=!0),y.aliases[L]&&y.aliases[L].length||F(L,R)}function M(R,L,k){k&&(L=Tb(L)),(re(R,y.bools)||re(R,y.counts))&&typeof L=="string"&&(L=L==="true");let P=Array.isArray(L)?L.map(function(A){return I(R,A)}):I(R,L);return re(R,y.counts)&&(Ct(P)||typeof P=="boolean")&&(P=Ho()),re(R,y.normalize)&&re(R,y.arrays)&&(Array.isArray(L)?P=L.map(A=>Lt.normalize(A)):P=Lt.normalize(L)),P}function I(R,L){return!o["parse-positional-numbers"]&&R==="_"||!re(R,y.strings)&&!re(R,y.bools)&&!Array.isArray(L)&&(wh(L)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${L}`)))||!Ct(L)&&re(R,y.numbers))&&(L=Number(L)),L}function Y(R){let L=Object.create(null);we(L,y.aliases,c),Object.keys(y.configs).forEach(function(k){let P=R[k]||L[k];if(P)try{let A=null,H=Lt.resolve(Lt.cwd(),P),z=y.configs[k];if(typeof z=="function"){try{A=z(H)}catch(J){A=J}if(A instanceof Error){x=A;return}}else A=Lt.require(H);Z(A)}catch(A){A.name==="PermissionDenied"?x=A:R[k]&&(x=Error(m("Invalid JSON config file: %s",P)))}})}function Z(R,L){Object.keys(R).forEach(function(k){let P=R[k],A=L?L+"."+k:k;typeof P=="object"&&P!==null&&!Array.isArray(P)&&o["dot-notation"]?Z(P,A):(!xe(v,A.split("."))||re(A,y.arrays)&&o["combine-arrays"])&&$(A,P)})}function G(){typeof l<"u"&&l.forEach(function(R){Z(R)})}function V(R,L){if(typeof u>"u")return;let k=typeof u=="string"?u:"",P=Lt.env();Object.keys(P).forEach(function(A){if(k===""||A.lastIndexOf(k,0)===0){let H=A.split("__").map(function(z,J){return J===0&&(z=z.substring(k.length)),zi(z)});(L&&y.configs[H.join(".")]||!L)&&!xe(R,H)&&$(H.join("."),P[A])}})}function se(R){let L,k=new Set;Object.keys(R).forEach(function(P){if(!k.has(P)&&(L=re(P,y.coercions),typeof L=="function"))try{let A=I(P,L(R[P]));[].concat(y.aliases[P]||[],P).forEach(H=>{k.add(H),R[H]=A})}catch(A){x=A}})}function ee(R){return y.keys.forEach(L=>{~L.indexOf(".")||typeof R[L]>"u"&&(R[L]=void 0)}),R}function we(R,L,k,P=!1){Object.keys(k).forEach(function(A){xe(R,A.split("."))||(Oe(R,A.split("."),k[A]),P&&(p[A]=!0),(L[A]||[]).forEach(function(H){xe(R,H.split("."))||Oe(R,H.split("."),k[A])}))})}function xe(R,L){let k=R;o["dot-notation"]||(L=[L.join(".")]),L.slice(0,-1).forEach(function(A){k=k[A]||{}});let P=L[L.length-1];return typeof k!="object"?!1:P in k}function Oe(R,L,k){let P=R;o["dot-notation"]||(L=[L.join(".")]),L.slice(0,-1).forEach(function(Se){Se=du(Se),typeof P=="object"&&P[Se]===void 0&&(P[Se]={}),typeof P[Se]!="object"||Array.isArray(P[Se])?(Array.isArray(P[Se])?P[Se].push({}):P[Se]=[P[Se],{}],P=P[Se][P[Se].length-1]):P=P[Se]});let A=du(L[L.length-1]),H=re(L.join("."),y.arrays),z=Array.isArray(k),J=o["duplicate-arguments-array"];!J&&re(A,y.nargs)&&(J=!0,(!Ct(P[A])&&y.nargs[A]===1||Array.isArray(P[A])&&P[A].length===y.nargs[A])&&(P[A]=void 0)),k===Ho()?P[A]=Ho(P[A]):Array.isArray(P[A])?J&&H&&z?P[A]=o["flatten-duplicate-arrays"]?P[A].concat(k):(Array.isArray(P[A][0])?P[A]:[P[A]]).concat([k]):!J&&!!H==!!z?P[A]=k:P[A]=P[A].concat([k]):P[A]===void 0&&H?P[A]=z?k:[k]:J&&!(P[A]===void 0||re(A,y.counts)||re(A,y.bools))?P[A]=[P[A],k]:P[A]=k}function Ur(...R){R.forEach(function(L){Object.keys(L||{}).forEach(function(k){y.aliases[k]||(y.aliases[k]=[].concat(a[k]||[]),y.aliases[k].concat(k).forEach(function(P){if(/-/.test(P)&&o["camel-case-expansion"]){let A=zi(P);A!==k&&y.aliases[k].indexOf(A)===-1&&(y.aliases[k].push(A),h[A]=!0)}}),y.aliases[k].concat(k).forEach(function(P){if(P.length>1&&/[A-Z]/.test(P)&&o["camel-case-expansion"]){let A=vh(P,"-");A!==k&&y.aliases[k].indexOf(A)===-1&&(y.aliases[k].push(A),h[A]=!0)}}),y.aliases[k].forEach(function(P){y.aliases[P]=[k].concat(y.aliases[k].filter(function(A){return P!==A}))}))})})}function re(R,L){let k=[].concat(y.aliases[R]||[],R),P=Object.keys(L),A=k.find(H=>P.includes(H));return A?L[A]:!1}function Gs(R){let L=Object.keys(y);return[].concat(L.map(P=>y[P])).some(function(P){return Array.isArray(P)?P.includes(R):P[R]})}function Ry(R,...L){return[].concat(...L).some(function(P){let A=R.match(P);return A&&Gs(A[1])})}function Cy(R){if(R.match(b)||!R.match(/^-[^-]+/))return!1;let L=!0,k,P=R.slice(1).split("");for(let A=0;A<P.length;A++){if(k=R.slice(A+2),!Gs(P[A])){L=!1;break}if(P[A+1]&&P[A+1]==="="||k==="-"||/[A-Za-z]/.test(P[A])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(k)||P[A+1]&&P[A+1].match(/\W/))break}return L}function zs(R){return o["unknown-options-as-args"]&&Ay(R)}function Ay(R){return R=R.replace(/^-{3,}/,"--"),R.match(b)||Cy(R)?!1:!Ry(R,/^-+([^=]+?)=[\s\S]*$/,w,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function Gr(R){return!re(R,y.bools)&&!re(R,y.counts)&&`${R}`in c?c[R]:Ly(Oy(R))}function Ly(R){return{[ft.BOOLEAN]:!0,[ft.STRING]:"",[ft.NUMBER]:void 0,[ft.ARRAY]:[]}[R]}function Oy(R){let L=ft.BOOLEAN;return re(R,y.strings)?L=ft.STRING:re(R,y.numbers)?L=ft.NUMBER:re(R,y.bools)?L=ft.BOOLEAN:re(R,y.arrays)&&(L=ft.ARRAY),L}function Ct(R){return R===void 0}function $y(){Object.keys(y.counts).find(R=>re(R,y.arrays)?(x=Error(m("Invalid configuration: %s, opts.count excludes opts.array.",R)),!0):re(R,y.nargs)?(x=Error(m("Invalid configuration: %s, opts.count excludes opts.narg.",R)),!0):!1)}return{aliases:Object.assign({},y.aliases),argv:Object.assign(E,v),configuration:o,defaulted:Object.assign({},p),error:x,newAliases:Object.assign({},h)}}};function $b(t){let e=[],r=Object.create(null),i=!0;for(Object.keys(t).forEach(function(s){e.push([].concat(t[s],s))});i;){i=!1;for(let s=0;s<e.length;s++)for(let n=s+1;n<e.length;n++)if(e[s].filter(function(o){return e[n].indexOf(o)!==-1}).length){e[s]=e[s].concat(e[n]),e.splice(n,1),i=!0;break}}return e.forEach(function(s){s=s.filter(function(a,o,c){return c.indexOf(a)===o});let n=s.pop();n!==void 0&&typeof n=="string"&&(r[n]=s)}),r}function Ho(t){return t!==void 0?t+1:1}function du(t){return t==="__proto__"?"___proto___":t}function Tb(t){return typeof t=="string"&&(t[0]==="'"||t[0]==='"')&&t[t.length-1]===t[0]?t.substring(1,t.length-1):t}var Ko,Yo,Xo,mu=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20,gu=(Yo=(Ko=process==null?void 0:process.versions)===null||Ko===void 0?void 0:Ko.node)!==null&&Yo!==void 0?Yo:(Xo=process==null?void 0:process.version)===null||Xo===void 0?void 0:Xo.slice(1);if(gu&&Number(gu.match(/^([^.]+)/)[1])<mu)throw Error(`yargs parser supports a minimum Node.js version of ${mu}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var Pb=process?process.env:{},yu=pu?pu(import.meta.url):void 0,xh=new Pa({cwd:process.cwd,env:()=>Pb,format:_b,normalize:Rb,resolve:Sb,require:t=>{if(typeof yu<"u")return yu(t);if(t.match(/\.json$/))return JSON.parse(Cb(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),Yr=function(e,r){return xh.parse(e.slice(),r).argv};Yr.detailed=function(t,e){return xh.parse(t.slice(),e)};Yr.camelCase=zi;Yr.decamelize=vh;Yr.looksLikeNumber=wh;var Eh=t=>typeof t=="object"&&t!==null,bu=t=>Eh(t)&&!(t instanceof RegExp)&&!(t instanceof Error)&&!(t instanceof Date)&&!(globalThis.Blob&&t instanceof globalThis.Blob),Ib=Symbol("mapObjectSkip"),Ia=(t,e,r,i=new WeakMap)=>{if(r={deep:!1,target:{},...r},i.has(t))return i.get(t);i.set(t,r.target);let{target:s}=r;delete r.target;let n=a=>a.map(o=>bu(o)?Ia(o,e,r,i):o);if(Array.isArray(t))return n(t);for(let[a,o]of Object.entries(t)){let c=e(a,o,t);if(c===Ib)continue;let[l,u,{shouldRecurse:d=!0}={}]=c;l!=="__proto__"&&(r.deep&&d&&bu(u)&&(u=Array.isArray(u)?n(u):Ia(u,e,r,i)),s[l]=u)}return s};function Fb(t,e,r){if(!Eh(t))throw new TypeError(`Expected an object, got \`${t}\` (${typeof t})`);if(Array.isArray(t))throw new TypeError("Expected an object, got an array");return Ia(t,e,r)}var Nb=/[\p{Lu}]/u,Db=/[\p{Ll}]/u,vu=/^[\p{Lu}](?![\p{Lu}])/gu,_h=/([\p{Alpha}\p{N}_]|$)/u,Ma=/[_.\- ]+/,Mb=new RegExp("^"+Ma.source),wu=new RegExp(Ma.source+_h.source,"gu"),xu=new RegExp("\\d+"+_h.source,"gu"),kb=(t,e,r,i)=>{let s=!1,n=!1,a=!1,o=!1;for(let c=0;c<t.length;c++){let l=t[c];o=c>2?t[c-3]==="-":!0,s&&Nb.test(l)?(t=t.slice(0,c)+"-"+t.slice(c),s=!1,a=n,n=!0,c++):n&&a&&Db.test(l)&&(!o||i)?(t=t.slice(0,c-1)+"-"+t.slice(c-1),a=n,n=!1,s=!0):(s=e(l)===l&&r(l)!==l,a=n,n=r(l)===l&&e(l)!==l)}return t},jb=(t,e)=>(vu.lastIndex=0,t.replaceAll(vu,r=>e(r))),Bb=(t,e)=>(wu.lastIndex=0,xu.lastIndex=0,t.replaceAll(xu,(r,i,s)=>["_","-"].includes(t.charAt(s+r.length))?r:e(r)).replaceAll(wu,(r,i)=>e(i)));function Ub(t,e){if(!(typeof t=="string"||Array.isArray(t)))throw new TypeError("Expected the input to be `string | string[]`");if(e={pascalCase:!1,preserveConsecutiveUppercase:!1,...e},Array.isArray(t)?t=t.map(n=>n.trim()).filter(n=>n.length).join("-"):t=t.trim(),t.length===0)return"";let r=e.locale===!1?n=>n.toLowerCase():n=>n.toLocaleLowerCase(e.locale),i=e.locale===!1?n=>n.toUpperCase():n=>n.toLocaleUpperCase(e.locale);return t.length===1?Ma.test(t)?"":e.pascalCase?i(t):r(t):(t!==r(t)&&(t=kb(t,r,i,e.preserveConsecutiveUppercase)),t=t.replace(Mb,""),t=e.preserveConsecutiveUppercase?jb(t,r):r(t),e.pascalCase&&(t=i(t.charAt(0))+t.slice(1)),Bb(t,i))}var Gb=class extends Map{#t=0;#r=new Map;#e=new Map;#n;#h;#w;constructor(e={}){if(super(),!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof e.maxAge=="number"&&e.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.#n=e.maxSize,this.#h=e.maxAge||Number.POSITIVE_INFINITY,this.#w=e.onEviction}get __oldCache(){return this.#e}#a(e){if(typeof this.#w=="function")for(let[r,i]of e)this.#w(r,i.value)}#u(e,r){return typeof r.expiry=="number"&&r.expiry<=Date.now()?(typeof this.#w=="function"&&this.#w(e,r.value),this.delete(e)):!1}#s(e,r){if(this.#u(e,r)===!1)return r.value}#c(e,r){return r.expiry?this.#s(e,r):r.value}#i(e,r){let i=r.get(e);return this.#c(e,i)}#l(e,r){this.#r.set(e,r),this.#t++,this.#t>=this.#n&&(this.#t=0,this.#a(this.#e),this.#e=this.#r,this.#r=new Map)}#o(e,r){this.#e.delete(e),this.#l(e,r)}*#d(){for(let e of this.#e){let[r,i]=e;this.#r.has(r)||this.#u(r,i)===!1&&(yield e)}for(let e of this.#r){let[r,i]=e;this.#u(r,i)===!1&&(yield e)}}get(e){if(this.#r.has(e)){let r=this.#r.get(e);return this.#c(e,r)}if(this.#e.has(e)){let r=this.#e.get(e);if(this.#u(e,r)===!1)return this.#o(e,r),r.value}}set(e,r,{maxAge:i=this.#h}={}){let s=typeof i=="number"&&i!==Number.POSITIVE_INFINITY?Date.now()+i:void 0;return this.#r.has(e)?this.#r.set(e,{value:r,expiry:s}):this.#l(e,{value:r,expiry:s}),this}has(e){return this.#r.has(e)?!this.#u(e,this.#r.get(e)):this.#e.has(e)?!this.#u(e,this.#e.get(e)):!1}peek(e){if(this.#r.has(e))return this.#i(e,this.#r);if(this.#e.has(e))return this.#i(e,this.#e)}expiresIn(e){let r=this.#r.get(e)??this.#e.get(e);if(r)return r.expiry?r.expiry-Date.now():Number.POSITIVE_INFINITY}delete(e){let r=this.#r.delete(e);return r&&this.#t--,this.#e.delete(e)||r}clear(){this.#r.clear(),this.#e.clear(),this.#t=0}resize(e){if(!(e&&e>0))throw new TypeError("`maxSize` must be a number greater than 0");let r=[...this.#d()],i=r.length-e;i<0?(this.#r=new Map(r),this.#e=new Map,this.#t=r.length):(i>0&&this.#a(r.slice(0,i)),this.#e=new Map(r.slice(i)),this.#r=new Map,this.#t=0),this.#n=e}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.#r){let[r,i]=e;this.#u(r,i)===!1&&(yield[r,i.value])}for(let e of this.#e){let[r,i]=e;this.#r.has(r)||this.#u(r,i)===!1&&(yield[r,i.value])}}*entriesDescending(){let e=[...this.#r];for(let r=e.length-1;r>=0;--r){let i=e[r],[s,n]=i;this.#u(s,n)===!1&&(yield[s,n.value])}e=[...this.#e];for(let r=e.length-1;r>=0;--r){let i=e[r],[s,n]=i;this.#r.has(s)||this.#u(s,n)===!1&&(yield[s,n.value])}}*entriesAscending(){for(let[e,r]of this.#d())yield[e,r.value]}get size(){if(!this.#t)return this.#e.size;let e=0;for(let r of this.#e.keys())this.#r.has(r)||e++;return Math.min(this.#t+e,this.#n)}get maxSize(){return this.#n}entries(){return this.entriesAscending()}forEach(e,r=this){for(let[i,s]of this.entriesAscending())e.call(r,s,i,this)}get[Symbol.toStringTag](){return"QuickLRU"}toString(){return`QuickLRU(${this.size}/${this.maxSize})`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},zb=(t,e)=>t.some(r=>typeof r=="string"?r===e:(r.lastIndex=0,r.test(e))),Jo=new Gb({maxSize:1e5}),Hr=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp)&&!(t instanceof Error)&&!(t instanceof Date),Kr=(t,e={},r=new WeakMap,i)=>{if(!Hr(t))return t;if(r.has(t))return r.get(t);let{exclude:s,pascalCase:n=!1,stopPaths:a,deep:o=!1,preserveConsecutiveUppercase:c=!1}=e,l=new Set(a);if(Array.isArray(t)){let p=[];r.set(t,p);for(let m of t)p.push(Hr(m)?Kr(m,e,r,i):m);return p}let u={};r.set(t,u);let g=Fb(t,(p=>(m,y)=>{if(o&&Hr(y)){let b=p===void 0?m:`${p}.${m}`;l.has(b)||(y=Array.isArray(y)?y.map(w=>Hr(w)?Kr(w,e,r,b):w):Kr(y,e,r,b))}if(typeof m=="string"&&!(s&&zb(s,m))){let b=n?`${m}_`:m;if(Jo.has(b))m=Jo.get(b);else{let w=Ub(m,{pascalCase:n,locale:!1,preserveConsecutiveUppercase:c});m.length<100&&Jo.set(b,w),m=w}}return[m,y]})(i),{deep:!1});Object.assign(u,g);let h=Object.getOwnPropertySymbols(t);for(let p of h)u[p]=o&&Hr(t[p])?Kr(t[p],e,r,i):t[p];return u};function Sh(t,e){let r=new WeakMap;return Array.isArray(t)?t.map((i,s)=>Hr(i)?Kr(i,e,r,String(s)):i):Kr(t,e,r)}function Rh(t){let e=0,r=t.length;for(;e<r&&(t[e]==="\r"||t[e]===`
|
|
17
|
+
`)+r,i=s+1,s=t.indexOf(`
|
|
18
|
+
`,i)}while(s!==-1);return n+=t.slice(i),n}var{stdout:$f,stderr:Pf}=Of,ic=Symbol("GENERATOR"),js=Symbol("STYLER"),Ui=Symbol("IS_EMPTY"),If=["ansi","ansi","ansi256","ansi16m"],Bs=Object.create(null),T_=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=$f?$f.level:0;t.level=e.level===void 0?r:e.level};var L_=t=>{let e=(...r)=>r.join(" ");return T_(e,t),Object.setPrototypeOf(e,Gi.prototype),e};function Gi(t){return L_(t)}Object.setPrototypeOf(Gi.prototype,Function.prototype);for(let[t,e]of Object.entries(Lt))Bs[t]={get(){let r=io(this,oc(e.open,e.close,this[js]),this[Ui]);return Object.defineProperty(this,t,{value:r}),r}};Bs.visible={get(){let t=io(this,this[js],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var nc=(t,e,r,...s)=>t==="rgb"?e==="ansi16m"?Lt[r].ansi16m(...s):e==="ansi256"?Lt[r].ansi256(Lt.rgbToAnsi256(...s)):Lt[r].ansi(Lt.rgbToAnsi(...s)):t==="hex"?nc("rgb",e,r,...Lt.hexToRgb(...s)):Lt[r][t](...s),$_=["rgb","hex","ansi256"];for(let t of $_){Bs[t]={get(){let{level:r}=this;return function(...s){let i=oc(nc(t,If[r],"color",...s),Lt.color.close,this[js]);return io(this,i,this[Ui])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);Bs[e]={get(){let{level:r}=this;return function(...s){let i=oc(nc(t,If[r],"bgColor",...s),Lt.bgColor.close,this[js]);return io(this,i,this[Ui])}}}}var P_=Object.defineProperties(()=>{},{...Bs,level:{enumerable:!0,get(){return this[ic].level},set(t){this[ic].level=t}}}),oc=(t,e,r)=>{let s,i;return r===void 0?(s=t,i=e):(s=r.openAll+t,i=e+r.closeAll),{open:t,close:e,openAll:s,closeAll:i,parent:r}},io=(t,e,r)=>{let s=(...i)=>I_(s,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(s,P_),s[ic]=t,s[js]=e,s[Ui]=r,s},I_=(t,e)=>{if(t.level<=0||!e)return t[Ui]?"":e;let r=t[js];if(r===void 0)return e;let{openAll:s,closeAll:i}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=Tf(e,r.close,r.open),r=r.parent;let n=e.indexOf(`
|
|
19
|
+
`);return n!==-1&&(e=Lf(e,i,s,n)),s+e+i};Object.defineProperties(Gi.prototype,Bs);var k_=Gi(),G2=Gi({level:Pf?Pf.level:0});var S=k_;var Hb=nt(Mf(),1);import sl from"node:process";import Uh,{format as Y_}from"util";import{resolve as J_,normalize as X_}from"path";import{readFileSync as Q_}from"fs";import Gh,{createRequire as jf}from"node:module";import yr from"node:path";import ew from"node:process";import tw,{fileURLToPath as zh}from"node:url";import qh from"node:fs";import Qc from"url";function Vi(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",s=!1,i=t.match(/^-+/);for(let n=i?i[0].length:0;n<t.length;n++){let a=t.charAt(n);s&&(s=!1,a=a.toUpperCase()),n!==0&&(a==="-"||a==="_")?s=!0:a!=="-"&&a!=="_"&&(r+=a)}return r}}function Wh(t,e){let r=t.toLowerCase();e=e||"-";let s="";for(let i=0;i<t.length;i++){let n=r.charAt(i),a=t.charAt(i);n!==a&&i>0?s+=`${e}${r.charAt(i)}`:s+=a}return s}function Vh(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function rw(t){if(Array.isArray(t))return t.map(a=>typeof a!="string"?a+"":a);t=t.trim();let e=0,r=null,s=null,i=null,n=[];for(let a=0;a<t.length;a++){if(r=s,s=t.charAt(a),s===" "&&!i){r!==" "&&e++;continue}s===i?i=null:(s==="'"||s==='"')&&!i&&(i=s),n[e]||(n[e]=""),n[e]+=s}return n}var $t;(function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"})($t||($t={}));var Qt,Kc=class{constructor(e){Qt=e}parse(e,r){let s=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},r),i=rw(e),n=typeof e=="string",a=sw(Object.assign(Object.create(null),s.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},s.configuration),c=Object.assign(Object.create(null),s.default),l=s.configObjects||[],u=s.envPrefix,p=o["populate--"],g=p?"--":"_",f=Object.create(null),d=Object.create(null),m=s.__||Qt.format,y={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:[]},v=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,_=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(s.array||[]).filter(Boolean).forEach(function(R){let T=typeof R=="object"?R.key:R,j=Object.keys(R).map(function(I){return{boolean:"bools",string:"strings",number:"numbers"}[I]}).filter(Boolean).pop();j&&(y[j][T]=!0),y.arrays[T]=!0,y.keys.push(T)}),[].concat(s.boolean||[]).filter(Boolean).forEach(function(R){y.bools[R]=!0,y.keys.push(R)}),[].concat(s.string||[]).filter(Boolean).forEach(function(R){y.strings[R]=!0,y.keys.push(R)}),[].concat(s.number||[]).filter(Boolean).forEach(function(R){y.numbers[R]=!0,y.keys.push(R)}),[].concat(s.count||[]).filter(Boolean).forEach(function(R){y.counts[R]=!0,y.keys.push(R)}),[].concat(s.normalize||[]).filter(Boolean).forEach(function(R){y.normalize[R]=!0,y.keys.push(R)}),typeof s.narg=="object"&&Object.entries(s.narg).forEach(([R,T])=>{typeof T=="number"&&(y.nargs[R]=T,y.keys.push(R))}),typeof s.coerce=="object"&&Object.entries(s.coerce).forEach(([R,T])=>{typeof T=="function"&&(y.coercions[R]=T,y.keys.push(R))}),typeof s.config<"u"&&(Array.isArray(s.config)||typeof s.config=="string"?[].concat(s.config).filter(Boolean).forEach(function(R){y.configs[R]=!0}):typeof s.config=="object"&&Object.entries(s.config).forEach(([R,T])=>{(typeof T=="boolean"||typeof T=="function")&&(y.configs[R]=T)})),Fs(s.key,a,s.default,y.arrays),Object.keys(c).forEach(function(R){(y.aliases[R]||[]).forEach(function(T){c[T]=c[R]})});let w=null;s_();let h=[],b=Object.assign(Object.create(null),{_:[]}),x={};for(let R=0;R<i.length;R++){let T=i[R],j=T.replace(/^-{3,}/,"---"),I,C,X,V,se,Ne;if(T!=="--"&&/^-/.test(T)&&eo(T))E(T);else if(j.match(/^---+(=|$)/)){E(T);continue}else if(T.match(/^--.+=/)||!o["short-option-groups"]&&T.match(/^-.+=/))V=T.match(/^--?([^=]+)=([\s\S]*)$/),V!==null&&Array.isArray(V)&&V.length>=3&&(le(V[1],y.arrays)?R=A(R,V[1],i,V[2]):le(V[1],y.nargs)!==!1?R=L(R,V[1],i,V[2]):O(V[1],V[2],!0));else if(T.match(_)&&o["boolean-negation"])V=T.match(_),V!==null&&Array.isArray(V)&&V.length>=2&&(C=V[1],O(C,le(C,y.arrays)?[!1]:!1));else if(T.match(/^--.+/)||!o["short-option-groups"]&&T.match(/^-[^-]+/))V=T.match(/^--?(.+)/),V!==null&&Array.isArray(V)&&V.length>=2&&(C=V[1],le(C,y.arrays)?R=A(R,C,i):le(C,y.nargs)!==!1?R=L(R,C,i):(se=i[R+1],se!==void 0&&(!se.match(/^-/)||se.match(v))&&!le(C,y.bools)&&!le(C,y.counts)||/^(true|false)$/.test(se)?(O(C,se),R++):O(C,Ms(C))));else if(T.match(/^-.\..+=/))V=T.match(/^-([^=]+)=([\s\S]*)$/),V!==null&&Array.isArray(V)&&V.length>=3&&O(V[1],V[2]);else if(T.match(/^-.\..+/)&&!T.match(v))se=i[R+1],V=T.match(/^-(.\..+)/),V!==null&&Array.isArray(V)&&V.length>=2&&(C=V[1],se!==void 0&&!se.match(/^-/)&&!le(C,y.bools)&&!le(C,y.counts)?(O(C,se),R++):O(C,Ms(C)));else if(T.match(/^-[^-]+/)&&!T.match(v)){X=T.slice(1,-1).split(""),I=!1;for(let Qe=0;Qe<X.length;Qe++){if(se=T.slice(Qe+2),X[Qe+1]&&X[Qe+1]==="="){Ne=T.slice(Qe+3),C=X[Qe],le(C,y.arrays)?R=A(R,C,i,Ne):le(C,y.nargs)!==!1?R=L(R,C,i,Ne):O(C,Ne),I=!0;break}if(se==="-"){O(X[Qe],se);continue}if(/[A-Za-z]/.test(X[Qe])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(se)&&le(se,y.bools)===!1){O(X[Qe],se),I=!0;break}if(X[Qe+1]&&X[Qe+1].match(/\W/)){O(X[Qe],se),I=!0;break}else O(X[Qe],Ms(X[Qe]))}C=T.slice(-1)[0],!I&&C!=="-"&&(le(C,y.arrays)?R=A(R,C,i):le(C,y.nargs)!==!1?R=L(R,C,i):(se=i[R+1],se!==void 0&&(!/^(-|--)[^-]/.test(se)||se.match(v))&&!le(C,y.bools)&&!le(C,y.counts)||/^(true|false)$/.test(se)?(O(C,se),R++):O(C,Ms(C))))}else if(T.match(/^-[0-9]$/)&&T.match(v)&&le(T.slice(1),y.bools))C=T.slice(1),O(C,Ms(C));else if(T==="--"){h=i.slice(R+1);break}else if(o["halt-at-non-option"]){h=i.slice(R);break}else E(T)}J(b,!0),J(b,!1),H(b),W(),$e(b,y.aliases,c,!0),fe(b),o["set-placeholder-key"]&&ne(b),Object.keys(y.counts).forEach(function(R){Pe(b,R.split("."))||O(R,0)}),p&&h.length&&(b[g]=[]),h.forEach(function(R){b[g].push(R)}),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(b).filter(R=>R!=="--"&&R.includes("-")).forEach(R=>{delete b[R]}),o["strip-aliased"]&&[].concat(...Object.keys(a).map(R=>a[R])).forEach(R=>{o["camel-case-expansion"]&&R.includes("-")&&delete b[R.split(".").map(T=>Vi(T)).join(".")],delete b[R]});function E(R){let T=P("_",R);(typeof T=="string"||typeof T=="number")&&b._.push(T)}function L(R,T,j,I){let C,X=le(T,y.nargs);if(X=typeof X!="number"||isNaN(X)?1:X,X===0)return Jt(I)||(w=Error(m("Argument unexpected for: %s",T))),O(T,Ms(T)),R;let V=Jt(I)?0:1;if(o["nargs-eats-options"])j.length-(R+1)+V<X&&(w=Error(m("Not enough arguments following: %s",T))),V=X;else{for(C=R+1;C<j.length&&(!j[C].match(/^-[^0-9]/)||j[C].match(v)||eo(j[C]));C++)V++;V<X&&(w=Error(m("Not enough arguments following: %s",T)))}let se=Math.min(V,X);for(!Jt(I)&&se>0&&(O(T,I),se--),C=R+1;C<se+R+1;C++)O(T,j[C]);return R+se}function A(R,T,j,I){let C=[],X=I||j[R+1],V=le(T,y.nargs);if(le(T,y.bools)&&!/^(true|false)$/.test(X))C.push(!0);else if(Jt(X)||Jt(I)&&/^-/.test(X)&&!v.test(X)&&!eo(X)){if(c[T]!==void 0){let se=c[T];C=Array.isArray(se)?se:[se]}}else{Jt(I)||C.push(z(T,I,!0));for(let se=R+1;se<j.length&&!(!o["greedy-arrays"]&&C.length>0||V&&typeof V=="number"&&C.length>=V||(X=j[se],/^-/.test(X)&&!v.test(X)&&!eo(X)));se++)R=se,C.push(z(T,X,n))}return typeof V=="number"&&(V&&C.length<V||isNaN(V)&&C.length===0)&&(w=Error(m("Not enough arguments following: %s",T))),O(T,C),R}function O(R,T,j=n){if(/-/.test(R)&&o["camel-case-expansion"]){let X=R.split(".").map(function(V){return Vi(V)}).join(".");k(R,X)}let I=z(R,T,j),C=R.split(".");Ue(b,C,I),y.aliases[R]&&y.aliases[R].forEach(function(X){let V=X.split(".");Ue(b,V,I)}),C.length>1&&o["dot-notation"]&&(y.aliases[C[0]]||[]).forEach(function(X){let V=X.split("."),se=[].concat(C);se.shift(),V=V.concat(se),(y.aliases[R]||[]).includes(V.join("."))||Ue(b,V,I)}),le(R,y.normalize)&&!le(R,y.arrays)&&[R].concat(y.aliases[R]||[]).forEach(function(V){Object.defineProperty(x,V,{enumerable:!0,get(){return T},set(se){T=typeof se=="string"?Qt.normalize(se):se}})})}function k(R,T){y.aliases[R]&&y.aliases[R].length||(y.aliases[R]=[T],f[T]=!0),y.aliases[T]&&y.aliases[T].length||k(T,R)}function z(R,T,j){j&&(T=iw(T)),(le(R,y.bools)||le(R,y.counts))&&typeof T=="string"&&(T=T==="true");let I=Array.isArray(T)?T.map(function(C){return P(R,C)}):P(R,T);return le(R,y.counts)&&(Jt(I)||typeof I=="boolean")&&(I=uc()),le(R,y.normalize)&&le(R,y.arrays)&&(Array.isArray(T)?I=T.map(C=>Qt.normalize(C)):I=Qt.normalize(T)),I}function P(R,T){return!o["parse-positional-numbers"]&&R==="_"||!le(R,y.strings)&&!le(R,y.bools)&&!Array.isArray(T)&&(Vh(T)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${T}`)))||!Jt(T)&&le(R,y.numbers))&&(T=Number(T)),T}function H(R){let T=Object.create(null);$e(T,y.aliases,c),Object.keys(y.configs).forEach(function(j){let I=R[j]||T[j];if(I)try{let C=null,X=Qt.resolve(Qt.cwd(),I),V=y.configs[j];if(typeof V=="function"){try{C=V(X)}catch(se){C=se}if(C instanceof Error){w=C;return}}else C=Qt.require(X);re(C)}catch(C){C.name==="PermissionDenied"?w=C:R[j]&&(w=Error(m("Invalid JSON config file: %s",I)))}})}function re(R,T){Object.keys(R).forEach(function(j){let I=R[j],C=T?T+"."+j:j;typeof I=="object"&&I!==null&&!Array.isArray(I)&&o["dot-notation"]?re(I,C):(!Pe(b,C.split("."))||le(C,y.arrays)&&o["combine-arrays"])&&O(C,I)})}function W(){typeof l<"u"&&l.forEach(function(R){re(R)})}function J(R,T){if(typeof u>"u")return;let j=typeof u=="string"?u:"",I=Qt.env();Object.keys(I).forEach(function(C){if(j===""||C.lastIndexOf(j,0)===0){let X=C.split("__").map(function(V,se){return se===0&&(V=V.substring(j.length)),Vi(V)});(T&&y.configs[X.join(".")]||!T)&&!Pe(R,X)&&O(X.join("."),I[C])}})}function fe(R){let T,j=new Set;Object.keys(R).forEach(function(I){if(!j.has(I)&&(T=le(I,y.coercions),typeof T=="function"))try{let C=P(I,T(R[I]));[].concat(y.aliases[I]||[],I).forEach(X=>{j.add(X),R[X]=C})}catch(C){w=C}})}function ne(R){return y.keys.forEach(T=>{~T.indexOf(".")||typeof R[T]>"u"&&(R[T]=void 0)}),R}function $e(R,T,j,I=!1){Object.keys(j).forEach(function(C){Pe(R,C.split("."))||(Ue(R,C.split("."),j[C]),I&&(d[C]=!0),(T[C]||[]).forEach(function(X){Pe(R,X.split("."))||Ue(R,X.split("."),j[C])}))})}function Pe(R,T){let j=R;o["dot-notation"]||(T=[T.join(".")]),T.slice(0,-1).forEach(function(C){j=j[C]||{}});let I=T[T.length-1];return typeof j!="object"?!1:I in j}function Ue(R,T,j){let I=R;o["dot-notation"]||(T=[T.join(".")]),T.slice(0,-1).forEach(function(Ne){Ne=Bf(Ne),typeof I=="object"&&I[Ne]===void 0&&(I[Ne]={}),typeof I[Ne]!="object"||Array.isArray(I[Ne])?(Array.isArray(I[Ne])?I[Ne].push({}):I[Ne]=[I[Ne],{}],I=I[Ne][I[Ne].length-1]):I=I[Ne]});let C=Bf(T[T.length-1]),X=le(T.join("."),y.arrays),V=Array.isArray(j),se=o["duplicate-arguments-array"];!se&&le(C,y.nargs)&&(se=!0,(!Jt(I[C])&&y.nargs[C]===1||Array.isArray(I[C])&&I[C].length===y.nargs[C])&&(I[C]=void 0)),j===uc()?I[C]=uc(I[C]):Array.isArray(I[C])?se&&X&&V?I[C]=o["flatten-duplicate-arrays"]?I[C].concat(j):(Array.isArray(I[C][0])?I[C]:[I[C]]).concat([j]):!se&&!!X==!!V?I[C]=j:I[C]=I[C].concat([j]):I[C]===void 0&&X?I[C]=V?j:[j]:se&&!(I[C]===void 0||le(C,y.counts)||le(C,y.bools))?I[C]=[I[C],j]:I[C]=j}function Fs(...R){R.forEach(function(T){Object.keys(T||{}).forEach(function(j){y.aliases[j]||(y.aliases[j]=[].concat(a[j]||[]),y.aliases[j].concat(j).forEach(function(I){if(/-/.test(I)&&o["camel-case-expansion"]){let C=Vi(I);C!==j&&y.aliases[j].indexOf(C)===-1&&(y.aliases[j].push(C),f[C]=!0)}}),y.aliases[j].concat(j).forEach(function(I){if(I.length>1&&/[A-Z]/.test(I)&&o["camel-case-expansion"]){let C=Wh(I,"-");C!==j&&y.aliases[j].indexOf(C)===-1&&(y.aliases[j].push(C),f[C]=!0)}}),y.aliases[j].forEach(function(I){y.aliases[I]=[j].concat(y.aliases[j].filter(function(C){return I!==C}))}))})})}function le(R,T){let j=[].concat(y.aliases[R]||[],R),I=Object.keys(T),C=j.find(X=>I.includes(X));return C?T[C]:!1}function Qn(R){let T=Object.keys(y);return[].concat(T.map(I=>y[I])).some(function(I){return Array.isArray(I)?I.includes(R):I[R]})}function Xb(R,...T){return[].concat(...T).some(function(I){let C=R.match(I);return C&&Qn(C[1])})}function Qb(R){if(R.match(v)||!R.match(/^-[^-]+/))return!1;let T=!0,j,I=R.slice(1).split("");for(let C=0;C<I.length;C++){if(j=R.slice(C+2),!Qn(I[C])){T=!1;break}if(I[C+1]&&I[C+1]==="="||j==="-"||/[A-Za-z]/.test(I[C])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(j)||I[C+1]&&I[C+1].match(/\W/))break}return T}function eo(R){return o["unknown-options-as-args"]&&e_(R)}function e_(R){return R=R.replace(/^-{3,}/,"--"),R.match(v)||Qb(R)?!1:!Xb(R,/^-+([^=]+?)=[\s\S]*$/,_,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function Ms(R){return!le(R,y.bools)&&!le(R,y.counts)&&`${R}`in c?c[R]:t_(r_(R))}function t_(R){return{[$t.BOOLEAN]:!0,[$t.STRING]:"",[$t.NUMBER]:void 0,[$t.ARRAY]:[]}[R]}function r_(R){let T=$t.BOOLEAN;return le(R,y.strings)?T=$t.STRING:le(R,y.numbers)?T=$t.NUMBER:le(R,y.bools)?T=$t.BOOLEAN:le(R,y.arrays)&&(T=$t.ARRAY),T}function Jt(R){return R===void 0}function s_(){Object.keys(y.counts).find(R=>le(R,y.arrays)?(w=Error(m("Invalid configuration: %s, opts.count excludes opts.array.",R)),!0):le(R,y.nargs)?(w=Error(m("Invalid configuration: %s, opts.count excludes opts.narg.",R)),!0):!1)}return{aliases:Object.assign({},y.aliases),argv:Object.assign(x,b),configuration:o,defaulted:Object.assign({},d),error:w,newAliases:Object.assign({},f)}}};function sw(t){let e=[],r=Object.create(null),s=!0;for(Object.keys(t).forEach(function(i){e.push([].concat(t[i],i))});s;){s=!1;for(let i=0;i<e.length;i++)for(let n=i+1;n<e.length;n++)if(e[i].filter(function(o){return e[n].indexOf(o)!==-1}).length){e[i]=e[i].concat(e[n]),e.splice(n,1),s=!0;break}}return e.forEach(function(i){i=i.filter(function(a,o,c){return c.indexOf(a)===o});let n=i.pop();n!==void 0&&typeof n=="string"&&(r[n]=i)}),r}function uc(t){return t!==void 0?t+1:1}function Bf(t){return t==="__proto__"?"___proto___":t}function iw(t){return typeof t=="string"&&(t[0]==="'"||t[0]==='"')&&t[t.length-1]===t[0]?t.substring(1,t.length-1):t}var fc,hc,dc,Uf=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20,Gf=(hc=(fc=process==null?void 0:process.versions)===null||fc===void 0?void 0:fc.node)!==null&&hc!==void 0?hc:(dc=process==null?void 0:process.version)===null||dc===void 0?void 0:dc.slice(1);if(Gf&&Number(Gf.match(/^([^.]+)/)[1])<Uf)throw Error(`yargs parser supports a minimum Node.js version of ${Uf}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var nw=process?process.env:{},zf=jf?jf(import.meta.url):void 0,Zh=new Kc({cwd:process.cwd,env:()=>nw,format:Y_,normalize:X_,resolve:J_,require:t=>{if(typeof zf<"u")return zf(t);if(t.match(/\.json$/))return JSON.parse(Q_(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),Ws=function(e,r){return Zh.parse(e.slice(),r).argv};Ws.detailed=function(t,e){return Zh.parse(t.slice(),e)};Ws.camelCase=Vi;Ws.decamelize=Wh;Ws.looksLikeNumber=Vh;var Hh=t=>typeof t=="object"&&t!==null,qf=t=>Hh(t)&&!(t instanceof RegExp)&&!(t instanceof Error)&&!(t instanceof Date)&&!(globalThis.Blob&&t instanceof globalThis.Blob),ow=Symbol("mapObjectSkip"),Yc=(t,e,r,s=new WeakMap)=>{if(r={deep:!1,target:{},...r},s.has(t))return s.get(t);s.set(t,r.target);let{target:i}=r;delete r.target;let n=a=>a.map(o=>qf(o)?Yc(o,e,r,s):o);if(Array.isArray(t))return n(t);for(let[a,o]of Object.entries(t)){let c=e(a,o,t);if(c===ow)continue;let[l,u,{shouldRecurse:p=!0}={}]=c;l!=="__proto__"&&(r.deep&&p&&qf(u)&&(u=Array.isArray(u)?n(u):Yc(u,e,r,s)),i[l]=u)}return i};function aw(t,e,r){if(!Hh(t))throw new TypeError(`Expected an object, got \`${t}\` (${typeof t})`);if(Array.isArray(t))throw new TypeError("Expected an object, got an array");return Yc(t,e,r)}var cw=/[\p{Lu}]/u,lw=/[\p{Ll}]/u,Wf=/^[\p{Lu}](?![\p{Lu}])/gu,Kh=/([\p{Alpha}\p{N}_]|$)/u,el=/[_.\- ]+/,uw=new RegExp("^"+el.source),Vf=new RegExp(el.source+Kh.source,"gu"),Zf=new RegExp("\\d+"+Kh.source,"gu"),fw=(t,e,r,s)=>{let i=!1,n=!1,a=!1,o=!1;for(let c=0;c<t.length;c++){let l=t[c];o=c>2?t[c-3]==="-":!0,i&&cw.test(l)?(t=t.slice(0,c)+"-"+t.slice(c),i=!1,a=n,n=!0,c++):n&&a&&lw.test(l)&&(!o||s)?(t=t.slice(0,c-1)+"-"+t.slice(c-1),a=n,n=!1,i=!0):(i=e(l)===l&&r(l)!==l,a=n,n=r(l)===l&&e(l)!==l)}return t},hw=(t,e)=>(Wf.lastIndex=0,t.replaceAll(Wf,r=>e(r))),dw=(t,e)=>(Vf.lastIndex=0,Zf.lastIndex=0,t.replaceAll(Zf,(r,s,i)=>["_","-"].includes(t.charAt(i+r.length))?r:e(r)).replaceAll(Vf,(r,s)=>e(s)));function pw(t,e){if(!(typeof t=="string"||Array.isArray(t)))throw new TypeError("Expected the input to be `string | string[]`");if(e={pascalCase:!1,preserveConsecutiveUppercase:!1,...e},Array.isArray(t)?t=t.map(n=>n.trim()).filter(n=>n.length).join("-"):t=t.trim(),t.length===0)return"";let r=e.locale===!1?n=>n.toLowerCase():n=>n.toLocaleLowerCase(e.locale),s=e.locale===!1?n=>n.toUpperCase():n=>n.toLocaleUpperCase(e.locale);return t.length===1?el.test(t)?"":e.pascalCase?s(t):r(t):(t!==r(t)&&(t=fw(t,r,s,e.preserveConsecutiveUppercase)),t=t.replace(uw,""),t=e.preserveConsecutiveUppercase?hw(t,r):r(t),e.pascalCase&&(t=s(t.charAt(0))+t.slice(1)),dw(t,s))}var mw=class extends Map{#t=0;#r=new Map;#e=new Map;#n;#f;#_;constructor(e={}){if(super(),!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof e.maxAge=="number"&&e.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.#n=e.maxSize,this.#f=e.maxAge||Number.POSITIVE_INFINITY,this.#_=e.onEviction}get __oldCache(){return this.#e}#a(e){if(typeof this.#_=="function")for(let[r,s]of e)this.#_(r,s.value)}#u(e,r){return typeof r.expiry=="number"&&r.expiry<=Date.now()?(typeof this.#_=="function"&&this.#_(e,r.value),this.delete(e)):!1}#i(e,r){if(this.#u(e,r)===!1)return r.value}#c(e,r){return r.expiry?this.#i(e,r):r.value}#s(e,r){let s=r.get(e);return this.#c(e,s)}#l(e,r){this.#r.set(e,r),this.#t++,this.#t>=this.#n&&(this.#t=0,this.#a(this.#e),this.#e=this.#r,this.#r=new Map)}#o(e,r){this.#e.delete(e),this.#l(e,r)}*#p(){for(let e of this.#e){let[r,s]=e;this.#r.has(r)||this.#u(r,s)===!1&&(yield e)}for(let e of this.#r){let[r,s]=e;this.#u(r,s)===!1&&(yield e)}}get(e){if(this.#r.has(e)){let r=this.#r.get(e);return this.#c(e,r)}if(this.#e.has(e)){let r=this.#e.get(e);if(this.#u(e,r)===!1)return this.#o(e,r),r.value}}set(e,r,{maxAge:s=this.#f}={}){let i=typeof s=="number"&&s!==Number.POSITIVE_INFINITY?Date.now()+s:void 0;return this.#r.has(e)?this.#r.set(e,{value:r,expiry:i}):this.#l(e,{value:r,expiry:i}),this}has(e){return this.#r.has(e)?!this.#u(e,this.#r.get(e)):this.#e.has(e)?!this.#u(e,this.#e.get(e)):!1}peek(e){if(this.#r.has(e))return this.#s(e,this.#r);if(this.#e.has(e))return this.#s(e,this.#e)}expiresIn(e){let r=this.#r.get(e)??this.#e.get(e);if(r)return r.expiry?r.expiry-Date.now():Number.POSITIVE_INFINITY}delete(e){let r=this.#r.delete(e);return r&&this.#t--,this.#e.delete(e)||r}clear(){this.#r.clear(),this.#e.clear(),this.#t=0}resize(e){if(!(e&&e>0))throw new TypeError("`maxSize` must be a number greater than 0");let r=[...this.#p()],s=r.length-e;s<0?(this.#r=new Map(r),this.#e=new Map,this.#t=r.length):(s>0&&this.#a(r.slice(0,s)),this.#e=new Map(r.slice(s)),this.#r=new Map,this.#t=0),this.#n=e}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.#r){let[r,s]=e;this.#u(r,s)===!1&&(yield[r,s.value])}for(let e of this.#e){let[r,s]=e;this.#r.has(r)||this.#u(r,s)===!1&&(yield[r,s.value])}}*entriesDescending(){let e=[...this.#r];for(let r=e.length-1;r>=0;--r){let s=e[r],[i,n]=s;this.#u(i,n)===!1&&(yield[i,n.value])}e=[...this.#e];for(let r=e.length-1;r>=0;--r){let s=e[r],[i,n]=s;this.#r.has(i)||this.#u(i,n)===!1&&(yield[i,n.value])}}*entriesAscending(){for(let[e,r]of this.#p())yield[e,r.value]}get size(){if(!this.#t)return this.#e.size;let e=0;for(let r of this.#e.keys())this.#r.has(r)||e++;return Math.min(this.#t+e,this.#n)}get maxSize(){return this.#n}entries(){return this.entriesAscending()}forEach(e,r=this){for(let[s,i]of this.entriesAscending())e.call(r,i,s,this)}get[Symbol.toStringTag](){return"QuickLRU"}toString(){return`QuickLRU(${this.size}/${this.maxSize})`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},gw=(t,e)=>t.some(r=>typeof r=="string"?r===e:(r.lastIndex=0,r.test(e))),pc=new mw({maxSize:1e5}),zs=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp)&&!(t instanceof Error)&&!(t instanceof Date),qs=(t,e={},r=new WeakMap,s)=>{if(!zs(t))return t;if(r.has(t))return r.get(t);let{exclude:i,pascalCase:n=!1,stopPaths:a,deep:o=!1,preserveConsecutiveUppercase:c=!1}=e,l=new Set(a);if(Array.isArray(t)){let d=[];r.set(t,d);for(let m of t)d.push(zs(m)?qs(m,e,r,s):m);return d}let u={};r.set(t,u);let g=aw(t,(d=>(m,y)=>{if(o&&zs(y)){let v=d===void 0?m:`${d}.${m}`;l.has(v)||(y=Array.isArray(y)?y.map(_=>zs(_)?qs(_,e,r,v):_):qs(y,e,r,v))}if(typeof m=="string"&&!(i&&gw(i,m))){let v=n?`${m}_`:m;if(pc.has(v))m=pc.get(v);else{let _=pw(m,{pascalCase:n,locale:!1,preserveConsecutiveUppercase:c});m.length<100&&pc.set(v,_),m=_}}return[m,y]})(s),{deep:!1});Object.assign(u,g);let f=Object.getOwnPropertySymbols(t);for(let d of f)u[d]=o&&zs(t[d])?qs(t[d],e,r,s):t[d];return u};function Yh(t,e){let r=new WeakMap;return Array.isArray(t)?t.map((s,i)=>zs(s)?qs(s,e,r,String(i)):s):qs(t,e,r)}function Jh(t){let e=0,r=t.length;for(;e<r&&(t[e]==="\r"||t[e]===`
|
|
20
20
|
`);)e++;for(;r>e&&(t[r-1]==="\r"||t[r-1]===`
|
|
21
|
-
`);)r--;return e>0||r<t.length?t.slice(e,r):t}function qb(t){let e=t.match(/^[ \t]*(?=\S)/gm);if(!e)return t;let r=Number.POSITIVE_INFINITY;for(let i of e)r=Math.min(r,i.length);return r===0||r===Number.POSITIVE_INFINITY?t:t.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),"")}function Wb(t,e=1,r={}){let{indent:i=" ",includeEmptyLines:s=!1}=r;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(e<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${e}\``);if(typeof i!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof i}\``);if(e===0)return t;let n=s?/^/gm:/^(?!\s*$)/gm;return t.replace(n,i.repeat(e))}function ka(t,e=0,r={}){return Wb(qb(t),e,r)}var Eu=t=>t instanceof URL?yh(t):t;function Vb(t,{cwd:e=Ab.cwd(),type:r="file",stopAt:i}={}){let s=Gt.resolve(Eu(e)??""),{root:n}=Gt.parse(s);i=Gt.resolve(s,Eu(i)??n);let a=Gt.isAbsolute(t);for(;s;){let o=a?t:Gt.join(s,t);try{let c=bh.statSync(o,{throwIfNoEntry:!1});if(r==="file"&&c?.isFile()||r==="directory"&&c?.isDirectory())return o}catch{}if(s===i||s===n)break;s=Gt.dirname(s)}}function Qs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Wr={},Ys={exports:{}},_u;function Hb(){if(_u)return Ys.exports;_u=1;let t=process||{},e=t.argv||[],r=t.env||{},i=!(r.NO_COLOR||e.includes("--no-color"))&&(!!r.FORCE_COLOR||e.includes("--color")||t.platform==="win32"||(t.stdout||{}).isTTY&&r.TERM!=="dumb"||!!r.CI),s=(o,c,l=o)=>u=>{let d=""+u,g=d.indexOf(c,o.length);return~g?o+n(d,c,l,g)+c:o+d+c},n=(o,c,l,u)=>{let d="",g=0;do d+=o.substring(g,u)+l,g=u+c.length,u=o.indexOf(c,g);while(~u);return d+o.substring(g)},a=(o=i)=>{let c=o?s:()=>String;return{isColorSupported:o,reset:c("\x1B[0m","\x1B[0m"),bold:c("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:c("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:c("\x1B[3m","\x1B[23m"),underline:c("\x1B[4m","\x1B[24m"),inverse:c("\x1B[7m","\x1B[27m"),hidden:c("\x1B[8m","\x1B[28m"),strikethrough:c("\x1B[9m","\x1B[29m"),black:c("\x1B[30m","\x1B[39m"),red:c("\x1B[31m","\x1B[39m"),green:c("\x1B[32m","\x1B[39m"),yellow:c("\x1B[33m","\x1B[39m"),blue:c("\x1B[34m","\x1B[39m"),magenta:c("\x1B[35m","\x1B[39m"),cyan:c("\x1B[36m","\x1B[39m"),white:c("\x1B[37m","\x1B[39m"),gray:c("\x1B[90m","\x1B[39m"),bgBlack:c("\x1B[40m","\x1B[49m"),bgRed:c("\x1B[41m","\x1B[49m"),bgGreen:c("\x1B[42m","\x1B[49m"),bgYellow:c("\x1B[43m","\x1B[49m"),bgBlue:c("\x1B[44m","\x1B[49m"),bgMagenta:c("\x1B[45m","\x1B[49m"),bgCyan:c("\x1B[46m","\x1B[49m"),bgWhite:c("\x1B[47m","\x1B[49m"),blackBright:c("\x1B[90m","\x1B[39m"),redBright:c("\x1B[91m","\x1B[39m"),greenBright:c("\x1B[92m","\x1B[39m"),yellowBright:c("\x1B[93m","\x1B[39m"),blueBright:c("\x1B[94m","\x1B[39m"),magentaBright:c("\x1B[95m","\x1B[39m"),cyanBright:c("\x1B[96m","\x1B[39m"),whiteBright:c("\x1B[97m","\x1B[39m"),bgBlackBright:c("\x1B[100m","\x1B[49m"),bgRedBright:c("\x1B[101m","\x1B[49m"),bgGreenBright:c("\x1B[102m","\x1B[49m"),bgYellowBright:c("\x1B[103m","\x1B[49m"),bgBlueBright:c("\x1B[104m","\x1B[49m"),bgMagentaBright:c("\x1B[105m","\x1B[49m"),bgCyanBright:c("\x1B[106m","\x1B[49m"),bgWhiteBright:c("\x1B[107m","\x1B[49m")}};return Ys.exports=a(),Ys.exports.createColors=a,Ys.exports}var Bi={},Su;function Kb(){return Su||(Su=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.default=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g,Bi.matchToToken=function(t){var e={type:"invalid",value:t[0],closed:void 0};return t[1]?(e.type="string",e.closed=!!(t[3]||t[4])):t[5]?e.type="comment":t[6]?(e.type="comment",e.closed=!!t[7]):t[8]?e.type="regex":t[9]?e.type="number":t[10]?e.type="name":t[11]?e.type="punctuator":t[12]&&(e.type="whitespace"),e}),Bi}var Zo={},Vr={},Ru;function Yb(){if(Ru)return Vr;Ru=1,Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.isIdentifierChar=c,Vr.isIdentifierName=l,Vr.isIdentifierStart=o;let t="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",e="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",r=new RegExp("["+t+"]"),i=new RegExp("["+t+e+"]");t=e=null;let s=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],n=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function a(u,d){let g=65536;for(let h=0,p=d.length;h<p;h+=2){if(g+=d[h],g>u)return!1;if(g+=d[h+1],g>=u)return!0}return!1}function o(u){return u<65?u===36:u<=90?!0:u<97?u===95:u<=122?!0:u<=65535?u>=170&&r.test(String.fromCharCode(u)):a(u,s)}function c(u){return u<48?u===36:u<58?!0:u<65?!1:u<=90?!0:u<97?u===95:u<=122?!0:u<=65535?u>=170&&i.test(String.fromCharCode(u)):a(u,s)||a(u,n)}function l(u){let d=!0;for(let g=0;g<u.length;g++){let h=u.charCodeAt(g);if((h&64512)===55296&&g+1<u.length){let p=u.charCodeAt(++g);(p&64512)===56320&&(h=65536+((h&1023)<<10)+(p&1023))}if(d){if(d=!1,!o(h))return!1}else if(!c(h))return!1}return!d}return Vr}var Ut={},Cu;function Xb(){if(Cu)return Ut;Cu=1,Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.isKeyword=c,Ut.isReservedWord=s,Ut.isStrictBindOnlyReservedWord=a,Ut.isStrictBindReservedWord=o,Ut.isStrictReservedWord=n;let t={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},e=new Set(t.keyword),r=new Set(t.strict),i=new Set(t.strictBind);function s(l,u){return u&&l==="await"||l==="enum"}function n(l,u){return s(l,u)||r.has(l)}function a(l){return i.has(l)}function o(l,u){return n(l,u)||a(l)}function c(l){return e.has(l)}return Ut}var Au;function Jb(){return Au||(Au=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isIdentifierChar",{enumerable:!0,get:function(){return e.isIdentifierChar}}),Object.defineProperty(t,"isIdentifierName",{enumerable:!0,get:function(){return e.isIdentifierName}}),Object.defineProperty(t,"isIdentifierStart",{enumerable:!0,get:function(){return e.isIdentifierStart}}),Object.defineProperty(t,"isKeyword",{enumerable:!0,get:function(){return r.isKeyword}}),Object.defineProperty(t,"isReservedWord",{enumerable:!0,get:function(){return r.isReservedWord}}),Object.defineProperty(t,"isStrictBindOnlyReservedWord",{enumerable:!0,get:function(){return r.isStrictBindOnlyReservedWord}}),Object.defineProperty(t,"isStrictBindReservedWord",{enumerable:!0,get:function(){return r.isStrictBindReservedWord}}),Object.defineProperty(t,"isStrictReservedWord",{enumerable:!0,get:function(){return r.isStrictReservedWord}});var e=Yb(),r=Xb()})(Zo)),Zo}var Lu;function Zb(){if(Lu)return Wr;Lu=1,Object.defineProperty(Wr,"__esModule",{value:!0});var t=Hb(),e=Kb(),r=Jb();function i(){return typeof process=="object"&&(process.env.FORCE_COLOR==="0"||process.env.FORCE_COLOR==="false")?!1:t.isColorSupported}let s=(x,f)=>v=>x(f(v));function n(x){return{keyword:x.cyan,capitalized:x.yellow,jsxIdentifier:x.yellow,punctuator:x.yellow,number:x.magenta,string:x.green,regex:x.magenta,comment:x.gray,invalid:s(s(x.white,x.bgRed),x.bold),gutter:x.gray,marker:s(x.red,x.bold),message:s(x.red,x.bold),reset:x.reset}}let a=n(t.createColors(!0)),o=n(t.createColors(!1));function c(x){return x?a:o}let l=new Set(["as","async","from","get","of","set"]),u=/\r\n|[\n\r\u2028\u2029]/,d=/^[()[\]{}]$/,g;{let x=/^[a-z][\w-]*$/i,f=function(v,E,_){if(v.type==="name"){if(r.isKeyword(v.value)||r.isStrictReservedWord(v.value,!0)||l.has(v.value))return"keyword";if(x.test(v.value)&&(_[E-1]==="<"||_.slice(E-2,E)==="</"))return"jsxIdentifier";if(v.value[0]!==v.value[0].toLowerCase())return"capitalized"}return v.type==="punctuator"&&d.test(v.value)?"bracket":v.type==="invalid"&&(v.value==="@"||v.value==="#")?"punctuator":v.type};g=function*(v){let E;for(;E=e.default.exec(v);){let _=e.matchToToken(E);yield{type:f(_,E.index,v),value:_.value}}}}function h(x){if(x==="")return"";let f=c(!0),v="";for(let{type:E,value:_}of g(x))E in f?v+=_.split(u).map(O=>f[E](O)).join(`
|
|
22
|
-
`):
|
|
23
|
-
`,
|
|
24
|
-
`);return
|
|
25
|
-
${
|
|
26
|
-
`,e-1);return{line:r===-1?0:t.slice(0,r+1).match(/\n/g).length,column:e-r-1}}function
|
|
21
|
+
`);)r--;return e>0||r<t.length?t.slice(e,r):t}function yw(t){let e=t.match(/^[ \t]*(?=\S)/gm);if(!e)return t;let r=Number.POSITIVE_INFINITY;for(let s of e)r=Math.min(r,s.length);return r===0||r===Number.POSITIVE_INFINITY?t:t.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),"")}function vw(t,e=1,r={}){let{indent:s=" ",includeEmptyLines:i=!1}=r;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(e<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${e}\``);if(typeof s!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof s}\``);if(e===0)return t;let n=i?/^/gm:/^(?!\s*$)/gm;return t.replace(n,s.repeat(e))}function tl(t,e=0,r={}){return vw(yw(t),e,r)}var Hf=t=>t instanceof URL?zh(t):t;function bw(t,{cwd:e=ew.cwd(),type:r="file",stopAt:s}={}){let i=yr.resolve(Hf(e)??""),{root:n}=yr.parse(i);s=yr.resolve(i,Hf(s)??n);let a=yr.isAbsolute(t);for(;i;){let o=a?t:yr.join(i,t);try{let c=qh.statSync(o,{throwIfNoEntry:!1});if(r==="file"&&c?.isFile()||r==="directory"&&c?.isDirectory())return o}catch{}if(i===s||i===n)break;i=yr.dirname(i)}}function uo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Us={},oo={exports:{}},Kf;function _w(){if(Kf)return oo.exports;Kf=1;let t=process||{},e=t.argv||[],r=t.env||{},s=!(r.NO_COLOR||e.includes("--no-color"))&&(!!r.FORCE_COLOR||e.includes("--color")||t.platform==="win32"||(t.stdout||{}).isTTY&&r.TERM!=="dumb"||!!r.CI),i=(o,c,l=o)=>u=>{let p=""+u,g=p.indexOf(c,o.length);return~g?o+n(p,c,l,g)+c:o+p+c},n=(o,c,l,u)=>{let p="",g=0;do p+=o.substring(g,u)+l,g=u+c.length,u=o.indexOf(c,g);while(~u);return p+o.substring(g)},a=(o=s)=>{let c=o?i:()=>String;return{isColorSupported:o,reset:c("\x1B[0m","\x1B[0m"),bold:c("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:c("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:c("\x1B[3m","\x1B[23m"),underline:c("\x1B[4m","\x1B[24m"),inverse:c("\x1B[7m","\x1B[27m"),hidden:c("\x1B[8m","\x1B[28m"),strikethrough:c("\x1B[9m","\x1B[29m"),black:c("\x1B[30m","\x1B[39m"),red:c("\x1B[31m","\x1B[39m"),green:c("\x1B[32m","\x1B[39m"),yellow:c("\x1B[33m","\x1B[39m"),blue:c("\x1B[34m","\x1B[39m"),magenta:c("\x1B[35m","\x1B[39m"),cyan:c("\x1B[36m","\x1B[39m"),white:c("\x1B[37m","\x1B[39m"),gray:c("\x1B[90m","\x1B[39m"),bgBlack:c("\x1B[40m","\x1B[49m"),bgRed:c("\x1B[41m","\x1B[49m"),bgGreen:c("\x1B[42m","\x1B[49m"),bgYellow:c("\x1B[43m","\x1B[49m"),bgBlue:c("\x1B[44m","\x1B[49m"),bgMagenta:c("\x1B[45m","\x1B[49m"),bgCyan:c("\x1B[46m","\x1B[49m"),bgWhite:c("\x1B[47m","\x1B[49m"),blackBright:c("\x1B[90m","\x1B[39m"),redBright:c("\x1B[91m","\x1B[39m"),greenBright:c("\x1B[92m","\x1B[39m"),yellowBright:c("\x1B[93m","\x1B[39m"),blueBright:c("\x1B[94m","\x1B[39m"),magentaBright:c("\x1B[95m","\x1B[39m"),cyanBright:c("\x1B[96m","\x1B[39m"),whiteBright:c("\x1B[97m","\x1B[39m"),bgBlackBright:c("\x1B[100m","\x1B[49m"),bgRedBright:c("\x1B[101m","\x1B[49m"),bgGreenBright:c("\x1B[102m","\x1B[49m"),bgYellowBright:c("\x1B[103m","\x1B[49m"),bgBlueBright:c("\x1B[104m","\x1B[49m"),bgMagentaBright:c("\x1B[105m","\x1B[49m"),bgCyanBright:c("\x1B[106m","\x1B[49m"),bgWhiteBright:c("\x1B[107m","\x1B[49m")}};return oo.exports=a(),oo.exports.createColors=a,oo.exports}var zi={},Yf;function ww(){return Yf||(Yf=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.default=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g,zi.matchToToken=function(t){var e={type:"invalid",value:t[0],closed:void 0};return t[1]?(e.type="string",e.closed=!!(t[3]||t[4])):t[5]?e.type="comment":t[6]?(e.type="comment",e.closed=!!t[7]):t[8]?e.type="regex":t[9]?e.type="number":t[10]?e.type="name":t[11]?e.type="punctuator":t[12]&&(e.type="whitespace"),e}),zi}var mc={},Gs={},Jf;function xw(){if(Jf)return Gs;Jf=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.isIdentifierChar=c,Gs.isIdentifierName=l,Gs.isIdentifierStart=o;let t="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",e="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",r=new RegExp("["+t+"]"),s=new RegExp("["+t+e+"]");t=e=null;let i=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],n=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function a(u,p){let g=65536;for(let f=0,d=p.length;f<d;f+=2){if(g+=p[f],g>u)return!1;if(g+=p[f+1],g>=u)return!0}return!1}function o(u){return u<65?u===36:u<=90?!0:u<97?u===95:u<=122?!0:u<=65535?u>=170&&r.test(String.fromCharCode(u)):a(u,i)}function c(u){return u<48?u===36:u<58?!0:u<65?!1:u<=90?!0:u<97?u===95:u<=122?!0:u<=65535?u>=170&&s.test(String.fromCharCode(u)):a(u,i)||a(u,n)}function l(u){let p=!0;for(let g=0;g<u.length;g++){let f=u.charCodeAt(g);if((f&64512)===55296&&g+1<u.length){let d=u.charCodeAt(++g);(d&64512)===56320&&(f=65536+((f&1023)<<10)+(d&1023))}if(p){if(p=!1,!o(f))return!1}else if(!c(f))return!1}return!p}return Gs}var gr={},Xf;function Ew(){if(Xf)return gr;Xf=1,Object.defineProperty(gr,"__esModule",{value:!0}),gr.isKeyword=c,gr.isReservedWord=i,gr.isStrictBindOnlyReservedWord=a,gr.isStrictBindReservedWord=o,gr.isStrictReservedWord=n;let t={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},e=new Set(t.keyword),r=new Set(t.strict),s=new Set(t.strictBind);function i(l,u){return u&&l==="await"||l==="enum"}function n(l,u){return i(l,u)||r.has(l)}function a(l){return s.has(l)}function o(l,u){return n(l,u)||a(l)}function c(l){return e.has(l)}return gr}var Qf;function Sw(){return Qf||(Qf=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isIdentifierChar",{enumerable:!0,get:function(){return e.isIdentifierChar}}),Object.defineProperty(t,"isIdentifierName",{enumerable:!0,get:function(){return e.isIdentifierName}}),Object.defineProperty(t,"isIdentifierStart",{enumerable:!0,get:function(){return e.isIdentifierStart}}),Object.defineProperty(t,"isKeyword",{enumerable:!0,get:function(){return r.isKeyword}}),Object.defineProperty(t,"isReservedWord",{enumerable:!0,get:function(){return r.isReservedWord}}),Object.defineProperty(t,"isStrictBindOnlyReservedWord",{enumerable:!0,get:function(){return r.isStrictBindOnlyReservedWord}}),Object.defineProperty(t,"isStrictBindReservedWord",{enumerable:!0,get:function(){return r.isStrictBindReservedWord}}),Object.defineProperty(t,"isStrictReservedWord",{enumerable:!0,get:function(){return r.isStrictReservedWord}});var e=xw(),r=Ew()})(mc)),mc}var eh;function Rw(){if(eh)return Us;eh=1,Object.defineProperty(Us,"__esModule",{value:!0});var t=_w(),e=ww(),r=Sw();function s(){return typeof process=="object"&&(process.env.FORCE_COLOR==="0"||process.env.FORCE_COLOR==="false")?!1:t.isColorSupported}let i=(w,h)=>b=>w(h(b));function n(w){return{keyword:w.cyan,capitalized:w.yellow,jsxIdentifier:w.yellow,punctuator:w.yellow,number:w.magenta,string:w.green,regex:w.magenta,comment:w.gray,invalid:i(i(w.white,w.bgRed),w.bold),gutter:w.gray,marker:i(w.red,w.bold),message:i(w.red,w.bold),reset:w.reset}}let a=n(t.createColors(!0)),o=n(t.createColors(!1));function c(w){return w?a:o}let l=new Set(["as","async","from","get","of","set"]),u=/\r\n|[\n\r\u2028\u2029]/,p=/^[()[\]{}]$/,g;{let w=/^[a-z][\w-]*$/i,h=function(b,x,E){if(b.type==="name"){if(r.isKeyword(b.value)||r.isStrictReservedWord(b.value,!0)||l.has(b.value))return"keyword";if(w.test(b.value)&&(E[x-1]==="<"||E.slice(x-2,x)==="</"))return"jsxIdentifier";if(b.value[0]!==b.value[0].toLowerCase())return"capitalized"}return b.type==="punctuator"&&p.test(b.value)?"bracket":b.type==="invalid"&&(b.value==="@"||b.value==="#")?"punctuator":b.type};g=function*(b){let x;for(;x=e.default.exec(b);){let E=e.matchToToken(x);yield{type:h(E,x.index,b),value:E.value}}}}function f(w){if(w==="")return"";let h=c(!0),b="";for(let{type:x,value:E}of g(w))x in h?b+=E.split(u).map(L=>h[x](L)).join(`
|
|
22
|
+
`):b+=E;return b}let d=!1,m=/\r\n|[\n\r\u2028\u2029]/;function y(w,h,b){let x=Object.assign({column:0,line:-1},w.start),E=Object.assign({},x,w.end),{linesAbove:L=2,linesBelow:A=3}=b||{},O=x.line,k=x.column,z=E.line,P=E.column,H=Math.max(O-(L+1),0),re=Math.min(h.length,z+A);O===-1&&(H=0),z===-1&&(re=h.length);let W=z-O,J={};if(W)for(let fe=0;fe<=W;fe++){let ne=fe+O;if(!k)J[ne]=!0;else if(fe===0){let $e=h[ne-1].length;J[ne]=[k,$e-k+1]}else if(fe===W)J[ne]=[0,P];else{let $e=h[ne-fe].length;J[ne]=[0,$e]}}else k===P?k?J[O]=[k,0]:J[O]=!0:J[O]=[k,P-k];return{start:H,end:re,markerLines:J}}function v(w,h,b={}){let x=b.forceColor||s()&&b.highlightCode,E=c(x),L=w.split(m),{start:A,end:O,markerLines:k}=y(h,L,b),z=h.start&&typeof h.start.column=="number",P=String(O).length,re=(x?f(w):w).split(m,O).slice(A,O).map((W,J)=>{let fe=A+1+J,$e=` ${` ${fe}`.slice(-P)} |`,Pe=k[fe],Ue=!k[fe+1];if(Pe){let Fs="";if(Array.isArray(Pe)){let le=W.slice(0,Math.max(Pe[0]-1,0)).replace(/[^\t]/g," "),Qn=Pe[1]||1;Fs=[`
|
|
23
|
+
`,E.gutter($e.replace(/\d/g," "))," ",le,E.marker("^").repeat(Qn)].join(""),Ue&&b.message&&(Fs+=" "+E.message(b.message))}return[E.marker(">"),E.gutter($e),W.length>0?` ${W}`:"",Fs].join("")}else return` ${E.gutter($e)}${W.length>0?` ${W}`:""}`}).join(`
|
|
24
|
+
`);return b.message&&!z&&(re=`${" ".repeat(P+1)}${b.message}
|
|
25
|
+
${re}`),x?E.reset(re):re}function _(w,h,b,x={}){if(!d){d=!0;let L="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning)process.emitWarning(L,"DeprecationWarning");else{let A=new Error(L);A.name="DeprecationWarning",console.warn(new Error(L))}}return b=Math.max(b,0),v(w,{start:{column:b,line:h}},x)}return Us.codeFrameColumns=v,Us.default=_,Us.highlight=f,Us}var Aw=Rw();function Cw(t,e){let r=e===0?-1:t.lastIndexOf(`
|
|
26
|
+
`,e-1);return{line:r===-1?0:t.slice(0,r+1).match(/\n/g).length,column:e-r-1}}function Ow(t,e,{oneBased:r=!1}={}){if(typeof t!="string")throw new TypeError("Text parameter should be a string");if(!Number.isInteger(e))throw new TypeError("Index parameter should be an integer");if(e<0||e>t.length)throw new RangeError("Index out of bounds");let s=Cw(t,e);return r?{line:s.line+1,column:s.column+1}:s}var Tw=t=>`\\u{${t.codePointAt(0).toString(16)}}`,Jc=class t extends Error{name="JSONError";fileName;#t;#r;#e;#n;#f;constructor(e){if(typeof e=="string")super(),this.#e=e;else{let{jsonParseError:r,fileName:s,input:i}=e;super(void 0,{cause:r}),this.#t=i,this.#r=r,this.fileName=s}Error.captureStackTrace?.(this,t)}get message(){this.#e??=`${$w(this.#r.message)}${this.#t===""?" while parsing empty string":""}`;let{codeFrame:e}=this;return`${this.#e}${this.fileName?` in ${this.fileName}`:""}${e?`
|
|
27
27
|
|
|
28
28
|
${e}
|
|
29
|
-
`:""}`}set message(e){this.#e=e}#w(e){if(!this.#r)return;let r=this.#t,i=iv(r,this.#r.message);if(i)return Qb.codeFrameColumns(r,{start:i},{highlightCode:e})}get codeFrame(){return this.#n??=this.#w(!0),this.#n}get rawCodeFrame(){return this.#h??=this.#w(!1),this.#h}},iv=(t,e)=>{let r=e.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);if(!r)return;let{index:i,line:s,column:n}=r.groups;return s&&n?{line:Number(s),column:Number(n)}:tv(t,Number(i),{oneBased:!0})},sv=t=>t.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(e,r,i)=>`"${i}"(${rv(i)})`);function nv(t,e,r){try{return JSON.parse(t,e)}catch(i){throw new Fa({jsonParseError:i,fileName:r,input:t})}}var Qo,Ou;function Ch(){return Ou||(Ou=1,Qo=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),Qo}var ea,$u;function Ah(){if($u)return ea;$u=1;let t="2.0.0",e=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,s=e-6;return ea={MAX_LENGTH:e,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:s,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},ea}var Xs={exports:{}},Tu;function ov(){return Tu||(Tu=1,(function(t,e){let{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:s}=Ah(),n=Ch();e=t.exports={};let a=e.re=[],o=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,g="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[g,i]],p=y=>{for(let[b,w]of h)y=y.split(`${b}*`).join(`${b}{0,${w}}`).split(`${b}+`).join(`${b}{1,${w}}`);return y},m=(y,b,w)=>{let x=p(b),f=d++;n(y,f,b),u[y]=f,c[f]=b,l[f]=x,a[f]=new RegExp(b,w?"g":void 0),o[f]=new RegExp(x,w?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${g}*`),m("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${g}+`),m("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),m("FULL",`^${c[u.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),m("LOOSE",`^${c[u.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),m("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),m("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",c[u.COERCE],!0),m("COERCERTLFULL",c[u.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",m("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",m("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Xs,Xs.exports)),Xs.exports}var ta,Pu;function av(){if(Pu)return ta;Pu=1;let t=Object.freeze({loose:!0}),e=Object.freeze({});return ta=i=>i?typeof i!="object"?t:i:e,ta}var ra,Iu;function cv(){if(Iu)return ra;Iu=1;let t=/^[0-9]+$/,e=(i,s)=>{let n=t.test(i),a=t.test(s);return n&&a&&(i=+i,s=+s),i===s?0:n&&!a?-1:a&&!n?1:i<s?-1:1};return ra={compareIdentifiers:e,rcompareIdentifiers:(i,s)=>e(s,i)},ra}var ia,Fu;function lv(){if(Fu)return ia;Fu=1;let t=Ch(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:r}=Ah(),{safeRe:i,t:s}=ov(),n=av(),{compareIdentifiers:a}=cv();class o{constructor(l,u){if(u=n(u),l instanceof o){if(l.loose===!!u.loose&&l.includePrerelease===!!u.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>e)throw new TypeError(`version is longer than ${e} characters`);t("SemVer",l,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;let d=l.trim().match(u.loose?i[s.LOOSE]:i[s.FULL]);if(!d)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+d[1],this.minor=+d[2],this.patch=+d[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");d[4]?this.prerelease=d[4].split(".").map(g=>{if(/^[0-9]+$/.test(g)){let h=+g;if(h>=0&&h<r)return h}return g}):this.prerelease=[],this.build=d[5]?d[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(l){if(t("SemVer.compare",this.version,this.options,l),!(l instanceof o)){if(typeof l=="string"&&l===this.version)return 0;l=new o(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof o||(l=new o(l,this.options)),a(this.major,l.major)||a(this.minor,l.minor)||a(this.patch,l.patch)}comparePre(l){if(l instanceof o||(l=new o(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let u=0;do{let d=this.prerelease[u],g=l.prerelease[u];if(t("prerelease compare",u,d,g),d===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(d===void 0)return-1;if(d===g)continue;return a(d,g)}while(++u)}compareBuild(l){l instanceof o||(l=new o(l,this.options));let u=0;do{let d=this.build[u],g=l.build[u];if(t("build compare",u,d,g),d===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(d===void 0)return-1;if(d===g)continue;return a(d,g)}while(++u)}inc(l,u,d){if(l.startsWith("pre")){if(!u&&d===!1)throw new Error("invalid increment argument: identifier is empty");if(u){let g=`-${u}`.match(this.options.loose?i[s.PRERELEASELOOSE]:i[s.PRERELEASE]);if(!g||g[1]!==u)throw new Error(`invalid identifier: ${u}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",u,d);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",u,d);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,d),this.inc("pre",u,d);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",u,d),this.inc("pre",u,d);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 g=Number(d)?1:0;if(this.prerelease.length===0)this.prerelease=[g];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(u===this.prerelease.join(".")&&d===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(g)}}if(u){let h=[u,g];d===!1&&(h=[u]),a(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return ia=o,ia}var sa,Nu;function Lh(){if(Nu)return sa;Nu=1;let t=lv();return sa=(r,i,s=!1)=>{if(r instanceof t)return r;try{return new t(r,i)}catch(n){if(!s)return null;throw n}},sa}var na,Du;function Oh(){if(Du)return na;Du=1;let t=Lh();return na=(r,i)=>{let s=t(r,i);return s?s.version:null},na}var oa,Mu;function $h(){if(Mu)return oa;Mu=1;let t=Lh();return oa=(r,i)=>{let s=t(r.trim().replace(/^[=v]+/,""),i);return s?s.version:null},oa}var Th=["0BSD","3D-Slicer-1.0","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","Artistic-dist","Aspell-RU","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-2-Clause-first-lines","BSD-2-Clause-pkgconf-disclaimer","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Boehm-GC-without-fee","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC-PDM-1.0","CC-SA-1.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","Catharon","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CryptoSwift","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","DocBook-DTD","DocBook-Schema","DocBook-Stylesheet","DocBook-XML","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRSD","FSFULLRWD","FSL-1.1-ALv2","FSL-1.1-MIT","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Game-Programming-Gems","Giftware","Glide","Glulxe","Graphics-Gems","Gutmann","HDF5","HIDAPI","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Netrek","HPND-Pbmplus","HPND-UC","HPND-UC-export-US","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-merchantability-variant","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","InnoSetup","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIPS","MIT","MIT-0","MIT-CMU","MIT-Click","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTIA-PD","NTP","NTP-0","Naumen","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMAIL-GPL","SMLNJ","SMPPL","SNIA","SOFA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SUL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","Sendmail-Open-Source-1.1","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","W3C","W3C-19980720","W3C-20150513","WTFPL","Watcom-1.0","Widget-Workshop","Wsuipa","X11","X11-distribute-modifications-variant","X11-swapped","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","any-OSI","any-OSI-perl-modules","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","cve-tou","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","generic-xts","gnuplot","gtkbook","hdparm","iMatix","jove","libpng-1.6.35","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","man2html","metamail","mpi-permissive","mpich2","mplus","ngrep","pkgconf","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","threeparttable","ulem","w3m","wwl","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","xzoom","zlib-acknowledgement"],uv=["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.1","LGPL-3.0","Net-SNMP","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"],hv=["389-exception","Asterisk-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"],aa,ku;function fv(){if(ku)return aa;ku=1;var t=[].concat(Th).concat(uv),e=hv;return aa=function(r){var i=0;function s(){return i<r.length}function n(y){if(y instanceof RegExp){var b=r.slice(i),w=b.match(y);if(w)return i+=w[0].length,w[0]}else if(r.indexOf(y,i)===i)return i+=y.length,y}function a(){n(/[ ]*/)}function o(){for(var y,b=["WITH","AND","OR","(",")",":","+"],w=0;w<b.length&&(y=n(b[w]),!y);w++);if(y==="+"&&i>1&&r[i-2]===" ")throw new Error("Space before `+`");return y&&{type:"OPERATOR",string:y}}function c(){return n(/[A-Za-z0-9-.]+/)}function l(){var y=c();if(!y)throw new Error("Expected idstring at offset "+i);return y}function u(){if(n("DocumentRef-")){var y=l();return{type:"DOCUMENTREF",string:y}}}function d(){if(n("LicenseRef-")){var y=l();return{type:"LICENSEREF",string:y}}}function g(){var y=i,b=c();if(t.indexOf(b)!==-1)return{type:"LICENSE",string:b};if(e.indexOf(b)!==-1)return{type:"EXCEPTION",string:b};i=y}function h(){return o()||u()||d()||g()}for(var p=[];s()&&(a(),!!s());){var m=h();if(!m)throw new Error("Unexpected `"+r[i]+"` at offset "+i);p.push(m)}return p},aa}var ca,ju;function pv(){return ju||(ju=1,ca=function(t){var e=0;function r(){return e<t.length}function i(){return r()?t[e]:null}function s(){if(!r())throw new Error;e++}function n(m){var y=i();if(y&&y.type==="OPERATOR"&&m===y.string)return s(),y.string}function a(){if(n("WITH")){var m=i();if(m&&m.type==="EXCEPTION")return s(),m.string;throw new Error("Expected exception after `WITH`")}}function o(){var m=e,y="",b=i();if(b.type==="DOCUMENTREF"&&(s(),y+="DocumentRef-"+b.string+":",!n(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(b=i(),b.type==="LICENSEREF")return s(),y+="LicenseRef-"+b.string,{license:y};e=m}function c(){var m=i();if(m&&m.type==="LICENSE"){s();var y={license:m.string};n("+")&&(y.plus=!0);var b=a();return b&&(y.exception=b),y}}function l(){var m=n("(");if(m){var y=h();if(!n(")"))throw new Error("Expected `)`");return y}}function u(){return l()||o()||c()}function d(m,y){return function b(){var w=y();if(w){if(!n(m))return w;var x=b();if(!x)throw new Error("Expected expression");return{left:w,conjunction:m.toLowerCase(),right:x}}}}var g=d("AND",u),h=d("OR",g),p=h();if(!p||r())throw new Error("Syntax error");return p}),ca}var la,Bu;function Ph(){if(Bu)return la;Bu=1;var t=fv(),e=pv();return la=function(r){return e(t(r))},la}var ua,Uu;function dv(){if(Uu)return ua;Uu=1;var t=Ph(),e=Th;function r(b){try{return t(b),!0}catch{return!1}}function i(b,w){var x=w[0].length-b[0].length;return x!==0?x:b[0].toUpperCase().localeCompare(w[0].toUpperCase())}var s=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(i),n=0,a=1,o=[function(b){return b.toUpperCase()},function(b){return b.trim()},function(b){return b.replace(/\./g,"")},function(b){return b.replace(/\s+/g,"")},function(b){return b.replace(/\s+/g,"-")},function(b){return b.replace("v","-")},function(b){return b.replace(/,?\s*(\d)/,"-$1")},function(b){return b.replace(/,?\s*(\d)/,"-$1.0")},function(b){return b.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(b){return b.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(b){return b[0].toUpperCase()+b.slice(1)},function(b){return b.replace("/","-")},function(b){return b.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(b){return b.indexOf("3.0")!==-1?b+"-or-later":b+"-only"},function(b){return b+"only"},function(b){return b.replace(/(\d)$/,"-$1.0")},function(b){return b.replace(/(-| )?(\d)$/,"-$2-Clause")},function(b){return b.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(b){return b.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(b){return b.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(b){return b.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(b){return b.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(b){return b.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(b){return"CC-"+b},function(b){return"CC-"+b+"-4.0"},function(b){return b.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(b){return"CC-"+b.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],c=e.map(function(b){var w=/^(.*)-\d+\.\d+$/.exec(b);return w?[w[0],w[1]]:[b,null]}).reduce(function(b,w){var x=w[1];return b[x]=b[x]||[],b[x].push(w[0]),b},{}),l=Object.keys(c).map(function(w){return[w,c[w]]}).filter(function(w){return w[1].length===1&&w[0]!==null&&w[0]!=="APL"}).map(function(w){return[w[0],w[1][0]]});c=void 0;var u=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(l).sort(i),d=0,g=1,h=function(b){for(var w=0;w<o.length;w++){var x=o[w](b).trim();if(x!==b&&r(x))return x}return null},p=function(b){for(var w=b.toUpperCase(),x=0;x<u.length;x++){var f=u[x];if(w.indexOf(f[d])>-1)return f[g]}return null},m=function(b,w){for(var x=0;x<s.length;x++){var f=s[x],v=f[n];if(b.indexOf(v)>-1){var E=b.replace(v,f[a]),_=w(E);if(_!==null)return _}}return null};ua=function(b,w){w=w||{};var x=w.upgrade===void 0?!0:!!w.upgrade;function f(O){return x?y(O):O}var v=typeof b=="string"&&b.trim().length!==0;if(!v)throw Error("Invalid argument. Expected non-empty string.");if(b=b.trim(),r(b))return f(b);var E=b.replace(/\+$/,"").trim();if(r(E))return f(E);var _=h(b);return _!==null||(_=m(b,function(O){return r(O)?O:h(O)}),_!==null)||(_=p(b),_!==null)||(_=m(b,p),_!==null)?f(_):null};function y(b){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(b)!==-1?b+"-only":["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(b)!==-1?b.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(b)!==-1?b+"-or-later":b}return ua}var ha,Gu;function Ih(){if(Gu)return ha;Gu=1;var t=Ph(),e=dv(),r='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',i=/^SEE LICEN[CS]E IN (.+)$/;function s(a,o){return o.slice(0,a.length)===a}function n(a){if(a.hasOwnProperty("license")){var o=a.license;return s("LicenseRef",o)||s("DocumentRef",o)}else return n(a.left)||n(a.right)}return ha=function(a){var o;try{o=t(a)}catch{var c;if(a==="UNLICENSED"||a==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(c=i.exec(a))return{validForOldPackages:!0,validForNewPackages:!0,inFile:c[1]};var l={validForOldPackages:!1,validForNewPackages:!1,warnings:[r]};if(a.trim().length!==0){var u=e(a);u&&l.warnings.push('license is similar to the valid expression "'+u+'"')}return l}return n(o)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[r]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}},ha}var Ui={},zu;function mv(){if(zu)return Ui;zu=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.LRUCache=void 0;let t=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,e=new Set,r=typeof process=="object"&&process?process:{},i=(g,h,p,m)=>{typeof r.emitWarning=="function"?r.emitWarning(g,h,p,m):console.error(`[${p}] ${h}: ${g}`)},s=globalThis.AbortController,n=globalThis.AbortSignal;if(typeof s>"u"){n=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(m,y){this._onabort.push(y)}},s=class{constructor(){h()}signal=new n;abort(m){if(!this.signal.aborted){this.signal.reason=m,this.signal.aborted=!0;for(let y of this.signal._onabort)y(m);this.signal.onabort?.(m)}}};let g=r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",h=()=>{g&&(g=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",h))}}let a=g=>!e.has(g),o=g=>g&&g===Math.floor(g)&&g>0&&isFinite(g),c=g=>o(g)?g<=Math.pow(2,8)?Uint8Array:g<=Math.pow(2,16)?Uint16Array:g<=Math.pow(2,32)?Uint32Array:g<=Number.MAX_SAFE_INTEGER?l:null:null;class l extends Array{constructor(h){super(h),this.fill(0)}}class u{heap;length;static#t=!1;static create(h){let p=c(h);if(!p)return[];u.#t=!0;let m=new u(h,p);return u.#t=!1,m}constructor(h,p){if(!u.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new p(h),this.length=0}push(h){this.heap[this.length++]=h}pop(){return this.heap[--this.length]}}class d{#t;#r;#e;#n;#h;#w;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#u;#s;#c;#i;#l;#o;#d;#g;#y;#p;#C;#x;#E;#_;#S;#v;static unsafeExposeInternals(h){return{starts:h.#x,ttls:h.#E,sizes:h.#C,keyMap:h.#s,keyList:h.#c,valList:h.#i,next:h.#l,prev:h.#o,get head(){return h.#d},get tail(){return h.#g},free:h.#y,isBackgroundFetch:p=>h.#m(p),backgroundFetch:(p,m,y,b)=>h.#F(p,m,y,b),moveToTail:p=>h.#D(p),indexes:p=>h.#L(p),rindexes:p=>h.#$(p),isStale:p=>h.#R(p)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#u}get size(){return this.#a}get fetchMethod(){return this.#h}get memoMethod(){return this.#w}get dispose(){return this.#e}get disposeAfter(){return this.#n}constructor(h){let{max:p=0,ttl:m,ttlResolution:y=1,ttlAutopurge:b,updateAgeOnGet:w,updateAgeOnHas:x,allowStale:f,dispose:v,disposeAfter:E,noDisposeOnSet:_,noUpdateTTL:O,maxSize:C=0,maxEntrySize:$=0,sizeCalculation:F,fetchMethod:M,memoMethod:I,noDeleteOnFetchRejection:Y,noDeleteOnStaleGet:Z,allowStaleOnFetchRejection:G,allowStaleOnFetchAbort:V,ignoreFetchAbort:se}=h;if(p!==0&&!o(p))throw new TypeError("max option must be a nonnegative integer");let ee=p?c(p):Array;if(!ee)throw new Error("invalid max value: "+p);if(this.#t=p,this.#r=C,this.maxEntrySize=$||this.#r,this.sizeCalculation=F,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(I!==void 0&&typeof I!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#w=I,M!==void 0&&typeof M!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#h=M,this.#S=!!M,this.#s=new Map,this.#c=new Array(p).fill(void 0),this.#i=new Array(p).fill(void 0),this.#l=new ee(p),this.#o=new ee(p),this.#d=0,this.#g=0,this.#y=u.create(p),this.#a=0,this.#u=0,typeof v=="function"&&(this.#e=v),typeof E=="function"?(this.#n=E,this.#p=[]):(this.#n=void 0,this.#p=void 0),this.#_=!!this.#e,this.#v=!!this.#n,this.noDisposeOnSet=!!_,this.noUpdateTTL=!!O,this.noDeleteOnFetchRejection=!!Y,this.allowStaleOnFetchRejection=!!G,this.allowStaleOnFetchAbort=!!V,this.ignoreFetchAbort=!!se,this.maxEntrySize!==0){if(this.#r!==0&&!o(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!o(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#I()}if(this.allowStale=!!f,this.noDeleteOnStaleGet=!!Z,this.updateAgeOnGet=!!w,this.updateAgeOnHas=!!x,this.ttlResolution=o(y)||y===0?y:1,this.ttlAutopurge=!!b,this.ttl=m||0,this.ttl){if(!o(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let we="LRU_CACHE_UNBOUNDED";a(we)&&(e.add(we),i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",we,d))}}getRemainingTTL(h){return this.#s.has(h)?1/0:0}#P(){let h=new l(this.#t),p=new l(this.#t);this.#E=h,this.#x=p,this.#M=(b,w,x=t.now())=>{if(p[b]=w!==0?x:0,h[b]=w,w!==0&&this.ttlAutopurge){let f=setTimeout(()=>{this.#R(b)&&this.#b(this.#c[b],"expire")},w+1);f.unref&&f.unref()}},this.#A=b=>{p[b]=h[b]!==0?t.now():0},this.#f=(b,w)=>{if(h[w]){let x=h[w],f=p[w];if(!x||!f)return;b.ttl=x,b.start=f,b.now=m||y();let v=b.now-f;b.remainingTTL=x-v}};let m=0,y=()=>{let b=t.now();if(this.ttlResolution>0){m=b;let w=setTimeout(()=>m=0,this.ttlResolution);w.unref&&w.unref()}return b};this.getRemainingTTL=b=>{let w=this.#s.get(b);if(w===void 0)return 0;let x=h[w],f=p[w];if(!x||!f)return 1/0;let v=(m||y())-f;return x-v},this.#R=b=>{let w=p[b],x=h[b];return!!x&&!!w&&(m||y())-w>x}}#A=()=>{};#f=()=>{};#M=()=>{};#R=()=>!1;#I(){let h=new l(this.#t);this.#u=0,this.#C=h,this.#N=p=>{this.#u-=h[p],h[p]=0},this.#B=(p,m,y,b)=>{if(this.#m(m))return 0;if(!o(y))if(b){if(typeof b!="function")throw new TypeError("sizeCalculation must be a function");if(y=b(m,p),!o(y))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return y},this.#O=(p,m,y)=>{if(h[p]=m,this.#r){let b=this.#r-h[p];for(;this.#u>b;)this.#T(!0)}this.#u+=h[p],y&&(y.entrySize=m,y.totalCalculatedSize=this.#u)}}#N=h=>{};#O=(h,p,m)=>{};#B=(h,p,m,y)=>{if(m||y)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#L({allowStale:h=this.allowStale}={}){if(this.#a)for(let p=this.#g;!(!this.#k(p)||((h||!this.#R(p))&&(yield p),p===this.#d));)p=this.#o[p]}*#$({allowStale:h=this.allowStale}={}){if(this.#a)for(let p=this.#d;!(!this.#k(p)||((h||!this.#R(p))&&(yield p),p===this.#g));)p=this.#l[p]}#k(h){return h!==void 0&&this.#s.get(this.#c[h])===h}*entries(){for(let h of this.#L())this.#i[h]!==void 0&&this.#c[h]!==void 0&&!this.#m(this.#i[h])&&(yield[this.#c[h],this.#i[h]])}*rentries(){for(let h of this.#$())this.#i[h]!==void 0&&this.#c[h]!==void 0&&!this.#m(this.#i[h])&&(yield[this.#c[h],this.#i[h]])}*keys(){for(let h of this.#L()){let p=this.#c[h];p!==void 0&&!this.#m(this.#i[h])&&(yield p)}}*rkeys(){for(let h of this.#$()){let p=this.#c[h];p!==void 0&&!this.#m(this.#i[h])&&(yield p)}}*values(){for(let h of this.#L())this.#i[h]!==void 0&&!this.#m(this.#i[h])&&(yield this.#i[h])}*rvalues(){for(let h of this.#$())this.#i[h]!==void 0&&!this.#m(this.#i[h])&&(yield this.#i[h])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(h,p={}){for(let m of this.#L()){let y=this.#i[m],b=this.#m(y)?y.__staleWhileFetching:y;if(b!==void 0&&h(b,this.#c[m],this))return this.get(this.#c[m],p)}}forEach(h,p=this){for(let m of this.#L()){let y=this.#i[m],b=this.#m(y)?y.__staleWhileFetching:y;b!==void 0&&h.call(p,b,this.#c[m],this)}}rforEach(h,p=this){for(let m of this.#$()){let y=this.#i[m],b=this.#m(y)?y.__staleWhileFetching:y;b!==void 0&&h.call(p,b,this.#c[m],this)}}purgeStale(){let h=!1;for(let p of this.#$({allowStale:!0}))this.#R(p)&&(this.#b(this.#c[p],"expire"),h=!0);return h}info(h){let p=this.#s.get(h);if(p===void 0)return;let m=this.#i[p],y=this.#m(m)?m.__staleWhileFetching:m;if(y===void 0)return;let b={value:y};if(this.#E&&this.#x){let w=this.#E[p],x=this.#x[p];if(w&&x){let f=w-(t.now()-x);b.ttl=f,b.start=Date.now()}}return this.#C&&(b.size=this.#C[p]),b}dump(){let h=[];for(let p of this.#L({allowStale:!0})){let m=this.#c[p],y=this.#i[p],b=this.#m(y)?y.__staleWhileFetching:y;if(b===void 0||m===void 0)continue;let w={value:b};if(this.#E&&this.#x){w.ttl=this.#E[p];let x=t.now()-this.#x[p];w.start=Math.floor(Date.now()-x)}this.#C&&(w.size=this.#C[p]),h.unshift([m,w])}return h}load(h){this.clear();for(let[p,m]of h){if(m.start){let y=Date.now()-m.start;m.start=t.now()-y}this.set(p,m.value,m)}}set(h,p,m={}){if(p===void 0)return this.delete(h),this;let{ttl:y=this.ttl,start:b,noDisposeOnSet:w=this.noDisposeOnSet,sizeCalculation:x=this.sizeCalculation,status:f}=m,{noUpdateTTL:v=this.noUpdateTTL}=m,E=this.#B(h,p,m.size||0,x);if(this.maxEntrySize&&E>this.maxEntrySize)return f&&(f.set="miss",f.maxEntrySizeExceeded=!0),this.#b(h,"set"),this;let _=this.#a===0?void 0:this.#s.get(h);if(_===void 0)_=this.#a===0?this.#g:this.#y.length!==0?this.#y.pop():this.#a===this.#t?this.#T(!1):this.#a,this.#c[_]=h,this.#i[_]=p,this.#s.set(h,_),this.#l[this.#g]=_,this.#o[_]=this.#g,this.#g=_,this.#a++,this.#O(_,E,f),f&&(f.set="add"),v=!1;else{this.#D(_);let O=this.#i[_];if(p!==O){if(this.#S&&this.#m(O)){O.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:C}=O;C!==void 0&&!w&&(this.#_&&this.#e?.(C,h,"set"),this.#v&&this.#p?.push([C,h,"set"]))}else w||(this.#_&&this.#e?.(O,h,"set"),this.#v&&this.#p?.push([O,h,"set"]));if(this.#N(_),this.#O(_,E,f),this.#i[_]=p,f){f.set="replace";let C=O&&this.#m(O)?O.__staleWhileFetching:O;C!==void 0&&(f.oldValue=C)}}else f&&(f.set="update")}if(y!==0&&!this.#E&&this.#P(),this.#E&&(v||this.#M(_,y,b),f&&this.#f(f,_)),!w&&this.#v&&this.#p){let O=this.#p,C;for(;C=O?.shift();)this.#n?.(...C)}return this}pop(){try{for(;this.#a;){let h=this.#i[this.#d];if(this.#T(!0),this.#m(h)){if(h.__staleWhileFetching)return h.__staleWhileFetching}else if(h!==void 0)return h}}finally{if(this.#v&&this.#p){let h=this.#p,p;for(;p=h?.shift();)this.#n?.(...p)}}}#T(h){let p=this.#d,m=this.#c[p],y=this.#i[p];return this.#S&&this.#m(y)?y.__abortController.abort(new Error("evicted")):(this.#_||this.#v)&&(this.#_&&this.#e?.(y,m,"evict"),this.#v&&this.#p?.push([y,m,"evict"])),this.#N(p),h&&(this.#c[p]=void 0,this.#i[p]=void 0,this.#y.push(p)),this.#a===1?(this.#d=this.#g=0,this.#y.length=0):this.#d=this.#l[p],this.#s.delete(m),this.#a--,p}has(h,p={}){let{updateAgeOnHas:m=this.updateAgeOnHas,status:y}=p,b=this.#s.get(h);if(b!==void 0){let w=this.#i[b];if(this.#m(w)&&w.__staleWhileFetching===void 0)return!1;if(this.#R(b))y&&(y.has="stale",this.#f(y,b));else return m&&this.#A(b),y&&(y.has="hit",this.#f(y,b)),!0}else y&&(y.has="miss");return!1}peek(h,p={}){let{allowStale:m=this.allowStale}=p,y=this.#s.get(h);if(y===void 0||!m&&this.#R(y))return;let b=this.#i[y];return this.#m(b)?b.__staleWhileFetching:b}#F(h,p,m,y){let b=p===void 0?void 0:this.#i[p];if(this.#m(b))return b;let w=new s,{signal:x}=m;x?.addEventListener("abort",()=>w.abort(x.reason),{signal:w.signal});let f={signal:w.signal,options:m,context:y},v=(F,M=!1)=>{let{aborted:I}=w.signal,Y=m.ignoreFetchAbort&&F!==void 0;if(m.status&&(I&&!M?(m.status.fetchAborted=!0,m.status.fetchError=w.signal.reason,Y&&(m.status.fetchAbortIgnored=!0)):m.status.fetchResolved=!0),I&&!Y&&!M)return _(w.signal.reason);let Z=C;return this.#i[p]===C&&(F===void 0?Z.__staleWhileFetching?this.#i[p]=Z.__staleWhileFetching:this.#b(h,"fetch"):(m.status&&(m.status.fetchUpdated=!0),this.set(h,F,f.options))),F},E=F=>(m.status&&(m.status.fetchRejected=!0,m.status.fetchError=F),_(F)),_=F=>{let{aborted:M}=w.signal,I=M&&m.allowStaleOnFetchAbort,Y=I||m.allowStaleOnFetchRejection,Z=Y||m.noDeleteOnFetchRejection,G=C;if(this.#i[p]===C&&(!Z||G.__staleWhileFetching===void 0?this.#b(h,"fetch"):I||(this.#i[p]=G.__staleWhileFetching)),Y)return m.status&&G.__staleWhileFetching!==void 0&&(m.status.returnedStale=!0),G.__staleWhileFetching;if(G.__returned===G)throw F},O=(F,M)=>{let I=this.#h?.(h,b,f);I&&I instanceof Promise&&I.then(Y=>F(Y===void 0?void 0:Y),M),w.signal.addEventListener("abort",()=>{(!m.ignoreFetchAbort||m.allowStaleOnFetchAbort)&&(F(void 0),m.allowStaleOnFetchAbort&&(F=Y=>v(Y,!0)))})};m.status&&(m.status.fetchDispatched=!0);let C=new Promise(O).then(v,E),$=Object.assign(C,{__abortController:w,__staleWhileFetching:b,__returned:void 0});return p===void 0?(this.set(h,$,{...f.options,status:void 0}),p=this.#s.get(h)):this.#i[p]=$,$}#m(h){if(!this.#S)return!1;let p=h;return!!p&&p instanceof Promise&&p.hasOwnProperty("__staleWhileFetching")&&p.__abortController instanceof s}async fetch(h,p={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:b=this.noDeleteOnStaleGet,ttl:w=this.ttl,noDisposeOnSet:x=this.noDisposeOnSet,size:f=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:E=this.noUpdateTTL,noDeleteOnFetchRejection:_=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:O=this.allowStaleOnFetchRejection,ignoreFetchAbort:C=this.ignoreFetchAbort,allowStaleOnFetchAbort:$=this.allowStaleOnFetchAbort,context:F,forceRefresh:M=!1,status:I,signal:Y}=p;if(!this.#S)return I&&(I.fetch="get"),this.get(h,{allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:b,status:I});let Z={allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:b,ttl:w,noDisposeOnSet:x,size:f,sizeCalculation:v,noUpdateTTL:E,noDeleteOnFetchRejection:_,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:$,ignoreFetchAbort:C,status:I,signal:Y},G=this.#s.get(h);if(G===void 0){I&&(I.fetch="miss");let V=this.#F(h,G,Z,F);return V.__returned=V}else{let V=this.#i[G];if(this.#m(V)){let Oe=m&&V.__staleWhileFetching!==void 0;return I&&(I.fetch="inflight",Oe&&(I.returnedStale=!0)),Oe?V.__staleWhileFetching:V.__returned=V}let se=this.#R(G);if(!M&&!se)return I&&(I.fetch="hit"),this.#D(G),y&&this.#A(G),I&&this.#f(I,G),V;let ee=this.#F(h,G,Z,F),xe=ee.__staleWhileFetching!==void 0&&m;return I&&(I.fetch=se?"stale":"refresh",xe&&se&&(I.returnedStale=!0)),xe?ee.__staleWhileFetching:ee.__returned=ee}}async forceFetch(h,p={}){let m=await this.fetch(h,p);if(m===void 0)throw new Error("fetch() returned undefined");return m}memo(h,p={}){let m=this.#w;if(!m)throw new Error("no memoMethod provided to constructor");let{context:y,forceRefresh:b,...w}=p,x=this.get(h,w);if(!b&&x!==void 0)return x;let f=m(h,x,{options:w,context:y});return this.set(h,f,w),f}get(h,p={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:b=this.noDeleteOnStaleGet,status:w}=p,x=this.#s.get(h);if(x!==void 0){let f=this.#i[x],v=this.#m(f);return w&&this.#f(w,x),this.#R(x)?(w&&(w.get="stale"),v?(w&&m&&f.__staleWhileFetching!==void 0&&(w.returnedStale=!0),m?f.__staleWhileFetching:void 0):(b||this.#b(h,"expire"),w&&m&&(w.returnedStale=!0),m?f:void 0)):(w&&(w.get="hit"),v?f.__staleWhileFetching:(this.#D(x),y&&this.#A(x),f))}else w&&(w.get="miss")}#j(h,p){this.#o[p]=h,this.#l[h]=p}#D(h){h!==this.#g&&(h===this.#d?this.#d=this.#l[h]:this.#j(this.#o[h],this.#l[h]),this.#j(this.#g,h),this.#g=h)}delete(h){return this.#b(h,"delete")}#b(h,p){let m=!1;if(this.#a!==0){let y=this.#s.get(h);if(y!==void 0)if(m=!0,this.#a===1)this.#G(p);else{this.#N(y);let b=this.#i[y];if(this.#m(b)?b.__abortController.abort(new Error("deleted")):(this.#_||this.#v)&&(this.#_&&this.#e?.(b,h,p),this.#v&&this.#p?.push([b,h,p])),this.#s.delete(h),this.#c[y]=void 0,this.#i[y]=void 0,y===this.#g)this.#g=this.#o[y];else if(y===this.#d)this.#d=this.#l[y];else{let w=this.#o[y];this.#l[w]=this.#l[y];let x=this.#l[y];this.#o[x]=this.#o[y]}this.#a--,this.#y.push(y)}}if(this.#v&&this.#p?.length){let y=this.#p,b;for(;b=y?.shift();)this.#n?.(...b)}return m}clear(){return this.#G("delete")}#G(h){for(let p of this.#$({allowStale:!0})){let m=this.#i[p];if(this.#m(m))m.__abortController.abort(new Error("deleted"));else{let y=this.#c[p];this.#_&&this.#e?.(m,y,h),this.#v&&this.#p?.push([m,y,h])}}if(this.#s.clear(),this.#i.fill(void 0),this.#c.fill(void 0),this.#E&&this.#x&&(this.#E.fill(0),this.#x.fill(0)),this.#C&&this.#C.fill(0),this.#d=0,this.#g=0,this.#y.length=0,this.#u=0,this.#a=0,this.#v&&this.#p){let p=this.#p,m;for(;m=p?.shift();)this.#n?.(...m)}}}return Ui.LRUCache=d,Ui}var fa,qu;function gv(){if(qu)return fa;qu=1;let t=(...n)=>n.every(a=>a)?n.join(""):"",e=n=>n?encodeURIComponent(n):"",r=n=>n.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-"),i={sshtemplate:({domain:n,user:a,project:o,committish:c})=>`git@${n}:${a}/${o}.git${t("#",c)}`,sshurltemplate:({domain:n,user:a,project:o,committish:c})=>`git+ssh://git@${n}/${a}/${o}.git${t("#",c)}`,edittemplate:({domain:n,user:a,project:o,committish:c,editpath:l,path:u})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u)}`,browsetemplate:({domain:n,user:a,project:o,committish:c,treepath:l})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c))}`,browsetreetemplate:({domain:n,user:a,project:o,committish:c,treepath:l,path:u,fragment:d,hashformat:g})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",g(d||""))}`,browseblobtemplate:({domain:n,user:a,project:o,committish:c,blobpath:l,path:u,fragment:d,hashformat:g})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",g(d||""))}`,docstemplate:({domain:n,user:a,project:o,treepath:c,committish:l})=>`https://${n}/${a}/${o}${t("/",c,"/",e(l))}#readme`,httpstemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git+https://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,filetemplate:({domain:n,user:a,project:o,committish:c,path:l})=>`https://${n}/${a}/${o}/raw/${e(c||"HEAD")}/${l}`,shortcuttemplate:({type:n,user:a,project:o,committish:c})=>`${n}:${a}/${o}${t("#",c)}`,pathtemplate:({user:n,project:a,committish:o})=>`${n}/${a}${t("#",o)}`,bugstemplate:({domain:n,user:a,project:o})=>`https://${n}/${a}/${o}/issues`,hashformat:r},s={};s.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:n,user:a,project:o,committish:c,path:l})=>`https://${t(n,"@")}raw.githubusercontent.com/${a}/${o}/${e(c||"HEAD")}/${l}`,gittemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://codeload.${n}/${a}/${o}/tar.gz/${e(c||"HEAD")}`,extract:n=>{let[,a,o,c,l]=n.pathname.split("/",5);if(!(c&&c!=="tree")&&(c||(l=n.hash.slice(1)),o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:l}}},s.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:n,user:a,project:o,committish:c,treepath:l,path:u,editpath:d})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u,d)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/get/${e(c||"HEAD")}.tar.gz`,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(!["get"].includes(c)&&(o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:n.hash.slice(1)}}},s.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",httpstemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git+https://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/repository/archive.tar.gz?ref=${e(c||"HEAD")}`,extract:n=>{let a=n.pathname.slice(1);if(a.includes("/-/")||a.includes("/archive.tar.gz"))return;let o=a.split("/"),c=o.pop();c.endsWith(".git")&&(c=c.slice(0,-4));let l=o.join("/");if(!(!l||!c))return{user:l,project:c,committish:n.hash.slice(1)}}},s.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:n,project:a,committish:o})=>`git@${n}:${a}.git${t("#",o)}`,sshurltemplate:({domain:n,project:a,committish:o})=>`git+ssh://git@${n}/${a}.git${t("#",o)}`,edittemplate:({domain:n,user:a,project:o,committish:c,editpath:l})=>`https://${n}/${a}/${o}${t("/",e(c))}/${l}`,browsetemplate:({domain:n,project:a,committish:o})=>`https://${n}/${a}${t("/",e(o))}`,browsetreetemplate:({domain:n,project:a,committish:o,path:c,hashformat:l})=>`https://${n}/${a}${t("/",e(o))}${t("#",l(c))}`,browseblobtemplate:({domain:n,project:a,committish:o,path:c,hashformat:l})=>`https://${n}/${a}${t("/",e(o))}${t("#",l(c))}`,docstemplate:({domain:n,project:a,committish:o})=>`https://${n}/${a}${t("/",e(o))}`,httpstemplate:({domain:n,project:a,committish:o})=>`git+https://${n}/${a}.git${t("#",o)}`,filetemplate:({user:n,project:a,committish:o,path:c})=>`https://gist.githubusercontent.com/${n}/${a}/raw${t("/",e(o))}/${c}`,shortcuttemplate:({type:n,project:a,committish:o})=>`${n}:${a}${t("#",o)}`,pathtemplate:({project:n,committish:a})=>`${n}${t("#",a)}`,bugstemplate:({domain:n,project:a})=>`https://${n}/${a}`,gittemplate:({domain:n,project:a,committish:o})=>`git://${n}/${a}.git${t("#",o)}`,tarballtemplate:({project:n,committish:a})=>`https://codeload.github.com/gist/${n}/tar.gz/${e(a||"HEAD")}`,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(c!=="raw"){if(!o){if(!a)return;o=a,a=null}return o.endsWith(".git")&&(o=o.slice(0,-4)),{user:a,project:o,committish:n.hash.slice(1)}}},hashformat:function(n){return n&&"file-"+r(n)}},s.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:n,user:a,project:o,committish:c,path:l})=>`https://${n}/${a}/${o}/blob/${e(c)||"HEAD"}/${l}`,httpstemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}.git${t("#",c)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/archive/${e(c)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(!["archive"].includes(c)&&(o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:n.hash.slice(1)}}};for(let[n,a]of Object.entries(s))s[n]=Object.assign({},i,a);return fa=s,fa}var pa,Wu;function Fh(){if(Wu)return pa;Wu=1;let t=Da,e=(n,a,o)=>{let c=n.indexOf(o);return n.lastIndexOf(a,c>-1?c:1/0)},r=n=>{try{return new t.URL(n)}catch{}},i=(n,a)=>{let o=n.indexOf(":"),c=n.slice(0,o+1);if(Object.prototype.hasOwnProperty.call(a,c))return n;let l=n.indexOf("@");return l>-1?l>o?`git+ssh://${n}`:n:n.indexOf("//")===o+1?n:`${n.slice(0,o+1)}//${n.slice(o+1)}`},s=n=>{let a=e(n,"@","#"),o=e(n,":","#");return o>a&&(n=n.slice(0,o)+"/"+n.slice(o+1)),e(n,":","#")===-1&&n.indexOf("//")===-1&&(n=`git+ssh://${n}`),n};return pa=(n,a)=>{let o=a?i(n,a):n;return r(o)||r(s(o))},pa}var da,Vu;function yv(){if(Vu)return da;Vu=1;let t=Fh(),e=r=>{let i=r.indexOf("#"),s=r.indexOf("/"),n=r.indexOf("/",s+1),a=r.indexOf(":"),o=/\s/.exec(r),c=r.indexOf("@"),l=!o||i>-1&&o.index>i,u=c===-1||i>-1&&c>i,d=a===-1||i>-1&&a>i,g=n===-1||i>-1&&n>i,h=s>0,p=i>-1?r[i-1]!=="/":!r.endsWith("/"),m=!r.startsWith(".");return l&&h&&p&&m&&u&&d&&g};return da=(r,i,{gitHosts:s,protocols:n})=>{if(!r)return;let a=e(r)?`github:${r}`:r,o=t(a,n);if(!o)return;let c=s.byShortcut[o.protocol],l=s.byDomain[o.hostname.startsWith("www.")?o.hostname.slice(4):o.hostname],u=c||l;if(!u)return;let d=s[c||l],g=null;n[o.protocol]?.auth&&(o.username||o.password)&&(g=`${o.username}${o.password?":"+o.password:""}`);let h=null,p=null,m=null,y=null;try{if(c){let b=o.pathname.startsWith("/")?o.pathname.slice(1):o.pathname,w=b.indexOf("@");w>-1&&(b=b.slice(w+1));let x=b.lastIndexOf("/");x>-1?(p=decodeURIComponent(b.slice(0,x)),p||(p=null),m=decodeURIComponent(b.slice(x+1))):m=decodeURIComponent(b),m.endsWith(".git")&&(m=m.slice(0,-4)),o.hash&&(h=decodeURIComponent(o.hash.slice(1))),y="shortcut"}else{if(!d.protocols.includes(o.protocol))return;let b=d.extract(o);if(!b)return;p=b.user&&decodeURIComponent(b.user),m=decodeURIComponent(b.project),h=decodeURIComponent(b.committish),y=n[o.protocol]?.name||o.protocol.slice(0,-1)}}catch(b){if(b instanceof URIError)return;throw b}return[u,p,g,m,h,y,i]},da}var ma,Hu;function bv(){if(Hu)return ma;Hu=1;let{LRUCache:t}=mv(),e=gv(),r=yv(),i=Fh(),s=new t({max:1e3});class n{constructor(o,c,l,u,d,g,h={}){Object.assign(this,n.#t[o],{type:o,user:c,auth:l,project:u,committish:d,default:g,opts:h})}static#t={byShortcut:{},byDomain:{}};static#r={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(o,c){n.#t[o]=c,n.#t.byDomain[c.domain]=o,n.#t.byShortcut[`${o}:`]=o,n.#r[`${o}:`]={name:o}}static fromUrl(o,c){if(typeof o!="string")return;let l=o+JSON.stringify(c||{});if(!s.has(l)){let u=r(o,c,{gitHosts:n.#t,protocols:n.#r});s.set(l,u?new n(...u):void 0)}return s.get(l)}static parseUrl(o){return i(o)}#e(o,c){if(typeof o!="function")return null;let l={...this,...this.opts,...c};l.path||(l.path=""),l.path.startsWith("/")&&(l.path=l.path.slice(1)),l.noCommittish&&(l.committish=null);let u=o(l);return l.noGitPlus&&u.startsWith("git+")?u.slice(4):u}hash(){return this.committish?`#${this.committish}`:""}ssh(o){return this.#e(this.sshtemplate,o)}sshurl(o){return this.#e(this.sshurltemplate,o)}browse(o,...c){return typeof o!="string"?this.#e(this.browsetemplate,o):typeof c[0]!="string"?this.#e(this.browsetreetemplate,{...c[0],path:o}):this.#e(this.browsetreetemplate,{...c[1],fragment:c[0],path:o})}browseFile(o,...c){return typeof c[0]!="string"?this.#e(this.browseblobtemplate,{...c[0],path:o}):this.#e(this.browseblobtemplate,{...c[1],fragment:c[0],path:o})}docs(o){return this.#e(this.docstemplate,o)}bugs(o){return this.#e(this.bugstemplate,o)}https(o){return this.#e(this.httpstemplate,o)}git(o){return this.#e(this.gittemplate,o)}shortcut(o){return this.#e(this.shortcuttemplate,o)}path(o){return this.#e(this.pathtemplate,o)}tarball(o){return this.#e(this.tarballtemplate,{...o,noCommittish:!1})}file(o,c){return this.#e(this.filetemplate,{...c,path:o})}edit(o,c){return this.#e(this.edittemplate,{...c,path:o})}getDefaultRepresentation(){return this.default}toString(o){return this.default&&typeof this[this.default]=="function"?this[this.default](o):this.sshurl(o)}}for(let[a,o]of Object.entries(e))n.addHost(a,o);return ma=n,ma}var ga,Ku;function vv(){if(Ku)return ga;Ku=1,ga=t;function t(e){if(!e||e==="ERROR: No README data found!")return;e=e.trim().split(`
|
|
30
|
-
`);let r=0;for(;e[r]&&e[r].trim().match(/^(#|$)/);)r++;let i=e.length,s=r+1;for(;s<i&&e[s].trim();)s++;return e.slice(r,s).join(" ").trim()}return ga}var wv={dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},xv={web:"url",name:"url"},Ev={server:"start",tests:"test"},_v={topLevel:wv,bugs:xv,script:Ev},ya,Yu;function Sv(){if(Yu)return ya;Yu=1;var t=Oh(),e=$h(),r=Ih(),i=bv(),s=gh,n=["dependencies","devDependencies","optionalDependencies"],a=vv(),o=Da,c=_v,l=f=>f.includes("@")&&f.indexOf("@")<f.lastIndexOf(".");ya={warn:function(){},fixRepositoryField:function(f){if(f.repositories&&(this.warn("repositories"),f.repository=f.repositories[0]),!f.repository)return this.warn("missingRepository");typeof f.repository=="string"&&(f.repository={type:"git",url:f.repository});var v=f.repository.url||"";if(v){var E=i.fromUrl(v);E&&(v=f.repository.url=E.getDefaultRepresentation()==="shortcut"?E.https():E.toString())}v.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",v)},fixTypos:function(f){Object.keys(c.topLevel).forEach(function(v){Object.prototype.hasOwnProperty.call(f,v)&&this.warn("typo",v,c.topLevel[v])},this)},fixScriptsField:function(f){if(f.scripts){if(typeof f.scripts!="object"){this.warn("nonObjectScripts"),delete f.scripts;return}Object.keys(f.scripts).forEach(function(v){typeof f.scripts[v]!="string"?(this.warn("nonStringScript"),delete f.scripts[v]):c.script[v]&&!f.scripts[c.script[v]]&&this.warn("typo",v,c.script[v],"scripts")},this)}},fixFilesField:function(f){var v=f.files;v&&!Array.isArray(v)?(this.warn("nonArrayFiles"),delete f.files):f.files&&(f.files=f.files.filter(function(E){return!E||typeof E!="string"?(this.warn("invalidFilename",E),!1):!0},this))},fixBinField:function(f){if(f.bin&&typeof f.bin=="string"){var v={},E;(E=f.name.match(/^@[^/]+[/](.*)$/))?v[E[1]]=f.bin:v[f.name]=f.bin,f.bin=v}},fixManField:function(f){f.man&&typeof f.man=="string"&&(f.man=[f.man])},fixBundleDependenciesField:function(f){var v="bundledDependencies",E="bundleDependencies";f[v]&&!f[E]&&(f[E]=f[v],delete f[v]),f[E]&&!Array.isArray(f[E])?(this.warn("nonArrayBundleDependencies"),delete f[E]):f[E]&&(f[E]=f[E].filter(function(_){return!_||typeof _!="string"?(this.warn("nonStringBundleDependency",_),!1):(f.dependencies||(f.dependencies={}),Object.prototype.hasOwnProperty.call(f.dependencies,_)||(this.warn("nonDependencyBundleDependency",_),f.dependencies[_]="*"),!0)},this))},fixDependencies:function(f){w(f,this.warn),y(f,this.warn),this.fixBundleDependenciesField(f),["dependencies","devDependencies"].forEach(function(v){if(v in f){if(!f[v]||typeof f[v]!="object"){this.warn("nonObjectDependencies",v),delete f[v];return}Object.keys(f[v]).forEach(function(E){var _=f[v][E];typeof _!="string"&&(this.warn("nonStringDependency",E,JSON.stringify(_)),delete f[v][E]);var O=i.fromUrl(f[v][E]);O&&(f[v][E]=O.toString())},this)}},this)},fixModulesField:function(f){f.modules&&(this.warn("deprecatedModules"),delete f.modules)},fixKeywordsField:function(f){typeof f.keywords=="string"&&(f.keywords=f.keywords.split(/,\s+/)),f.keywords&&!Array.isArray(f.keywords)?(delete f.keywords,this.warn("nonArrayKeywords")):f.keywords&&(f.keywords=f.keywords.filter(function(v){return typeof v!="string"||!v?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(f,v){var E=!v;if(!f.version)return f.version="",!0;if(!t(f.version,E))throw new Error('Invalid version: "'+f.version+'"');return f.version=e(f.version,E),!0},fixPeople:function(f){h(f,p),h(f,m)},fixNameField:function(f,v){typeof v=="boolean"?v={strict:v}:typeof v>"u"&&(v={});var E=v.strict;if(!f.name&&!E){f.name="";return}if(typeof f.name!="string")throw new Error("name field must be a string.");E||(f.name=f.name.trim()),g(f.name,E,v.allowLegacyCase),s.builtinModules.includes(f.name)&&this.warn("conflictingName",f.name)},fixDescriptionField:function(f){f.description&&typeof f.description!="string"&&(this.warn("nonStringDescription"),delete f.description),f.readme&&!f.description&&(f.description=a(f.readme)),f.description===void 0&&delete f.description,f.description||this.warn("missingDescription")},fixReadmeField:function(f){f.readme||(this.warn("missingReadme"),f.readme="ERROR: No README data found!")},fixBugsField:function(f){if(!f.bugs&&f.repository&&f.repository.url){var v=i.fromUrl(f.repository.url);v&&v.bugs()&&(f.bugs={url:v.bugs()})}else if(f.bugs){if(typeof f.bugs=="string")l(f.bugs)?f.bugs={email:f.bugs}:o.parse(f.bugs).protocol?f.bugs={url:f.bugs}:this.warn("nonEmailUrlBugsString");else{x(f.bugs,this.warn);var E=f.bugs;f.bugs={},E.url&&(typeof E.url=="string"&&o.parse(E.url).protocol?f.bugs.url=E.url:this.warn("nonUrlBugsUrlField")),E.email&&(typeof E.email=="string"&&l(E.email)?f.bugs.email=E.email:this.warn("nonEmailBugsEmailField"))}!f.bugs.email&&!f.bugs.url&&(delete f.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(f){if(!f.homepage&&f.repository&&f.repository.url){var v=i.fromUrl(f.repository.url);v&&v.docs()&&(f.homepage=v.docs())}if(f.homepage){if(typeof f.homepage!="string")return this.warn("nonUrlHomepage"),delete f.homepage;o.parse(f.homepage).protocol||(f.homepage="http://"+f.homepage)}},fixLicenseField:function(f){let v=f.license||f.licence;if(!v)return this.warn("missingLicense");if(typeof v!="string"||v.length<1||v.trim()==="")return this.warn("invalidLicense");if(!r(v).validForNewPackages)return this.warn("invalidLicense")}};function u(f){if(f.charAt(0)!=="@")return!1;var v=f.slice(1).split("/");return v.length!==2?!1:v[0]&&v[1]&&v[0]===encodeURIComponent(v[0])&&v[1]===encodeURIComponent(v[1])}function d(f){return!f.match(/[/@\s+%:]/)&&f===encodeURIComponent(f)}function g(f,v,E){if(f.charAt(0)==="."||!(u(f)||d(f))||v&&!E&&f!==f.toLowerCase()||f.toLowerCase()==="node_modules"||f.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(f))}function h(f,v){return f.author&&(f.author=v(f.author)),["maintainers","contributors"].forEach(function(E){Array.isArray(f[E])&&(f[E]=f[E].map(v))}),f}function p(f){if(typeof f=="string")return f;var v=f.name||"",E=f.url||f.web,_=E?" ("+E+")":"",O=f.email||f.mail,C=O?" <"+O+">":"";return v+C+_}function m(f){if(typeof f!="string")return f;var v=f.match(/^([^(<]+)/),E=f.match(/\(([^()]+)\)/),_=f.match(/<([^<>]+)>/),O={};return v&&v[0].trim()&&(O.name=v[0].trim()),_&&(O.email=_[1]),E&&(O.url=E[1]),O}function y(f){var v=f.optionalDependencies;if(v){var E=f.dependencies||{};Object.keys(v).forEach(function(_){E[_]=v[_]}),f.dependencies=E}}function b(f,v,E){if(!f)return{};if(typeof f=="string"&&(f=f.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(f))return f;E("deprecatedArrayDependencies",v);var _={};return f.filter(function(O){return typeof O=="string"}).forEach(function(O){O=O.trim().split(/(:?[@\s><=])/);var C=O.shift(),$=O.join("");$=$.trim(),$=$.replace(/^@/,""),_[C]=$}),_}function w(f,v){n.forEach(function(E){f[E]&&(f[E]=b(f[E],E,v))})}function x(f,v){f&&Object.keys(f).forEach(function(E){c.bugs[E]&&(v("typo",E,c.bugs[E],"bugs"),f[c.bugs[E]]=f[E],delete f[E])})}return ya}var Rv="'repositories' (plural) Not supported. Please pick one as the 'repository' field",Cv="No repository field.",Av="Probably broken git url: %s",Lv="scripts must be an object",Ov="script values must be string commands",$v="Invalid 'files' member",Tv="Invalid filename in 'files' list: %s",Pv="Invalid 'bundleDependencies' list. Must be array of package names",Iv="Invalid bundleDependencies member: %s",Fv="Non-dependency in bundleDependencies: %s",Nv="%s field must be an object",Dv="Invalid dependency: %s %s",Mv="specifying %s as array is deprecated",kv="modules field is deprecated",jv="keywords should be an array of strings",Bv="keywords should be an array of strings",Uv="%s is also the name of a node core module.",Gv="'description' field should be a string",zv="No description",qv="No README data",Wv="No license field.",Vv="Bug string field must be url, email, or {email,url}",Hv="bugs.url field must be a string url. Deleted.",Kv="bugs.email field must be a string email. Deleted.",Yv="Normalized value of bugs field is an empty object. Deleted.",Xv="homepage field must be a string url. Deleted.",Jv="license should be a valid SPDX license expression",Zv="%s should probably be %s.",Qv={repositories:Rv,missingRepository:Cv,brokenGitUrl:Av,nonObjectScripts:Lv,nonStringScript:Ov,nonArrayFiles:$v,invalidFilename:Tv,nonArrayBundleDependencies:Pv,nonStringBundleDependency:Iv,nonDependencyBundleDependency:Fv,nonObjectDependencies:Nv,nonStringDependency:Dv,deprecatedArrayDependencies:Mv,deprecatedModules:kv,nonArrayKeywords:jv,nonStringKeyword:Bv,conflictingName:Uv,nonStringDescription:Gv,missingDescription:zv,missingReadme:qv,missingLicense:Wv,nonEmailUrlBugsString:Vv,nonUrlBugsUrlField:Hv,nonEmailBugsEmailField:Kv,emptyNormalizedBugs:Yv,nonUrlHomepage:Xv,invalidLicense:Jv,typo:Zv},ba,Xu;function ew(){if(Xu)return ba;Xu=1;var t=mh,e=Qv;ba=function(){var i=Array.prototype.slice.call(arguments,0),s=i.shift();if(s==="typo")return r.apply(null,i);var n=e[s]?e[s]:s+": '%s'";return i.unshift(n),t.format.apply(null,i)};function r(i,s,n){return n&&(i=n+"['"+i+"']",s=n+"['"+s+"']"),t.format(e.typo,i,s)}return ba}var va,Ju;function tw(){if(Ju)return va;Ju=1,va=n;var t=Sv();n.fixer=t;var e=ew(),r=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],i=["dependencies","people","typos"],s=r.map(function(o){return a(o)+"Field"});s=s.concat(i);function n(o,c,l){c===!0&&(c=null,l=!0),l||(l=!1),(!c||o.private)&&(c=function(){}),o.scripts&&o.scripts.install==="node-gyp rebuild"&&!o.scripts.preinstall&&(o.gypfile=!0),t.warn=function(){c(e.apply(null,arguments))},s.forEach(function(u){t["fix"+a(u)](o,l)}),o._id=o.name+"@"+o.version}function a(o){return o.charAt(0).toUpperCase()+o.slice(1)}return va}var rw=tw(),iw=Qs(rw);function sw(t){return t instanceof URL?yh(t):t}var nw=t=>Gt.resolve(sw(t)??".","package.json"),ow=(t,e)=>{let r=typeof t=="string"?nv(t):t;return e&&iw(r),r};function aw({cwd:t,normalize:e=!0}={}){let r=bh.readFileSync(nw(t),"utf8");return ow(r,e)}function Nh(t){let e=Vb("package.json",t);if(e)return{packageJson:aw({...t,cwd:Gt.dirname(e)}),path:e}}var Gi={},Zu;function cw(){if(Zu)return Gi;Zu=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.LRUCache=void 0;let t=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,e=new Set,r=typeof process=="object"&&process?process:{},i=(g,h,p,m)=>{typeof r.emitWarning=="function"?r.emitWarning(g,h,p,m):console.error(`[${p}] ${h}: ${g}`)},s=globalThis.AbortController,n=globalThis.AbortSignal;if(typeof s>"u"){n=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(m,y){this._onabort.push(y)}},s=class{constructor(){h()}signal=new n;abort(m){if(!this.signal.aborted){this.signal.reason=m,this.signal.aborted=!0;for(let y of this.signal._onabort)y(m);this.signal.onabort?.(m)}}};let g=r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",h=()=>{g&&(g=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",h))}}let a=g=>!e.has(g),o=g=>g&&g===Math.floor(g)&&g>0&&isFinite(g),c=g=>o(g)?g<=Math.pow(2,8)?Uint8Array:g<=Math.pow(2,16)?Uint16Array:g<=Math.pow(2,32)?Uint32Array:g<=Number.MAX_SAFE_INTEGER?l:null:null;class l extends Array{constructor(h){super(h),this.fill(0)}}class u{heap;length;static#t=!1;static create(h){let p=c(h);if(!p)return[];u.#t=!0;let m=new u(h,p);return u.#t=!1,m}constructor(h,p){if(!u.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new p(h),this.length=0}push(h){this.heap[this.length++]=h}pop(){return this.heap[--this.length]}}class d{#t;#r;#e;#n;#h;#w;#a;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#c;#i;#l;#o;#d;#g;#y;#p;#C;#x;#E;#_;#S;#v;#P;#A;#f;static unsafeExposeInternals(h){return{starts:h.#_,ttls:h.#S,sizes:h.#E,keyMap:h.#i,keyList:h.#l,valList:h.#o,next:h.#d,prev:h.#g,get head(){return h.#y},get tail(){return h.#p},free:h.#C,isBackgroundFetch:p=>h.#b(p),backgroundFetch:(p,m,y,b)=>h.#D(p,m,y,b),moveToTail:p=>h.#z(p),indexes:p=>h.#T(p),rindexes:p=>h.#F(p),isStale:p=>h.#O(p)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#c}get size(){return this.#s}get fetchMethod(){return this.#w}get memoMethod(){return this.#a}get dispose(){return this.#e}get onInsert(){return this.#n}get disposeAfter(){return this.#h}constructor(h){let{max:p=0,ttl:m,ttlResolution:y=1,ttlAutopurge:b,updateAgeOnGet:w,updateAgeOnHas:x,allowStale:f,dispose:v,onInsert:E,disposeAfter:_,noDisposeOnSet:O,noUpdateTTL:C,maxSize:$=0,maxEntrySize:F=0,sizeCalculation:M,fetchMethod:I,memoMethod:Y,noDeleteOnFetchRejection:Z,noDeleteOnStaleGet:G,allowStaleOnFetchRejection:V,allowStaleOnFetchAbort:se,ignoreFetchAbort:ee,perf:we}=h;if(we!==void 0&&typeof we?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=we??t,p!==0&&!o(p))throw new TypeError("max option must be a nonnegative integer");let xe=p?c(p):Array;if(!xe)throw new Error("invalid max value: "+p);if(this.#t=p,this.#r=$,this.maxEntrySize=F||this.#r,this.sizeCalculation=M,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(Y!==void 0&&typeof Y!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#a=Y,I!==void 0&&typeof I!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#w=I,this.#P=!!I,this.#i=new Map,this.#l=new Array(p).fill(void 0),this.#o=new Array(p).fill(void 0),this.#d=new xe(p),this.#g=new xe(p),this.#y=0,this.#p=0,this.#C=u.create(p),this.#s=0,this.#c=0,typeof v=="function"&&(this.#e=v),typeof E=="function"&&(this.#n=E),typeof _=="function"?(this.#h=_,this.#x=[]):(this.#h=void 0,this.#x=void 0),this.#v=!!this.#e,this.#f=!!this.#n,this.#A=!!this.#h,this.noDisposeOnSet=!!O,this.noUpdateTTL=!!C,this.noDeleteOnFetchRejection=!!Z,this.allowStaleOnFetchRejection=!!V,this.allowStaleOnFetchAbort=!!se,this.ignoreFetchAbort=!!ee,this.maxEntrySize!==0){if(this.#r!==0&&!o(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!o(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#B()}if(this.allowStale=!!f,this.noDeleteOnStaleGet=!!G,this.updateAgeOnGet=!!w,this.updateAgeOnHas=!!x,this.ttlResolution=o(y)||y===0?y:1,this.ttlAutopurge=!!b,this.ttl=m||0,this.ttl){if(!o(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#M()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let Oe="LRU_CACHE_UNBOUNDED";a(Oe)&&(e.add(Oe),i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Oe,d))}}getRemainingTTL(h){return this.#i.has(h)?1/0:0}#M(){let h=new l(this.#t),p=new l(this.#t);this.#S=h,this.#_=p,this.#N=(b,w,x=this.#u.now())=>{if(p[b]=w!==0?x:0,h[b]=w,w!==0&&this.ttlAutopurge){let f=setTimeout(()=>{this.#O(b)&&this.#U(this.#l[b],"expire")},w+1);f.unref&&f.unref()}},this.#R=b=>{p[b]=h[b]!==0?this.#u.now():0},this.#I=(b,w)=>{if(h[w]){let x=h[w],f=p[w];if(!x||!f)return;b.ttl=x,b.start=f,b.now=m||y();let v=b.now-f;b.remainingTTL=x-v}};let m=0,y=()=>{let b=this.#u.now();if(this.ttlResolution>0){m=b;let w=setTimeout(()=>m=0,this.ttlResolution);w.unref&&w.unref()}return b};this.getRemainingTTL=b=>{let w=this.#i.get(b);if(w===void 0)return 0;let x=h[w],f=p[w];if(!x||!f)return 1/0;let v=(m||y())-f;return x-v},this.#O=b=>{let w=p[b],x=h[b];return!!x&&!!w&&(m||y())-w>x}}#R=()=>{};#I=()=>{};#N=()=>{};#O=()=>!1;#B(){let h=new l(this.#t);this.#c=0,this.#E=h,this.#L=p=>{this.#c-=h[p],h[p]=0},this.#k=(p,m,y,b)=>{if(this.#b(m))return 0;if(!o(y))if(b){if(typeof b!="function")throw new TypeError("sizeCalculation must be a function");if(y=b(m,p),!o(y))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return y},this.#$=(p,m,y)=>{if(h[p]=m,this.#r){let b=this.#r-h[p];for(;this.#c>b;)this.#j(!0)}this.#c+=h[p],y&&(y.entrySize=m,y.totalCalculatedSize=this.#c)}}#L=h=>{};#$=(h,p,m)=>{};#k=(h,p,m,y)=>{if(m||y)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:h=this.allowStale}={}){if(this.#s)for(let p=this.#p;!(!this.#m(p)||((h||!this.#O(p))&&(yield p),p===this.#y));)p=this.#g[p]}*#F({allowStale:h=this.allowStale}={}){if(this.#s)for(let p=this.#y;!(!this.#m(p)||((h||!this.#O(p))&&(yield p),p===this.#p));)p=this.#d[p]}#m(h){return h!==void 0&&this.#i.get(this.#l[h])===h}*entries(){for(let h of this.#T())this.#o[h]!==void 0&&this.#l[h]!==void 0&&!this.#b(this.#o[h])&&(yield[this.#l[h],this.#o[h]])}*rentries(){for(let h of this.#F())this.#o[h]!==void 0&&this.#l[h]!==void 0&&!this.#b(this.#o[h])&&(yield[this.#l[h],this.#o[h]])}*keys(){for(let h of this.#T()){let p=this.#l[h];p!==void 0&&!this.#b(this.#o[h])&&(yield p)}}*rkeys(){for(let h of this.#F()){let p=this.#l[h];p!==void 0&&!this.#b(this.#o[h])&&(yield p)}}*values(){for(let h of this.#T())this.#o[h]!==void 0&&!this.#b(this.#o[h])&&(yield this.#o[h])}*rvalues(){for(let h of this.#F())this.#o[h]!==void 0&&!this.#b(this.#o[h])&&(yield this.#o[h])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(h,p={}){for(let m of this.#T()){let y=this.#o[m],b=this.#b(y)?y.__staleWhileFetching:y;if(b!==void 0&&h(b,this.#l[m],this))return this.get(this.#l[m],p)}}forEach(h,p=this){for(let m of this.#T()){let y=this.#o[m],b=this.#b(y)?y.__staleWhileFetching:y;b!==void 0&&h.call(p,b,this.#l[m],this)}}rforEach(h,p=this){for(let m of this.#F()){let y=this.#o[m],b=this.#b(y)?y.__staleWhileFetching:y;b!==void 0&&h.call(p,b,this.#l[m],this)}}purgeStale(){let h=!1;for(let p of this.#F({allowStale:!0}))this.#O(p)&&(this.#U(this.#l[p],"expire"),h=!0);return h}info(h){let p=this.#i.get(h);if(p===void 0)return;let m=this.#o[p],y=this.#b(m)?m.__staleWhileFetching:m;if(y===void 0)return;let b={value:y};if(this.#S&&this.#_){let w=this.#S[p],x=this.#_[p];if(w&&x){let f=w-(this.#u.now()-x);b.ttl=f,b.start=Date.now()}}return this.#E&&(b.size=this.#E[p]),b}dump(){let h=[];for(let p of this.#T({allowStale:!0})){let m=this.#l[p],y=this.#o[p],b=this.#b(y)?y.__staleWhileFetching:y;if(b===void 0||m===void 0)continue;let w={value:b};if(this.#S&&this.#_){w.ttl=this.#S[p];let x=this.#u.now()-this.#_[p];w.start=Math.floor(Date.now()-x)}this.#E&&(w.size=this.#E[p]),h.unshift([m,w])}return h}load(h){this.clear();for(let[p,m]of h){if(m.start){let y=Date.now()-m.start;m.start=this.#u.now()-y}this.set(p,m.value,m)}}set(h,p,m={}){if(p===void 0)return this.delete(h),this;let{ttl:y=this.ttl,start:b,noDisposeOnSet:w=this.noDisposeOnSet,sizeCalculation:x=this.sizeCalculation,status:f}=m,{noUpdateTTL:v=this.noUpdateTTL}=m,E=this.#k(h,p,m.size||0,x);if(this.maxEntrySize&&E>this.maxEntrySize)return f&&(f.set="miss",f.maxEntrySizeExceeded=!0),this.#U(h,"set"),this;let _=this.#s===0?void 0:this.#i.get(h);if(_===void 0)_=this.#s===0?this.#p:this.#C.length!==0?this.#C.pop():this.#s===this.#t?this.#j(!1):this.#s,this.#l[_]=h,this.#o[_]=p,this.#i.set(h,_),this.#d[this.#p]=_,this.#g[_]=this.#p,this.#p=_,this.#s++,this.#$(_,E,f),f&&(f.set="add"),v=!1,this.#f&&this.#n?.(p,h,"add");else{this.#z(_);let O=this.#o[_];if(p!==O){if(this.#P&&this.#b(O)){O.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:C}=O;C!==void 0&&!w&&(this.#v&&this.#e?.(C,h,"set"),this.#A&&this.#x?.push([C,h,"set"]))}else w||(this.#v&&this.#e?.(O,h,"set"),this.#A&&this.#x?.push([O,h,"set"]));if(this.#L(_),this.#$(_,E,f),this.#o[_]=p,f){f.set="replace";let C=O&&this.#b(O)?O.__staleWhileFetching:O;C!==void 0&&(f.oldValue=C)}}else f&&(f.set="update");this.#f&&this.onInsert?.(p,h,p===O?"update":"replace")}if(y!==0&&!this.#S&&this.#M(),this.#S&&(v||this.#N(_,y,b),f&&this.#I(f,_)),!w&&this.#A&&this.#x){let O=this.#x,C;for(;C=O?.shift();)this.#h?.(...C)}return this}pop(){try{for(;this.#s;){let h=this.#o[this.#y];if(this.#j(!0),this.#b(h)){if(h.__staleWhileFetching)return h.__staleWhileFetching}else if(h!==void 0)return h}}finally{if(this.#A&&this.#x){let h=this.#x,p;for(;p=h?.shift();)this.#h?.(...p)}}}#j(h){let p=this.#y,m=this.#l[p],y=this.#o[p];return this.#P&&this.#b(y)?y.__abortController.abort(new Error("evicted")):(this.#v||this.#A)&&(this.#v&&this.#e?.(y,m,"evict"),this.#A&&this.#x?.push([y,m,"evict"])),this.#L(p),h&&(this.#l[p]=void 0,this.#o[p]=void 0,this.#C.push(p)),this.#s===1?(this.#y=this.#p=0,this.#C.length=0):this.#y=this.#d[p],this.#i.delete(m),this.#s--,p}has(h,p={}){let{updateAgeOnHas:m=this.updateAgeOnHas,status:y}=p,b=this.#i.get(h);if(b!==void 0){let w=this.#o[b];if(this.#b(w)&&w.__staleWhileFetching===void 0)return!1;if(this.#O(b))y&&(y.has="stale",this.#I(y,b));else return m&&this.#R(b),y&&(y.has="hit",this.#I(y,b)),!0}else y&&(y.has="miss");return!1}peek(h,p={}){let{allowStale:m=this.allowStale}=p,y=this.#i.get(h);if(y===void 0||!m&&this.#O(y))return;let b=this.#o[y];return this.#b(b)?b.__staleWhileFetching:b}#D(h,p,m,y){let b=p===void 0?void 0:this.#o[p];if(this.#b(b))return b;let w=new s,{signal:x}=m;x?.addEventListener("abort",()=>w.abort(x.reason),{signal:w.signal});let f={signal:w.signal,options:m,context:y},v=(F,M=!1)=>{let{aborted:I}=w.signal,Y=m.ignoreFetchAbort&&F!==void 0;if(m.status&&(I&&!M?(m.status.fetchAborted=!0,m.status.fetchError=w.signal.reason,Y&&(m.status.fetchAbortIgnored=!0)):m.status.fetchResolved=!0),I&&!Y&&!M)return _(w.signal.reason);let Z=C;return this.#o[p]===C&&(F===void 0?Z.__staleWhileFetching!==void 0?this.#o[p]=Z.__staleWhileFetching:this.#U(h,"fetch"):(m.status&&(m.status.fetchUpdated=!0),this.set(h,F,f.options))),F},E=F=>(m.status&&(m.status.fetchRejected=!0,m.status.fetchError=F),_(F)),_=F=>{let{aborted:M}=w.signal,I=M&&m.allowStaleOnFetchAbort,Y=I||m.allowStaleOnFetchRejection,Z=Y||m.noDeleteOnFetchRejection,G=C;if(this.#o[p]===C&&(!Z||G.__staleWhileFetching===void 0?this.#U(h,"fetch"):I||(this.#o[p]=G.__staleWhileFetching)),Y)return m.status&&G.__staleWhileFetching!==void 0&&(m.status.returnedStale=!0),G.__staleWhileFetching;if(G.__returned===G)throw F},O=(F,M)=>{let I=this.#w?.(h,b,f);I&&I instanceof Promise&&I.then(Y=>F(Y===void 0?void 0:Y),M),w.signal.addEventListener("abort",()=>{(!m.ignoreFetchAbort||m.allowStaleOnFetchAbort)&&(F(void 0),m.allowStaleOnFetchAbort&&(F=Y=>v(Y,!0)))})};m.status&&(m.status.fetchDispatched=!0);let C=new Promise(O).then(v,E),$=Object.assign(C,{__abortController:w,__staleWhileFetching:b,__returned:void 0});return p===void 0?(this.set(h,$,{...f.options,status:void 0}),p=this.#i.get(h)):this.#o[p]=$,$}#b(h){if(!this.#P)return!1;let p=h;return!!p&&p instanceof Promise&&p.hasOwnProperty("__staleWhileFetching")&&p.__abortController instanceof s}async fetch(h,p={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:b=this.noDeleteOnStaleGet,ttl:w=this.ttl,noDisposeOnSet:x=this.noDisposeOnSet,size:f=0,sizeCalculation:v=this.sizeCalculation,noUpdateTTL:E=this.noUpdateTTL,noDeleteOnFetchRejection:_=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:O=this.allowStaleOnFetchRejection,ignoreFetchAbort:C=this.ignoreFetchAbort,allowStaleOnFetchAbort:$=this.allowStaleOnFetchAbort,context:F,forceRefresh:M=!1,status:I,signal:Y}=p;if(!this.#P)return I&&(I.fetch="get"),this.get(h,{allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:b,status:I});let Z={allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:b,ttl:w,noDisposeOnSet:x,size:f,sizeCalculation:v,noUpdateTTL:E,noDeleteOnFetchRejection:_,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:$,ignoreFetchAbort:C,status:I,signal:Y},G=this.#i.get(h);if(G===void 0){I&&(I.fetch="miss");let V=this.#D(h,G,Z,F);return V.__returned=V}else{let V=this.#o[G];if(this.#b(V)){let Oe=m&&V.__staleWhileFetching!==void 0;return I&&(I.fetch="inflight",Oe&&(I.returnedStale=!0)),Oe?V.__staleWhileFetching:V.__returned=V}let se=this.#O(G);if(!M&&!se)return I&&(I.fetch="hit"),this.#z(G),y&&this.#R(G),I&&this.#I(I,G),V;let ee=this.#D(h,G,Z,F),xe=ee.__staleWhileFetching!==void 0&&m;return I&&(I.fetch=se?"stale":"refresh",xe&&se&&(I.returnedStale=!0)),xe?ee.__staleWhileFetching:ee.__returned=ee}}async forceFetch(h,p={}){let m=await this.fetch(h,p);if(m===void 0)throw new Error("fetch() returned undefined");return m}memo(h,p={}){let m=this.#a;if(!m)throw new Error("no memoMethod provided to constructor");let{context:y,forceRefresh:b,...w}=p,x=this.get(h,w);if(!b&&x!==void 0)return x;let f=m(h,x,{options:w,context:y});return this.set(h,f,w),f}get(h,p={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:b=this.noDeleteOnStaleGet,status:w}=p,x=this.#i.get(h);if(x!==void 0){let f=this.#o[x],v=this.#b(f);return w&&this.#I(w,x),this.#O(x)?(w&&(w.get="stale"),v?(w&&m&&f.__staleWhileFetching!==void 0&&(w.returnedStale=!0),m?f.__staleWhileFetching:void 0):(b||this.#U(h,"expire"),w&&m&&(w.returnedStale=!0),m?f:void 0)):(w&&(w.get="hit"),v?f.__staleWhileFetching:(this.#z(x),y&&this.#R(x),f))}else w&&(w.get="miss")}#G(h,p){this.#g[p]=h,this.#d[h]=p}#z(h){h!==this.#p&&(h===this.#y?this.#y=this.#d[h]:this.#G(this.#g[h],this.#d[h]),this.#G(this.#p,h),this.#p=h)}delete(h){return this.#U(h,"delete")}#U(h,p){let m=!1;if(this.#s!==0){let y=this.#i.get(h);if(y!==void 0)if(m=!0,this.#s===1)this.#q(p);else{this.#L(y);let b=this.#o[y];if(this.#b(b)?b.__abortController.abort(new Error("deleted")):(this.#v||this.#A)&&(this.#v&&this.#e?.(b,h,p),this.#A&&this.#x?.push([b,h,p])),this.#i.delete(h),this.#l[y]=void 0,this.#o[y]=void 0,y===this.#p)this.#p=this.#g[y];else if(y===this.#y)this.#y=this.#d[y];else{let w=this.#g[y];this.#d[w]=this.#d[y];let x=this.#d[y];this.#g[x]=this.#g[y]}this.#s--,this.#C.push(y)}}if(this.#A&&this.#x?.length){let y=this.#x,b;for(;b=y?.shift();)this.#h?.(...b)}return m}clear(){return this.#q("delete")}#q(h){for(let p of this.#F({allowStale:!0})){let m=this.#o[p];if(this.#b(m))m.__abortController.abort(new Error("deleted"));else{let y=this.#l[p];this.#v&&this.#e?.(m,y,h),this.#A&&this.#x?.push([m,y,h])}}if(this.#i.clear(),this.#o.fill(void 0),this.#l.fill(void 0),this.#S&&this.#_&&(this.#S.fill(0),this.#_.fill(0)),this.#E&&this.#E.fill(0),this.#y=0,this.#p=0,this.#C.length=0,this.#c=0,this.#s=0,this.#A&&this.#x){let p=this.#x,m;for(;m=p?.shift();)this.#h?.(...m)}}}return Gi.LRUCache=d,Gi}var wa,Qu;function lw(){if(Qu)return wa;Qu=1;let t=(...n)=>n.every(a=>a)?n.join(""):"",e=n=>n?encodeURIComponent(n):"",r=n=>n.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),i={sshtemplate:({domain:n,user:a,project:o,committish:c})=>`git@${n}:${a}/${o}.git${t("#",c)}`,sshurltemplate:({domain:n,user:a,project:o,committish:c})=>`git+ssh://git@${n}/${a}/${o}.git${t("#",c)}`,edittemplate:({domain:n,user:a,project:o,committish:c,editpath:l,path:u})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u)}`,browsetemplate:({domain:n,user:a,project:o,committish:c,treepath:l})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c))}`,browsetreetemplate:({domain:n,user:a,project:o,committish:c,treepath:l,path:u,fragment:d,hashformat:g})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",g(d||""))}`,browseblobtemplate:({domain:n,user:a,project:o,committish:c,blobpath:l,path:u,fragment:d,hashformat:g})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",g(d||""))}`,docstemplate:({domain:n,user:a,project:o,treepath:c,committish:l})=>`https://${n}/${a}/${o}${t("/",c,"/",e(l))}#readme`,httpstemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git+https://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,filetemplate:({domain:n,user:a,project:o,committish:c,path:l})=>`https://${n}/${a}/${o}/raw/${e(c||"HEAD")}/${l}`,shortcuttemplate:({type:n,user:a,project:o,committish:c})=>`${n}:${a}/${o}${t("#",c)}`,pathtemplate:({user:n,project:a,committish:o})=>`${n}/${a}${t("#",o)}`,bugstemplate:({domain:n,user:a,project:o})=>`https://${n}/${a}/${o}/issues`,hashformat:r},s={};s.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:n,user:a,project:o,committish:c,path:l})=>`https://${t(n,"@")}raw.githubusercontent.com/${a}/${o}/${e(c||"HEAD")}/${l}`,gittemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://codeload.${n}/${a}/${o}/tar.gz/${e(c||"HEAD")}`,extract:n=>{let[,a,o,c,l]=n.pathname.split("/",5);if(!(c&&c!=="tree")&&(c||(l=n.hash.slice(1)),o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:l}}},s.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:n,user:a,project:o,committish:c,treepath:l,path:u,editpath:d})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u,d)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/get/${e(c||"HEAD")}.tar.gz`,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(!["get"].includes(c)&&(o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:n.hash.slice(1)}}},s.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",httpstemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git+https://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/repository/archive.tar.gz?ref=${e(c||"HEAD")}`,extract:n=>{let a=n.pathname.slice(1);if(a.includes("/-/")||a.includes("/archive.tar.gz"))return;let o=a.split("/"),c=o.pop();c.endsWith(".git")&&(c=c.slice(0,-4));let l=o.join("/");if(!(!l||!c))return{user:l,project:c,committish:n.hash.slice(1)}}},s.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:n,project:a,committish:o})=>`git@${n}:${a}.git${t("#",o)}`,sshurltemplate:({domain:n,project:a,committish:o})=>`git+ssh://git@${n}/${a}.git${t("#",o)}`,edittemplate:({domain:n,user:a,project:o,committish:c,editpath:l})=>`https://${n}/${a}/${o}${t("/",e(c))}/${l}`,browsetemplate:({domain:n,project:a,committish:o})=>`https://${n}/${a}${t("/",e(o))}`,browsetreetemplate:({domain:n,project:a,committish:o,path:c,hashformat:l})=>`https://${n}/${a}${t("/",e(o))}${t("#",l(c))}`,browseblobtemplate:({domain:n,project:a,committish:o,path:c,hashformat:l})=>`https://${n}/${a}${t("/",e(o))}${t("#",l(c))}`,docstemplate:({domain:n,project:a,committish:o})=>`https://${n}/${a}${t("/",e(o))}`,httpstemplate:({domain:n,project:a,committish:o})=>`git+https://${n}/${a}.git${t("#",o)}`,filetemplate:({user:n,project:a,committish:o,path:c})=>`https://gist.githubusercontent.com/${n}/${a}/raw${t("/",e(o))}/${c}`,shortcuttemplate:({type:n,project:a,committish:o})=>`${n}:${a}${t("#",o)}`,pathtemplate:({project:n,committish:a})=>`${n}${t("#",a)}`,bugstemplate:({domain:n,project:a})=>`https://${n}/${a}`,gittemplate:({domain:n,project:a,committish:o})=>`git://${n}/${a}.git${t("#",o)}`,tarballtemplate:({project:n,committish:a})=>`https://codeload.github.com/gist/${n}/tar.gz/${e(a||"HEAD")}`,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(c!=="raw"){if(!o){if(!a)return;o=a,a=null}return o.endsWith(".git")&&(o=o.slice(0,-4)),{user:a,project:o,committish:n.hash.slice(1)}}},hashformat:function(n){return n&&"file-"+r(n)}},s.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:n,user:a,project:o,committish:c,path:l})=>`https://${n}/${a}/${o}/blob/${e(c)||"HEAD"}/${l}`,httpstemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}.git${t("#",c)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/archive/${e(c)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(!["archive"].includes(c)&&(o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:n.hash.slice(1)}}};for(let[n,a]of Object.entries(s))s[n]=Object.assign({},i,a);return wa=s,wa}var xa,eh;function Dh(){if(eh)return xa;eh=1;let t=Da,e=(n,a,o)=>{let c=n.indexOf(o);return n.lastIndexOf(a,c>-1?c:1/0)},r=n=>{try{return new t.URL(n)}catch{}},i=(n,a)=>{let o=n.indexOf(":"),c=n.slice(0,o+1);if(Object.prototype.hasOwnProperty.call(a,c))return n;let l=n.indexOf("@");return l>-1?l>o?`git+ssh://${n}`:n:n.indexOf("//")===o+1?n:`${n.slice(0,o+1)}//${n.slice(o+1)}`},s=n=>{let a=e(n,"@","#"),o=e(n,":","#");return o>a&&(n=n.slice(0,o)+"/"+n.slice(o+1)),e(n,":","#")===-1&&n.indexOf("//")===-1&&(n=`git+ssh://${n}`),n};return xa=(n,a)=>{let o=a?i(n,a):n;return r(o)||r(s(o))},xa}var Ea,th;function uw(){if(th)return Ea;th=1;let t=Dh(),e=r=>{let i=r.indexOf("#"),s=r.indexOf("/"),n=r.indexOf("/",s+1),a=r.indexOf(":"),o=/\s/.exec(r),c=r.indexOf("@"),l=!o||i>-1&&o.index>i,u=c===-1||i>-1&&c>i,d=a===-1||i>-1&&a>i,g=n===-1||i>-1&&n>i,h=s>0,p=i>-1?r[i-1]!=="/":!r.endsWith("/"),m=!r.startsWith(".");return l&&h&&p&&m&&u&&d&&g};return Ea=(r,i,{gitHosts:s,protocols:n})=>{if(!r)return;let a=e(r)?`github:${r}`:r,o=t(a,n);if(!o)return;let c=s.byShortcut[o.protocol],l=s.byDomain[o.hostname.startsWith("www.")?o.hostname.slice(4):o.hostname],u=c||l;if(!u)return;let d=s[c||l],g=null;n[o.protocol]?.auth&&(o.username||o.password)&&(g=`${o.username}${o.password?":"+o.password:""}`);let h=null,p=null,m=null,y=null;try{if(c){let b=o.pathname.startsWith("/")?o.pathname.slice(1):o.pathname,w=b.indexOf("@");w>-1&&(b=b.slice(w+1));let x=b.lastIndexOf("/");x>-1?(p=decodeURIComponent(b.slice(0,x)),p||(p=null),m=decodeURIComponent(b.slice(x+1))):m=decodeURIComponent(b),m.endsWith(".git")&&(m=m.slice(0,-4)),o.hash&&(h=decodeURIComponent(o.hash.slice(1))),y="shortcut"}else{if(!d.protocols.includes(o.protocol))return;let b=d.extract(o);if(!b)return;p=b.user&&decodeURIComponent(b.user),m=decodeURIComponent(b.project),h=decodeURIComponent(b.committish),y=n[o.protocol]?.name||o.protocol.slice(0,-1)}}catch(b){if(b instanceof URIError)return;throw b}return[u,p,g,m,h,y,i]},Ea}var _a,rh;function hw(){if(rh)return _a;rh=1;let{LRUCache:t}=cw(),e=lw(),r=uw(),i=Dh(),s=new t({max:1e3});function n(o){try{let{protocol:c,hostname:l,pathname:u}=new URL(o);if(!l)return null;let d=/(?:git\+)http:$/.test(c)?"http:":"https:",g=u.replace(/\.git$/,"");return`${d}//${l}${g}`}catch{return null}}class a{constructor(c,l,u,d,g,h,p={}){Object.assign(this,a.#t[c],{type:c,user:l,auth:u,project:d,committish:g,default:h,opts:p})}static#t={byShortcut:{},byDomain:{}};static#r={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(c,l){a.#t[c]=l,a.#t.byDomain[l.domain]=c,a.#t.byShortcut[`${c}:`]=c,a.#r[`${c}:`]={name:c}}static fromUrl(c,l){if(typeof c!="string")return;let u=c+JSON.stringify(l||{});if(!s.has(u)){let d=r(c,l,{gitHosts:a.#t,protocols:a.#r});s.set(u,d?new a(...d):void 0)}return s.get(u)}static fromManifest(c,l={}){if(!c||typeof c!="object")return;let u=c.repository,d=u&&(typeof u=="string"?u:typeof u=="object"&&typeof u.url=="string"?u.url:null);if(!d)throw new Error("no repository");let g=d&&a.fromUrl(d.replace(/^git\+/,""),l)||null;if(g)return g;let h=n(d);return a.fromUrl(h,l)||h}static parseUrl(c){return i(c)}#e(c,l){if(typeof c!="function")return null;let u={...this,...this.opts,...l};u.path||(u.path=""),u.path.startsWith("/")&&(u.path=u.path.slice(1)),u.noCommittish&&(u.committish=null);let d=c(u);return u.noGitPlus&&d.startsWith("git+")?d.slice(4):d}hash(){return this.committish?`#${this.committish}`:""}ssh(c){return this.#e(this.sshtemplate,c)}sshurl(c){return this.#e(this.sshurltemplate,c)}browse(c,...l){return typeof c!="string"?this.#e(this.browsetemplate,c):typeof l[0]!="string"?this.#e(this.browsetreetemplate,{...l[0],path:c}):this.#e(this.browsetreetemplate,{...l[1],fragment:l[0],path:c})}browseFile(c,...l){return typeof l[0]!="string"?this.#e(this.browseblobtemplate,{...l[0],path:c}):this.#e(this.browseblobtemplate,{...l[1],fragment:l[0],path:c})}docs(c){return this.#e(this.docstemplate,c)}bugs(c){return this.#e(this.bugstemplate,c)}https(c){return this.#e(this.httpstemplate,c)}git(c){return this.#e(this.gittemplate,c)}shortcut(c){return this.#e(this.shortcuttemplate,c)}path(c){return this.#e(this.pathtemplate,c)}tarball(c){return this.#e(this.tarballtemplate,{...c,noCommittish:!1})}file(c,l){return this.#e(this.filetemplate,{...l,path:c})}edit(c,l){return this.#e(this.edittemplate,{...l,path:c})}getDefaultRepresentation(){return this.default}toString(c){return this.default&&typeof this[this.default]=="function"?this[this.default](c):this.sshurl(c)}}for(let[o,c]of Object.entries(e))a.addHost(o,c);return _a=a,_a}var Sa,ih;function fw(){if(ih)return Sa;ih=1,Sa=t;function t(e){if(!e||e==="ERROR: No README data found!")return;e=e.trim().split(`
|
|
31
|
-
`);let r=0;for(;e[r]&&e[r].trim().match(/^(#|$)/);)r++;let i=e.length,s=r+1;for(;s<i&&e[s].trim();)s++;return e.slice(r,s).join(" ").trim()}return Sa}var pw={dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},dw={web:"url",name:"url"},mw={server:"start",tests:"test"},gw={topLevel:pw,bugs:dw,script:mw},Ra,sh;function yw(){if(sh)return Ra;sh=1;var{URL:t}=Lb,e=Oh(),r=$h(),i=Ih(),s=hw(),{isBuiltin:n}=gh,a=["dependencies","devDependencies","optionalDependencies"],o=fw(),c=gw,l=f=>f.includes("@")&&f.indexOf("@")<f.lastIndexOf(".");Ra={warn:function(){},fixRepositoryField:function(f){if(f.repositories&&(this.warn("repositories"),f.repository=f.repositories[0]),!f.repository)return this.warn("missingRepository");typeof f.repository=="string"&&(f.repository={type:"git",url:f.repository});var v=f.repository.url||"";if(v){var E=s.fromUrl(v);E&&(v=f.repository.url=E.getDefaultRepresentation()==="shortcut"?E.https():E.toString())}v.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",v)},fixTypos:function(f){Object.keys(c.topLevel).forEach(function(v){Object.prototype.hasOwnProperty.call(f,v)&&this.warn("typo",v,c.topLevel[v])},this)},fixScriptsField:function(f){if(f.scripts){if(typeof f.scripts!="object"){this.warn("nonObjectScripts"),delete f.scripts;return}Object.keys(f.scripts).forEach(function(v){typeof f.scripts[v]!="string"?(this.warn("nonStringScript"),delete f.scripts[v]):c.script[v]&&!f.scripts[c.script[v]]&&this.warn("typo",v,c.script[v],"scripts")},this)}},fixFilesField:function(f){var v=f.files;v&&!Array.isArray(v)?(this.warn("nonArrayFiles"),delete f.files):f.files&&(f.files=f.files.filter(function(E){return!E||typeof E!="string"?(this.warn("invalidFilename",E),!1):!0},this))},fixBinField:function(f){if(f.bin&&typeof f.bin=="string"){var v={},E;(E=f.name.match(/^@[^/]+[/](.*)$/))?v[E[1]]=f.bin:v[f.name]=f.bin,f.bin=v}},fixManField:function(f){f.man&&typeof f.man=="string"&&(f.man=[f.man])},fixBundleDependenciesField:function(f){var v="bundledDependencies",E="bundleDependencies";f[v]&&!f[E]&&(f[E]=f[v],delete f[v]),f[E]&&!Array.isArray(f[E])?(this.warn("nonArrayBundleDependencies"),delete f[E]):f[E]&&(f[E]=f[E].filter(function(_){return!_||typeof _!="string"?(this.warn("nonStringBundleDependency",_),!1):(f.dependencies||(f.dependencies={}),Object.prototype.hasOwnProperty.call(f.dependencies,_)||(this.warn("nonDependencyBundleDependency",_),f.dependencies[_]="*"),!0)},this))},fixDependencies:function(f){w(f,this.warn),y(f,this.warn),this.fixBundleDependenciesField(f),["dependencies","devDependencies"].forEach(function(v){if(v in f){if(!f[v]||typeof f[v]!="object"){this.warn("nonObjectDependencies",v),delete f[v];return}Object.keys(f[v]).forEach(function(E){var _=f[v][E];typeof _!="string"&&(this.warn("nonStringDependency",E,JSON.stringify(_)),delete f[v][E]);var O=s.fromUrl(f[v][E]);O&&(f[v][E]=O.toString())},this)}},this)},fixModulesField:function(f){f.modules&&(this.warn("deprecatedModules"),delete f.modules)},fixKeywordsField:function(f){typeof f.keywords=="string"&&(f.keywords=f.keywords.split(/,\s+/)),f.keywords&&!Array.isArray(f.keywords)?(delete f.keywords,this.warn("nonArrayKeywords")):f.keywords&&(f.keywords=f.keywords.filter(function(v){return typeof v!="string"||!v?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(f,v){var E=!v;if(!f.version)return f.version="",!0;if(!e(f.version,E))throw new Error('Invalid version: "'+f.version+'"');return f.version=r(f.version,E),!0},fixPeople:function(f){h(f,p),h(f,m)},fixNameField:function(f,v){typeof v=="boolean"?v={strict:v}:typeof v>"u"&&(v={});var E=v.strict;if(!f.name&&!E){f.name="";return}if(typeof f.name!="string")throw new Error("name field must be a string.");E||(f.name=f.name.trim()),g(f.name,E,v.allowLegacyCase),n(f.name)&&this.warn("conflictingName",f.name)},fixDescriptionField:function(f){f.description&&typeof f.description!="string"&&(this.warn("nonStringDescription"),delete f.description),f.readme&&!f.description&&(f.description=o(f.readme)),f.description===void 0&&delete f.description,f.description||this.warn("missingDescription")},fixReadmeField:function(f){f.readme||(this.warn("missingReadme"),f.readme="ERROR: No README data found!")},fixBugsField:function(f){if(!f.bugs&&f.repository&&f.repository.url){var v=s.fromUrl(f.repository.url);v&&v.bugs()&&(f.bugs={url:v.bugs()})}else if(f.bugs){if(typeof f.bugs=="string")l(f.bugs)?f.bugs={email:f.bugs}:t.canParse(f.bugs)?f.bugs={url:f.bugs}:this.warn("nonEmailUrlBugsString");else{x(f.bugs,this.warn);var E=f.bugs;f.bugs={},E.url&&(t.canParse(E.url)?f.bugs.url=E.url:this.warn("nonUrlBugsUrlField")),E.email&&(typeof E.email=="string"&&l(E.email)?f.bugs.email=E.email:this.warn("nonEmailBugsEmailField"))}!f.bugs.email&&!f.bugs.url&&(delete f.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(f){if(!f.homepage&&f.repository&&f.repository.url){var v=s.fromUrl(f.repository.url);v&&v.docs()&&(f.homepage=v.docs())}if(f.homepage){if(typeof f.homepage!="string")return this.warn("nonUrlHomepage"),delete f.homepage;t.canParse(f.homepage)||(f.homepage="http://"+f.homepage)}},fixLicenseField:function(f){let v=f.license||f.licence;if(!v)return this.warn("missingLicense");if(typeof v!="string"||v.length<1||v.trim()==="")return this.warn("invalidLicense");if(!i(v).validForNewPackages)return this.warn("invalidLicense")}};function u(f){if(f.charAt(0)!=="@")return!1;var v=f.slice(1).split("/");return v.length!==2?!1:v[0]&&v[1]&&v[0]===encodeURIComponent(v[0])&&v[1]===encodeURIComponent(v[1])}function d(f){return!f.match(/[/@\s+%:]/)&&f===encodeURIComponent(f)}function g(f,v,E){if(f.charAt(0)==="."||!(u(f)||d(f))||v&&!E&&f!==f.toLowerCase()||f.toLowerCase()==="node_modules"||f.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(f))}function h(f,v){return f.author&&(f.author=v(f.author)),["maintainers","contributors"].forEach(function(E){Array.isArray(f[E])&&(f[E]=f[E].map(v))}),f}function p(f){if(typeof f=="string")return f;var v=f.name||"",E=f.url||f.web,_=E?" ("+E+")":"",O=f.email||f.mail,C=O?" <"+O+">":"";return v+C+_}function m(f){if(typeof f!="string")return f;var v=f.match(/^([^(<]+)/),E=f.match(/\(([^()]+)\)/),_=f.match(/<([^<>]+)>/),O={};return v&&v[0].trim()&&(O.name=v[0].trim()),_&&(O.email=_[1]),E&&(O.url=E[1]),O}function y(f){var v=f.optionalDependencies;if(v){var E=f.dependencies||{};Object.keys(v).forEach(function(_){E[_]=v[_]}),f.dependencies=E}}function b(f,v,E){if(!f)return{};if(typeof f=="string"&&(f=f.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(f))return f;E("deprecatedArrayDependencies",v);var _={};return f.filter(function(O){return typeof O=="string"}).forEach(function(O){O=O.trim().split(/(:?[@\s><=])/);var C=O.shift(),$=O.join("");$=$.trim(),$=$.replace(/^@/,""),_[C]=$}),_}function w(f,v){a.forEach(function(E){f[E]&&(f[E]=b(f[E],E,v))})}function x(f,v){f&&Object.keys(f).forEach(function(E){c.bugs[E]&&(v("typo",E,c.bugs[E],"bugs"),f[c.bugs[E]]=f[E],delete f[E])})}return Ra}var bw="'repositories' (plural) Not supported. Please pick one as the 'repository' field",vw="No repository field.",ww="Probably broken git url: %s",xw="scripts must be an object",Ew="script values must be string commands",_w="Invalid 'files' member",Sw="Invalid filename in 'files' list: %s",Rw="Invalid 'bundleDependencies' list. Must be array of package names",Cw="Invalid bundleDependencies member: %s",Aw="Non-dependency in bundleDependencies: %s",Lw="%s field must be an object",Ow="Invalid dependency: %s %s",$w="specifying %s as array is deprecated",Tw="modules field is deprecated",Pw="keywords should be an array of strings",Iw="keywords should be an array of strings",Fw="%s is also the name of a node core module.",Nw="'description' field should be a string",Dw="No description",Mw="No README data",kw="No license field.",jw="Bug string field must be url, email, or {email,url}",Bw="bugs.url field must be a string url. Deleted.",Uw="bugs.email field must be a string email. Deleted.",Gw="Normalized value of bugs field is an empty object. Deleted.",zw="homepage field must be a string url. Deleted.",qw="license should be a valid SPDX license expression",Ww="%s should probably be %s.",Vw={repositories:bw,missingRepository:vw,brokenGitUrl:ww,nonObjectScripts:xw,nonStringScript:Ew,nonArrayFiles:_w,invalidFilename:Sw,nonArrayBundleDependencies:Rw,nonStringBundleDependency:Cw,nonDependencyBundleDependency:Aw,nonObjectDependencies:Lw,nonStringDependency:Ow,deprecatedArrayDependencies:$w,deprecatedModules:Tw,nonArrayKeywords:Pw,nonStringKeyword:Iw,conflictingName:Fw,nonStringDescription:Nw,missingDescription:Dw,missingReadme:Mw,missingLicense:kw,nonEmailUrlBugsString:jw,nonUrlBugsUrlField:Bw,nonEmailBugsEmailField:Uw,emptyNormalizedBugs:Gw,nonUrlHomepage:zw,invalidLicense:qw,typo:Ww},Ca,nh;function Hw(){if(nh)return Ca;nh=1;var t=mh,e=Vw;Ca=function(){var i=Array.prototype.slice.call(arguments,0),s=i.shift();if(s==="typo")return r.apply(null,i);var n=e[s]?e[s]:s+": '%s'";return i.unshift(n),t.format.apply(null,i)};function r(i,s,n){return n&&(i=n+"['"+i+"']",s=n+"['"+s+"']"),t.format(e.typo,i,s)}return Ca}var Aa,oh;function Kw(){if(oh)return Aa;oh=1,Aa=n;var t=yw();n.fixer=t;var e=Hw(),r=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],i=["dependencies","people","typos"],s=r.map(function(o){return a(o)+"Field"});s=s.concat(i);function n(o,c,l){c===!0&&(c=null,l=!0),l||(l=!1),(!c||o.private)&&(c=function(){}),o.scripts&&o.scripts.install==="node-gyp rebuild"&&!o.scripts.preinstall&&(o.gypfile=!0),t.warn=function(){c(e.apply(null,arguments))},s.forEach(function(u){t["fix"+a(u)](o,l)}),o._id=o.name+"@"+o.version}function a(o){return o.charAt(0).toUpperCase()+o.slice(1)}return Aa}var Yw=Kw(),Mh=Qs(Yw),Xw=(t,e)=>(t=t.replace(/((?<![\p{Uppercase_Letter}\d])[\p{Uppercase_Letter}\d](?![\p{Uppercase_Letter}\d]))/gu,r=>r.toLowerCase()),t.replace(new RegExp("(?<!\\p{Uppercase_Letter})(\\p{Uppercase_Letter}+)(\\p{Uppercase_Letter}\\p{Lowercase_Letter}+)","gu"),(r,i,s)=>i+e+s.toLowerCase()));function ja(t,{separator:e="_",preserveConsecutiveUppercase:r=!1}={}){if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("The `text` and `separator` arguments should be of type `string`");if(t.length<2)return r?t:t.toLowerCase();let i=`$1${e}$2`,s=t.replace(new RegExp("([\\p{Lowercase_Letter}\\d])(\\p{Uppercase_Letter})","gu"),i);return r?Xw(s,e):s.replace(new RegExp("(\\p{Uppercase_Letter})(\\p{Uppercase_Letter}\\p{Lowercase_Letter}+)","gu"),i).toLowerCase()}var Js={exports:{}},La,ah;function Jw(){if(ah)return La;ah=1;var t=Object.prototype.toString;return La=function(e){var r;return t.call(e)==="[object Object]"&&(r=Object.getPrototypeOf(e),r===null||r===Object.getPrototypeOf({}))},La}var Oa,ch;function Zw(){return ch||(ch=1,Oa=function(t){return t==null?[]:Array.isArray(t)?t:[t]}),Oa}var $a,lh;function Qw(){if(lh)return $a;lh=1;var t=Object.prototype.toString;$a=function(d){if(d===void 0)return"undefined";if(d===null)return"null";var g=typeof d;if(g==="boolean")return"boolean";if(g==="string")return"string";if(g==="number")return"number";if(g==="symbol")return"symbol";if(g==="function")return a(d)?"generatorfunction":"function";if(r(d))return"array";if(l(d))return"buffer";if(c(d))return"arguments";if(s(d))return"date";if(i(d))return"error";if(n(d))return"regexp";switch(e(d)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(o(d))return"generator";switch(g=t.call(d),g){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return g.slice(8,-1).toLowerCase().replace(/\s/g,"")};function e(u){return typeof u.constructor=="function"?u.constructor.name:null}function r(u){return Array.isArray?Array.isArray(u):u instanceof Array}function i(u){return u instanceof Error||typeof u.message=="string"&&u.constructor&&typeof u.constructor.stackTraceLimit=="number"}function s(u){return u instanceof Date?!0:typeof u.toDateString=="function"&&typeof u.getDate=="function"&&typeof u.setDate=="function"}function n(u){return u instanceof RegExp?!0:typeof u.flags=="string"&&typeof u.ignoreCase=="boolean"&&typeof u.multiline=="boolean"&&typeof u.global=="boolean"}function a(u,d){return e(u)==="GeneratorFunction"}function o(u){return typeof u.throw=="function"&&typeof u.return=="function"&&typeof u.next=="function"}function c(u){try{if(typeof u.length=="number"&&typeof u.callee=="function")return!0}catch(d){if(d.message.indexOf("callee")!==-1)return!0}return!1}function l(u){return u.constructor&&typeof u.constructor.isBuffer=="function"?u.constructor.isBuffer(u):!1}return $a}var uh;function e1(){if(uh)return Js.exports;uh=1;let t=Jw(),e=Zw(),r=Qw(),i=(h,p,m)=>{h[p]||(h[p]=[]),h[p].push(m)},s=(h,p,m,y)=>{h[p]||(h[p]={}),h[p][m]=y},n=h=>Array.isArray(h)?`[${h.map(n).join(", ")}]`:r(h)==="string"?JSON.stringify(h):h,a=h=>{if(Array.isArray(h)&&h.length>0){let[p]=h;return`${r(p)}-array`}return r(h)},o=(h,p)=>{let m=h==="array"?"string-array":h;return u.includes(m)&&Array.isArray(p)&&p.length===0?"array":m},c=["stopEarly","unknown","--"],l=["string","boolean","number"],u=l.map(h=>`${h}-array`),d=[...l,"array",...u],g=h=>{h=h||{};let p={};return c.forEach(m=>{h[m]&&(p[m]=h[m])}),Object.keys(h).forEach(m=>{let y=h[m];if(m==="arguments"&&(m="_"),typeof y=="string"&&(y={type:y}),t(y)){let b=y,{type:w}=b;if(w){if(!d.includes(w))throw new TypeError(`Expected type of "${m}" to be one of ${n(d)}, got ${n(w)}`);if(u.includes(w)){let[x]=w.split("-");i(p,"array",{key:m,[x]:!0})}else i(p,w,m)}if({}.hasOwnProperty.call(b,"default")){let{default:x}=b,f=a(x),v=o(w,x);if(v&&v!==f)throw new TypeError(`Expected "${m}" default value to be of type "${v}", got ${n(f)}`);s(p,"default",m,x)}e(b.alias).forEach(x=>{s(p,"alias",x,m)})}}),p};return Js.exports=g,Js.exports.default=g,Js.exports}var t1=e1(),kh=Qs(t1),Zs={exports:{}},hh;function r1(){if(hh)return Zs.exports;hh=1;let t=s=>typeof s=="object"&&s!==null,e=Symbol("skip"),r=s=>t(s)&&!(s instanceof RegExp)&&!(s instanceof Error)&&!(s instanceof Date),i=(s,n,a,o=new WeakMap)=>{if(a={deep:!1,target:{},...a},o.has(s))return o.get(s);o.set(s,a.target);let{target:c}=a;delete a.target;let l=u=>u.map(d=>r(d)?i(d,n,a,o):d);if(Array.isArray(s))return l(s);for(let[u,d]of Object.entries(s)){let g=n(u,d,s);if(g===e)continue;let[h,p,{shouldRecurse:m=!0}={}]=g;h!=="__proto__"&&(a.deep&&m&&r(p)&&(p=Array.isArray(p)?l(p):i(p,n,a,o)),c[h]=p)}return c};return Zs.exports=(s,n,a)=>{if(!t(s))throw new TypeError(`Expected an object, got \`${s}\` (${typeof s})`);return i(s,n,a)},Zs.exports.mapObjectSkip=e,Zs.exports}var i1=r1(),fh=Qs(i1),Na=class extends Map{constructor(e={}){if(super(),!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof e.maxAge=="number"&&e.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=e.maxSize,this.maxAge=e.maxAge||Number.POSITIVE_INFINITY,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(e){if(typeof this.onEviction=="function")for(let[r,i]of e)this.onEviction(r,i.value)}_deleteIfExpired(e,r){return typeof r.expiry=="number"&&r.expiry<=Date.now()?(typeof this.onEviction=="function"&&this.onEviction(e,r.value),this.delete(e)):!1}_getOrDeleteIfExpired(e,r){if(this._deleteIfExpired(e,r)===!1)return r.value}_getItemValue(e,r){return r.expiry?this._getOrDeleteIfExpired(e,r):r.value}_peek(e,r){let i=r.get(e);return this._getItemValue(e,i)}_set(e,r){this.cache.set(e,r),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(e,r){this.oldCache.delete(e),this._set(e,r)}*_entriesAscending(){for(let e of this.oldCache){let[r,i]=e;this.cache.has(r)||this._deleteIfExpired(r,i)===!1&&(yield e)}for(let e of this.cache){let[r,i]=e;this._deleteIfExpired(r,i)===!1&&(yield e)}}get(e){if(this.cache.has(e)){let r=this.cache.get(e);return this._getItemValue(e,r)}if(this.oldCache.has(e)){let r=this.oldCache.get(e);if(this._deleteIfExpired(e,r)===!1)return this._moveToRecent(e,r),r.value}}set(e,r,{maxAge:i=this.maxAge}={}){let s=typeof i=="number"&&i!==Number.POSITIVE_INFINITY?Date.now()+i:void 0;return this.cache.has(e)?this.cache.set(e,{value:r,expiry:s}):this._set(e,{value:r,expiry:s}),this}has(e){return this.cache.has(e)?!this._deleteIfExpired(e,this.cache.get(e)):this.oldCache.has(e)?!this._deleteIfExpired(e,this.oldCache.get(e)):!1}peek(e){if(this.cache.has(e))return this._peek(e,this.cache);if(this.oldCache.has(e))return this._peek(e,this.oldCache)}delete(e){let r=this.cache.delete(e);return r&&this._size--,this.oldCache.delete(e)||r}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(e){if(!(e&&e>0))throw new TypeError("`maxSize` must be a number greater than 0");let r=[...this._entriesAscending()],i=r.length-e;i<0?(this.cache=new Map(r),this.oldCache=new Map,this._size=r.length):(i>0&&this._emitEvictions(r.slice(0,i)),this.oldCache=new Map(r.slice(i)),this.cache=new Map,this._size=0),this.maxSize=e}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache){let[r,i]=e;this._deleteIfExpired(r,i)===!1&&(yield[r,i.value])}for(let e of this.oldCache){let[r,i]=e;this.cache.has(r)||this._deleteIfExpired(r,i)===!1&&(yield[r,i.value])}}*entriesDescending(){let e=[...this.cache];for(let r=e.length-1;r>=0;--r){let i=e[r],[s,n]=i;this._deleteIfExpired(s,n)===!1&&(yield[s,n.value])}e=[...this.oldCache];for(let r=e.length-1;r>=0;--r){let i=e[r],[s,n]=i;this.cache.has(s)||this._deleteIfExpired(s,n)===!1&&(yield[s,n.value])}}*entriesAscending(){for(let[e,r]of this._entriesAscending())yield[e,r.value]}get size(){if(!this._size)return this.oldCache.size;let e=0;for(let r of this.oldCache.keys())this.cache.has(r)||e++;return Math.min(this._size+e,this.maxSize)}entries(){return this.entriesAscending()}forEach(e,r=this){for(let[i,s]of this.entriesAscending())e.call(r,s,i,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}},s1=(t,e)=>t.some(r=>typeof r=="string"?r===e:(r.lastIndex=0,r.test(e))),Ta=new Na({maxSize:1e5}),ph=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp)&&!(t instanceof Error)&&!(t instanceof Date),dh=(t,e={})=>{if(!ph(t))return t;let{separator:r="_",exclude:i,deep:s=!1}=e,n=a=>(o,c)=>{if(s&&ph(c)&&(c=fh(c,n())),!(i&&s1(i,o))){let l=`${r}${o}`;if(Ta.has(l))o=Ta.get(l);else{let u=ja(o,{separator:r});o.length<100&&Ta.set(l,u),o=u}}return[o,c]};return fh(t,n())};function jh(t,e){return Array.isArray(t)?Object.keys(t).map(r=>dh(t[r],e)):dh(t,e)}import n1 from"node:process";import o1 from"node:path";import{fileURLToPath as a1}from"node:url";var or=t=>`--${ja(t,{separator:"-"})}`,qi=(t,e="--")=>`\`${e}${t.join(`\`, \`${e}`)}\``;var c1=t=>{let e={flags:{keyContainsDashes:{filter:([i])=>i.includes("-")&&i!=="--",message:i=>`Flag keys may not contain '-'. Invalid flags: ${qi(i,"")}`},aliasIsSet:{filter:([,i])=>Object.hasOwn(i,"alias"),message:i=>`The option \`alias\` has been renamed to \`shortFlag\`. The following flags need to be updated: ${qi(i)}`},choicesNotAnArray:{filter:([,i])=>Object.hasOwn(i,"choices")&&!Array.isArray(i.choices),message:i=>`The option \`choices\` must be an array. Invalid flags: ${qi(i)}`},choicesNotMatchFlagType:{filter:([,i])=>i.type&&Array.isArray(i.choices)&&i.choices.some(s=>typeof s!==i.type),message(i){return`Each value of the option \`choices\` must be of the same type as its flag. Invalid flags: ${i.map(n=>`(\`${or(n)}\`, type: '${t.flags[n].type}')`).join(", ")}`}},defaultNotInChoices:{filter:([,i])=>i.default&&Array.isArray(i.choices)&&![i.default].flat().every(s=>i.choices.includes(s)),message:i=>`Each value of the option \`default\` must exist within the option \`choices\`. Invalid flags: ${qi(i)}`}}},r=[];for(let[i,s]of Object.entries(e)){let n=Object.entries(t[i]);for(let{filter:a,message:o}of Object.values(s)){let c=n.filter(u=>a(u)),l=c.map(([u])=>u);c.length>0&&r.push(o(l))}}if(r.length>0)throw new Error(r.join(`
|
|
32
|
-
`))},
|
|
33
|
-
`)}`)},
|
|
34
|
-
`))},
|
|
35
|
-
`)&&(
|
|
36
|
-
${
|
|
29
|
+
`:""}`}set message(e){this.#e=e}#_(e){if(!this.#r)return;let r=this.#t,s=Lw(r,this.#r.message);if(s)return Aw.codeFrameColumns(r,{start:s},{highlightCode:e})}get codeFrame(){return this.#n??=this.#_(!0),this.#n}get rawCodeFrame(){return this.#f??=this.#_(!1),this.#f}},Lw=(t,e)=>{let r=e.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);if(!r)return;let{index:s,line:i,column:n}=r.groups;return i&&n?{line:Number(i),column:Number(n)}:Ow(t,Number(s),{oneBased:!0})},$w=t=>t.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(e,r,s)=>`"${s}"(${Tw(s)})`);function Pw(t,e,r){try{return JSON.parse(t,e)}catch(s){throw new Jc({jsonParseError:s,fileName:r,input:t})}}var gc,th;function Xh(){return th||(th=1,gc=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}),gc}var yc,rh;function Qh(){if(rh)return yc;rh=1;let t="2.0.0",e=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,s=16,i=e-6;return yc={MAX_LENGTH:e,MAX_SAFE_COMPONENT_LENGTH:s,MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},yc}var ao={exports:{}},sh;function Iw(){return sh||(sh=1,(function(t,e){let{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:i}=Qh(),n=Xh();e=t.exports={};let a=e.re=[],o=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},p=0,g="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",i],[g,s]],d=y=>{for(let[v,_]of f)y=y.split(`${v}*`).join(`${v}{0,${_}}`).split(`${v}+`).join(`${v}{1,${_}}`);return y},m=(y,v,_)=>{let w=d(v),h=p++;n(y,h,v),u[y]=h,c[h]=v,l[h]=w,a[h]=new RegExp(v,_?"g":void 0),o[h]=new RegExp(w,_?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${g}*`),m("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${g}+`),m("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),m("FULL",`^${c[u.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),m("LOOSE",`^${c[u.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),m("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),m("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",c[u.COERCE],!0),m("COERCERTLFULL",c[u.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",m("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",m("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ao,ao.exports)),ao.exports}var vc,ih;function kw(){if(ih)return vc;ih=1;let t=Object.freeze({loose:!0}),e=Object.freeze({});return vc=s=>s?typeof s!="object"?t:s:e,vc}var bc,nh;function Nw(){if(nh)return bc;nh=1;let t=/^[0-9]+$/,e=(s,i)=>{let n=t.test(s),a=t.test(i);return n&&a&&(s=+s,i=+i),s===i?0:n&&!a?-1:a&&!n?1:s<i?-1:1};return bc={compareIdentifiers:e,rcompareIdentifiers:(s,i)=>e(i,s)},bc}var _c,oh;function Dw(){if(oh)return _c;oh=1;let t=Xh(),{MAX_LENGTH:e,MAX_SAFE_INTEGER:r}=Qh(),{safeRe:s,t:i}=Iw(),n=kw(),{compareIdentifiers:a}=Nw();class o{constructor(l,u){if(u=n(u),l instanceof o){if(l.loose===!!u.loose&&l.includePrerelease===!!u.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>e)throw new TypeError(`version is longer than ${e} characters`);t("SemVer",l,u),this.options=u,this.loose=!!u.loose,this.includePrerelease=!!u.includePrerelease;let p=l.trim().match(u.loose?s[i.LOOSE]:s[i.FULL]);if(!p)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+p[1],this.minor=+p[2],this.patch=+p[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");p[4]?this.prerelease=p[4].split(".").map(g=>{if(/^[0-9]+$/.test(g)){let f=+g;if(f>=0&&f<r)return f}return g}):this.prerelease=[],this.build=p[5]?p[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(l){if(t("SemVer.compare",this.version,this.options,l),!(l instanceof o)){if(typeof l=="string"&&l===this.version)return 0;l=new o(l,this.options)}return l.version===this.version?0:this.compareMain(l)||this.comparePre(l)}compareMain(l){return l instanceof o||(l=new o(l,this.options)),a(this.major,l.major)||a(this.minor,l.minor)||a(this.patch,l.patch)}comparePre(l){if(l instanceof o||(l=new o(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;let u=0;do{let p=this.prerelease[u],g=l.prerelease[u];if(t("prerelease compare",u,p,g),p===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(p===void 0)return-1;if(p===g)continue;return a(p,g)}while(++u)}compareBuild(l){l instanceof o||(l=new o(l,this.options));let u=0;do{let p=this.build[u],g=l.build[u];if(t("build compare",u,p,g),p===void 0&&g===void 0)return 0;if(g===void 0)return 1;if(p===void 0)return-1;if(p===g)continue;return a(p,g)}while(++u)}inc(l,u,p){if(l.startsWith("pre")){if(!u&&p===!1)throw new Error("invalid increment argument: identifier is empty");if(u){let g=`-${u}`.match(this.options.loose?s[i.PRERELEASELOOSE]:s[i.PRERELEASE]);if(!g||g[1]!==u)throw new Error(`invalid identifier: ${u}`)}}switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",u,p);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",u,p);break;case"prepatch":this.prerelease.length=0,this.inc("patch",u,p),this.inc("pre",u,p);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",u,p),this.inc("pre",u,p);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 g=Number(p)?1:0;if(this.prerelease.length===0)this.prerelease=[g];else{let f=this.prerelease.length;for(;--f>=0;)typeof this.prerelease[f]=="number"&&(this.prerelease[f]++,f=-2);if(f===-1){if(u===this.prerelease.join(".")&&p===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(g)}}if(u){let f=[u,g];p===!1&&(f=[u]),a(this.prerelease[0],u)===0?isNaN(this.prerelease[1])&&(this.prerelease=f):this.prerelease=f}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return _c=o,_c}var wc,ah;function ed(){if(ah)return wc;ah=1;let t=Dw();return wc=(r,s,i=!1)=>{if(r instanceof t)return r;try{return new t(r,s)}catch(n){if(!i)return null;throw n}},wc}var xc,ch;function td(){if(ch)return xc;ch=1;let t=ed();return xc=(r,s)=>{let i=t(r,s);return i?i.version:null},xc}var Ec,lh;function rd(){if(lh)return Ec;lh=1;let t=ed();return Ec=(r,s)=>{let i=t(r.trim().replace(/^[=v]+/,""),s);return i?i.version:null},Ec}var sd=["0BSD","3D-Slicer-1.0","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","Artistic-dist","Aspell-RU","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-2-Clause-first-lines","BSD-2-Clause-pkgconf-disclaimer","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Boehm-GC-without-fee","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC-PDM-1.0","CC-SA-1.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","Catharon","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CryptoSwift","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","DocBook-DTD","DocBook-Schema","DocBook-Stylesheet","DocBook-XML","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRSD","FSFULLRWD","FSL-1.1-ALv2","FSL-1.1-MIT","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Game-Programming-Gems","Giftware","Glide","Glulxe","Graphics-Gems","Gutmann","HDF5","HIDAPI","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Netrek","HPND-Pbmplus","HPND-UC","HPND-UC-export-US","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-merchantability-variant","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","InnoSetup","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIPS","MIT","MIT-0","MIT-CMU","MIT-Click","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTIA-PD","NTP","NTP-0","Naumen","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMAIL-GPL","SMLNJ","SMPPL","SNIA","SOFA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SUL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","Sendmail-Open-Source-1.1","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","W3C","W3C-19980720","W3C-20150513","WTFPL","Watcom-1.0","Widget-Workshop","Wsuipa","X11","X11-distribute-modifications-variant","X11-swapped","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","any-OSI","any-OSI-perl-modules","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","cve-tou","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","generic-xts","gnuplot","gtkbook","hdparm","iMatix","jove","libpng-1.6.35","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","man2html","metamail","mpi-permissive","mpich2","mplus","ngrep","pkgconf","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","threeparttable","ulem","w3m","wwl","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","xzoom","zlib-acknowledgement"],Fw=["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.1","LGPL-3.0","Net-SNMP","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"],Mw=["389-exception","Asterisk-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"],Sc,uh;function jw(){if(uh)return Sc;uh=1;var t=[].concat(sd).concat(Fw),e=Mw;return Sc=function(r){var s=0;function i(){return s<r.length}function n(y){if(y instanceof RegExp){var v=r.slice(s),_=v.match(y);if(_)return s+=_[0].length,_[0]}else if(r.indexOf(y,s)===s)return s+=y.length,y}function a(){n(/[ ]*/)}function o(){for(var y,v=["WITH","AND","OR","(",")",":","+"],_=0;_<v.length&&(y=n(v[_]),!y);_++);if(y==="+"&&s>1&&r[s-2]===" ")throw new Error("Space before `+`");return y&&{type:"OPERATOR",string:y}}function c(){return n(/[A-Za-z0-9-.]+/)}function l(){var y=c();if(!y)throw new Error("Expected idstring at offset "+s);return y}function u(){if(n("DocumentRef-")){var y=l();return{type:"DOCUMENTREF",string:y}}}function p(){if(n("LicenseRef-")){var y=l();return{type:"LICENSEREF",string:y}}}function g(){var y=s,v=c();if(t.indexOf(v)!==-1)return{type:"LICENSE",string:v};if(e.indexOf(v)!==-1)return{type:"EXCEPTION",string:v};s=y}function f(){return o()||u()||p()||g()}for(var d=[];i()&&(a(),!!i());){var m=f();if(!m)throw new Error("Unexpected `"+r[s]+"` at offset "+s);d.push(m)}return d},Sc}var Rc,fh;function Bw(){return fh||(fh=1,Rc=function(t){var e=0;function r(){return e<t.length}function s(){return r()?t[e]:null}function i(){if(!r())throw new Error;e++}function n(m){var y=s();if(y&&y.type==="OPERATOR"&&m===y.string)return i(),y.string}function a(){if(n("WITH")){var m=s();if(m&&m.type==="EXCEPTION")return i(),m.string;throw new Error("Expected exception after `WITH`")}}function o(){var m=e,y="",v=s();if(v.type==="DOCUMENTREF"&&(i(),y+="DocumentRef-"+v.string+":",!n(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(v=s(),v.type==="LICENSEREF")return i(),y+="LicenseRef-"+v.string,{license:y};e=m}function c(){var m=s();if(m&&m.type==="LICENSE"){i();var y={license:m.string};n("+")&&(y.plus=!0);var v=a();return v&&(y.exception=v),y}}function l(){var m=n("(");if(m){var y=f();if(!n(")"))throw new Error("Expected `)`");return y}}function u(){return l()||o()||c()}function p(m,y){return function v(){var _=y();if(_){if(!n(m))return _;var w=v();if(!w)throw new Error("Expected expression");return{left:_,conjunction:m.toLowerCase(),right:w}}}}var g=p("AND",u),f=p("OR",g),d=f();if(!d||r())throw new Error("Syntax error");return d}),Rc}var Ac,hh;function id(){if(hh)return Ac;hh=1;var t=jw(),e=Bw();return Ac=function(r){return e(t(r))},Ac}var Cc,dh;function Uw(){if(dh)return Cc;dh=1;var t=id(),e=sd;function r(v){try{return t(v),!0}catch{return!1}}function s(v,_){var w=_[0].length-v[0].length;return w!==0?w:v[0].toUpperCase().localeCompare(_[0].toUpperCase())}var i=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(s),n=0,a=1,o=[function(v){return v.toUpperCase()},function(v){return v.trim()},function(v){return v.replace(/\./g,"")},function(v){return v.replace(/\s+/g,"")},function(v){return v.replace(/\s+/g,"-")},function(v){return v.replace("v","-")},function(v){return v.replace(/,?\s*(\d)/,"-$1")},function(v){return v.replace(/,?\s*(\d)/,"-$1.0")},function(v){return v.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(v){return v.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(v){return v[0].toUpperCase()+v.slice(1)},function(v){return v.replace("/","-")},function(v){return v.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(v){return v.indexOf("3.0")!==-1?v+"-or-later":v+"-only"},function(v){return v+"only"},function(v){return v.replace(/(\d)$/,"-$1.0")},function(v){return v.replace(/(-| )?(\d)$/,"-$2-Clause")},function(v){return v.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(v){return v.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(v){return v.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(v){return v.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(v){return v.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(v){return v.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(v){return"CC-"+v},function(v){return"CC-"+v+"-4.0"},function(v){return v.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(v){return"CC-"+v.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],c=e.map(function(v){var _=/^(.*)-\d+\.\d+$/.exec(v);return _?[_[0],_[1]]:[v,null]}).reduce(function(v,_){var w=_[1];return v[w]=v[w]||[],v[w].push(_[0]),v},{}),l=Object.keys(c).map(function(_){return[_,c[_]]}).filter(function(_){return _[1].length===1&&_[0]!==null&&_[0]!=="APL"}).map(function(_){return[_[0],_[1][0]]});c=void 0;var u=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(l).sort(s),p=0,g=1,f=function(v){for(var _=0;_<o.length;_++){var w=o[_](v).trim();if(w!==v&&r(w))return w}return null},d=function(v){for(var _=v.toUpperCase(),w=0;w<u.length;w++){var h=u[w];if(_.indexOf(h[p])>-1)return h[g]}return null},m=function(v,_){for(var w=0;w<i.length;w++){var h=i[w],b=h[n];if(v.indexOf(b)>-1){var x=v.replace(b,h[a]),E=_(x);if(E!==null)return E}}return null};Cc=function(v,_){_=_||{};var w=_.upgrade===void 0?!0:!!_.upgrade;function h(L){return w?y(L):L}var b=typeof v=="string"&&v.trim().length!==0;if(!b)throw Error("Invalid argument. Expected non-empty string.");if(v=v.trim(),r(v))return h(v);var x=v.replace(/\+$/,"").trim();if(r(x))return h(x);var E=f(v);return E!==null||(E=m(v,function(L){return r(L)?L:f(L)}),E!==null)||(E=d(v),E!==null)||(E=m(v,d),E!==null)?h(E):null};function y(v){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(v)!==-1?v+"-only":["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(v)!==-1?v.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(v)!==-1?v+"-or-later":v}return Cc}var Oc,ph;function nd(){if(ph)return Oc;ph=1;var t=id(),e=Uw(),r='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',s=/^SEE LICEN[CS]E IN (.+)$/;function i(a,o){return o.slice(0,a.length)===a}function n(a){if(a.hasOwnProperty("license")){var o=a.license;return i("LicenseRef",o)||i("DocumentRef",o)}else return n(a.left)||n(a.right)}return Oc=function(a){var o;try{o=t(a)}catch{var c;if(a==="UNLICENSED"||a==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(c=s.exec(a))return{validForOldPackages:!0,validForNewPackages:!0,inFile:c[1]};var l={validForOldPackages:!1,validForNewPackages:!1,warnings:[r]};if(a.trim().length!==0){var u=e(a);u&&l.warnings.push('license is similar to the valid expression "'+u+'"')}return l}return n(o)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[r]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}},Oc}var qi={},mh;function Gw(){if(mh)return qi;mh=1,Object.defineProperty(qi,"__esModule",{value:!0}),qi.LRUCache=void 0;let t=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,e=new Set,r=typeof process=="object"&&process?process:{},s=(g,f,d,m)=>{typeof r.emitWarning=="function"?r.emitWarning(g,f,d,m):console.error(`[${d}] ${f}: ${g}`)},i=globalThis.AbortController,n=globalThis.AbortSignal;if(typeof i>"u"){n=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(m,y){this._onabort.push(y)}},i=class{constructor(){f()}signal=new n;abort(m){if(!this.signal.aborted){this.signal.reason=m,this.signal.aborted=!0;for(let y of this.signal._onabort)y(m);this.signal.onabort?.(m)}}};let g=r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",f=()=>{g&&(g=!1,s("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",f))}}let a=g=>!e.has(g),o=g=>g&&g===Math.floor(g)&&g>0&&isFinite(g),c=g=>o(g)?g<=Math.pow(2,8)?Uint8Array:g<=Math.pow(2,16)?Uint16Array:g<=Math.pow(2,32)?Uint32Array:g<=Number.MAX_SAFE_INTEGER?l:null:null;class l extends Array{constructor(f){super(f),this.fill(0)}}class u{heap;length;static#t=!1;static create(f){let d=c(f);if(!d)return[];u.#t=!0;let m=new u(f,d);return u.#t=!1,m}constructor(f,d){if(!u.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new d(f),this.length=0}push(f){this.heap[this.length++]=f}pop(){return this.heap[--this.length]}}class p{#t;#r;#e;#n;#f;#_;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#u;#i;#c;#s;#l;#o;#p;#g;#y;#d;#A;#w;#x;#E;#S;#b;static unsafeExposeInternals(f){return{starts:f.#w,ttls:f.#x,sizes:f.#A,keyMap:f.#i,keyList:f.#c,valList:f.#s,next:f.#l,prev:f.#o,get head(){return f.#p},get tail(){return f.#g},free:f.#y,isBackgroundFetch:d=>f.#m(d),backgroundFetch:(d,m,y,v)=>f.#k(d,m,y,v),moveToTail:d=>f.#D(d),indexes:d=>f.#O(d),rindexes:d=>f.#L(d),isStale:d=>f.#R(d)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#u}get size(){return this.#a}get fetchMethod(){return this.#f}get memoMethod(){return this.#_}get dispose(){return this.#e}get disposeAfter(){return this.#n}constructor(f){let{max:d=0,ttl:m,ttlResolution:y=1,ttlAutopurge:v,updateAgeOnGet:_,updateAgeOnHas:w,allowStale:h,dispose:b,disposeAfter:x,noDisposeOnSet:E,noUpdateTTL:L,maxSize:A=0,maxEntrySize:O=0,sizeCalculation:k,fetchMethod:z,memoMethod:P,noDeleteOnFetchRejection:H,noDeleteOnStaleGet:re,allowStaleOnFetchRejection:W,allowStaleOnFetchAbort:J,ignoreFetchAbort:fe}=f;if(d!==0&&!o(d))throw new TypeError("max option must be a nonnegative integer");let ne=d?c(d):Array;if(!ne)throw new Error("invalid max value: "+d);if(this.#t=d,this.#r=A,this.maxEntrySize=O||this.#r,this.sizeCalculation=k,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(P!==void 0&&typeof P!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#_=P,z!==void 0&&typeof z!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#f=z,this.#S=!!z,this.#i=new Map,this.#c=new Array(d).fill(void 0),this.#s=new Array(d).fill(void 0),this.#l=new ne(d),this.#o=new ne(d),this.#p=0,this.#g=0,this.#y=u.create(d),this.#a=0,this.#u=0,typeof b=="function"&&(this.#e=b),typeof x=="function"?(this.#n=x,this.#d=[]):(this.#n=void 0,this.#d=void 0),this.#E=!!this.#e,this.#b=!!this.#n,this.noDisposeOnSet=!!E,this.noUpdateTTL=!!L,this.noDeleteOnFetchRejection=!!H,this.allowStaleOnFetchRejection=!!W,this.allowStaleOnFetchAbort=!!J,this.ignoreFetchAbort=!!fe,this.maxEntrySize!==0){if(this.#r!==0&&!o(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!o(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#I()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!re,this.updateAgeOnGet=!!_,this.updateAgeOnHas=!!w,this.ttlResolution=o(y)||y===0?y:1,this.ttlAutopurge=!!v,this.ttl=m||0,this.ttl){if(!o(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let $e="LRU_CACHE_UNBOUNDED";a($e)&&(e.add($e),s("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",$e,p))}}getRemainingTTL(f){return this.#i.has(f)?1/0:0}#P(){let f=new l(this.#t),d=new l(this.#t);this.#x=f,this.#w=d,this.#F=(v,_,w=t.now())=>{if(d[v]=_!==0?w:0,f[v]=_,_!==0&&this.ttlAutopurge){let h=setTimeout(()=>{this.#R(v)&&this.#v(this.#c[v],"expire")},_+1);h.unref&&h.unref()}},this.#C=v=>{d[v]=f[v]!==0?t.now():0},this.#h=(v,_)=>{if(f[_]){let w=f[_],h=d[_];if(!w||!h)return;v.ttl=w,v.start=h,v.now=m||y();let b=v.now-h;v.remainingTTL=w-b}};let m=0,y=()=>{let v=t.now();if(this.ttlResolution>0){m=v;let _=setTimeout(()=>m=0,this.ttlResolution);_.unref&&_.unref()}return v};this.getRemainingTTL=v=>{let _=this.#i.get(v);if(_===void 0)return 0;let w=f[_],h=d[_];if(!w||!h)return 1/0;let b=(m||y())-h;return w-b},this.#R=v=>{let _=d[v],w=f[v];return!!w&&!!_&&(m||y())-_>w}}#C=()=>{};#h=()=>{};#F=()=>{};#R=()=>!1;#I(){let f=new l(this.#t);this.#u=0,this.#A=f,this.#N=d=>{this.#u-=f[d],f[d]=0},this.#B=(d,m,y,v)=>{if(this.#m(m))return 0;if(!o(y))if(v){if(typeof v!="function")throw new TypeError("sizeCalculation must be a function");if(y=v(m,d),!o(y))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return y},this.#T=(d,m,y)=>{if(f[d]=m,this.#r){let v=this.#r-f[d];for(;this.#u>v;)this.#$(!0)}this.#u+=f[d],y&&(y.entrySize=m,y.totalCalculatedSize=this.#u)}}#N=f=>{};#T=(f,d,m)=>{};#B=(f,d,m,y)=>{if(m||y)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#O({allowStale:f=this.allowStale}={}){if(this.#a)for(let d=this.#g;!(!this.#M(d)||((f||!this.#R(d))&&(yield d),d===this.#p));)d=this.#o[d]}*#L({allowStale:f=this.allowStale}={}){if(this.#a)for(let d=this.#p;!(!this.#M(d)||((f||!this.#R(d))&&(yield d),d===this.#g));)d=this.#l[d]}#M(f){return f!==void 0&&this.#i.get(this.#c[f])===f}*entries(){for(let f of this.#O())this.#s[f]!==void 0&&this.#c[f]!==void 0&&!this.#m(this.#s[f])&&(yield[this.#c[f],this.#s[f]])}*rentries(){for(let f of this.#L())this.#s[f]!==void 0&&this.#c[f]!==void 0&&!this.#m(this.#s[f])&&(yield[this.#c[f],this.#s[f]])}*keys(){for(let f of this.#O()){let d=this.#c[f];d!==void 0&&!this.#m(this.#s[f])&&(yield d)}}*rkeys(){for(let f of this.#L()){let d=this.#c[f];d!==void 0&&!this.#m(this.#s[f])&&(yield d)}}*values(){for(let f of this.#O())this.#s[f]!==void 0&&!this.#m(this.#s[f])&&(yield this.#s[f])}*rvalues(){for(let f of this.#L())this.#s[f]!==void 0&&!this.#m(this.#s[f])&&(yield this.#s[f])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(f,d={}){for(let m of this.#O()){let y=this.#s[m],v=this.#m(y)?y.__staleWhileFetching:y;if(v!==void 0&&f(v,this.#c[m],this))return this.get(this.#c[m],d)}}forEach(f,d=this){for(let m of this.#O()){let y=this.#s[m],v=this.#m(y)?y.__staleWhileFetching:y;v!==void 0&&f.call(d,v,this.#c[m],this)}}rforEach(f,d=this){for(let m of this.#L()){let y=this.#s[m],v=this.#m(y)?y.__staleWhileFetching:y;v!==void 0&&f.call(d,v,this.#c[m],this)}}purgeStale(){let f=!1;for(let d of this.#L({allowStale:!0}))this.#R(d)&&(this.#v(this.#c[d],"expire"),f=!0);return f}info(f){let d=this.#i.get(f);if(d===void 0)return;let m=this.#s[d],y=this.#m(m)?m.__staleWhileFetching:m;if(y===void 0)return;let v={value:y};if(this.#x&&this.#w){let _=this.#x[d],w=this.#w[d];if(_&&w){let h=_-(t.now()-w);v.ttl=h,v.start=Date.now()}}return this.#A&&(v.size=this.#A[d]),v}dump(){let f=[];for(let d of this.#O({allowStale:!0})){let m=this.#c[d],y=this.#s[d],v=this.#m(y)?y.__staleWhileFetching:y;if(v===void 0||m===void 0)continue;let _={value:v};if(this.#x&&this.#w){_.ttl=this.#x[d];let w=t.now()-this.#w[d];_.start=Math.floor(Date.now()-w)}this.#A&&(_.size=this.#A[d]),f.unshift([m,_])}return f}load(f){this.clear();for(let[d,m]of f){if(m.start){let y=Date.now()-m.start;m.start=t.now()-y}this.set(d,m.value,m)}}set(f,d,m={}){if(d===void 0)return this.delete(f),this;let{ttl:y=this.ttl,start:v,noDisposeOnSet:_=this.noDisposeOnSet,sizeCalculation:w=this.sizeCalculation,status:h}=m,{noUpdateTTL:b=this.noUpdateTTL}=m,x=this.#B(f,d,m.size||0,w);if(this.maxEntrySize&&x>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this.#v(f,"set"),this;let E=this.#a===0?void 0:this.#i.get(f);if(E===void 0)E=this.#a===0?this.#g:this.#y.length!==0?this.#y.pop():this.#a===this.#t?this.#$(!1):this.#a,this.#c[E]=f,this.#s[E]=d,this.#i.set(f,E),this.#l[this.#g]=E,this.#o[E]=this.#g,this.#g=E,this.#a++,this.#T(E,x,h),h&&(h.set="add"),b=!1;else{this.#D(E);let L=this.#s[E];if(d!==L){if(this.#S&&this.#m(L)){L.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:A}=L;A!==void 0&&!_&&(this.#E&&this.#e?.(A,f,"set"),this.#b&&this.#d?.push([A,f,"set"]))}else _||(this.#E&&this.#e?.(L,f,"set"),this.#b&&this.#d?.push([L,f,"set"]));if(this.#N(E),this.#T(E,x,h),this.#s[E]=d,h){h.set="replace";let A=L&&this.#m(L)?L.__staleWhileFetching:L;A!==void 0&&(h.oldValue=A)}}else h&&(h.set="update")}if(y!==0&&!this.#x&&this.#P(),this.#x&&(b||this.#F(E,y,v),h&&this.#h(h,E)),!_&&this.#b&&this.#d){let L=this.#d,A;for(;A=L?.shift();)this.#n?.(...A)}return this}pop(){try{for(;this.#a;){let f=this.#s[this.#p];if(this.#$(!0),this.#m(f)){if(f.__staleWhileFetching)return f.__staleWhileFetching}else if(f!==void 0)return f}}finally{if(this.#b&&this.#d){let f=this.#d,d;for(;d=f?.shift();)this.#n?.(...d)}}}#$(f){let d=this.#p,m=this.#c[d],y=this.#s[d];return this.#S&&this.#m(y)?y.__abortController.abort(new Error("evicted")):(this.#E||this.#b)&&(this.#E&&this.#e?.(y,m,"evict"),this.#b&&this.#d?.push([y,m,"evict"])),this.#N(d),f&&(this.#c[d]=void 0,this.#s[d]=void 0,this.#y.push(d)),this.#a===1?(this.#p=this.#g=0,this.#y.length=0):this.#p=this.#l[d],this.#i.delete(m),this.#a--,d}has(f,d={}){let{updateAgeOnHas:m=this.updateAgeOnHas,status:y}=d,v=this.#i.get(f);if(v!==void 0){let _=this.#s[v];if(this.#m(_)&&_.__staleWhileFetching===void 0)return!1;if(this.#R(v))y&&(y.has="stale",this.#h(y,v));else return m&&this.#C(v),y&&(y.has="hit",this.#h(y,v)),!0}else y&&(y.has="miss");return!1}peek(f,d={}){let{allowStale:m=this.allowStale}=d,y=this.#i.get(f);if(y===void 0||!m&&this.#R(y))return;let v=this.#s[y];return this.#m(v)?v.__staleWhileFetching:v}#k(f,d,m,y){let v=d===void 0?void 0:this.#s[d];if(this.#m(v))return v;let _=new i,{signal:w}=m;w?.addEventListener("abort",()=>_.abort(w.reason),{signal:_.signal});let h={signal:_.signal,options:m,context:y},b=(k,z=!1)=>{let{aborted:P}=_.signal,H=m.ignoreFetchAbort&&k!==void 0;if(m.status&&(P&&!z?(m.status.fetchAborted=!0,m.status.fetchError=_.signal.reason,H&&(m.status.fetchAbortIgnored=!0)):m.status.fetchResolved=!0),P&&!H&&!z)return E(_.signal.reason);let re=A;return this.#s[d]===A&&(k===void 0?re.__staleWhileFetching?this.#s[d]=re.__staleWhileFetching:this.#v(f,"fetch"):(m.status&&(m.status.fetchUpdated=!0),this.set(f,k,h.options))),k},x=k=>(m.status&&(m.status.fetchRejected=!0,m.status.fetchError=k),E(k)),E=k=>{let{aborted:z}=_.signal,P=z&&m.allowStaleOnFetchAbort,H=P||m.allowStaleOnFetchRejection,re=H||m.noDeleteOnFetchRejection,W=A;if(this.#s[d]===A&&(!re||W.__staleWhileFetching===void 0?this.#v(f,"fetch"):P||(this.#s[d]=W.__staleWhileFetching)),H)return m.status&&W.__staleWhileFetching!==void 0&&(m.status.returnedStale=!0),W.__staleWhileFetching;if(W.__returned===W)throw k},L=(k,z)=>{let P=this.#f?.(f,v,h);P&&P instanceof Promise&&P.then(H=>k(H===void 0?void 0:H),z),_.signal.addEventListener("abort",()=>{(!m.ignoreFetchAbort||m.allowStaleOnFetchAbort)&&(k(void 0),m.allowStaleOnFetchAbort&&(k=H=>b(H,!0)))})};m.status&&(m.status.fetchDispatched=!0);let A=new Promise(L).then(b,x),O=Object.assign(A,{__abortController:_,__staleWhileFetching:v,__returned:void 0});return d===void 0?(this.set(f,O,{...h.options,status:void 0}),d=this.#i.get(f)):this.#s[d]=O,O}#m(f){if(!this.#S)return!1;let d=f;return!!d&&d instanceof Promise&&d.hasOwnProperty("__staleWhileFetching")&&d.__abortController instanceof i}async fetch(f,d={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:v=this.noDeleteOnStaleGet,ttl:_=this.ttl,noDisposeOnSet:w=this.noDisposeOnSet,size:h=0,sizeCalculation:b=this.sizeCalculation,noUpdateTTL:x=this.noUpdateTTL,noDeleteOnFetchRejection:E=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:L=this.allowStaleOnFetchRejection,ignoreFetchAbort:A=this.ignoreFetchAbort,allowStaleOnFetchAbort:O=this.allowStaleOnFetchAbort,context:k,forceRefresh:z=!1,status:P,signal:H}=d;if(!this.#S)return P&&(P.fetch="get"),this.get(f,{allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:v,status:P});let re={allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:v,ttl:_,noDisposeOnSet:w,size:h,sizeCalculation:b,noUpdateTTL:x,noDeleteOnFetchRejection:E,allowStaleOnFetchRejection:L,allowStaleOnFetchAbort:O,ignoreFetchAbort:A,status:P,signal:H},W=this.#i.get(f);if(W===void 0){P&&(P.fetch="miss");let J=this.#k(f,W,re,k);return J.__returned=J}else{let J=this.#s[W];if(this.#m(J)){let Ue=m&&J.__staleWhileFetching!==void 0;return P&&(P.fetch="inflight",Ue&&(P.returnedStale=!0)),Ue?J.__staleWhileFetching:J.__returned=J}let fe=this.#R(W);if(!z&&!fe)return P&&(P.fetch="hit"),this.#D(W),y&&this.#C(W),P&&this.#h(P,W),J;let ne=this.#k(f,W,re,k),Pe=ne.__staleWhileFetching!==void 0&&m;return P&&(P.fetch=fe?"stale":"refresh",Pe&&fe&&(P.returnedStale=!0)),Pe?ne.__staleWhileFetching:ne.__returned=ne}}async forceFetch(f,d={}){let m=await this.fetch(f,d);if(m===void 0)throw new Error("fetch() returned undefined");return m}memo(f,d={}){let m=this.#_;if(!m)throw new Error("no memoMethod provided to constructor");let{context:y,forceRefresh:v,..._}=d,w=this.get(f,_);if(!v&&w!==void 0)return w;let h=m(f,w,{options:_,context:y});return this.set(f,h,_),h}get(f,d={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:v=this.noDeleteOnStaleGet,status:_}=d,w=this.#i.get(f);if(w!==void 0){let h=this.#s[w],b=this.#m(h);return _&&this.#h(_,w),this.#R(w)?(_&&(_.get="stale"),b?(_&&m&&h.__staleWhileFetching!==void 0&&(_.returnedStale=!0),m?h.__staleWhileFetching:void 0):(v||this.#v(f,"expire"),_&&m&&(_.returnedStale=!0),m?h:void 0)):(_&&(_.get="hit"),b?h.__staleWhileFetching:(this.#D(w),y&&this.#C(w),h))}else _&&(_.get="miss")}#j(f,d){this.#o[d]=f,this.#l[f]=d}#D(f){f!==this.#g&&(f===this.#p?this.#p=this.#l[f]:this.#j(this.#o[f],this.#l[f]),this.#j(this.#g,f),this.#g=f)}delete(f){return this.#v(f,"delete")}#v(f,d){let m=!1;if(this.#a!==0){let y=this.#i.get(f);if(y!==void 0)if(m=!0,this.#a===1)this.#G(d);else{this.#N(y);let v=this.#s[y];if(this.#m(v)?v.__abortController.abort(new Error("deleted")):(this.#E||this.#b)&&(this.#E&&this.#e?.(v,f,d),this.#b&&this.#d?.push([v,f,d])),this.#i.delete(f),this.#c[y]=void 0,this.#s[y]=void 0,y===this.#g)this.#g=this.#o[y];else if(y===this.#p)this.#p=this.#l[y];else{let _=this.#o[y];this.#l[_]=this.#l[y];let w=this.#l[y];this.#o[w]=this.#o[y]}this.#a--,this.#y.push(y)}}if(this.#b&&this.#d?.length){let y=this.#d,v;for(;v=y?.shift();)this.#n?.(...v)}return m}clear(){return this.#G("delete")}#G(f){for(let d of this.#L({allowStale:!0})){let m=this.#s[d];if(this.#m(m))m.__abortController.abort(new Error("deleted"));else{let y=this.#c[d];this.#E&&this.#e?.(m,y,f),this.#b&&this.#d?.push([m,y,f])}}if(this.#i.clear(),this.#s.fill(void 0),this.#c.fill(void 0),this.#x&&this.#w&&(this.#x.fill(0),this.#w.fill(0)),this.#A&&this.#A.fill(0),this.#p=0,this.#g=0,this.#y.length=0,this.#u=0,this.#a=0,this.#b&&this.#d){let d=this.#d,m;for(;m=d?.shift();)this.#n?.(...m)}}}return qi.LRUCache=p,qi}var Tc,gh;function zw(){if(gh)return Tc;gh=1;let t=(...n)=>n.every(a=>a)?n.join(""):"",e=n=>n?encodeURIComponent(n):"",r=n=>n.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-"),s={sshtemplate:({domain:n,user:a,project:o,committish:c})=>`git@${n}:${a}/${o}.git${t("#",c)}`,sshurltemplate:({domain:n,user:a,project:o,committish:c})=>`git+ssh://git@${n}/${a}/${o}.git${t("#",c)}`,edittemplate:({domain:n,user:a,project:o,committish:c,editpath:l,path:u})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u)}`,browsetemplate:({domain:n,user:a,project:o,committish:c,treepath:l})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c))}`,browsetreetemplate:({domain:n,user:a,project:o,committish:c,treepath:l,path:u,fragment:p,hashformat:g})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",g(p||""))}`,browseblobtemplate:({domain:n,user:a,project:o,committish:c,blobpath:l,path:u,fragment:p,hashformat:g})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",g(p||""))}`,docstemplate:({domain:n,user:a,project:o,treepath:c,committish:l})=>`https://${n}/${a}/${o}${t("/",c,"/",e(l))}#readme`,httpstemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git+https://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,filetemplate:({domain:n,user:a,project:o,committish:c,path:l})=>`https://${n}/${a}/${o}/raw/${e(c||"HEAD")}/${l}`,shortcuttemplate:({type:n,user:a,project:o,committish:c})=>`${n}:${a}/${o}${t("#",c)}`,pathtemplate:({user:n,project:a,committish:o})=>`${n}/${a}${t("#",o)}`,bugstemplate:({domain:n,user:a,project:o})=>`https://${n}/${a}/${o}/issues`,hashformat:r},i={};i.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:n,user:a,project:o,committish:c,path:l})=>`https://${t(n,"@")}raw.githubusercontent.com/${a}/${o}/${e(c||"HEAD")}/${l}`,gittemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://codeload.${n}/${a}/${o}/tar.gz/${e(c||"HEAD")}`,extract:n=>{let[,a,o,c,l]=n.pathname.split("/",5);if(!(c&&c!=="tree")&&(c||(l=n.hash.slice(1)),o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:l}}},i.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:n,user:a,project:o,committish:c,treepath:l,path:u,editpath:p})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u,p)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/get/${e(c||"HEAD")}.tar.gz`,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(!["get"].includes(c)&&(o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:n.hash.slice(1)}}},i.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",httpstemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git+https://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/repository/archive.tar.gz?ref=${e(c||"HEAD")}`,extract:n=>{let a=n.pathname.slice(1);if(a.includes("/-/")||a.includes("/archive.tar.gz"))return;let o=a.split("/"),c=o.pop();c.endsWith(".git")&&(c=c.slice(0,-4));let l=o.join("/");if(!(!l||!c))return{user:l,project:c,committish:n.hash.slice(1)}}},i.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:n,project:a,committish:o})=>`git@${n}:${a}.git${t("#",o)}`,sshurltemplate:({domain:n,project:a,committish:o})=>`git+ssh://git@${n}/${a}.git${t("#",o)}`,edittemplate:({domain:n,user:a,project:o,committish:c,editpath:l})=>`https://${n}/${a}/${o}${t("/",e(c))}/${l}`,browsetemplate:({domain:n,project:a,committish:o})=>`https://${n}/${a}${t("/",e(o))}`,browsetreetemplate:({domain:n,project:a,committish:o,path:c,hashformat:l})=>`https://${n}/${a}${t("/",e(o))}${t("#",l(c))}`,browseblobtemplate:({domain:n,project:a,committish:o,path:c,hashformat:l})=>`https://${n}/${a}${t("/",e(o))}${t("#",l(c))}`,docstemplate:({domain:n,project:a,committish:o})=>`https://${n}/${a}${t("/",e(o))}`,httpstemplate:({domain:n,project:a,committish:o})=>`git+https://${n}/${a}.git${t("#",o)}`,filetemplate:({user:n,project:a,committish:o,path:c})=>`https://gist.githubusercontent.com/${n}/${a}/raw${t("/",e(o))}/${c}`,shortcuttemplate:({type:n,project:a,committish:o})=>`${n}:${a}${t("#",o)}`,pathtemplate:({project:n,committish:a})=>`${n}${t("#",a)}`,bugstemplate:({domain:n,project:a})=>`https://${n}/${a}`,gittemplate:({domain:n,project:a,committish:o})=>`git://${n}/${a}.git${t("#",o)}`,tarballtemplate:({project:n,committish:a})=>`https://codeload.github.com/gist/${n}/tar.gz/${e(a||"HEAD")}`,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(c!=="raw"){if(!o){if(!a)return;o=a,a=null}return o.endsWith(".git")&&(o=o.slice(0,-4)),{user:a,project:o,committish:n.hash.slice(1)}}},hashformat:function(n){return n&&"file-"+r(n)}},i.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:n,user:a,project:o,committish:c,path:l})=>`https://${n}/${a}/${o}/blob/${e(c)||"HEAD"}/${l}`,httpstemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}.git${t("#",c)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/archive/${e(c)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(!["archive"].includes(c)&&(o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:n.hash.slice(1)}}};for(let[n,a]of Object.entries(i))i[n]=Object.assign({},s,a);return Tc=i,Tc}var Lc,yh;function od(){if(yh)return Lc;yh=1;let t=Qc,e=(n,a,o)=>{let c=n.indexOf(o);return n.lastIndexOf(a,c>-1?c:1/0)},r=n=>{try{return new t.URL(n)}catch{}},s=(n,a)=>{let o=n.indexOf(":"),c=n.slice(0,o+1);if(Object.prototype.hasOwnProperty.call(a,c))return n;let l=n.indexOf("@");return l>-1?l>o?`git+ssh://${n}`:n:n.indexOf("//")===o+1?n:`${n.slice(0,o+1)}//${n.slice(o+1)}`},i=n=>{let a=e(n,"@","#"),o=e(n,":","#");return o>a&&(n=n.slice(0,o)+"/"+n.slice(o+1)),e(n,":","#")===-1&&n.indexOf("//")===-1&&(n=`git+ssh://${n}`),n};return Lc=(n,a)=>{let o=a?s(n,a):n;return r(o)||r(i(o))},Lc}var $c,vh;function qw(){if(vh)return $c;vh=1;let t=od(),e=r=>{let s=r.indexOf("#"),i=r.indexOf("/"),n=r.indexOf("/",i+1),a=r.indexOf(":"),o=/\s/.exec(r),c=r.indexOf("@"),l=!o||s>-1&&o.index>s,u=c===-1||s>-1&&c>s,p=a===-1||s>-1&&a>s,g=n===-1||s>-1&&n>s,f=i>0,d=s>-1?r[s-1]!=="/":!r.endsWith("/"),m=!r.startsWith(".");return l&&f&&d&&m&&u&&p&&g};return $c=(r,s,{gitHosts:i,protocols:n})=>{if(!r)return;let a=e(r)?`github:${r}`:r,o=t(a,n);if(!o)return;let c=i.byShortcut[o.protocol],l=i.byDomain[o.hostname.startsWith("www.")?o.hostname.slice(4):o.hostname],u=c||l;if(!u)return;let p=i[c||l],g=null;n[o.protocol]?.auth&&(o.username||o.password)&&(g=`${o.username}${o.password?":"+o.password:""}`);let f=null,d=null,m=null,y=null;try{if(c){let v=o.pathname.startsWith("/")?o.pathname.slice(1):o.pathname,_=v.indexOf("@");_>-1&&(v=v.slice(_+1));let w=v.lastIndexOf("/");w>-1?(d=decodeURIComponent(v.slice(0,w)),d||(d=null),m=decodeURIComponent(v.slice(w+1))):m=decodeURIComponent(v),m.endsWith(".git")&&(m=m.slice(0,-4)),o.hash&&(f=decodeURIComponent(o.hash.slice(1))),y="shortcut"}else{if(!p.protocols.includes(o.protocol))return;let v=p.extract(o);if(!v)return;d=v.user&&decodeURIComponent(v.user),m=decodeURIComponent(v.project),f=decodeURIComponent(v.committish),y=n[o.protocol]?.name||o.protocol.slice(0,-1)}}catch(v){if(v instanceof URIError)return;throw v}return[u,d,g,m,f,y,s]},$c}var Pc,bh;function Ww(){if(bh)return Pc;bh=1;let{LRUCache:t}=Gw(),e=zw(),r=qw(),s=od(),i=new t({max:1e3});class n{constructor(o,c,l,u,p,g,f={}){Object.assign(this,n.#t[o],{type:o,user:c,auth:l,project:u,committish:p,default:g,opts:f})}static#t={byShortcut:{},byDomain:{}};static#r={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(o,c){n.#t[o]=c,n.#t.byDomain[c.domain]=o,n.#t.byShortcut[`${o}:`]=o,n.#r[`${o}:`]={name:o}}static fromUrl(o,c){if(typeof o!="string")return;let l=o+JSON.stringify(c||{});if(!i.has(l)){let u=r(o,c,{gitHosts:n.#t,protocols:n.#r});i.set(l,u?new n(...u):void 0)}return i.get(l)}static parseUrl(o){return s(o)}#e(o,c){if(typeof o!="function")return null;let l={...this,...this.opts,...c};l.path||(l.path=""),l.path.startsWith("/")&&(l.path=l.path.slice(1)),l.noCommittish&&(l.committish=null);let u=o(l);return l.noGitPlus&&u.startsWith("git+")?u.slice(4):u}hash(){return this.committish?`#${this.committish}`:""}ssh(o){return this.#e(this.sshtemplate,o)}sshurl(o){return this.#e(this.sshurltemplate,o)}browse(o,...c){return typeof o!="string"?this.#e(this.browsetemplate,o):typeof c[0]!="string"?this.#e(this.browsetreetemplate,{...c[0],path:o}):this.#e(this.browsetreetemplate,{...c[1],fragment:c[0],path:o})}browseFile(o,...c){return typeof c[0]!="string"?this.#e(this.browseblobtemplate,{...c[0],path:o}):this.#e(this.browseblobtemplate,{...c[1],fragment:c[0],path:o})}docs(o){return this.#e(this.docstemplate,o)}bugs(o){return this.#e(this.bugstemplate,o)}https(o){return this.#e(this.httpstemplate,o)}git(o){return this.#e(this.gittemplate,o)}shortcut(o){return this.#e(this.shortcuttemplate,o)}path(o){return this.#e(this.pathtemplate,o)}tarball(o){return this.#e(this.tarballtemplate,{...o,noCommittish:!1})}file(o,c){return this.#e(this.filetemplate,{...c,path:o})}edit(o,c){return this.#e(this.edittemplate,{...c,path:o})}getDefaultRepresentation(){return this.default}toString(o){return this.default&&typeof this[this.default]=="function"?this[this.default](o):this.sshurl(o)}}for(let[a,o]of Object.entries(e))n.addHost(a,o);return Pc=n,Pc}var Ic,_h;function Vw(){if(_h)return Ic;_h=1,Ic=t;function t(e){if(!e||e==="ERROR: No README data found!")return;e=e.trim().split(`
|
|
30
|
+
`);let r=0;for(;e[r]&&e[r].trim().match(/^(#|$)/);)r++;let s=e.length,i=r+1;for(;i<s&&e[i].trim();)i++;return e.slice(r,i).join(" ").trim()}return Ic}var Zw={dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},Hw={web:"url",name:"url"},Kw={server:"start",tests:"test"},Yw={topLevel:Zw,bugs:Hw,script:Kw},kc,wh;function Jw(){if(wh)return kc;wh=1;var t=td(),e=rd(),r=nd(),s=Ww(),i=Gh,n=["dependencies","devDependencies","optionalDependencies"],a=Vw(),o=Qc,c=Yw,l=h=>h.includes("@")&&h.indexOf("@")<h.lastIndexOf(".");kc={warn:function(){},fixRepositoryField:function(h){if(h.repositories&&(this.warn("repositories"),h.repository=h.repositories[0]),!h.repository)return this.warn("missingRepository");typeof h.repository=="string"&&(h.repository={type:"git",url:h.repository});var b=h.repository.url||"";if(b){var x=s.fromUrl(b);x&&(b=h.repository.url=x.getDefaultRepresentation()==="shortcut"?x.https():x.toString())}b.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",b)},fixTypos:function(h){Object.keys(c.topLevel).forEach(function(b){Object.prototype.hasOwnProperty.call(h,b)&&this.warn("typo",b,c.topLevel[b])},this)},fixScriptsField:function(h){if(h.scripts){if(typeof h.scripts!="object"){this.warn("nonObjectScripts"),delete h.scripts;return}Object.keys(h.scripts).forEach(function(b){typeof h.scripts[b]!="string"?(this.warn("nonStringScript"),delete h.scripts[b]):c.script[b]&&!h.scripts[c.script[b]]&&this.warn("typo",b,c.script[b],"scripts")},this)}},fixFilesField:function(h){var b=h.files;b&&!Array.isArray(b)?(this.warn("nonArrayFiles"),delete h.files):h.files&&(h.files=h.files.filter(function(x){return!x||typeof x!="string"?(this.warn("invalidFilename",x),!1):!0},this))},fixBinField:function(h){if(h.bin&&typeof h.bin=="string"){var b={},x;(x=h.name.match(/^@[^/]+[/](.*)$/))?b[x[1]]=h.bin:b[h.name]=h.bin,h.bin=b}},fixManField:function(h){h.man&&typeof h.man=="string"&&(h.man=[h.man])},fixBundleDependenciesField:function(h){var b="bundledDependencies",x="bundleDependencies";h[b]&&!h[x]&&(h[x]=h[b],delete h[b]),h[x]&&!Array.isArray(h[x])?(this.warn("nonArrayBundleDependencies"),delete h[x]):h[x]&&(h[x]=h[x].filter(function(E){return!E||typeof E!="string"?(this.warn("nonStringBundleDependency",E),!1):(h.dependencies||(h.dependencies={}),Object.prototype.hasOwnProperty.call(h.dependencies,E)||(this.warn("nonDependencyBundleDependency",E),h.dependencies[E]="*"),!0)},this))},fixDependencies:function(h){_(h,this.warn),y(h,this.warn),this.fixBundleDependenciesField(h),["dependencies","devDependencies"].forEach(function(b){if(b in h){if(!h[b]||typeof h[b]!="object"){this.warn("nonObjectDependencies",b),delete h[b];return}Object.keys(h[b]).forEach(function(x){var E=h[b][x];typeof E!="string"&&(this.warn("nonStringDependency",x,JSON.stringify(E)),delete h[b][x]);var L=s.fromUrl(h[b][x]);L&&(h[b][x]=L.toString())},this)}},this)},fixModulesField:function(h){h.modules&&(this.warn("deprecatedModules"),delete h.modules)},fixKeywordsField:function(h){typeof h.keywords=="string"&&(h.keywords=h.keywords.split(/,\s+/)),h.keywords&&!Array.isArray(h.keywords)?(delete h.keywords,this.warn("nonArrayKeywords")):h.keywords&&(h.keywords=h.keywords.filter(function(b){return typeof b!="string"||!b?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(h,b){var x=!b;if(!h.version)return h.version="",!0;if(!t(h.version,x))throw new Error('Invalid version: "'+h.version+'"');return h.version=e(h.version,x),!0},fixPeople:function(h){f(h,d),f(h,m)},fixNameField:function(h,b){typeof b=="boolean"?b={strict:b}:typeof b>"u"&&(b={});var x=b.strict;if(!h.name&&!x){h.name="";return}if(typeof h.name!="string")throw new Error("name field must be a string.");x||(h.name=h.name.trim()),g(h.name,x,b.allowLegacyCase),i.builtinModules.includes(h.name)&&this.warn("conflictingName",h.name)},fixDescriptionField:function(h){h.description&&typeof h.description!="string"&&(this.warn("nonStringDescription"),delete h.description),h.readme&&!h.description&&(h.description=a(h.readme)),h.description===void 0&&delete h.description,h.description||this.warn("missingDescription")},fixReadmeField:function(h){h.readme||(this.warn("missingReadme"),h.readme="ERROR: No README data found!")},fixBugsField:function(h){if(!h.bugs&&h.repository&&h.repository.url){var b=s.fromUrl(h.repository.url);b&&b.bugs()&&(h.bugs={url:b.bugs()})}else if(h.bugs){if(typeof h.bugs=="string")l(h.bugs)?h.bugs={email:h.bugs}:o.parse(h.bugs).protocol?h.bugs={url:h.bugs}:this.warn("nonEmailUrlBugsString");else{w(h.bugs,this.warn);var x=h.bugs;h.bugs={},x.url&&(typeof x.url=="string"&&o.parse(x.url).protocol?h.bugs.url=x.url:this.warn("nonUrlBugsUrlField")),x.email&&(typeof x.email=="string"&&l(x.email)?h.bugs.email=x.email:this.warn("nonEmailBugsEmailField"))}!h.bugs.email&&!h.bugs.url&&(delete h.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(h){if(!h.homepage&&h.repository&&h.repository.url){var b=s.fromUrl(h.repository.url);b&&b.docs()&&(h.homepage=b.docs())}if(h.homepage){if(typeof h.homepage!="string")return this.warn("nonUrlHomepage"),delete h.homepage;o.parse(h.homepage).protocol||(h.homepage="http://"+h.homepage)}},fixLicenseField:function(h){let b=h.license||h.licence;if(!b)return this.warn("missingLicense");if(typeof b!="string"||b.length<1||b.trim()==="")return this.warn("invalidLicense");if(!r(b).validForNewPackages)return this.warn("invalidLicense")}};function u(h){if(h.charAt(0)!=="@")return!1;var b=h.slice(1).split("/");return b.length!==2?!1:b[0]&&b[1]&&b[0]===encodeURIComponent(b[0])&&b[1]===encodeURIComponent(b[1])}function p(h){return!h.match(/[/@\s+%:]/)&&h===encodeURIComponent(h)}function g(h,b,x){if(h.charAt(0)==="."||!(u(h)||p(h))||b&&!x&&h!==h.toLowerCase()||h.toLowerCase()==="node_modules"||h.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(h))}function f(h,b){return h.author&&(h.author=b(h.author)),["maintainers","contributors"].forEach(function(x){Array.isArray(h[x])&&(h[x]=h[x].map(b))}),h}function d(h){if(typeof h=="string")return h;var b=h.name||"",x=h.url||h.web,E=x?" ("+x+")":"",L=h.email||h.mail,A=L?" <"+L+">":"";return b+A+E}function m(h){if(typeof h!="string")return h;var b=h.match(/^([^(<]+)/),x=h.match(/\(([^()]+)\)/),E=h.match(/<([^<>]+)>/),L={};return b&&b[0].trim()&&(L.name=b[0].trim()),E&&(L.email=E[1]),x&&(L.url=x[1]),L}function y(h){var b=h.optionalDependencies;if(b){var x=h.dependencies||{};Object.keys(b).forEach(function(E){x[E]=b[E]}),h.dependencies=x}}function v(h,b,x){if(!h)return{};if(typeof h=="string"&&(h=h.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(h))return h;x("deprecatedArrayDependencies",b);var E={};return h.filter(function(L){return typeof L=="string"}).forEach(function(L){L=L.trim().split(/(:?[@\s><=])/);var A=L.shift(),O=L.join("");O=O.trim(),O=O.replace(/^@/,""),E[A]=O}),E}function _(h,b){n.forEach(function(x){h[x]&&(h[x]=v(h[x],x,b))})}function w(h,b){h&&Object.keys(h).forEach(function(x){c.bugs[x]&&(b("typo",x,c.bugs[x],"bugs"),h[c.bugs[x]]=h[x],delete h[x])})}return kc}var Xw="'repositories' (plural) Not supported. Please pick one as the 'repository' field",Qw="No repository field.",ex="Probably broken git url: %s",tx="scripts must be an object",rx="script values must be string commands",sx="Invalid 'files' member",ix="Invalid filename in 'files' list: %s",nx="Invalid 'bundleDependencies' list. Must be array of package names",ox="Invalid bundleDependencies member: %s",ax="Non-dependency in bundleDependencies: %s",cx="%s field must be an object",lx="Invalid dependency: %s %s",ux="specifying %s as array is deprecated",fx="modules field is deprecated",hx="keywords should be an array of strings",dx="keywords should be an array of strings",px="%s is also the name of a node core module.",mx="'description' field should be a string",gx="No description",yx="No README data",vx="No license field.",bx="Bug string field must be url, email, or {email,url}",_x="bugs.url field must be a string url. Deleted.",wx="bugs.email field must be a string email. Deleted.",xx="Normalized value of bugs field is an empty object. Deleted.",Ex="homepage field must be a string url. Deleted.",Sx="license should be a valid SPDX license expression",Rx="%s should probably be %s.",Ax={repositories:Xw,missingRepository:Qw,brokenGitUrl:ex,nonObjectScripts:tx,nonStringScript:rx,nonArrayFiles:sx,invalidFilename:ix,nonArrayBundleDependencies:nx,nonStringBundleDependency:ox,nonDependencyBundleDependency:ax,nonObjectDependencies:cx,nonStringDependency:lx,deprecatedArrayDependencies:ux,deprecatedModules:fx,nonArrayKeywords:hx,nonStringKeyword:dx,conflictingName:px,nonStringDescription:mx,missingDescription:gx,missingReadme:yx,missingLicense:vx,nonEmailUrlBugsString:bx,nonUrlBugsUrlField:_x,nonEmailBugsEmailField:wx,emptyNormalizedBugs:xx,nonUrlHomepage:Ex,invalidLicense:Sx,typo:Rx},Nc,xh;function Cx(){if(xh)return Nc;xh=1;var t=Uh,e=Ax;Nc=function(){var s=Array.prototype.slice.call(arguments,0),i=s.shift();if(i==="typo")return r.apply(null,s);var n=e[i]?e[i]:i+": '%s'";return s.unshift(n),t.format.apply(null,s)};function r(s,i,n){return n&&(s=n+"['"+s+"']",i=n+"['"+i+"']"),t.format(e.typo,s,i)}return Nc}var Dc,Eh;function Ox(){if(Eh)return Dc;Eh=1,Dc=n;var t=Jw();n.fixer=t;var e=Cx(),r=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],s=["dependencies","people","typos"],i=r.map(function(o){return a(o)+"Field"});i=i.concat(s);function n(o,c,l){c===!0&&(c=null,l=!0),l||(l=!1),(!c||o.private)&&(c=function(){}),o.scripts&&o.scripts.install==="node-gyp rebuild"&&!o.scripts.preinstall&&(o.gypfile=!0),t.warn=function(){c(e.apply(null,arguments))},i.forEach(function(u){t["fix"+a(u)](o,l)}),o._id=o.name+"@"+o.version}function a(o){return o.charAt(0).toUpperCase()+o.slice(1)}return Dc}var Tx=Ox(),Lx=uo(Tx);function $x(t){return t instanceof URL?zh(t):t}var Px=t=>yr.resolve($x(t)??".","package.json"),Ix=(t,e)=>{let r=typeof t=="string"?Pw(t):t;return e&&Lx(r),r};function kx({cwd:t,normalize:e=!0}={}){let r=qh.readFileSync(Px(t),"utf8");return Ix(r,e)}function ad(t){let e=bw("package.json",t);if(e)return{packageJson:kx({...t,cwd:yr.dirname(e)}),path:e}}var Wi={},Sh;function Nx(){if(Sh)return Wi;Sh=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.LRUCache=void 0;let t=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,e=new Set,r=typeof process=="object"&&process?process:{},s=(g,f,d,m)=>{typeof r.emitWarning=="function"?r.emitWarning(g,f,d,m):console.error(`[${d}] ${f}: ${g}`)},i=globalThis.AbortController,n=globalThis.AbortSignal;if(typeof i>"u"){n=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(m,y){this._onabort.push(y)}},i=class{constructor(){f()}signal=new n;abort(m){if(!this.signal.aborted){this.signal.reason=m,this.signal.aborted=!0;for(let y of this.signal._onabort)y(m);this.signal.onabort?.(m)}}};let g=r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",f=()=>{g&&(g=!1,s("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",f))}}let a=g=>!e.has(g),o=g=>g&&g===Math.floor(g)&&g>0&&isFinite(g),c=g=>o(g)?g<=Math.pow(2,8)?Uint8Array:g<=Math.pow(2,16)?Uint16Array:g<=Math.pow(2,32)?Uint32Array:g<=Number.MAX_SAFE_INTEGER?l:null:null;class l extends Array{constructor(f){super(f),this.fill(0)}}class u{heap;length;static#t=!1;static create(f){let d=c(f);if(!d)return[];u.#t=!0;let m=new u(f,d);return u.#t=!1,m}constructor(f,d){if(!u.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new d(f),this.length=0}push(f){this.heap[this.length++]=f}pop(){return this.heap[--this.length]}}class p{#t;#r;#e;#n;#f;#_;#a;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#c;#s;#l;#o;#p;#g;#y;#d;#A;#w;#x;#E;#S;#b;#P;#C;#h;static unsafeExposeInternals(f){return{starts:f.#E,ttls:f.#S,sizes:f.#x,keyMap:f.#s,keyList:f.#l,valList:f.#o,next:f.#p,prev:f.#g,get head(){return f.#y},get tail(){return f.#d},free:f.#A,isBackgroundFetch:d=>f.#v(d),backgroundFetch:(d,m,y,v)=>f.#D(d,m,y,v),moveToTail:d=>f.#z(d),indexes:d=>f.#$(d),rindexes:d=>f.#k(d),isStale:d=>f.#T(d)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#c}get size(){return this.#i}get fetchMethod(){return this.#_}get memoMethod(){return this.#a}get dispose(){return this.#e}get onInsert(){return this.#n}get disposeAfter(){return this.#f}constructor(f){let{max:d=0,ttl:m,ttlResolution:y=1,ttlAutopurge:v,updateAgeOnGet:_,updateAgeOnHas:w,allowStale:h,dispose:b,onInsert:x,disposeAfter:E,noDisposeOnSet:L,noUpdateTTL:A,maxSize:O=0,maxEntrySize:k=0,sizeCalculation:z,fetchMethod:P,memoMethod:H,noDeleteOnFetchRejection:re,noDeleteOnStaleGet:W,allowStaleOnFetchRejection:J,allowStaleOnFetchAbort:fe,ignoreFetchAbort:ne,perf:$e}=f;if($e!==void 0&&typeof $e?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=$e??t,d!==0&&!o(d))throw new TypeError("max option must be a nonnegative integer");let Pe=d?c(d):Array;if(!Pe)throw new Error("invalid max value: "+d);if(this.#t=d,this.#r=O,this.maxEntrySize=k||this.#r,this.sizeCalculation=z,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(H!==void 0&&typeof H!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#a=H,P!==void 0&&typeof P!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#_=P,this.#P=!!P,this.#s=new Map,this.#l=new Array(d).fill(void 0),this.#o=new Array(d).fill(void 0),this.#p=new Pe(d),this.#g=new Pe(d),this.#y=0,this.#d=0,this.#A=u.create(d),this.#i=0,this.#c=0,typeof b=="function"&&(this.#e=b),typeof x=="function"&&(this.#n=x),typeof E=="function"?(this.#f=E,this.#w=[]):(this.#f=void 0,this.#w=void 0),this.#b=!!this.#e,this.#h=!!this.#n,this.#C=!!this.#f,this.noDisposeOnSet=!!L,this.noUpdateTTL=!!A,this.noDeleteOnFetchRejection=!!re,this.allowStaleOnFetchRejection=!!J,this.allowStaleOnFetchAbort=!!fe,this.ignoreFetchAbort=!!ne,this.maxEntrySize!==0){if(this.#r!==0&&!o(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!o(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#B()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!W,this.updateAgeOnGet=!!_,this.updateAgeOnHas=!!w,this.ttlResolution=o(y)||y===0?y:1,this.ttlAutopurge=!!v,this.ttl=m||0,this.ttl){if(!o(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#F()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let Ue="LRU_CACHE_UNBOUNDED";a(Ue)&&(e.add(Ue),s("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Ue,p))}}getRemainingTTL(f){return this.#s.has(f)?1/0:0}#F(){let f=new l(this.#t),d=new l(this.#t);this.#S=f,this.#E=d,this.#N=(v,_,w=this.#u.now())=>{if(d[v]=_!==0?w:0,f[v]=_,_!==0&&this.ttlAutopurge){let h=setTimeout(()=>{this.#T(v)&&this.#U(this.#l[v],"expire")},_+1);h.unref&&h.unref()}},this.#R=v=>{d[v]=f[v]!==0?this.#u.now():0},this.#I=(v,_)=>{if(f[_]){let w=f[_],h=d[_];if(!w||!h)return;v.ttl=w,v.start=h,v.now=m||y();let b=v.now-h;v.remainingTTL=w-b}};let m=0,y=()=>{let v=this.#u.now();if(this.ttlResolution>0){m=v;let _=setTimeout(()=>m=0,this.ttlResolution);_.unref&&_.unref()}return v};this.getRemainingTTL=v=>{let _=this.#s.get(v);if(_===void 0)return 0;let w=f[_],h=d[_];if(!w||!h)return 1/0;let b=(m||y())-h;return w-b},this.#T=v=>{let _=d[v],w=f[v];return!!w&&!!_&&(m||y())-_>w}}#R=()=>{};#I=()=>{};#N=()=>{};#T=()=>!1;#B(){let f=new l(this.#t);this.#c=0,this.#x=f,this.#O=d=>{this.#c-=f[d],f[d]=0},this.#M=(d,m,y,v)=>{if(this.#v(m))return 0;if(!o(y))if(v){if(typeof v!="function")throw new TypeError("sizeCalculation must be a function");if(y=v(m,d),!o(y))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return y},this.#L=(d,m,y)=>{if(f[d]=m,this.#r){let v=this.#r-f[d];for(;this.#c>v;)this.#j(!0)}this.#c+=f[d],y&&(y.entrySize=m,y.totalCalculatedSize=this.#c)}}#O=f=>{};#L=(f,d,m)=>{};#M=(f,d,m,y)=>{if(m||y)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#$({allowStale:f=this.allowStale}={}){if(this.#i)for(let d=this.#d;!(!this.#m(d)||((f||!this.#T(d))&&(yield d),d===this.#y));)d=this.#g[d]}*#k({allowStale:f=this.allowStale}={}){if(this.#i)for(let d=this.#y;!(!this.#m(d)||((f||!this.#T(d))&&(yield d),d===this.#d));)d=this.#p[d]}#m(f){return f!==void 0&&this.#s.get(this.#l[f])===f}*entries(){for(let f of this.#$())this.#o[f]!==void 0&&this.#l[f]!==void 0&&!this.#v(this.#o[f])&&(yield[this.#l[f],this.#o[f]])}*rentries(){for(let f of this.#k())this.#o[f]!==void 0&&this.#l[f]!==void 0&&!this.#v(this.#o[f])&&(yield[this.#l[f],this.#o[f]])}*keys(){for(let f of this.#$()){let d=this.#l[f];d!==void 0&&!this.#v(this.#o[f])&&(yield d)}}*rkeys(){for(let f of this.#k()){let d=this.#l[f];d!==void 0&&!this.#v(this.#o[f])&&(yield d)}}*values(){for(let f of this.#$())this.#o[f]!==void 0&&!this.#v(this.#o[f])&&(yield this.#o[f])}*rvalues(){for(let f of this.#k())this.#o[f]!==void 0&&!this.#v(this.#o[f])&&(yield this.#o[f])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(f,d={}){for(let m of this.#$()){let y=this.#o[m],v=this.#v(y)?y.__staleWhileFetching:y;if(v!==void 0&&f(v,this.#l[m],this))return this.get(this.#l[m],d)}}forEach(f,d=this){for(let m of this.#$()){let y=this.#o[m],v=this.#v(y)?y.__staleWhileFetching:y;v!==void 0&&f.call(d,v,this.#l[m],this)}}rforEach(f,d=this){for(let m of this.#k()){let y=this.#o[m],v=this.#v(y)?y.__staleWhileFetching:y;v!==void 0&&f.call(d,v,this.#l[m],this)}}purgeStale(){let f=!1;for(let d of this.#k({allowStale:!0}))this.#T(d)&&(this.#U(this.#l[d],"expire"),f=!0);return f}info(f){let d=this.#s.get(f);if(d===void 0)return;let m=this.#o[d],y=this.#v(m)?m.__staleWhileFetching:m;if(y===void 0)return;let v={value:y};if(this.#S&&this.#E){let _=this.#S[d],w=this.#E[d];if(_&&w){let h=_-(this.#u.now()-w);v.ttl=h,v.start=Date.now()}}return this.#x&&(v.size=this.#x[d]),v}dump(){let f=[];for(let d of this.#$({allowStale:!0})){let m=this.#l[d],y=this.#o[d],v=this.#v(y)?y.__staleWhileFetching:y;if(v===void 0||m===void 0)continue;let _={value:v};if(this.#S&&this.#E){_.ttl=this.#S[d];let w=this.#u.now()-this.#E[d];_.start=Math.floor(Date.now()-w)}this.#x&&(_.size=this.#x[d]),f.unshift([m,_])}return f}load(f){this.clear();for(let[d,m]of f){if(m.start){let y=Date.now()-m.start;m.start=this.#u.now()-y}this.set(d,m.value,m)}}set(f,d,m={}){if(d===void 0)return this.delete(f),this;let{ttl:y=this.ttl,start:v,noDisposeOnSet:_=this.noDisposeOnSet,sizeCalculation:w=this.sizeCalculation,status:h}=m,{noUpdateTTL:b=this.noUpdateTTL}=m,x=this.#M(f,d,m.size||0,w);if(this.maxEntrySize&&x>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this.#U(f,"set"),this;let E=this.#i===0?void 0:this.#s.get(f);if(E===void 0)E=this.#i===0?this.#d:this.#A.length!==0?this.#A.pop():this.#i===this.#t?this.#j(!1):this.#i,this.#l[E]=f,this.#o[E]=d,this.#s.set(f,E),this.#p[this.#d]=E,this.#g[E]=this.#d,this.#d=E,this.#i++,this.#L(E,x,h),h&&(h.set="add"),b=!1,this.#h&&this.#n?.(d,f,"add");else{this.#z(E);let L=this.#o[E];if(d!==L){if(this.#P&&this.#v(L)){L.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:A}=L;A!==void 0&&!_&&(this.#b&&this.#e?.(A,f,"set"),this.#C&&this.#w?.push([A,f,"set"]))}else _||(this.#b&&this.#e?.(L,f,"set"),this.#C&&this.#w?.push([L,f,"set"]));if(this.#O(E),this.#L(E,x,h),this.#o[E]=d,h){h.set="replace";let A=L&&this.#v(L)?L.__staleWhileFetching:L;A!==void 0&&(h.oldValue=A)}}else h&&(h.set="update");this.#h&&this.onInsert?.(d,f,d===L?"update":"replace")}if(y!==0&&!this.#S&&this.#F(),this.#S&&(b||this.#N(E,y,v),h&&this.#I(h,E)),!_&&this.#C&&this.#w){let L=this.#w,A;for(;A=L?.shift();)this.#f?.(...A)}return this}pop(){try{for(;this.#i;){let f=this.#o[this.#y];if(this.#j(!0),this.#v(f)){if(f.__staleWhileFetching)return f.__staleWhileFetching}else if(f!==void 0)return f}}finally{if(this.#C&&this.#w){let f=this.#w,d;for(;d=f?.shift();)this.#f?.(...d)}}}#j(f){let d=this.#y,m=this.#l[d],y=this.#o[d];return this.#P&&this.#v(y)?y.__abortController.abort(new Error("evicted")):(this.#b||this.#C)&&(this.#b&&this.#e?.(y,m,"evict"),this.#C&&this.#w?.push([y,m,"evict"])),this.#O(d),f&&(this.#l[d]=void 0,this.#o[d]=void 0,this.#A.push(d)),this.#i===1?(this.#y=this.#d=0,this.#A.length=0):this.#y=this.#p[d],this.#s.delete(m),this.#i--,d}has(f,d={}){let{updateAgeOnHas:m=this.updateAgeOnHas,status:y}=d,v=this.#s.get(f);if(v!==void 0){let _=this.#o[v];if(this.#v(_)&&_.__staleWhileFetching===void 0)return!1;if(this.#T(v))y&&(y.has="stale",this.#I(y,v));else return m&&this.#R(v),y&&(y.has="hit",this.#I(y,v)),!0}else y&&(y.has="miss");return!1}peek(f,d={}){let{allowStale:m=this.allowStale}=d,y=this.#s.get(f);if(y===void 0||!m&&this.#T(y))return;let v=this.#o[y];return this.#v(v)?v.__staleWhileFetching:v}#D(f,d,m,y){let v=d===void 0?void 0:this.#o[d];if(this.#v(v))return v;let _=new i,{signal:w}=m;w?.addEventListener("abort",()=>_.abort(w.reason),{signal:_.signal});let h={signal:_.signal,options:m,context:y},b=(k,z=!1)=>{let{aborted:P}=_.signal,H=m.ignoreFetchAbort&&k!==void 0;if(m.status&&(P&&!z?(m.status.fetchAborted=!0,m.status.fetchError=_.signal.reason,H&&(m.status.fetchAbortIgnored=!0)):m.status.fetchResolved=!0),P&&!H&&!z)return E(_.signal.reason);let re=A;return this.#o[d]===A&&(k===void 0?re.__staleWhileFetching!==void 0?this.#o[d]=re.__staleWhileFetching:this.#U(f,"fetch"):(m.status&&(m.status.fetchUpdated=!0),this.set(f,k,h.options))),k},x=k=>(m.status&&(m.status.fetchRejected=!0,m.status.fetchError=k),E(k)),E=k=>{let{aborted:z}=_.signal,P=z&&m.allowStaleOnFetchAbort,H=P||m.allowStaleOnFetchRejection,re=H||m.noDeleteOnFetchRejection,W=A;if(this.#o[d]===A&&(!re||W.__staleWhileFetching===void 0?this.#U(f,"fetch"):P||(this.#o[d]=W.__staleWhileFetching)),H)return m.status&&W.__staleWhileFetching!==void 0&&(m.status.returnedStale=!0),W.__staleWhileFetching;if(W.__returned===W)throw k},L=(k,z)=>{let P=this.#_?.(f,v,h);P&&P instanceof Promise&&P.then(H=>k(H===void 0?void 0:H),z),_.signal.addEventListener("abort",()=>{(!m.ignoreFetchAbort||m.allowStaleOnFetchAbort)&&(k(void 0),m.allowStaleOnFetchAbort&&(k=H=>b(H,!0)))})};m.status&&(m.status.fetchDispatched=!0);let A=new Promise(L).then(b,x),O=Object.assign(A,{__abortController:_,__staleWhileFetching:v,__returned:void 0});return d===void 0?(this.set(f,O,{...h.options,status:void 0}),d=this.#s.get(f)):this.#o[d]=O,O}#v(f){if(!this.#P)return!1;let d=f;return!!d&&d instanceof Promise&&d.hasOwnProperty("__staleWhileFetching")&&d.__abortController instanceof i}async fetch(f,d={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:v=this.noDeleteOnStaleGet,ttl:_=this.ttl,noDisposeOnSet:w=this.noDisposeOnSet,size:h=0,sizeCalculation:b=this.sizeCalculation,noUpdateTTL:x=this.noUpdateTTL,noDeleteOnFetchRejection:E=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:L=this.allowStaleOnFetchRejection,ignoreFetchAbort:A=this.ignoreFetchAbort,allowStaleOnFetchAbort:O=this.allowStaleOnFetchAbort,context:k,forceRefresh:z=!1,status:P,signal:H}=d;if(!this.#P)return P&&(P.fetch="get"),this.get(f,{allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:v,status:P});let re={allowStale:m,updateAgeOnGet:y,noDeleteOnStaleGet:v,ttl:_,noDisposeOnSet:w,size:h,sizeCalculation:b,noUpdateTTL:x,noDeleteOnFetchRejection:E,allowStaleOnFetchRejection:L,allowStaleOnFetchAbort:O,ignoreFetchAbort:A,status:P,signal:H},W=this.#s.get(f);if(W===void 0){P&&(P.fetch="miss");let J=this.#D(f,W,re,k);return J.__returned=J}else{let J=this.#o[W];if(this.#v(J)){let Ue=m&&J.__staleWhileFetching!==void 0;return P&&(P.fetch="inflight",Ue&&(P.returnedStale=!0)),Ue?J.__staleWhileFetching:J.__returned=J}let fe=this.#T(W);if(!z&&!fe)return P&&(P.fetch="hit"),this.#z(W),y&&this.#R(W),P&&this.#I(P,W),J;let ne=this.#D(f,W,re,k),Pe=ne.__staleWhileFetching!==void 0&&m;return P&&(P.fetch=fe?"stale":"refresh",Pe&&fe&&(P.returnedStale=!0)),Pe?ne.__staleWhileFetching:ne.__returned=ne}}async forceFetch(f,d={}){let m=await this.fetch(f,d);if(m===void 0)throw new Error("fetch() returned undefined");return m}memo(f,d={}){let m=this.#a;if(!m)throw new Error("no memoMethod provided to constructor");let{context:y,forceRefresh:v,..._}=d,w=this.get(f,_);if(!v&&w!==void 0)return w;let h=m(f,w,{options:_,context:y});return this.set(f,h,_),h}get(f,d={}){let{allowStale:m=this.allowStale,updateAgeOnGet:y=this.updateAgeOnGet,noDeleteOnStaleGet:v=this.noDeleteOnStaleGet,status:_}=d,w=this.#s.get(f);if(w!==void 0){let h=this.#o[w],b=this.#v(h);return _&&this.#I(_,w),this.#T(w)?(_&&(_.get="stale"),b?(_&&m&&h.__staleWhileFetching!==void 0&&(_.returnedStale=!0),m?h.__staleWhileFetching:void 0):(v||this.#U(f,"expire"),_&&m&&(_.returnedStale=!0),m?h:void 0)):(_&&(_.get="hit"),b?h.__staleWhileFetching:(this.#z(w),y&&this.#R(w),h))}else _&&(_.get="miss")}#G(f,d){this.#g[d]=f,this.#p[f]=d}#z(f){f!==this.#d&&(f===this.#y?this.#y=this.#p[f]:this.#G(this.#g[f],this.#p[f]),this.#G(this.#d,f),this.#d=f)}delete(f){return this.#U(f,"delete")}#U(f,d){let m=!1;if(this.#i!==0){let y=this.#s.get(f);if(y!==void 0)if(m=!0,this.#i===1)this.#q(d);else{this.#O(y);let v=this.#o[y];if(this.#v(v)?v.__abortController.abort(new Error("deleted")):(this.#b||this.#C)&&(this.#b&&this.#e?.(v,f,d),this.#C&&this.#w?.push([v,f,d])),this.#s.delete(f),this.#l[y]=void 0,this.#o[y]=void 0,y===this.#d)this.#d=this.#g[y];else if(y===this.#y)this.#y=this.#p[y];else{let _=this.#g[y];this.#p[_]=this.#p[y];let w=this.#p[y];this.#g[w]=this.#g[y]}this.#i--,this.#A.push(y)}}if(this.#C&&this.#w?.length){let y=this.#w,v;for(;v=y?.shift();)this.#f?.(...v)}return m}clear(){return this.#q("delete")}#q(f){for(let d of this.#k({allowStale:!0})){let m=this.#o[d];if(this.#v(m))m.__abortController.abort(new Error("deleted"));else{let y=this.#l[d];this.#b&&this.#e?.(m,y,f),this.#C&&this.#w?.push([m,y,f])}}if(this.#s.clear(),this.#o.fill(void 0),this.#l.fill(void 0),this.#S&&this.#E&&(this.#S.fill(0),this.#E.fill(0)),this.#x&&this.#x.fill(0),this.#y=0,this.#d=0,this.#A.length=0,this.#c=0,this.#i=0,this.#C&&this.#w){let d=this.#w,m;for(;m=d?.shift();)this.#f?.(...m)}}}return Wi.LRUCache=p,Wi}var Fc,Rh;function Dx(){if(Rh)return Fc;Rh=1;let t=(...n)=>n.every(a=>a)?n.join(""):"",e=n=>n?encodeURIComponent(n):"",r=n=>n.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),s={sshtemplate:({domain:n,user:a,project:o,committish:c})=>`git@${n}:${a}/${o}.git${t("#",c)}`,sshurltemplate:({domain:n,user:a,project:o,committish:c})=>`git+ssh://git@${n}/${a}/${o}.git${t("#",c)}`,edittemplate:({domain:n,user:a,project:o,committish:c,editpath:l,path:u})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u)}`,browsetemplate:({domain:n,user:a,project:o,committish:c,treepath:l})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c))}`,browsetreetemplate:({domain:n,user:a,project:o,committish:c,treepath:l,path:u,fragment:p,hashformat:g})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",g(p||""))}`,browseblobtemplate:({domain:n,user:a,project:o,committish:c,blobpath:l,path:u,fragment:p,hashformat:g})=>`https://${n}/${a}/${o}/${l}/${e(c||"HEAD")}/${u}${t("#",g(p||""))}`,docstemplate:({domain:n,user:a,project:o,treepath:c,committish:l})=>`https://${n}/${a}/${o}${t("/",c,"/",e(l))}#readme`,httpstemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git+https://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,filetemplate:({domain:n,user:a,project:o,committish:c,path:l})=>`https://${n}/${a}/${o}/raw/${e(c||"HEAD")}/${l}`,shortcuttemplate:({type:n,user:a,project:o,committish:c})=>`${n}:${a}/${o}${t("#",c)}`,pathtemplate:({user:n,project:a,committish:o})=>`${n}/${a}${t("#",o)}`,bugstemplate:({domain:n,user:a,project:o})=>`https://${n}/${a}/${o}/issues`,hashformat:r},i={};i.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:n,user:a,project:o,committish:c,path:l})=>`https://${t(n,"@")}raw.githubusercontent.com/${a}/${o}/${e(c||"HEAD")}/${l}`,gittemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://codeload.${n}/${a}/${o}/tar.gz/${e(c||"HEAD")}`,extract:n=>{let[,a,o,c,l]=n.pathname.split("/",5);if(!(c&&c!=="tree")&&(c||(l=n.hash.slice(1)),o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:l}}},i.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:n,user:a,project:o,committish:c,treepath:l,path:u,editpath:p})=>`https://${n}/${a}/${o}${t("/",l,"/",e(c||"HEAD"),"/",u,p)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/get/${e(c||"HEAD")}.tar.gz`,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(!["get"].includes(c)&&(o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:n.hash.slice(1)}}},i.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",httpstemplate:({auth:n,domain:a,user:o,project:c,committish:l})=>`git+https://${t(n,"@")}${a}/${o}/${c}.git${t("#",l)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/repository/archive.tar.gz?ref=${e(c||"HEAD")}`,extract:n=>{let a=n.pathname.slice(1);if(a.includes("/-/")||a.includes("/archive.tar.gz"))return;let o=a.split("/"),c=o.pop();c.endsWith(".git")&&(c=c.slice(0,-4));let l=o.join("/");if(!(!l||!c))return{user:l,project:c,committish:n.hash.slice(1)}}},i.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:n,project:a,committish:o})=>`git@${n}:${a}.git${t("#",o)}`,sshurltemplate:({domain:n,project:a,committish:o})=>`git+ssh://git@${n}/${a}.git${t("#",o)}`,edittemplate:({domain:n,user:a,project:o,committish:c,editpath:l})=>`https://${n}/${a}/${o}${t("/",e(c))}/${l}`,browsetemplate:({domain:n,project:a,committish:o})=>`https://${n}/${a}${t("/",e(o))}`,browsetreetemplate:({domain:n,project:a,committish:o,path:c,hashformat:l})=>`https://${n}/${a}${t("/",e(o))}${t("#",l(c))}`,browseblobtemplate:({domain:n,project:a,committish:o,path:c,hashformat:l})=>`https://${n}/${a}${t("/",e(o))}${t("#",l(c))}`,docstemplate:({domain:n,project:a,committish:o})=>`https://${n}/${a}${t("/",e(o))}`,httpstemplate:({domain:n,project:a,committish:o})=>`git+https://${n}/${a}.git${t("#",o)}`,filetemplate:({user:n,project:a,committish:o,path:c})=>`https://gist.githubusercontent.com/${n}/${a}/raw${t("/",e(o))}/${c}`,shortcuttemplate:({type:n,project:a,committish:o})=>`${n}:${a}${t("#",o)}`,pathtemplate:({project:n,committish:a})=>`${n}${t("#",a)}`,bugstemplate:({domain:n,project:a})=>`https://${n}/${a}`,gittemplate:({domain:n,project:a,committish:o})=>`git://${n}/${a}.git${t("#",o)}`,tarballtemplate:({project:n,committish:a})=>`https://codeload.github.com/gist/${n}/tar.gz/${e(a||"HEAD")}`,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(c!=="raw"){if(!o){if(!a)return;o=a,a=null}return o.endsWith(".git")&&(o=o.slice(0,-4)),{user:a,project:o,committish:n.hash.slice(1)}}},hashformat:function(n){return n&&"file-"+r(n)}},i.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:n,user:a,project:o,committish:c,path:l})=>`https://${n}/${a}/${o}/blob/${e(c)||"HEAD"}/${l}`,httpstemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}.git${t("#",c)}`,tarballtemplate:({domain:n,user:a,project:o,committish:c})=>`https://${n}/${a}/${o}/archive/${e(c)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:n=>{let[,a,o,c]=n.pathname.split("/",4);if(!["archive"].includes(c)&&(o&&o.endsWith(".git")&&(o=o.slice(0,-4)),!(!a||!o)))return{user:a,project:o,committish:n.hash.slice(1)}}};for(let[n,a]of Object.entries(i))i[n]=Object.assign({},s,a);return Fc=i,Fc}var Mc,Ah;function cd(){if(Ah)return Mc;Ah=1;let t=Qc,e=(n,a,o)=>{let c=n.indexOf(o);return n.lastIndexOf(a,c>-1?c:1/0)},r=n=>{try{return new t.URL(n)}catch{}},s=(n,a)=>{let o=n.indexOf(":"),c=n.slice(0,o+1);if(Object.prototype.hasOwnProperty.call(a,c))return n;let l=n.indexOf("@");return l>-1?l>o?`git+ssh://${n}`:n:n.indexOf("//")===o+1?n:`${n.slice(0,o+1)}//${n.slice(o+1)}`},i=n=>{let a=e(n,"@","#"),o=e(n,":","#");return o>a&&(n=n.slice(0,o)+"/"+n.slice(o+1)),e(n,":","#")===-1&&n.indexOf("//")===-1&&(n=`git+ssh://${n}`),n};return Mc=(n,a)=>{let o=a?s(n,a):n;return r(o)||r(i(o))},Mc}var jc,Ch;function Fx(){if(Ch)return jc;Ch=1;let t=cd(),e=r=>{let s=r.indexOf("#"),i=r.indexOf("/"),n=r.indexOf("/",i+1),a=r.indexOf(":"),o=/\s/.exec(r),c=r.indexOf("@"),l=!o||s>-1&&o.index>s,u=c===-1||s>-1&&c>s,p=a===-1||s>-1&&a>s,g=n===-1||s>-1&&n>s,f=i>0,d=s>-1?r[s-1]!=="/":!r.endsWith("/"),m=!r.startsWith(".");return l&&f&&d&&m&&u&&p&&g};return jc=(r,s,{gitHosts:i,protocols:n})=>{if(!r)return;let a=e(r)?`github:${r}`:r,o=t(a,n);if(!o)return;let c=i.byShortcut[o.protocol],l=i.byDomain[o.hostname.startsWith("www.")?o.hostname.slice(4):o.hostname],u=c||l;if(!u)return;let p=i[c||l],g=null;n[o.protocol]?.auth&&(o.username||o.password)&&(g=`${o.username}${o.password?":"+o.password:""}`);let f=null,d=null,m=null,y=null;try{if(c){let v=o.pathname.startsWith("/")?o.pathname.slice(1):o.pathname,_=v.indexOf("@");_>-1&&(v=v.slice(_+1));let w=v.lastIndexOf("/");w>-1?(d=decodeURIComponent(v.slice(0,w)),d||(d=null),m=decodeURIComponent(v.slice(w+1))):m=decodeURIComponent(v),m.endsWith(".git")&&(m=m.slice(0,-4)),o.hash&&(f=decodeURIComponent(o.hash.slice(1))),y="shortcut"}else{if(!p.protocols.includes(o.protocol))return;let v=p.extract(o);if(!v)return;d=v.user&&decodeURIComponent(v.user),m=decodeURIComponent(v.project),f=decodeURIComponent(v.committish),y=n[o.protocol]?.name||o.protocol.slice(0,-1)}}catch(v){if(v instanceof URIError)return;throw v}return[u,d,g,m,f,y,s]},jc}var Bc,Oh;function Mx(){if(Oh)return Bc;Oh=1;let{LRUCache:t}=Nx(),e=Dx(),r=Fx(),s=cd(),i=new t({max:1e3});function n(o){try{let{protocol:c,hostname:l,pathname:u}=new URL(o);if(!l)return null;let p=/(?:git\+)http:$/.test(c)?"http:":"https:",g=u.replace(/\.git$/,"");return`${p}//${l}${g}`}catch{return null}}class a{constructor(c,l,u,p,g,f,d={}){Object.assign(this,a.#t[c],{type:c,user:l,auth:u,project:p,committish:g,default:f,opts:d})}static#t={byShortcut:{},byDomain:{}};static#r={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(c,l){a.#t[c]=l,a.#t.byDomain[l.domain]=c,a.#t.byShortcut[`${c}:`]=c,a.#r[`${c}:`]={name:c}}static fromUrl(c,l){if(typeof c!="string")return;let u=c+JSON.stringify(l||{});if(!i.has(u)){let p=r(c,l,{gitHosts:a.#t,protocols:a.#r});i.set(u,p?new a(...p):void 0)}return i.get(u)}static fromManifest(c,l={}){if(!c||typeof c!="object")return;let u=c.repository,p=u&&(typeof u=="string"?u:typeof u=="object"&&typeof u.url=="string"?u.url:null);if(!p)throw new Error("no repository");let g=p&&a.fromUrl(p.replace(/^git\+/,""),l)||null;if(g)return g;let f=n(p);return a.fromUrl(f,l)||f}static parseUrl(c){return s(c)}#e(c,l){if(typeof c!="function")return null;let u={...this,...this.opts,...l};u.path||(u.path=""),u.path.startsWith("/")&&(u.path=u.path.slice(1)),u.noCommittish&&(u.committish=null);let p=c(u);return u.noGitPlus&&p.startsWith("git+")?p.slice(4):p}hash(){return this.committish?`#${this.committish}`:""}ssh(c){return this.#e(this.sshtemplate,c)}sshurl(c){return this.#e(this.sshurltemplate,c)}browse(c,...l){return typeof c!="string"?this.#e(this.browsetemplate,c):typeof l[0]!="string"?this.#e(this.browsetreetemplate,{...l[0],path:c}):this.#e(this.browsetreetemplate,{...l[1],fragment:l[0],path:c})}browseFile(c,...l){return typeof l[0]!="string"?this.#e(this.browseblobtemplate,{...l[0],path:c}):this.#e(this.browseblobtemplate,{...l[1],fragment:l[0],path:c})}docs(c){return this.#e(this.docstemplate,c)}bugs(c){return this.#e(this.bugstemplate,c)}https(c){return this.#e(this.httpstemplate,c)}git(c){return this.#e(this.gittemplate,c)}shortcut(c){return this.#e(this.shortcuttemplate,c)}path(c){return this.#e(this.pathtemplate,c)}tarball(c){return this.#e(this.tarballtemplate,{...c,noCommittish:!1})}file(c,l){return this.#e(this.filetemplate,{...l,path:c})}edit(c,l){return this.#e(this.edittemplate,{...l,path:c})}getDefaultRepresentation(){return this.default}toString(c){return this.default&&typeof this[this.default]=="function"?this[this.default](c):this.sshurl(c)}}for(let[o,c]of Object.entries(e))a.addHost(o,c);return Bc=a,Bc}var Uc,Th;function jx(){if(Th)return Uc;Th=1,Uc=t;function t(e){if(!e||e==="ERROR: No README data found!")return;e=e.trim().split(`
|
|
31
|
+
`);let r=0;for(;e[r]&&e[r].trim().match(/^(#|$)/);)r++;let s=e.length,i=r+1;for(;i<s&&e[i].trim();)i++;return e.slice(r,i).join(" ").trim()}return Uc}var Bx={dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},Ux={web:"url",name:"url"},Gx={server:"start",tests:"test"},zx={topLevel:Bx,bugs:Ux,script:Gx},Gc,Lh;function qx(){if(Lh)return Gc;Lh=1;var{URL:t}=tw,e=td(),r=rd(),s=nd(),i=Mx(),{isBuiltin:n}=Gh,a=["dependencies","devDependencies","optionalDependencies"],o=jx(),c=zx,l=h=>h.includes("@")&&h.indexOf("@")<h.lastIndexOf(".");Gc={warn:function(){},fixRepositoryField:function(h){if(h.repositories&&(this.warn("repositories"),h.repository=h.repositories[0]),!h.repository)return this.warn("missingRepository");typeof h.repository=="string"&&(h.repository={type:"git",url:h.repository});var b=h.repository.url||"";if(b){var x=i.fromUrl(b);x&&(b=h.repository.url=x.getDefaultRepresentation()==="shortcut"?x.https():x.toString())}b.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",b)},fixTypos:function(h){Object.keys(c.topLevel).forEach(function(b){Object.prototype.hasOwnProperty.call(h,b)&&this.warn("typo",b,c.topLevel[b])},this)},fixScriptsField:function(h){if(h.scripts){if(typeof h.scripts!="object"){this.warn("nonObjectScripts"),delete h.scripts;return}Object.keys(h.scripts).forEach(function(b){typeof h.scripts[b]!="string"?(this.warn("nonStringScript"),delete h.scripts[b]):c.script[b]&&!h.scripts[c.script[b]]&&this.warn("typo",b,c.script[b],"scripts")},this)}},fixFilesField:function(h){var b=h.files;b&&!Array.isArray(b)?(this.warn("nonArrayFiles"),delete h.files):h.files&&(h.files=h.files.filter(function(x){return!x||typeof x!="string"?(this.warn("invalidFilename",x),!1):!0},this))},fixBinField:function(h){if(h.bin&&typeof h.bin=="string"){var b={},x;(x=h.name.match(/^@[^/]+[/](.*)$/))?b[x[1]]=h.bin:b[h.name]=h.bin,h.bin=b}},fixManField:function(h){h.man&&typeof h.man=="string"&&(h.man=[h.man])},fixBundleDependenciesField:function(h){var b="bundledDependencies",x="bundleDependencies";h[b]&&!h[x]&&(h[x]=h[b],delete h[b]),h[x]&&!Array.isArray(h[x])?(this.warn("nonArrayBundleDependencies"),delete h[x]):h[x]&&(h[x]=h[x].filter(function(E){return!E||typeof E!="string"?(this.warn("nonStringBundleDependency",E),!1):(h.dependencies||(h.dependencies={}),Object.prototype.hasOwnProperty.call(h.dependencies,E)||(this.warn("nonDependencyBundleDependency",E),h.dependencies[E]="*"),!0)},this))},fixDependencies:function(h){_(h,this.warn),y(h,this.warn),this.fixBundleDependenciesField(h),["dependencies","devDependencies"].forEach(function(b){if(b in h){if(!h[b]||typeof h[b]!="object"){this.warn("nonObjectDependencies",b),delete h[b];return}Object.keys(h[b]).forEach(function(x){var E=h[b][x];typeof E!="string"&&(this.warn("nonStringDependency",x,JSON.stringify(E)),delete h[b][x]);var L=i.fromUrl(h[b][x]);L&&(h[b][x]=L.toString())},this)}},this)},fixModulesField:function(h){h.modules&&(this.warn("deprecatedModules"),delete h.modules)},fixKeywordsField:function(h){typeof h.keywords=="string"&&(h.keywords=h.keywords.split(/,\s+/)),h.keywords&&!Array.isArray(h.keywords)?(delete h.keywords,this.warn("nonArrayKeywords")):h.keywords&&(h.keywords=h.keywords.filter(function(b){return typeof b!="string"||!b?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(h,b){var x=!b;if(!h.version)return h.version="",!0;if(!e(h.version,x))throw new Error('Invalid version: "'+h.version+'"');return h.version=r(h.version,x),!0},fixPeople:function(h){f(h,d),f(h,m)},fixNameField:function(h,b){typeof b=="boolean"?b={strict:b}:typeof b>"u"&&(b={});var x=b.strict;if(!h.name&&!x){h.name="";return}if(typeof h.name!="string")throw new Error("name field must be a string.");x||(h.name=h.name.trim()),g(h.name,x,b.allowLegacyCase),n(h.name)&&this.warn("conflictingName",h.name)},fixDescriptionField:function(h){h.description&&typeof h.description!="string"&&(this.warn("nonStringDescription"),delete h.description),h.readme&&!h.description&&(h.description=o(h.readme)),h.description===void 0&&delete h.description,h.description||this.warn("missingDescription")},fixReadmeField:function(h){h.readme||(this.warn("missingReadme"),h.readme="ERROR: No README data found!")},fixBugsField:function(h){if(!h.bugs&&h.repository&&h.repository.url){var b=i.fromUrl(h.repository.url);b&&b.bugs()&&(h.bugs={url:b.bugs()})}else if(h.bugs){if(typeof h.bugs=="string")l(h.bugs)?h.bugs={email:h.bugs}:t.canParse(h.bugs)?h.bugs={url:h.bugs}:this.warn("nonEmailUrlBugsString");else{w(h.bugs,this.warn);var x=h.bugs;h.bugs={},x.url&&(t.canParse(x.url)?h.bugs.url=x.url:this.warn("nonUrlBugsUrlField")),x.email&&(typeof x.email=="string"&&l(x.email)?h.bugs.email=x.email:this.warn("nonEmailBugsEmailField"))}!h.bugs.email&&!h.bugs.url&&(delete h.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(h){if(!h.homepage&&h.repository&&h.repository.url){var b=i.fromUrl(h.repository.url);b&&b.docs()&&(h.homepage=b.docs())}if(h.homepage){if(typeof h.homepage!="string")return this.warn("nonUrlHomepage"),delete h.homepage;t.canParse(h.homepage)||(h.homepage="http://"+h.homepage)}},fixLicenseField:function(h){let b=h.license||h.licence;if(!b)return this.warn("missingLicense");if(typeof b!="string"||b.length<1||b.trim()==="")return this.warn("invalidLicense");if(!s(b).validForNewPackages)return this.warn("invalidLicense")}};function u(h){if(h.charAt(0)!=="@")return!1;var b=h.slice(1).split("/");return b.length!==2?!1:b[0]&&b[1]&&b[0]===encodeURIComponent(b[0])&&b[1]===encodeURIComponent(b[1])}function p(h){return!h.match(/[/@\s+%:]/)&&h===encodeURIComponent(h)}function g(h,b,x){if(h.charAt(0)==="."||!(u(h)||p(h))||b&&!x&&h!==h.toLowerCase()||h.toLowerCase()==="node_modules"||h.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(h))}function f(h,b){return h.author&&(h.author=b(h.author)),["maintainers","contributors"].forEach(function(x){Array.isArray(h[x])&&(h[x]=h[x].map(b))}),h}function d(h){if(typeof h=="string")return h;var b=h.name||"",x=h.url||h.web,E=x?" ("+x+")":"",L=h.email||h.mail,A=L?" <"+L+">":"";return b+A+E}function m(h){if(typeof h!="string")return h;var b=h.match(/^([^(<]+)/),x=h.match(/\(([^()]+)\)/),E=h.match(/<([^<>]+)>/),L={};return b&&b[0].trim()&&(L.name=b[0].trim()),E&&(L.email=E[1]),x&&(L.url=x[1]),L}function y(h){var b=h.optionalDependencies;if(b){var x=h.dependencies||{};Object.keys(b).forEach(function(E){x[E]=b[E]}),h.dependencies=x}}function v(h,b,x){if(!h)return{};if(typeof h=="string"&&(h=h.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(h))return h;x("deprecatedArrayDependencies",b);var E={};return h.filter(function(L){return typeof L=="string"}).forEach(function(L){L=L.trim().split(/(:?[@\s><=])/);var A=L.shift(),O=L.join("");O=O.trim(),O=O.replace(/^@/,""),E[A]=O}),E}function _(h,b){a.forEach(function(x){h[x]&&(h[x]=v(h[x],x,b))})}function w(h,b){h&&Object.keys(h).forEach(function(x){c.bugs[x]&&(b("typo",x,c.bugs[x],"bugs"),h[c.bugs[x]]=h[x],delete h[x])})}return Gc}var Wx="'repositories' (plural) Not supported. Please pick one as the 'repository' field",Vx="No repository field.",Zx="Probably broken git url: %s",Hx="scripts must be an object",Kx="script values must be string commands",Yx="Invalid 'files' member",Jx="Invalid filename in 'files' list: %s",Xx="Invalid 'bundleDependencies' list. Must be array of package names",Qx="Invalid bundleDependencies member: %s",e1="Non-dependency in bundleDependencies: %s",t1="%s field must be an object",r1="Invalid dependency: %s %s",s1="specifying %s as array is deprecated",i1="modules field is deprecated",n1="keywords should be an array of strings",o1="keywords should be an array of strings",a1="%s is also the name of a node core module.",c1="'description' field should be a string",l1="No description",u1="No README data",f1="No license field.",h1="Bug string field must be url, email, or {email,url}",d1="bugs.url field must be a string url. Deleted.",p1="bugs.email field must be a string email. Deleted.",m1="Normalized value of bugs field is an empty object. Deleted.",g1="homepage field must be a string url. Deleted.",y1="license should be a valid SPDX license expression",v1="%s should probably be %s.",b1={repositories:Wx,missingRepository:Vx,brokenGitUrl:Zx,nonObjectScripts:Hx,nonStringScript:Kx,nonArrayFiles:Yx,invalidFilename:Jx,nonArrayBundleDependencies:Xx,nonStringBundleDependency:Qx,nonDependencyBundleDependency:e1,nonObjectDependencies:t1,nonStringDependency:r1,deprecatedArrayDependencies:s1,deprecatedModules:i1,nonArrayKeywords:n1,nonStringKeyword:o1,conflictingName:a1,nonStringDescription:c1,missingDescription:l1,missingReadme:u1,missingLicense:f1,nonEmailUrlBugsString:h1,nonUrlBugsUrlField:d1,nonEmailBugsEmailField:p1,emptyNormalizedBugs:m1,nonUrlHomepage:g1,invalidLicense:y1,typo:v1},zc,$h;function _1(){if($h)return zc;$h=1;var t=Uh,e=b1;zc=function(){var s=Array.prototype.slice.call(arguments,0),i=s.shift();if(i==="typo")return r.apply(null,s);var n=e[i]?e[i]:i+": '%s'";return s.unshift(n),t.format.apply(null,s)};function r(s,i,n){return n&&(s=n+"['"+s+"']",i=n+"['"+i+"']"),t.format(e.typo,s,i)}return zc}var qc,Ph;function w1(){if(Ph)return qc;Ph=1,qc=n;var t=qx();n.fixer=t;var e=_1(),r=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],s=["dependencies","people","typos"],i=r.map(function(o){return a(o)+"Field"});i=i.concat(s);function n(o,c,l){c===!0&&(c=null,l=!0),l||(l=!1),(!c||o.private)&&(c=function(){}),o.scripts&&o.scripts.install==="node-gyp rebuild"&&!o.scripts.preinstall&&(o.gypfile=!0),t.warn=function(){c(e.apply(null,arguments))},i.forEach(function(u){t["fix"+a(u)](o,l)}),o._id=o.name+"@"+o.version}function a(o){return o.charAt(0).toUpperCase()+o.slice(1)}return qc}var x1=w1(),ld=uo(x1),E1=(t,e)=>(t=t.replace(/((?<![\p{Uppercase_Letter}\d])[\p{Uppercase_Letter}\d](?![\p{Uppercase_Letter}\d]))/gu,r=>r.toLowerCase()),t.replace(new RegExp("(?<!\\p{Uppercase_Letter})(\\p{Uppercase_Letter}+)(\\p{Uppercase_Letter}\\p{Lowercase_Letter}+)","gu"),(r,s,i)=>s+e+i.toLowerCase()));function rl(t,{separator:e="_",preserveConsecutiveUppercase:r=!1}={}){if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("The `text` and `separator` arguments should be of type `string`");if(t.length<2)return r?t:t.toLowerCase();let s=`$1${e}$2`,i=t.replace(new RegExp("([\\p{Lowercase_Letter}\\d])(\\p{Uppercase_Letter})","gu"),s);return r?E1(i,e):i.replace(new RegExp("(\\p{Uppercase_Letter})(\\p{Uppercase_Letter}\\p{Lowercase_Letter}+)","gu"),s).toLowerCase()}var co={exports:{}},Wc,Ih;function S1(){if(Ih)return Wc;Ih=1;var t=Object.prototype.toString;return Wc=function(e){var r;return t.call(e)==="[object Object]"&&(r=Object.getPrototypeOf(e),r===null||r===Object.getPrototypeOf({}))},Wc}var Vc,kh;function R1(){return kh||(kh=1,Vc=function(t){return t==null?[]:Array.isArray(t)?t:[t]}),Vc}var Zc,Nh;function A1(){if(Nh)return Zc;Nh=1;var t=Object.prototype.toString;Zc=function(p){if(p===void 0)return"undefined";if(p===null)return"null";var g=typeof p;if(g==="boolean")return"boolean";if(g==="string")return"string";if(g==="number")return"number";if(g==="symbol")return"symbol";if(g==="function")return a(p)?"generatorfunction":"function";if(r(p))return"array";if(l(p))return"buffer";if(c(p))return"arguments";if(i(p))return"date";if(s(p))return"error";if(n(p))return"regexp";switch(e(p)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(o(p))return"generator";switch(g=t.call(p),g){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return g.slice(8,-1).toLowerCase().replace(/\s/g,"")};function e(u){return typeof u.constructor=="function"?u.constructor.name:null}function r(u){return Array.isArray?Array.isArray(u):u instanceof Array}function s(u){return u instanceof Error||typeof u.message=="string"&&u.constructor&&typeof u.constructor.stackTraceLimit=="number"}function i(u){return u instanceof Date?!0:typeof u.toDateString=="function"&&typeof u.getDate=="function"&&typeof u.setDate=="function"}function n(u){return u instanceof RegExp?!0:typeof u.flags=="string"&&typeof u.ignoreCase=="boolean"&&typeof u.multiline=="boolean"&&typeof u.global=="boolean"}function a(u,p){return e(u)==="GeneratorFunction"}function o(u){return typeof u.throw=="function"&&typeof u.return=="function"&&typeof u.next=="function"}function c(u){try{if(typeof u.length=="number"&&typeof u.callee=="function")return!0}catch(p){if(p.message.indexOf("callee")!==-1)return!0}return!1}function l(u){return u.constructor&&typeof u.constructor.isBuffer=="function"?u.constructor.isBuffer(u):!1}return Zc}var Dh;function C1(){if(Dh)return co.exports;Dh=1;let t=S1(),e=R1(),r=A1(),s=(f,d,m)=>{f[d]||(f[d]=[]),f[d].push(m)},i=(f,d,m,y)=>{f[d]||(f[d]={}),f[d][m]=y},n=f=>Array.isArray(f)?`[${f.map(n).join(", ")}]`:r(f)==="string"?JSON.stringify(f):f,a=f=>{if(Array.isArray(f)&&f.length>0){let[d]=f;return`${r(d)}-array`}return r(f)},o=(f,d)=>{let m=f==="array"?"string-array":f;return u.includes(m)&&Array.isArray(d)&&d.length===0?"array":m},c=["stopEarly","unknown","--"],l=["string","boolean","number"],u=l.map(f=>`${f}-array`),p=[...l,"array",...u],g=f=>{f=f||{};let d={};return c.forEach(m=>{f[m]&&(d[m]=f[m])}),Object.keys(f).forEach(m=>{let y=f[m];if(m==="arguments"&&(m="_"),typeof y=="string"&&(y={type:y}),t(y)){let v=y,{type:_}=v;if(_){if(!p.includes(_))throw new TypeError(`Expected type of "${m}" to be one of ${n(p)}, got ${n(_)}`);if(u.includes(_)){let[w]=_.split("-");s(d,"array",{key:m,[w]:!0})}else s(d,_,m)}if({}.hasOwnProperty.call(v,"default")){let{default:w}=v,h=a(w),b=o(_,w);if(b&&b!==h)throw new TypeError(`Expected "${m}" default value to be of type "${b}", got ${n(h)}`);i(d,"default",m,w)}e(v.alias).forEach(w=>{i(d,"alias",w,m)})}}),d};return co.exports=g,co.exports.default=g,co.exports}var O1=C1(),ud=uo(O1),lo={exports:{}},Fh;function T1(){if(Fh)return lo.exports;Fh=1;let t=i=>typeof i=="object"&&i!==null,e=Symbol("skip"),r=i=>t(i)&&!(i instanceof RegExp)&&!(i instanceof Error)&&!(i instanceof Date),s=(i,n,a,o=new WeakMap)=>{if(a={deep:!1,target:{},...a},o.has(i))return o.get(i);o.set(i,a.target);let{target:c}=a;delete a.target;let l=u=>u.map(p=>r(p)?s(p,n,a,o):p);if(Array.isArray(i))return l(i);for(let[u,p]of Object.entries(i)){let g=n(u,p,i);if(g===e)continue;let[f,d,{shouldRecurse:m=!0}={}]=g;f!=="__proto__"&&(a.deep&&m&&r(d)&&(d=Array.isArray(d)?l(d):s(d,n,a,o)),c[f]=d)}return c};return lo.exports=(i,n,a)=>{if(!t(i))throw new TypeError(`Expected an object, got \`${i}\` (${typeof i})`);return s(i,n,a)},lo.exports.mapObjectSkip=e,lo.exports}var L1=T1(),Mh=uo(L1),Xc=class extends Map{constructor(e={}){if(super(),!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof e.maxAge=="number"&&e.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=e.maxSize,this.maxAge=e.maxAge||Number.POSITIVE_INFINITY,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(e){if(typeof this.onEviction=="function")for(let[r,s]of e)this.onEviction(r,s.value)}_deleteIfExpired(e,r){return typeof r.expiry=="number"&&r.expiry<=Date.now()?(typeof this.onEviction=="function"&&this.onEviction(e,r.value),this.delete(e)):!1}_getOrDeleteIfExpired(e,r){if(this._deleteIfExpired(e,r)===!1)return r.value}_getItemValue(e,r){return r.expiry?this._getOrDeleteIfExpired(e,r):r.value}_peek(e,r){let s=r.get(e);return this._getItemValue(e,s)}_set(e,r){this.cache.set(e,r),this._size++,this._size>=this.maxSize&&(this._size=0,this._emitEvictions(this.oldCache),this.oldCache=this.cache,this.cache=new Map)}_moveToRecent(e,r){this.oldCache.delete(e),this._set(e,r)}*_entriesAscending(){for(let e of this.oldCache){let[r,s]=e;this.cache.has(r)||this._deleteIfExpired(r,s)===!1&&(yield e)}for(let e of this.cache){let[r,s]=e;this._deleteIfExpired(r,s)===!1&&(yield e)}}get(e){if(this.cache.has(e)){let r=this.cache.get(e);return this._getItemValue(e,r)}if(this.oldCache.has(e)){let r=this.oldCache.get(e);if(this._deleteIfExpired(e,r)===!1)return this._moveToRecent(e,r),r.value}}set(e,r,{maxAge:s=this.maxAge}={}){let i=typeof s=="number"&&s!==Number.POSITIVE_INFINITY?Date.now()+s:void 0;return this.cache.has(e)?this.cache.set(e,{value:r,expiry:i}):this._set(e,{value:r,expiry:i}),this}has(e){return this.cache.has(e)?!this._deleteIfExpired(e,this.cache.get(e)):this.oldCache.has(e)?!this._deleteIfExpired(e,this.oldCache.get(e)):!1}peek(e){if(this.cache.has(e))return this._peek(e,this.cache);if(this.oldCache.has(e))return this._peek(e,this.oldCache)}delete(e){let r=this.cache.delete(e);return r&&this._size--,this.oldCache.delete(e)||r}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}resize(e){if(!(e&&e>0))throw new TypeError("`maxSize` must be a number greater than 0");let r=[...this._entriesAscending()],s=r.length-e;s<0?(this.cache=new Map(r),this.oldCache=new Map,this._size=r.length):(s>0&&this._emitEvictions(r.slice(0,s)),this.oldCache=new Map(r.slice(s)),this.cache=new Map,this._size=0),this.maxSize=e}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache){let[r,s]=e;this._deleteIfExpired(r,s)===!1&&(yield[r,s.value])}for(let e of this.oldCache){let[r,s]=e;this.cache.has(r)||this._deleteIfExpired(r,s)===!1&&(yield[r,s.value])}}*entriesDescending(){let e=[...this.cache];for(let r=e.length-1;r>=0;--r){let s=e[r],[i,n]=s;this._deleteIfExpired(i,n)===!1&&(yield[i,n.value])}e=[...this.oldCache];for(let r=e.length-1;r>=0;--r){let s=e[r],[i,n]=s;this.cache.has(i)||this._deleteIfExpired(i,n)===!1&&(yield[i,n.value])}}*entriesAscending(){for(let[e,r]of this._entriesAscending())yield[e,r.value]}get size(){if(!this._size)return this.oldCache.size;let e=0;for(let r of this.oldCache.keys())this.cache.has(r)||e++;return Math.min(this._size+e,this.maxSize)}entries(){return this.entriesAscending()}forEach(e,r=this){for(let[s,i]of this.entriesAscending())e.call(r,i,s,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}},$1=(t,e)=>t.some(r=>typeof r=="string"?r===e:(r.lastIndex=0,r.test(e))),Hc=new Xc({maxSize:1e5}),jh=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp)&&!(t instanceof Error)&&!(t instanceof Date),Bh=(t,e={})=>{if(!jh(t))return t;let{separator:r="_",exclude:s,deep:i=!1}=e,n=a=>(o,c)=>{if(i&&jh(c)&&(c=Mh(c,n())),!(s&&$1(s,o))){let l=`${r}${o}`;if(Hc.has(l))o=Hc.get(l);else{let u=rl(o,{separator:r});o.length<100&&Hc.set(l,u),o=u}}return[o,c]};return Mh(t,n())};function fd(t,e){return Array.isArray(t)?Object.keys(t).map(r=>Bh(t[r],e)):Bh(t,e)}import P1 from"node:process";import I1 from"node:path";import{fileURLToPath as k1}from"node:url";var Mr=t=>`--${rl(t,{separator:"-"})}`,Zi=(t,e="--")=>`\`${e}${t.join(`\`, \`${e}`)}\``;var N1=t=>{let e={flags:{keyContainsDashes:{filter:([s])=>s.includes("-")&&s!=="--",message:s=>`Flag keys may not contain '-'. Invalid flags: ${Zi(s,"")}`},aliasIsSet:{filter:([,s])=>Object.hasOwn(s,"alias"),message:s=>`The option \`alias\` has been renamed to \`shortFlag\`. The following flags need to be updated: ${Zi(s)}`},choicesNotAnArray:{filter:([,s])=>Object.hasOwn(s,"choices")&&!Array.isArray(s.choices),message:s=>`The option \`choices\` must be an array. Invalid flags: ${Zi(s)}`},choicesNotMatchFlagType:{filter:([,s])=>s.type&&Array.isArray(s.choices)&&s.choices.some(i=>typeof i!==s.type),message(s){return`Each value of the option \`choices\` must be of the same type as its flag. Invalid flags: ${s.map(n=>`(\`${Mr(n)}\`, type: '${t.flags[n].type}')`).join(", ")}`}},defaultNotInChoices:{filter:([,s])=>s.default&&Array.isArray(s.choices)&&![s.default].flat().every(i=>s.choices.includes(i)),message:s=>`Each value of the option \`default\` must exist within the option \`choices\`. Invalid flags: ${Zi(s)}`}}},r=[];for(let[s,i]of Object.entries(e)){let n=Object.entries(t[s]);for(let{filter:a,message:o}of Object.values(i)){let c=n.filter(u=>a(u)),l=c.map(([u])=>u);c.length>0&&r.push(o(l))}}if(r.length>0)throw new Error(r.join(`
|
|
32
|
+
`))},hd=(t,e)=>{if(typeof t!="string"&&(e=t,t=""),!e.importMeta?.url)throw new TypeError("The `importMeta` option is required. Its value must be `import.meta`.");let s=e.pkg??ad({cwd:I1.dirname(k1(e.importMeta.url)),normalize:!1})?.packageJson??{};ld(s);let i={argv:P1.argv.slice(2),flags:{},inferType:!1,input:"string",description:s.description??!1,help:t,version:s.version||"No version found",autoHelp:!0,autoVersion:!0,booleanDefault:!1,allowUnknownFlags:!0,allowParentFlags:!0,helpIndent:2,...e,pkg:s};return N1(i),i};var D1=({flags:t,booleanDefault:e})=>{let r={};for(let[s,i]of Object.entries(t)){let n={...i};n.shortFlag&&(n.alias=n.shortFlag,delete n.shortFlag),e!==void 0&&n.type==="boolean"&&!Object.hasOwn(n,"default")&&(n.default=n.isMultiple?[e]:e),n.isMultiple&&(n.type=n.type?`${n.type}-array`:"array",n.default??=[],delete n.isMultiple),Array.isArray(n.aliases)&&(n.alias&&n.aliases.push(n.alias),n.alias=n.aliases,delete n.aliases),r[s]=n}return r},dd=t=>{let e=D1(t);return e.arguments=t.input,e=fd(e,{separator:"-",exclude:["stopEarly","--"]}),t.inferType&&delete e.arguments,t.allowUnknownFlags||(t.autoHelp&&!e.help&&(e.help={type:"boolean"}),t.autoVersion&&!e.version&&(e.version={type:"boolean"})),e=ud(e),e.configuration={...e.configuration,"greedy-arrays":!1,"parse-numbers":t.inferType},e["--"]&&(e.configuration["populate--"]=!0),t.allowUnknownFlags||(e.configuration["unknown-options-as-args"]=!0),e};import pd from"node:process";var F1=(t,e)=>{for(let[r,s]of Object.entries(e.flags))if(r!=="--"&&!s.isMultiple&&Array.isArray(t[r]))throw new Error(`The flag --${r} can only be set once.`)},M1=(t,e,r)=>{let{choices:s,isRequired:i}=e;if(!s)return;let n=`Value must be one of: [\`${s.join("`, `")}\`]`;if(!r)return i?`Flag \`${Mr(t)}\` has no value. ${n}`:void 0;if(Array.isArray(r)){let a=r.filter(o=>!s.includes(o));if(a.length>0)return`Unknown ${a.length>1?"values":"value"} for flag \`${Mr(t)}\`: \`${a.join("`, `")}\`. ${n}`}else if(!s.includes(r))return`Unknown value for flag \`${Mr(t)}\`: \`${r}\`. ${n}`},j1=(t,e)=>{let r=[];for(let[s,i]of Object.entries(t)){let n=e[s],a=M1(s,i,n);a&&r.push(a)}if(r.length>0)throw new Error(`${r.join(`
|
|
33
|
+
`)}`)},md=(t,e)=>{F1(t,e),j1(e.flags,t)},B1=t=>{console.error([`Unknown flag${t.length>1?"s":""}`,...t].join(`
|
|
34
|
+
`))},gd=t=>{let e=t.filter(r=>typeof r=="string"&&r.startsWith("-"));e.length>0&&(B1(e),pd.exit(2))},U1=(t,e,r,s)=>{let i=e[t],n=!0;if(typeof i.isRequired=="function"&&(n=i.isRequired(r,s),typeof n!="boolean"))throw new TypeError(`Return value for isRequired callback should be of type boolean, but ${typeof n} was returned.`);return(r[t]===void 0||i.isMultiple&&r[t].length===0)&&n},G1=t=>{console.error(`Missing required flag${t.length>1?"s":""}`);for(let e of t)console.error(` ${Mr(e.key)}${e.shortFlag?`, -${e.shortFlag}`:""}`)},yd=(t,e,r)=>{let s=[];if(t===void 0)return[];for(let i of Object.keys(t))t[i].isRequired&&U1(i,t,e,r)&&s.push({key:i,...t[i]});s.length>0&&(G1(s),pd.exit(2))};var z1=({pkg:t,...e},r)=>{let s=Ws(e.argv,r),i="";if(e.help&&(i=Jh((e.help||"").replace(/\t+\n*$/,"")),i.includes(`
|
|
35
|
+
`)&&(i=tl(i,e.helpIndent)),i=`
|
|
36
|
+
${i}`),e.description!==!1){let{description:u}=e;u&&(u=i?tl(`
|
|
37
37
|
${u}
|
|
38
38
|
`,e.helpIndent):`
|
|
39
|
-
${u}`,
|
|
40
|
-
`;let n=u=>{console.log(s),Ba.exit(typeof u=="number"?u:2)},a=()=>{console.log(e.version),Ba.exit(0)};i._.length===0&&e.argv.length===1&&(i.version===!0&&e.autoVersion?a():i.help===!0&&e.autoHelp&&n(0));let o=i._;delete i._,e.allowUnknownFlags||qh(o);let c=Sh(i,{exclude:["--",/^\w$/]}),l={...c};zh(c,e);for(let u of Object.values(e.flags)){if(Array.isArray(u.aliases))for(let d of u.aliases)delete c[d];delete c[u.shortFlag]}return Wh(e.flags,c,o),{input:o,flags:c,unnormalizedFlags:l,pkg:t,help:s,showHelp:n,showVersion:a}},Vh=(t,e={})=>{let r=Bh(t,e),i=Uh(r),s=g1(r,i);return Ba.title=s.pkg.bin?Object.keys(s.pkg.bin).at(0):s.pkg.name,s};var Ey=We(oc(),1);var Gp=We(Bp(),1);var p_=Object.prototype.toString,d_=t=>p_.call(t)==="[object Error]",m_=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);function ac(t){return t&&d_(t)&&t.name==="TypeError"&&typeof t.message=="string"?t.message==="Load failed"?t.stack===void 0:m_.has(t.message):!1}var cc=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},Up=(t,e,r)=>{let i=r.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=i,t};async function lc(t,e){return new Promise((r,i)=>{e={...e},e.onFailedAttempt??=()=>{},e.shouldRetry??=()=>!0,e.retries??=10;let s=Gp.default.operation(e),n=()=>{s.stop(),i(e.signal?.reason)};e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",n,{once:!0});let a=()=>{e.signal?.removeEventListener("abort",n),s.stop()};s.attempt(async o=>{try{let c=await t(o);a(),r(c)}catch(c){try{if(!(c instanceof Error))throw new TypeError(`Non-error was thrown: "${c}". You should only throw errors.`);if(c instanceof cc)throw c.originalError;if(c instanceof TypeError&&!ac(c))throw c;if(Up(c,o,e),await e.shouldRetry(c)||(s.stop(),i(c)),await e.onFailedAttempt(c),!s.retry(c))throw s.mainError()}catch(l){Up(l,o,e),a(),i(l)}}})})}var T={};jo(T,{BRAND:()=>U_,DIRTY:()=>lr,EMPTY_PATH:()=>v_,INVALID:()=>Q,NEVER:()=>RS,OK:()=>Ne,ParseStatus:()=>$e,Schema:()=>ae,ZodAny:()=>Wt,ZodArray:()=>Pt,ZodBigInt:()=>hr,ZodBoolean:()=>fr,ZodBranded:()=>Qi,ZodCatch:()=>_r,ZodDate:()=>pr,ZodDefault:()=>Er,ZodDiscriminatedUnion:()=>mn,ZodEffects:()=>it,ZodEnum:()=>wr,ZodError:()=>Ve,ZodFirstPartyTypeKind:()=>te,ZodFunction:()=>yn,ZodIntersection:()=>yr,ZodIssueCode:()=>N,ZodLazy:()=>br,ZodLiteral:()=>vr,ZodMap:()=>ri,ZodNaN:()=>si,ZodNativeEnum:()=>xr,ZodNever:()=>pt,ZodNull:()=>mr,ZodNullable:()=>Et,ZodNumber:()=>ur,ZodObject:()=>He,ZodOptional:()=>tt,ZodParsedType:()=>U,ZodPipeline:()=>es,ZodPromise:()=>Vt,ZodReadonly:()=>Sr,ZodRecord:()=>gn,ZodSchema:()=>ae,ZodSet:()=>ii,ZodString:()=>qt,ZodSymbol:()=>ei,ZodTransformer:()=>it,ZodTuple:()=>xt,ZodType:()=>ae,ZodUndefined:()=>dr,ZodUnion:()=>gr,ZodUnknown:()=>Tt,ZodVoid:()=>ti,addIssueToContext:()=>B,any:()=>X_,array:()=>eS,bigint:()=>W_,boolean:()=>Qp,coerce:()=>SS,custom:()=>Xp,date:()=>V_,datetimeRegex:()=>Kp,defaultErrorMap:()=>Ot,discriminatedUnion:()=>sS,effect:()=>gS,enum:()=>pS,function:()=>uS,getErrorMap:()=>Jr,getParsedType:()=>wt,instanceof:()=>z_,intersection:()=>nS,isAborted:()=>pn,isAsync:()=>Zr,isDirty:()=>dn,isValid:()=>zt,late:()=>G_,lazy:()=>hS,literal:()=>fS,makeIssue:()=>Zi,map:()=>cS,nan:()=>q_,nativeEnum:()=>dS,never:()=>Z_,null:()=>Y_,nullable:()=>bS,number:()=>Zp,object:()=>tS,objectUtil:()=>uc,oboolean:()=>_S,onumber:()=>ES,optional:()=>yS,ostring:()=>xS,pipeline:()=>wS,preprocess:()=>vS,promise:()=>mS,quotelessJson:()=>g_,record:()=>aS,set:()=>lS,setErrorMap:()=>b_,strictObject:()=>rS,string:()=>Jp,symbol:()=>H_,transformer:()=>gS,tuple:()=>oS,undefined:()=>K_,union:()=>iS,unknown:()=>J_,util:()=>ce,void:()=>Q_});var ce;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{let n={};for(let a of s)n[a]=a;return n},t.getValidEnumValues=s=>{let n=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),a={};for(let o of n)a[o]=s[o];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(n){return s[n]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let n=[];for(let a in s)Object.prototype.hasOwnProperty.call(s,a)&&n.push(a);return n},t.find=(s,n)=>{for(let a of s)if(n(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function i(s,n=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(n)}t.joinValues=i,t.jsonStringifyReplacer=(s,n)=>typeof n=="bigint"?n.toString():n})(ce||(ce={}));var uc;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(uc||(uc={}));var U=ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wt=t=>{switch(typeof t){case"undefined":return U.undefined;case"string":return U.string;case"number":return Number.isNaN(t)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(t)?U.array:t===null?U.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?U.promise:typeof Map<"u"&&t instanceof Map?U.map:typeof Set<"u"&&t instanceof Set?U.set:typeof Date<"u"&&t instanceof Date?U.date:U.object;default:return U.unknown}};var N=ce.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),g_=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Ve=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(n){return n.message},i={_errors:[]},s=n=>{for(let a of n.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)i._errors.push(r(a));else{let o=i,c=0;for(;c<a.path.length;){let l=a.path[c];c===a.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(r(a))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return s(this),i}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ce.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},i=[];for(let s of this.issues)if(s.path.length>0){let n=s.path[0];r[n]=r[n]||[],r[n].push(e(s))}else i.push(e(s));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Ve.create=t=>new Ve(t);var y_=(t,e)=>{let r;switch(t.code){case N.invalid_type:t.received===U.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ce.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:r=`Unrecognized key(s) in object: ${ce.joinValues(t.keys,", ")}`;break;case N.invalid_union:r="Invalid input";break;case N.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ce.joinValues(t.options)}`;break;case N.invalid_enum_value:r=`Invalid enum value. Expected ${ce.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:r="Invalid function arguments";break;case N.invalid_return_type:r="Invalid function return type";break;case N.invalid_date:r="Invalid date";break;case N.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ce.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case N.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case N.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case N.custom:r="Invalid input";break;case N.invalid_intersection_types:r="Intersection results could not be merged";break;case N.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:r="Number must be finite";break;default:r=e.defaultError,ce.assertNever(t)}return{message:r}},Ot=y_;var zp=Ot;function b_(t){zp=t}function Jr(){return zp}var Zi=t=>{let{data:e,path:r,errorMaps:i,issueData:s}=t,n=[...r,...s.path||[]],a={...s,path:n};if(s.message!==void 0)return{...s,path:n,message:s.message};let o="",c=i.filter(l=>!!l).slice().reverse();for(let l of c)o=l(a,{data:e,defaultError:o}).message;return{...s,path:n,message:o}},v_=[];function B(t,e){let r=Jr(),i=Zi({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Ot?void 0:Ot].filter(s=>!!s)});t.common.issues.push(i)}var $e=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let i=[];for(let s of r){if(s.status==="aborted")return Q;s.status==="dirty"&&e.dirty(),i.push(s.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){let i=[];for(let s of r){let n=await s.key,a=await s.value;i.push({key:n,value:a})}return t.mergeObjectSync(e,i)}static mergeObjectSync(e,r){let i={};for(let s of r){let{key:n,value:a}=s;if(n.status==="aborted"||a.status==="aborted")return Q;n.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(i[n.value]=a.value)}return{status:e.value,value:i}}},Q=Object.freeze({status:"aborted"}),lr=t=>({status:"dirty",value:t}),Ne=t=>({status:"valid",value:t}),pn=t=>t.status==="aborted",dn=t=>t.status==="dirty",zt=t=>t.status==="valid",Zr=t=>typeof Promise<"u"&&t instanceof Promise;var K;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(K||(K={}));var rt=class{constructor(e,r,i,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=i,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},qp=(t,e)=>{if(zt(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ve(t.common.issues);return this._error=r,this._error}}};function ne(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:s}=t;if(e&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,o)=>{let{message:c}=t;return a.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??i??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:c??r??o.defaultError}},description:s}}var ae=class{get description(){return this._def.description}_getType(e){return wt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:wt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new $e,ctx:{common:e.parent.common,data:e.data,parsedType:wt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Zr(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){let i={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wt(e)},s=this._parseSync({data:e,path:i.path,parent:i});return qp(i,s)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wt(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:r});return zt(i)?{value:i.value}:{issues:r.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(i=>zt(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(e,r){let i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){let i={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wt(e)},s=this._parse({data:e,path:i.path,parent:i}),n=await(Zr(s)?s:Promise.resolve(s));return qp(i,n)}refine(e,r){let i=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,n)=>{let a=e(s),o=()=>n.addIssue({code:N.custom,...i(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,r){return this._refinement((i,s)=>e(i)?!0:(s.addIssue(typeof r=="function"?r(i,s):r),!1))}_refinement(e){return new it({schema:this,typeName:te.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return tt.create(this,this._def)}nullable(){return Et.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Pt.create(this)}promise(){return Vt.create(this,this._def)}or(e){return gr.create([this,e],this._def)}and(e){return yr.create(this,e,this._def)}transform(e){return new it({...ne(this._def),schema:this,typeName:te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Er({...ne(this._def),innerType:this,defaultValue:r,typeName:te.ZodDefault})}brand(){return new Qi({typeName:te.ZodBranded,type:this,...ne(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new _r({...ne(this._def),innerType:this,catchValue:r,typeName:te.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return es.create(this,e)}readonly(){return Sr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},w_=/^c[^\s-]{8,}$/i,x_=/^[0-9a-z]+$/,E_=/^[0-9A-HJKMNP-TV-Z]{26}$/i,__=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,S_=/^[a-z0-9_-]{21}$/i,R_=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,C_=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,A_=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,L_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",hc,O_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,$_=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,T_=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,P_=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,I_=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,F_=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Vp="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",N_=new RegExp(`^${Vp}$`);function Hp(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function D_(t){return new RegExp(`^${Hp(t)}$`)}function Kp(t){let e=`${Vp}T${Hp(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function M_(t,e){return!!((e==="v4"||!e)&&O_.test(t)||(e==="v6"||!e)&&T_.test(t))}function k_(t,e){if(!R_.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let i=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(i));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function j_(t,e){return!!((e==="v4"||!e)&&$_.test(t)||(e==="v6"||!e)&&P_.test(t))}var qt=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==U.string){let n=this._getOrReturnCtx(e);return B(n,{code:N.invalid_type,expected:U.string,received:n.parsedType}),Q}let i=new $e,s;for(let n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(s=this._getOrReturnCtx(e,s),B(s,{code:N.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),i.dirty());else if(n.kind==="max")e.data.length>n.value&&(s=this._getOrReturnCtx(e,s),B(s,{code:N.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),i.dirty());else if(n.kind==="length"){let a=e.data.length>n.value,o=e.data.length<n.value;(a||o)&&(s=this._getOrReturnCtx(e,s),a?B(s,{code:N.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):o&&B(s,{code:N.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),i.dirty())}else if(n.kind==="email")A_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"email",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="emoji")hc||(hc=new RegExp(L_,"u")),hc.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"emoji",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="uuid")__.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"uuid",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="nanoid")S_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"nanoid",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="cuid")w_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"cuid",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="cuid2")x_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"cuid2",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="ulid")E_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"ulid",code:N.invalid_string,message:n.message}),i.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),B(s,{validation:"url",code:N.invalid_string,message:n.message}),i.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"regex",code:N.invalid_string,message:n.message}),i.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),i.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:{startsWith:n.value},message:n.message}),i.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:{endsWith:n.value},message:n.message}),i.dirty()):n.kind==="datetime"?Kp(n).test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:"datetime",message:n.message}),i.dirty()):n.kind==="date"?N_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:"date",message:n.message}),i.dirty()):n.kind==="time"?D_(n).test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{code:N.invalid_string,validation:"time",message:n.message}),i.dirty()):n.kind==="duration"?C_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"duration",code:N.invalid_string,message:n.message}),i.dirty()):n.kind==="ip"?M_(e.data,n.version)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"ip",code:N.invalid_string,message:n.message}),i.dirty()):n.kind==="jwt"?k_(e.data,n.alg)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"jwt",code:N.invalid_string,message:n.message}),i.dirty()):n.kind==="cidr"?j_(e.data,n.version)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"cidr",code:N.invalid_string,message:n.message}),i.dirty()):n.kind==="base64"?I_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"base64",code:N.invalid_string,message:n.message}),i.dirty()):n.kind==="base64url"?F_.test(e.data)||(s=this._getOrReturnCtx(e,s),B(s,{validation:"base64url",code:N.invalid_string,message:n.message}),i.dirty()):ce.assertNever(n);return{status:i.value,value:e.data}}_regex(e,r,i){return this.refinement(s=>e.test(s),{validation:r,code:N.invalid_string,...K.errToObj(i)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...K.errToObj(e)})}url(e){return this._addCheck({kind:"url",...K.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...K.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...K.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...K.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...K.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...K.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...K.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...K.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...K.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...K.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...K.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...K.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...K.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...K.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...K.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...K.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...K.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...K.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...K.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...K.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...K.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...K.errToObj(r)})}nonempty(e){return this.min(1,K.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};qt.create=t=>new qt({checks:[],typeName:te.ZodString,coerce:t?.coerce??!1,...ne(t)});function B_(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,s=r>i?r:i,n=Number.parseInt(t.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return n%a/10**s}var ur=class t extends ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==U.number){let n=this._getOrReturnCtx(e);return B(n,{code:N.invalid_type,expected:U.number,received:n.parsedType}),Q}let i,s=new $e;for(let n of this._def.checks)n.kind==="int"?ce.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),B(i,{code:N.invalid_type,expected:"integer",received:"float",message:n.message}),s.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),s.dirty()):n.kind==="multipleOf"?B_(e.data,n.value)!==0&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),B(i,{code:N.not_finite,message:n.message}),s.dirty()):ce.assertNever(n);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,K.toString(r))}gt(e,r){return this.setLimit("min",e,!1,K.toString(r))}lte(e,r){return this.setLimit("max",e,!0,K.toString(r))}lt(e,r){return this.setLimit("max",e,!1,K.toString(r))}setLimit(e,r,i,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:K.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:K.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:K.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:K.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:K.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:K.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:K.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ce.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(r)&&Number.isFinite(e)}};ur.create=t=>new ur({checks:[],typeName:te.ZodNumber,coerce:t?.coerce||!1,...ne(t)});var hr=class t extends ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==U.bigint)return this._getInvalidInput(e);let i,s=new $e;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),s.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),B(i,{code:N.not_multiple_of,multipleOf:n.value,message:n.message}),s.dirty()):ce.assertNever(n);return{status:s.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return B(r,{code:N.invalid_type,expected:U.bigint,received:r.parsedType}),Q}gte(e,r){return this.setLimit("min",e,!0,K.toString(r))}gt(e,r){return this.setLimit("min",e,!1,K.toString(r))}lte(e,r){return this.setLimit("max",e,!0,K.toString(r))}lt(e,r){return this.setLimit("max",e,!1,K.toString(r))}setLimit(e,r,i,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:K.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:K.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:K.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:K.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:K.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:K.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};hr.create=t=>new hr({checks:[],typeName:te.ZodBigInt,coerce:t?.coerce??!1,...ne(t)});var fr=class extends ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==U.boolean){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.boolean,received:i.parsedType}),Q}return Ne(e.data)}};fr.create=t=>new fr({typeName:te.ZodBoolean,coerce:t?.coerce||!1,...ne(t)});var pr=class t extends ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==U.date){let n=this._getOrReturnCtx(e);return B(n,{code:N.invalid_type,expected:U.date,received:n.parsedType}),Q}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return B(n,{code:N.invalid_date}),Q}let i=new $e,s;for(let n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(s=this._getOrReturnCtx(e,s),B(s,{code:N.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),i.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(s=this._getOrReturnCtx(e,s),B(s,{code:N.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),i.dirty()):ce.assertNever(n);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:K.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:K.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};pr.create=t=>new pr({checks:[],coerce:t?.coerce||!1,typeName:te.ZodDate,...ne(t)});var ei=class extends ae{_parse(e){if(this._getType(e)!==U.symbol){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.symbol,received:i.parsedType}),Q}return Ne(e.data)}};ei.create=t=>new ei({typeName:te.ZodSymbol,...ne(t)});var dr=class extends ae{_parse(e){if(this._getType(e)!==U.undefined){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.undefined,received:i.parsedType}),Q}return Ne(e.data)}};dr.create=t=>new dr({typeName:te.ZodUndefined,...ne(t)});var mr=class extends ae{_parse(e){if(this._getType(e)!==U.null){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.null,received:i.parsedType}),Q}return Ne(e.data)}};mr.create=t=>new mr({typeName:te.ZodNull,...ne(t)});var Wt=class extends ae{constructor(){super(...arguments),this._any=!0}_parse(e){return Ne(e.data)}};Wt.create=t=>new Wt({typeName:te.ZodAny,...ne(t)});var Tt=class extends ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ne(e.data)}};Tt.create=t=>new Tt({typeName:te.ZodUnknown,...ne(t)});var pt=class extends ae{_parse(e){let r=this._getOrReturnCtx(e);return B(r,{code:N.invalid_type,expected:U.never,received:r.parsedType}),Q}};pt.create=t=>new pt({typeName:te.ZodNever,...ne(t)});var ti=class extends ae{_parse(e){if(this._getType(e)!==U.undefined){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.void,received:i.parsedType}),Q}return Ne(e.data)}};ti.create=t=>new ti({typeName:te.ZodVoid,...ne(t)});var Pt=class t extends ae{_parse(e){let{ctx:r,status:i}=this._processInputParams(e),s=this._def;if(r.parsedType!==U.array)return B(r,{code:N.invalid_type,expected:U.array,received:r.parsedType}),Q;if(s.exactLength!==null){let a=r.data.length>s.exactLength.value,o=r.data.length<s.exactLength.value;(a||o)&&(B(r,{code:a?N.too_big:N.too_small,minimum:o?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),i.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(B(r,{code:N.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),i.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(B(r,{code:N.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((a,o)=>s.type._parseAsync(new rt(r,a,r.path,o)))).then(a=>$e.mergeArray(i,a));let n=[...r.data].map((a,o)=>s.type._parseSync(new rt(r,a,r.path,o)));return $e.mergeArray(i,n)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:K.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:K.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:K.toString(r)}})}nonempty(e){return this.min(1,e)}};Pt.create=(t,e)=>new Pt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:te.ZodArray,...ne(e)});function Qr(t){if(t instanceof He){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=tt.create(Qr(i))}return new He({...t._def,shape:()=>e})}else return t instanceof Pt?new Pt({...t._def,type:Qr(t.element)}):t instanceof tt?tt.create(Qr(t.unwrap())):t instanceof Et?Et.create(Qr(t.unwrap())):t instanceof xt?xt.create(t.items.map(e=>Qr(e))):t}var He=class t extends ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=ce.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==U.object){let l=this._getOrReturnCtx(e);return B(l,{code:N.invalid_type,expected:U.object,received:l.parsedType}),Q}let{status:i,ctx:s}=this._processInputParams(e),{shape:n,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof pt&&this._def.unknownKeys==="strip"))for(let l in s.data)a.includes(l)||o.push(l);let c=[];for(let l of a){let u=n[l],d=s.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new rt(s,d,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof pt){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of o)c.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(l==="strict")o.length>0&&(B(s,{code:N.unrecognized_keys,keys:o}),i.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of o){let d=s.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new rt(s,d,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let d=await u.key,g=await u.value;l.push({key:d,value:g,alwaysSet:u.alwaysSet})}return l}).then(l=>$e.mergeObjectSync(i,l)):$e.mergeObjectSync(i,c)}get shape(){return this._def.shape()}strict(e){return K.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{let s=this._def.errorMap?.(r,i).message??i.defaultError;return r.code==="unrecognized_keys"?{message:K.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:te.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let i of ce.objectKeys(e))e[i]&&this.shape[i]&&(r[i]=this.shape[i]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let i of ce.objectKeys(this.shape))e[i]||(r[i]=this.shape[i]);return new t({...this._def,shape:()=>r})}deepPartial(){return Qr(this)}partial(e){let r={};for(let i of ce.objectKeys(this.shape)){let s=this.shape[i];e&&!e[i]?r[i]=s:r[i]=s.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let i of ce.objectKeys(this.shape))if(e&&!e[i])r[i]=this.shape[i];else{let n=this.shape[i];for(;n instanceof tt;)n=n._def.innerType;r[i]=n}return new t({...this._def,shape:()=>r})}keyof(){return Yp(ce.objectKeys(this.shape))}};He.create=(t,e)=>new He({shape:()=>t,unknownKeys:"strip",catchall:pt.create(),typeName:te.ZodObject,...ne(e)});He.strictCreate=(t,e)=>new He({shape:()=>t,unknownKeys:"strict",catchall:pt.create(),typeName:te.ZodObject,...ne(e)});He.lazycreate=(t,e)=>new He({shape:t,unknownKeys:"strip",catchall:pt.create(),typeName:te.ZodObject,...ne(e)});var gr=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),i=this._def.options;function s(n){for(let o of n)if(o.result.status==="valid")return o.result;for(let o of n)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let a=n.map(o=>new Ve(o.ctx.common.issues));return B(r,{code:N.invalid_union,unionErrors:a}),Q}if(r.common.async)return Promise.all(i.map(async n=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await n._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(s);{let n,a=[];for(let c of i){let l={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!n&&(n={result:u,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(n)return r.common.issues.push(...n.ctx.common.issues),n.result;let o=a.map(c=>new Ve(c));return B(r,{code:N.invalid_union,unionErrors:o}),Q}}get options(){return this._def.options}};gr.create=(t,e)=>new gr({options:t,typeName:te.ZodUnion,...ne(e)});var $t=t=>t instanceof br?$t(t.schema):t instanceof it?$t(t.innerType()):t instanceof vr?[t.value]:t instanceof wr?t.options:t instanceof xr?ce.objectValues(t.enum):t instanceof Er?$t(t._def.innerType):t instanceof dr?[void 0]:t instanceof mr?[null]:t instanceof tt?[void 0,...$t(t.unwrap())]:t instanceof Et?[null,...$t(t.unwrap())]:t instanceof Qi||t instanceof Sr?$t(t.unwrap()):t instanceof _r?$t(t._def.innerType):[],mn=class t extends ae{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.object)return B(r,{code:N.invalid_type,expected:U.object,received:r.parsedType}),Q;let i=this.discriminator,s=r.data[i],n=this.optionsMap.get(s);return n?r.common.async?n._parseAsync({data:r.data,path:r.path,parent:r}):n._parseSync({data:r.data,path:r.path,parent:r}):(B(r,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,i){let s=new Map;for(let n of r){let a=$t(n.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of a){if(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,n)}}return new t({typeName:te.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...ne(i)})}};function fc(t,e){let r=wt(t),i=wt(e);if(t===e)return{valid:!0,data:t};if(r===U.object&&i===U.object){let s=ce.objectKeys(e),n=ce.objectKeys(t).filter(o=>s.indexOf(o)!==-1),a={...t,...e};for(let o of n){let c=fc(t[o],e[o]);if(!c.valid)return{valid:!1};a[o]=c.data}return{valid:!0,data:a}}else if(r===U.array&&i===U.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let n=0;n<t.length;n++){let a=t[n],o=e[n],c=fc(a,o);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===U.date&&i===U.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var yr=class extends ae{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),s=(n,a)=>{if(pn(n)||pn(a))return Q;let o=fc(n.value,a.value);return o.valid?((dn(n)||dn(a))&&r.dirty(),{status:r.value,value:o.data}):(B(i,{code:N.invalid_intersection_types}),Q)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([n,a])=>s(n,a)):s(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};yr.create=(t,e,r)=>new yr({left:t,right:e,typeName:te.ZodIntersection,...ne(r)});var xt=class t extends ae{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==U.array)return B(i,{code:N.invalid_type,expected:U.array,received:i.parsedType}),Q;if(i.data.length<this._def.items.length)return B(i,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Q;!this._def.rest&&i.data.length>this._def.items.length&&(B(i,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let n=[...i.data].map((a,o)=>{let c=this._def.items[o]||this._def.rest;return c?c._parse(new rt(i,a,i.path,o)):null}).filter(a=>!!a);return i.common.async?Promise.all(n).then(a=>$e.mergeArray(r,a)):$e.mergeArray(r,n)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};xt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xt({items:t,typeName:te.ZodTuple,rest:null,...ne(e)})};var gn=class t extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==U.object)return B(i,{code:N.invalid_type,expected:U.object,received:i.parsedType}),Q;let s=[],n=this._def.keyType,a=this._def.valueType;for(let o in i.data)s.push({key:n._parse(new rt(i,o,i.path,o)),value:a._parse(new rt(i,i.data[o],i.path,o)),alwaysSet:o in i.data});return i.common.async?$e.mergeObjectAsync(r,s):$e.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof ae?new t({keyType:e,valueType:r,typeName:te.ZodRecord,...ne(i)}):new t({keyType:qt.create(),valueType:e,typeName:te.ZodRecord,...ne(r)})}},ri=class extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==U.map)return B(i,{code:N.invalid_type,expected:U.map,received:i.parsedType}),Q;let s=this._def.keyType,n=this._def.valueType,a=[...i.data.entries()].map(([o,c],l)=>({key:s._parse(new rt(i,o,i.path,[l,"key"])),value:n._parse(new rt(i,c,i.path,[l,"value"]))}));if(i.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let c of a){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return Q;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(l.value,u.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let c of a){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return Q;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(l.value,u.value)}return{status:r.value,value:o}}}};ri.create=(t,e,r)=>new ri({valueType:e,keyType:t,typeName:te.ZodMap,...ne(r)});var ii=class t extends ae{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==U.set)return B(i,{code:N.invalid_type,expected:U.set,received:i.parsedType}),Q;let s=this._def;s.minSize!==null&&i.data.size<s.minSize.value&&(B(i,{code:N.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&i.data.size>s.maxSize.value&&(B(i,{code:N.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let n=this._def.valueType;function a(c){let l=new Set;for(let u of c){if(u.status==="aborted")return Q;u.status==="dirty"&&r.dirty(),l.add(u.value)}return{status:r.value,value:l}}let o=[...i.data.values()].map((c,l)=>n._parse(new rt(i,c,i.path,l)));return i.common.async?Promise.all(o).then(c=>a(c)):a(o)}min(e,r){return new t({...this._def,minSize:{value:e,message:K.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:K.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};ii.create=(t,e)=>new ii({valueType:t,minSize:null,maxSize:null,typeName:te.ZodSet,...ne(e)});var yn=class t extends ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.function)return B(r,{code:N.invalid_type,expected:U.function,received:r.parsedType}),Q;function i(o,c){return Zi({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Jr(),Ot].filter(l=>!!l),issueData:{code:N.invalid_arguments,argumentsError:c}})}function s(o,c){return Zi({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Jr(),Ot].filter(l=>!!l),issueData:{code:N.invalid_return_type,returnTypeError:c}})}let n={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Vt){let o=this;return Ne(async function(...c){let l=new Ve([]),u=await o._def.args.parseAsync(c,n).catch(h=>{throw l.addIssue(i(c,h)),l}),d=await Reflect.apply(a,this,u);return await o._def.returns._def.type.parseAsync(d,n).catch(h=>{throw l.addIssue(s(d,h)),l})})}else{let o=this;return Ne(function(...c){let l=o._def.args.safeParse(c,n);if(!l.success)throw new Ve([i(c,l.error)]);let u=Reflect.apply(a,this,l.data),d=o._def.returns.safeParse(u,n);if(!d.success)throw new Ve([s(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:xt.create(e).rest(Tt.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,i){return new t({args:e||xt.create([]).rest(Tt.create()),returns:r||Tt.create(),typeName:te.ZodFunction,...ne(i)})}},br=class extends ae{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};br.create=(t,e)=>new br({getter:t,typeName:te.ZodLazy,...ne(e)});var vr=class extends ae{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return B(r,{received:r.data,code:N.invalid_literal,expected:this._def.value}),Q}return{status:"valid",value:e.data}}get value(){return this._def.value}};vr.create=(t,e)=>new vr({value:t,typeName:te.ZodLiteral,...ne(e)});function Yp(t,e){return new wr({values:t,typeName:te.ZodEnum,...ne(e)})}var wr=class t extends ae{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),i=this._def.values;return B(r,{expected:ce.joinValues(i),received:r.parsedType,code:N.invalid_type}),Q}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),i=this._def.values;return B(r,{received:r.data,code:N.invalid_enum_value,options:i}),Q}return Ne(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(i=>!e.includes(i)),{...this._def,...r})}};wr.create=Yp;var xr=class extends ae{_parse(e){let r=ce.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==U.string&&i.parsedType!==U.number){let s=ce.objectValues(r);return B(i,{expected:ce.joinValues(s),received:i.parsedType,code:N.invalid_type}),Q}if(this._cache||(this._cache=new Set(ce.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let s=ce.objectValues(r);return B(i,{received:i.data,code:N.invalid_enum_value,options:s}),Q}return Ne(e.data)}get enum(){return this._def.values}};xr.create=(t,e)=>new xr({values:t,typeName:te.ZodNativeEnum,...ne(e)});var Vt=class extends ae{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.promise&&r.common.async===!1)return B(r,{code:N.invalid_type,expected:U.promise,received:r.parsedType}),Q;let i=r.parsedType===U.promise?r.data:Promise.resolve(r.data);return Ne(i.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Vt.create=(t,e)=>new Vt({type:t,typeName:te.ZodPromise,...ne(e)});var it=class extends ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:i}=this._processInputParams(e),s=this._def.effect||null,n={addIssue:a=>{B(i,a),a.fatal?r.abort():r.dirty()},get path(){return i.path}};if(n.addIssue=n.addIssue.bind(n),s.type==="preprocess"){let a=s.transform(i.data,n);if(i.common.async)return Promise.resolve(a).then(async o=>{if(r.value==="aborted")return Q;let c=await this._def.schema._parseAsync({data:o,path:i.path,parent:i});return c.status==="aborted"?Q:c.status==="dirty"?lr(c.value):r.value==="dirty"?lr(c.value):c});{if(r.value==="aborted")return Q;let o=this._def.schema._parseSync({data:a,path:i.path,parent:i});return o.status==="aborted"?Q:o.status==="dirty"?lr(o.value):r.value==="dirty"?lr(o.value):o}}if(s.type==="refinement"){let a=o=>{let c=s.refinement(o,n);if(i.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(i.common.async===!1){let o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return o.status==="aborted"?Q:(o.status==="dirty"&&r.dirty(),a(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(o=>o.status==="aborted"?Q:(o.status==="dirty"&&r.dirty(),a(o.value).then(()=>({status:r.value,value:o.value}))))}if(s.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!zt(a))return Q;let o=s.transform(a.value,n);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>zt(a)?Promise.resolve(s.transform(a.value,n)).then(o=>({status:r.value,value:o})):Q);ce.assertNever(s)}};it.create=(t,e,r)=>new it({schema:t,typeName:te.ZodEffects,effect:e,...ne(r)});it.createWithPreprocess=(t,e,r)=>new it({schema:e,effect:{type:"preprocess",transform:t},typeName:te.ZodEffects,...ne(r)});var tt=class extends ae{_parse(e){return this._getType(e)===U.undefined?Ne(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};tt.create=(t,e)=>new tt({innerType:t,typeName:te.ZodOptional,...ne(e)});var Et=class extends ae{_parse(e){return this._getType(e)===U.null?Ne(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Et.create=(t,e)=>new Et({innerType:t,typeName:te.ZodNullable,...ne(e)});var Er=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return r.parsedType===U.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Er.create=(t,e)=>new Er({innerType:t,typeName:te.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ne(e)});var _r=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),i={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Zr(s)?s.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Ve(i.common.issues)},input:i.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ve(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};_r.create=(t,e)=>new _r({innerType:t,typeName:te.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ne(e)});var si=class extends ae{_parse(e){if(this._getType(e)!==U.nan){let i=this._getOrReturnCtx(e);return B(i,{code:N.invalid_type,expected:U.nan,received:i.parsedType}),Q}return{status:"valid",value:e.data}}};si.create=t=>new si({typeName:te.ZodNaN,...ne(t)});var U_=Symbol("zod_brand"),Qi=class extends ae{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},es=class t extends ae{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?Q:n.status==="dirty"?(r.dirty(),lr(n.value)):this._def.out._parseAsync({data:n.value,path:i.path,parent:i})})();{let s=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Q:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:i.path,parent:i})}}static create(e,r){return new t({in:e,out:r,typeName:te.ZodPipeline})}},Sr=class extends ae{_parse(e){let r=this._def.innerType._parse(e),i=s=>(zt(s)&&(s.value=Object.freeze(s.value)),s);return Zr(r)?r.then(s=>i(s)):i(r)}unwrap(){return this._def.innerType}};Sr.create=(t,e)=>new Sr({innerType:t,typeName:te.ZodReadonly,...ne(e)});function Wp(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Xp(t,e={},r){return t?Wt.create().superRefine((i,s)=>{let n=t(i);if(n instanceof Promise)return n.then(a=>{if(!a){let o=Wp(e,i),c=o.fatal??r??!0;s.addIssue({code:"custom",...o,fatal:c})}});if(!n){let a=Wp(e,i),o=a.fatal??r??!0;s.addIssue({code:"custom",...a,fatal:o})}}):Wt.create()}var G_={object:He.lazycreate},te;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(te||(te={}));var z_=(t,e={message:`Input not instance of ${t.name}`})=>Xp(r=>r instanceof t,e),Jp=qt.create,Zp=ur.create,q_=si.create,W_=hr.create,Qp=fr.create,V_=pr.create,H_=ei.create,K_=dr.create,Y_=mr.create,X_=Wt.create,J_=Tt.create,Z_=pt.create,Q_=ti.create,eS=Pt.create,tS=He.create,rS=He.strictCreate,iS=gr.create,sS=mn.create,nS=yr.create,oS=xt.create,aS=gn.create,cS=ri.create,lS=ii.create,uS=yn.create,hS=br.create,fS=vr.create,pS=wr.create,dS=xr.create,mS=Vt.create,gS=it.create,yS=tt.create,bS=Et.create,vS=it.createWithPreprocess,wS=es.create,xS=()=>Jp().optional(),ES=()=>Zp().optional(),_S=()=>Qp().optional(),SS={string:(t=>qt.create({...t,coerce:!0})),number:(t=>ur.create({...t,coerce:!0})),boolean:(t=>fr.create({...t,coerce:!0})),bigint:(t=>hr.create({...t,coerce:!0})),date:(t=>pr.create({...t,coerce:!0}))};var RS=Q;var CS=T.object({repository_url:T.string(),powerlint_version:T.string(),schema_version:T.string()}),AS=T.object({configured:T.boolean(),invalid_api_key:T.boolean().optional(),is_valid_repository:T.boolean().optional(),config:T.object({ignored_globs:T.array(T.string())}).optional()}),LS=T.object({repository_url:T.string(),rule_ids:T.array(T.string()).optional(),schema_version:T.string(),powerlint_version:T.string()}),OS=T.object({rules:T.array(T.object({id:T.string(),internalId:T.string(),internalVersionId:T.string(),message:T.string(),prompt:T.string(),severity:T.enum(["suggestion","violation"]),schema:T.any(),execution:T.enum(["llm","deterministic"]).optional()}))}),$S=T.object({rule:T.object({id:T.string(),versionId:T.string(),contents:T.string(),message:T.string()}),matches:T.array(T.any()),messages:T.array(T.any()),tools:T.array(T.enum(["read","grep","glob"])),files:T.array(T.object({path:T.string(),sha:T.string()})).optional(),schema_version:T.string(),powerlint_version:T.string(),repository_url:T.string(),commit:T.object({sha:T.string(),branch:T.string(),message:T.string(),timestamp:T.string()})}),TS=T.discriminatedUnion("type",[T.object({type:T.literal("tool_request"),tool_calls:T.array(T.any()),usage:T.object({cost:T.string(),inputTokens:T.string(),outputTokens:T.string()})}),T.object({type:T.literal("matches"),matches:T.array(T.any()),usage:T.object({cost:T.string(),inputTokens:T.string(),outputTokens:T.string()}),files:T.array(T.object({path:T.string(),sha:T.string()})).optional()}),T.object({type:T.literal("request_files"),files:T.array(T.object({path:T.string(),sha:T.string()})),usage:T.object({cost:T.string(),inputTokens:T.string(),outputTokens:T.string()})}),T.object({type:T.literal("partial_matches"),matches:T.array(T.any()),unresolved:T.array(T.any()),usage:T.object({cost:T.string(),inputTokens:T.string(),outputTokens:T.string()})})]),PS=T.object({rule:T.object({id:T.string(),versionId:T.string(),contents:T.string(),message:T.string()}),matches:T.array(T.any()),files:T.array(T.object({path:T.string(),sha:T.string()})).optional(),schema_version:T.string(),powerlint_version:T.string(),repository_url:T.string(),commit:T.object({sha:T.string(),branch:T.string(),message:T.string(),timestamp:T.string()})}),IS=T.discriminatedUnion("type",[T.object({type:T.literal("matches"),matches:T.array(T.any()),usage:T.object({cost:T.string(),inputTokens:T.string(),outputTokens:T.string()})}),T.object({type:T.literal("partial_matches"),matches:T.array(T.any()),unresolved:T.array(T.any()),usage:T.object({cost:T.string(),inputTokens:T.string(),outputTokens:T.string()})})]),ts=class{baseUrl;apiKey;constructor(e){this.baseUrl=e.baseUrl,this.apiKey=e.apiKey}async request(e,r,i){let s=`${this.baseUrl}${e}`,a=await(await lc(async()=>{let o=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify(r)});if(!o.ok){let c=await o.text();throw new Error(`Wispbit API request failed: ${o.status} ${o.statusText} - ${c}`)}return o},{retries:5,factor:2,minTimeout:1e3,maxTimeout:1e4,randomize:!0})).json();return i?i.parse(a):a}async initialize(e){let r=CS.parse(e);return await this.request("/plv1/initialize",r,AS)}async getRules(e){let r=LS.parse(e);return await this.request("/plv1/get-rules",r,OS)}async matchLLMSearch(e){let r=$S.parse(e);return await this.request("/plv1/llm-search",r,TS)}async matchLLMValidate(e){let r=PS.parse(e);return await this.request("/plv1/llm-validate",r,IS)}};var bn=class{config;environment;constructor(e,r){this.config=e,this.environment=r}async search(e){let r=this.config.getApiClient(),i=await this.environment.getRepositoryUrl(),s=await this.environment.getCurrentCommit(),n={id:e.rule.internalId,versionId:e.rule.internalVersionId,contents:e.rule.prompt,message:e.rule.config.message};return await r.matchLLMSearch({rule:n,matches:e.matches,messages:e.messages,tools:e.tools,files:e.files,schema_version:this.config.getSchemaVersion(),powerlint_version:this.config.getLocalVersion(),repository_url:i,commit:s})}async validate(e){let r=this.config.getApiClient(),i=await this.environment.getRepositoryUrl(),s=await this.environment.getCurrentCommit(),n={id:e.rule.internalId,versionId:e.rule.internalVersionId,contents:e.rule.prompt,message:e.rule.config.message};return await r.matchLLMValidate({rule:n,matches:e.matches,files:e.files,schema_version:this.config.getSchemaVersion(),powerlint_version:this.config.getLocalVersion(),repository_url:i,commit:s})}};import{readFileSync as WR}from"fs";import{dirname as VR,join as HR}from"path";import{fileURLToPath as KR}from"url";var rs=class extends Error{response;request;options;constructor(e,r,i){let s=e.status||e.status===0?e.status:"",n=e.statusText||"",a=`${s} ${n}`.trim(),o=a?`status code ${a}`:"an unknown error";super(`Request failed with ${o}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=i}};var ni=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var pc=(()=>{let t=!1,e=!1,r=typeof globalThis.ReadableStream=="function",i=typeof globalThis.Request=="function";if(r&&i)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(s){if(s instanceof Error&&s.message==="unsupported BodyInit type")return!1;throw s}return t&&!e})(),ed=typeof globalThis.AbortController=="function",td=typeof globalThis.ReadableStream=="function",rd=typeof globalThis.FormData=="function",vn=["get","post","put","patch","head","delete"],FS=()=>{};FS();var id={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},wn=2147483647,sd=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,xn=Symbol("stop"),nd={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},od={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0};var NS=t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(let[r,i]of t)e+=sd,e+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,e+=typeof i=="string"?new TextEncoder().encode(i).length:i.size;return e}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength;if(typeof t=="string")return new TextEncoder().encode(t).length;if(t instanceof URLSearchParams)return new TextEncoder().encode(t.toString()).length;if("byteLength"in t)return t.byteLength;if(typeof t=="object"&&t!==null)try{let e=JSON.stringify(t);return new TextEncoder().encode(e).length}catch{return 0}return 0},ad=(t,e)=>{let r=Number(t.headers.get("content-length"))||0,i=0;return t.status===204?(e&&e({percent:1,totalBytes:r,transferredBytes:i},new Uint8Array),new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers})):new Response(new ReadableStream({async start(s){let n=t.body.getReader();e&&e({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array);async function a(){let{done:o,value:c}=await n.read();if(o){s.close();return}if(e){i+=c.byteLength;let l=r===0?0:i/r;e({percent:l,transferredBytes:i,totalBytes:r},c)}s.enqueue(c),await a()}await a()}}),{status:t.status,statusText:t.statusText,headers:t.headers})},cd=(t,e)=>{let r=NS(t.body),i=0;return new Request(t,{duplex:"half",body:new ReadableStream({async start(s){let n=t.body instanceof ReadableStream?t.body.getReader():new Response("").body.getReader();async function a(){let{done:o,value:c}=await n.read();if(o){e&&e({percent:1,transferredBytes:i,totalBytes:Math.max(r,i)},new Uint8Array),s.close();return}i+=c.byteLength;let l=r===0?0:i/r;(r<i||l===1)&&(l=.99),e&&e({percent:Number(l.toFixed(2)),transferredBytes:i,totalBytes:r},c),s.enqueue(c),await a()}await a()}})})};var oi=t=>t!==null&&typeof t=="object";var is=(...t)=>{for(let e of t)if((!oi(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return gc({},...t)},dc=(t={},e={})=>{let r=new globalThis.Headers(t),i=e instanceof globalThis.Headers,s=new globalThis.Headers(e);for(let[n,a]of s.entries())i&&a==="undefined"||a===void 0?r.delete(n):r.set(n,a);return r};function En(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:gc(t[r]??[],e[r]??[])}var mc=(t={},e={})=>({beforeRequest:En(t,e,"beforeRequest"),beforeRetry:En(t,e,"beforeRetry"),afterResponse:En(t,e,"afterResponse"),beforeError:En(t,e,"beforeError")}),gc=(...t)=>{let e={},r={},i={};for(let s of t)if(Array.isArray(s))Array.isArray(e)||(e=[]),e=[...e,...s];else if(oi(s)){for(let[n,a]of Object.entries(s))oi(a)&&n in e&&(a=gc(e[n],a)),e={...e,[n]:a};oi(s.hooks)&&(i=mc(i,s.hooks),e.hooks=i),oi(s.headers)&&(r=dc(r,s.headers),e.headers=r)}return e};var ud=t=>vn.includes(t)?t.toUpperCase():t,DS=["get","put","head","delete","options","trace"],MS=[408,413,429,500,502,503,504],kS=[413,429,503],ld={limit:2,methods:DS,statusCodes:MS,afterStatusCodes:kS,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},hd=(t={})=>{if(typeof t=="number")return{...ld,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...ld,...t}};async function yc(t,e,r,i){return new Promise((s,n)=>{let a=setTimeout(()=>{r&&r.abort(),n(new ni(t))},i.timeout);i.fetch(t,e).then(s).catch(n).then(()=>{clearTimeout(a)})})}async function bc(t,{signal:e}){return new Promise((r,i)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",s,{once:!0}));function s(){clearTimeout(n),i(e.reason)}let n=setTimeout(()=>{e?.removeEventListener("abort",s),r()},t)})}var fd=(t,e)=>{let r={};for(let i in e)!(i in od)&&!(i in nd)&&!(i in t)&&(r[i]=e[i]);return r};var ss=class t{static create(e,r){let i=new t(e,r),s=async()=>{if(typeof i._options.timeout=="number"&&i._options.timeout>wn)throw new RangeError(`The \`timeout\` option cannot be greater than ${wn}`);await Promise.resolve();let o=await i._fetch();for(let c of i._options.hooks.afterResponse){let l=await c(i.request,i._options,i._decorateResponse(o.clone()));l instanceof globalThis.Response&&(o=l)}if(i._decorateResponse(o),!o.ok&&i._options.throwHttpErrors){let c=new rs(o,i.request,i._options);for(let l of i._options.hooks.beforeError)c=await l(c);throw c}if(i._options.onDownloadProgress){if(typeof i._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!td)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return ad(o.clone(),i._options.onDownloadProgress)}return o},a=(i._options.retry.methods.includes(i.request.method.toLowerCase())?i._retry(s):s()).finally(async()=>{i.request.bodyUsed||await i.request.body?.cancel()});for(let[o,c]of Object.entries(id))a[o]=async()=>{i.request.headers.set("accept",i.request.headers.get("accept")||c);let l=await a;if(o==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await l.text())}return l[o]()};return a}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:dc(this._input.headers,r.headers),hooks:mc({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:ud(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:hd(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(ed){let i=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=i?AbortSignal.any([i,this.abortController.signal]):this.abortController.signal}if(pc&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let s="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),n=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,s);(rd&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(n,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!pc)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=cd(this.request,this._options.onUploadProgress))}}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount>this._options.retry.limit||e instanceof ni)throw e;if(e instanceof rs){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;let i=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(i&&this._options.retry.afterStatusCodes.includes(e.response.status)){let s=Number(i)*1e3;Number.isNaN(s)?s=Date.parse(i)-Date.now():s>=Date.parse("2024-01-01")&&(s-=Date.now());let n=this._options.retry.maxRetryAfter??s;return s<n?s:n}if(e.response.status===413)throw e}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(r){let i=Math.min(this._calculateRetryDelay(r),wn);if(this._retryCount<1)throw r;await bc(i,{signal:this._options.signal});for(let s of this._options.hooks.beforeRetry)if(await s({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===xn)return;return this._retry(e)}}async _fetch(){for(let i of this._options.hooks.beforeRequest){let s=await i(this.request,this._options);if(s instanceof Request){this.request=s;break}if(s instanceof Response)return s}let e=fd(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):yc(r,e,this.abortController,this._options)}};var vc=t=>{let e=(r,i)=>ss.create(r,is(t,i));for(let r of vn)e[r]=(i,s)=>ss.create(i,is(t,s,{method:r}));return e.create=r=>vc(is(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),vc(is(t,r))),e.stop=xn,e},jS=vc(),pd=jS;var Dd=We(Nd(),1);function Sc(t){let e=(0,Dd.default)("npm",{registry:"https://registry.npmjs.org/"}),r=e[`${t}:registry`]||e.config_registry||e.registry;return r.slice(-1)==="/"?r:`${r}/`}var $m=We(Om(),1),Tm=We(oc(),1),Mc=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},kc=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function jc(t,e={}){let{version:r="latest"}=e,{omitDeprecated:i=!0}=e,s=t.split("/")[0],n=e.registryUrl??Sc(s),a=new URL(encodeURIComponent(t).replace(/^%40/,"@"),n),o=(0,$m.default)(n.toString(),{recursive:!0}),c={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};e.fullMetadata&&delete c.accept,o&&(c.authorization=`${o.type} ${o.token}`);let l;try{l=await pd(a,{headers:c,keepalive:!0}).json()}catch(d){throw d?.response?.status===404?new Mc(t):d}if(e.allVersions)return l;let u=new kc(t,r);if(l["dist-tags"][r]){let{time:d}=l;l=l.versions[l["dist-tags"][r]],l.time=d}else if(r){let d=!!l.versions[r];if(i&&!d)for(let[h,p]of Object.entries(l.versions))p.deprecated&&delete l.versions[h];if(!d){let h=Object.keys(l.versions);if(r=Tm.default.maxSatisfying(h,r),!r)throw u}let{time:g}=l;if(l=l.versions[r],l.time=g,!l)throw u}return l}async function Bc(t,e){let{version:r}=await jc(t.toLowerCase(),e);return r}function Ir(){let t=KR(import.meta.url?import.meta.url:__filename),e=VR(t),r=HR(e,"./package.json");try{let i=WR(r,"utf8");return JSON.parse(i).version}catch{return"0.0.0"}}async function Pm(){try{return await Bc("@wispbit/local")}catch{return Ir()}}var us=class t{config;apiKey=null;baseUrl=null;apiClient=null;llmProvider=null;constructor(e,r){this.config={...e,ignoredGlobs:e.ignoredGlobs||[]},this.apiKey=e.apiKey||null,this.baseUrl=e.baseUrl||null,this.apiKey&&this.baseUrl&&(this.apiClient=new ts({baseUrl:this.baseUrl,apiKey:this.apiKey})),r?.llmProvider&&(this.llmProvider=r.llmProvider)}getIgnoredGlobs(){return this.config.ignoredGlobs||[]}getApiKey(){return this.apiKey}getBaseUrl(){return this.baseUrl}getApiClient(){if(!this.apiClient)throw new Error("API client not initialized. Config must have both apiKey and baseUrl.");return this.apiClient}getLLMProvider(){if(!this.llmProvider)throw new Error("LLM provider not initialized. Use Config.initialize() instead of initializeLocal().");return this.llmProvider}getLocalVersion(){return Ir()}getSchemaVersion(){return"v1"}static initializeLocal(e={}){let r=e.ignoredGlobs||[];return new t({ignoredGlobs:r},{llmProvider:e.llmProvider})}static async initialize(e,{apiKey:r,baseUrl:i}){let s=i||process.env.WISPBIT_API_BASE_URL||"https://api.wispbit.com",n=r||process.env.WISPBIT_API_KEY||null;if(!n)return console.log("No API key found"),{failed:!0,error:"INVALID_API_KEY"};let a=await e.getRepositoryUrl(),c=await new ts({baseUrl:s,apiKey:n}).initialize({repository_url:a,powerlint_version:Ir(),schema_version:"v1"});if(c.invalid_api_key)return{failed:!0,error:"INVALID_API_KEY"};if(!c.is_valid_repository)return{failed:!0,error:"INVALID_REPOSITORY"};let l=c.config?.ignored_globs||[],u=new t({ignoredGlobs:l,apiKey:n,baseUrl:s},{});return u.llmProvider=new bn(u,e),u}isConfigured(){return this.getApiKey()!==null}};import{exec as XR,execSync as JR}from"child_process";import{existsSync as ZR,readFileSync as QR}from"fs";import{promisify as eC}from"util";import{createHash as YR}from"crypto";function hs(t){return YR("sha256").update(t).digest("hex")}var fe=eC(XR);function Fm(){return JR("git rev-parse --show-toplevel",{encoding:"utf-8"}).trim()}async function Nm(t){let{stdout:e}=await fe("git ls-files --ignored --exclude-standard --others",{cwd:t,maxBuffer:52428800});return e.split(`
|
|
41
|
-
`).filter(Boolean).map(r=>r.trim())}async function
|
|
42
|
-
`)[0].match(/a\/(.+?) b\//);if(a){let o=a[1];e.set(o,"diff --git "+
|
|
43
|
-
`),r=[],
|
|
44
|
-
`).trimEnd()}function
|
|
45
|
-
`).filter(Boolean);for(let
|
|
46
|
-
`).filter(Boolean);for(let
|
|
47
|
-
`).filter(Boolean);for(let
|
|
48
|
-
`),O=0,C=0;for(let $ of _)$.startsWith("+")&&!$.startsWith("+++")?O++:$.startsWith("-")&&!$.startsWith("---")&&C++;x.set(v.path,{additions:O,deletions:C})}let f=[];for(let v of h){let E=w.get(v.path)||"",_=x.get(v.path)||{additions:0,deletions:0},O=sC(v),C={filename:v.path,status:O,patch:E,additions:_.additions,deletions:_.deletions,sha:hs(E)};v.oldPath&&(C.oldFilename=v.oldPath),f.push(C)}return{files:f,currentBranch:n,currentCommit:o,diffBranch:l,diffCommit:c}}var pi=class{workspaceRoot;repositoryUrl;constructor(e){this.repositoryUrl=e?.repositoryUrl||null,this.workspaceRoot=e?.workspaceRoot||Fm()}getWorkspaceRoot(){return this.workspaceRoot}async getRepositoryUrl(e="origin"){if(this.repositoryUrl)return this.repositoryUrl;let r=await Dm(this.workspaceRoot,e);if(!r)throw new Error("Could not determine repository URL. Make sure you're in a Git repository with a remote origin.");return r}async getCurrentCommit(){return await Bm(this.workspaceRoot)}};import*as Me from"fs/promises";import HC from"os";import gi from"path";import{Buffer as Gm}from"buffer";var Dn=(t,e=!0)=>{if(t==null)return"null";if(typeof t=="string")return JSON.stringify(e&&t.startsWith(":")?`:${t}`:t);if(Gm.isBuffer(t))return JSON.stringify(`:base64:${t.toString("base64")}`);if(t?.toJSON&&(t=t.toJSON()),typeof t=="object"){let r="",i=Array.isArray(t);r=i?"[":"{";let s=!0;for(let n in t){let a=typeof t[n]=="function"||!i&&t[n]===void 0;!Object.hasOwn(t,n)||a||(s||(r+=","),s=!1,i?r+=Dn(t[n],e):t[n]!==void 0&&(r+=`${Dn(n,!1)}:${Dn(t[n],e)}`))}return r+=i?"]":"}",r}return JSON.stringify(t)},Wc=t=>Dn(t,!0),Vc=t=>JSON.parse(t,(e,r)=>typeof r=="string"?r.startsWith(":base64:")?Gm.from(r.slice(8),"base64"):r.startsWith(":")?r.slice(1):r:r);var oC=class{_eventListeners;_maxListeners;constructor(){this._eventListeners=new Map,this._maxListeners=100}maxListeners(){return this._maxListeners}addListener(t,e){this.on(t,e)}on(t,e){this._eventListeners.has(t)||this._eventListeners.set(t,[]);let r=this._eventListeners.get(t);return r&&(r.length>=this._maxListeners&&console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${r.length+1} ${t} listeners added. Use setMaxListeners() to increase limit.`),r.push(e)),this}removeListener(t,e){this.off(t,e)}off(t,e){let r=this._eventListeners.get(t)??[],i=r.indexOf(e);i!==-1&&r.splice(i,1),r.length===0&&this._eventListeners.delete(t)}once(t,e){let r=(...i)=>{e(...i),this.off(t,r)};this.on(t,r)}emit(t,...e){let r=this._eventListeners.get(t);if(r&&r.length>0)for(let i of r)i(...e)}listeners(t){return this._eventListeners.get(t)??[]}removeAllListeners(t){t?this._eventListeners.delete(t):this._eventListeners.clear()}setMaxListeners(t){this._maxListeners=t}},Hc=oC,aC=class extends Hc{_hookHandlers;constructor(){super(),this._hookHandlers=new Map}addHandler(t,e){let r=this._hookHandlers.get(t);r?r.push(e):this._hookHandlers.set(t,[e])}removeHandler(t,e){let r=this._hookHandlers.get(t);if(r){let i=r.indexOf(e);i!==-1&&r.splice(i,1)}}trigger(t,e){let r=this._hookHandlers.get(t);if(r)for(let i of r)try{i(e)}catch(s){this.emit("error",new Error(`Error in hook handler for event "${t}": ${s.message}`))}}get handlers(){return new Map(this._hookHandlers)}},cC=aC,lC=class extends Hc{enabled=!0;hits=0;misses=0;sets=0;deletes=0;errors=0;constructor(t){super(),t!==void 0&&(this.enabled=t),this.reset()}hit(){this.enabled&&this.hits++}miss(){this.enabled&&this.misses++}set(){this.enabled&&this.sets++}delete(){this.enabled&&this.deletes++}hitsOrMisses(t){for(let e of t)e===void 0?this.miss():this.hit()}reset(){this.hits=0,this.misses=0,this.sets=0,this.deletes=0,this.errors=0}},uC=lC;var zm=["sqlite","postgres","mysql","mongo","redis","valkey","etcd"],hC=class extends Hc{opts;iterator;hooks=new cC;stats=new uC(!1);_ttl;_namespace;_store=new Map;_serialize=Wc;_deserialize=Vc;_compression;_useKeyPrefix=!0;_throwOnErrors=!1;constructor(t,e){if(super(),e??={},t??={},this.opts={namespace:"keyv",serialize:Wc,deserialize:Vc,emitErrors:!0,store:new Map,...e},t&&t.get?this.opts.store=t:this.opts={...this.opts,...t},this._store=this.opts.store??new Map,this._compression=this.opts.compression,this._serialize=this.opts.serialize,this._deserialize=this.opts.deserialize,this.opts.namespace&&(this._namespace=this.opts.namespace),this._store){if(!this._isValidStorageAdapter(this._store))throw new Error("Invalid storage adapter");typeof this._store.on=="function"&&this._store.on("error",r=>this.emit("error",r)),this._store.namespace=this._namespace,typeof this._store[Symbol.iterator]=="function"&&this._store instanceof Map?this.iterator=this.generateIterator(this._store):"iterator"in this._store&&this._store.opts&&this._checkIterableAdapter()&&(this.iterator=this.generateIterator(this._store.iterator.bind(this._store)))}this.opts.stats&&(this.stats.enabled=this.opts.stats),this.opts.ttl&&(this._ttl=this.opts.ttl),this.opts.useKeyPrefix!==void 0&&(this._useKeyPrefix=this.opts.useKeyPrefix),this.opts.throwOnErrors!==void 0&&(this._throwOnErrors=this.opts.throwOnErrors)}get store(){return this._store}set store(t){if(this._isValidStorageAdapter(t))this._store=t,this.opts.store=t,typeof t.on=="function"&&t.on("error",e=>this.emit("error",e)),this._namespace&&(this._store.namespace=this._namespace),typeof t[Symbol.iterator]=="function"&&t instanceof Map?this.iterator=this.generateIterator(t):"iterator"in t&&t.opts&&this._checkIterableAdapter()&&(this.iterator=this.generateIterator(t.iterator?.bind(t)));else throw new Error("Invalid storage adapter")}get compression(){return this._compression}set compression(t){this._compression=t}get namespace(){return this._namespace}set namespace(t){this._namespace=t,this.opts.namespace=t,this._store.namespace=t,this.opts.store&&(this.opts.store.namespace=t)}get ttl(){return this._ttl}set ttl(t){this.opts.ttl=t,this._ttl=t}get serialize(){return this._serialize}set serialize(t){this.opts.serialize=t,this._serialize=t}get deserialize(){return this._deserialize}set deserialize(t){this.opts.deserialize=t,this._deserialize=t}get useKeyPrefix(){return this._useKeyPrefix}set useKeyPrefix(t){this._useKeyPrefix=t,this.opts.useKeyPrefix=t}get throwOnErrors(){return this._throwOnErrors}set throwOnErrors(t){this._throwOnErrors=t,this.opts.throwOnErrors=t}generateIterator(t){return async function*(){for await(let[r,i]of typeof t=="function"?t(this._store.namespace):t){let s=await this.deserializeData(i);if(!(this._useKeyPrefix&&this._store.namespace&&!r.includes(this._store.namespace))){if(typeof s.expires=="number"&&Date.now()>s.expires){this.delete(r);continue}yield[this._getKeyUnprefix(r),s.value]}}}.bind(this)}_checkIterableAdapter(){return zm.includes(this._store.opts.dialect)||zm.some(t=>this._store.opts.url.includes(t))}_getKeyPrefix(t){return!this._useKeyPrefix||!this._namespace?t:`${this._namespace}:${t}`}_getKeyPrefixArray(t){return!this._useKeyPrefix||!this._namespace?t:t.map(e=>`${this._namespace}:${e}`)}_getKeyUnprefix(t){return this._useKeyPrefix?t.split(":").splice(1).join(":"):t}_isValidStorageAdapter(t){return t instanceof Map||typeof t.get=="function"&&typeof t.set=="function"&&typeof t.delete=="function"&&typeof t.clear=="function"}async get(t,e){let{store:r}=this.opts,i=Array.isArray(t),s=i?this._getKeyPrefixArray(t):this._getKeyPrefix(t),n=c=>typeof c.expires=="number"&&Date.now()>c.expires;if(i)return e?.raw===!0?this.getMany(t,{raw:!0}):this.getMany(t,{raw:!1});this.hooks.trigger("preGet",{key:s});let a;try{a=await r.get(s)}catch(c){if(this.throwOnErrors)throw c}let o=typeof a=="string"||this.opts.compression?await this.deserializeData(a):a;if(o==null){this.stats.miss();return}if(n(o)){await this.delete(t),this.stats.miss();return}return this.hooks.trigger("postGet",{key:s,value:o}),this.stats.hit(),e?.raw?o:o.value}async getMany(t,e){let{store:r}=this.opts,i=this._getKeyPrefixArray(t),s=c=>typeof c.expires=="number"&&Date.now()>c.expires;if(this.hooks.trigger("preGetMany",{keys:i}),r.getMany===void 0){let c=i.map(async d=>{let g=await r.get(d),h=typeof g=="string"||this.opts.compression?await this.deserializeData(g):g;if(h!=null){if(s(h)){await this.delete(d);return}return e?.raw?h:h.value}}),u=(await Promise.allSettled(c)).map(d=>d.value);return this.hooks.trigger("postGetMany",u),u.length>0&&this.stats.hit(),u}let n=await r.getMany(i),a=[],o=[];for(let c in n){let l=n[c];if(typeof l=="string"&&(l=await this.deserializeData(l)),l==null){a.push(void 0);continue}if(s(l)){o.push(t[c]),a.push(void 0);continue}let u=e?.raw?l:l.value;a.push(u)}return o.length>0&&await this.deleteMany(o),this.hooks.trigger("postGetMany",a),a.length>0&&this.stats.hit(),a}async getRaw(t){let{store:e}=this.opts,r=this._getKeyPrefix(t);this.hooks.trigger("preGetRaw",{key:r});let i=await e.get(r);if(i==null){this.stats.miss();return}let s=typeof i=="string"||this.opts.compression?await this.deserializeData(i):i;if(s!==void 0&&s.expires!==void 0&&s.expires!==null&&s.expires<Date.now()){this.stats.miss(),await this.delete(t);return}return this.stats.hit(),this.hooks.trigger("postGetRaw",{key:r,value:s}),s}async getManyRaw(t){let{store:e}=this.opts,r=this._getKeyPrefixArray(t);if(t.length===0){let a=Array.from({length:t.length}).fill(void 0);return this.stats.misses+=t.length,this.hooks.trigger("postGetManyRaw",{keys:r,values:a}),a}let i=[];if(e.getMany===void 0){let a=r.map(async c=>{let l=await e.get(c);if(l!=null)return this.deserializeData(l)});i=(await Promise.allSettled(a)).map(c=>c.value)}else{let a=await e.getMany(r);for(let o of a)o!=null?i.push(await this.deserializeData(o)):i.push(void 0)}let s=[],n=a=>typeof a.expires=="number"&&Date.now()>a.expires;for(let[a,o]of i.entries())o!==void 0&&n(o)&&(s.push(r[a]),i[a]=void 0);return s.length>0&&await this.deleteMany(s),this.stats.hitsOrMisses(i),this.hooks.trigger("postGetManyRaw",{keys:r,values:i}),i}async set(t,e,r){let i={key:t,value:e,ttl:r};this.hooks.trigger("preSet",i);let s=this._getKeyPrefix(i.key);i.ttl??=this._ttl,i.ttl===0&&(i.ttl=void 0);let{store:n}=this.opts,a=typeof i.ttl=="number"?Date.now()+i.ttl:void 0;if(typeof i.value=="symbol")throw this.emit("error","symbol cannot be serialized"),new Error("symbol cannot be serialized");let o={value:i.value,expires:a},c=await this.serializeData(o),l=!0;try{let u=await n.set(s,c,i.ttl);typeof u=="boolean"&&(l=u)}catch(u){if(l=!1,this.emit("error",u),this._throwOnErrors)throw u}return this.hooks.trigger("postSet",{key:s,value:c,ttl:r}),this.stats.set(),l}async setMany(t){let e=[];try{if(this._store.setMany===void 0){let r=[];for(let s of t)r.push(this.set(s.key,s.value,s.ttl));e=await Promise.all(r)}else{let r=await Promise.all(t.map(async({key:i,value:s,ttl:n})=>{n??=this._ttl,n===0&&(n=void 0);let a=typeof n=="number"?Date.now()+n:void 0;if(typeof s=="symbol")throw this.emit("error","symbol cannot be serialized"),new Error("symbol cannot be serialized");let o={value:s,expires:a},c=await this.serializeData(o);return{key:this._getKeyPrefix(i),value:c,ttl:n}}));e=await this._store.setMany(r)}}catch(r){if(this.emit("error",r),this._throwOnErrors)throw r;e=t.map(()=>!1)}return e}async delete(t){let{store:e}=this.opts;if(Array.isArray(t))return this.deleteMany(t);let r=this._getKeyPrefix(t);this.hooks.trigger("preDelete",{key:r});let i=!0;try{let s=await e.delete(r);typeof s=="boolean"&&(i=s)}catch(s){if(i=!1,this.emit("error",s),this._throwOnErrors)throw s}return this.hooks.trigger("postDelete",{key:r,value:i}),this.stats.delete(),i}async deleteMany(t){try{let{store:e}=this.opts,r=this._getKeyPrefixArray(t);if(this.hooks.trigger("preDelete",{key:r}),e.deleteMany!==void 0)return await e.deleteMany(r);let i=r.map(async a=>e.delete(a)),n=(await Promise.all(i)).every(Boolean);return this.hooks.trigger("postDelete",{key:r,value:n}),n}catch(e){if(this.emit("error",e),this._throwOnErrors)throw e;return!1}}async clear(){this.emit("clear");let{store:t}=this.opts;try{await t.clear()}catch(e){if(this.emit("error",e),this._throwOnErrors)throw e}}async has(t){if(Array.isArray(t))return this.hasMany(t);let e=this._getKeyPrefix(t),{store:r}=this.opts;if(r.has!==void 0&&!(r instanceof Map))return r.has(e);let i;try{i=await r.get(e)}catch(s){if(this.emit("error",s),this._throwOnErrors)throw s;return!1}if(i){let s=await this.deserializeData(i);if(s)return s.expires===void 0||s.expires===null?!0:s.expires>Date.now()}return!1}async hasMany(t){let e=this._getKeyPrefixArray(t),{store:r}=this.opts;if(r.hasMany!==void 0)return r.hasMany(e);let i=[];for(let s of t)i.push(await this.has(s));return i}async disconnect(){let{store:t}=this.opts;if(this.emit("disconnect"),typeof t.disconnect=="function")return t.disconnect()}emit(t,...e){t==="error"&&!this.opts.emitErrors||super.emit(t,...e)}async serializeData(t){return this._serialize?this._compression?.compress?this._serialize({value:await this._compression.compress(t.value),expires:t.expires}):this._serialize(t):t}async deserializeData(t){if(!this._deserialize)return t;if(this._compression?.decompress&&typeof t=="string"){let e=await this._deserialize(t);return{value:await this._compression.decompress(e?.value),expires:e?.expires}}if(typeof t=="string")return this._deserialize(t)}},qm=hC;var Sg=We(_g(),1);var zn=class{environment;cacheStore;constructor(e){this.environment=e}getStorageDirectory(){return gi.join(HC.homedir(),".powerlint")}getIndexDirectory(){return gi.join(this.getStorageDirectory(),"indexes",hs(this.environment.getWorkspaceRoot()))}getCacheDirectory(){return gi.join(this.getStorageDirectory(),"cache",hs(this.environment.getWorkspaceRoot()))}async ensureDirectory(e){await Me.mkdir(e,{recursive:!0})}async getIndexFilePath(e,r){let i=this.getIndexDirectory();await this.ensureDirectory(i);let s=r||`${e.toLowerCase()}-index.scip`;return gi.join(i,`${e.toLowerCase()}-${s}`)}async indexExists(e,r){let i=await this.getIndexFilePath(e,r);try{return await Me.access(i),!0}catch{return!1}}async readIndex(e,r){let i=await this.getIndexFilePath(e,r);try{return await Me.access(i),await Me.readFile(i)}catch{return null}}async saveIndex(e,r,i){let s=await this.getIndexFilePath(e,i);await Me.writeFile(s,r)}getCacheFilePath(){return gi.join(this.getCacheDirectory(),"cache.json")}async purgeStorage(){let e=0,r=this.getStorageDirectory();try{await Me.access(r),await Me.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}async purgeCache(){let e=0,r=this.getCacheDirectory();try{await Me.access(r),await Me.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}getCacheStore(){if(!this.cacheStore){let e=this.getCacheDirectory();this.cacheStore=new qm({store:new Sg.KeyvFile({filename:gi.join(e,"cache.json")})})}return this.cacheStore}async saveCache(e,r,i){let s=this.getCacheStore(),n=`${e}:${r}`;await s.set(n,i)}async readCache(e,r){let i=this.getCacheStore(),s=`${e}:${r}`;return await i.get(s)||null}async purgeIndexes(){let e=0,r=this.getIndexDirectory();try{await Me.access(r),await Me.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}};var ds=class{config;environment;constructor(e,r){this.config=e,this.environment=r}async getRepositoryUrl(){let e=await this.environment.getRepositoryUrl();if(!e)throw new Error("Could not determine repository URL. Make sure you're in a Git repository with a remote origin.");return e}async loadRuleById(e){let r=await this.fetchRules([e]);if(r.length===0)throw new Error(`Rule with ID '${e}' not found`);return r[0]}async loadAllRules(){return await this.fetchRules()}async fetchRules(e){let r=await this.getRepositoryUrl();return(await this.config.getApiClient().getRules({repository_url:r,rule_ids:e,schema_version:this.config.getSchemaVersion(),powerlint_version:this.config.getLocalVersion()})).rules.map(n=>({id:n.id,internalId:n.internalId,internalVersionId:n.internalVersionId,config:{message:n.message,severity:n.severity,execution:n.execution||"llm",steps:n.schema},prompt:n.prompt,testCases:[]}))}};import{EventEmitter as KC}from"events";var nt=class extends KC{rulesStartTime=0;indexingStartTimes=new Map;fileDiscoveryStartTime=0;constructor(){super(),this.setMaxListeners(20)}emit(e,r){return super.emit(e,r)}on(e,r){return super.on(e,r)}once(e,r){return super.once(e,r)}off(e,r){return super.off(e,r)}setExecutionMode(e,r){this.emit("execution:mode",{mode:e,...r})}startRules(e){this.rulesStartTime=Date.now(),this.emit("rules:start",{totalRules:e})}progressRule(e,r,i,s){let n=Math.round(e/r*100);this.emit("rules:progress",{currentRule:e,totalRules:r,ruleId:i,percentage:n,isLlm:s})}completeRules(e,r){let i=Date.now()-this.rulesStartTime;this.emit("rules:complete",{totalRules:e,totalMatches:r,executionTime:i})}startFileDiscovery(e){this.fileDiscoveryStartTime=Date.now(),this.emit("files:discovery:start",{mode:e})}fileDiscoveryProgress(e,r){this.emit("files:discovery:progress",{message:e,currentCount:r})}completeFileDiscovery(e,r){let i=Date.now()-this.fileDiscoveryStartTime;this.emit("files:discovery:complete",{totalFiles:e,mode:r,executionTime:i})}fileFilter(e,r,i){this.emit("files:filter",{originalCount:e,filteredCount:r,filterType:i})}startScipMatchLookup(e,r){this.emit("scip:match-lookup:start",{language:e,match:r})}scipMatchLookupProgress(e,r){this.emit("scip:match-lookup:progress",{language:e,document:r})}scipMatchLookupComplete(e,r){this.emit("scip:match-lookup:complete",{language:e,document:r})}startIndexing(e){this.indexingStartTimes.set(e,Date.now()),this.emit("indexing:start",{language:e})}indexingProgress(e,r,i,s){this.emit("indexing:progress",{language:e,message:r,packageName:i,timeMs:s})}completeIndexing(e){let r=this.indexingStartTimes.get(e)||Date.now(),i=Date.now()-r;this.indexingStartTimes.delete(e),this.emit("indexing:complete",{language:e,executionTime:i})}startStep(e,r,i,s,n){this.emit("step:start",{ruleId:e,stepName:r,stepType:i,inputs:s,parentStepName:n})}completeStep(e,r,i,s,n=0,a){this.emit("step:complete",{ruleId:e,stepName:r,stepType:i,outputs:s,executionTime:n,parentStepName:a})}startTest(e,r){this.emit("test:start",{ruleId:e,testName:r})}testMatches(e,r,i){this.emit("test:matches",{ruleId:e,testName:r,matches:i})}completeTest(e,r,i,s){this.emit("test:complete",{ruleId:e,testName:r,matches:i,stepExecutions:s})}startLLMValidation(e,r,i){this.emit("llm:validation:start",{ruleId:e,matchCount:r,estimatedCost:i})}llmValidationProgress(e,r,i,s){this.emit("llm:validation:progress",{ruleId:e,tokenCount:r,elapsedTime:i,streamedText:s})}completeLLMValidation(e,r,i,s,n,a,o,c){this.emit("llm:validation:complete",{ruleId:e,tokenCount:r,inputTokens:i,outputTokens:s,cost:n,executionTime:a,violationCount:o,fromCache:c})}llmToolExecution(e,r,i){this.emit("llm:tool-execution",{ruleId:e,toolName:r,...i})}startLLMValidationPhase(e,r){this.emit("llm:validation-phase:start",{ruleId:e,matchCount:r})}};import{cpus as KO}from"os";var Cg=We(Xc(),1);import{existsSync as rA}from"fs";import Fr from"path";import{fileURLToPath as iA}from"url";console.debug=()=>{};var sA=iA(import.meta.url),Jc=Fr.dirname(sA),nA={darwin:"macOS",linux:"Linux",win32:"Windows"},oA={x64:"X64",arm64:"ARM64"};function he(t){let e=nA[process.platform],r=oA[process.arch];if(!e||!r)return;let i=[Fr.join(Jc,"powerlint/dist/vendor"),Fr.join(Jc,"../dist/vendor"),Fr.join(Jc,"./vendor")];for(let s of i){let n=Fr.join(s,`ast-grep-lang-${t}`),a=Fr.join(n,"prebuilds",`prebuild-${e}-${r}`,"parser.so");if(rA(a))return a}throw new Error(`Prebuild not found for ${t} on ${e} ${r}. Paths tried: ${i.join(", ")}`)}var aA={libraryPath:he("angular"),extensions:["html"],languageSymbol:"tree_sitter_angular",expandoChar:"z"},cA={libraryPath:he("bash"),extensions:["bash","bats","cgi","command","env","fcgi","ksh","sh","tmux","tool","zsh"],languageSymbol:"tree_sitter_bash",expandoChar:"$"},lA={libraryPath:he("c"),extensions:["c","h"],languageSymbol:"tree_sitter_c",expandoChar:"_"},uA={libraryPath:he("cpp"),extensions:["cc","hpp","cpp","hh","cxx","cu","ino"],languageSymbol:"tree_sitter_cpp",expandoChar:"_"},hA={libraryPath:he("csharp"),extensions:["cs"],languageSymbol:"tree_sitter_c_sharp",expandoChar:"\xB5"},fA={libraryPath:he("css"),extensions:["css","scss"],languageSymbol:"tree_sitter_css",expandoChar:"$"},pA={libraryPath:he("dart"),extensions:["dart"],languageSymbol:"tree_sitter_dart",expandoChar:"$"},dA={libraryPath:he("elixir"),extensions:["ex","exs"],languageSymbol:"tree_sitter_elixir",expandoChar:"\xB5"},mA={libraryPath:he("go"),extensions:["go"],languageSymbol:"tree_sitter_go",expandoChar:"\xB5"},gA={libraryPath:he("haskell"),extensions:["hs"],languageSymbol:"tree_sitter_haskell",expandoChar:"\xB5"},yA={libraryPath:he("html"),extensions:["html","htm","xhtml"],languageSymbol:"tree_sitter_html",expandoChar:"z"},bA={libraryPath:he("java"),extensions:["java"],languageSymbol:"tree_sitter_java",expandoChar:"$"},vA={libraryPath:he("javascript"),extensions:["cjs","js","mjs","jsx"],languageSymbol:"tree_sitter_javascript",expandoChar:"$"},wA={libraryPath:he("json"),extensions:["json"],languageSymbol:"tree_sitter_json",expandoChar:"$"},xA={libraryPath:he("kotlin"),extensions:["kt","ktm","kts"],languageSymbol:"tree_sitter_kotlin",expandoChar:"\xB5"},EA={libraryPath:he("lua"),extensions:["lua"],languageSymbol:"tree_sitter_lua",expandoChar:"$"},_A={libraryPath:he("markdown"),extensions:["md"],languageSymbol:"tree_sitter_markdown",expandoChar:"$"},SA={libraryPath:he("php"),extensions:["php"],languageSymbol:"tree_sitter_php",expandoChar:"$"},RA={libraryPath:he("python"),extensions:["py"],languageSymbol:"tree_sitter_python",expandoChar:"\xB5"},CA={libraryPath:he("ruby"),extensions:["rb","rbw","gemspec"],languageSymbol:"tree_sitter_ruby",expandoChar:"\xB5"},AA={libraryPath:he("rust"),extensions:["rs"],languageSymbol:"tree_sitter_rust",expandoChar:"\xB5"},LA={libraryPath:he("scala"),extensions:["scala","sc","sbt"],languageSymbol:"tree_sitter_scala",expandoChar:"$"},OA={libraryPath:he("sql"),extensions:["sql"],languageSymbol:"tree_sitter_sql",expandoChar:"_"},$A={libraryPath:he("swift"),extensions:["swift"],languageSymbol:"tree_sitter_swift",expandoChar:"\xB5"},TA={libraryPath:he("toml"),extensions:["toml"],languageSymbol:"tree_sitter_toml",expandoChar:"_"},PA={libraryPath:he("tsx"),extensions:["tsx"],languageSymbol:"tree_sitter_tsx",expandoChar:"$"},IA={libraryPath:he("typescript"),extensions:["ts","cts","mts"],languageSymbol:"tree_sitter_typescript",expandoChar:"$"},FA={libraryPath:he("yaml"),extensions:["yaml","yml"],languageSymbol:"tree_sitter_yaml",expandoChar:"$"},Ag={Angular:aA,Bash:cA,C:lA,Cpp:uA,Csharp:hA,Css:fA,Dart:pA,Elixir:dA,Go:mA,Haskell:gA,Html:yA,Java:bA,JavaScript:vA,Json:wA,Kotlin:xA,Lua:EA,Markdown:_A,Php:SA,Python:RA,Ruby:CA,Rust:AA,Scala:LA,Sql:OA,Swift:$A,Toml:TA,Tsx:PA,TypeScript:IA,Yaml:FA};(0,Cg.registerDynamicLanguage)(Ag);var Rg=Object.entries(Ag).reduce((t,[e,r])=>(t[e]=r.extensions??[],t),{});function Wn(t){let e=Fr.extname(t).slice(1);return NA(e)??"Unknown"}function NA(t){return Object.keys(Rg).find(e=>Rg[e].includes(t))}import*as Oi from"fs";import*as jt from"path";var Kg=We(Bg(),1);var gs=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var zA={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},ys=t=>t.replace(/[[\]\\-]/g,"\\$&"),qA=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ug=t=>t.join(""),Gg=(t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let i=[],s=[],n=r+1,a=!1,o=!1,c=!1,l=!1,u=r,d="";e:for(;n<t.length;){let m=t.charAt(n);if((m==="!"||m==="^")&&n===r+1){l=!0,n++;continue}if(m==="]"&&a&&!c){u=n+1;break}if(a=!0,m==="\\"&&!c){c=!0,n++;continue}if(m==="["&&!c){for(let[y,[b,w,x]]of Object.entries(zA))if(t.startsWith(y,n)){if(d)return["$.",!1,t.length-r,!0];n+=y.length,x?s.push(b):i.push(b),o=o||w;continue e}}if(c=!1,d){m>d?i.push(ys(d)+"-"+ys(m)):m===d&&i.push(ys(m)),d="",n++;continue}if(t.startsWith("-]",n+1)){i.push(ys(m+"-")),n+=2;continue}if(t.startsWith("-",n+1)){d=m,n+=2;continue}i.push(ys(m)),n++}if(u<n)return["",!1,0,!1];if(!i.length&&!s.length)return["$.",!1,t.length-r,!0];if(s.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!l){let m=i[0].length===2?i[0].slice(-1):i[0];return[qA(m),!1,u-r,!1]}let g="["+(l?"^":"")+Ug(i)+"]",h="["+(l?"":"^")+Ug(s)+"]";return[i.length&&s.length?"("+g+"|"+h+")":i.length?g:h,o,u-r,!0]};var dt=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var WA=new Set(["!","?","+","*","@"]),zg=t=>WA.has(t),VA="(?!(?:^|/)\\.\\.?(?:$|/))",Vn="(?!\\.)",HA=new Set(["[","."]),KA=new Set(["..","."]),YA=new Set("().*{}+?[]^$\\!"),XA=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),el="[^/]",qg=el+"*?",Wg=el+"+?",yi=class t{type;#t;#r;#e=!1;#n=[];#h;#w;#a;#u=!1;#s;#c;#i=!1;constructor(e,r,i={}){this.type=e,e&&(this.#r=!0),this.#h=r,this.#t=this.#h?this.#h.#t:this,this.#s=this.#t===this?i:this.#t.#s,this.#a=this.#t===this?[]:this.#t.#a,e==="!"&&!this.#t.#u&&this.#a.push(this),this.#w=this.#h?this.#h.#n.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#n)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#n.map(e=>String(e)).join("|")+")":this.#c=this.#n.map(e=>String(e)).join("")}#l(){if(this!==this.#t)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#a.pop();){if(e.type!=="!")continue;let r=e,i=r.#h;for(;i;){for(let s=r.#w+1;!i.type&&s<i.#n.length;s++)for(let n of e.#n){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(i.#n[s])}r=i,i=r.#h}}return this}push(...e){for(let r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof t&&r.#h===this))throw new Error("invalid part: "+r);this.#n.push(r)}}toJSON(){let e=this.type===null?this.#n.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#n.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#u&&this.#h?.type==="!")&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#h?.isStart())return!1;if(this.#w===0)return!0;let e=this.#h;for(let r=0;r<this.#w;r++){let i=e.#n[r];if(!(i instanceof t&&i.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#h?.type==="!")return!0;if(!this.#h?.isEnd())return!1;if(!this.type)return this.#h?.isEnd();let e=this.#h?this.#h.#n.length:0;return this.#w===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let r=new t(this.type,e);for(let i of this.#n)r.copyIn(i);return r}static#o(e,r,i,s){let n=!1,a=!1,o=-1,c=!1;if(r.type===null){let h=i,p="";for(;h<e.length;){let m=e.charAt(h++);if(n||m==="\\"){n=!n,p+=m;continue}if(a){h===o+1?(m==="^"||m==="!")&&(c=!0):m==="]"&&!(h===o+2&&c)&&(a=!1),p+=m;continue}else if(m==="["){a=!0,o=h,c=!1,p+=m;continue}if(!s.noext&&zg(m)&&e.charAt(h)==="("){r.push(p),p="";let y=new t(m,r);h=t.#o(e,y,h,s),r.push(y);continue}p+=m}return r.push(p),h}let l=i+1,u=new t(null,r),d=[],g="";for(;l<e.length;){let h=e.charAt(l++);if(n||h==="\\"){n=!n,g+=h;continue}if(a){l===o+1?(h==="^"||h==="!")&&(c=!0):h==="]"&&!(l===o+2&&c)&&(a=!1),g+=h;continue}else if(h==="["){a=!0,o=l,c=!1,g+=h;continue}if(zg(h)&&e.charAt(l)==="("){u.push(g),g="";let p=new t(h,u);u.push(p),l=t.#o(e,p,l,s);continue}if(h==="|"){u.push(g),g="",d.push(u),u=new t(null,r);continue}if(h===")")return g===""&&r.#n.length===0&&(r.#i=!0),u.push(g),g="",r.push(...d,u),l;g+=h}return r.type=null,r.#r=void 0,r.#n=[e.substring(i-1)],l}static fromGlob(e,r={}){let i=new t(null,void 0,r);return t.#o(e,i,0,r),i}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[r,i,s,n]=this.toRegExpSource();if(!(s||this.#r||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return i;let o=(this.#s.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${r}$`,o),{_src:r,_glob:e})}get options(){return this.#s}toRegExpSource(e){let r=e??!!this.#s.dot;if(this.#t===this&&this.#l(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#n.map(h=>{let[p,m,y,b]=typeof h=="string"?t.#g(h,this.#r,c):h.toRegExpSource(e);return this.#r=this.#r||y,this.#e=this.#e||b,p}).join(""),u="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&KA.has(this.#n[0]))){let p=HA,m=r&&p.has(l.charAt(0))||l.startsWith("\\.")&&p.has(l.charAt(2))||l.startsWith("\\.\\.")&&p.has(l.charAt(4)),y=!r&&!e&&p.has(l.charAt(0));u=m?VA:y?Vn:""}let d="";return this.isEnd()&&this.#t.#u&&this.#h?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,dt(l),this.#r=!!this.#r,this.#e]}let i=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#d(r);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let c=this.toString();return this.#n=[c],this.type=null,this.#r=void 0,[c,dt(this.toString()),!1,!1]}let a=!i||e||r||!Vn?"":this.#d(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let o="";if(this.type==="!"&&this.#i)o=(this.isStart()&&!r?Vn:"")+Wg;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!e?Vn:"")+qg+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=s+n+c}return[o,dt(n),this.#r=!!this.#r,this.#e]}#d(e){return this.#n.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[i,s,n,a]=r.toRegExpSource(e);return this.#e=this.#e||a,i}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#g(e,r,i=!1){let s=!1,n="",a=!1;for(let o=0;o<e.length;o++){let c=e.charAt(o);if(s){s=!1,n+=(YA.has(c)?"\\":"")+c;continue}if(c==="\\"){o===e.length-1?n+="\\\\":s=!0;continue}if(c==="["){let[l,u,d,g]=Gg(e,o);if(d){n+=l,a=a||u,o+=d-1,r=r||g;continue}}if(c==="*"){i&&e==="*"?n+=Wg:n+=qg,r=!0;continue}if(c==="?"){n+=el,r=!0;continue}n+=XA(c)}return[n,dt(e),!!r,a]}};var bi=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var ze=(t,e,r={})=>(gs(e),!r.nocomment&&e.charAt(0)==="#"?!1:new Ye(e,r).match(t)),JA=/^\*+([^+@!?\*\[\(]*)$/,ZA=t=>e=>!e.startsWith(".")&&e.endsWith(t),QA=t=>e=>e.endsWith(t),eL=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),tL=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),rL=/^\*+\.\*+$/,iL=t=>!t.startsWith(".")&&t.includes("."),sL=t=>t!=="."&&t!==".."&&t.includes("."),nL=/^\.\*+$/,oL=t=>t!=="."&&t!==".."&&t.startsWith("."),aL=/^\*+$/,cL=t=>t.length!==0&&!t.startsWith("."),lL=t=>t.length!==0&&t!=="."&&t!=="..",uL=/^\?+([^+@!?\*\[\(]*)?$/,hL=([t,e=""])=>{let r=Yg([t]);return e?(e=e.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(e)):r},fL=([t,e=""])=>{let r=Xg([t]);return e?(e=e.toLowerCase(),i=>r(i)&&i.toLowerCase().endsWith(e)):r},pL=([t,e=""])=>{let r=Xg([t]);return e?i=>r(i)&&i.endsWith(e):r},dL=([t,e=""])=>{let r=Yg([t]);return e?i=>r(i)&&i.endsWith(e):r},Yg=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},Xg=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},Jg=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Vg={win32:{sep:"\\"},posix:{sep:"/"}},mL=Jg==="win32"?Vg.win32.sep:Vg.posix.sep;ze.sep=mL;var Pe=Symbol("globstar **");ze.GLOBSTAR=Pe;var gL="[^/]",yL=gL+"*?",bL="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",vL="(?:(?!(?:\\/|^)\\.).)*?",wL=(t,e={})=>r=>ze(r,t,e);ze.filter=wL;var ot=(t,e={})=>Object.assign({},t,e),xL=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return ze;let e=ze;return Object.assign((i,s,n={})=>e(i,s,ot(t,n)),{Minimatch:class extends e.Minimatch{constructor(s,n={}){super(s,ot(t,n))}static defaults(s){return e.defaults(ot(t,s)).Minimatch}},AST:class extends e.AST{constructor(s,n,a={}){super(s,n,ot(t,a))}static fromGlob(s,n={}){return e.AST.fromGlob(s,ot(t,n))}},unescape:(i,s={})=>e.unescape(i,ot(t,s)),escape:(i,s={})=>e.escape(i,ot(t,s)),filter:(i,s={})=>e.filter(i,ot(t,s)),defaults:i=>e.defaults(ot(t,i)),makeRe:(i,s={})=>e.makeRe(i,ot(t,s)),braceExpand:(i,s={})=>e.braceExpand(i,ot(t,s)),match:(i,s,n={})=>e.match(i,s,ot(t,n)),sep:e.sep,GLOBSTAR:Pe})};ze.defaults=xL;var Zg=(t,e={})=>(gs(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,Kg.default)(t));ze.braceExpand=Zg;var EL=(t,e={})=>new Ye(t,e).makeRe();ze.makeRe=EL;var _L=(t,e,r={})=>{let i=new Ye(e,r);return t=t.filter(s=>i.match(s)),i.options.nonull&&!t.length&&t.push(e),t};ze.match=_L;var Hg=/[?*]|[+@!]\(.*?\)|\[|\]/,SL=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ye=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,r={}){gs(e),r=r||{},this.options=r,this.pattern=e,this.platform=r.platform||Jg,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...n)=>console.error(...n)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let s=this.globParts.map((n,a,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=n[0]===""&&n[1]===""&&(n[2]==="?"||!Hg.test(n[2]))&&!Hg.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(c)return[...n.slice(0,4),...n.slice(4).map(u=>this.parse(u))];if(l)return[n[0],...n.slice(1).map(u=>this.parse(u))]}return n.map(c=>this.parse(c))});if(this.debug(this.pattern,s),this.set=s.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let a=this.set[n];a[0]===""&&a[1]===""&&this.globParts[n][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let i=0;i<e.length;i++)for(let s=0;s<e[i].length;s++)e[i][s]==="**"&&(e[i][s]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let s=i;for(;r[s+1]==="**";)s++;s!==i&&r.splice(i,s-i)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((i,s)=>{let n=i[i.length-1];return s==="**"&&n==="**"?i:s===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(i.pop(),i):(i.push(s),i)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let n=e[s];s===1&&n===""&&e[0]===""||(n==="."||n==="")&&(r=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let s=e[i-1];s&&s!=="."&&s!==".."&&s!=="**"&&(r=!0,e.splice(i-1,2),i-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let i of e){let s=-1;for(;(s=i.indexOf("**",s+1))!==-1;){let a=s;for(;i[a+1]==="**";)a++;a>s&&i.splice(s+1,a-s);let o=i[s+1],c=i[s+2],l=i[s+3];if(o!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;r=!0,i.splice(s,1);let u=i.slice(0);u[s]="**",e.push(u),s--}if(!this.preserveMultipleSlashes){for(let a=1;a<i.length-1;a++){let o=i[a];a===1&&o===""&&i[0]===""||(o==="."||o==="")&&(r=!0,i.splice(a,1),a--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(r=!0,i.pop())}let n=0;for(;(n=i.indexOf("..",n+1))!==-1;){let a=i[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){r=!0;let c=n===1&&i[n+1]==="**"?["."]:[];i.splice(n-1,2,...c),i.length===0&&i.push(""),n-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let i=r+1;i<e.length;i++){let s=this.partsMatch(e[r],e[i],!this.preserveMultipleSlashes);if(s){e[r]=[],e[i]=s;break}}return e.filter(r=>r.length)}partsMatch(e,r,i=!1){let s=0,n=0,a=[],o="";for(;s<e.length&&n<r.length;)if(e[s]===r[n])a.push(o==="b"?r[n]:e[s]),s++,n++;else if(i&&e[s]==="**"&&r[n]===e[s+1])a.push(e[s]),s++;else if(i&&r[n]==="**"&&e[s]===r[n+1])a.push(r[n]),n++;else if(e[s]==="*"&&r[n]&&(this.options.dot||!r[n].startsWith("."))&&r[n]!=="**"){if(o==="b")return!1;o="a",a.push(e[s]),s++,n++}else if(r[n]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(o==="a")return!1;o="b",a.push(r[n]),s++,n++}else return!1;return e.length===r.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,i=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)r=!r,i++;i&&(this.pattern=e.slice(i)),this.negate=r}matchOne(e,r,i=!1){let s=this.options;if(this.isWindows){let m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),y=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),b=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),w=!b&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),x=y?3:m?0:void 0,f=w?3:b?0:void 0;if(typeof x=="number"&&typeof f=="number"){let[v,E]=[e[x],r[f]];v.toLowerCase()===E.toLowerCase()&&(r[f]=v,f>x?r=r.slice(f):x>f&&(e=e.slice(x)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:r}),this.debug("matchOne",e.length,r.length);for(var a=0,o=0,c=e.length,l=r.length;a<c&&o<l;a++,o++){this.debug("matchOne loop");var u=r[o],d=e[a];if(this.debug(r,u,d),u===!1)return!1;if(u===Pe){this.debug("GLOBSTAR",[r,u,d]);var g=a,h=o+1;if(h===l){for(this.debug("** at the end");a<c;a++)if(e[a]==="."||e[a]===".."||!s.dot&&e[a].charAt(0)===".")return!1;return!0}for(;g<c;){var p=e[g];if(this.debug(`
|
|
49
|
-
globstar while`,e,g,r,
|
|
50
|
-
>>> no match, partial?`,e,g,r,h),g===c))}let m;if(typeof u=="string"?(m=d===u,this.debug("string match",u,d,m)):(m=u.test(d),this.debug("pattern match",u,d,m)),!m)return!1}if(a===c&&o===l)return!0;if(a===c)return i;if(o===l)return a===c-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return Zg(this.pattern,this.options)}parse(e){gs(e);let r=this.options;if(e==="**")return Pe;if(e==="")return"";let i,s=null;(i=e.match(aL))?s=r.dot?lL:cL:(i=e.match(JA))?s=(r.nocase?r.dot?tL:eL:r.dot?QA:ZA)(i[1]):(i=e.match(uL))?s=(r.nocase?r.dot?fL:hL:r.dot?pL:dL)(i):(i=e.match(rL))?s=r.dot?sL:iL:(i=e.match(nL))&&(s=oL);let n=yi.fromGlob(e,this.options).toMMPattern();return s&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:s}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,i=r.noglobstar?yL:r.dot?bL:vL,s=new Set(r.nocase?["i"]:[]),n=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let d of u.flags.split(""))s.add(d);return typeof u=="string"?SL(u):u===Pe?Pe:u._src});return l.forEach((u,d)=>{let g=l[d+1],h=l[d-1];u!==Pe||h===Pe||(h===void 0?g!==void 0&&g!==Pe?l[d+1]="(?:\\/|"+i+"\\/)?"+g:l[d]=i:g===void 0?l[d-1]=h+"(?:\\/|"+i+")?":g!==Pe&&(l[d-1]=h+"(?:\\/|\\/"+i+"\\/)"+g,l[d+1]=Pe))}),l.filter(u=>u!==Pe).join("/")}).join("|"),[a,o]=e.length>1?["(?:",")"]:["",""];n="^"+a+n+o+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let n=this.set;this.debug(this.pattern,"set",n);let a=s[s.length-1];if(!a)for(let o=s.length-2;!a&&o>=0;o--)a=s[o];for(let o=0;o<n.length;o++){let c=n[o],l=s;if(i.matchBase&&c.length===1&&(l=[a]),this.matchOne(l,c,r))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return ze.defaults(e).Minimatch}};ze.AST=yi;ze.Minimatch=Ye;ze.escape=bi;ze.unescape=dt;import{fileURLToPath as rO}from"node:url";var vi=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,e0=new Set,tl=typeof process=="object"&&process?process:{},t0=(t,e,r,i)=>{typeof tl.emitWarning=="function"?tl.emitWarning(t,e,r,i):console.error(`[${r}] ${e}: ${t}`)},Hn=globalThis.AbortController,Qg=globalThis.AbortSignal;if(typeof Hn>"u"){Qg=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,s){this._onabort.push(s)}},Hn=class{constructor(){e()}signal=new Qg;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i)}}};let t=tl.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,t0("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var RL=t=>!e0.has(t),CF=Symbol("type"),Yt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),r0=t=>Yt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?wi:null:null,wi=class extends Array{constructor(e){super(e),this.fill(0)}},rl=class t{heap;length;static#t=!1;static create(e){let r=r0(e);if(!r)return[];t.#t=!0;let i=new t(e,r);return t.#t=!1,i}constructor(e,r){if(!t.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},bs=class t{#t;#r;#e;#n;#h;#w;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#u;#s;#c;#i;#l;#o;#d;#g;#y;#p;#C;#x;#E;#_;#S;#v;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#E,sizes:e.#C,keyMap:e.#s,keyList:e.#c,valList:e.#i,next:e.#l,prev:e.#o,get head(){return e.#d},get tail(){return e.#g},free:e.#y,isBackgroundFetch:r=>e.#m(r),backgroundFetch:(r,i,s,n)=>e.#F(r,i,s,n),moveToTail:r=>e.#D(r),indexes:r=>e.#L(r),rindexes:r=>e.#$(r),isStale:r=>e.#R(r)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#u}get size(){return this.#a}get fetchMethod(){return this.#h}get memoMethod(){return this.#w}get dispose(){return this.#e}get disposeAfter(){return this.#n}constructor(e){let{max:r=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:o,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:d,noUpdateTTL:g,maxSize:h=0,maxEntrySize:p=0,sizeCalculation:m,fetchMethod:y,memoMethod:b,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:x,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:v,ignoreFetchAbort:E}=e;if(r!==0&&!Yt(r))throw new TypeError("max option must be a nonnegative integer");let _=r?r0(r):Array;if(!_)throw new Error("invalid max value: "+r);if(this.#t=r,this.#r=h,this.maxEntrySize=p||this.#r,this.sizeCalculation=m,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(b!==void 0&&typeof b!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#w=b,y!==void 0&&typeof y!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#h=y,this.#S=!!y,this.#s=new Map,this.#c=new Array(r).fill(void 0),this.#i=new Array(r).fill(void 0),this.#l=new _(r),this.#o=new _(r),this.#d=0,this.#g=0,this.#y=rl.create(r),this.#a=0,this.#u=0,typeof l=="function"&&(this.#e=l),typeof u=="function"?(this.#n=u,this.#p=[]):(this.#n=void 0,this.#p=void 0),this.#_=!!this.#e,this.#v=!!this.#n,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!w,this.allowStaleOnFetchRejection=!!f,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!E,this.maxEntrySize!==0){if(this.#r!==0&&!Yt(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!Yt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#I()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!x,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!o,this.ttlResolution=Yt(s)||s===0?s:1,this.ttlAutopurge=!!n,this.ttl=i||0,this.ttl){if(!Yt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let O="LRU_CACHE_UNBOUNDED";RL(O)&&(e0.add(O),t0("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",O,t))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#P(){let e=new wi(this.#t),r=new wi(this.#t);this.#E=e,this.#x=r,this.#M=(n,a,o=vi.now())=>{if(r[n]=a!==0?o:0,e[n]=a,a!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#R(n)&&this.#b(this.#c[n],"expire")},a+1);c.unref&&c.unref()}},this.#A=n=>{r[n]=e[n]!==0?vi.now():0},this.#f=(n,a)=>{if(e[a]){let o=e[a],c=r[a];if(!o||!c)return;n.ttl=o,n.start=c,n.now=i||s();let l=n.now-c;n.remainingTTL=o-l}};let i=0,s=()=>{let n=vi.now();if(this.ttlResolution>0){i=n;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return n};this.getRemainingTTL=n=>{let a=this.#s.get(n);if(a===void 0)return 0;let o=e[a],c=r[a];if(!o||!c)return 1/0;let l=(i||s())-c;return o-l},this.#R=n=>{let a=r[n],o=e[n];return!!o&&!!a&&(i||s())-a>o}}#A=()=>{};#f=()=>{};#M=()=>{};#R=()=>!1;#I(){let e=new wi(this.#t);this.#u=0,this.#C=e,this.#N=r=>{this.#u-=e[r],e[r]=0},this.#B=(r,i,s,n)=>{if(this.#m(i))return 0;if(!Yt(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(i,r),!Yt(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#O=(r,i,s)=>{if(e[r]=i,this.#r){let n=this.#r-e[r];for(;this.#u>n;)this.#T(!0)}this.#u+=e[r],s&&(s.entrySize=i,s.totalCalculatedSize=this.#u)}}#N=e=>{};#O=(e,r,i)=>{};#B=(e,r,i,s)=>{if(i||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#L({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#g;!(!this.#k(r)||((e||!this.#R(r))&&(yield r),r===this.#d));)r=this.#o[r]}*#$({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#d;!(!this.#k(r)||((e||!this.#R(r))&&(yield r),r===this.#g));)r=this.#l[r]}#k(e){return e!==void 0&&this.#s.get(this.#c[e])===e}*entries(){for(let e of this.#L())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#m(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*rentries(){for(let e of this.#$())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#m(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*keys(){for(let e of this.#L()){let r=this.#c[e];r!==void 0&&!this.#m(this.#i[e])&&(yield r)}}*rkeys(){for(let e of this.#$()){let r=this.#c[e];r!==void 0&&!this.#m(this.#i[e])&&(yield r)}}*values(){for(let e of this.#L())this.#i[e]!==void 0&&!this.#m(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#$())this.#i[e]!==void 0&&!this.#m(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let i of this.#L()){let s=this.#i[i],n=this.#m(s)?s.__staleWhileFetching:s;if(n!==void 0&&e(n,this.#c[i],this))return this.get(this.#c[i],r)}}forEach(e,r=this){for(let i of this.#L()){let s=this.#i[i],n=this.#m(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(r,n,this.#c[i],this)}}rforEach(e,r=this){for(let i of this.#$()){let s=this.#i[i],n=this.#m(s)?s.__staleWhileFetching:s;n!==void 0&&e.call(r,n,this.#c[i],this)}}purgeStale(){let e=!1;for(let r of this.#$({allowStale:!0}))this.#R(r)&&(this.#b(this.#c[r],"expire"),e=!0);return e}info(e){let r=this.#s.get(e);if(r===void 0)return;let i=this.#i[r],s=this.#m(i)?i.__staleWhileFetching:i;if(s===void 0)return;let n={value:s};if(this.#E&&this.#x){let a=this.#E[r],o=this.#x[r];if(a&&o){let c=a-(vi.now()-o);n.ttl=c,n.start=Date.now()}}return this.#C&&(n.size=this.#C[r]),n}dump(){let e=[];for(let r of this.#L({allowStale:!0})){let i=this.#c[r],s=this.#i[r],n=this.#m(s)?s.__staleWhileFetching:s;if(n===void 0||i===void 0)continue;let a={value:n};if(this.#E&&this.#x){a.ttl=this.#E[r];let o=vi.now()-this.#x[r];a.start=Math.floor(Date.now()-o)}this.#C&&(a.size=this.#C[r]),e.unshift([i,a])}return e}load(e){this.clear();for(let[r,i]of e){if(i.start){let s=Date.now()-i.start;i.start=vi.now()-s}this.set(r,i.value,i)}}set(e,r,i={}){if(r===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:c}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,u=this.#B(e,r,i.size||0,o);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#b(e,"set"),this;let d=this.#a===0?void 0:this.#s.get(e);if(d===void 0)d=this.#a===0?this.#g:this.#y.length!==0?this.#y.pop():this.#a===this.#t?this.#T(!1):this.#a,this.#c[d]=e,this.#i[d]=r,this.#s.set(e,d),this.#l[this.#g]=d,this.#o[d]=this.#g,this.#g=d,this.#a++,this.#O(d,u,c),c&&(c.set="add"),l=!1;else{this.#D(d);let g=this.#i[d];if(r!==g){if(this.#S&&this.#m(g)){g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:h}=g;h!==void 0&&!a&&(this.#_&&this.#e?.(h,e,"set"),this.#v&&this.#p?.push([h,e,"set"]))}else a||(this.#_&&this.#e?.(g,e,"set"),this.#v&&this.#p?.push([g,e,"set"]));if(this.#N(d),this.#O(d,u,c),this.#i[d]=r,c){c.set="replace";let h=g&&this.#m(g)?g.__staleWhileFetching:g;h!==void 0&&(c.oldValue=h)}}else c&&(c.set="update")}if(s!==0&&!this.#E&&this.#P(),this.#E&&(l||this.#M(d,s,n),c&&this.#f(c,d)),!a&&this.#v&&this.#p){let g=this.#p,h;for(;h=g?.shift();)this.#n?.(...h)}return this}pop(){try{for(;this.#a;){let e=this.#i[this.#d];if(this.#T(!0),this.#m(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#v&&this.#p){let e=this.#p,r;for(;r=e?.shift();)this.#n?.(...r)}}}#T(e){let r=this.#d,i=this.#c[r],s=this.#i[r];return this.#S&&this.#m(s)?s.__abortController.abort(new Error("evicted")):(this.#_||this.#v)&&(this.#_&&this.#e?.(s,i,"evict"),this.#v&&this.#p?.push([s,i,"evict"])),this.#N(r),e&&(this.#c[r]=void 0,this.#i[r]=void 0,this.#y.push(r)),this.#a===1?(this.#d=this.#g=0,this.#y.length=0):this.#d=this.#l[r],this.#s.delete(i),this.#a--,r}has(e,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=r,n=this.#s.get(e);if(n!==void 0){let a=this.#i[n];if(this.#m(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#R(n))s&&(s.has="stale",this.#f(s,n));else return i&&this.#A(n),s&&(s.has="hit",this.#f(s,n)),!0}else s&&(s.has="miss");return!1}peek(e,r={}){let{allowStale:i=this.allowStale}=r,s=this.#s.get(e);if(s===void 0||!i&&this.#R(s))return;let n=this.#i[s];return this.#m(n)?n.__staleWhileFetching:n}#F(e,r,i,s){let n=r===void 0?void 0:this.#i[r];if(this.#m(n))return n;let a=new Hn,{signal:o}=i;o?.addEventListener("abort",()=>a.abort(o.reason),{signal:a.signal});let c={signal:a.signal,options:i,context:s},l=(m,y=!1)=>{let{aborted:b}=a.signal,w=i.ignoreFetchAbort&&m!==void 0;if(i.status&&(b&&!y?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,w&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),b&&!w&&!y)return d(a.signal.reason);let x=h;return this.#i[r]===h&&(m===void 0?x.__staleWhileFetching?this.#i[r]=x.__staleWhileFetching:this.#b(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,m,c.options))),m},u=m=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=m),d(m)),d=m=>{let{aborted:y}=a.signal,b=y&&i.allowStaleOnFetchAbort,w=b||i.allowStaleOnFetchRejection,x=w||i.noDeleteOnFetchRejection,f=h;if(this.#i[r]===h&&(!x||f.__staleWhileFetching===void 0?this.#b(e,"fetch"):b||(this.#i[r]=f.__staleWhileFetching)),w)return i.status&&f.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),f.__staleWhileFetching;if(f.__returned===f)throw m},g=(m,y)=>{let b=this.#h?.(e,n,c);b&&b instanceof Promise&&b.then(w=>m(w===void 0?void 0:w),y),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=w=>l(w,!0)))})};i.status&&(i.status.fetchDispatched=!0);let h=new Promise(g).then(l,u),p=Object.assign(h,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return r===void 0?(this.set(e,p,{...c.options,status:void 0}),r=this.#s.get(e)):this.#i[r]=p,p}#m(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Hn}async fetch(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:y=!1,status:b,signal:w}=r;if(!this.#S)return b&&(b.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:b});let x={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:o,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:p,ignoreFetchAbort:h,status:b,signal:w},f=this.#s.get(e);if(f===void 0){b&&(b.fetch="miss");let v=this.#F(e,f,x,m);return v.__returned=v}else{let v=this.#i[f];if(this.#m(v)){let $=i&&v.__staleWhileFetching!==void 0;return b&&(b.fetch="inflight",$&&(b.returnedStale=!0)),$?v.__staleWhileFetching:v.__returned=v}let E=this.#R(f);if(!y&&!E)return b&&(b.fetch="hit"),this.#D(f),s&&this.#A(f),b&&this.#f(b,f),v;let _=this.#F(e,f,x,m),C=_.__staleWhileFetching!==void 0&&i;return b&&(b.fetch=E?"stale":"refresh",C&&E&&(b.returnedStale=!0)),C?_.__staleWhileFetching:_.__returned=_}}async forceFetch(e,r={}){let i=await this.fetch(e,r);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,r={}){let i=this.#w;if(!i)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:n,...a}=r,o=this.get(e,a);if(!n&&o!==void 0)return o;let c=i(e,o,{options:a,context:s});return this.set(e,c,a),c}get(e,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=r,o=this.#s.get(e);if(o!==void 0){let c=this.#i[o],l=this.#m(c);return a&&this.#f(a,o),this.#R(o)?(a&&(a.get="stale"),l?(a&&i&&c.__staleWhileFetching!==void 0&&(a.returnedStale=!0),i?c.__staleWhileFetching:void 0):(n||this.#b(e,"expire"),a&&i&&(a.returnedStale=!0),i?c:void 0)):(a&&(a.get="hit"),l?c.__staleWhileFetching:(this.#D(o),s&&this.#A(o),c))}else a&&(a.get="miss")}#j(e,r){this.#o[r]=e,this.#l[e]=r}#D(e){e!==this.#g&&(e===this.#d?this.#d=this.#l[e]:this.#j(this.#o[e],this.#l[e]),this.#j(this.#g,e),this.#g=e)}delete(e){return this.#b(e,"delete")}#b(e,r){let i=!1;if(this.#a!==0){let s=this.#s.get(e);if(s!==void 0)if(i=!0,this.#a===1)this.#G(r);else{this.#N(s);let n=this.#i[s];if(this.#m(n)?n.__abortController.abort(new Error("deleted")):(this.#_||this.#v)&&(this.#_&&this.#e?.(n,e,r),this.#v&&this.#p?.push([n,e,r])),this.#s.delete(e),this.#c[s]=void 0,this.#i[s]=void 0,s===this.#g)this.#g=this.#o[s];else if(s===this.#d)this.#d=this.#l[s];else{let a=this.#o[s];this.#l[a]=this.#l[s];let o=this.#l[s];this.#o[o]=this.#o[s]}this.#a--,this.#y.push(s)}}if(this.#v&&this.#p?.length){let s=this.#p,n;for(;n=s?.shift();)this.#n?.(...n)}return i}clear(){return this.#G("delete")}#G(e){for(let r of this.#$({allowStale:!0})){let i=this.#i[r];if(this.#m(i))i.__abortController.abort(new Error("deleted"));else{let s=this.#c[r];this.#_&&this.#e?.(i,s,e),this.#v&&this.#p?.push([i,s,e])}}if(this.#s.clear(),this.#i.fill(void 0),this.#c.fill(void 0),this.#E&&this.#x&&(this.#E.fill(0),this.#x.fill(0)),this.#C&&this.#C.fill(0),this.#d=0,this.#g=0,this.#y.length=0,this.#u=0,this.#a=0,this.#v&&this.#p){let r=this.#p,i;for(;i=r?.shift();)this.#n?.(...i)}}};import{posix as DL,win32 as fl}from"node:path";import{fileURLToPath as ML}from"node:url";import{lstatSync as kL,readdir as jL,readdirSync as BL,readlinkSync as UL,realpathSync as GL}from"fs";import*as zL from"node:fs";import{lstat as WL,readdir as VL,readlink as HL,realpath as KL}from"node:fs/promises";import{EventEmitter as ll}from"node:events";import a0 from"node:stream";import{StringDecoder as CL}from"node:string_decoder";var i0=typeof process=="object"&&process?process:{stdout:null,stderr:null},AL=t=>!!t&&typeof t=="object"&&(t instanceof Jt||t instanceof a0||LL(t)||OL(t)),LL=t=>!!t&&typeof t=="object"&&t instanceof ll&&typeof t.pipe=="function"&&t.pipe!==a0.Writable.prototype.pipe,OL=t=>!!t&&typeof t=="object"&&t instanceof ll&&typeof t.write=="function"&&typeof t.end=="function",Dt=Symbol("EOF"),Mt=Symbol("maybeEmitEnd"),Xt=Symbol("emittedEnd"),Kn=Symbol("emittingEnd"),vs=Symbol("emittedError"),Yn=Symbol("closed"),s0=Symbol("read"),Xn=Symbol("flush"),n0=Symbol("flushChunk"),mt=Symbol("encoding"),xi=Symbol("decoder"),Ce=Symbol("flowing"),ws=Symbol("paused"),Ei=Symbol("resume"),Ae=Symbol("buffer"),qe=Symbol("pipes"),Le=Symbol("bufferLength"),il=Symbol("bufferPush"),Jn=Symbol("bufferShift"),ke=Symbol("objectMode"),Ee=Symbol("destroyed"),sl=Symbol("error"),nl=Symbol("emitData"),o0=Symbol("emitEnd"),ol=Symbol("emitEnd2"),_t=Symbol("async"),al=Symbol("abort"),Zn=Symbol("aborted"),xs=Symbol("signal"),Nr=Symbol("dataListeners"),Xe=Symbol("discarded"),Es=t=>Promise.resolve().then(t),$L=t=>t(),TL=t=>t==="end"||t==="finish"||t==="prefinish",PL=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,IL=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Qn=class{src;dest;opts;ondrain;constructor(e,r,i){this.src=e,this.dest=r,this.opts=i,this.ondrain=()=>e[Ei](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},cl=class extends Qn{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,i){super(e,r,i),this.proxyErrors=s=>r.emit("error",s),e.on("error",this.proxyErrors)}},FL=t=>!!t.objectMode,NL=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Jt=class extends ll{[Ce]=!1;[ws]=!1;[qe]=[];[Ae]=[];[ke];[mt];[_t];[xi];[Dt]=!1;[Xt]=!1;[Kn]=!1;[Yn]=!1;[vs]=null;[Le]=0;[Ee]=!1;[xs];[Zn]=!1;[Nr]=0;[Xe]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");FL(r)?(this[ke]=!0,this[mt]=null):NL(r)?(this[mt]=r.encoding,this[ke]=!1):(this[ke]=!1,this[mt]=null),this[_t]=!!r.async,this[xi]=this[mt]?new CL(this[mt]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Ae]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[qe]});let{signal:i}=r;i&&(this[xs]=i,i.aborted?this[al]():i.addEventListener("abort",()=>this[al]()))}get bufferLength(){return this[Le]}get encoding(){return this[mt]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[ke]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[_t]}set async(e){this[_t]=this[_t]||!!e}[al](){this[Zn]=!0,this.emit("abort",this[xs]?.reason),this.destroy(this[xs]?.reason)}get aborted(){return this[Zn]}set aborted(e){}write(e,r,i){if(this[Zn])return!1;if(this[Dt])throw new Error("write after end");if(this[Ee])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(i=r,r="utf8"),r||(r="utf8");let s=this[_t]?Es:$L;if(!this[ke]&&!Buffer.isBuffer(e)){if(IL(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(PL(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[ke]?(this[Ce]&&this[Le]!==0&&this[Xn](!0),this[Ce]?this.emit("data",e):this[il](e),this[Le]!==0&&this.emit("readable"),i&&s(i),this[Ce]):e.length?(typeof e=="string"&&!(r===this[mt]&&!this[xi]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[mt]&&(e=this[xi].write(e)),this[Ce]&&this[Le]!==0&&this[Xn](!0),this[Ce]?this.emit("data",e):this[il](e),this[Le]!==0&&this.emit("readable"),i&&s(i),this[Ce]):(this[Le]!==0&&this.emit("readable"),i&&s(i),this[Ce])}read(e){if(this[Ee])return null;if(this[Xe]=!1,this[Le]===0||e===0||e&&e>this[Le])return this[Mt](),null;this[ke]&&(e=null),this[Ae].length>1&&!this[ke]&&(this[Ae]=[this[mt]?this[Ae].join(""):Buffer.concat(this[Ae],this[Le])]);let r=this[s0](e||null,this[Ae][0]);return this[Mt](),r}[s0](e,r){if(this[ke])this[Jn]();else{let i=r;e===i.length||e===null?this[Jn]():typeof i=="string"?(this[Ae][0]=i.slice(e),r=i.slice(0,e),this[Le]-=e):(this[Ae][0]=i.subarray(e),r=i.subarray(0,e),this[Le]-=e)}return this.emit("data",r),!this[Ae].length&&!this[Dt]&&this.emit("drain"),r}end(e,r,i){return typeof e=="function"&&(i=e,e=void 0),typeof r=="function"&&(i=r,r="utf8"),e!==void 0&&this.write(e,r),i&&this.once("end",i),this[Dt]=!0,this.writable=!1,(this[Ce]||!this[ws])&&this[Mt](),this}[Ei](){this[Ee]||(!this[Nr]&&!this[qe].length&&(this[Xe]=!0),this[ws]=!1,this[Ce]=!0,this.emit("resume"),this[Ae].length?this[Xn]():this[Dt]?this[Mt]():this.emit("drain"))}resume(){return this[Ei]()}pause(){this[Ce]=!1,this[ws]=!0,this[Xe]=!1}get destroyed(){return this[Ee]}get flowing(){return this[Ce]}get paused(){return this[ws]}[il](e){this[ke]?this[Le]+=1:this[Le]+=e.length,this[Ae].push(e)}[Jn](){return this[ke]?this[Le]-=1:this[Le]-=this[Ae][0].length,this[Ae].shift()}[Xn](e=!1){do;while(this[n0](this[Jn]())&&this[Ae].length);!e&&!this[Ae].length&&!this[Dt]&&this.emit("drain")}[n0](e){return this.emit("data",e),this[Ce]}pipe(e,r){if(this[Ee])return e;this[Xe]=!1;let i=this[Xt];return r=r||{},e===i0.stdout||e===i0.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,i?r.end&&e.end():(this[qe].push(r.proxyErrors?new cl(this,e,r):new Qn(this,e,r)),this[_t]?Es(()=>this[Ei]()):this[Ei]()),e}unpipe(e){let r=this[qe].find(i=>i.dest===e);r&&(this[qe].length===1?(this[Ce]&&this[Nr]===0&&(this[Ce]=!1),this[qe]=[]):this[qe].splice(this[qe].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let i=super.on(e,r);if(e==="data")this[Xe]=!1,this[Nr]++,!this[qe].length&&!this[Ce]&&this[Ei]();else if(e==="readable"&&this[Le]!==0)super.emit("readable");else if(TL(e)&&this[Xt])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[vs]){let s=r;this[_t]?Es(()=>s.call(this,this[vs])):s.call(this,this[vs])}return i}removeListener(e,r){return this.off(e,r)}off(e,r){let i=super.off(e,r);return e==="data"&&(this[Nr]=this.listeners("data").length,this[Nr]===0&&!this[Xe]&&!this[qe].length&&(this[Ce]=!1)),i}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Nr]=0,!this[Xe]&&!this[qe].length&&(this[Ce]=!1)),r}get emittedEnd(){return this[Xt]}[Mt](){!this[Kn]&&!this[Xt]&&!this[Ee]&&this[Ae].length===0&&this[Dt]&&(this[Kn]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Yn]&&this.emit("close"),this[Kn]=!1)}emit(e,...r){let i=r[0];if(e!=="error"&&e!=="close"&&e!==Ee&&this[Ee])return!1;if(e==="data")return!this[ke]&&!i?!1:this[_t]?(Es(()=>this[nl](i)),!0):this[nl](i);if(e==="end")return this[o0]();if(e==="close"){if(this[Yn]=!0,!this[Xt]&&!this[Ee])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[vs]=i,super.emit(sl,i);let n=!this[xs]||this.listeners("error").length?super.emit("error",i):!1;return this[Mt](),n}else if(e==="resume"){let n=super.emit("resume");return this[Mt](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let s=super.emit(e,...r);return this[Mt](),s}[nl](e){for(let i of this[qe])i.dest.write(e)===!1&&this.pause();let r=this[Xe]?!1:super.emit("data",e);return this[Mt](),r}[o0](){return this[Xt]?!1:(this[Xt]=!0,this.readable=!1,this[_t]?(Es(()=>this[ol]()),!0):this[ol]())}[ol](){if(this[xi]){let r=this[xi].end();if(r){for(let i of this[qe])i.dest.write(r);this[Xe]||super.emit("data",r)}}for(let r of this[qe])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[ke]||(e.dataLength=0);let r=this.promise();return this.on("data",i=>{e.push(i),this[ke]||(e.dataLength+=i.length)}),await r,e}async concat(){if(this[ke])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[mt]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(Ee,()=>r(new Error("stream destroyed"))),this.on("error",i=>r(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Xe]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[Dt])return r();let n,a,o=d=>{this.off("data",c),this.off("end",l),this.off(Ee,u),r(),a(d)},c=d=>{this.off("error",o),this.off("end",l),this.off(Ee,u),this.pause(),n({value:d,done:!!this[Dt]})},l=()=>{this.off("error",o),this.off("data",c),this.off(Ee,u),r(),n({done:!0,value:void 0})},u=()=>o(new Error("stream destroyed"));return new Promise((d,g)=>{a=g,n=d,this.once(Ee,u),this.once("error",o),this.once("end",l),this.once("data",c)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Xe]=!1;let e=!1,r=()=>(this.pause(),this.off(sl,r),this.off(Ee,r),this.off("end",r),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return r();let s=this.read();return s===null?r():{done:!1,value:s}};return this.once("end",r),this.once(sl,r),this.once(Ee,r),{next:i,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[Ee])return e?this.emit("error",e):this.emit(Ee),this;this[Ee]=!0,this[Xe]=!0,this[Ae].length=0,this[Le]=0;let r=this;return typeof r.close=="function"&&!this[Yn]&&r.close(),e?this.emit("error",e):this.emit(Ee),this}static get isStream(){return AL}};var qL=GL.native,Ss={lstatSync:kL,readdir:jL,readdirSync:BL,readlinkSync:UL,realpathSync:qL,promises:{lstat:WL,readdir:VL,readlink:HL,realpath:KL}},f0=t=>!t||t===Ss||t===zL?Ss:{...Ss,...t,promises:{...Ss.promises,...t.promises||{}}},p0=/^\\\\\?\\([a-z]:)\\?$/i,YL=t=>t.replace(/\//g,"\\").replace(p0,"$1\\"),XL=/[\\\/]/,ct=0,d0=1,m0=2,St=4,g0=6,y0=8,Dr=10,b0=12,at=15,_s=~at,ul=16,c0=32,Rs=64,gt=128,eo=256,ro=512,l0=Rs|gt|ro,JL=1023,hl=t=>t.isFile()?y0:t.isDirectory()?St:t.isSymbolicLink()?Dr:t.isCharacterDevice()?m0:t.isBlockDevice()?g0:t.isSocket()?b0:t.isFIFO()?d0:ct,u0=new Map,Cs=t=>{let e=u0.get(t);if(e)return e;let r=t.normalize("NFKD");return u0.set(t,r),r},h0=new Map,to=t=>{let e=h0.get(t);if(e)return e;let r=Cs(t.toLowerCase());return h0.set(t,r),r},io=class extends bs{constructor(){super({max:256})}},pl=class extends bs{constructor(e=16*1024){super({maxSize:e,sizeCalculation:r=>r.length+1})}},v0=Symbol("PathScurry setAsCwd"),je=class{name;root;roots;parent;nocase;isCWD=!1;#t;#r;get dev(){return this.#r}#e;get mode(){return this.#e}#n;get nlink(){return this.#n}#h;get uid(){return this.#h}#w;get gid(){return this.#w}#a;get rdev(){return this.#a}#u;get blksize(){return this.#u}#s;get ino(){return this.#s}#c;get size(){return this.#c}#i;get blocks(){return this.#i}#l;get atimeMs(){return this.#l}#o;get mtimeMs(){return this.#o}#d;get ctimeMs(){return this.#d}#g;get birthtimeMs(){return this.#g}#y;get atime(){return this.#y}#p;get mtime(){return this.#p}#C;get ctime(){return this.#C}#x;get birthtime(){return this.#x}#E;#_;#S;#v;#P;#A;#f;#M;#R;#I;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=ct,i,s,n,a,o){this.name=e,this.#E=n?to(e):Cs(e),this.#f=r&JL,this.nocase=n,this.roots=s,this.root=i||this,this.#M=a,this.#S=o.fullpath,this.#P=o.relative,this.#A=o.relativePosix,this.parent=o.parent,this.parent?this.#t=this.parent.#t:this.#t=f0(o.fs)}depth(){return this.#_!==void 0?this.#_:this.parent?this.#_=this.parent.depth()+1:this.#_=0}childrenCache(){return this.#M}resolve(e){if(!e)return this;let r=this.getRootString(e),s=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#N(s):this.#N(s)}#N(e){let r=this;for(let i of e)r=r.child(i);return r}children(){let e=this.#M.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#M.set(this,r),this.#f&=~ul,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let i=this.children(),s=this.nocase?to(e):Cs(e);for(let c of i)if(c.#E===s)return c;let n=this.parent?this.sep:"",a=this.#S?this.#S+n+e:void 0,o=this.newChild(e,ct,{...r,parent:this,fullpath:a});return this.canReaddir()||(o.#f|=gt),i.push(o),o}relative(){if(this.isCWD)return"";if(this.#P!==void 0)return this.#P;let e=this.name,r=this.parent;if(!r)return this.#P=this.name;let i=r.relative();return i+(!i||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let e=this.name,r=this.parent;if(!r)return this.#A=this.fullpathPosix();let i=r.relativePosix();return i+(!i||!r.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.name;let s=r.fullpath()+(r.parent?this.sep:"")+e;return this.#S=s}fullpathPosix(){if(this.#v!==void 0)return this.#v;if(this.sep==="/")return this.#v=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#v=`//?/${s}`:this.#v=s}let e=this.parent,r=e.fullpathPosix(),i=r+(!r||!e.parent?"":"/")+this.name;return this.#v=i}isUnknown(){return(this.#f&at)===ct}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#f&at)===y0}isDirectory(){return(this.#f&at)===St}isCharacterDevice(){return(this.#f&at)===m0}isBlockDevice(){return(this.#f&at)===g0}isFIFO(){return(this.#f&at)===d0}isSocket(){return(this.#f&at)===b0}isSymbolicLink(){return(this.#f&Dr)===Dr}lstatCached(){return this.#f&c0?this:void 0}readlinkCached(){return this.#R}realpathCached(){return this.#I}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#R)return!0;if(!this.parent)return!1;let e=this.#f&at;return!(e!==ct&&e!==Dr||this.#f&eo||this.#f>)}calledReaddir(){return!!(this.#f&ul)}isENOENT(){return!!(this.#f>)}isNamed(e){return this.nocase?this.#E===to(e):this.#E===Cs(e)}async readlink(){let e=this.#R;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#t.promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(r);if(i)return this.#R=i}catch(r){this.#m(r.code);return}}readlinkSync(){let e=this.#R;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#t.readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(r);if(i)return this.#R=i}catch(r){this.#m(r.code);return}}#O(e){this.#f|=ul;for(let r=e.provisional;r<e.length;r++){let i=e[r];i&&i.#B()}}#B(){this.#f>||(this.#f=(this.#f|gt)&_s,this.#L())}#L(){let e=this.children();e.provisional=0;for(let r of e)r.#B()}#$(){this.#f|=ro,this.#k()}#k(){if(this.#f&Rs)return;let e=this.#f;(e&at)===St&&(e&=_s),this.#f=e|Rs,this.#L()}#T(e=""){e==="ENOTDIR"||e==="EPERM"?this.#k():e==="ENOENT"?this.#B():this.children().provisional=0}#F(e=""){e==="ENOTDIR"?this.parent.#k():e==="ENOENT"&&this.#B()}#m(e=""){let r=this.#f;r|=eo,e==="ENOENT"&&(r|=gt),(e==="EINVAL"||e==="UNKNOWN")&&(r&=_s),this.#f=r,e==="ENOTDIR"&&this.parent&&this.parent.#k()}#j(e,r){return this.#b(e,r)||this.#D(e,r)}#D(e,r){let i=hl(e),s=this.newChild(e.name,i,{parent:this}),n=s.#f&at;return n!==St&&n!==Dr&&n!==ct&&(s.#f|=Rs),r.unshift(s),r.provisional++,s}#b(e,r){for(let i=r.provisional;i<r.length;i++){let s=r[i];if((this.nocase?to(e.name):Cs(e.name))===s.#E)return this.#G(e,s,i,r)}}#G(e,r,i,s){let n=r.name;return r.#f=r.#f&_s|hl(e),n!==e.name&&(r.name=e.name),i!==s.provisional&&(i===s.length-1?s.pop():s.splice(i,1),s.unshift(r)),s.provisional++,r}async lstat(){if((this.#f>)===0)try{return this.#z(await this.#t.promises.lstat(this.fullpath())),this}catch(e){this.#F(e.code)}}lstatSync(){if((this.#f>)===0)try{return this.#z(this.#t.lstatSync(this.fullpath())),this}catch(e){this.#F(e.code)}}#z(e){let{atime:r,atimeMs:i,birthtime:s,birthtimeMs:n,blksize:a,blocks:o,ctime:c,ctimeMs:l,dev:u,gid:d,ino:g,mode:h,mtime:p,mtimeMs:m,nlink:y,rdev:b,size:w,uid:x}=e;this.#y=r,this.#l=i,this.#x=s,this.#g=n,this.#u=a,this.#i=o,this.#C=c,this.#d=l,this.#r=u,this.#w=d,this.#s=g,this.#e=h,this.#p=p,this.#o=m,this.#n=y,this.#a=b,this.#c=w,this.#h=x;let f=hl(e);this.#f=this.#f&_s|f|c0,f!==ct&&f!==St&&f!==Dr&&(this.#f|=Rs)}#U=[];#q=!1;#V(e){this.#q=!1;let r=this.#U.slice();this.#U.length=0,r.forEach(i=>i(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let i=this.children();if(this.calledReaddir()){let n=i.slice(0,i.provisional);r?e(null,n):queueMicrotask(()=>e(null,n));return}if(this.#U.push(e),this.#q)return;this.#q=!0;let s=this.fullpath();this.#t.readdir(s,{withFileTypes:!0},(n,a)=>{if(n)this.#T(n.code),i.provisional=0;else{for(let o of a)this.#j(o,i);this.#O(i)}this.#V(i.slice(0,i.provisional))})}#W;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#W)await this.#W;else{let i=()=>{};this.#W=new Promise(s=>i=s);try{for(let s of await this.#t.promises.readdir(r,{withFileTypes:!0}))this.#j(s,e);this.#O(e)}catch(s){this.#T(s.code),e.provisional=0}this.#W=void 0,i()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let i of this.#t.readdirSync(r,{withFileTypes:!0}))this.#j(i,e);this.#O(e)}catch(i){this.#T(i.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#f&l0)return!1;let e=at&this.#f;return e===ct||e===St||e===Dr}shouldWalk(e,r){return(this.#f&St)===St&&!(this.#f&l0)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#I)return this.#I;if(!((ro|eo|gt)&this.#f))try{let e=await this.#t.promises.realpath(this.fullpath());return this.#I=this.resolve(e)}catch{this.#$()}}realpathSync(){if(this.#I)return this.#I;if(!((ro|eo|gt)&this.#f))try{let e=this.#t.realpathSync(this.fullpath());return this.#I=this.resolve(e)}catch{this.#$()}}[v0](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),i=[],s=this;for(;s&&s.parent;)r.add(s),s.#P=i.join(this.sep),s.#A=i.join("/"),s=s.parent,i.push("..");for(s=e;s&&s.parent&&!r.has(s);)s.#P=void 0,s.#A=void 0,s=s.parent}},so=class t extends je{sep="\\";splitSep=XL;constructor(e,r=ct,i,s,n,a,o){super(e,r,i,s,n,a,o)}newChild(e,r=ct,i={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(e){return fl.parse(e).root}getRoot(e){if(e=YL(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,i]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=i;return this.roots[e]=new _i(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(p0,"$1\\"),e===r}},no=class t extends je{splitSep="/";sep="/";constructor(e,r=ct,i,s,n,a,o){super(e,r,i,s,n,a,o)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=ct,i={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),i)}},oo=class{root;rootPath;roots;cwd;#t;#r;#e;nocase;#n;constructor(e=process.cwd(),r,i,{nocase:s,childrenCacheSize:n=16*1024,fs:a=Ss}={}){this.#n=f0(a),(e instanceof URL||e.startsWith("file://"))&&(e=ML(e));let o=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#t=new io,this.#r=new io,this.#e=new pl(n);let c=o.substring(this.rootPath.length).split(i);if(c.length===1&&!c[0]&&c.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=r.sep,g=this.rootPath,h=!1;for(let p of c){let m=u--;l=l.child(p,{relative:new Array(m).fill("..").join(d),relativePosix:new Array(m).fill("..").join("/"),fullpath:g+=(h?"":d)+p}),h=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#e}resolve(...e){let r="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let i=this.#t.get(r);if(i!==void 0)return i;let s=this.cwd.resolve(r).fullpath();return this.#t.set(r,s),s}resolvePosix(...e){let r="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let i=this.#r.get(r);if(i!==void 0)return i;let s=this.cwd.resolve(r).fullpathPosix();return this.#r.set(r,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i}=r;if(e.canReaddir()){let s=await e.readdir();return i?s:s.map(n=>n.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0}=r;return e.canReaddir()?i?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e.withFileTypes,e=this.cwd);let i=await e.readlink();return r?i:i?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e.withFileTypes,e=this.cwd);let i=e.readlinkSync();return r?i:i?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e.withFileTypes,e=this.cwd);let i=await e.realpath();return r?i:i?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e.withFileTypes,e=this.cwd);let i=e.realpathSync();return r?i:i?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=r,o=[];(!n||n(e))&&o.push(i?e:e.fullpath());let c=new Set,l=(d,g)=>{c.add(d),d.readdirCB((h,p)=>{if(h)return g(h);let m=p.length;if(!m)return g();let y=()=>{--m===0&&g()};for(let b of p)(!n||n(b))&&o.push(i?b:b.fullpath()),s&&b.isSymbolicLink()?b.realpath().then(w=>w?.isUnknown()?w.lstat():w).then(w=>w?.shouldWalk(c,a)?l(w,y):y()):b.shouldWalk(c,a)?l(b,y):y()},!0)},u=e;return new Promise((d,g)=>{l(u,h=>{if(h)return g(h);d(o)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=r,o=[];(!n||n(e))&&o.push(i?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!n||n(d))&&o.push(i?d:d.fullpath());let g=d;if(d.isSymbolicLink()){if(!(s&&(g=d.realpathSync())))continue;g.isUnknown()&&g.lstatSync()}g.shouldWalk(c,a)&&c.add(g)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=r;(!n||n(e))&&(yield i?e:e.fullpath());let o=new Set([e]);for(let c of o){let l=c.readdirSync();for(let u of l){(!n||n(u))&&(yield i?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(s&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(o,a)&&o.add(d)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=r,o=new Jt({objectMode:!0});(!n||n(e))&&o.write(i?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let g=!1;for(;!g;){let h=l.shift();if(!h){u===0&&o.end();return}u++,c.add(h);let p=(y,b,w=!1)=>{if(y)return o.emit("error",y);if(s&&!w){let x=[];for(let f of b)f.isSymbolicLink()&&x.push(f.realpath().then(v=>v?.isUnknown()?v.lstat():v));if(x.length){Promise.all(x).then(()=>p(null,b,!0));return}}for(let x of b)x&&(!n||n(x))&&(o.write(i?x:x.fullpath())||(g=!0));u--;for(let x of b){let f=x.realpathCached()||x;f.shouldWalk(c,a)&&l.push(f)}g&&!o.flowing?o.once("drain",d):m||d()},m=!0;h.readdirCB(p,!0),m=!1}};return d(),o}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof je||(r=e,e=this.cwd);let{withFileTypes:i=!0,follow:s=!1,filter:n,walkFilter:a}=r,o=new Jt({objectMode:!0}),c=new Set;(!n||n(e))&&o.write(i?e:e.fullpath());let l=[e],u=0,d=()=>{let g=!1;for(;!g;){let h=l.shift();if(!h){u===0&&o.end();return}u++,c.add(h);let p=h.readdirSync();for(let m of p)(!n||n(m))&&(o.write(i?m:m.fullpath())||(g=!0));u--;for(let m of p){let y=m;if(m.isSymbolicLink()){if(!(s&&(y=m.realpathSync())))continue;y.isUnknown()&&y.lstatSync()}y.shouldWalk(c,a)&&l.push(y)}}g&&!o.flowing&&o.once("drain",d)};return d(),o}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[v0](r)}},_i=class extends oo{sep="\\";constructor(e=process.cwd(),r={}){let{nocase:i=!0}=r;super(e,fl,"\\",{...r,nocase:i}),this.nocase=i;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return fl.parse(e).root.toUpperCase()}newRoot(e){return new so(this.rootPath,St,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Si=class extends oo{sep="/";constructor(e=process.cwd(),r={}){let{nocase:i=!1}=r;super(e,DL,"/",{...r,nocase:i}),this.nocase=i}parseRootPath(e){return"/"}newRoot(e){return new no(this.rootPath,St,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},As=class extends Si{constructor(e=process.cwd(),r={}){let{nocase:i=!0}=r;super(e,{...r,nocase:i})}},kF=process.platform==="win32"?so:no,w0=process.platform==="win32"?_i:process.platform==="darwin"?As:Si;var ZL=t=>t.length>=1,QL=t=>t.length>=1,Ri=class t{#t;#r;#e;length;#n;#h;#w;#a;#u;#s;#c=!0;constructor(e,r,i,s){if(!ZL(e))throw new TypeError("empty pattern list");if(!QL(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,i<0||i>=this.length)throw new TypeError("index out of range");if(this.#t=e,this.#r=r,this.#e=i,this.#n=s,this.#e===0){if(this.isUNC()){let[n,a,o,c,...l]=this.#t,[u,d,g,h,...p]=this.#r;l[0]===""&&(l.shift(),p.shift());let m=[n,a,o,c,""].join("/"),y=[u,d,g,h,""].join("/");this.#t=[m,...l],this.#r=[y,...p],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[n,...a]=this.#t,[o,...c]=this.#r;a[0]===""&&(a.shift(),c.shift());let l=n+"/",u=o+"/";this.#t=[l,...a],this.#r=[u,...c],this.length=this.#t.length}}}pattern(){return this.#t[this.#e]}isString(){return typeof this.#t[this.#e]=="string"}isGlobstar(){return this.#t[this.#e]===Pe}isRegExp(){return this.#t[this.#e]instanceof RegExp}globString(){return this.#w=this.#w||(this.#e===0?this.isAbsolute()?this.#r[0]+this.#r.slice(1).join("/"):this.#r.join("/"):this.#r.slice(this.#e).join("/"))}hasMore(){return this.length>this.#e+1}rest(){return this.#h!==void 0?this.#h:this.hasMore()?(this.#h=new t(this.#t,this.#r,this.#e+1,this.#n),this.#h.#s=this.#s,this.#h.#u=this.#u,this.#h.#a=this.#a,this.#h):this.#h=null}isUNC(){let e=this.#t;return this.#u!==void 0?this.#u:this.#u=this.#n==="win32"&&this.#e===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#t;return this.#a!==void 0?this.#a:this.#a=this.#n==="win32"&&this.#e===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#t;return this.#s!==void 0?this.#s:this.#s=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#t[0];return typeof e=="string"&&this.isAbsolute()&&this.#e===0?e:""}checkFollowGlobstar(){return!(this.#e===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#e===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var eO=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ci=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:i,noext:s,noglobstar:n,platform:a=eO}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:r,nocase:i,noext:s,noglobstar:n,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let o of e)this.add(o)}add(e){let r=new Ye(e,this.mmopts);for(let i=0;i<r.set.length;i++){let s=r.set[i],n=r.globParts[i];if(!s||!n)throw new Error("invalid pattern object");for(;s[0]==="."&&n[0]===".";)s.shift(),n.shift();let a=new Ri(s,n,0,this.platform),o=new Ye(a.globString(),this.mmopts),c=n[n.length-1]==="**",l=a.isAbsolute();l?this.absolute.push(o):this.relative.push(o),c&&(l?this.absoluteChildren.push(o):this.relativeChildren.push(o))}}ignored(e){let r=e.fullpath(),i=`${r}/`,s=e.relative()||".",n=`${s}/`;for(let a of this.relative)if(a.match(s)||a.match(n))return!0;for(let a of this.absolute)if(a.match(r)||a.match(i))return!0;return!1}childrenIgnored(e){let r=e.fullpath()+"/",i=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(i))return!0;for(let s of this.absoluteChildren)if(s.match(r))return!0;return!1}};var dl=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,r){return this.store.get(e.fullpath())?.has(r.globString())}storeWalked(e,r){let i=e.fullpath(),s=this.store.get(i);s?s.add(r.globString()):this.store.set(i,new Set([r.globString()]))}},ml=class{store=new Map;add(e,r,i){let s=(r?2:0)|(i?1:0),n=this.store.get(e);this.store.set(e,n===void 0?s:s&n)}entries(){return[...this.store.entries()].map(([e,r])=>[e,!!(r&2),!!(r&1)])}},gl=class{store=new Map;add(e,r){if(!e.canReaddir())return;let i=this.store.get(e);i?i.find(s=>s.globString()===r.globString())||i.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},Ls=class t{hasWalkedCache;matches=new ml;subwalks=new gl;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new dl}processPatterns(e,r){this.patterns=r;let i=r.map(s=>[e,s]);for(let[s,n]of i){this.hasWalkedCache.storeWalked(s,n);let a=n.root(),o=n.isAbsolute()&&this.opts.absolute!==!1;if(a){s=s.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let d=n.rest();if(d)n=d;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let c,l,u=!1;for(;typeof(c=n.pattern())=="string"&&(l=n.rest());)s=s.resolve(c),n=l,u=!0;if(c=n.pattern(),l=n.rest(),u){if(this.hasWalkedCache.hasWalked(s,n))continue;this.hasWalkedCache.storeWalked(s,n)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(s.resolve(c),o,d);continue}else if(c===Pe){(!s.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(s,n);let d=l?.pattern(),g=l?.rest();if(!l||(d===""||d===".")&&!g)this.matches.add(s,o,d===""||d===".");else if(d===".."){let h=s.parent||s;g?this.hasWalkedCache.hasWalked(h,g)||this.subwalks.add(h,g):this.matches.add(h,o,!0)}}else c instanceof RegExp&&this.subwalks.add(s,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let i=this.subwalks.get(e),s=this.child();for(let n of r)for(let a of i){let o=a.isAbsolute(),c=a.pattern(),l=a.rest();c===Pe?s.testGlobstar(n,a,l,o):c instanceof RegExp?s.testRegExp(n,c,l,o):s.testString(n,c,l,o)}return s}testGlobstar(e,r,i,s){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,s,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(i&&r.checkFollowGlobstar()?this.subwalks.add(e,i):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),i){let n=i.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(e,n,i.rest(),s);else if(n===".."){let a=e.parent||e;this.subwalks.add(a,i)}else n instanceof RegExp&&this.testRegExp(e,n,i.rest(),s)}}testRegExp(e,r,i,s){r.test(e.name)&&(i?this.subwalks.add(e,i):this.matches.add(e,s,!1))}testString(e,r,i,s){e.isNamed(r)&&(i?this.subwalks.add(e,i):this.matches.add(e,s,!1))}};var tO=(t,e)=>typeof t=="string"?new Ci([t],e):Array.isArray(t)?new Ci(t,e):t,ao=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#r;#e;signal;maxDepth;includeChildMatches;constructor(e,r,i){if(this.patterns=e,this.path=r,this.opts=i,this.#e=!i.posix&&i.platform==="win32"?"\\":"/",this.includeChildMatches=i.includeChildMatches!==!1,(i.ignore||!this.includeChildMatches)&&(this.#r=tO(i.ignore??[],i),!this.includeChildMatches&&typeof this.#r.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#n(e){return this.seen.has(e)||!!this.#r?.ignored?.(e)}#h(e){return!!this.#r?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#t.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#t.push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||await e.realpath(),!i)return;e=i}let n=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=await n.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(n,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||e.realpathSync(),!i)return;e=i}let n=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=n.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(n,r)}matchFinish(e,r){if(this.#n(e))return;if(!this.includeChildMatches&&this.#r?.add){let n=`${e.relativePosix()}/**`;this.#r.add(n)}let i=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#e:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(i){let n=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(n+s)}else{let n=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!n.startsWith(".."+this.#e)?"."+this.#e:"";this.matchEmit(n?a+n+s:"."+s)}}async match(e,r,i){let s=await this.matchCheck(e,i);s&&this.matchFinish(s,r)}matchSync(e,r,i){let s=this.matchCheckSync(e,i);s&&this.matchFinish(s,r)}walkCB(e,r,i){this.signal?.aborted&&i(),this.walkCB2(e,r,new Ls(this.opts),i)}walkCB2(e,r,i,s){if(this.#h(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,r,i,s));return}i.processPatterns(e,r);let n=1,a=()=>{--n===0&&s()};for(let[o,c,l]of i.matches.entries())this.#n(o)||(n++,this.match(o,c,l).then(()=>a()));for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;n++;let c=o.readdirCached();o.calledReaddir()?this.walkCB3(o,c,i,a):o.readdirCB((l,u)=>this.walkCB3(o,u,i,a),!0)}a()}walkCB3(e,r,i,s){i=i.filterEntries(e,r);let n=1,a=()=>{--n===0&&s()};for(let[o,c,l]of i.matches.entries())this.#n(o)||(n++,this.match(o,c,l).then(()=>a()));for(let[o,c]of i.subwalks.entries())n++,this.walkCB2(o,c,i.child(),a);a()}walkCBSync(e,r,i){this.signal?.aborted&&i(),this.walkCB2Sync(e,r,new Ls(this.opts),i)}walkCB2Sync(e,r,i,s){if(this.#h(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,i,s));return}i.processPatterns(e,r);let n=1,a=()=>{--n===0&&s()};for(let[o,c,l]of i.matches.entries())this.#n(o)||this.matchSync(o,c,l);for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;n++;let c=o.readdirSync();this.walkCB3Sync(o,c,i,a)}a()}walkCB3Sync(e,r,i,s){i=i.filterEntries(e,r);let n=1,a=()=>{--n===0&&s()};for(let[o,c,l]of i.matches.entries())this.#n(o)||this.matchSync(o,c,l);for(let[o,c]of i.subwalks.entries())n++,this.walkCB2Sync(o,c,i.child(),a);a()}},Os=class extends ao{matches=new Set;constructor(e,r,i){super(e,r,i)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},$s=class extends ao{results;constructor(e,r,i){super(e,r,i),this.results=new Jt({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var iO=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",yt=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=rO(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=r.platform||iO,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=r.platform==="win32"?_i:r.platform==="darwin"?As:r.platform?Si:w0;this.scurry=new c(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",s={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(c=>new Ye(c,s)),[a,o]=n.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=a.map((c,l)=>{let u=o[l];if(!u)throw new Error("invalid pattern object");return new Ri(c,u,0,this.platform)})}async walk(){return[...await new Os(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Os(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new $s(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new $s(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var yl=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new Ye(r,e).hasMagic())return!0;return!1};function co(t,e={}){return new yt(t,e).streamSync()}function E0(t,e={}){return new yt(t,e).stream()}function _0(t,e={}){return new yt(t,e).walkSync()}async function x0(t,e={}){return new yt(t,e).walk()}function lo(t,e={}){return new yt(t,e).iterateSync()}function S0(t,e={}){return new yt(t,e).iterate()}var sO=co,nO=Object.assign(E0,{sync:co}),oO=lo,aO=Object.assign(S0,{sync:lo}),cO=Object.assign(_0,{stream:co,iterate:lo}),Zt=Object.assign(x0,{glob:x0,globSync:_0,sync:cO,globStream:E0,stream:nO,globStreamSync:co,streamSync:sO,globIterate:S0,iterate:aO,globIterateSync:lo,iterateSync:oO,Glob:yt,hasMagic:yl,escape:bi,unescape:dt});Zt.glob=Zt;function bl(t,e){let{changedFiles:r}=e;return r.some(i=>t===i||t.endsWith(i)||i.endsWith(t))}function lO(t,e,r,i){let{fileChangeMap:s}=i,n=s.get(t);return n?n.status==="added"?!0:n.status==="removed"?!1:uO(n.patch,e,r):!1}function R0(t,e){return bl(t.file.path,e)&&lO(t.file.path,t.range.start.line,t.range.end.line,e)}function uO(t,e,r){let i=t.split(`
|
|
51
|
-
`),
|
|
52
|
-
${
|
|
53
|
-
`),n=Math.max(0,e-1),a=Math.min(
|
|
54
|
-
`);let o=
|
|
55
|
-
`);let l=o.map((u,
|
|
56
|
-
`),a<
|
|
57
|
-
[Lines ${a+1}-${
|
|
58
|
-
`),o=[];for(let c of a){let l=c.match(/^([^:]+):(\d+):(.*)$/);if(l){let[,u,
|
|
59
|
-
`),
|
|
60
|
-
`);for(let n of s){let a=JSON.parse(n);if(a.type!=="match")continue;let o=a.data,c=o.path.text||Buffer.from(o.path.bytes||"","base64").toString("utf-8"),l=Cl.relative(r,c),u=o.lines.text;for(let d of o.submatches){let g=d.start,h=d.end,p=g+1,m=u.substring(g,h);i.push({file:l,line:o.line_number,column:p,text:m})}}return i}};var Pi=class extends Error{constructor(e,r){super(`${e} is not supported: ${r}`),this.name="LanguageBackendNotSupportedError"}},Ii=class{matchProvider;intelligenceProvider;language;constructor(e,r){this.language=r,r==="Unknown"?this.matchProvider=new Eo(e):this.matchProvider=new xo(e,r)}async findMatches(e,r){if(!this.matchProvider)throw new Pi("findMatches","no match provider configured for this language");return await this.matchProvider.findMatches(e,r)}async findDefinitions(e){if(!this.intelligenceProvider)throw new Pi("findDefinitions","no intelligence provider configured for this language");return await this.intelligenceProvider.findDefinitions(e)}async findReferences(e){if(!this.intelligenceProvider)throw new Pi("findReferences","no intelligence provider configured for this language");return await this.intelligenceProvider.findReferences(e)}async expandMatch(e){if(!this.matchProvider)throw new Pi("expandMatch","no match provider configured for this language");return await this.matchProvider.expandMatch(e)}};var _o=class{environment;eventEmitter;constructor(e,r){this.environment=e,this.eventEmitter=r}async execute(e,r,i){let s=Date.now(),n=i.filePaths.filter(d=>Wn(d)===r),c=(await new Ii(this.environment,r).findMatches(n,e)).map(d=>{if(jO.isAbsolute(d.file.path))throw new Error(`Match provider returned absolute path: ${d.file.path}. All file paths must be relative to workspace root.`);return{...d,language:r}}),l=i.previousMatches&&i.previousMatches.length>0?this.filterMatchesByRanges(c,i.previousMatches,r):c;l=this.deduplicateMatches(l);let u=Date.now()-s;return{matches:l,totalMatches:l.length,executionTime:u}}filterMatchesByRanges(e,r,i){let s=[];for(let n of e){let a=r.find(c=>this.isMatchInRange(n,c));if(!a)continue;let o=[...a.evidence||[],{file:a.file,text:a.text,range:a.range,language:a.language}];s.push({...n,evidence:o})}return s}isMatchInRange(e,r){if(e.file.path!==r.file.path)return!1;let i=e.range.start,s=e.range.end,n=r.range.start,a=r.range.end,o=i.line>n.line||i.line===n.line&&i.column>=n.column,c=s.line<a.line||s.line===a.line&&s.column<=a.column;return o&&c}deduplicateMatches(e){if(e.length<=1)return e;let r=[];for(let i of e)e.some(n=>i===n?!1:this.isMatchInRange(i,n))||r.push(i);return r}};var K0=We(po(),1);import BO from"path";var So=class{maxDepth=1;environment;eventEmitter;constructor(e,r){this.environment=e,this.eventEmitter=r||new nt}async execute(e,r,i={}){let s=Date.now(),n=new Ii(this.environment,r),a=await this.followDefinitions(e,n,this.maxDepth,i.where,r),o=Date.now()-s,c=a.map(l=>{let{depth:u,sourceMatch:d,...g}=l,h=d?[{file:d.file,text:d.text,range:d.range,language:d.language},...d.evidence||[]]:[];return{...g,source:h}});return{definitions:c,totalDefinitions:c.length,executionTime:o}}async followDefinitions(e,r,i,s,n){let a=[],o=new Set;for(let c of e)await this.followDefinitionsRecursive(c,r,0,i,s,a,o,c,n);return a}async followDefinitionsRecursive(e,r,i,s,n,a,o,c,l){if(i>=s)return;let u=`${e.file.path}:${e.range.start.line}:${e.range.start.column}`;if(o.has(u))return;o.add(u);let d=await r.findDefinitions(e);for(let g of d){let p={...await r.expandMatch(g)??g,language:l,depth:i,sourceMatch:c||e};n&&!this.matchesDefinitionFilter(p,n)||(a.push(p),i+1<s&&await this.followDefinitionsRecursive(g,r,i+1,s,n,a,o,c||e,l))}}matchesDefinitionFilter(e,r){return r.all?r.all.every(i=>this.matchesDefinitionFilter(e,i)):r.any?r.any.some(i=>this.matchesDefinitionFilter(e,i)):r.not?!this.matchesDefinitionFilter(e,r.not):!(r.file&&!this.matchesFileSpec(e.file.path,r.file)||r.function?.name)}matchesNameSpec(e,r){return r.equals?e===r.equals:r.anyOf?r.anyOf.includes(e):r.regex?new RegExp(r.regex).test(e):!0}matchesFileSpec(e,r){let i=BO.relative(this.environment.getWorkspaceRoot(),e);return r.path?i===r.path:r.glob?(0,K0.default)().add(r.glob).ignores(i):r.regex?new RegExp(r.regex).test(i):!0}};import{existsSync as UO}from"fs";import{dirname as GO,join as Ro}from"path";import{fileURLToPath as zO}from"url";var qO=zO(import.meta.url),Co=GO(qO);function Y0(){let t=process.platform,e=process.arch,r;if(t==="linux"&&e==="x64")r="x64-linux";else if(t==="linux"&&e==="arm64")r="arm64-linux";else if(t==="darwin"&&e==="x64")r="x64-darwin";else if(t==="darwin"&&e==="arm64")r="arm64-darwin";else if(t==="win32"&&e==="x64")r="x64-win32";else throw new Error(`Unsupported platform: ${t}-${e}. Supported platforms: x64-linux, arm64-linux, x64-darwin, arm64-darwin, x64-win32`);let i=t==="win32"?"rg.exe":"rg",s=[Ro(Co,"powerlint/dist/vendor/ripgrep",r,i),Ro(Co,"../../dist/vendor/ripgrep",r,i),Ro(Co,"../vendor/ripgrep",r,i),Ro(Co,"./vendor/ripgrep",r,i)];for(let n of s)if(UO(n))return n;throw new Error(`Bundled ripgrep binary not found for platform ${r}. Tried paths:
|
|
61
|
-
${
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
`)}var HO=Y0(),Ao=class{environment;eventEmitter;config;maxIterations;constructor(e,r,i,s){this.environment=r,this.eventEmitter=i||new nt,this.config=e,this.maxIterations=s||20}async executeTool(e,r,i,s){switch(r){case"read":{this.eventEmitter.llmToolExecution(e,"read",{file:i.target_file,offset:i.offset,limit:i.limit});let n=await B0(i,this.environment.getWorkspaceRoot());if(!("error"in n)){let a=i.target_file;s.some(o=>o.path===a)||s.push({path:a,sha:n.sha})}return"error"in n?n:n.content}case"grep":{this.eventEmitter.llmToolExecution(e,"grep",{path:i.path,pattern:i.pattern});let n=await U0(i,this.environment.getWorkspaceRoot(),[],HO);if(!("error"in n))for(let a of n.matches)s.some(o=>o.path===a.file)||s.push({path:a.file,sha:a.sha});return"error"in n?n:JSON.stringify(n.matches)}case"glob":{this.eventEmitter.llmToolExecution(e,"glob",{path:i.path,pattern:i.pattern});let n=await G0(i,this.environment.getWorkspaceRoot());return"error"in n?n:JSON.stringify(n.files)}default:return{error:`Unknown tool: ${r}`}}}async hydrateMatchesWithFileContent(e){let r=[];for(let i of e){let s=await Al(this.environment.getWorkspaceRoot(),i.file.path,i.range),n=i.evidence;if(i.evidence&&i.evidence.length>0){n=[];for(let a of i.evidence){let o=await Al(this.environment.getWorkspaceRoot(),a.file.path,a.range);n.push({...a,text:o})}}r.push({...i,text:s,evidence:n})}return r}async executeLLMValidation(e,r,i){let s=Date.now(),n=this.config.getLLMProvider();this.eventEmitter.startLLMValidation(e.id,r.length);let a=[],o=[],c=new Ke(0),l=new Ke(0),u=new Ke(0),d,g=[];for(let w=0;w<this.maxIterations;w++){let x=await n.search({rule:e,matches:r,tools:i,messages:a,files:o});if(x.usage&&(c=c.plus(new Ke(x.usage.inputTokens)),l=l.plus(new Ke(x.usage.outputTokens)),u=u.plus(new Ke(x.usage.cost))),x.type==="partial_matches"){let f=await this.hydrateMatchesWithFileContent(x.matches);g=[...g,...f],r=x.unresolved;continue}if(x.type==="matches"){let f=await this.hydrateMatchesWithFileContent(x.matches);d={...x,matches:[...g,...f]};break}if(x.type==="request_files"){for(let f of x.files)o.some(v=>v.path===f.path)||o.push({path:f.path,sha:f.sha});continue}if(x.type==="tool_request"){a.push({type:"tool_request",tool_calls:x.tool_calls});let f=await Promise.all(x.tool_calls.map(async v=>{let E=JSON.parse(v.function.arguments),_=await this.executeTool(e.id,v.function.name,E,o),O=typeof _=="string"?_:JSON.stringify(_);return{tool_call_id:v.id,content:O}}));for(let v of f)a.push({type:"tool_response",tool_call_id:v.tool_call_id,content:v.content});continue}}if(!d)throw new Error(`Max iterations (${this.maxIterations}) reached without getting matches`);let h=d.matches;if(h.length===0){let w=c.plus(l).toNumber();return this.eventEmitter.completeLLMValidation(e.id,w,c.toNumber(),l.toNumber(),u.toString(),Date.now()-s,0,!1),{matches:[],executionTime:Date.now()-s}}this.eventEmitter.startLLMValidationPhase(e.id,h.length);let p=[],m=h;for(;m.length>0;){let w=await n.validate({rule:e,matches:m,files:o});if(w.usage&&(c=c.plus(new Ke(w.usage.inputTokens)),l=l.plus(new Ke(w.usage.outputTokens)),u=u.plus(new Ke(w.usage.cost))),w.type==="partial_matches"){let x=await this.hydrateMatchesWithFileContent(w.matches);p=[...p,...x],console.log("partial matches",JSON.stringify(w,null,2)),m=w.unresolved;continue}if(w.type==="matches"){let x=await this.hydrateMatchesWithFileContent(w.matches);p=[...p,...x];break}}let y=p,b=c.plus(l).toNumber();return this.eventEmitter.completeLLMValidation(e.id,b,c.toNumber(),l.toNumber(),u.toString(),Date.now()-s,y.length,!1),{matches:y,executionTime:Date.now()-s}}async execute(e,r,i){return r.length===0?{matches:[],executionTime:0}:await this.executeLLMValidation(e,r,i)}};var Lo=class{fileFilterStep;findMatchesStep;gotoDefinitionStep;llmStep;environment;executionContext;currentMode;eventEmitter;config;constructor(e,r,i){this.environment=r,this.eventEmitter=i||new nt,this.config=e,this.fileFilterStep=new go(this.environment),this.findMatchesStep=new _o(this.environment,this.eventEmitter),this.gotoDefinitionStep=new So(this.environment,this.eventEmitter),this.llmStep=new Ao(this.config,this.environment,this.eventEmitter)}async executeStep(e,r,i,s,n,a,o){let c=i.type;if(c==="ast-grep"){let{type:l,language:u,...d}=i;return{matches:(await this.findMatchesStep.execute(d,u,{filePaths:s,previousMatches:n})).matches}}if(c==="ripgrep"){let{type:l,...u}=i;return{matches:(await this.findMatchesStep.execute(u,"Unknown",{filePaths:s,previousMatches:n})).matches}}if(c==="step-group"){let l=[];for(let u=0;u<i.steps.length;u++){let d=i.steps[u],g=`${r}[${u}]`;this.eventEmitter.startStep(e.id,g,d.type,{filePaths:s,matches:n},r);let h=Date.now(),p=await this.executeStep(e,g,d,s,n,a,r),m=Date.now()-h;this.eventEmitter.completeStep(e.id,g,d.type,p,m,r),p.matches&&(l=l.concat(p.matches))}return{matches:l}}if(c==="file-filter")return{filePaths:(await this.fileFilterStep.execute(s,{include:i.include,ignore:i.ignore,conditions:i.conditions})).filteredPaths};if(c==="goto-definition")throw new Error("goto-definition step is disabled");if(c==="llm")return n.length===0?{matches:[]}:{matches:(await this.llmStep.execute(e,n,i.tools??[])).matches};throw new Error(`Unknown step type: ${c}`)}async executeRule(e,r){let i=e.id,s=e.config,n=[...this.executionContext.filePaths],a=[];for(let c of s.steps){let l=c.id,u=c.step;this.eventEmitter.startStep(i,l,u.type,{filePaths:n,matches:a});let d=Date.now(),g=await this.executeStep(e,l,u,n,a,r),h=Date.now()-d;if(this.eventEmitter.completeStep(i,l,u.type,g,h),g.filePaths!==void 0&&(n=this.executionContext.filterFiles(g.filePaths),a=this.executionContext.filterMatchesByFilePaths(a,n)),g.matches!==void 0&&(a=this.executionContext.filterMatches(g.matches)),n.length===0)break}let o=a.sort((c,l)=>c.file.path.localeCompare(l.file.path));return{ruleId:i,matches:o}}getPoolSize(){let e=KO().length;return Math.max(2,Math.min(8,e))}async execute(e,r){if(this.currentMode&&this.currentMode!==r.mode)throw new Error(`Execution mode mismatch: expected ${this.currentMode}, got ${r.mode}`);(!this.executionContext||this.currentMode!==r.mode)&&(this.executionContext=await mo.initialize(this.config,this.environment,r.mode,this.eventEmitter,r.filePath,r.diffOptions),this.currentMode=r.mode),this.eventEmitter.startRules(e.length);let i=this.getPoolSize(),s=[],n=[...e],a=async u=>{let d=u.id,g=!1;for(let p of u.config.steps)if(p.step.type==="llm"){g=!0;break}this.eventEmitter.emit("rules:rule-start",{ruleId:d,isLlm:g,message:u.config.message,severity:u.config.severity});let h=await this.executeRule(u,r);return this.eventEmitter.emit("rules:rule-complete",{ruleId:d}),h};await(async()=>{let u=async()=>{if(n.length===0)return;let g=n.shift(),h=await a(g);s.push(h),await u()},d=[];for(let g=0;g<Math.min(i,e.length);g++)d.push(u());await Promise.all(d)})();let c=new Map(e.map((u,d)=>[u.id,d]));s.sort((u,d)=>{let g=c.get(u.ruleId)??0,h=c.get(d.ruleId)??0;return g-h});let l=s.reduce((u,d)=>u+d.matches.length,0);return this.eventEmitter.completeRules(e.length,l),s}};var Oo=class extends Error{constructor(r,i,s){super(`Invalid rule format in '${r}': ${i}`);this.validationErrors=s;this.name="InvalidRuleFormatError"}};import{stripVTControlCharacters as py}from"node:util";import Do from"node:process";import ty from"node:process";import Io from"node:process";var YO=(t,e,r,i)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let s=Object.getOwnPropertyDescriptor(t,r),n=Object.getOwnPropertyDescriptor(e,r);!XO(s,n)&&i||Object.defineProperty(t,r,n)},XO=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},JO=(t,e)=>{let r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},ZO=(t,e)=>`/* Wrapped ${t}*/
|
|
65
|
-
${e}`,QO=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),e$=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),t$=(t,e,r)=>{let i=r===""?"":`with ${r.trim()}() `,s=ZO.bind(null,i,e.toString());Object.defineProperty(s,"name",e$);let{writable:n,enumerable:a,configurable:o}=QO;Object.defineProperty(t,"toString",{value:s,writable:n,enumerable:a,configurable:o})};function Ll(t,e,{ignoreNonConfigurable:r=!1}={}){let{name:i}=t;for(let s of Reflect.ownKeys(e))YO(t,e,s,r);return JO(t,e),t$(t,e,i),t}var $o=new WeakMap,X0=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,i=0,s=t.displayName||t.name||"<anonymous>",n=function(...a){if($o.set(n,++i),i===1)r=t.apply(this,a),t=void 0;else if(e.throw===!0)throw new Error(`Function \`${s}\` can only be called once`);return r};return Ll(n,t),$o.set(n,i),n};X0.callCount=t=>{if(!$o.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return $o.get(t)};var J0=X0;var kr=[];kr.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&kr.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&kr.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var To=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",Ol=Symbol.for("signal-exit emitter"),$l=globalThis,r$=Object.defineProperty.bind(Object),Tl=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if($l[Ol])return $l[Ol];r$($l,Ol,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let i=this.listeners[e],s=i.indexOf(r);s!==-1&&(s===0&&i.length===1?i.length=0:i.splice(s,1))}emit(e,r,i){if(this.emitted[e])return!1;this.emitted[e]=!0;let s=!1;for(let n of this.listeners[e])s=n(r,i)===!0||s;return e==="exit"&&(s=this.emit("afterExit",r,i)||s),s}},Po=class{},i$=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),Pl=class extends Po{onExit(){return()=>{}}load(){}unload(){}},Il=class extends Po{#t=Fl.platform==="win32"?"SIGINT":"SIGHUP";#r=new Tl;#e;#n;#h;#w={};#a=!1;constructor(e){super(),this.#e=e,this.#w={};for(let r of kr)this.#w[r]=()=>{let i=this.#e.listeners(r),{count:s}=this.#r,n=e;if(typeof n.__signal_exit_emitter__=="object"&&typeof n.__signal_exit_emitter__.count=="number"&&(s+=n.__signal_exit_emitter__.count),i.length===s){this.unload();let a=this.#r.emit("exit",null,r),o=r==="SIGHUP"?this.#t:r;a||e.kill(e.pid,o)}};this.#h=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!To(this.#e))return()=>{};this.#a===!1&&this.load();let i=r?.alwaysLast?"afterExit":"exit";return this.#r.on(i,e),()=>{this.#r.removeListener(i,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#a){this.#a=!0,this.#r.count+=1;for(let e of kr)try{let r=this.#w[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#s(e,...r),this.#e.reallyExit=e=>this.#u(e)}}unload(){this.#a&&(this.#a=!1,kr.forEach(e=>{let r=this.#w[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#h,this.#r.count-=1)}#u(e){return To(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#h.call(this.#e,this.#e.exitCode)):0}#s(e,...r){let i=this.#n;if(e==="exit"&&To(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let s=i.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),s}else return i.call(this.#e,e,...r)}},Fl=globalThis.process,{onExit:Z0,load:VD,unload:HD}=i$(To(Fl)?new Il(Fl):new Pl);var Q0=Io.stderr.isTTY?Io.stderr:Io.stdout.isTTY?Io.stdout:void 0,s$=Q0?J0(()=>{Z0(()=>{Q0.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},ey=s$;var Fo=!1,Fi={};Fi.show=(t=ty.stderr)=>{t.isTTY&&(Fo=!1,t.write("\x1B[?25h"))};Fi.hide=(t=ty.stderr)=>{t.isTTY&&(ey(),Fo=!0,t.write("\x1B[?25l"))};Fi.toggle=(t,e)=>{t!==void 0&&(Fo=t),Fo?Fi.show(e):Fi.hide(e)};var Nl=Fi;var Dl={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots14:{interval:80,frames:["\u2809\u2809","\u2808\u2819","\u2800\u2839","\u2800\u28B8","\u2800\u28F0","\u2880\u28E0","\u28C0\u28C0","\u28C4\u2840","\u28C6\u2800","\u2847\u2800","\u280F\u2800","\u280B\u2801"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},dotsCircle:{interval:80,frames:["\u288E ","\u280E\u2801","\u280A\u2811","\u2808\u2831"," \u2871","\u2880\u2870","\u2884\u2860","\u2886\u2840"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u{1F497} "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}};var Ns=Dl,sM=Object.keys(Dl);var jr={};jo(jr,{error:()=>h$,info:()=>c$,success:()=>l$,warning:()=>u$});import o$ from"node:tty";var a$=o$?.WriteStream?.prototype?.hasColors?.()??!1,oe=(t,e)=>{if(!a$)return s=>s;let r=`\x1B[${t}m`,i=`\x1B[${e}m`;return s=>{let n=s+"",a=n.indexOf(i);if(a===-1)return r+n+i;let o=r,c=0;for(;a!==-1;)o+=n.slice(c,a)+r,c=a+i.length,a=n.indexOf(i,c);return o+=n.slice(c)+i,o}},aM=oe(0,0),cM=oe(1,22),lM=oe(2,22),uM=oe(3,23),hM=oe(4,24),fM=oe(53,55),pM=oe(7,27),dM=oe(8,28),mM=oe(9,29),gM=oe(30,39),ry=oe(31,39),iy=oe(32,39),sy=oe(33,39),ny=oe(34,39),yM=oe(35,39),bM=oe(36,39),vM=oe(37,39),wM=oe(90,39),xM=oe(40,49),EM=oe(41,49),_M=oe(42,49),SM=oe(43,49),RM=oe(44,49),CM=oe(45,49),AM=oe(46,49),LM=oe(47,49),OM=oe(100,49),$M=oe(91,39),TM=oe(92,39),PM=oe(93,39),IM=oe(94,39),FM=oe(95,39),NM=oe(96,39),DM=oe(97,39),MM=oe(101,49),kM=oe(102,49),jM=oe(103,49),BM=oe(104,49),UM=oe(105,49),GM=oe(106,49),zM=oe(107,49);import oy from"node:process";function Ds(){let{env:t}=oy,{TERM:e,TERM_PROGRAM:r}=t;return oy.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var No=Ds(),c$=ny(No?"\u2139":"i"),l$=iy(No?"\u2714":"\u221A"),u$=sy(No?"\u26A0":"\u203C"),h$=ry(No?"\u2716":"\xD7");function Ml({onlyFirst:t=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,t?void 0:"g")}var f$=Ml();function Ms(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(f$,"")}function ay(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function cy(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function ly(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101631&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129673||t>=129679&&t<=129734||t>=129742&&t<=129756||t>=129759&&t<=129769||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function p$(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function kl(t,{ambiguousAsWide:e=!1}={}){return p$(t),cy(t)||ly(t)||e&&ay(t)?2:1}var d$=new Intl.Segmenter,m$=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark}|\\p{Surrogate})+$","v"),g$=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+","v"),y$=new RegExp("^\\p{RGI_Emoji}$","v");function b$(t){return t.replace(g$,"")}function v$(t){return m$.test(t)}function w$(t,e){let r=0;if(t.length>1)for(let i of t.slice(1))i>="\uFF00"&&i<="\uFFEF"&&(r+=kl(i.codePointAt(0),e));return r}function jl(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:i=!1}=e,s=t;if(i||(s=Ms(s)),s.length===0)return 0;let n=0,a={ambiguousAsWide:!r};for(let{segment:o}of d$.segment(s)){if(v$(o))continue;if(y$.test(o)){n+=2;continue}let c=b$(o).codePointAt(0);n+=kl(c,a),n+=w$(o,a)}return n}function Bl({stream:t=process.stdout}={}){return!!(t&&t.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import Rt from"node:process";var x$=3,Ul=class{#t=0;start(){this.#t++,this.#t===1&&this.#r()}stop(){if(this.#t<=0)throw new Error("`stop` called more times than `start`");this.#t--,this.#t===0&&this.#e()}#r(){Rt.platform==="win32"||!Rt.stdin.isTTY||(Rt.stdin.setRawMode(!0),Rt.stdin.on("data",this.#n),Rt.stdin.resume())}#e(){Rt.stdin.isTTY&&(Rt.stdin.off("data",this.#n),Rt.stdin.pause(),Rt.stdin.setRawMode(!1))}#n(e){e[0]===x$&&Rt.emit("SIGINT")}},E$=new Ul,Gl=E$;var zl=class{#t=0;#r=!1;#e=0;#n=-1;#h=0;#w=0;#a;#u;#s;#c;#i;#l;#o;#d;#g;#y;#p;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#a={color:"cyan",stream:Do.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#a.color,this.spinner=this.#a.spinner,this.#i=this.#a.interval,this.#s=this.#a.stream,this.#l=typeof this.#a.isEnabled=="boolean"?this.#a.isEnabled:Bl({stream:this.#s}),this.#o=typeof this.#a.isSilent=="boolean"?this.#a.isSilent:!1,this.text=this.#a.text,this.prefixText=this.#a.prefixText,this.suffixText=this.#a.suffixText,this.indent=this.#a.indent,Do.env.NODE_ENV==="test"&&(this._stream=this.#s,this._isEnabled=this.#l,Object.defineProperty(this,"_linesToClear",{get(){return this.#t},set(r){this.#t=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#n}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}))}get indent(){return this.#d}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#d=e,this.#S()}get interval(){return this.#i??this.#u.interval??100}get spinner(){return this.#u}set spinner(e){if(this.#n=-1,this.#i=void 0,typeof e=="object"){if(!Array.isArray(e.frames)||e.frames.length===0||e.frames.some(r=>typeof r!="string"))throw new Error("The given spinner must have a non-empty `frames` array of strings");if(e.interval!==void 0&&!(Number.isInteger(e.interval)&&e.interval>0))throw new Error("`spinner.interval` must be a positive integer if provided");this.#u=e}else if(!Ds())this.#u=Ns.line;else if(e===void 0)this.#u=Ns.dots;else if(e!=="default"&&Ns[e])this.#u=Ns[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#g}set text(e=""){this.#g=e,this.#S()}get prefixText(){return this.#y}set prefixText(e=""){this.#y=e,this.#S()}get suffixText(){return this.#p}set suffixText(e=""){this.#p=e,this.#S()}get isSpinning(){return this.#c!==void 0}#C(e,r,i=!1){let s=typeof e=="function"?e():e;return typeof s=="string"&&s!==""?i?r+s:s+r:""}#x(e=this.#y,r=" "){return this.#C(e,r,!1)}#E(e=this.#p,r=" "){return this.#C(e,r,!0)}#_(e,r){let i=0;for(let s of Ms(e).split(`
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
39
|
+
${u}`,i=`${u}${i}`)}i+=`
|
|
40
|
+
`;let n=u=>{console.log(i),sl.exit(typeof u=="number"?u:2)},a=()=>{console.log(e.version),sl.exit(0)};s._.length===0&&e.argv.length===1&&(s.version===!0&&e.autoVersion?a():s.help===!0&&e.autoHelp&&n(0));let o=s._;delete s._,e.allowUnknownFlags||gd(o);let c=Yh(s,{exclude:["--",/^\w$/]}),l={...c};md(c,e);for(let u of Object.values(e.flags)){if(Array.isArray(u.aliases))for(let p of u.aliases)delete c[p];delete c[u.shortFlag]}return yd(e.flags,c,o),{input:o,flags:c,unnormalizedFlags:l,pkg:t,help:i,showHelp:n,showVersion:a}},vd=(t,e={})=>{let r=hd(t,e),s=dd(r),i=z1(r,s);return sl.title=i.pkg.bin?Object.keys(i.pkg.bin).at(0):i.pkg.name,i};var Kb=nt(El(),1);var dm=nt(fm(),1);var BR=Object.prototype.toString,UR=t=>BR.call(t)==="[object Error]",GR=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);function Sl(t){return t&&UR(t)&&t.name==="TypeError"&&typeof t.message=="string"?t.message==="Load failed"?t.stack===void 0:GR.has(t.message):!1}var Rl=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},hm=(t,e,r)=>{let s=r.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=s,t};async function Al(t,e){return new Promise((r,s)=>{e={...e},e.onFailedAttempt??=()=>{},e.shouldRetry??=()=>!0,e.retries??=10;let i=dm.default.operation(e),n=()=>{i.stop(),s(e.signal?.reason)};e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",n,{once:!0});let a=()=>{e.signal?.removeEventListener("abort",n),i.stop()};i.attempt(async o=>{try{let c=await t(o);a(),r(c)}catch(c){try{if(!(c instanceof Error))throw new TypeError(`Non-error was thrown: "${c}". You should only throw errors.`);if(c instanceof Rl)throw c.originalError;if(c instanceof TypeError&&!Sl(c))throw c;if(hm(c,o,e),await e.shouldRetry(c)||(i.stop(),s(c)),await e.onFailedAttempt(c),!i.retry(c))throw i.mainError()}catch(l){hm(l,o,e),a(),s(l)}}})})}var $={};rc($,{BRAND:()=>pA,DIRTY:()=>Ur,EMPTY_PATH:()=>VR,INVALID:()=>ie,NEVER:()=>XA,OK:()=>Ze,ParseStatus:()=>Ge,Schema:()=>ge,ZodAny:()=>_r,ZodArray:()=>sr,ZodBigInt:()=>zr,ZodBoolean:()=>qr,ZodBranded:()=>rn,ZodCatch:()=>ts,ZodDate:()=>Wr,ZodDefault:()=>es,ZodDiscriminatedUnion:()=>Ao,ZodEffects:()=>_t,ZodEnum:()=>Xr,ZodError:()=>ot,ZodFirstPartyTypeKind:()=>ae,ZodFunction:()=>Oo,ZodIntersection:()=>Kr,ZodIssueCode:()=>N,ZodLazy:()=>Yr,ZodLiteral:()=>Jr,ZodMap:()=>Xs,ZodNaN:()=>ei,ZodNativeEnum:()=>Qr,ZodNever:()=>Pt,ZodNull:()=>Zr,ZodNullable:()=>qt,ZodNumber:()=>Gr,ZodObject:()=>at,ZodOptional:()=>vt,ZodParsedType:()=>q,ZodPipeline:()=>sn,ZodPromise:()=>wr,ZodReadonly:()=>rs,ZodRecord:()=>Co,ZodSchema:()=>ge,ZodSet:()=>Qs,ZodString:()=>br,ZodSymbol:()=>Ys,ZodTransformer:()=>_t,ZodTuple:()=>zt,ZodType:()=>ge,ZodUndefined:()=>Vr,ZodUnion:()=>Hr,ZodUnknown:()=>rr,ZodVoid:()=>Js,addIssueToContext:()=>U,any:()=>EA,array:()=>CA,bigint:()=>vA,boolean:()=>Sm,coerce:()=>JA,custom:()=>wm,date:()=>bA,datetimeRegex:()=>bm,defaultErrorMap:()=>er,discriminatedUnion:()=>$A,effect:()=>zA,enum:()=>BA,function:()=>FA,getErrorMap:()=>Zs,getParsedType:()=>Gt,instanceof:()=>gA,intersection:()=>PA,isAborted:()=>So,isAsync:()=>Hs,isDirty:()=>Ro,isValid:()=>vr,late:()=>mA,lazy:()=>MA,literal:()=>jA,makeIssue:()=>tn,map:()=>NA,nan:()=>yA,nativeEnum:()=>UA,never:()=>RA,null:()=>xA,nullable:()=>WA,number:()=>Em,object:()=>OA,objectUtil:()=>Cl,oboolean:()=>YA,onumber:()=>KA,optional:()=>qA,ostring:()=>HA,pipeline:()=>ZA,preprocess:()=>VA,promise:()=>GA,quotelessJson:()=>zR,record:()=>kA,set:()=>DA,setErrorMap:()=>WR,strictObject:()=>TA,string:()=>xm,symbol:()=>_A,transformer:()=>zA,tuple:()=>IA,undefined:()=>wA,union:()=>LA,unknown:()=>SA,util:()=>ye,void:()=>AA});var ye;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let n={};for(let a of i)n[a]=a;return n},t.getValidEnumValues=i=>{let n=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),a={};for(let o of n)a[o]=i[o];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(n){return i[n]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let n=[];for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&n.push(a);return n},t.find=(i,n)=>{for(let a of i)if(n(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function s(i,n=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(n)}t.joinValues=s,t.jsonStringifyReplacer=(i,n)=>typeof n=="bigint"?n.toString():n})(ye||(ye={}));var Cl;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Cl||(Cl={}));var q=ye.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Gt=t=>{switch(typeof t){case"undefined":return q.undefined;case"string":return q.string;case"number":return Number.isNaN(t)?q.nan:q.number;case"boolean":return q.boolean;case"function":return q.function;case"bigint":return q.bigint;case"symbol":return q.symbol;case"object":return Array.isArray(t)?q.array:t===null?q.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?q.promise:typeof Map<"u"&&t instanceof Map?q.map:typeof Set<"u"&&t instanceof Set?q.set:typeof Date<"u"&&t instanceof Date?q.date:q.object;default:return q.unknown}};var N=ye.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),zR=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),ot=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(n){return n.message},s={_errors:[]},i=n=>{for(let a of n.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)s._errors.push(r(a));else{let o=s,c=0;for(;c<a.path.length;){let l=a.path[c];c===a.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(r(a))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return i(this),s}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ye.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},s=[];for(let i of this.issues)if(i.path.length>0){let n=i.path[0];r[n]=r[n]||[],r[n].push(e(i))}else s.push(e(i));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}};ot.create=t=>new ot(t);var qR=(t,e)=>{let r;switch(t.code){case N.invalid_type:t.received===q.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ye.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:r=`Unrecognized key(s) in object: ${ye.joinValues(t.keys,", ")}`;break;case N.invalid_union:r="Invalid input";break;case N.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ye.joinValues(t.options)}`;break;case N.invalid_enum_value:r=`Invalid enum value. Expected ${ye.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:r="Invalid function arguments";break;case N.invalid_return_type:r="Invalid function return type";break;case N.invalid_date:r="Invalid date";break;case N.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ye.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case N.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case N.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case N.custom:r="Invalid input";break;case N.invalid_intersection_types:r="Intersection results could not be merged";break;case N.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:r="Number must be finite";break;default:r=e.defaultError,ye.assertNever(t)}return{message:r}},er=qR;var pm=er;function WR(t){pm=t}function Zs(){return pm}var tn=t=>{let{data:e,path:r,errorMaps:s,issueData:i}=t,n=[...r,...i.path||[]],a={...i,path:n};if(i.message!==void 0)return{...i,path:n,message:i.message};let o="",c=s.filter(l=>!!l).slice().reverse();for(let l of c)o=l(a,{data:e,defaultError:o}).message;return{...i,path:n,message:o}},VR=[];function U(t,e){let r=Zs(),s=tn({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===er?void 0:er].filter(i=>!!i)});t.common.issues.push(s)}var Ge=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let s=[];for(let i of r){if(i.status==="aborted")return ie;i.status==="dirty"&&e.dirty(),s.push(i.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,r){let s=[];for(let i of r){let n=await i.key,a=await i.value;s.push({key:n,value:a})}return t.mergeObjectSync(e,s)}static mergeObjectSync(e,r){let s={};for(let i of r){let{key:n,value:a}=i;if(n.status==="aborted"||a.status==="aborted")return ie;n.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(s[n.value]=a.value)}return{status:e.value,value:s}}},ie=Object.freeze({status:"aborted"}),Ur=t=>({status:"dirty",value:t}),Ze=t=>({status:"valid",value:t}),So=t=>t.status==="aborted",Ro=t=>t.status==="dirty",vr=t=>t.status==="valid",Hs=t=>typeof Promise<"u"&&t instanceof Promise;var Q;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Q||(Q={}));var bt=class{constructor(e,r,s,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=s,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},mm=(t,e)=>{if(vr(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new ot(t.common.issues);return this._error=r,this._error}}};function he(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:s,description:i}=t;if(e&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(a,o)=>{let{message:c}=t;return a.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??s??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:c??r??o.defaultError}},description:i}}var ge=class{get description(){return this._def.description}_getType(e){return Gt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Gt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ge,ctx:{common:e.parent.common,data:e.data,parsedType:Gt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Hs(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let s=this.safeParse(e,r);if(s.success)return s.data;throw s.error}safeParse(e,r){let s={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Gt(e)},i=this._parseSync({data:e,path:s.path,parent:s});return mm(s,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Gt(e)};if(!this["~standard"].async)try{let s=this._parseSync({data:e,path:[],parent:r});return vr(s)?{value:s.value}:{issues:r.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(s=>vr(s)?{value:s.value}:{issues:r.common.issues})}async parseAsync(e,r){let s=await this.safeParseAsync(e,r);if(s.success)return s.data;throw s.error}async safeParseAsync(e,r){let s={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Gt(e)},i=this._parse({data:e,path:s.path,parent:s}),n=await(Hs(i)?i:Promise.resolve(i));return mm(s,n)}refine(e,r){let s=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,n)=>{let a=e(i),o=()=>n.addIssue({code:N.custom,...s(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,r){return this._refinement((s,i)=>e(s)?!0:(i.addIssue(typeof r=="function"?r(s,i):r),!1))}_refinement(e){return new _t({schema:this,typeName:ae.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return vt.create(this,this._def)}nullable(){return qt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sr.create(this)}promise(){return wr.create(this,this._def)}or(e){return Hr.create([this,e],this._def)}and(e){return Kr.create(this,e,this._def)}transform(e){return new _t({...he(this._def),schema:this,typeName:ae.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new es({...he(this._def),innerType:this,defaultValue:r,typeName:ae.ZodDefault})}brand(){return new rn({typeName:ae.ZodBranded,type:this,...he(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new ts({...he(this._def),innerType:this,catchValue:r,typeName:ae.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return sn.create(this,e)}readonly(){return rs.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},ZR=/^c[^\s-]{8,}$/i,HR=/^[0-9a-z]+$/,KR=/^[0-9A-HJKMNP-TV-Z]{26}$/i,YR=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,JR=/^[a-z0-9_-]{21}$/i,XR=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,QR=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,eA=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ol,rA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,sA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,iA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,nA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,oA=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aA=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ym="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",cA=new RegExp(`^${ym}$`);function vm(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function lA(t){return new RegExp(`^${vm(t)}$`)}function bm(t){let e=`${ym}T${vm(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function uA(t,e){return!!((e==="v4"||!e)&&rA.test(t)||(e==="v6"||!e)&&iA.test(t))}function fA(t,e){if(!XR.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let s=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(s));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function hA(t,e){return!!((e==="v4"||!e)&&sA.test(t)||(e==="v6"||!e)&&nA.test(t))}var br=class t extends ge{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==q.string){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:q.string,received:n.parsedType}),ie}let s=new Ge,i;for(let n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="max")e.data.length>n.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="length"){let a=e.data.length>n.value,o=e.data.length<n.value;(a||o)&&(i=this._getOrReturnCtx(e,i),a?U(i,{code:N.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):o&&U(i,{code:N.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),s.dirty())}else if(n.kind==="email")eA.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"email",code:N.invalid_string,message:n.message}),s.dirty());else if(n.kind==="emoji")Ol||(Ol=new RegExp(tA,"u")),Ol.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"emoji",code:N.invalid_string,message:n.message}),s.dirty());else if(n.kind==="uuid")YR.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"uuid",code:N.invalid_string,message:n.message}),s.dirty());else if(n.kind==="nanoid")JR.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"nanoid",code:N.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid")ZR.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid",code:N.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid2")HR.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid2",code:N.invalid_string,message:n.message}),s.dirty());else if(n.kind==="ulid")KR.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ulid",code:N.invalid_string,message:n.message}),s.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),U(i,{validation:"url",code:N.invalid_string,message:n.message}),s.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"regex",code:N.invalid_string,message:n.message}),s.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),s.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{startsWith:n.value},message:n.message}),s.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{endsWith:n.value},message:n.message}),s.dirty()):n.kind==="datetime"?bm(n).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"datetime",message:n.message}),s.dirty()):n.kind==="date"?cA.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"date",message:n.message}),s.dirty()):n.kind==="time"?lA(n).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"time",message:n.message}),s.dirty()):n.kind==="duration"?QR.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"duration",code:N.invalid_string,message:n.message}),s.dirty()):n.kind==="ip"?uA(e.data,n.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ip",code:N.invalid_string,message:n.message}),s.dirty()):n.kind==="jwt"?fA(e.data,n.alg)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"jwt",code:N.invalid_string,message:n.message}),s.dirty()):n.kind==="cidr"?hA(e.data,n.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cidr",code:N.invalid_string,message:n.message}),s.dirty()):n.kind==="base64"?oA.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64",code:N.invalid_string,message:n.message}),s.dirty()):n.kind==="base64url"?aA.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64url",code:N.invalid_string,message:n.message}),s.dirty()):ye.assertNever(n);return{status:s.value,value:e.data}}_regex(e,r,s){return this.refinement(i=>e.test(i),{validation:r,code:N.invalid_string,...Q.errToObj(s)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Q.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Q.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Q.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Q.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Q.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Q.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Q.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Q.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Q.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Q.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Q.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Q.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Q.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Q.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Q.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Q.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Q.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Q.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Q.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Q.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Q.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Q.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Q.errToObj(r)})}nonempty(e){return this.min(1,Q.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};br.create=t=>new br({checks:[],typeName:ae.ZodString,coerce:t?.coerce??!1,...he(t)});function dA(t,e){let r=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,i=r>s?r:s,n=Number.parseInt(t.toFixed(i).replace(".","")),a=Number.parseInt(e.toFixed(i).replace(".",""));return n%a/10**i}var Gr=class t extends ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==q.number){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:q.number,received:n.parsedType}),ie}let s,i=new Ge;for(let n of this._def.checks)n.kind==="int"?ye.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),U(s,{code:N.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),U(s,{code:N.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),U(s,{code:N.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="multipleOf"?dA(e.data,n.value)!==0&&(s=this._getOrReturnCtx(e,s),U(s,{code:N.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),U(s,{code:N.not_finite,message:n.message}),i.dirty()):ye.assertNever(n);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Q.toString(r))}setLimit(e,r,s,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:Q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Q.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Q.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Q.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Q.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Q.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ye.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Gr.create=t=>new Gr({checks:[],typeName:ae.ZodNumber,coerce:t?.coerce||!1,...he(t)});var zr=class t extends ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==q.bigint)return this._getInvalidInput(e);let s,i=new Ge;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),U(s,{code:N.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),U(s,{code:N.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),U(s,{code:N.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):ye.assertNever(n);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return U(r,{code:N.invalid_type,expected:q.bigint,received:r.parsedType}),ie}gte(e,r){return this.setLimit("min",e,!0,Q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Q.toString(r))}setLimit(e,r,s,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:Q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Q.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};zr.create=t=>new zr({checks:[],typeName:ae.ZodBigInt,coerce:t?.coerce??!1,...he(t)});var qr=class extends ge{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==q.boolean){let s=this._getOrReturnCtx(e);return U(s,{code:N.invalid_type,expected:q.boolean,received:s.parsedType}),ie}return Ze(e.data)}};qr.create=t=>new qr({typeName:ae.ZodBoolean,coerce:t?.coerce||!1,...he(t)});var Wr=class t extends ge{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==q.date){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:q.date,received:n.parsedType}),ie}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_date}),ie}let s=new Ge,i;for(let n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),s.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),s.dirty()):ye.assertNever(n);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Q.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Q.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Wr.create=t=>new Wr({checks:[],coerce:t?.coerce||!1,typeName:ae.ZodDate,...he(t)});var Ys=class extends ge{_parse(e){if(this._getType(e)!==q.symbol){let s=this._getOrReturnCtx(e);return U(s,{code:N.invalid_type,expected:q.symbol,received:s.parsedType}),ie}return Ze(e.data)}};Ys.create=t=>new Ys({typeName:ae.ZodSymbol,...he(t)});var Vr=class extends ge{_parse(e){if(this._getType(e)!==q.undefined){let s=this._getOrReturnCtx(e);return U(s,{code:N.invalid_type,expected:q.undefined,received:s.parsedType}),ie}return Ze(e.data)}};Vr.create=t=>new Vr({typeName:ae.ZodUndefined,...he(t)});var Zr=class extends ge{_parse(e){if(this._getType(e)!==q.null){let s=this._getOrReturnCtx(e);return U(s,{code:N.invalid_type,expected:q.null,received:s.parsedType}),ie}return Ze(e.data)}};Zr.create=t=>new Zr({typeName:ae.ZodNull,...he(t)});var _r=class extends ge{constructor(){super(...arguments),this._any=!0}_parse(e){return Ze(e.data)}};_r.create=t=>new _r({typeName:ae.ZodAny,...he(t)});var rr=class extends ge{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ze(e.data)}};rr.create=t=>new rr({typeName:ae.ZodUnknown,...he(t)});var Pt=class extends ge{_parse(e){let r=this._getOrReturnCtx(e);return U(r,{code:N.invalid_type,expected:q.never,received:r.parsedType}),ie}};Pt.create=t=>new Pt({typeName:ae.ZodNever,...he(t)});var Js=class extends ge{_parse(e){if(this._getType(e)!==q.undefined){let s=this._getOrReturnCtx(e);return U(s,{code:N.invalid_type,expected:q.void,received:s.parsedType}),ie}return Ze(e.data)}};Js.create=t=>new Js({typeName:ae.ZodVoid,...he(t)});var sr=class t extends ge{_parse(e){let{ctx:r,status:s}=this._processInputParams(e),i=this._def;if(r.parsedType!==q.array)return U(r,{code:N.invalid_type,expected:q.array,received:r.parsedType}),ie;if(i.exactLength!==null){let a=r.data.length>i.exactLength.value,o=r.data.length<i.exactLength.value;(a||o)&&(U(r,{code:a?N.too_big:N.too_small,minimum:o?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),s.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(U(r,{code:N.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),s.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(U(r,{code:N.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((a,o)=>i.type._parseAsync(new bt(r,a,r.path,o)))).then(a=>Ge.mergeArray(s,a));let n=[...r.data].map((a,o)=>i.type._parseSync(new bt(r,a,r.path,o)));return Ge.mergeArray(s,n)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Q.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Q.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Q.toString(r)}})}nonempty(e){return this.min(1,e)}};sr.create=(t,e)=>new sr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ae.ZodArray,...he(e)});function Ks(t){if(t instanceof at){let e={};for(let r in t.shape){let s=t.shape[r];e[r]=vt.create(Ks(s))}return new at({...t._def,shape:()=>e})}else return t instanceof sr?new sr({...t._def,type:Ks(t.element)}):t instanceof vt?vt.create(Ks(t.unwrap())):t instanceof qt?qt.create(Ks(t.unwrap())):t instanceof zt?zt.create(t.items.map(e=>Ks(e))):t}var at=class t extends ge{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=ye.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==q.object){let l=this._getOrReturnCtx(e);return U(l,{code:N.invalid_type,expected:q.object,received:l.parsedType}),ie}let{status:s,ctx:i}=this._processInputParams(e),{shape:n,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Pt&&this._def.unknownKeys==="strip"))for(let l in i.data)a.includes(l)||o.push(l);let c=[];for(let l of a){let u=n[l],p=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new bt(i,p,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Pt){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of o)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")o.length>0&&(U(i,{code:N.unrecognized_keys,keys:o}),s.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of o){let p=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new bt(i,p,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let p=await u.key,g=await u.value;l.push({key:p,value:g,alwaysSet:u.alwaysSet})}return l}).then(l=>Ge.mergeObjectSync(s,l)):Ge.mergeObjectSync(s,c)}get shape(){return this._def.shape()}strict(e){return Q.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,s)=>{let i=this._def.errorMap?.(r,s).message??s.defaultError;return r.code==="unrecognized_keys"?{message:Q.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ae.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let s of ye.objectKeys(e))e[s]&&this.shape[s]&&(r[s]=this.shape[s]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let s of ye.objectKeys(this.shape))e[s]||(r[s]=this.shape[s]);return new t({...this._def,shape:()=>r})}deepPartial(){return Ks(this)}partial(e){let r={};for(let s of ye.objectKeys(this.shape)){let i=this.shape[s];e&&!e[s]?r[s]=i:r[s]=i.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let s of ye.objectKeys(this.shape))if(e&&!e[s])r[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof vt;)n=n._def.innerType;r[s]=n}return new t({...this._def,shape:()=>r})}keyof(){return _m(ye.objectKeys(this.shape))}};at.create=(t,e)=>new at({shape:()=>t,unknownKeys:"strip",catchall:Pt.create(),typeName:ae.ZodObject,...he(e)});at.strictCreate=(t,e)=>new at({shape:()=>t,unknownKeys:"strict",catchall:Pt.create(),typeName:ae.ZodObject,...he(e)});at.lazycreate=(t,e)=>new at({shape:t,unknownKeys:"strip",catchall:Pt.create(),typeName:ae.ZodObject,...he(e)});var Hr=class extends ge{_parse(e){let{ctx:r}=this._processInputParams(e),s=this._def.options;function i(n){for(let o of n)if(o.result.status==="valid")return o.result;for(let o of n)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let a=n.map(o=>new ot(o.ctx.common.issues));return U(r,{code:N.invalid_union,unionErrors:a}),ie}if(r.common.async)return Promise.all(s.map(async n=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await n._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(i);{let n,a=[];for(let c of s){let l={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!n&&(n={result:u,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(n)return r.common.issues.push(...n.ctx.common.issues),n.result;let o=a.map(c=>new ot(c));return U(r,{code:N.invalid_union,unionErrors:o}),ie}}get options(){return this._def.options}};Hr.create=(t,e)=>new Hr({options:t,typeName:ae.ZodUnion,...he(e)});var tr=t=>t instanceof Yr?tr(t.schema):t instanceof _t?tr(t.innerType()):t instanceof Jr?[t.value]:t instanceof Xr?t.options:t instanceof Qr?ye.objectValues(t.enum):t instanceof es?tr(t._def.innerType):t instanceof Vr?[void 0]:t instanceof Zr?[null]:t instanceof vt?[void 0,...tr(t.unwrap())]:t instanceof qt?[null,...tr(t.unwrap())]:t instanceof rn||t instanceof rs?tr(t.unwrap()):t instanceof ts?tr(t._def.innerType):[],Ao=class t extends ge{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.object)return U(r,{code:N.invalid_type,expected:q.object,received:r.parsedType}),ie;let s=this.discriminator,i=r.data[s],n=this.optionsMap.get(i);return n?r.common.async?n._parseAsync({data:r.data,path:r.path,parent:r}):n._parseSync({data:r.data,path:r.path,parent:r}):(U(r,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),ie)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,s){let i=new Map;for(let n of r){let a=tr(n.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of a){if(i.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);i.set(o,n)}}return new t({typeName:ae.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...he(s)})}};function Tl(t,e){let r=Gt(t),s=Gt(e);if(t===e)return{valid:!0,data:t};if(r===q.object&&s===q.object){let i=ye.objectKeys(e),n=ye.objectKeys(t).filter(o=>i.indexOf(o)!==-1),a={...t,...e};for(let o of n){let c=Tl(t[o],e[o]);if(!c.valid)return{valid:!1};a[o]=c.data}return{valid:!0,data:a}}else if(r===q.array&&s===q.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let n=0;n<t.length;n++){let a=t[n],o=e[n],c=Tl(a,o);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===q.date&&s===q.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Kr=class extends ge{_parse(e){let{status:r,ctx:s}=this._processInputParams(e),i=(n,a)=>{if(So(n)||So(a))return ie;let o=Tl(n.value,a.value);return o.valid?((Ro(n)||Ro(a))&&r.dirty(),{status:r.value,value:o.data}):(U(s,{code:N.invalid_intersection_types}),ie)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([n,a])=>i(n,a)):i(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};Kr.create=(t,e,r)=>new Kr({left:t,right:e,typeName:ae.ZodIntersection,...he(r)});var zt=class t extends ge{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==q.array)return U(s,{code:N.invalid_type,expected:q.array,received:s.parsedType}),ie;if(s.data.length<this._def.items.length)return U(s,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ie;!this._def.rest&&s.data.length>this._def.items.length&&(U(s,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let n=[...s.data].map((a,o)=>{let c=this._def.items[o]||this._def.rest;return c?c._parse(new bt(s,a,s.path,o)):null}).filter(a=>!!a);return s.common.async?Promise.all(n).then(a=>Ge.mergeArray(r,a)):Ge.mergeArray(r,n)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};zt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new zt({items:t,typeName:ae.ZodTuple,rest:null,...he(e)})};var Co=class t extends ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==q.object)return U(s,{code:N.invalid_type,expected:q.object,received:s.parsedType}),ie;let i=[],n=this._def.keyType,a=this._def.valueType;for(let o in s.data)i.push({key:n._parse(new bt(s,o,s.path,o)),value:a._parse(new bt(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?Ge.mergeObjectAsync(r,i):Ge.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,s){return r instanceof ge?new t({keyType:e,valueType:r,typeName:ae.ZodRecord,...he(s)}):new t({keyType:br.create(),valueType:e,typeName:ae.ZodRecord,...he(r)})}},Xs=class extends ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==q.map)return U(s,{code:N.invalid_type,expected:q.map,received:s.parsedType}),ie;let i=this._def.keyType,n=this._def.valueType,a=[...s.data.entries()].map(([o,c],l)=>({key:i._parse(new bt(s,o,s.path,[l,"key"])),value:n._parse(new bt(s,c,s.path,[l,"value"]))}));if(s.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let c of a){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return ie;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(l.value,u.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let c of a){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return ie;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(l.value,u.value)}return{status:r.value,value:o}}}};Xs.create=(t,e,r)=>new Xs({valueType:e,keyType:t,typeName:ae.ZodMap,...he(r)});var Qs=class t extends ge{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==q.set)return U(s,{code:N.invalid_type,expected:q.set,received:s.parsedType}),ie;let i=this._def;i.minSize!==null&&s.data.size<i.minSize.value&&(U(s,{code:N.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&s.data.size>i.maxSize.value&&(U(s,{code:N.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let n=this._def.valueType;function a(c){let l=new Set;for(let u of c){if(u.status==="aborted")return ie;u.status==="dirty"&&r.dirty(),l.add(u.value)}return{status:r.value,value:l}}let o=[...s.data.values()].map((c,l)=>n._parse(new bt(s,c,s.path,l)));return s.common.async?Promise.all(o).then(c=>a(c)):a(o)}min(e,r){return new t({...this._def,minSize:{value:e,message:Q.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Q.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Qs.create=(t,e)=>new Qs({valueType:t,minSize:null,maxSize:null,typeName:ae.ZodSet,...he(e)});var Oo=class t extends ge{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.function)return U(r,{code:N.invalid_type,expected:q.function,received:r.parsedType}),ie;function s(o,c){return tn({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Zs(),er].filter(l=>!!l),issueData:{code:N.invalid_arguments,argumentsError:c}})}function i(o,c){return tn({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Zs(),er].filter(l=>!!l),issueData:{code:N.invalid_return_type,returnTypeError:c}})}let n={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof wr){let o=this;return Ze(async function(...c){let l=new ot([]),u=await o._def.args.parseAsync(c,n).catch(f=>{throw l.addIssue(s(c,f)),l}),p=await Reflect.apply(a,this,u);return await o._def.returns._def.type.parseAsync(p,n).catch(f=>{throw l.addIssue(i(p,f)),l})})}else{let o=this;return Ze(function(...c){let l=o._def.args.safeParse(c,n);if(!l.success)throw new ot([s(c,l.error)]);let u=Reflect.apply(a,this,l.data),p=o._def.returns.safeParse(u,n);if(!p.success)throw new ot([i(u,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:zt.create(e).rest(rr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,s){return new t({args:e||zt.create([]).rest(rr.create()),returns:r||rr.create(),typeName:ae.ZodFunction,...he(s)})}},Yr=class extends ge{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Yr.create=(t,e)=>new Yr({getter:t,typeName:ae.ZodLazy,...he(e)});var Jr=class extends ge{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return U(r,{received:r.data,code:N.invalid_literal,expected:this._def.value}),ie}return{status:"valid",value:e.data}}get value(){return this._def.value}};Jr.create=(t,e)=>new Jr({value:t,typeName:ae.ZodLiteral,...he(e)});function _m(t,e){return new Xr({values:t,typeName:ae.ZodEnum,...he(e)})}var Xr=class t extends ge{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),s=this._def.values;return U(r,{expected:ye.joinValues(s),received:r.parsedType,code:N.invalid_type}),ie}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),s=this._def.values;return U(r,{received:r.data,code:N.invalid_enum_value,options:s}),ie}return Ze(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(s=>!e.includes(s)),{...this._def,...r})}};Xr.create=_m;var Qr=class extends ge{_parse(e){let r=ye.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==q.string&&s.parsedType!==q.number){let i=ye.objectValues(r);return U(s,{expected:ye.joinValues(i),received:s.parsedType,code:N.invalid_type}),ie}if(this._cache||(this._cache=new Set(ye.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=ye.objectValues(r);return U(s,{received:s.data,code:N.invalid_enum_value,options:i}),ie}return Ze(e.data)}get enum(){return this._def.values}};Qr.create=(t,e)=>new Qr({values:t,typeName:ae.ZodNativeEnum,...he(e)});var wr=class extends ge{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.promise&&r.common.async===!1)return U(r,{code:N.invalid_type,expected:q.promise,received:r.parsedType}),ie;let s=r.parsedType===q.promise?r.data:Promise.resolve(r.data);return Ze(s.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};wr.create=(t,e)=>new wr({type:t,typeName:ae.ZodPromise,...he(e)});var _t=class extends ge{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:s}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:a=>{U(s,a),a.fatal?r.abort():r.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),i.type==="preprocess"){let a=i.transform(s.data,n);if(s.common.async)return Promise.resolve(a).then(async o=>{if(r.value==="aborted")return ie;let c=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return c.status==="aborted"?ie:c.status==="dirty"?Ur(c.value):r.value==="dirty"?Ur(c.value):c});{if(r.value==="aborted")return ie;let o=this._def.schema._parseSync({data:a,path:s.path,parent:s});return o.status==="aborted"?ie:o.status==="dirty"?Ur(o.value):r.value==="dirty"?Ur(o.value):o}}if(i.type==="refinement"){let a=o=>{let c=i.refinement(o,n);if(s.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?ie:(o.status==="dirty"&&r.dirty(),a(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?ie:(o.status==="dirty"&&r.dirty(),a(o.value).then(()=>({status:r.value,value:o.value}))))}if(i.type==="transform")if(s.common.async===!1){let a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!vr(a))return ie;let o=i.transform(a.value,n);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>vr(a)?Promise.resolve(i.transform(a.value,n)).then(o=>({status:r.value,value:o})):ie);ye.assertNever(i)}};_t.create=(t,e,r)=>new _t({schema:t,typeName:ae.ZodEffects,effect:e,...he(r)});_t.createWithPreprocess=(t,e,r)=>new _t({schema:e,effect:{type:"preprocess",transform:t},typeName:ae.ZodEffects,...he(r)});var vt=class extends ge{_parse(e){return this._getType(e)===q.undefined?Ze(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};vt.create=(t,e)=>new vt({innerType:t,typeName:ae.ZodOptional,...he(e)});var qt=class extends ge{_parse(e){return this._getType(e)===q.null?Ze(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};qt.create=(t,e)=>new qt({innerType:t,typeName:ae.ZodNullable,...he(e)});var es=class extends ge{_parse(e){let{ctx:r}=this._processInputParams(e),s=r.data;return r.parsedType===q.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};es.create=(t,e)=>new es({innerType:t,typeName:ae.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...he(e)});var ts=class extends ge{_parse(e){let{ctx:r}=this._processInputParams(e),s={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Hs(i)?i.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ot(s.common.issues)},input:s.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ot(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};ts.create=(t,e)=>new ts({innerType:t,typeName:ae.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...he(e)});var ei=class extends ge{_parse(e){if(this._getType(e)!==q.nan){let s=this._getOrReturnCtx(e);return U(s,{code:N.invalid_type,expected:q.nan,received:s.parsedType}),ie}return{status:"valid",value:e.data}}};ei.create=t=>new ei({typeName:ae.ZodNaN,...he(t)});var pA=Symbol("zod_brand"),rn=class extends ge{_parse(e){let{ctx:r}=this._processInputParams(e),s=r.data;return this._def.type._parse({data:s,path:r.path,parent:r})}unwrap(){return this._def.type}},sn=class t extends ge{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?ie:n.status==="dirty"?(r.dirty(),Ur(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{let i=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?ie:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:s.path,parent:s})}}static create(e,r){return new t({in:e,out:r,typeName:ae.ZodPipeline})}},rs=class extends ge{_parse(e){let r=this._def.innerType._parse(e),s=i=>(vr(i)&&(i.value=Object.freeze(i.value)),i);return Hs(r)?r.then(i=>s(i)):s(r)}unwrap(){return this._def.innerType}};rs.create=(t,e)=>new rs({innerType:t,typeName:ae.ZodReadonly,...he(e)});function gm(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function wm(t,e={},r){return t?_r.create().superRefine((s,i)=>{let n=t(s);if(n instanceof Promise)return n.then(a=>{if(!a){let o=gm(e,s),c=o.fatal??r??!0;i.addIssue({code:"custom",...o,fatal:c})}});if(!n){let a=gm(e,s),o=a.fatal??r??!0;i.addIssue({code:"custom",...a,fatal:o})}}):_r.create()}var mA={object:at.lazycreate},ae;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ae||(ae={}));var gA=(t,e={message:`Input not instance of ${t.name}`})=>wm(r=>r instanceof t,e),xm=br.create,Em=Gr.create,yA=ei.create,vA=zr.create,Sm=qr.create,bA=Wr.create,_A=Ys.create,wA=Vr.create,xA=Zr.create,EA=_r.create,SA=rr.create,RA=Pt.create,AA=Js.create,CA=sr.create,OA=at.create,TA=at.strictCreate,LA=Hr.create,$A=Ao.create,PA=Kr.create,IA=zt.create,kA=Co.create,NA=Xs.create,DA=Qs.create,FA=Oo.create,MA=Yr.create,jA=Jr.create,BA=Xr.create,UA=Qr.create,GA=wr.create,zA=_t.create,qA=vt.create,WA=qt.create,VA=_t.createWithPreprocess,ZA=sn.create,HA=()=>xm().optional(),KA=()=>Em().optional(),YA=()=>Sm().optional(),JA={string:(t=>br.create({...t,coerce:!0})),number:(t=>Gr.create({...t,coerce:!0})),boolean:(t=>qr.create({...t,coerce:!0})),bigint:(t=>zr.create({...t,coerce:!0})),date:(t=>Wr.create({...t,coerce:!0}))};var XA=ie;var QA=$.object({repository_url:$.string(),powerlint_version:$.string(),schema_version:$.string()}),eC=$.object({configured:$.boolean(),invalid_api_key:$.boolean().optional(),is_valid_repository:$.boolean().optional(),config:$.object({ignored_globs:$.array($.string())}).optional()}),tC=$.object({repository_url:$.string(),rule_ids:$.array($.string()).optional(),schema_version:$.string(),powerlint_version:$.string()}),rC=$.object({rules:$.array($.object({id:$.string(),internalId:$.string(),internalVersionId:$.string(),message:$.string(),prompt:$.string(),severity:$.enum(["suggestion","violation"]),schema:$.any(),execution:$.enum(["llm","deterministic"]).optional()}))}),sC=$.object({rule:$.object({id:$.string(),versionId:$.string(),contents:$.string(),message:$.string()}),matches:$.array($.any()),messages:$.array($.any()),tools:$.array($.enum(["read","grep","glob"])),files:$.array($.object({path:$.string(),sha:$.string()})).optional(),schema_version:$.string(),powerlint_version:$.string(),repository_url:$.string(),commit:$.object({sha:$.string(),branch:$.string(),message:$.string(),timestamp:$.string()})}),iC=$.discriminatedUnion("type",[$.object({type:$.literal("tool_request"),tool_calls:$.array($.any()),usage:$.object({cost:$.string(),inputTokens:$.string(),outputTokens:$.string()})}),$.object({type:$.literal("matches"),matches:$.array($.any()),usage:$.object({cost:$.string(),inputTokens:$.string(),outputTokens:$.string()}),files:$.array($.object({path:$.string(),sha:$.string()})).optional()}),$.object({type:$.literal("request_files"),files:$.array($.object({path:$.string(),sha:$.string()})),usage:$.object({cost:$.string(),inputTokens:$.string(),outputTokens:$.string()})}),$.object({type:$.literal("partial_matches"),matches:$.array($.any()),unresolved:$.array($.any()),usage:$.object({cost:$.string(),inputTokens:$.string(),outputTokens:$.string()})})]),nC=$.object({rule:$.object({id:$.string(),versionId:$.string(),contents:$.string(),message:$.string()}),matches:$.array($.any()),files:$.array($.object({path:$.string(),sha:$.string()})).optional(),schema_version:$.string(),powerlint_version:$.string(),repository_url:$.string(),commit:$.object({sha:$.string(),branch:$.string(),message:$.string(),timestamp:$.string()})}),oC=$.discriminatedUnion("type",[$.object({type:$.literal("matches"),matches:$.array($.any()),usage:$.object({cost:$.string(),inputTokens:$.string(),outputTokens:$.string()})}),$.object({type:$.literal("partial_matches"),matches:$.array($.any()),unresolved:$.array($.any()),usage:$.object({cost:$.string(),inputTokens:$.string(),outputTokens:$.string()})})]),nn=class{baseUrl;apiKey;constructor(e){this.baseUrl=e.baseUrl,this.apiKey=e.apiKey}async request(e,r,s){let i=`${this.baseUrl}${e}`,a=await(await Al(async()=>{let o=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify(r)});if(!o.ok){let c=await o.text();throw new Error(`Wispbit API request failed: ${o.status} ${o.statusText} - ${c}`)}return o},{retries:5,factor:2,minTimeout:1e3,maxTimeout:1e4,randomize:!0})).json();return s?s.parse(a):a}async initialize(e){let r=QA.parse(e);return await this.request("/plv1/initialize",r,eC)}async getRules(e){let r=tC.parse(e);return await this.request("/plv1/get-rules",r,rC)}async matchLLMSearch(e){let r=sC.parse(e);return await this.request("/plv1/llm-search",r,iC)}async matchLLMValidate(e){let r=nC.parse(e);return await this.request("/plv1/llm-validate",r,oC)}};var To=class{config;environment;constructor(e,r){this.config=e,this.environment=r}async search(e){let r=this.config.getApiClient(),s=await this.environment.getRepositoryUrl(),i=await this.environment.getCurrentCommit(),n={id:e.rule.internalId,versionId:e.rule.internalVersionId,contents:e.rule.prompt,message:e.rule.config.message};return await r.matchLLMSearch({rule:n,matches:e.matches,messages:e.messages,tools:e.tools,files:e.files,schema_version:this.config.getSchemaVersion(),powerlint_version:this.config.getLocalVersion(),repository_url:s,commit:i})}async validate(e){let r=this.config.getApiClient(),s=await this.environment.getRepositoryUrl(),i=await this.environment.getCurrentCommit(),n={id:e.rule.internalId,versionId:e.rule.internalVersionId,contents:e.rule.prompt,message:e.rule.config.message};return await r.matchLLMValidate({rule:n,matches:e.matches,files:e.files,schema_version:this.config.getSchemaVersion(),powerlint_version:this.config.getLocalVersion(),repository_url:s,commit:i})}};import{readFileSync as vO}from"fs";import{dirname as bO,join as _O}from"path";import{fileURLToPath as wO}from"url";var on=class extends Error{response;request;options;constructor(e,r,s){let i=e.status||e.status===0?e.status:"",n=e.statusText||"",a=`${i} ${n}`.trim(),o=a?`status code ${a}`:"an unknown error";super(`Request failed with ${o}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=s}};var ti=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var Ll=(()=>{let t=!1,e=!1,r=typeof globalThis.ReadableStream=="function",s=typeof globalThis.Request=="function";if(r&&s)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return t&&!e})(),Rm=typeof globalThis.AbortController=="function",Am=typeof globalThis.ReadableStream=="function",Cm=typeof globalThis.FormData=="function",Lo=["get","post","put","patch","head","delete"],aC=()=>{};aC();var Om={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},$o=2147483647,Tm=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Po=Symbol("stop"),Lm={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},$m={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0};var cC=t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(let[r,s]of t)e+=Tm,e+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,e+=typeof s=="string"?new TextEncoder().encode(s).length:s.size;return e}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength;if(typeof t=="string")return new TextEncoder().encode(t).length;if(t instanceof URLSearchParams)return new TextEncoder().encode(t.toString()).length;if("byteLength"in t)return t.byteLength;if(typeof t=="object"&&t!==null)try{let e=JSON.stringify(t);return new TextEncoder().encode(e).length}catch{return 0}return 0},Pm=(t,e)=>{let r=Number(t.headers.get("content-length"))||0,s=0;return t.status===204?(e&&e({percent:1,totalBytes:r,transferredBytes:s},new Uint8Array),new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers})):new Response(new ReadableStream({async start(i){let n=t.body.getReader();e&&e({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array);async function a(){let{done:o,value:c}=await n.read();if(o){i.close();return}if(e){s+=c.byteLength;let l=r===0?0:s/r;e({percent:l,transferredBytes:s,totalBytes:r},c)}i.enqueue(c),await a()}await a()}}),{status:t.status,statusText:t.statusText,headers:t.headers})},Im=(t,e)=>{let r=cC(t.body),s=0;return new Request(t,{duplex:"half",body:new ReadableStream({async start(i){let n=t.body instanceof ReadableStream?t.body.getReader():new Response("").body.getReader();async function a(){let{done:o,value:c}=await n.read();if(o){e&&e({percent:1,transferredBytes:s,totalBytes:Math.max(r,s)},new Uint8Array),i.close();return}s+=c.byteLength;let l=r===0?0:s/r;(r<s||l===1)&&(l=.99),e&&e({percent:Number(l.toFixed(2)),transferredBytes:s,totalBytes:r},c),i.enqueue(c),await a()}await a()}})})};var ri=t=>t!==null&&typeof t=="object";var an=(...t)=>{for(let e of t)if((!ri(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return Il({},...t)},$l=(t={},e={})=>{let r=new globalThis.Headers(t),s=e instanceof globalThis.Headers,i=new globalThis.Headers(e);for(let[n,a]of i.entries())s&&a==="undefined"||a===void 0?r.delete(n):r.set(n,a);return r};function Io(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:Il(t[r]??[],e[r]??[])}var Pl=(t={},e={})=>({beforeRequest:Io(t,e,"beforeRequest"),beforeRetry:Io(t,e,"beforeRetry"),afterResponse:Io(t,e,"afterResponse"),beforeError:Io(t,e,"beforeError")}),Il=(...t)=>{let e={},r={},s={};for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(ri(i)){for(let[n,a]of Object.entries(i))ri(a)&&n in e&&(a=Il(e[n],a)),e={...e,[n]:a};ri(i.hooks)&&(s=Pl(s,i.hooks),e.hooks=s),ri(i.headers)&&(r=$l(r,i.headers),e.headers=r)}return e};var Nm=t=>Lo.includes(t)?t.toUpperCase():t,lC=["get","put","head","delete","options","trace"],uC=[408,413,429,500,502,503,504],fC=[413,429,503],km={limit:2,methods:lC,statusCodes:uC,afterStatusCodes:fC,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},Dm=(t={})=>{if(typeof t=="number")return{...km,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...km,...t}};async function kl(t,e,r,s){return new Promise((i,n)=>{let a=setTimeout(()=>{r&&r.abort(),n(new ti(t))},s.timeout);s.fetch(t,e).then(i).catch(n).then(()=>{clearTimeout(a)})})}async function Nl(t,{signal:e}){return new Promise((r,s)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(n),s(e.reason)}let n=setTimeout(()=>{e?.removeEventListener("abort",i),r()},t)})}var Fm=(t,e)=>{let r={};for(let s in e)!(s in $m)&&!(s in Lm)&&!(s in t)&&(r[s]=e[s]);return r};var cn=class t{static create(e,r){let s=new t(e,r),i=async()=>{if(typeof s._options.timeout=="number"&&s._options.timeout>$o)throw new RangeError(`The \`timeout\` option cannot be greater than ${$o}`);await Promise.resolve();let o=await s._fetch();for(let c of s._options.hooks.afterResponse){let l=await c(s.request,s._options,s._decorateResponse(o.clone()));l instanceof globalThis.Response&&(o=l)}if(s._decorateResponse(o),!o.ok&&s._options.throwHttpErrors){let c=new on(o,s.request,s._options);for(let l of s._options.hooks.beforeError)c=await l(c);throw c}if(s._options.onDownloadProgress){if(typeof s._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Am)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return Pm(o.clone(),s._options.onDownloadProgress)}return o},a=(s._options.retry.methods.includes(s.request.method.toLowerCase())?s._retry(i):i()).finally(async()=>{s.request.bodyUsed||await s.request.body?.cancel()});for(let[o,c]of Object.entries(Om))a[o]=async()=>{s.request.headers.set("accept",s.request.headers.get("accept")||c);let l=await a;if(o==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await l.text())}return l[o]()};return a}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:$l(this._input.headers,r.headers),hooks:Pl({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Nm(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:Dm(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(Rm){let s=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=s?AbortSignal.any([s,this.abortController.signal]):this.abortController.signal}if(Ll&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),n=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(Cm&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(n,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!Ll)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&(this.request=Im(this.request,this._options.onUploadProgress))}}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount>this._options.retry.limit||e instanceof ti)throw e;if(e instanceof on){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;let s=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(s&&this._options.retry.afterStatusCodes.includes(e.response.status)){let i=Number(s)*1e3;Number.isNaN(i)?i=Date.parse(s)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());let n=this._options.retry.maxRetryAfter??i;return i<n?i:n}if(e.response.status===413)throw e}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(r){let s=Math.min(this._calculateRetryDelay(r),$o);if(this._retryCount<1)throw r;await Nl(s,{signal:this._options.signal});for(let i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===Po)return;return this._retry(e)}}async _fetch(){for(let s of this._options.hooks.beforeRequest){let i=await s(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}let e=Fm(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):kl(r,e,this.abortController,this._options)}};var Dl=t=>{let e=(r,s)=>cn.create(r,an(t,s));for(let r of Lo)e[r]=(s,i)=>cn.create(s,an(t,i,{method:r}));return e.create=r=>Dl(an(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),Dl(an(t,r))),e.stop=Po,e},hC=Dl(),Mm=hC;var ag=nt(og(),1);function Ul(t){let e=(0,ag.default)("npm",{registry:"https://registry.npmjs.org/"}),r=e[`${t}:registry`]||e.config_registry||e.registry;return r.slice(-1)==="/"?r:`${r}/`}var ty=nt(ey(),1),ry=nt(El(),1),eu=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},tu=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function ru(t,e={}){let{version:r="latest"}=e,{omitDeprecated:s=!0}=e,i=t.split("/")[0],n=e.registryUrl??Ul(i),a=new URL(encodeURIComponent(t).replace(/^%40/,"@"),n),o=(0,ty.default)(n.toString(),{recursive:!0}),c={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};e.fullMetadata&&delete c.accept,o&&(c.authorization=`${o.type} ${o.token}`);let l;try{l=await Mm(a,{headers:c,keepalive:!0}).json()}catch(p){throw p?.response?.status===404?new eu(t):p}if(e.allVersions)return l;let u=new tu(t,r);if(l["dist-tags"][r]){let{time:p}=l;l=l.versions[l["dist-tags"][r]],l.time=p}else if(r){let p=!!l.versions[r];if(s&&!p)for(let[f,d]of Object.entries(l.versions))d.deprecated&&delete l.versions[f];if(!p){let f=Object.keys(l.versions);if(r=ry.default.maxSatisfying(f,r),!r)throw u}let{time:g}=l;if(l=l.versions[r],l.time=g,!l)throw u}return l}async function su(t,e){let{version:r}=await ru(t.toLowerCase(),e);return r}function fs(){let t=wO(import.meta.url?import.meta.url:__filename),e=bO(t),r=_O(e,"./package.json");try{let s=vO(r,"utf8");return JSON.parse(s).version}catch{return"0.0.0"}}async function sy(){try{return await su("@wispbit/local")}catch{return fs()}}var pn=class t{config;apiKey=null;baseUrl=null;apiClient=null;llmProvider=null;constructor(e,r){this.config={...e,ignoredGlobs:e.ignoredGlobs||[]},this.apiKey=e.apiKey||null,this.baseUrl=e.baseUrl||null,this.apiKey&&this.baseUrl&&(this.apiClient=new nn({baseUrl:this.baseUrl,apiKey:this.apiKey})),r?.llmProvider&&(this.llmProvider=r.llmProvider)}getIgnoredGlobs(){return this.config.ignoredGlobs||[]}getApiKey(){return this.apiKey}getBaseUrl(){return this.baseUrl}getApiClient(){if(!this.apiClient)throw new Error("API client not initialized. Config must have both apiKey and baseUrl.");return this.apiClient}getLLMProvider(){if(!this.llmProvider)throw new Error("LLM provider not initialized. Use Config.initialize() instead of initializeLocal().");return this.llmProvider}getLocalVersion(){return fs()}getSchemaVersion(){return"v1"}static initializeLocal(e={}){let r=e.ignoredGlobs||[];return new t({ignoredGlobs:r},{llmProvider:e.llmProvider})}static async initialize(e,{apiKey:r,baseUrl:s}){let i=s||process.env.WISPBIT_API_BASE_URL||"https://api.wispbit.com",n=r||process.env.WISPBIT_API_KEY||null;if(!n)return console.log("No API key found"),{failed:!0,error:"INVALID_API_KEY"};let a=await e.getRepositoryUrl(),c=await new nn({baseUrl:i,apiKey:n}).initialize({repository_url:a,powerlint_version:fs(),schema_version:"v1"});if(c.invalid_api_key)return{failed:!0,error:"INVALID_API_KEY"};if(!c.is_valid_repository)return{failed:!0,error:"INVALID_REPOSITORY"};let l=c.config?.ignored_globs||[],u=new t({ignoredGlobs:l,apiKey:n,baseUrl:i},{});return u.llmProvider=new To(u,e),u}isConfigured(){return this.getApiKey()!==null}};import{exec as EO,execSync as SO}from"child_process";import{existsSync as RO,readFileSync as AO}from"fs";import{promisify as CO}from"util";import{createHash as xO}from"crypto";function mn(t){return xO("sha256").update(t).digest("hex")}var Ee=CO(EO);function ny(){return SO("git rev-parse --show-toplevel",{encoding:"utf-8"}).trim()}async function oy(t){let{stdout:e}=await Ee("git ls-files --ignored --exclude-standard --others",{cwd:t,maxBuffer:52428800});return e.split(`
|
|
41
|
+
`).filter(Boolean).map(r=>r.trim())}async function ay(t,e="origin"){let{stdout:r}=await Ee(`git config --get remote.${e}.url`,{cwd:t});return r.trim()||null}async function cy(t,e="origin"){try{let{stdout:r}=await Ee(`git rev-parse --abbrev-ref ${e}/HEAD`,{cwd:t});return r.trim().split("/").pop()||null}catch{let s=["main","master"];for(let i of s)try{return await Ee(`git rev-parse --verify ${i}`,{cwd:t}),i}catch{}return null}}async function ly(t){let{stdout:e}=await Ee("git rev-parse --abbrev-ref --symbolic-full-name @{u}",{cwd:t});return e.trim()||void 0}function uy(t,e){let r=`.git/refs/branch-metadata/${e}`,s=`${t}/${r}`;return RO(s)?AO(s,"utf-8").match(/"parent"\s*:\s*"([^"]+)"/)?.[1]:void 0}function wt(t){return`'${t.replace(/'/g,"'\\''")}'`}function Er(t){return t.map(wt).join(" ")}function OO(t){let e={committed:!0,staged:!0,unstaged:!0,untracked:!0};if(!t||t.length===0)return e;let r=new Set(t);return{committed:r.has("committed"),staged:r.has("staged"),unstaged:r.has("unstaged"),untracked:r.has("untracked")}}function Wo(t,e){if(!t)return[];let r=[],s=t.split("\0").filter(Boolean);for(let i=0;i<s.length;){let n=s[i];if(!n)break;if(n.startsWith("R")){let a=s[i+1],o=s[i+2];a&&o?(r.push({status:n,path:o,oldPath:a,source:e}),i+=3):i++}else{let a=s[i+1];a?(r.push({status:n,path:a,source:e}),i+=2):i++}}return r}function TO(t){return t?t.split("\0").filter(Boolean).map(e=>({status:"U",path:e,source:"untracked"})):[]}function LO(t){let e=new Map;for(let r of t){let s=e.get(r.path);if(!s)e.set(r.path,r);else{let i=iy(s.source),n=iy(r.source);n>i?e.set(r.path,r):n===i&&r.oldPath&&(s.oldPath=s.oldPath||r.oldPath)}}return Array.from(e.values())}function iy(t){switch(t){case"untracked":return 4;case"unstaged":return 3;case"staged":return 2;case"committed":return 1}}function iu(t){let e=new Map;if(!t)return e;let r=t.split(/^diff --git /m).filter(Boolean);for(let s of r){let a=s.split(`
|
|
42
|
+
`)[0].match(/a\/(.+?) b\//);if(a){let o=a[1];e.set(o,"diff --git "+s)}}return e}function $O(t){return t.status==="U"||t.status==="A"?"added":t.status==="D"?"removed":"modified"}function gn(t){if(!t)return"";let e=t.split(`
|
|
43
|
+
`),r=[],s=!1;for(let i of e)i.startsWith("diff --git")||i.startsWith("index ")||i.startsWith("--- ")||i.startsWith("+++ ")||i.startsWith("new file mode")||i.startsWith("deleted file mode")||i.startsWith("old mode")||i.startsWith("new mode")||i.startsWith("similarity index")||i.startsWith("rename from")||i.startsWith("rename to")||i.startsWith("copy from")||i.startsWith("copy to")||i==="\"||(i.startsWith("@@")&&(s=!0),s&&r.push(i));return r.join(`
|
|
44
|
+
`).trimEnd()}function Vo(t){let e=t.match(/^(.+)\.\.\.(.+)$/);if(e)return[e[1],e[2],!0];let r=t.match(/^(.+)\.\.([^.].*)$/);return r?[r[1],r[2],!1]:[t,t,!1]}function PO(t){let[,e]=Vo(t);return e}async function nu(t){let{stdout:e}=await Ee("git rev-parse --abbrev-ref HEAD",{cwd:t});return e.trim()}async function fy(t){let e=await nu(t),{stdout:r}=await Ee("git rev-parse HEAD",{cwd:t}),s=r.trim(),{stdout:i}=await Ee('git log -1 --pretty=format:"%s"',{cwd:t}),n=i.trim(),{stdout:a}=await Ee('git log -1 --pretty=format:"%cI"',{cwd:t}),o=a.trim();return{sha:s,branch:e,message:n,timestamp:o}}function ou(t,e,r){if(!t.includes("..")||!(e.includes("staged")||e.includes("unstaged")||e.includes("untracked")))return null;let n=PO(t);return n==="HEAD"||n===r?null:`Worktree includes (staged, unstaged, untracked) require range to end at HEAD or current branch (${r}). Got: ${t}`}async function au(t){let{stdout:e}=await Ee("git rev-parse --abbrev-ref HEAD",{cwd:t}),r=e.trim(),s=["committed","staged","unstaged","untracked"],i=uy(t,r);if(i)return{commitSelector:`${i}...${r}`,include:s};let n=await cy(t);if(n){if(r===n){let l=await ly(t).catch(()=>{});return l?{commitSelector:`${l}...HEAD`,include:s}:{commitSelector:"HEAD~1...HEAD",include:s}}let a=`origin/${n}`,{stdout:o}=await Ee(`git rev-parse --verify ${a}`,{cwd:t});return{commitSelector:`${o.trim()?a:n}...${r}`,include:s}}return{commitSelector:"HEAD...HEAD",include:s}}async function hy(t,e){let r=e.commitSelector.trim(),s=r.includes(".."),{stdout:i}=await Ee("git rev-parse --abbrev-ref HEAD",{cwd:t}),n=i.trim(),{stdout:a}=await Ee("git rev-parse HEAD",{cwd:t}),o=a.trim(),c="",l="";if(s)c=r,l=r;else{let b=uy(t,n),x=await cy(t),E=r||b||`origin/${x||"main"}`;l=E;let L=`git merge-base --fork-point ${wt(E)} HEAD || git merge-base ${wt(E)} HEAD`,{stdout:A}=await Ee(L,{cwd:t});if(c=A.trim(),!r&&n===(x||"main")){let O=await ly(t).catch(()=>{});if(O){l=O;let{stdout:k}=await Ee(`git merge-base --fork-point ${wt(O)} HEAD || git merge-base ${wt(O)} HEAD`,{cwd:t});c=k.trim()}else l="HEAD~1",c="HEAD~1"}}let u=OO(e.include),p=ou(r,e.include,n);if(p)throw new Error(p);let g=[];if(u.committed)if(s){let[b,x]=Vo(r),{stdout:E}=await Ee(`git diff --name-status -M -z ${wt(b)}..${wt(x)}`,{cwd:t,maxBuffer:50*1024*1024});g.push(...Wo(E,"committed"))}else{let{stdout:b}=await Ee(`git diff --name-status -M -z ${c}..HEAD`,{cwd:t,maxBuffer:52428800});g.push(...Wo(b,"committed"))}if(u.staged){let{stdout:b}=await Ee("git diff --name-status -M -z --cached",{cwd:t,maxBuffer:52428800});g.push(...Wo(b,"staged"))}if(u.unstaged){let{stdout:b}=await Ee("git diff --name-status -M -z",{cwd:t,maxBuffer:52428800});g.push(...Wo(b,"unstaged"))}if(u.untracked){let{stdout:b}=await Ee("git ls-files --others --exclude-standard -z",{cwd:t,maxBuffer:52428800});g.push(...TO(b))}let f=LO(g),d=f.filter(b=>b.source==="committed"),m=f.filter(b=>b.source==="staged"),y=f.filter(b=>b.source==="unstaged"),v=f.filter(b=>b.source==="untracked"),_=new Map;if(d.length>0){let b=d.map(A=>A.path),x="";if(s){let[A,O]=Vo(r);x=`git diff -U0 -M ${wt(A)}..${wt(O)} -- ${Er(b)}`}else x=`git diff -U0 -M ${c}..HEAD -- ${Er(b)}`;let{stdout:E}=await Ee(x,{cwd:t,maxBuffer:50*1024*1024});iu(E).forEach((A,O)=>_.set(O,gn(A)))}if(m.length>0){let b=m.map(A=>A.path),x=`git diff -U0 -M --cached -- ${Er(b)}`,{stdout:E}=await Ee(x,{cwd:t,maxBuffer:50*1024*1024});iu(E).forEach((A,O)=>_.set(O,gn(A)))}if(y.length>0){let b=y.map(A=>A.path),x=`git diff -U0 -M -- ${Er(b)}`,{stdout:E}=await Ee(x,{cwd:t,maxBuffer:50*1024*1024});iu(E).forEach((A,O)=>_.set(O,gn(A)))}for(let b of v)try{let{stdout:x}=await Ee(`git diff -U0 --no-index /dev/null ${wt(b.path)}`,{cwd:t,maxBuffer:52428800});_.set(b.path,gn(x))}catch(x){if(x.stdout)_.set(b.path,gn(x.stdout));else throw x}let w=new Map;if(d.length>0){let b=d.map(A=>A.path),x="";if(s){let[A,O]=Vo(r);x=`git diff --numstat ${wt(A)}..${wt(O)} -- ${Er(b)}`}else x=`git diff --numstat ${c}..HEAD -- ${Er(b)}`;let{stdout:E}=await Ee(x,{cwd:t,maxBuffer:50*1024*1024}),L=E.split(`
|
|
45
|
+
`).filter(Boolean);for(let A of L){let O=A.split(" ");if(O.length>=3){let[k,z,P]=O;w.set(P,{additions:parseInt(k)||0,deletions:parseInt(z)||0})}}}if(m.length>0){let b=m.map(A=>A.path),x=`git diff --numstat --cached -- ${Er(b)}`,{stdout:E}=await Ee(x,{cwd:t,maxBuffer:50*1024*1024}),L=E.split(`
|
|
46
|
+
`).filter(Boolean);for(let A of L){let O=A.split(" ");if(O.length>=3){let[k,z,P]=O;w.set(P,{additions:parseInt(k)||0,deletions:parseInt(z)||0})}}}if(y.length>0){let b=y.map(A=>A.path),x=`git diff --numstat -- ${Er(b)}`,{stdout:E}=await Ee(x,{cwd:t,maxBuffer:50*1024*1024}),L=E.split(`
|
|
47
|
+
`).filter(Boolean);for(let A of L){let O=A.split(" ");if(O.length>=3){let[k,z,P]=O;w.set(P,{additions:parseInt(k)||0,deletions:parseInt(z)||0})}}}for(let b of v){let E=(_.get(b.path)||"").split(`
|
|
48
|
+
`),L=0,A=0;for(let O of E)O.startsWith("+")&&!O.startsWith("+++")?L++:O.startsWith("-")&&!O.startsWith("---")&&A++;w.set(b.path,{additions:L,deletions:A})}let h=[];for(let b of f){let x=_.get(b.path)||"",E=w.get(b.path)||{additions:0,deletions:0},L=$O(b),A={filename:b.path,status:L,patch:x,additions:E.additions,deletions:E.deletions,sha:mn(x)};b.oldPath&&(A.oldFilename=b.oldPath),h.push(A)}return{files:h,currentBranch:n,currentCommit:o,diffBranch:l,diffCommit:c}}var li=class{workspaceRoot;repositoryUrl;constructor(e){this.repositoryUrl=e?.repositoryUrl||null,this.workspaceRoot=e?.workspaceRoot||ny()}getWorkspaceRoot(){return this.workspaceRoot}async getRepositoryUrl(e="origin"){if(this.repositoryUrl)return this.repositoryUrl;let r=await ay(this.workspaceRoot,e);if(!r)throw new Error("Could not determine repository URL. Make sure you're in a Git repository with a remote origin.");return r}async getCurrentCommit(){return await fy(this.workspaceRoot)}};import*as Ke from"fs/promises";import _T from"os";import hi from"path";import{Buffer as dy}from"buffer";var Zo=(t,e=!0)=>{if(t==null)return"null";if(typeof t=="string")return JSON.stringify(e&&t.startsWith(":")?`:${t}`:t);if(dy.isBuffer(t))return JSON.stringify(`:base64:${t.toString("base64")}`);if(t?.toJSON&&(t=t.toJSON()),typeof t=="object"){let r="",s=Array.isArray(t);r=s?"[":"{";let i=!0;for(let n in t){let a=typeof t[n]=="function"||!s&&t[n]===void 0;!Object.hasOwn(t,n)||a||(i||(r+=","),i=!1,s?r+=Zo(t[n],e):t[n]!==void 0&&(r+=`${Zo(n,!1)}:${Zo(t[n],e)}`))}return r+=s?"]":"}",r}return JSON.stringify(t)},cu=t=>Zo(t,!0),lu=t=>JSON.parse(t,(e,r)=>typeof r=="string"?r.startsWith(":base64:")?dy.from(r.slice(8),"base64"):r.startsWith(":")?r.slice(1):r:r);var IO=class{_eventListeners;_maxListeners;constructor(){this._eventListeners=new Map,this._maxListeners=100}maxListeners(){return this._maxListeners}addListener(t,e){this.on(t,e)}on(t,e){this._eventListeners.has(t)||this._eventListeners.set(t,[]);let r=this._eventListeners.get(t);return r&&(r.length>=this._maxListeners&&console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${r.length+1} ${t} listeners added. Use setMaxListeners() to increase limit.`),r.push(e)),this}removeListener(t,e){this.off(t,e)}off(t,e){let r=this._eventListeners.get(t)??[],s=r.indexOf(e);s!==-1&&r.splice(s,1),r.length===0&&this._eventListeners.delete(t)}once(t,e){let r=(...s)=>{e(...s),this.off(t,r)};this.on(t,r)}emit(t,...e){let r=this._eventListeners.get(t);if(r&&r.length>0)for(let s of r)s(...e)}listeners(t){return this._eventListeners.get(t)??[]}removeAllListeners(t){t?this._eventListeners.delete(t):this._eventListeners.clear()}setMaxListeners(t){this._maxListeners=t}},uu=IO,kO=class extends uu{_hookHandlers;constructor(){super(),this._hookHandlers=new Map}addHandler(t,e){let r=this._hookHandlers.get(t);r?r.push(e):this._hookHandlers.set(t,[e])}removeHandler(t,e){let r=this._hookHandlers.get(t);if(r){let s=r.indexOf(e);s!==-1&&r.splice(s,1)}}trigger(t,e){let r=this._hookHandlers.get(t);if(r)for(let s of r)try{s(e)}catch(i){this.emit("error",new Error(`Error in hook handler for event "${t}": ${i.message}`))}}get handlers(){return new Map(this._hookHandlers)}},NO=kO,DO=class extends uu{enabled=!0;hits=0;misses=0;sets=0;deletes=0;errors=0;constructor(t){super(),t!==void 0&&(this.enabled=t),this.reset()}hit(){this.enabled&&this.hits++}miss(){this.enabled&&this.misses++}set(){this.enabled&&this.sets++}delete(){this.enabled&&this.deletes++}hitsOrMisses(t){for(let e of t)e===void 0?this.miss():this.hit()}reset(){this.hits=0,this.misses=0,this.sets=0,this.deletes=0,this.errors=0}},FO=DO;var py=["sqlite","postgres","mysql","mongo","redis","valkey","etcd"],MO=class extends uu{opts;iterator;hooks=new NO;stats=new FO(!1);_ttl;_namespace;_store=new Map;_serialize=cu;_deserialize=lu;_compression;_useKeyPrefix=!0;_throwOnErrors=!1;constructor(t,e){if(super(),e??={},t??={},this.opts={namespace:"keyv",serialize:cu,deserialize:lu,emitErrors:!0,store:new Map,...e},t&&t.get?this.opts.store=t:this.opts={...this.opts,...t},this._store=this.opts.store??new Map,this._compression=this.opts.compression,this._serialize=this.opts.serialize,this._deserialize=this.opts.deserialize,this.opts.namespace&&(this._namespace=this.opts.namespace),this._store){if(!this._isValidStorageAdapter(this._store))throw new Error("Invalid storage adapter");typeof this._store.on=="function"&&this._store.on("error",r=>this.emit("error",r)),this._store.namespace=this._namespace,typeof this._store[Symbol.iterator]=="function"&&this._store instanceof Map?this.iterator=this.generateIterator(this._store):"iterator"in this._store&&this._store.opts&&this._checkIterableAdapter()&&(this.iterator=this.generateIterator(this._store.iterator.bind(this._store)))}this.opts.stats&&(this.stats.enabled=this.opts.stats),this.opts.ttl&&(this._ttl=this.opts.ttl),this.opts.useKeyPrefix!==void 0&&(this._useKeyPrefix=this.opts.useKeyPrefix),this.opts.throwOnErrors!==void 0&&(this._throwOnErrors=this.opts.throwOnErrors)}get store(){return this._store}set store(t){if(this._isValidStorageAdapter(t))this._store=t,this.opts.store=t,typeof t.on=="function"&&t.on("error",e=>this.emit("error",e)),this._namespace&&(this._store.namespace=this._namespace),typeof t[Symbol.iterator]=="function"&&t instanceof Map?this.iterator=this.generateIterator(t):"iterator"in t&&t.opts&&this._checkIterableAdapter()&&(this.iterator=this.generateIterator(t.iterator?.bind(t)));else throw new Error("Invalid storage adapter")}get compression(){return this._compression}set compression(t){this._compression=t}get namespace(){return this._namespace}set namespace(t){this._namespace=t,this.opts.namespace=t,this._store.namespace=t,this.opts.store&&(this.opts.store.namespace=t)}get ttl(){return this._ttl}set ttl(t){this.opts.ttl=t,this._ttl=t}get serialize(){return this._serialize}set serialize(t){this.opts.serialize=t,this._serialize=t}get deserialize(){return this._deserialize}set deserialize(t){this.opts.deserialize=t,this._deserialize=t}get useKeyPrefix(){return this._useKeyPrefix}set useKeyPrefix(t){this._useKeyPrefix=t,this.opts.useKeyPrefix=t}get throwOnErrors(){return this._throwOnErrors}set throwOnErrors(t){this._throwOnErrors=t,this.opts.throwOnErrors=t}generateIterator(t){return async function*(){for await(let[r,s]of typeof t=="function"?t(this._store.namespace):t){let i=await this.deserializeData(s);if(!(this._useKeyPrefix&&this._store.namespace&&!r.includes(this._store.namespace))){if(typeof i.expires=="number"&&Date.now()>i.expires){this.delete(r);continue}yield[this._getKeyUnprefix(r),i.value]}}}.bind(this)}_checkIterableAdapter(){return py.includes(this._store.opts.dialect)||py.some(t=>this._store.opts.url.includes(t))}_getKeyPrefix(t){return!this._useKeyPrefix||!this._namespace?t:`${this._namespace}:${t}`}_getKeyPrefixArray(t){return!this._useKeyPrefix||!this._namespace?t:t.map(e=>`${this._namespace}:${e}`)}_getKeyUnprefix(t){return this._useKeyPrefix?t.split(":").splice(1).join(":"):t}_isValidStorageAdapter(t){return t instanceof Map||typeof t.get=="function"&&typeof t.set=="function"&&typeof t.delete=="function"&&typeof t.clear=="function"}async get(t,e){let{store:r}=this.opts,s=Array.isArray(t),i=s?this._getKeyPrefixArray(t):this._getKeyPrefix(t),n=c=>typeof c.expires=="number"&&Date.now()>c.expires;if(s)return e?.raw===!0?this.getMany(t,{raw:!0}):this.getMany(t,{raw:!1});this.hooks.trigger("preGet",{key:i});let a;try{a=await r.get(i)}catch(c){if(this.throwOnErrors)throw c}let o=typeof a=="string"||this.opts.compression?await this.deserializeData(a):a;if(o==null){this.stats.miss();return}if(n(o)){await this.delete(t),this.stats.miss();return}return this.hooks.trigger("postGet",{key:i,value:o}),this.stats.hit(),e?.raw?o:o.value}async getMany(t,e){let{store:r}=this.opts,s=this._getKeyPrefixArray(t),i=c=>typeof c.expires=="number"&&Date.now()>c.expires;if(this.hooks.trigger("preGetMany",{keys:s}),r.getMany===void 0){let c=s.map(async p=>{let g=await r.get(p),f=typeof g=="string"||this.opts.compression?await this.deserializeData(g):g;if(f!=null){if(i(f)){await this.delete(p);return}return e?.raw?f:f.value}}),u=(await Promise.allSettled(c)).map(p=>p.value);return this.hooks.trigger("postGetMany",u),u.length>0&&this.stats.hit(),u}let n=await r.getMany(s),a=[],o=[];for(let c in n){let l=n[c];if(typeof l=="string"&&(l=await this.deserializeData(l)),l==null){a.push(void 0);continue}if(i(l)){o.push(t[c]),a.push(void 0);continue}let u=e?.raw?l:l.value;a.push(u)}return o.length>0&&await this.deleteMany(o),this.hooks.trigger("postGetMany",a),a.length>0&&this.stats.hit(),a}async getRaw(t){let{store:e}=this.opts,r=this._getKeyPrefix(t);this.hooks.trigger("preGetRaw",{key:r});let s=await e.get(r);if(s==null){this.stats.miss();return}let i=typeof s=="string"||this.opts.compression?await this.deserializeData(s):s;if(i!==void 0&&i.expires!==void 0&&i.expires!==null&&i.expires<Date.now()){this.stats.miss(),await this.delete(t);return}return this.stats.hit(),this.hooks.trigger("postGetRaw",{key:r,value:i}),i}async getManyRaw(t){let{store:e}=this.opts,r=this._getKeyPrefixArray(t);if(t.length===0){let a=Array.from({length:t.length}).fill(void 0);return this.stats.misses+=t.length,this.hooks.trigger("postGetManyRaw",{keys:r,values:a}),a}let s=[];if(e.getMany===void 0){let a=r.map(async c=>{let l=await e.get(c);if(l!=null)return this.deserializeData(l)});s=(await Promise.allSettled(a)).map(c=>c.value)}else{let a=await e.getMany(r);for(let o of a)o!=null?s.push(await this.deserializeData(o)):s.push(void 0)}let i=[],n=a=>typeof a.expires=="number"&&Date.now()>a.expires;for(let[a,o]of s.entries())o!==void 0&&n(o)&&(i.push(r[a]),s[a]=void 0);return i.length>0&&await this.deleteMany(i),this.stats.hitsOrMisses(s),this.hooks.trigger("postGetManyRaw",{keys:r,values:s}),s}async set(t,e,r){let s={key:t,value:e,ttl:r};this.hooks.trigger("preSet",s);let i=this._getKeyPrefix(s.key);s.ttl??=this._ttl,s.ttl===0&&(s.ttl=void 0);let{store:n}=this.opts,a=typeof s.ttl=="number"?Date.now()+s.ttl:void 0;if(typeof s.value=="symbol")throw this.emit("error","symbol cannot be serialized"),new Error("symbol cannot be serialized");let o={value:s.value,expires:a},c=await this.serializeData(o),l=!0;try{let u=await n.set(i,c,s.ttl);typeof u=="boolean"&&(l=u)}catch(u){if(l=!1,this.emit("error",u),this._throwOnErrors)throw u}return this.hooks.trigger("postSet",{key:i,value:c,ttl:r}),this.stats.set(),l}async setMany(t){let e=[];try{if(this._store.setMany===void 0){let r=[];for(let i of t)r.push(this.set(i.key,i.value,i.ttl));e=await Promise.all(r)}else{let r=await Promise.all(t.map(async({key:s,value:i,ttl:n})=>{n??=this._ttl,n===0&&(n=void 0);let a=typeof n=="number"?Date.now()+n:void 0;if(typeof i=="symbol")throw this.emit("error","symbol cannot be serialized"),new Error("symbol cannot be serialized");let o={value:i,expires:a},c=await this.serializeData(o);return{key:this._getKeyPrefix(s),value:c,ttl:n}}));e=await this._store.setMany(r)}}catch(r){if(this.emit("error",r),this._throwOnErrors)throw r;e=t.map(()=>!1)}return e}async delete(t){let{store:e}=this.opts;if(Array.isArray(t))return this.deleteMany(t);let r=this._getKeyPrefix(t);this.hooks.trigger("preDelete",{key:r});let s=!0;try{let i=await e.delete(r);typeof i=="boolean"&&(s=i)}catch(i){if(s=!1,this.emit("error",i),this._throwOnErrors)throw i}return this.hooks.trigger("postDelete",{key:r,value:s}),this.stats.delete(),s}async deleteMany(t){try{let{store:e}=this.opts,r=this._getKeyPrefixArray(t);if(this.hooks.trigger("preDelete",{key:r}),e.deleteMany!==void 0)return await e.deleteMany(r);let s=r.map(async a=>e.delete(a)),n=(await Promise.all(s)).every(Boolean);return this.hooks.trigger("postDelete",{key:r,value:n}),n}catch(e){if(this.emit("error",e),this._throwOnErrors)throw e;return!1}}async clear(){this.emit("clear");let{store:t}=this.opts;try{await t.clear()}catch(e){if(this.emit("error",e),this._throwOnErrors)throw e}}async has(t){if(Array.isArray(t))return this.hasMany(t);let e=this._getKeyPrefix(t),{store:r}=this.opts;if(r.has!==void 0&&!(r instanceof Map))return r.has(e);let s;try{s=await r.get(e)}catch(i){if(this.emit("error",i),this._throwOnErrors)throw i;return!1}if(s){let i=await this.deserializeData(s);if(i)return i.expires===void 0||i.expires===null?!0:i.expires>Date.now()}return!1}async hasMany(t){let e=this._getKeyPrefixArray(t),{store:r}=this.opts;if(r.hasMany!==void 0)return r.hasMany(e);let s=[];for(let i of t)s.push(await this.has(i));return s}async disconnect(){let{store:t}=this.opts;if(this.emit("disconnect"),typeof t.disconnect=="function")return t.disconnect()}emit(t,...e){t==="error"&&!this.opts.emitErrors||super.emit(t,...e)}async serializeData(t){return this._serialize?this._compression?.compress?this._serialize({value:await this._compression.compress(t.value),expires:t.expires}):this._serialize(t):t}async deserializeData(t){if(!this._deserialize)return t;if(this._compression?.decompress&&typeof t=="string"){let e=await this._deserialize(t);return{value:await this._compression.decompress(e?.value),expires:e?.expires}}if(typeof t=="string")return this._deserialize(t)}},my=MO;var Ky=nt(Hy(),1);var ea=class{environment;cacheStore;constructor(e){this.environment=e}getStorageDirectory(){return hi.join(_T.homedir(),".powerlint")}getIndexDirectory(){return hi.join(this.getStorageDirectory(),"indexes",mn(this.environment.getWorkspaceRoot()))}getCacheDirectory(){return hi.join(this.getStorageDirectory(),"cache",mn(this.environment.getWorkspaceRoot()))}async ensureDirectory(e){await Ke.mkdir(e,{recursive:!0})}async getIndexFilePath(e,r){let s=this.getIndexDirectory();await this.ensureDirectory(s);let i=r||`${e.toLowerCase()}-index.scip`;return hi.join(s,`${e.toLowerCase()}-${i}`)}async indexExists(e,r){let s=await this.getIndexFilePath(e,r);try{return await Ke.access(s),!0}catch{return!1}}async readIndex(e,r){let s=await this.getIndexFilePath(e,r);try{return await Ke.access(s),await Ke.readFile(s)}catch{return null}}async saveIndex(e,r,s){let i=await this.getIndexFilePath(e,s);await Ke.writeFile(i,r)}getCacheFilePath(){return hi.join(this.getCacheDirectory(),"cache.json")}async purgeStorage(){let e=0,r=this.getStorageDirectory();try{await Ke.access(r),await Ke.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}async purgeCache(){let e=0,r=this.getCacheDirectory();try{await Ke.access(r),await Ke.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}getCacheStore(){if(!this.cacheStore){let e=this.getCacheDirectory();this.cacheStore=new my({store:new Ky.KeyvFile({filename:hi.join(e,"cache.json")})})}return this.cacheStore}async saveCache(e,r,s){let i=this.getCacheStore(),n=`${e}:${r}`;await i.set(n,s)}async readCache(e,r){let s=this.getCacheStore(),i=`${e}:${r}`;return await s.get(i)||null}async purgeIndexes(){let e=0,r=this.getIndexDirectory();try{await Ke.access(r),await Ke.rm(r,{recursive:!0,force:!0}),e++}catch{}return{success:!0,deletedCount:e}}};var vn=class{config;environment;constructor(e,r){this.config=e,this.environment=r}async getRepositoryUrl(){let e=await this.environment.getRepositoryUrl();if(!e)throw new Error("Could not determine repository URL. Make sure you're in a Git repository with a remote origin.");return e}async loadRuleById(e){let r=await this.fetchRules([e]);if(r.length===0)throw new Error(`Rule with ID '${e}' not found`);return r[0]}async loadAllRules(){return await this.fetchRules()}async fetchRules(e){let r=await this.getRepositoryUrl();return(await this.config.getApiClient().getRules({repository_url:r,rule_ids:e,schema_version:this.config.getSchemaVersion(),powerlint_version:this.config.getLocalVersion()})).rules.map(n=>({id:n.id,internalId:n.internalId,internalVersionId:n.internalVersionId,config:{message:n.message,severity:n.severity,execution:n.execution||"llm",steps:n.schema},prompt:n.prompt,testCases:[]}))}};import{EventEmitter as wT}from"events";var xt=class extends wT{rulesStartTime=0;indexingStartTimes=new Map;fileDiscoveryStartTime=0;constructor(){super(),this.setMaxListeners(20)}emit(e,r){return super.emit(e,r)}on(e,r){return super.on(e,r)}once(e,r){return super.once(e,r)}off(e,r){return super.off(e,r)}setExecutionMode(e,r){this.emit("execution:mode",{mode:e,...r})}startRules(e){this.rulesStartTime=Date.now(),this.emit("rules:start",{totalRules:e})}progressRule(e,r,s,i){let n=Math.round(e/r*100);this.emit("rules:progress",{currentRule:e,totalRules:r,ruleId:s,percentage:n,isLlm:i})}completeRules(e,r){let s=Date.now()-this.rulesStartTime;this.emit("rules:complete",{totalRules:e,totalMatches:r,executionTime:s})}startFileDiscovery(e){this.fileDiscoveryStartTime=Date.now(),this.emit("files:discovery:start",{mode:e})}fileDiscoveryProgress(e,r){this.emit("files:discovery:progress",{message:e,currentCount:r})}completeFileDiscovery(e,r,s,i,n){let a=Date.now()-this.fileDiscoveryStartTime,o;r==="diff"&&s&&(o={totalAdditions:0,totalDeletions:0,files:e.map(c=>{let l=s.get(c),u=l?.additions||0,p=l?.deletions||0;return{path:c,additions:u,deletions:p}})},o.totalAdditions=o.files.reduce((c,l)=>c+l.additions,0),o.totalDeletions=o.files.reduce((c,l)=>c+l.deletions,0)),this.emit("files:discovery:complete",{totalFiles:e.length,mode:r,executionTime:a,stats:o,ignoredFiles:i,deletedFiles:n})}fileFilter(e,r,s){this.emit("files:filter",{originalCount:e,filteredCount:r,filterType:s})}startScipMatchLookup(e,r){this.emit("scip:match-lookup:start",{language:e,match:r})}scipMatchLookupProgress(e,r){this.emit("scip:match-lookup:progress",{language:e,document:r})}scipMatchLookupComplete(e,r){this.emit("scip:match-lookup:complete",{language:e,document:r})}startIndexing(e){this.indexingStartTimes.set(e,Date.now()),this.emit("indexing:start",{language:e})}indexingProgress(e,r,s,i){this.emit("indexing:progress",{language:e,message:r,packageName:s,timeMs:i})}completeIndexing(e){let r=this.indexingStartTimes.get(e)||Date.now(),s=Date.now()-r;this.indexingStartTimes.delete(e),this.emit("indexing:complete",{language:e,executionTime:s})}startStep(e,r,s,i,n){this.emit("step:start",{ruleId:e,stepName:r,stepType:s,inputs:i,parentStepName:n})}completeStep(e,r,s,i,n=0,a){this.emit("step:complete",{ruleId:e,stepName:r,stepType:s,outputs:i,executionTime:n,parentStepName:a})}startTest(e,r){this.emit("test:start",{ruleId:e,testName:r})}testMatches(e,r,s){this.emit("test:matches",{ruleId:e,testName:r,matches:s})}completeTest(e,r,s,i){this.emit("test:complete",{ruleId:e,testName:r,matches:s,stepExecutions:i})}startLLMValidation(e,r,s){this.emit("llm:validation:start",{ruleId:e,matchCount:r,estimatedCost:s})}llmValidationProgress(e,r,s,i){this.emit("llm:validation:progress",{ruleId:e,tokenCount:r,elapsedTime:s,streamedText:i})}completeLLMValidation(e,r,s,i,n,a,o,c){this.emit("llm:validation:complete",{ruleId:e,tokenCount:r,inputTokens:s,outputTokens:i,cost:n,executionTime:a,violationCount:o,fromCache:c})}llmToolExecution(e,r,s){this.emit("llm:tool-execution",{ruleId:e,toolName:r,...s})}startLLMSearchPhase(e,r){this.emit("llm:search-phase:start",{ruleId:e,matchCount:r})}startLLMValidationPhase(e,r){this.emit("llm:validation-phase:start",{ruleId:e,matchCount:r})}};import{cpus as BI}from"os";var Jy=nt(du(),1);import{existsSync as TT}from"fs";import hs from"path";import{fileURLToPath as LT}from"url";console.debug=()=>{};var $T=LT(import.meta.url),pu=hs.dirname($T),PT={darwin:"macOS",linux:"Linux",win32:"Windows"},IT={x64:"X64",arm64:"ARM64"};function xe(t){let e=PT[process.platform],r=IT[process.arch];if(!e||!r)return;let s=[hs.join(pu,"powerlint/dist/vendor"),hs.join(pu,"../dist/vendor"),hs.join(pu,"./vendor")];for(let i of s){let n=hs.join(i,`ast-grep-lang-${t}`),a=hs.join(n,"prebuilds",`prebuild-${e}-${r}`,"parser.so");if(TT(a))return a}throw new Error(`Prebuild not found for ${t} on ${e} ${r}. Paths tried: ${s.join(", ")}`)}var kT={libraryPath:xe("angular"),extensions:["html"],languageSymbol:"tree_sitter_angular",expandoChar:"z"},NT={libraryPath:xe("bash"),extensions:["bash","bats","cgi","command","env","fcgi","ksh","sh","tmux","tool","zsh"],languageSymbol:"tree_sitter_bash",expandoChar:"$"},DT={libraryPath:xe("c"),extensions:["c","h"],languageSymbol:"tree_sitter_c",expandoChar:"_"},FT={libraryPath:xe("cpp"),extensions:["cc","hpp","cpp","hh","cxx","cu","ino"],languageSymbol:"tree_sitter_cpp",expandoChar:"_"},MT={libraryPath:xe("csharp"),extensions:["cs"],languageSymbol:"tree_sitter_c_sharp",expandoChar:"\xB5"},jT={libraryPath:xe("css"),extensions:["css","scss"],languageSymbol:"tree_sitter_css",expandoChar:"$"},BT={libraryPath:xe("dart"),extensions:["dart"],languageSymbol:"tree_sitter_dart",expandoChar:"$"},UT={libraryPath:xe("elixir"),extensions:["ex","exs"],languageSymbol:"tree_sitter_elixir",expandoChar:"\xB5"},GT={libraryPath:xe("go"),extensions:["go"],languageSymbol:"tree_sitter_go",expandoChar:"\xB5"},zT={libraryPath:xe("haskell"),extensions:["hs"],languageSymbol:"tree_sitter_haskell",expandoChar:"\xB5"},qT={libraryPath:xe("html"),extensions:["html","htm","xhtml"],languageSymbol:"tree_sitter_html",expandoChar:"z"},WT={libraryPath:xe("java"),extensions:["java"],languageSymbol:"tree_sitter_java",expandoChar:"$"},VT={libraryPath:xe("javascript"),extensions:["cjs","js","mjs","jsx"],languageSymbol:"tree_sitter_javascript",expandoChar:"$"},ZT={libraryPath:xe("json"),extensions:["json"],languageSymbol:"tree_sitter_json",expandoChar:"$"},HT={libraryPath:xe("kotlin"),extensions:["kt","ktm","kts"],languageSymbol:"tree_sitter_kotlin",expandoChar:"\xB5"},KT={libraryPath:xe("lua"),extensions:["lua"],languageSymbol:"tree_sitter_lua",expandoChar:"$"},YT={libraryPath:xe("markdown"),extensions:["md"],languageSymbol:"tree_sitter_markdown",expandoChar:"$"},JT={libraryPath:xe("php"),extensions:["php"],languageSymbol:"tree_sitter_php",expandoChar:"$"},XT={libraryPath:xe("python"),extensions:["py"],languageSymbol:"tree_sitter_python",expandoChar:"\xB5"},QT={libraryPath:xe("ruby"),extensions:["rb","rbw","gemspec"],languageSymbol:"tree_sitter_ruby",expandoChar:"\xB5"},eL={libraryPath:xe("rust"),extensions:["rs"],languageSymbol:"tree_sitter_rust",expandoChar:"\xB5"},tL={libraryPath:xe("scala"),extensions:["scala","sc","sbt"],languageSymbol:"tree_sitter_scala",expandoChar:"$"},rL={libraryPath:xe("sql"),extensions:["sql"],languageSymbol:"tree_sitter_sql",expandoChar:"_"},sL={libraryPath:xe("swift"),extensions:["swift"],languageSymbol:"tree_sitter_swift",expandoChar:"\xB5"},iL={libraryPath:xe("toml"),extensions:["toml"],languageSymbol:"tree_sitter_toml",expandoChar:"_"},nL={libraryPath:xe("tsx"),extensions:["tsx"],languageSymbol:"tree_sitter_tsx",expandoChar:"$"},oL={libraryPath:xe("typescript"),extensions:["ts","cts","mts"],languageSymbol:"tree_sitter_typescript",expandoChar:"$"},aL={libraryPath:xe("yaml"),extensions:["yaml","yml"],languageSymbol:"tree_sitter_yaml",expandoChar:"$"},Xy={Angular:kT,Bash:NT,C:DT,Cpp:FT,Csharp:MT,Css:jT,Dart:BT,Elixir:UT,Go:GT,Haskell:zT,Html:qT,Java:WT,JavaScript:VT,Json:ZT,Kotlin:HT,Lua:KT,Markdown:YT,Php:JT,Python:XT,Ruby:QT,Rust:eL,Scala:tL,Sql:rL,Swift:sL,Toml:iL,Tsx:nL,TypeScript:oL,Yaml:aL};(0,Jy.registerDynamicLanguage)(Xy);var Yy=Object.entries(Xy).reduce((t,[e,r])=>(t[e]=r.extensions??[],t),{});function ra(t){let e=hs.extname(t).slice(1);return cL(e)??"Unknown"}function cL(t){return Object.keys(Yy).find(e=>Yy[e].includes(t))}import*as ms from"fs";import*as Zt from"path";var b0=nt(f0(),1);var _n=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var gL={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},wn=t=>t.replace(/[[\]\\-]/g,"\\$&"),yL=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),h0=t=>t.join(""),d0=(t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let s=[],i=[],n=r+1,a=!1,o=!1,c=!1,l=!1,u=r,p="";e:for(;n<t.length;){let m=t.charAt(n);if((m==="!"||m==="^")&&n===r+1){l=!0,n++;continue}if(m==="]"&&a&&!c){u=n+1;break}if(a=!0,m==="\\"&&!c){c=!0,n++;continue}if(m==="["&&!c){for(let[y,[v,_,w]]of Object.entries(gL))if(t.startsWith(y,n)){if(p)return["$.",!1,t.length-r,!0];n+=y.length,w?i.push(v):s.push(v),o=o||_;continue e}}if(c=!1,p){m>p?s.push(wn(p)+"-"+wn(m)):m===p&&s.push(wn(m)),p="",n++;continue}if(t.startsWith("-]",n+1)){s.push(wn(m+"-")),n+=2;continue}if(t.startsWith("-",n+1)){p=m,n+=2;continue}s.push(wn(m)),n++}if(u<n)return["",!1,0,!1];if(!s.length&&!i.length)return["$.",!1,t.length-r,!0];if(i.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!l){let m=s[0].length===2?s[0].slice(-1):s[0];return[yL(m),!1,u-r,!1]}let g="["+(l?"^":"")+h0(s)+"]",f="["+(l?"":"^")+h0(i)+"]";return[s.length&&i.length?"("+g+"|"+f+")":s.length?g:f,o,u-r,!0]};var It=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var vL=new Set(["!","?","+","*","@"]),p0=t=>vL.has(t),bL="(?!(?:^|/)\\.\\.?(?:$|/))",sa="(?!\\.)",_L=new Set(["[","."]),wL=new Set(["..","."]),xL=new Set("().*{}+?[]^$\\!"),EL=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),yu="[^/]",m0=yu+"*?",g0=yu+"+?",di=class t{type;#t;#r;#e=!1;#n=[];#f;#_;#a;#u=!1;#i;#c;#s=!1;constructor(e,r,s={}){this.type=e,e&&(this.#r=!0),this.#f=r,this.#t=this.#f?this.#f.#t:this,this.#i=this.#t===this?s:this.#t.#i,this.#a=this.#t===this?[]:this.#t.#a,e==="!"&&!this.#t.#u&&this.#a.push(this),this.#_=this.#f?this.#f.#n.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#n)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#c!==void 0?this.#c:this.type?this.#c=this.type+"("+this.#n.map(e=>String(e)).join("|")+")":this.#c=this.#n.map(e=>String(e)).join("")}#l(){if(this!==this.#t)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#a.pop();){if(e.type!=="!")continue;let r=e,s=r.#f;for(;s;){for(let i=r.#_+1;!s.type&&i<s.#n.length;i++)for(let n of e.#n){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(s.#n[i])}r=s,s=r.#f}}return this}push(...e){for(let r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof t&&r.#f===this))throw new Error("invalid part: "+r);this.#n.push(r)}}toJSON(){let e=this.type===null?this.#n.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#n.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#u&&this.#f?.type==="!")&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#f?.isStart())return!1;if(this.#_===0)return!0;let e=this.#f;for(let r=0;r<this.#_;r++){let s=e.#n[r];if(!(s instanceof t&&s.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#f?.type==="!")return!0;if(!this.#f?.isEnd())return!1;if(!this.type)return this.#f?.isEnd();let e=this.#f?this.#f.#n.length:0;return this.#_===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let r=new t(this.type,e);for(let s of this.#n)r.copyIn(s);return r}static#o(e,r,s,i){let n=!1,a=!1,o=-1,c=!1;if(r.type===null){let f=s,d="";for(;f<e.length;){let m=e.charAt(f++);if(n||m==="\\"){n=!n,d+=m;continue}if(a){f===o+1?(m==="^"||m==="!")&&(c=!0):m==="]"&&!(f===o+2&&c)&&(a=!1),d+=m;continue}else if(m==="["){a=!0,o=f,c=!1,d+=m;continue}if(!i.noext&&p0(m)&&e.charAt(f)==="("){r.push(d),d="";let y=new t(m,r);f=t.#o(e,y,f,i),r.push(y);continue}d+=m}return r.push(d),f}let l=s+1,u=new t(null,r),p=[],g="";for(;l<e.length;){let f=e.charAt(l++);if(n||f==="\\"){n=!n,g+=f;continue}if(a){l===o+1?(f==="^"||f==="!")&&(c=!0):f==="]"&&!(l===o+2&&c)&&(a=!1),g+=f;continue}else if(f==="["){a=!0,o=l,c=!1,g+=f;continue}if(p0(f)&&e.charAt(l)==="("){u.push(g),g="";let d=new t(f,u);u.push(d),l=t.#o(e,d,l,i);continue}if(f==="|"){u.push(g),g="",p.push(u),u=new t(null,r);continue}if(f===")")return g===""&&r.#n.length===0&&(r.#s=!0),u.push(g),g="",r.push(...p,u),l;g+=f}return r.type=null,r.#r=void 0,r.#n=[e.substring(s-1)],l}static fromGlob(e,r={}){let s=new t(null,void 0,r);return t.#o(e,s,0,r),s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[r,s,i,n]=this.toRegExpSource();if(!(i||this.#r||this.#i.nocase&&!this.#i.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return s;let o=(this.#i.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${r}$`,o),{_src:r,_glob:e})}get options(){return this.#i}toRegExpSource(e){let r=e??!!this.#i.dot;if(this.#t===this&&this.#l(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#n.map(f=>{let[d,m,y,v]=typeof f=="string"?t.#g(f,this.#r,c):f.toRegExpSource(e);return this.#r=this.#r||y,this.#e=this.#e||v,d}).join(""),u="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&wL.has(this.#n[0]))){let d=_L,m=r&&d.has(l.charAt(0))||l.startsWith("\\.")&&d.has(l.charAt(2))||l.startsWith("\\.\\.")&&d.has(l.charAt(4)),y=!r&&!e&&d.has(l.charAt(0));u=m?bL:y?sa:""}let p="";return this.isEnd()&&this.#t.#u&&this.#f?.type==="!"&&(p="(?:$|\\/)"),[u+l+p,It(l),this.#r=!!this.#r,this.#e]}let s=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#p(r);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let c=this.toString();return this.#n=[c],this.type=null,this.#r=void 0,[c,It(this.toString()),!1,!1]}let a=!s||e||r||!sa?"":this.#p(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let o="";if(this.type==="!"&&this.#s)o=(this.isStart()&&!r?sa:"")+g0;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!e?sa:"")+m0+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=i+n+c}return[o,It(n),this.#r=!!this.#r,this.#e]}#p(e){return this.#n.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[s,i,n,a]=r.toRegExpSource(e);return this.#e=this.#e||a,s}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#g(e,r,s=!1){let i=!1,n="",a=!1;for(let o=0;o<e.length;o++){let c=e.charAt(o);if(i){i=!1,n+=(xL.has(c)?"\\":"")+c;continue}if(c==="\\"){o===e.length-1?n+="\\\\":i=!0;continue}if(c==="["){let[l,u,p,g]=d0(e,o);if(p){n+=l,a=a||u,o+=p-1,r=r||g;continue}}if(c==="*"){s&&e==="*"?n+=g0:n+=m0,r=!0;continue}if(c==="?"){n+=yu,r=!0;continue}n+=EL(c)}return[n,It(e),!!r,a]}};var pi=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var rt=(t,e,r={})=>(_n(e),!r.nocomment&&e.charAt(0)==="#"?!1:new ut(e,r).match(t)),SL=/^\*+([^+@!?\*\[\(]*)$/,RL=t=>e=>!e.startsWith(".")&&e.endsWith(t),AL=t=>e=>e.endsWith(t),CL=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),OL=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),TL=/^\*+\.\*+$/,LL=t=>!t.startsWith(".")&&t.includes("."),$L=t=>t!=="."&&t!==".."&&t.includes("."),PL=/^\.\*+$/,IL=t=>t!=="."&&t!==".."&&t.startsWith("."),kL=/^\*+$/,NL=t=>t.length!==0&&!t.startsWith("."),DL=t=>t.length!==0&&t!=="."&&t!=="..",FL=/^\?+([^+@!?\*\[\(]*)?$/,ML=([t,e=""])=>{let r=_0([t]);return e?(e=e.toLowerCase(),s=>r(s)&&s.toLowerCase().endsWith(e)):r},jL=([t,e=""])=>{let r=w0([t]);return e?(e=e.toLowerCase(),s=>r(s)&&s.toLowerCase().endsWith(e)):r},BL=([t,e=""])=>{let r=w0([t]);return e?s=>r(s)&&s.endsWith(e):r},UL=([t,e=""])=>{let r=_0([t]);return e?s=>r(s)&&s.endsWith(e):r},_0=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},w0=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},x0=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",y0={win32:{sep:"\\"},posix:{sep:"/"}},GL=x0==="win32"?y0.win32.sep:y0.posix.sep;rt.sep=GL;var qe=Symbol("globstar **");rt.GLOBSTAR=qe;var zL="[^/]",qL=zL+"*?",WL="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",VL="(?:(?!(?:\\/|^)\\.).)*?",ZL=(t,e={})=>r=>rt(r,t,e);rt.filter=ZL;var Et=(t,e={})=>Object.assign({},t,e),HL=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return rt;let e=rt;return Object.assign((s,i,n={})=>e(s,i,Et(t,n)),{Minimatch:class extends e.Minimatch{constructor(i,n={}){super(i,Et(t,n))}static defaults(i){return e.defaults(Et(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,n,a={}){super(i,n,Et(t,a))}static fromGlob(i,n={}){return e.AST.fromGlob(i,Et(t,n))}},unescape:(s,i={})=>e.unescape(s,Et(t,i)),escape:(s,i={})=>e.escape(s,Et(t,i)),filter:(s,i={})=>e.filter(s,Et(t,i)),defaults:s=>e.defaults(Et(t,s)),makeRe:(s,i={})=>e.makeRe(s,Et(t,i)),braceExpand:(s,i={})=>e.braceExpand(s,Et(t,i)),match:(s,i,n={})=>e.match(s,i,Et(t,n)),sep:e.sep,GLOBSTAR:qe})};rt.defaults=HL;var E0=(t,e={})=>(_n(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,b0.default)(t));rt.braceExpand=E0;var KL=(t,e={})=>new ut(t,e).makeRe();rt.makeRe=KL;var YL=(t,e,r={})=>{let s=new ut(e,r);return t=t.filter(i=>s.match(i)),s.options.nonull&&!t.length&&t.push(e),t};rt.match=YL;var v0=/[?*]|[+@!]\(.*?\)|\[|\]/,JL=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ut=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,r={}){_n(e),r=r||{},this.options=r,this.pattern=e,this.platform=r.platform||x0,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...n)=>console.error(...n)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let i=this.globParts.map((n,a,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=n[0]===""&&n[1]===""&&(n[2]==="?"||!v0.test(n[2]))&&!v0.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(c)return[...n.slice(0,4),...n.slice(4).map(u=>this.parse(u))];if(l)return[n[0],...n.slice(1).map(u=>this.parse(u))]}return n.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let a=this.set[n];a[0]===""&&a[1]===""&&this.globParts[n][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let s=0;s<e.length;s++)for(let i=0;i<e[s].length;i++)e[s][i]==="**"&&(e[s][i]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let i=s;for(;r[i+1]==="**";)i++;i!==s&&r.splice(s,i-s)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((s,i)=>{let n=s[s.length-1];return i==="**"&&n==="**"?s:i===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(s.pop(),s):(s.push(i),s)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let n=e[i];i===1&&n===""&&e[0]===""||(n==="."||n==="")&&(r=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let s=0;for(;(s=e.indexOf("..",s+1))!==-1;){let i=e[s-1];i&&i!=="."&&i!==".."&&i!=="**"&&(r=!0,e.splice(s-1,2),s-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let s of e){let i=-1;for(;(i=s.indexOf("**",i+1))!==-1;){let a=i;for(;s[a+1]==="**";)a++;a>i&&s.splice(i+1,a-i);let o=s[i+1],c=s[i+2],l=s[i+3];if(o!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;r=!0,s.splice(i,1);let u=s.slice(0);u[i]="**",e.push(u),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<s.length-1;a++){let o=s[a];a===1&&o===""&&s[0]===""||(o==="."||o==="")&&(r=!0,s.splice(a,1),a--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(r=!0,s.pop())}let n=0;for(;(n=s.indexOf("..",n+1))!==-1;){let a=s[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){r=!0;let c=n===1&&s[n+1]==="**"?["."]:[];s.splice(n-1,2,...c),s.length===0&&s.push(""),n-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let s=r+1;s<e.length;s++){let i=this.partsMatch(e[r],e[s],!this.preserveMultipleSlashes);if(i){e[r]=[],e[s]=i;break}}return e.filter(r=>r.length)}partsMatch(e,r,s=!1){let i=0,n=0,a=[],o="";for(;i<e.length&&n<r.length;)if(e[i]===r[n])a.push(o==="b"?r[n]:e[i]),i++,n++;else if(s&&e[i]==="**"&&r[n]===e[i+1])a.push(e[i]),i++;else if(s&&r[n]==="**"&&e[i]===r[n+1])a.push(r[n]),n++;else if(e[i]==="*"&&r[n]&&(this.options.dot||!r[n].startsWith("."))&&r[n]!=="**"){if(o==="b")return!1;o="a",a.push(e[i]),i++,n++}else if(r[n]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(o==="a")return!1;o="b",a.push(r[n]),i++,n++}else return!1;return e.length===r.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,s=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)r=!r,s++;s&&(this.pattern=e.slice(s)),this.negate=r}matchOne(e,r,s=!1){let i=this.options;if(this.isWindows){let m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),y=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),v=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),_=!v&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),w=y?3:m?0:void 0,h=_?3:v?0:void 0;if(typeof w=="number"&&typeof h=="number"){let[b,x]=[e[w],r[h]];b.toLowerCase()===x.toLowerCase()&&(r[h]=b,h>w?r=r.slice(h):w>h&&(e=e.slice(w)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:r}),this.debug("matchOne",e.length,r.length);for(var a=0,o=0,c=e.length,l=r.length;a<c&&o<l;a++,o++){this.debug("matchOne loop");var u=r[o],p=e[a];if(this.debug(r,u,p),u===!1)return!1;if(u===qe){this.debug("GLOBSTAR",[r,u,p]);var g=a,f=o+1;if(f===l){for(this.debug("** at the end");a<c;a++)if(e[a]==="."||e[a]===".."||!i.dot&&e[a].charAt(0)===".")return!1;return!0}for(;g<c;){var d=e[g];if(this.debug(`
|
|
49
|
+
globstar while`,e,g,r,f,d),this.matchOne(e.slice(g),r.slice(f),s))return this.debug("globstar found match!",g,c,d),!0;if(d==="."||d===".."||!i.dot&&d.charAt(0)==="."){this.debug("dot detected!",e,g,r,f);break}this.debug("globstar swallow a segment, and continue"),g++}return!!(s&&(this.debug(`
|
|
50
|
+
>>> no match, partial?`,e,g,r,f),g===c))}let m;if(typeof u=="string"?(m=p===u,this.debug("string match",u,p,m)):(m=u.test(p),this.debug("pattern match",u,p,m)),!m)return!1}if(a===c&&o===l)return!0;if(a===c)return s;if(o===l)return a===c-1&&e[a]==="";throw new Error("wtf?")}braceExpand(){return E0(this.pattern,this.options)}parse(e){_n(e);let r=this.options;if(e==="**")return qe;if(e==="")return"";let s,i=null;(s=e.match(kL))?i=r.dot?DL:NL:(s=e.match(SL))?i=(r.nocase?r.dot?OL:CL:r.dot?AL:RL)(s[1]):(s=e.match(FL))?i=(r.nocase?r.dot?jL:ML:r.dot?BL:UL)(s):(s=e.match(TL))?i=r.dot?$L:LL:(s=e.match(PL))&&(i=IL);let n=di.fromGlob(e,this.options).toMMPattern();return i&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:i}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,s=r.noglobstar?qL:r.dot?WL:VL,i=new Set(r.nocase?["i"]:[]),n=e.map(c=>{let l=c.map(u=>{if(u instanceof RegExp)for(let p of u.flags.split(""))i.add(p);return typeof u=="string"?JL(u):u===qe?qe:u._src});return l.forEach((u,p)=>{let g=l[p+1],f=l[p-1];u!==qe||f===qe||(f===void 0?g!==void 0&&g!==qe?l[p+1]="(?:\\/|"+s+"\\/)?"+g:l[p]=s:g===void 0?l[p-1]=f+"(?:\\/|"+s+")?":g!==qe&&(l[p-1]=f+"(?:\\/|\\/"+s+"\\/)"+g,l[p+1]=qe))}),l.filter(u=>u!==qe).join("/")}).join("|"),[a,o]=e.length>1?["(?:",")"]:["",""];n="^"+a+n+o+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let s=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let n=this.set;this.debug(this.pattern,"set",n);let a=i[i.length-1];if(!a)for(let o=i.length-2;!a&&o>=0;o--)a=i[o];for(let o=0;o<n.length;o++){let c=n[o],l=i;if(s.matchBase&&c.length===1&&(l=[a]),this.matchOne(l,c,r))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(e){return rt.defaults(e).Minimatch}};rt.AST=di;rt.Minimatch=ut;rt.escape=pi;rt.unescape=It;import{fileURLToPath as T$}from"node:url";var mi=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,R0=new Set,vu=typeof process=="object"&&process?process:{},A0=(t,e,r,s)=>{typeof vu.emitWarning=="function"?vu.emitWarning(t,e,r,s):console.error(`[${r}] ${e}: ${t}`)},ia=globalThis.AbortController,S0=globalThis.AbortSignal;if(typeof ia>"u"){S0=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(s,i){this._onabort.push(i)}},ia=class{constructor(){e()}signal=new S0;abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(let i of this.signal._onabort)i(s);this.signal.onabort?.(s)}}};let t=vu.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,A0("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var XL=t=>!R0.has(t),vM=Symbol("type"),Sr=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),C0=t=>Sr(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?gi:null:null,gi=class extends Array{constructor(e){super(e),this.fill(0)}},bu=class t{heap;length;static#t=!1;static create(e){let r=C0(e);if(!r)return[];t.#t=!0;let s=new t(e,r);return t.#t=!1,s}constructor(e,r){if(!t.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},xn=class t{#t;#r;#e;#n;#f;#_;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#u;#i;#c;#s;#l;#o;#p;#g;#y;#d;#A;#w;#x;#E;#S;#b;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#x,sizes:e.#A,keyMap:e.#i,keyList:e.#c,valList:e.#s,next:e.#l,prev:e.#o,get head(){return e.#p},get tail(){return e.#g},free:e.#y,isBackgroundFetch:r=>e.#m(r),backgroundFetch:(r,s,i,n)=>e.#k(r,s,i,n),moveToTail:r=>e.#D(r),indexes:r=>e.#O(r),rindexes:r=>e.#L(r),isStale:r=>e.#R(r)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#u}get size(){return this.#a}get fetchMethod(){return this.#f}get memoMethod(){return this.#_}get dispose(){return this.#e}get disposeAfter(){return this.#n}constructor(e){let{max:r=0,ttl:s,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:o,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:p,noUpdateTTL:g,maxSize:f=0,maxEntrySize:d=0,sizeCalculation:m,fetchMethod:y,memoMethod:v,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:b,ignoreFetchAbort:x}=e;if(r!==0&&!Sr(r))throw new TypeError("max option must be a nonnegative integer");let E=r?C0(r):Array;if(!E)throw new Error("invalid max value: "+r);if(this.#t=r,this.#r=f,this.maxEntrySize=d||this.#r,this.sizeCalculation=m,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(v!==void 0&&typeof v!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#_=v,y!==void 0&&typeof y!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#f=y,this.#S=!!y,this.#i=new Map,this.#c=new Array(r).fill(void 0),this.#s=new Array(r).fill(void 0),this.#l=new E(r),this.#o=new E(r),this.#p=0,this.#g=0,this.#y=bu.create(r),this.#a=0,this.#u=0,typeof l=="function"&&(this.#e=l),typeof u=="function"?(this.#n=u,this.#d=[]):(this.#n=void 0,this.#d=void 0),this.#E=!!this.#e,this.#b=!!this.#n,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!g,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!h,this.allowStaleOnFetchAbort=!!b,this.ignoreFetchAbort=!!x,this.maxEntrySize!==0){if(this.#r!==0&&!Sr(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!Sr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#I()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!o,this.ttlResolution=Sr(i)||i===0?i:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!Sr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let L="LRU_CACHE_UNBOUNDED";XL(L)&&(R0.add(L),A0("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",L,t))}}getRemainingTTL(e){return this.#i.has(e)?1/0:0}#P(){let e=new gi(this.#t),r=new gi(this.#t);this.#x=e,this.#w=r,this.#F=(n,a,o=mi.now())=>{if(r[n]=a!==0?o:0,e[n]=a,a!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#R(n)&&this.#v(this.#c[n],"expire")},a+1);c.unref&&c.unref()}},this.#C=n=>{r[n]=e[n]!==0?mi.now():0},this.#h=(n,a)=>{if(e[a]){let o=e[a],c=r[a];if(!o||!c)return;n.ttl=o,n.start=c,n.now=s||i();let l=n.now-c;n.remainingTTL=o-l}};let s=0,i=()=>{let n=mi.now();if(this.ttlResolution>0){s=n;let a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref()}return n};this.getRemainingTTL=n=>{let a=this.#i.get(n);if(a===void 0)return 0;let o=e[a],c=r[a];if(!o||!c)return 1/0;let l=(s||i())-c;return o-l},this.#R=n=>{let a=r[n],o=e[n];return!!o&&!!a&&(s||i())-a>o}}#C=()=>{};#h=()=>{};#F=()=>{};#R=()=>!1;#I(){let e=new gi(this.#t);this.#u=0,this.#A=e,this.#N=r=>{this.#u-=e[r],e[r]=0},this.#B=(r,s,i,n)=>{if(this.#m(s))return 0;if(!Sr(i))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(i=n(s,r),!Sr(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#T=(r,s,i)=>{if(e[r]=s,this.#r){let n=this.#r-e[r];for(;this.#u>n;)this.#$(!0)}this.#u+=e[r],i&&(i.entrySize=s,i.totalCalculatedSize=this.#u)}}#N=e=>{};#T=(e,r,s)=>{};#B=(e,r,s,i)=>{if(s||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#O({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#g;!(!this.#M(r)||((e||!this.#R(r))&&(yield r),r===this.#p));)r=this.#o[r]}*#L({allowStale:e=this.allowStale}={}){if(this.#a)for(let r=this.#p;!(!this.#M(r)||((e||!this.#R(r))&&(yield r),r===this.#g));)r=this.#l[r]}#M(e){return e!==void 0&&this.#i.get(this.#c[e])===e}*entries(){for(let e of this.#O())this.#s[e]!==void 0&&this.#c[e]!==void 0&&!this.#m(this.#s[e])&&(yield[this.#c[e],this.#s[e]])}*rentries(){for(let e of this.#L())this.#s[e]!==void 0&&this.#c[e]!==void 0&&!this.#m(this.#s[e])&&(yield[this.#c[e],this.#s[e]])}*keys(){for(let e of this.#O()){let r=this.#c[e];r!==void 0&&!this.#m(this.#s[e])&&(yield r)}}*rkeys(){for(let e of this.#L()){let r=this.#c[e];r!==void 0&&!this.#m(this.#s[e])&&(yield r)}}*values(){for(let e of this.#O())this.#s[e]!==void 0&&!this.#m(this.#s[e])&&(yield this.#s[e])}*rvalues(){for(let e of this.#L())this.#s[e]!==void 0&&!this.#m(this.#s[e])&&(yield this.#s[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let s of this.#O()){let i=this.#s[s],n=this.#m(i)?i.__staleWhileFetching:i;if(n!==void 0&&e(n,this.#c[s],this))return this.get(this.#c[s],r)}}forEach(e,r=this){for(let s of this.#O()){let i=this.#s[s],n=this.#m(i)?i.__staleWhileFetching:i;n!==void 0&&e.call(r,n,this.#c[s],this)}}rforEach(e,r=this){for(let s of this.#L()){let i=this.#s[s],n=this.#m(i)?i.__staleWhileFetching:i;n!==void 0&&e.call(r,n,this.#c[s],this)}}purgeStale(){let e=!1;for(let r of this.#L({allowStale:!0}))this.#R(r)&&(this.#v(this.#c[r],"expire"),e=!0);return e}info(e){let r=this.#i.get(e);if(r===void 0)return;let s=this.#s[r],i=this.#m(s)?s.__staleWhileFetching:s;if(i===void 0)return;let n={value:i};if(this.#x&&this.#w){let a=this.#x[r],o=this.#w[r];if(a&&o){let c=a-(mi.now()-o);n.ttl=c,n.start=Date.now()}}return this.#A&&(n.size=this.#A[r]),n}dump(){let e=[];for(let r of this.#O({allowStale:!0})){let s=this.#c[r],i=this.#s[r],n=this.#m(i)?i.__staleWhileFetching:i;if(n===void 0||s===void 0)continue;let a={value:n};if(this.#x&&this.#w){a.ttl=this.#x[r];let o=mi.now()-this.#w[r];a.start=Math.floor(Date.now()-o)}this.#A&&(a.size=this.#A[r]),e.unshift([s,a])}return e}load(e){this.clear();for(let[r,s]of e){if(s.start){let i=Date.now()-s.start;s.start=mi.now()-i}this.set(r,s.value,s)}}set(e,r,s={}){if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:c}=s,{noUpdateTTL:l=this.noUpdateTTL}=s,u=this.#B(e,r,s.size||0,o);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#v(e,"set"),this;let p=this.#a===0?void 0:this.#i.get(e);if(p===void 0)p=this.#a===0?this.#g:this.#y.length!==0?this.#y.pop():this.#a===this.#t?this.#$(!1):this.#a,this.#c[p]=e,this.#s[p]=r,this.#i.set(e,p),this.#l[this.#g]=p,this.#o[p]=this.#g,this.#g=p,this.#a++,this.#T(p,u,c),c&&(c.set="add"),l=!1;else{this.#D(p);let g=this.#s[p];if(r!==g){if(this.#S&&this.#m(g)){g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=g;f!==void 0&&!a&&(this.#E&&this.#e?.(f,e,"set"),this.#b&&this.#d?.push([f,e,"set"]))}else a||(this.#E&&this.#e?.(g,e,"set"),this.#b&&this.#d?.push([g,e,"set"]));if(this.#N(p),this.#T(p,u,c),this.#s[p]=r,c){c.set="replace";let f=g&&this.#m(g)?g.__staleWhileFetching:g;f!==void 0&&(c.oldValue=f)}}else c&&(c.set="update")}if(i!==0&&!this.#x&&this.#P(),this.#x&&(l||this.#F(p,i,n),c&&this.#h(c,p)),!a&&this.#b&&this.#d){let g=this.#d,f;for(;f=g?.shift();)this.#n?.(...f)}return this}pop(){try{for(;this.#a;){let e=this.#s[this.#p];if(this.#$(!0),this.#m(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#b&&this.#d){let e=this.#d,r;for(;r=e?.shift();)this.#n?.(...r)}}}#$(e){let r=this.#p,s=this.#c[r],i=this.#s[r];return this.#S&&this.#m(i)?i.__abortController.abort(new Error("evicted")):(this.#E||this.#b)&&(this.#E&&this.#e?.(i,s,"evict"),this.#b&&this.#d?.push([i,s,"evict"])),this.#N(r),e&&(this.#c[r]=void 0,this.#s[r]=void 0,this.#y.push(r)),this.#a===1?(this.#p=this.#g=0,this.#y.length=0):this.#p=this.#l[r],this.#i.delete(s),this.#a--,r}has(e,r={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=r,n=this.#i.get(e);if(n!==void 0){let a=this.#s[n];if(this.#m(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#R(n))i&&(i.has="stale",this.#h(i,n));else return s&&this.#C(n),i&&(i.has="hit",this.#h(i,n)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{allowStale:s=this.allowStale}=r,i=this.#i.get(e);if(i===void 0||!s&&this.#R(i))return;let n=this.#s[i];return this.#m(n)?n.__staleWhileFetching:n}#k(e,r,s,i){let n=r===void 0?void 0:this.#s[r];if(this.#m(n))return n;let a=new ia,{signal:o}=s;o?.addEventListener("abort",()=>a.abort(o.reason),{signal:a.signal});let c={signal:a.signal,options:s,context:i},l=(m,y=!1)=>{let{aborted:v}=a.signal,_=s.ignoreFetchAbort&&m!==void 0;if(s.status&&(v&&!y?(s.status.fetchAborted=!0,s.status.fetchError=a.signal.reason,_&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),v&&!_&&!y)return p(a.signal.reason);let w=f;return this.#s[r]===f&&(m===void 0?w.__staleWhileFetching?this.#s[r]=w.__staleWhileFetching:this.#v(e,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(e,m,c.options))),m},u=m=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=m),p(m)),p=m=>{let{aborted:y}=a.signal,v=y&&s.allowStaleOnFetchAbort,_=v||s.allowStaleOnFetchRejection,w=_||s.noDeleteOnFetchRejection,h=f;if(this.#s[r]===f&&(!w||h.__staleWhileFetching===void 0?this.#v(e,"fetch"):v||(this.#s[r]=h.__staleWhileFetching)),_)return s.status&&h.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),h.__staleWhileFetching;if(h.__returned===h)throw m},g=(m,y)=>{let v=this.#f?.(e,n,c);v&&v instanceof Promise&&v.then(_=>m(_===void 0?void 0:_),y),a.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(m(void 0),s.allowStaleOnFetchAbort&&(m=_=>l(_,!0)))})};s.status&&(s.status.fetchDispatched=!0);let f=new Promise(g).then(l,u),d=Object.assign(f,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return r===void 0?(this.set(e,d,{...c.options,status:void 0}),r=this.#i.get(e)):this.#s[r]=d,d}#m(e){if(!this.#S)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof ia}async fetch(e,r={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:m,forceRefresh:y=!1,status:v,signal:_}=r;if(!this.#S)return v&&(v.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:v});let w={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:o,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:d,ignoreFetchAbort:f,status:v,signal:_},h=this.#i.get(e);if(h===void 0){v&&(v.fetch="miss");let b=this.#k(e,h,w,m);return b.__returned=b}else{let b=this.#s[h];if(this.#m(b)){let O=s&&b.__staleWhileFetching!==void 0;return v&&(v.fetch="inflight",O&&(v.returnedStale=!0)),O?b.__staleWhileFetching:b.__returned=b}let x=this.#R(h);if(!y&&!x)return v&&(v.fetch="hit"),this.#D(h),i&&this.#C(h),v&&this.#h(v,h),b;let E=this.#k(e,h,w,m),A=E.__staleWhileFetching!==void 0&&s;return v&&(v.fetch=x?"stale":"refresh",A&&x&&(v.returnedStale=!0)),A?E.__staleWhileFetching:E.__returned=E}}async forceFetch(e,r={}){let s=await this.fetch(e,r);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,r={}){let s=this.#_;if(!s)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:n,...a}=r,o=this.get(e,a);if(!n&&o!==void 0)return o;let c=s(e,o,{options:a,context:i});return this.set(e,c,a),c}get(e,r={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=r,o=this.#i.get(e);if(o!==void 0){let c=this.#s[o],l=this.#m(c);return a&&this.#h(a,o),this.#R(o)?(a&&(a.get="stale"),l?(a&&s&&c.__staleWhileFetching!==void 0&&(a.returnedStale=!0),s?c.__staleWhileFetching:void 0):(n||this.#v(e,"expire"),a&&s&&(a.returnedStale=!0),s?c:void 0)):(a&&(a.get="hit"),l?c.__staleWhileFetching:(this.#D(o),i&&this.#C(o),c))}else a&&(a.get="miss")}#j(e,r){this.#o[r]=e,this.#l[e]=r}#D(e){e!==this.#g&&(e===this.#p?this.#p=this.#l[e]:this.#j(this.#o[e],this.#l[e]),this.#j(this.#g,e),this.#g=e)}delete(e){return this.#v(e,"delete")}#v(e,r){let s=!1;if(this.#a!==0){let i=this.#i.get(e);if(i!==void 0)if(s=!0,this.#a===1)this.#G(r);else{this.#N(i);let n=this.#s[i];if(this.#m(n)?n.__abortController.abort(new Error("deleted")):(this.#E||this.#b)&&(this.#E&&this.#e?.(n,e,r),this.#b&&this.#d?.push([n,e,r])),this.#i.delete(e),this.#c[i]=void 0,this.#s[i]=void 0,i===this.#g)this.#g=this.#o[i];else if(i===this.#p)this.#p=this.#l[i];else{let a=this.#o[i];this.#l[a]=this.#l[i];let o=this.#l[i];this.#o[o]=this.#o[i]}this.#a--,this.#y.push(i)}}if(this.#b&&this.#d?.length){let i=this.#d,n;for(;n=i?.shift();)this.#n?.(...n)}return s}clear(){return this.#G("delete")}#G(e){for(let r of this.#L({allowStale:!0})){let s=this.#s[r];if(this.#m(s))s.__abortController.abort(new Error("deleted"));else{let i=this.#c[r];this.#E&&this.#e?.(s,i,e),this.#b&&this.#d?.push([s,i,e])}}if(this.#i.clear(),this.#s.fill(void 0),this.#c.fill(void 0),this.#x&&this.#w&&(this.#x.fill(0),this.#w.fill(0)),this.#A&&this.#A.fill(0),this.#p=0,this.#g=0,this.#y.length=0,this.#u=0,this.#a=0,this.#b&&this.#d){let r=this.#d,s;for(;s=r?.shift();)this.#n?.(...s)}}};import{posix as l$,win32 as Tu}from"node:path";import{fileURLToPath as u$}from"node:url";import{lstatSync as f$,readdir as h$,readdirSync as d$,readlinkSync as p$,realpathSync as m$}from"fs";import*as g$ from"node:fs";import{lstat as v$,readdir as b$,readlink as _$,realpath as w$}from"node:fs/promises";import{EventEmitter as Au}from"node:events";import P0 from"node:stream";import{StringDecoder as QL}from"node:string_decoder";var O0=typeof process=="object"&&process?process:{stdout:null,stderr:null},e$=t=>!!t&&typeof t=="object"&&(t instanceof Ar||t instanceof P0||t$(t)||r$(t)),t$=t=>!!t&&typeof t=="object"&&t instanceof Au&&typeof t.pipe=="function"&&t.pipe!==P0.Writable.prototype.pipe,r$=t=>!!t&&typeof t=="object"&&t instanceof Au&&typeof t.write=="function"&&typeof t.end=="function",ar=Symbol("EOF"),cr=Symbol("maybeEmitEnd"),Rr=Symbol("emittedEnd"),na=Symbol("emittingEnd"),En=Symbol("emittedError"),oa=Symbol("closed"),T0=Symbol("read"),aa=Symbol("flush"),L0=Symbol("flushChunk"),kt=Symbol("encoding"),yi=Symbol("decoder"),Fe=Symbol("flowing"),Sn=Symbol("paused"),vi=Symbol("resume"),Me=Symbol("buffer"),st=Symbol("pipes"),je=Symbol("bufferLength"),_u=Symbol("bufferPush"),ca=Symbol("bufferShift"),Ye=Symbol("objectMode"),Ie=Symbol("destroyed"),wu=Symbol("error"),xu=Symbol("emitData"),$0=Symbol("emitEnd"),Eu=Symbol("emitEnd2"),Wt=Symbol("async"),Su=Symbol("abort"),la=Symbol("aborted"),Rn=Symbol("signal"),ds=Symbol("dataListeners"),ft=Symbol("discarded"),An=t=>Promise.resolve().then(t),s$=t=>t(),i$=t=>t==="end"||t==="finish"||t==="prefinish",n$=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,o$=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),ua=class{src;dest;opts;ondrain;constructor(e,r,s){this.src=e,this.dest=r,this.opts=s,this.ondrain=()=>e[vi](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ru=class extends ua{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,s){super(e,r,s),this.proxyErrors=i=>r.emit("error",i),e.on("error",this.proxyErrors)}},a$=t=>!!t.objectMode,c$=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Ar=class extends Au{[Fe]=!1;[Sn]=!1;[st]=[];[Me]=[];[Ye];[kt];[Wt];[yi];[ar]=!1;[Rr]=!1;[na]=!1;[oa]=!1;[En]=null;[je]=0;[Ie]=!1;[Rn];[la]=!1;[ds]=0;[ft]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");a$(r)?(this[Ye]=!0,this[kt]=null):c$(r)?(this[kt]=r.encoding,this[Ye]=!1):(this[Ye]=!1,this[kt]=null),this[Wt]=!!r.async,this[yi]=this[kt]?new QL(this[kt]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Me]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[st]});let{signal:s}=r;s&&(this[Rn]=s,s.aborted?this[Su]():s.addEventListener("abort",()=>this[Su]()))}get bufferLength(){return this[je]}get encoding(){return this[kt]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Ye]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Wt]}set async(e){this[Wt]=this[Wt]||!!e}[Su](){this[la]=!0,this.emit("abort",this[Rn]?.reason),this.destroy(this[Rn]?.reason)}get aborted(){return this[la]}set aborted(e){}write(e,r,s){if(this[la])return!1;if(this[ar])throw new Error("write after end");if(this[Ie])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(s=r,r="utf8"),r||(r="utf8");let i=this[Wt]?An:s$;if(!this[Ye]&&!Buffer.isBuffer(e)){if(o$(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(n$(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Ye]?(this[Fe]&&this[je]!==0&&this[aa](!0),this[Fe]?this.emit("data",e):this[_u](e),this[je]!==0&&this.emit("readable"),s&&i(s),this[Fe]):e.length?(typeof e=="string"&&!(r===this[kt]&&!this[yi]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[kt]&&(e=this[yi].write(e)),this[Fe]&&this[je]!==0&&this[aa](!0),this[Fe]?this.emit("data",e):this[_u](e),this[je]!==0&&this.emit("readable"),s&&i(s),this[Fe]):(this[je]!==0&&this.emit("readable"),s&&i(s),this[Fe])}read(e){if(this[Ie])return null;if(this[ft]=!1,this[je]===0||e===0||e&&e>this[je])return this[cr](),null;this[Ye]&&(e=null),this[Me].length>1&&!this[Ye]&&(this[Me]=[this[kt]?this[Me].join(""):Buffer.concat(this[Me],this[je])]);let r=this[T0](e||null,this[Me][0]);return this[cr](),r}[T0](e,r){if(this[Ye])this[ca]();else{let s=r;e===s.length||e===null?this[ca]():typeof s=="string"?(this[Me][0]=s.slice(e),r=s.slice(0,e),this[je]-=e):(this[Me][0]=s.subarray(e),r=s.subarray(0,e),this[je]-=e)}return this.emit("data",r),!this[Me].length&&!this[ar]&&this.emit("drain"),r}end(e,r,s){return typeof e=="function"&&(s=e,e=void 0),typeof r=="function"&&(s=r,r="utf8"),e!==void 0&&this.write(e,r),s&&this.once("end",s),this[ar]=!0,this.writable=!1,(this[Fe]||!this[Sn])&&this[cr](),this}[vi](){this[Ie]||(!this[ds]&&!this[st].length&&(this[ft]=!0),this[Sn]=!1,this[Fe]=!0,this.emit("resume"),this[Me].length?this[aa]():this[ar]?this[cr]():this.emit("drain"))}resume(){return this[vi]()}pause(){this[Fe]=!1,this[Sn]=!0,this[ft]=!1}get destroyed(){return this[Ie]}get flowing(){return this[Fe]}get paused(){return this[Sn]}[_u](e){this[Ye]?this[je]+=1:this[je]+=e.length,this[Me].push(e)}[ca](){return this[Ye]?this[je]-=1:this[je]-=this[Me][0].length,this[Me].shift()}[aa](e=!1){do;while(this[L0](this[ca]())&&this[Me].length);!e&&!this[Me].length&&!this[ar]&&this.emit("drain")}[L0](e){return this.emit("data",e),this[Fe]}pipe(e,r){if(this[Ie])return e;this[ft]=!1;let s=this[Rr];return r=r||{},e===O0.stdout||e===O0.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,s?r.end&&e.end():(this[st].push(r.proxyErrors?new Ru(this,e,r):new ua(this,e,r)),this[Wt]?An(()=>this[vi]()):this[vi]()),e}unpipe(e){let r=this[st].find(s=>s.dest===e);r&&(this[st].length===1?(this[Fe]&&this[ds]===0&&(this[Fe]=!1),this[st]=[]):this[st].splice(this[st].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let s=super.on(e,r);if(e==="data")this[ft]=!1,this[ds]++,!this[st].length&&!this[Fe]&&this[vi]();else if(e==="readable"&&this[je]!==0)super.emit("readable");else if(i$(e)&&this[Rr])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[En]){let i=r;this[Wt]?An(()=>i.call(this,this[En])):i.call(this,this[En])}return s}removeListener(e,r){return this.off(e,r)}off(e,r){let s=super.off(e,r);return e==="data"&&(this[ds]=this.listeners("data").length,this[ds]===0&&!this[ft]&&!this[st].length&&(this[Fe]=!1)),s}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[ds]=0,!this[ft]&&!this[st].length&&(this[Fe]=!1)),r}get emittedEnd(){return this[Rr]}[cr](){!this[na]&&!this[Rr]&&!this[Ie]&&this[Me].length===0&&this[ar]&&(this[na]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[oa]&&this.emit("close"),this[na]=!1)}emit(e,...r){let s=r[0];if(e!=="error"&&e!=="close"&&e!==Ie&&this[Ie])return!1;if(e==="data")return!this[Ye]&&!s?!1:this[Wt]?(An(()=>this[xu](s)),!0):this[xu](s);if(e==="end")return this[$0]();if(e==="close"){if(this[oa]=!0,!this[Rr]&&!this[Ie])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[En]=s,super.emit(wu,s);let n=!this[Rn]||this.listeners("error").length?super.emit("error",s):!1;return this[cr](),n}else if(e==="resume"){let n=super.emit("resume");return this[cr](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,...r);return this[cr](),i}[xu](e){for(let s of this[st])s.dest.write(e)===!1&&this.pause();let r=this[ft]?!1:super.emit("data",e);return this[cr](),r}[$0](){return this[Rr]?!1:(this[Rr]=!0,this.readable=!1,this[Wt]?(An(()=>this[Eu]()),!0):this[Eu]())}[Eu](){if(this[yi]){let r=this[yi].end();if(r){for(let s of this[st])s.dest.write(r);this[ft]||super.emit("data",r)}}for(let r of this[st])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Ye]||(e.dataLength=0);let r=this.promise();return this.on("data",s=>{e.push(s),this[Ye]||(e.dataLength+=s.length)}),await r,e}async concat(){if(this[Ye])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[kt]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(Ie,()=>r(new Error("stream destroyed"))),this.on("error",s=>r(s)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[ft]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[ar])return r();let n,a,o=p=>{this.off("data",c),this.off("end",l),this.off(Ie,u),r(),a(p)},c=p=>{this.off("error",o),this.off("end",l),this.off(Ie,u),this.pause(),n({value:p,done:!!this[ar]})},l=()=>{this.off("error",o),this.off("data",c),this.off(Ie,u),r(),n({done:!0,value:void 0})},u=()=>o(new Error("stream destroyed"));return new Promise((p,g)=>{a=g,n=p,this.once(Ie,u),this.once("error",o),this.once("end",l),this.once("data",c)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[ft]=!1;let e=!1,r=()=>(this.pause(),this.off(wu,r),this.off(Ie,r),this.off("end",r),e=!0,{done:!0,value:void 0}),s=()=>{if(e)return r();let i=this.read();return i===null?r():{done:!1,value:i}};return this.once("end",r),this.once(wu,r),this.once(Ie,r),{next:s,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[Ie])return e?this.emit("error",e):this.emit(Ie),this;this[Ie]=!0,this[ft]=!0,this[Me].length=0,this[je]=0;let r=this;return typeof r.close=="function"&&!this[oa]&&r.close(),e?this.emit("error",e):this.emit(Ie),this}static get isStream(){return e$}};var y$=m$.native,On={lstatSync:f$,readdir:h$,readdirSync:d$,readlinkSync:p$,realpathSync:y$,promises:{lstat:v$,readdir:b$,readlink:_$,realpath:w$}},F0=t=>!t||t===On||t===g$?On:{...On,...t,promises:{...On.promises,...t.promises||{}}},M0=/^\\\\\?\\([a-z]:)\\?$/i,x$=t=>t.replace(/\//g,"\\").replace(M0,"$1\\"),E$=/[\\\/]/,Rt=0,j0=1,B0=2,Vt=4,U0=6,G0=8,ps=10,z0=12,St=15,Cn=~St,Cu=16,I0=32,Tn=64,Nt=128,fa=256,da=512,k0=Tn|Nt|da,S$=1023,Ou=t=>t.isFile()?G0:t.isDirectory()?Vt:t.isSymbolicLink()?ps:t.isCharacterDevice()?B0:t.isBlockDevice()?U0:t.isSocket()?z0:t.isFIFO()?j0:Rt,N0=new Map,Ln=t=>{let e=N0.get(t);if(e)return e;let r=t.normalize("NFKD");return N0.set(t,r),r},D0=new Map,ha=t=>{let e=D0.get(t);if(e)return e;let r=Ln(t.toLowerCase());return D0.set(t,r),r},pa=class extends xn{constructor(){super({max:256})}},Lu=class extends xn{constructor(e=16*1024){super({maxSize:e,sizeCalculation:r=>r.length+1})}},q0=Symbol("PathScurry setAsCwd"),Je=class{name;root;roots;parent;nocase;isCWD=!1;#t;#r;get dev(){return this.#r}#e;get mode(){return this.#e}#n;get nlink(){return this.#n}#f;get uid(){return this.#f}#_;get gid(){return this.#_}#a;get rdev(){return this.#a}#u;get blksize(){return this.#u}#i;get ino(){return this.#i}#c;get size(){return this.#c}#s;get blocks(){return this.#s}#l;get atimeMs(){return this.#l}#o;get mtimeMs(){return this.#o}#p;get ctimeMs(){return this.#p}#g;get birthtimeMs(){return this.#g}#y;get atime(){return this.#y}#d;get mtime(){return this.#d}#A;get ctime(){return this.#A}#w;get birthtime(){return this.#w}#x;#E;#S;#b;#P;#C;#h;#F;#R;#I;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=Rt,s,i,n,a,o){this.name=e,this.#x=n?ha(e):Ln(e),this.#h=r&S$,this.nocase=n,this.roots=i,this.root=s||this,this.#F=a,this.#S=o.fullpath,this.#P=o.relative,this.#C=o.relativePosix,this.parent=o.parent,this.parent?this.#t=this.parent.#t:this.#t=F0(o.fs)}depth(){return this.#E!==void 0?this.#E:this.parent?this.#E=this.parent.depth()+1:this.#E=0}childrenCache(){return this.#F}resolve(e){if(!e)return this;let r=this.getRootString(e),i=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#N(i):this.#N(i)}#N(e){let r=this;for(let s of e)r=r.child(s);return r}children(){let e=this.#F.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#F.set(this,r),this.#h&=~Cu,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let s=this.children(),i=this.nocase?ha(e):Ln(e);for(let c of s)if(c.#x===i)return c;let n=this.parent?this.sep:"",a=this.#S?this.#S+n+e:void 0,o=this.newChild(e,Rt,{...r,parent:this,fullpath:a});return this.canReaddir()||(o.#h|=Nt),s.push(o),o}relative(){if(this.isCWD)return"";if(this.#P!==void 0)return this.#P;let e=this.name,r=this.parent;if(!r)return this.#P=this.name;let s=r.relative();return s+(!s||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,r=this.parent;if(!r)return this.#C=this.fullpathPosix();let s=r.relativePosix();return s+(!s||!r.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,r=this.parent;if(!r)return this.#S=this.name;let i=r.fullpath()+(r.parent?this.sep:"")+e;return this.#S=i}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep==="/")return this.#b=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#b=`//?/${i}`:this.#b=i}let e=this.parent,r=e.fullpathPosix(),s=r+(!r||!e.parent?"":"/")+this.name;return this.#b=s}isUnknown(){return(this.#h&St)===Rt}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#h&St)===G0}isDirectory(){return(this.#h&St)===Vt}isCharacterDevice(){return(this.#h&St)===B0}isBlockDevice(){return(this.#h&St)===U0}isFIFO(){return(this.#h&St)===j0}isSocket(){return(this.#h&St)===z0}isSymbolicLink(){return(this.#h&ps)===ps}lstatCached(){return this.#h&I0?this:void 0}readlinkCached(){return this.#R}realpathCached(){return this.#I}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#R)return!0;if(!this.parent)return!1;let e=this.#h&St;return!(e!==Rt&&e!==ps||this.#h&fa||this.#h&Nt)}calledReaddir(){return!!(this.#h&Cu)}isENOENT(){return!!(this.#h&Nt)}isNamed(e){return this.nocase?this.#x===ha(e):this.#x===Ln(e)}async readlink(){let e=this.#R;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#t.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(r);if(s)return this.#R=s}catch(r){this.#m(r.code);return}}readlinkSync(){let e=this.#R;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#t.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(r);if(s)return this.#R=s}catch(r){this.#m(r.code);return}}#T(e){this.#h|=Cu;for(let r=e.provisional;r<e.length;r++){let s=e[r];s&&s.#B()}}#B(){this.#h&Nt||(this.#h=(this.#h|Nt)&Cn,this.#O())}#O(){let e=this.children();e.provisional=0;for(let r of e)r.#B()}#L(){this.#h|=da,this.#M()}#M(){if(this.#h&Tn)return;let e=this.#h;(e&St)===Vt&&(e&=Cn),this.#h=e|Tn,this.#O()}#$(e=""){e==="ENOTDIR"||e==="EPERM"?this.#M():e==="ENOENT"?this.#B():this.children().provisional=0}#k(e=""){e==="ENOTDIR"?this.parent.#M():e==="ENOENT"&&this.#B()}#m(e=""){let r=this.#h;r|=fa,e==="ENOENT"&&(r|=Nt),(e==="EINVAL"||e==="UNKNOWN")&&(r&=Cn),this.#h=r,e==="ENOTDIR"&&this.parent&&this.parent.#M()}#j(e,r){return this.#v(e,r)||this.#D(e,r)}#D(e,r){let s=Ou(e),i=this.newChild(e.name,s,{parent:this}),n=i.#h&St;return n!==Vt&&n!==ps&&n!==Rt&&(i.#h|=Tn),r.unshift(i),r.provisional++,i}#v(e,r){for(let s=r.provisional;s<r.length;s++){let i=r[s];if((this.nocase?ha(e.name):Ln(e.name))===i.#x)return this.#G(e,i,s,r)}}#G(e,r,s,i){let n=r.name;return r.#h=r.#h&Cn|Ou(e),n!==e.name&&(r.name=e.name),s!==i.provisional&&(s===i.length-1?i.pop():i.splice(s,1),i.unshift(r)),i.provisional++,r}async lstat(){if((this.#h&Nt)===0)try{return this.#z(await this.#t.promises.lstat(this.fullpath())),this}catch(e){this.#k(e.code)}}lstatSync(){if((this.#h&Nt)===0)try{return this.#z(this.#t.lstatSync(this.fullpath())),this}catch(e){this.#k(e.code)}}#z(e){let{atime:r,atimeMs:s,birthtime:i,birthtimeMs:n,blksize:a,blocks:o,ctime:c,ctimeMs:l,dev:u,gid:p,ino:g,mode:f,mtime:d,mtimeMs:m,nlink:y,rdev:v,size:_,uid:w}=e;this.#y=r,this.#l=s,this.#w=i,this.#g=n,this.#u=a,this.#s=o,this.#A=c,this.#p=l,this.#r=u,this.#_=p,this.#i=g,this.#e=f,this.#d=d,this.#o=m,this.#n=y,this.#a=v,this.#c=_,this.#f=w;let h=Ou(e);this.#h=this.#h&Cn|h|I0,h!==Rt&&h!==Vt&&h!==ps&&(this.#h|=Tn)}#U=[];#q=!1;#V(e){this.#q=!1;let r=this.#U.slice();this.#U.length=0,r.forEach(s=>s(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let s=this.children();if(this.calledReaddir()){let n=s.slice(0,s.provisional);r?e(null,n):queueMicrotask(()=>e(null,n));return}if(this.#U.push(e),this.#q)return;this.#q=!0;let i=this.fullpath();this.#t.readdir(i,{withFileTypes:!0},(n,a)=>{if(n)this.#$(n.code),s.provisional=0;else{for(let o of a)this.#j(o,s);this.#T(s)}this.#V(s.slice(0,s.provisional))})}#W;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#W)await this.#W;else{let s=()=>{};this.#W=new Promise(i=>s=i);try{for(let i of await this.#t.promises.readdir(r,{withFileTypes:!0}))this.#j(i,e);this.#T(e)}catch(i){this.#$(i.code),e.provisional=0}this.#W=void 0,s()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let s of this.#t.readdirSync(r,{withFileTypes:!0}))this.#j(s,e);this.#T(e)}catch(s){this.#$(s.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#h&k0)return!1;let e=St&this.#h;return e===Rt||e===Vt||e===ps}shouldWalk(e,r){return(this.#h&Vt)===Vt&&!(this.#h&k0)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#I)return this.#I;if(!((da|fa|Nt)&this.#h))try{let e=await this.#t.promises.realpath(this.fullpath());return this.#I=this.resolve(e)}catch{this.#L()}}realpathSync(){if(this.#I)return this.#I;if(!((da|fa|Nt)&this.#h))try{let e=this.#t.realpathSync(this.fullpath());return this.#I=this.resolve(e)}catch{this.#L()}}[q0](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),s=[],i=this;for(;i&&i.parent;)r.add(i),i.#P=s.join(this.sep),i.#C=s.join("/"),i=i.parent,s.push("..");for(i=e;i&&i.parent&&!r.has(i);)i.#P=void 0,i.#C=void 0,i=i.parent}},ma=class t extends Je{sep="\\";splitSep=E$;constructor(e,r=Rt,s,i,n,a,o){super(e,r,s,i,n,a,o)}newChild(e,r=Rt,s={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(e){return Tu.parse(e).root}getRoot(e){if(e=x$(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,s]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=s;return this.roots[e]=new bi(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(M0,"$1\\"),e===r}},ga=class t extends Je{splitSep="/";sep="/";constructor(e,r=Rt,s,i,n,a,o){super(e,r,s,i,n,a,o)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=Rt,s={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),s)}},ya=class{root;rootPath;roots;cwd;#t;#r;#e;nocase;#n;constructor(e=process.cwd(),r,s,{nocase:i,childrenCacheSize:n=16*1024,fs:a=On}={}){this.#n=F0(a),(e instanceof URL||e.startsWith("file://"))&&(e=u$(e));let o=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#t=new pa,this.#r=new pa,this.#e=new Lu(n);let c=o.substring(this.rootPath.length).split(s);if(c.length===1&&!c[0]&&c.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,p=r.sep,g=this.rootPath,f=!1;for(let d of c){let m=u--;l=l.child(d,{relative:new Array(m).fill("..").join(p),relativePosix:new Array(m).fill("..").join("/"),fullpath:g+=(f?"":p)+d}),f=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#e}resolve(...e){let r="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let s=this.#t.get(r);if(s!==void 0)return s;let i=this.cwd.resolve(r).fullpath();return this.#t.set(r,i),i}resolvePosix(...e){let r="";for(let n=e.length-1;n>=0;n--){let a=e[n];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let s=this.#r.get(r);if(s!==void 0)return s;let i=this.cwd.resolve(r).fullpathPosix();return this.#r.set(r,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Je||(r=e,e=this.cwd);let{withFileTypes:s}=r;if(e.canReaddir()){let i=await e.readdir();return s?i:i.map(n=>n.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Je||(r=e,e=this.cwd);let{withFileTypes:s=!0}=r;return e.canReaddir()?s?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Je||(r=e.withFileTypes,e=this.cwd);let s=await e.readlink();return r?s:s?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Je||(r=e.withFileTypes,e=this.cwd);let s=e.readlinkSync();return r?s:s?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Je||(r=e.withFileTypes,e=this.cwd);let s=await e.realpath();return r?s:s?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Je||(r=e.withFileTypes,e=this.cwd);let s=e.realpathSync();return r?s:s?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Je||(r=e,e=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:a}=r,o=[];(!n||n(e))&&o.push(s?e:e.fullpath());let c=new Set,l=(p,g)=>{c.add(p),p.readdirCB((f,d)=>{if(f)return g(f);let m=d.length;if(!m)return g();let y=()=>{--m===0&&g()};for(let v of d)(!n||n(v))&&o.push(s?v:v.fullpath()),i&&v.isSymbolicLink()?v.realpath().then(_=>_?.isUnknown()?_.lstat():_).then(_=>_?.shouldWalk(c,a)?l(_,y):y()):v.shouldWalk(c,a)?l(v,y):y()},!0)},u=e;return new Promise((p,g)=>{l(u,f=>{if(f)return g(f);p(o)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Je||(r=e,e=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:a}=r,o=[];(!n||n(e))&&o.push(s?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let p of u){(!n||n(p))&&o.push(s?p:p.fullpath());let g=p;if(p.isSymbolicLink()){if(!(i&&(g=p.realpathSync())))continue;g.isUnknown()&&g.lstatSync()}g.shouldWalk(c,a)&&c.add(g)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Je||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Je||(r=e,e=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:a}=r;(!n||n(e))&&(yield s?e:e.fullpath());let o=new Set([e]);for(let c of o){let l=c.readdirSync();for(let u of l){(!n||n(u))&&(yield s?u:u.fullpath());let p=u;if(u.isSymbolicLink()){if(!(i&&(p=u.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(o,a)&&o.add(p)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Je||(r=e,e=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:a}=r,o=new Ar({objectMode:!0});(!n||n(e))&&o.write(s?e:e.fullpath());let c=new Set,l=[e],u=0,p=()=>{let g=!1;for(;!g;){let f=l.shift();if(!f){u===0&&o.end();return}u++,c.add(f);let d=(y,v,_=!1)=>{if(y)return o.emit("error",y);if(i&&!_){let w=[];for(let h of v)h.isSymbolicLink()&&w.push(h.realpath().then(b=>b?.isUnknown()?b.lstat():b));if(w.length){Promise.all(w).then(()=>d(null,v,!0));return}}for(let w of v)w&&(!n||n(w))&&(o.write(s?w:w.fullpath())||(g=!0));u--;for(let w of v){let h=w.realpathCached()||w;h.shouldWalk(c,a)&&l.push(h)}g&&!o.flowing?o.once("drain",p):m||p()},m=!0;f.readdirCB(d,!0),m=!1}};return p(),o}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Je||(r=e,e=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:a}=r,o=new Ar({objectMode:!0}),c=new Set;(!n||n(e))&&o.write(s?e:e.fullpath());let l=[e],u=0,p=()=>{let g=!1;for(;!g;){let f=l.shift();if(!f){u===0&&o.end();return}u++,c.add(f);let d=f.readdirSync();for(let m of d)(!n||n(m))&&(o.write(s?m:m.fullpath())||(g=!0));u--;for(let m of d){let y=m;if(m.isSymbolicLink()){if(!(i&&(y=m.realpathSync())))continue;y.isUnknown()&&y.lstatSync()}y.shouldWalk(c,a)&&l.push(y)}}g&&!o.flowing&&o.once("drain",p)};return p(),o}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[q0](r)}},bi=class extends ya{sep="\\";constructor(e=process.cwd(),r={}){let{nocase:s=!0}=r;super(e,Tu,"\\",{...r,nocase:s}),this.nocase=s;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Tu.parse(e).root.toUpperCase()}newRoot(e){return new ma(this.rootPath,Vt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},_i=class extends ya{sep="/";constructor(e=process.cwd(),r={}){let{nocase:s=!1}=r;super(e,l$,"/",{...r,nocase:s}),this.nocase=s}parseRootPath(e){return"/"}newRoot(e){return new ga(this.rootPath,Vt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},$n=class extends _i{constructor(e=process.cwd(),r={}){let{nocase:s=!0}=r;super(e,{...r,nocase:s})}},LM=process.platform==="win32"?ma:ga,W0=process.platform==="win32"?bi:process.platform==="darwin"?$n:_i;var R$=t=>t.length>=1,A$=t=>t.length>=1,wi=class t{#t;#r;#e;length;#n;#f;#_;#a;#u;#i;#c=!0;constructor(e,r,s,i){if(!R$(e))throw new TypeError("empty pattern list");if(!A$(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=e,this.#r=r,this.#e=s,this.#n=i,this.#e===0){if(this.isUNC()){let[n,a,o,c,...l]=this.#t,[u,p,g,f,...d]=this.#r;l[0]===""&&(l.shift(),d.shift());let m=[n,a,o,c,""].join("/"),y=[u,p,g,f,""].join("/");this.#t=[m,...l],this.#r=[y,...d],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[n,...a]=this.#t,[o,...c]=this.#r;a[0]===""&&(a.shift(),c.shift());let l=n+"/",u=o+"/";this.#t=[l,...a],this.#r=[u,...c],this.length=this.#t.length}}}pattern(){return this.#t[this.#e]}isString(){return typeof this.#t[this.#e]=="string"}isGlobstar(){return this.#t[this.#e]===qe}isRegExp(){return this.#t[this.#e]instanceof RegExp}globString(){return this.#_=this.#_||(this.#e===0?this.isAbsolute()?this.#r[0]+this.#r.slice(1).join("/"):this.#r.join("/"):this.#r.slice(this.#e).join("/"))}hasMore(){return this.length>this.#e+1}rest(){return this.#f!==void 0?this.#f:this.hasMore()?(this.#f=new t(this.#t,this.#r,this.#e+1,this.#n),this.#f.#i=this.#i,this.#f.#u=this.#u,this.#f.#a=this.#a,this.#f):this.#f=null}isUNC(){let e=this.#t;return this.#u!==void 0?this.#u:this.#u=this.#n==="win32"&&this.#e===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#t;return this.#a!==void 0?this.#a:this.#a=this.#n==="win32"&&this.#e===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#t;return this.#i!==void 0?this.#i:this.#i=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#t[0];return typeof e=="string"&&this.isAbsolute()&&this.#e===0?e:""}checkFollowGlobstar(){return!(this.#e===0||!this.isGlobstar()||!this.#c)}markFollowGlobstar(){return this.#e===0||!this.isGlobstar()||!this.#c?!1:(this.#c=!1,!0)}};var C$=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",xi=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:s,noext:i,noglobstar:n,platform:a=C$}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:r,nocase:s,noext:i,noglobstar:n,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let o of e)this.add(o)}add(e){let r=new ut(e,this.mmopts);for(let s=0;s<r.set.length;s++){let i=r.set[s],n=r.globParts[s];if(!i||!n)throw new Error("invalid pattern object");for(;i[0]==="."&&n[0]===".";)i.shift(),n.shift();let a=new wi(i,n,0,this.platform),o=new ut(a.globString(),this.mmopts),c=n[n.length-1]==="**",l=a.isAbsolute();l?this.absolute.push(o):this.relative.push(o),c&&(l?this.absoluteChildren.push(o):this.relativeChildren.push(o))}}ignored(e){let r=e.fullpath(),s=`${r}/`,i=e.relative()||".",n=`${i}/`;for(let a of this.relative)if(a.match(i)||a.match(n))return!0;for(let a of this.absolute)if(a.match(r)||a.match(s))return!0;return!1}childrenIgnored(e){let r=e.fullpath()+"/",s=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(s))return!0;for(let i of this.absoluteChildren)if(i.match(r))return!0;return!1}};var $u=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,r){return this.store.get(e.fullpath())?.has(r.globString())}storeWalked(e,r){let s=e.fullpath(),i=this.store.get(s);i?i.add(r.globString()):this.store.set(s,new Set([r.globString()]))}},Pu=class{store=new Map;add(e,r,s){let i=(r?2:0)|(s?1:0),n=this.store.get(e);this.store.set(e,n===void 0?i:i&n)}entries(){return[...this.store.entries()].map(([e,r])=>[e,!!(r&2),!!(r&1)])}},Iu=class{store=new Map;add(e,r){if(!e.canReaddir())return;let s=this.store.get(e);s?s.find(i=>i.globString()===r.globString())||s.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},Pn=class t{hasWalkedCache;matches=new Pu;subwalks=new Iu;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new $u}processPatterns(e,r){this.patterns=r;let s=r.map(i=>[e,i]);for(let[i,n]of s){this.hasWalkedCache.storeWalked(i,n);let a=n.root(),o=n.isAbsolute()&&this.opts.absolute!==!1;if(a){i=i.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let p=n.rest();if(p)n=p;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let c,l,u=!1;for(;typeof(c=n.pattern())=="string"&&(l=n.rest());)i=i.resolve(c),n=l,u=!0;if(c=n.pattern(),l=n.rest(),u){if(this.hasWalkedCache.hasWalked(i,n))continue;this.hasWalkedCache.storeWalked(i,n)}if(typeof c=="string"){let p=c===".."||c===""||c===".";this.matches.add(i.resolve(c),o,p);continue}else if(c===qe){(!i.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(i,n);let p=l?.pattern(),g=l?.rest();if(!l||(p===""||p===".")&&!g)this.matches.add(i,o,p===""||p===".");else if(p===".."){let f=i.parent||i;g?this.hasWalkedCache.hasWalked(f,g)||this.subwalks.add(f,g):this.matches.add(f,o,!0)}}else c instanceof RegExp&&this.subwalks.add(i,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let s=this.subwalks.get(e),i=this.child();for(let n of r)for(let a of s){let o=a.isAbsolute(),c=a.pattern(),l=a.rest();c===qe?i.testGlobstar(n,a,l,o):c instanceof RegExp?i.testRegExp(n,c,l,o):i.testString(n,c,l,o)}return i}testGlobstar(e,r,s,i){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(s&&r.checkFollowGlobstar()?this.subwalks.add(e,s):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(e,n,s.rest(),i);else if(n===".."){let a=e.parent||e;this.subwalks.add(a,s)}else n instanceof RegExp&&this.testRegExp(e,n,s.rest(),i)}}testRegExp(e,r,s,i){r.test(e.name)&&(s?this.subwalks.add(e,s):this.matches.add(e,i,!1))}testString(e,r,s,i){e.isNamed(r)&&(s?this.subwalks.add(e,s):this.matches.add(e,i,!1))}};var O$=(t,e)=>typeof t=="string"?new xi([t],e):Array.isArray(t)?new xi(t,e):t,va=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#r;#e;signal;maxDepth;includeChildMatches;constructor(e,r,s){if(this.patterns=e,this.path=r,this.opts=s,this.#e=!s.posix&&s.platform==="win32"?"\\":"/",this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(this.#r=O$(s.ignore??[],s),!this.includeChildMatches&&typeof this.#r.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#n(e){return this.seen.has(e)||!!this.#r?.ignored?.(e)}#f(e){return!!this.#r?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#t.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#t.push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=e.realpathCached()||await e.realpath(),!s)return;e=s}let n=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=await n.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(n,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=e.realpathCached()||e.realpathSync(),!s)return;e=s}let n=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let a=n.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(n,r)}matchFinish(e,r){if(this.#n(e))return;if(!this.includeChildMatches&&this.#r?.add){let n=`${e.relativePosix()}/**`;this.#r.add(n)}let s=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#e:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(s){let n=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?e.relativePosix():e.relative(),a=this.opts.dotRelative&&!n.startsWith(".."+this.#e)?"."+this.#e:"";this.matchEmit(n?a+n+i:"."+i)}}async match(e,r,s){let i=await this.matchCheck(e,s);i&&this.matchFinish(i,r)}matchSync(e,r,s){let i=this.matchCheckSync(e,s);i&&this.matchFinish(i,r)}walkCB(e,r,s){this.signal?.aborted&&s(),this.walkCB2(e,r,new Pn(this.opts),s)}walkCB2(e,r,s,i){if(this.#f(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,r,s,i));return}s.processPatterns(e,r);let n=1,a=()=>{--n===0&&i()};for(let[o,c,l]of s.matches.entries())this.#n(o)||(n++,this.match(o,c,l).then(()=>a()));for(let o of s.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;n++;let c=o.readdirCached();o.calledReaddir()?this.walkCB3(o,c,s,a):o.readdirCB((l,u)=>this.walkCB3(o,u,s,a),!0)}a()}walkCB3(e,r,s,i){s=s.filterEntries(e,r);let n=1,a=()=>{--n===0&&i()};for(let[o,c,l]of s.matches.entries())this.#n(o)||(n++,this.match(o,c,l).then(()=>a()));for(let[o,c]of s.subwalks.entries())n++,this.walkCB2(o,c,s.child(),a);a()}walkCBSync(e,r,s){this.signal?.aborted&&s(),this.walkCB2Sync(e,r,new Pn(this.opts),s)}walkCB2Sync(e,r,s,i){if(this.#f(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,s,i));return}s.processPatterns(e,r);let n=1,a=()=>{--n===0&&i()};for(let[o,c,l]of s.matches.entries())this.#n(o)||this.matchSync(o,c,l);for(let o of s.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;n++;let c=o.readdirSync();this.walkCB3Sync(o,c,s,a)}a()}walkCB3Sync(e,r,s,i){s=s.filterEntries(e,r);let n=1,a=()=>{--n===0&&i()};for(let[o,c,l]of s.matches.entries())this.#n(o)||this.matchSync(o,c,l);for(let[o,c]of s.subwalks.entries())n++,this.walkCB2Sync(o,c,s.child(),a);a()}},In=class extends va{matches=new Set;constructor(e,r,s){super(e,r,s)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},kn=class extends va{results;constructor(e,r,s){super(e,r,s),this.results=new Ar({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var L$=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Dt=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=T$(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=r.platform||L$,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=r.platform==="win32"?bi:r.platform==="darwin"?$n:r.platform?_i:W0;this.scurry=new c(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",i={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(c=>new ut(c,i)),[a,o]=n.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=a.map((c,l)=>{let u=o[l];if(!u)throw new Error("invalid pattern object");return new wi(c,u,0,this.platform)})}async walk(){return[...await new In(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new In(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new kn(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new kn(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var ku=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new ut(r,e).hasMagic())return!0;return!1};function ba(t,e={}){return new Dt(t,e).streamSync()}function Z0(t,e={}){return new Dt(t,e).stream()}function H0(t,e={}){return new Dt(t,e).walkSync()}async function V0(t,e={}){return new Dt(t,e).walk()}function _a(t,e={}){return new Dt(t,e).iterateSync()}function K0(t,e={}){return new Dt(t,e).iterate()}var $$=ba,P$=Object.assign(Z0,{sync:ba}),I$=_a,k$=Object.assign(K0,{sync:_a}),N$=Object.assign(H0,{stream:ba,iterate:_a}),Cr=Object.assign(V0,{glob:V0,globSync:H0,sync:N$,globStream:Z0,stream:P$,globStreamSync:ba,streamSync:$$,globIterate:K0,iterate:k$,globIterateSync:_a,iterateSync:I$,Glob:Dt,hasMagic:ku,escape:pi,unescape:It});Cr.glob=Cr;function Nu(t,e){let{changedFiles:r}=e;return r.some(s=>t===s||t.endsWith(s)||s.endsWith(t))}function D$(t,e,r,s){let{fileChangeMap:i}=s,n=i.get(t);return n?n.status==="added"?!0:n.status==="removed"?!1:F$(n.patch,e,r):!1}function Y0(t,e){return Nu(t.file.path,e)&&D$(t.file.path,t.range.start.line,t.range.end.line,e)}function F$(t,e,r){let s=t.split(`
|
|
51
|
+
`),i=0,n=!1;for(let a of s){let o=a.match(/^@@\s+-\d+(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);if(o){i=parseInt(o[1],10),n=!0;continue}if(n)if(a.startsWith("+")){if(i>=e&&i<=r)return!0;i++}else{if(a.startsWith("-"))continue;if(!a.startsWith("\\")){if(i>=e&&i<=r)return!0;i++}}}return!1}var nv=nt(Sa(),1);function ur(t,e){return e.length===0?!1:(0,nv.default)().add(e).ignores(t)}var Ra=class t{environment;_filePaths=[];mode;eventEmitter;config;diffMode;constructor(e,r,s,i){this.environment=r,this.mode=s,this.eventEmitter=i||new xt,this.config=e}static async initialize(e,r,s,i,n,a){let o=new t(e,r,s,i);if(s==="diff"&&!n){let u=o.environment.getWorkspaceRoot(),p=a?.include,g=a?.commitSelector;if(!g||!p)throw new Error("Commit selector and include are required in diff mode");let f=await hy(u,{include:p,commitSelector:g}).catch(d=>{throw new Error(`Error running wispbit in diff mode:
|
|
52
|
+
${d.message}`)});o.diffMode={gitChanges:f,changedFiles:f.files.map(d=>d.filename),fileChangeMap:new Map(f.files.map(d=>[d.filename,d]))},o.eventEmitter.fileDiscoveryProgress(`Found ${o.diffMode.changedFiles.length} changed files`)}let c=s==="check"?await o.loadGitIgnoredFiles():new Set,l=await o.discoverFiles(n,c);return o._filePaths=l,o}get filePaths(){return this._filePaths}filterFiles(e){let r=e.length,s;return this.mode==="check"?s=e:s=e.filter(i=>this.isFileValid({filePath:i})),r!==s.length&&this.eventEmitter.fileFilter(r,s.length,`${this.mode}-mode-files`),s}filterMatches(e){let r=e.length,s=e.filter(i=>this.isMatchValid({match:i}));return r!==s.length&&this.eventEmitter.fileFilter(r,s.length,`${this.mode}-mode-matches`),s}filterMatchesByFilePaths(e,r){if(e.length===0)return e;let s=new Set(r);return e.filter(i=>s.has(i.file.path))}get executionMode(){return this.mode}async loadGitIgnoredFiles(){let e=this.environment.getWorkspaceRoot(),r=await oy(e).catch(()=>(this.eventEmitter.fileDiscoveryProgress("Not in a git repository, skipping git-ignored files"),[])),s=new Set(r);return r.length>0&&this.eventEmitter.fileDiscoveryProgress(`Found ${r.length} git-ignored files`),s}async discoverFiles(e,r){this.eventEmitter.startFileDiscovery(this.mode);let s;if(e)s=await this.discoverFilesFromPath(e,r);else if(this.mode==="diff"){let i=this.environment.getWorkspaceRoot(),n=this.diffMode.changedFiles.filter(c=>!ms.existsSync(Zt.resolve(i,c)));s=this.diffMode.changedFiles.filter(c=>ms.existsSync(Zt.resolve(i,c))),n.length>0&&this.eventEmitter.fileDiscoveryProgress(`Filtered out ${n.length} deleted files`);let a=this.config.getIgnoredGlobs(),o=[];if(a.length>0){this.eventEmitter.fileDiscoveryProgress("Applying ignore patterns...");let c=s.length;o=s.filter(l=>ur(l,a)),s=s.filter(l=>!ur(l,a)),c!==s.length&&this.eventEmitter.fileDiscoveryProgress(`Filtered out ${c-s.length} ignored files`)}return this.eventEmitter.completeFileDiscovery(s,this.mode,this.diffMode?.fileChangeMap,o,n),s}else{this.eventEmitter.fileDiscoveryProgress("Scanning workspace for files...");let i=this.environment.getWorkspaceRoot(),n=this.config.getIgnoredGlobs();s=await this.discoverAllFiles([i],n,r)}return this.eventEmitter.completeFileDiscovery(s,this.mode),s}async discoverFilesFromPath(e,r){let s=this.environment.getWorkspaceRoot(),i=Zt.resolve(s,e),n=this.config.getIgnoredGlobs();if(this.isGlobPattern(e))return this.eventEmitter.fileDiscoveryProgress(`Discovering files matching glob pattern: ${e}`),await this.discoverFilesFromGlob(e,n,r);if(!ms.existsSync(i))throw new Error(`Path not found: ${e}`);let a=ms.statSync(i);if(a.isFile())return this.eventEmitter.fileDiscoveryProgress(`Checking specific file: ${e}`),r.has(e)?(this.eventEmitter.fileDiscoveryProgress(`File ${e} is ignored by git`),[]):ur(e,n)?(this.eventEmitter.fileDiscoveryProgress(`File ${e} is ignored by patterns`),[]):[e];if(a.isDirectory())return this.eventEmitter.fileDiscoveryProgress(`Discovering files in directory: ${e}`),await this.discoverFilesFromDirectory(e,n,r);throw new Error(`Path is neither a file nor directory: ${e}`)}isGlobPattern(e){return/[*?[\]{}]/.test(e)}async discoverFilesFromGlob(e,r,s){let i=this.environment.getWorkspaceRoot(),n=["**/node_modules/**","**/.git/**",...r],o=(await Cr(e,{cwd:i,nodir:!0,absolute:!1,ignore:n})).filter(c=>!s.has(c));return this.eventEmitter.fileDiscoveryProgress(`Found ${o.length} files matching pattern`),o}async discoverFilesFromDirectory(e,r,s){let i=this.environment.getWorkspaceRoot(),n=Zt.join(e,"**/*").replace(/\\/g,"/"),a=["**/node_modules/**","**/.git/**",...r],c=(await Cr(n,{cwd:i,nodir:!0,absolute:!1,ignore:a})).filter(l=>!s.has(l));return this.eventEmitter.fileDiscoveryProgress(`Found ${c.length} files in directory`),c}async discoverAllFiles(e,r,s){let i=[],n=this.environment.getWorkspaceRoot(),a=["**/node_modules/**","**/.git/**",...r];for(let o of e){if(!ms.statSync(o).isDirectory()){let p=Zt.relative(n,o),g=s.has(p),f=ur(p,r);!g&&!f&&i.push(p);continue}let u=(await Cr("**/*",{cwd:o,nodir:!0,absolute:!1,ignore:a})).map(p=>{let g=Zt.resolve(o,p);return Zt.relative(n,g)}).filter(p=>!s.has(p));i.push(...u)}return[...new Set(i)]}isFileValid(e){if(this.mode==="check")return!0;let{filePath:r}=e;return Nu(r,{changedFiles:this.diffMode.changedFiles,fileChangeMap:this.diffMode.fileChangeMap})}isMatchValid(e){if(this.mode==="check")return!0;let{match:r}=e;return Y0(r,{changedFiles:this.diffMode.changedFiles,fileChangeMap:this.diffMode.fileChangeMap})}};import*as Ri from"fs";import*as At from"path";var Aa=class{environment;constructor(e){this.environment=e}evaluateCondition(e,r){let s=this.environment.getWorkspaceRoot(),i=At.resolve(s,r);if("fs.siblingExists"in e){let{filename:n}=e["fs.siblingExists"],a=At.dirname(i),o=At.join(a,n);return Ri.existsSync(o)}if("fs.ancestorHas"in e){let{filename:n}=e["fs.ancestorHas"],a=At.dirname(i),o=At.parse(a).root;for(;a!==o;){let c=At.join(a,n);if(Ri.existsSync(c))return!0;let l=At.dirname(a);if(l===a)break;a=l}return!1}if("fs.siblingAny"in e){let{pattern:n}=e["fs.siblingAny"],a=At.dirname(i);return Ri.existsSync(a)?Ri.readdirSync(a).some(c=>ur(c,[n])):!1}return!1}evaluateConditions(e,r){let s=[];return e.all&&e.all.length>0&&s.push(e.all.every(i=>this.evaluateCondition(i,r))),e.any&&e.any.length>0&&s.push(e.any.some(i=>this.evaluateCondition(i,r))),e.not&&e.not.length>0&&s.push(!e.not.some(i=>this.evaluateCondition(i,r))),s.length===0?!0:s.every(i=>i===!0)}async execute(e,r){let s=Date.now(),i=e;r.include?.length&&(i=i.filter(a=>ur(a,r.include))),r.ignore?.length&&(i=i.filter(a=>!ur(a,r.ignore))),Object.keys(r.conditions||{}).length>0&&i.length>0&&(i=i.filter(a=>this.evaluateConditions(r.conditions,a)));let n=Date.now()-s;return await Promise.resolve({filteredPaths:i,executionTime:n})}};import hP from"path";var Mn=nt(du(),1);import{readFile as mv}from"fs/promises";import gv from"path";import{spawn as aP}from"child_process";import cP from"crypto";import Ai from"fs";import fr,{dirname as lv,join as uv}from"path";import{promises as iP}from"fs";import wj from"path";async function Ca(t){try{return await iP.access(t),!0}catch{return!1}}import{execSync as nP}from"child_process";function Dn(){return nP("which rg").toString().trim()}import Oa from"fs";import oP from"path";async function ov(t){try{if(t.includes("/")||t.includes("\\"))return await Oa.promises.access(t,Oa.constants.X_OK),!0;let e=process.env.PATH||"",r=process.platform==="win32"?";":":",s=e.split(r),i=process.platform==="win32"?(process.env.PATHEXT||".exe;.cmd;.bat").split(";"):[""];for(let n of s)for(let a of i){let o=oP.join(n,t+a);try{return await Oa.promises.access(o,Oa.constants.X_OK),!0}catch{}}return!1}catch{return!1}}var av=nt(Sa(),1);function cv(t){let e=t.match(/\{([^}]+)\}/);if(!e)return[t];let r=e[1].split(","),s=t.slice(0,e.index),i=t.slice(e.index+e[0].length),n=[];for(let a of r){let o=s+a+i;n.push(...cv(o))}return n}function Fn(t,e){if(e.length===0)return!1;let r=[];for(let i of e)r.push(...cv(i));return(0,av.default)().add(r).ignores(t)}function Ta(t,e){let r=new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g");return t.replace(r,"").replace(/\/\//g,"/")}async function gs(t){return await new Promise((e,r)=>{let s=cP.createHash("sha256"),i=Ai.createReadStream(t);i.on("error",n=>r(n)),i.on("data",n=>s.update(n)),i.on("end",()=>e(s.digest("hex")))})}function La(t,e){try{let r=fr.resolve(t),s=fr.resolve(t,e),i=fr.normalize(r),n=fr.normalize(s);return n===i||n.startsWith(i+fr.sep)?n:null}catch{return null}}function lP(t,e,r){try{let i=Ai.readFileSync(t,"utf8").split(`
|
|
53
|
+
`),n=Math.max(0,e-1),a=Math.min(i.length,r);if(n===0&&a>=i.length)return i.map((u,p)=>`L${p+1} ${u}`).join(`
|
|
54
|
+
`);let o=i.slice(n,a),c="";n>0&&(c+=`[Lines 1-${n} omitted]
|
|
55
|
+
`);let l=o.map((u,p)=>`L${n+p+1} ${u}`);return c+=l.join(`
|
|
56
|
+
`),a<i.length&&(c+=`
|
|
57
|
+
[Lines ${a+1}-${i.length} omitted]`),c}catch(s){let i=s instanceof Error?s.message:String(s);throw new Error(`Failed to read file ${t}: ${i}`)}}async function fv(t,e,r=[]){let{target_file:s}=t,i=t.offset?parseInt(t.offset?.toString(),10):void 0,n=t.limit?parseInt(t.limit?.toString(),10):void 0,a=s.startsWith("/")?s.slice(1):s;if(Fn(a,r))return{error:`File not found or not accessible: ${s}. Please provide the correct path.`};let o=La(e,a);if(!o)return{error:`Invalid file path: '${s}'`};if(!await Ca(o))return{error:`File not found or not accessible: ${s}. Please provide the correct path. It could also have been deleted as part of the PR.`};try{if(i!==void 0&&(Number.isNaN(Number(i))||i<0))return{error:`Invalid offset: ${i}. Offset must be a non-negative number starting from 0.`};if(n!==void 0&&(Number.isNaN(Number(n))||n<1))return{error:`Invalid limit: ${n}. Limit must be a positive number.`};let c=i??1,u=Math.min(n??200,500),p=c+u-1,g=lP(o,c,p),f=await gs(o);return{content:g,sha:f}}catch(c){let l=c.message||String(c);return{error:Ta(`Error reading file: ${l}`,e)}}}async function uP(t,e,r,s="."){let i=["--no-config","--line-number","--color=never","--max-columns=300","--max-filesize=1M","--max-count=50","-i"];r&&i.push("-g",r),i.push(e),i.push(s);try{let n=await new Promise((c,l)=>{let u=aP(t,i,{cwd:s,shell:!1,stdio:["ignore","pipe","pipe"],env:{LANG:"C",RIPGREP_CONFIG_PATH:""}}),p="",g="";u.stdout?.on("data",d=>{p+=d.toString()}),u.stderr?.on("data",d=>{g+=d.toString()});let f=setTimeout(()=>{u.kill("SIGTERM"),l(new Error("rg search operation timed out"))},3e4);u.on("close",d=>{clearTimeout(f),d===1&&!g?c({stdout:"",stderr:""}):d===0||d===1&&!g?c({stdout:p,stderr:g}):l(new Error(`ripgrep exited with code ${d}: ${g}`))}),u.on("error",d=>{clearTimeout(f),l(d)})});if(!n.stdout.trim())return[];let a=n.stdout.trim().split(`
|
|
58
|
+
`),o=[];for(let c of a){let l=c.match(/^([^:]+):(\d+):(.*)$/);if(l){let[,u,p,g]=l,f=u;f=fr.relative(s,u);let d=fr.join(s,f);try{if(Ai.existsSync(d)){let m=await gs(d);o.push({file:f,line_number:parseInt(p,10),content:g,sha:m})}}catch{}}}return o}catch(n){let a=n;if(a.code===1&&!a.stderr)return[];throw a.signal==="SIGTERM"?new Error("rg search operation timed out"):n}}async function hv(t,e,r=[],s=Dn()){let{pattern:i,include:n}=t,a=t.path?.startsWith("/")?t.path.slice(1):t.path;try{if(!await ov(s))throw new Error(`ripgrep is not found or not executable: ${s}`);let c=null;if(a){let p=La(e,a);if(!p)return{error:`Invalid path: '${a}'. Please provide the correct path.`};if(!await Ca(p))return{error:`Path not found or not accessible: ${a}. Please provide the correct path.`};let g=await Ai.promises.stat(p);if(g.isFile())c=lv(p),a=lv(a);else if(g.isDirectory())c=p;else return{error:`Path is neither a file nor a directory: ${a}`}}return{matches:(await uP(s,i,n,c||e)).filter(p=>{let g=a?uv(a,p.file):p.file;return!Fn(g,r)}).slice(0,50).map(p=>({...p,file:a?uv(a,p.file):p.file}))}}catch(o){let c=typeof o=="object"&&o!==null&&"message"in o&&typeof o.message=="string"?o.message:String(o);return{error:Ta(c,e)}}}async function dv(t,e,r=[]){let s=t.pattern,i=t.path;i&&s.startsWith(i)&&(s=s.replace(i,"")),s=s.startsWith("/")?s.slice(1):s;let n;if(i){if(i=i.startsWith("/")?i.slice(1):i,i!=="."&&Fn(i,r))return{files:[]};let a=La(e,i);if(!a)return{error:`Path not found or not accessible: '${i}'. Please provide the correct path.`};n=a}else n=e;if(!await Ca(n))return{error:`Directory not found or not accessible: ${i||"."}. Please provide the correct path.`};try{if(!(await Ai.promises.stat(n)).isDirectory())return{error:`Not a directory: ${i||"."}. Please provide the correct path.`}}catch{return{error:`Directory not found or not accessible: ${i||"."}. Please provide the correct path.`}}try{return{files:(await fP(s,i,e)).filter(c=>!Fn(c,r)).slice(0,50)}}catch(a){let o=typeof a=="object"&&a!==null&&"message"in a&&typeof a.message=="string"?a.message:String(a);return{error:Ta(o,e)}}}async function fP(t,e,r){try{let s;if(e){let a=e.startsWith("/")?e.slice(1):e,o=La(r,a);if(!o)throw new Error(`Invalid directory path: potential directory traversal detected in '${a}'`);s=o}else s=r;let i=await Cr(t,{cwd:s,nodir:!0,ignore:["node_modules/**",".git/**","**/__pycache__/**"],absolute:!1}),n=[];for(let a of i)try{let o=fr.join(s,a),c=await Ai.promises.stat(o);c.isFile()&&n.push({path:e?fr.join(e,a):a,mtime:c.mtime})}catch{}return n.sort((a,o)=>o.mtime.getTime()-a.mtime.getTime()),n.map(a=>a.path)}catch(s){let i=s instanceof Error?s.message:String(s);throw new Error(Ta(`Glob search failed: ${i}`,r))}}function pv(t){return{...t,range:{start:{line:t.range.start.line-1,column:t.range.start.column-1},end:{line:t.range.end.line-1,column:t.range.end.column-1}}}}function Gu(t){return{...t,range:{start:{line:t.range.start.line+1,column:t.range.start.column+1},end:{line:t.range.end.line+1,column:t.range.end.column+1}}}}var $a=class{environment;language;constructor(e,r){this.environment=e,this.language=r}async findMatches(e,r){if(e.length===0)return[];let{rule:s,constraints:i}=r,n=this.getBatchSize(),a=[];for(let o=0;o<e.length;o+=n){let c=e.slice(o,o+n),l=await this.processBatch(c,s,i);a.push(...l)}return a}getBatchSize(){let e=parseInt(process.env.UV_THREADPOOL_SIZE||"4",10);return Math.max(2,Math.floor(e/2))}async processBatch(e,r,s){let i=e.map(async c=>{let l=gv.resolve(this.environment.getWorkspaceRoot(),c),u=await mv(l,"utf-8"),g=(await(0,Mn.parseAsync)(this.language,u)).root().findAll({rule:r,language:this.language,constraints:s});if(g.length===0)return[];let f=await gs(l);return g.map(d=>({filePath:c,sgNode:d,sha:f}))}),a=(await Promise.all(i)).flat(),o=[];for(let{filePath:c,sgNode:l,sha:u}of a){let p=l.range(),g={file:{path:c,sha:u},text:l.text(),range:{start:{line:p.start.line,column:p.start.column},end:{line:p.end.line,column:p.end.column}},language:this.language};o.push(Gu(g))}return o}extractSymbol(e){let r=e.kind();if(r==="call_expression"){let s=e.field("function");if(s)return this.extractSymbol(s)}else if(r==="member_expression"){let s=e.field("property");if(s)return s.text()}else if(r==="identifier")return e.text()}static async validateSchema(e,r,s){let{rule:i,constraints:n}=r;if(!i)return{isValid:!1,error:"Schema must include a 'rule' field"};if(s)try{(await(0,Mn.parseAsync)(e,s)).root().findAll({rule:i,constraints:n})}catch(a){return{isValid:!1,error:`Failed to parse ast-grep schema: ${a instanceof Error?a.message:"Unknown error"}`}}return{isValid:!0}}async expandMatch(e){let r=new Set(["method_definition","function_declaration","function_expression","arrow_function","class_declaration","export_statement","lexical_declaration"]),s=gv.resolve(this.environment.getWorkspaceRoot(),e.file.path),[i,n]=await Promise.all([mv(s,"utf-8"),gs(s)]),a=(0,Mn.parse)(this.language,i).root(),o=pv(e),c=this.findNodeAtPosition(a,o.range.start.line,o.range.start.column);if(!c)return null;let l=c;for(;l;){let u=l.kind(),p=typeof u=="string"?u:String(u);if(r.has(p)){let g=l.range(),f={file:{path:e.file.path,sha:n},text:l.text(),range:{start:{line:g.start.line,column:g.start.column},end:{line:g.end.line,column:g.end.column}},language:this.language};return Gu(f)}l=l.parent()}return null}findNodeAtPosition(e,r,s){let i=e.range(),n=r>i.start.line||r===i.start.line&&s>=i.start.column,a=r<i.end.line||r===i.end.line&&s<=i.end.column;if(!n||!a)return null;let o=e.children();for(let c of o){let l=this.findNodeAtPosition(c,r,s);if(l)return l}return e}};import{spawn as yv}from"child_process";import zu from"path";var Pa=class{environment;ripgrepPath;constructor(e){this.environment=e,this.ripgrepPath=Dn()}async findMatches(e,r){if(e.length===0)return[];let s=e.filter(u=>ra(u)==="Unknown");if(s.length===0)return[];let{rule:i,context:n}=r,{pattern:a}=i,o=await this.executePattern(a,s,n),c=[],l=new Map;for(let u of o){let p=zu.resolve(this.environment.getWorkspaceRoot(),u.file),g=l.get(u.file);g||(g=await gs(p),l.set(u.file,g));let f=u.text.split(`
|
|
59
|
+
`),d=u.line+f.length-1,m=f.length===1?u.column+u.text.length:f[f.length-1].length+1;c.push({file:{path:u.file,sha:g},text:u.text,range:{start:{line:u.line,column:u.column},end:{line:d,column:m}},language:"Unknown"})}return c}static async validateSchema(e){let{rule:r}=e;if(!r||!r.pattern)return{isValid:!1,error:"Schema must include a 'rule' object with a 'pattern' field"};let{pattern:s}=r,i=Dn();return await new Promise(n=>{let a=yv(i,["--json","--no-config","--pcre2","-U","--multiline-dotall",s,"/dev/null"],{stdio:["ignore","pipe","pipe"]}),o="";a.stderr?.on("data",c=>{o+=c.toString()}),a.on("close",c=>{n(c===0||c===1?{isValid:!0}:{isValid:!1,error:o.trim()})}),a.on("error",c=>{n({isValid:!1,error:c.message})})})}async expandMatch(e){return await Promise.resolve(null)}async executePattern(e,r,s){let i=this.environment.getWorkspaceRoot(),n=["--no-config","--json","--pcre2","-U","--multiline-dotall"];s!==void 0&&s>0&&n.push("-C",s.toString()),n.push(e);let a=r.map(o=>zu.resolve(i,o));return n.push(...a),await new Promise((o,c)=>{let l=yv(this.ripgrepPath,n,{cwd:i,shell:!1,stdio:["ignore","pipe","pipe"],env:{LANG:"C",RIPGREP_CONFIG_PATH:""}}),u="",p="";l.stdout?.on("data",f=>{u+=f.toString()}),l.stderr?.on("data",f=>{p+=f.toString()});let g=setTimeout(()=>{l.kill("SIGTERM"),c(new Error("Ripgrep search operation timed out"))},3e4);l.on("close",f=>{if(clearTimeout(g),f===0||f===1){let d=this.parseRipgrepOutput(u,i);o(d)}else c(new Error(`Ripgrep exited with code ${f}: ${p}`))}),l.on("error",f=>{clearTimeout(g),c(f)})})}parseRipgrepOutput(e,r){if(!e.trim())return[];let s=[],i=e.trim().split(`
|
|
60
|
+
`);for(let n of i){let a=JSON.parse(n);if(a.type!=="match")continue;let o=a.data,c=o.path.text||Buffer.from(o.path.bytes||"","base64").toString("utf-8"),l=zu.relative(r,c),u=o.lines.text;for(let p of o.submatches){let g=p.start,f=p.end,d=g+1,m=u.substring(g,f);s.push({file:l,line:o.line_number,column:d,text:m})}}return s}};var Ci=class extends Error{constructor(e,r){super(`${e} is not supported: ${r}`),this.name="LanguageBackendNotSupportedError"}},Oi=class{matchProvider;intelligenceProvider;language;constructor(e,r){this.language=r,r==="Unknown"?this.matchProvider=new Pa(e):this.matchProvider=new $a(e,r)}async findMatches(e,r){if(!this.matchProvider)throw new Ci("findMatches","no match provider configured for this language");return await this.matchProvider.findMatches(e,r)}async findDefinitions(e){if(!this.intelligenceProvider)throw new Ci("findDefinitions","no intelligence provider configured for this language");return await this.intelligenceProvider.findDefinitions(e)}async findReferences(e){if(!this.intelligenceProvider)throw new Ci("findReferences","no intelligence provider configured for this language");return await this.intelligenceProvider.findReferences(e)}async expandMatch(e){if(!this.matchProvider)throw new Ci("expandMatch","no match provider configured for this language");return await this.matchProvider.expandMatch(e)}};var Ia=class{environment;eventEmitter;constructor(e,r){this.environment=e,this.eventEmitter=r}async execute(e,r,s){let i=Date.now(),n=s.filePaths.filter(p=>ra(p)===r),c=(await new Oi(this.environment,r).findMatches(n,e)).map(p=>{if(hP.isAbsolute(p.file.path))throw new Error(`Match provider returned absolute path: ${p.file.path}. All file paths must be relative to workspace root.`);return{...p,language:r}}),l=s.previousMatches&&s.previousMatches.length>0?this.filterMatchesByRanges(c,s.previousMatches,r):c;l=this.deduplicateMatches(l);let u=Date.now()-i;return{matches:l,totalMatches:l.length,executionTime:u}}filterMatchesByRanges(e,r,s){let i=[];for(let n of e){let a=r.find(c=>this.isMatchInRange(n,c));if(!a)continue;let o=[...a.evidence||[],{file:a.file,text:a.text,range:a.range,language:a.language}];i.push({...n,evidence:o})}return i}isMatchInRange(e,r){if(e.file.path!==r.file.path)return!1;let s=e.range.start,i=e.range.end,n=r.range.start,a=r.range.end,o=s.line>n.line||s.line===n.line&&s.column>=n.column,c=i.line<a.line||i.line===a.line&&i.column<=a.column;return o&&c}deduplicateMatches(e){if(e.length<=1)return e;let r=[];for(let s of e)e.some(n=>s===n?!1:this.isMatchInRange(s,n))||r.push(s);return r}};var bv=nt(Sa(),1);import dP from"path";var ka=class{maxDepth=1;environment;eventEmitter;constructor(e,r){this.environment=e,this.eventEmitter=r||new xt}async execute(e,r,s={}){let i=Date.now(),n=new Oi(this.environment,r),a=await this.followDefinitions(e,n,this.maxDepth,s.where,r),o=Date.now()-i,c=a.map(l=>{let{depth:u,sourceMatch:p,...g}=l,f=p?[{file:p.file,text:p.text,range:p.range,language:p.language},...p.evidence||[]]:[];return{...g,source:f}});return{definitions:c,totalDefinitions:c.length,executionTime:o}}async followDefinitions(e,r,s,i,n){let a=[],o=new Set;for(let c of e)await this.followDefinitionsRecursive(c,r,0,s,i,a,o,c,n);return a}async followDefinitionsRecursive(e,r,s,i,n,a,o,c,l){if(s>=i)return;let u=`${e.file.path}:${e.range.start.line}:${e.range.start.column}`;if(o.has(u))return;o.add(u);let p=await r.findDefinitions(e);for(let g of p){let d={...await r.expandMatch(g)??g,language:l,depth:s,sourceMatch:c||e};n&&!this.matchesDefinitionFilter(d,n)||(a.push(d),s+1<i&&await this.followDefinitionsRecursive(g,r,s+1,i,n,a,o,c||e,l))}}matchesDefinitionFilter(e,r){return r.all?r.all.every(s=>this.matchesDefinitionFilter(e,s)):r.any?r.any.some(s=>this.matchesDefinitionFilter(e,s)):r.not?!this.matchesDefinitionFilter(e,r.not):!(r.file&&!this.matchesFileSpec(e.file.path,r.file)||r.function?.name)}matchesNameSpec(e,r){return r.equals?e===r.equals:r.anyOf?r.anyOf.includes(e):r.regex?new RegExp(r.regex).test(e):!0}matchesFileSpec(e,r){let s=dP.relative(this.environment.getWorkspaceRoot(),e);return r.path?s===r.path:r.glob?(0,bv.default)().add(r.glob).ignores(s):r.regex?new RegExp(r.regex).test(s):!0}};function _v(t,{parser:e,callback:r}){let s={...t};return Object.defineProperties(s,{$brand:{value:"auto-parseable-tool",enumerable:!1},$parseRaw:{value:e,enumerable:!1},$callback:{value:r,enumerable:!1}}),s}var xv=Symbol("Let zodToJsonSchema decide on which parser to use"),wv={name:void 0,$refStrategy:"root",effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",nullableStrategy:"from-target",removeAdditionalStrategy:"passthrough",definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Ev=t=>typeof t=="string"?{...wv,basePath:["#"],definitions:{},name:t}:{...wv,basePath:["#"],definitions:{},...t};var jn=t=>"_def"in t?t._def:t;function Sv(t){if(!t)return!0;for(let e in t)return!1;return!0}var Rv=t=>{let e=Ev(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:r,propertyPath:void 0,seenRefs:new Set,seen:new Map(Object.entries(e.definitions).map(([s,i])=>[jn(i),{def:jn(i),path:[...e.basePath,e.definitionPath,s],jsonSchema:void 0}]))}};function qu(t,e,r,s){s?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function be(t,e,r,s,i){t[e]=r,qu(t,e,s,i)}var _e;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let n={};for(let a of i)n[a]=a;return n},t.getValidEnumValues=i=>{let n=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),a={};for(let o of n)a[o]=i[o];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(n){return i[n]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let n=[];for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&n.push(a);return n},t.find=(i,n)=>{for(let a of i)if(n(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function s(i,n=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(n)}t.joinValues=s,t.jsonStringifyReplacer=(i,n)=>typeof n=="bigint"?n.toString():n})(_e||(_e={}));var Vu;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Vu||(Vu={}));var Z=_e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),dr=t=>{switch(typeof t){case"undefined":return Z.undefined;case"string":return Z.string;case"number":return isNaN(t)?Z.nan:Z.number;case"boolean":return Z.boolean;case"function":return Z.function;case"bigint":return Z.bigint;case"symbol":return Z.symbol;case"object":return Array.isArray(t)?Z.array:t===null?Z.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Z.promise:typeof Map<"u"&&t instanceof Map?Z.map:typeof Set<"u"&&t instanceof Set?Z.set:typeof Date<"u"&&t instanceof Date?Z.date:Z.object;default:return Z.unknown}},D=_e.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),pP=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),ht=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(n){return n.message},s={_errors:[]},i=n=>{for(let a of n.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)s._errors.push(r(a));else{let o=s,c=0;for(;c<a.path.length;){let l=a.path[c];c===a.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(r(a))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return i(this),s}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_e.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},s=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):s.push(e(i));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}};ht.create=t=>new ht(t);var $i=(t,e)=>{let r;switch(t.code){case D.invalid_type:t.received===Z.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case D.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,_e.jsonStringifyReplacer)}`;break;case D.unrecognized_keys:r=`Unrecognized key(s) in object: ${_e.joinValues(t.keys,", ")}`;break;case D.invalid_union:r="Invalid input";break;case D.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${_e.joinValues(t.options)}`;break;case D.invalid_enum_value:r=`Invalid enum value. Expected ${_e.joinValues(t.options)}, received '${t.received}'`;break;case D.invalid_arguments:r="Invalid function arguments";break;case D.invalid_return_type:r="Invalid function return type";break;case D.invalid_date:r="Invalid date";break;case D.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:_e.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case D.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case D.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case D.custom:r="Invalid input";break;case D.invalid_intersection_types:r="Intersection results could not be merged";break;case D.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case D.not_finite:r="Number must be finite";break;default:r=e.defaultError,_e.assertNever(t)}return{message:r}},Tv=$i;function mP(t){Tv=t}function Na(){return Tv}var Da=t=>{let{data:e,path:r,errorMaps:s,issueData:i}=t,n=[...r,...i.path||[]],a={...i,path:n};if(i.message!==void 0)return{...i,path:n,message:i.message};let o="",c=s.filter(l=>!!l).slice().reverse();for(let l of c)o=l(a,{data:e,defaultError:o}).message;return{...i,path:n,message:o}},gP=[];function G(t,e){let r=Na(),s=Da({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===$i?void 0:$i].filter(i=>!!i)});t.common.issues.push(s)}var Xe=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let s=[];for(let i of r){if(i.status==="aborted")return ce;i.status==="dirty"&&e.dirty(),s.push(i.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,r){let s=[];for(let i of r){let n=await i.key,a=await i.value;s.push({key:n,value:a})}return t.mergeObjectSync(e,s)}static mergeObjectSync(e,r){let s={};for(let i of r){let{key:n,value:a}=i;if(n.status==="aborted"||a.status==="aborted")return ce;n.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(s[n.value]=a.value)}return{status:e.value,value:s}}},ce=Object.freeze({status:"aborted"}),Li=t=>({status:"dirty",value:t}),it=t=>({status:"valid",value:t}),Zu=t=>t.status==="aborted",Hu=t=>t.status==="dirty",ys=t=>t.status==="valid",Gn=t=>typeof Promise<"u"&&t instanceof Promise;function Fa(t,e,r,s){if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?s:r==="a"?s.call(t):s?s.value:e.get(t)}function Lv(t,e,r,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var ee;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(ee||(ee={}));var Bn,Un,Ot=class{constructor(e,r,s,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=s,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Av=(t,e)=>{if(ys(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new ht(t.common.issues);return this._error=r,this._error}}};function de(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:s,description:i}=t;if(e&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(a,o)=>{var c,l;let{message:u}=t;return a.code==="invalid_enum_value"?{message:u??o.defaultError}:typeof o.data>"u"?{message:(c=u??s)!==null&&c!==void 0?c:o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:(l=u??r)!==null&&l!==void 0?l:o.defaultError}},description:i}}var pe=class{get description(){return this._def.description}_getType(e){return dr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:dr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Xe,ctx:{common:e.parent.common,data:e.data,parsedType:dr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Gn(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let s=this.safeParse(e,r);if(s.success)return s.data;throw s.error}safeParse(e,r){var s;let i={common:{issues:[],async:(s=r?.async)!==null&&s!==void 0?s:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:dr(e)},n=this._parseSync({data:e,path:i.path,parent:i});return Av(i,n)}"~validate"(e){var r,s;let i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:dr(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:i});return ys(n)?{value:n.value}:{issues:i.common.issues}}catch(n){!((s=(r=n?.message)===null||r===void 0?void 0:r.toLowerCase())===null||s===void 0)&&s.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:i}).then(n=>ys(n)?{value:n.value}:{issues:i.common.issues})}async parseAsync(e,r){let s=await this.safeParseAsync(e,r);if(s.success)return s.data;throw s.error}async safeParseAsync(e,r){let s={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:dr(e)},i=this._parse({data:e,path:s.path,parent:s}),n=await(Gn(i)?i:Promise.resolve(i));return Av(s,n)}refine(e,r){let s=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,n)=>{let a=e(i),o=()=>n.addIssue({code:D.custom,...s(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,r){return this._refinement((s,i)=>e(s)?!0:(i.addIssue(typeof r=="function"?r(s,i):r),!1))}_refinement(e){return new dt({schema:this,typeName:F.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Ct.create(this,this._def)}nullable(){return Kt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mr.create(this)}promise(){return Lr.create(this,this._def)}or(e){return Ss.create([this,e],this._def)}and(e){return Rs.create(this,e,this._def)}transform(e){return new dt({...de(this._def),schema:this,typeName:F.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ls({...de(this._def),innerType:this,defaultValue:r,typeName:F.ZodDefault})}brand(){return new zn({typeName:F.ZodBranded,type:this,...de(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new $s({...de(this._def),innerType:this,catchValue:r,typeName:F.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return qn.create(this,e)}readonly(){return Ps.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},yP=/^c[^\s-]{8,}$/i,vP=/^[0-9a-z]+$/,bP=/^[0-9A-HJKMNP-TV-Z]{26}$/i,_P=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,wP=/^[a-z0-9_-]{21}$/i,xP=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,EP=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,SP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,RP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Wu,AP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,CP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,OP=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,TP=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,LP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$P=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,$v="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",PP=new RegExp(`^${$v}$`);function Pv(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function IP(t){return new RegExp(`^${Pv(t)}$`)}function Iv(t){let e=`${$v}T${Pv(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function kP(t,e){return!!((e==="v4"||!e)&&AP.test(t)||(e==="v6"||!e)&&OP.test(t))}function NP(t,e){if(!xP.test(t))return!1;try{let[r]=t.split("."),s=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(s));return!(typeof i!="object"||i===null||!i.typ||!i.alg||e&&i.alg!==e)}catch{return!1}}function DP(t,e){return!!((e==="v4"||!e)&&CP.test(t)||(e==="v6"||!e)&&TP.test(t))}var Or=class t extends pe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Z.string){let n=this._getOrReturnCtx(e);return G(n,{code:D.invalid_type,expected:Z.string,received:n.parsedType}),ce}let s=new Xe,i;for(let n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:D.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="max")e.data.length>n.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:D.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="length"){let a=e.data.length>n.value,o=e.data.length<n.value;(a||o)&&(i=this._getOrReturnCtx(e,i),a?G(i,{code:D.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):o&&G(i,{code:D.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),s.dirty())}else if(n.kind==="email")SP.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"email",code:D.invalid_string,message:n.message}),s.dirty());else if(n.kind==="emoji")Wu||(Wu=new RegExp(RP,"u")),Wu.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"emoji",code:D.invalid_string,message:n.message}),s.dirty());else if(n.kind==="uuid")_P.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"uuid",code:D.invalid_string,message:n.message}),s.dirty());else if(n.kind==="nanoid")wP.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"nanoid",code:D.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid")yP.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"cuid",code:D.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid2")vP.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"cuid2",code:D.invalid_string,message:n.message}),s.dirty());else if(n.kind==="ulid")bP.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"ulid",code:D.invalid_string,message:n.message}),s.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),G(i,{validation:"url",code:D.invalid_string,message:n.message}),s.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"regex",code:D.invalid_string,message:n.message}),s.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(i=this._getOrReturnCtx(e,i),G(i,{code:D.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),s.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(i=this._getOrReturnCtx(e,i),G(i,{code:D.invalid_string,validation:{startsWith:n.value},message:n.message}),s.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(i=this._getOrReturnCtx(e,i),G(i,{code:D.invalid_string,validation:{endsWith:n.value},message:n.message}),s.dirty()):n.kind==="datetime"?Iv(n).test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{code:D.invalid_string,validation:"datetime",message:n.message}),s.dirty()):n.kind==="date"?PP.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{code:D.invalid_string,validation:"date",message:n.message}),s.dirty()):n.kind==="time"?IP(n).test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{code:D.invalid_string,validation:"time",message:n.message}),s.dirty()):n.kind==="duration"?EP.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"duration",code:D.invalid_string,message:n.message}),s.dirty()):n.kind==="ip"?kP(e.data,n.version)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"ip",code:D.invalid_string,message:n.message}),s.dirty()):n.kind==="jwt"?NP(e.data,n.alg)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"jwt",code:D.invalid_string,message:n.message}),s.dirty()):n.kind==="cidr"?DP(e.data,n.version)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"cidr",code:D.invalid_string,message:n.message}),s.dirty()):n.kind==="base64"?LP.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"base64",code:D.invalid_string,message:n.message}),s.dirty()):n.kind==="base64url"?$P.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"base64url",code:D.invalid_string,message:n.message}),s.dirty()):_e.assertNever(n);return{status:s.value,value:e.data}}_regex(e,r,s){return this.refinement(i=>e.test(i),{validation:r,code:D.invalid_string,...ee.errToObj(s)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ee.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ee.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ee.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ee.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ee.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ee.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ee.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ee.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ee.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ee.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ee.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ee.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ee.errToObj(e)})}datetime(e){var r,s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(s=e?.local)!==null&&s!==void 0?s:!1,...ee.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...ee.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...ee.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ee.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...ee.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ee.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ee.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ee.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ee.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ee.errToObj(r)})}nonempty(e){return this.min(1,ee.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Or.create=t=>{var e;return new Or({checks:[],typeName:F.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...de(t)})};function FP(t,e){let r=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,i=r>s?r:s,n=parseInt(t.toFixed(i).replace(".","")),a=parseInt(e.toFixed(i).replace(".",""));return n%a/Math.pow(10,i)}var vs=class t extends pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Z.number){let n=this._getOrReturnCtx(e);return G(n,{code:D.invalid_type,expected:Z.number,received:n.parsedType}),ce}let s,i=new Xe;for(let n of this._def.checks)n.kind==="int"?_e.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),G(s,{code:D.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),G(s,{code:D.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),G(s,{code:D.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="multipleOf"?FP(e.data,n.value)!==0&&(s=this._getOrReturnCtx(e,s),G(s,{code:D.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),G(s,{code:D.not_finite,message:n.message}),i.dirty()):_e.assertNever(n);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ee.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ee.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ee.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ee.toString(r))}setLimit(e,r,s,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:ee.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ee.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ee.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ee.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ee.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ee.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ee.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ee.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ee.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ee.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_e.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(r)&&Number.isFinite(e)}};vs.create=t=>new vs({checks:[],typeName:F.ZodNumber,coerce:t?.coerce||!1,...de(t)});var bs=class t extends pe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Z.bigint)return this._getInvalidInput(e);let s,i=new Xe;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),G(s,{code:D.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),G(s,{code:D.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),G(s,{code:D.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):_e.assertNever(n);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return G(r,{code:D.invalid_type,expected:Z.bigint,received:r.parsedType}),ce}gte(e,r){return this.setLimit("min",e,!0,ee.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ee.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ee.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ee.toString(r))}setLimit(e,r,s,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:ee.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ee.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ee.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ee.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ee.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ee.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};bs.create=t=>{var e;return new bs({checks:[],typeName:F.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...de(t)})};var _s=class extends pe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Z.boolean){let s=this._getOrReturnCtx(e);return G(s,{code:D.invalid_type,expected:Z.boolean,received:s.parsedType}),ce}return it(e.data)}};_s.create=t=>new _s({typeName:F.ZodBoolean,coerce:t?.coerce||!1,...de(t)});var ws=class t extends pe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Z.date){let n=this._getOrReturnCtx(e);return G(n,{code:D.invalid_type,expected:Z.date,received:n.parsedType}),ce}if(isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return G(n,{code:D.invalid_date}),ce}let s=new Xe,i;for(let n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:D.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),s.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:D.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),s.dirty()):_e.assertNever(n);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ee.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ee.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};ws.create=t=>new ws({checks:[],coerce:t?.coerce||!1,typeName:F.ZodDate,...de(t)});var Pi=class extends pe{_parse(e){if(this._getType(e)!==Z.symbol){let s=this._getOrReturnCtx(e);return G(s,{code:D.invalid_type,expected:Z.symbol,received:s.parsedType}),ce}return it(e.data)}};Pi.create=t=>new Pi({typeName:F.ZodSymbol,...de(t)});var xs=class extends pe{_parse(e){if(this._getType(e)!==Z.undefined){let s=this._getOrReturnCtx(e);return G(s,{code:D.invalid_type,expected:Z.undefined,received:s.parsedType}),ce}return it(e.data)}};xs.create=t=>new xs({typeName:F.ZodUndefined,...de(t)});var Es=class extends pe{_parse(e){if(this._getType(e)!==Z.null){let s=this._getOrReturnCtx(e);return G(s,{code:D.invalid_type,expected:Z.null,received:s.parsedType}),ce}return it(e.data)}};Es.create=t=>new Es({typeName:F.ZodNull,...de(t)});var Tr=class extends pe{constructor(){super(...arguments),this._any=!0}_parse(e){return it(e.data)}};Tr.create=t=>new Tr({typeName:F.ZodAny,...de(t)});var pr=class extends pe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return it(e.data)}};pr.create=t=>new pr({typeName:F.ZodUnknown,...de(t)});var Ft=class extends pe{_parse(e){let r=this._getOrReturnCtx(e);return G(r,{code:D.invalid_type,expected:Z.never,received:r.parsedType}),ce}};Ft.create=t=>new Ft({typeName:F.ZodNever,...de(t)});var Ii=class extends pe{_parse(e){if(this._getType(e)!==Z.undefined){let s=this._getOrReturnCtx(e);return G(s,{code:D.invalid_type,expected:Z.void,received:s.parsedType}),ce}return it(e.data)}};Ii.create=t=>new Ii({typeName:F.ZodVoid,...de(t)});var mr=class t extends pe{_parse(e){let{ctx:r,status:s}=this._processInputParams(e),i=this._def;if(r.parsedType!==Z.array)return G(r,{code:D.invalid_type,expected:Z.array,received:r.parsedType}),ce;if(i.exactLength!==null){let a=r.data.length>i.exactLength.value,o=r.data.length<i.exactLength.value;(a||o)&&(G(r,{code:a?D.too_big:D.too_small,minimum:o?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),s.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(G(r,{code:D.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),s.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(G(r,{code:D.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((a,o)=>i.type._parseAsync(new Ot(r,a,r.path,o)))).then(a=>Xe.mergeArray(s,a));let n=[...r.data].map((a,o)=>i.type._parseSync(new Ot(r,a,r.path,o)));return Xe.mergeArray(s,n)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:ee.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:ee.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:ee.toString(r)}})}nonempty(e){return this.min(1,e)}};mr.create=(t,e)=>new mr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:F.ZodArray,...de(e)});function Ti(t){if(t instanceof ct){let e={};for(let r in t.shape){let s=t.shape[r];e[r]=Ct.create(Ti(s))}return new ct({...t._def,shape:()=>e})}else return t instanceof mr?new mr({...t._def,type:Ti(t.element)}):t instanceof Ct?Ct.create(Ti(t.unwrap())):t instanceof Kt?Kt.create(Ti(t.unwrap())):t instanceof Ht?Ht.create(t.items.map(e=>Ti(e))):t}var ct=class t extends pe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=_e.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Z.object){let l=this._getOrReturnCtx(e);return G(l,{code:D.invalid_type,expected:Z.object,received:l.parsedType}),ce}let{status:s,ctx:i}=this._processInputParams(e),{shape:n,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ft&&this._def.unknownKeys==="strip"))for(let l in i.data)a.includes(l)||o.push(l);let c=[];for(let l of a){let u=n[l],p=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Ot(i,p,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Ft){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of o)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")o.length>0&&(G(i,{code:D.unrecognized_keys,keys:o}),s.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of o){let p=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Ot(i,p,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let p=await u.key,g=await u.value;l.push({key:p,value:g,alwaysSet:u.alwaysSet})}return l}).then(l=>Xe.mergeObjectSync(s,l)):Xe.mergeObjectSync(s,c)}get shape(){return this._def.shape()}strict(e){return ee.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,s)=>{var i,n,a,o;let c=(a=(n=(i=this._def).errorMap)===null||n===void 0?void 0:n.call(i,r,s).message)!==null&&a!==void 0?a:s.defaultError;return r.code==="unrecognized_keys"?{message:(o=ee.errToObj(e).message)!==null&&o!==void 0?o:c}:{message:c}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:F.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return _e.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(r[s]=this.shape[s])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return _e.objectKeys(this.shape).forEach(s=>{e[s]||(r[s]=this.shape[s])}),new t({...this._def,shape:()=>r})}deepPartial(){return Ti(this)}partial(e){let r={};return _e.objectKeys(this.shape).forEach(s=>{let i=this.shape[s];e&&!e[s]?r[s]=i:r[s]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return _e.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])r[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof Ct;)n=n._def.innerType;r[s]=n}}),new t({...this._def,shape:()=>r})}keyof(){return kv(_e.objectKeys(this.shape))}};ct.create=(t,e)=>new ct({shape:()=>t,unknownKeys:"strip",catchall:Ft.create(),typeName:F.ZodObject,...de(e)});ct.strictCreate=(t,e)=>new ct({shape:()=>t,unknownKeys:"strict",catchall:Ft.create(),typeName:F.ZodObject,...de(e)});ct.lazycreate=(t,e)=>new ct({shape:t,unknownKeys:"strip",catchall:Ft.create(),typeName:F.ZodObject,...de(e)});var Ss=class extends pe{_parse(e){let{ctx:r}=this._processInputParams(e),s=this._def.options;function i(n){for(let o of n)if(o.result.status==="valid")return o.result;for(let o of n)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let a=n.map(o=>new ht(o.ctx.common.issues));return G(r,{code:D.invalid_union,unionErrors:a}),ce}if(r.common.async)return Promise.all(s.map(async n=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await n._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(i);{let n,a=[];for(let c of s){let l={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!n&&(n={result:u,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(n)return r.common.issues.push(...n.ctx.common.issues),n.result;let o=a.map(c=>new ht(c));return G(r,{code:D.invalid_union,unionErrors:o}),ce}}get options(){return this._def.options}};Ss.create=(t,e)=>new Ss({options:t,typeName:F.ZodUnion,...de(e)});var hr=t=>t instanceof As?hr(t.schema):t instanceof dt?hr(t.innerType()):t instanceof Cs?[t.value]:t instanceof Os?t.options:t instanceof Ts?_e.objectValues(t.enum):t instanceof Ls?hr(t._def.innerType):t instanceof xs?[void 0]:t instanceof Es?[null]:t instanceof Ct?[void 0,...hr(t.unwrap())]:t instanceof Kt?[null,...hr(t.unwrap())]:t instanceof zn||t instanceof Ps?hr(t.unwrap()):t instanceof $s?hr(t._def.innerType):[],Ma=class t extends pe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Z.object)return G(r,{code:D.invalid_type,expected:Z.object,received:r.parsedType}),ce;let s=this.discriminator,i=r.data[s],n=this.optionsMap.get(i);return n?r.common.async?n._parseAsync({data:r.data,path:r.path,parent:r}):n._parseSync({data:r.data,path:r.path,parent:r}):(G(r,{code:D.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,s){let i=new Map;for(let n of r){let a=hr(n.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of a){if(i.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);i.set(o,n)}}return new t({typeName:F.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...de(s)})}};function Ku(t,e){let r=dr(t),s=dr(e);if(t===e)return{valid:!0,data:t};if(r===Z.object&&s===Z.object){let i=_e.objectKeys(e),n=_e.objectKeys(t).filter(o=>i.indexOf(o)!==-1),a={...t,...e};for(let o of n){let c=Ku(t[o],e[o]);if(!c.valid)return{valid:!1};a[o]=c.data}return{valid:!0,data:a}}else if(r===Z.array&&s===Z.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let n=0;n<t.length;n++){let a=t[n],o=e[n],c=Ku(a,o);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===Z.date&&s===Z.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Rs=class extends pe{_parse(e){let{status:r,ctx:s}=this._processInputParams(e),i=(n,a)=>{if(Zu(n)||Zu(a))return ce;let o=Ku(n.value,a.value);return o.valid?((Hu(n)||Hu(a))&&r.dirty(),{status:r.value,value:o.data}):(G(s,{code:D.invalid_intersection_types}),ce)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([n,a])=>i(n,a)):i(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};Rs.create=(t,e,r)=>new Rs({left:t,right:e,typeName:F.ZodIntersection,...de(r)});var Ht=class t extends pe{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==Z.array)return G(s,{code:D.invalid_type,expected:Z.array,received:s.parsedType}),ce;if(s.data.length<this._def.items.length)return G(s,{code:D.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ce;!this._def.rest&&s.data.length>this._def.items.length&&(G(s,{code:D.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let n=[...s.data].map((a,o)=>{let c=this._def.items[o]||this._def.rest;return c?c._parse(new Ot(s,a,s.path,o)):null}).filter(a=>!!a);return s.common.async?Promise.all(n).then(a=>Xe.mergeArray(r,a)):Xe.mergeArray(r,n)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Ht.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ht({items:t,typeName:F.ZodTuple,rest:null,...de(e)})};var ja=class t extends pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==Z.object)return G(s,{code:D.invalid_type,expected:Z.object,received:s.parsedType}),ce;let i=[],n=this._def.keyType,a=this._def.valueType;for(let o in s.data)i.push({key:n._parse(new Ot(s,o,s.path,o)),value:a._parse(new Ot(s,s.data[o],s.path,o)),alwaysSet:o in s.data});return s.common.async?Xe.mergeObjectAsync(r,i):Xe.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,s){return r instanceof pe?new t({keyType:e,valueType:r,typeName:F.ZodRecord,...de(s)}):new t({keyType:Or.create(),valueType:e,typeName:F.ZodRecord,...de(r)})}},ki=class extends pe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==Z.map)return G(s,{code:D.invalid_type,expected:Z.map,received:s.parsedType}),ce;let i=this._def.keyType,n=this._def.valueType,a=[...s.data.entries()].map(([o,c],l)=>({key:i._parse(new Ot(s,o,s.path,[l,"key"])),value:n._parse(new Ot(s,c,s.path,[l,"value"]))}));if(s.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let c of a){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return ce;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(l.value,u.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let c of a){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return ce;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),o.set(l.value,u.value)}return{status:r.value,value:o}}}};ki.create=(t,e,r)=>new ki({valueType:e,keyType:t,typeName:F.ZodMap,...de(r)});var Ni=class t extends pe{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==Z.set)return G(s,{code:D.invalid_type,expected:Z.set,received:s.parsedType}),ce;let i=this._def;i.minSize!==null&&s.data.size<i.minSize.value&&(G(s,{code:D.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&s.data.size>i.maxSize.value&&(G(s,{code:D.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let n=this._def.valueType;function a(c){let l=new Set;for(let u of c){if(u.status==="aborted")return ce;u.status==="dirty"&&r.dirty(),l.add(u.value)}return{status:r.value,value:l}}let o=[...s.data.values()].map((c,l)=>n._parse(new Ot(s,c,s.path,l)));return s.common.async?Promise.all(o).then(c=>a(c)):a(o)}min(e,r){return new t({...this._def,minSize:{value:e,message:ee.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:ee.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Ni.create=(t,e)=>new Ni({valueType:t,minSize:null,maxSize:null,typeName:F.ZodSet,...de(e)});var Ba=class t extends pe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Z.function)return G(r,{code:D.invalid_type,expected:Z.function,received:r.parsedType}),ce;function s(o,c){return Da({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Na(),$i].filter(l=>!!l),issueData:{code:D.invalid_arguments,argumentsError:c}})}function i(o,c){return Da({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Na(),$i].filter(l=>!!l),issueData:{code:D.invalid_return_type,returnTypeError:c}})}let n={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Lr){let o=this;return it(async function(...c){let l=new ht([]),u=await o._def.args.parseAsync(c,n).catch(f=>{throw l.addIssue(s(c,f)),l}),p=await Reflect.apply(a,this,u);return await o._def.returns._def.type.parseAsync(p,n).catch(f=>{throw l.addIssue(i(p,f)),l})})}else{let o=this;return it(function(...c){let l=o._def.args.safeParse(c,n);if(!l.success)throw new ht([s(c,l.error)]);let u=Reflect.apply(a,this,l.data),p=o._def.returns.safeParse(u,n);if(!p.success)throw new ht([i(u,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Ht.create(e).rest(pr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,s){return new t({args:e||Ht.create([]).rest(pr.create()),returns:r||pr.create(),typeName:F.ZodFunction,...de(s)})}},As=class extends pe{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};As.create=(t,e)=>new As({getter:t,typeName:F.ZodLazy,...de(e)});var Cs=class extends pe{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return G(r,{received:r.data,code:D.invalid_literal,expected:this._def.value}),ce}return{status:"valid",value:e.data}}get value(){return this._def.value}};Cs.create=(t,e)=>new Cs({value:t,typeName:F.ZodLiteral,...de(e)});function kv(t,e){return new Os({values:t,typeName:F.ZodEnum,...de(e)})}var Os=class t extends pe{constructor(){super(...arguments),Bn.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),s=this._def.values;return G(r,{expected:_e.joinValues(s),received:r.parsedType,code:D.invalid_type}),ce}if(Fa(this,Bn,"f")||Lv(this,Bn,new Set(this._def.values),"f"),!Fa(this,Bn,"f").has(e.data)){let r=this._getOrReturnCtx(e),s=this._def.values;return G(r,{received:r.data,code:D.invalid_enum_value,options:s}),ce}return it(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(s=>!e.includes(s)),{...this._def,...r})}};Bn=new WeakMap;Os.create=kv;var Ts=class extends pe{constructor(){super(...arguments),Un.set(this,void 0)}_parse(e){let r=_e.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==Z.string&&s.parsedType!==Z.number){let i=_e.objectValues(r);return G(s,{expected:_e.joinValues(i),received:s.parsedType,code:D.invalid_type}),ce}if(Fa(this,Un,"f")||Lv(this,Un,new Set(_e.getValidEnumValues(this._def.values)),"f"),!Fa(this,Un,"f").has(e.data)){let i=_e.objectValues(r);return G(s,{received:s.data,code:D.invalid_enum_value,options:i}),ce}return it(e.data)}get enum(){return this._def.values}};Un=new WeakMap;Ts.create=(t,e)=>new Ts({values:t,typeName:F.ZodNativeEnum,...de(e)});var Lr=class extends pe{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Z.promise&&r.common.async===!1)return G(r,{code:D.invalid_type,expected:Z.promise,received:r.parsedType}),ce;let s=r.parsedType===Z.promise?r.data:Promise.resolve(r.data);return it(s.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Lr.create=(t,e)=>new Lr({type:t,typeName:F.ZodPromise,...de(e)});var dt=class extends pe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===F.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:s}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:a=>{G(s,a),a.fatal?r.abort():r.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),i.type==="preprocess"){let a=i.transform(s.data,n);if(s.common.async)return Promise.resolve(a).then(async o=>{if(r.value==="aborted")return ce;let c=await this._def.schema._parseAsync({data:o,path:s.path,parent:s});return c.status==="aborted"?ce:c.status==="dirty"||r.value==="dirty"?Li(c.value):c});{if(r.value==="aborted")return ce;let o=this._def.schema._parseSync({data:a,path:s.path,parent:s});return o.status==="aborted"?ce:o.status==="dirty"||r.value==="dirty"?Li(o.value):o}}if(i.type==="refinement"){let a=o=>{let c=i.refinement(o,n);if(s.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?ce:(o.status==="dirty"&&r.dirty(),a(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?ce:(o.status==="dirty"&&r.dirty(),a(o.value).then(()=>({status:r.value,value:o.value}))))}if(i.type==="transform")if(s.common.async===!1){let a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!ys(a))return a;let o=i.transform(a.value,n);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>ys(a)?Promise.resolve(i.transform(a.value,n)).then(o=>({status:r.value,value:o})):a);_e.assertNever(i)}};dt.create=(t,e,r)=>new dt({schema:t,typeName:F.ZodEffects,effect:e,...de(r)});dt.createWithPreprocess=(t,e,r)=>new dt({schema:e,effect:{type:"preprocess",transform:t},typeName:F.ZodEffects,...de(r)});var Ct=class extends pe{_parse(e){return this._getType(e)===Z.undefined?it(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ct.create=(t,e)=>new Ct({innerType:t,typeName:F.ZodOptional,...de(e)});var Kt=class extends pe{_parse(e){return this._getType(e)===Z.null?it(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Kt.create=(t,e)=>new Kt({innerType:t,typeName:F.ZodNullable,...de(e)});var Ls=class extends pe{_parse(e){let{ctx:r}=this._processInputParams(e),s=r.data;return r.parsedType===Z.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ls.create=(t,e)=>new Ls({innerType:t,typeName:F.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...de(e)});var $s=class extends pe{_parse(e){let{ctx:r}=this._processInputParams(e),s={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Gn(i)?i.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ht(s.common.issues)},input:s.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ht(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};$s.create=(t,e)=>new $s({innerType:t,typeName:F.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...de(e)});var Di=class extends pe{_parse(e){if(this._getType(e)!==Z.nan){let s=this._getOrReturnCtx(e);return G(s,{code:D.invalid_type,expected:Z.nan,received:s.parsedType}),ce}return{status:"valid",value:e.data}}};Di.create=t=>new Di({typeName:F.ZodNaN,...de(t)});var MP=Symbol("zod_brand"),zn=class extends pe{_parse(e){let{ctx:r}=this._processInputParams(e),s=r.data;return this._def.type._parse({data:s,path:r.path,parent:r})}unwrap(){return this._def.type}},qn=class t extends pe{_parse(e){let{status:r,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?ce:n.status==="dirty"?(r.dirty(),Li(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{let i=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?ce:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:s.path,parent:s})}}static create(e,r){return new t({in:e,out:r,typeName:F.ZodPipeline})}},Ps=class extends pe{_parse(e){let r=this._def.innerType._parse(e),s=i=>(ys(i)&&(i.value=Object.freeze(i.value)),i);return Gn(r)?r.then(i=>s(i)):s(r)}unwrap(){return this._def.innerType}};Ps.create=(t,e)=>new Ps({innerType:t,typeName:F.ZodReadonly,...de(e)});function Cv(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Nv(t,e={},r){return t?Tr.create().superRefine((s,i)=>{var n,a;let o=t(s);if(o instanceof Promise)return o.then(c=>{var l,u;if(!c){let p=Cv(e,s),g=(u=(l=p.fatal)!==null&&l!==void 0?l:r)!==null&&u!==void 0?u:!0;i.addIssue({code:"custom",...p,fatal:g})}});if(!o){let c=Cv(e,s),l=(a=(n=c.fatal)!==null&&n!==void 0?n:r)!==null&&a!==void 0?a:!0;i.addIssue({code:"custom",...c,fatal:l})}}):Tr.create()}var jP={object:ct.lazycreate},F;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(F||(F={}));var BP=(t,e={message:`Input not instance of ${t.name}`})=>Nv(r=>r instanceof t,e),Dv=Or.create,Fv=vs.create,UP=Di.create,GP=bs.create,Mv=_s.create,zP=ws.create,qP=Pi.create,WP=xs.create,VP=Es.create,ZP=Tr.create,HP=pr.create,KP=Ft.create,YP=Ii.create,JP=mr.create,XP=ct.create,QP=ct.strictCreate,eI=Ss.create,tI=Ma.create,rI=Rs.create,sI=Ht.create,iI=ja.create,nI=ki.create,oI=Ni.create,aI=Ba.create,cI=As.create,lI=Cs.create,uI=Os.create,fI=Ts.create,hI=Lr.create,Ov=dt.create,dI=Ct.create,pI=Kt.create,mI=dt.createWithPreprocess,gI=qn.create,yI=()=>Dv().optional(),vI=()=>Fv().optional(),bI=()=>Mv().optional(),_I={string:(t=>Or.create({...t,coerce:!0})),number:(t=>vs.create({...t,coerce:!0})),boolean:(t=>_s.create({...t,coerce:!0})),bigint:(t=>bs.create({...t,coerce:!0})),date:(t=>ws.create({...t,coerce:!0}))},wI=ce,Be=Object.freeze({__proto__:null,defaultErrorMap:$i,setErrorMap:mP,getErrorMap:Na,makeIssue:Da,EMPTY_PATH:gP,addIssueToContext:G,ParseStatus:Xe,INVALID:ce,DIRTY:Li,OK:it,isAborted:Zu,isDirty:Hu,isValid:ys,isAsync:Gn,get util(){return _e},get objectUtil(){return Vu},ZodParsedType:Z,getParsedType:dr,ZodType:pe,datetimeRegex:Iv,ZodString:Or,ZodNumber:vs,ZodBigInt:bs,ZodBoolean:_s,ZodDate:ws,ZodSymbol:Pi,ZodUndefined:xs,ZodNull:Es,ZodAny:Tr,ZodUnknown:pr,ZodNever:Ft,ZodVoid:Ii,ZodArray:mr,ZodObject:ct,ZodUnion:Ss,ZodDiscriminatedUnion:Ma,ZodIntersection:Rs,ZodTuple:Ht,ZodRecord:ja,ZodMap:ki,ZodSet:Ni,ZodFunction:Ba,ZodLazy:As,ZodLiteral:Cs,ZodEnum:Os,ZodNativeEnum:Ts,ZodPromise:Lr,ZodEffects:dt,ZodTransformer:dt,ZodOptional:Ct,ZodNullable:Kt,ZodDefault:Ls,ZodCatch:$s,ZodNaN:Di,BRAND:MP,ZodBranded:zn,ZodPipeline:qn,ZodReadonly:Ps,custom:Nv,Schema:pe,ZodSchema:pe,late:jP,get ZodFirstPartyTypeKind(){return F},coerce:_I,any:ZP,array:JP,bigint:GP,boolean:Mv,date:zP,discriminatedUnion:tI,effect:Ov,enum:uI,function:aI,instanceof:BP,intersection:rI,lazy:cI,literal:lI,map:nI,nan:UP,nativeEnum:fI,never:KP,null:VP,nullable:pI,number:Fv,object:XP,oboolean:bI,onumber:vI,optional:dI,ostring:yI,pipeline:gI,preprocess:mI,promise:hI,record:iI,set:oI,strictObject:QP,string:Dv,symbol:qP,transformer:Ov,tuple:sI,undefined:WP,union:eI,unknown:HP,void:YP,NEVER:wI,ZodIssueCode:D,quotelessJson:pP,ZodError:ht});function jv(){return{}}function Bv(t,e){let r={type:"array"};return t.type?._def?.typeName!==F.ZodAny&&(r.items=oe(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&be(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&be(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(be(r,"minItems",t.exactLength.value,t.exactLength.message,e),be(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}function Uv(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let s of t.checks)switch(s.kind){case"min":e.target==="jsonSchema7"?s.inclusive?be(r,"minimum",s.value,s.message,e):be(r,"exclusiveMinimum",s.value,s.message,e):(s.inclusive||(r.exclusiveMinimum=!0),be(r,"minimum",s.value,s.message,e));break;case"max":e.target==="jsonSchema7"?s.inclusive?be(r,"maximum",s.value,s.message,e):be(r,"exclusiveMaximum",s.value,s.message,e):(s.inclusive||(r.exclusiveMaximum=!0),be(r,"maximum",s.value,s.message,e));break;case"multipleOf":be(r,"multipleOf",s.value,s.message,e);break}return r}function Gv(){return{type:"boolean"}}function zv(t,e){return oe(t.type._def,e)}var qv=(t,e)=>oe(t.innerType._def,e);function Yu(t,e,r){let s=r??e.dateStrategy;if(Array.isArray(s))return{anyOf:s.map((i,n)=>Yu(t,e,i))};switch(s){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return xI(t,e)}}var xI=(t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let s of t.checks)switch(s.kind){case"min":be(r,"minimum",s.value,s.message,e);break;case"max":be(r,"maximum",s.value,s.message,e);break}return r};function Wv(t,e){return{...oe(t.innerType._def,e),default:t.defaultValue()}}function Vv(t,e,r){return e.effectStrategy==="input"?oe(t.schema._def,e,r):{}}function Zv(t){return{type:"string",enum:[...t.values]}}var EI=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function Hv(t,e){let r=[oe(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),oe(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(n=>!!n),s=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,i=[];return r.forEach(n=>{if(EI(n))i.push(...n.allOf),n.unevaluatedProperties===void 0&&(s=void 0);else{let a=n;if("additionalProperties"in n&&n.additionalProperties===!1){let{additionalProperties:o,...c}=n;a=c}else s=void 0;i.push(a)}}),i.length?{allOf:i,...s}:void 0}function Kv(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}var Ju,Is={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Ju===void 0&&(Ju=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ju),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/};function Ua(t,e){let r={type:"string"};function s(i){return e.patternStrategy==="escape"?SI(i):i}if(t.checks)for(let i of t.checks)switch(i.kind){case"min":be(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,i.value):i.value,i.message,e);break;case"max":be(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,i.value):i.value,i.message,e);break;case"email":switch(e.emailStrategy){case"format:email":Mt(r,"email",i.message,e);break;case"format:idn-email":Mt(r,"idn-email",i.message,e);break;case"pattern:zod":jt(r,Is.email,i.message,e);break}break;case"url":Mt(r,"uri",i.message,e);break;case"uuid":Mt(r,"uuid",i.message,e);break;case"regex":jt(r,i.regex,i.message,e);break;case"cuid":jt(r,Is.cuid,i.message,e);break;case"cuid2":jt(r,Is.cuid2,i.message,e);break;case"startsWith":jt(r,RegExp(`^${s(i.value)}`),i.message,e);break;case"endsWith":jt(r,RegExp(`${s(i.value)}$`),i.message,e);break;case"datetime":Mt(r,"date-time",i.message,e);break;case"date":Mt(r,"date",i.message,e);break;case"time":Mt(r,"time",i.message,e);break;case"duration":Mt(r,"duration",i.message,e);break;case"length":be(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,i.value):i.value,i.message,e),be(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,i.value):i.value,i.message,e);break;case"includes":{jt(r,RegExp(s(i.value)),i.message,e);break}case"ip":{i.version!=="v6"&&Mt(r,"ipv4",i.message,e),i.version!=="v4"&&Mt(r,"ipv6",i.message,e);break}case"emoji":jt(r,Is.emoji,i.message,e);break;case"ulid":{jt(r,Is.ulid,i.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{Mt(r,"binary",i.message,e);break}case"contentEncoding:base64":{be(r,"contentEncoding","base64",i.message,e);break}case"pattern:zod":{jt(r,Is.base64,i.message,e);break}}break}case"nanoid":jt(r,Is.nanoid,i.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}var SI=t=>Array.from(t).map(e=>/[a-zA-Z0-9]/.test(e)?e:`\\${e}`).join(""),Mt=(t,e,r,s)=>{t.format||t.anyOf?.some(i=>i.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&s.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&s.errorMessages&&{errorMessage:{format:r}}})):be(t,"format",e,r,s)},jt=(t,e,r,s)=>{t.pattern||t.allOf?.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&s.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:Yv(e,s),...r&&s.errorMessages&&{errorMessage:{pattern:r}}})):be(t,"pattern",Yv(e,s),r,s)},Yv=(t,e)=>{let r=typeof t=="function"?t():t;if(!e.applyRegexFlags||!r.flags)return r.source;let s={i:r.flags.includes("i"),m:r.flags.includes("m"),s:r.flags.includes("s")},i=s.i?r.source.toLowerCase():r.source,n="",a=!1,o=!1,c=!1;for(let l=0;l<i.length;l++){if(a){n+=i[l],a=!1;continue}if(s.i){if(o){if(i[l].match(/[a-z]/)){c?(n+=i[l],n+=`${i[l-2]}-${i[l]}`.toUpperCase(),c=!1):i[l+1]==="-"&&i[l+2]?.match(/[a-z]/)?(n+=i[l],c=!0):n+=`${i[l]}${i[l].toUpperCase()}`;continue}}else if(i[l].match(/[a-z]/)){n+=`[${i[l]}${i[l].toUpperCase()}]`;continue}}if(s.m){if(i[l]==="^"){n+=`(^|(?<=[\r
|
|
61
|
+
]))`;continue}else if(i[l]==="$"){n+=`($|(?=[\r
|
|
62
|
+
]))`;continue}}if(s.s&&i[l]==="."){n+=o?`${i[l]}\r
|
|
63
|
+
`:`[${i[l]}\r
|
|
64
|
+
]`;continue}n+=i[l],i[l]==="\\"?a=!0:o&&i[l]==="]"?o=!1:!o&&i[l]==="["&&(o=!0)}try{let l=new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),r.source}return n};function Ga(t,e){if(e.target==="openApi3"&&t.keyType?._def.typeName===F.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((s,i)=>({...s,[i]:oe(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",i]})??{}}),{}),additionalProperties:!1};let r={type:"object",additionalProperties:oe(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??{}};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===F.ZodString&&t.keyType._def.checks?.length){let s=Object.entries(Ua(t.keyType._def,e)).reduce((i,[n,a])=>n==="type"?i:{...i,[n]:a},{});return{...r,propertyNames:s}}else if(t.keyType?._def.typeName===F.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};return r}function Jv(t,e){if(e.mapStrategy==="record")return Ga(t,e);let r=oe(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||{},s=oe(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[r,s],minItems:2,maxItems:2}}}function Xv(t){let e=t.values,s=Object.keys(t.values).filter(n=>typeof e[e[n]]!="number").map(n=>e[n]),i=Array.from(new Set(s.map(n=>typeof n)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:s}}function Qv(){return{not:{}}}function eb(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var Wn={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function rb(t,e){if(e.target==="openApi3")return tb(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(s=>s._def.typeName in Wn&&(!s._def.checks||!s._def.checks.length))){let s=r.reduce((i,n)=>{let a=Wn[n._def.typeName];return a&&!i.includes(a)?[...i,a]:i},[]);return{type:s.length>1?s:s[0]}}else if(r.every(s=>s._def.typeName==="ZodLiteral"&&!s.description)){let s=r.reduce((i,n)=>{let a=typeof n._def.value;switch(a){case"string":case"number":case"boolean":return[...i,a];case"bigint":return[...i,"integer"];case"object":if(n._def.value===null)return[...i,"null"];case"symbol":case"undefined":case"function":default:return i}},[]);if(s.length===r.length){let i=s.filter((n,a,o)=>o.indexOf(n)===a);return{type:i.length>1?i:i[0],enum:r.reduce((n,a)=>n.includes(a._def.value)?n:[...n,a._def.value],[])}}}else if(r.every(s=>s._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((s,i)=>[...s,...i._def.values.filter(n=>!s.includes(n))],[])};return tb(t,e)}var tb=(t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((s,i)=>oe(s._def,{...e,currentPath:[...e.currentPath,"anyOf",`${i}`]})).filter(s=>!!s&&(!e.strictUnions||typeof s=="object"&&Object.keys(s).length>0));return r.length?{anyOf:r}:void 0};function sb(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"||e.nullableStrategy==="property"?{type:Wn[t.innerType._def.typeName],nullable:!0}:{type:[Wn[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let s=oe(t.innerType._def,{...e,currentPath:[...e.currentPath]});return s&&"$ref"in s?{allOf:[s],nullable:!0}:s&&{...s,nullable:!0}}let r=oe(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function ib(t,e){let r={type:"number"};if(!t.checks)return r;for(let s of t.checks)switch(s.kind){case"int":r.type="integer",qu(r,"type",s.message,e);break;case"min":e.target==="jsonSchema7"?s.inclusive?be(r,"minimum",s.value,s.message,e):be(r,"exclusiveMinimum",s.value,s.message,e):(s.inclusive||(r.exclusiveMinimum=!0),be(r,"minimum",s.value,s.message,e));break;case"max":e.target==="jsonSchema7"?s.inclusive?be(r,"maximum",s.value,s.message,e):be(r,"exclusiveMaximum",s.value,s.message,e):(s.inclusive||(r.exclusiveMaximum=!0),be(r,"maximum",s.value,s.message,e));break;case"multipleOf":be(r,"multipleOf",s.value,s.message,e);break}return r}function RI(t,e){return e.removeAdditionalStrategy==="strict"?t.catchall._def.typeName==="ZodNever"?t.unknownKeys!=="strict":oe(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??!0:t.catchall._def.typeName==="ZodNever"?t.unknownKeys==="passthrough":oe(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??!0}function nb(t,e){let r={type:"object",...Object.entries(t.shape()).reduce((s,[i,n])=>{if(n===void 0||n._def===void 0)return s;let a=oe(n._def,{...e,currentPath:[...e.currentPath,"properties",i],propertyPath:[...e.currentPath,"properties",i]});return a===void 0?s:{properties:{...s.properties,[i]:a},required:n.isOptional()&&!e.openaiStrictMode?s.required:[...s.required,i]}},{properties:{},required:[]}),additionalProperties:RI(t,e)};return r.required.length||delete r.required,r}var ob=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return oe(t.innerType._def,e);let r=oe(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:{}},r]}:{}};var ab=(t,e)=>{if(e.pipeStrategy==="input")return oe(t.in._def,e);if(e.pipeStrategy==="output")return oe(t.out._def,e);let r=oe(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),s=oe(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,s].filter(i=>i!==void 0)}};function cb(t,e){return oe(t.type._def,e)}function lb(t,e){let s={type:"array",uniqueItems:!0,items:oe(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&be(s,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&be(s,"maxItems",t.maxSize.value,t.maxSize.message,e),s}function ub(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,s)=>oe(r._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((r,s)=>s===void 0?r:[...r,s],[]),additionalItems:oe(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,s)=>oe(r._def,{...e,currentPath:[...e.currentPath,"items",`${s}`]})).reduce((r,s)=>s===void 0?r:[...r,s],[])}}function fb(){return{not:{}}}function hb(){return{}}var db=(t,e)=>oe(t.innerType._def,e);function oe(t,e,r=!1){let s=e.seen.get(t);if(e.override){let a=e.override?.(t,e,s,r);if(a!==xv)return a}if(s&&!r){let a=AI(s,e);if(a!==void 0)return"$ref"in a&&e.seenRefs.add(a.$ref),a}let i={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,i);let n=OI(t,t.typeName,e,r);return n&&TI(t,e,n),i.jsonSchema=n,n}var AI=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"extract-to-root":let r=t.path.slice(e.basePath.length+1).join("_");return r!==e.name&&e.nameStrategy==="duplicate-ref"&&(e.definitions[r]=t.def),{$ref:[...e.basePath,e.definitionPath,r].join("/")};case"relative":return{$ref:CI(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((s,i)=>e.currentPath[i]===s)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),{}):e.$refStrategy==="seen"?{}:void 0}},CI=(t,e)=>{let r=0;for(;r<t.length&&r<e.length&&t[r]===e[r];r++);return[(t.length-r).toString(),...e.slice(r)].join("/")},OI=(t,e,r,s)=>{switch(e){case F.ZodString:return Ua(t,r);case F.ZodNumber:return ib(t,r);case F.ZodObject:return nb(t,r);case F.ZodBigInt:return Uv(t,r);case F.ZodBoolean:return Gv();case F.ZodDate:return Yu(t,r);case F.ZodUndefined:return fb();case F.ZodNull:return eb(r);case F.ZodArray:return Bv(t,r);case F.ZodUnion:case F.ZodDiscriminatedUnion:return rb(t,r);case F.ZodIntersection:return Hv(t,r);case F.ZodTuple:return ub(t,r);case F.ZodRecord:return Ga(t,r);case F.ZodLiteral:return Kv(t,r);case F.ZodEnum:return Zv(t);case F.ZodNativeEnum:return Xv(t);case F.ZodNullable:return sb(t,r);case F.ZodOptional:return ob(t,r);case F.ZodMap:return Jv(t,r);case F.ZodSet:return lb(t,r);case F.ZodLazy:return oe(t.getter()._def,r);case F.ZodPromise:return cb(t,r);case F.ZodNaN:case F.ZodNever:return Qv();case F.ZodEffects:return Vv(t,r,s);case F.ZodAny:return jv();case F.ZodUnknown:return hb();case F.ZodDefault:return Wv(t,r);case F.ZodBranded:return zv(t,r);case F.ZodReadonly:return db(t,r);case F.ZodCatch:return qv(t,r);case F.ZodPipeline:return ab(t,r);case F.ZodFunction:case F.ZodVoid:case F.ZodSymbol:return;default:return(i=>{})(e)}},TI=(t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r);var pb=(t,e)=>{let r=Rv(e),s=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,i=oe(t._def,s===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,s]},!1)??{},n=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;n!==void 0&&(i.title=n);let a=(()=>{if(Sv(r.definitions))return;let c={},l=new Set;for(let u=0;u<500;u++){let p=Object.entries(r.definitions).filter(([g])=>!l.has(g));if(p.length===0)break;for(let[g,f]of p)c[g]=oe(jn(f),{...r,currentPath:[...r.basePath,r.definitionPath,g]},!0)??{},l.add(g)}return c})(),o=s===void 0?a?{...i,[r.definitionPath]:a}:i:r.nameStrategy==="duplicate-ref"?{...i,...a||r.seenRefs.size?{[r.definitionPath]:{...a,...r.seenRefs.size?{[s]:i}:void 0}}:void 0}:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,s].join("/"),[r.definitionPath]:{...a,[s]:i}};return r.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":r.target==="jsonSchema2019-09"&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),o};function LI(t,e){return pb(t,{openaiStrictMode:!0,name:e.name,nameStrategy:"duplicate-ref",$refStrategy:"extract-to-root",nullableStrategy:"property"})}function $r(t){return _v({type:"function",function:{name:t.name,parameters:LI(t.parameters,{name:t.name}),strict:!0,...t.description?{description:t.description}:void 0}},{callback:t.function,parser:e=>t.parameters.parse(JSON.parse(e))})}var mb=Be.object({target_file:Be.string().describe("Path to the file to read, relative to the workspace root"),offset:Be.preprocess(t=>String(t),Be.string()).optional().describe("The line number to start reading from. Defaults to 1 (first line)."),limit:Be.preprocess(t=>String(t),Be.string()).optional().describe("The number of lines to read. Defaults to 200 lines if not specified. Max is 500.")}),gb=Be.object({pattern:Be.string().describe("The regular expression pattern to search for in file contents"),path:Be.string().optional().describe("The directory to search in, relative to the workspace root. Defaults to the current working directory."),include:Be.string().optional().describe('File pattern to include in the search (e.g. "*.js", "*.{ts,tsx}")')}),$I=Be.object({relative_workspace_path:Be.string().describe("Path to list contents of, relative to the workspace root")}),yb=Be.object({pattern:Be.string().describe("The glob pattern to match files against"),path:Be.string().optional().describe("The directory to search in. Defaults to the current working directory.")}),f4=$r({name:"read_file",description:"Reads a file from the local filesystem. The file_path parameter must be an absolute path, not a relative path. By default, it reads up to 200 lines starting from the beginning of the file. You can optionally specify a line offset and limit (especially handy for long files), but it's recommended to read the whole file by not providing these parameters. Any lines longer than 200 characters will be truncated. ",parameters:mb}),h4=$r({name:"grep_search",description:`Fast text-based regex search that finds exact pattern matches within files or directories, utilizing the ripgrep command for efficient searching.
|
|
65
|
+
Results will be formatted in the style of ripgrep.
|
|
66
|
+
To avoid overwhelming output, the results are capped at 50 matches.
|
|
67
|
+
Use the include or exclude patterns to filter the search scope by file type or specific paths.
|
|
68
|
+
|
|
69
|
+
This is best for finding exact text matches or regex patterns.
|
|
70
|
+
You can use this when we know the exact symbol/function name/etc. to search in some set of directories/file types.`,parameters:gb}),d4=$r({name:"list_dir",description:"Lists files and directories in a given path. The relative_workspace_path parameter must be relative to the workspace root. You should generally prefer the Glob and Grep tools, if you know which directories to search.",parameters:$I}),p4=$r({name:"glob_search",description:'Fast file pattern matching tool that works with any codebase size. Supports glob patterns like "**/*.js" or "src/**/*.ts". Returns matching file paths sorted by modification time. Use this tool when you need to find files by name patterns.',parameters:yb}),vb=$r({name:"read",description:"Reads a file from the local filesystem. The file_path parameter must be an absolute path, not a relative path. By default, it reads up to 200 lines starting from the beginning of the file. You can optionally specify a line offset and limit (especially handy for long files), but it's recommended to read the whole file by not providing these parameters. Any lines longer than 200 characters will be truncated. ",parameters:mb}),bb=$r({name:"grep",description:`Fast text-based regex search that finds exact pattern matches within files or directories, utilizing the ripgrep command for efficient searching.
|
|
71
|
+
Results will be formatted in the style of ripgrep.
|
|
72
|
+
To avoid overwhelming output, the results are capped at 50 matches.
|
|
73
|
+
Use the include or exclude patterns to filter the search scope by file type or specific paths.
|
|
74
|
+
|
|
75
|
+
This is best for finding exact text matches or regex patterns.
|
|
76
|
+
You can use this when we know the exact symbol/function name/etc. to search in some set of directories/file types.`,parameters:gb}),_b=$r({name:"glob",description:'Fast file pattern matching tool that works with any codebase size. Supports glob patterns like "**/*.js" or "src/**/*.ts". Returns matching file paths sorted by modification time. Use this tool when you need to find files by name patterns.',parameters:yb});function wb(t,e,r){try{let s=r.find(n=>n.function.name===t);return s?{success:!0,data:s.$parseRaw(e)}:{success:!1,error:`Unknown tool: ${t}. Available tools: ${r.map(n=>n.function.name).join(", ")}`}}catch(s){if(s instanceof Be.ZodError){let i=s.errors.map(n=>`${n.path.join(".")}: ${n.message}`).join(", ");return{success:!1,error:`JSON Validation error for tool '${t}': ${i}`}}return{success:!1,error:`Failed to parse parameters for tool '${t}': ${s}`}}}import{existsSync as PI}from"fs";import{dirname as II,join as za}from"path";import{fileURLToPath as kI}from"url";var NI=kI(import.meta.url),qa=II(NI);function xb(){let t=process.platform,e=process.arch,r;if(t==="linux"&&e==="x64")r="x64-linux";else if(t==="linux"&&e==="arm64")r="arm64-linux";else if(t==="darwin"&&e==="x64")r="x64-darwin";else if(t==="darwin"&&e==="arm64")r="arm64-darwin";else if(t==="win32"&&e==="x64")r="x64-win32";else throw new Error(`Unsupported platform: ${t}-${e}. Supported platforms: x64-linux, arm64-linux, x64-darwin, arm64-darwin, x64-win32`);let s=t==="win32"?"rg.exe":"rg",i=[za(qa,"powerlint/dist/vendor/ripgrep",r,s),za(qa,"../../dist/vendor/ripgrep",r,s),za(qa,"../vendor/ripgrep",r,s),za(qa,"./vendor/ripgrep",r,s)];for(let n of i)if(PI(n))return n;throw new Error(`Bundled ripgrep binary not found for platform ${r}. Tried paths:
|
|
77
|
+
${i.join(`
|
|
78
|
+
`)}`)}import{readFile as DI}from"fs/promises";import FI from"path";async function Xu(t,e,r,s=!1){let i=FI.resolve(t,e),a=(await DI(i,"utf-8")).split(`
|
|
79
|
+
`),{start:o,end:c}=r,l=o.line-1,u=c.line-1;if(o.line===c.line){let g=a[l]||"";return s?g.substring(o.column-1,c.column-1):g}let p=[];for(let g=l;g<=u&&g<a.length;g++){let f=a[g];g===l?p.push(s?f.substring(o.column-1):f):g===u?p.push(s?f.substring(0,c.column-1):f):p.push(f)}return p.join(`
|
|
80
|
+
`)}var MI=xb(),jI={read:vb,grep:bb,glob:_b},Wa=class{environment;eventEmitter;config;maxIterations;constructor(e,r,s,i){this.environment=r,this.eventEmitter=s||new xt,this.config=e,this.maxIterations=i||20}async executeTool(e,r,s,i){let n=jI[r];if(!n)return{error:`Unknown tool: ${r}. Available tools are: read, grep, glob`};let a=wb(r,s,[n]);if(!a.success)return{error:`Tool parameter validation failed: ${a.error}. Please fix the parameters and try again.`};let o=a.data;switch(r){case"read":{this.eventEmitter.llmToolExecution(e,"read",{file:o.target_file,offset:o.offset,limit:o.limit});let c=await fv(o,this.environment.getWorkspaceRoot());if(!("error"in c)){let l=o.target_file;i.some(u=>u.path===l)||i.push({path:l,sha:c.sha})}return"error"in c?c:c.content}case"grep":{this.eventEmitter.llmToolExecution(e,"grep",{path:o.path,pattern:o.pattern});let c=await hv(o,this.environment.getWorkspaceRoot(),[],MI);if(!("error"in c))for(let l of c.matches)i.some(u=>u.path===l.file)||i.push({path:l.file,sha:l.sha});return"error"in c?c:JSON.stringify(c.matches)}case"glob":{this.eventEmitter.llmToolExecution(e,"glob",{path:o.path,pattern:o.pattern});let c=await dv(o,this.environment.getWorkspaceRoot());return"error"in c?c:JSON.stringify(c.files)}default:return{error:`Unknown tool: ${r}`}}}async hydrateMatchesWithFileContent(e){let r=[];for(let s of e){let i=await Xu(this.environment.getWorkspaceRoot(),s.file.path,s.range),n=s.evidence;if(s.evidence&&s.evidence.length>0){n=[];for(let a of s.evidence){let o=await Xu(this.environment.getWorkspaceRoot(),a.file.path,a.range);n.push({...a,text:o})}}r.push({...s,text:i,evidence:n})}return r}async executeLLMValidation(e,r,s){let i=Date.now(),n=this.config.getLLMProvider();this.eventEmitter.startLLMValidation(e.id,r.length);let a=[],o=[],c=new lt(0),l=new lt(0),u=new lt(0);this.eventEmitter.startLLMSearchPhase(e.id,r.length);let p,g=[];for(let _=0;_<this.maxIterations;_++){let w=await n.search({rule:e,matches:r,tools:s,messages:a,files:o});if(w.usage&&(c=c.plus(new lt(w.usage.inputTokens)),l=l.plus(new lt(w.usage.outputTokens)),u=u.plus(new lt(w.usage.cost))),w.type==="partial_matches"){let h=await this.hydrateMatchesWithFileContent(w.matches);g=[...g,...h],r=w.unresolved;continue}if(w.type==="matches"){let h=await this.hydrateMatchesWithFileContent(w.matches);p={...w,matches:[...g,...h]};break}if(w.type==="request_files"){for(let h of w.files)o.some(b=>b.path===h.path)||o.push({path:h.path,sha:h.sha});continue}if(w.type==="assistant"){a.push({type:"assistant",content:w.content}),a.push({type:"user",content:"Please use tool calls to interact with the codebase and report violations."});continue}if(w.type==="tool_request"){a.push({type:"tool_request",tool_calls:w.tool_calls});let h=await Promise.all(w.tool_calls.map(async b=>{let x=await this.executeTool(e.id,b.function.name,b.function.arguments,o),E=typeof x=="string"?x:JSON.stringify(x);return{tool_call_id:b.id,content:E}}));a.push({type:"tool_response",tool_results:h});continue}}if(!p)throw new Error(`Max iterations (${this.maxIterations}) reached without getting matches`);let f=p.matches;if(f.length===0){let _=c.plus(l).toNumber();return this.eventEmitter.completeLLMValidation(e.id,_,c.toNumber(),l.toNumber(),u.toString(),Date.now()-i,0,!1),{matches:[],executionTime:Date.now()-i}}this.eventEmitter.startLLMValidationPhase(e.id,f.length);let d=[],m=f;for(;m.length>0;){let _=await n.validate({rule:e,matches:m,files:o});if(_.usage&&(c=c.plus(new lt(_.usage.inputTokens)),l=l.plus(new lt(_.usage.outputTokens)),u=u.plus(new lt(_.usage.cost))),_.type==="partial_matches"){let w=await this.hydrateMatchesWithFileContent(_.matches);d=[...d,...w],console.log("partial matches",JSON.stringify(_,null,2)),m=_.unresolved;continue}if(_.type==="matches"){let w=await this.hydrateMatchesWithFileContent(_.matches);d=[...d,...w];break}}let y=d,v=c.plus(l).toNumber();return this.eventEmitter.completeLLMValidation(e.id,v,c.toNumber(),l.toNumber(),u.toString(),Date.now()-i,y.length,!1),{matches:y,executionTime:Date.now()-i}}async execute(e,r,s){return r.length===0?{matches:[],executionTime:0}:await this.executeLLMValidation(e,r,s)}};var Va=class{fileFilterStep;findMatchesStep;gotoDefinitionStep;llmStep;environment;executionContext;currentMode;eventEmitter;config;constructor(e,r,s){this.environment=r,this.eventEmitter=s||new xt,this.config=e,this.fileFilterStep=new Aa(this.environment),this.findMatchesStep=new Ia(this.environment,this.eventEmitter),this.gotoDefinitionStep=new ka(this.environment,this.eventEmitter),this.llmStep=new Wa(this.config,this.environment,this.eventEmitter)}async executeStep(e,r,s,i,n,a,o){let c=s.type;if(c==="ast-grep"){let{type:l,language:u,...p}=s;return{matches:(await this.findMatchesStep.execute(p,u,{filePaths:i,previousMatches:n})).matches}}if(c==="ripgrep"){let{type:l,...u}=s;return{matches:(await this.findMatchesStep.execute(u,"Unknown",{filePaths:i,previousMatches:n})).matches}}if(c==="step-group"){let l=[];for(let u=0;u<s.steps.length;u++){let p=s.steps[u],g=`${r}[${u}]`;this.eventEmitter.startStep(e.id,g,p.type,{filePaths:i,matches:n},r);let f=Date.now(),d=await this.executeStep(e,g,p,i,n,a,r),m=Date.now()-f;this.eventEmitter.completeStep(e.id,g,p.type,{filePaths:d.filePaths??[],matches:d.matches??[]},m,r),d.matches&&(l=l.concat(d.matches))}return{matches:l}}if(c==="file-filter")return{filePaths:(await this.fileFilterStep.execute(i,{include:s.include,ignore:s.ignore,conditions:s.conditions})).filteredPaths};if(c==="goto-definition")throw new Error("goto-definition step is disabled");if(c==="llm")return n.length===0?{matches:[]}:{matches:(await this.llmStep.execute(e,n,s.tools??[])).matches};throw new Error(`Unknown step type: ${c}`)}async executeRule(e,r){let s=e.id,i=e.config,n=[...this.executionContext.filePaths],a=[];for(let c of i.steps){let l=c.id,u=c.step;this.eventEmitter.startStep(s,l,u.type,{filePaths:n,matches:a});let p=Date.now(),g=await this.executeStep(e,l,u,n,a,r),f=Date.now()-p;if(this.eventEmitter.completeStep(s,l,u.type,{filePaths:g.filePaths??[],matches:g.matches??[]},f),g.filePaths!==void 0&&(n=this.executionContext.filterFiles(g.filePaths),a=this.executionContext.filterMatchesByFilePaths(a,n)),g.matches!==void 0&&(a=this.executionContext.filterMatches(g.matches)),n.length===0)break}let o=a.sort((c,l)=>c.file.path.localeCompare(l.file.path));return{ruleId:s,matches:o}}getPoolSize(){let e=BI().length;return Math.max(2,Math.min(8,e))}async execute(e,r){if(this.currentMode&&this.currentMode!==r.mode)throw new Error(`Execution mode mismatch: expected ${this.currentMode}, got ${r.mode}`);(!this.executionContext||this.currentMode!==r.mode)&&(this.executionContext=await Ra.initialize(this.config,this.environment,r.mode,this.eventEmitter,r.filePath,r.diffOptions),this.currentMode=r.mode),this.eventEmitter.startRules(e.length);let s=this.getPoolSize(),i=[],n=[...e],a=async u=>{let p=u.id,g=!1;for(let d of u.config.steps)if(d.step.type==="llm"){g=!0;break}this.eventEmitter.emit("rules:rule-start",{ruleId:p,isLlm:g,message:u.config.message,severity:u.config.severity});let f=await this.executeRule(u,r);return this.eventEmitter.emit("rules:rule-complete",{ruleId:p,matches:f.matches}),f};await(async()=>{let u=async()=>{if(n.length===0)return;let g=n.shift(),f=await a(g);i.push(f),await u()},p=[];for(let g=0;g<Math.min(s,e.length);g++)p.push(u());await Promise.all(p)})();let c=new Map(e.map((u,p)=>[u.id,p]));i.sort((u,p)=>{let g=c.get(u.ruleId)??0,f=c.get(p.ruleId)??0;return g-f});let l=i.reduce((u,p)=>u+p.matches.length,0);return this.eventEmitter.completeRules(e.length,l),i}};import{stripVTControlCharacters as Bb}from"node:util";import Qa from"node:process";import Ob from"node:process";import Ya from"node:process";var UI=(t,e,r,s)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let i=Object.getOwnPropertyDescriptor(t,r),n=Object.getOwnPropertyDescriptor(e,r);!GI(i,n)&&s||Object.defineProperty(t,r,n)},GI=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},zI=(t,e)=>{let r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},qI=(t,e)=>`/* Wrapped ${t}*/
|
|
81
|
+
${e}`,WI=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),VI=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),ZI=(t,e,r)=>{let s=r===""?"":`with ${r.trim()}() `,i=qI.bind(null,s,e.toString());Object.defineProperty(i,"name",VI);let{writable:n,enumerable:a,configurable:o}=WI;Object.defineProperty(t,"toString",{value:i,writable:n,enumerable:a,configurable:o})};function Qu(t,e,{ignoreNonConfigurable:r=!1}={}){let{name:s}=t;for(let i of Reflect.ownKeys(e))UI(t,e,i,r);return zI(t,e),ZI(t,e,s),t}var Za=new WeakMap,Eb=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,s=0,i=t.displayName||t.name||"<anonymous>",n=function(...a){if(Za.set(n,++s),s===1)r=t.apply(this,a),t=void 0;else if(e.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return r};return Qu(n,t),Za.set(n,s),n};Eb.callCount=t=>{if(!Za.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return Za.get(t)};var Sb=Eb;var ks=[];ks.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&ks.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ks.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Ha=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",ef=Symbol.for("signal-exit emitter"),tf=globalThis,HI=Object.defineProperty.bind(Object),rf=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(tf[ef])return tf[ef];HI(tf,ef,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let s=this.listeners[e],i=s.indexOf(r);i!==-1&&(i===0&&s.length===1?s.length=0:s.splice(i,1))}emit(e,r,s){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let n of this.listeners[e])i=n(r,s)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,s)||i),i}},Ka=class{},KI=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),sf=class extends Ka{onExit(){return()=>{}}load(){}unload(){}},nf=class extends Ka{#t=of.platform==="win32"?"SIGINT":"SIGHUP";#r=new rf;#e;#n;#f;#_={};#a=!1;constructor(e){super(),this.#e=e,this.#_={};for(let r of ks)this.#_[r]=()=>{let s=this.#e.listeners(r),{count:i}=this.#r,n=e;if(typeof n.__signal_exit_emitter__=="object"&&typeof n.__signal_exit_emitter__.count=="number"&&(i+=n.__signal_exit_emitter__.count),s.length===i){this.unload();let a=this.#r.emit("exit",null,r),o=r==="SIGHUP"?this.#t:r;a||e.kill(e.pid,o)}};this.#f=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!Ha(this.#e))return()=>{};this.#a===!1&&this.load();let s=r?.alwaysLast?"afterExit":"exit";return this.#r.on(s,e),()=>{this.#r.removeListener(s,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#a){this.#a=!0,this.#r.count+=1;for(let e of ks)try{let r=this.#_[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#i(e,...r),this.#e.reallyExit=e=>this.#u(e)}}unload(){this.#a&&(this.#a=!1,ks.forEach(e=>{let r=this.#_[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#f,this.#r.count-=1)}#u(e){return Ha(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#f.call(this.#e,this.#e.exitCode)):0}#i(e,...r){let s=this.#n;if(e==="exit"&&Ha(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let i=s.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),i}else return s.call(this.#e,e,...r)}},of=globalThis.process,{onExit:Rb,load:H4,unload:K4}=KI(Ha(of)?new nf(of):new sf);var Ab=Ya.stderr.isTTY?Ya.stderr:Ya.stdout.isTTY?Ya.stdout:void 0,YI=Ab?Sb(()=>{Rb(()=>{Ab.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},Cb=YI;var Ja=!1,Fi={};Fi.show=(t=Ob.stderr)=>{t.isTTY&&(Ja=!1,t.write("\x1B[?25h"))};Fi.hide=(t=Ob.stderr)=>{t.isTTY&&(Cb(),Ja=!0,t.write("\x1B[?25l"))};Fi.toggle=(t,e)=>{t!==void 0&&(Ja=t),Ja?Fi.show(e):Fi.hide(e)};var af=Fi;var cf={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots14:{interval:80,frames:["\u2809\u2809","\u2808\u2819","\u2800\u2839","\u2800\u28B8","\u2800\u28F0","\u2880\u28E0","\u28C0\u28C0","\u28C4\u2840","\u28C6\u2800","\u2847\u2800","\u280F\u2800","\u280B\u2801"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},dotsCircle:{interval:80,frames:["\u288E ","\u280E\u2801","\u280A\u2811","\u2808\u2831"," \u2871","\u2880\u2870","\u2884\u2860","\u2886\u2840"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u{1F497} "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}};var Vn=cf,oB=Object.keys(cf);var Ns={};rc(Ns,{error:()=>s2,info:()=>e2,success:()=>t2,warning:()=>r2});import XI from"node:tty";var QI=XI?.WriteStream?.prototype?.hasColors?.()??!1,me=(t,e)=>{if(!QI)return i=>i;let r=`\x1B[${t}m`,s=`\x1B[${e}m`;return i=>{let n=i+"",a=n.indexOf(s);if(a===-1)return r+n+s;let o=r,c=0;for(;a!==-1;)o+=n.slice(c,a)+r,c=a+s.length,a=n.indexOf(s,c);return o+=n.slice(c)+s,o}},lB=me(0,0),uB=me(1,22),fB=me(2,22),hB=me(3,23),dB=me(4,24),pB=me(53,55),mB=me(7,27),gB=me(8,28),yB=me(9,29),vB=me(30,39),Tb=me(31,39),Lb=me(32,39),$b=me(33,39),Pb=me(34,39),bB=me(35,39),_B=me(36,39),wB=me(37,39),xB=me(90,39),EB=me(40,49),SB=me(41,49),RB=me(42,49),AB=me(43,49),CB=me(44,49),OB=me(45,49),TB=me(46,49),LB=me(47,49),$B=me(100,49),PB=me(91,39),IB=me(92,39),kB=me(93,39),NB=me(94,39),DB=me(95,39),FB=me(96,39),MB=me(97,39),jB=me(101,49),BB=me(102,49),UB=me(103,49),GB=me(104,49),zB=me(105,49),qB=me(106,49),WB=me(107,49);import Ib from"node:process";function Zn(){let{env:t}=Ib,{TERM:e,TERM_PROGRAM:r}=t;return Ib.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Xa=Zn(),e2=Pb(Xa?"\u2139":"i"),t2=Lb(Xa?"\u2714":"\u221A"),r2=$b(Xa?"\u26A0":"\u203C"),s2=Tb(Xa?"\u2716":"\xD7");function lf({onlyFirst:t=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,t?void 0:"g")}var i2=lf();function Hn(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(i2,"")}function kb(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function Nb(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function Db(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101631&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129673||t>=129679&&t<=129734||t>=129742&&t<=129756||t>=129759&&t<=129769||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function n2(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function uf(t,{ambiguousAsWide:e=!1}={}){return n2(t),Nb(t)||Db(t)||e&&kb(t)?2:1}var o2=new Intl.Segmenter,a2=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark}|\\p{Surrogate})+$","v"),c2=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+","v"),l2=new RegExp("^\\p{RGI_Emoji}$","v");function u2(t){return t.replace(c2,"")}function f2(t){return a2.test(t)}function h2(t,e){let r=0;if(t.length>1)for(let s of t.slice(1))s>="\uFF00"&&s<="\uFFEF"&&(r+=uf(s.codePointAt(0),e));return r}function ff(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:s=!1}=e,i=t;if(s||(i=Hn(i)),i.length===0)return 0;let n=0,a={ambiguousAsWide:!r};for(let{segment:o}of o2.segment(i)){if(f2(o))continue;if(l2.test(o)){n+=2;continue}let c=u2(o).codePointAt(0);n+=uf(c,a),n+=h2(o,a)}return n}function hf({stream:t=process.stdout}={}){return!!(t&&t.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import Yt from"node:process";var d2=3,df=class{#t=0;start(){this.#t++,this.#t===1&&this.#r()}stop(){if(this.#t<=0)throw new Error("`stop` called more times than `start`");this.#t--,this.#t===0&&this.#e()}#r(){Yt.platform==="win32"||!Yt.stdin.isTTY||(Yt.stdin.setRawMode(!0),Yt.stdin.on("data",this.#n),Yt.stdin.resume())}#e(){Yt.stdin.isTTY&&(Yt.stdin.off("data",this.#n),Yt.stdin.pause(),Yt.stdin.setRawMode(!1))}#n(e){e[0]===d2&&Yt.emit("SIGINT")}},p2=new df,pf=p2;var mf=class{#t=0;#r=!1;#e=0;#n=-1;#f=0;#_=0;#a;#u;#i;#c;#s;#l;#o;#p;#g;#y;#d;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#a={color:"cyan",stream:Qa.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#a.color,this.spinner=this.#a.spinner,this.#s=this.#a.interval,this.#i=this.#a.stream,this.#l=typeof this.#a.isEnabled=="boolean"?this.#a.isEnabled:hf({stream:this.#i}),this.#o=typeof this.#a.isSilent=="boolean"?this.#a.isSilent:!1,this.text=this.#a.text,this.prefixText=this.#a.prefixText,this.suffixText=this.#a.suffixText,this.indent=this.#a.indent,Qa.env.NODE_ENV==="test"&&(this._stream=this.#i,this._isEnabled=this.#l,Object.defineProperty(this,"_linesToClear",{get(){return this.#t},set(r){this.#t=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#n}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}}))}get indent(){return this.#p}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#p=e,this.#S()}get interval(){return this.#s??this.#u.interval??100}get spinner(){return this.#u}set spinner(e){if(this.#n=-1,this.#s=void 0,typeof e=="object"){if(!Array.isArray(e.frames)||e.frames.length===0||e.frames.some(r=>typeof r!="string"))throw new Error("The given spinner must have a non-empty `frames` array of strings");if(e.interval!==void 0&&!(Number.isInteger(e.interval)&&e.interval>0))throw new Error("`spinner.interval` must be a positive integer if provided");this.#u=e}else if(!Zn())this.#u=Vn.line;else if(e===void 0)this.#u=Vn.dots;else if(e!=="default"&&Vn[e])this.#u=Vn[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#g}set text(e=""){this.#g=e,this.#S()}get prefixText(){return this.#y}set prefixText(e=""){this.#y=e,this.#S()}get suffixText(){return this.#d}set suffixText(e=""){this.#d=e,this.#S()}get isSpinning(){return this.#c!==void 0}#A(e,r,s=!1){let i=typeof e=="function"?e():e;return typeof i=="string"&&i!==""?s?r+i:i+r:""}#w(e=this.#y,r=" "){return this.#A(e,r,!1)}#x(e=this.#d,r=" "){return this.#A(e,r,!0)}#E(e,r){let s=0;for(let i of Hn(e).split(`
|
|
82
|
+
`))s+=Math.max(1,Math.ceil(ff(i)/r));return s}#S(){let e=this.#i.columns??80,r=typeof this.#y=="function"?"":this.#y,s=typeof this.#d=="function"?"":this.#d,i=typeof r=="string"&&r!==""?r+" ":"",n=typeof s=="string"&&s!==""?" "+s:"",o=" ".repeat(this.#p)+i+"-"+(typeof this.#g=="string"?" "+this.#g:"")+n;this.#e=this.#E(o,e)}get isEnabled(){return this.#l&&!this.#o}set isEnabled(e){if(typeof e!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#l=e}get isSilent(){return this.#o}set isSilent(e){if(typeof e!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#o=e}frame(){let e=Date.now();(this.#n===-1||e-this.#f>=this.interval)&&(this.#n=++this.#n%this.#u.frames.length,this.#f=e);let{frames:r}=this.#u,s=r[this.#n];this.color&&(s=S[this.color](s));let i=this.#w(this.#y," "),n=typeof this.text=="string"?" "+this.text:"",a=this.#x(this.#d," ");return i+s+n+a}clear(){if(!this.#l||!this.#i.isTTY)return this;this.#i.cursorTo(0);for(let e=0;e<this.#t;e++)e>0&&this.#i.moveCursor(0,-1),this.#i.clearLine(1);return(this.#p||this.#_!==this.#p)&&this.#i.cursorTo(this.#p),this.#_=this.#p,this.#t=0,this}render(){if(!this.#l||this.#o)return this;this.clear();let e=this.frame(),r=this.#i.columns??80,s=this.#E(e,r),i=this.#i.rows;if(i&&i>1&&s>i){let n=e.split(`
|
|
83
|
+
`),a=i-1;e=[...n.slice(0,a),"... (content truncated to fit terminal)"].join(`
|
|
84
|
+
`)}return this.#i.write(e),this.#t=this.#E(e,r),this}start(e){if(e&&(this.text=e),this.#o)return this;if(!this.#l){let r=" ".repeat(this.#p)+this.#w(this.#y," ")+(this.text?`- ${this.text}`:"")+this.#x(this.#d," ");return r.trim()!==""&&this.#i.write(r+`
|
|
85
|
+
`),this}return this.isSpinning?this:(this.#a.hideCursor&&af.hide(this.#i),this.#a.discardStdin&&Qa.stdin.isTTY&&(this.#r=!0,pf.start()),this.render(),this.#c=setInterval(this.render.bind(this),this.interval),this)}stop(){return clearInterval(this.#c),this.#c=void 0,this.#n=0,this.#l&&(this.clear(),this.#a.hideCursor&&af.show(this.#i)),this.#a.discardStdin&&Qa.stdin.isTTY&&this.#r&&(pf.stop(),this.#r=!1),this}succeed(e){return this.stopAndPersist({symbol:Ns.success,text:e})}fail(e){return this.stopAndPersist({symbol:Ns.error,text:e})}warn(e){return this.stopAndPersist({symbol:Ns.warning,text:e})}info(e){return this.stopAndPersist({symbol:Ns.info,text:e})}stopAndPersist(e={}){if(this.#o)return this;let r=e.prefixText??this.#y,s=this.#w(r," "),i=e.symbol??" ",n=e.text??this.text,o=typeof n=="string"?(i?" ":"")+n:"",c=e.suffixText??this.#d,l=this.#x(c," "),u=s+i+o+l+`
|
|
86
|
+
`;return this.stop(),this.#i.write(u),this}};function Kn(t){return new mf(t)}var Pr="#f87171",Ir="#60a5fa",m2="#9b59b6",Te="#fbbf24",gf="#9ca3af",Jn="#9b59b6",ec="\u25A0",Yn="\u25CF",Xn="\u2B25";function g2(t,e){if(e){let r=`https://app.wispbit.com/rules/${e}`;return S.dim(`\x1B]8;;${r}\x1B\\${t}\x1B]8;;\x1B\\`)}return S.dim(t)}function Ub(t,e){return t.length<=e?t:t.substring(0,e-3)+"..."}var Fb="#f8f8f8",Mb="#888888",y2=[S.hex(Te)("~(oo)~"),S.hex(Te)("~(oO)~"),S.hex(Te)("~(Oo)~"),S.hex(Te)("~(OO)~"),S.hex(Te)("~(\u25CFo)~"),S.hex(Te)("~(o\u25CF)~"),S.hex(Te)("~(\u25C9o)~"),S.hex(Te)("~(o\u25C9)~"),S.hex(Te)("\\(oo)/"),S.hex(Te)("\\(oO)/"),S.hex(Te)("\\(Oo)/"),S.hex(Te)("\\(OO)/"),S.hex(Te)("~(Oo)~"),S.hex(Te)("~(oO)~"),S.hex(Te)("~(\u25CEo)~"),S.hex(Te)("~(o\u25CE)~"),S.hex(Te)("~(oo)~"),S.hex(Te)("~(OO)~"),S.hex(Te)("~(Oo)~"),S.hex(Te)("\\(oo)/"),S.hex(Te)("\\(oO)/"),S.hex(Te)("\\(Oo)/"),S.hex(Te)("\\(OO)/")];function jb(t,e){return e===1?t:`${t}s`}function v2(t,e={}){let s=e.align||[],i=e.stringLength||(a=>Bb(a).length),n=t.reduce((a,o)=>(o.forEach((c,l)=>{let u=i(c);(!a[l]||u>a[l])&&(a[l]=u)}),a),[]);return t.map(a=>a.map((o,c)=>{let l=n[c]-i(o)||0,u=Array(Math.max(l+1,1)).join(" ");return s[c]==="r"?u+o:o+u}).join(" ").trimEnd()).join(`
|
|
87
|
+
`)}function Gb(t,e){let r=`
|
|
88
|
+
`,s=0,i=0,n=new Map;t.forEach(d=>{if(d.matches.length===0)return;let m=d.ruleId||"unknown";n.has(m)||n.set(m,{message:d.message,severity:d.severity,internalId:d.internalId,execution:d.execution,matches:[]});let y=n.get(m);d.matches.forEach(v=>{y.matches.push({file:{path:v.file.path,sha:v.file.sha},line:v.range.start.line,column:v.range.start.column,endLine:v.range.end.line!==v.range.start.line?v.range.end.line:void 0,text:v.text,description:v.description,evidence:v.evidence?.map(_=>({file:{path:_.file.path,sha:_.file.sha},text:_.text,range:_.range,description:_.description}))}),d.severity==="violation"?s++:i++})}),n.forEach((d,m)=>{if(d.matches.length===0&&d.severity!=="skipped")return;let y;d.severity==="violation"?y=S.hex(Pr)(ec):d.severity==="suggestion"?y=S.hex(Ir)(Yn):y=S.hex(m2)(Yn);let v=d.execution==="llm"?`${S.hex(Jn)(Xn)} `:"",_;if(d.internalId){let h=`https://app.wispbit.com/rules/${d.internalId}`;_=S.bold(`\x1B]8;;${h}\x1B\\${m}\x1B]8;;\x1B\\`)}else _=S.bold(m);let w=`${y} ${v}${_} ${d.message.replace(/([^ ])\.$/u,"$1")}`;if(r+=`${w}
|
|
73
89
|
`,r+=`${S.dim("\u2500".repeat(80))}
|
|
74
|
-
`,
|
|
75
|
-
`;else{let
|
|
76
|
-
`,
|
|
77
|
-
`).forEach((
|
|
78
|
-
`})}else{let
|
|
79
|
-
`}
|
|
80
|
-
`,
|
|
81
|
-
`).forEach((
|
|
82
|
-
`})}else{let
|
|
83
|
-
`}}),
|
|
90
|
+
`,d.severity==="skipped")r+=`
|
|
91
|
+
`;else{let h=d.matches.sort((b,x)=>b.file.path.localeCompare(x.file.path));h.forEach((b,x)=>{if(b.text){let E=b.description?` - ${S.dim(b.description)}`:"";r+=` ${b.file.path}${E}
|
|
92
|
+
`,b.text.split(`
|
|
93
|
+
`).forEach((A,O)=>{let k=b.line+O,z=S.bgHex(Fb).hex(Mb)(` ${String(k)} `);r+=` ${z} ${S.dim(A)}
|
|
94
|
+
`})}else{let E=b.endLine?`(${b.line}:${b.endLine})`:`(${b.line})`,L=b.description?` - ${S.dim(b.description)}`:"";r+=` ${b.file.path} ${S.dim(E)}${L}
|
|
95
|
+
`}b.evidence&&b.evidence.length>0&&b.evidence.forEach(E=>{if(E.text){let L=E.description?` - ${S.dim(E.description)}`:"";r+=` ${E.file.path}${L}
|
|
96
|
+
`,E.text.split(`
|
|
97
|
+
`).forEach((O,k)=>{let z=E.range.start.line+k,P=S.bgHex(Fb).hex(Mb)(` ${String(z)} `);r+=` ${P} ${S.dim(O)}
|
|
98
|
+
`})}else{let L=`${E.range.start.line}:${E.range.end.line}`,A=E.description?` - ${S.dim(E.description)}`:"";r+=` ${E.file.path} ${S.dim(`(${L})`)}${A}
|
|
99
|
+
`}}),x<h.length-1&&(r+=`
|
|
84
100
|
`)}),r+=`
|
|
85
101
|
|
|
86
|
-
`}}),console.log(r);let a=i
|
|
87
|
-
`,
|
|
88
|
-
`,
|
|
89
|
-
`,console.log(a>0?S.reset(
|
|
102
|
+
`}}),console.log(r);let a=s+i,o=s>0?`${S.dim("violations".padStart(12))} ${S.hex(Pr)(ec)} ${S.hex(Pr).bold(s)}`:`${S.dim("violations".padStart(12))} ${S.dim(s)}`,c=i>0?`${S.dim("suggestions".padStart(12))} ${S.hex(Ir)(Yn)} ${S.hex(Ir).bold(i)}`:`${S.dim("suggestions".padStart(12))} ${S.dim(i)}`,l=e.totalFiles?`${e.totalFiles} ${jb("file",e.totalFiles)}`:"0 files",u=`${e.totalRules} ${jb("rule",e.totalRules)}`,p=e.executionTime?`${Math.round(e.executionTime)}ms`:"",g=[l,u,p].filter(Boolean).join(", "),f="";f+=`${o}
|
|
103
|
+
`,f+=`${c}
|
|
104
|
+
`,f+=`${S.dim("summary".padStart(12))} ${g}
|
|
105
|
+
`,console.log(a>0?S.reset(f):f),s>0&&process.exit(1)}function zb(t){if(t.length===0){console.log(S.yellow("No rules found.")),console.log(S.dim("Go to https://app.wispbit.com/rules to create a rule."));return}let e=[];e.push(["",`${"id".padEnd(12)} ${S.dim("\u2502")} ${"severity".padEnd(16)} ${S.dim("\u2502")} ${"execution".padEnd(18)} ${S.dim("\u2502")} message`]);let r=process.stdout.columns||120,i=Math.max(20,r-55-10);e.push(["",`${S.dim("\u2500".repeat(12))} ${S.dim("\u253C")} ${S.dim("\u2500".repeat(16))} ${S.dim("\u253C")} ${S.dim("\u2500".repeat(18))} ${S.dim("\u253C")} ${S.dim("\u2500".repeat(i))}`]);for(let a of t){let o=a.config.severity==="violation"?ec:Yn,c=a.config.severity==="violation"?S.hex(Pr).bold:S.hex(Ir).bold,u=(a.config.severity==="violation"?S.hex(Pr):S.hex(Ir))(o)+" "+c(a.config.severity),p=g2(a.id,a.internalId),g=a.config.execution==="llm"?S.hex(Jn)(Xn)+" "+S.hex(Jn)("llm"):S.hex(gf)(Xn)+" "+S.hex(gf)("deterministic"),f=Ub(a.config.message,i),d=Math.max(0,12-a.id.length),m=Math.max(0,16-(a.config.severity.length+2)),y=Math.max(0,18-(a.config.execution.length+2));e.push(["",`${p}${" ".repeat(d)} ${S.dim("\u2502")} ${u}${" ".repeat(m)} ${S.dim("\u2502")} ${g}${" ".repeat(y)} ${S.dim("\u2502")} ${f}`])}let n=v2(e,{align:["","l"],stringLength(a){return Bb(a).length}});console.log(`
|
|
90
106
|
`+n),console.log(S.dim(`
|
|
91
|
-
Use 'wispbit check --rule <rule-id>' to run a specific rule.`))}function
|
|
92
|
-
${O}`)}else if(m)if(m.toolName==="read"&&m.file){let O="";if(m.offset||m.limit){let
|
|
93
|
-
${
|
|
94
|
-
${
|
|
95
|
-
${
|
|
96
|
-
`).map((p,
|
|
107
|
+
Use 'wispbit check --rule <rule-id>' to run a specific rule.`))}function qb(t,e="pretty"){let r=[];for(let s of t)for(let i of s.matches){let n={file:i.file,range:i.range,language:i.language,text:i.text,evidence:i.evidence,ruleId:s.ruleId,internalId:s.internalId,severity:s.severity,message:s.message};r.push(n)}if(e==="stream")for(let s of r)console.log(JSON.stringify(s));else console.log(e==="compact"?JSON.stringify(r):JSON.stringify(r,null,2))}function Wb(t,e=!1){let r=null,s=null,i=null,n=new Map,a=()=>{if(!r)return;let o=[],c=process.stdout.columns||120;for(let[u,{isLlm:p,message:g,severity:f,dotAnimationFrame:d,toolInfo:m,searchPhase:y,validationPhase:v}]of n){if(m||v||y){let O=n.get(u);O.dotAnimationFrame=(O.dotAnimationFrame+1)%3}let _=d+1,w=S.hex(Te)(".".repeat(_).padEnd(3," ")),h=f==="violation"?S.hex(Pr)(ec):S.hex(Ir)(Yn),b=p?`${S.hex(Jn)(Xn)} ${S.hex(Jn)("llm")}`:S.hex(gf)(Xn),x=Math.max(40,c-50),E=Ub(g,x),L=`${h} ${b} ${S.dim(u)} ${E}`,A=y?` ${S.dim(`(${y.matchCount} ${y.matchCount===1?"match":"matches"})`)}`:"";if(v){let O=` ${w} ${S.dim(`validating ${v.matchCount} ${v.matchCount===1?"match":"matches"}`)}`;o.push(`${L}
|
|
108
|
+
${O}`)}else if(m)if(m.toolName==="read"&&m.file){let O="";if(m.offset||m.limit){let z=m.offset?parseInt(m.offset,10):1,P=m.limit?parseInt(m.limit,10):200,H=z+P-1;O=` ${S.dim(`(lines ${z}-${H})`)}`}let k=` ${w} ${S.dim("tool: read")} ${m.file}${O}${A}`;o.push(`${L}
|
|
109
|
+
${k}`)}else if(m.toolName==="grep"){let O=m.path||".",k=m.pattern||"",z=` ${w} ${S.dim("tool: grep")} ${O} ${S.dim(`for "${k}"`)}${A}`;o.push(`${L}
|
|
110
|
+
${z}`)}else if(m.toolName==="glob"){let O=m.path||".",k=m.pattern||"",z=` ${w} ${S.dim("tool: glob")} ${O} ${S.dim(`for "${k}"`)}${A}`;o.push(`${L}
|
|
111
|
+
${z}`)}else o.push(L);else if(y){let O=` ${w} ${S.dim("searching")}${A}`;o.push(`${L}
|
|
112
|
+
${O}`)}else o.push(L)}let l="";if(i&&(i.mode==="check"?l=i.filePath?` ${S.dim(`(${i.filePath})`)}`:"":i.mode==="diff"&&(l=` ${S.dim(`(${i.baseCommit} \u2192 ${i.headCommit})`)}`)),o.length>0){let u=o.map((p,g)=>g===0?p:p.split(`
|
|
113
|
+
`).map((d,m)=>m===0?` ${d}`:d).join(`
|
|
97
114
|
`));r.text=`${u.join(`
|
|
98
|
-
`)}${l}`}else r.text=`${l}`};return t.on("execution:mode",o=>{
|
|
99
|
-
${S.blue("Discovering files")} in ${S.bold(o.mode)} mode...`)}),t.on("files:discovery:progress",o=>{e&&console.log(` ${o.message}`)}),t.on("files:discovery:complete",o=>{e&&console.log(S.green("File discovery complete:"),`${o.totalFiles} files found (${o.executionTime}ms)`)}),t.on("files:filter",o=>{e&&o.originalCount!==o.filteredCount&&console.log(S.yellow("Filtered:"),`${o.originalCount} \u2192 ${o.filteredCount} ${o.filterType}`)}),t.on("indexing:start",o=>{
|
|
115
|
+
`)}${l}`}else r.text=`${l}`};return t.on("execution:mode",o=>{i=o}),t.on("rules:start",o=>{r=Kn({spinner:{interval:120,frames:y2},color:!1}).start();let c=()=>{r&&r.stopAndPersist(),process.exit(130)};process.on("SIGINT",c),process.on("SIGTERM",c);let l=setInterval(()=>{a()},200);r._updateInterval=l}),t.on("rules:rule-start",o=>{n.set(o.ruleId,{isLlm:o.isLlm,message:o.message,severity:o.severity,dotAnimationFrame:0}),a()}),t.on("rules:rule-complete",o=>{n.delete(o.ruleId),a()}),t.on("llm:tool-execution",o=>{let c=n.get(o.ruleId);c&&(c.toolInfo={toolName:o.toolName,file:o.file,path:o.path,pattern:o.pattern,offset:o.offset,limit:o.limit},a())}),t.on("llm:search-phase:start",o=>{let c=n.get(o.ruleId);c&&(c.searchPhase={matchCount:o.matchCount},a())}),t.on("llm:validation-phase:start",o=>{let c=n.get(o.ruleId);c&&(c.toolInfo=void 0,c.searchPhase=void 0,c.validationPhase={matchCount:o.matchCount},a())}),t.on("rules:progress",o=>{a()}),t.on("rules:complete",()=>{r&&(r._updateInterval&&clearInterval(r._updateInterval),r.stopAndPersist(),r=null),n.clear()}),t.on("files:discovery:start",o=>{e&&console.log(`
|
|
116
|
+
${S.blue("Discovering files")} in ${S.bold(o.mode)} mode...`)}),t.on("files:discovery:progress",o=>{e&&console.log(` ${o.message}`)}),t.on("files:discovery:complete",o=>{e&&console.log(S.green("File discovery complete:"),`${o.totalFiles} files found (${o.executionTime}ms)`)}),t.on("files:filter",o=>{e&&o.originalCount!==o.filteredCount&&console.log(S.yellow("Filtered:"),`${o.originalCount} \u2192 ${o.filteredCount} ${o.filterType}`)}),t.on("indexing:start",o=>{s=Date.now()}),t.on("indexing:progress",o=>{r&&(r.color="yellow"),s&&Date.now()-s>1e3&&r&&(r.text=`Indexing ${o.language}...`),r&&(o.packageName&&o.timeMs?r.text=`Indexing ${o.language}: ${o.packageName}`:o.message!=="Indexing files..."&&(r.text=`Indexing ${o.language}: ${o.message}`)),e&&(o.packageName&&o.timeMs?console.log(` + ${o.packageName} (${o.timeMs}ms)`):o.message==="Indexing files..."?process.stdout.write("."):o.message!=="Indexing files..."&&console.log(` ${o.message}`))}),t.on("indexing:complete",o=>{s=null,r&&(r.color="blue"),e&&(process.stdout.write(`
|
|
100
117
|
`),console.log(S.green("Indexing complete for"),`${o.language} (${o.executionTime}ms)`))}),e&&(t.on("scip:match-lookup:start",o=>{console.log(S.cyan(`
|
|
101
118
|
\u{1F50D} [${o.language}] Starting SCIP match lookup for: ${JSON.stringify(o.match)}`))}),t.on("scip:match-lookup:progress",o=>{console.log(`${JSON.stringify(o.document)}`)}),t.on("scip:match-lookup:complete",o=>{console.log(S.green(`SCIP match lookup complete for: ${o.language}`))}),t.on("step:start",o=>{console.log(S.cyan(`
|
|
102
|
-
\u{1F527} [${o.ruleId}] Starting step: ${o.stepName} (${o.stepType})`)),console.log(` Input files: ${o.inputs.filePaths.length}`),console.log(` Input matches: ${o.inputs.matches.length}`),o.inputs.matches.length>0&&(console.log(" Match details:"),o.inputs.matches.forEach((c,l)=>{console.log(` Match ${l+1}:`),console.log(` File: ${c.file.path}`),console.log(` Range: ${c.range.start.line}:${c.range.start.column} \u2192 ${c.range.end.line}:${c.range.end.column}`),c.evidence&&c.evidence.length>0&&(console.log(` Evidence chain: ${c.evidence.length} evidence(s)`),c.evidence.forEach((u,
|
|
103
|
-
\u{1F9EA} [${o.ruleId}] Running test: "${o.testName}"`))}),t.on("test:matches",o=>{console.log(S.magenta(` Found ${o.matches.length} match(es):`)),o.matches.forEach((c,l)=>{console.log(` Match ${l+1}:`),console.log(` File: ${c.file.path}`),console.log(` Range: ${c.range.start.line}:${c.range.start.column} \u2192 ${c.range.end.line}:${c.range.end.column}`),c.evidence&&c.evidence.length>0&&(console.log(` Evidence chain: ${c.evidence.length} evidence(s)`),c.evidence.forEach((u,
|
|
104
|
-
${S.hex(
|
|
105
|
-
${S.hex(
|
|
106
|
-
${S.hex(
|
|
107
|
-
${S.hex(
|
|
108
|
-
${S.hex(
|
|
109
|
-
${S.hex(
|
|
119
|
+
\u{1F527} [${o.ruleId}] Starting step: ${o.stepName} (${o.stepType})`)),console.log(` Input files: ${o.inputs.filePaths.length}`),console.log(` Input matches: ${o.inputs.matches.length}`),o.inputs.matches.length>0&&(console.log(" Match details:"),o.inputs.matches.forEach((c,l)=>{console.log(` Match ${l+1}:`),console.log(` File: ${c.file.path}`),console.log(` Range: ${c.range.start.line}:${c.range.start.column} \u2192 ${c.range.end.line}:${c.range.end.column}`),c.evidence&&c.evidence.length>0&&(console.log(` Evidence chain: ${c.evidence.length} evidence(s)`),c.evidence.forEach((u,p)=>{console.log(` ${p+1}. ${u.filePath} @ ${u.range.start.line} \u2192 ${u.range.end.line}`)})),console.log(` Text preview: ${c.text?.substring(0,120)}...`)}))}),t.on("step:complete",o=>{console.log(S.cyan(`\u2705 [${o.ruleId}] Completed step: ${o.stepName} (${o.stepType}) (${o.executionTime}ms)`)),o.outputs.filePaths!==void 0&&console.log(` Output files: ${o.outputs.filePaths.length}`),o.outputs.matches!==void 0&&(console.log(` Output matches: ${o.outputs.matches.length}`),o.outputs.matches.length>0&&(console.log(" Output match details:"),o.outputs.matches.forEach((c,l)=>{console.log(` Match ${l+1}:`),console.log(` File: ${c.file.path}`),console.log(` Range: ${c.range.start.line}:${c.range.start.column} \u2192 ${c.range.end.line}:${c.range.end.column}`),c.evidence&&c.evidence.length>0&&(console.log(` Evidence chain: ${c.evidence.length} evidence(s)`),c.evidence.forEach((u,p)=>{console.log(` ${p+1}. ${u.filePath} @ ${u.range.start.line} \u2192 ${u.range.end.line}`)})),console.log(` Text preview: ${c.text?.substring(0,120)}...`)})))}),t.on("test:start",o=>{console.log(S.magenta(`
|
|
120
|
+
\u{1F9EA} [${o.ruleId}] Running test: "${o.testName}"`))}),t.on("test:matches",o=>{console.log(S.magenta(` Found ${o.matches.length} match(es):`)),o.matches.forEach((c,l)=>{console.log(` Match ${l+1}:`),console.log(` File: ${c.file.path}`),console.log(` Range: ${c.range.start.line}:${c.range.start.column} \u2192 ${c.range.end.line}:${c.range.end.column}`),c.evidence&&c.evidence.length>0&&(console.log(` Evidence chain: ${c.evidence.length} evidence(s)`),c.evidence.forEach((u,p)=>{console.log(` ${p+1}. ${u.filePath} @ ${u.range.start.line} \u2192 ${u.range.end.line}`)})),console.log(` Text preview: ${c.text?.substring(0,120)}...`)})})),()=>{r&&(r._updateInterval&&clearInterval(r._updateInterval),r.stopAndPersist(),r=null),n.clear()}}import b2 from"readline";var ve="#fbbf24",Mi="#ff6b35",Tt="#4a90e2",ji="#9b59b6",yf=[`
|
|
121
|
+
${S.hex(ve)(" \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")}
|
|
122
|
+
${S.hex(ve)(" \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D")}
|
|
123
|
+
${S.hex(ve)(" \u2588\u2588\u2551 \u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
|
|
124
|
+
${S.hex(ve)(" \u2588\u2588\u2551\u2588\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
|
|
125
|
+
${S.hex(ve)(" \u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
|
|
126
|
+
${S.hex(ve)(" \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D ")}
|
|
110
127
|
`,`
|
|
111
|
-
${S.hex(
|
|
112
|
-
${S.hex(
|
|
113
|
-
${S.hex(
|
|
114
|
-
${S.hex(
|
|
115
|
-
${S.hex(
|
|
116
|
-
${S.hex(
|
|
128
|
+
${S.hex(Tt)(" \u2588\u2588\u2557 ")}${S.hex(ve)("\u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")}
|
|
129
|
+
${S.hex(Tt)(" \u2588\u2588\u2551 ")}${S.hex(ve)("\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D")}
|
|
130
|
+
${S.hex(Tt)(" \u2588\u2588\u2551 \u2588\u2557 ")}${S.hex(ve)("\u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
|
|
131
|
+
${S.hex(Tt)(" \u2588\u2588\u2551\u2588\u2588\u2588\u2557")}${S.hex(ve)("\u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
|
|
132
|
+
${S.hex(Tt)(" \u255A\u2588\u2588\u2588\u2554\u2588\u2588")}${S.hex(ve)("\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
|
|
133
|
+
${S.hex(Tt)(" \u255A\u2550\u2550\u255D\u255A\u2550")}${S.hex(ve)("\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D ")}
|
|
117
134
|
`,`
|
|
118
|
-
${S.hex(
|
|
119
|
-
${S.hex(
|
|
120
|
-
${S.hex(
|
|
121
|
-
${S.hex(
|
|
122
|
-
${S.hex(
|
|
123
|
-
${S.hex(
|
|
135
|
+
${S.hex(ve)(" \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557")}${S.hex(ji)("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ")}${S.hex(ve)("\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")}
|
|
136
|
+
${S.hex(ve)(" \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551")}${S.hex(ji)("\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557")}${S.hex(ve)("\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D")}
|
|
137
|
+
${S.hex(ve)(" \u2588\u2588\u2551 \u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551")}${S.hex(ji)("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D")}${S.hex(ve)("\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
|
|
138
|
+
${S.hex(ve)(" \u2588\u2588\u2551\u2588\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551")}${S.hex(ji)("\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u255D ")}${S.hex(ve)("\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
|
|
139
|
+
${S.hex(ve)(" \u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551")}${S.hex(ji)("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 ")}${S.hex(ve)("\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
|
|
140
|
+
${S.hex(ve)(" \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D \u255A\u2550\u255D")}${S.hex(ji)("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D ")}${S.hex(ve)("\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D ")}
|
|
124
141
|
`,`
|
|
125
|
-
${S.hex(
|
|
126
|
-
${S.hex(
|
|
127
|
-
${S.hex(
|
|
128
|
-
${S.hex(
|
|
129
|
-
${S.hex(
|
|
130
|
-
${S.hex(
|
|
142
|
+
${S.hex(ve)(" \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ")}${S.hex(Mi)("\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")}
|
|
143
|
+
${S.hex(ve)(" \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557")}${S.hex(Mi)("\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D")}
|
|
144
|
+
${S.hex(ve)(" \u2588\u2588\u2551 \u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D")}${S.hex(Mi)("\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
|
|
145
|
+
${S.hex(ve)(" \u2588\u2588\u2551\u2588\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u255D ")}${S.hex(Mi)("\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
|
|
146
|
+
${S.hex(ve)(" \u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 ")}${S.hex(Mi)("\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 ")}
|
|
147
|
+
${S.hex(ve)(" \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D ")}${S.hex(Mi)("\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D ")}
|
|
131
148
|
`,`
|
|
132
|
-
${S.hex(
|
|
133
|
-
${S.hex(
|
|
134
|
-
${S.hex(
|
|
135
|
-
${S.hex(
|
|
136
|
-
${S.hex(
|
|
137
|
-
${S.hex(
|
|
138
|
-
`];function
|
|
149
|
+
${S.hex(ve)(" \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557")}${S.hex(Tt)("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")}
|
|
150
|
+
${S.hex(ve)(" \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551")}${S.hex(Tt)("\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D")}
|
|
151
|
+
${S.hex(ve)(" \u2588\u2588\u2551 \u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551")}${S.hex(Tt)(" \u2588\u2588\u2551 ")}
|
|
152
|
+
${S.hex(ve)(" \u2588\u2588\u2551\u2588\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551")}${S.hex(Tt)(" \u2588\u2588\u2551 ")}
|
|
153
|
+
${S.hex(ve)(" \u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551")}${S.hex(Tt)(" \u2588\u2588\u2551 ")}
|
|
154
|
+
${S.hex(ve)(" \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D")}${S.hex(Tt)(" \u255A\u2550\u255D ")}
|
|
155
|
+
`];function _2(){process.stdout.write("\x1B[2J\x1B[H")}function w2(t){return new Promise(e=>setTimeout(e,t))}async function x2(t=3e3){let e=Kn({text:"",spinner:{interval:100,frames:yf}}).start();await w2(t),e.stop()}async function E2(t){let e=b2.createInterface({input:process.stdin,output:process.stdout});return await new Promise(r=>{e.question(t,s=>{e.close(),r(s.trim())})})}async function Vb(){_2(),await x2(1500),console.log(yf[0]),console.log(S.hex(Pr)(`
|
|
139
156
|
Welcome to wispbit`)),console.log(S(` The linter for AI
|
|
140
157
|
`)),console.log(S.dim(" To use wispbit, you need an API key.")),console.log(S.dim(` You can get one at: https://app.wispbit.com/api-keys
|
|
141
|
-
`));let t=await
|
|
142
|
-
Setup cancelled.`)),null)}
|
|
143
|
-
`)))}var
|
|
158
|
+
`));let t=await E2(S.bold.hex(Ir)(" Enter your Wispbit API key (or press Enter to exit): "));return t||(console.log(S.dim(`
|
|
159
|
+
Setup cancelled.`)),null)}Hb.default.config();function Yb(){return tc.join(Zb.homedir(),".powerlint","config.json")}async function S2(t){let e=Yb(),r=tc.dirname(e);await Ds.mkdir(r,{recursive:!0});let s={};try{let n=await Ds.readFile(e,"utf-8");s=JSON.parse(n)}catch{}let i={...s,apiKey:t};await Ds.writeFile(e,JSON.stringify(i,null,2))}async function R2(){if(process.env.WISPBIT_API_KEY)return process.env.WISPBIT_API_KEY;let t=Yb();try{let e=await Ds.readFile(t,"utf-8");return JSON.parse(e).apiKey||null}catch{return null}}async function Jb(t){let e=process.env.WISPBIT_API_KEY||null;e||(e=await R2());let r=await pn.initialize(t,{apiKey:e||void 0});if("failed"in r){if(r.error==="INVALID_API_KEY"){let s=await Vb();if(s||process.exit(0),await t.getRepositoryUrl()||(console.log(S.red("Repository URL not found. Make sure you're in a git repository.")),process.exit(1)),console.log(S.dim("Validating API key...")),await S2(s),r=await pn.initialize(t,{apiKey:s}),"failed"in r)console.log(S.red("Invalid API key. Please check your API key and try again.")),process.exit(1);else return console.log(S.green("Setup complete! powerlint has been configured.")),r}else if(r.error==="INVALID_REPOSITORY"){let s=await t.getRepositoryUrl();console.log(S.red(`No repository in wispbit found for url: ${s}. If you are passing the repository URL as a flag, make sure it is correct. If your git remote URL was recently modified, use "git remote set-url origin <new-url>" to update the remote URL.`)),process.exit(1)}}return r}async function A2(){let t=fs(),e=await sy();Kb.default.gt(e,t)&&(console.log(S.bgHex("#b2f5ea").black.bold(` NEW VERSION AVAILABLE: ${e} (current: ${t}) `)),console.log(S.bgHex("#b2f5ea").black.bold(` Run 'pnpm install -g @wispbit/local' to update
|
|
160
|
+
`)))}var Se=vd(`
|
|
144
161
|
wispbit - the linter for AI
|
|
145
162
|
https://wispbit.com/
|
|
146
163
|
|
|
@@ -185,8 +202,8 @@ Global options:
|
|
|
185
202
|
--repo-url <url> Override repository URL (default: from git remote)
|
|
186
203
|
-v, --version Show version number
|
|
187
204
|
-h, --help Show help
|
|
188
|
-
`,{importMeta:import.meta,flags:{rule:{type:"string"},json:{type:"string"},include:{type:"string"},repoUrl:{type:"string"},debug:{type:"boolean",shortFlag:"d",default:!1},version:{type:"boolean",shortFlag:"v"},help:{type:"boolean",shortFlag:"h"}},version:
|
|
189
|
-
${S.green("Cache purged successfully.")} Removed ${n.deletedCount} item(s).`)}else console.error(S.red("Unknown cache subcommand:"),e),
|
|
205
|
+
`,{importMeta:import.meta,flags:{rule:{type:"string"},json:{type:"string"},include:{type:"string"},repoUrl:{type:"string"},debug:{type:"boolean",shortFlag:"d",default:!1},version:{type:"boolean",shortFlag:"v"},help:{type:"boolean",shortFlag:"h"}},version:fs()});async function vf(t){let e=new li({repositoryUrl:t.repoUrl}),r=await Jb(e),{ruleId:s,json:i,mode:n,filePath:a}=t,{commitSelector:o,diffInclude:c}=t;if(n==="diff"){let h=e.getWorkspaceRoot();if(o)c||(c=(await au(h)).include);else{let b=await au(h);o=b.commitSelector,c||(c=b.include)}}if(n==="diff"&&o&&c){let h=e.getWorkspaceRoot(),b=await nu(h),x=ou(o,c,b);x&&(console.error(S.red(x)),process.exit(1))}let l=!1,u="pretty";i!==void 0?(l=!0,typeof i=="string"?i==="stream"?u="stream":i==="compact"?u="compact":u="pretty":u="pretty"):await A2();let p,g=new vn(r,e);if(s?p=[await g.loadRuleById(s)]:p=await g.loadAllRules(),!l)if(n==="check"){let h=S.bgHex("#eab308").black(" CHECK "),b=S.dim(` (${a||"all files"})`);console.log(`${h}${b}`)}else{let h=S.bgHex("#4a90e2").black(" DIFF "),b=(o||"").replace(/\b[0-9a-f]{30,}\b/gi,E=>E.substring(0,7)),x=c?` ${b} ${S.dim(`[${c.join("/")}]`)}`:` ${b}`;console.log(`${h}${x}`)}let f=new xt;if(n==="check")f.setExecutionMode("check",{filePath:a});else{let h=c?c.join(", "):"all";f.setExecutionMode("diff",{baseCommit:o||"",headCommit:h})}let d=t.json?void 0:Wb(f,t.debug||!1),m=Date.now(),y=new Va(r,e,f),v=0;f.on("files:discovery:complete",h=>{v=h.totalFiles});let _=await y.execute(p,{mode:n,filePath:a,diffOptions:n==="diff"?{include:c,commitSelector:o}:void 0}),w=[];for(let h of _){let b=p.find(x=>x.id===h.ruleId);if(b){let L={ruleId:h.ruleId,internalId:b.internalId,message:b.config.message,severity:b.config.severity,execution:b.config.execution,matches:h.matches,llmCost:void 0,llmTokens:void 0};w.push(L)}}if(d?.(),l)qb(w,u);else{let h=w.filter(P=>P.severity==="violation"),b=w.filter(P=>P.severity==="suggestion"),x=h.reduce((P,H)=>P+H.matches.length,0),E=b.reduce((P,H)=>P+H.matches.length,0),L=x+E,A=w.filter(P=>P.llmCost).reduce((P,H)=>P.plus(new lt(H.llmCost||0)),new lt(0)),O=w.filter(P=>P.llmTokens).reduce((P,H)=>P+(H.llmTokens||0),0),k;if(n==="check")k={mode:"check",filePath:a};else{let P=(o||"").replace(/\b[0-9a-f]{30,}\b/gi,re=>re.substring(0,7)),H=c?c.join(", "):"all";k={mode:"diff",baseCommit:P,headCommit:H}}let z=Date.now()-m;Gb(w,{totalRules:p.length,violationCount:x,suggestionCount:E,totalMatches:L,totalLLMCost:A.toString(),totalLLMTokens:O,executionMode:k,executionTime:z,totalFiles:v})}return w}async function C2(t){let e=new li({repositoryUrl:t}),r=await Jb(e),i=await new vn(r,e).loadAllRules();zb(i)}async function O2(){let t=Se.input[0],e=Se.input[1],r=Se.flags.debug;switch(t){case"check":{let s=Se.input[1];await vf({ruleId:Se.flags.rule,json:Se.flags.json,debug:Se.flags.debug,mode:"check",filePath:s,repoUrl:Se.flags.repoUrl});break}case"diff":{let s;if(Se.flags.include){let a=Se.flags.include.split(",").map(l=>l.trim()),o=["committed","staged","unstaged","untracked"],c=a.filter(l=>!o.includes(l));c.length>0&&(console.error(S.red(`Invalid include(s): ${c.join(", ")}. Valid includes: ${o.join(", ")}`)),process.exit(1)),s=a}let i=Se.input[1];await vf({ruleId:Se.flags.rule,json:Se.flags.json,debug:Se.flags.debug,mode:"diff",diffInclude:s,commitSelector:i,repoUrl:Se.flags.repoUrl});break}case"list":{await C2(Se.flags.repoUrl);break}case"cache":{if(e==="purge"){let s=new li({repositoryUrl:Se.flags.repoUrl}),n=await new ea(s).purgeCache();console.log(`
|
|
206
|
+
${S.green("Cache purged successfully.")} Removed ${n.deletedCount} item(s).`)}else console.error(S.red("Unknown cache subcommand:"),e),Se.showHelp(),process.exit(1);break}default:{let s;if(Se.flags.include){let a=Se.flags.include.split(",").map(l=>l.trim()),o=["committed","staged","unstaged","untracked"],c=a.filter(l=>!o.includes(l));c.length>0&&(console.error(S.red(`Invalid include(s): ${c.join(", ")}. Valid includes: ${o.join(", ")}`)),process.exit(1)),s=a}let i=Se.input[0];await vf({ruleId:Se.flags.rule,json:Se.flags.json,debug:Se.flags.debug,mode:"diff",diffInclude:s,commitSelector:i,repoUrl:Se.flags.repoUrl});break}}return r}O2().catch(t=>{Se.flags.debug?console.error(t):console.error(S.red("Error:"),t.message||String(t)),process.exit(1)});export{A2 as checkForUpdates};
|
|
190
207
|
/*! Bundled license information:
|
|
191
208
|
|
|
192
209
|
deep-extend/lib/deep-extend.js:
|