@visulima/vis 1.0.0-alpha.25 → 1.0.0-alpha.26
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/CHANGELOG.md +17 -0
- package/LICENSE.md +2 -135
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/packem_chunks/bin.js +123 -123
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/config.js +15 -15
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler22.js +1 -1
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler31.js +1 -1
- package/dist/packem_chunks/handler38.js +1 -1
- package/dist/packem_chunks/handler39.js +1 -1
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler40.js +1 -1
- package/dist/packem_chunks/handler42.js +1 -1
- package/dist/packem_chunks/handler44.js +1 -1
- package/dist/packem_chunks/handler45.js +1 -1
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler48.js +58 -57
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +1 -1
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/{advisories-U1QKY_tg.js → advisories-DS8JEB_g.js} +1 -1
- package/dist/packem_shared/{cyclonedx-D6F9rAay.js → cyclonedx-ja1cbU69.js} +1 -1
- package/dist/packem_shared/{docker-BU-7veP5.js → docker-Bw9gKo69.js} +1 -1
- package/dist/packem_shared/{index-PexbdLyT.js → index-88UK-tt_.js} +1 -1
- package/dist/packem_shared/{index-D9ZIw4ra.js → index-CS6a2wFB.js} +1 -1
- package/dist/packem_shared/{osv-bloom-CyCDpXBl.js → osv-bloom-QSAn2Dcw.js} +2 -2
- package/dist/packem_shared/{pm-runner-Cj76BV8q.js → pm-runner-BzGZmzYs.js} +1 -1
- package/dist/packem_shared/{provenance-CdvMwB2R.js → provenance-BsBn1f5S.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-CRFybyxv.js → resolve-explicit-CBPr617N.js} +1 -1
- package/dist/packem_shared/{s1ngularity-CiZla5EP.js → s1ngularity-j_ArCZAs.js} +1 -1
- package/dist/packem_shared/{signatures-BsEDWhME.js → signatures-CaXzNuEn.js} +1 -1
- package/dist/packem_shared/{typosquats-_7T7U2q2.js → typosquats-C1e6RNjF.js} +1 -1
- package/index.d.ts +201 -201
- package/index.js +26 -26
- package/package.json +10 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var Ok=Object.defineProperty;var d=(e,t)=>Ok(e,"name",{value:t,configurable:!0});import{createRequire as Pk}from"node:module";import{d as Bk,e as Tg,g as Ng,m as Fa,N as Rk,i as Tk,T as Nk,w as Ik,a as Lk}from"../packem_shared/index-D9ZIw4ra.js";import{f as Dp,s as Mk,g as Wk,M as Vk,B as qe,n as le,w as wo,b as $t,i as Ba,j as Hn,K as Ig,e as uh}from"./config.js";import{f as ko,C as Ke,U as Tt,M as D,L as gu,Q as _g,O as Mg,b as Wg,a as tn,K as Je,_ as yu,c as Uk,s as Vg,$ as H,z as zn,i as j,y as Gk}from"../packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js";import{x as qg}from"tinyexec";import{r as Zk,c as eS,s as Fs,A as fh}from"../packem_shared/pm-runner-Cj76BV8q.js";import{getMainWorktreeRoot as sS,Cache as Ra,parseCacheSize as iS,readLastRunSummary as Jg,getLastRunSummaryPath as vu,digestFile as Kg,looksLikeInputUri as oS,parseInputUri as aS}from"@visulima/task-runner";import{g as dc,E as On,T as Dl,j as Qt,e as _i,q as Gr,P as fS,I as hS}from"../packem_shared/index.server-B7ETiT4C.js";import{renderToString as Xg,render as mS}from"@visulima/tui";import bs,{useState as Mi,useRef as eo,useEffect as Qg,useCallback as Zg,useSyncExternalStore as gS}from"react";import{jsx as L,jsxs as ce}from"react/jsx-runtime";import{Box as de}from"@visulima/tui/components/box";import{Dialog as $u}from"@visulima/tui/components/dialog";import{Text as _}from"@visulima/tui/components/text";import{useApp as ey}from"@visulima/tui/hooks/use-app";import{useInput as ty}from"@visulima/tui/hooks/use-input";import{useWindowSize as yS}from"@visulima/tui/hooks/use-window-size";import{ScrollView as vS}from"@visulima/tui/components/scroll-view";import{ScrollBar as bS}from"@visulima/tui/components/scroll-bar";import{resolveEditorconfigDefaults as $S}from"#native";import{Table as wS}from"@visulima/tui/components/table";const Fk=Pk(import.meta.url),fs=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,wt=d(e=>{if(typeof fs<"u"&&fs.versions&&fs.versions.node){const[t,r]=fs.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return fs.getBuiltinModule(e)}return Fk(e)},"__cjs_getBuiltinModule"),_k=wt("node:assert"),Lg=wt("node:module"),{createRequire:mt}=Lg,Gs=fs,{env:Sl}=Gs,Cp=wt("node:fs/promises"),{readdir:So,stat:qs,readFile:Ug,realpath:ph,rm:Ep,mkdtemp:qk,mkdir:Hk}=Cp,jr=wt("node:path"),{resolve:Ps,dirname:zk,delimiter:dh}=jr,{existsSync:pc,rmSync:Nt,writeFileSync:Oe,readdirSync:Ze,statSync:cr,readFileSync:Gg,watch:Jk,copyFileSync:Kk,unlinkSync:Jn,mkdirSync:Yk,cpSync:Xk}=wt("node:fs"),Hg=wt("node:url"),{fileURLToPath:Qk}=Hg,tS=wt("util"),{spawn:hh,execFileSync:rS,execFile:nS,spawnSync:Ss,execSync:zg}=wt("node:child_process"),{createHash:cS}=wt("node:crypto"),{homedir:Yg,platform:jp,tmpdir:lS}=wt("node:os"),{createServer:uS,STATUS_CODES:pS}=wt("node:http"),{Http2ServerRequest:Zi,constants:dS}=wt("node:http2"),{Readable:bu}=wt("node:stream"),{createInterface:Ap}=wt("node:readline");var kS=Object.defineProperty,ry=d((e,t)=>kS(e,"name",{value:t,configurable:!0}),"t$S"),SS=Object.defineProperty,ny=ry((e,t)=>SS(e,"name",{value:t,configurable:!0}),"t"),DS=Object.defineProperty,CS=ny((e,t)=>DS(e,"name",{value:t,configurable:!0}),"t");let mh=class extends Error{static{d(this,"l")}static{ry(this,"c")}static{ny(this,"i")}static{CS(this,"WalkError")}root;constructor(t,r){super(`${t instanceof Error?t.message:String(t)} for path "${r}"`),this.cause=t,this.root=r}get name(){return"WalkError"}set name(t){throw new Error("Cannot overwrite name of WalkError")}};var ES=Object.defineProperty,jS=d((e,t)=>ES(e,"name",{value:t,configurable:!0}),"l$M"),AS=Object.defineProperty,sy=jS((e,t)=>AS(e,"name",{value:t,configurable:!0}),"t"),xS=Object.defineProperty,OS=sy((e,t)=>xS(e,"name",{value:t,configurable:!0}),"g");const gh=OS(e=>{const t=e.replace(/\.\*/g,".([^/]*)").replace(/\*\*/g,"(.*)").replace(/(?<!\.)\*(?!\*)/g,"([^/]*)").replace(/\?/g,"[^/]").replace(/\.(?!\*)/g,String.raw`\.`).replace(/\{/g,"(").replace(/\}/g,")").replace(/,/g,"|").replace(/\[!(.*?)\]/g,"[^$1]");return new RegExp(`^${t}$`)},"globToRegExp");var PS=Object.defineProperty,FS=sy((e,t)=>PS(e,"name",{value:t,configurable:!0}),"t");const ea=FS((e,t,r,n)=>{if(Array.isArray(t)&&t.length>0&&!t.some(i=>e.endsWith(i)))return!1;const s=e.includes("\\")?e.replaceAll("\\","/"):e;return r&&!r.some(i=>i.test(s))?!1:!n?.some(i=>i.test(s))},"walkInclude");var BS=Object.defineProperty,iy=d((e,t)=>BS(e,"name",{value:t,configurable:!0}),"p$V"),RS=Object.defineProperty,xp=iy((e,t)=>RS(e,"name",{value:t,configurable:!0}),"m");const TS=mt(import.meta.url),$i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,NS=xp(e=>{if(typeof $i<"u"&&$i.versions&&$i.versions.node){const[t,r]=$i.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return $i.getBuiltinModule(e)}return TS(e)},"__cjs_getBuiltinModule"),{readdirSync:IS,realpathSync:LS,statSync:_S}=NS("node:fs");var MS=Object.defineProperty,Ut=xp((e,t)=>MS(e,"name",{value:t,configurable:!0}),"t");const WS=Ut(e=>{const t=gu(e),r=_S(t);return{isDirectory:Ut(()=>r.isDirectory(),"isDirectory"),isFile:Ut(()=>r.isFile(),"isFile"),isSymbolicLink:Ut(()=>r.isSymbolicLink(),"isSymbolicLink"),name:_g(t),path:t}},"_createWalkEntry");function*un(e,{extensions:t,followSymlinks:r=!1,includeDirs:n=!0,includeFiles:s=!0,includeSymlinks:i=!0,match:o,maxDepth:a=Number.POSITIVE_INFINITY,skip:c}={}){if(ko(e),a<0)return;const l=o?o.map(p=>typeof p=="string"?gh(p):p):void 0,u=c?c.map(p=>typeof p=="string"?gh(p):p):void 0;if(e=Ke(Tt(e)),n&&ea(e,t,l,u)&&(yield WS(e)),!(a<1||!ea(e,void 0,void 0,u)))try{const p=IS(e,{withFileTypes:!0});for(const f of p){let m=D(e,f.name);if(f.isSymbolicLink())if(r)m=LS(m);else if(i&&ea(m,t,l,u)){yield{isDirectory:Ut(()=>f.isDirectory(),"isDirectory"),isFile:Ut(()=>f.isFile(),"isFile"),isSymbolicLink:Ut(()=>f.isSymbolicLink(),"isSymbolicLink"),name:f.name,path:gu(m)};continue}else continue;f.isDirectory()?yield*un(m,{extensions:t,followSymlinks:r,includeDirs:n,includeFiles:s,includeSymlinks:i,match:l,maxDepth:a-1,skip:u}):f.isFile()&&s&&ea(m,t,l,u)&&(yield{isDirectory:Ut(()=>f.isDirectory(),"isDirectory"),isFile:Ut(()=>f.isFile(),"isFile"),isSymbolicLink:Ut(()=>f.isSymbolicLink(),"isSymbolicLink"),name:f.name,path:gu(m)})}}catch(p){throw p instanceof mh?p:new mh(p,e)}}d(un,"y$H");iy(un,"F");xp(un,"b");Ut(un,"walkSync");var VS=Object.defineProperty,US=d((e,t)=>VS(e,"name",{value:t,configurable:!0}),"p$U"),GS=Object.defineProperty,oy=US((e,t)=>GS(e,"name",{value:t,configurable:!0}),"a");const qS=mt(import.meta.url),wi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ay=oy(e=>{if(typeof wi<"u"&&wi.versions&&wi.versions.node){const[t,r]=wi.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return wi.getBuiltinModule(e)}return qS(e)},"__cjs_getBuiltinModule"),{stat:HS,lstat:zS}=ay("node:fs/promises"),{fileURLToPath:JS}=ay("node:url");var KS=Object.defineProperty,yh=oy((e,t)=>KS(e,"name",{value:t,configurable:!0}),"n");const Do=yh(async(e,t={})=>{if(typeof e!="string"&&!Array.isArray(e)&&typeof e!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const r=t.cwd?Tt(t.cwd):process.cwd();let n=Ke(r);const{root:s}=Mg(n),i=Tt(t.stopAt??s),o=Ke(n,i),a=t.type??"file",c=yh(async function(u){return typeof e=="function"?[await e(u)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]},"getMatchers");t.allowSymlinks??=!0;const l=t.allowSymlinks?HS:zS;for(;n&&n!==o&&n!==s;){const u=await c(n);for(let p of u){if(p===Wg)return;if(p===void 0)continue;Buffer.isBuffer(p)?p=p.toString():p instanceof URL&&(p=JS(p));const f=tn(p)?p:Ke(n,p);try{const m=await l(f);if(a==="file"&&m.isFile()||a==="directory"&&m.isDirectory())return f}catch{}}n=Je(n)}},"findUp");var YS=Object.defineProperty,XS=d((e,t)=>YS(e,"name",{value:t,configurable:!0}),"u$15"),QS=Object.defineProperty,cy=XS((e,t)=>QS(e,"name",{value:t,configurable:!0}),"i");const ZS=mt(import.meta.url),ki=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ly=cy(e=>{if(typeof ki<"u"&&ki.versions&&ki.versions.node){const[t,r]=ki.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ki.getBuiltinModule(e)}return ZS(e)},"__cjs_getBuiltinModule"),{statSync:eD,lstatSync:tD}=ly("node:fs"),{fileURLToPath:rD}=ly("node:url");var nD=Object.defineProperty,vh=cy((e,t)=>nD(e,"name",{value:t,configurable:!0}),"o");const Co=vh((e,t={})=>{if(typeof e!="string"&&!Array.isArray(e)&&typeof e!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const r=t.cwd?Tt(t.cwd):process.cwd();let n=Ke(r);const{root:s}=Mg(n),i=Tt(t.stopAt??s),o=Ke(n,i),a=t.type??"file",c=vh(function(u){return typeof e=="function"?[e(u)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]},"getMatchers");t.allowSymlinks??=!0;const l=t.allowSymlinks?eD:tD;for(;n&&n!==o&&n!==s;){for(let u of c(n)){if(u===Wg)return;if(u===void 0)continue;Buffer.isBuffer(u)?u=u.toString():u instanceof URL&&(u=rD(u));const p=tn(u)?u:Ke(n,u);try{const f=l(p);if(a==="file"&&f.isFile()||a==="directory"&&f.isDirectory())return p}catch{}}n=Je(n)}},"findUpSync");var sD=Object.defineProperty,uy=d((e,t)=>sD(e,"name",{value:t,configurable:!0}),"t$R"),iD=Object.defineProperty,Op=uy((e,t)=>iD(e,"name",{value:t,configurable:!0}),"s");const oD=mt(import.meta.url),Si=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,aD=Op(e=>{if(typeof Si<"u"&&Si.versions&&Si.versions.node){const[t,r]=Si.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Si.getBuiltinModule(e)}return oD(e)},"__cjs_getBuiltinModule"),{access:cD}=aD("node:fs/promises");var lD=Object.defineProperty,uD=Op((e,t)=>lD(e,"name",{value:t,configurable:!0}),"o");async function xr(e,t=yu){ko(e),e=Tt(e);try{return await cD(e,t),!0}catch{return!1}}d(xr,"i$11");uy(xr,"d");Op(xr,"m");uD(xr,"isAccessible");var pD=Object.defineProperty,dD=d((e,t)=>pD(e,"name",{value:t,configurable:!0}),"f$N"),fD=Object.defineProperty,py=dD((e,t)=>fD(e,"name",{value:t,configurable:!0}),"i");const hD=mt(import.meta.url),Di=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,dy=py(e=>{if(typeof Di<"u"&&Di.versions&&Di.versions.node){const[t,r]=Di.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Di.getBuiltinModule(e)}return hD(e)},"__cjs_getBuiltinModule"),{readFile:mD}=dy("node:fs/promises"),{unzip:gD,brotliDecompress:yD}=dy("node:zlib");var vD=Object.defineProperty,fy=py((e,t)=>vD(e,"name",{value:t,configurable:!0}),"n");const bD={brotli:yD,gzip:gD,none:fy((e,t)=>{t(null,e)},"none")},Pp=fy(async(e,t)=>{if(ko(e),e=Tt(e),!await xr(e))throw new Uk(`unable to read the non-accessible file: ${e}`);if(!await xr(e,Vg))throw new Error(`Unable to read the non-readable file: ${e}`);const{buffer:r,compression:n,encoding:s,flag:i}=t??{};return await mD(e,i?{encoding:s,flag:i}:{encoding:s}).then(async o=>await new Promise((a,c)=>{bD[n??"none"](o,(l,u)=>{l?c(l):a(r?u:u.toString())})})).catch(o=>{throw o})},"readFile");var $D=Object.defineProperty,hy=d((e,t)=>$D(e,"name",{value:t,configurable:!0}),"t$Q"),wD=Object.defineProperty,my=hy((e,t)=>wD(e,"name",{value:t,configurable:!0}),"t"),kD=Object.defineProperty,SD=my((e,t)=>kD(e,"name",{value:t,configurable:!0}),"i");async function Eo(e,t,r){typeof t=="object"&&(r=t,t=void 0);const n=await Pp(e,{buffer:!0,encoding:void 0});let s=new TextDecoder().decode(n);const{beforeParse:i,color:o}=r??{};return typeof i=="function"&&(s=i(s)),Dp(s,t,Tt(e),{color:o})}d(Eo,"a$19");hy(Eo,"l");my(Eo,"c");SD(Eo,"readJson");var DD=Object.defineProperty,CD=d((e,t)=>DD(e,"name",{value:t,configurable:!0}),"a$18"),ED=Object.defineProperty,jD=CD((e,t)=>ED(e,"name",{value:t,configurable:!0}),"t"),AD=Object.defineProperty,xD=jD((e,t)=>AD(e,"name",{value:t,configurable:!0}),"t");const OD=xD(e=>{const t={force:!0,recursive:!0};return e?.maxRetries!==void 0&&(t.maxRetries=e.maxRetries),e?.retryDelay!==void 0&&(t.retryDelay=e.retryDelay),t},"buildRmOptions");var PD=Object.defineProperty,FD=d((e,t)=>PD(e,"name",{value:t,configurable:!0}),"i$$"),BD=Object.defineProperty,gy=FD((e,t)=>BD(e,"name",{value:t,configurable:!0}),"s");const RD=mt(import.meta.url),Ci=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,TD=gy(e=>{if(typeof Ci<"u"&&Ci.versions&&Ci.versions.node){const[t,r]=Ci.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ci.getBuiltinModule(e)}return RD(e)},"__cjs_getBuiltinModule"),{unlinkSync:ND,rmSync:ID}=TD("node:fs");var LD=Object.defineProperty,_D=gy((e,t)=>LD(e,"name",{value:t,configurable:!0}),"o");const MD=_D((e,t={})=>{ko(e);try{ND(e)}catch{}try{ID(e,OD(t))}catch{}},"removeSync");var WD=Object.defineProperty,VD=d((e,t)=>WD(e,"name",{value:t,configurable:!0}),"m$R"),UD=Object.defineProperty,yy=VD((e,t)=>UD(e,"name",{value:t,configurable:!0}),"s");const GD=mt(import.meta.url),Ei=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qD=yy(e=>{if(typeof Ei<"u"&&Ei.versions&&Ei.versions.node){const[t,r]=Ei.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ei.getBuiltinModule(e)}return GD(e)},"__cjs_getBuiltinModule"),{mkdir:HD,writeFile:zD,stat:JD,rename:bh,chown:KD,chmod:YD,unlink:XD}=qD("node:fs/promises");var QD=Object.defineProperty,ZD=yy((e,t)=>QD(e,"name",{value:t,configurable:!0}),"d");const eC=ZD(async(e,t,r)=>{r={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...r},ko(e),Mk(t),e=Tt(e);const n=`${e}.tmp`;try{const s=await xr(e,yu);if(!s&&r.recursive){const o=Je(e);await xr(o,yu)||await HD(o,{recursive:!0})}let i;if(await zD(n,Wk(t),{encoding:r.encoding,flag:r.flag}),s&&!r.overwrite&&(i=await JD(e),r.chown??={gid:i.gid,uid:i.uid},await bh(e,`${e}.bak`)),r.chown)try{await KD(n,r.chown.uid,r.chown.gid)}catch{}await YD(n,i&&!r.mode?i.mode:r.mode??438),await bh(n,e)}catch(s){throw new Error(`Failed to write file at: ${e} - ${s.message}`,{cause:s})}finally{await xr(n)&&await XD(`${e}.tmp`)}},"writeFile");var tC=Object.defineProperty,rC=d((e,t)=>tC(e,"name",{value:t,configurable:!0}),"a$16"),nC=Object.defineProperty,vy=rC((e,t)=>nC(e,"name",{value:t,configurable:!0}),"n");const sC=mt(import.meta.url),ji=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,iC=vy(e=>{if(typeof ji<"u"&&ji.versions&&ji.versions.node){const[t,r]=ji.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ji.getBuiltinModule(e)}return sC(e)},"__cjs_getBuiltinModule"),{readFile:oC}=iC("node:fs/promises");var aC=Object.defineProperty,cC=vy((e,t)=>aC(e,"name",{value:t,configurable:!0}),"r");const lC=cC(async(e,t,r={})=>{const{detectIndent:n,indent:s,replacer:i,stringify:o=JSON.stringify,...a}={indent:" ",...r};let c=s,l=`
|
|
1
|
+
var Ok=Object.defineProperty;var d=(e,t)=>Ok(e,"name",{value:t,configurable:!0});import{createRequire as Pk}from"node:module";import{d as Bk,e as Tg,g as Ng,m as Fa,N as Rk,i as Tk,T as Nk,w as Ik,a as Lk}from"../packem_shared/index-CS6a2wFB.js";import{f as Dp,s as Mk,g as Wk,M as Vk,B as qe,n as le,w as wo,b as $t,i as Ba,j as Hn,D as Ig,e as uh}from"./config.js";import{f as ko,C as Ke,U as Tt,M as D,L as gu,Q as _g,O as Mg,b as Wg,a as tn,K as Je,_ as yu,c as Uk,s as Vg,$ as H,z as zn,i as j,y as Gk}from"../packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js";import{x as qg}from"tinyexec";import{r as Zk,c as eS,s as Fs,A as fh}from"../packem_shared/pm-runner-BzGZmzYs.js";import{getMainWorktreeRoot as sS,Cache as Ra,parseCacheSize as iS,readLastRunSummary as Jg,getLastRunSummaryPath as vu,digestFile as Kg,looksLikeInputUri as oS,parseInputUri as aS}from"@visulima/task-runner";import{g as dc,E as On,T as Dl,j as Qt,e as _i,q as Gr,P as fS,I as hS}from"../packem_shared/index.server-B7ETiT4C.js";import{renderToString as Xg,render as mS}from"@visulima/tui";import bs,{useState as Mi,useRef as eo,useEffect as Qg,useCallback as Zg,useSyncExternalStore as gS}from"react";import{jsx as L,jsxs as ce}from"react/jsx-runtime";import{Box as de}from"@visulima/tui/components/box";import{Dialog as $u}from"@visulima/tui/components/dialog";import{Text as _}from"@visulima/tui/components/text";import{useApp as ey}from"@visulima/tui/hooks/use-app";import{useInput as ty}from"@visulima/tui/hooks/use-input";import{useWindowSize as yS}from"@visulima/tui/hooks/use-window-size";import{ScrollView as vS}from"@visulima/tui/components/scroll-view";import{ScrollBar as bS}from"@visulima/tui/components/scroll-bar";import{resolveEditorconfigDefaults as $S}from"#native";import{Table as wS}from"@visulima/tui/components/table";const Fk=Pk(import.meta.url),fs=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,wt=d(e=>{if(typeof fs<"u"&&fs.versions&&fs.versions.node){const[t,r]=fs.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return fs.getBuiltinModule(e)}return Fk(e)},"__cjs_getBuiltinModule"),_k=wt("node:assert"),Lg=wt("node:module"),{createRequire:mt}=Lg,Gs=fs,{env:Sl}=Gs,Cp=wt("node:fs/promises"),{readdir:So,stat:qs,readFile:Ug,realpath:ph,rm:Ep,mkdtemp:qk,mkdir:Hk}=Cp,jr=wt("node:path"),{resolve:Ps,dirname:zk,delimiter:dh}=jr,{existsSync:pc,rmSync:Nt,writeFileSync:Oe,readdirSync:Ze,statSync:cr,readFileSync:Gg,watch:Jk,copyFileSync:Kk,unlinkSync:Jn,mkdirSync:Yk,cpSync:Xk}=wt("node:fs"),Hg=wt("node:url"),{fileURLToPath:Qk}=Hg,tS=wt("util"),{spawn:hh,execFileSync:rS,execFile:nS,spawnSync:Ss,execSync:zg}=wt("node:child_process"),{createHash:cS}=wt("node:crypto"),{homedir:Yg,platform:jp,tmpdir:lS}=wt("node:os"),{createServer:uS,STATUS_CODES:pS}=wt("node:http"),{Http2ServerRequest:Zi,constants:dS}=wt("node:http2"),{Readable:bu}=wt("node:stream"),{createInterface:Ap}=wt("node:readline");var kS=Object.defineProperty,ry=d((e,t)=>kS(e,"name",{value:t,configurable:!0}),"t$S"),SS=Object.defineProperty,ny=ry((e,t)=>SS(e,"name",{value:t,configurable:!0}),"t"),DS=Object.defineProperty,CS=ny((e,t)=>DS(e,"name",{value:t,configurable:!0}),"t");let mh=class extends Error{static{d(this,"l")}static{ry(this,"c")}static{ny(this,"i")}static{CS(this,"WalkError")}root;constructor(t,r){super(`${t instanceof Error?t.message:String(t)} for path "${r}"`),this.cause=t,this.root=r}get name(){return"WalkError"}set name(t){throw new Error("Cannot overwrite name of WalkError")}};var ES=Object.defineProperty,jS=d((e,t)=>ES(e,"name",{value:t,configurable:!0}),"l$M"),AS=Object.defineProperty,sy=jS((e,t)=>AS(e,"name",{value:t,configurable:!0}),"t"),xS=Object.defineProperty,OS=sy((e,t)=>xS(e,"name",{value:t,configurable:!0}),"g");const gh=OS(e=>{const t=e.replace(/\.\*/g,".([^/]*)").replace(/\*\*/g,"(.*)").replace(/(?<!\.)\*(?!\*)/g,"([^/]*)").replace(/\?/g,"[^/]").replace(/\.(?!\*)/g,String.raw`\.`).replace(/\{/g,"(").replace(/\}/g,")").replace(/,/g,"|").replace(/\[!(.*?)\]/g,"[^$1]");return new RegExp(`^${t}$`)},"globToRegExp");var PS=Object.defineProperty,FS=sy((e,t)=>PS(e,"name",{value:t,configurable:!0}),"t");const ea=FS((e,t,r,n)=>{if(Array.isArray(t)&&t.length>0&&!t.some(i=>e.endsWith(i)))return!1;const s=e.includes("\\")?e.replaceAll("\\","/"):e;return r&&!r.some(i=>i.test(s))?!1:!n?.some(i=>i.test(s))},"walkInclude");var BS=Object.defineProperty,iy=d((e,t)=>BS(e,"name",{value:t,configurable:!0}),"p$V"),RS=Object.defineProperty,xp=iy((e,t)=>RS(e,"name",{value:t,configurable:!0}),"m");const TS=mt(import.meta.url),$i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,NS=xp(e=>{if(typeof $i<"u"&&$i.versions&&$i.versions.node){const[t,r]=$i.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return $i.getBuiltinModule(e)}return TS(e)},"__cjs_getBuiltinModule"),{readdirSync:IS,realpathSync:LS,statSync:_S}=NS("node:fs");var MS=Object.defineProperty,Ut=xp((e,t)=>MS(e,"name",{value:t,configurable:!0}),"t");const WS=Ut(e=>{const t=gu(e),r=_S(t);return{isDirectory:Ut(()=>r.isDirectory(),"isDirectory"),isFile:Ut(()=>r.isFile(),"isFile"),isSymbolicLink:Ut(()=>r.isSymbolicLink(),"isSymbolicLink"),name:_g(t),path:t}},"_createWalkEntry");function*un(e,{extensions:t,followSymlinks:r=!1,includeDirs:n=!0,includeFiles:s=!0,includeSymlinks:i=!0,match:o,maxDepth:a=Number.POSITIVE_INFINITY,skip:c}={}){if(ko(e),a<0)return;const l=o?o.map(p=>typeof p=="string"?gh(p):p):void 0,u=c?c.map(p=>typeof p=="string"?gh(p):p):void 0;if(e=Ke(Tt(e)),n&&ea(e,t,l,u)&&(yield WS(e)),!(a<1||!ea(e,void 0,void 0,u)))try{const p=IS(e,{withFileTypes:!0});for(const f of p){let m=D(e,f.name);if(f.isSymbolicLink())if(r)m=LS(m);else if(i&&ea(m,t,l,u)){yield{isDirectory:Ut(()=>f.isDirectory(),"isDirectory"),isFile:Ut(()=>f.isFile(),"isFile"),isSymbolicLink:Ut(()=>f.isSymbolicLink(),"isSymbolicLink"),name:f.name,path:gu(m)};continue}else continue;f.isDirectory()?yield*un(m,{extensions:t,followSymlinks:r,includeDirs:n,includeFiles:s,includeSymlinks:i,match:l,maxDepth:a-1,skip:u}):f.isFile()&&s&&ea(m,t,l,u)&&(yield{isDirectory:Ut(()=>f.isDirectory(),"isDirectory"),isFile:Ut(()=>f.isFile(),"isFile"),isSymbolicLink:Ut(()=>f.isSymbolicLink(),"isSymbolicLink"),name:f.name,path:gu(m)})}}catch(p){throw p instanceof mh?p:new mh(p,e)}}d(un,"y$H");iy(un,"F");xp(un,"b");Ut(un,"walkSync");var VS=Object.defineProperty,US=d((e,t)=>VS(e,"name",{value:t,configurable:!0}),"p$U"),GS=Object.defineProperty,oy=US((e,t)=>GS(e,"name",{value:t,configurable:!0}),"a");const qS=mt(import.meta.url),wi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ay=oy(e=>{if(typeof wi<"u"&&wi.versions&&wi.versions.node){const[t,r]=wi.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return wi.getBuiltinModule(e)}return qS(e)},"__cjs_getBuiltinModule"),{stat:HS,lstat:zS}=ay("node:fs/promises"),{fileURLToPath:JS}=ay("node:url");var KS=Object.defineProperty,yh=oy((e,t)=>KS(e,"name",{value:t,configurable:!0}),"n");const Do=yh(async(e,t={})=>{if(typeof e!="string"&&!Array.isArray(e)&&typeof e!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const r=t.cwd?Tt(t.cwd):process.cwd();let n=Ke(r);const{root:s}=Mg(n),i=Tt(t.stopAt??s),o=Ke(n,i),a=t.type??"file",c=yh(async function(u){return typeof e=="function"?[await e(u)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]},"getMatchers");t.allowSymlinks??=!0;const l=t.allowSymlinks?HS:zS;for(;n&&n!==o&&n!==s;){const u=await c(n);for(let p of u){if(p===Wg)return;if(p===void 0)continue;Buffer.isBuffer(p)?p=p.toString():p instanceof URL&&(p=JS(p));const f=tn(p)?p:Ke(n,p);try{const m=await l(f);if(a==="file"&&m.isFile()||a==="directory"&&m.isDirectory())return f}catch{}}n=Je(n)}},"findUp");var YS=Object.defineProperty,XS=d((e,t)=>YS(e,"name",{value:t,configurable:!0}),"u$15"),QS=Object.defineProperty,cy=XS((e,t)=>QS(e,"name",{value:t,configurable:!0}),"i");const ZS=mt(import.meta.url),ki=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ly=cy(e=>{if(typeof ki<"u"&&ki.versions&&ki.versions.node){const[t,r]=ki.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ki.getBuiltinModule(e)}return ZS(e)},"__cjs_getBuiltinModule"),{statSync:eD,lstatSync:tD}=ly("node:fs"),{fileURLToPath:rD}=ly("node:url");var nD=Object.defineProperty,vh=cy((e,t)=>nD(e,"name",{value:t,configurable:!0}),"o");const Co=vh((e,t={})=>{if(typeof e!="string"&&!Array.isArray(e)&&typeof e!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const r=t.cwd?Tt(t.cwd):process.cwd();let n=Ke(r);const{root:s}=Mg(n),i=Tt(t.stopAt??s),o=Ke(n,i),a=t.type??"file",c=vh(function(u){return typeof e=="function"?[e(u)]:typeof e=="string"?[e]:Array.isArray(e)?e:[e]},"getMatchers");t.allowSymlinks??=!0;const l=t.allowSymlinks?eD:tD;for(;n&&n!==o&&n!==s;){for(let u of c(n)){if(u===Wg)return;if(u===void 0)continue;Buffer.isBuffer(u)?u=u.toString():u instanceof URL&&(u=rD(u));const p=tn(u)?u:Ke(n,u);try{const f=l(p);if(a==="file"&&f.isFile()||a==="directory"&&f.isDirectory())return p}catch{}}n=Je(n)}},"findUpSync");var sD=Object.defineProperty,uy=d((e,t)=>sD(e,"name",{value:t,configurable:!0}),"t$R"),iD=Object.defineProperty,Op=uy((e,t)=>iD(e,"name",{value:t,configurable:!0}),"s");const oD=mt(import.meta.url),Si=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,aD=Op(e=>{if(typeof Si<"u"&&Si.versions&&Si.versions.node){const[t,r]=Si.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Si.getBuiltinModule(e)}return oD(e)},"__cjs_getBuiltinModule"),{access:cD}=aD("node:fs/promises");var lD=Object.defineProperty,uD=Op((e,t)=>lD(e,"name",{value:t,configurable:!0}),"o");async function xr(e,t=yu){ko(e),e=Tt(e);try{return await cD(e,t),!0}catch{return!1}}d(xr,"i$10");uy(xr,"d");Op(xr,"m");uD(xr,"isAccessible");var pD=Object.defineProperty,dD=d((e,t)=>pD(e,"name",{value:t,configurable:!0}),"f$N"),fD=Object.defineProperty,py=dD((e,t)=>fD(e,"name",{value:t,configurable:!0}),"i");const hD=mt(import.meta.url),Di=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,dy=py(e=>{if(typeof Di<"u"&&Di.versions&&Di.versions.node){const[t,r]=Di.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Di.getBuiltinModule(e)}return hD(e)},"__cjs_getBuiltinModule"),{readFile:mD}=dy("node:fs/promises"),{unzip:gD,brotliDecompress:yD}=dy("node:zlib");var vD=Object.defineProperty,fy=py((e,t)=>vD(e,"name",{value:t,configurable:!0}),"n");const bD={brotli:yD,gzip:gD,none:fy((e,t)=>{t(null,e)},"none")},Pp=fy(async(e,t)=>{if(ko(e),e=Tt(e),!await xr(e))throw new Uk(`unable to read the non-accessible file: ${e}`);if(!await xr(e,Vg))throw new Error(`Unable to read the non-readable file: ${e}`);const{buffer:r,compression:n,encoding:s,flag:i}=t??{};return await mD(e,i?{encoding:s,flag:i}:{encoding:s}).then(async o=>await new Promise((a,c)=>{bD[n??"none"](o,(l,u)=>{l?c(l):a(r?u:u.toString())})})).catch(o=>{throw o})},"readFile");var $D=Object.defineProperty,hy=d((e,t)=>$D(e,"name",{value:t,configurable:!0}),"t$Q"),wD=Object.defineProperty,my=hy((e,t)=>wD(e,"name",{value:t,configurable:!0}),"t"),kD=Object.defineProperty,SD=my((e,t)=>kD(e,"name",{value:t,configurable:!0}),"i");async function Eo(e,t,r){typeof t=="object"&&(r=t,t=void 0);const n=await Pp(e,{buffer:!0,encoding:void 0});let s=new TextDecoder().decode(n);const{beforeParse:i,color:o}=r??{};return typeof i=="function"&&(s=i(s)),Dp(s,t,Tt(e),{color:o})}d(Eo,"a$19");hy(Eo,"l");my(Eo,"c");SD(Eo,"readJson");var DD=Object.defineProperty,CD=d((e,t)=>DD(e,"name",{value:t,configurable:!0}),"a$18"),ED=Object.defineProperty,jD=CD((e,t)=>ED(e,"name",{value:t,configurable:!0}),"t"),AD=Object.defineProperty,xD=jD((e,t)=>AD(e,"name",{value:t,configurable:!0}),"t");const OD=xD(e=>{const t={force:!0,recursive:!0};return e?.maxRetries!==void 0&&(t.maxRetries=e.maxRetries),e?.retryDelay!==void 0&&(t.retryDelay=e.retryDelay),t},"buildRmOptions");var PD=Object.defineProperty,FD=d((e,t)=>PD(e,"name",{value:t,configurable:!0}),"i$_"),BD=Object.defineProperty,gy=FD((e,t)=>BD(e,"name",{value:t,configurable:!0}),"s");const RD=mt(import.meta.url),Ci=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,TD=gy(e=>{if(typeof Ci<"u"&&Ci.versions&&Ci.versions.node){const[t,r]=Ci.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ci.getBuiltinModule(e)}return RD(e)},"__cjs_getBuiltinModule"),{unlinkSync:ND,rmSync:ID}=TD("node:fs");var LD=Object.defineProperty,_D=gy((e,t)=>LD(e,"name",{value:t,configurable:!0}),"o");const MD=_D((e,t={})=>{ko(e);try{ND(e)}catch{}try{ID(e,OD(t))}catch{}},"removeSync");var WD=Object.defineProperty,VD=d((e,t)=>WD(e,"name",{value:t,configurable:!0}),"m$R"),UD=Object.defineProperty,yy=VD((e,t)=>UD(e,"name",{value:t,configurable:!0}),"s");const GD=mt(import.meta.url),Ei=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qD=yy(e=>{if(typeof Ei<"u"&&Ei.versions&&Ei.versions.node){const[t,r]=Ei.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ei.getBuiltinModule(e)}return GD(e)},"__cjs_getBuiltinModule"),{mkdir:HD,writeFile:zD,stat:JD,rename:bh,chown:KD,chmod:YD,unlink:XD}=qD("node:fs/promises");var QD=Object.defineProperty,ZD=yy((e,t)=>QD(e,"name",{value:t,configurable:!0}),"d");const eC=ZD(async(e,t,r)=>{r={encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...r},ko(e),Mk(t),e=Tt(e);const n=`${e}.tmp`;try{const s=await xr(e,yu);if(!s&&r.recursive){const o=Je(e);await xr(o,yu)||await HD(o,{recursive:!0})}let i;if(await zD(n,Wk(t),{encoding:r.encoding,flag:r.flag}),s&&!r.overwrite&&(i=await JD(e),r.chown??={gid:i.gid,uid:i.uid},await bh(e,`${e}.bak`)),r.chown)try{await KD(n,r.chown.uid,r.chown.gid)}catch{}await YD(n,i&&!r.mode?i.mode:r.mode??438),await bh(n,e)}catch(s){throw new Error(`Failed to write file at: ${e} - ${s.message}`,{cause:s})}finally{await xr(n)&&await XD(`${e}.tmp`)}},"writeFile");var tC=Object.defineProperty,rC=d((e,t)=>tC(e,"name",{value:t,configurable:!0}),"a$16"),nC=Object.defineProperty,vy=rC((e,t)=>nC(e,"name",{value:t,configurable:!0}),"n");const sC=mt(import.meta.url),ji=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,iC=vy(e=>{if(typeof ji<"u"&&ji.versions&&ji.versions.node){const[t,r]=ji.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ji.getBuiltinModule(e)}return sC(e)},"__cjs_getBuiltinModule"),{readFile:oC}=iC("node:fs/promises");var aC=Object.defineProperty,cC=vy((e,t)=>aC(e,"name",{value:t,configurable:!0}),"r");const lC=cC(async(e,t,r={})=>{const{detectIndent:n,indent:s,replacer:i,stringify:o=JSON.stringify,...a}={indent:" ",...r};let c=s,l=`
|
|
2
2
|
`;if(await xr(e,Vg))try{const p=await oC(e,"utf8");if(n){const{indent:f}=Vk(p);c=f}l=p.endsWith(`
|
|
3
3
|
`)?`
|
|
4
|
-
`:""}catch(p){if(p.code!=="ENOENT")throw p}const u=o(t,i,c);await eC(e,`${u}${l}`,a)},"writeJson");var uC=Object.defineProperty,pC=d((e,t)=>uC(e,"name",{value:t,configurable:!0}),"r$
|
|
4
|
+
`:""}catch(p){if(p.code!=="ENOENT")throw p}const u=o(t,i,c);await eC(e,`${u}${l}`,a)},"writeJson");var uC=Object.defineProperty,pC=d((e,t)=>uC(e,"name",{value:t,configurable:!0}),"r$Y"),dC=Object.defineProperty,fC=pC((e,t)=>dC(e,"name",{value:t,configurable:!0}),"t"),hC=Object.defineProperty,mC=fC((e,t)=>hC(e,"name",{value:t,configurable:!0}),"t");const Se=mC((e,t)=>async()=>({default:(await e())[t]}),"lazyNamed");var gC=Object.defineProperty,fc=d((e,t)=>gC(e,"name",{value:t,configurable:!0}),"r$X");function by(e,t){return`#compdef ${e}
|
|
5
5
|
compdef _${e} ${e}
|
|
6
6
|
|
|
7
7
|
# zsh completion for ${e} -*- shell-script -*-
|
|
@@ -554,7 +554,7 @@ complete -c ${e} -n '__${r}_clear_perform_completion_once_result'
|
|
|
554
554
|
complete -c ${e} -n 'not __${r}_requires_order_preservation && __${r}_prepare_completions' -f -a '$__${r}_comp_results'
|
|
555
555
|
# Otherwise we use the -k flag
|
|
556
556
|
complete -k -c ${e} -n '__${r}_requires_order_preservation && __${r}_prepare_completions' -f -a '$__${r}_comp_results'
|
|
557
|
-
`}d(wy,"_$
|
|
557
|
+
`}d(wy,"_$r");fc(wy,"r");function ky(e,t){let r=e.replace(/[-:]/g,"_");return`# powershell completion for ${e} -*- shell-script -*-
|
|
558
558
|
|
|
559
559
|
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
|
560
560
|
function __${e}_debug {
|
|
@@ -806,16 +806,16 @@ Register-ArgumentCompleter -CommandName '${e}' -ScriptBlock $__${r}CompleterBloc
|
|
|
806
806
|
`))}};var EC=Object.defineProperty,hr=Fp((e,t)=>EC(e,"name",{value:t,configurable:!0}),"s");const wu=["bash","zsh","fish","powershell"],ku=["node","bun","deno"],jC=hr(e=>"Deno"in e,"hasDeno"),AC=hr(e=>"Bun"in e,"hasBun"),wh=hr(()=>jC(globalThis)?"deno":AC(globalThis)?"bun":"node","detectRuntime"),kh=hr(e=>{const t=e?.starshipShell??e?.shell;if(t){const s=t.toLowerCase();if(s.includes("zsh"))return"zsh";if(s.includes("bash"))return"bash";if(s.includes("fish"))return"fish"}const r=e?.psModulePath,n=e?.prompt;if(r||n?.includes("PS"))return"powershell";if(e?.comSpec?.toLowerCase().includes("cmd.exe"))return"bash"},"detectShell"),Sh=Sy,xC=hr((e,t)=>{for(const r of t)r.hidden||(r.name&&e.option(r.name,r.description??""),r.alias&&e.option(r.alias,r.description??""))},"registerCommandOptions"),OC=hr((e,t)=>{for(const[r,n]of t){if(n.name!==r||n.hidden)continue;const s=e.command(n.name,n.description??"");n.options&&xC(s,n.options)}},"registerCommands"),PC=hr(e=>{if(!wu.includes(e))throw new Bp(`Invalid shell type: ${e}`,"INVALID_SHELL",[`Valid shells are: ${wu.join(", ")}`,"Shell will be auto-detected if not specified"])},"validateShell"),FC=hr(e=>{if(e&&!ku.includes(e))throw new Bp(`Invalid runtime: ${e}`,"INVALID_RUNTIME",[`Valid runtimes are: ${ku.join(", ")}`,"Runtime will be auto-detected if not specified"])},"validateRuntime"),BC=hr((e,t)=>{e.error("Could not detect current shell");const r=[`Usage: ${t} completion --shell=<bash|zsh|fish|powershell> [--runtime=<node|bun|deno>]`,"","Examples:"," # Install completions for zsh:",` ${t} completion --shell=zsh > ~/.${t}-completion.zsh`,` echo 'source ~/.${t}-completion.zsh' >> ~/.zshrc`,""," # Install completions for bash with custom runtime:",` ${t} completion --shell=bash --runtime=bun > ~/.${t}-completion.bash`,` echo 'source ~/.${t}-completion.bash' >> ~/.bashrc`,""," # Install completions for fish:",` ${t} completion --shell=fish > ~/.config/fish/completions/${t}.fish`].join(`
|
|
807
807
|
`);e.info(r)},"printUsageInstructions"),RC={description:"Generate shell completion scripts",env:[{description:"Shell path (Unix-like systems). Used for shell detection.",name:"SHELL",type:String},{description:"Starship shell configuration. Takes precedence over SHELL for detection.",name:"STARSHIP_SHELL",type:String},{description:"PowerShell module path (Windows). Used for PowerShell detection.",name:"PSModulePath",type:String},{description:"Command prompt variable (Windows). Used for PowerShell detection.",name:"PROMPT",type:String},{description:"Command processor (Windows). Used for Windows Command Prompt detection.",name:"ComSpec",type:String}],execute:hr(async({env:e,logger:t,options:r,runtime:n})=>{const s=n.getCliName(),i=r.shell??kh(e);if(!i){BC(t,s);return}try{PC(i),FC(r.runtime),OC(Sh,n.getCommands());const o=`${r.runtime??wh()} ${s}`;Sh.setup(s,o,i)}catch(o){if(o instanceof Bp){const a=[`Failed to generate completion script: ${o.message}`,`Error code: ${o.code}`];throw o.troubleshooting.length>0&&a.push("","Troubleshooting:",...o.troubleshooting.map(c=>` • ${c}`)),t.error(a.join(`
|
|
808
808
|
`)),o}else{const a=["Failed to generate completion script",`Error: ${o instanceof Error?o.message:String(o)}`,"","Troubleshooting:"," • Ensure @bomb.sh/tab is installed: pnpm add @bomb.sh/tab",` • Verify shell is supported: ${wu.join(", ")}`,` • Verify runtime is supported: ${ku.join(", ")}`," • Check that your CLI name is correct"];t.error(a.join(`
|
|
809
|
-
`))}}},"execute"),name:"completion",options:[{defaultOption:!0,defaultValue:kh(),description:"Shell type (bash, zsh, fish, powershell). Defaults to current shell if detected.",name:"shell",type:String,typeLabel:"{underline shell}"},{defaultOption:!0,defaultValue:wh(),description:"JavaScript runtime (node, bun, deno). Defaults to current runtime if detected.",name:"runtime",type:String,typeLabel:"{underline runtime}"}]};var TC=Object.defineProperty,NC=d((e,t)=>TC(e,"name",{value:t,configurable:!0}),"o$14"),IC=Object.defineProperty,LC=NC((e,t)=>IC(e,"name",{value:t,configurable:!0}),"r"),_C=Object.defineProperty,MC=LC((e,t)=>_C(e,"name",{value:t,configurable:!0}),"s");const WC={alias:["v","V"],description:"Output the version number",execute:MC(({logger:e,runtime:t})=>{const r=t.getPackageVersion();r===void 0?(e.warn("Unknown version"),e.debug("The version number was not provided by the cli constructor.")):e.info(r)},"execute"),name:"version",options:[],usage:[]};var VC=Object.defineProperty,Cy=d((e,t)=>VC(e,"name",{value:t,configurable:!0}),"o$13"),UC=Object.defineProperty,Ey=Cy((e,t)=>UC(e,"name",{value:t,configurable:!0}),"o"),GC=Object.defineProperty,qC=Ey((e,t)=>GC(e,"name",{value:t,configurable:!0}),"o");let Bs=class extends Error{static{d(this,"s")}static{Cy(this,"u")}static{Ey(this,"n")}static{qC(this,"NotFoundError")}constructor(t){super(`ENOENT: ${t}`)}get code(){return"ENOENT"}set code(t){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(t){throw new Error("Cannot overwrite name of NotFoundError")}};const jy=["npm","yarn","yarn@berry","pnpm","pnpm@6","bun","deno"],Dh={"bun.lock":"bun","bun.lockb":"bun","deno.lock":"deno","pnpm-lock.yaml":"pnpm","pnpm-workspace.yaml":"pnpm","yarn.lock":"yarn","package-lock.json":"npm","npm-shrinkwrap.json":"npm"},Ch={"node_modules/.deno/":"deno","node_modules/.pnpm/":"pnpm","node_modules/.yarn-state.yml":"yarn","node_modules/.yarn_integrity":"yarn","node_modules/.package-lock.json":"npm",".pnp.cjs":"yarn",".pnp.js":"yarn","bun.lock":"bun","bun.lockb":"bun"};var HC=Object.defineProperty,mr=d((e,t)=>HC(e,"name",{value:t,configurable:!0}),"i$Z");async function Ta(e,t){try{const r=await Cp.stat(e);return t==="file"?r.isFile():r.isDirectory()}catch{return!1}}d(Ta,"u$Y");mr(Ta,"pathExists");function zC(){const e=Gs.env.npm_config_user_agent;if(!e)return null;const t=e.split("/")[0];return jy.includes(t)?t:null}d(zC,"b$B");mr(zC,"getUserAgent");function*Ay(e=Gs.cwd()){let t=jr.resolve(e);const{root:r}=jr.parse(t);for(;t&&t!==r;)yield t,t=jr.dirname(t)}d(Ay,"M$p");mr(Ay,"lookup");async function Su(e,t){return!e||!await Ta(e,"file")?null:await Py(e,t)}d(Su,"m$N");mr(Su,"parsePackageJson");async function xy(e={}){const{cwd:t,strategies:r=["lockfile","packageManager-field","devEngines-field"]}=e;let n;if(typeof e.stopDir=="string"){const s=jr.resolve(e.stopDir);n=mr(i=>i===s,"stopDir")}else n=e.stopDir;for(const s of Ay(t)){for(const i of r)switch(i){case"lockfile":{for(const o of Object.keys(Dh))if(await Ta(jr.join(s,o),"file")){const a=Dh[o];return await Su(jr.join(s,"package.json"),e)||{name:a,agent:a}}break}case"packageManager-field":case"devEngines-field":{const o=await Su(jr.join(s,"package.json"),e);if(o)return o;break}case"install-metadata":{for(const o of Object.keys(Ch)){const a=o.endsWith("/")?"dir":"file";if(await Ta(jr.join(s,o),a)){const c=Ch[o],l=c==="yarn"?Fy(o)?"yarn":"yarn@berry":c;return{name:c,agent:l}}}break}}if(n?.(s))break}return null}d(xy,"A$w");mr(xy,"detect");function Oy(e){const t=mr(r=>r?.match(/\d+(\.\d+){0,2}/)?.[0]??r,"handelVer");if(typeof e.packageManager=="string"){const[r,n]=e.packageManager.replace(/^\^/,"").split("@");return{name:r,ver:t(n)}}if(typeof e.devEngines?.packageManager?.name=="string")return{name:e.devEngines.packageManager.name,ver:t(e.devEngines.packageManager.version)}}d(Oy,"h$B");mr(Oy,"getNameAndVer");async function Py(e,t){try{const r=await Cp.readFile(e,"utf8"),n=t.packageJsonParser?await t.packageJsonParser(r,e):JSON.parse(r);let s;const i=Oy(n);if(i){const o=i.name,a=i.ver;let c=a;return o==="yarn"&&a&&Number.parseInt(a)>1?(s="yarn@berry",c="berry",{name:o,agent:s,version:c}):o==="pnpm"&&a&&Number.parseInt(a)<7?(s="pnpm@6",{name:o,agent:s,version:c}):jy.includes(o)?(s=o,{name:o,agent:s,version:c}):t.onUnknown?.(n.packageManager)??null}}catch{}return null}d(Py,"j$p");mr(Py,"handlePackageManager");function Fy(e){return e.endsWith(".yarn_integrity")}d(Fy,"E$t");mr(Fy,"isMetadataYarnClassic");var JC=Object.defineProperty,Rp=d((e,t)=>JC(e,"name",{value:t,configurable:!0}),"i$Y");async function Tp(e=Gs.cwd()){return(await xy({cwd:e,onUnknown(t){console.warn("[@antfu/install-pkg] Unknown packageManager:",t)}}))?.agent||null}d(Tp,"c$S");Rp(Tp,"detectPackageManager");async function By(e,t={}){const r=t.packageManager||await Tp(t.cwd)||"npm",[n]=r.split("@");Array.isArray(e)||(e=[e]);const s=(typeof t.additionalArgs=="function"?t.additionalArgs(n,r):t.additionalArgs)||[];return t.preferOffline&&(r==="yarn@berry"?s.unshift("--cached"):s.unshift("--prefer-offline")),n==="pnpm"&&(s.unshift("--prod=false"),pc(Ps(t.cwd??Gs.cwd(),"pnpm-workspace.yaml"))&&s.unshift("-w")),qg(n,[n==="yarn"?"add":"install",t.dev?"-D":"",...s,...e].filter(Boolean),{nodeOptions:{stdio:t.silent?"ignore":"inherit",cwd:t.cwd},throwOnError:!0})}d(By,"p$O");Rp(By,"installPackage");async function KC(e,t={}){const r=t.packageManager||await Tp(t.cwd)||"npm",[n]=r.split("@");Array.isArray(e)||(e=[e]);const s=t.additionalArgs||[];return n==="pnpm"&&pc(Ps(t.cwd??Gs.cwd(),"pnpm-workspace.yaml"))&&s.unshift("-w"),qg(n,[n==="yarn"?"remove":"uninstall",t.dev?"-D":"",...s,...e].filter(Boolean),{nodeOptions:{stdio:t.silent?"ignore":"inherit",cwd:t.cwd},throwOnError:!0})}d(KC,"h$A");Rp(KC,"uninstallPackage");var YC=Object.defineProperty,Nr=d((e,t)=>YC(e,"name",{value:t,configurable:!0}),"c$R");const Np=Symbol.for("yaml.alias"),Du=Symbol.for("yaml.document"),Yr=Symbol.for("yaml.map"),Ry=Symbol.for("yaml.pair"),lr=Symbol.for("yaml.scalar"),Hs=Symbol.for("yaml.seq"),It=Symbol.for("yaml.node.type"),zs=Nr(e=>!!e&&typeof e=="object"&&e[It]===Np,"isAlias"),Js=Nr(e=>!!e&&typeof e=="object"&&e[It]===Du,"isDocument"),Ao=Nr(e=>!!e&&typeof e=="object"&&e[It]===Yr,"isMap"),We=Nr(e=>!!e&&typeof e=="object"&&e[It]===Ry,"isPair"),Fe=Nr(e=>!!e&&typeof e=="object"&&e[It]===lr,"isScalar"),xo=Nr(e=>!!e&&typeof e=="object"&&e[It]===Hs,"isSeq");function _e(e){if(e&&typeof e=="object")switch(e[It]){case Yr:case Hs:return!0}return!1}d(_e,"i$X");Nr(_e,"isCollection");function Me(e){if(e&&typeof e=="object")switch(e[It]){case Np:case Yr:case lr:case Hs:return!0}return!1}d(Me,"A$v");Nr(Me,"isNode");const Ty=Nr(e=>(Fe(e)||_e(e))&&!!e.anchor,"hasAnchor");var XC=Object.defineProperty,Kn=d((e,t)=>XC(e,"name",{value:t,configurable:!0}),"r$W");const vt=Symbol("break visit"),Ny=Symbol("skip children"),nr=Symbol("remove node");function Yn(e,t){const r=Ip(t);Js(e)?Cn(null,e.contents,r,Object.freeze([e]))===nr&&(e.contents=null):Cn(null,e,r,Object.freeze([]))}d(Yn,"S$u");Kn(Yn,"visit");Yn.BREAK=vt;Yn.SKIP=Ny;Yn.REMOVE=nr;function Cn(e,t,r,n){const s=Lp(e,t,r,n);if(Me(s)||We(s))return _p(e,n,s),Cn(e,s,r,n);if(typeof s!="symbol"){if(_e(t)){n=Object.freeze(n.concat(t));for(let i=0;i<t.items.length;++i){const o=Cn(i,t.items[i],r,n);if(typeof o=="number")i=o-1;else{if(o===vt)return vt;o===nr&&(t.items.splice(i,1),i-=1)}}}else if(We(t)){n=Object.freeze(n.concat(t));const i=Cn("key",t.key,r,n);if(i===vt)return vt;i===nr&&(t.key=null);const o=Cn("value",t.value,r,n);if(o===vt)return vt;o===nr&&(t.value=null)}}return s}d(Cn,"a$12");Kn(Cn,"visit_");async function hc(e,t){const r=Ip(t);Js(e)?await En(null,e.contents,r,Object.freeze([e]))===nr&&(e.contents=null):await En(null,e,r,Object.freeze([]))}d(hc,"y$C");Kn(hc,"visitAsync");hc.BREAK=vt;hc.SKIP=Ny;hc.REMOVE=nr;async function En(e,t,r,n){const s=await Lp(e,t,r,n);if(Me(s)||We(s))return _p(e,n,s),En(e,s,r,n);if(typeof s!="symbol"){if(_e(t)){n=Object.freeze(n.concat(t));for(let i=0;i<t.items.length;++i){const o=await En(i,t.items[i],r,n);if(typeof o=="number")i=o-1;else{if(o===vt)return vt;o===nr&&(t.items.splice(i,1),i-=1)}}}else if(We(t)){n=Object.freeze(n.concat(t));const i=await En("key",t.key,r,n);if(i===vt)return vt;i===nr&&(t.key=null);const o=await En("value",t.value,r,n);if(o===vt)return vt;o===nr&&(t.value=null)}}return s}d(En,"b$z");Kn(En,"visitAsync_");function Ip(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}d(Ip,"z$e");Kn(Ip,"initVisitor");function Lp(e,t,r,n){if(typeof r=="function")return r(e,t,n);if(Ao(t))return r.Map?.(e,t,n);if(xo(t))return r.Seq?.(e,t,n);if(We(t))return r.Pair?.(e,t,n);if(Fe(t))return r.Scalar?.(e,t,n);if(zs(t))return r.Alias?.(e,t,n)}d(Lp,"A$u");Kn(Lp,"callVisitor");function _p(e,t,r){const n=t[t.length-1];if(_e(n))n.items[e]=r;else if(We(n))e==="key"?n.key=r:n.value=r;else if(Js(n))n.contents=r;else{const s=zs(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}d(_p,"M$o");Kn(_p,"replaceNode");var QC=Object.defineProperty,Iy=d((e,t)=>QC(e,"name",{value:t,configurable:!0}),"h$y");const ZC={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},eE=Iy(e=>e.replace(/[!,[\]{}]/g,t=>ZC[t]),"escapeTagName");let Ds=class kr{static{d(this,"n")}static{Iy(this,"Directives")}constructor(t,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},kr.defaultYaml,t),this.tags=Object.assign({},kr.defaultTags,r)}clone(){const t=new kr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new kr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:kr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},kr.defaultTags);break}return t}add(t,r){this.atNextDocument&&(this.yaml={explicit:kr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},kr.defaultTags),this.atNextDocument=!1);const n=t.trim().split(/[ \t]+/),s=n.shift();switch(s){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[i,o]=n;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;const[i]=n;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const o=/^\d+\.\d+$/.test(i);return r(6,`Unsupported YAML version ${i}`,o),!1}}default:return r(0,`Unknown directive ${s}`,!0),!1}}tagName(t,r){if(t==="!")return"!";if(t[0]!=="!")return r(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}const[,n,s]=t.match(/^(.*!)([^!]*)$/s);s||r(`The ${t} tag has no suffix`);const i=this.tags[n];if(i)try{return i+decodeURIComponent(s)}catch(o){return r(String(o)),null}return n==="!"?t:(r(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[r,n]of Object.entries(this.tags))if(t.startsWith(n))return r+eE(t.substring(n.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let s;if(t&&n.length>0&&Me(t.contents)){const i={};Yn(t.contents,(o,a)=>{Me(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,o]of n)i==="!!"&&o==="tag:yaml.org,2002:"||(!t||s.some(a=>a.startsWith(o)))&&r.push(`%TAG ${i} ${o}`);return r.join(`
|
|
810
|
-
`)}};Ds.defaultYaml={explicit:!1,version:"1.2"};Ds.defaultTags={"!!":"tag:yaml.org,2002:"};var tE=Object.defineProperty,Rs=d((e,t)=>tE(e,"name",{value:t,configurable:!0}),"c$Q");function Mp(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(t)}return!0}d(Mp,"m$L");Rs(Mp,"anchorIsValid");function Wp(e){const t=new Set;return Yn(e,{Value(r,n){n.anchor&&t.add(n.anchor)}}),t}d(Wp,"h$x");Rs(Wp,"anchorNames");function Vp(e,t){for(let r=1;;++r){const n=`${e}${r}`;if(!t.has(n))return n}}d(Vp,"u$V");Rs(Vp,"findNewAnchor");function Ly(e,t){const r=[],n=new Map;let s=null;return{onAnchor:Rs(i=>{r.push(i),s??(s=Wp(e));const o=Vp(t,s);return s.add(o),o},"onAnchor"),setAnchors:Rs(()=>{for(const i of r){const o=n.get(i);if(typeof o=="object"&&o.anchor&&(Fe(o.node)||_e(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},"setAnchors"),sourceObjects:n}}d(Ly,"w$t");Rs(Ly,"createNodeAnchors");var rE=Object.defineProperty,nE=d((e,t)=>rE(e,"name",{value:t,configurable:!0}),"d$M");function jn(e,t,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let s=0,i=n.length;s<i;++s){const o=n[s],a=jn(e,n,String(s),o);a===void 0?delete n[s]:a!==o&&(n[s]=a)}else if(n instanceof Map)for(const s of Array.from(n.keys())){const i=n.get(s),o=jn(e,n,s,i);o===void 0?n.delete(s):o!==i&&n.set(s,o)}else if(n instanceof Set)for(const s of Array.from(n)){const i=jn(e,n,s,s);i===void 0?n.delete(s):i!==s&&(n.delete(s),n.add(i))}else for(const[s,i]of Object.entries(n)){const o=jn(e,n,s,i);o===void 0?delete n[s]:o!==i&&(n[s]=o)}return e.call(t,r,n)}d(jn,"s$S");nE(jn,"applyReviver");var sE=Object.defineProperty,iE=d((e,t)=>sE(e,"name",{value:t,configurable:!0}),"i$
|
|
809
|
+
`))}}},"execute"),name:"completion",options:[{defaultOption:!0,defaultValue:kh(),description:"Shell type (bash, zsh, fish, powershell). Defaults to current shell if detected.",name:"shell",type:String,typeLabel:"{underline shell}"},{defaultOption:!0,defaultValue:wh(),description:"JavaScript runtime (node, bun, deno). Defaults to current runtime if detected.",name:"runtime",type:String,typeLabel:"{underline runtime}"}]};var TC=Object.defineProperty,NC=d((e,t)=>TC(e,"name",{value:t,configurable:!0}),"o$14"),IC=Object.defineProperty,LC=NC((e,t)=>IC(e,"name",{value:t,configurable:!0}),"r"),_C=Object.defineProperty,MC=LC((e,t)=>_C(e,"name",{value:t,configurable:!0}),"s");const WC={alias:["v","V"],description:"Output the version number",execute:MC(({logger:e,runtime:t})=>{const r=t.getPackageVersion();r===void 0?(e.warn("Unknown version"),e.debug("The version number was not provided by the cli constructor.")):e.info(r)},"execute"),name:"version",options:[],usage:[]};var VC=Object.defineProperty,Cy=d((e,t)=>VC(e,"name",{value:t,configurable:!0}),"o$13"),UC=Object.defineProperty,Ey=Cy((e,t)=>UC(e,"name",{value:t,configurable:!0}),"o"),GC=Object.defineProperty,qC=Ey((e,t)=>GC(e,"name",{value:t,configurable:!0}),"o");let Bs=class extends Error{static{d(this,"s")}static{Cy(this,"u")}static{Ey(this,"n")}static{qC(this,"NotFoundError")}constructor(t){super(`ENOENT: ${t}`)}get code(){return"ENOENT"}set code(t){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(t){throw new Error("Cannot overwrite name of NotFoundError")}};const jy=["npm","yarn","yarn@berry","pnpm","pnpm@6","bun","deno"],Dh={"bun.lock":"bun","bun.lockb":"bun","deno.lock":"deno","pnpm-lock.yaml":"pnpm","pnpm-workspace.yaml":"pnpm","yarn.lock":"yarn","package-lock.json":"npm","npm-shrinkwrap.json":"npm"},Ch={"node_modules/.deno/":"deno","node_modules/.pnpm/":"pnpm","node_modules/.yarn-state.yml":"yarn","node_modules/.yarn_integrity":"yarn","node_modules/.package-lock.json":"npm",".pnp.cjs":"yarn",".pnp.js":"yarn","bun.lock":"bun","bun.lockb":"bun"};var HC=Object.defineProperty,mr=d((e,t)=>HC(e,"name",{value:t,configurable:!0}),"i$Y");async function Ta(e,t){try{const r=await Cp.stat(e);return t==="file"?r.isFile():r.isDirectory()}catch{return!1}}d(Ta,"u$Y");mr(Ta,"pathExists");function zC(){const e=Gs.env.npm_config_user_agent;if(!e)return null;const t=e.split("/")[0];return jy.includes(t)?t:null}d(zC,"b$B");mr(zC,"getUserAgent");function*Ay(e=Gs.cwd()){let t=jr.resolve(e);const{root:r}=jr.parse(t);for(;t&&t!==r;)yield t,t=jr.dirname(t)}d(Ay,"M$p");mr(Ay,"lookup");async function Su(e,t){return!e||!await Ta(e,"file")?null:await Py(e,t)}d(Su,"m$N");mr(Su,"parsePackageJson");async function xy(e={}){const{cwd:t,strategies:r=["lockfile","packageManager-field","devEngines-field"]}=e;let n;if(typeof e.stopDir=="string"){const s=jr.resolve(e.stopDir);n=mr(i=>i===s,"stopDir")}else n=e.stopDir;for(const s of Ay(t)){for(const i of r)switch(i){case"lockfile":{for(const o of Object.keys(Dh))if(await Ta(jr.join(s,o),"file")){const a=Dh[o];return await Su(jr.join(s,"package.json"),e)||{name:a,agent:a}}break}case"packageManager-field":case"devEngines-field":{const o=await Su(jr.join(s,"package.json"),e);if(o)return o;break}case"install-metadata":{for(const o of Object.keys(Ch)){const a=o.endsWith("/")?"dir":"file";if(await Ta(jr.join(s,o),a)){const c=Ch[o],l=c==="yarn"?Fy(o)?"yarn":"yarn@berry":c;return{name:c,agent:l}}}break}}if(n?.(s))break}return null}d(xy,"A$w");mr(xy,"detect");function Oy(e){const t=mr(r=>r?.match(/\d+(\.\d+){0,2}/)?.[0]??r,"handelVer");if(typeof e.packageManager=="string"){const[r,n]=e.packageManager.replace(/^\^/,"").split("@");return{name:r,ver:t(n)}}if(typeof e.devEngines?.packageManager?.name=="string")return{name:e.devEngines.packageManager.name,ver:t(e.devEngines.packageManager.version)}}d(Oy,"h$B");mr(Oy,"getNameAndVer");async function Py(e,t){try{const r=await Cp.readFile(e,"utf8"),n=t.packageJsonParser?await t.packageJsonParser(r,e):JSON.parse(r);let s;const i=Oy(n);if(i){const o=i.name,a=i.ver;let c=a;return o==="yarn"&&a&&Number.parseInt(a)>1?(s="yarn@berry",c="berry",{name:o,agent:s,version:c}):o==="pnpm"&&a&&Number.parseInt(a)<7?(s="pnpm@6",{name:o,agent:s,version:c}):jy.includes(o)?(s=o,{name:o,agent:s,version:c}):t.onUnknown?.(n.packageManager)??null}}catch{}return null}d(Py,"j$p");mr(Py,"handlePackageManager");function Fy(e){return e.endsWith(".yarn_integrity")}d(Fy,"E$t");mr(Fy,"isMetadataYarnClassic");var JC=Object.defineProperty,Rp=d((e,t)=>JC(e,"name",{value:t,configurable:!0}),"i$X");async function Tp(e=Gs.cwd()){return(await xy({cwd:e,onUnknown(t){console.warn("[@antfu/install-pkg] Unknown packageManager:",t)}}))?.agent||null}d(Tp,"c$S");Rp(Tp,"detectPackageManager");async function By(e,t={}){const r=t.packageManager||await Tp(t.cwd)||"npm",[n]=r.split("@");Array.isArray(e)||(e=[e]);const s=(typeof t.additionalArgs=="function"?t.additionalArgs(n,r):t.additionalArgs)||[];return t.preferOffline&&(r==="yarn@berry"?s.unshift("--cached"):s.unshift("--prefer-offline")),n==="pnpm"&&(s.unshift("--prod=false"),pc(Ps(t.cwd??Gs.cwd(),"pnpm-workspace.yaml"))&&s.unshift("-w")),qg(n,[n==="yarn"?"add":"install",t.dev?"-D":"",...s,...e].filter(Boolean),{nodeOptions:{stdio:t.silent?"ignore":"inherit",cwd:t.cwd},throwOnError:!0})}d(By,"p$O");Rp(By,"installPackage");async function KC(e,t={}){const r=t.packageManager||await Tp(t.cwd)||"npm",[n]=r.split("@");Array.isArray(e)||(e=[e]);const s=t.additionalArgs||[];return n==="pnpm"&&pc(Ps(t.cwd??Gs.cwd(),"pnpm-workspace.yaml"))&&s.unshift("-w"),qg(n,[n==="yarn"?"remove":"uninstall",t.dev?"-D":"",...s,...e].filter(Boolean),{nodeOptions:{stdio:t.silent?"ignore":"inherit",cwd:t.cwd},throwOnError:!0})}d(KC,"h$A");Rp(KC,"uninstallPackage");var YC=Object.defineProperty,Nr=d((e,t)=>YC(e,"name",{value:t,configurable:!0}),"c$R");const Np=Symbol.for("yaml.alias"),Du=Symbol.for("yaml.document"),Yr=Symbol.for("yaml.map"),Ry=Symbol.for("yaml.pair"),lr=Symbol.for("yaml.scalar"),Hs=Symbol.for("yaml.seq"),It=Symbol.for("yaml.node.type"),zs=Nr(e=>!!e&&typeof e=="object"&&e[It]===Np,"isAlias"),Js=Nr(e=>!!e&&typeof e=="object"&&e[It]===Du,"isDocument"),Ao=Nr(e=>!!e&&typeof e=="object"&&e[It]===Yr,"isMap"),We=Nr(e=>!!e&&typeof e=="object"&&e[It]===Ry,"isPair"),Fe=Nr(e=>!!e&&typeof e=="object"&&e[It]===lr,"isScalar"),xo=Nr(e=>!!e&&typeof e=="object"&&e[It]===Hs,"isSeq");function _e(e){if(e&&typeof e=="object")switch(e[It]){case Yr:case Hs:return!0}return!1}d(_e,"i$W");Nr(_e,"isCollection");function Me(e){if(e&&typeof e=="object")switch(e[It]){case Np:case Yr:case lr:case Hs:return!0}return!1}d(Me,"A$v");Nr(Me,"isNode");const Ty=Nr(e=>(Fe(e)||_e(e))&&!!e.anchor,"hasAnchor");var XC=Object.defineProperty,Kn=d((e,t)=>XC(e,"name",{value:t,configurable:!0}),"r$V");const vt=Symbol("break visit"),Ny=Symbol("skip children"),nr=Symbol("remove node");function Yn(e,t){const r=Ip(t);Js(e)?Cn(null,e.contents,r,Object.freeze([e]))===nr&&(e.contents=null):Cn(null,e,r,Object.freeze([]))}d(Yn,"S$u");Kn(Yn,"visit");Yn.BREAK=vt;Yn.SKIP=Ny;Yn.REMOVE=nr;function Cn(e,t,r,n){const s=Lp(e,t,r,n);if(Me(s)||We(s))return _p(e,n,s),Cn(e,s,r,n);if(typeof s!="symbol"){if(_e(t)){n=Object.freeze(n.concat(t));for(let i=0;i<t.items.length;++i){const o=Cn(i,t.items[i],r,n);if(typeof o=="number")i=o-1;else{if(o===vt)return vt;o===nr&&(t.items.splice(i,1),i-=1)}}}else if(We(t)){n=Object.freeze(n.concat(t));const i=Cn("key",t.key,r,n);if(i===vt)return vt;i===nr&&(t.key=null);const o=Cn("value",t.value,r,n);if(o===vt)return vt;o===nr&&(t.value=null)}}return s}d(Cn,"a$12");Kn(Cn,"visit_");async function hc(e,t){const r=Ip(t);Js(e)?await En(null,e.contents,r,Object.freeze([e]))===nr&&(e.contents=null):await En(null,e,r,Object.freeze([]))}d(hc,"y$C");Kn(hc,"visitAsync");hc.BREAK=vt;hc.SKIP=Ny;hc.REMOVE=nr;async function En(e,t,r,n){const s=await Lp(e,t,r,n);if(Me(s)||We(s))return _p(e,n,s),En(e,s,r,n);if(typeof s!="symbol"){if(_e(t)){n=Object.freeze(n.concat(t));for(let i=0;i<t.items.length;++i){const o=await En(i,t.items[i],r,n);if(typeof o=="number")i=o-1;else{if(o===vt)return vt;o===nr&&(t.items.splice(i,1),i-=1)}}}else if(We(t)){n=Object.freeze(n.concat(t));const i=await En("key",t.key,r,n);if(i===vt)return vt;i===nr&&(t.key=null);const o=await En("value",t.value,r,n);if(o===vt)return vt;o===nr&&(t.value=null)}}return s}d(En,"b$z");Kn(En,"visitAsync_");function Ip(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}d(Ip,"z$e");Kn(Ip,"initVisitor");function Lp(e,t,r,n){if(typeof r=="function")return r(e,t,n);if(Ao(t))return r.Map?.(e,t,n);if(xo(t))return r.Seq?.(e,t,n);if(We(t))return r.Pair?.(e,t,n);if(Fe(t))return r.Scalar?.(e,t,n);if(zs(t))return r.Alias?.(e,t,n)}d(Lp,"A$u");Kn(Lp,"callVisitor");function _p(e,t,r){const n=t[t.length-1];if(_e(n))n.items[e]=r;else if(We(n))e==="key"?n.key=r:n.value=r;else if(Js(n))n.contents=r;else{const s=zs(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${s} parent`)}}d(_p,"M$o");Kn(_p,"replaceNode");var QC=Object.defineProperty,Iy=d((e,t)=>QC(e,"name",{value:t,configurable:!0}),"h$y");const ZC={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},eE=Iy(e=>e.replace(/[!,[\]{}]/g,t=>ZC[t]),"escapeTagName");let Ds=class kr{static{d(this,"n")}static{Iy(this,"Directives")}constructor(t,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},kr.defaultYaml,t),this.tags=Object.assign({},kr.defaultTags,r)}clone(){const t=new kr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new kr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:kr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},kr.defaultTags);break}return t}add(t,r){this.atNextDocument&&(this.yaml={explicit:kr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},kr.defaultTags),this.atNextDocument=!1);const n=t.trim().split(/[ \t]+/),s=n.shift();switch(s){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[i,o]=n;return this.tags[i]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;const[i]=n;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const o=/^\d+\.\d+$/.test(i);return r(6,`Unsupported YAML version ${i}`,o),!1}}default:return r(0,`Unknown directive ${s}`,!0),!1}}tagName(t,r){if(t==="!")return"!";if(t[0]!=="!")return r(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}const[,n,s]=t.match(/^(.*!)([^!]*)$/s);s||r(`The ${t} tag has no suffix`);const i=this.tags[n];if(i)try{return i+decodeURIComponent(s)}catch(o){return r(String(o)),null}return n==="!"?t:(r(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[r,n]of Object.entries(this.tags))if(t.startsWith(n))return r+eE(t.substring(n.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let s;if(t&&n.length>0&&Me(t.contents)){const i={};Yn(t.contents,(o,a)=>{Me(a)&&a.tag&&(i[a.tag]=!0)}),s=Object.keys(i)}else s=[];for(const[i,o]of n)i==="!!"&&o==="tag:yaml.org,2002:"||(!t||s.some(a=>a.startsWith(o)))&&r.push(`%TAG ${i} ${o}`);return r.join(`
|
|
810
|
+
`)}};Ds.defaultYaml={explicit:!1,version:"1.2"};Ds.defaultTags={"!!":"tag:yaml.org,2002:"};var tE=Object.defineProperty,Rs=d((e,t)=>tE(e,"name",{value:t,configurable:!0}),"c$Q");function Mp(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(t)}return!0}d(Mp,"m$L");Rs(Mp,"anchorIsValid");function Wp(e){const t=new Set;return Yn(e,{Value(r,n){n.anchor&&t.add(n.anchor)}}),t}d(Wp,"h$x");Rs(Wp,"anchorNames");function Vp(e,t){for(let r=1;;++r){const n=`${e}${r}`;if(!t.has(n))return n}}d(Vp,"u$V");Rs(Vp,"findNewAnchor");function Ly(e,t){const r=[],n=new Map;let s=null;return{onAnchor:Rs(i=>{r.push(i),s??(s=Wp(e));const o=Vp(t,s);return s.add(o),o},"onAnchor"),setAnchors:Rs(()=>{for(const i of r){const o=n.get(i);if(typeof o=="object"&&o.anchor&&(Fe(o.node)||_e(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},"setAnchors"),sourceObjects:n}}d(Ly,"w$t");Rs(Ly,"createNodeAnchors");var rE=Object.defineProperty,nE=d((e,t)=>rE(e,"name",{value:t,configurable:!0}),"d$M");function jn(e,t,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let s=0,i=n.length;s<i;++s){const o=n[s],a=jn(e,n,String(s),o);a===void 0?delete n[s]:a!==o&&(n[s]=a)}else if(n instanceof Map)for(const s of Array.from(n.keys())){const i=n.get(s),o=jn(e,n,s,i);o===void 0?n.delete(s):o!==i&&n.set(s,o)}else if(n instanceof Set)for(const s of Array.from(n)){const i=jn(e,n,s,s);i===void 0?n.delete(s):i!==s&&(n.delete(s),n.add(i))}else for(const[s,i]of Object.entries(n)){const o=jn(e,n,s,i);o===void 0?delete n[s]:o!==i&&(n[s]=o)}return e.call(t,r,n)}d(jn,"s$S");nE(jn,"applyReviver");var sE=Object.defineProperty,iE=d((e,t)=>sE(e,"name",{value:t,configurable:!0}),"i$U");function Ct(e,t,r){if(Array.isArray(e))return e.map((n,s)=>Ct(n,String(s),r));if(e&&typeof e.toJSON=="function"){if(!r||!Ty(e))return e.toJSON(t,r);const n={aliasCount:0,count:1,res:void 0};r.anchors.set(e,n),r.onCreate=i=>{n.res=i,delete r.onCreate};const s=e.toJSON(t,r);return r.onCreate&&r.onCreate(s),s}return typeof e=="bigint"&&!r?.keep?Number(e):e}d(Ct,"f$F");iE(Ct,"toJS");var oE=Object.defineProperty,aE=d((e,t)=>oE(e,"name",{value:t,configurable:!0}),"i$T");let Up=class{static{d(this,"O")}static{aE(this,"NodeBase")}constructor(t){Object.defineProperty(this,It,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:r,maxAliasCount:n,onAnchor:s,reviver:i}={}){if(!Js(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},a=Ct(this,"",o);if(typeof s=="function")for(const{count:c,res:l}of o.anchors.values())s(l,c);return typeof i=="function"?jn(i,{"":a},"",a):a}};var cE=Object.defineProperty,Cu=d((e,t)=>cE(e,"name",{value:t,configurable:!0}),"u$T");let Gp=class extends Up{static{d(this,"b")}static{Cu(this,"Alias")}constructor(t){super(Np),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],Yn(t,{Node:Cu((i,o)=>{(zs(o)||Ty(o))&&n.push(o)},"Node")}),r&&(r.aliasResolveCache=n));let s;for(const i of n){if(i===this)break;i.anchor===this.source&&(s=i)}return s}toJSON(t,r){if(!r)return{source:this.source};const{anchors:n,doc:s,maxAliasCount:i}=r,o=this.resolve(s,r);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=n.get(o);if(a||(Ct(o,null,r),a=n.get(o)),a?.res===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=to(s,o,n)),a.count*a.aliasCount>i)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(t,r,n){const s=`*${this.source}`;if(t){if(Mp(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(t.implicitKey)return`${s} `}return s}};function to(e,t,r){if(zs(t)){const n=t.resolve(e),s=r&&n&&r.get(n);return s?s.count*s.aliasCount:0}else if(_e(t)){let n=0;for(const s of t.items){const i=to(e,s,r);i>n&&(n=i)}return n}else if(We(t)){const n=to(e,t.key,r),s=to(e,t.value,r);return Math.max(n,s)}return 1}d(to,"c$P");Cu(to,"getAliasCount");var lE=Object.defineProperty,_y=d((e,t)=>lE(e,"name",{value:t,configurable:!0}),"L$q");const My=_y(e=>!e||typeof e!="function"&&typeof e!="object","isScalarValue");let se=class extends Up{static{d(this,"o")}static{_y(this,"Scalar")}constructor(t){super(lr),this.value=t}toJSON(t,r){return r?.keep?this.value:Ct(this.value,t,r)}toString(){return String(this.value)}};se.BLOCK_FOLDED="BLOCK_FOLDED";se.BLOCK_LITERAL="BLOCK_LITERAL";se.PLAIN="PLAIN";se.QUOTE_DOUBLE="QUOTE_DOUBLE";se.QUOTE_SINGLE="QUOTE_SINGLE";var uE=Object.defineProperty,Wy=d((e,t)=>uE(e,"name",{value:t,configurable:!0}),"h$v");const pE="tag:yaml.org,2002:";function Vy(e,t,r){if(t){const n=r.filter(i=>i.tag===t),s=n.find(i=>!i.format)??n[0];if(!s)throw new Error(`Tag ${t} not found`);return s}return r.find(n=>n.identify?.(e)&&!n.format)}d(Vy,"A$t");Wy(Vy,"findTagObject");function Ts(e,t,r){if(Js(e)&&(e=e.contents),Me(e))return e;if(We(e)){const p=r.schema[Yr].createNode?.(r.schema,null,r);return p.items.push(e),p}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:n,onAnchor:s,onTagObj:i,schema:o,sourceObjects:a}=r;let c;if(n&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor??(c.anchor=s(e)),new Gp(c.anchor);c={anchor:null,node:null},a.set(e,c)}t?.startsWith("!!")&&(t=pE+t.slice(2));let l=Vy(e,t,o.tags);if(!l){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const p=new se(e);return c&&(c.node=p),p}l=e instanceof Map?o[Yr]:Symbol.iterator in Object(e)?o[Hs]:o[Yr]}i&&(i(l),delete r.onTagObj);const u=l?.createNode?l.createNode(r.schema,e,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,e,r):new se(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}d(Ts,"B$h");Wy(Ts,"createNode");var dE=Object.defineProperty,mc=d((e,t)=>dE(e,"name",{value:t,configurable:!0}),"i$S");function uo(e,t,r){let n=r;for(let s=t.length-1;s>=0;--s){const i=t[s];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const o=[];o[i]=n,n=o}else n=new Map([[i,n]])}return Ts(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:mc(()=>{throw new Error("This should not happen, please report a bug.")},"onAnchor"),schema:e,sourceObjects:new Map})}d(uo,"c$O");mc(uo,"collectionFromPath");const Wi=mc(e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done,"isEmptyPath");let Uy=class extends Up{static{d(this,"b")}static{mc(this,"Collection")}constructor(t,r){super(t),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(t){const r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(r.schema=t),r.items=r.items.map(n=>Me(n)||We(n)?n.clone(t):n),this.range&&(r.range=this.range.slice()),r}addIn(t,r){if(Wi(t))this.add(r);else{const[n,...s]=t,i=this.get(n,!0);if(_e(i))i.addIn(s,r);else if(i===void 0&&this.schema)this.set(n,uo(this.schema,s,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}}deleteIn(t){const[r,...n]=t;if(n.length===0)return this.delete(r);const s=this.get(r,!0);if(_e(s))return s.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(t,r){const[n,...s]=t,i=this.get(n,!0);return s.length===0?!r&&Fe(i)?i.value:i:_e(i)?i.getIn(s,r):void 0}hasAllNullValues(t){return this.items.every(r=>{if(!We(r))return!1;const n=r.value;return n==null||t&&Fe(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(t){const[r,...n]=t;if(n.length===0)return this.has(r);const s=this.get(r,!0);return _e(s)?s.hasIn(n):!1}setIn(t,r){const[n,...s]=t;if(s.length===0)this.set(n,r);else{const i=this.get(n,!0);if(_e(i))i.setIn(s,r);else if(i===void 0&&this.schema)this.set(n,uo(this.schema,s,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}}};var fE=Object.defineProperty,qp=d((e,t)=>fE(e,"name",{value:t,configurable:!0}),"r$U");const hE=qp(e=>e.replace(/^(?!$)(?: $)?/gm,"#"),"stringifyComment");function tr(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}d(tr,"s$R");qp(tr,"indentComment");const An=qp((e,t,r)=>e.endsWith(`
|
|
811
811
|
`)?tr(r,t):r.includes(`
|
|
812
812
|
`)?`
|
|
813
|
-
`+tr(r,t):(e.endsWith(" ")?"":" ")+r,"lineComment");var mE=Object.defineProperty,Gy=d((e,t)=>mE(e,"name",{value:t,configurable:!0}),"O$
|
|
813
|
+
`+tr(r,t):(e.endsWith(" ")?"":" ")+r,"lineComment");var mE=Object.defineProperty,Gy=d((e,t)=>mE(e,"name",{value:t,configurable:!0}),"O$q");const qy="flow",Eu="block",ma="quoted";function Oo(e,t,r="flow",{indentAtStart:n,lineWidth:s=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!s||s<0)return e;s<i&&(i=0);const c=Math.max(1+i,1+s-t.length);if(e.length<=c)return e;const l=[],u={};let p=s-t.length;typeof n=="number"&&(n>s-Math.max(2,i)?l.push(0):p=s-n);let f,m,$=!1,b=-1,k=-1,S=-1;r===Eu&&(b=ju(e,b,t.length),b!==-1&&(p=b+c));for(let h;h=e[b+=1];){if(r===ma&&h==="\\"){switch(k=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}S=b}if(h===`
|
|
814
814
|
`)r===Eu&&(b=ju(e,b,t.length)),p=b+t.length+c,f=void 0;else{if(h===" "&&m&&m!==" "&&m!==`
|
|
815
815
|
`&&m!==" "){const v=e[b+1];v&&v!==" "&&v!==`
|
|
816
816
|
`&&v!==" "&&(f=b)}if(b>=p)if(f)l.push(f),p=f+c,f=void 0;else if(r===ma){for(;m===" "||m===" ";)m=h,h=e[b+=1],$=!0;const v=b>S+1?b-2:k-1;if(u[v])return e;l.push(v),u[v]=!0,p=v+c,f=void 0}else $=!0}m=h}if($&&a&&a(),l.length===0)return e;o&&o();let y=e.slice(0,l[0]);for(let h=0;h<l.length;++h){const v=l[h],w=l[h+1]||e.length;v===0?y=`
|
|
817
817
|
${t}${e.slice(0,w)}`:(r===ma&&u[v]&&(y+=`${e[v]}\\`),y+=`
|
|
818
|
-
${t}${e.slice(v+1,w)}`)}return y}d(Oo,"q$
|
|
818
|
+
${t}${e.slice(v+1,w)}`)}return y}d(Oo,"q$j");Gy(Oo,"foldFlowLines");function ju(e,t,r){let n=t,s=t+1,i=e[s];for(;i===" "||i===" ";)if(t<s+r)i=e[++t];else{do i=e[++t];while(i&&i!==`
|
|
819
819
|
`);n=t,s=t+1,i=e[s]}return n}d(ju,"E$s");Gy(ju,"consumeMoreIndentedLines");var gE=Object.defineProperty,Jt=d((e,t)=>gE(e,"name",{value:t,configurable:!0}),"d$K");const gc=Jt((e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),"getFoldOptions"),yc=Jt(e=>/^(%|---|\.\.\.)/m.test(e),"containsDocumentMarker");function Hy(e,t,r){if(!t||t<0)return!1;const n=t-r,s=e.length;if(s<=n)return!1;for(let i=0,o=0;i<s;++i)if(e[i]===`
|
|
820
820
|
`){if(i-o>n)return!0;if(o=i+1,s-o<=n)return!1}return!0}d(Hy,"M$n");Jt(Hy,"lineLengthOverLimit");function Cs(e,t){const r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;const{implicitKey:n}=t,s=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(yc(e)?" ":"");let o="",a=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(o+=r.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{o+=r.slice(a,c);const u=r.substr(c+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(n||r[c+2]==='"'||r.length<s)c+=1;else{for(o+=r.slice(a,c)+`
|
|
821
821
|
|
|
@@ -838,8 +838,8 @@ ${l}${y}${r}${m}`}d(ro,"D$o");Jt(ro,"blockString");function zy(e,t,r,n){const{ty
|
|
|
838
838
|
`)||u&&/[[\]{},]/.test(i))return xn(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes(`
|
|
839
839
|
`)?xn(i,t):ro(e,t,r,n);if(!a&&!u&&s!==se.PLAIN&&i.includes(`
|
|
840
840
|
`))return ro(e,t,r,n);if(yc(i)){if(c==="")return t.forceBlockIndent=!0,ro(e,t,r,n);if(a&&c===l)return xn(i,t)}const p=i.replace(/\n+/g,`$&
|
|
841
|
-
${c}`);if(o){const f=Jt(b=>b.default&&b.tag!=="tag:yaml.org,2002:str"&&b.test?.test(p),"test"),{compat:m,tags:$}=t.doc.schema;if($.some(f)||m?.some(f))return xn(i,t)}return a?p:Oo(p,c,qy,gc(t,!1))}d(zy,"m$K");Jt(zy,"plainString");function Ks(e,t,r,n){const{implicitKey:s,inFlow:i}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==se.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=se.QUOTE_DOUBLE);const c=Jt(u=>{switch(u){case se.BLOCK_FOLDED:case se.BLOCK_LITERAL:return s||i?xn(o.value,t):ro(o,t,r,n);case se.QUOTE_DOUBLE:return Cs(o.value,t);case se.QUOTE_SINGLE:return Na(o.value,t);case se.PLAIN:return zy(o,t,r,n);default:return null}},"_stringify");let l=c(a);if(l===null){const{defaultKeyType:u,defaultStringType:p}=t.options,f=s&&u||p;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}d(Ks,"R$
|
|
842
|
-
${t.indent}${a}`:a}d(Nn,"O$
|
|
841
|
+
${c}`);if(o){const f=Jt(b=>b.default&&b.tag!=="tag:yaml.org,2002:str"&&b.test?.test(p),"test"),{compat:m,tags:$}=t.doc.schema;if($.some(f)||m?.some(f))return xn(i,t)}return a?p:Oo(p,c,qy,gc(t,!1))}d(zy,"m$K");Jt(zy,"plainString");function Ks(e,t,r,n){const{implicitKey:s,inFlow:i}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==se.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=se.QUOTE_DOUBLE);const c=Jt(u=>{switch(u){case se.BLOCK_FOLDED:case se.BLOCK_LITERAL:return s||i?xn(o.value,t):ro(o,t,r,n);case se.QUOTE_DOUBLE:return Cs(o.value,t);case se.QUOTE_SINGLE:return Na(o.value,t);case se.PLAIN:return zy(o,t,r,n);default:return null}},"_stringify");let l=c(a);if(l===null){const{defaultKeyType:u,defaultStringType:p}=t.options,f=s&&u||p;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}d(Ks,"R$k");Jt(Ks,"stringifyString");var yE=Object.defineProperty,Po=d((e,t)=>yE(e,"name",{value:t,configurable:!0}),"s$Q");function Hp(e,t){const r=Object.assign({blockQuote:!0,commentString:hE,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:e,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}d(Hp,"w$s");Po(Hp,"createStringifyContext");function Jy(e,t){if(t.tag){const s=e.filter(i=>i.tag===t.tag);if(s.length>0)return s.find(i=>i.format===t.format)??s[0]}let r,n;if(Fe(t)){n=t.value;let s=e.filter(i=>i.identify?.(n));if(s.length>1){const i=s.filter(o=>o.test);i.length>0&&(s=i)}r=s.find(i=>i.format===t.format)??s.find(i=>!i.format)}else n=t,r=e.find(s=>s.nodeClass&&n instanceof s.nodeClass);if(!r){const s=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${s} value`)}return r}d(Jy,"b$w");Po(Jy,"getTagObject");function Ky(e,t,{anchors:r,doc:n}){if(!n.directives)return"";const s=[],i=(Fe(e)||_e(e))&&e.anchor;i&&Mp(i)&&(r.add(i),s.push(`&${i}`));const o=e.tag??(t.default?null:t.tag);return o&&s.push(n.directives.tagString(o)),s.join(" ")}d(Ky,"A$s");Po(Ky,"stringifyProps");function Nn(e,t,r,n){if(We(e))return e.toString(t,r,n);if(zs(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s;const i=Me(e)?e:t.doc.createNode(e,{onTagObj:Po(c=>s=c,"onTagObj")});s??(s=Jy(t.doc.schema.tags,i));const o=Ky(i,s,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const a=typeof s.stringify=="function"?s.stringify(i,t,r,n):Fe(i)?Ks(i,t,r,n):i.toString(t,r,n);return o?Fe(i)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
842
|
+
${t.indent}${a}`:a}d(Nn,"O$p");Po(Nn,"stringify");var vE=Object.defineProperty,bE=d((e,t)=>vE(e,"name",{value:t,configurable:!0}),"D$n");function Yy({key:e,value:t},r,n,s){const{allNullValues:i,doc:o,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:p}}=r;let f=Me(e)&&e.comment||null;if(p){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(_e(e)||!Me(e)&&typeof e=="object"){const E="With simple keys, collection cannot be used as a key value";throw new Error(E)}}let m=!p&&(!e||f&&t==null&&!r.inFlow||_e(e)||(Fe(e)?e.type===se.BLOCK_FOLDED||e.type===se.BLOCK_LITERAL:typeof e=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!m&&(p||!i),indent:a+c});let $=!1,b=!1,k=Nn(e,r,()=>$=!0,()=>b=!0);if(!m&&!r.inFlow&&k.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(r.inFlow){if(i||t==null)return $&&n&&n(),k===""?"?":m?`? ${k}`:k}else if(i&&!p||t==null&&m)return k=`? ${k}`,f&&!$?k+=An(k,r.indent,l(f)):b&&s&&s(),k;$&&(f=null),m?(f&&(k+=An(k,r.indent,l(f))),k=`? ${k}
|
|
843
843
|
${a}:`):(k=`${k}:`,f&&(k+=An(k,r.indent,l(f))));let S,y,h;Me(t)?(S=!!t.spaceBefore,y=t.commentBefore,h=t.comment):(S=!1,y=null,h=null,t&&typeof t=="object"&&(t=o.createNode(t))),r.implicitKey=!1,!m&&!f&&Fe(t)&&(r.indentAtStart=k.length+1),b=!1,!u&&c.length>=2&&!r.inFlow&&!m&&xo(t)&&!t.flow&&!t.tag&&!t.anchor&&(r.indent=r.indent.substring(2));let v=!1;const w=Nn(t,r,()=>v=!0,()=>b=!0);let g=" ";if(f||S||y){if(g=S?`
|
|
844
844
|
`:"",y){const E=l(y);g+=`
|
|
845
845
|
${tr(E,r.indent)}`}w===""&&!r.inFlow?g===`
|
|
@@ -849,32 +849,32 @@ ${tr(E,r.indent)}`}w===""&&!r.inFlow?g===`
|
|
|
849
849
|
${r.indent}`}else if(!m&&_e(t)){const E=w[0],C=w.indexOf(`
|
|
850
850
|
`),A=C!==-1,O=r.inFlow??t.flow??t.items.length===0;if(A||!O){let I=!1;if(A&&(E==="&"||E==="!")){let V=w.indexOf(" ");E==="&"&&V!==-1&&V<C&&w[V+1]==="!"&&(V=w.indexOf(" ",V+1)),(V===-1||C<V)&&(I=!0)}I||(g=`
|
|
851
851
|
${r.indent}`)}}else(w===""||w[0]===`
|
|
852
|
-
`)&&(g="");return k+=g+w,r.inFlow?v&&n&&n():h&&!v?k+=An(k,r.indent,l(h)):b&&s&&s(),k}d(Yy,"R$
|
|
852
|
+
`)&&(g="");return k+=g+w,r.inFlow?v&&n&&n():h&&!v?k+=An(k,r.indent,l(h)):b&&s&&s(),k}d(Yy,"R$j");bE(Yy,"stringifyPair");var $E=Object.defineProperty,Xy=d((e,t)=>$E(e,"name",{value:t,configurable:!0}),"u$Q");function wE(e,...t){e==="debug"&&console.log(...t)}d(wE,"e$14");Xy(wE,"debug");function zp(e,t){(e==="debug"||e==="warn")&&console.warn(t)}d(zp,"f$D");Xy(zp,"warn");var kE=Object.defineProperty,Pn=d((e,t)=>kE(e,"name",{value:t,configurable:!0}),"s$P");const ta="<<",Or={identify:Pn(e=>e===ta||typeof e=="symbol"&&e.description===ta,"identify"),default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:Pn(()=>Object.assign(new se(Symbol(ta)),{addToJSMap:Jp}),"resolve"),stringify:Pn(()=>ta,"stringify")},SE=Pn((e,t)=>(Or.identify(t)||Fe(t)&&(!t.type||t.type===se.PLAIN)&&Or.identify(t.value))&&e?.doc.schema.tags.some(r=>r.tag===Or.tag&&r.default),"isMergeKey");function Jp(e,t,r){const n=Kp(e,r);if(xo(n))for(const s of n.items)ga(e,t,s);else if(Array.isArray(n))for(const s of n)ga(e,t,s);else ga(e,t,n)}d(Jp,"d$J");Pn(Jp,"addMergeToJSMap");function ga(e,t,r){const n=Kp(e,r);if(!Ao(n))throw new Error("Merge sources must be maps or map aliases");const s=n.toJSON(null,e,Map);for(const[i,o]of s)t instanceof Map?t.has(i)||t.set(i,o):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}d(ga,"l$H");Pn(ga,"mergeValue");function Kp(e,t){return e&&zs(t)?t.resolve(e.doc,e):t}d(Kp,"g$w");Pn(Kp,"resolveAliasValue");var DE=Object.defineProperty,Qy=d((e,t)=>DE(e,"name",{value:t,configurable:!0}),"s$O");function Yp(e,t,{key:r,value:n}){if(Me(r)&&r.addToJSMap)r.addToJSMap(e,t,n);else if(SE(e,r))Jp(e,t,n);else{const s=Ct(r,"",e);if(t instanceof Map)t.set(s,Ct(n,s,e));else if(t instanceof Set)t.add(s);else{const i=Zy(r,s,e),o=Ct(n,i,e);i in t?Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[i]=o}}return t}d(Yp,"b$v");Qy(Yp,"addPairToJSMap");function Zy(e,t,r){if(t===null)return"";if(typeof t!="object")return String(t);if(Me(e)&&r?.doc){const n=Hp(r.doc,{});n.anchors=new Set;for(const i of r.anchors.keys())n.anchors.add(i.anchor);n.inFlow=!0,n.inStringifyKey=!0;const s=e.toString(n);if(!r.mapKeyWarned){let i=JSON.stringify(s);i.length>40&&(i=i.substring(0,36)+'..."'),zp(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return s}return JSON.stringify(t)}d(Zy,"p$L");Qy(Zy,"stringifyKey");var CE=Object.defineProperty,ev=d((e,t)=>CE(e,"name",{value:t,configurable:!0}),"o$_");function vc(e,t,r){const n=Ts(e,void 0,r),s=Ts(t,void 0,r);return new Et(n,s)}d(vc,"m$J");ev(vc,"createPair");let Et=class tv{static{d(this,"i")}static{ev(this,"Pair")}constructor(t,r=null){Object.defineProperty(this,It,{value:Ry}),this.key=t,this.value=r}clone(t){let{key:r,value:n}=this;return Me(r)&&(r=r.clone(t)),Me(n)&&(n=n.clone(t)),new tv(r,n)}toJSON(t,r){const n=r?.mapAsMap?new Map:{};return Yp(r,n,this)}toString(t,r,n){return t?.doc?Yy(this,t,r,n):JSON.stringify(this)}};var EE=Object.defineProperty,bc=d((e,t)=>EE(e,"name",{value:t,configurable:!0}),"$$i");function Xp(e,t,r){return(t.inFlow??e.flow?nv:rv)(e,t,r)}d(Xp,"P$m");bc(Xp,"stringifyCollection");function rv({comment:e,items:t},r,{blockItemPrefix:n,flowChars:s,itemIndent:i,onChompKeep:o,onComment:a}){const{indent:c,options:{commentString:l}}=r,u=Object.assign({},r,{indent:i,type:null});let p=!1;const f=[];for(let $=0;$<t.length;++$){const b=t[$];let k=null;if(Me(b))!p&&b.spaceBefore&&f.push(""),po(r,f,b.commentBefore,p),b.comment&&(k=b.comment);else if(We(b)){const y=Me(b.key)?b.key:null;y&&(!p&&y.spaceBefore&&f.push(""),po(r,f,y.commentBefore,p))}p=!1;let S=Nn(b,u,()=>k=null,()=>p=!0);k&&(S+=An(S,i,l(k))),p&&k&&(p=!1),f.push(n+S)}let m;if(f.length===0)m=s.start+s.end;else{m=f[0];for(let $=1;$<f.length;++$){const b=f[$];m+=b?`
|
|
853
853
|
${c}${b}`:`
|
|
854
854
|
`}}return e?(m+=`
|
|
855
855
|
`+tr(l(e),c),a&&a()):p&&o&&o(),m}d(rv,"b$u");bc(rv,"stringifyBlockCollection");function nv({items:e},t,{flowChars:r,itemIndent:n}){const{indent:s,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=t;n+=i;const c=Object.assign({},t,{indent:n,inFlow:!0,type:null});let l=!1,u=0;const p=[];for(let $=0;$<e.length;++$){const b=e[$];let k=null;if(Me(b))b.spaceBefore&&p.push(""),po(t,p,b.commentBefore,!1),b.comment&&(k=b.comment);else if(We(b)){const y=Me(b.key)?b.key:null;y&&(y.spaceBefore&&p.push(""),po(t,p,y.commentBefore,!1),y.comment&&(l=!0));const h=Me(b.value)?b.value:null;h?(h.comment&&(k=h.comment),h.commentBefore&&(l=!0)):b.value==null&&y?.comment&&(k=y.comment)}k&&(l=!0);let S=Nn(b,c,()=>k=null);l||(l=p.length>u||S.includes(`
|
|
856
856
|
`)),$<e.length-1?S+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(l||(l=p.reduce((y,h)=>y+h.length+2,2)+(S.length+2)>t.options.lineWidth)),l&&(S+=",")),k&&(S+=An(S,n,a(k))),p.push(S),u=p.length}const{start:f,end:m}=r;if(p.length===0)return f+m;if(!l){const $=p.reduce((b,k)=>b+k.length+2,2);l=t.options.lineWidth>0&&$>t.options.lineWidth}if(l){let $=f;for(const b of p)$+=b?`
|
|
857
857
|
${i}${s}${b}`:`
|
|
858
858
|
`;return`${$}
|
|
859
|
-
${s}${m}`}else return`${f}${o}${p.join(" ")}${o}${m}`}d(nv,"N$
|
|
859
|
+
${s}${m}`}else return`${f}${o}${p.join(" ")}${o}${m}`}d(nv,"N$m");bc(nv,"stringifyFlowCollection");function po({indent:e,options:{commentString:t}},r,n,s){if(n&&s&&(n=n.replace(/^\n+/,"")),n){const i=tr(t(n),e);r.push(i.trimStart())}}d(po,"C$m");bc(po,"addCommentBefore");var jE=Object.defineProperty,xu=d((e,t)=>jE(e,"name",{value:t,configurable:!0}),"m$I");function zr(e,t){const r=Fe(t)?t.value:t;for(const n of e)if(We(n)&&(n.key===t||n.key===r||Fe(n.key)&&n.key.value===r))return n}d(zr,"f$B");xu(zr,"findPair");let Bt=class extends Uy{static{d(this,"N")}static{xu(this,"YAMLMap")}static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Yr,t),this.items=[]}static from(t,r,n){const{keepUndefined:s,replacer:i}=n,o=new this(t),a=xu((c,l)=>{if(typeof i=="function")l=i.call(r,c,l);else if(Array.isArray(i)&&!i.includes(c))return;(l!==void 0||s)&&o.items.push(vc(c,l,n))},"add");if(r instanceof Map)for(const[c,l]of r)a(c,l);else if(r&&typeof r=="object")for(const c of Object.keys(r))a(c,r[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,r){let n;We(t)?n=t:!t||typeof t!="object"||!("key"in t)?n=new Et(t,t?.value):n=new Et(t.key,t.value);const s=zr(this.items,n.key),i=this.schema?.sortMapEntries;if(s){if(!r)throw new Error(`Key ${n.key} already set`);Fe(s.value)&&My(n.value)?s.value.value=n.value:s.value=n.value}else if(i){const o=this.items.findIndex(a=>i(n,a)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(t){const r=zr(this.items,t);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(t,r){const n=zr(this.items,t)?.value;return(!r&&Fe(n)?n.value:n)??void 0}has(t){return!!zr(this.items,t)}set(t,r){this.add(new Et(t,r),!0)}toJSON(t,r,n){const s=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(s);for(const i of this.items)Yp(r,s,i);return s}toString(t,r,n){if(!t)return JSON.stringify(this);for(const s of this.items)if(!We(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Xp(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:n,onComment:r})}};var AE=Object.defineProperty,xE=d((e,t)=>AE(e,"name",{value:t,configurable:!0}),"a$$");const Ys={collection:"map",default:!0,nodeClass:Bt,tag:"tag:yaml.org,2002:map",resolve(e,t){return Ao(e)||t("Expected a mapping for this tag"),e},createNode:xE((e,t,r)=>Bt.from(e,t,r),"createNode")};var OE=Object.defineProperty,sv=d((e,t)=>OE(e,"name",{value:t,configurable:!0}),"m$H");let In=class extends Uy{static{d(this,"b")}static{sv(this,"YAMLSeq")}static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Hs,t),this.items=[]}add(t){this.items.push(t)}delete(t){const r=Vi(t);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(t,r){const n=Vi(t);if(typeof n!="number")return;const s=this.items[n];return!r&&Fe(s)?s.value:s}has(t){const r=Vi(t);return typeof r=="number"&&r<this.items.length}set(t,r){const n=Vi(t);if(typeof n!="number")throw new Error(`Expected a valid index, not ${t}.`);const s=this.items[n];Fe(s)&&My(r)?s.value=r:this.items[n]=r}toJSON(t,r){const n=[];r?.onCreate&&r.onCreate(n);let s=0;for(const i of this.items)n.push(Ct(i,String(s++),r));return n}toString(t,r,n){return t?Xp(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(t,r,n){const{replacer:s}=n,i=new this(t);if(r&&Symbol.iterator in Object(r)){let o=0;for(let a of r){if(typeof s=="function"){const c=r instanceof Set?a:String(o++);a=s.call(r,c,a)}i.items.push(Ts(a,void 0,n))}}return i}};function Vi(e){let t=Fe(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}d(Vi,"f$A");sv(Vi,"asItemIndex");var PE=Object.defineProperty,FE=d((e,t)=>PE(e,"name",{value:t,configurable:!0}),"t$K");const Xs={collection:"seq",default:!0,nodeClass:In,tag:"tag:yaml.org,2002:seq",resolve(e,t){return xo(e)||t("Expected a sequence for this tag"),e},createNode:FE((e,t,r)=>In.from(e,t,r),"createNode")};var BE=Object.defineProperty,Eh=d((e,t)=>BE(e,"name",{value:t,configurable:!0}),"i$P");const $c={identify:Eh(e=>typeof e=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:Eh(e=>e,"resolve"),stringify(e,t,r,n){return t=Object.assign({actualString:!0},t),Ks(e,t,r,n)}};var RE=Object.defineProperty,ra=d((e,t)=>RE(e,"name",{value:t,configurable:!0}),"l$G");const wc={identify:ra(e=>e==null,"identify"),createNode:ra(()=>new se(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:ra(()=>new se(null),"resolve"),stringify:ra(({source:e},t)=>typeof e=="string"&&wc.test.test(e)?e:t.options.nullStr,"stringify")};var TE=Object.defineProperty,jh=d((e,t)=>TE(e,"name",{value:t,configurable:!0}),"e$13");const Qp={identify:jh(e=>typeof e=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:jh(e=>new se(e[0]==="t"||e[0]==="T"),"resolve"),stringify({source:e,value:t},r){if(e&&Qp.test.test(e)){const n=e[0]==="t"||e[0]==="T";if(t===n)return e}return t?r.options.trueStr:r.options.falseStr}};var NE=Object.defineProperty,IE=d((e,t)=>NE(e,"name",{value:t,configurable:!0}),"g$v");function _t({format:e,minFractionDigits:t,tag:r,value:n}){if(typeof n=="bigint")return String(n);const s=typeof n=="number"?n:Number(n);if(!isFinite(s))return isNaN(s)?".nan":s<0?"-.inf":".inf";let i=Object.is(n,-0)?"-0":JSON.stringify(n);if(!e&&t&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let o=i.indexOf(".");o<0&&(o=i.length,i+=".");let a=t-(i.length-o-1);for(;a-- >0;)i+="0"}return i}d(_t,"y$z");IE(_t,"stringifyNumber");var LE=Object.defineProperty,fo=d((e,t)=>LE(e,"name",{value:t,configurable:!0}),"o$Z");const iv={identify:fo(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:fo(e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:_t},ov={identify:fo(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:fo(e=>parseFloat(e),"resolve"),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():_t(e)}},av={identify:fo(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new se(parseFloat(e)),r=e.indexOf(".");return r!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-r-1),t},stringify:_t};var _E=Object.defineProperty,sr=d((e,t)=>_E(e,"name",{value:t,configurable:!0}),"r$R");const kc=sr(e=>typeof e=="bigint"||Number.isInteger(e),"intIdentify"),Zp=sr((e,t,r,{intAsBigInt:n})=>n?BigInt(e):parseInt(e.substring(t),r),"intResolve");function ed(e,t,r){const{value:n}=e;return kc(n)&&n>=0?r+n.toString(t):_t(e)}d(ed,"g$u");sr(ed,"intStringify");const cv={identify:sr(e=>kc(e)&&e>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:sr((e,t,r)=>Zp(e,2,8,r),"resolve"),stringify:sr(e=>ed(e,8,"0o"),"stringify")},lv={identify:kc,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:sr((e,t,r)=>Zp(e,0,10,r),"resolve"),stringify:_t},uv={identify:sr(e=>kc(e)&&e>=0,"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:sr((e,t,r)=>Zp(e,2,16,r),"resolve"),stringify:sr(e=>ed(e,16,"0x"),"stringify")},ME=[Ys,Xs,$c,wc,Qp,cv,lv,uv,iv,ov,av];var WE=Object.defineProperty,Dt=d((e,t)=>WE(e,"name",{value:t,configurable:!0}),"e$12");function Ou(e){return typeof e=="bigint"||Number.isInteger(e)}d(Ou,"i$O");Dt(Ou,"intIdentify");const na=Dt(({value:e})=>JSON.stringify(e),"stringifyJSON"),VE=[{identify:Dt(e=>typeof e=="string","identify"),default:!0,tag:"tag:yaml.org,2002:str",resolve:Dt(e=>e,"resolve"),stringify:na},{identify:Dt(e=>e==null,"identify"),createNode:Dt(()=>new se(null),"createNode"),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:Dt(()=>null,"resolve"),stringify:na},{identify:Dt(e=>typeof e=="boolean","identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:Dt(e=>e==="true","resolve"),stringify:na},{identify:Ou,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:Dt((e,t,{intAsBigInt:r})=>r?BigInt(e):parseInt(e,10),"resolve"),stringify:Dt(({value:e})=>Ou(e)?e.toString():JSON.stringify(e),"stringify")},{identify:Dt(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:Dt(e=>parseFloat(e),"resolve"),stringify:na}],UE={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},GE=[Ys,Xs].concat(VE,UE);var qE=Object.defineProperty,HE=d((e,t)=>qE(e,"name",{value:t,configurable:!0}),"b$r");const td={identify:HE(e=>e instanceof Uint8Array,"identify"),default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const r=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let s=0;s<r.length;++s)n[s]=r.charCodeAt(s);return n}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:r},n,s,i){if(!r)return"";const o=r;let a;if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=se.BLOCK_LITERAL),t!==se.QUOTE_DOUBLE){const c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let p=0,f=0;p<l;++p,f+=c)u[p]=a.substr(f,c);a=u.join(t===se.BLOCK_LITERAL?`
|
|
860
860
|
`:" ")}return Ks({comment:e,type:t,value:a},n,s,i)}};var zE=Object.defineProperty,pv=d((e,t)=>zE(e,"name",{value:t,configurable:!0}),"f$w");function rd(e,t){if(xo(e))for(let r=0;r<e.items.length;++r){let n=e.items[r];if(!We(n)){if(Ao(n)){n.items.length>1&&t("Each pair must have its own sequence indicator");const s=n.items[0]||new Et(new se(null));if(n.commentBefore&&(s.key.commentBefore=s.key.commentBefore?`${n.commentBefore}
|
|
861
861
|
${s.key.commentBefore}`:n.commentBefore),n.comment){const i=s.value??s.key;i.comment=i.comment?`${n.comment}
|
|
862
|
-
${i.comment}`:n.comment}n=s}e.items[r]=We(n)?n:new Et(n)}}else t("Expected a sequence for this tag");return e}d(rd,"y$v");pv(rd,"resolvePairs");function nd(e,t,r){const{replacer:n}=r,s=new In(e);s.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof n=="function"&&(o=n.call(t,String(i++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;s.items.push(vc(a,c,r))}return s}d(nd,"u$L");pv(nd,"createPairs");const sd={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:rd,createNode:nd};var JE=Object.defineProperty,Pu=d((e,t)=>JE(e,"name",{value:t,configurable:!0}),"p$I");let ya=class dv extends In{static{d(this,"a")}static{Pu(this,"YAMLOMap")}constructor(){super(),this.add=Bt.prototype.add.bind(this),this.delete=Bt.prototype.delete.bind(this),this.get=Bt.prototype.get.bind(this),this.has=Bt.prototype.has.bind(this),this.set=Bt.prototype.set.bind(this),this.tag=dv.tag}toJSON(t,r){if(!r)return super.toJSON(t);const n=new Map;r?.onCreate&&r.onCreate(n);for(const s of this.items){let i,o;if(We(s)?(i=Ct(s.key,"",r),o=Ct(s.value,i,r)):i=Ct(s,"",r),n.has(i))throw new Error("Ordered maps must not include duplicate keys");n.set(i,o)}return n}static from(t,r,n){const s=nd(t,r,n),i=new this;return i.items=s.items,i}};ya.tag="tag:yaml.org,2002:omap";const id={collection:"seq",identify:Pu(e=>e instanceof Map,"identify"),nodeClass:ya,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const r=rd(e,t),n=[];for(const{key:s}of r.items)Fe(s)&&(n.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):n.push(s.value));return Object.assign(new ya,r)},createNode:Pu((e,t,r)=>ya.from(e,t,r),"createNode")};var KE=Object.defineProperty,ho=d((e,t)=>KE(e,"name",{value:t,configurable:!0}),"e$10");function od({value:e,source:t},r){return t&&(e?fv:hv).test.test(t)?t:e?r.options.trueStr:r.options.falseStr}d(od,"f$v");ho(od,"boolStringify");const fv={identify:ho(e=>e===!0,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:ho(()=>new se(!0),"resolve"),stringify:od},hv={identify:ho(e=>e===!1,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:ho(()=>new se(!1),"resolve"),stringify:od};var YE=Object.defineProperty,mo=d((e,t)=>YE(e,"name",{value:t,configurable:!0}),"a$T");const XE={identify:mo(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:mo(e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:_t},QE={identify:mo(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:mo(e=>parseFloat(e.replace(/_/g,"")),"resolve"),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():_t(e)}},ZE={identify:mo(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new se(parseFloat(e.replace(/_/g,""))),r=e.indexOf(".");if(r!==-1){const n=e.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(t.minFractionDigits=n.length)}return t},stringify:_t};var e2=Object.defineProperty,ur=d((e,t)=>e2(e,"name",{value:t,configurable:!0}),"i$N");const Fo=ur(e=>typeof e=="bigint"||Number.isInteger(e),"intIdentify");function Bo(e,t,r,{intAsBigInt:n}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),n){switch(r){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return s==="-"?BigInt(-1)*o:o}const i=parseInt(e,r);return s==="-"?-1*i:i}d(Bo,"g$p");ur(Bo,"intResolve");function Sc(e,t,r){const{value:n}=e;if(Fo(n)){const s=n.toString(t);return n<0?"-"+r+s.substr(1):r+s}return _t(e)}d(Sc,"s$J");ur(Sc,"intStringify");const t2={identify:Fo,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:ur((e,t,r)=>Bo(e,2,2,r),"resolve"),stringify:ur(e=>Sc(e,2,"0b"),"stringify")},r2={identify:Fo,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:ur((e,t,r)=>Bo(e,1,8,r),"resolve"),stringify:ur(e=>Sc(e,8,"0"),"stringify")},n2={identify:Fo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:ur((e,t,r)=>Bo(e,0,10,r),"resolve"),stringify:_t},s2={identify:Fo,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:ur((e,t,r)=>Bo(e,2,16,r),"resolve"),stringify:ur(e=>Sc(e,16,"0x"),"stringify")};var i2=Object.defineProperty,Fu=d((e,t)=>i2(e,"name",{value:t,configurable:!0}),"n$N");let va=class mv extends Bt{static{d(this,"l")}static{Fu(this,"YAMLSet")}constructor(t){super(t),this.tag=mv.tag}add(t){let r;We(t)?r=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?r=new Et(t.key,null):r=new Et(t,null),zr(this.items,r.key)||this.items.push(r)}get(t,r){const n=zr(this.items,t);return!r&&We(n)?Fe(n.key)?n.key.value:n.key:n}set(t,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);const n=zr(this.items,t);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Et(t))}toJSON(t,r){return super.toJSON(t,r,Set)}toString(t,r,n){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(t,r,n){const{replacer:s}=n,i=new this(t);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof s=="function"&&(o=s.call(r,o,o)),i.items.push(vc(o,null,n));return i}};va.tag="tag:yaml.org,2002:set";const ad={collection:"map",identify:Fu(e=>e instanceof Set,"identify"),nodeClass:va,default:!1,tag:"tag:yaml.org,2002:set",createNode:Fu((e,t,r)=>va.from(e,t,r),"createNode"),resolve(e,t){if(Ao(e)){if(e.hasAllNullValues(!0))return Object.assign(new va,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};var o2=Object.defineProperty,qt=d((e,t)=>o2(e,"name",{value:t,configurable:!0}),"n$M");function Dc(e,t){const r=e[0],n=r==="-"||r==="+"?e.substring(1):e,s=qt(o=>t?BigInt(o):Number(o),"num"),i=n.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return r==="-"?s(-1)*i:i}d(Dc,"l$A");qt(Dc,"parseSexagesimal");function cd(e){let{value:t}=e,r=qt(o=>o,"num");if(typeof t=="bigint")r=qt(o=>BigInt(o),"num");else if(isNaN(t)||!isFinite(t))return _t(e);let n="";t<0&&(n="-",t*=r(-1));const s=r(60),i=[t%s];return t<60?i.unshift(0):(t=(t-i[0])/s,i.unshift(t%s),t>=60&&(t=(t-i[0])/s,i.unshift(t))),n+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}d(cd,"c$J");qt(cd,"stringifySexagesimal");const gv={identify:qt(e=>typeof e=="bigint"||Number.isInteger(e),"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:qt((e,t,{intAsBigInt:r})=>Dc(e,r),"resolve"),stringify:cd},yv={identify:qt(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:qt(e=>Dc(e,!1),"resolve"),stringify:cd},Cc={identify:qt(e=>e instanceof Date,"identify"),default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Cc.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,r,n,s,i,o,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let l=Date.UTC(r,n-1,s,i||0,o||0,a||0,c);const u=t[8];if(u&&u!=="Z"){let p=Dc(u,!1);Math.abs(p)<30&&(p*=60),l-=6e4*p}return new Date(l)},stringify:qt(({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??"","stringify")},Ah=[Ys,Xs,$c,wc,fv,hv,t2,r2,n2,s2,XE,QE,ZE,td,Or,id,sd,ad,gv,yv,Cc];var a2=Object.defineProperty,c2=d((e,t)=>a2(e,"name",{value:t,configurable:!0}),"s$I");const xh=new Map([["core",ME],["failsafe",[Ys,Xs,$c]],["json",GE],["yaml11",Ah],["yaml-1.1",Ah]]),Oh={binary:td,bool:Qp,float:av,floatExp:ov,floatNaN:iv,floatTime:yv,int:lv,intHex:uv,intOct:cv,intTime:gv,map:Ys,merge:Or,null:wc,omap:id,pairs:sd,seq:Xs,set:ad,timestamp:Cc},l2={"tag:yaml.org,2002:binary":td,"tag:yaml.org,2002:merge":Or,"tag:yaml.org,2002:omap":id,"tag:yaml.org,2002:pairs":sd,"tag:yaml.org,2002:set":ad,"tag:yaml.org,2002:timestamp":Cc};function ba(e,t,r){const n=xh.get(t);if(n&&!e)return r&&!n.includes(Or)?n.concat(Or):n.slice();let s=n;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(xh.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${i} or define customTags array`)}if(Array.isArray(e))for(const i of e)s=s.concat(i);else typeof e=="function"&&(s=e(s.slice()));return r&&(s=s.concat(Or)),s.reduce((i,o)=>{const a=typeof o=="string"?Oh[o]:o;if(!a){const c=JSON.stringify(o),l=Object.keys(Oh).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return i.includes(a)||i.push(a),i},[])}d(ba,"C$k");c2(ba,"getTags");var u2=Object.defineProperty,vv=d((e,t)=>u2(e,"name",{value:t,configurable:!0}),"o$X");const p2=vv((e,t)=>e.key<t.key?-1:e.key>t.key?1:0,"sortMapEntriesByKey");let d2=class bv{static{d(this,"i")}static{vv(this,"Schema")}constructor({compat:t,customTags:r,merge:n,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?ba(t,"compat"):t?ba(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?l2:{},this.tags=ba(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,Yr,{value:Ys}),Object.defineProperty(this,lr,{value:$c}),Object.defineProperty(this,Hs,{value:Xs}),this.sortMapEntries=typeof o=="function"?o:o===!0?p2:null}clone(){const t=Object.create(bv.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};var f2=Object.defineProperty,h2=d((e,t)=>f2(e,"name",{value:t,configurable:!0}),"u$K");function $v(e,t){const r=[];let n=t.directives===!0;if(t.directives!==!1&&e.directives){const c=e.directives.toString(e);c?(r.push(c),n=!0):e.directives.docStart&&(n=!0)}n&&r.push("---");const s=Hp(e,t),{commentString:i}=s.options;if(e.commentBefore){r.length!==1&&r.unshift("");const c=i(e.commentBefore);r.unshift(tr(c,""))}let o=!1,a=null;if(e.contents){if(Me(e.contents)){if(e.contents.spaceBefore&&n&&r.push(""),e.contents.commentBefore){const u=i(e.contents.commentBefore);r.push(tr(u,""))}s.forceBlockIndent=!!e.comment,a=e.contents.comment}const c=a?void 0:()=>o=!0;let l=Nn(e.contents,s,()=>a=null,c);a&&(l+=An(l,"",i(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(Nn(e.contents,s));if(e.directives?.docEnd)if(e.comment){const c=i(e.comment);c.includes(`
|
|
862
|
+
${i.comment}`:n.comment}n=s}e.items[r]=We(n)?n:new Et(n)}}else t("Expected a sequence for this tag");return e}d(rd,"y$v");pv(rd,"resolvePairs");function nd(e,t,r){const{replacer:n}=r,s=new In(e);s.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof n=="function"&&(o=n.call(t,String(i++),o));let a,c;if(Array.isArray(o))if(o.length===2)a=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const l=Object.keys(o);if(l.length===1)a=l[0],c=o[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=o;s.items.push(vc(a,c,r))}return s}d(nd,"u$L");pv(nd,"createPairs");const sd={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:rd,createNode:nd};var JE=Object.defineProperty,Pu=d((e,t)=>JE(e,"name",{value:t,configurable:!0}),"p$I");let ya=class dv extends In{static{d(this,"a")}static{Pu(this,"YAMLOMap")}constructor(){super(),this.add=Bt.prototype.add.bind(this),this.delete=Bt.prototype.delete.bind(this),this.get=Bt.prototype.get.bind(this),this.has=Bt.prototype.has.bind(this),this.set=Bt.prototype.set.bind(this),this.tag=dv.tag}toJSON(t,r){if(!r)return super.toJSON(t);const n=new Map;r?.onCreate&&r.onCreate(n);for(const s of this.items){let i,o;if(We(s)?(i=Ct(s.key,"",r),o=Ct(s.value,i,r)):i=Ct(s,"",r),n.has(i))throw new Error("Ordered maps must not include duplicate keys");n.set(i,o)}return n}static from(t,r,n){const s=nd(t,r,n),i=new this;return i.items=s.items,i}};ya.tag="tag:yaml.org,2002:omap";const id={collection:"seq",identify:Pu(e=>e instanceof Map,"identify"),nodeClass:ya,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const r=rd(e,t),n=[];for(const{key:s}of r.items)Fe(s)&&(n.includes(s.value)?t(`Ordered maps must not include duplicate keys: ${s.value}`):n.push(s.value));return Object.assign(new ya,r)},createNode:Pu((e,t,r)=>ya.from(e,t,r),"createNode")};var KE=Object.defineProperty,ho=d((e,t)=>KE(e,"name",{value:t,configurable:!0}),"e$11");function od({value:e,source:t},r){return t&&(e?fv:hv).test.test(t)?t:e?r.options.trueStr:r.options.falseStr}d(od,"f$v");ho(od,"boolStringify");const fv={identify:ho(e=>e===!0,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:ho(()=>new se(!0),"resolve"),stringify:od},hv={identify:ho(e=>e===!1,"identify"),default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:ho(()=>new se(!1),"resolve"),stringify:od};var YE=Object.defineProperty,mo=d((e,t)=>YE(e,"name",{value:t,configurable:!0}),"a$T");const XE={identify:mo(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:mo(e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,"resolve"),stringify:_t},QE={identify:mo(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:mo(e=>parseFloat(e.replace(/_/g,"")),"resolve"),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():_t(e)}},ZE={identify:mo(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new se(parseFloat(e.replace(/_/g,""))),r=e.indexOf(".");if(r!==-1){const n=e.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(t.minFractionDigits=n.length)}return t},stringify:_t};var e2=Object.defineProperty,ur=d((e,t)=>e2(e,"name",{value:t,configurable:!0}),"i$M");const Fo=ur(e=>typeof e=="bigint"||Number.isInteger(e),"intIdentify");function Bo(e,t,r,{intAsBigInt:n}){const s=e[0];if((s==="-"||s==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),n){switch(r){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return s==="-"?BigInt(-1)*o:o}const i=parseInt(e,r);return s==="-"?-1*i:i}d(Bo,"g$p");ur(Bo,"intResolve");function Sc(e,t,r){const{value:n}=e;if(Fo(n)){const s=n.toString(t);return n<0?"-"+r+s.substr(1):r+s}return _t(e)}d(Sc,"s$J");ur(Sc,"intStringify");const t2={identify:Fo,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:ur((e,t,r)=>Bo(e,2,2,r),"resolve"),stringify:ur(e=>Sc(e,2,"0b"),"stringify")},r2={identify:Fo,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:ur((e,t,r)=>Bo(e,1,8,r),"resolve"),stringify:ur(e=>Sc(e,8,"0"),"stringify")},n2={identify:Fo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:ur((e,t,r)=>Bo(e,0,10,r),"resolve"),stringify:_t},s2={identify:Fo,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:ur((e,t,r)=>Bo(e,2,16,r),"resolve"),stringify:ur(e=>Sc(e,16,"0x"),"stringify")};var i2=Object.defineProperty,Fu=d((e,t)=>i2(e,"name",{value:t,configurable:!0}),"n$O");let va=class mv extends Bt{static{d(this,"l")}static{Fu(this,"YAMLSet")}constructor(t){super(t),this.tag=mv.tag}add(t){let r;We(t)?r=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?r=new Et(t.key,null):r=new Et(t,null),zr(this.items,r.key)||this.items.push(r)}get(t,r){const n=zr(this.items,t);return!r&&We(n)?Fe(n.key)?n.key.value:n.key:n}set(t,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);const n=zr(this.items,t);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new Et(t))}toJSON(t,r){return super.toJSON(t,r,Set)}toString(t,r,n){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(t,r,n){const{replacer:s}=n,i=new this(t);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof s=="function"&&(o=s.call(r,o,o)),i.items.push(vc(o,null,n));return i}};va.tag="tag:yaml.org,2002:set";const ad={collection:"map",identify:Fu(e=>e instanceof Set,"identify"),nodeClass:va,default:!1,tag:"tag:yaml.org,2002:set",createNode:Fu((e,t,r)=>va.from(e,t,r),"createNode"),resolve(e,t){if(Ao(e)){if(e.hasAllNullValues(!0))return Object.assign(new va,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};var o2=Object.defineProperty,qt=d((e,t)=>o2(e,"name",{value:t,configurable:!0}),"n$N");function Dc(e,t){const r=e[0],n=r==="-"||r==="+"?e.substring(1):e,s=qt(o=>t?BigInt(o):Number(o),"num"),i=n.replace(/_/g,"").split(":").reduce((o,a)=>o*s(60)+s(a),s(0));return r==="-"?s(-1)*i:i}d(Dc,"l$A");qt(Dc,"parseSexagesimal");function cd(e){let{value:t}=e,r=qt(o=>o,"num");if(typeof t=="bigint")r=qt(o=>BigInt(o),"num");else if(isNaN(t)||!isFinite(t))return _t(e);let n="";t<0&&(n="-",t*=r(-1));const s=r(60),i=[t%s];return t<60?i.unshift(0):(t=(t-i[0])/s,i.unshift(t%s),t>=60&&(t=(t-i[0])/s,i.unshift(t))),n+i.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}d(cd,"c$J");qt(cd,"stringifySexagesimal");const gv={identify:qt(e=>typeof e=="bigint"||Number.isInteger(e),"identify"),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:qt((e,t,{intAsBigInt:r})=>Dc(e,r),"resolve"),stringify:cd},yv={identify:qt(e=>typeof e=="number","identify"),default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:qt(e=>Dc(e,!1),"resolve"),stringify:cd},Cc={identify:qt(e=>e instanceof Date,"identify"),default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Cc.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,r,n,s,i,o,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let l=Date.UTC(r,n-1,s,i||0,o||0,a||0,c);const u=t[8];if(u&&u!=="Z"){let p=Dc(u,!1);Math.abs(p)<30&&(p*=60),l-=6e4*p}return new Date(l)},stringify:qt(({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??"","stringify")},Ah=[Ys,Xs,$c,wc,fv,hv,t2,r2,n2,s2,XE,QE,ZE,td,Or,id,sd,ad,gv,yv,Cc];var a2=Object.defineProperty,c2=d((e,t)=>a2(e,"name",{value:t,configurable:!0}),"s$I");const xh=new Map([["core",ME],["failsafe",[Ys,Xs,$c]],["json",GE],["yaml11",Ah],["yaml-1.1",Ah]]),Oh={binary:td,bool:Qp,float:av,floatExp:ov,floatNaN:iv,floatTime:yv,int:lv,intHex:uv,intOct:cv,intTime:gv,map:Ys,merge:Or,null:wc,omap:id,pairs:sd,seq:Xs,set:ad,timestamp:Cc},l2={"tag:yaml.org,2002:binary":td,"tag:yaml.org,2002:merge":Or,"tag:yaml.org,2002:omap":id,"tag:yaml.org,2002:pairs":sd,"tag:yaml.org,2002:set":ad,"tag:yaml.org,2002:timestamp":Cc};function ba(e,t,r){const n=xh.get(t);if(n&&!e)return r&&!n.includes(Or)?n.concat(Or):n.slice();let s=n;if(!s)if(Array.isArray(e))s=[];else{const i=Array.from(xh.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${i} or define customTags array`)}if(Array.isArray(e))for(const i of e)s=s.concat(i);else typeof e=="function"&&(s=e(s.slice()));return r&&(s=s.concat(Or)),s.reduce((i,o)=>{const a=typeof o=="string"?Oh[o]:o;if(!a){const c=JSON.stringify(o),l=Object.keys(Oh).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return i.includes(a)||i.push(a),i},[])}d(ba,"C$l");c2(ba,"getTags");var u2=Object.defineProperty,vv=d((e,t)=>u2(e,"name",{value:t,configurable:!0}),"o$X");const p2=vv((e,t)=>e.key<t.key?-1:e.key>t.key?1:0,"sortMapEntriesByKey");let d2=class bv{static{d(this,"i")}static{vv(this,"Schema")}constructor({compat:t,customTags:r,merge:n,resolveKnownTags:s,schema:i,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(t)?ba(t,"compat"):t?ba(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=s?l2:{},this.tags=ba(r,this.name,n),this.toStringOptions=a??null,Object.defineProperty(this,Yr,{value:Ys}),Object.defineProperty(this,lr,{value:$c}),Object.defineProperty(this,Hs,{value:Xs}),this.sortMapEntries=typeof o=="function"?o:o===!0?p2:null}clone(){const t=Object.create(bv.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};var f2=Object.defineProperty,h2=d((e,t)=>f2(e,"name",{value:t,configurable:!0}),"u$K");function $v(e,t){const r=[];let n=t.directives===!0;if(t.directives!==!1&&e.directives){const c=e.directives.toString(e);c?(r.push(c),n=!0):e.directives.docStart&&(n=!0)}n&&r.push("---");const s=Hp(e,t),{commentString:i}=s.options;if(e.commentBefore){r.length!==1&&r.unshift("");const c=i(e.commentBefore);r.unshift(tr(c,""))}let o=!1,a=null;if(e.contents){if(Me(e.contents)){if(e.contents.spaceBefore&&n&&r.push(""),e.contents.commentBefore){const u=i(e.contents.commentBefore);r.push(tr(u,""))}s.forceBlockIndent=!!e.comment,a=e.contents.comment}const c=a?void 0:()=>o=!0;let l=Nn(e.contents,s,()=>a=null,c);a&&(l+=An(l,"",i(a))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(Nn(e.contents,s));if(e.directives?.docEnd)if(e.comment){const c=i(e.comment);c.includes(`
|
|
863
863
|
`)?(r.push("..."),r.push(tr(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=e.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||a)&&r[r.length-1]!==""&&r.push(""),r.push(tr(i(c),"")))}return r.join(`
|
|
864
864
|
`)+`
|
|
865
|
-
`}d($v,"C$
|
|
865
|
+
`}d($v,"C$k");h2($v,"stringifyDocument");var m2=Object.defineProperty,Bu=d((e,t)=>m2(e,"name",{value:t,configurable:!0}),"f$u");let ld=class wv{static{d(this,"b")}static{Bu(this,"Document")}constructor(t,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,It,{value:Du});let s=null;typeof r=="function"||Array.isArray(r)?s=r:n===void 0&&r&&(n=r,r=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=i;let{version:o}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Ds({version:o}),this.setSchema(o,n),this.contents=t===void 0?null:this.createNode(t,s,n)}clone(){const t=Object.create(wv.prototype,{[It]:{value:Du}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Me(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){kn(this.contents)&&this.contents.add(t)}addIn(t,r){kn(this.contents)&&this.contents.addIn(t,r)}createAlias(t,r){if(!t.anchor){const n=Wp(this);t.anchor=!r||n.has(r)?Vp(r||"a",n):r}return new Gp(t.anchor)}createNode(t,r,n){let s;if(typeof r=="function")t=r.call({"":t},"",t),s=r;else if(Array.isArray(r)){const k=Bu(y=>typeof y=="number"||y instanceof String||y instanceof Number,"keyToStr"),S=r.filter(k).map(String);S.length>0&&(r=r.concat(S)),s=r}else n===void 0&&r&&(n=r,r=void 0);const{aliasDuplicateObjects:i,anchorPrefix:o,flow:a,keepUndefined:c,onTagObj:l,tag:u}=n??{},{onAnchor:p,setAnchors:f,sourceObjects:m}=Ly(this,o||"a"),$={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:p,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:m},b=Ts(t,u,$);return a&&_e(b)&&(b.flow=!0),f(),b}createPair(t,r,n={}){const s=this.createNode(t,null,n),i=this.createNode(r,null,n);return new Et(s,i)}delete(t){return kn(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Wi(t)?this.contents==null?!1:(this.contents=null,!0):kn(this.contents)?this.contents.deleteIn(t):!1}get(t,r){return _e(this.contents)?this.contents.get(t,r):void 0}getIn(t,r){return Wi(t)?!r&&Fe(this.contents)?this.contents.value:this.contents:_e(this.contents)?this.contents.getIn(t,r):void 0}has(t){return _e(this.contents)?this.contents.has(t):!1}hasIn(t){return Wi(t)?this.contents!==void 0:_e(this.contents)?this.contents.hasIn(t):!1}set(t,r){this.contents==null?this.contents=uo(this.schema,[t],r):kn(this.contents)&&this.contents.set(t,r)}setIn(t,r){Wi(t)?this.contents=r:this.contents==null?this.contents=uo(this.schema,Array.from(t),r):kn(this.contents)&&this.contents.setIn(t,r)}setSchema(t,r={}){typeof t=="number"&&(t=String(t));let n;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ds({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Ds({version:t}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const s=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${s}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new d2(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:r,mapAsMap:n,maxAliasCount:s,onAnchor:i,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},c=Ct(this.contents,r??"",a);if(typeof i=="function")for(const{count:l,res:u}of a.anchors.values())i(u,l);return typeof o=="function"?jn(o,{"":c},"",c):c}toJSON(t,r){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:r})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const r=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return $v(this,t)}};function kn(e){if(_e(e))return!0;throw new Error("Expected a YAML collection as document contents")}d(kn,"o$W");Bu(kn,"assertCollection");var g2=Object.defineProperty,Ec=d((e,t)=>g2(e,"name",{value:t,configurable:!0}),"l$y");let kv=class extends Error{static{d(this,"g")}static{Ec(this,"YAMLError")}constructor(t,r,n,s){super(),this.name=t,this.code=n,this.message=s,this.pos=r}},$s=class extends kv{static{d(this,"h")}static{Ec(this,"YAMLParseError")}constructor(t,r,n){super("YAMLParseError",t,r,n)}},y2=class extends kv{static{d(this,"m")}static{Ec(this,"YAMLWarning")}constructor(t,r,n){super("YAMLWarning",t,r,n)}};const Ia=Ec((e,t)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(a=>t.linePos(a));const{line:n,col:s}=r.linePos[0];r.message+=` at line ${n}, column ${s}`;let i=s-1,o=e.substring(t.lineStarts[n-1],t.lineStarts[n]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){const a=Math.min(i-39,o.length-79);o="…"+o.substring(a),i-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),n>1&&/^ *$/.test(o.substring(0,i))){let a=e.substring(t.lineStarts[n-2],t.lineStarts[n-1]);a.length>80&&(a=a.substring(0,79)+`…
|
|
866
866
|
`),o=a+o}if(/[^ ]/.test(o)){let a=1;const c=r.linePos[1];c?.line===n&&c.col>s&&(a=Math.max(1,Math.min(c.col-s,80-i)));const l=" ".repeat(i)+"^".repeat(a);r.message+=`:
|
|
867
867
|
|
|
868
868
|
${o}
|
|
869
869
|
${l}
|
|
870
|
-
`}},"prettifyError");var v2=Object.defineProperty,b2=d((e,t)=>v2(e,"name",{value:t,configurable:!0}),"g$m");function Ln(e,{flow:t,indicator:r,next:n,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,p="",f="",m=!1,$=!1,b=null,k=null,S=null,y=null,h=null,v=null,w=null;for(const C of e)switch($&&(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma"&&i(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),$=!1),b&&(l&&C.type!=="comment"&&C.type!=="newline"&&i(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),C.type){case"space":!t&&(r!=="doc-start"||n?.type!=="flow-collection")&&C.source.includes(" ")&&(b=C),u=!0;break;case"comment":{u||i(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const A=C.source.substring(1)||" ";p?p+=f+A:p=A,f="",l=!1;break}case"newline":l?p?p+=C.source:(!v||r!=="seq-item-ind")&&(c=!0):f+=C.source,l=!0,m=!0,(k||S)&&(y=C),u=!0;break;case"anchor":k&&i(C,"MULTIPLE_ANCHORS","A node can have at most one anchor"),C.source.endsWith(":")&&i(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),k=C,w??(w=C.offset),l=!1,u=!1,$=!0;break;case"tag":{S&&i(C,"MULTIPLE_TAGS","A node can have at most one tag"),S=C,w??(w=C.offset),l=!1,u=!1,$=!0;break}case r:(k||S)&&i(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`),v&&i(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${t??"collection"}`),v=C,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(t){h&&i(C,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),h=C,l=!1,u=!1;break}default:i(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),l=!1,u=!1}const g=e[e.length-1],E=g?g.offset+g.source.length:s;return $&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&i(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b&&(l&&b.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&i(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:h,found:v,spaceBefore:c,comment:p,hasNewline:m,anchor:k,tag:S,newlineAfterProp:y,end:E,start:w??E}}d(Ln,"C$
|
|
871
|
-
`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const r of t.start)if(r.type==="newline")return!0;if(t.sep){for(const r of t.sep)if(r.type==="newline")return!0}if(Ns(t.key)||Ns(t.value))return!0}return!1;default:return!0}}d(Ns,"n$
|
|
870
|
+
`}},"prettifyError");var v2=Object.defineProperty,b2=d((e,t)=>v2(e,"name",{value:t,configurable:!0}),"g$m");function Ln(e,{flow:t,indicator:r,next:n,offset:s,onError:i,parentIndent:o,startOnNewline:a}){let c=!1,l=a,u=a,p="",f="",m=!1,$=!1,b=null,k=null,S=null,y=null,h=null,v=null,w=null;for(const C of e)switch($&&(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma"&&i(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),$=!1),b&&(l&&C.type!=="comment"&&C.type!=="newline"&&i(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),C.type){case"space":!t&&(r!=="doc-start"||n?.type!=="flow-collection")&&C.source.includes(" ")&&(b=C),u=!0;break;case"comment":{u||i(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const A=C.source.substring(1)||" ";p?p+=f+A:p=A,f="",l=!1;break}case"newline":l?p?p+=C.source:(!v||r!=="seq-item-ind")&&(c=!0):f+=C.source,l=!0,m=!0,(k||S)&&(y=C),u=!0;break;case"anchor":k&&i(C,"MULTIPLE_ANCHORS","A node can have at most one anchor"),C.source.endsWith(":")&&i(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),k=C,w??(w=C.offset),l=!1,u=!1,$=!0;break;case"tag":{S&&i(C,"MULTIPLE_TAGS","A node can have at most one tag"),S=C,w??(w=C.offset),l=!1,u=!1,$=!0;break}case r:(k||S)&&i(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`),v&&i(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${t??"collection"}`),v=C,l=r==="seq-item-ind"||r==="explicit-key-ind",u=!1;break;case"comma":if(t){h&&i(C,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),h=C,l=!1,u=!1;break}default:i(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),l=!1,u=!1}const g=e[e.length-1],E=g?g.offset+g.source.length:s;return $&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&i(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b&&(l&&b.indent<=o||n?.type==="block-map"||n?.type==="block-seq")&&i(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:h,found:v,spaceBefore:c,comment:p,hasNewline:m,anchor:k,tag:S,newlineAfterProp:y,end:E,start:w??E}}d(Ln,"C$j");b2(Ln,"resolveProps");var $2=Object.defineProperty,w2=d((e,t)=>$2(e,"name",{value:t,configurable:!0}),"s$H");function Ns(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
871
|
+
`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const r of t.start)if(r.type==="newline")return!0;if(t.sep){for(const r of t.sep)if(r.type==="newline")return!0}if(Ns(t.key)||Ns(t.value))return!0}return!1;default:return!0}}d(Ns,"n$M");w2(Ns,"containsNewline");var k2=Object.defineProperty,S2=d((e,t)=>k2(e,"name",{value:t,configurable:!0}),"t$J");function La(e,t,r){if(t?.type==="flow-collection"){const n=t.end[0];n.indent===e&&(n.source==="]"||n.source==="}")&&Ns(t)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}d(La,"c$H");S2(La,"flowIndentCheck");var D2=Object.defineProperty,C2=d((e,t)=>D2(e,"name",{value:t,configurable:!0}),"u$I");function ud(e,t,r){const{uniqueKeys:n}=e.options;if(n===!1)return!1;const s=typeof n=="function"?n:(i,o)=>i===o||Fe(i)&&Fe(o)&&i.value===o.value;return t.some(i=>s(i.key,r))}d(ud,"a$Q");C2(ud,"mapIncludes");var E2=Object.defineProperty,j2=d((e,t)=>E2(e,"name",{value:t,configurable:!0}),"w$r");const Ph="All mapping items must start at the same column";function Sv({composeNode:e,composeEmptyNode:t},r,n,s,i){const o=i?.nodeClass??Bt,a=new o(r.schema);r.atRoot&&(r.atRoot=!1);let c=n.offset,l=null;for(const u of n.items){const{start:p,key:f,sep:m,value:$}=u,b=Ln(p,{indicator:"explicit-key-ind",next:f??m?.[0],offset:c,onError:s,parentIndent:n.indent,startOnNewline:!0}),k=!b.found;if(k){if(f&&(f.type==="block-seq"?s(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==n.indent&&s(c,"BAD_INDENT",Ph)),!b.anchor&&!b.tag&&!m){l=b.end,b.comment&&(a.comment?a.comment+=`
|
|
872
872
|
`+b.comment:a.comment=b.comment);continue}(b.newlineAfterProp||Ns(f))&&s(f??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else b.found?.indent!==n.indent&&s(c,"BAD_INDENT",Ph);r.atKey=!0;const S=b.end,y=f?e(r,f,b,s):t(r,S,p,null,b,s);r.schema.compat&&La(n.indent,f,s),r.atKey=!1,ud(r,a.items,y)&&s(S,"DUPLICATE_KEY","Map keys must be unique");const h=Ln(m??[],{indicator:"map-value-ind",next:$,offset:y.range[2],onError:s,parentIndent:n.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=h.end,h.found){k&&($?.type==="block-map"&&!h.hasNewline&&s(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&b.start<h.found.offset-1024&&s(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const v=$?e(r,$,h,s):t(r,c,m,null,h,s);r.schema.compat&&La(n.indent,$,s),c=v.range[2];const w=new Et(y,v);r.options.keepSourceTokens&&(w.srcToken=u),a.items.push(w)}else{k&&s(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),h.comment&&(y.comment?y.comment+=`
|
|
873
873
|
`+h.comment:y.comment=h.comment);const v=new Et(y);r.options.keepSourceTokens&&(v.srcToken=u),a.items.push(v)}}return l&&l<c&&s(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[n.offset,c,l??c],a}d(Sv,"v$t");j2(Sv,"resolveBlockMap");var A2=Object.defineProperty,x2=d((e,t)=>A2(e,"name",{value:t,configurable:!0}),"u$H");function Dv({composeNode:e,composeEmptyNode:t},r,n,s,i){const o=i?.nodeClass??In,a=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=n.offset,l=null;for(const{start:u,value:p}of n.items){const f=Ln(u,{indicator:"seq-item-ind",next:p,offset:c,onError:s,parentIndent:n.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||p)p?.type==="block-seq"?s(f.end,"BAD_INDENT","All sequence items must start at the same column"):s(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(a.comment=f.comment);continue}const m=p?e(r,p,f,s):t(r,f.end,u,null,f,s);r.schema.compat&&La(n.indent,p,s),c=m.range[2],a.items.push(m)}return a.range=[n.offset,c,l??c],a}d(Dv,"S$r");x2(Dv,"resolveBlockSeq");var O2=Object.defineProperty,P2=d((e,t)=>O2(e,"name",{value:t,configurable:!0}),"f$s");function Qs(e,t,r,n){let s="";if(e){let i=!1,o="";for(const a of e){const{source:c,type:l}=a;switch(l){case"space":i=!0;break;case"comment":{r&&!i&&n(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const u=c.substring(1)||" ";s?s+=o+u:s=u,o="";break}case"newline":s&&(o+=c),i=!0;break;default:n(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=c.length}}return{comment:s,offset:t}}d(Qs,"u$G");P2(Qs,"resolveEnd");var F2=Object.defineProperty,Cv=d((e,t)=>F2(e,"name",{value:t,configurable:!0}),"T$q");const Cl="Block collections are not allowed within flow collections",El=Cv(e=>e&&(e.type==="block-map"||e.type==="block-seq"),"isBlock");function Ev({composeNode:e,composeEmptyNode:t},r,n,s,i){const o=n.start.source==="{",a=o?"flow map":"flow sequence",c=i?.nodeClass??(o?Bt:In),l=new c(r.schema);l.flow=!0;const u=r.atRoot;u&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let p=n.offset+n.start.source.length;for(let k=0;k<n.items.length;++k){const S=n.items[k],{start:y,key:h,sep:v,value:w}=S,g=Ln(y,{flow:a,indicator:"explicit-key-ind",next:h??v?.[0],offset:p,onError:s,parentIndent:n.indent,startOnNewline:!1});if(!g.found){if(!g.anchor&&!g.tag&&!v&&!w){k===0&&g.comma?s(g.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):k<n.items.length-1&&s(g.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),g.comment&&(l.comment?l.comment+=`
|
|
874
874
|
`+g.comment:l.comment=g.comment),p=g.end;continue}!o&&r.options.strict&&Ns(h)&&s(h,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(k===0)g.comma&&s(g.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(g.comma||s(g.start,"MISSING_CHAR",`Missing , between ${a} items`),g.comment){let E="";e:for(const C of y)switch(C.type){case"comma":case"space":break;case"comment":E=C.source.substring(1);break e;default:break e}if(E){let C=l.items[l.items.length-1];We(C)&&(C=C.value??C.key),C.comment?C.comment+=`
|
|
875
875
|
`+E:C.comment=E,g.comment=g.comment.substring(E.length+1)}}if(!o&&!v&&!g.found){const E=w?e(r,w,g,s):t(r,g.end,v,null,g,s);l.items.push(E),p=E.range[2],El(w)&&s(E.range,"BLOCK_IN_FLOW",Cl)}else{r.atKey=!0;const E=g.end,C=h?e(r,h,g,s):t(r,E,y,null,g,s);El(h)&&s(C.range,"BLOCK_IN_FLOW",Cl),r.atKey=!1;const A=Ln(v??[],{flow:a,indicator:"map-value-ind",next:w,offset:C.range[2],onError:s,parentIndent:n.indent,startOnNewline:!1});if(A.found){if(!o&&!g.found&&r.options.strict){if(v)for(const V of v){if(V===A.found)break;if(V.type==="newline"){s(V,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}g.start<A.found.offset-1024&&s(A.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else w&&("source"in w&&w.source?.[0]===":"?s(w,"MISSING_CHAR",`Missing space after : in ${a}`):s(A.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const O=w?e(r,w,A,s):A.found?t(r,A.end,v,null,A,s):null;O?El(w)&&s(O.range,"BLOCK_IN_FLOW",Cl):A.comment&&(C.comment?C.comment+=`
|
|
876
876
|
`+A.comment:C.comment=A.comment);const I=new Et(C,O);if(r.options.keepSourceTokens&&(I.srcToken=S),o){const V=l;ud(r,V.items,C)&&s(E,"DUPLICATE_KEY","Map keys must be unique"),V.items.push(I)}else{const V=new Bt(r.schema);V.flow=!0,V.items.push(I);const fe=(O??C).range;V.range=[C.range[0],fe[1],fe[2]],l.items.push(V)}p=O?O.range[2]:A.end}}const f=o?"}":"]",[m,...$]=n.end;let b=p;if(m?.source===f)b=m.offset+m.source.length;else{const k=a[0].toUpperCase()+a.substring(1),S=u?`${k} must end with a ${f}`:`${k} in block collection must be sufficiently indented and end with a ${f}`;s(p,u?"MISSING_CHAR":"BAD_INDENT",S),m&&m.source.length!==1&&$.unshift(m)}if($.length>0){const k=Qs($,b,r.options.strict,s);k.comment&&(l.comment?l.comment+=`
|
|
877
|
-
`+k.comment:l.comment=k.comment),l.range=[n.offset,b,k.offset]}else l.range=[n.offset,b,b];return l}d(Ev,"F$
|
|
877
|
+
`+k.comment:l.comment=k.comment),l.range=[n.offset,b,k.offset]}else l.range=[n.offset,b,b];return l}d(Ev,"F$l");Cv(Ev,"resolveFlowCollection");var B2=Object.defineProperty,jv=d((e,t)=>B2(e,"name",{value:t,configurable:!0}),"u$F");function $a(e,t,r,n,s,i){const o=r.type==="block-map"?Sv(e,t,r,n,i):r.type==="block-seq"?Dv(e,t,r,n,i):Ev(e,t,r,n,i),a=o.constructor;return s==="!"||s===a.tagName?(o.tag=a.tagName,o):(s&&(o.tag=s),o)}d($a,"A$r");jv($a,"resolveCollection");function Av(e,t,r,n,s){const i=n.tag,o=i?t.directives.tagName(i.source,f=>s(i,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){const{anchor:f,newlineAfterProp:m}=n,$=f&&i?f.offset>i.offset?f:i:f??i;$&&(!m||m.offset<$.offset)&&s($,"MISSING_CHAR","Missing newline after block sequence props")}const a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===Bt.tagName&&a==="map"||o===In.tagName&&a==="seq")return $a(e,t,r,s,o);let c=t.schema.tags.find(f=>f.tag===o&&f.collection===a);if(!c){const f=t.schema.knownTags[o];if(f?.collection===a)t.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?s(i,"BAD_COLLECTION_TYPE",`${f.tag} used for ${a} collection, but expects ${f.collection??"scalar"}`,!0):s(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),$a(e,t,r,s,o)}const l=$a(e,t,r,s,o,c),u=c.resolve?.(l,f=>s(i,"TAG_RESOLVE_FAILED",f),t.options)??l,p=Me(u)?u:new se(u);return p.range=l.range,p.tag=o,c?.format&&(p.format=c.format),p}d(Av,"I$n");jv(Av,"composeCollection");var R2=Object.defineProperty,pd=d((e,t)=>R2(e,"name",{value:t,configurable:!0}),"B$e");function dd(e,t,r){const n=t.offset,s=xv(t,e.options.strict,r);if(!s)return{value:"",type:null,comment:"",range:[n,n,n]};const i=s.mode===">"?se.BLOCK_FOLDED:se.BLOCK_LITERAL,o=t.source?Ov(t.source):[];let a=o.length;for(let b=o.length-1;b>=0;--b){const k=o[b][1];if(k===""||k==="\r")a=b;else break}if(a===0){const b=s.chomp==="+"&&o.length>0?`
|
|
878
878
|
`.repeat(Math.max(1,o.length-1)):"";let k=n+s.length;return t.source&&(k+=t.source.length),{value:b,type:i,comment:s.comment,range:[n,k,k]}}let c=t.indent+s.indent,l=t.offset+s.length,u=0;for(let b=0;b<a;++b){const[k,S]=o[b];if(S===""||S==="\r")s.indent===0&&k.length>c&&(c=k.length);else{k.length<c&&r(l+k.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),s.indent===0&&(c=k.length),u=b,c===0&&!e.atRoot&&r(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=k.length+S.length+1}for(let b=o.length-1;b>=a;--b)o[b][0].length>c&&(a=b+1);let p="",f="",m=!1;for(let b=0;b<u;++b)p+=o[b][0].slice(c)+`
|
|
879
879
|
`;for(let b=u;b<a;++b){let[k,S]=o[b];l+=k.length+S.length+1;const y=S[S.length-1]==="\r";if(y&&(S=S.slice(0,-1)),S&&k.length<c){const h=`Block scalar lines must not be less indented than their ${s.indent?"explicit indentation indicator":"first line"}`;r(l-S.length-(y?2:1),"BAD_INDENT",h),k=""}i===se.BLOCK_LITERAL?(p+=f+k.slice(c)+S,f=`
|
|
880
880
|
`):k.length>c||S[0]===" "?(f===" "?f=`
|
|
@@ -889,7 +889,7 @@ ${l}
|
|
|
889
889
|
`+o[b][0].slice(c);p[p.length-1]!==`
|
|
890
890
|
`&&(p+=`
|
|
891
891
|
`);break;default:p+=`
|
|
892
|
-
`}const $=n+s.length+t.source.length;return{value:p,type:i,comment:s.comment,range:[n,$,$]}}d(dd,"E$r");pd(dd,"resolveBlockScalar");function xv({offset:e,props:t},r,n){if(t[0].type!=="block-scalar-header")return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],i=s[0];let o=0,a="",c=-1;for(let f=1;f<s.length;++f){const m=s[f];if(!a&&(m==="-"||m==="+"))a=m;else{const $=Number(m);!o&&$?o=$:c===-1&&(c=e+f)}}c!==-1&&n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let l=!1,u="",p=s.length;for(let f=1;f<t.length;++f){const m=t[f];switch(m.type){case"space":l=!0;case"newline":p+=m.source.length;break;case"comment":r&&!l&&n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),p+=m.source.length,u=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),p+=m.source.length;break;default:{const $=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",$);const b=m.source;b&&typeof b=="string"&&(p+=b.length)}}}return{mode:i,indent:o,chomp:a,comment:u,length:p}}d(xv,"L$n");pd(xv,"parseBlockScalarHeader");function Ov(e){const t=e.split(/\n( *)/),r=t[0],n=r.match(/^( *)/),s=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let i=1;i<t.length;i+=2)s.push([t[i],t[i+1]]);return s}d(Ov,"T$p");pd(Ov,"splitLines");var T2=Object.defineProperty,pn=d((e,t)=>T2(e,"name",{value:t,configurable:!0}),"r$
|
|
892
|
+
`}const $=n+s.length+t.source.length;return{value:p,type:i,comment:s.comment,range:[n,$,$]}}d(dd,"E$r");pd(dd,"resolveBlockScalar");function xv({offset:e,props:t},r,n){if(t[0].type!=="block-scalar-header")return n(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:s}=t[0],i=s[0];let o=0,a="",c=-1;for(let f=1;f<s.length;++f){const m=s[f];if(!a&&(m==="-"||m==="+"))a=m;else{const $=Number(m);!o&&$?o=$:c===-1&&(c=e+f)}}c!==-1&&n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${s}`);let l=!1,u="",p=s.length;for(let f=1;f<t.length;++f){const m=t[f];switch(m.type){case"space":l=!0;case"newline":p+=m.source.length;break;case"comment":r&&!l&&n(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),p+=m.source.length,u=m.source.substring(1);break;case"error":n(m,"UNEXPECTED_TOKEN",m.message),p+=m.source.length;break;default:{const $=`Unexpected token in block scalar header: ${m.type}`;n(m,"UNEXPECTED_TOKEN",$);const b=m.source;b&&typeof b=="string"&&(p+=b.length)}}}return{mode:i,indent:o,chomp:a,comment:u,length:p}}d(xv,"L$n");pd(xv,"parseBlockScalarHeader");function Ov(e){const t=e.split(/\n( *)/),r=t[0],n=r.match(/^( *)/),s=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let i=1;i<t.length;i+=2)s.push([t[i],t[i+1]]);return s}d(Ov,"T$p");pd(Ov,"splitLines");var T2=Object.defineProperty,pn=d((e,t)=>T2(e,"name",{value:t,configurable:!0}),"r$Q");function fd(e,t,r){const{offset:n,type:s,source:i,end:o}=e;let a,c;const l=pn((f,m,$)=>r(n+f,m,$),"_onError");switch(s){case"scalar":a=se.PLAIN,c=Pv(i,l);break;case"single-quoted-scalar":a=se.QUOTE_SINGLE,c=Fv(i,l);break;case"double-quoted-scalar":a=se.QUOTE_DOUBLE,c=Bv(i,l);break;default:return r(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${s}`),{value:"",type:null,comment:"",range:[n,n+i.length,n+i.length]}}const u=n+i.length,p=Qs(o,u,t,r);return{value:c,type:a,comment:p.comment,range:[n,u,p.offset]}}d(fd,"_$o");pn(fd,"resolveFlowScalar");function Pv(e,t){let r="";switch(e[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${e[0]}`;break}case"@":case"`":{r=`reserved character ${e[0]}`;break}}return r&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),hd(e)}d(Pv,"v$s");pn(Pv,"plainValue");function Fv(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),hd(e.slice(1,-1)).replace(/''/g,"'")}d(Fv,"I$m");pn(Fv,"singleQuotedValue");function hd(e){let t,r;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
893
893
|
`,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
894
894
|
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=t.exec(e);if(!n)return e;let s=n[1],i=" ",o=t.lastIndex;for(r.lastIndex=o;n=r.exec(e);)n[1]===""?i===`
|
|
895
895
|
`?s+=i:i=`
|
|
@@ -904,14 +904,14 @@ ${l}
|
|
|
904
904
|
`);)n===`
|
|
905
905
|
`&&(r+=`
|
|
906
906
|
`),t+=1,n=e[t+1];return r||(r=" "),{fold:r,offset:t}}d(Rv,"k$s");pn(Rv,"foldNewline");const N2={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
907
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Tv(e,t,r,n){const s=e.substr(t,r),i=s.length===r&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;try{return String.fromCodePoint(i)}catch{const o=e.substr(t-2,r+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}}d(Tv,"A$q");pn(Tv,"parseCharCode");var I2=Object.defineProperty,md=d((e,t)=>I2(e,"name",{value:t,configurable:!0}),"m$C");function gd(e,t,r,n){const{value:s,type:i,comment:o,range:a}=t.type==="block-scalar"?dd(e,t,n):fd(t,e.options.strict,n),c=r?e.directives.tagName(r.source,p=>n(r,"TAG_RESOLVE_FAILED",p)):null;let l;e.options.stringKeys&&e.atKey?l=e.schema[lr]:c?l=Nv(e.schema,s,c,r,n):t.type==="scalar"?l=Iv(e,s,t,n):l=e.schema[lr];let u;try{const p=l.resolve(s,f=>n(r??t,"TAG_RESOLVE_FAILED",f),e.options);u=Fe(p)?p:new se(p)}catch(p){const f=p instanceof Error?p.message:String(p);n(r??t,"TAG_RESOLVE_FAILED",f),u=new se(s)}return u.range=a,u.source=s,i&&(u.type=i),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}d(gd,"E$q");md(gd,"composeScalar");function Nv(e,t,r,n,s){if(r==="!")return e[lr];const i=[];for(const a of e.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)i.push(a);else return a;for(const a of i)if(a.test?.test(t))return a;const o=e.knownTags[r];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),e[lr])}d(Nv,"_$
|
|
907
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Tv(e,t,r,n){const s=e.substr(t,r),i=s.length===r&&/^[0-9a-fA-F]+$/.test(s)?parseInt(s,16):NaN;try{return String.fromCodePoint(i)}catch{const o=e.substr(t-2,r+2);return n(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}}d(Tv,"A$q");pn(Tv,"parseCharCode");var I2=Object.defineProperty,md=d((e,t)=>I2(e,"name",{value:t,configurable:!0}),"m$C");function gd(e,t,r,n){const{value:s,type:i,comment:o,range:a}=t.type==="block-scalar"?dd(e,t,n):fd(t,e.options.strict,n),c=r?e.directives.tagName(r.source,p=>n(r,"TAG_RESOLVE_FAILED",p)):null;let l;e.options.stringKeys&&e.atKey?l=e.schema[lr]:c?l=Nv(e.schema,s,c,r,n):t.type==="scalar"?l=Iv(e,s,t,n):l=e.schema[lr];let u;try{const p=l.resolve(s,f=>n(r??t,"TAG_RESOLVE_FAILED",f),e.options);u=Fe(p)?p:new se(p)}catch(p){const f=p instanceof Error?p.message:String(p);n(r??t,"TAG_RESOLVE_FAILED",f),u=new se(s)}return u.range=a,u.source=s,i&&(u.type=i),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}d(gd,"E$q");md(gd,"composeScalar");function Nv(e,t,r,n,s){if(r==="!")return e[lr];const i=[];for(const a of e.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)i.push(a);else return a;for(const a of i)if(a.test?.test(t))return a;const o=e.knownTags[r];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(s(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),e[lr])}d(Nv,"_$n");md(Nv,"findScalarTagByName");function Iv({atKey:e,directives:t,schema:r},n,s,i){const o=r.tags.find(a=>(a.default===!0||e&&a.default==="key")&&a.test?.test(n))||r[lr];if(r.compat){const a=r.compat.find(c=>c.default&&c.test?.test(n))??r[lr];if(o.tag!==a.tag){const c=t.tagString(o.tag),l=t.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;i(s,"TAG_RESOLVE_FAILED",u,!0)}}return o}d(Iv,"F$k");md(Iv,"findScalarTagByTest");var L2=Object.defineProperty,_2=d((e,t)=>L2(e,"name",{value:t,configurable:!0}),"a$P");function Lv(e,t,r){if(t){r??(r=t.length);for(let n=r-1;n>=0;--n){let s=t[n];switch(s.type){case"space":case"comment":case"newline":e-=s.source.length;continue}for(s=t[++n];s?.type==="space";)e+=s.source.length,s=t[++n];break}}return e}d(Lv,"s$G");_2(Lv,"emptyScalarPosition");var M2=Object.defineProperty,yd=d((e,t)=>M2(e,"name",{value:t,configurable:!0}),"u$E");const W2={composeNode:vd,composeEmptyNode:jc};function vd(e,t,r,n){const s=e.atKey,{spaceBefore:i,comment:o,anchor:a,tag:c}=r;let l,u=!0;switch(t.type){case"alias":l=_v(e,t,n),(a||c)&&n(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=gd(e,t,c,n),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Av(W2,e,t,r,n),a&&(l.anchor=a.source.substring(1))}catch(p){const f=p instanceof Error?p.message:String(p);n(t,"RESOURCE_EXHAUSTION",f)}break;default:{const p=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;n(t,"UNEXPECTED_TOKEN",p),u=!1}}return l??(l=jc(e,t.offset,void 0,null,r,n)),a&&l.anchor===""&&n(a,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!Fe(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&n(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),i&&(l.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}d(vd,"A$p");yd(vd,"composeNode");function jc(e,t,r,n,{spaceBefore:s,comment:i,anchor:o,tag:a,end:c},l){const u={type:"scalar",offset:Lv(t,r,n),indent:-1,source:""},p=gd(e,u,a,l);return o&&(p.anchor=o.source.substring(1),p.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),s&&(p.spaceBefore=!0),i&&(p.comment=i,p.range[2]=c),p}d(jc,"p$E");yd(jc,"composeEmptyNode");function _v({options:e},{offset:t,source:r,end:n},s){const i=new Gp(r.substring(1));i.source===""&&s(t,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&s(t+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+r.length,a=Qs(n,o,e.strict,s);return i.range=[t,o,a.offset],a.comment&&(i.comment=a.comment),i}d(_v,"I$l");yd(_v,"composeAlias");var V2=Object.defineProperty,U2=d((e,t)=>V2(e,"name",{value:t,configurable:!0}),"f$r");function Mv(e,t,{offset:r,start:n,value:s,end:i},o){const a=Object.assign({_directives:t},e),c=new ld(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Ln(n,{indicator:"doc-start",next:s??i?.[0],offset:r,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,s&&(s.type==="block-map"||s.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=s?vd(l,s,u,o):jc(l,u.end,n,null,u,o);const p=c.contents.range[2],f=Qs(i,p,!1,o);return f.comment&&(c.comment=f.comment),c.range=[r,p,f.offset],c}d(Mv,"b$n");U2(Mv,"composeDoc");var G2=Object.defineProperty,bd=d((e,t)=>G2(e,"name",{value:t,configurable:!0}),"h$r");function hs(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:r}=e;return[t,t+(typeof r=="string"?r.length:1)]}d(hs,"c$G");bd(hs,"getErrorPos");function Ru(e){let t="",r=!1,n=!1;for(let s=0;s<e.length;++s){const i=e[s];switch(i[0]){case"#":t+=(t===""?"":n?`
|
|
908
908
|
|
|
909
909
|
`:`
|
|
910
910
|
`)+(i.substring(1)||" "),r=!0,n=!1;break;case"%":e[s+1]?.[0]!=="#"&&(s+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:t,afterEmptyLine:n}}d(Ru,"m$B");bd(Ru,"parsePrelude");let Wv=class{static{d(this,"y")}static{bd(this,"Composer")}constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,s,i)=>{const o=hs(r);i?this.warnings.push(new y2(o,n,s)):this.errors.push(new $s(o,n,s))},this.directives=new Ds({version:t.version||"1.2"}),this.options=t}decorate(t,r){const{comment:n,afterEmptyLine:s}=Ru(this.prelude);if(n){const i=t.contents;if(r)t.comment=t.comment?`${t.comment}
|
|
911
911
|
${n}`:n;else if(s||t.directives.docStart||!i)t.commentBefore=n;else if(_e(i)&&!i.flow&&i.items.length>0){let o=i.items[0];We(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${n}
|
|
912
912
|
${a}`:n}else{const o=i.commentBefore;i.commentBefore=o?`${n}
|
|
913
913
|
${o}`:n}}if(r){for(let i=0;i<this.errors.length;++i)t.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)t.warnings.push(this.warnings[i])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ru(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,r=!1,n=-1){for(const s of t)yield*this.next(s);yield*this.end(r,n)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(r,n,s)=>{const i=hs(t);i[0]+=r,this.onError(i,"BAD_DIRECTIVE",n,s)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const r=Mv(this.options,this.directives,t,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const r=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,n=new $s(hs(t),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const n="Unexpected doc-end without preceding document";this.errors.push(new $s(hs(t),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;const r=Qs(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){const n=this.doc.comment;this.doc.comment=n?`${n}
|
|
914
|
-
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new $s(hs(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const n=Object.assign({_directives:this.directives},this.options),s=new ld(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,r,r],this.decorate(s,!1),yield s}}};var q2=Object.defineProperty,Xn=d((e,t)=>q2(e,"name",{value:t,configurable:!0}),"i$
|
|
914
|
+
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new $s(hs(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const n=Object.assign({_directives:this.directives},this.options),s=new ld(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),s.range=[0,r,r],this.decorate(s,!1),yield s}}};var q2=Object.defineProperty,Xn=d((e,t)=>q2(e,"name",{value:t,configurable:!0}),"i$K");function H2(e,t=!0,r){if(e){const n=Xn((s,i,o)=>{const a=typeof s=="number"?s:Array.isArray(s)?s[0]:s.offset;if(r)r(a,i,o);else throw new $s([a,a+1],i,o)},"_onError");switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return fd(e,t,n);case"block-scalar":return dd({options:{strict:t}},e,n)}}return null}d(H2,"q$h");Xn(H2,"resolveAsScalar");function z2(e,t){const{implicitKey:r=!1,indent:n,inFlow:s=!1,offset:i=-1,type:o="PLAIN"}=t,a=Ks({type:o,value:e},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
915
915
|
`}];switch(a[0]){case"|":case">":{const l=a.indexOf(`
|
|
916
916
|
`),u=a.substring(0,l),p=a.substring(l+1)+`
|
|
917
917
|
`,f=[{type:"block-scalar-header",offset:i,indent:n,source:u}];return $d(f,c)||f.push({type:"newline",offset:-1,indent:n,source:`
|
|
@@ -919,10 +919,10 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
|
|
|
919
919
|
`),n=t.substring(0,r),s=t.substring(r+1)+`
|
|
920
920
|
`;if(e.type==="block-scalar"){const i=e.props[0];if(i.type!=="block-scalar-header")throw new Error("Invalid block scalar header");i.source=n,e.source=s}else{const{offset:i}=e,o="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:o,source:n}];$d(a,"end"in e?e.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
921
921
|
`});for(const c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:"block-scalar",indent:o,props:a,source:s})}}d(Vv,"A$o");Xn(Vv,"setBlockScalarValue");function $d(e,t){if(t)for(const r of t)switch(r.type){case"space":case"comment":e.push(r);break;case"newline":return e.push(r),!0}return!1}d($d,"b$m");Xn($d,"addEndtoBlockProps");function wa(e,t,r){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=r,e.source=t;break;case"block-scalar":{const n=e.props.slice(1);let s=t.length;e.props[0].type==="block-scalar-header"&&(s-=e.props[0].source.length);for(const i of n)i.offset+=s;delete e.props,Object.assign(e,{type:r,source:t,end:n});break}case"block-map":case"block-seq":{const n={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
|
|
922
|
-
`};delete e.items,Object.assign(e,{type:r,source:t,end:[n]});break}default:{const n="indent"in e?e.indent:-1,s="end"in e&&Array.isArray(e.end)?e.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(const i of Object.keys(e))i!=="type"&&i!=="offset"&&delete e[i];Object.assign(e,{type:r,indent:n,source:t,end:s})}}}d(wa,"u$D");Xn(wa,"setFlowScalarValue");var K2=Object.defineProperty,wd=d((e,t)=>K2(e,"name",{value:t,configurable:!0}),"t$I");wd(e=>"type"in e?go(e):no(e),"stringify");function go(e){switch(e.type){case"block-scalar":{let t="";for(const r of e.props)t+=go(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(const r of e.items)t+=no(r);return t}case"flow-collection":{let t=e.start.source;for(const r of e.items)t+=no(r);for(const r of e.end)t+=r.source;return t}case"document":{let t=no(e);if(e.end)for(const r of e.end)t+=r.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const r of e.end)t+=r.source;return t}}}d(go,"f$p");wd(go,"stringifyToken");function no({start:e,key:t,sep:r,value:n}){let s="";for(const i of e)s+=i.source;if(t&&(s+=go(t)),r)for(const i of r)s+=i.source;return n&&(s+=go(n)),s}d(no,"c$F");wd(no,"stringifyItem");var Y2=Object.defineProperty,Uv=d((e,t)=>Y2(e,"name",{value:t,configurable:!0}),"s$F");const Tu=Symbol("break visit"),X2=Symbol("skip children"),Gv=Symbol("remove item");function _n(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),kd(Object.freeze([]),e,t)}d(_n,"l$v");Uv(_n,"visit");_n.BREAK=Tu;_n.SKIP=X2;_n.REMOVE=Gv;_n.itemAtPath=(e,t)=>{let r=e;for(const[n,s]of t){const i=r?.[n];if(i&&"items"in i)r=i.items[s];else return}return r};_n.parentCollection=(e,t)=>{const r=_n.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],s=r?.[n];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};function kd(e,t,r){let n=r(t,e);if(typeof n=="symbol")return n;for(const s of["key","value"]){const i=t[s];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){const a=kd(Object.freeze(e.concat([[s,o]])),i.items[o],r);if(typeof a=="number")o=a-1;else{if(a===Tu)return Tu;a===Gv&&(i.items.splice(o,1),o-=1)}}typeof n=="function"&&s==="key"&&(n=n(t,e))}}return typeof n=="function"?n(t,e):n}d(kd,"y$r");Uv(kd,"_visit");var Q2=Object.defineProperty,Ac=d((e,t)=>Q2(e,"name",{value:t,configurable:!0}),"r$
|
|
922
|
+
`};delete e.items,Object.assign(e,{type:r,source:t,end:[n]});break}default:{const n="indent"in e?e.indent:-1,s="end"in e&&Array.isArray(e.end)?e.end.filter(i=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(const i of Object.keys(e))i!=="type"&&i!=="offset"&&delete e[i];Object.assign(e,{type:r,indent:n,source:t,end:s})}}}d(wa,"u$D");Xn(wa,"setFlowScalarValue");var K2=Object.defineProperty,wd=d((e,t)=>K2(e,"name",{value:t,configurable:!0}),"t$I");wd(e=>"type"in e?go(e):no(e),"stringify");function go(e){switch(e.type){case"block-scalar":{let t="";for(const r of e.props)t+=go(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(const r of e.items)t+=no(r);return t}case"flow-collection":{let t=e.start.source;for(const r of e.items)t+=no(r);for(const r of e.end)t+=r.source;return t}case"document":{let t=no(e);if(e.end)for(const r of e.end)t+=r.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const r of e.end)t+=r.source;return t}}}d(go,"f$p");wd(go,"stringifyToken");function no({start:e,key:t,sep:r,value:n}){let s="";for(const i of e)s+=i.source;if(t&&(s+=go(t)),r)for(const i of r)s+=i.source;return n&&(s+=go(n)),s}d(no,"c$F");wd(no,"stringifyItem");var Y2=Object.defineProperty,Uv=d((e,t)=>Y2(e,"name",{value:t,configurable:!0}),"s$F");const Tu=Symbol("break visit"),X2=Symbol("skip children"),Gv=Symbol("remove item");function _n(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),kd(Object.freeze([]),e,t)}d(_n,"l$v");Uv(_n,"visit");_n.BREAK=Tu;_n.SKIP=X2;_n.REMOVE=Gv;_n.itemAtPath=(e,t)=>{let r=e;for(const[n,s]of t){const i=r?.[n];if(i&&"items"in i)r=i.items[s];else return}return r};_n.parentCollection=(e,t)=>{const r=_n.itemAtPath(e,t.slice(0,-1)),n=t[t.length-1][0],s=r?.[n];if(s&&"items"in s)return s;throw new Error("Parent collection not found")};function kd(e,t,r){let n=r(t,e);if(typeof n=="symbol")return n;for(const s of["key","value"]){const i=t[s];if(i&&"items"in i){for(let o=0;o<i.items.length;++o){const a=kd(Object.freeze(e.concat([[s,o]])),i.items[o],r);if(typeof a=="number")o=a-1;else{if(a===Tu)return Tu;a===Gv&&(i.items.splice(o,1),o-=1)}}typeof n=="function"&&s==="key"&&(n=n(t,e))}}return typeof n=="function"?n(t,e):n}d(kd,"y$r");Uv(kd,"_visit");var Q2=Object.defineProperty,Ac=d((e,t)=>Q2(e,"name",{value:t,configurable:!0}),"r$P");const Sd="\uFEFF",Dd="",Cd="",_a="";Ac(e=>!!e&&"items"in e,"isCollection");Ac(e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar"),"isScalar");function Z2(e){switch(e){case Sd:return"<BOM>";case Dd:return"<DOC>";case Cd:return"<FLOW_END>";case _a:return"<SCALAR>";default:return JSON.stringify(e)}}d(Z2,"i$J");Ac(Z2,"prettyToken");function qv(e){switch(e){case Sd:return"byte-order-mark";case Dd:return"doc-mode";case Cd:return"flow-error-end";case _a:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
923
923
|
`:case`\r
|
|
924
924
|
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}d(qv,"d$C");Ac(qv,"tokenType");var ej=Object.defineProperty,Ed=d((e,t)=>ej(e,"name",{value:t,configurable:!0}),"a$N");function Pt(e){switch(e){case void 0:case" ":case`
|
|
925
|
-
`:case"\r":case" ":return!0;default:return!1}}d(Pt,"n$
|
|
925
|
+
`:case"\r":case" ":return!0;default:return!1}}d(Pt,"n$L");Ed(Pt,"isEmpty");const Fh=new Set("0123456789ABCDEFabcdef"),tj=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),sa=new Set(",[]{}"),rj=new Set(` ,[]{}
|
|
926
926
|
\r `),jl=Ed(e=>!e||rj.has(e),"isNotAnchorChar");let nj=class{static{d(this,"k")}static{Ed(this,"Lexer")}constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,r=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let t=this.pos,r=this.buffer[t];for(;r===" "||r===" ";)r=this.buffer[++t];return!r||r==="#"||r===`
|
|
927
927
|
`?!0:r==="\r"?this.buffer[t+1]===`
|
|
928
928
|
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let r=this.buffer[t];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+t];if(r==="\r"){const s=this.buffer[n+t+1];if(s===`
|
|
@@ -940,28 +940,28 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
|
|
|
940
940
|
`,i=this.buffer[n+1]):r=n),i==="#"||t&&sa.has(i))break;if(s===`
|
|
941
941
|
`){const o=this.continueScalar(n+1);if(o===-1)break;n=Math.max(n,o-2)}}else{if(t&&sa.has(s))break;r=n}return!s&&!this.atEnd?this.setNext("plain-scalar"):(yield _a,yield*this.pushToIndex(r+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,r){const n=this.buffer.slice(this.pos,t);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(jl),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const r=this.flowLevel>0,n=this.charAt(1);if(Pt(n)||r&&sa.has(n)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,r=this.buffer[t];for(;!Pt(r)&&r!==">";)r=this.buffer[++t];return yield*this.pushToIndex(r===">"?t+1:t,!1)}else{let t=this.pos+1,r=this.buffer[t];for(;r;)if(tj.has(r))r=this.buffer[++t];else if(r==="%"&&Fh.has(this.buffer[t+1])&&Fh.has(this.buffer[t+2]))r=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
|
|
942
942
|
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
943
|
-
`?yield*this.pushCount(2):0}*pushSpaces(t){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||t&&n===" ");const s=r-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=r),s}*pushUntil(t){let r=this.pos,n=this.buffer[r];for(;!t(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};var sj=Object.defineProperty,ij=d((e,t)=>sj(e,"name",{value:t,configurable:!0}),"s$D");let oj=class{static{d(this,"a")}static{ij(this,"LineCounter")}constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let r=0,n=this.lineStarts.length;for(;r<n;){const i=r+n>>1;this.lineStarts[i]<t?r=i+1:n=i}if(this.lineStarts[r]===t)return{line:r+1,col:1};if(r===0)return{line:0,col:t};const s=this.lineStarts[r-1];return{line:r,col:t-s+1}}}};var aj=Object.defineProperty,dn=d((e,t)=>aj(e,"name",{value:t,configurable:!0}),"l$u");function Dr(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}d(Dr,"r$
|
|
943
|
+
`?yield*this.pushCount(2):0}*pushSpaces(t){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||t&&n===" ");const s=r-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=r),s}*pushUntil(t){let r=this.pos,n=this.buffer[r];for(;!t(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};var sj=Object.defineProperty,ij=d((e,t)=>sj(e,"name",{value:t,configurable:!0}),"s$D");let oj=class{static{d(this,"a")}static{ij(this,"LineCounter")}constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let r=0,n=this.lineStarts.length;for(;r<n;){const i=r+n>>1;this.lineStarts[i]<t?r=i+1:n=i}if(this.lineStarts[r]===t)return{line:r+1,col:1};if(r===0)return{line:0,col:t};const s=this.lineStarts[r-1];return{line:r,col:t-s+1}}}};var aj=Object.defineProperty,dn=d((e,t)=>aj(e,"name",{value:t,configurable:!0}),"l$u");function Dr(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}d(Dr,"r$O");dn(Dr,"includesToken");function Nu(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}d(Nu,"d$B");dn(Nu,"findNonEmptyIndex");function jd(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}d(jd,"k$q");dn(jd,"isFlowToken");function Ui(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}d(Ui,"u$y");dn(Ui,"getPrevProps");function Sn(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}d(Sn,"h$p");dn(Sn,"getFirstKeyStartProps");function yo(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let r=0;r<t.length;++r)e.push(t[r])}d(yo,"f$n");dn(yo,"arrayPushArray");function Iu(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Dr(t.start,"explicit-key-ind")&&!Dr(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,jd(t.value)?t.value.end?yo(t.value.end,t.sep):t.value.end=t.sep:yo(t.start,t.sep),delete t.sep)}d(Iu,"y$q");dn(Iu,"fixFlowSeqItems");let Hv=class{static{d(this,"g")}static{dn(this,"Parser")}constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new nj,this.onNewLine=t}*parse(t,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const n of this.lexer.lex(t,r))yield*this.next(n);r||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const r=qv(t);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const n=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const r=t??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{const n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&Iu(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{const s=n.items[n.items.length-1];if(s.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(s.sep)s.value=r;else{Object.assign(s,{key:r,sep:[]}),this.onKeyLine=!s.explicitKey;return}break}case"block-seq":{const s=n.items[n.items.length-1];s.value?n.items.push({start:[],value:r}):s.value=r;break}case"flow-collection":{const s=n.items[n.items.length-1];!s||s.value?n.items.push({start:[],key:r,sep:[]}):s.sep?s.value=r:Object.assign(s,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){const s=r.items[r.items.length-1];s&&!s.sep&&!s.value&&s.start.length>0&&Nu(s.start)===-1&&(r.indent===0||s.start.every(i=>i.type!=="comment"||i.indent<r.indent))&&(n.type==="document"?n.end=s.start:n.items.push({start:s.start}),r.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{Nu(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const r=Ui(this.peek(2)),n=Sn(r);let s;t.end?(s=t.end,s.push(this.sourceToken),delete t.end):s=[this.sourceToken];const i={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:n,key:t,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
|
|
944
944
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
945
945
|
`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const r=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){const n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)t.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,t.indent)){const n=t.items[t.items.length-2]?.value?.end;if(Array.isArray(n)){yo(n,r.start),n.push(this.sourceToken),t.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const n=!this.onKeyLine&&this.indent===t.indent,s=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind";let i=[];if(s&&r.sep&&!r.value){const o=[];for(let a=0;a<r.sep.length;++a){const c=r.sep[a];switch(c.type){case"newline":o.push(a);break;case"space":break;case"comment":c.indent>t.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=r.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||r.value?(i.push(this.sourceToken),t.items.push({start:i}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):s||r.value?(i.push(this.sourceToken),t.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Dr(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(jd(r.key)&&!Dr(r.sep,"newline")){const o=Sn(r.start),a=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:c}]})}else i.length>0?r.sep=r.sep.concat(i,this.sourceToken):r.sep.push(this.sourceToken);else if(Dr(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{const o=Sn(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||s?t.items.push({start:i,key:null,sep:[this.sourceToken]}):Dr(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);s||r.value?(t.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(o):(Object.assign(r,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!r.explicitKey&&r.sep&&!Dr(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&t.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const r=t.items[t.items.length-1];switch(this.type){case"newline":if(r.value){const n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,t.indent)){const n=t.items[t.items.length-2]?.value?.end;if(Array.isArray(n)){yo(n,r.start),n.push(this.sourceToken),t.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=t.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;r.value||Dr(r.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>t.indent){const n=this.startBlockValue(t);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const r=t.items[t.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?t.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?t.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const s=this.flowScalar(this.type);!r||r.value?t.items.push({start:[],key:s,sep:[]}):r.sep?this.stack.push(s):Object.assign(r,{key:s,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===t.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){const s=Ui(n),i=Sn(s);Iu(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let r=this.source.indexOf(`
|
|
946
946
|
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
947
|
-
`,r)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const r=Ui(t),n=Sn(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const r=Ui(t),n=Sn(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,r){return this.type!=="comment"||this.indent<=r?!1:t.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};var cj=Object.defineProperty,Ro=d((e,t)=>cj(e,"name",{value:t,configurable:!0}),"s$C");function Ad(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new oj||null,prettyErrors:t}}d(Ad,"a$L");Ro(Ad,"parseOptions");function lj(e,t={}){const{lineCounter:r,prettyErrors:n}=Ad(t),s=new Hv(r?.addNewLine),i=new Wv(t),o=Array.from(i.compose(s.parse(e)));if(n&&r)for(const a of o)a.errors.forEach(Ia(e,r)),a.warnings.forEach(Ia(e,r));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}d(lj,"L$l");Ro(lj,"parseAllDocuments");function zv(e,t={}){const{lineCounter:r,prettyErrors:n}=Ad(t),s=new Hv(r?.addNewLine),i=new Wv(t);let o=null;for(const a of i.compose(s.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new $s(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(Ia(e,r)),o.warnings.forEach(Ia(e,r))),o}d(zv,"d$A");Ro(zv,"parseDocument");function Is(e,t,r){let n;typeof t=="function"?n=t:r===void 0&&t&&typeof t=="object"&&(r=t);const s=zv(e,r);if(!s)return null;if(s.warnings.forEach(i=>zp(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:n},r))}d(Is,"C$h");Ro(Is,"parse");function Jv(e,t,r){let n=null;if(typeof t=="function"||Array.isArray(t)?n=t:r===void 0&&t&&(r=t),typeof r=="string"&&(r=r.length),typeof r=="number"){const s=Math.round(r);r=s<1?void 0:s>8?{indent:8}:{indent:s}}if(e===void 0){const{keepUndefined:s}=r??t??{};if(!s)return}return Js(e)&&!n?e.toString(r):new ld(e,n,r).toString(r)}d(Jv,"A$n");Ro(Jv,"stringify");var uj=Object.defineProperty,Kv=d((e,t)=>uj(e,"name",{value:t,configurable:!0}),"a$K"),pj=Object.defineProperty,Yv=Kv((e,t)=>pj(e,"name",{value:t,configurable:!0}),"o"),dj=Object.defineProperty,fj=Yv((e,t)=>dj(e,"name",{value:t,configurable:!0}),"r");async function To(e,t,r){const{buffer:n,compression:s,encoding:i="utf8",flag:o,...a}=r??{},c=await Pp(e,{buffer:n,compression:s,encoding:i,flag:o});return typeof t=="function"?Is(c,t,a):Is(c,a)}d(To,"n$J");Kv(To,"g");Yv(To,"l");fj(To,"readYaml");var hj=Object.defineProperty,Xv=d((e,t)=>hj(e,"name",{value:t,configurable:!0}),"n$I"),mj=Object.defineProperty,Qv=Xv((e,t)=>mj(e,"name",{value:t,configurable:!0}),"o"),gj=Object.defineProperty,yj=Qv((e,t)=>gj(e,"name",{value:t,configurable:!0}),"t");function Lt(e,t,r){const{buffer:n,compression:s,encoding:i="utf8",flag:o,...a}=r??{},c=H(e,{buffer:n,compression:s,encoding:i,flag:o});return typeof t=="function"?Is(c,t,a):Is(c,a)}d(Lt,"o$U");Xv(Lt,"g");Qv(Lt,"l");yj(Lt,"readYamlSync");var vj=Object.defineProperty,Zv=d((e,t)=>vj(e,"name",{value:t,configurable:!0}),"i$I"),bj=Object.defineProperty,eb=Zv((e,t)=>bj(e,"name",{value:t,configurable:!0}),"t"),$j=Object.defineProperty,wj=eb((e,t)=>$j(e,"name",{value:t,configurable:!0}),"a");function No(e,t,r,n){let s,i,o;typeof r=="object"&&r!==null&&!Array.isArray(r)&&typeof r!="function"?(s=r,i=s.replacer,o=s.space):typeof n=="object"?(s=n,i=r,o=s.space):(i=r,o=n);const a=Jv(t,i,o??s);qe(e,a,s)}d(No,"n$H");Zv(No,"b");eb(No,"c");wj(No,"writeYamlSync");var kj=Object.defineProperty,Ye=d((e,t)=>kj(e,"name",{value:t,configurable:!0}),"n$G"),Sj=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Dj=/[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Cj=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Al={Space_Separator:Sj,ID_Start:Dj,ID_Continue:Cj},Ge={isSpaceSeparator(e){return typeof e=="string"&&Al.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||Al.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e===""||e===""||Al.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}};let Lu,ht,Ar,Ma,rn,Gt,Qe,xd,so;var Ej=Ye(function(e,t){Lu=String(e),ht="start",Ar=[],Ma=0,rn=1,Gt=0,Qe=void 0,xd=void 0,so=void 0;do Qe=tb(),jj[ht]();while(Qe.type!=="eof");return typeof t=="function"?Wa({"":so},"",t):so},"parse");function Wa(e,t,r){const n=e[t];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let s=0;s<n.length;s++){const i=String(s),o=Wa(n,i,r);o===void 0?delete n[i]:Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(const s in n){const i=Wa(n,s,r);i===void 0?delete n[s]:Object.defineProperty(n,s,{value:i,writable:!0,enumerable:!0,configurable:!0})}return r.call(e,t,n)}d(Wa,"T$o");Ye(Wa,"internalize");let ae,re,Gi,Sr,pe;function tb(){for(ae="default",re="",Gi=!1,Sr=1;;){pe=ir();const e=rb[ae]();if(e)return e}}d(tb,"tu");Ye(tb,"lex");function ir(){if(Lu[Ma])return String.fromCodePoint(Lu.codePointAt(Ma))}d(ir,"S$n");Ye(ir,"peek");function B(){const e=ir();return e===`
|
|
947
|
+
`,r)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const r=Ui(t),n=Sn(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const r=Ui(t),n=Sn(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,r){return this.type!=="comment"||this.indent<=r?!1:t.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};var cj=Object.defineProperty,Ro=d((e,t)=>cj(e,"name",{value:t,configurable:!0}),"s$C");function Ad(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new oj||null,prettyErrors:t}}d(Ad,"a$L");Ro(Ad,"parseOptions");function lj(e,t={}){const{lineCounter:r,prettyErrors:n}=Ad(t),s=new Hv(r?.addNewLine),i=new Wv(t),o=Array.from(i.compose(s.parse(e)));if(n&&r)for(const a of o)a.errors.forEach(Ia(e,r)),a.warnings.forEach(Ia(e,r));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())}d(lj,"L$l");Ro(lj,"parseAllDocuments");function zv(e,t={}){const{lineCounter:r,prettyErrors:n}=Ad(t),s=new Hv(r?.addNewLine),i=new Wv(t);let o=null;for(const a of i.compose(s.parse(e),!0,e.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new $s(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(o.errors.forEach(Ia(e,r)),o.warnings.forEach(Ia(e,r))),o}d(zv,"d$A");Ro(zv,"parseDocument");function Is(e,t,r){let n;typeof t=="function"?n=t:r===void 0&&t&&typeof t=="object"&&(r=t);const s=zv(e,r);if(!s)return null;if(s.warnings.forEach(i=>zp(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:n},r))}d(Is,"C$i");Ro(Is,"parse");function Jv(e,t,r){let n=null;if(typeof t=="function"||Array.isArray(t)?n=t:r===void 0&&t&&(r=t),typeof r=="string"&&(r=r.length),typeof r=="number"){const s=Math.round(r);r=s<1?void 0:s>8?{indent:8}:{indent:s}}if(e===void 0){const{keepUndefined:s}=r??t??{};if(!s)return}return Js(e)&&!n?e.toString(r):new ld(e,n,r).toString(r)}d(Jv,"A$n");Ro(Jv,"stringify");var uj=Object.defineProperty,Kv=d((e,t)=>uj(e,"name",{value:t,configurable:!0}),"a$K"),pj=Object.defineProperty,Yv=Kv((e,t)=>pj(e,"name",{value:t,configurable:!0}),"o"),dj=Object.defineProperty,fj=Yv((e,t)=>dj(e,"name",{value:t,configurable:!0}),"r");async function To(e,t,r){const{buffer:n,compression:s,encoding:i="utf8",flag:o,...a}=r??{},c=await Pp(e,{buffer:n,compression:s,encoding:i,flag:o});return typeof t=="function"?Is(c,t,a):Is(c,a)}d(To,"n$K");Kv(To,"g");Yv(To,"l");fj(To,"readYaml");var hj=Object.defineProperty,Xv=d((e,t)=>hj(e,"name",{value:t,configurable:!0}),"n$J"),mj=Object.defineProperty,Qv=Xv((e,t)=>mj(e,"name",{value:t,configurable:!0}),"o"),gj=Object.defineProperty,yj=Qv((e,t)=>gj(e,"name",{value:t,configurable:!0}),"t");function Lt(e,t,r){const{buffer:n,compression:s,encoding:i="utf8",flag:o,...a}=r??{},c=H(e,{buffer:n,compression:s,encoding:i,flag:o});return typeof t=="function"?Is(c,t,a):Is(c,a)}d(Lt,"o$U");Xv(Lt,"g");Qv(Lt,"l");yj(Lt,"readYamlSync");var vj=Object.defineProperty,Zv=d((e,t)=>vj(e,"name",{value:t,configurable:!0}),"i$H"),bj=Object.defineProperty,eb=Zv((e,t)=>bj(e,"name",{value:t,configurable:!0}),"t"),$j=Object.defineProperty,wj=eb((e,t)=>$j(e,"name",{value:t,configurable:!0}),"a");function No(e,t,r,n){let s,i,o;typeof r=="object"&&r!==null&&!Array.isArray(r)&&typeof r!="function"?(s=r,i=s.replacer,o=s.space):typeof n=="object"?(s=n,i=r,o=s.space):(i=r,o=n);const a=Jv(t,i,o??s);qe(e,a,s)}d(No,"n$I");Zv(No,"b");eb(No,"c");wj(No,"writeYamlSync");var kj=Object.defineProperty,Ye=d((e,t)=>kj(e,"name",{value:t,configurable:!0}),"n$H"),Sj=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Dj=/[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,Cj=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,Al={Space_Separator:Sj,ID_Start:Dj,ID_Continue:Cj},Ge={isSpaceSeparator(e){return typeof e=="string"&&Al.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||Al.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e===""||e===""||Al.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}};let Lu,ht,Ar,Ma,rn,Gt,Qe,xd,so;var Ej=Ye(function(e,t){Lu=String(e),ht="start",Ar=[],Ma=0,rn=1,Gt=0,Qe=void 0,xd=void 0,so=void 0;do Qe=tb(),jj[ht]();while(Qe.type!=="eof");return typeof t=="function"?Wa({"":so},"",t):so},"parse");function Wa(e,t,r){const n=e[t];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let s=0;s<n.length;s++){const i=String(s),o=Wa(n,i,r);o===void 0?delete n[i]:Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(const s in n){const i=Wa(n,s,r);i===void 0?delete n[s]:Object.defineProperty(n,s,{value:i,writable:!0,enumerable:!0,configurable:!0})}return r.call(e,t,n)}d(Wa,"T$o");Ye(Wa,"internalize");let ae,re,Gi,Sr,pe;function tb(){for(ae="default",re="",Gi=!1,Sr=1;;){pe=ir();const e=rb[ae]();if(e)return e}}d(tb,"tu");Ye(tb,"lex");function ir(){if(Lu[Ma])return String.fromCodePoint(Lu.codePointAt(Ma))}d(ir,"S$n");Ye(ir,"peek");function B(){const e=ir();return e===`
|
|
948
948
|
`?(rn++,Gt=0):e?Gt+=e.length:Gt++,e&&(Ma+=e.length),e}d(B,"u$w");Ye(B,"read");const rb={default(){switch(pe){case" ":case"\v":case"\f":case" ":case" ":case"\uFEFF":case`
|
|
949
949
|
`:case"\r":case"\u2028":case"\u2029":B();return;case"/":B(),ae="comment";return;case void 0:return B(),Ee("eof")}if(Ge.isSpaceSeparator(pe)){B();return}return rb[ht]()},comment(){switch(pe){case"*":B(),ae="multiLineComment";return;case"/":B(),ae="singleLineComment";return}throw Be(B())},multiLineComment(){switch(pe){case"*":B(),ae="multiLineCommentAsterisk";return;case void 0:throw Be(B())}B()},multiLineCommentAsterisk(){switch(pe){case"*":B();return;case"/":B(),ae="default";return;case void 0:throw Be(B())}B(),ae="multiLineComment"},singleLineComment(){switch(pe){case`
|
|
950
950
|
`:case"\r":case"\u2028":case"\u2029":B(),ae="default";return;case void 0:return B(),Ee("eof")}B()},value(){switch(pe){case"{":case"[":return Ee("punctuator",B());case"n":return B(),Vr("ull"),Ee("null",null);case"t":return B(),Vr("rue"),Ee("boolean",!0);case"f":return B(),Vr("alse"),Ee("boolean",!1);case"-":case"+":B()==="-"&&(Sr=-1),ae="sign";return;case".":re=B(),ae="decimalPointLeading";return;case"0":re=B(),ae="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":re=B(),ae="decimalInteger";return;case"I":return B(),Vr("nfinity"),Ee("numeric",1/0);case"N":return B(),Vr("aN"),Ee("numeric",NaN);case'"':case"'":Gi=B()==='"',re="",ae="string";return}throw Be(B())},identifierNameStartEscape(){if(pe!=="u")throw Be(B());B();const e=Va();switch(e){case"$":case"_":break;default:if(!Ge.isIdStartChar(e))throw _u();break}re+=e,ae="identifierName"},identifierName(){switch(pe){case"$":case"_":case"":case"":re+=B();return;case"\\":B(),ae="identifierNameEscape";return}if(Ge.isIdContinueChar(pe)){re+=B();return}return Ee("identifier",re)},identifierNameEscape(){if(pe!=="u")throw Be(B());B();const e=Va();switch(e){case"$":case"_":case"":case"":break;default:if(!Ge.isIdContinueChar(e))throw _u();break}re+=e,ae="identifierName"},sign(){switch(pe){case".":re=B(),ae="decimalPointLeading";return;case"0":re=B(),ae="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":re=B(),ae="decimalInteger";return;case"I":return B(),Vr("nfinity"),Ee("numeric",Sr*(1/0));case"N":return B(),Vr("aN"),Ee("numeric",NaN)}throw Be(B())},zero(){switch(pe){case".":re+=B(),ae="decimalPoint";return;case"e":case"E":re+=B(),ae="decimalExponent";return;case"x":case"X":re+=B(),ae="hexadecimal";return}return Ee("numeric",Sr*0)},decimalInteger(){switch(pe){case".":re+=B(),ae="decimalPoint";return;case"e":case"E":re+=B(),ae="decimalExponent";return}if(Ge.isDigit(pe)){re+=B();return}return Ee("numeric",Sr*Number(re))},decimalPointLeading(){if(Ge.isDigit(pe)){re+=B(),ae="decimalFraction";return}throw Be(B())},decimalPoint(){switch(pe){case"e":case"E":re+=B(),ae="decimalExponent";return}if(Ge.isDigit(pe)){re+=B(),ae="decimalFraction";return}return Ee("numeric",Sr*Number(re))},decimalFraction(){switch(pe){case"e":case"E":re+=B(),ae="decimalExponent";return}if(Ge.isDigit(pe)){re+=B();return}return Ee("numeric",Sr*Number(re))},decimalExponent(){switch(pe){case"+":case"-":re+=B(),ae="decimalExponentSign";return}if(Ge.isDigit(pe)){re+=B(),ae="decimalExponentInteger";return}throw Be(B())},decimalExponentSign(){if(Ge.isDigit(pe)){re+=B(),ae="decimalExponentInteger";return}throw Be(B())},decimalExponentInteger(){if(Ge.isDigit(pe)){re+=B();return}return Ee("numeric",Sr*Number(re))},hexadecimal(){if(Ge.isHexDigit(pe)){re+=B(),ae="hexadecimalInteger";return}throw Be(B())},hexadecimalInteger(){if(Ge.isHexDigit(pe)){re+=B();return}return Ee("numeric",Sr*Number(re))},string(){switch(pe){case"\\":B(),re+=nb();return;case'"':if(Gi)return B(),Ee("string",re);re+=B();return;case"'":if(!Gi)return B(),Ee("string",re);re+=B();return;case`
|
|
951
|
-
`:case"\r":throw Be(B());case"\u2028":case"\u2029":ib(pe);break;case void 0:throw Be(B())}re+=B()},start(){switch(pe){case"{":case"[":return Ee("punctuator",B())}ae="value"},beforePropertyName(){switch(pe){case"$":case"_":re=B(),ae="identifierName";return;case"\\":B(),ae="identifierNameStartEscape";return;case"}":return Ee("punctuator",B());case'"':case"'":Gi=B()==='"',ae="string";return}if(Ge.isIdStartChar(pe)){re+=B(),ae="identifierName";return}throw Be(B())},afterPropertyName(){if(pe===":")return Ee("punctuator",B());throw Be(B())},beforePropertyValue(){ae="value"},afterPropertyValue(){switch(pe){case",":case"}":return Ee("punctuator",B())}throw Be(B())},beforeArrayValue(){if(pe==="]")return Ee("punctuator",B());ae="value"},afterArrayValue(){switch(pe){case",":case"]":return Ee("punctuator",B())}throw Be(B())},end(){throw Be(B())}};function Ee(e,t){return{type:e,value:t,line:rn,column:Gt}}d(Ee,"i$
|
|
951
|
+
`:case"\r":throw Be(B());case"\u2028":case"\u2029":ib(pe);break;case void 0:throw Be(B())}re+=B()},start(){switch(pe){case"{":case"[":return Ee("punctuator",B())}ae="value"},beforePropertyName(){switch(pe){case"$":case"_":re=B(),ae="identifierName";return;case"\\":B(),ae="identifierNameStartEscape";return;case"}":return Ee("punctuator",B());case'"':case"'":Gi=B()==='"',ae="string";return}if(Ge.isIdStartChar(pe)){re+=B(),ae="identifierName";return}throw Be(B())},afterPropertyName(){if(pe===":")return Ee("punctuator",B());throw Be(B())},beforePropertyValue(){ae="value"},afterPropertyValue(){switch(pe){case",":case"}":return Ee("punctuator",B())}throw Be(B())},beforeArrayValue(){if(pe==="]")return Ee("punctuator",B());ae="value"},afterArrayValue(){switch(pe){case",":case"]":return Ee("punctuator",B())}throw Be(B())},end(){throw Be(B())}};function Ee(e,t){return{type:e,value:t,line:rn,column:Gt}}d(Ee,"i$G");Ye(Ee,"newToken");function Vr(e){for(const t of e){if(ir()!==t)throw Be(B());B()}}d(Vr,"I$k");Ye(Vr,"literal");function nb(){switch(ir()){case"b":return B(),"\b";case"f":return B(),"\f";case"n":return B(),`
|
|
952
952
|
`;case"r":return B(),"\r";case"t":return B()," ";case"v":return B(),"\v";case"0":if(B(),Ge.isDigit(ir()))throw Be(B());return"\0";case"x":return B(),sb();case"u":return B(),Va();case`
|
|
953
953
|
`:case"\u2028":case"\u2029":return B(),"";case"\r":return B(),ir()===`
|
|
954
|
-
`&&B(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw Be(B());case void 0:throw Be(B())}return B()}d(nb,"Au");Ye(nb,"escape");function sb(){let e="",t=ir();if(!Ge.isHexDigit(t)||(e+=B(),t=ir(),!Ge.isHexDigit(t)))throw Be(B());return e+=B(),String.fromCodePoint(parseInt(e,16))}d(sb,"ru");Ye(sb,"hexEscape");function Va(){let e="",t=4;for(;t-- >0;){const r=ir();if(!Ge.isHexDigit(r))throw Be(B());e+=B()}return String.fromCodePoint(parseInt(e,16))}d(Va,"Z$8");Ye(Va,"unicodeEscape");const jj={start(){if(Qe.type==="eof")throw Ur();ka()},beforePropertyName(){switch(Qe.type){case"identifier":case"string":xd=Qe.value,ht="afterPropertyName";return;case"punctuator":qi();return;case"eof":throw Ur()}},afterPropertyName(){if(Qe.type==="eof")throw Ur();ht="beforePropertyValue"},beforePropertyValue(){if(Qe.type==="eof")throw Ur();ka()},beforeArrayValue(){if(Qe.type==="eof")throw Ur();if(Qe.type==="punctuator"&&Qe.value==="]"){qi();return}ka()},afterPropertyValue(){if(Qe.type==="eof")throw Ur();switch(Qe.value){case",":ht="beforePropertyName";return;case"}":qi()}},afterArrayValue(){if(Qe.type==="eof")throw Ur();switch(Qe.value){case",":ht="beforeArrayValue";return;case"]":qi()}},end(){}};function ka(){let e;switch(Qe.type){case"punctuator":switch(Qe.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=Qe.value;break}if(so===void 0)so=e;else{const t=Ar[Ar.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,xd,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")Ar.push(e),Array.isArray(e)?ht="beforeArrayValue":ht="beforePropertyName";else{const t=Ar[Ar.length-1];t==null?ht="end":Array.isArray(t)?ht="afterArrayValue":ht="afterPropertyValue"}}d(ka,"q$
|
|
954
|
+
`&&B(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw Be(B());case void 0:throw Be(B())}return B()}d(nb,"Au");Ye(nb,"escape");function sb(){let e="",t=ir();if(!Ge.isHexDigit(t)||(e+=B(),t=ir(),!Ge.isHexDigit(t)))throw Be(B());return e+=B(),String.fromCodePoint(parseInt(e,16))}d(sb,"ru");Ye(sb,"hexEscape");function Va(){let e="",t=4;for(;t-- >0;){const r=ir();if(!Ge.isHexDigit(r))throw Be(B());e+=B()}return String.fromCodePoint(parseInt(e,16))}d(Va,"Z$8");Ye(Va,"unicodeEscape");const jj={start(){if(Qe.type==="eof")throw Ur();ka()},beforePropertyName(){switch(Qe.type){case"identifier":case"string":xd=Qe.value,ht="afterPropertyName";return;case"punctuator":qi();return;case"eof":throw Ur()}},afterPropertyName(){if(Qe.type==="eof")throw Ur();ht="beforePropertyValue"},beforePropertyValue(){if(Qe.type==="eof")throw Ur();ka()},beforeArrayValue(){if(Qe.type==="eof")throw Ur();if(Qe.type==="punctuator"&&Qe.value==="]"){qi();return}ka()},afterPropertyValue(){if(Qe.type==="eof")throw Ur();switch(Qe.value){case",":ht="beforePropertyName";return;case"}":qi()}},afterArrayValue(){if(Qe.type==="eof")throw Ur();switch(Qe.value){case",":ht="beforeArrayValue";return;case"]":qi()}},end(){}};function ka(){let e;switch(Qe.type){case"punctuator":switch(Qe.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=Qe.value;break}if(so===void 0)so=e;else{const t=Ar[Ar.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,xd,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")Ar.push(e),Array.isArray(e)?ht="beforeArrayValue":ht="beforePropertyName";else{const t=Ar[Ar.length-1];t==null?ht="end":Array.isArray(t)?ht="afterArrayValue":ht="afterPropertyValue"}}d(ka,"q$g");Ye(ka,"push");function qi(){Ar.pop();const e=Ar[Ar.length-1];e==null?ht="end":Array.isArray(e)?ht="afterArrayValue":ht="afterPropertyValue"}d(qi,"_$m");Ye(qi,"pop");function Be(e){return xc(e===void 0?`JSON5: invalid end of input at ${rn}:${Gt}`:`JSON5: invalid character '${Od(e)}' at ${rn}:${Gt}`)}d(Be,"a$J");Ye(Be,"invalidChar");function Ur(){return xc(`JSON5: invalid end of input at ${rn}:${Gt}`)}d(Ur,"v$o");Ye(Ur,"invalidEOF");function _u(){return Gt-=5,xc(`JSON5: invalid identifier character at ${rn}:${Gt}`)}d(_u,"R$i");Ye(_u,"invalidIdentifier");function ib(e){console.warn(`JSON5: '${Od(e)}' in strings is not valid ECMAScript; consider escaping`)}d(ib,"nu");Ye(ib,"separatorChar");function Od(e){const t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){const r=e.charCodeAt(0).toString(16);return"\\x"+("00"+r).substring(r.length)}return e}d(Od,"G$b");Ye(Od,"formatChar");function xc(e){const t=new SyntaxError(e);return t.lineNumber=rn,t.columnNumber=Gt,t}d(xc,"J$g");Ye(xc,"syntaxError");var Aj=Ye(function(e,t,r){const n=[];let s="",i,o,a="",c;if(t!=null&&typeof t=="object"&&!Array.isArray(t)&&(r=t.space,c=t.quote,t=t.replacer),typeof t=="function")o=t;else if(Array.isArray(t)){i=[];for(const $ of t){let b;typeof $=="string"?b=$:(typeof $=="number"||$ instanceof String||$ instanceof Number)&&(b=String($)),b!==void 0&&i.indexOf(b)<0&&i.push(b)}}return r instanceof Number?r=Number(r):r instanceof String&&(r=String(r)),typeof r=="number"?r>0&&(r=Math.min(10,Math.floor(r)),a=" ".substr(0,r)):typeof r=="string"&&(a=r.substr(0,10)),l("",{"":e});function l($,b){let k=b[$];switch(k!=null&&(typeof k.toJSON5=="function"?k=k.toJSON5($):typeof k.toJSON=="function"&&(k=k.toJSON($))),o&&(k=o.call(b,$,k)),k instanceof Number?k=Number(k):k instanceof String?k=String(k):k instanceof Boolean&&(k=k.valueOf()),k){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof k=="string")return u(k);if(typeof k=="number")return String(k);if(typeof k=="object")return Array.isArray(k)?m(k):p(k)}function u($){const b={"'":.1,'"':.2},k={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let S="";for(let h=0;h<$.length;h++){const v=$[h];switch(v){case"'":case'"':b[v]++,S+=v;continue;case"\0":if(Ge.isDigit($[h+1])){S+="\\x00";continue}}if(k[v]){S+=k[v];continue}if(v<" "){let w=v.charCodeAt(0).toString(16);S+="\\x"+("00"+w).substring(w.length);continue}S+=v}const y=c||Object.keys(b).reduce((h,v)=>b[h]<b[v]?h:v);return S=S.replace(new RegExp(y,"g"),k[y]),y+S+y}function p($){if(n.indexOf($)>=0)throw TypeError("Converting circular structure to JSON5");n.push($);let b=s;s=s+a;let k=i||Object.keys($),S=[];for(const h of k){const v=l(h,$);if(v!==void 0){let w=f(h)+":";a!==""&&(w+=" "),w+=v,S.push(w)}}let y;if(S.length===0)y="{}";else{let h;if(a==="")h=S.join(","),y="{"+h+"}";else{let v=`,
|
|
955
955
|
`+s;h=S.join(v),y=`{
|
|
956
956
|
`+s+h+`,
|
|
957
957
|
`+b+"}"}}return n.pop(),s=b,y}function f($){if($.length===0)return u($);const b=String.fromCodePoint($.codePointAt(0));if(!Ge.isIdStartChar(b))return u($);for(let k=b.length;k<$.length;k++)if(!Ge.isIdContinueChar(String.fromCodePoint($.codePointAt(k))))return u($);return $}function m($){if(n.indexOf($)>=0)throw TypeError("Converting circular structure to JSON5");n.push($);let b=s;s=s+a;let k=[];for(let y=0;y<$.length;y++){const h=l(String(y),$);k.push(h!==void 0?h:"null")}let S;if(k.length===0)S="[]";else if(a==="")S="["+k.join(",")+"]";else{let y=`,
|
|
958
958
|
`+s,h=k.join(y);S=`[
|
|
959
959
|
`+s+h+`,
|
|
960
960
|
`+b+"]"}return n.pop(),s=b,S}},"stringify");const xj={parse:Ej,stringify:Aj};var ob=xj,xl,Bh;function ab(){return Bh||(Bh=1,xl=["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","ALGLIB-Documentation","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","Advanced-Cryptics-Dictionary","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","BOLA-1.1","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-Tso","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-Mark-Modifications","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","Buddy","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CAPEC-tou","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","ESA-PL-permissive-2.4","ESA-PL-strong-copyleft-2.4","ESA-PL-weak-copyleft-2.4","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-SMC","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","HPND-sell-variant-critical-systems","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ISO-permission","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-STK","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MMPL-1.0.1","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-TNT","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","OSC-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OSSP","OpenMDW-1.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","ParaType-Free-Font-1.3","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","SGMLUG-PM","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","TekHVC","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","UnRAR","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","Vixie-Cron","W3C","W3C-19980720","W3C-20150513","WTFNMFPL","WTFPL","Watcom-1.0","Widget-Workshop","WordNet","Wsuipa","X11","X11-distribute-modifications-variant","X11-no-permit-persons","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","hyphen-bulgarian","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"]),xl}d(ab,"requireSpdxLicenseIds");var Ol,Rh;function Oj(){return Rh||(Rh=1,Ol=["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"]),Ol}d(Oj,"requireDeprecated");var Pl,Th;function Pj(){return Th||(Th=1,Pl=["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"]),Pl}d(Pj,"requireSpdxExceptions");var Fl,Nh;function Fj(){if(Nh)return Fl;Nh=1;var e=Object.defineProperty,t=d((s,i)=>e(s,"name",{value:i,configurable:!0}),"n"),r=[].concat(ab()).concat(Oj()),n=Pj();return Fl=d(function(s){var i=0;function o(){return i<s.length}d(o,"o"),t(o,"hasMore");function a(y){if(y instanceof RegExp){var h=s.slice(i),v=h.match(y);if(v)return i+=v[0].length,v[0]}else if(s.indexOf(y,i)===i)return i+=y.length,y}d(a,"s"),t(a,"read");function c(){a(/[ ]*/)}d(c,"d"),t(c,"skipWhitespace");function l(){for(var y,h=["WITH","AND","OR","(",")",":","+"],v=0;v<h.length&&(y=a(h[v]),!y);v++);if(y==="+"&&i>1&&s[i-2]===" ")throw new Error("Space before `+`");return y&&{type:"OPERATOR",string:y}}d(l,"g"),t(l,"operator");function u(){return a(/[A-Za-z0-9-.]+/)}d(u,"c"),t(u,"idstring");function p(){var y=u();if(!y)throw new Error("Expected idstring at offset "+i);return y}d(p,"a"),t(p,"expectIdstring");function f(){if(a("DocumentRef-")){var y=p();return{type:"DOCUMENTREF",string:y}}}d(f,"E"),t(f,"documentRef");function m(){if(a("LicenseRef-")){var y=p();return{type:"LICENSEREF",string:y}}}d(m,"x"),t(m,"licenseRef");function $(){var y=i,h=u();if(r.indexOf(h)!==-1)return{type:"LICENSE",string:h};if(n.indexOf(h)!==-1)return{type:"EXCEPTION",string:h};i=y}d($,"v"),t($,"identifier");function b(){return l()||f()||m()||$()}d(b,"h"),t(b,"parseToken");for(var k=[];o()&&(c(),!!o());){var S=b();if(!S)throw new Error("Unexpected `"+s[i]+"` at offset "+i);k.push(S)}return k},"scan"),Fl}d(Fj,"requireScan");var Bl,Ih;function Bj(){if(Ih)return Bl;Ih=1;var e=Object.defineProperty,t=d((r,n)=>e(r,"name",{value:n,configurable:!0}),"n");return Bl=d(function(r){var n=0;function s(){return n<r.length}d(s,"u"),t(s,"hasMore");function i(){return s()?r[n]:null}d(i,"o"),t(i,"token");function o(){if(!s())throw new Error;n++}d(o,"a"),t(o,"next");function a(S){var y=i();if(y&&y.type==="OPERATOR"&&S===y.string)return o(),y.string}d(a,"f"),t(a,"parseOperator");function c(){if(a("WITH")){var S=i();if(S&&S.type==="EXCEPTION")return o(),S.string;throw new Error("Expected exception after `WITH`")}}d(c,"x"),t(c,"parseWith");function l(){var S=n,y="",h=i();if(h.type==="DOCUMENTREF"&&(o(),y+="DocumentRef-"+h.string+":",!a(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(h=i(),h.type==="LICENSEREF")return o(),y+="LicenseRef-"+h.string,{license:y};n=S}d(l,"h"),t(l,"parseLicenseRef");function u(){var S=i();if(S&&S.type==="LICENSE"){o();var y={license:S.string};a("+")&&(y.plus=!0);var h=c();return h&&(y.exception=h),y}}d(u,"g"),t(u,"parseLicense");function p(){var S=a("(");if(S){var y=b();if(!a(")"))throw new Error("Expected `)`");return y}}d(p,"l"),t(p,"parseParenthesizedExpression");function f(){return p()||l()||u()}d(f,"R"),t(f,"parseAtom");function m(S,y){return t(d(function h(){var v=y();if(v){if(!a(S))return v;var w=h();if(!w)throw new Error("Expected expression");return{left:v,conjunction:S.toLowerCase(),right:w}}},"t"),"parseBinaryOp")}d(m,"p"),t(m,"makeBinaryOpParser");var $=m("AND",f),b=m("OR",$),k=b();if(!k||s())throw new Error("Syntax error");return k},"parse$1"),Bl}d(Bj,"requireParse");var Rl,Lh;function cb(){if(Lh)return Rl;Lh=1;var e=Fj(),t=Bj();return Rl=d(function(r){return t(e(r))},"spdxExpressionParse"),Rl}d(cb,"requireSpdxExpressionParse");var Tl,_h;function Rj(){if(_h)return Tl;_h=1;var e=Object.defineProperty,t=d((h,v)=>e(h,"name",{value:v,configurable:!0}),"u"),r=cb(),n=ab();function s(h){try{return r(h),!0}catch{return!1}}d(s,"valid"),t(s,"valid");function i(h,v){var w=v[0].length-h[0].length;return w!==0?w:h[0].toUpperCase().localeCompare(v[0].toUpperCase())}d(i,"sortTranspositions"),t(i,"sortTranspositions");var o=[["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),a=0,c=1,l=[function(h){return h.toUpperCase()},function(h){return h.trim()},function(h){return h.replace(/\./g,"")},function(h){return h.replace(/\s+/g,"")},function(h){return h.replace(/\s+/g,"-")},function(h){return h.replace("v","-")},function(h){return h.replace(/,?\s*(\d)/,"-$1")},function(h){return h.replace(/,?\s*(\d)/,"-$1.0")},function(h){return h.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(h){return h.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(h){return h[0].toUpperCase()+h.slice(1)},function(h){return h.replace("/","-")},function(h){return h.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(h){return h.indexOf("3.0")!==-1?h+"-or-later":h+"-only"},function(h){return h+"only"},function(h){return h.replace(/(\d)$/,"-$1.0")},function(h){return h.replace(/(-| )?(\d)$/,"-$2-Clause")},function(h){return h.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(h){return h.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(h){return h.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(h){return h.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(h){return h.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(h){return h.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(h){return"CC-"+h},function(h){return"CC-"+h+"-4.0"},function(h){return h.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(h){return"CC-"+h.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],u=n.map(function(h){var v=/^(.*)-\d+\.\d+$/.exec(h);return v?[v[0],v[1]]:[h,null]}).reduce(function(h,v){var w=v[1];return h[w]=h[w]||[],h[w].push(v[0]),h},{}),p=Object.keys(u).map(t(function(h){return[h,u[h]]},"makeEntries")).filter(t(function(h){return h[1].length===1&&h[0]!==null&&h[0]!=="APL"},"identifySoleVersions")).map(t(function(h){return[h[0],h[1][0]]},"createLastResorts"));u=void 0;var f=[["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(p).sort(i),m=0,$=1,b=t(function(h){for(var v=0;v<l.length;v++){var w=l[v](h).trim();if(w!==h&&s(w))return w}return null},"validTransformation"),k=t(function(h){for(var v=h.toUpperCase(),w=0;w<f.length;w++){var g=f[w];if(v.indexOf(g[m])>-1)return g[$]}return null},"validLastResort"),S=t(function(h,v){for(var w=0;w<o.length;w++){var g=o[w],E=g[a];if(h.indexOf(E)>-1){var C=h.replace(E,g[c]),A=v(C);if(A!==null)return A}}return null},"anyCorrection");Tl=d(function(h,v){v=v||{};var w=v.upgrade===void 0?!0:!!v.upgrade;function g(O){return w?y(O):O}d(g,"L"),t(g,"postprocess");var E=typeof h=="string"&&h.trim().length!==0;if(!E)throw Error("Invalid argument. Expected non-empty string.");if(h=h.trim(),s(h))return g(h);var C=h.replace(/\+$/,"").trim();if(s(C))return g(C);var A=b(h);return A!==null||(A=S(h,function(O){return s(O)?O:b(O)}),A!==null)||(A=k(h),A!==null)||(A=S(h,k),A!==null)?g(A):null},"spdxCorrect");function y(h){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(h)!==-1?h+"-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(h)!==-1?h.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(h)!==-1?h+"-or-later":h}return d(y,"upgradeGPLs"),t(y,"upgradeGPLs"),Tl}d(Rj,"requireSpdxCorrect");var Nl,Mh;function Tj(){if(Mh)return Nl;Mh=1;var e=Object.defineProperty,t=d((c,l)=>e(c,"name",{value:l,configurable:!0}),"i"),r=cb(),n=Rj(),s='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',i=/^SEE LICEN[CS]E IN (.+)$/;function o(c,l){return l.slice(0,c.length)===c}d(o,"startsWith"),t(o,"startsWith");function a(c){if(c.hasOwnProperty("license")){var l=c.license;return o("LicenseRef",l)||o("DocumentRef",l)}else return a(c.left)||a(c.right)}return d(a,"usesLicenseRef"),t(a,"usesLicenseRef"),Nl=d(function(c){var l;try{l=r(c)}catch{var u;if(c==="UNLICENSED"||c==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(u=i.exec(c))return{validForOldPackages:!0,validForNewPackages:!0,inFile:u[1]};var p={validForOldPackages:!1,validForNewPackages:!1,warnings:[s]};if(c.trim().length!==0){var f=n(c);f&&p.warnings.push('license is similar to the valid expression "'+f+'"')}return p}return a(l)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[s]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}},"validateNpmPackageLicense"),Nl}d(Tj,"requireValidateNpmPackageLicense");var Ai={},Wh;function Nj(){if(Wh)return Ai;Wh=1;var e=Object.defineProperty,t=d((S,y)=>e(S,"name",{value:y,configurable:!0}),"f"),r=t((S,y)=>()=>(y||S((y={exports:{}}).exports,y),y.exports),"j"),n=r(S=>{Object.defineProperty(S,"__esModule",{value:!0}),S.tracing=S.metrics=void 0;var y={hasSubscribers:!1};S.metrics=y,S.tracing=y}),s=r(S=>{Object.defineProperty(S,"__esModule",{value:!0}),S.defaultPerf=void 0,S.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date});Object.defineProperty(Ai,"__esModule",{value:!0}),Ai.LRUCache=void 0;var i=n(),o=s(),a=t(()=>i.metrics.hasSubscribers||i.tracing.hasSubscribers,"x"),c=new Set,l=process||{},u=t((S,y,h,v)=>{typeof l.emitWarning=="function"?l.emitWarning(S,y,h,v):console.error(`[${h}] ${y}: ${S}`)},"V"),p=t(S=>!c.has(S),"B"),f=t(S=>!!S&&S===Math.floor(S)&&S>0&&isFinite(S),"T"),m=t(S=>f(S)?S<=Math.pow(2,8)?Uint8Array:S<=Math.pow(2,16)?Uint16Array:S<=Math.pow(2,32)?Uint32Array:S<=Number.MAX_SAFE_INTEGER?$:null:null,"H"),$=class extends Array{static{d(this,"W")}static{t(this,"W")}constructor(S){super(S),this.fill(0)}},b=class Hi{static{d(this,"E")}static{t(this,"c")}heap;length;static#e=!1;static create(y){let h=m(y);if(!h)return[];Hi.#e=!0;let v=new Hi(y,h);return Hi.#e=!1,v}constructor(y,h){if(!Hi.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new h(y),this.length=0}push(y){this.heap[this.length++]=y}pop(){return this.heap[--this.length]}},k=class lb{static{d(this,"M")}static{t(this,"c")}#e;#t;#r;#i;#n;#o;#x;#m;get perf(){return this.#m}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#l;#f;#u;#a;#s;#g;#v;#h;#p;#k;#d;#S;#D;#b;#$;#C;#I;#y;#F;static unsafeExposeInternals(y){return{starts:y.#D,ttls:y.#b,autopurgeTimers:y.#$,sizes:y.#S,keyMap:y.#u,keyList:y.#a,valList:y.#s,next:y.#g,prev:y.#v,get head(){return y.#h},get tail(){return y.#p},free:y.#k,isBackgroundFetch:t(h=>y.#c(h),"isBackgroundFetch"),backgroundFetch:t((h,v,w,g)=>y.#M(h,v,w,g),"backgroundFetch"),moveToTail:t(h=>y.#N(h),"moveToTail"),indexes:t(h=>y.#E(h),"indexes"),rindexes:t(h=>y.#j(h),"rindexes"),isStale:t(h=>y.#w(h),"isStale")}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#f}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#x}get dispose(){return this.#r}get onInsert(){return this.#i}get disposeAfter(){return this.#n}constructor(y){let{max:h=0,ttl:v,ttlResolution:w=1,ttlAutopurge:g,updateAgeOnGet:E,updateAgeOnHas:C,allowStale:A,dispose:O,onInsert:I,disposeAfter:V,noDisposeOnSet:fe,noUpdateTTL:Y,maxSize:U=0,maxEntrySize:M=0,sizeCalculation:X,fetchMethod:x,memoMethod:W,noDeleteOnFetchRejection:Z,noDeleteOnStaleGet:z,allowStaleOnFetchRejection:J,allowStaleOnFetchAbort:K,ignoreFetchAbort:ee,backgroundFetchSize:De=1,perf:ve}=y;if(this.backgroundFetchSize=De,ve!==void 0&&typeof ve?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#m=ve??o.defaultPerf,h!==0&&!f(h))throw new TypeError("max option must be a nonnegative integer");let R=h?m(h):Array;if(!R)throw new Error("invalid max value: "+h);if(this.#e=h,this.#t=U,this.maxEntrySize=M||this.#t,this.sizeCalculation=X,this.sizeCalculation){if(!this.#t&&!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(W!==void 0&&typeof W!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#x=W,x!==void 0&&typeof x!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=x,this.#I=!!x,this.#u=new Map,this.#a=Array.from({length:h}).fill(void 0),this.#s=Array.from({length:h}).fill(void 0),this.#g=new R(h),this.#v=new R(h),this.#h=0,this.#p=0,this.#k=b.create(h),this.#l=0,this.#f=0,typeof O=="function"&&(this.#r=O),typeof I=="function"&&(this.#i=I),typeof V=="function"?(this.#n=V,this.#d=[]):(this.#n=void 0,this.#d=void 0),this.#C=!!this.#r,this.#F=!!this.#i,this.#y=!!this.#n,this.noDisposeOnSet=!!fe,this.noUpdateTTL=!!Y,this.noDeleteOnFetchRejection=!!Z,this.allowStaleOnFetchRejection=!!J,this.allowStaleOnFetchAbort=!!K,this.ignoreFetchAbort=!!ee,this.maxEntrySize!==0){if(this.#t!==0&&!f(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!f(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#J()}if(this.allowStale=!!A,this.noDeleteOnStaleGet=!!z,this.updateAgeOnGet=!!E,this.updateAgeOnHas=!!C,this.ttlResolution=f(w)||w===0?w:1,this.ttlAutopurge=!!g,this.ttl=v||0,this.ttl){if(!f(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#W()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let F="LRU_CACHE_UNBOUNDED";p(F)&&(c.add(F),u("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",F,lb))}}getRemainingTTL(y){return this.#u.has(y)?1/0:0}#W(){let y=new $(this.#e),h=new $(this.#e);this.#b=y,this.#D=h;let v=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#$=v,this.#V=(C,A,O=this.#m.now())=>{h[C]=A!==0?O:0,y[C]=A,w(C,A)},this.#B=C=>{h[C]=y[C]!==0?this.#m.now():0,w(C,y[C])};let w=this.ttlAutopurge?(C,A)=>{if(v?.[C]&&(clearTimeout(v[C]),v[C]=void 0),A&&A!==0&&v){let O=setTimeout(()=>{this.#w(C)&&this.#A(this.#a[C],"expire")},A+1);O.unref&&O.unref(),v[C]=O}}:()=>{};this.#O=(C,A)=>{if(y[A]){let O=y[A],I=h[A];if(!O||!I)return;C.ttl=O,C.start=I,C.now=g||E();let V=C.now-I;C.remainingTTL=O-V}};let g=0,E=t(()=>{let C=this.#m.now();if(this.ttlResolution>0){g=C;let A=setTimeout(()=>g=0,this.ttlResolution);A.unref&&A.unref()}return C},"r");this.getRemainingTTL=C=>{let A=this.#u.get(C);if(A===void 0)return 0;let O=y[A],I=h[A];if(!O||!I)return 1/0;let V=(g||E())-I;return O-V},this.#w=C=>{let A=h[C],O=y[C];return!!O&&!!A&&(g||E())-A>O}}#B=t(()=>{},"#R");#O=t(()=>{},"#E");#V=t(()=>{},"#H");#w=t(()=>!1,"#p");#J(){let y=new $(this.#e);this.#f=0,this.#S=y,this.#R=h=>{this.#f-=y[h],y[h]=0},this.#U=(h,v,w,g)=>{if(!f(w)){if(this.#c(v))return this.backgroundFetchSize;if(g){if(typeof g!="function")throw new TypeError("sizeCalculation must be a function");if(w=g(v,h),!f(w))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 w},this.#L=(h,v,w)=>{if(y[h]=v,this.#t){let g=this.#t-y[h];for(;this.#f>g;)this.#_(!0)}this.#f+=y[h],w&&(w.entrySize=v,w.totalCalculatedSize=this.#f)}}#R=t(y=>{},"#x");#L=t((y,h,v)=>{},"#I");#U=t((y,h,v,w)=>{if(v||w)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#N");*#E({allowStale:y=this.allowStale}={}){if(this.#l)for(let h=this.#p;this.#G(h)&&((y||!this.#w(h))&&(yield h),h!==this.#h);)h=this.#v[h]}*#j({allowStale:y=this.allowStale}={}){if(this.#l)for(let h=this.#h;this.#G(h)&&((y||!this.#w(h))&&(yield h),h!==this.#p);)h=this.#g[h]}#G(y){return y!==void 0&&this.#u.get(this.#a[y])===y}*entries(){for(let y of this.#E())this.#s[y]!==void 0&&this.#a[y]!==void 0&&!this.#c(this.#s[y])&&(yield[this.#a[y],this.#s[y]])}*rentries(){for(let y of this.#j())this.#s[y]!==void 0&&this.#a[y]!==void 0&&!this.#c(this.#s[y])&&(yield[this.#a[y],this.#s[y]])}*keys(){for(let y of this.#E()){let h=this.#a[y];h!==void 0&&!this.#c(this.#s[y])&&(yield h)}}*rkeys(){for(let y of this.#j()){let h=this.#a[y];h!==void 0&&!this.#c(this.#s[y])&&(yield h)}}*values(){for(let y of this.#E())this.#s[y]!==void 0&&!this.#c(this.#s[y])&&(yield this.#s[y])}*rvalues(){for(let y of this.#j())this.#s[y]!==void 0&&!this.#c(this.#s[y])&&(yield this.#s[y])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(y,h={}){for(let v of this.#E()){let w=this.#s[v],g=this.#c(w)?w.__staleWhileFetching:w;if(g!==void 0&&y(g,this.#a[v],this))return this.#T(this.#a[v],h)}}forEach(y,h=this){for(let v of this.#E()){let w=this.#s[v],g=this.#c(w)?w.__staleWhileFetching:w;g!==void 0&&y.call(h,g,this.#a[v],this)}}rforEach(y,h=this){for(let v of this.#j()){let w=this.#s[v],g=this.#c(w)?w.__staleWhileFetching:w;g!==void 0&&y.call(h,g,this.#a[v],this)}}purgeStale(){let y=!1;for(let h of this.#j({allowStale:!0}))this.#w(h)&&(this.#A(this.#a[h],"expire"),y=!0);return y}info(y){let h=this.#u.get(y);if(h===void 0)return;let v=this.#s[h],w=this.#c(v)?v.__staleWhileFetching:v;if(w===void 0)return;let g={value:w};if(this.#b&&this.#D){let E=this.#b[h],C=this.#D[h];if(E&&C){let A=E-(this.#m.now()-C);g.ttl=A,g.start=Date.now()}}return this.#S&&(g.size=this.#S[h]),g}dump(){let y=[];for(let h of this.#E({allowStale:!0})){let v=this.#a[h],w=this.#s[h],g=this.#c(w)?w.__staleWhileFetching:w;if(g===void 0||v===void 0)continue;let E={value:g};if(this.#b&&this.#D){E.ttl=this.#b[h];let C=this.#m.now()-this.#D[h];E.start=Math.floor(Date.now()-C)}this.#S&&(E.size=this.#S[h]),y.unshift([v,E])}return y}load(y){this.clear();for(let[h,v]of y){if(v.start){let w=Date.now()-v.start;v.start=this.#m.now()-w}this.#P(h,v.value,v)}}set(y,h,v={}){let{status:w=i.metrics.hasSubscribers?{}:void 0}=v;v.status=w,w&&(w.op="set",w.key=y,h!==void 0&&(w.value=h),w.cache=this);let g=this.#P(y,h,v);return w&&i.metrics.hasSubscribers&&i.metrics.publish(w),g}#P(y,h,v,w){let{ttl:g=this.ttl,start:E,noDisposeOnSet:C=this.noDisposeOnSet,sizeCalculation:A=this.sizeCalculation,status:O}=v,I=this.#c(h);if(h===void 0)return O&&(O.set="deleted"),this.delete(y),this;let{noUpdateTTL:V=this.noUpdateTTL}=v;O&&!I&&(O.value=h);let fe=this.#U(y,h,v.size||0,A,O);if(this.maxEntrySize&&fe>this.maxEntrySize)return this.#A(y,"set"),O&&(O.set="miss",O.maxEntrySizeExceeded=!0),this;let Y=this.#l===0?void 0:this.#u.get(y);if(Y===void 0)Y=this.#l===0?this.#p:this.#k.length!==0?this.#k.pop():this.#l===this.#e?this.#_(!1):this.#l,this.#a[Y]=y,this.#s[Y]=h,this.#u.set(y,Y),this.#g[this.#p]=Y,this.#v[Y]=this.#p,this.#p=Y,this.#l++,this.#L(Y,fe,O),O&&(O.set="add"),V=!1,this.#F&&!I&&this.#i?.(h,y,"add");else{this.#N(Y);let U=this.#s[Y];if(h!==U){if(!C)if(this.#c(U)){U!==w&&U.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:M}=U;M!==void 0&&M!==h&&(this.#C&&this.#r?.(M,y,"set"),this.#y&&this.#d?.push([M,y,"set"]))}else this.#C&&this.#r?.(U,y,"set"),this.#y&&this.#d?.push([U,y,"set"]);if(this.#R(Y),this.#L(Y,fe,O),this.#s[Y]=h,!I){let M=U&&this.#c(U)?U.__staleWhileFetching:U,X=M===void 0?"add":h!==M?"replace":"update";O&&(O.set=X,M!==void 0&&(O.oldValue=M)),this.#F&&this.onInsert?.(h,y,X)}}else I||(O&&(O.set="update"),this.#F&&this.onInsert?.(h,y,"update"))}if(g!==0&&!this.#b&&this.#W(),this.#b&&(V||this.#V(Y,g,E),O&&this.#O(O,Y)),!C&&this.#y&&this.#d){let U=this.#d,M;for(;M=U?.shift();)this.#n?.(...M)}return this}pop(){try{for(;this.#l;){let y=this.#s[this.#h];if(this.#_(!0),this.#c(y)){if(y.__staleWhileFetching)return y.__staleWhileFetching}else if(y!==void 0)return y}}finally{if(this.#y&&this.#d){let y=this.#d,h;for(;h=y?.shift();)this.#n?.(...h)}}}#_(y){let h=this.#h,v=this.#a[h],w=this.#s[h],g=this.#c(w);g&&w.__abortController.abort(new Error("evicted"));let E=g?w.__staleWhileFetching:w;return(this.#C||this.#y)&&E!==void 0&&(this.#C&&this.#r?.(E,v,"evict"),this.#y&&this.#d?.push([E,v,"evict"])),this.#R(h),this.#$?.[h]&&(clearTimeout(this.#$[h]),this.#$[h]=void 0),y&&(this.#a[h]=void 0,this.#s[h]=void 0,this.#k.push(h)),this.#l===1?(this.#h=this.#p=0,this.#k.length=0):this.#h=this.#g[h],this.#u.delete(v),this.#l--,h}has(y,h={}){let{status:v=i.metrics.hasSubscribers?{}:void 0}=h;h.status=v,v&&(v.op="has",v.key=y,v.cache=this);let w=this.#K(y,h);return i.metrics.hasSubscribers&&i.metrics.publish(v),w}#K(y,h={}){let{updateAgeOnHas:v=this.updateAgeOnHas,status:w}=h,g=this.#u.get(y);if(g!==void 0){let E=this.#s[g];if(this.#c(E)&&E.__staleWhileFetching===void 0)return!1;if(this.#w(g))w&&(w.has="stale",this.#O(w,g));else return v&&this.#B(g),w&&(w.has="hit",this.#O(w,g)),!0}else w&&(w.has="miss");return!1}peek(y,h={}){let{status:v=a()?{}:void 0}=h;v&&(v.op="peek",v.key=y,v.cache=this),h.status=v;let w=this.#Y(y,h);return i.metrics.hasSubscribers&&i.metrics.publish(v),w}#Y(y,h){let{status:v,allowStale:w=this.allowStale}=h,g=this.#u.get(y);if(g===void 0||!w&&this.#w(g)){v&&(v.peek=g===void 0?"miss":"stale");return}let E=this.#s[g],C=this.#c(E)?E.__staleWhileFetching:E;return v&&(C!==void 0?(v.peek="hit",v.value=C):v.peek="miss"),C}#M(y,h,v,w){let g=h===void 0?void 0:this.#s[h];if(this.#c(g))return g;let E=new AbortController,{signal:C}=v;C?.addEventListener("abort",()=>E.abort(C.reason),{signal:E.signal});let A={signal:E.signal,options:v,context:w},O=t((M,X=!1)=>{let{aborted:x}=E.signal,W=v.ignoreFetchAbort&&M!==void 0,Z=v.ignoreFetchAbort||!!(v.allowStaleOnFetchAbort&&M!==void 0);if(v.status&&(x&&!X?(v.status.fetchAborted=!0,v.status.fetchError=E.signal.reason,W&&(v.status.fetchAbortIgnored=!0)):v.status.fetchResolved=!0),x&&!W&&!X)return V(E.signal.reason,Z);let z=Y,J=this.#s[h];return(J===Y||J===void 0&&W&&X)&&(M===void 0?z.__staleWhileFetching!==void 0?this.#s[h]=z.__staleWhileFetching:this.#A(y,"fetch"):(v.status&&(v.status.fetchUpdated=!0),this.#P(y,M,A.options,z))),M},"o"),I=t(M=>(v.status&&(v.status.fetchRejected=!0,v.status.fetchError=M),V(M,!1)),"d"),V=t((M,X)=>{let{aborted:x}=E.signal,W=x&&v.allowStaleOnFetchAbort,Z=W||v.allowStaleOnFetchRejection,z=Z||v.noDeleteOnFetchRejection,J=Y;if(this.#s[h]===Y&&(!z||!X&&J.__staleWhileFetching===void 0?this.#A(y,"fetch"):W||(this.#s[h]=J.__staleWhileFetching)),Z)return v.status&&J.__staleWhileFetching!==void 0&&(v.status.returnedStale=!0),J.__staleWhileFetching;if(J.__returned===J)throw M},"y"),fe=t((M,X)=>{let x=this.#o?.(y,g,A);E.signal.addEventListener("abort",()=>{(!v.ignoreFetchAbort||v.allowStaleOnFetchAbort)&&(M(void 0),v.allowStaleOnFetchAbort&&(M=t(W=>O(W,!0),"f")))}),x&&x instanceof Promise?x.then(W=>M(W===void 0?void 0:W),X):x!==void 0&&M(x)},"_");v.status&&(v.status.fetchDispatched=!0);let Y=new Promise(fe).then(O,I),U=Object.assign(Y,{__abortController:E,__staleWhileFetching:g,__returned:void 0});return h===void 0?(this.#P(y,U,{...A.options,status:void 0}),h=this.#u.get(y)):this.#s[h]=U,U}#c(y){if(!this.#I)return!1;let h=y;return!!h&&h instanceof Promise&&h.hasOwnProperty("__staleWhileFetching")&&h.__abortController instanceof AbortController}fetch(y,h={}){let v=i.tracing.hasSubscribers,{status:w=a()?{}:void 0}=h;h.status=w,w&&h.context&&(w.context=h.context);let g=this.#q(y,h);return w&&v&&(w.trace=!0,i.tracing.tracePromise(()=>g,w).catch(()=>{})),g}async#q(y,h={}){let{allowStale:v=this.allowStale,updateAgeOnGet:w=this.updateAgeOnGet,noDeleteOnStaleGet:g=this.noDeleteOnStaleGet,ttl:E=this.ttl,noDisposeOnSet:C=this.noDisposeOnSet,size:A=0,sizeCalculation:O=this.sizeCalculation,noUpdateTTL:I=this.noUpdateTTL,noDeleteOnFetchRejection:V=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:fe=this.allowStaleOnFetchRejection,ignoreFetchAbort:Y=this.ignoreFetchAbort,allowStaleOnFetchAbort:U=this.allowStaleOnFetchAbort,context:M,forceRefresh:X=!1,status:x,signal:W}=h;if(x&&(x.op="fetch",x.key=y,X&&(x.forceRefresh=!0),x.cache=this),!this.#I)return x&&(x.fetch="get"),this.#T(y,{allowStale:v,updateAgeOnGet:w,noDeleteOnStaleGet:g,status:x});let Z={allowStale:v,updateAgeOnGet:w,noDeleteOnStaleGet:g,ttl:E,noDisposeOnSet:C,size:A,sizeCalculation:O,noUpdateTTL:I,noDeleteOnFetchRejection:V,allowStaleOnFetchRejection:fe,allowStaleOnFetchAbort:U,ignoreFetchAbort:Y,status:x,signal:W},z=this.#u.get(y);if(z===void 0){x&&(x.fetch="miss");let J=this.#M(y,z,Z,M);return J.__returned=J}else{let J=this.#s[z];if(this.#c(J)){let ve=v&&J.__staleWhileFetching!==void 0;return x&&(x.fetch="inflight",ve&&(x.returnedStale=!0)),ve?J.__staleWhileFetching:J.__returned=J}let K=this.#w(z);if(!X&&!K)return x&&(x.fetch="hit"),this.#N(z),w&&this.#B(z),x&&this.#O(x,z),J;let ee=this.#M(y,z,Z,M),De=ee.__staleWhileFetching!==void 0&&v;return x&&(x.fetch=K?"stale":"refresh",De&&K&&(x.returnedStale=!0)),De?ee.__staleWhileFetching:ee.__returned=ee}}forceFetch(y,h={}){let v=i.tracing.hasSubscribers,{status:w=a()?{}:void 0}=h;h.status=w,w&&h.context&&(w.context=h.context);let g=this.#X(y,h);return w&&v&&(w.trace=!0,i.tracing.tracePromise(()=>g,w).catch(()=>{})),g}async#X(y,h={}){let v=await this.#q(y,h);if(v===void 0)throw new Error("fetch() returned undefined");return v}memo(y,h={}){let{status:v=i.metrics.hasSubscribers?{}:void 0}=h;h.status=v,v&&(v.op="memo",v.key=y,h.context&&(v.context=h.context),v.cache=this);let w=this.#Q(y,h);return v&&(v.value=w),i.metrics.hasSubscribers&&i.metrics.publish(v),w}#Q(y,h={}){let v=this.#x;if(!v)throw new Error("no memoMethod provided to constructor");let{context:w,status:g,forceRefresh:E,...C}=h;g&&E&&(g.forceRefresh=!0);let A=this.#T(y,C),O=E||A===void 0;if(g&&(g.memo=O?"miss":"hit",O||(g.value=A)),!O)return A;let I=v(y,A,{options:C,context:w});return g&&(g.value=I),this.#P(y,I,C),I}get(y,h={}){let{status:v=i.metrics.hasSubscribers?{}:void 0}=h;h.status=v,v&&(v.op="get",v.key=y,v.cache=this);let w=this.#T(y,h);return v&&(w!==void 0&&(v.value=w),i.metrics.hasSubscribers&&i.metrics.publish(v)),w}#T(y,h={}){let{allowStale:v=this.allowStale,updateAgeOnGet:w=this.updateAgeOnGet,noDeleteOnStaleGet:g=this.noDeleteOnStaleGet,status:E}=h,C=this.#u.get(y);if(C===void 0){E&&(E.get="miss");return}let A=this.#s[C],O=this.#c(A);return E&&this.#O(E,C),this.#w(C)?O?(E&&(E.get="stale-fetching"),v&&A.__staleWhileFetching!==void 0?(E&&(E.returnedStale=!0),A.__staleWhileFetching):void 0):(g||this.#A(y,"expire"),E&&(E.get="stale"),v?(E&&(E.returnedStale=!0),A):void 0):(E&&(E.get=O?"fetching":"hit"),this.#N(C),w&&this.#B(C),O?A.__staleWhileFetching:A)}#H(y,h){this.#v[h]=y,this.#g[y]=h}#N(y){y!==this.#p&&(y===this.#h?this.#h=this.#g[y]:this.#H(this.#v[y],this.#g[y]),this.#H(this.#p,y),this.#p=y)}delete(y){return this.#A(y,"delete")}#A(y,h){i.metrics.hasSubscribers&&i.metrics.publish({op:"delete",delete:h,key:y,cache:this});let v=!1;if(this.#l!==0){let w=this.#u.get(y);if(w!==void 0)if(this.#$?.[w]&&(clearTimeout(this.#$?.[w]),this.#$[w]=void 0),v=!0,this.#l===1)this.#z(h);else{this.#R(w);let g=this.#s[w];if(this.#c(g)?g.__abortController.abort(new Error("deleted")):(this.#C||this.#y)&&(this.#C&&this.#r?.(g,y,h),this.#y&&this.#d?.push([g,y,h])),this.#u.delete(y),this.#a[w]=void 0,this.#s[w]=void 0,w===this.#p)this.#p=this.#v[w];else if(w===this.#h)this.#h=this.#g[w];else{let E=this.#v[w];this.#g[E]=this.#g[w];let C=this.#g[w];this.#v[C]=this.#v[w]}this.#l--,this.#k.push(w)}}if(this.#y&&this.#d?.length){let w=this.#d,g;for(;g=w?.shift();)this.#n?.(...g)}return v}clear(){return this.#z("delete")}#z(y){for(let h of this.#j({allowStale:!0})){let v=this.#s[h];if(this.#c(v))v.__abortController.abort(new Error("deleted"));else{let w=this.#a[h];this.#C&&this.#r?.(v,w,y),this.#y&&this.#d?.push([v,w,y])}}if(this.#u.clear(),this.#s.fill(void 0),this.#a.fill(void 0),this.#b&&this.#D){this.#b.fill(0),this.#D.fill(0);for(let h of this.#$??[])h!==void 0&&clearTimeout(h);this.#$?.fill(void 0)}if(this.#S&&this.#S.fill(0),this.#h=0,this.#p=0,this.#k.length=0,this.#f=0,this.#l=0,this.#y&&this.#d){let h=this.#d,v;for(;v=h?.shift();)this.#n?.(...v)}}};return Ai.LRUCache=k,Ai}d(Nj,"requireIndex_min");var Il,Vh;function Ij(){if(Vh)return Il;Vh=1;var e=Object.defineProperty,t=d((a,c)=>e(a,"name",{value:c,configurable:!0}),"$");const r=t((...a)=>a.every(c=>c)?a.join(""):"","maybeJoin"),n=t(a=>a?encodeURIComponent(a):"","maybeEncode"),s=t(a=>a.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),"formatHashFragment"),i={sshtemplate:t(({domain:a,user:c,project:l,committish:u})=>`git@${a}:${c}/${l}.git${r("#",u)}`,"sshtemplate"),sshurltemplate:t(({domain:a,user:c,project:l,committish:u})=>`git+ssh://git@${a}/${c}/${l}.git${r("#",u)}`,"sshurltemplate"),edittemplate:t(({domain:a,user:c,project:l,committish:u,editpath:p,path:f})=>`https://${a}/${c}/${l}${r("/",p,"/",n(u||"HEAD"),"/",f)}`,"edittemplate"),browsetemplate:t(({domain:a,user:c,project:l,committish:u,treepath:p})=>`https://${a}/${c}/${l}${r("/",p,"/",n(u))}`,"browsetemplate"),browsetreetemplate:t(({domain:a,user:c,project:l,committish:u,treepath:p,path:f,fragment:m,hashformat:$})=>`https://${a}/${c}/${l}/${p}/${n(u||"HEAD")}/${f}${r("#",$(m||""))}`,"browsetreetemplate"),browseblobtemplate:t(({domain:a,user:c,project:l,committish:u,blobpath:p,path:f,fragment:m,hashformat:$})=>`https://${a}/${c}/${l}/${p}/${n(u||"HEAD")}/${f}${r("#",$(m||""))}`,"browseblobtemplate"),docstemplate:t(({domain:a,user:c,project:l,treepath:u,committish:p})=>`https://${a}/${c}/${l}${r("/",u,"/",n(p))}#readme`,"docstemplate"),httpstemplate:t(({auth:a,domain:c,user:l,project:u,committish:p})=>`git+https://${r(a,"@")}${c}/${l}/${u}.git${r("#",p)}`,"httpstemplate"),filetemplate:t(({domain:a,user:c,project:l,committish:u,path:p})=>`https://${a}/${c}/${l}/raw/${n(u||"HEAD")}/${p}`,"filetemplate"),shortcuttemplate:t(({type:a,user:c,project:l,committish:u})=>`${a}:${c}/${l}${r("#",u)}`,"shortcuttemplate"),pathtemplate:t(({user:a,project:c,committish:l})=>`${a}/${c}${r("#",l)}`,"pathtemplate"),bugstemplate:t(({domain:a,user:c,project:l})=>`https://${a}/${c}/${l}/issues`,"bugstemplate"),hashformat:s},o={};o.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:t(({auth:a,user:c,project:l,committish:u,path:p})=>`https://${r(a,"@")}raw.githubusercontent.com/${c}/${l}/${n(u||"HEAD")}/${p}`,"filetemplate"),gittemplate:t(({auth:a,domain:c,user:l,project:u,committish:p})=>`git://${r(a,"@")}${c}/${l}/${u}.git${r("#",p)}`,"gittemplate"),tarballtemplate:t(({domain:a,user:c,project:l,committish:u})=>`https://codeload.${a}/${c}/${l}/tar.gz/${n(u||"HEAD")}`,"tarballtemplate"),extract:t(a=>{let[,c,l,u,p]=a.pathname.split("/",5);if(!(u&&u!=="tree")&&(u||(p=a.hash.slice(1)),l&&l.endsWith(".git")&&(l=l.slice(0,-4)),!(!c||!l)))return{user:c,project:l,committish:p}},"extract")},o.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:t(({domain:a,user:c,project:l,committish:u,treepath:p,path:f,editpath:m})=>`https://${a}/${c}/${l}${r("/",p,"/",n(u||"HEAD"),"/",f,m)}`,"edittemplate"),tarballtemplate:t(({domain:a,user:c,project:l,committish:u})=>`https://${a}/${c}/${l}/get/${n(u||"HEAD")}.tar.gz`,"tarballtemplate"),extract:t(a=>{let[,c,l,u]=a.pathname.split("/",4);if(!["get"].includes(u)&&(l&&l.endsWith(".git")&&(l=l.slice(0,-4)),!(!c||!l)))return{user:c,project:l,committish:a.hash.slice(1)}},"extract")},o.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",tarballtemplate:t(({domain:a,user:c,project:l,committish:u})=>`https://${a}/api/v4/projects/${n(c+"/"+l)}/repository/archive.tar.gz?sha=${n(u||"HEAD")}`,"tarballtemplate"),extract:t(a=>{const c=a.pathname.slice(1);if(c.includes("/-/")||c.includes("/archive.tar.gz"))return;const l=c.split("/");let u=l.pop();u.endsWith(".git")&&(u=u.slice(0,-4));const p=l.join("/");if(!(!p||!u))return{user:p,project:u,committish:a.hash.slice(1)}},"extract")},o.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:t(({domain:a,project:c,committish:l})=>`git@${a}:${c}.git${r("#",l)}`,"sshtemplate"),sshurltemplate:t(({domain:a,project:c,committish:l})=>`git+ssh://git@${a}/${c}.git${r("#",l)}`,"sshurltemplate"),edittemplate:t(({domain:a,user:c,project:l,committish:u,editpath:p})=>`https://${a}/${c}/${l}${r("/",n(u))}/${p}`,"edittemplate"),browsetemplate:t(({domain:a,project:c,committish:l})=>`https://${a}/${c}${r("/",n(l))}`,"browsetemplate"),browsetreetemplate:t(({domain:a,project:c,committish:l,path:u,hashformat:p})=>`https://${a}/${c}${r("/",n(l))}${r("#",p(u))}`,"browsetreetemplate"),browseblobtemplate:t(({domain:a,project:c,committish:l,path:u,hashformat:p})=>`https://${a}/${c}${r("/",n(l))}${r("#",p(u))}`,"browseblobtemplate"),docstemplate:t(({domain:a,project:c,committish:l})=>`https://${a}/${c}${r("/",n(l))}`,"docstemplate"),httpstemplate:t(({domain:a,project:c,committish:l})=>`git+https://${a}/${c}.git${r("#",l)}`,"httpstemplate"),filetemplate:t(({user:a,project:c,committish:l,path:u})=>`https://gist.githubusercontent.com/${a}/${c}/raw${r("/",n(l))}/${u}`,"filetemplate"),shortcuttemplate:t(({type:a,project:c,committish:l})=>`${a}:${c}${r("#",l)}`,"shortcuttemplate"),pathtemplate:t(({project:a,committish:c})=>`${a}${r("#",c)}`,"pathtemplate"),bugstemplate:t(({domain:a,project:c})=>`https://${a}/${c}`,"bugstemplate"),gittemplate:t(({domain:a,project:c,committish:l})=>`git://${a}/${c}.git${r("#",l)}`,"gittemplate"),tarballtemplate:t(({project:a,committish:c})=>`https://codeload.github.com/gist/${a}/tar.gz/${n(c||"HEAD")}`,"tarballtemplate"),extract:t(a=>{let[,c,l,u]=a.pathname.split("/",4);if(u!=="raw"){if(!l){if(!c)return;l=c,c=null}return l.endsWith(".git")&&(l=l.slice(0,-4)),{user:c,project:l,committish:a.hash.slice(1)}}},"extract"),hashformat:t(function(a){return a&&"file-"+s(a)},"hashformat")},o.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:t(({domain:a,user:c,project:l,committish:u,path:p})=>`https://${a}/${c}/${l}/blob/${n(u)||"HEAD"}/${p}`,"filetemplate"),httpstemplate:t(({domain:a,user:c,project:l,committish:u})=>`https://${a}/${c}/${l}${r("#",u)}`,"httpstemplate"),tarballtemplate:t(({domain:a,user:c,project:l,committish:u})=>`https://${a}/${c}/${l}/archive/${n(u)||"HEAD"}.tar.gz`,"tarballtemplate"),bugstemplate:t(()=>null,"bugstemplate"),extract:t(a=>{let[,c,l,u]=a.pathname.split("/",4);if(!["archive"].includes(u)&&(l&&l.endsWith(".git")&&(l=l.slice(0,-4)),!(!c||!l)))return{user:c,project:l,committish:a.hash.slice(1)}},"extract")};for(const[a,c]of Object.entries(o))o[a]=Object.assign({},i,c);return Il=o,Il}d(Ij,"requireHosts");var Ll,Uh;function ub(){if(Uh)return Ll;Uh=1;var e=Object.defineProperty,t=d((o,a)=>e(o,"name",{value:a,configurable:!0}),"s");const r=t((o,a,c)=>{const l=o.indexOf(c);return o.lastIndexOf(a,l>-1?l:1/0)},"lastIndexOfBefore"),n=t(o=>{try{return new URL(o)}catch{}},"safeUrl"),s=t((o,a)=>{const c=o.indexOf(":"),l=o.slice(0,c+1);if(Object.prototype.hasOwnProperty.call(a,l)||o.substr(c,3)==="://")return o;const u=o.indexOf("@");return u>-1?u>c?`git+ssh://${o}`:o:`${o.slice(0,c+1)}//${o.slice(c+1)}`},"correctProtocol"),i=t(o=>{const a=r(o,"@","#"),c=r(o,":","#");return c>a&&(o=o.slice(0,c)+"/"+o.slice(c+1)),r(o,":","#")===-1&&o.indexOf("//")===-1&&(o=`git+ssh://${o}`),o},"correctUrl");return Ll=d((o,a)=>{const c=a?s(o,a):o;return n(c)||n(i(c))},"parseUrl"),Ll}d(ub,"requireParseUrl");var _l,Gh;function Lj(){if(Gh)return _l;Gh=1;var e=Object.defineProperty,t=d((s,i)=>e(s,"name",{value:i,configurable:!0}),"S");const r=ub(),n=t(s=>{const i=s.indexOf("#"),o=s.indexOf("/"),a=s.indexOf("/",o+1),c=s.indexOf(":"),l=/\s/.exec(s),u=s.indexOf("@"),p=!l||i>-1&&l.index>i,f=u===-1||i>-1&&u>i,m=c===-1||i>-1&&c>i,$=a===-1||i>-1&&a>i,b=o>0,k=i>-1?s[i-1]!=="/":!s.endsWith("/"),S=!s.startsWith(".");return p&&b&&k&&S&&f&&m&&$},"isGitHubShorthand");return _l=d((s,i,{gitHosts:o,protocols:a})=>{if(!s)return;const c=n(s)?`github:${s}`:s,l=r(c,a);if(!l)return;const u=o.byShortcut[l.protocol],p=o.byDomain[l.hostname.startsWith("www.")?l.hostname.slice(4):l.hostname],f=u||p;if(!f)return;const m=o[u||p];let $=null;a[l.protocol]?.auth&&(l.username||l.password)&&($=`${l.username}${l.password?":"+l.password:""}`);let b=null,k=null,S=null,y=null;try{if(u){let h=l.pathname.startsWith("/")?l.pathname.slice(1):l.pathname;const v=h.indexOf("@");v>-1&&(h=h.slice(v+1));const w=h.lastIndexOf("/");w>-1?(k=decodeURIComponent(h.slice(0,w)),k||(k=null),S=decodeURIComponent(h.slice(w+1))):S=decodeURIComponent(h),S.endsWith(".git")&&(S=S.slice(0,-4)),l.hash&&(b=decodeURIComponent(l.hash.slice(1))),y="shortcut"}else{if(!m.protocols.includes(l.protocol))return;const h=m.extract(l);if(!h)return;k=h.user&&decodeURIComponent(h.user),S=decodeURIComponent(h.project),b=decodeURIComponent(h.committish),y=a[l.protocol]?.name||l.protocol.slice(0,-1)}}catch(h){if(h instanceof URIError)return;throw h}return[f,k,$,S,b,y,i]},"fromUrl"),_l}d(Lj,"requireFromUrl");var Ml,qh;function _j(){if(qh)return Ml;qh=1;var e=Object.defineProperty,t=d((l,u)=>e(l,"name",{value:u,configurable:!0}),"o");const{LRUCache:r}=Nj(),n=Ij(),s=Lj(),i=ub(),o=new r({max:1e3});function a(l){try{const{protocol:u,hostname:p,pathname:f}=new URL(l);if(!p)return null;const m=/(?:git\+)http:$/.test(u)?"http:":"https:",$=f.replace(/\.git$/,"");return`${m}//${p}${$}`}catch{return null}}d(a,"unknownHostedUrl"),t(a,"unknownHostedUrl");class c{static{d(this,"GitHost")}static{t(this,"GitHost")}constructor(u,p,f,m,$,b,k={}){Object.assign(this,c.#e[u],{type:u,user:p,auth:f,project:m,committish:$,default:b,opts:k})}static#e={byShortcut:{},byDomain:{}};static#t={"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(u,p){c.#e[u]=p,c.#e.byDomain[p.domain]=u,c.#e.byShortcut[`${u}:`]=u,c.#t[`${u}:`]={name:u}}static fromUrl(u,p){if(typeof u!="string")return;const f=u+JSON.stringify(p||{});if(!o.has(f)){const m=s(u,p,{gitHosts:c.#e,protocols:c.#t});o.set(f,m?new c(...m):void 0)}return o.get(f)}static fromManifest(u,p={}){if(!u||typeof u!="object")return;const f=u.repository,m=f&&(typeof f=="string"?f:typeof f=="object"&&typeof f.url=="string"?f.url:null);if(!m)throw new Error("no repository");const $=m&&c.fromUrl(m.replace(/^git\+/,""),p)||null;if($)return $;const b=a(m);return c.fromUrl(b,p)||b}static parseUrl(u){return i(u)}#r(u,p){if(typeof u!="function")return null;const f={...this,...this.opts,...p};f.path||(f.path=""),f.path.startsWith("/")&&(f.path=f.path.slice(1)),f.noCommittish&&(f.committish=null);const m=u(f);return f.noGitPlus&&m.startsWith("git+")?m.slice(4):m}hash(){return this.committish?`#${this.committish}`:""}ssh(u){return this.#r(this.sshtemplate,u)}sshurl(u){return this.#r(this.sshurltemplate,u)}browse(u,...p){return typeof u!="string"?this.#r(this.browsetemplate,u):typeof p[0]!="string"?this.#r(this.browsetreetemplate,{...p[0],path:u}):this.#r(this.browsetreetemplate,{...p[1],fragment:p[0],path:u})}browseFile(u,...p){return typeof p[0]!="string"?this.#r(this.browseblobtemplate,{...p[0],path:u}):this.#r(this.browseblobtemplate,{...p[1],fragment:p[0],path:u})}docs(u){return this.#r(this.docstemplate,u)}bugs(u){return this.#r(this.bugstemplate,u)}https(u){return this.#r(this.httpstemplate,u)}git(u){return this.#r(this.gittemplate,u)}shortcut(u){return this.#r(this.shortcuttemplate,u)}path(u){return this.#r(this.pathtemplate,u)}tarball(u){return this.#r(this.tarballtemplate,{...u,noCommittish:!1})}file(u,p){return this.#r(this.filetemplate,{...p,path:u})}edit(u,p){return this.#r(this.edittemplate,{...p,path:u})}getDefaultRepresentation(){return this.default}toString(u){return this.default&&typeof this[this.default]=="function"?this[this.default](u):this.sshurl(u)}}for(const[l,u]of Object.entries(n))c.addHost(l,u);return Ml=c,Ml}d(_j,"requireLib");var Wl,Hh;function Mj(){if(Hh)return Wl;Hh=1;var e=Object.defineProperty,t=d((n,s)=>e(n,"name",{value:s,configurable:!0}),"r");Wl=r;function r(n){if(!n||n==="ERROR: No README data found!")return;n=n.trim().split(`
|
|
961
|
-
`);let s=0;for(;n[s]&&n[s].trim().match(/^(#|$)/);)s++;const i=n.length;let o=s+1;for(;o<i&&n[o].trim();)o++;return n.slice(s,o).join(" ").trim()}return d(r,"extractDescription"),t(r,"extractDescription"),Wl}d(Mj,"requireExtract_description");var pb={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"},db={web:"url",name:"url"},fb={server:"start",tests:"test"};const Wj={topLevel:pb,bugs:db,script:fb},Vj=Object.defineProperty({__proto__:null,bugs:db,default:Wj,script:fb,topLevel:pb},Symbol.toStringTag,{value:"Module"}),Uj=Tg(Vj);var Vl,zh;function Gj(){if(zh)return Vl;zh=1;var e=Object.defineProperty,t=d((g,E)=>e(g,"name",{value:E,configurable:!0}),"n"),{URL:r}=Hg,n=Zk(),s=eS(),i=Tj(),o=_j(),{isBuiltin:a}=Lg,c=["dependencies","devDependencies","optionalDependencies"],l=Mj(),u=Uj,p=t(g=>g.includes("@")&&g.indexOf("@")<g.lastIndexOf("."),"isEmail");Vl={warn:t(function(){},"warn"),fixRepositoryField:t(function(g){if(g.repositories&&(this.warn("repositories"),g.repository=g.repositories[0]),!g.repository)return this.warn("missingRepository");typeof g.repository=="string"&&(g.repository={type:"git",url:g.repository});var E=g.repository.url||"";if(E){var C=o.fromUrl(E);C&&(E=g.repository.url=C.getDefaultRepresentation()==="shortcut"?C.https():C.toString())}E.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",E)},"fixRepositoryField"),fixTypos:t(function(g){Object.keys(u.topLevel).forEach(function(E){Object.prototype.hasOwnProperty.call(g,E)&&this.warn("typo",E,u.topLevel[E])},this)},"fixTypos"),fixScriptsField:t(function(g){if(g.scripts){if(typeof g.scripts!="object"){this.warn("nonObjectScripts"),delete g.scripts;return}Object.keys(g.scripts).forEach(function(E){typeof g.scripts[E]!="string"?(this.warn("nonStringScript"),delete g.scripts[E]):u.script[E]&&!g.scripts[u.script[E]]&&this.warn("typo",E,u.script[E],"scripts")},this)}},"fixScriptsField"),fixFilesField:t(function(g){var E=g.files;E&&!Array.isArray(E)?(this.warn("nonArrayFiles"),delete g.files):g.files&&(g.files=g.files.filter(function(C){return!C||typeof C!="string"?(this.warn("invalidFilename",C),!1):!0},this))},"fixFilesField"),fixBinField:t(function(g){if(g.bin&&typeof g.bin=="string"){var E={},C;(C=g.name.match(/^@[^/]+[/](.*)$/))?E[C[1]]=g.bin:E[g.name]=g.bin,g.bin=E}},"fixBinField"),fixManField:t(function(g){g.man&&typeof g.man=="string"&&(g.man=[g.man])},"fixManField"),fixBundleDependenciesField:t(function(g){var E="bundledDependencies",C="bundleDependencies";g[E]&&!g[C]&&(g[C]=g[E],delete g[E]),g[C]&&!Array.isArray(g[C])?(this.warn("nonArrayBundleDependencies"),delete g[C]):g[C]&&(g[C]=g[C].filter(function(A){return!A||typeof A!="string"?(this.warn("nonStringBundleDependency",A),!1):(g.dependencies||(g.dependencies={}),Object.prototype.hasOwnProperty.call(g.dependencies,A)||(this.warn("nonDependencyBundleDependency",A),g.dependencies[A]="*"),!0)},this))},"fixBundleDependenciesField"),fixDependencies:t(function(g){v(g,this.warn),y(g),this.fixBundleDependenciesField(g),["dependencies","devDependencies"].forEach(function(E){if(E in g){if(!g[E]||typeof g[E]!="object"){this.warn("nonObjectDependencies",E),delete g[E];return}Object.keys(g[E]).forEach(function(C){var A=g[E][C];typeof A!="string"&&(this.warn("nonStringDependency",C,JSON.stringify(A)),delete g[E][C]);var O=o.fromUrl(g[E][C]);O&&(g[E][C]=O.toString())},this)}},this)},"fixDependencies"),fixModulesField:t(function(g){g.modules&&(this.warn("deprecatedModules"),delete g.modules)},"fixModulesField"),fixKeywordsField:t(function(g){typeof g.keywords=="string"&&(g.keywords=g.keywords.split(/,\s+/)),g.keywords&&!Array.isArray(g.keywords)?(delete g.keywords,this.warn("nonArrayKeywords")):g.keywords&&(g.keywords=g.keywords.filter(function(E){return typeof E!="string"||!E?(this.warn("nonStringKeyword"),!1):!0},this))},"fixKeywordsField"),fixVersionField:t(function(g,E){var C=!E;if(!g.version)return g.version="",!0;if(!n(g.version,C))throw new Error('Invalid version: "'+g.version+'"');return g.version=s(g.version,C),!0},"fixVersionField"),fixPeople:t(function(g){b(g,k),b(g,S)},"fixPeople"),fixNameField:t(function(g,E){typeof E=="boolean"?E={strict:E}:typeof E>"u"&&(E={});var C=E.strict;if(!g.name&&!C){g.name="";return}if(typeof g.name!="string")throw new Error("name field must be a string.");C||(g.name=g.name.trim()),$(g.name,C,E.allowLegacyCase),a(g.name)&&this.warn("conflictingName",g.name)},"fixNameField"),fixDescriptionField:t(function(g){g.description&&typeof g.description!="string"&&(this.warn("nonStringDescription"),delete g.description),g.readme&&!g.description&&(g.description=l(g.readme)),g.description===void 0&&delete g.description,g.description||this.warn("missingDescription")},"fixDescriptionField"),fixReadmeField:t(function(g){g.readme||(this.warn("missingReadme"),g.readme="ERROR: No README data found!")},"fixReadmeField"),fixBugsField:t(function(g){if(!g.bugs&&g.repository&&g.repository.url){var E=o.fromUrl(g.repository.url);E&&E.bugs()&&(g.bugs={url:E.bugs()})}else if(g.bugs){if(typeof g.bugs=="string")p(g.bugs)?g.bugs={email:g.bugs}:r.canParse(g.bugs)?g.bugs={url:g.bugs}:this.warn("nonEmailUrlBugsString");else{w(g.bugs,this.warn);var C=g.bugs;g.bugs={},C.url&&(r.canParse(C.url)?g.bugs.url=C.url:this.warn("nonUrlBugsUrlField")),C.email&&(typeof C.email=="string"&&p(C.email)?g.bugs.email=C.email:this.warn("nonEmailBugsEmailField"))}!g.bugs.email&&!g.bugs.url&&(delete g.bugs,this.warn("emptyNormalizedBugs"))}},"fixBugsField"),fixHomepageField:t(function(g){if(!g.homepage&&g.repository&&g.repository.url){var E=o.fromUrl(g.repository.url);E&&E.docs()&&(g.homepage=E.docs())}if(g.homepage){if(typeof g.homepage!="string")return this.warn("nonUrlHomepage"),delete g.homepage;r.canParse(g.homepage)||(g.homepage="http://"+g.homepage)}},"fixHomepageField"),fixLicenseField:t(function(g){const E=g.license||g.licence;if(!E)return this.warn("missingLicense");if(typeof E!="string"||E.length<1||E.trim()==="")return this.warn("invalidLicense");if(!i(E).validForNewPackages)return this.warn("invalidLicense")},"fixLicenseField")};function f(g){if(g.charAt(0)!=="@")return!1;var E=g.slice(1).split("/");return E.length!==2?!1:E[0]&&E[1]&&E[0]===encodeURIComponent(E[0])&&E[1]===encodeURIComponent(E[1])}d(f,"isValidScopedPackageName"),t(f,"isValidScopedPackageName");function m(g){return!g.match(/[/@\s+%:]/)&&g===encodeURIComponent(g)}d(m,"isCorrectlyEncodedName"),t(m,"isCorrectlyEncodedName");function $(g,E,C){if(g.charAt(0)==="."||!(f(g)||m(g))||E&&!C&&g!==g.toLowerCase()||g.toLowerCase()==="node_modules"||g.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(g))}d($,"ensureValidName"),t($,"ensureValidName");function b(g,E){return g.author&&(g.author=E(g.author)),["maintainers","contributors"].forEach(function(C){Array.isArray(g[C])&&(g[C]=g[C].map(E))}),g}d(b,"modifyPeople"),t(b,"modifyPeople");function k(g){if(typeof g=="string")return g;var E=g.name||"",C=g.url||g.web,A=C?" ("+C+")":"",O=g.email||g.mail,I=O?" <"+O+">":"";return E+I+A}d(k,"unParsePerson"),t(k,"unParsePerson");function S(g){if(typeof g!="string")return g;var E=g.match(/^([^(<]+)/),C=g.match(/\(([^()]+)\)/),A=g.match(/<([^<>]+)>/),O={};return E&&E[0].trim()&&(O.name=E[0].trim()),A&&(O.email=A[1]),C&&(O.url=C[1]),O}d(S,"parsePerson"),t(S,"parsePerson");function y(g){var E=g.optionalDependencies;if(E){var C=g.dependencies||{};Object.keys(E).forEach(function(A){C[A]=E[A]}),g.dependencies=C}}d(y,"addOptionalDepsToDeps"),t(y,"addOptionalDepsToDeps");function h(g,E,C){if(!g)return{};if(typeof g=="string"&&(g=g.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(g))return g;C("deprecatedArrayDependencies",E);var A={};return g.filter(function(O){return typeof O=="string"}).forEach(function(O){O=O.trim().split(/(:?[@\s><=])/);var I=O.shift(),V=O.join("");V=V.trim(),V=V.replace(/^@/,""),A[I]=V}),A}d(h,"depObjectify"),t(h,"depObjectify");function v(g,E){c.forEach(function(C){g[C]&&(g[C]=h(g[C],C,E))})}d(v,"objectifyDeps"),t(v,"objectifyDeps");function w(g,E){g&&Object.keys(g).forEach(function(C){u.bugs[C]&&(E("typo",C,u.bugs[C],"bugs"),g[u.bugs[C]]=g[C],delete g[C])})}return d(w,"bugsTypos"),t(w,"bugsTypos"),Vl}d(Gj,"requireFixer");var hb="'repositories' (plural) Not supported. Please pick one as the 'repository' field",mb="No repository field.",gb="Probably broken git url: %s",yb="scripts must be an object",vb="script values must be string commands",bb="Invalid 'files' member",$b="Invalid filename in 'files' list: %s",wb="Invalid 'bundleDependencies' list. Must be array of package names",kb="Invalid bundleDependencies member: %s",Sb="Non-dependency in bundleDependencies: %s",Db="%s field must be an object",Cb="Invalid dependency: %s %s",Eb="specifying %s as array is deprecated",jb="modules field is deprecated",Ab="keywords should be an array of strings",xb="keywords should be an array of strings",Ob="%s is also the name of a node core module.",Pb="'description' field should be a string",Fb="No description",Bb="No README data",Rb="No license field.",Tb="Bug string field must be url, email, or {email,url}",Nb="bugs.url field must be a string url. Deleted.",Ib="bugs.email field must be a string email. Deleted.",Lb="Normalized value of bugs field is an empty object. Deleted.",_b="homepage field must be a string url. Deleted.",Mb="license should be a valid SPDX license expression",Wb="%s should probably be %s.";const qj={repositories:hb,missingRepository:mb,brokenGitUrl:gb,nonObjectScripts:yb,nonStringScript:vb,nonArrayFiles:bb,invalidFilename:$b,nonArrayBundleDependencies:wb,nonStringBundleDependency:kb,nonDependencyBundleDependency:Sb,nonObjectDependencies:Db,nonStringDependency:Cb,deprecatedArrayDependencies:Eb,deprecatedModules:jb,nonArrayKeywords:Ab,nonStringKeyword:xb,conflictingName:Ob,nonStringDescription:Pb,missingDescription:Fb,missingReadme:Bb,missingLicense:Rb,nonEmailUrlBugsString:Tb,nonUrlBugsUrlField:Nb,nonEmailBugsEmailField:Ib,emptyNormalizedBugs:Lb,nonUrlHomepage:_b,invalidLicense:Mb,typo:Wb},Hj=Object.defineProperty({__proto__:null,brokenGitUrl:gb,conflictingName:Ob,default:qj,deprecatedArrayDependencies:Eb,deprecatedModules:jb,emptyNormalizedBugs:Lb,invalidFilename:$b,invalidLicense:Mb,missingDescription:Fb,missingLicense:Rb,missingReadme:Bb,missingRepository:mb,nonArrayBundleDependencies:wb,nonArrayFiles:bb,nonArrayKeywords:Ab,nonDependencyBundleDependency:Sb,nonEmailBugsEmailField:Ib,nonEmailUrlBugsString:Tb,nonObjectDependencies:Db,nonObjectScripts:yb,nonStringBundleDependency:kb,nonStringDependency:Cb,nonStringDescription:Pb,nonStringKeyword:xb,nonStringScript:vb,nonUrlBugsUrlField:Nb,nonUrlHomepage:_b,repositories:hb,typo:Wb},Symbol.toStringTag,{value:"Module"}),zj=Tg(Hj);var Ul,Jh;function Jj(){if(Jh)return Ul;Jh=1;var e=Object.defineProperty,t=d((i,o)=>e(i,"name",{value:o,configurable:!0}),"s"),r=tS,n=zj;Ul=d(function(){var i=Array.prototype.slice.call(arguments,0),o=i.shift();if(o==="typo")return s.apply(null,i);var a=n[o]?n[o]:o+": '%s'";return i.unshift(a),r.format.apply(null,i)},"make_warning");function s(i,o,a){return a&&(i=a+"['"+i+"']",o=a+"['"+o+"']"),r.format(n.typo,i,o)}return d(s,"makeTypoWarning"),t(s,"makeTypoWarning"),Ul}d(Jj,"requireMake_warning");var Gl,Kh;function Kj(){if(Kh)return Gl;Kh=1;var e=Object.defineProperty,t=d((l,u)=>e(l,"name",{value:u,configurable:!0}),"n");Gl=a;var r=Gj();a.fixer=r;var n=Jj(),s=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],i=["dependencies","people","typos"],o=s.map(function(l){return c(l)+"Field"});o=o.concat(i);function a(l,u,p){u===!0&&(u=null,p=!0),p||(p=!1),(!u||l.private)&&(u=t(function(){},"warn")),l.scripts&&l.scripts.install==="node-gyp rebuild"&&!l.scripts.preinstall&&(l.gypfile=!0),r.warn=function(){u(n.apply(null,arguments))},o.forEach(function(f){r["fix"+c(f)](l,p)}),l._id=l.name+"@"+l.version}d(a,"normalize"),t(a,"normalize");function c(l){return l.charAt(0).toUpperCase()+l.slice(1)}return d(c,"ucFirst"),t(c,"ucFirst"),Gl}d(Kj,"requireNormalize");var Yj=Kj();const Xj=Ng(Yj);var Qj=Object.defineProperty,Zj=d((e,t)=>Qj(e,"name",{value:t,configurable:!0}),"d$w"),eA=Object.defineProperty,tA=Zj((e,t)=>eA(e,"name",{value:t,configurable:!0}),"f"),rA=Object.defineProperty,Zs=tA((e,t)=>rA(e,"name",{value:t,configurable:!0}),"c");const Vb=Zs((e,t,r)=>{const n=Je(e),s=Je(t),i=s===n?".":zn(n,s);return r.some(o=>{const a=o.startsWith("./")?o.slice(2):o,c=i.startsWith("./")?i.slice(2):i;if(a==="."&&c===".")return!0;if(a.endsWith("/**")){const l=a.slice(0,-3);return c===l||c.startsWith(`${l}/`)}if(a.endsWith("/*")){const l=a.slice(0,-2);return l===""?c!=="."&&!c.includes("/"):c.startsWith(`${l}/`)||c===l}return c===a||c.startsWith(`${a}/`)})},"isPackageInWorkspace"),Ub=Zs(async e=>{const t=await Do("pnpm-workspace.yaml",{cwd:Je(e),type:"file"});if(!t)return;const r=await To(t),n=Array.isArray(r.packages)?r.packages:[];if(!Vb(t,e,n))return;const s={};return r.catalog&&typeof r.catalog=="object"&&(s.catalog=r.catalog),r.catalogs&&typeof r.catalogs=="object"&&(s.catalogs=r.catalogs),Object.keys(s).length>0?s:void 0},"readPnpmCatalogs"),Gb=Zs(e=>{const t=Co("pnpm-workspace.yaml",{cwd:Je(e),type:"file"});if(!t)return;const r=Lt(t),n=Array.isArray(r.packages)?r.packages:[];if(!Vb(t,e,n))return;const s={};return r.catalog&&typeof r.catalog=="object"&&(s.catalog=r.catalog),r.catalogs&&typeof r.catalogs=="object"&&(s.catalogs=r.catalogs),Object.keys(s).length>0?s:void 0},"readPnpmCatalogsSync"),nA=Zs((e,t,r)=>{if(t==="catalog:")return r.catalog?.[e];if(t.startsWith("catalog:")){const n=t.slice(8);return r.catalogs?.[n]?.[e]}},"resolveCatalogReference"),sA=Zs((e,t)=>{for(const[r,n]of Object.entries(e)){if(typeof n!="string")continue;const s=nA(r,n,t);s&&(e[r]=s)}},"resolveDependenciesCatalogReferences"),Oc=Zs((e,t)=>{const r=["dependencies","devDependencies","peerDependencies","optionalDependencies"];for(const n of r){if(!e[n]||typeof e[n]!="object")continue;const s=e[n];sA(s,t)}},"resolveCatalogReferences");var iA=Object.defineProperty,ct=d((e,t)=>iA(e,"name",{value:t,configurable:!0}),"l$t"),oA=Object.defineProperty,Xe=ct((e,t)=>oA(e,"name",{value:t,configurable:!0}),"f");const aA=mt(import.meta.url),xi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Pd=Xe(e=>{if(typeof xi<"u"&&xi.versions&&xi.versions.node){const[t,r]=xi.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return xi.getBuiltinModule(e)}return aA(e)},"__cjs_getBuiltinModule"),{existsSync:qb}=Pd("node:fs"),{createInterface:cA}=Pd("node:readline"),{styleText:Ot}=Pd("node:util");var lA=Object.defineProperty,nt=Xe((e,t)=>lA(e,"name",{value:t,configurable:!0}),"f");const pr=nt(e=>{const t=typeof e;return e!==null&&(t==="object"||t==="function")},"isObject"),uA=nt(e=>{if(!pr(e))return!1;for(const t in e)if(Object.hasOwn(e,t))return!1;return!0},"isEmptyObject"),Hb=new Set(["__proto__","prototype","constructor"]),zb=1e6,pA=nt(e=>e>="0"&&e<="9","isDigit");function Qn(e){if(e==="0")return!0;if(/^[1-9]\d*$/.test(e)){const t=Number.parseInt(e,10);return t<=Number.MAX_SAFE_INTEGER&&t<=zb}return!1}d(Qn,"w$n");ct(Qn,"b");Xe(Qn,"p$1");nt(Qn,"shouldCoerceToNumber");function Es(e,t){return Hb.has(e)?!1:(e&&Qn(e)?t.push(Number.parseInt(e,10)):t.push(e),!0)}d(Es,"P$j");ct(Es,"P");Xe(Es,"y");nt(Es,"processSegment");function Pc(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);const t=[];let r="",n="start",s=!1,i=0;for(const o of e){if(i++,s){r+=o,s=!1;continue}if(o==="\\"){if(n==="index")throw new Error(`Invalid character '${o}' in an index at position ${i}`);if(n==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${i}`);s=!0,n=n==="start"?"property":n;continue}switch(o){case".":{if(n==="index")throw new Error(`Invalid character '${o}' in an index at position ${i}`);if(n==="indexEnd"){n="property";break}if(!Es(r,t))return[];r="",n="property";break}case"[":{if(n==="index")throw new Error(`Invalid character '${o}' in an index at position ${i}`);if(n==="indexEnd"){n="index";break}if(n==="property"||n==="start"){if((r||n==="property")&&!Es(r,t))return[];r=""}n="index";break}case"]":{if(n==="index"){if(r==="")r=(t.pop()||"")+"[]",n="property";else{const a=Number.parseInt(r,10);!Number.isNaN(a)&&Number.isFinite(a)&&a>=0&&a<=Number.MAX_SAFE_INTEGER&&a<=zb&&r===String(a)?t.push(a):t.push(r),r="",n="indexEnd"}break}if(n==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${i}`);r+=o;break}default:{if(n==="index"&&!pA(o))throw new Error(`Invalid character '${o}' in an index at position ${i}`);if(n==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${i}`);n==="start"&&(n="property"),r+=o}}}switch(s&&(r+="\\"),n){case"property":{if(!Es(r,t))return[];break}case"index":throw new Error("Index was not closed");case"start":{t.push("");break}}return t}d(Pc,"N$g");ct(Pc,"B");Xe(Pc,"parsePath");nt(Pc,"parsePath");function Zn(e){if(typeof e=="string")return Pc(e);if(Array.isArray(e)){const t=[];for(const[r,n]of e.entries()){if(typeof n!="string"&&typeof n!="number")throw new TypeError(`Expected a string or number for path segment at index ${r}, got ${typeof n}`);if(typeof n=="number"&&!Number.isFinite(n))throw new TypeError(`Path segment at index ${r} must be a finite number, got ${n}`);if(Hb.has(n))return[];typeof n=="string"&&Qn(n)?t.push(Number.parseInt(n,10)):t.push(n)}return t}return[]}d(Zn,"b$g");ct(Zn,"k");Xe(Zn,"d");nt(Zn,"normalizePath");function or(e,t,r){if(!pr(e)||typeof t!="string"&&!Array.isArray(t))return r===void 0?e:r;const n=Zn(t);if(n.length===0)return r;for(let s=0;s<n.length;s++){const i=n[s];if(e=e[i],e==null){if(s!==n.length-1)return r;break}}return e===void 0?r:e}d(or,"d$v");ct(or,"h");Xe(or,"getProperty");nt(or,"getProperty");function Fc(e,t,r){if(!pr(e)||typeof t!="string"&&!Array.isArray(t))return e;const n=e,s=Zn(t);if(s.length===0)return e;for(let i=0;i<s.length;i++){const o=s[i];if(i===s.length-1)e[o]=r;else if(!pr(e[o])){const a=typeof s[i+1]=="number";e[o]=a?[]:{}}e=e[o]}return n}d(Fc,"T$n");ct(Fc,"M");Xe(Fc,"setProperty");nt(Fc,"setProperty");function Fd(e,t){if(!pr(e)||typeof t!="string"&&!Array.isArray(t))return!1;const r=Zn(t);if(r.length===0)return!1;for(let n=0;n<r.length;n++){const s=r[n];if(n===r.length-1)return Object.hasOwn(e,s)?(delete e[s],!0):!1;if(e=e[s],!pr(e))return!1}}d(Fd,"q$e");ct(Fd,"ue");Xe(Fd,"deleteProperty");nt(Fd,"deleteProperty");function Xr(e,t){if(!pr(e)||typeof t!="string"&&!Array.isArray(t))return!1;const r=Zn(t);if(r.length===0)return!1;for(const n of r){if(!pr(e)||!(n in e))return!1;e=e[n]}return!0}d(Xr,"m$w");ct(Xr,"y");Xe(Xr,"hasProperty");nt(Xr,"hasProperty");function vo(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return e.replaceAll(/[\\.[]/g,String.raw`\$&`)}d(vo,"E$o");ct(vo,"x");Xe(vo,"escapePath");nt(vo,"escapePath");function Bc(e){const t=Object.entries(e);return Array.isArray(e)?t.map(([r,n])=>[Qn(r)?Number.parseInt(r,10):r,n]):t}d(Bc,"D$l");ct(Bc,"R");Xe(Bc,"m$2");nt(Bc,"normalizeEntries");function Rc(e,t={}){if(!Array.isArray(e))throw new TypeError(`Expected an array, got ${typeof e}`);const{preferDotForIndices:r=!1}=t,n=[];for(const[s,i]of e.entries()){if(typeof i!="string"&&typeof i!="number")throw new TypeError(`Expected a string or number for path segment at index ${s}, got ${typeof i}`);if(typeof i=="number")if(!Number.isInteger(i)||i<0){const o=vo(String(i));n.push(s===0?o:`.${o}`)}else r&&s>0?n.push(`.${i}`):n.push(`[${i}]`);else if(typeof i=="string")if(i==="")s===0||n.push(".");else if(Qn(i)){const o=Number.parseInt(i,10);r&&s>0?n.push(`.${o}`):n.push(`[${o}]`)}else{const o=vo(i);n.push(s===0?o:`.${o}`)}}return n.join("")}d(Rc,"F$i");ct(Rc,"Y");Xe(Rc,"stringifyPath");nt(Rc,"stringifyPath");function*Io(e,t=[],r=new Set){if(!pr(e)||uA(e)){t.length>0&&(yield Rc(t));return}if(!r.has(e)){r.add(e);for(const[n,s]of Bc(e))t.push(n),yield*Io(s,t,r),t.pop();r.delete(e)}}d(Io,"j$k");ct(Io,"S");Xe(Io,"x");nt(Io,"deepKeysIterator");function Bd(e){return[...Io(e)]}d(Bd,"G$a");ct(Bd,"ge");Xe(Bd,"deepKeys");nt(Bd,"deepKeys");function Rd(e){const t={};if(!pr(e))return t;for(const[r,n]of Object.entries(e))Fc(t,r,n);return t}d(Rd,"K$b");ct(Rd,"de");Xe(Rd,"unflatten");nt(Rd,"unflatten");var dA=Object.defineProperty,ql=Xe((e,t)=>dA(e,"name",{value:t,configurable:!0}),"i");const fA=ql(async e=>{const{default:t=!1,message:r,transformer:n}=e,s=ql(o=>{const a=Ot(["cyan","bold"],"?"),c=Ot(["bold"],o),l=t?`${Ot(["greenBright"],"Y")}${Ot(["gray"],"/n")}`:`y/${Ot(["yellowBright"],"N")}`;return`${a} ${c} ${Ot(["gray"],`(${l})`)}`},"formatMessage"),i=ql(o=>n?n(o):o?Ot(["greenBright"],"Yes"):Ot(["yellowBright"],"No"),"formatAnswer");return new Promise(o=>{const a=cA({input:process.stdin,output:process.stdout}),c=s(r);a.question(c,l=>{a.close();const u=l.trim().toLowerCase();if(u===""){o(t);return}if(u==="y"||u==="yes"){console.log(`${Ot(["greenBright"],"✓")} ${i(!0)}`),o(!0);return}if(u==="n"||u==="no"){console.log(`${Ot(["yellowBright"],"✗")} ${i(!1)}`),o(!1);return}console.log(`${Ot(["gray"],"→")} ${i(t)}`),o(t)}),a.on("SIGINT",()=>{a.close(),console.log(`
|
|
961
|
+
`);let s=0;for(;n[s]&&n[s].trim().match(/^(#|$)/);)s++;const i=n.length;let o=s+1;for(;o<i&&n[o].trim();)o++;return n.slice(s,o).join(" ").trim()}return d(r,"extractDescription"),t(r,"extractDescription"),Wl}d(Mj,"requireExtract_description");var pb={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"},db={web:"url",name:"url"},fb={server:"start",tests:"test"};const Wj={topLevel:pb,bugs:db,script:fb},Vj=Object.defineProperty({__proto__:null,bugs:db,default:Wj,script:fb,topLevel:pb},Symbol.toStringTag,{value:"Module"}),Uj=Tg(Vj);var Vl,zh;function Gj(){if(zh)return Vl;zh=1;var e=Object.defineProperty,t=d((g,E)=>e(g,"name",{value:E,configurable:!0}),"n"),{URL:r}=Hg,n=Zk(),s=eS(),i=Tj(),o=_j(),{isBuiltin:a}=Lg,c=["dependencies","devDependencies","optionalDependencies"],l=Mj(),u=Uj,p=t(g=>g.includes("@")&&g.indexOf("@")<g.lastIndexOf("."),"isEmail");Vl={warn:t(function(){},"warn"),fixRepositoryField:t(function(g){if(g.repositories&&(this.warn("repositories"),g.repository=g.repositories[0]),!g.repository)return this.warn("missingRepository");typeof g.repository=="string"&&(g.repository={type:"git",url:g.repository});var E=g.repository.url||"";if(E){var C=o.fromUrl(E);C&&(E=g.repository.url=C.getDefaultRepresentation()==="shortcut"?C.https():C.toString())}E.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",E)},"fixRepositoryField"),fixTypos:t(function(g){Object.keys(u.topLevel).forEach(function(E){Object.prototype.hasOwnProperty.call(g,E)&&this.warn("typo",E,u.topLevel[E])},this)},"fixTypos"),fixScriptsField:t(function(g){if(g.scripts){if(typeof g.scripts!="object"){this.warn("nonObjectScripts"),delete g.scripts;return}Object.keys(g.scripts).forEach(function(E){typeof g.scripts[E]!="string"?(this.warn("nonStringScript"),delete g.scripts[E]):u.script[E]&&!g.scripts[u.script[E]]&&this.warn("typo",E,u.script[E],"scripts")},this)}},"fixScriptsField"),fixFilesField:t(function(g){var E=g.files;E&&!Array.isArray(E)?(this.warn("nonArrayFiles"),delete g.files):g.files&&(g.files=g.files.filter(function(C){return!C||typeof C!="string"?(this.warn("invalidFilename",C),!1):!0},this))},"fixFilesField"),fixBinField:t(function(g){if(g.bin&&typeof g.bin=="string"){var E={},C;(C=g.name.match(/^@[^/]+[/](.*)$/))?E[C[1]]=g.bin:E[g.name]=g.bin,g.bin=E}},"fixBinField"),fixManField:t(function(g){g.man&&typeof g.man=="string"&&(g.man=[g.man])},"fixManField"),fixBundleDependenciesField:t(function(g){var E="bundledDependencies",C="bundleDependencies";g[E]&&!g[C]&&(g[C]=g[E],delete g[E]),g[C]&&!Array.isArray(g[C])?(this.warn("nonArrayBundleDependencies"),delete g[C]):g[C]&&(g[C]=g[C].filter(function(A){return!A||typeof A!="string"?(this.warn("nonStringBundleDependency",A),!1):(g.dependencies||(g.dependencies={}),Object.prototype.hasOwnProperty.call(g.dependencies,A)||(this.warn("nonDependencyBundleDependency",A),g.dependencies[A]="*"),!0)},this))},"fixBundleDependenciesField"),fixDependencies:t(function(g){v(g,this.warn),y(g),this.fixBundleDependenciesField(g),["dependencies","devDependencies"].forEach(function(E){if(E in g){if(!g[E]||typeof g[E]!="object"){this.warn("nonObjectDependencies",E),delete g[E];return}Object.keys(g[E]).forEach(function(C){var A=g[E][C];typeof A!="string"&&(this.warn("nonStringDependency",C,JSON.stringify(A)),delete g[E][C]);var O=o.fromUrl(g[E][C]);O&&(g[E][C]=O.toString())},this)}},this)},"fixDependencies"),fixModulesField:t(function(g){g.modules&&(this.warn("deprecatedModules"),delete g.modules)},"fixModulesField"),fixKeywordsField:t(function(g){typeof g.keywords=="string"&&(g.keywords=g.keywords.split(/,\s+/)),g.keywords&&!Array.isArray(g.keywords)?(delete g.keywords,this.warn("nonArrayKeywords")):g.keywords&&(g.keywords=g.keywords.filter(function(E){return typeof E!="string"||!E?(this.warn("nonStringKeyword"),!1):!0},this))},"fixKeywordsField"),fixVersionField:t(function(g,E){var C=!E;if(!g.version)return g.version="",!0;if(!n(g.version,C))throw new Error('Invalid version: "'+g.version+'"');return g.version=s(g.version,C),!0},"fixVersionField"),fixPeople:t(function(g){b(g,k),b(g,S)},"fixPeople"),fixNameField:t(function(g,E){typeof E=="boolean"?E={strict:E}:typeof E>"u"&&(E={});var C=E.strict;if(!g.name&&!C){g.name="";return}if(typeof g.name!="string")throw new Error("name field must be a string.");C||(g.name=g.name.trim()),$(g.name,C,E.allowLegacyCase),a(g.name)&&this.warn("conflictingName",g.name)},"fixNameField"),fixDescriptionField:t(function(g){g.description&&typeof g.description!="string"&&(this.warn("nonStringDescription"),delete g.description),g.readme&&!g.description&&(g.description=l(g.readme)),g.description===void 0&&delete g.description,g.description||this.warn("missingDescription")},"fixDescriptionField"),fixReadmeField:t(function(g){g.readme||(this.warn("missingReadme"),g.readme="ERROR: No README data found!")},"fixReadmeField"),fixBugsField:t(function(g){if(!g.bugs&&g.repository&&g.repository.url){var E=o.fromUrl(g.repository.url);E&&E.bugs()&&(g.bugs={url:E.bugs()})}else if(g.bugs){if(typeof g.bugs=="string")p(g.bugs)?g.bugs={email:g.bugs}:r.canParse(g.bugs)?g.bugs={url:g.bugs}:this.warn("nonEmailUrlBugsString");else{w(g.bugs,this.warn);var C=g.bugs;g.bugs={},C.url&&(r.canParse(C.url)?g.bugs.url=C.url:this.warn("nonUrlBugsUrlField")),C.email&&(typeof C.email=="string"&&p(C.email)?g.bugs.email=C.email:this.warn("nonEmailBugsEmailField"))}!g.bugs.email&&!g.bugs.url&&(delete g.bugs,this.warn("emptyNormalizedBugs"))}},"fixBugsField"),fixHomepageField:t(function(g){if(!g.homepage&&g.repository&&g.repository.url){var E=o.fromUrl(g.repository.url);E&&E.docs()&&(g.homepage=E.docs())}if(g.homepage){if(typeof g.homepage!="string")return this.warn("nonUrlHomepage"),delete g.homepage;r.canParse(g.homepage)||(g.homepage="http://"+g.homepage)}},"fixHomepageField"),fixLicenseField:t(function(g){const E=g.license||g.licence;if(!E)return this.warn("missingLicense");if(typeof E!="string"||E.length<1||E.trim()==="")return this.warn("invalidLicense");if(!i(E).validForNewPackages)return this.warn("invalidLicense")},"fixLicenseField")};function f(g){if(g.charAt(0)!=="@")return!1;var E=g.slice(1).split("/");return E.length!==2?!1:E[0]&&E[1]&&E[0]===encodeURIComponent(E[0])&&E[1]===encodeURIComponent(E[1])}d(f,"isValidScopedPackageName"),t(f,"isValidScopedPackageName");function m(g){return!g.match(/[/@\s+%:]/)&&g===encodeURIComponent(g)}d(m,"isCorrectlyEncodedName"),t(m,"isCorrectlyEncodedName");function $(g,E,C){if(g.charAt(0)==="."||!(f(g)||m(g))||E&&!C&&g!==g.toLowerCase()||g.toLowerCase()==="node_modules"||g.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(g))}d($,"ensureValidName"),t($,"ensureValidName");function b(g,E){return g.author&&(g.author=E(g.author)),["maintainers","contributors"].forEach(function(C){Array.isArray(g[C])&&(g[C]=g[C].map(E))}),g}d(b,"modifyPeople"),t(b,"modifyPeople");function k(g){if(typeof g=="string")return g;var E=g.name||"",C=g.url||g.web,A=C?" ("+C+")":"",O=g.email||g.mail,I=O?" <"+O+">":"";return E+I+A}d(k,"unParsePerson"),t(k,"unParsePerson");function S(g){if(typeof g!="string")return g;var E=g.match(/^([^(<]+)/),C=g.match(/\(([^()]+)\)/),A=g.match(/<([^<>]+)>/),O={};return E&&E[0].trim()&&(O.name=E[0].trim()),A&&(O.email=A[1]),C&&(O.url=C[1]),O}d(S,"parsePerson"),t(S,"parsePerson");function y(g){var E=g.optionalDependencies;if(E){var C=g.dependencies||{};Object.keys(E).forEach(function(A){C[A]=E[A]}),g.dependencies=C}}d(y,"addOptionalDepsToDeps"),t(y,"addOptionalDepsToDeps");function h(g,E,C){if(!g)return{};if(typeof g=="string"&&(g=g.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(g))return g;C("deprecatedArrayDependencies",E);var A={};return g.filter(function(O){return typeof O=="string"}).forEach(function(O){O=O.trim().split(/(:?[@\s><=])/);var I=O.shift(),V=O.join("");V=V.trim(),V=V.replace(/^@/,""),A[I]=V}),A}d(h,"depObjectify"),t(h,"depObjectify");function v(g,E){c.forEach(function(C){g[C]&&(g[C]=h(g[C],C,E))})}d(v,"objectifyDeps"),t(v,"objectifyDeps");function w(g,E){g&&Object.keys(g).forEach(function(C){u.bugs[C]&&(E("typo",C,u.bugs[C],"bugs"),g[u.bugs[C]]=g[C],delete g[C])})}return d(w,"bugsTypos"),t(w,"bugsTypos"),Vl}d(Gj,"requireFixer");var hb="'repositories' (plural) Not supported. Please pick one as the 'repository' field",mb="No repository field.",gb="Probably broken git url: %s",yb="scripts must be an object",vb="script values must be string commands",bb="Invalid 'files' member",$b="Invalid filename in 'files' list: %s",wb="Invalid 'bundleDependencies' list. Must be array of package names",kb="Invalid bundleDependencies member: %s",Sb="Non-dependency in bundleDependencies: %s",Db="%s field must be an object",Cb="Invalid dependency: %s %s",Eb="specifying %s as array is deprecated",jb="modules field is deprecated",Ab="keywords should be an array of strings",xb="keywords should be an array of strings",Ob="%s is also the name of a node core module.",Pb="'description' field should be a string",Fb="No description",Bb="No README data",Rb="No license field.",Tb="Bug string field must be url, email, or {email,url}",Nb="bugs.url field must be a string url. Deleted.",Ib="bugs.email field must be a string email. Deleted.",Lb="Normalized value of bugs field is an empty object. Deleted.",_b="homepage field must be a string url. Deleted.",Mb="license should be a valid SPDX license expression",Wb="%s should probably be %s.";const qj={repositories:hb,missingRepository:mb,brokenGitUrl:gb,nonObjectScripts:yb,nonStringScript:vb,nonArrayFiles:bb,invalidFilename:$b,nonArrayBundleDependencies:wb,nonStringBundleDependency:kb,nonDependencyBundleDependency:Sb,nonObjectDependencies:Db,nonStringDependency:Cb,deprecatedArrayDependencies:Eb,deprecatedModules:jb,nonArrayKeywords:Ab,nonStringKeyword:xb,conflictingName:Ob,nonStringDescription:Pb,missingDescription:Fb,missingReadme:Bb,missingLicense:Rb,nonEmailUrlBugsString:Tb,nonUrlBugsUrlField:Nb,nonEmailBugsEmailField:Ib,emptyNormalizedBugs:Lb,nonUrlHomepage:_b,invalidLicense:Mb,typo:Wb},Hj=Object.defineProperty({__proto__:null,brokenGitUrl:gb,conflictingName:Ob,default:qj,deprecatedArrayDependencies:Eb,deprecatedModules:jb,emptyNormalizedBugs:Lb,invalidFilename:$b,invalidLicense:Mb,missingDescription:Fb,missingLicense:Rb,missingReadme:Bb,missingRepository:mb,nonArrayBundleDependencies:wb,nonArrayFiles:bb,nonArrayKeywords:Ab,nonDependencyBundleDependency:Sb,nonEmailBugsEmailField:Ib,nonEmailUrlBugsString:Tb,nonObjectDependencies:Db,nonObjectScripts:yb,nonStringBundleDependency:kb,nonStringDependency:Cb,nonStringDescription:Pb,nonStringKeyword:xb,nonStringScript:vb,nonUrlBugsUrlField:Nb,nonUrlHomepage:_b,repositories:hb,typo:Wb},Symbol.toStringTag,{value:"Module"}),zj=Tg(Hj);var Ul,Jh;function Jj(){if(Jh)return Ul;Jh=1;var e=Object.defineProperty,t=d((i,o)=>e(i,"name",{value:o,configurable:!0}),"s"),r=tS,n=zj;Ul=d(function(){var i=Array.prototype.slice.call(arguments,0),o=i.shift();if(o==="typo")return s.apply(null,i);var a=n[o]?n[o]:o+": '%s'";return i.unshift(a),r.format.apply(null,i)},"make_warning");function s(i,o,a){return a&&(i=a+"['"+i+"']",o=a+"['"+o+"']"),r.format(n.typo,i,o)}return d(s,"makeTypoWarning"),t(s,"makeTypoWarning"),Ul}d(Jj,"requireMake_warning");var Gl,Kh;function Kj(){if(Kh)return Gl;Kh=1;var e=Object.defineProperty,t=d((l,u)=>e(l,"name",{value:u,configurable:!0}),"n");Gl=a;var r=Gj();a.fixer=r;var n=Jj(),s=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],i=["dependencies","people","typos"],o=s.map(function(l){return c(l)+"Field"});o=o.concat(i);function a(l,u,p){u===!0&&(u=null,p=!0),p||(p=!1),(!u||l.private)&&(u=t(function(){},"warn")),l.scripts&&l.scripts.install==="node-gyp rebuild"&&!l.scripts.preinstall&&(l.gypfile=!0),r.warn=function(){u(n.apply(null,arguments))},o.forEach(function(f){r["fix"+c(f)](l,p)}),l._id=l.name+"@"+l.version}d(a,"normalize"),t(a,"normalize");function c(l){return l.charAt(0).toUpperCase()+l.slice(1)}return d(c,"ucFirst"),t(c,"ucFirst"),Gl}d(Kj,"requireNormalize");var Yj=Kj();const Xj=Ng(Yj);var Qj=Object.defineProperty,Zj=d((e,t)=>Qj(e,"name",{value:t,configurable:!0}),"d$w"),eA=Object.defineProperty,tA=Zj((e,t)=>eA(e,"name",{value:t,configurable:!0}),"f"),rA=Object.defineProperty,Zs=tA((e,t)=>rA(e,"name",{value:t,configurable:!0}),"c");const Vb=Zs((e,t,r)=>{const n=Je(e),s=Je(t),i=s===n?".":zn(n,s);return r.some(o=>{const a=o.startsWith("./")?o.slice(2):o,c=i.startsWith("./")?i.slice(2):i;if(a==="."&&c===".")return!0;if(a.endsWith("/**")){const l=a.slice(0,-3);return c===l||c.startsWith(`${l}/`)}if(a.endsWith("/*")){const l=a.slice(0,-2);return l===""?c!=="."&&!c.includes("/"):c.startsWith(`${l}/`)||c===l}return c===a||c.startsWith(`${a}/`)})},"isPackageInWorkspace"),Ub=Zs(async e=>{const t=await Do("pnpm-workspace.yaml",{cwd:Je(e),type:"file"});if(!t)return;const r=await To(t),n=Array.isArray(r.packages)?r.packages:[];if(!Vb(t,e,n))return;const s={};return r.catalog&&typeof r.catalog=="object"&&(s.catalog=r.catalog),r.catalogs&&typeof r.catalogs=="object"&&(s.catalogs=r.catalogs),Object.keys(s).length>0?s:void 0},"readPnpmCatalogs"),Gb=Zs(e=>{const t=Co("pnpm-workspace.yaml",{cwd:Je(e),type:"file"});if(!t)return;const r=Lt(t),n=Array.isArray(r.packages)?r.packages:[];if(!Vb(t,e,n))return;const s={};return r.catalog&&typeof r.catalog=="object"&&(s.catalog=r.catalog),r.catalogs&&typeof r.catalogs=="object"&&(s.catalogs=r.catalogs),Object.keys(s).length>0?s:void 0},"readPnpmCatalogsSync"),nA=Zs((e,t,r)=>{if(t==="catalog:")return r.catalog?.[e];if(t.startsWith("catalog:")){const n=t.slice(8);return r.catalogs?.[n]?.[e]}},"resolveCatalogReference"),sA=Zs((e,t)=>{for(const[r,n]of Object.entries(e)){if(typeof n!="string")continue;const s=nA(r,n,t);s&&(e[r]=s)}},"resolveDependenciesCatalogReferences"),Oc=Zs((e,t)=>{const r=["dependencies","devDependencies","peerDependencies","optionalDependencies"];for(const n of r){if(!e[n]||typeof e[n]!="object")continue;const s=e[n];sA(s,t)}},"resolveCatalogReferences");var iA=Object.defineProperty,ct=d((e,t)=>iA(e,"name",{value:t,configurable:!0}),"l$t"),oA=Object.defineProperty,Xe=ct((e,t)=>oA(e,"name",{value:t,configurable:!0}),"f");const aA=mt(import.meta.url),xi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Pd=Xe(e=>{if(typeof xi<"u"&&xi.versions&&xi.versions.node){const[t,r]=xi.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return xi.getBuiltinModule(e)}return aA(e)},"__cjs_getBuiltinModule"),{existsSync:qb}=Pd("node:fs"),{createInterface:cA}=Pd("node:readline"),{styleText:Ot}=Pd("node:util");var lA=Object.defineProperty,nt=Xe((e,t)=>lA(e,"name",{value:t,configurable:!0}),"f");const pr=nt(e=>{const t=typeof e;return e!==null&&(t==="object"||t==="function")},"isObject"),uA=nt(e=>{if(!pr(e))return!1;for(const t in e)if(Object.hasOwn(e,t))return!1;return!0},"isEmptyObject"),Hb=new Set(["__proto__","prototype","constructor"]),zb=1e6,pA=nt(e=>e>="0"&&e<="9","isDigit");function Qn(e){if(e==="0")return!0;if(/^[1-9]\d*$/.test(e)){const t=Number.parseInt(e,10);return t<=Number.MAX_SAFE_INTEGER&&t<=zb}return!1}d(Qn,"w$n");ct(Qn,"b");Xe(Qn,"p$1");nt(Qn,"shouldCoerceToNumber");function Es(e,t){return Hb.has(e)?!1:(e&&Qn(e)?t.push(Number.parseInt(e,10)):t.push(e),!0)}d(Es,"P$j");ct(Es,"P");Xe(Es,"y");nt(Es,"processSegment");function Pc(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);const t=[];let r="",n="start",s=!1,i=0;for(const o of e){if(i++,s){r+=o,s=!1;continue}if(o==="\\"){if(n==="index")throw new Error(`Invalid character '${o}' in an index at position ${i}`);if(n==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${i}`);s=!0,n=n==="start"?"property":n;continue}switch(o){case".":{if(n==="index")throw new Error(`Invalid character '${o}' in an index at position ${i}`);if(n==="indexEnd"){n="property";break}if(!Es(r,t))return[];r="",n="property";break}case"[":{if(n==="index")throw new Error(`Invalid character '${o}' in an index at position ${i}`);if(n==="indexEnd"){n="index";break}if(n==="property"||n==="start"){if((r||n==="property")&&!Es(r,t))return[];r=""}n="index";break}case"]":{if(n==="index"){if(r==="")r=(t.pop()||"")+"[]",n="property";else{const a=Number.parseInt(r,10);!Number.isNaN(a)&&Number.isFinite(a)&&a>=0&&a<=Number.MAX_SAFE_INTEGER&&a<=zb&&r===String(a)?t.push(a):t.push(r),r="",n="indexEnd"}break}if(n==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${i}`);r+=o;break}default:{if(n==="index"&&!pA(o))throw new Error(`Invalid character '${o}' in an index at position ${i}`);if(n==="indexEnd")throw new Error(`Invalid character '${o}' after an index at position ${i}`);n==="start"&&(n="property"),r+=o}}}switch(s&&(r+="\\"),n){case"property":{if(!Es(r,t))return[];break}case"index":throw new Error("Index was not closed");case"start":{t.push("");break}}return t}d(Pc,"N$h");ct(Pc,"B");Xe(Pc,"parsePath");nt(Pc,"parsePath");function Zn(e){if(typeof e=="string")return Pc(e);if(Array.isArray(e)){const t=[];for(const[r,n]of e.entries()){if(typeof n!="string"&&typeof n!="number")throw new TypeError(`Expected a string or number for path segment at index ${r}, got ${typeof n}`);if(typeof n=="number"&&!Number.isFinite(n))throw new TypeError(`Path segment at index ${r} must be a finite number, got ${n}`);if(Hb.has(n))return[];typeof n=="string"&&Qn(n)?t.push(Number.parseInt(n,10)):t.push(n)}return t}return[]}d(Zn,"b$g");ct(Zn,"k");Xe(Zn,"d");nt(Zn,"normalizePath");function or(e,t,r){if(!pr(e)||typeof t!="string"&&!Array.isArray(t))return r===void 0?e:r;const n=Zn(t);if(n.length===0)return r;for(let s=0;s<n.length;s++){const i=n[s];if(e=e[i],e==null){if(s!==n.length-1)return r;break}}return e===void 0?r:e}d(or,"d$v");ct(or,"h");Xe(or,"getProperty");nt(or,"getProperty");function Fc(e,t,r){if(!pr(e)||typeof t!="string"&&!Array.isArray(t))return e;const n=e,s=Zn(t);if(s.length===0)return e;for(let i=0;i<s.length;i++){const o=s[i];if(i===s.length-1)e[o]=r;else if(!pr(e[o])){const a=typeof s[i+1]=="number";e[o]=a?[]:{}}e=e[o]}return n}d(Fc,"T$n");ct(Fc,"M");Xe(Fc,"setProperty");nt(Fc,"setProperty");function Fd(e,t){if(!pr(e)||typeof t!="string"&&!Array.isArray(t))return!1;const r=Zn(t);if(r.length===0)return!1;for(let n=0;n<r.length;n++){const s=r[n];if(n===r.length-1)return Object.hasOwn(e,s)?(delete e[s],!0):!1;if(e=e[s],!pr(e))return!1}}d(Fd,"q$f");ct(Fd,"ue");Xe(Fd,"deleteProperty");nt(Fd,"deleteProperty");function Xr(e,t){if(!pr(e)||typeof t!="string"&&!Array.isArray(t))return!1;const r=Zn(t);if(r.length===0)return!1;for(const n of r){if(!pr(e)||!(n in e))return!1;e=e[n]}return!0}d(Xr,"m$w");ct(Xr,"y");Xe(Xr,"hasProperty");nt(Xr,"hasProperty");function vo(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return e.replaceAll(/[\\.[]/g,String.raw`\$&`)}d(vo,"E$o");ct(vo,"x");Xe(vo,"escapePath");nt(vo,"escapePath");function Bc(e){const t=Object.entries(e);return Array.isArray(e)?t.map(([r,n])=>[Qn(r)?Number.parseInt(r,10):r,n]):t}d(Bc,"D$l");ct(Bc,"R");Xe(Bc,"m$2");nt(Bc,"normalizeEntries");function Rc(e,t={}){if(!Array.isArray(e))throw new TypeError(`Expected an array, got ${typeof e}`);const{preferDotForIndices:r=!1}=t,n=[];for(const[s,i]of e.entries()){if(typeof i!="string"&&typeof i!="number")throw new TypeError(`Expected a string or number for path segment at index ${s}, got ${typeof i}`);if(typeof i=="number")if(!Number.isInteger(i)||i<0){const o=vo(String(i));n.push(s===0?o:`.${o}`)}else r&&s>0?n.push(`.${i}`):n.push(`[${i}]`);else if(typeof i=="string")if(i==="")s===0||n.push(".");else if(Qn(i)){const o=Number.parseInt(i,10);r&&s>0?n.push(`.${o}`):n.push(`[${o}]`)}else{const o=vo(i);n.push(s===0?o:`.${o}`)}}return n.join("")}d(Rc,"F$j");ct(Rc,"Y");Xe(Rc,"stringifyPath");nt(Rc,"stringifyPath");function*Io(e,t=[],r=new Set){if(!pr(e)||uA(e)){t.length>0&&(yield Rc(t));return}if(!r.has(e)){r.add(e);for(const[n,s]of Bc(e))t.push(n),yield*Io(s,t,r),t.pop();r.delete(e)}}d(Io,"j$k");ct(Io,"S");Xe(Io,"x");nt(Io,"deepKeysIterator");function Bd(e){return[...Io(e)]}d(Bd,"G$a");ct(Bd,"ge");Xe(Bd,"deepKeys");nt(Bd,"deepKeys");function Rd(e){const t={};if(!pr(e))return t;for(const[r,n]of Object.entries(e))Fc(t,r,n);return t}d(Rd,"K$b");ct(Rd,"de");Xe(Rd,"unflatten");nt(Rd,"unflatten");var dA=Object.defineProperty,ql=Xe((e,t)=>dA(e,"name",{value:t,configurable:!0}),"i");const fA=ql(async e=>{const{default:t=!1,message:r,transformer:n}=e,s=ql(o=>{const a=Ot(["cyan","bold"],"?"),c=Ot(["bold"],o),l=t?`${Ot(["greenBright"],"Y")}${Ot(["gray"],"/n")}`:`y/${Ot(["yellowBright"],"N")}`;return`${a} ${c} ${Ot(["gray"],`(${l})`)}`},"formatMessage"),i=ql(o=>n?n(o):o?Ot(["greenBright"],"Yes"):Ot(["yellowBright"],"No"),"formatAnswer");return new Promise(o=>{const a=cA({input:process.stdin,output:process.stdout}),c=s(r);a.question(c,l=>{a.close();const u=l.trim().toLowerCase();if(u===""){o(t);return}if(u==="y"||u==="yes"){console.log(`${Ot(["greenBright"],"✓")} ${i(!0)}`),o(!0);return}if(u==="n"||u==="no"){console.log(`${Ot(["yellowBright"],"✗")} ${i(!1)}`),o(!1);return}console.log(`${Ot(["gray"],"→")} ${i(t)}`),o(t)}),a.on("SIGINT",()=>{a.close(),console.log(`
|
|
962
962
|
${Ot(["gray"],"→")} ${i(t)}`),o(t)})})},"confirm"),hA=typeof process.stdout<"u"&&!process.versions.deno&&!globalThis.window;var mA=Object.defineProperty,tt=Xe((e,t)=>mA(e,"name",{value:t,configurable:!0}),"l");const Jb=/, ([^,]*)$/,Ua=new Map,Kb=new Map;let gA=class extends Error{static{d(this,"ke")}static{ct(this,"be")}static{Xe(this,"M")}static{tt(this,"PackageJsonValidationError")}constructor(t){super(`The following warnings were encountered while normalizing package data:
|
|
963
963
|
- ${t.join(`
|
|
964
|
-
- `)}`),this.name="PackageJsonValidationError"}};const Tc=tt((e,t,r=[])=>{const n=[];if(Xj(e,s=>{n.push(s)},t),t&&n.length>0){const s=n.filter(i=>!r.some(o=>o instanceof RegExp?o.test(i):o===i));if(s.length>0)throw new gA(s)}return e},"normalizeInput"),yA=tt(async e=>await To(e),"parseYamlFile"),vA=tt(e=>Lt(e),"parseYamlFileSync"),bA=tt(async e=>{const t=await Pp(e);return ob.parse(t)},"parseJson5File"),$A=tt(e=>{const t=H(e);return ob.parse(t)},"parseJson5FileSync"),Yb=tt(async(e,t)=>t?.yaml!==!1&&(e.endsWith(".yaml")||e.endsWith(".yml"))?yA(e):t?.json5!==!1&&e.endsWith(".json5")?bA(e):Eo(e),"parsePackageFile"),Xb=tt((e,t)=>t?.yaml!==!1&&(e.endsWith(".yaml")||e.endsWith(".yml"))?vA(e):t?.json5!==!1&&e.endsWith(".json5")?$A(e):le(e),"parsePackageFileSync");tt(async(e,t={})=>{const r={type:"file"};e&&(r.cwd=e);const n=["package.json"];t.yaml!==!1&&n.push("package.yaml","package.yml"),t.json5!==!1&&n.push("package.json5");let s;for(const c of n)if(s=await Do(c,r),s)break;if(!s)throw new Bs(`No such file or directory, for ${n.join(", ").replace(Jb," or $1")} found.`);const i=t.cache&&typeof t.cache!="boolean"?t.cache:Kb;if(t.cache&&i.has(s))return i.get(s);const o=await Yb(s,t);if(t.resolveCatalogs){const c=await Ub(s);c&&Oc(o,c)}Tc(o,t.strict??!1,t.ignoreWarnings);const a={packageJson:o,path:s};return t.cache&&i.set(s,a),a},"findPackageJson");tt((e,t={})=>{const r={type:"file"};e&&(r.cwd=e);const n=["package.json"];t.yaml!==!1&&n.push("package.yaml","package.yml"),t.json5!==!1&&n.push("package.json5");let s;for(const c of n)if(s=Co(c,r),s)break;if(!s)throw new Bs(`No such file or directory, for ${n.join(", ").replace(Jb," or $1")} found.`);const i=t.cache&&typeof t.cache!="boolean"?t.cache:Kb;if(t.cache&&i.has(s))return i.get(s);const o=Xb(s,t);if(t.resolveCatalogs){const c=Gb(s);c&&Oc(o,c)}Tc(o,t.strict??!1,t.ignoreWarnings);const a={packageJson:o,path:s};return t.cache&&i.set(s,a),a},"findPackageJsonSync");tt(async(e,t={})=>{const{cwd:r,...n}=t,s=Tt(r??process.cwd());await lC(D(s,"package.json"),e,n)},"writePackageJson");tt((e,t={})=>{const{cwd:r,...n}=t,s=Tt(r??process.cwd());wo(D(s,"package.json"),e,n)},"writePackageJsonSync");const Qb=tt((e,t)=>{const r=typeof e=="object"&&!Array.isArray(e);if(!r&&typeof e!="string")throw new TypeError("`packageFile` should be either an `object` or a `string`.");let n,s=!1,i;if(r)n=structuredClone(e);else if(qb(e)){i=e;const a=t?.cache&&typeof t.cache!="boolean"?t.cache:Ua;if(t?.cache&&a.has(i))return a.get(i);n=Xb(i,t),s=!0}else n=Dp(e);if(t?.resolveCatalogs)if(s){const a=Gb(e);a&&Oc(n,a)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");Tc(n,t?.strict??!1,t?.ignoreWarnings);const o=n;return s&&t?.cache&&(typeof t.cache=="boolean"?Ua:t.cache).set(i,o),o},"parsePackageJsonSync");tt(async(e,t)=>{const r=typeof e=="object"&&!Array.isArray(e);if(!r&&typeof e!="string")throw new TypeError("`packageFile` should be either an `object` or a `string`.");let n,s=!1,i;if(r)n=structuredClone(e);else if(qb(e)){i=e;const a=t?.cache&&typeof t.cache!="boolean"?t.cache:Ua;if(t?.cache&&a.has(i))return a.get(i);n=await Yb(i,t),s=!0}else n=Dp(e);if(t?.resolveCatalogs)if(s){const a=await Ub(e);a&&Oc(n,a)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");Tc(n,t?.strict??!1,t?.ignoreWarnings);const o=n;return s&&t?.cache&&(typeof t.cache=="boolean"?Ua:t.cache).set(i,o),o},"parsePackageJson");tt((e,t,r)=>or(e,t,r),"getPackageJsonProperty");tt((e,t)=>Xr(e,t),"hasPackageJsonProperty");tt((e,t,r)=>{const n=or(e,"dependencies",{}),s=or(e,"devDependencies",{}),i=or(e,"peerDependencies",{}),o={...n,...s,...r?.peerDeps===!1?{}:i};for(const a of t)if(Xr(o,a))return!0;return!1},"hasPackageJsonAnyDependency");tt(async(e,t,r="dependencies",n={})=>{const s=or(e,"dependencies",{}),i=or(e,"devDependencies",{}),o=or(e,"peerDependencies",{}),a=[],c={deps:!0,devDeps:!0,peerDeps:!1,...n};for(const l of t)c.deps&&Xr(s,l)||c.devDeps&&Xr(i,l)||c.peerDeps&&Xr(o,l)||a.push(l);if(a.length!==0){if(process.env.CI||hA&&!process.stdout.isTTY){const l=`Skipping package installation for [${t.join(", ")}] because the process is not interactive.`;if(n.throwOnWarn)throw new Error(l);n.logger?.warn?n.logger.warn(l):console.warn(l);return}if(typeof c.confirm?.message=="function"&&(c.confirm.message=c.confirm.message(a)),c.confirm?.message===void 0){const l=`${a.length===1?"Package is":"Packages are"} required for this config: ${a.join(", ")}. Do you want to install them?`;c.confirm===void 0?c.confirm={message:l}:c.confirm.message=l}await fA(c.confirm)&&await By(a,{...c.installPackage,cwd:c.cwd?Tt(c.cwd):void 0,dev:r==="devDependencies"})}},"ensurePackages");var wA=Object.defineProperty,kA=d((e,t)=>wA(e,"name",{value:t,configurable:!0}),"d$u"),SA=Object.defineProperty,Zb=kA((e,t)=>SA(e,"name",{value:t,configurable:!0}),"g");const DA=mt(import.meta.url),Oi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,e0=Zb(e=>{if(typeof Oi<"u"&&Oi.versions&&Oi.versions.node){const[t,r]=Oi.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Oi.getBuiltinModule(e)}return DA(e)},"__cjs_getBuiltinModule"),{execSync:CA}=e0("node:child_process"),{existsSync:Yh,readFileSync:EA}=e0("node:fs");var jA=Object.defineProperty,dr=Zb((e,t)=>jA(e,"name",{value:t,configurable:!0}),"r");const Td=["yarn.lock","package-lock.json","pnpm-lock.yaml","npm-shrinkwrap.json","bun.lockb"],t0=dr(e=>{let t;if(Td.forEach(n=>{!t&&Yh(D(e,n))&&(t=D(e,n))}),t)return t;const r=D(e,"package.json");if(Yh(r)&&Qb(EA(r,"utf8")).packageManager!==void 0)return r},"packageMangerFindUpMatcher"),r0=dr(e=>{if(!e)throw new Bs("Could not find a package manager");if(e.endsWith("package.json")){const t=Qb(e);if(t.packageManager){const r=["npm","yarn","pnpm","bun"].find(n=>t.packageManager.startsWith(n));if(r)return{packageManager:r,path:Je(e)}}}if(e.endsWith("yarn.lock"))return{packageManager:"yarn",path:Je(e)};if(e.endsWith("package-lock.json")||e.endsWith("npm-shrinkwrap.json"))return{packageManager:"npm",path:Je(e)};if(e.endsWith("pnpm-lock.yaml"))return{packageManager:"pnpm",path:Je(e)};if(e.endsWith("bun.lockb"))return{packageManager:"bun",path:Je(e)};throw new Bs("Could not find a package manager")},"resolvePackageManagerFromFile");dr(async e=>{const t=await Do(Td,{type:"file",...e&&{cwd:e}});if(!t)throw new Error("Could not find lock file");return t},"findLockFile");dr(e=>{const t=Co(Td,{type:"file",...e&&{cwd:e}});if(!t)throw new Error("Could not find lock file");return t},"findLockFileSync");const AA=dr(async e=>{const t=await Do(t0,{...e&&{cwd:e}});return r0(t)},"findPackageManager"),xA=dr(e=>{const t=Co(t0,{...e&&{cwd:e}});return r0(t)},"findPackageManagerSync"),
|
|
964
|
+
- `)}`),this.name="PackageJsonValidationError"}};const Tc=tt((e,t,r=[])=>{const n=[];if(Xj(e,s=>{n.push(s)},t),t&&n.length>0){const s=n.filter(i=>!r.some(o=>o instanceof RegExp?o.test(i):o===i));if(s.length>0)throw new gA(s)}return e},"normalizeInput"),yA=tt(async e=>await To(e),"parseYamlFile"),vA=tt(e=>Lt(e),"parseYamlFileSync"),bA=tt(async e=>{const t=await Pp(e);return ob.parse(t)},"parseJson5File"),$A=tt(e=>{const t=H(e);return ob.parse(t)},"parseJson5FileSync"),Yb=tt(async(e,t)=>t?.yaml!==!1&&(e.endsWith(".yaml")||e.endsWith(".yml"))?yA(e):t?.json5!==!1&&e.endsWith(".json5")?bA(e):Eo(e),"parsePackageFile"),Xb=tt((e,t)=>t?.yaml!==!1&&(e.endsWith(".yaml")||e.endsWith(".yml"))?vA(e):t?.json5!==!1&&e.endsWith(".json5")?$A(e):le(e),"parsePackageFileSync");tt(async(e,t={})=>{const r={type:"file"};e&&(r.cwd=e);const n=["package.json"];t.yaml!==!1&&n.push("package.yaml","package.yml"),t.json5!==!1&&n.push("package.json5");let s;for(const c of n)if(s=await Do(c,r),s)break;if(!s)throw new Bs(`No such file or directory, for ${n.join(", ").replace(Jb," or $1")} found.`);const i=t.cache&&typeof t.cache!="boolean"?t.cache:Kb;if(t.cache&&i.has(s))return i.get(s);const o=await Yb(s,t);if(t.resolveCatalogs){const c=await Ub(s);c&&Oc(o,c)}Tc(o,t.strict??!1,t.ignoreWarnings);const a={packageJson:o,path:s};return t.cache&&i.set(s,a),a},"findPackageJson");tt((e,t={})=>{const r={type:"file"};e&&(r.cwd=e);const n=["package.json"];t.yaml!==!1&&n.push("package.yaml","package.yml"),t.json5!==!1&&n.push("package.json5");let s;for(const c of n)if(s=Co(c,r),s)break;if(!s)throw new Bs(`No such file or directory, for ${n.join(", ").replace(Jb," or $1")} found.`);const i=t.cache&&typeof t.cache!="boolean"?t.cache:Kb;if(t.cache&&i.has(s))return i.get(s);const o=Xb(s,t);if(t.resolveCatalogs){const c=Gb(s);c&&Oc(o,c)}Tc(o,t.strict??!1,t.ignoreWarnings);const a={packageJson:o,path:s};return t.cache&&i.set(s,a),a},"findPackageJsonSync");tt(async(e,t={})=>{const{cwd:r,...n}=t,s=Tt(r??process.cwd());await lC(D(s,"package.json"),e,n)},"writePackageJson");tt((e,t={})=>{const{cwd:r,...n}=t,s=Tt(r??process.cwd());wo(D(s,"package.json"),e,n)},"writePackageJsonSync");const Qb=tt((e,t)=>{const r=typeof e=="object"&&!Array.isArray(e);if(!r&&typeof e!="string")throw new TypeError("`packageFile` should be either an `object` or a `string`.");let n,s=!1,i;if(r)n=structuredClone(e);else if(qb(e)){i=e;const a=t?.cache&&typeof t.cache!="boolean"?t.cache:Ua;if(t?.cache&&a.has(i))return a.get(i);n=Xb(i,t),s=!0}else n=Dp(e);if(t?.resolveCatalogs)if(s){const a=Gb(e);a&&Oc(n,a)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");Tc(n,t?.strict??!1,t?.ignoreWarnings);const o=n;return s&&t?.cache&&(typeof t.cache=="boolean"?Ua:t.cache).set(i,o),o},"parsePackageJsonSync");tt(async(e,t)=>{const r=typeof e=="object"&&!Array.isArray(e);if(!r&&typeof e!="string")throw new TypeError("`packageFile` should be either an `object` or a `string`.");let n,s=!1,i;if(r)n=structuredClone(e);else if(qb(e)){i=e;const a=t?.cache&&typeof t.cache!="boolean"?t.cache:Ua;if(t?.cache&&a.has(i))return a.get(i);n=await Yb(i,t),s=!0}else n=Dp(e);if(t?.resolveCatalogs)if(s){const a=await Ub(e);a&&Oc(n,a)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");Tc(n,t?.strict??!1,t?.ignoreWarnings);const o=n;return s&&t?.cache&&(typeof t.cache=="boolean"?Ua:t.cache).set(i,o),o},"parsePackageJson");tt((e,t,r)=>or(e,t,r),"getPackageJsonProperty");tt((e,t)=>Xr(e,t),"hasPackageJsonProperty");tt((e,t,r)=>{const n=or(e,"dependencies",{}),s=or(e,"devDependencies",{}),i=or(e,"peerDependencies",{}),o={...n,...s,...r?.peerDeps===!1?{}:i};for(const a of t)if(Xr(o,a))return!0;return!1},"hasPackageJsonAnyDependency");tt(async(e,t,r="dependencies",n={})=>{const s=or(e,"dependencies",{}),i=or(e,"devDependencies",{}),o=or(e,"peerDependencies",{}),a=[],c={deps:!0,devDeps:!0,peerDeps:!1,...n};for(const l of t)c.deps&&Xr(s,l)||c.devDeps&&Xr(i,l)||c.peerDeps&&Xr(o,l)||a.push(l);if(a.length!==0){if(process.env.CI||hA&&!process.stdout.isTTY){const l=`Skipping package installation for [${t.join(", ")}] because the process is not interactive.`;if(n.throwOnWarn)throw new Error(l);n.logger?.warn?n.logger.warn(l):console.warn(l);return}if(typeof c.confirm?.message=="function"&&(c.confirm.message=c.confirm.message(a)),c.confirm?.message===void 0){const l=`${a.length===1?"Package is":"Packages are"} required for this config: ${a.join(", ")}. Do you want to install them?`;c.confirm===void 0?c.confirm={message:l}:c.confirm.message=l}await fA(c.confirm)&&await By(a,{...c.installPackage,cwd:c.cwd?Tt(c.cwd):void 0,dev:r==="devDependencies"})}},"ensurePackages");var wA=Object.defineProperty,kA=d((e,t)=>wA(e,"name",{value:t,configurable:!0}),"d$u"),SA=Object.defineProperty,Zb=kA((e,t)=>SA(e,"name",{value:t,configurable:!0}),"g");const DA=mt(import.meta.url),Oi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,e0=Zb(e=>{if(typeof Oi<"u"&&Oi.versions&&Oi.versions.node){const[t,r]=Oi.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Oi.getBuiltinModule(e)}return DA(e)},"__cjs_getBuiltinModule"),{execSync:CA}=e0("node:child_process"),{existsSync:Yh,readFileSync:EA}=e0("node:fs");var jA=Object.defineProperty,dr=Zb((e,t)=>jA(e,"name",{value:t,configurable:!0}),"r");const Td=["yarn.lock","package-lock.json","pnpm-lock.yaml","npm-shrinkwrap.json","bun.lockb"],t0=dr(e=>{let t;if(Td.forEach(n=>{!t&&Yh(D(e,n))&&(t=D(e,n))}),t)return t;const r=D(e,"package.json");if(Yh(r)&&Qb(EA(r,"utf8")).packageManager!==void 0)return r},"packageMangerFindUpMatcher"),r0=dr(e=>{if(!e)throw new Bs("Could not find a package manager");if(e.endsWith("package.json")){const t=Qb(e);if(t.packageManager){const r=["npm","yarn","pnpm","bun"].find(n=>t.packageManager.startsWith(n));if(r)return{packageManager:r,path:Je(e)}}}if(e.endsWith("yarn.lock"))return{packageManager:"yarn",path:Je(e)};if(e.endsWith("package-lock.json")||e.endsWith("npm-shrinkwrap.json"))return{packageManager:"npm",path:Je(e)};if(e.endsWith("pnpm-lock.yaml"))return{packageManager:"pnpm",path:Je(e)};if(e.endsWith("bun.lockb"))return{packageManager:"bun",path:Je(e)};throw new Bs("Could not find a package manager")},"resolvePackageManagerFromFile");dr(async e=>{const t=await Do(Td,{type:"file",...e&&{cwd:e}});if(!t)throw new Error("Could not find lock file");return t},"findLockFile");dr(e=>{const t=Co(Td,{type:"file",...e&&{cwd:e}});if(!t)throw new Error("Could not find lock file");return t},"findLockFileSync");const AA=dr(async e=>{const t=await Do(t0,{...e&&{cwd:e}});return r0(t)},"findPackageManager"),xA=dr(e=>{const t=Co(t0,{...e&&{cwd:e}});return r0(t)},"findPackageManagerSync"),eJ=dr(e=>CA(`${e} --version`).toString("utf8").trim(),"getPackageManagerVersion");dr(()=>{if(!process.env.npm_config_user_agent)return;const e=process.env.npm_config_user_agent.split(" ")[0],t=e.lastIndexOf("/"),r=e.slice(0,Math.max(0,t));return{name:r==="npminstall"?"cnpm":r,version:e.slice(Math.max(0,t+1))}},"identifyInitiatingPackageManager");dr((e,t,r)=>{const n=t.length===1?"":"s";if(r.packageManagers??=["npm","pnpm","yarn"],r.packageManagers.length===0)throw new Error("No package managers provided, please provide at least one package manager");if(t.length===0)throw new Error("No missing packages provided, please provide at least one missing package");let s=`
|
|
965
965
|
${r.preMessage??""}
|
|
966
966
|
${e} could not find the following package${n}
|
|
967
967
|
|
|
@@ -973,16 +973,16 @@ To install the missing package${n}, please run the following command:
|
|
|
973
973
|
|
|
974
974
|
or
|
|
975
975
|
|
|
976
|
-
`),r.postMessage&&(s+=r.postMessage),s},"generateMissingPackagesInstallMessage");var OA=Object.defineProperty,PA=d((e,t)=>OA(e,"name",{value:t,configurable:!0}),"c$C"),FA=Object.defineProperty,n0=PA((e,t)=>FA(e,"name",{value:t,configurable:!0}),"p");const BA=mt(import.meta.url),Pi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,RA=n0(e=>{if(typeof Pi<"u"&&Pi.versions&&Pi.versions.node){const[t,r]=Pi.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Pi.getBuiltinModule(e)}return BA(e)},"__cjs_getBuiltinModule"),{existsSync:Ga,readFileSync:s0}=RA("node:fs");var TA=Object.defineProperty,i0=n0((e,t)=>TA(e,"name",{value:t,configurable:!0}),"i");i0(async e=>{const t=await Do(["lerna.json","turbo.json"],{type:"file",...e&&{cwd:e}});if(t?.endsWith("lerna.json")){const n=await Eo(t);if(n&&typeof n=="object"&&!Array.isArray(n)){const s=n;if(s.useWorkspaces||s.packages)return{path:Je(t),strategy:"lerna"}}}const r=t?.endsWith("turbo.json");try{const{packageManager:n,path:s}=await AA(e);if(["npm","yarn"].includes(n)){const i=D(s,"package.json");if(Ga(i)&&s0(D(s,"package.json"),"utf8").includes("workspaces"))return{path:s,strategy:r?"turbo":n}}else if(n==="pnpm"){const i=D(s,"pnpm-workspace.yaml");if(Ga(i))return{path:s,strategy:r?"turbo":"pnpm"}}}catch(n){if(!(n instanceof Bs))throw n}throw new Error(`No monorepo root could be found upwards from the directory ${e} using lerna, yarn, pnpm, or npm as indicators.`)},"findMonorepoRoot");const o0=i0(e=>{const t=Co(["lerna.json","turbo.json"],{type:"file",...e&&{cwd:e}});if(t?.endsWith("lerna.json")){const n=le(t);if(n.useWorkspaces||n.packages)return{path:Je(t),strategy:"lerna"}}const r=t?.endsWith("turbo.json");try{const{packageManager:n,path:s}=xA(e);if(["npm","yarn"].includes(n)){const i=D(s,"package.json");if(Ga(i)&&s0(D(s,"package.json"),"utf8").includes("workspaces"))return{path:s,strategy:r?"turbo":n}}else if(n==="pnpm"){const i=D(s,"pnpm-workspace.yaml");if(Ga(i))return{path:s,strategy:r?"turbo":"pnpm"}}}catch(n){if(!(n instanceof Bs))throw n}throw new Error(`No monorepo root could be found upwards from the directory ${e} using lerna, yarn, pnpm, or npm as indicators.`)},"findMonorepoRootSync");var NA=Object.defineProperty,IA=d((e,t)=>NA(e,"name",{value:t,configurable:!0}),"e$_");const LA={argument:{description:"Target selector (same syntax as `vis run`): `build`, `:build`, `~:test`, `#tag:lint`, …",name:"selector",type:String},description:"Show the execution plan for a target without running it",examples:[["vis action-graph build","Print the task plan for `build` on every project"],["vis action-graph :test","Moon-style selector"],["vis action-graph build --json","Emit a JSON description of the plan"],['vis action-graph lint --query "tag=frontend"',"Filter projects by query"]],group:"Workspace",loader:IA(()=>import("./handler.js"),"loader"),name:"action-graph",options:[{defaultValue:!1,description:"Emit JSON instead of ASCII",name:"json",type:Boolean},{description:"Filter matched projects by a query",name:"query",type:String}]};var _A=Object.defineProperty,MA=d((e,t)=>_A(e,"name",{value:t,configurable:!0}),"e$Z");const WA={argument:{description:"Packages to add (e.g., react react-dom)",name:"packages",type:String},description:"Add packages using the detected package manager",examples:[["vis add react react-dom","Add packages"],["vis add -D typescript @types/react","Add as dev dependencies"],["vis add react --filter app","Add to specific workspace package"],["vis add react --to web","Add to one package, auto-conforming the version to existing catalogs / sibling deps"],["vis add -g typescript","Add globally (uses npm)"],["vis add lodash -w","Add to workspace root"],["vis add lodash --no-socket-check","Add without Socket.dev check"],["vis add lodash --no-typosquat-check","Skip typosquat name check"],["vis add lodash --no-marshall-check","Skip the offline marshall pipeline (author, downloads, etc.)"],["vis add lodash --run-scripts","Run lifecycle scripts (opts out of vis's default block-by-default policy)"]],group:"Dependencies",loader:MA(()=>import("./handler17.js"),"loader"),name:"add",options:[{alias:"D",defaultValue:!1,description:"Add as dev dependency",name:"save-dev",type:Boolean},{alias:"E",defaultValue:!1,description:"Save exact version",name:"exact",type:Boolean},{alias:"P",defaultValue:!1,description:"Add as peer dependency",name:"save-peer",type:Boolean},{alias:"O",defaultValue:!1,description:"Add as optional dependency",name:"save-optional",type:Boolean},{alias:"g",defaultValue:!1,description:"Install globally (uses npm)",name:"global",type:Boolean},{alias:"w",defaultValue:!1,description:"Add to workspace root",name:"workspace-root",type:Boolean},{defaultValue:!1,description:"Use workspace protocol (pnpm)",name:"workspace",type:Boolean},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String},{description:"Target a single workspace package and auto-conform the version to existing catalogs / sibling deps (syncpack#285)",name:"to",type:String},{defaultValue:!1,description:"Skip typosquat name check before adding",name:"no-typosquat-check",type:Boolean},{defaultValue:!1,description:"Skip Socket.dev security check before adding",name:"no-socket-check",type:Boolean},{defaultValue:!1,description:"Skip the offline marshall pipeline (author, provenance, metadata, downloads, expired-domains, new-bin, signatures, archived-repo)",name:"no-marshall-check",type:Boolean},{defaultValue:!1,description:"Run lifecycle scripts during add (opts out of vis's default block-by-default policy; allowlisted packages run via security.policies.installScripts.allow)",name:"run-scripts",type:Boolean},{defaultValue:!1,description:"After adding, recursively install non-optional peer dependencies that aren't already in the workspace (matches nypm's installPeerDependencies)",name:"auto-install-peers",type:Boolean}]},Nd={description:"Override the cache DB path (defaults to <cache>/vis/advisories/db.sqlite via @visulima/find-cache-dir).",name:"db",type:String},Lo={description:"Output format: table (default) or json.",name:"format",type:String},VA={commandPath:["advisories"],description:"Download and ingest one or more OSV ecosystem dumps into the local cache",examples:[["vis advisories sync","Sync the npm ecosystem (default)"],["vis advisories sync --ecosystem npm","Sync a single explicit ecosystem"],["vis advisories sync --ecosystem npm,PyPI","Sync several ecosystems in one pass"],["vis advisories sync --force","Re-download even when the ETag matches"],["vis advisories sync --source https://mirror.example.com","Use a corporate OSV mirror (must be in allowedHosts)"]],group:"Security & Health",loader:Se(()=>import("./sync.js"),"advisoriesSyncExecute"),name:"sync",options:[{description:"Comma-separated list of ecosystems to sync (default: npm).",name:"ecosystem",type:String},{defaultValue:!1,description:"Re-download and re-ingest even if the upstream ETag is unchanged.",name:"force",type:Boolean},{description:"Override the advisory source URL. Must be https and resolve to an allowed host.",name:"source",type:String},Nd,Lo]},UA={commandPath:["advisories"],description:"Print the local advisory DB summary: path, schema version, ecosystems, row counts, last sync, ETag",examples:[["vis advisories status","Human-readable summary"],["vis advisories status --format json","Machine-readable for CI freshness checks"]],group:"Security & Health",loader:Se(()=>import("./status.js"),"advisoriesStatusExecute"),name:"status",options:[Nd,Lo]},GA={commandPath:["advisories"],description:"Delete the local advisory DB. The next `vis audit --offline` will fail until you re-sync",examples:[["vis advisories prune","Confirm and delete the local DB"],["vis advisories prune --force","Delete without confirmation"]],group:"Security & Health",loader:Se(()=>import("./prune.js"),"advisoriesPruneExecute"),name:"prune",options:[Nd,{defaultValue:!1,description:"Skip the confirmation prompt.",name:"force",type:Boolean},Lo]},a0={description:"Override the bloom cache directory (defaults to <cache>/vis/osv-bloom/).",name:"cache-dir",type:String},qA={commandPath:["advisories","bloom"],description:"Fetch and verify the endevco/osv-bloom MAL-* prefilter into the local cache",examples:[["vis advisories bloom sync","Fetch the bloom filter from the default upstream"],["vis advisories bloom sync --force","Re-download even when the set digest matches"],["vis advisories bloom sync --source https://bloom.example.com","Use an internal mirror (must be in allowedHosts)"]],group:"Security & Health",loader:Se(()=>import("./bloom-sync.js"),"advisoriesBloomSyncExecute"),name:"sync",options:[{defaultValue:!1,description:"Re-download and re-verify even when the upstream set digest is unchanged.",name:"force",type:Boolean},{description:"Override the bloom source URL. Must be https and resolve to an allowed host.",name:"source",type:String},a0,Lo]},HA={commandPath:["advisories","bloom"],description:"Print the local osv-bloom cache freshness: built-at, filter size, m/k parameters, set digest",examples:[["vis advisories bloom status","Human-readable summary"],["vis advisories bloom status --format json","Machine-readable for CI freshness checks"]],group:"Security & Health",loader:Se(()=>import("./bloom-status.js"),"advisoriesBloomStatusExecute"),name:"status",options:[a0,Lo]},zA=[VA,UA,GA,qA,HA];var JA=Object.defineProperty,KA=d((e,t)=>JA(e,"name",{value:t,configurable:!0}),"e$Y");const YA={argument:{description:"The target to run (e.g., build, test, lint)",name:"target",type:String},description:"Run a target only on projects affected by recent changes",examples:[["vis affected build","Run build on affected projects"],["vis affected test --base=main","Run tests on projects changed since main"],["vis affected destroy --reverse","Tear down affected projects leaves-first"],["vis affected build --sparse-checkout","Print a git sparse-checkout cone set for the affected projects and exit"]],group:"Run & Execute",loader:KA(()=>import("./handler2.js"),"loader"),name:"affected",options:[{description:"Git base ref for comparison. When omitted, vis auto-resolves it from the active CI provider (GitHub/GitLab/Buildkite/CircleCI) or falls back to `git merge-base HEAD origin/<defaultBase>` locally. Default base branch comes from `vis.config.ts#defaultBase` (or `main`).",name:"base",type:String},{description:"Git head ref for comparison. When omitted, auto-resolves from CI env (e.g. `$GITHUB_SHA`) or defaults to `HEAD`.",name:"head",type:String},{defaultValue:"deep",description:'Downstream scope: "none", "direct", or "deep" — controls how far to include dependents of changed projects',name:"downstream",type:String},{defaultValue:"none",description:'Upstream scope: "none", "direct", or "deep" — controls how far to include dependencies of changed projects',name:"upstream",type:String},{defaultValue:3,description:"Maximum number of parallel tasks",name:"parallel",type:Number},{defaultValue:!0,description:"Enable caching (use --no-cache to disable)",name:"cache",type:Boolean},{defaultValue:!1,description:"Show what would run without executing",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Instead of running, print the affected project roots as a git sparse-checkout cone set (one path per line) and exit. Pipe into `git sparse-checkout set --stdin` to shrink huge-monorepo CI checkouts.",name:"sparse-checkout",type:Boolean},{description:'Partition tasks for distributed CI (e.g., "1/4" for first of four runners). Falls back to VIS_PARTITION env var.',name:"partition",type:String},{description:"Filter affected projects by a query (e.g. 'language=typescript && tag=lib')",name:"query",type:String},{defaultValue:!1,description:"Run the dependency graph in reverse (leaves first, then their dependents). Useful for teardown targets like `destroy`/`undeploy` where dependents must run before the things they depend on.",name:"reverse",type:Boolean},{description:"Comma-separated tags this runner advertises (e.g. 'gpu,slow'). Forwarded verbatim to the downstream `vis run` so capability-gated tasks resolve identically. Falls back to VIS_RUNNER_TAGS env var.",name:"runner-tags",type:String}]},c0={description:"Output format: table or json (default: table)",name:"format",type:String},XA={commandPath:["ai"],description:"List detected AI providers and show which one is selected",examples:[["vis ai providers","List all AI providers and their status"],["vis ai providers --format json","Output as JSON"]],group:"System",loader:Se(()=>import("./handler30.js"),"aiProvidersExecute"),name:"providers",options:[c0]},QA={commandPath:["ai"],description:"Test the best available AI provider with a quick prompt",examples:[["vis ai test","Test the selected provider"]],group:"System",loader:Se(()=>import("./handler30.js"),"aiTestExecute"),name:"test",options:[]},ZA={argument:{description:"Task ID to propose a fix for (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["ai"],description:"Read a failed task's logs and propose a structured patch (Phase 1: local-only, no git)",examples:[["vis ai fix @myorg/app:build","Print proposed patch for the failed task"],["vis ai fix @myorg/app:build --apply","Apply the patch to disk after confirming"],["vis ai fix @myorg/app:build --format json","Machine-readable patch output"],["vis ai fix @myorg/app:build --run 2026-04-28T...","Inspect a specific historical run"]],group:"System",loader:Se(()=>import("./handler30.js"),"aiFixExecute"),name:"fix",options:[c0,{description:"Use a specific run ID from .vis/runs/ instead of the latest run",name:"run",type:String},{defaultValue:!1,description:"Apply the proposed patch to disk after printing it",name:"apply",type:Boolean},{defaultValue:!1,description:"Bypass the AI response cache",name:"no-cache",type:Boolean},{defaultValue:!1,description:"Skip the confirmation prompt before applying",name:"yes",type:Boolean}]},ex={description:"AI-assisted commands: provider detection and failure-fix proposals (cache management lives under `vis cache`)",examples:[["vis ai","List all AI subcommands"],["vis ai discover-help","Machine-readable subcommand catalogue (for AI agents)"]],group:"System",loader:Se(()=>import("./handler30.js"),"aiRootExecute"),name:"ai",options:[]},tx={commandPath:["ai"],description:"Print the machine-readable AI subcommand catalogue (JSON to stdout, designed for AI agents)",examples:[["vis ai discover-help","Emit the discovery payload as JSON"],["vis ai discover-help | jq '.subcommands[].path'","List all available paths"]],group:"System",loader:Se(()=>import("./handler30.js"),"aiDiscoverHelpExecute"),name:"discover-help",options:[]},rx={commandPath:["ai"],description:"Diagnose the most recent failed task and post a structured patch as a PR/MR comment (or Buildkite annotation)",examples:[["vis ai heal","Heal the most recent failure"],["vis ai heal --dry-run","Propose a patch but skip apply / validate / post"],["vis ai heal --run 2026-04-28T...","Heal a specific historical run"]],group:"System",loader:Se(()=>import("./heal.js").then(e=>e.h),"aiHeal"),name:"heal",options:[{defaultValue:!1,description:"Show the proposal and exit without applying or posting it",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Bypass the AI response cache",name:"no-cache",type:Boolean},{description:"Use a specific run ID from .vis/runs/ instead of the latest run",name:"run",type:String},{description:"Per-task validation timeout in seconds (default: 1800)",name:"validation-timeout",type:Number}]},nx={commandPath:["ai","heal"],description:"Re-run the proposed fix and commit it to the PR/MR branch when validation passes",examples:[["vis ai heal accept","Triggered automatically by a `/vis heal accept` PR comment (GitHub/GitLab) or a Buildkite block-step unblock"]],group:"System",loader:Se(()=>import("./heal-accept.js"),"aiHealAccept"),name:"accept",options:[{description:"Use a specific run ID from .vis/runs/ instead of the latest run",name:"run",type:String},{description:"Per-task validation timeout in seconds (default: 1800)",name:"validation-timeout",type:Number}]},l0=[ex,tx,XA,QA,ZA,rx,nx],zz=Object.defineProperty({__proto__:null,default:l0},Symbol.toStringTag,{value:"Module"});var sx=Object.defineProperty,ix=d((e,t)=>sx(e,"name",{value:t,configurable:!0}),"e$X");const ox={argument:{description:"Package name to analyze (e.g., react)",name:"package",required:!0,type:String},description:"Analyze a single package update with AI",examples:[["vis analyze react","Analyze updating react to latest"],["vis analyze react 19.0.0","Analyze updating react to specific version"],["vis analyze react --ai-type security","Run security-focused analysis"],["vis analyze react --format json","Output as JSON"]],group:"System",loader:ix(()=>import("./handler3.js"),"loader"),name:"analyze",options:[{description:"AI analysis type: impact, security, compatibility, or recommend (default: impact)",name:"ai-type",type:String},{defaultValue:!1,description:"Check for known security vulnerabilities",name:"security",type:Boolean},{description:"Output format: table or json (default: table)",name:"format",type:String}]};var ax=Object.defineProperty,cx=d((e,t)=>ax(e,"name",{value:t,configurable:!0}),"e$W");const lx={description:"Review and approve dependencies with build scripts",examples:[["vis approve-builds","Scan and list unapproved build scripts"],["vis approve-builds --all","Approve all pending builds (pnpm)"],["vis approve-builds --write","Write unapproved entries into vis.config.ts security.policies.installScripts.allow"],["vis approve-builds --sync-native","Sync allowBuilds to native PM config"]],group:"Security & Health",loader:cx(()=>import("./handler31.js"),"loader"),name:"approve-builds",options:[{defaultValue:!1,description:"Approve all pending builds without prompting (pnpm only)",name:"all",type:Boolean},{defaultValue:!1,description:"Force vis scanning even for pnpm (instead of delegating)",name:"scan",type:Boolean},{defaultValue:!1,description:"Sync allowBuilds to native PM config (bun: trustedDependencies, npm: .npmrc, yarn: .yarnrc.yml)",name:"sync-native",type:Boolean},{defaultValue:!1,description:"Write unapproved entries directly into vis.config.ts security.policies.installScripts.allow (LavaMoat 'auto' parity)",name:"write",type:Boolean}]},u0={description:"Output format: table, json, or ndjson (default: table). json/ndjson go to stdout, logs to stderr.",name:"format",type:String},ux={commandPath:["attest"],description:"Verify inbound provenance + registry signatures across the locked dependency graph and gate on regressions",examples:[["vis attest verify","Check every locked dep for provenance regressions and signature problems"],["vis attest verify --prod-only","Skip devDependencies"],["vis attest verify --format json","Machine-readable findings for CI (Axis A)"],["vis attest verify --fail-on error","Exit non-zero only on error-severity findings (default: any finding)"]],group:"Security & Health",loader:Se(()=>import("./handler4.js"),"attestVerifyExecute"),name:"verify",options:[u0,{defaultValue:!1,description:"Skip devDependencies — verify the production graph only.",name:"prod-only",type:Boolean},{description:"Severity that triggers a non-zero exit: 'warning' (any finding, default) or 'error'.",name:"fail-on",type:String},{description:"Comma-separated package names to exclude from both marshalls.",name:"allowlist",type:String}]},px={argument:{description:"Path to the built artifact to attest (e.g. dist/app.tgz). Its sha256 becomes the in-toto subject digest.",name:"subject",type:String},description:"Build an in-toto SLSA v1 provenance statement for an artifact and keyless-sign it via Sigstore",examples:[["vis attest dist/app.tgz","Emit dist/app.tgz.sigstore (keyless-signed in CI)"],["vis attest dist/app.tgz --output attest.sigstore","Write the bundle to a specific path"],["vis attest dist/app.tgz --predicate slsaProvenance","Predicate type (default: slsaProvenance)"],["vis attest dist/app.tgz --require-signing","Fail instead of skip-with-warn when no ambient OIDC (outside CI)"],["vis attest dist/app.tgz --format json","Print the signed bundle summary as JSON (Axis A)"]],group:"Security & Health",loader:Se(()=>import("./handler4.js"),"attestEmitExecute"),name:"attest",options:[u0,{description:"Write the serialized Sigstore bundle here (default: <subject>.sigstore).",name:"output",type:String},{description:"Predicate type: 'slsaProvenance' (default, https://slsa.dev/provenance/v1).",name:"predicate",type:String},{defaultValue:!1,description:"Error instead of skip-with-warn when no ambient OIDC token is available (i.e. outside CI).",name:"require-signing",type:Boolean}]},dx=[px,ux];var fx=Object.defineProperty,hx=d((e,t)=>fx(e,"name",{value:t,configurable:!0}),"e$V");const mx={description:"Audit installed packages for vulnerabilities and supply chain risks",examples:[["vis audit","Full audit of all installed packages"],["vis audit --severity high","Show only high/critical issues"],["vis audit --format json","Output as JSON for CI integration"],["vis audit --format sarif","Output SARIF 2.1.0 for code-scanning uploads"],["vis audit --format csaf","Output CSAF 2.0 csaf_vex for enterprise vuln pipelines"],["vis audit --format cyclonedx-vex","Output a CycloneDX 1.7 BOM with vulnerabilities[] (SBOM + VEX)"],["vis audit --format gitlab","Output a GitLab dependency-scanning report (gl-dependency-scanning.json)"],["vis audit --format junit","Output a Surefire-compatible JUnit XML report"],["vis audit --report report.html","Write a self-contained HTML report to ./report.html"],["vis audit --usage","Only report vulnerabilities in statically-imported packages"],["vis audit --offline","Query the local OSV cache only (no network)"],["vis audit --offline --db ./vendor.sqlite","Use a specific advisory DB"],["vis audit --ecosystem npm,pypi","Scan multiple OSV ecosystems (npm, pypi, crates.io, maven, go, rubygems)"],["vis audit --prod-only","Skip devDependencies"],["vis audit --fail-on high","Exit non-zero on any high or critical finding"],["vis audit --show-fixes","Print fix-suggestion lines (no apply, no rescan)"],["vis audit --fix","Apply direct-dep upgrades for vulnerable packages, then rescan (dry-run preview by default)"],["vis audit --fix --yes","Skip the confirmation prompt and run the upgrades immediately"],["vis audit --fix --allow-major","Permit major-version bumps when the lowest fix is outside the existing range"],["vis audit --fix-transitive","Write PM-specific overrides for vulnerable transitives (dry-run preview by default)"],["vis audit --exit-code","Exit with code 1 if issues found (for CI)"],["vis audit --show-accepted","Include acknowledged risks in output"],["vis audit --sync","Sync accepted risks to native PM config (pnpm-workspace.yaml / .yarnrc.yml)"],["vis audit --policies license,vulnerability","Run only the named policies (default: every configured policy)"],["vis audit --policies none","Skip the policy engine entirely"],["vis audit --explain","Add a plain-English AI explanation under every finding (auto-detects an installed AI CLI)"],["vis audit --explain CVE-2021-23337","Explain only the finding with this CVE/GHSA id"],["vis audit --explain 2","Explain only the 2nd finding"]],group:"Security & Health",loader:hx(()=>import("./handler44.js"),"loader"),name:"audit",options:[{description:"Minimum severity to report: low, medium, high, critical (default: low)",name:"severity",type:String},{description:"Output format: table, json, sarif, csaf, cyclonedx-vex, gitlab, or junit (default: table)",name:"format",type:String},{description:"Write a self-contained HTML report to this path. Auto-opens in a TTY when not in CI.",name:"report",type:String},{defaultValue:!1,description:"Only report vulnerabilities in statically-imported packages (reachability filter).",name:"usage",type:Boolean},{defaultValue:!1,description:"Disable the reachability filter even if enabled in config.",name:"no-usage",type:Boolean},{defaultValue:!1,description:"Query the local OSV advisory cache only — no network calls. Errors if the cache is missing.",name:"offline",type:Boolean},{description:"Override the offline advisory DB path (default: <cache>/vis/advisories/db.sqlite).",name:"db",type:String},{description:"Comma-separated list of OSV ecosystems to scan (default: npm). Supported: npm, pypi, crates.io (or 'cargo'), maven, go, rubygems. Non-npm ecosystems require --offline (online OSV path is npm-only).",name:"ecosystem",type:String},{defaultValue:!1,description:"Skip devDependencies — scan production graph only.",name:"prod-only",type:Boolean},{description:"Exit non-zero when any finding is at this severity or higher. One of: low, medium, high, critical.",name:"fail-on",type:String},{defaultValue:!1,description:"Print fix-suggestion lines for each finding (no apply, no rescan)",name:"show-fixes",type:Boolean},{defaultValue:!1,description:"Apply direct-dep fixes for vulnerable packages by running the active PM update command, then rescan",name:"fix",type:Boolean},{defaultValue:!1,description:"Apply transitive fixes by writing PM-specific overrides (pnpm-workspace.yaml / package.json overrides / resolutions)",name:"fix-transitive",type:Boolean},{defaultValue:!1,description:"Skip confirmation prompt for --fix / --fix-transitive (required in CI)",name:"yes",type:Boolean},{defaultValue:!1,description:"Allow --fix to bump a direct dep across a major version when the lowest fix is outside the existing range",name:"allow-major",type:Boolean},{defaultValue:!1,description:"Exit with code 1 if any issues found (for CI)",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Include acknowledged (accepted risk) issues in output",name:"show-accepted",type:Boolean},{defaultValue:!1,description:"Sync vis accepted risks to native PM config (pnpm-workspace.yaml / .yarnrc.yml)",name:"sync",type:Boolean},{description:"Comma-separated list of supply-chain policies to evaluate (default: every configured policy). Use 'none' to skip the engine entirely, 'all' to force the full set. Known: malware, firstSeen, unexpectedDeps, publisherChange, installScripts, score, vulnerability, license.",name:"policies",type:String},{description:"Audit backend: 'auto' (default, delegates to 'aube audit' when aube is the installer), 'aube' (force delegate), or 'vis' (always use vis's OSV/Socket scanner).",name:"backend",type:String},{description:"Add a plain-English AI explanation to findings. Bare flag explains all findings at/above --severity; pass a finding index (e.g. 2) or a CVE/GHSA id to explain just one. Auto-detects an installed AI CLI; mutually exclusive with --offline.",name:"explain",type:String}]},_o={description:"Cache directory (overrides config and default). Relative paths are resolved against the workspace root.",name:"cache-dir",type:String},Nc={description:"Cache scope: 'shared' (default — main worktree's cache), 'worktree' (this checkout's local cache), or 'all' (both)",name:"scope",type:String},p0={description:"Cache type: 'task' (workspace task cache), 'ai' (AI response cache), 'socket' (Socket.dev reports), 'deps-dev' (Google deps.dev reports), or 'all' (default)",name:"type",type:String},gx={commandPath:["cache"],description:"List all cache entries",examples:[["vis cache list","List all cache entries"]],group:"Workspace",loader:Se(()=>Promise.resolve().then(()=>ls),"cacheListExecute"),name:"list",options:[_o,Nc,{description:"Output format: table or json (default: table)",name:"format",type:String}]},yx={commandPath:["cache"],description:"Remove cache entries (defaults to all stores: workspace task cache, AI responses, Socket.dev reports)",examples:[["vis cache clean","Remove all cache entries from every store"],["vis cache clean --type=ai","Clear only the AI response cache"],["vis cache clean --type=task","Clear only the workspace task cache"],["vis cache clean --dry-run","Preview what clean would remove"]],group:"Workspace",loader:Se(()=>Promise.resolve().then(()=>ls),"cacheCleanExecute"),name:"clean",options:[_o,p0,{defaultValue:!1,description:"Preview without deleting",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Skip the confirmation prompt for out-of-workspace cache directories",name:"force",type:Boolean}]},vx={commandPath:["cache"],description:"Remove old and oversized cache entries",examples:[["vis cache prune","Remove old and oversized entries"],["vis cache prune --max-age-days=3 --max-size=500MB","Prune with custom limits"],["vis cache prune --keep-last=30","Keep only the 30 most recent entries"]],group:"Workspace",loader:Se(()=>Promise.resolve().then(()=>ls),"cachePruneExecute"),name:"prune",options:[_o,Nc,{description:"Remove entries older than N days",name:"max-age-days",type:Number},{description:"Evict oldest entries until cache is under this size (e.g. 500MB)",name:"max-size",type:String},{description:"Keep only the N most recent entries (sorted newest-first by mtime)",name:"keep-last",type:Number}]},bx={commandPath:["cache"],description:"Print on-disk footprint and stats for one or more cache stores (task / ai / socket)",examples:[["vis cache size","Show stats for every cache store"],["vis cache size --type=ai","Show only the AI response cache (entries, size, oldest, newest)"],["vis cache size --type=task --format=json","Machine-readable task cache size"]],group:"Workspace",loader:Se(()=>Promise.resolve().then(()=>ls),"cacheSizeExecute"),name:"size",options:[_o,Nc,p0,{description:"Output format: table or json (default: table)",name:"format",type:String}]},Id={description:"Output format: table or json (default: table)",name:"format",type:String},d0={description:"Use a specific run ID from .vis/runs/ instead of the latest run",name:"run",type:String},$x={argument:{description:"Task ID to explain (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["cache"],description:"Explain why a task missed the cache by diffing hash inputs against the previous run",examples:[["vis cache why @myorg/app:build","Show which inputs changed since the last run"],["vis cache why @myorg/app:build --json","Machine-readable output for CI"],["vis cache why @myorg/app:build --run 2026-04-28T...","Inspect a specific historical run"]],group:"Workspace",loader:Se(()=>Promise.resolve().then(()=>ls),"cacheWhyExecute"),name:"why",options:[Id,d0]},wx={argument:{description:"Task ID to print the hash for (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["cache"],description:"Print the recorded hash and per-input hash details for a task",examples:[["vis cache hash @myorg/app:build","Show the resolved hash + contributing inputs"],["vis cache hash @myorg/app:build --json","Machine-readable output"]],group:"Workspace",loader:Se(()=>Promise.resolve().then(()=>ls),"cacheHashExecute"),name:"hash",options:[Id,d0]},kx={argument:{description:"Task ID to verify (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["cache"],description:"Verify cache restore fidelity: extract the cached entry into a tmp directory and diff each file's content, mode, and mtime against the live workspace. Exits 1 on any drift (changed content, mode, mtime) or if a cached output is missing from the workspace. With --scope=all, the first cache directory containing the task is used.",examples:[["vis cache verify @myorg/app:build","Diff cached outputs vs live workspace files"],["vis cache verify @myorg/app:build --format=json","Machine-readable diff (status: ok | drift)"],["vis cache verify @myorg/app:build --cache-dir=.alt-cache","Verify against a non-default cache directory"],["vis cache verify @myorg/app:build --scope=all","Search shared and worktree caches for the task"]],group:"Workspace",loader:Se(()=>Promise.resolve().then(()=>ls),"cacheVerifyExecute"),name:"verify",options:[_o,Nc,Id]},Sx={commandPath:["cache"],description:"Probe the configured remote cache (HTTP HEAD or REAPI Capabilities) and report reachability, latency, and negotiated capabilities",examples:[["vis cache doctor","Probe the remoteCache configured in vis.config.ts"],["vis cache doctor --url=grpcs://cache.example.com:443 --backend=reapi","Override URL/backend ad-hoc"],["vis cache doctor --json","Machine-readable output"]],group:"Workspace",loader:Se(()=>import("./doctor-probe.js"),"cacheDoctorExecute"),name:"doctor",options:[{description:"Override remote cache URL (otherwise read from vis.config.ts remoteCache.url, or TURBO_API env var)",name:"url",type:String},{description:"Override backend selector: 'http' or 'reapi'",name:"backend",type:String},{description:"Output format: table or json (default: table)",name:"format",type:String},{defaultValue:5e3,description:"Probe timeout in milliseconds (default: 5000)",name:"timeout",type:Number}]},Dx=[gx,yx,vx,bx,$x,wx,kx,Sx];var Cx=Object.defineProperty,Ex=d((e,t)=>Cx(e,"name",{value:t,configurable:!0}),"e$U");const jx={alias:["c","outdated"],argument:{description:"Specific packages to check (checks all if omitted)",name:"packages",type:String},description:"Check for outdated dependencies, security vulnerabilities, and supply chain settings",examples:[["vis check","Check all catalog dependencies"],["vis check react","Check specific packages"],["vis check --target minor","Only show minor/patch updates"],["vis check --exclude '@types/*'","Exclude packages by pattern"],["vis check --no-security","Skip vulnerability scanning"],["vis check --security-config","Audit supply chain security settings"],["vis check --security-config --sync","Sync security config to pnpm-workspace.yaml"]],group:"Security & Health",loader:Ex(()=>import("./handler5.js"),"loader"),name:"check",options:[{alias:"t",description:"Update target: latest, minor, or patch (default: latest)",name:"target",type:String},{description:"Glob pattern to include packages (repeatable)",lazyMultiple:!0,name:"include",type:String},{description:"Glob pattern to exclude packages (repeatable)",lazyMultiple:!0,name:"exclude",type:String},{defaultValue:!1,description:"Include prerelease versions",name:"prerelease",type:Boolean},{defaultValue:!1,description:"Skip security vulnerability scanning",name:"no-security",type:Boolean},{defaultValue:!1,description:"Audit supply chain security settings",name:"security-config",type:Boolean},{defaultValue:!1,description:"Sync security settings to pnpm-workspace.yaml (pnpm only, requires --security-config)",name:"sync",type:Boolean},{description:"Output format: table, json, or minimal (default: table)",name:"format",type:String},{defaultValue:!1,description:"Exit with code 1 if outdated dependencies found (for CI)",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Run AI analysis on outdated packages",name:"ai",type:Boolean},{description:"AI analysis type: impact, security, compatibility, or recommend",name:"ai-type",type:String},{alias:"D",conflicts:"prod",description:"Check only devDependencies (npm/yarn mode)",name:"dev",type:Boolean},{alias:"P",conflicts:"dev",description:"Check only dependencies (npm/yarn mode)",name:"prod",type:Boolean},{defaultValue:!1,description:"Include peerDependencies in outdated checks",name:"peer",type:Boolean},{defaultValue:!1,description:"Also check workspace-owned package names against the registry",name:"include-internal",type:Boolean}]};var Ax=Object.defineProperty,xx=d((e,t)=>Ax(e,"name",{value:t,configurable:!0}),"e$T");const Ox={argument:{description:"Comma-separated list of targets to run (e.g., lint,test,build)",name:"targets",type:String},description:"Run affected targets in a CI-optimized pipeline",examples:[["vis ci lint,test,build","Run lint, test, and build on affected projects"],["vis ci test --base=origin/main","Override the base ref"],["vis ci build --no-install","Skip the install step (assume deps already present)"],["vis ci build --parallel=6","Increase concurrency"]],group:"Run & Execute",loader:xx(()=>import("./handler6.js"),"loader"),name:"ci",options:[{defaultValue:!0,description:"Install dependencies before running targets (use --no-install to skip)",name:"install",type:Boolean},{defaultValue:!1,description:"Skip the toolchain pre-flight (no auto-install for any pinned tool: node / pnpm / yarn / npm / bun / deno / go / python / ruby / rust)",name:"skip-toolchain",type:Boolean},{description:"Git base ref for affected detection (default: auto-detected from CI env)",name:"base",type:String},{description:"Git head ref for affected detection (default: HEAD)",name:"head",type:String},{defaultValue:"none",description:"Upstream scope: none | direct | deep",name:"upstream",type:String},{defaultValue:"deep",description:"Downstream scope: none | direct | deep",name:"downstream",type:String},{defaultValue:4,description:"Maximum number of parallel tasks per target",name:"parallel",type:Number},{description:'Partition tasks for distributed CI (e.g., "1/4")',name:"partition",type:String},{description:"Filter affected projects by a query (e.g. 'language=typescript && tag=lib')",name:"query",type:String}]};var Px=Object.defineProperty,Fx=d((e,t)=>Px(e,"name",{value:t,configurable:!0}),"e$S");const Bx={description:"Remove node_modules from all workspace projects",examples:[["vis clean","Remove all node_modules directories"],["vis clean --lockfile","Also remove lockfiles"],["vis clean --dry-run","Preview what would be removed"]],group:"Workspace",loader:Fx(()=>import("./handler7.js"),"loader"),name:"clean",options:[{alias:"l",defaultValue:!1,description:"Also remove lockfiles (pnpm-lock.yaml, package-lock.json, etc.)",name:"lockfile",type:Boolean},{defaultValue:!1,description:"Preview what would be removed without deleting",name:"dry-run",type:Boolean}]};var Rx=Object.defineProperty,Tx=d((e,t)=>Rx(e,"name",{value:t,configurable:!0}),"e$R");const Nx={argument:{description:"Template to use (e.g., vis:app, create-vite, user/repo) — omit for interactive mode",name:"template",type:String},description:"Create a new project from a template",examples:[["vis create","Interactive project scaffolding"],["vis create vis:monorepo my-workspace","Create a monorepo workspace"],["vis create vis:app my-app","Scaffold a Vite application"],["vis create vis:library my-lib","Create a TypeScript library"],["vis create vite my-app -- --template react-ts","Use create-vite with React TypeScript"],["vis create user/repo my-project","Clone a GitHub template"],["vis create --list","Show available templates"]],group:"Scaffold & Config",loader:Tx(()=>import("./handler39.js"),"loader"),name:"create",options:[{defaultValue:!1,description:"Show available templates",name:"list",type:Boolean},{description:"Generate editor configs (vscode)",name:"editor",type:String},{defaultValue:!1,description:"Initialize a git repository",name:"git-init",type:Boolean},{defaultValue:!1,description:"Skip interactive prompts",name:"no-interactive",type:Boolean}]};var Ix=Object.defineProperty,Kt=d((e,t)=>Ix(e,"name",{value:t,configurable:!0}),"r$J");const Ld=Kt(()=>D(Yg(),".vis"),"getVisHomeDir"),Ic=Kt(()=>D(Ld(),"cache"),"getVisCacheDir"),fn=Kt(()=>D(Ld(),"state"),"getVisStateDir"),Lx=Kt(e=>cS("sha256").update(e).digest("hex").slice(0,12),"hashWorkspace"),Jz=Kt(e=>D(Ld(),"workspaces",Lx(e)),"getVisWorkspaceDir"),f0=".vis",Pr=Kt(e=>D(e,f0),"getVisWorkspaceDataDir"),h0=`${f0}/cache`;Kt(e=>D(Pr(e),"cache"),"getVisWorkspaceCacheDir");const hn=Kt(e=>D(Pr(e),"runs"),"getVisRunsDir"),m0=Kt(e=>D(Pr(e),"last-summary.json"),"getVisLastSummaryPath"),Kz=Kt(e=>D(Pr(e),"last-failures"),"getVisLastFailuresDir"),Yz=Kt(e=>{const t=jp()==="win32";for(const r of[".task-runner",".task-runner-cache"]){const n=D(e,r);if(pc(n))try{const s=t?hh("cmd.exe",["/c","rmdir","/s","/q",n],{detached:!0,stdio:"ignore"}):hh("rm",["-rf",n],{detached:!0,stdio:"ignore"});s.on("error",()=>{}),s.unref()}catch{}}},"cleanupLegacyTaskRunnerLayout");var _x=Object.defineProperty,nn=d((e,t)=>_x(e,"name",{value:t,configurable:!0}),"i$v");const g0=nn((e,t,r)=>{const n=nn(i=>tn(i)?i:Ke(e,i),"normalize");if(t&&t.length>0)return n(t);if(r&&r.length>0)return n(r);const s=process.env.VIS_CACHE_DIRECTORY;return s&&s.length>0?n(s):Ke(e,h0)},"resolveCacheDirectory"),Mx=nn((e,t)=>t===!1?e:sS(e)??e,"resolveSharedCacheRoot"),Xh=nn((e,t,r,n)=>{const s=t??r??process.env.VIS_CACHE_DIRECTORY;if(s&&s.length>0)return g0(e,t,r);const i=Mx(e,n);return Ke(i,h0)},"resolveSharedCacheDirectory"),Wx=/[^\w.-]+/g,Vx=/^-+|-+$/g,Ux=nn(e=>e.trim().replaceAll(Wx,"-").replaceAll(Vx,"").slice(0,64),"sanitizeBranchSegment"),Gx=nn(e=>{try{const t=rS("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return!t||t==="HEAD"?void 0:t}catch{return}},"detectGitBranch"),Xz=nn((e,t,r)=>{if(r!==!0)return e;const n=Gx(t);if(!n)return e;const s=Ux(n);return s.length===0?e:Ke(e,"branches",s)},"applyBranchScope"),qx=nn((e,t)=>{const r=zn(t,e);return r.length===0?!1:r!==".."&&!r.startsWith("../")&&!tn(r)},"isCacheDirectoryInsideWorkspace"),Hx="x-hono-already-sent";var zx=Object.defineProperty,qa=d((e,t)=>zx(e,"name",{value:t,configurable:!0}),"o$K");(class{static{qa(this,"WSContext")}#e;constructor(e){this.#e=e,this.raw=e.raw,this.url=e.url?new URL(e.url):null,this.protocol=e.protocol??null}send(e,t){this.#e.send(e,t??{})}raw;binaryType="arraybuffer";get readyState(){return this.#e.readyState}url;protocol;close(e,t){this.#e.close(e,t)}});qa(e=>new MessageEvent("message",{data:e}),"createWSMessageEvent");var Jx=qa(e=>((...t)=>{if(typeof t[0]=="function"){const[r,n]=t;return qa(async function(s,i){const o=await r(s),a=await e(s,o,n);if(a)return a;await i()},"upgradeWebSocket")}else{const[r,n,s]=t;return(async()=>{const i=await e(r,n,s);if(!i)throw new Error("Failed to upgrade WebSocket");return i})()}}),"defineWebSocketHelper"),Kx=Object.defineProperty,G=d((e,t)=>Kx(e,"name",{value:t,configurable:!0}),"c$z"),er=class extends Error{static{d(this,"p")}static{G(this,"RequestError")}constructor(t,r){super(t,r),this.name="RequestError"}};const Yx=/^\/[!#$&-;=?-\[\]_a-z~]*$/,Xx=/\/\.\.?(?:[/?#]|$)/,Qx=/^[a-z0-9._-]+(?::(?:[1-5]\d{3,4}|[6-9]\d{3}))?$/,Zx=G((e,t,r)=>{const n=`${e}://${t}${r}`;if(Qx.test(t)){if(r.length===0)return n+"/";if(r.charCodeAt(0)!==47)throw new er("Invalid URL");return!Yx.test(r)||Xx.test(r)?new URL(n).href:n}else{const s=new URL(n);if(s.hostname.length!==t.length&&s.hostname!==(t.includes(":")?t.replace(/:\d+$/,""):t).toLowerCase())throw new er("Invalid host header");return s.href}},"buildUrl"),eO=G(e=>e instanceof er?e:new er(e.message,{cause:e}),"toRequestError"),tO=global.Request;var Ls=class extends tO{static{d(this,"H")}static{G(this,"Request$1")}constructor(t,r){if(typeof t=="object"&&Qr in t){const n=r!==void 0&&"body"in r&&r.body!=null;if(t[Fr]&&!n)throw new TypeError("Cannot construct a Request with a Request object that has already been used.");t=t[Qr]()}typeof r?.body?.getReader<"u"&&(r.duplex??="half"),super(t,r)}};const y0=G(e=>{const t=[],r=e.rawHeaders;for(let n=0,s=r.length;n<s;n+=2){const i=r[n];i.charCodeAt(0)!==58&&t.push([i,r[n+1]])}return new Headers(t)},"newHeadersFromIncoming"),v0=Symbol("wrapBodyStream"),rO=G((e,t,r,n,s)=>{const i={method:e,headers:r,signal:s.signal};if(e==="TRACE"){i.method="GET";const o=new Ls(t,i);return Object.defineProperty(o,"method",{get(){return"TRACE"}}),o}if(!(e==="GET"||e==="HEAD"))if("rawBody"in n&&n.rawBody instanceof Buffer)i.body=new ReadableStream({start(o){o.enqueue(n.rawBody),o.close()}});else if(n[v0]){let o;i.body=new ReadableStream({async pull(a){try{o||=bu.toWeb(n).getReader();const{done:c,value:l}=await o.read();c?a.close():a.enqueue(l)}catch(c){a.error(c)}}})}else i.body=bu.toWeb(n);return new Ls(t,i)},"newRequestFromIncoming"),Qr=Symbol("getRequestCache"),Cr=Symbol("requestCache"),_s=Symbol("incomingKey"),io=Symbol("urlKey"),b0=Symbol("methodKey"),$0=Symbol("headersKey"),Fi=Symbol("abortControllerKey"),Mu=Symbol("getAbortController"),Wu=Symbol("abortRequest"),js=Symbol("bodyBuffer"),ia=Symbol("bodyReadPromise"),Fr=Symbol("bodyConsumedDirectly"),Qh=Symbol("bodyLockReader"),zi=Symbol("abortReason"),w0=G(()=>new TypeError("Body is unusable"),"newBodyUnusableError"),Mo=G(()=>Promise.reject(w0()),"rejectBodyUnusable"),nO=new TextDecoder,sO=G(e=>{if(e[Fr])return Mo();e[Fr]=!0},"consumeBodyDirectOnce"),iO=G(e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),"toArrayBuffer"),oO=G(e=>(e[$0]||=y0(e[_s])).get("content-type")||"","contentType"),aO=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,cO=G(e=>{if(typeof e!="string"||e.length===0)return"GET";switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"POST":case"PUT":return e}const t=e.toUpperCase();switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"POST":case"PUT":return t;default:return e}},"normalizeIncomingMethod"),lO=G(e=>{if(!aO.test(e))return new TypeError(`'${e}' is not a valid HTTP method.`);const t=e.toUpperCase();if(t==="CONNECT"||t==="TRACK"||t==="TRACE"&&e!=="TRACE")return new TypeError(`'${e}' HTTP method is unsupported.`)},"validateDirectReadMethod"),_d=G((e,t,r)=>{if(e[Fr])return Mo();const n=e.method;if(n==="GET"||n==="HEAD")return e[Qr]()[t]();const s=lO(n);if(s)return Promise.reject(s);if(e[Cr]&&n!=="TRACE")return e[Cr][t]();const i=sO(e);if(i)return i;const o=uO(e);if(o){const a=Promise.resolve(r(o,e));return e[js]=void 0,a}return pO(e).then(a=>{const c=r(a,e);return e[js]=void 0,c})},"readBodyWithFastPath"),uO=G(e=>{const t=e[_s];if("rawBody"in t&&t.rawBody instanceof Buffer)return t.rawBody},"readRawBodyIfAvailable"),pO=G(e=>{if(e[js])return Promise.resolve(e[js]);if(e[ia])return e[ia];const t=e[_s];if(bu.isDisturbed(t))return Mo();const r=new Promise((n,s)=>{const i=[];let o=!1;const a=G(m=>{o||(o=!0,f(),m())},"finish"),c=G(m=>{i.push(Buffer.isBuffer(m)?m:Buffer.from(m))},"onData"),l=G(()=>{a(()=>{const m=i.length===1?i[0]:Buffer.concat(i);e[js]=m,n(m)})},"onEnd"),u=G(m=>{a(()=>{s(m)})},"onError"),p=G(()=>{if(t.readableEnded){l();return}a(()=>{if(t.errored){s(t.errored);return}const m=e[zi];if(m!==void 0){s(m instanceof Error?m:new Error(String(m)));return}s(new Error("Client connection prematurely closed."))})},"onClose"),f=G(()=>{t.off("data",c),t.off("end",l),t.off("error",u),t.off("close",p),e[ia]=void 0},"cleanup");t.on("data",c),t.on("end",l),t.on("error",u),t.on("close",p),queueMicrotask(()=>{o||(t.readableEnded?l():t.errored?u(t.errored):t.destroyed&&p())})});return e[ia]=r,r},"readBodyDirect"),gr={get method(){return this[b0]},get url(){return this[io]},get headers(){return this[$0]||=y0(this[_s])},[Wu](e){this[zi]===void 0&&(this[zi]=e);const t=this[Fi];t&&!t.signal.aborted&&t.abort(e)},[Mu](){return this[Fi]||=new AbortController,this[zi]!==void 0&&!this[Fi].signal.aborted&&this[Fi].abort(this[zi]),this[Fi]},[Qr](){const e=this[Mu]();if(this[Cr])return this[Cr];const t=this.method;if(this[Fr]&&!(t==="GET"||t==="HEAD")){this[js]=void 0;const r={method:t==="TRACE"?"GET":t,headers:this.headers,signal:e.signal};t!=="TRACE"&&(r.body=new ReadableStream({start(s){s.close()}}),r.duplex="half");const n=new Ls(this[io],r);return t==="TRACE"&&Object.defineProperty(n,"method",{get(){return"TRACE"}}),this[Cr]=n}return this[Cr]=rO(this.method,this[io],this.headers,this[_s],e)},get body(){if(!this[Fr])return this[Qr]().body;const e=this[Qr]();return!this[Qh]&&e.body&&(this[Qh]=e.body.getReader()),e.body},get bodyUsed(){return this[Fr]?!0:this[Cr]?this[Cr].bodyUsed:!1}};Object.defineProperty(gr,"signal",{get(){return this[Mu]().signal}});["cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","keepalive"].forEach(e=>{Object.defineProperty(gr,e,{get(){return this[Qr]()[e]}})});["clone","formData"].forEach(e=>{Object.defineProperty(gr,e,{value:G(function(){if(this[Fr]){if(e==="clone")throw w0();return Mo()}return this[Qr]()[e]()},"value")})});Object.defineProperty(gr,"text",{value:G(function(){return _d(this,"text",e=>nO.decode(e))},"value")});Object.defineProperty(gr,"arrayBuffer",{value:G(function(){return _d(this,"arrayBuffer",e=>iO(e))},"value")});Object.defineProperty(gr,"blob",{value:G(function(){return _d(this,"blob",(e,t)=>{const r=oO(t),n=r?{headers:{"content-type":r}}:void 0;return new Response(e,n).blob()})},"value")});Object.defineProperty(gr,"json",{value:G(function(){return this[Fr]?Mo():this.text().then(JSON.parse)},"value")});Object.defineProperty(gr,Symbol.for("nodejs.util.inspect.custom"),{value:G(function(e,t,r){return`Request (lightweight) ${r({method:this.method,url:this.url,headers:this.headers,nativeRequest:this[Cr]},{...t,depth:e==null?null:e-1})}`},"value")});Object.setPrototypeOf(gr,Ls.prototype);const dO=G((e,t)=>{const r=Object.create(gr);r[_s]=e,r[b0]=cO(e.method);const n=e.url||"";if(n[0]!=="/"&&(n.startsWith("http://")||n.startsWith("https://"))){if(e instanceof Zi)throw new er("Absolute URL for :path is not allowed in HTTP/2");try{r[io]=new URL(n).href}catch(o){throw new er("Invalid absolute URL",{cause:o})}return r}const s=(e instanceof Zi?e.authority:e.headers.host)||t;if(!s)throw new er("Missing host header");let i;if(e instanceof Zi){if(i=e.scheme,!(i==="http"||i==="https"))throw new er("Unsupported scheme")}else i=e.socket&&e.socket.encrypted?"https":"http";try{r[io]=Zx(i,s,n)}catch(o){throw o instanceof er?o:new er("Invalid URL",{cause:o})}return r},"newRequest"),qr="text/plain; charset=UTF-8",Vu=Symbol("responseCache"),ws=Symbol("getResponseCache"),Jr=Symbol("cache"),Md=global.Response;var fr=class k0{static{d(this,"Q")}static{G(this,"Response$1")}#e;#t;[ws](){return delete this[Jr],this[Vu]||=new Md(this.#e,this.#t)}constructor(t,r){let n;if(this.#e=t,r instanceof k0){const s=r[Vu];if(s){this.#t=s,this[ws]();return}else this.#t=r.#t,n=new Headers(r.#t.headers)}else this.#t=r;(t==null||typeof t=="string"||typeof t?.getReader<"u"||t instanceof Blob||t instanceof Uint8Array)&&(this[Jr]=[r?.status||200,t??null,n||r?.headers])}get headers(){const t=this[Jr];return t?(t[2]instanceof Headers||(t[2]=new Headers(t[2]||(t[1]===null?void 0:{"content-type":qr}))),t[2]):this[ws]().headers}get status(){return this[Jr]?.[0]??this[ws]().status}get ok(){const t=this.status;return t>=200&&t<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(fr.prototype,e,{get(){return this[ws]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(fr.prototype,e,{value:G(function(){return this[ws]()[e]()},"value")})});Object.defineProperty(fr.prototype,Symbol.for("nodejs.util.inspect.custom"),{value:G(function(e,t,r){return`Response (lightweight) ${r({status:this.status,headers:this.headers,ok:this.ok,nativeResponse:this[Vu]},{...t,depth:e==null?null:e-1})}`},"value")});Object.setPrototypeOf(fr,Md);Object.setPrototypeOf(fr.prototype,Md.prototype);const fO=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,hO=G(e=>e instanceof URL?e.href:fO.test(e)?e:new URL(e).href,"parseRedirectUrl"),mO=new Set([301,302,303,307,308]);Object.defineProperty(fr,"redirect",{value:G(function(e,t=302){if(!mO.has(t))throw new RangeError("Invalid status code");return new fr(null,{status:t,headers:{location:hO(e)}})},"redirect"),writable:!0,configurable:!0});Object.defineProperty(fr,"json",{value:G(function(e,t){const r=JSON.stringify(e);if(r===void 0)throw new TypeError("The data is not JSON serializable");const n=t?.headers;let s;return n?(s=new Headers(n),s.has("content-type")||s.set("content-type","application/json")):s={"content-type":"application/json"},new fr(r,{status:t?.status??200,statusText:t?.statusText,headers:s})},"json"),writable:!0,configurable:!0});async function S0(e){return Promise.race([e,Promise.resolve().then(()=>Promise.resolve(void 0))])}d(S0,"$e$4");G(S0,"readWithoutBlocking");function Wd(e,t,r){const n=G(a=>{e.cancel(a).catch(()=>{})},"cancel");return t.on("close",n),t.on("error",n),(r??e.read()).then(o,s),e.closed.finally(()=>{t.off("close",n),t.off("error",n)});function s(a){a&&t.destroy(a)}function i(){e.read().then(o,s)}function o({done:a,value:c}){try{if(a)t.end();else if(!t.write(c))t.once("drain",i);else return e.read().then(o,s)}catch(l){s(l)}}}d(Wd,"ee$4");G(Wd,"writeFromReadableStreamDefaultReader");function Uu(e,t){if(e.locked)throw new TypeError("ReadableStream is locked.");return t.destroyed?void 0:Wd(e.getReader(),t)}d(Uu,"F$g");G(Uu,"writeFromReadableStream");const Gu=G((e,t)=>{const r={};if(e instanceof Headers||(e=new Headers(e??void 0)),e.has("set-cookie")){const n=[];for(const[s,i]of e)s==="set-cookie"?n.push(i):r[s]=i;n.length>0&&(r["set-cookie"]=n)}else for(const[n,s]of e)r[n]=s;return t&&(r["content-type"]??=t),r},"buildOutgoingHttpHeaders"),Ha=Symbol("outgoingEnded"),Zh=Symbol("incomingDraining"),gO=500,yO=64*1024*1024,D0=G(e=>{const t=e;if(e.destroyed||t[Zh])return;if(t[Zh]=!0,e instanceof Zi){try{e.stream?.close?.(dS.NGHTTP2_NO_ERROR)}catch{}return}let r=0;const n=G(()=>{clearTimeout(i),e.off("data",o),e.off("end",n),e.off("error",n)},"cleanup"),s=G(()=>{n();const a=e.socket;a&&!a.destroyed&&a.destroySoon()},"forceClose"),i=setTimeout(s,gO);i.unref?.();const o=G(a=>{r+=a.length,r>yO&&s()},"onData");e.on("data",o),e.on("end",n),e.on("error",n),e.resume()},"drainIncoming"),vO=G((e,t,r,n)=>()=>{t.errored?e[Wu](t.errored.toString()):r.writableFinished||e[Wu]("Client connection prematurely closed."),n&&!t.readableEnded&&setTimeout(()=>{t.readableEnded||setTimeout(()=>{D0(t)})})},"makeCloseHandler"),bO=G(e=>{if(!(Jr in e))return!1;const t=e[Jr][1];return t===null||typeof t=="string"||t instanceof Uint8Array},"isImmediateCacheableResponse"),$O=G(()=>new Response(null,{status:400}),"handleRequestError"),C0=G(e=>new Response(null,{status:e instanceof Error&&(e.name==="TimeoutError"||e.constructor.name==="TimeoutError")?504:500}),"handleFetchError"),za=G((e,t)=>{const r=e instanceof Error?e:new Error("unknown error",{cause:e});r.code==="ERR_STREAM_PREMATURE_CLOSE"?console.info("The user aborted a request."):(console.error(e),t.headersSent||t.writeHead(500,{"Content-Type":"text/plain"}),t.end(`Error: ${r.message}`),t.destroy(r))},"handleResponseError"),qu=G(e=>{"flushHeaders"in e&&e.writable&&e.flushHeaders()},"flushHeaders"),E0=G(async(e,t)=>{let[r,n,s]=e[Jr];if(!s){n===null?(t.writeHead(r),t.end()):typeof n=="string"?(t.writeHead(r,{"Content-Type":qr,"Content-Length":Buffer.byteLength(n)}),t.end(n)):n instanceof Uint8Array?(t.writeHead(r,{"Content-Type":qr,"Content-Length":n.byteLength}),t.end(n)):n instanceof Blob?(t.writeHead(r,{"Content-Type":qr,"Content-Length":n.size}),t.end(new Uint8Array(await n.arrayBuffer()))):(t.writeHead(r,{"Content-Type":qr}),qu(t),await Uu(n,t)?.catch(o=>za(o,t))),t[Ha]?.();return}let i=!1;if(s instanceof Headers)i=s.has("content-length"),s=Gu(s,n===null?void 0:qr);else if(Array.isArray(s)){const o=new Headers(s);i=o.has("content-length"),s=Gu(o,n===null?void 0:qr)}else for(const o in s)if(o.length===14&&o.toLowerCase()==="content-length"){i=!0;break}i||(typeof n=="string"?s["Content-Length"]=Buffer.byteLength(n):n instanceof Uint8Array?s["Content-Length"]=n.byteLength:n instanceof Blob&&(s["Content-Length"]=n.size)),t.writeHead(r,s),n==null?t.end():typeof n=="string"||n instanceof Uint8Array?t.end(n):n instanceof Blob?t.end(new Uint8Array(await n.arrayBuffer())):(qu(t),await Uu(n,t)?.catch(o=>za(o,t))),t[Ha]?.()},"responseViaCache"),j0=G(e=>typeof e.then=="function","isPromise"),wO=G(async(e,t,r={})=>{if(j0(e))if(r.errorHandler)try{e=await e}catch(s){const i=await r.errorHandler(s);if(!i)return;e=i}else e=await e.catch(C0);if(Jr in e)return E0(e,t);const n=Gu(e.headers,e.body===null?void 0:qr);if(e.body){const s=e.body.getReader(),i=[];let o=!1,a;if(n["transfer-encoding"]!=="chunked"){let c=2;for(let l=0;l<c;l++){a||=s.read();const u=await S0(a).catch(p=>{console.error(p),o=!0});if(!u){if(l===1){await new Promise(p=>setTimeout(p)),c=3;continue}break}if(a=void 0,u.value&&i.push(u.value),u.done){o=!0;break}}o&&!("content-length"in n)&&(n["content-length"]=i.reduce((l,u)=>l+u.length,0))}t.writeHead(e.status,n),i.forEach(c=>{t.write(c)}),o?t.end():(i.length===0&&qu(t),await Wd(s,t,a))}else n[Hx]||(t.writeHead(e.status,n),t.end());t[Ha]?.()},"responseViaResponseObject"),kO=G((e,t={})=>{const r=t.autoCleanupIncoming??!0;return t.overrideGlobalObjects!==!1&&global.Request!==Ls&&(Object.defineProperty(global,"Request",{value:Ls}),Object.defineProperty(global,"Response",{value:fr})),async(n,s)=>{let i,o,a=!1,c=!1;const l=G(()=>{!o||c||(c=!0,s.on("close",vO(o,n,s,a)))},"ensureCloseHandler");try{if(o=dO(n,t.hostname),a=r&&!(n.method==="GET"||n.method==="HEAD"),a&&(n[v0]=!0,n instanceof Zi&&(s[Ha]=()=>{n.readableEnded||setTimeout(()=>{n.readableEnded||setTimeout(()=>{n.destroy(),s.destroy()})})})),i=e(o,{incoming:n,outgoing:s}),!j0(i)&&bO(i))return a&&!n.readableEnded&&s.once("finish",()=>{n.readableEnded||D0(n)}),E0(i,s);l()}catch(u){if(i)return za(u,s);if(t.errorHandler){if(l(),i=await t.errorHandler(o?u:eO(u)),!i)return}else o?i=C0(u):i=$O()}try{return await wO(i,s,t)}catch(u){return za(u,s)}}},"getRequestListener"),SO=globalThis.CloseEvent??class extends Event{#e;constructor(e,t={}){super(e,t),this.#e=t}get wasClean(){return this.#e.wasClean??!1}get code(){return this.#e.code??0}get reason(){return this.#e.reason??""}},DO=G(()=>Symbol("connection"),"generateConnectionSymbol"),A0=Symbol("CONNECTION_SYMBOL_KEY"),x0=Symbol("WAIT_FOR_WEBSOCKET_SYMBOL"),CO=new Set(["connection","content-length","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","transfer-encoding","upgrade","sec-websocket-accept","sec-websocket-extensions","sec-websocket-protocol"]),O0=G((e,t)=>{t&&t.forEach((r,n)=>{CO.has(n.toLowerCase())||e.push(`${n}: ${r}`)})},"appendResponseHeaders"),em=G((e,t,r)=>{const n=["Connection: close","Content-Length: 0"];O0(n,r),e.end(`HTTP/1.1 ${t.toString()} ${pS[t]??""}\r
|
|
976
|
+
`),r.postMessage&&(s+=r.postMessage),s},"generateMissingPackagesInstallMessage");var OA=Object.defineProperty,PA=d((e,t)=>OA(e,"name",{value:t,configurable:!0}),"c$C"),FA=Object.defineProperty,n0=PA((e,t)=>FA(e,"name",{value:t,configurable:!0}),"p");const BA=mt(import.meta.url),Pi=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,RA=n0(e=>{if(typeof Pi<"u"&&Pi.versions&&Pi.versions.node){const[t,r]=Pi.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Pi.getBuiltinModule(e)}return BA(e)},"__cjs_getBuiltinModule"),{existsSync:Ga,readFileSync:s0}=RA("node:fs");var TA=Object.defineProperty,i0=n0((e,t)=>TA(e,"name",{value:t,configurable:!0}),"i");i0(async e=>{const t=await Do(["lerna.json","turbo.json"],{type:"file",...e&&{cwd:e}});if(t?.endsWith("lerna.json")){const n=await Eo(t);if(n&&typeof n=="object"&&!Array.isArray(n)){const s=n;if(s.useWorkspaces||s.packages)return{path:Je(t),strategy:"lerna"}}}const r=t?.endsWith("turbo.json");try{const{packageManager:n,path:s}=await AA(e);if(["npm","yarn"].includes(n)){const i=D(s,"package.json");if(Ga(i)&&s0(D(s,"package.json"),"utf8").includes("workspaces"))return{path:s,strategy:r?"turbo":n}}else if(n==="pnpm"){const i=D(s,"pnpm-workspace.yaml");if(Ga(i))return{path:s,strategy:r?"turbo":"pnpm"}}}catch(n){if(!(n instanceof Bs))throw n}throw new Error(`No monorepo root could be found upwards from the directory ${e} using lerna, yarn, pnpm, or npm as indicators.`)},"findMonorepoRoot");const o0=i0(e=>{const t=Co(["lerna.json","turbo.json"],{type:"file",...e&&{cwd:e}});if(t?.endsWith("lerna.json")){const n=le(t);if(n.useWorkspaces||n.packages)return{path:Je(t),strategy:"lerna"}}const r=t?.endsWith("turbo.json");try{const{packageManager:n,path:s}=xA(e);if(["npm","yarn"].includes(n)){const i=D(s,"package.json");if(Ga(i)&&s0(D(s,"package.json"),"utf8").includes("workspaces"))return{path:s,strategy:r?"turbo":n}}else if(n==="pnpm"){const i=D(s,"pnpm-workspace.yaml");if(Ga(i))return{path:s,strategy:r?"turbo":"pnpm"}}}catch(n){if(!(n instanceof Bs))throw n}throw new Error(`No monorepo root could be found upwards from the directory ${e} using lerna, yarn, pnpm, or npm as indicators.`)},"findMonorepoRootSync");var NA=Object.defineProperty,IA=d((e,t)=>NA(e,"name",{value:t,configurable:!0}),"e$$");const LA={argument:{description:"Target selector (same syntax as `vis run`): `build`, `:build`, `~:test`, `#tag:lint`, …",name:"selector",type:String},description:"Show the execution plan for a target without running it",examples:[["vis action-graph build","Print the task plan for `build` on every project"],["vis action-graph :test","Moon-style selector"],["vis action-graph build --json","Emit a JSON description of the plan"],['vis action-graph lint --query "tag=frontend"',"Filter projects by query"]],group:"Workspace",loader:IA(()=>import("./handler.js"),"loader"),name:"action-graph",options:[{defaultValue:!1,description:"Emit JSON instead of ASCII",name:"json",type:Boolean},{description:"Filter matched projects by a query",name:"query",type:String}]};var _A=Object.defineProperty,MA=d((e,t)=>_A(e,"name",{value:t,configurable:!0}),"e$_");const WA={argument:{description:"Packages to add (e.g., react react-dom)",name:"packages",type:String},description:"Add packages using the detected package manager",examples:[["vis add react react-dom","Add packages"],["vis add -D typescript @types/react","Add as dev dependencies"],["vis add react --filter app","Add to specific workspace package"],["vis add react --to web","Add to one package, auto-conforming the version to existing catalogs / sibling deps"],["vis add -g typescript","Add globally (uses npm)"],["vis add lodash -w","Add to workspace root"],["vis add lodash --no-socket-check","Add without Socket.dev check"],["vis add lodash --no-typosquat-check","Skip typosquat name check"],["vis add lodash --no-marshall-check","Skip the offline marshall pipeline (author, downloads, etc.)"],["vis add lodash --run-scripts","Run lifecycle scripts (opts out of vis's default block-by-default policy)"]],group:"Dependencies",loader:MA(()=>import("./handler17.js"),"loader"),name:"add",options:[{alias:"D",defaultValue:!1,description:"Add as dev dependency",name:"save-dev",type:Boolean},{alias:"E",defaultValue:!1,description:"Save exact version",name:"exact",type:Boolean},{alias:"P",defaultValue:!1,description:"Add as peer dependency",name:"save-peer",type:Boolean},{alias:"O",defaultValue:!1,description:"Add as optional dependency",name:"save-optional",type:Boolean},{alias:"g",defaultValue:!1,description:"Install globally (uses npm)",name:"global",type:Boolean},{alias:"w",defaultValue:!1,description:"Add to workspace root",name:"workspace-root",type:Boolean},{defaultValue:!1,description:"Use workspace protocol (pnpm)",name:"workspace",type:Boolean},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String},{description:"Target a single workspace package and auto-conform the version to existing catalogs / sibling deps (syncpack#285)",name:"to",type:String},{defaultValue:!1,description:"Skip typosquat name check before adding",name:"no-typosquat-check",type:Boolean},{defaultValue:!1,description:"Skip Socket.dev security check before adding",name:"no-socket-check",type:Boolean},{defaultValue:!1,description:"Skip the offline marshall pipeline (author, provenance, metadata, downloads, expired-domains, new-bin, signatures, archived-repo)",name:"no-marshall-check",type:Boolean},{defaultValue:!1,description:"Run lifecycle scripts during add (opts out of vis's default block-by-default policy; allowlisted packages run via security.policies.installScripts.allow)",name:"run-scripts",type:Boolean},{defaultValue:!1,description:"After adding, recursively install non-optional peer dependencies that aren't already in the workspace (matches nypm's installPeerDependencies)",name:"auto-install-peers",type:Boolean}]},Nd={description:"Override the cache DB path (defaults to <cache>/vis/advisories/db.sqlite via @visulima/find-cache-dir).",name:"db",type:String},Lo={description:"Output format: table (default) or json.",name:"format",type:String},VA={commandPath:["advisories"],description:"Download and ingest one or more OSV ecosystem dumps into the local cache",examples:[["vis advisories sync","Sync the npm ecosystem (default)"],["vis advisories sync --ecosystem npm","Sync a single explicit ecosystem"],["vis advisories sync --ecosystem npm,PyPI","Sync several ecosystems in one pass"],["vis advisories sync --force","Re-download even when the ETag matches"],["vis advisories sync --source https://mirror.example.com","Use a corporate OSV mirror (must be in allowedHosts)"]],group:"Security & Health",loader:Se(()=>import("./sync.js"),"advisoriesSyncExecute"),name:"sync",options:[{description:"Comma-separated list of ecosystems to sync (default: npm).",name:"ecosystem",type:String},{defaultValue:!1,description:"Re-download and re-ingest even if the upstream ETag is unchanged.",name:"force",type:Boolean},{description:"Override the advisory source URL. Must be https and resolve to an allowed host.",name:"source",type:String},Nd,Lo]},UA={commandPath:["advisories"],description:"Print the local advisory DB summary: path, schema version, ecosystems, row counts, last sync, ETag",examples:[["vis advisories status","Human-readable summary"],["vis advisories status --format json","Machine-readable for CI freshness checks"]],group:"Security & Health",loader:Se(()=>import("./status.js"),"advisoriesStatusExecute"),name:"status",options:[Nd,Lo]},GA={commandPath:["advisories"],description:"Delete the local advisory DB. The next `vis audit --offline` will fail until you re-sync",examples:[["vis advisories prune","Confirm and delete the local DB"],["vis advisories prune --force","Delete without confirmation"]],group:"Security & Health",loader:Se(()=>import("./prune.js"),"advisoriesPruneExecute"),name:"prune",options:[Nd,{defaultValue:!1,description:"Skip the confirmation prompt.",name:"force",type:Boolean},Lo]},a0={description:"Override the bloom cache directory (defaults to <cache>/vis/osv-bloom/).",name:"cache-dir",type:String},qA={commandPath:["advisories","bloom"],description:"Fetch and verify the endevco/osv-bloom MAL-* prefilter into the local cache",examples:[["vis advisories bloom sync","Fetch the bloom filter from the default upstream"],["vis advisories bloom sync --force","Re-download even when the set digest matches"],["vis advisories bloom sync --source https://bloom.example.com","Use an internal mirror (must be in allowedHosts)"]],group:"Security & Health",loader:Se(()=>import("./bloom-sync.js"),"advisoriesBloomSyncExecute"),name:"sync",options:[{defaultValue:!1,description:"Re-download and re-verify even when the upstream set digest is unchanged.",name:"force",type:Boolean},{description:"Override the bloom source URL. Must be https and resolve to an allowed host.",name:"source",type:String},a0,Lo]},HA={commandPath:["advisories","bloom"],description:"Print the local osv-bloom cache freshness: built-at, filter size, m/k parameters, set digest",examples:[["vis advisories bloom status","Human-readable summary"],["vis advisories bloom status --format json","Machine-readable for CI freshness checks"]],group:"Security & Health",loader:Se(()=>import("./bloom-status.js"),"advisoriesBloomStatusExecute"),name:"status",options:[a0,Lo]},zA=[VA,UA,GA,qA,HA];var JA=Object.defineProperty,KA=d((e,t)=>JA(e,"name",{value:t,configurable:!0}),"e$Z");const YA={argument:{description:"The target to run (e.g., build, test, lint)",name:"target",type:String},description:"Run a target only on projects affected by recent changes",examples:[["vis affected build","Run build on affected projects"],["vis affected test --base=main","Run tests on projects changed since main"],["vis affected destroy --reverse","Tear down affected projects leaves-first"],["vis affected build --sparse-checkout","Print a git sparse-checkout cone set for the affected projects and exit"]],group:"Run & Execute",loader:KA(()=>import("./handler2.js"),"loader"),name:"affected",options:[{description:"Git base ref for comparison. When omitted, vis auto-resolves it from the active CI provider (GitHub/GitLab/Buildkite/CircleCI) or falls back to `git merge-base HEAD origin/<defaultBase>` locally. Default base branch comes from `vis.config.ts#defaultBase` (or `main`).",name:"base",type:String},{description:"Git head ref for comparison. When omitted, auto-resolves from CI env (e.g. `$GITHUB_SHA`) or defaults to `HEAD`.",name:"head",type:String},{defaultValue:"deep",description:'Downstream scope: "none", "direct", or "deep" — controls how far to include dependents of changed projects',name:"downstream",type:String},{defaultValue:"none",description:'Upstream scope: "none", "direct", or "deep" — controls how far to include dependencies of changed projects',name:"upstream",type:String},{defaultValue:3,description:"Maximum number of parallel tasks",name:"parallel",type:Number},{defaultValue:!0,description:"Enable caching (use --no-cache to disable)",name:"cache",type:Boolean},{defaultValue:!1,description:"Show what would run without executing",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Instead of running, print the affected project roots as a git sparse-checkout cone set (one path per line) and exit. Pipe into `git sparse-checkout set --stdin` to shrink huge-monorepo CI checkouts.",name:"sparse-checkout",type:Boolean},{description:'Partition tasks for distributed CI (e.g., "1/4" for first of four runners). Falls back to VIS_PARTITION env var.',name:"partition",type:String},{description:"Filter affected projects by a query (e.g. 'language=typescript && tag=lib')",name:"query",type:String},{defaultValue:!1,description:"Run the dependency graph in reverse (leaves first, then their dependents). Useful for teardown targets like `destroy`/`undeploy` where dependents must run before the things they depend on.",name:"reverse",type:Boolean},{description:"Comma-separated tags this runner advertises (e.g. 'gpu,slow'). Forwarded verbatim to the downstream `vis run` so capability-gated tasks resolve identically. Falls back to VIS_RUNNER_TAGS env var.",name:"runner-tags",type:String}]},c0={description:"Output format: table or json (default: table)",name:"format",type:String},XA={commandPath:["ai"],description:"List detected AI providers and show which one is selected",examples:[["vis ai providers","List all AI providers and their status"],["vis ai providers --format json","Output as JSON"]],group:"System",loader:Se(()=>import("./handler30.js"),"aiProvidersExecute"),name:"providers",options:[c0]},QA={commandPath:["ai"],description:"Test the best available AI provider with a quick prompt",examples:[["vis ai test","Test the selected provider"]],group:"System",loader:Se(()=>import("./handler30.js"),"aiTestExecute"),name:"test",options:[]},ZA={argument:{description:"Task ID to propose a fix for (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["ai"],description:"Read a failed task's logs and propose a structured patch (Phase 1: local-only, no git)",examples:[["vis ai fix @myorg/app:build","Print proposed patch for the failed task"],["vis ai fix @myorg/app:build --apply","Apply the patch to disk after confirming"],["vis ai fix @myorg/app:build --format json","Machine-readable patch output"],["vis ai fix @myorg/app:build --run 2026-04-28T...","Inspect a specific historical run"]],group:"System",loader:Se(()=>import("./handler30.js"),"aiFixExecute"),name:"fix",options:[c0,{description:"Use a specific run ID from .vis/runs/ instead of the latest run",name:"run",type:String},{defaultValue:!1,description:"Apply the proposed patch to disk after printing it",name:"apply",type:Boolean},{defaultValue:!1,description:"Bypass the AI response cache",name:"no-cache",type:Boolean},{defaultValue:!1,description:"Skip the confirmation prompt before applying",name:"yes",type:Boolean}]},ex={description:"AI-assisted commands: provider detection and failure-fix proposals (cache management lives under `vis cache`)",examples:[["vis ai","List all AI subcommands"],["vis ai discover-help","Machine-readable subcommand catalogue (for AI agents)"]],group:"System",loader:Se(()=>import("./handler30.js"),"aiRootExecute"),name:"ai",options:[]},tx={commandPath:["ai"],description:"Print the machine-readable AI subcommand catalogue (JSON to stdout, designed for AI agents)",examples:[["vis ai discover-help","Emit the discovery payload as JSON"],["vis ai discover-help | jq '.subcommands[].path'","List all available paths"]],group:"System",loader:Se(()=>import("./handler30.js"),"aiDiscoverHelpExecute"),name:"discover-help",options:[]},rx={commandPath:["ai"],description:"Diagnose the most recent failed task and post a structured patch as a PR/MR comment (or Buildkite annotation)",examples:[["vis ai heal","Heal the most recent failure"],["vis ai heal --dry-run","Propose a patch but skip apply / validate / post"],["vis ai heal --run 2026-04-28T...","Heal a specific historical run"]],group:"System",loader:Se(()=>import("./heal.js").then(e=>e.h),"aiHeal"),name:"heal",options:[{defaultValue:!1,description:"Show the proposal and exit without applying or posting it",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Bypass the AI response cache",name:"no-cache",type:Boolean},{description:"Use a specific run ID from .vis/runs/ instead of the latest run",name:"run",type:String},{description:"Per-task validation timeout in seconds (default: 1800)",name:"validation-timeout",type:Number}]},nx={commandPath:["ai","heal"],description:"Re-run the proposed fix and commit it to the PR/MR branch when validation passes",examples:[["vis ai heal accept","Triggered automatically by a `/vis heal accept` PR comment (GitHub/GitLab) or a Buildkite block-step unblock"]],group:"System",loader:Se(()=>import("./heal-accept.js"),"aiHealAccept"),name:"accept",options:[{description:"Use a specific run ID from .vis/runs/ instead of the latest run",name:"run",type:String},{description:"Per-task validation timeout in seconds (default: 1800)",name:"validation-timeout",type:Number}]},l0=[ex,tx,XA,QA,ZA,rx,nx],tJ=Object.defineProperty({__proto__:null,default:l0},Symbol.toStringTag,{value:"Module"});var sx=Object.defineProperty,ix=d((e,t)=>sx(e,"name",{value:t,configurable:!0}),"e$Y");const ox={argument:{description:"Package name to analyze (e.g., react)",name:"package",required:!0,type:String},description:"Analyze a single package update with AI",examples:[["vis analyze react","Analyze updating react to latest"],["vis analyze react 19.0.0","Analyze updating react to specific version"],["vis analyze react --ai-type security","Run security-focused analysis"],["vis analyze react --format json","Output as JSON"]],group:"System",loader:ix(()=>import("./handler3.js"),"loader"),name:"analyze",options:[{description:"AI analysis type: impact, security, compatibility, or recommend (default: impact)",name:"ai-type",type:String},{defaultValue:!1,description:"Check for known security vulnerabilities",name:"security",type:Boolean},{description:"Output format: table or json (default: table)",name:"format",type:String}]};var ax=Object.defineProperty,cx=d((e,t)=>ax(e,"name",{value:t,configurable:!0}),"e$X");const lx={description:"Review and approve dependencies with build scripts",examples:[["vis approve-builds","Scan and list unapproved build scripts"],["vis approve-builds --all","Approve all pending builds (pnpm)"],["vis approve-builds --write","Write unapproved entries into vis.config.ts security.policies.installScripts.allow"],["vis approve-builds --sync-native","Sync allowBuilds to native PM config"]],group:"Security & Health",loader:cx(()=>import("./handler31.js"),"loader"),name:"approve-builds",options:[{defaultValue:!1,description:"Approve all pending builds without prompting (pnpm only)",name:"all",type:Boolean},{defaultValue:!1,description:"Force vis scanning even for pnpm (instead of delegating)",name:"scan",type:Boolean},{defaultValue:!1,description:"Sync allowBuilds to native PM config (bun: trustedDependencies, npm: .npmrc, yarn: .yarnrc.yml)",name:"sync-native",type:Boolean},{defaultValue:!1,description:"Write unapproved entries directly into vis.config.ts security.policies.installScripts.allow (LavaMoat 'auto' parity)",name:"write",type:Boolean}]},u0={description:"Output format: table, json, or ndjson (default: table). json/ndjson go to stdout, logs to stderr.",name:"format",type:String},ux={commandPath:["attest"],description:"Verify inbound provenance + registry signatures across the locked dependency graph and gate on regressions",examples:[["vis attest verify","Check every locked dep for provenance regressions and signature problems"],["vis attest verify --prod-only","Skip devDependencies"],["vis attest verify --format json","Machine-readable findings for CI (Axis A)"],["vis attest verify --fail-on error","Exit non-zero only on error-severity findings (default: any finding)"]],group:"Security & Health",loader:Se(()=>import("./handler4.js"),"attestVerifyExecute"),name:"verify",options:[u0,{defaultValue:!1,description:"Skip devDependencies — verify the production graph only.",name:"prod-only",type:Boolean},{description:"Severity that triggers a non-zero exit: 'warning' (any finding, default) or 'error'.",name:"fail-on",type:String},{description:"Comma-separated package names to exclude from both marshalls.",name:"allowlist",type:String}]},px={argument:{description:"Path to the built artifact to attest (e.g. dist/app.tgz). Its sha256 becomes the in-toto subject digest.",name:"subject",type:String},description:"Build an in-toto SLSA v1 provenance statement for an artifact and keyless-sign it via Sigstore",examples:[["vis attest dist/app.tgz","Emit dist/app.tgz.sigstore (keyless-signed in CI)"],["vis attest dist/app.tgz --output attest.sigstore","Write the bundle to a specific path"],["vis attest dist/app.tgz --predicate slsaProvenance","Predicate type (default: slsaProvenance)"],["vis attest dist/app.tgz --require-signing","Fail instead of skip-with-warn when no ambient OIDC (outside CI)"],["vis attest dist/app.tgz --format json","Print the signed bundle summary as JSON (Axis A)"]],group:"Security & Health",loader:Se(()=>import("./handler4.js"),"attestEmitExecute"),name:"attest",options:[u0,{description:"Write the serialized Sigstore bundle here (default: <subject>.sigstore).",name:"output",type:String},{description:"Predicate type: 'slsaProvenance' (default, https://slsa.dev/provenance/v1).",name:"predicate",type:String},{defaultValue:!1,description:"Error instead of skip-with-warn when no ambient OIDC token is available (i.e. outside CI).",name:"require-signing",type:Boolean}]},dx=[px,ux];var fx=Object.defineProperty,hx=d((e,t)=>fx(e,"name",{value:t,configurable:!0}),"e$W");const mx={description:"Audit installed packages for vulnerabilities and supply chain risks",examples:[["vis audit","Full audit of all installed packages"],["vis audit --severity high","Show only high/critical issues"],["vis audit --format json","Output as JSON for CI integration"],["vis audit --format sarif","Output SARIF 2.1.0 for code-scanning uploads"],["vis audit --format csaf","Output CSAF 2.0 csaf_vex for enterprise vuln pipelines"],["vis audit --format cyclonedx-vex","Output a CycloneDX 1.7 BOM with vulnerabilities[] (SBOM + VEX)"],["vis audit --format gitlab","Output a GitLab dependency-scanning report (gl-dependency-scanning.json)"],["vis audit --format junit","Output a Surefire-compatible JUnit XML report"],["vis audit --report report.html","Write a self-contained HTML report to ./report.html"],["vis audit --usage","Only report vulnerabilities in statically-imported packages"],["vis audit --offline","Query the local OSV cache only (no network)"],["vis audit --offline --db ./vendor.sqlite","Use a specific advisory DB"],["vis audit --ecosystem npm,pypi","Scan multiple OSV ecosystems (npm, pypi, crates.io, maven, go, rubygems)"],["vis audit --prod-only","Skip devDependencies"],["vis audit --fail-on high","Exit non-zero on any high or critical finding"],["vis audit --show-fixes","Print fix-suggestion lines (no apply, no rescan)"],["vis audit --fix","Apply direct-dep upgrades for vulnerable packages, then rescan (dry-run preview by default)"],["vis audit --fix --yes","Skip the confirmation prompt and run the upgrades immediately"],["vis audit --fix --allow-major","Permit major-version bumps when the lowest fix is outside the existing range"],["vis audit --fix-transitive","Write PM-specific overrides for vulnerable transitives (dry-run preview by default)"],["vis audit --exit-code","Exit with code 1 if issues found (for CI)"],["vis audit --show-accepted","Include acknowledged risks in output"],["vis audit --sync","Sync accepted risks to native PM config (pnpm-workspace.yaml / .yarnrc.yml)"],["vis audit --policies license,vulnerability","Run only the named policies (default: every configured policy)"],["vis audit --policies none","Skip the policy engine entirely"],["vis audit --explain","Add a plain-English AI explanation under every finding (auto-detects an installed AI CLI)"],["vis audit --explain CVE-2021-23337","Explain only the finding with this CVE/GHSA id"],["vis audit --explain 2","Explain only the 2nd finding"]],group:"Security & Health",loader:hx(()=>import("./handler44.js"),"loader"),name:"audit",options:[{description:"Minimum severity to report: low, medium, high, critical (default: low)",name:"severity",type:String},{description:"Output format: table, json, sarif, csaf, cyclonedx-vex, gitlab, or junit (default: table)",name:"format",type:String},{description:"Write a self-contained HTML report to this path. Auto-opens in a TTY when not in CI.",name:"report",type:String},{defaultValue:!1,description:"Only report vulnerabilities in statically-imported packages (reachability filter).",name:"usage",type:Boolean},{defaultValue:!1,description:"Disable the reachability filter even if enabled in config.",name:"no-usage",type:Boolean},{defaultValue:!1,description:"Query the local OSV advisory cache only — no network calls. Errors if the cache is missing.",name:"offline",type:Boolean},{description:"Override the offline advisory DB path (default: <cache>/vis/advisories/db.sqlite).",name:"db",type:String},{description:"Comma-separated list of OSV ecosystems to scan (default: npm). Supported: npm, pypi, crates.io (or 'cargo'), maven, go, rubygems. Non-npm ecosystems require --offline (online OSV path is npm-only).",name:"ecosystem",type:String},{defaultValue:!1,description:"Skip devDependencies — scan production graph only.",name:"prod-only",type:Boolean},{description:"Exit non-zero when any finding is at this severity or higher. One of: low, medium, high, critical.",name:"fail-on",type:String},{defaultValue:!1,description:"Print fix-suggestion lines for each finding (no apply, no rescan)",name:"show-fixes",type:Boolean},{defaultValue:!1,description:"Apply direct-dep fixes for vulnerable packages by running the active PM update command, then rescan",name:"fix",type:Boolean},{defaultValue:!1,description:"Apply transitive fixes by writing PM-specific overrides (pnpm-workspace.yaml / package.json overrides / resolutions)",name:"fix-transitive",type:Boolean},{defaultValue:!1,description:"Skip confirmation prompt for --fix / --fix-transitive (required in CI)",name:"yes",type:Boolean},{defaultValue:!1,description:"Allow --fix to bump a direct dep across a major version when the lowest fix is outside the existing range",name:"allow-major",type:Boolean},{defaultValue:!1,description:"Exit with code 1 if any issues found (for CI)",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Include acknowledged (accepted risk) issues in output",name:"show-accepted",type:Boolean},{defaultValue:!1,description:"Sync vis accepted risks to native PM config (pnpm-workspace.yaml / .yarnrc.yml)",name:"sync",type:Boolean},{description:"Comma-separated list of supply-chain policies to evaluate (default: every configured policy). Use 'none' to skip the engine entirely, 'all' to force the full set. Known: malware, firstSeen, unexpectedDeps, publisherChange, installScripts, score, vulnerability, license.",name:"policies",type:String},{description:"Audit backend: 'auto' (default, delegates to 'aube audit' when aube is the installer), 'aube' (force delegate), or 'vis' (always use vis's OSV/Socket scanner).",name:"backend",type:String},{description:"Add a plain-English AI explanation to findings. Bare flag explains all findings at/above --severity; pass a finding index (e.g. 2) or a CVE/GHSA id to explain just one. Auto-detects an installed AI CLI; mutually exclusive with --offline.",name:"explain",type:String}]},_o={description:"Cache directory (overrides config and default). Relative paths are resolved against the workspace root.",name:"cache-dir",type:String},Nc={description:"Cache scope: 'shared' (default — main worktree's cache), 'worktree' (this checkout's local cache), or 'all' (both)",name:"scope",type:String},p0={description:"Cache type: 'task' (workspace task cache), 'ai' (AI response cache), 'socket' (Socket.dev reports), 'deps-dev' (Google deps.dev reports), or 'all' (default)",name:"type",type:String},gx={commandPath:["cache"],description:"List all cache entries",examples:[["vis cache list","List all cache entries"]],group:"Workspace",loader:Se(()=>Promise.resolve().then(()=>ls),"cacheListExecute"),name:"list",options:[_o,Nc,{description:"Output format: table or json (default: table)",name:"format",type:String}]},yx={commandPath:["cache"],description:"Remove cache entries (defaults to all stores: workspace task cache, AI responses, Socket.dev reports)",examples:[["vis cache clean","Remove all cache entries from every store"],["vis cache clean --type=ai","Clear only the AI response cache"],["vis cache clean --type=task","Clear only the workspace task cache"],["vis cache clean --dry-run","Preview what clean would remove"]],group:"Workspace",loader:Se(()=>Promise.resolve().then(()=>ls),"cacheCleanExecute"),name:"clean",options:[_o,p0,{defaultValue:!1,description:"Preview without deleting",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Skip the confirmation prompt for out-of-workspace cache directories",name:"force",type:Boolean}]},vx={commandPath:["cache"],description:"Remove old and oversized cache entries",examples:[["vis cache prune","Remove old and oversized entries"],["vis cache prune --max-age-days=3 --max-size=500MB","Prune with custom limits"],["vis cache prune --keep-last=30","Keep only the 30 most recent entries"]],group:"Workspace",loader:Se(()=>Promise.resolve().then(()=>ls),"cachePruneExecute"),name:"prune",options:[_o,Nc,{description:"Remove entries older than N days",name:"max-age-days",type:Number},{description:"Evict oldest entries until cache is under this size (e.g. 500MB)",name:"max-size",type:String},{description:"Keep only the N most recent entries (sorted newest-first by mtime)",name:"keep-last",type:Number}]},bx={commandPath:["cache"],description:"Print on-disk footprint and stats for one or more cache stores (task / ai / socket)",examples:[["vis cache size","Show stats for every cache store"],["vis cache size --type=ai","Show only the AI response cache (entries, size, oldest, newest)"],["vis cache size --type=task --format=json","Machine-readable task cache size"]],group:"Workspace",loader:Se(()=>Promise.resolve().then(()=>ls),"cacheSizeExecute"),name:"size",options:[_o,Nc,p0,{description:"Output format: table or json (default: table)",name:"format",type:String}]},Id={description:"Output format: table or json (default: table)",name:"format",type:String},d0={description:"Use a specific run ID from .vis/runs/ instead of the latest run",name:"run",type:String},$x={argument:{description:"Task ID to explain (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["cache"],description:"Explain why a task missed the cache by diffing hash inputs against the previous run",examples:[["vis cache why @myorg/app:build","Show which inputs changed since the last run"],["vis cache why @myorg/app:build --json","Machine-readable output for CI"],["vis cache why @myorg/app:build --run 2026-04-28T...","Inspect a specific historical run"]],group:"Workspace",loader:Se(()=>Promise.resolve().then(()=>ls),"cacheWhyExecute"),name:"why",options:[Id,d0]},wx={argument:{description:"Task ID to print the hash for (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["cache"],description:"Print the recorded hash and per-input hash details for a task",examples:[["vis cache hash @myorg/app:build","Show the resolved hash + contributing inputs"],["vis cache hash @myorg/app:build --json","Machine-readable output"]],group:"Workspace",loader:Se(()=>Promise.resolve().then(()=>ls),"cacheHashExecute"),name:"hash",options:[Id,d0]},kx={argument:{description:"Task ID to verify (e.g. @my/app:build)",name:"taskId",type:String},commandPath:["cache"],description:"Verify cache restore fidelity: extract the cached entry into a tmp directory and diff each file's content, mode, and mtime against the live workspace. Exits 1 on any drift (changed content, mode, mtime) or if a cached output is missing from the workspace. With --scope=all, the first cache directory containing the task is used.",examples:[["vis cache verify @myorg/app:build","Diff cached outputs vs live workspace files"],["vis cache verify @myorg/app:build --format=json","Machine-readable diff (status: ok | drift)"],["vis cache verify @myorg/app:build --cache-dir=.alt-cache","Verify against a non-default cache directory"],["vis cache verify @myorg/app:build --scope=all","Search shared and worktree caches for the task"]],group:"Workspace",loader:Se(()=>Promise.resolve().then(()=>ls),"cacheVerifyExecute"),name:"verify",options:[_o,Nc,Id]},Sx={commandPath:["cache"],description:"Probe the configured remote cache (HTTP HEAD or REAPI Capabilities) and report reachability, latency, and negotiated capabilities",examples:[["vis cache doctor","Probe the remoteCache configured in vis.config.ts"],["vis cache doctor --url=grpcs://cache.example.com:443 --backend=reapi","Override URL/backend ad-hoc"],["vis cache doctor --json","Machine-readable output"]],group:"Workspace",loader:Se(()=>import("./doctor-probe.js"),"cacheDoctorExecute"),name:"doctor",options:[{description:"Override remote cache URL (otherwise read from vis.config.ts remoteCache.url, or TURBO_API env var)",name:"url",type:String},{description:"Override backend selector: 'http' or 'reapi'",name:"backend",type:String},{description:"Output format: table or json (default: table)",name:"format",type:String},{defaultValue:5e3,description:"Probe timeout in milliseconds (default: 5000)",name:"timeout",type:Number}]},Dx=[gx,yx,vx,bx,$x,wx,kx,Sx];var Cx=Object.defineProperty,Ex=d((e,t)=>Cx(e,"name",{value:t,configurable:!0}),"e$V");const jx={alias:["c","outdated"],argument:{description:"Specific packages to check (checks all if omitted)",name:"packages",type:String},description:"Check for outdated dependencies, security vulnerabilities, and supply chain settings",examples:[["vis check","Check all catalog dependencies"],["vis check react","Check specific packages"],["vis check --target minor","Only show minor/patch updates"],["vis check --exclude '@types/*'","Exclude packages by pattern"],["vis check --no-security","Skip vulnerability scanning"],["vis check --security-config","Audit supply chain security settings"],["vis check --security-config --sync","Sync security config to pnpm-workspace.yaml"]],group:"Security & Health",loader:Ex(()=>import("./handler5.js"),"loader"),name:"check",options:[{alias:"t",description:"Update target: latest, minor, or patch (default: latest)",name:"target",type:String},{description:"Glob pattern to include packages (repeatable)",lazyMultiple:!0,name:"include",type:String},{description:"Glob pattern to exclude packages (repeatable)",lazyMultiple:!0,name:"exclude",type:String},{defaultValue:!1,description:"Include prerelease versions",name:"prerelease",type:Boolean},{defaultValue:!1,description:"Skip security vulnerability scanning",name:"no-security",type:Boolean},{defaultValue:!1,description:"Audit supply chain security settings",name:"security-config",type:Boolean},{defaultValue:!1,description:"Sync security settings to pnpm-workspace.yaml (pnpm only, requires --security-config)",name:"sync",type:Boolean},{description:"Output format: table, json, or minimal (default: table)",name:"format",type:String},{defaultValue:!1,description:"Exit with code 1 if outdated dependencies found (for CI)",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Run AI analysis on outdated packages",name:"ai",type:Boolean},{description:"AI analysis type: impact, security, compatibility, or recommend",name:"ai-type",type:String},{alias:"D",conflicts:"prod",description:"Check only devDependencies (npm/yarn mode)",name:"dev",type:Boolean},{alias:"P",conflicts:"dev",description:"Check only dependencies (npm/yarn mode)",name:"prod",type:Boolean},{defaultValue:!1,description:"Include peerDependencies in outdated checks",name:"peer",type:Boolean},{defaultValue:!1,description:"Also check workspace-owned package names against the registry",name:"include-internal",type:Boolean}]};var Ax=Object.defineProperty,xx=d((e,t)=>Ax(e,"name",{value:t,configurable:!0}),"e$U");const Ox={argument:{description:"Comma-separated list of targets to run (e.g., lint,test,build)",name:"targets",type:String},description:"Run affected targets in a CI-optimized pipeline",examples:[["vis ci lint,test,build","Run lint, test, and build on affected projects"],["vis ci test --base=origin/main","Override the base ref"],["vis ci build --no-install","Skip the install step (assume deps already present)"],["vis ci build --parallel=6","Increase concurrency"]],group:"Run & Execute",loader:xx(()=>import("./handler6.js"),"loader"),name:"ci",options:[{defaultValue:!0,description:"Install dependencies before running targets (use --no-install to skip)",name:"install",type:Boolean},{defaultValue:!1,description:"Skip the toolchain pre-flight (no auto-install for any pinned tool: node / pnpm / yarn / npm / bun / deno / go / python / ruby / rust)",name:"skip-toolchain",type:Boolean},{description:"Git base ref for affected detection (default: auto-detected from CI env)",name:"base",type:String},{description:"Git head ref for affected detection (default: HEAD)",name:"head",type:String},{defaultValue:"none",description:"Upstream scope: none | direct | deep",name:"upstream",type:String},{defaultValue:"deep",description:"Downstream scope: none | direct | deep",name:"downstream",type:String},{defaultValue:4,description:"Maximum number of parallel tasks per target",name:"parallel",type:Number},{description:'Partition tasks for distributed CI (e.g., "1/4")',name:"partition",type:String},{description:"Filter affected projects by a query (e.g. 'language=typescript && tag=lib')",name:"query",type:String}]};var Px=Object.defineProperty,Fx=d((e,t)=>Px(e,"name",{value:t,configurable:!0}),"e$T");const Bx={description:"Remove node_modules from all workspace projects",examples:[["vis clean","Remove all node_modules directories"],["vis clean --lockfile","Also remove lockfiles"],["vis clean --dry-run","Preview what would be removed"]],group:"Workspace",loader:Fx(()=>import("./handler7.js"),"loader"),name:"clean",options:[{alias:"l",defaultValue:!1,description:"Also remove lockfiles (pnpm-lock.yaml, package-lock.json, etc.)",name:"lockfile",type:Boolean},{defaultValue:!1,description:"Preview what would be removed without deleting",name:"dry-run",type:Boolean}]};var Rx=Object.defineProperty,Tx=d((e,t)=>Rx(e,"name",{value:t,configurable:!0}),"e$S");const Nx={argument:{description:"Template to use (e.g., vis:app, create-vite, user/repo) — omit for interactive mode",name:"template",type:String},description:"Create a new project from a template",examples:[["vis create","Interactive project scaffolding"],["vis create vis:monorepo my-workspace","Create a monorepo workspace"],["vis create vis:app my-app","Scaffold a Vite application"],["vis create vis:library my-lib","Create a TypeScript library"],["vis create vite my-app -- --template react-ts","Use create-vite with React TypeScript"],["vis create user/repo my-project","Clone a GitHub template"],["vis create --list","Show available templates"]],group:"Scaffold & Config",loader:Tx(()=>import("./handler39.js"),"loader"),name:"create",options:[{defaultValue:!1,description:"Show available templates",name:"list",type:Boolean},{description:"Generate editor configs (vscode)",name:"editor",type:String},{defaultValue:!1,description:"Initialize a git repository",name:"git-init",type:Boolean},{defaultValue:!1,description:"Skip interactive prompts",name:"no-interactive",type:Boolean}]};var Ix=Object.defineProperty,Kt=d((e,t)=>Ix(e,"name",{value:t,configurable:!0}),"r$I");const Ld=Kt(()=>D(Yg(),".vis"),"getVisHomeDir"),Ic=Kt(()=>D(Ld(),"cache"),"getVisCacheDir"),fn=Kt(()=>D(Ld(),"state"),"getVisStateDir"),Lx=Kt(e=>cS("sha256").update(e).digest("hex").slice(0,12),"hashWorkspace"),rJ=Kt(e=>D(Ld(),"workspaces",Lx(e)),"getVisWorkspaceDir"),f0=".vis",Pr=Kt(e=>D(e,f0),"getVisWorkspaceDataDir"),h0=`${f0}/cache`;Kt(e=>D(Pr(e),"cache"),"getVisWorkspaceCacheDir");const hn=Kt(e=>D(Pr(e),"runs"),"getVisRunsDir"),m0=Kt(e=>D(Pr(e),"last-summary.json"),"getVisLastSummaryPath"),nJ=Kt(e=>D(Pr(e),"last-failures"),"getVisLastFailuresDir"),sJ=Kt(e=>{const t=jp()==="win32";for(const r of[".task-runner",".task-runner-cache"]){const n=D(e,r);if(pc(n))try{const s=t?hh("cmd.exe",["/c","rmdir","/s","/q",n],{detached:!0,stdio:"ignore"}):hh("rm",["-rf",n],{detached:!0,stdio:"ignore"});s.on("error",()=>{}),s.unref()}catch{}}},"cleanupLegacyTaskRunnerLayout");var _x=Object.defineProperty,nn=d((e,t)=>_x(e,"name",{value:t,configurable:!0}),"i$u");const g0=nn((e,t,r)=>{const n=nn(i=>tn(i)?i:Ke(e,i),"normalize");if(t&&t.length>0)return n(t);if(r&&r.length>0)return n(r);const s=process.env.VIS_CACHE_DIRECTORY;return s&&s.length>0?n(s):Ke(e,h0)},"resolveCacheDirectory"),Mx=nn((e,t)=>t===!1?e:sS(e)??e,"resolveSharedCacheRoot"),Xh=nn((e,t,r,n)=>{const s=t??r??process.env.VIS_CACHE_DIRECTORY;if(s&&s.length>0)return g0(e,t,r);const i=Mx(e,n);return Ke(i,h0)},"resolveSharedCacheDirectory"),Wx=/[^\w.-]+/g,Vx=/^-+|-+$/g,Ux=nn(e=>e.trim().replaceAll(Wx,"-").replaceAll(Vx,"").slice(0,64),"sanitizeBranchSegment"),Gx=nn(e=>{try{const t=rS("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return!t||t==="HEAD"?void 0:t}catch{return}},"detectGitBranch"),iJ=nn((e,t,r)=>{if(r!==!0)return e;const n=Gx(t);if(!n)return e;const s=Ux(n);return s.length===0?e:Ke(e,"branches",s)},"applyBranchScope"),qx=nn((e,t)=>{const r=zn(t,e);return r.length===0?!1:r!==".."&&!r.startsWith("../")&&!tn(r)},"isCacheDirectoryInsideWorkspace"),Hx="x-hono-already-sent";var zx=Object.defineProperty,qa=d((e,t)=>zx(e,"name",{value:t,configurable:!0}),"o$K");(class{static{qa(this,"WSContext")}#e;constructor(e){this.#e=e,this.raw=e.raw,this.url=e.url?new URL(e.url):null,this.protocol=e.protocol??null}send(e,t){this.#e.send(e,t??{})}raw;binaryType="arraybuffer";get readyState(){return this.#e.readyState}url;protocol;close(e,t){this.#e.close(e,t)}});qa(e=>new MessageEvent("message",{data:e}),"createWSMessageEvent");var Jx=qa(e=>((...t)=>{if(typeof t[0]=="function"){const[r,n]=t;return qa(async function(s,i){const o=await r(s),a=await e(s,o,n);if(a)return a;await i()},"upgradeWebSocket")}else{const[r,n,s]=t;return(async()=>{const i=await e(r,n,s);if(!i)throw new Error("Failed to upgrade WebSocket");return i})()}}),"defineWebSocketHelper"),Kx=Object.defineProperty,G=d((e,t)=>Kx(e,"name",{value:t,configurable:!0}),"c$z"),er=class extends Error{static{d(this,"p")}static{G(this,"RequestError")}constructor(t,r){super(t,r),this.name="RequestError"}};const Yx=/^\/[!#$&-;=?-\[\]_a-z~]*$/,Xx=/\/\.\.?(?:[/?#]|$)/,Qx=/^[a-z0-9._-]+(?::(?:[1-5]\d{3,4}|[6-9]\d{3}))?$/,Zx=G((e,t,r)=>{const n=`${e}://${t}${r}`;if(Qx.test(t)){if(r.length===0)return n+"/";if(r.charCodeAt(0)!==47)throw new er("Invalid URL");return!Yx.test(r)||Xx.test(r)?new URL(n).href:n}else{const s=new URL(n);if(s.hostname.length!==t.length&&s.hostname!==(t.includes(":")?t.replace(/:\d+$/,""):t).toLowerCase())throw new er("Invalid host header");return s.href}},"buildUrl"),eO=G(e=>e instanceof er?e:new er(e.message,{cause:e}),"toRequestError"),tO=global.Request;var Ls=class extends tO{static{d(this,"H")}static{G(this,"Request$1")}constructor(t,r){if(typeof t=="object"&&Qr in t){const n=r!==void 0&&"body"in r&&r.body!=null;if(t[Fr]&&!n)throw new TypeError("Cannot construct a Request with a Request object that has already been used.");t=t[Qr]()}typeof r?.body?.getReader<"u"&&(r.duplex??="half"),super(t,r)}};const y0=G(e=>{const t=[],r=e.rawHeaders;for(let n=0,s=r.length;n<s;n+=2){const i=r[n];i.charCodeAt(0)!==58&&t.push([i,r[n+1]])}return new Headers(t)},"newHeadersFromIncoming"),v0=Symbol("wrapBodyStream"),rO=G((e,t,r,n,s)=>{const i={method:e,headers:r,signal:s.signal};if(e==="TRACE"){i.method="GET";const o=new Ls(t,i);return Object.defineProperty(o,"method",{get(){return"TRACE"}}),o}if(!(e==="GET"||e==="HEAD"))if("rawBody"in n&&n.rawBody instanceof Buffer)i.body=new ReadableStream({start(o){o.enqueue(n.rawBody),o.close()}});else if(n[v0]){let o;i.body=new ReadableStream({async pull(a){try{o||=bu.toWeb(n).getReader();const{done:c,value:l}=await o.read();c?a.close():a.enqueue(l)}catch(c){a.error(c)}}})}else i.body=bu.toWeb(n);return new Ls(t,i)},"newRequestFromIncoming"),Qr=Symbol("getRequestCache"),Cr=Symbol("requestCache"),_s=Symbol("incomingKey"),io=Symbol("urlKey"),b0=Symbol("methodKey"),$0=Symbol("headersKey"),Fi=Symbol("abortControllerKey"),Mu=Symbol("getAbortController"),Wu=Symbol("abortRequest"),js=Symbol("bodyBuffer"),ia=Symbol("bodyReadPromise"),Fr=Symbol("bodyConsumedDirectly"),Qh=Symbol("bodyLockReader"),zi=Symbol("abortReason"),w0=G(()=>new TypeError("Body is unusable"),"newBodyUnusableError"),Mo=G(()=>Promise.reject(w0()),"rejectBodyUnusable"),nO=new TextDecoder,sO=G(e=>{if(e[Fr])return Mo();e[Fr]=!0},"consumeBodyDirectOnce"),iO=G(e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),"toArrayBuffer"),oO=G(e=>(e[$0]||=y0(e[_s])).get("content-type")||"","contentType"),aO=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,cO=G(e=>{if(typeof e!="string"||e.length===0)return"GET";switch(e){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"POST":case"PUT":return e}const t=e.toUpperCase();switch(t){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"POST":case"PUT":return t;default:return e}},"normalizeIncomingMethod"),lO=G(e=>{if(!aO.test(e))return new TypeError(`'${e}' is not a valid HTTP method.`);const t=e.toUpperCase();if(t==="CONNECT"||t==="TRACK"||t==="TRACE"&&e!=="TRACE")return new TypeError(`'${e}' HTTP method is unsupported.`)},"validateDirectReadMethod"),_d=G((e,t,r)=>{if(e[Fr])return Mo();const n=e.method;if(n==="GET"||n==="HEAD")return e[Qr]()[t]();const s=lO(n);if(s)return Promise.reject(s);if(e[Cr]&&n!=="TRACE")return e[Cr][t]();const i=sO(e);if(i)return i;const o=uO(e);if(o){const a=Promise.resolve(r(o,e));return e[js]=void 0,a}return pO(e).then(a=>{const c=r(a,e);return e[js]=void 0,c})},"readBodyWithFastPath"),uO=G(e=>{const t=e[_s];if("rawBody"in t&&t.rawBody instanceof Buffer)return t.rawBody},"readRawBodyIfAvailable"),pO=G(e=>{if(e[js])return Promise.resolve(e[js]);if(e[ia])return e[ia];const t=e[_s];if(bu.isDisturbed(t))return Mo();const r=new Promise((n,s)=>{const i=[];let o=!1;const a=G(m=>{o||(o=!0,f(),m())},"finish"),c=G(m=>{i.push(Buffer.isBuffer(m)?m:Buffer.from(m))},"onData"),l=G(()=>{a(()=>{const m=i.length===1?i[0]:Buffer.concat(i);e[js]=m,n(m)})},"onEnd"),u=G(m=>{a(()=>{s(m)})},"onError"),p=G(()=>{if(t.readableEnded){l();return}a(()=>{if(t.errored){s(t.errored);return}const m=e[zi];if(m!==void 0){s(m instanceof Error?m:new Error(String(m)));return}s(new Error("Client connection prematurely closed."))})},"onClose"),f=G(()=>{t.off("data",c),t.off("end",l),t.off("error",u),t.off("close",p),e[ia]=void 0},"cleanup");t.on("data",c),t.on("end",l),t.on("error",u),t.on("close",p),queueMicrotask(()=>{o||(t.readableEnded?l():t.errored?u(t.errored):t.destroyed&&p())})});return e[ia]=r,r},"readBodyDirect"),gr={get method(){return this[b0]},get url(){return this[io]},get headers(){return this[$0]||=y0(this[_s])},[Wu](e){this[zi]===void 0&&(this[zi]=e);const t=this[Fi];t&&!t.signal.aborted&&t.abort(e)},[Mu](){return this[Fi]||=new AbortController,this[zi]!==void 0&&!this[Fi].signal.aborted&&this[Fi].abort(this[zi]),this[Fi]},[Qr](){const e=this[Mu]();if(this[Cr])return this[Cr];const t=this.method;if(this[Fr]&&!(t==="GET"||t==="HEAD")){this[js]=void 0;const r={method:t==="TRACE"?"GET":t,headers:this.headers,signal:e.signal};t!=="TRACE"&&(r.body=new ReadableStream({start(s){s.close()}}),r.duplex="half");const n=new Ls(this[io],r);return t==="TRACE"&&Object.defineProperty(n,"method",{get(){return"TRACE"}}),this[Cr]=n}return this[Cr]=rO(this.method,this[io],this.headers,this[_s],e)},get body(){if(!this[Fr])return this[Qr]().body;const e=this[Qr]();return!this[Qh]&&e.body&&(this[Qh]=e.body.getReader()),e.body},get bodyUsed(){return this[Fr]?!0:this[Cr]?this[Cr].bodyUsed:!1}};Object.defineProperty(gr,"signal",{get(){return this[Mu]().signal}});["cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","keepalive"].forEach(e=>{Object.defineProperty(gr,e,{get(){return this[Qr]()[e]}})});["clone","formData"].forEach(e=>{Object.defineProperty(gr,e,{value:G(function(){if(this[Fr]){if(e==="clone")throw w0();return Mo()}return this[Qr]()[e]()},"value")})});Object.defineProperty(gr,"text",{value:G(function(){return _d(this,"text",e=>nO.decode(e))},"value")});Object.defineProperty(gr,"arrayBuffer",{value:G(function(){return _d(this,"arrayBuffer",e=>iO(e))},"value")});Object.defineProperty(gr,"blob",{value:G(function(){return _d(this,"blob",(e,t)=>{const r=oO(t),n=r?{headers:{"content-type":r}}:void 0;return new Response(e,n).blob()})},"value")});Object.defineProperty(gr,"json",{value:G(function(){return this[Fr]?Mo():this.text().then(JSON.parse)},"value")});Object.defineProperty(gr,Symbol.for("nodejs.util.inspect.custom"),{value:G(function(e,t,r){return`Request (lightweight) ${r({method:this.method,url:this.url,headers:this.headers,nativeRequest:this[Cr]},{...t,depth:e==null?null:e-1})}`},"value")});Object.setPrototypeOf(gr,Ls.prototype);const dO=G((e,t)=>{const r=Object.create(gr);r[_s]=e,r[b0]=cO(e.method);const n=e.url||"";if(n[0]!=="/"&&(n.startsWith("http://")||n.startsWith("https://"))){if(e instanceof Zi)throw new er("Absolute URL for :path is not allowed in HTTP/2");try{r[io]=new URL(n).href}catch(o){throw new er("Invalid absolute URL",{cause:o})}return r}const s=(e instanceof Zi?e.authority:e.headers.host)||t;if(!s)throw new er("Missing host header");let i;if(e instanceof Zi){if(i=e.scheme,!(i==="http"||i==="https"))throw new er("Unsupported scheme")}else i=e.socket&&e.socket.encrypted?"https":"http";try{r[io]=Zx(i,s,n)}catch(o){throw o instanceof er?o:new er("Invalid URL",{cause:o})}return r},"newRequest"),qr="text/plain; charset=UTF-8",Vu=Symbol("responseCache"),ws=Symbol("getResponseCache"),Jr=Symbol("cache"),Md=global.Response;var fr=class k0{static{d(this,"Q")}static{G(this,"Response$1")}#e;#t;[ws](){return delete this[Jr],this[Vu]||=new Md(this.#e,this.#t)}constructor(t,r){let n;if(this.#e=t,r instanceof k0){const s=r[Vu];if(s){this.#t=s,this[ws]();return}else this.#t=r.#t,n=new Headers(r.#t.headers)}else this.#t=r;(t==null||typeof t=="string"||typeof t?.getReader<"u"||t instanceof Blob||t instanceof Uint8Array)&&(this[Jr]=[r?.status||200,t??null,n||r?.headers])}get headers(){const t=this[Jr];return t?(t[2]instanceof Headers||(t[2]=new Headers(t[2]||(t[1]===null?void 0:{"content-type":qr}))),t[2]):this[ws]().headers}get status(){return this[Jr]?.[0]??this[ws]().status}get ok(){const t=this.status;return t>=200&&t<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(fr.prototype,e,{get(){return this[ws]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(fr.prototype,e,{value:G(function(){return this[ws]()[e]()},"value")})});Object.defineProperty(fr.prototype,Symbol.for("nodejs.util.inspect.custom"),{value:G(function(e,t,r){return`Response (lightweight) ${r({status:this.status,headers:this.headers,ok:this.ok,nativeResponse:this[Vu]},{...t,depth:e==null?null:e-1})}`},"value")});Object.setPrototypeOf(fr,Md);Object.setPrototypeOf(fr.prototype,Md.prototype);const fO=/^https?:\/\/[!#-;=?-[\]_a-z~A-Z]+$/,hO=G(e=>e instanceof URL?e.href:fO.test(e)?e:new URL(e).href,"parseRedirectUrl"),mO=new Set([301,302,303,307,308]);Object.defineProperty(fr,"redirect",{value:G(function(e,t=302){if(!mO.has(t))throw new RangeError("Invalid status code");return new fr(null,{status:t,headers:{location:hO(e)}})},"redirect"),writable:!0,configurable:!0});Object.defineProperty(fr,"json",{value:G(function(e,t){const r=JSON.stringify(e);if(r===void 0)throw new TypeError("The data is not JSON serializable");const n=t?.headers;let s;return n?(s=new Headers(n),s.has("content-type")||s.set("content-type","application/json")):s={"content-type":"application/json"},new fr(r,{status:t?.status??200,statusText:t?.statusText,headers:s})},"json"),writable:!0,configurable:!0});async function S0(e){return Promise.race([e,Promise.resolve().then(()=>Promise.resolve(void 0))])}d(S0,"$e$4");G(S0,"readWithoutBlocking");function Wd(e,t,r){const n=G(a=>{e.cancel(a).catch(()=>{})},"cancel");return t.on("close",n),t.on("error",n),(r??e.read()).then(o,s),e.closed.finally(()=>{t.off("close",n),t.off("error",n)});function s(a){a&&t.destroy(a)}function i(){e.read().then(o,s)}function o({done:a,value:c}){try{if(a)t.end();else if(!t.write(c))t.once("drain",i);else return e.read().then(o,s)}catch(l){s(l)}}}d(Wd,"ee$4");G(Wd,"writeFromReadableStreamDefaultReader");function Uu(e,t){if(e.locked)throw new TypeError("ReadableStream is locked.");return t.destroyed?void 0:Wd(e.getReader(),t)}d(Uu,"F$h");G(Uu,"writeFromReadableStream");const Gu=G((e,t)=>{const r={};if(e instanceof Headers||(e=new Headers(e??void 0)),e.has("set-cookie")){const n=[];for(const[s,i]of e)s==="set-cookie"?n.push(i):r[s]=i;n.length>0&&(r["set-cookie"]=n)}else for(const[n,s]of e)r[n]=s;return t&&(r["content-type"]??=t),r},"buildOutgoingHttpHeaders"),Ha=Symbol("outgoingEnded"),Zh=Symbol("incomingDraining"),gO=500,yO=64*1024*1024,D0=G(e=>{const t=e;if(e.destroyed||t[Zh])return;if(t[Zh]=!0,e instanceof Zi){try{e.stream?.close?.(dS.NGHTTP2_NO_ERROR)}catch{}return}let r=0;const n=G(()=>{clearTimeout(i),e.off("data",o),e.off("end",n),e.off("error",n)},"cleanup"),s=G(()=>{n();const a=e.socket;a&&!a.destroyed&&a.destroySoon()},"forceClose"),i=setTimeout(s,gO);i.unref?.();const o=G(a=>{r+=a.length,r>yO&&s()},"onData");e.on("data",o),e.on("end",n),e.on("error",n),e.resume()},"drainIncoming"),vO=G((e,t,r,n)=>()=>{t.errored?e[Wu](t.errored.toString()):r.writableFinished||e[Wu]("Client connection prematurely closed."),n&&!t.readableEnded&&setTimeout(()=>{t.readableEnded||setTimeout(()=>{D0(t)})})},"makeCloseHandler"),bO=G(e=>{if(!(Jr in e))return!1;const t=e[Jr][1];return t===null||typeof t=="string"||t instanceof Uint8Array},"isImmediateCacheableResponse"),$O=G(()=>new Response(null,{status:400}),"handleRequestError"),C0=G(e=>new Response(null,{status:e instanceof Error&&(e.name==="TimeoutError"||e.constructor.name==="TimeoutError")?504:500}),"handleFetchError"),za=G((e,t)=>{const r=e instanceof Error?e:new Error("unknown error",{cause:e});r.code==="ERR_STREAM_PREMATURE_CLOSE"?console.info("The user aborted a request."):(console.error(e),t.headersSent||t.writeHead(500,{"Content-Type":"text/plain"}),t.end(`Error: ${r.message}`),t.destroy(r))},"handleResponseError"),qu=G(e=>{"flushHeaders"in e&&e.writable&&e.flushHeaders()},"flushHeaders"),E0=G(async(e,t)=>{let[r,n,s]=e[Jr];if(!s){n===null?(t.writeHead(r),t.end()):typeof n=="string"?(t.writeHead(r,{"Content-Type":qr,"Content-Length":Buffer.byteLength(n)}),t.end(n)):n instanceof Uint8Array?(t.writeHead(r,{"Content-Type":qr,"Content-Length":n.byteLength}),t.end(n)):n instanceof Blob?(t.writeHead(r,{"Content-Type":qr,"Content-Length":n.size}),t.end(new Uint8Array(await n.arrayBuffer()))):(t.writeHead(r,{"Content-Type":qr}),qu(t),await Uu(n,t)?.catch(o=>za(o,t))),t[Ha]?.();return}let i=!1;if(s instanceof Headers)i=s.has("content-length"),s=Gu(s,n===null?void 0:qr);else if(Array.isArray(s)){const o=new Headers(s);i=o.has("content-length"),s=Gu(o,n===null?void 0:qr)}else for(const o in s)if(o.length===14&&o.toLowerCase()==="content-length"){i=!0;break}i||(typeof n=="string"?s["Content-Length"]=Buffer.byteLength(n):n instanceof Uint8Array?s["Content-Length"]=n.byteLength:n instanceof Blob&&(s["Content-Length"]=n.size)),t.writeHead(r,s),n==null?t.end():typeof n=="string"||n instanceof Uint8Array?t.end(n):n instanceof Blob?t.end(new Uint8Array(await n.arrayBuffer())):(qu(t),await Uu(n,t)?.catch(o=>za(o,t))),t[Ha]?.()},"responseViaCache"),j0=G(e=>typeof e.then=="function","isPromise"),wO=G(async(e,t,r={})=>{if(j0(e))if(r.errorHandler)try{e=await e}catch(s){const i=await r.errorHandler(s);if(!i)return;e=i}else e=await e.catch(C0);if(Jr in e)return E0(e,t);const n=Gu(e.headers,e.body===null?void 0:qr);if(e.body){const s=e.body.getReader(),i=[];let o=!1,a;if(n["transfer-encoding"]!=="chunked"){let c=2;for(let l=0;l<c;l++){a||=s.read();const u=await S0(a).catch(p=>{console.error(p),o=!0});if(!u){if(l===1){await new Promise(p=>setTimeout(p)),c=3;continue}break}if(a=void 0,u.value&&i.push(u.value),u.done){o=!0;break}}o&&!("content-length"in n)&&(n["content-length"]=i.reduce((l,u)=>l+u.length,0))}t.writeHead(e.status,n),i.forEach(c=>{t.write(c)}),o?t.end():(i.length===0&&qu(t),await Wd(s,t,a))}else n[Hx]||(t.writeHead(e.status,n),t.end());t[Ha]?.()},"responseViaResponseObject"),kO=G((e,t={})=>{const r=t.autoCleanupIncoming??!0;return t.overrideGlobalObjects!==!1&&global.Request!==Ls&&(Object.defineProperty(global,"Request",{value:Ls}),Object.defineProperty(global,"Response",{value:fr})),async(n,s)=>{let i,o,a=!1,c=!1;const l=G(()=>{!o||c||(c=!0,s.on("close",vO(o,n,s,a)))},"ensureCloseHandler");try{if(o=dO(n,t.hostname),a=r&&!(n.method==="GET"||n.method==="HEAD"),a&&(n[v0]=!0,n instanceof Zi&&(s[Ha]=()=>{n.readableEnded||setTimeout(()=>{n.readableEnded||setTimeout(()=>{n.destroy(),s.destroy()})})})),i=e(o,{incoming:n,outgoing:s}),!j0(i)&&bO(i))return a&&!n.readableEnded&&s.once("finish",()=>{n.readableEnded||D0(n)}),E0(i,s);l()}catch(u){if(i)return za(u,s);if(t.errorHandler){if(l(),i=await t.errorHandler(o?u:eO(u)),!i)return}else o?i=C0(u):i=$O()}try{return await wO(i,s,t)}catch(u){return za(u,s)}}},"getRequestListener"),SO=globalThis.CloseEvent??class extends Event{#e;constructor(e,t={}){super(e,t),this.#e=t}get wasClean(){return this.#e.wasClean??!1}get code(){return this.#e.code??0}get reason(){return this.#e.reason??""}},DO=G(()=>Symbol("connection"),"generateConnectionSymbol"),A0=Symbol("CONNECTION_SYMBOL_KEY"),x0=Symbol("WAIT_FOR_WEBSOCKET_SYMBOL"),CO=new Set(["connection","content-length","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","transfer-encoding","upgrade","sec-websocket-accept","sec-websocket-extensions","sec-websocket-protocol"]),O0=G((e,t)=>{t&&t.forEach((r,n)=>{CO.has(n.toLowerCase())||e.push(`${n}: ${r}`)})},"appendResponseHeaders"),em=G((e,t,r)=>{const n=["Connection: close","Content-Length: 0"];O0(n,r),e.end(`HTTP/1.1 ${t.toString()} ${pS[t]??""}\r
|
|
977
977
|
${n.join(`\r
|
|
978
978
|
`)}\r
|
|
979
979
|
\r
|
|
980
|
-
`)},"rejectUpgradeRequest"),EO=G(e=>{const t=e.socket.encrypted?"https":"http",r=new URL(e.url??"/",`${t}://${e.headers.host??"localhost"}`),n=new Headers;for(const s in e.headers){const i=e.headers[s];i&&n.append(s,Array.isArray(i)?i[0]:i)}return new Request(r,{headers:n})},"createUpgradeRequest"),jO=G(e=>{const{server:t,fetchCallback:r,wss:n}=e,s=new Map;n.on("connection",(o,a)=>{const c=s.get(a);c&&(c.resolve(o),s.delete(a))});const i=G((o,a)=>new Promise(c=>{s.set(o,{resolve:c,connectionSymbol:a})}),"waitForWebSocket");t.on("upgrade",async(o,a,c)=>{if(o.headers.upgrade?.toLowerCase()!=="websocket")return;const l={incoming:o,outgoing:void 0,wss:n,[x0]:i};let u=400,p;try{const $=await r(EO(o),l);$ instanceof Response&&(u=$.status,p=$.headers)}catch{t.listenerCount("upgrade")===1&&em(a,500);return}const f=s.get(o);if(!f||f.connectionSymbol!==l[A0]){s.delete(o),t.listenerCount("upgrade")===1&&em(a,u,p);return}const m=G($=>{O0($,p)},"addResponseHeaders");n.on("headers",m);try{n.handleUpgrade(o,a,c,$=>{n.emit("connection",$,o)})}finally{n.off("headers",m)}}),t.on("close",()=>{n.close()})},"setupWebSocket");Jx(async(e,t,r)=>{if(e.req.header("upgrade")?.toLowerCase()!=="websocket")return;const n=e.env,s=n[x0];if(!s||!n.incoming)return new Response(null,{status:500});const i=DO();return n[A0]=i,(async()=>{const o=await s(n.incoming,i),a=[],c=G((p,f)=>{a.push([p,f])},"bufferMessage");o.on("message",c);const l={binaryType:"arraybuffer",close(p,f){o.close(p,f)},protocol:o.protocol,raw:o,get readyState(){return o.readyState},send(p,f){o.send(p,{compress:f?.compress})},url:new URL(e.req.url)};try{t?.onOpen?.(new Event("open"),l)}catch(p){(r?.onError??console.error)(p)}const u=G((p,f)=>{const m=Array.isArray(p)?p:[p];for(const $ of m)try{t?.onMessage?.(new MessageEvent("message",{data:f?$ instanceof ArrayBuffer?$:$.buffer.slice($.byteOffset,$.byteOffset+$.byteLength):$.toString("utf-8")}),l)}catch(b){(r?.onError??console.error)(b)}},"handleMessage");o.off("message",c);for(const p of a)u(...p);o.on("message",(p,f)=>{u(p,f)}),o.on("close",(p,f)=>{try{t?.onClose?.(new SO("close",{code:p,reason:f.toString()}),l)}catch(m){(r?.onError??console.error)(m)}}),o.on("error",p=>{try{t?.onError?.(new ErrorEvent("error",{error:p}),l)}catch(f){(r?.onError??console.error)(f)}})})(),new Response});const AO=G(e=>{const t=e.fetch,r=kO(t,{hostname:e.hostname,overrideGlobalObjects:e.overrideGlobalObjects,autoCleanupIncoming:e.autoCleanupIncoming}),n=(e.createServer||uS)(e.serverOptions||{},r);if(e.websocket&&e.websocket.server){if(e.websocket.server.options.noServer!==!0)throw new Error("WebSocket server must be created with { noServer: true } option");jO({server:n,fetchCallback:t,wss:e.websocket.server})}return n},"createAdaptorServer"),xO=G((e,t)=>{const r=AO(e);return r.listen(e?.port??3e3,e.hostname,()=>{const n=r.address();t&&t(n)}),r},"serve");var OO=Object.defineProperty,PO=d((e,t)=>OO(e,"name",{value:t,configurable:!0}),"t$z"),tm=PO((e,t,r)=>(n,s)=>{let i=-1;return o(0);async function o(a){if(a<=i)throw new Error("next() called multiple times");i=a;let c,l=!1,u;if(e[a]?(u=e[a][0][0],n.req.routeIndex=a):u=a===e.length&&s||void 0,u)try{c=await u(n,()=>o(a+1))}catch(p){if(p instanceof Error&&t)n.error=p,c=await t(p,n),l=!0;else throw p}else n.finalized===!1&&r&&(c=await r(n));return c&&(n.finalized===!1||l)&&(n.res=c),n}},"compose"),FO=Object.defineProperty,BO=d((e,t)=>FO(e,"name",{value:t,configurable:!0}),"t$y"),RO=class extends Error{static{d(this,"a")}static{BO(this,"HTTPException")}res;status;constructor(t=500,r){super(r?.message,{cause:r?.cause}),this.res=r?.res,this.status=t}getResponse(){return this.res?new Response(this.res.body,{status:this.status,headers:this.res.headers}):new Response(this.message,{status:this.status})}},TO=Symbol(),NO=Object.defineProperty,Wo=d((e,t)=>NO(e,"name",{value:t,configurable:!0}),"o$J"),IO=Wo(async(e,t=Object.create(null))=>{const{all:r=!1,dot:n=!1}=t,s=(e instanceof L0?e.raw.headers:e.headers).get("Content-Type");return s?.startsWith("multipart/form-data")||s?.startsWith("application/x-www-form-urlencoded")?P0(e,{all:r,dot:n}):{}},"parseBody");async function P0(e,t){const r=await e.formData();return r?F0(r,t):{}}d(P0,"f$j");Wo(P0,"parseFormData");function F0(e,t){const r=Object.create(null);return e.forEach((n,s)=>{t.all||s.endsWith("[]")?LO(r,s,n):r[s]=n}),t.dot&&Object.entries(r).forEach(([n,s])=>{n.includes(".")&&(_O(r,n,s),delete r[n])}),r}d(F0,"h$m");Wo(F0,"convertFormDataToBodyData");var LO=Wo((e,t,r)=>{e[t]!==void 0?Array.isArray(e[t])?e[t].push(r):e[t]=[e[t],r]:t.endsWith("[]")?e[t]=[r]:e[t]=r},"handleParsingAllValues"),_O=Wo((e,t,r)=>{if(/(?:^|\.)__proto__\./.test(t))return;let n=e;const s=t.split(".");s.forEach((i,o)=>{o===s.length-1?n[i]=r:((!n[i]||typeof n[i]!="object"||Array.isArray(n[i])||n[i]instanceof File)&&(n[i]=Object.create(null)),n=n[i])})},"handleParsingNestedValues"),MO=Object.defineProperty,gt=d((e,t)=>MO(e,"name",{value:t,configurable:!0}),"s$v"),B0=gt(e=>{const t=e.split("/");return t[0]===""&&t.shift(),t},"splitPath"),WO=gt(e=>{const{groups:t,path:r}=VO(e),n=B0(r);return UO(n,t)},"splitRoutingPath"),VO=gt(e=>{const t=[];return e=e.replace(/\{[^}]+\}/g,(r,n)=>{const s=`@${n}`;return t.push([s,r]),s}),{groups:t,path:e}},"extractGroupsFromPath"),UO=gt((e,t)=>{for(let r=t.length-1;r>=0;r--){const[n]=t[r];for(let s=e.length-1;s>=0;s--)if(e[s].includes(n)){e[s]=e[s].replace(n,t[r][1]);break}}return e},"replaceGroupMarks"),oa={},GO=gt((e,t)=>{if(e==="*")return"*";const r=e.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);if(r){const n=`${e}#${t}`;return oa[n]||(r[2]?oa[n]=t&&t[0]!==":"&&t[0]!=="*"?[n,r[1],new RegExp(`^${r[2]}(?=/${t})`)]:[e,r[1],new RegExp(`^${r[2]}$`)]:oa[n]=[e,r[1],!0]),oa[n]}return null},"getPattern"),Vd=gt((e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,r=>{try{return t(r)}catch{return r}})}},"tryDecode"),qO=gt(e=>Vd(e,decodeURI),"tryDecodeURI"),R0=gt(e=>{const t=e.url,r=t.indexOf("/",t.indexOf(":")+4);let n=r;for(;n<t.length;n++){const s=t.charCodeAt(n);if(s===37){const i=t.indexOf("?",n),o=t.indexOf("#",n),a=i===-1?o===-1?void 0:o:o===-1?i:Math.min(i,o),c=t.slice(r,a);return qO(c.includes("%25")?c.replace(/%25/g,"%2525"):c)}else if(s===63||s===35)break}return t.slice(r,n)},"getPath");gt(e=>{const t=e.indexOf("?",8);return t===-1?"":"?"+e.slice(t+1)},"getQueryStrings");var HO=gt(e=>{const t=R0(e);return t.length>1&&t.at(-1)==="/"?t.slice(0,-1):t},"getPathNoStrict"),ms=gt((e,t,...r)=>(r.length&&(t=ms(t,...r)),`${e?.[0]==="/"?"":"/"}${e}${t==="/"?"":`${e?.at(-1)==="/"?"":"/"}${t?.[0]==="/"?t.slice(1):t}`}`),"mergePath"),T0=gt(e=>{if(e.charCodeAt(e.length-1)!==63||!e.includes(":"))return null;const t=e.split("/"),r=[];let n="";return t.forEach(s=>{if(s!==""&&!/\:/.test(s))n+="/"+s;else if(/\:/.test(s))if(/\?/.test(s)){r.length===0&&n===""?r.push("/"):r.push(n);const i=s.replace("?","");n+="/"+i,r.push(n)}else n+="/"+s}),r.filter((s,i,o)=>o.indexOf(s)===i)},"checkOptionalParameter"),Hl=gt(e=>/[%+]/.test(e)?(e.indexOf("+")!==-1&&(e=e.replace(/\+/g," ")),e.indexOf("%")!==-1?Vd(e,I0):e):e,"_decodeURI"),N0=gt((e,t,r)=>{let n;if(!r&&t&&!/[%+]/.test(t)){let o=e.indexOf("?",8);if(o===-1)return;for(e.startsWith(t,o+1)||(o=e.indexOf(`&${t}`,o+1));o!==-1;){const a=e.charCodeAt(o+t.length+1);if(a===61){const c=o+t.length+2,l=e.indexOf("&",c);return Hl(e.slice(c,l===-1?void 0:l))}else if(a==38||isNaN(a))return"";o=e.indexOf(`&${t}`,o+1)}if(n=/[%+]/.test(e),!n)return}const s={};n??=/[%+]/.test(e);let i=e.indexOf("?",8);for(;i!==-1;){const o=e.indexOf("&",i+1);let a=e.indexOf("=",i);a>o&&o!==-1&&(a=-1);let c=e.slice(i+1,a===-1?o===-1?void 0:o:a);if(n&&(c=Hl(c)),i=o,c==="")continue;let l;a===-1?l="":(l=e.slice(a+1,o===-1?void 0:o),n&&(l=Hl(l))),r?(s[c]&&Array.isArray(s[c])||(s[c]=[]),s[c].push(l)):s[c]??=l}return t?s[t]:s},"_getQueryParam"),zO=N0,JO=gt((e,t)=>N0(e,t,!0),"getQueryParams"),I0=decodeURIComponent,KO=Object.defineProperty,Ja=d((e,t)=>KO(e,"name",{value:t,configurable:!0}),"s$u"),rm=Ja(e=>Vd(e,I0),"tryDecodeURIComponent"),L0=class{static{d(this,"w")}static{Ja(this,"HonoRequest")}raw;#e;#t;routeIndex=0;path;bodyCache={};constructor(t,r="/",n=[[]]){this.raw=t,this.path=r,this.#t=n,this.#e={}}param(t){return t?this.#r(t):this.#i()}#r(t){const r=this.#t[0][this.routeIndex][1][t],n=this.#n(r);return n&&/\%/.test(n)?rm(n):n}#i(){const t={},r=Object.keys(this.#t[0][this.routeIndex][1]);for(const n of r){const s=this.#n(this.#t[0][this.routeIndex][1][n]);s!==void 0&&(t[n]=/\%/.test(s)?rm(s):s)}return t}#n(t){return this.#t[1]?this.#t[1][t]:t}query(t){return zO(this.url,t)}queries(t){return JO(this.url,t)}header(t){if(t)return this.raw.headers.get(t)??void 0;const r={};return this.raw.headers.forEach((n,s)=>{r[s]=n}),r}async parseBody(t){return IO(this,t)}#o=Ja(t=>{const{bodyCache:r,raw:n}=this,s=r[t];if(s)return s;const i=Object.keys(r)[0];return i?r[i].then(o=>(i==="json"&&(o=JSON.stringify(o)),new Response(o)[t]())):r[t]=n[t]()},"#cachedBody");json(){return this.#o("text").then(t=>JSON.parse(t))}text(){return this.#o("text")}arrayBuffer(){return this.#o("arrayBuffer")}bytes(){return this.#o("arrayBuffer").then(t=>new Uint8Array(t))}blob(){return this.#o("blob")}formData(){return this.#o("formData")}addValidatedData(t,r){this.#e[t]=r}valid(t){return this.#e[t]}get url(){return this.raw.url}get method(){return this.raw.method}get[TO](){return this.#t}get matchedRoutes(){return this.#t[0].map(([[,t]])=>t)}get routePath(){return this.#t[0].map(([[,t]])=>t)[this.routeIndex].path}};Ja(async e=>{if(!e.raw.bodyUsed)return e.raw.clone();const t=Object.keys(e.bodyCache)[0];if(!t)throw new RO(500,{message:"Cannot clone request: body was already consumed and not cached. Please use HonoRequest methods (e.g., req.json(), req.text()) instead of consuming req.raw directly."});const r={body:await e[t](),cache:e.raw.cache,credentials:e.raw.credentials,headers:e.header(),integrity:e.raw.integrity,keepalive:e.raw.keepalive,method:e.method,mode:e.raw.mode,redirect:e.raw.redirect,referrer:e.raw.referrer,referrerPolicy:e.raw.referrerPolicy,signal:e.raw.signal};return new Request(e.url,r)},"cloneRawRequest");var YO=Object.defineProperty,Vo=d((e,t)=>YO(e,"name",{value:t,configurable:!0}),"o$I"),Ud={Stringify:1},_0=Vo((e,t)=>{const r=new String(e);return r.isEscaped=!0,r.callbacks=t,r},"raw"),XO=/[&<>'"]/;Vo(async(e,t)=>{let r="";t||=[];const n=await Promise.all(e);for(let s=n.length-1;r+=n[s],s--,!(s<0);s--){let i=n[s];typeof i=="object"&&t.push(...i.callbacks||[]);const o=i.isEscaped;if(i=await(typeof i=="object"?i.toString():i),typeof i=="object"&&t.push(...i.callbacks||[]),i.isEscaped??o)r+=i;else{const a=[r];QO(i,a),r=a[0]}}return _0(r,t)},"stringBufferToString");var QO=Vo((e,t)=>{const r=e.search(XO);if(r===-1){t[0]+=e;return}let n,s,i=0;for(s=r;s<e.length;s++){switch(e.charCodeAt(s)){case 34:n=""";break;case 39:n="'";break;case 38:n="&";break;case 60:n="<";break;case 62:n=">";break;default:continue}t[0]+=e.substring(i,s)+n,i=s+1}t[0]+=e.substring(i,s)},"escapeToBuffer");Vo(e=>{const t=e.callbacks;if(!t?.length)return e;const r=[e],n={};return t.forEach(s=>s({phase:Ud.Stringify,buffer:r,context:n})),r[0]},"resolveCallbackSync");var Gd=Vo(async(e,t,r,n,s)=>{typeof e=="object"&&!(e instanceof String)&&(e instanceof Promise||(e=e.toString()),e instanceof Promise&&(e=await e));const i=e.callbacks;if(!i?.length)return Promise.resolve(e);s?s[0]+=e:s=[e];const o=Promise.all(i.map(a=>a({phase:t,buffer:s,context:n}))).then(a=>Promise.all(a.filter(Boolean).map(c=>Gd(c,t,!1,n,s))).then(()=>s[0]));return r?_0(await o,i):o},"resolveCallback"),ZO=Object.defineProperty,He=d((e,t)=>ZO(e,"name",{value:t,configurable:!0}),"s$t"),M0="text/plain; charset=UTF-8",zl=He((e,t)=>({"Content-Type":e,...t}),"setDefaultContentType"),Bi=He((e,t)=>new Response(e,t),"createResponseInstance"),eP=class{static{d(this,"w")}static{He(this,"Context")}#e;#t;env={};#r;finalized=!1;error;#i;#n;#o;#x;#m;#l;#f;#u;#a;constructor(t,r){this.#e=t,r&&(this.#n=r.executionCtx,this.env=r.env,this.#l=r.notFoundHandler,this.#a=r.path,this.#u=r.matchResult)}get req(){return this.#t??=new L0(this.#e,this.#a,this.#u),this.#t}get event(){if(this.#n&&"respondWith"in this.#n)return this.#n;throw Error("This context has no FetchEvent")}get executionCtx(){if(this.#n)return this.#n;throw Error("This context has no ExecutionContext")}get res(){return this.#o||=Bi(null,{headers:this.#f??=new Headers})}set res(t){if(this.#o&&t){t=Bi(t.body,t);for(const[r,n]of this.#o.headers.entries())if(r!=="content-type")if(r==="set-cookie"){const s=this.#o.headers.getSetCookie();t.headers.delete("set-cookie");for(const i of s)t.headers.append("set-cookie",i)}else t.headers.set(r,n)}this.#o=t,this.finalized=!0}render=He((...t)=>(this.#m??=r=>this.html(r),this.#m(...t)),"render");setLayout=He(t=>this.#x=t,"setLayout");getLayout=He(()=>this.#x,"getLayout");setRenderer=He(t=>{this.#m=t},"setRenderer");header=He((t,r,n)=>{this.finalized&&(this.#o=Bi(this.#o.body,this.#o));const s=this.#o?this.#o.headers:this.#f??=new Headers;r===void 0?s.delete(t):n?.append?s.append(t,r):s.set(t,r)},"header");status=He(t=>{this.#i=t},"status");set=He((t,r)=>{this.#r??=new Map,this.#r.set(t,r)},"set");get=He(t=>this.#r?this.#r.get(t):void 0,"get");get var(){return this.#r?Object.fromEntries(this.#r):{}}#s(t,r,n){const s=this.#o?new Headers(this.#o.headers):this.#f??new Headers;if(typeof r=="object"&&"headers"in r){const o=r.headers instanceof Headers?r.headers:new Headers(r.headers);for(const[a,c]of o)a.toLowerCase()==="set-cookie"?s.append(a,c):s.set(a,c)}if(n)for(const[o,a]of Object.entries(n))if(typeof a=="string")s.set(o,a);else{s.delete(o);for(const c of a)s.append(o,c)}const i=typeof r=="number"?r:r?.status??this.#i;return Bi(t,{status:i,headers:s})}newResponse=He((...t)=>this.#s(...t),"newResponse");body=He((t,r,n)=>this.#s(t,r,n),"body");text=He((t,r,n)=>!this.#f&&!this.#i&&!r&&!n&&!this.finalized?new Response(t):this.#s(t,r,zl(M0,n)),"text");json=He((t,r,n)=>this.#s(JSON.stringify(t),r,zl("application/json",n)),"json");html=He((t,r,n)=>{const s=He(i=>this.#s(i,r,zl("text/html; charset=UTF-8",n)),"res");return typeof t=="object"?Gd(t,Ud.Stringify,!1,{}).then(s):s(t)},"html");redirect=He((t,r)=>{const n=String(t);return this.header("Location",/[^\x00-\xFF]/.test(n)?encodeURI(n):n),this.newResponse(null,r??302)},"redirect");notFound=He(()=>(this.#l??=()=>Bi(),this.#l(this)),"notFound")},tP=Object.defineProperty,rP=d((e,t)=>tP(e,"name",{value:t,configurable:!0}),"r$H"),Ne="ALL",nP="all",sP=["get","post","put","delete","options","patch"],W0="Can not add a route since the matcher is already built.",V0=class extends Error{static{d(this,"_")}static{rP(this,"UnsupportedPathError")}},iP="__COMPOSED_HANDLER",oP=Object.defineProperty,Vt=d((e,t)=>oP(e,"name",{value:t,configurable:!0}),"l$n"),aP=Vt(e=>e.text("404 Not Found",404),"notFoundHandler"),nm=Vt((e,t)=>{if("getResponse"in e){const r=e.getResponse();return t.newResponse(r.body,r)}return console.error(e),t.text("Internal Server Error",500)},"errorHandler"),cP=class U0{static{d(this,"m")}static{Vt(this,"_Hono")}get;post;put;delete;options;patch;all;on;use;router;getPath;_basePath="/";#e="/";routes=[];constructor(t={}){[...sP,nP].forEach(s=>{this[s]=(i,...o)=>(typeof i=="string"?this.#e=i:this.#i(s,this.#e,i),o.forEach(a=>{this.#i(s,this.#e,a)}),this)}),this.on=(s,i,...o)=>{for(const a of[i].flat()){this.#e=a;for(const c of[s].flat())o.map(l=>{this.#i(c.toUpperCase(),this.#e,l)})}return this},this.use=(s,...i)=>(typeof s=="string"?this.#e=s:(this.#e="*",i.unshift(s)),i.forEach(o=>{this.#i(Ne,this.#e,o)}),this);const{strict:r,...n}=t;Object.assign(this,n),this.getPath=r??!0?t.getPath??R0:HO}#t(){const t=new U0({router:this.router,getPath:this.getPath});return t.errorHandler=this.errorHandler,t.#r=this.#r,t.routes=this.routes,t}#r=aP;errorHandler=nm;route(t,r){const n=this.basePath(t);return r.routes.map(s=>{let i;r.errorHandler===nm?i=s.handler:(i=Vt(async(o,a)=>(await tm([],r.errorHandler)(o,()=>s.handler(o,a))).res,"handler"),i[iP]=s.handler),n.#i(s.method,s.path,i)}),this}basePath(t){const r=this.#t();return r._basePath=ms(this._basePath,t),r}onError=Vt(t=>(this.errorHandler=t,this),"onError");notFound=Vt(t=>(this.#r=t,this),"notFound");mount(t,r,n){let s,i;n&&(typeof n=="function"?i=n:(i=n.optionHandler,n.replaceRequest===!1?s=Vt(c=>c,"replaceRequest"):s=n.replaceRequest));const o=i?c=>{const l=i(c);return Array.isArray(l)?l:[l]}:c=>{let l;try{l=c.executionCtx}catch{}return[c.env,l]};s||=(()=>{const c=ms(this._basePath,t),l=c==="/"?0:c.length;return u=>{const p=new URL(u.url);return p.pathname=p.pathname.slice(l)||"/",new Request(p,u)}})();const a=Vt(async(c,l)=>{const u=await r(s(c.req.raw),...o(c));if(u)return u;await l()},"handler");return this.#i(Ne,ms(t,"*"),a),this}#i(t,r,n){t=t.toUpperCase(),r=ms(this._basePath,r);const s={basePath:this._basePath,path:r,method:t,handler:n};this.router.add(t,r,[n,s]),this.routes.push(s)}#n(t,r){if(t instanceof Error)return this.errorHandler(t,r);throw t}#o(t,r,n,s){if(s==="HEAD")return(async()=>new Response(null,await this.#o(t,r,n,"GET")))();const i=this.getPath(t,{env:n}),o=this.router.match(s,i),a=new eP(t,{path:i,matchResult:o,env:n,executionCtx:r,notFoundHandler:this.#r});if(o[0].length===1){let l;try{l=o[0][0][0][0](a,async()=>{a.res=await this.#r(a)})}catch(u){return this.#n(u,a)}return l instanceof Promise?l.then(u=>u||(a.finalized?a.res:this.#r(a))).catch(u=>this.#n(u,a)):l??this.#r(a)}const c=tm(o[0],this.errorHandler,this.#r);return(async()=>{try{const l=await c(a);if(!l.finalized)throw new Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");return l.res}catch(l){return this.#n(l,a)}})()}fetch=Vt((t,...r)=>this.#o(t,r[1],r[0],t.method),"fetch");request=Vt((t,r,n,s)=>t instanceof Request?this.fetch(r?new Request(t,r):t,n,s):(t=t.toString(),this.fetch(new Request(/^https?:\/\//.test(t)?t:`http://localhost${ms("/",t)}`,r),n,s)),"request");fire=Vt(()=>{addEventListener("fetch",t=>{t.respondWith(this.#o(t.request,t,void 0,t.request.method))})},"fire")},lP=Object.defineProperty,G0=d((e,t)=>lP(e,"name",{value:t,configurable:!0}),"a$v"),qd=[];function Hd(e,t){const r=this.buildAllMatchers(),n=G0(((s,i)=>{const o=r[s]||r[Ne],a=o[2][i];if(a)return a;const c=i.match(o[0]);if(!c)return[[],qd];const l=c.indexOf("",1);return[o[1][l],c]}),"match2");return this.match=n,n(e,t)}d(Hd,"d$m");G0(Hd,"match");var uP=Object.defineProperty,q0=d((e,t)=>uP(e,"name",{value:t,configurable:!0}),"_$h"),Ka="[^/]+",oo=".*",ao="(?:|/.*)",Ji=Symbol(),pP=new Set(".\\+*[^]$()");function H0(e,t){return e.length===1?t.length===1?e<t?-1:1:-1:t.length===1||e===oo||e===ao?1:t===oo||t===ao?-1:e===Ka?1:t===Ka?-1:e.length===t.length?e<t?-1:1:t.length-e.length}d(H0,"L$g");q0(H0,"compareKey");var dP=class Hu{static{d(this,"v")}static{q0(this,"_Node")}#e;#t;#r=Object.create(null);insert(t,r,n,s,i){if(t.length===0){if(this.#e!==void 0)throw Ji;if(i)return;this.#e=r;return}const[o,...a]=t,c=o==="*"?a.length===0?["","",oo]:["","",Ka]:o==="/*"?["","",ao]:o.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);let l;if(c){const u=c[1];let p=c[2]||Ka;if(u&&c[2]&&(p===".*"||(p=p.replace(/^\((?!\?:)(?=[^)]+\)$)/,"(?:"),/\((?!\?:)/.test(p))))throw Ji;if(l=this.#r[p],!l){if(Object.keys(this.#r).some(f=>f!==oo&&f!==ao))throw Ji;if(i)return;l=this.#r[p]=new Hu,u!==""&&(l.#t=s.varIndex++)}!i&&u!==""&&n.push([u,l.#t])}else if(l=this.#r[o],!l){if(Object.keys(this.#r).some(u=>u.length>1&&u!==oo&&u!==ao))throw Ji;if(i)return;l=this.#r[o]=new Hu}l.insert(a,r,n,s,i)}buildRegExpStr(){const t=Object.keys(this.#r).sort(H0).map(r=>{const n=this.#r[r];return(typeof n.#t=="number"?`(${r})@${n.#t}`:pP.has(r)?`\\${r}`:r)+n.buildRegExpStr()});return typeof this.#e=="number"&&t.unshift(`#${this.#e}`),t.length===0?"":t.length===1?t[0]:"(?:"+t.join("|")+")"}},fP=Object.defineProperty,hP=d((e,t)=>fP(e,"name",{value:t,configurable:!0}),"p$q"),mP=class{static{d(this,"g")}static{hP(this,"Trie")}#e={varIndex:0};#t=new dP;insert(t,r,n){const s=[],i=[];for(let a=0;;){let c=!1;if(t=t.replace(/\{[^}]+\}/g,l=>{const u=`@\\${a}`;return i[a]=[u,l],a++,c=!0,u}),!c)break}const o=t.match(/(?::[^\/]+)|(?:\/\*$)|./g)||[];for(let a=i.length-1;a>=0;a--){const[c]=i[a];for(let l=o.length-1;l>=0;l--)if(o[l].indexOf(c)!==-1){o[l]=o[l].replace(c,i[a][1]);break}}return this.#t.insert(o,r,s,this.#e,n),s}buildRegExp(){let t=this.#t.buildRegExpStr();if(t==="")return[/^$/,[],[]];let r=0;const n=[],s=[];return t=t.replace(/#(\d+)|@(\d+)|\.\*\$/g,(i,o,a)=>o!==void 0?(n[++r]=Number(o),"$()"):(a!==void 0&&(s[Number(a)]=++r),"")),[new RegExp(`^${t}`),n,s]}},gP=Object.defineProperty,Uo=d((e,t)=>gP(e,"name",{value:t,configurable:!0}),"g$e"),yP=[/^$/,[],Object.create(null)],z0=Object.create(null);function zd(e){return z0[e]??=new RegExp(e==="*"?"":`^${e.replace(/\/\*$|([.\\+*[^\]$()])/g,(t,r)=>r?`\\${r}`:"(?:|/.*)")}$`)}d(zd,"M$k");Uo(zd,"buildWildcardRegExp");function J0(){z0=Object.create(null)}d(J0,"D$i");Uo(J0,"clearWildcardRegExpCache");function K0(e){const t=new mP,r=[];if(e.length===0)return yP;const n=e.map(l=>[!/\*|\/:/.test(l[0]),...l]).sort(([l,u],[p,f])=>l?1:p?-1:u.length-f.length),s=Object.create(null);for(let l=0,u=-1,p=n.length;l<p;l++){const[f,m,$]=n[l];f?s[m]=[$.map(([k])=>[k,Object.create(null)]),qd]:u++;let b;try{b=t.insert(m,u,f)}catch(k){throw k===Ji?new V0(m):k}f||(r[u]=$.map(([k,S])=>{const y=Object.create(null);for(S-=1;S>=0;S--){const[h,v]=b[S];y[h]=v}return[k,y]}))}const[i,o,a]=t.buildRegExp();for(let l=0,u=r.length;l<u;l++)for(let p=0,f=r[l].length;p<f;p++){const m=r[l][p]?.[1];if(!m)continue;const $=Object.keys(m);for(let b=0,k=$.length;b<k;b++)m[$[b]]=a[m[$[b]]]}const c=[];for(const l in o)c[l]=r[o[l]];return[i,c,s]}d(K0,"H$c");Uo(K0,"buildMatcherFromPreprocessedRoutes");function Dn(e,t){if(e){for(const r of Object.keys(e).sort((n,s)=>s.length-n.length))if(zd(r).test(t))return[...e[r]]}}d(Dn,"p$p");Uo(Dn,"findMiddleware");var Y0=class{static{d(this,"I")}static{Uo(this,"RegExpRouter")}name="RegExpRouter";#e;#t;constructor(){this.#e={[Ne]:Object.create(null)},this.#t={[Ne]:Object.create(null)}}add(t,r,n){const s=this.#e,i=this.#t;if(!s||!i)throw new Error(W0);s[t]||[s,i].forEach(c=>{c[t]=Object.create(null),Object.keys(c[Ne]).forEach(l=>{c[t][l]=[...c[Ne][l]]})}),r==="/*"&&(r="*");const o=(r.match(/\/:/g)||[]).length;if(/\*$/.test(r)){const c=zd(r);t===Ne?Object.keys(s).forEach(l=>{s[l][r]||=Dn(s[l],r)||Dn(s[Ne],r)||[]}):s[t][r]||=Dn(s[t],r)||Dn(s[Ne],r)||[],Object.keys(s).forEach(l=>{(t===Ne||t===l)&&Object.keys(s[l]).forEach(u=>{c.test(u)&&s[l][u].push([n,o])})}),Object.keys(i).forEach(l=>{(t===Ne||t===l)&&Object.keys(i[l]).forEach(u=>c.test(u)&&i[l][u].push([n,o]))});return}const a=T0(r)||[r];for(let c=0,l=a.length;c<l;c++){const u=a[c];Object.keys(i).forEach(p=>{(t===Ne||t===p)&&(i[p][u]||=[...Dn(s[p],u)||Dn(s[Ne],u)||[]],i[p][u].push([n,o-l+c+1]))})}}match=Hd;buildAllMatchers(){const t=Object.create(null);return Object.keys(this.#t).concat(Object.keys(this.#e)).forEach(r=>{t[r]||=this.#r(r)}),this.#e=this.#t=void 0,J0(),t}#r(t){const r=[];let n=t===Ne;return[this.#e,this.#t].forEach(s=>{const i=s[t]?Object.keys(s[t]).map(o=>[o,s[t][o]]):[];i.length!==0?(n||=!0,r.push(...i)):t!==Ne&&r.push(...Object.keys(s[Ne]).map(o=>[o,s[Ne][o]]))}),n?K0(r):null}},vP=Object.defineProperty,Ya=d((e,t)=>vP(e,"name",{value:t,configurable:!0}),"a$u");(class{static{Ya(this,"PreparedRegExpRouter")}name="PreparedRegExpRouter";#e;#t;constructor(e,t){this.#e=e,this.#t=t}#r(e,t){const r=this.#e[e];r[1].forEach(n=>n&&n.push(t)),Object.values(r[2]).forEach(n=>n[0].push(t))}#i(e,t,r,n,s){const i=this.#e[e];s?n.forEach(o=>{typeof o=="number"?i[1][o].push([r,s]):i[2][o||t][0].push([r,s])}):i[2][t][0].push([r,{}])}add(e,t,r){if(!this.#e[e]){const s=this.#e[Ne],i={};for(const o in s[2])i[o]=[s[2][o][0].slice(),qd];this.#e[e]=[s[0],s[1].map(o=>Array.isArray(o)?o.slice():0),i]}if(t==="/*"||t==="*"){const s=[r,{}];if(e===Ne)for(const i in this.#e)this.#r(i,s);else this.#r(e,s);return}const n=this.#t[t];if(!n)throw new Error(`Path ${t} is not registered`);for(const[s,i]of n)if(e===Ne)for(const o in this.#e)this.#i(o,t,r,s,i);else this.#i(e,t,r,s,i)}buildAllMatchers(){return this.#e}match=Hd});Ya(({paths:e})=>{const t=class extends Y0{static{d(this,"e")}static{Ya(this,"RegExpRouterWithMatcherExport")}buildAndExportAllMatchers(){return this.buildAllMatchers()}},r=new t;for(const o of e)r.add(Ne,o,o);const n=r.buildAndExportAllMatchers(),s=n[Ne],i={};for(const o of e)if(!(o==="/*"||o==="*")){s[1].forEach((a,c)=>{a.forEach(([l,u])=>{l===o&&(i[o]?i[o][0][1]={...i[o][0][1],...u}:i[o]=[[[],u]],i[o][0][0].findIndex(p=>p===c)===-1&&i[o][0][0].push(c))})});for(const a in s[2])s[2][a][0].forEach(([c])=>{if(c===o){i[o]||=[[[]]];const l=a===o?"":a;i[o][0][0].findIndex(u=>u===l)===-1&&i[o][0][0].push(l)}})}for(let o=0,a=s[1].length;o<a;o++)s[1][o]=s[1][o]?[]:0;for(const o in s[2])s[2][o][0]=[];return[n,i]},"buildInitParams");Ya(([e,t])=>{const r=JSON.stringify(e,(s,i)=>i instanceof RegExp?`##${i.toString()}##`:i).replace(/"##(.+?)##"/g,(s,i)=>i.replace(/\\\\/g,"\\")),n=JSON.stringify(t);return`[${r},${n}]`},"serializeInitParams");var bP=Object.defineProperty,$P=d((e,t)=>bP(e,"name",{value:t,configurable:!0}),"c$w"),wP=class{static{d(this,"f")}static{$P(this,"SmartRouter")}name="SmartRouter";#e=[];#t=[];constructor(t){this.#e=t.routers}add(t,r,n){if(!this.#t)throw new Error(W0);this.#t.push([t,r,n])}match(t,r){if(!this.#t)throw new Error("Fatal error");const n=this.#e,s=this.#t,i=n.length;let o=0,a;for(;o<i;o++){const c=n[o];try{for(let l=0,u=s.length;l<u;l++)c.add(...s[l]);a=c.match(t,r)}catch(l){if(l instanceof V0)continue;throw l}this.match=c.match.bind(c),this.#e=[c],this.#t=void 0;break}if(o===i)throw new Error("Fatal error");return this.name=`SmartRouter + ${this.activeRouter.name}`,a}get activeRouter(){if(this.#t||this.#e.length!==1)throw new Error("No active router has been determined yet.");return this.#e[0]}},kP=Object.defineProperty,X0=d((e,t)=>kP(e,"name",{value:t,configurable:!0}),"k$m"),Ri=Object.create(null),SP=X0(e=>{for(const t in e)return!0;return!1},"hasChildren"),DP=class Q0{static{d(this,"E")}static{X0(this,"_Node")}#e;#t;#r;#i=0;#n=Ri;constructor(t,r,n){if(this.#t=n||Object.create(null),this.#e=[],t&&r){const s=Object.create(null);s[t]={handler:r,possibleKeys:[],score:0},this.#e=[s]}this.#r=[]}insert(t,r,n){this.#i=++this.#i;let s=this;const i=WO(r),o=[];for(let a=0,c=i.length;a<c;a++){const l=i[a],u=i[a+1],p=GO(l,u),f=Array.isArray(p)?p[0]:l;if(f in s.#t){s=s.#t[f],p&&o.push(p[1]);continue}s.#t[f]=new Q0,p&&(s.#r.push(p),o.push(p[1])),s=s.#t[f]}return s.#e.push({[t]:{handler:n,possibleKeys:o.filter((a,c,l)=>l.indexOf(a)===c),score:this.#i}}),s}#o(t,r,n,s,i){for(let o=0,a=r.#e.length;o<a;o++){const c=r.#e[o],l=c[n]||c[Ne],u={};if(l!==void 0&&(l.params=Object.create(null),t.push(l),s!==Ri||i&&i!==Ri))for(let p=0,f=l.possibleKeys.length;p<f;p++){const m=l.possibleKeys[p],$=u[l.score];l.params[m]=i?.[m]&&!$?i[m]:s[m]??i?.[m],u[l.score]=!0}}}search(t,r){const n=[];this.#n=Ri;let s=[this];const i=B0(r),o=[],a=i.length;let c=null;for(let l=0;l<a;l++){const u=i[l],p=l===a-1,f=[];for(let $=0,b=s.length;$<b;$++){const k=s[$],S=k.#t[u];S&&(S.#n=k.#n,p?(S.#t["*"]&&this.#o(n,S.#t["*"],t,k.#n),this.#o(n,S,t,k.#n)):f.push(S));for(let y=0,h=k.#r.length;y<h;y++){const v=k.#r[y],w=k.#n===Ri?{}:{...k.#n};if(v==="*"){const O=k.#t["*"];O&&(this.#o(n,O,t,k.#n),O.#n=w,f.push(O));continue}const[g,E,C]=v;if(!u&&!(C instanceof RegExp))continue;const A=k.#t[g];if(C instanceof RegExp){if(c===null){c=new Array(a);let V=r[0]==="/"?1:0;for(let fe=0;fe<a;fe++)c[fe]=V,V+=i[fe].length+1}const O=r.substring(c[l]),I=C.exec(O);if(I){if(w[E]=I[0],this.#o(n,A,t,k.#n,w),SP(A.#t)){A.#n=w;const V=I[0].match(/\//)?.length??0;(o[V]||=[]).push(A)}continue}}(C===!0||C.test(u))&&(w[E]=u,p?(this.#o(n,A,t,w,k.#n),A.#t["*"]&&this.#o(n,A.#t["*"],t,w,k.#n)):(A.#n=w,f.push(A)))}}const m=o.shift();s=m?f.concat(m):f}return n.length>1&&n.sort((l,u)=>l.score-u.score),[n.map(({handler:l,params:u})=>[l,u])]}},CP=Object.defineProperty,EP=d((e,t)=>CP(e,"name",{value:t,configurable:!0}),"s$s"),jP=class{static{d(this,"u")}static{EP(this,"TrieRouter")}name="TrieRouter";#e;constructor(){this.#e=new DP}add(t,r,n){const s=T0(r);if(s){for(let i=0,o=s.length;i<o;i++)this.#e.insert(t,s[i],n);return}this.#e.insert(t,r,n)}match(t,r){return this.#e.search(t,r)}},AP=Object.defineProperty,xP=d((e,t)=>AP(e,"name",{value:t,configurable:!0}),"o$G"),OP=class extends cP{static{d(this,"p")}static{xP(this,"Hono")}constructor(t={}){super(t),this.router=t.router??new wP({routers:[new Y0,new jP]})}},PP=Object.defineProperty,sm=d((e,t)=>PP(e,"name",{value:t,configurable:!0}),"r$G"),Z0=class{static{d(this,"n")}static{sm(this,"StreamingApi")}writer;encoder;writable;abortSubscribers=[];responseReadable;aborted=!1;closed=!1;constructor(t,r){this.writable=t,this.writer=t.getWriter(),this.encoder=new TextEncoder;const n=r.getReader();this.abortSubscribers.push(async()=>{await n.cancel()}),this.responseReadable=new ReadableStream({async pull(s){const{done:i,value:o}=await n.read();i?s.close():s.enqueue(o)},cancel:sm(()=>{this.closed||this.abort()},"cancel")})}async write(t){try{typeof t=="string"&&(t=this.encoder.encode(t)),await this.writer.write(t)}catch{}return this}async writeln(t){return await this.write(t+`
|
|
981
|
-
`),this}sleep(t){return new Promise(r=>setTimeout(r,t))}async close(){this.closed=!0;try{await this.writer.close()}catch{}}async pipe(t){this.writer.releaseLock(),await t.pipeTo(this.writable,{preventClose:!0}),this.writer=this.writable.getWriter()}onAbort(t){this.abortSubscribers.push(t)}abort(){this.aborted||(this.aborted=!0,this.abortSubscribers.forEach(t=>t()))}},FP=Object.defineProperty,im=d((e,t)=>FP(e,"name",{value:t,configurable:!0}),"r$
|
|
980
|
+
`)},"rejectUpgradeRequest"),EO=G(e=>{const t=e.socket.encrypted?"https":"http",r=new URL(e.url??"/",`${t}://${e.headers.host??"localhost"}`),n=new Headers;for(const s in e.headers){const i=e.headers[s];i&&n.append(s,Array.isArray(i)?i[0]:i)}return new Request(r,{headers:n})},"createUpgradeRequest"),jO=G(e=>{const{server:t,fetchCallback:r,wss:n}=e,s=new Map;n.on("connection",(o,a)=>{const c=s.get(a);c&&(c.resolve(o),s.delete(a))});const i=G((o,a)=>new Promise(c=>{s.set(o,{resolve:c,connectionSymbol:a})}),"waitForWebSocket");t.on("upgrade",async(o,a,c)=>{if(o.headers.upgrade?.toLowerCase()!=="websocket")return;const l={incoming:o,outgoing:void 0,wss:n,[x0]:i};let u=400,p;try{const $=await r(EO(o),l);$ instanceof Response&&(u=$.status,p=$.headers)}catch{t.listenerCount("upgrade")===1&&em(a,500);return}const f=s.get(o);if(!f||f.connectionSymbol!==l[A0]){s.delete(o),t.listenerCount("upgrade")===1&&em(a,u,p);return}const m=G($=>{O0($,p)},"addResponseHeaders");n.on("headers",m);try{n.handleUpgrade(o,a,c,$=>{n.emit("connection",$,o)})}finally{n.off("headers",m)}}),t.on("close",()=>{n.close()})},"setupWebSocket");Jx(async(e,t,r)=>{if(e.req.header("upgrade")?.toLowerCase()!=="websocket")return;const n=e.env,s=n[x0];if(!s||!n.incoming)return new Response(null,{status:500});const i=DO();return n[A0]=i,(async()=>{const o=await s(n.incoming,i),a=[],c=G((p,f)=>{a.push([p,f])},"bufferMessage");o.on("message",c);const l={binaryType:"arraybuffer",close(p,f){o.close(p,f)},protocol:o.protocol,raw:o,get readyState(){return o.readyState},send(p,f){o.send(p,{compress:f?.compress})},url:new URL(e.req.url)};try{t?.onOpen?.(new Event("open"),l)}catch(p){(r?.onError??console.error)(p)}const u=G((p,f)=>{const m=Array.isArray(p)?p:[p];for(const $ of m)try{t?.onMessage?.(new MessageEvent("message",{data:f?$ instanceof ArrayBuffer?$:$.buffer.slice($.byteOffset,$.byteOffset+$.byteLength):$.toString("utf-8")}),l)}catch(b){(r?.onError??console.error)(b)}},"handleMessage");o.off("message",c);for(const p of a)u(...p);o.on("message",(p,f)=>{u(p,f)}),o.on("close",(p,f)=>{try{t?.onClose?.(new SO("close",{code:p,reason:f.toString()}),l)}catch(m){(r?.onError??console.error)(m)}}),o.on("error",p=>{try{t?.onError?.(new ErrorEvent("error",{error:p}),l)}catch(f){(r?.onError??console.error)(f)}})})(),new Response});const AO=G(e=>{const t=e.fetch,r=kO(t,{hostname:e.hostname,overrideGlobalObjects:e.overrideGlobalObjects,autoCleanupIncoming:e.autoCleanupIncoming}),n=(e.createServer||uS)(e.serverOptions||{},r);if(e.websocket&&e.websocket.server){if(e.websocket.server.options.noServer!==!0)throw new Error("WebSocket server must be created with { noServer: true } option");jO({server:n,fetchCallback:t,wss:e.websocket.server})}return n},"createAdaptorServer"),xO=G((e,t)=>{const r=AO(e);return r.listen(e?.port??3e3,e.hostname,()=>{const n=r.address();t&&t(n)}),r},"serve");var OO=Object.defineProperty,PO=d((e,t)=>OO(e,"name",{value:t,configurable:!0}),"t$z"),tm=PO((e,t,r)=>(n,s)=>{let i=-1;return o(0);async function o(a){if(a<=i)throw new Error("next() called multiple times");i=a;let c,l=!1,u;if(e[a]?(u=e[a][0][0],n.req.routeIndex=a):u=a===e.length&&s||void 0,u)try{c=await u(n,()=>o(a+1))}catch(p){if(p instanceof Error&&t)n.error=p,c=await t(p,n),l=!0;else throw p}else n.finalized===!1&&r&&(c=await r(n));return c&&(n.finalized===!1||l)&&(n.res=c),n}},"compose"),FO=Object.defineProperty,BO=d((e,t)=>FO(e,"name",{value:t,configurable:!0}),"t$y"),RO=class extends Error{static{d(this,"a")}static{BO(this,"HTTPException")}res;status;constructor(t=500,r){super(r?.message,{cause:r?.cause}),this.res=r?.res,this.status=t}getResponse(){return this.res?new Response(this.res.body,{status:this.status,headers:this.res.headers}):new Response(this.message,{status:this.status})}},TO=Symbol(),NO=Object.defineProperty,Wo=d((e,t)=>NO(e,"name",{value:t,configurable:!0}),"o$J"),IO=Wo(async(e,t=Object.create(null))=>{const{all:r=!1,dot:n=!1}=t,s=(e instanceof L0?e.raw.headers:e.headers).get("Content-Type");return s?.startsWith("multipart/form-data")||s?.startsWith("application/x-www-form-urlencoded")?P0(e,{all:r,dot:n}):{}},"parseBody");async function P0(e,t){const r=await e.formData();return r?F0(r,t):{}}d(P0,"f$j");Wo(P0,"parseFormData");function F0(e,t){const r=Object.create(null);return e.forEach((n,s)=>{t.all||s.endsWith("[]")?LO(r,s,n):r[s]=n}),t.dot&&Object.entries(r).forEach(([n,s])=>{n.includes(".")&&(_O(r,n,s),delete r[n])}),r}d(F0,"h$m");Wo(F0,"convertFormDataToBodyData");var LO=Wo((e,t,r)=>{e[t]!==void 0?Array.isArray(e[t])?e[t].push(r):e[t]=[e[t],r]:t.endsWith("[]")?e[t]=[r]:e[t]=r},"handleParsingAllValues"),_O=Wo((e,t,r)=>{if(/(?:^|\.)__proto__\./.test(t))return;let n=e;const s=t.split(".");s.forEach((i,o)=>{o===s.length-1?n[i]=r:((!n[i]||typeof n[i]!="object"||Array.isArray(n[i])||n[i]instanceof File)&&(n[i]=Object.create(null)),n=n[i])})},"handleParsingNestedValues"),MO=Object.defineProperty,gt=d((e,t)=>MO(e,"name",{value:t,configurable:!0}),"s$v"),B0=gt(e=>{const t=e.split("/");return t[0]===""&&t.shift(),t},"splitPath"),WO=gt(e=>{const{groups:t,path:r}=VO(e),n=B0(r);return UO(n,t)},"splitRoutingPath"),VO=gt(e=>{const t=[];return e=e.replace(/\{[^}]+\}/g,(r,n)=>{const s=`@${n}`;return t.push([s,r]),s}),{groups:t,path:e}},"extractGroupsFromPath"),UO=gt((e,t)=>{for(let r=t.length-1;r>=0;r--){const[n]=t[r];for(let s=e.length-1;s>=0;s--)if(e[s].includes(n)){e[s]=e[s].replace(n,t[r][1]);break}}return e},"replaceGroupMarks"),oa={},GO=gt((e,t)=>{if(e==="*")return"*";const r=e.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);if(r){const n=`${e}#${t}`;return oa[n]||(r[2]?oa[n]=t&&t[0]!==":"&&t[0]!=="*"?[n,r[1],new RegExp(`^${r[2]}(?=/${t})`)]:[e,r[1],new RegExp(`^${r[2]}$`)]:oa[n]=[e,r[1],!0]),oa[n]}return null},"getPattern"),Vd=gt((e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,r=>{try{return t(r)}catch{return r}})}},"tryDecode"),qO=gt(e=>Vd(e,decodeURI),"tryDecodeURI"),R0=gt(e=>{const t=e.url,r=t.indexOf("/",t.indexOf(":")+4);let n=r;for(;n<t.length;n++){const s=t.charCodeAt(n);if(s===37){const i=t.indexOf("?",n),o=t.indexOf("#",n),a=i===-1?o===-1?void 0:o:o===-1?i:Math.min(i,o),c=t.slice(r,a);return qO(c.includes("%25")?c.replace(/%25/g,"%2525"):c)}else if(s===63||s===35)break}return t.slice(r,n)},"getPath");gt(e=>{const t=e.indexOf("?",8);return t===-1?"":"?"+e.slice(t+1)},"getQueryStrings");var HO=gt(e=>{const t=R0(e);return t.length>1&&t.at(-1)==="/"?t.slice(0,-1):t},"getPathNoStrict"),ms=gt((e,t,...r)=>(r.length&&(t=ms(t,...r)),`${e?.[0]==="/"?"":"/"}${e}${t==="/"?"":`${e?.at(-1)==="/"?"":"/"}${t?.[0]==="/"?t.slice(1):t}`}`),"mergePath"),T0=gt(e=>{if(e.charCodeAt(e.length-1)!==63||!e.includes(":"))return null;const t=e.split("/"),r=[];let n="";return t.forEach(s=>{if(s!==""&&!/\:/.test(s))n+="/"+s;else if(/\:/.test(s))if(/\?/.test(s)){r.length===0&&n===""?r.push("/"):r.push(n);const i=s.replace("?","");n+="/"+i,r.push(n)}else n+="/"+s}),r.filter((s,i,o)=>o.indexOf(s)===i)},"checkOptionalParameter"),Hl=gt(e=>/[%+]/.test(e)?(e.indexOf("+")!==-1&&(e=e.replace(/\+/g," ")),e.indexOf("%")!==-1?Vd(e,I0):e):e,"_decodeURI"),N0=gt((e,t,r)=>{let n;if(!r&&t&&!/[%+]/.test(t)){let o=e.indexOf("?",8);if(o===-1)return;for(e.startsWith(t,o+1)||(o=e.indexOf(`&${t}`,o+1));o!==-1;){const a=e.charCodeAt(o+t.length+1);if(a===61){const c=o+t.length+2,l=e.indexOf("&",c);return Hl(e.slice(c,l===-1?void 0:l))}else if(a==38||isNaN(a))return"";o=e.indexOf(`&${t}`,o+1)}if(n=/[%+]/.test(e),!n)return}const s={};n??=/[%+]/.test(e);let i=e.indexOf("?",8);for(;i!==-1;){const o=e.indexOf("&",i+1);let a=e.indexOf("=",i);a>o&&o!==-1&&(a=-1);let c=e.slice(i+1,a===-1?o===-1?void 0:o:a);if(n&&(c=Hl(c)),i=o,c==="")continue;let l;a===-1?l="":(l=e.slice(a+1,o===-1?void 0:o),n&&(l=Hl(l))),r?(s[c]&&Array.isArray(s[c])||(s[c]=[]),s[c].push(l)):s[c]??=l}return t?s[t]:s},"_getQueryParam"),zO=N0,JO=gt((e,t)=>N0(e,t,!0),"getQueryParams"),I0=decodeURIComponent,KO=Object.defineProperty,Ja=d((e,t)=>KO(e,"name",{value:t,configurable:!0}),"s$u"),rm=Ja(e=>Vd(e,I0),"tryDecodeURIComponent"),L0=class{static{d(this,"w")}static{Ja(this,"HonoRequest")}raw;#e;#t;routeIndex=0;path;bodyCache={};constructor(t,r="/",n=[[]]){this.raw=t,this.path=r,this.#t=n,this.#e={}}param(t){return t?this.#r(t):this.#i()}#r(t){const r=this.#t[0][this.routeIndex][1][t],n=this.#n(r);return n&&/\%/.test(n)?rm(n):n}#i(){const t={},r=Object.keys(this.#t[0][this.routeIndex][1]);for(const n of r){const s=this.#n(this.#t[0][this.routeIndex][1][n]);s!==void 0&&(t[n]=/\%/.test(s)?rm(s):s)}return t}#n(t){return this.#t[1]?this.#t[1][t]:t}query(t){return zO(this.url,t)}queries(t){return JO(this.url,t)}header(t){if(t)return this.raw.headers.get(t)??void 0;const r={};return this.raw.headers.forEach((n,s)=>{r[s]=n}),r}async parseBody(t){return IO(this,t)}#o=Ja(t=>{const{bodyCache:r,raw:n}=this,s=r[t];if(s)return s;const i=Object.keys(r)[0];return i?r[i].then(o=>(i==="json"&&(o=JSON.stringify(o)),new Response(o)[t]())):r[t]=n[t]()},"#cachedBody");json(){return this.#o("text").then(t=>JSON.parse(t))}text(){return this.#o("text")}arrayBuffer(){return this.#o("arrayBuffer")}bytes(){return this.#o("arrayBuffer").then(t=>new Uint8Array(t))}blob(){return this.#o("blob")}formData(){return this.#o("formData")}addValidatedData(t,r){this.#e[t]=r}valid(t){return this.#e[t]}get url(){return this.raw.url}get method(){return this.raw.method}get[TO](){return this.#t}get matchedRoutes(){return this.#t[0].map(([[,t]])=>t)}get routePath(){return this.#t[0].map(([[,t]])=>t)[this.routeIndex].path}};Ja(async e=>{if(!e.raw.bodyUsed)return e.raw.clone();const t=Object.keys(e.bodyCache)[0];if(!t)throw new RO(500,{message:"Cannot clone request: body was already consumed and not cached. Please use HonoRequest methods (e.g., req.json(), req.text()) instead of consuming req.raw directly."});const r={body:await e[t](),cache:e.raw.cache,credentials:e.raw.credentials,headers:e.header(),integrity:e.raw.integrity,keepalive:e.raw.keepalive,method:e.method,mode:e.raw.mode,redirect:e.raw.redirect,referrer:e.raw.referrer,referrerPolicy:e.raw.referrerPolicy,signal:e.raw.signal};return new Request(e.url,r)},"cloneRawRequest");var YO=Object.defineProperty,Vo=d((e,t)=>YO(e,"name",{value:t,configurable:!0}),"o$I"),Ud={Stringify:1},_0=Vo((e,t)=>{const r=new String(e);return r.isEscaped=!0,r.callbacks=t,r},"raw"),XO=/[&<>'"]/;Vo(async(e,t)=>{let r="";t||=[];const n=await Promise.all(e);for(let s=n.length-1;r+=n[s],s--,!(s<0);s--){let i=n[s];typeof i=="object"&&t.push(...i.callbacks||[]);const o=i.isEscaped;if(i=await(typeof i=="object"?i.toString():i),typeof i=="object"&&t.push(...i.callbacks||[]),i.isEscaped??o)r+=i;else{const a=[r];QO(i,a),r=a[0]}}return _0(r,t)},"stringBufferToString");var QO=Vo((e,t)=>{const r=e.search(XO);if(r===-1){t[0]+=e;return}let n,s,i=0;for(s=r;s<e.length;s++){switch(e.charCodeAt(s)){case 34:n=""";break;case 39:n="'";break;case 38:n="&";break;case 60:n="<";break;case 62:n=">";break;default:continue}t[0]+=e.substring(i,s)+n,i=s+1}t[0]+=e.substring(i,s)},"escapeToBuffer");Vo(e=>{const t=e.callbacks;if(!t?.length)return e;const r=[e],n={};return t.forEach(s=>s({phase:Ud.Stringify,buffer:r,context:n})),r[0]},"resolveCallbackSync");var Gd=Vo(async(e,t,r,n,s)=>{typeof e=="object"&&!(e instanceof String)&&(e instanceof Promise||(e=e.toString()),e instanceof Promise&&(e=await e));const i=e.callbacks;if(!i?.length)return Promise.resolve(e);s?s[0]+=e:s=[e];const o=Promise.all(i.map(a=>a({phase:t,buffer:s,context:n}))).then(a=>Promise.all(a.filter(Boolean).map(c=>Gd(c,t,!1,n,s))).then(()=>s[0]));return r?_0(await o,i):o},"resolveCallback"),ZO=Object.defineProperty,He=d((e,t)=>ZO(e,"name",{value:t,configurable:!0}),"s$t"),M0="text/plain; charset=UTF-8",zl=He((e,t)=>({"Content-Type":e,...t}),"setDefaultContentType"),Bi=He((e,t)=>new Response(e,t),"createResponseInstance"),eP=class{static{d(this,"w")}static{He(this,"Context")}#e;#t;env={};#r;finalized=!1;error;#i;#n;#o;#x;#m;#l;#f;#u;#a;constructor(t,r){this.#e=t,r&&(this.#n=r.executionCtx,this.env=r.env,this.#l=r.notFoundHandler,this.#a=r.path,this.#u=r.matchResult)}get req(){return this.#t??=new L0(this.#e,this.#a,this.#u),this.#t}get event(){if(this.#n&&"respondWith"in this.#n)return this.#n;throw Error("This context has no FetchEvent")}get executionCtx(){if(this.#n)return this.#n;throw Error("This context has no ExecutionContext")}get res(){return this.#o||=Bi(null,{headers:this.#f??=new Headers})}set res(t){if(this.#o&&t){t=Bi(t.body,t);for(const[r,n]of this.#o.headers.entries())if(r!=="content-type")if(r==="set-cookie"){const s=this.#o.headers.getSetCookie();t.headers.delete("set-cookie");for(const i of s)t.headers.append("set-cookie",i)}else t.headers.set(r,n)}this.#o=t,this.finalized=!0}render=He((...t)=>(this.#m??=r=>this.html(r),this.#m(...t)),"render");setLayout=He(t=>this.#x=t,"setLayout");getLayout=He(()=>this.#x,"getLayout");setRenderer=He(t=>{this.#m=t},"setRenderer");header=He((t,r,n)=>{this.finalized&&(this.#o=Bi(this.#o.body,this.#o));const s=this.#o?this.#o.headers:this.#f??=new Headers;r===void 0?s.delete(t):n?.append?s.append(t,r):s.set(t,r)},"header");status=He(t=>{this.#i=t},"status");set=He((t,r)=>{this.#r??=new Map,this.#r.set(t,r)},"set");get=He(t=>this.#r?this.#r.get(t):void 0,"get");get var(){return this.#r?Object.fromEntries(this.#r):{}}#s(t,r,n){const s=this.#o?new Headers(this.#o.headers):this.#f??new Headers;if(typeof r=="object"&&"headers"in r){const o=r.headers instanceof Headers?r.headers:new Headers(r.headers);for(const[a,c]of o)a.toLowerCase()==="set-cookie"?s.append(a,c):s.set(a,c)}if(n)for(const[o,a]of Object.entries(n))if(typeof a=="string")s.set(o,a);else{s.delete(o);for(const c of a)s.append(o,c)}const i=typeof r=="number"?r:r?.status??this.#i;return Bi(t,{status:i,headers:s})}newResponse=He((...t)=>this.#s(...t),"newResponse");body=He((t,r,n)=>this.#s(t,r,n),"body");text=He((t,r,n)=>!this.#f&&!this.#i&&!r&&!n&&!this.finalized?new Response(t):this.#s(t,r,zl(M0,n)),"text");json=He((t,r,n)=>this.#s(JSON.stringify(t),r,zl("application/json",n)),"json");html=He((t,r,n)=>{const s=He(i=>this.#s(i,r,zl("text/html; charset=UTF-8",n)),"res");return typeof t=="object"?Gd(t,Ud.Stringify,!1,{}).then(s):s(t)},"html");redirect=He((t,r)=>{const n=String(t);return this.header("Location",/[^\x00-\xFF]/.test(n)?encodeURI(n):n),this.newResponse(null,r??302)},"redirect");notFound=He(()=>(this.#l??=()=>Bi(),this.#l(this)),"notFound")},tP=Object.defineProperty,rP=d((e,t)=>tP(e,"name",{value:t,configurable:!0}),"r$G"),Ne="ALL",nP="all",sP=["get","post","put","delete","options","patch"],W0="Can not add a route since the matcher is already built.",V0=class extends Error{static{d(this,"_")}static{rP(this,"UnsupportedPathError")}},iP="__COMPOSED_HANDLER",oP=Object.defineProperty,Vt=d((e,t)=>oP(e,"name",{value:t,configurable:!0}),"l$n"),aP=Vt(e=>e.text("404 Not Found",404),"notFoundHandler"),nm=Vt((e,t)=>{if("getResponse"in e){const r=e.getResponse();return t.newResponse(r.body,r)}return console.error(e),t.text("Internal Server Error",500)},"errorHandler"),cP=class U0{static{d(this,"m")}static{Vt(this,"_Hono")}get;post;put;delete;options;patch;all;on;use;router;getPath;_basePath="/";#e="/";routes=[];constructor(t={}){[...sP,nP].forEach(s=>{this[s]=(i,...o)=>(typeof i=="string"?this.#e=i:this.#i(s,this.#e,i),o.forEach(a=>{this.#i(s,this.#e,a)}),this)}),this.on=(s,i,...o)=>{for(const a of[i].flat()){this.#e=a;for(const c of[s].flat())o.map(l=>{this.#i(c.toUpperCase(),this.#e,l)})}return this},this.use=(s,...i)=>(typeof s=="string"?this.#e=s:(this.#e="*",i.unshift(s)),i.forEach(o=>{this.#i(Ne,this.#e,o)}),this);const{strict:r,...n}=t;Object.assign(this,n),this.getPath=r??!0?t.getPath??R0:HO}#t(){const t=new U0({router:this.router,getPath:this.getPath});return t.errorHandler=this.errorHandler,t.#r=this.#r,t.routes=this.routes,t}#r=aP;errorHandler=nm;route(t,r){const n=this.basePath(t);return r.routes.map(s=>{let i;r.errorHandler===nm?i=s.handler:(i=Vt(async(o,a)=>(await tm([],r.errorHandler)(o,()=>s.handler(o,a))).res,"handler"),i[iP]=s.handler),n.#i(s.method,s.path,i)}),this}basePath(t){const r=this.#t();return r._basePath=ms(this._basePath,t),r}onError=Vt(t=>(this.errorHandler=t,this),"onError");notFound=Vt(t=>(this.#r=t,this),"notFound");mount(t,r,n){let s,i;n&&(typeof n=="function"?i=n:(i=n.optionHandler,n.replaceRequest===!1?s=Vt(c=>c,"replaceRequest"):s=n.replaceRequest));const o=i?c=>{const l=i(c);return Array.isArray(l)?l:[l]}:c=>{let l;try{l=c.executionCtx}catch{}return[c.env,l]};s||=(()=>{const c=ms(this._basePath,t),l=c==="/"?0:c.length;return u=>{const p=new URL(u.url);return p.pathname=p.pathname.slice(l)||"/",new Request(p,u)}})();const a=Vt(async(c,l)=>{const u=await r(s(c.req.raw),...o(c));if(u)return u;await l()},"handler");return this.#i(Ne,ms(t,"*"),a),this}#i(t,r,n){t=t.toUpperCase(),r=ms(this._basePath,r);const s={basePath:this._basePath,path:r,method:t,handler:n};this.router.add(t,r,[n,s]),this.routes.push(s)}#n(t,r){if(t instanceof Error)return this.errorHandler(t,r);throw t}#o(t,r,n,s){if(s==="HEAD")return(async()=>new Response(null,await this.#o(t,r,n,"GET")))();const i=this.getPath(t,{env:n}),o=this.router.match(s,i),a=new eP(t,{path:i,matchResult:o,env:n,executionCtx:r,notFoundHandler:this.#r});if(o[0].length===1){let l;try{l=o[0][0][0][0](a,async()=>{a.res=await this.#r(a)})}catch(u){return this.#n(u,a)}return l instanceof Promise?l.then(u=>u||(a.finalized?a.res:this.#r(a))).catch(u=>this.#n(u,a)):l??this.#r(a)}const c=tm(o[0],this.errorHandler,this.#r);return(async()=>{try{const l=await c(a);if(!l.finalized)throw new Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");return l.res}catch(l){return this.#n(l,a)}})()}fetch=Vt((t,...r)=>this.#o(t,r[1],r[0],t.method),"fetch");request=Vt((t,r,n,s)=>t instanceof Request?this.fetch(r?new Request(t,r):t,n,s):(t=t.toString(),this.fetch(new Request(/^https?:\/\//.test(t)?t:`http://localhost${ms("/",t)}`,r),n,s)),"request");fire=Vt(()=>{addEventListener("fetch",t=>{t.respondWith(this.#o(t.request,t,void 0,t.request.method))})},"fire")},lP=Object.defineProperty,G0=d((e,t)=>lP(e,"name",{value:t,configurable:!0}),"a$v"),qd=[];function Hd(e,t){const r=this.buildAllMatchers(),n=G0(((s,i)=>{const o=r[s]||r[Ne],a=o[2][i];if(a)return a;const c=i.match(o[0]);if(!c)return[[],qd];const l=c.indexOf("",1);return[o[1][l],c]}),"match2");return this.match=n,n(e,t)}d(Hd,"d$m");G0(Hd,"match");var uP=Object.defineProperty,q0=d((e,t)=>uP(e,"name",{value:t,configurable:!0}),"_$i"),Ka="[^/]+",oo=".*",ao="(?:|/.*)",Ji=Symbol(),pP=new Set(".\\+*[^]$()");function H0(e,t){return e.length===1?t.length===1?e<t?-1:1:-1:t.length===1||e===oo||e===ao?1:t===oo||t===ao?-1:e===Ka?1:t===Ka?-1:e.length===t.length?e<t?-1:1:t.length-e.length}d(H0,"L$g");q0(H0,"compareKey");var dP=class Hu{static{d(this,"v")}static{q0(this,"_Node")}#e;#t;#r=Object.create(null);insert(t,r,n,s,i){if(t.length===0){if(this.#e!==void 0)throw Ji;if(i)return;this.#e=r;return}const[o,...a]=t,c=o==="*"?a.length===0?["","",oo]:["","",Ka]:o==="/*"?["","",ao]:o.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);let l;if(c){const u=c[1];let p=c[2]||Ka;if(u&&c[2]&&(p===".*"||(p=p.replace(/^\((?!\?:)(?=[^)]+\)$)/,"(?:"),/\((?!\?:)/.test(p))))throw Ji;if(l=this.#r[p],!l){if(Object.keys(this.#r).some(f=>f!==oo&&f!==ao))throw Ji;if(i)return;l=this.#r[p]=new Hu,u!==""&&(l.#t=s.varIndex++)}!i&&u!==""&&n.push([u,l.#t])}else if(l=this.#r[o],!l){if(Object.keys(this.#r).some(u=>u.length>1&&u!==oo&&u!==ao))throw Ji;if(i)return;l=this.#r[o]=new Hu}l.insert(a,r,n,s,i)}buildRegExpStr(){const t=Object.keys(this.#r).sort(H0).map(r=>{const n=this.#r[r];return(typeof n.#t=="number"?`(${r})@${n.#t}`:pP.has(r)?`\\${r}`:r)+n.buildRegExpStr()});return typeof this.#e=="number"&&t.unshift(`#${this.#e}`),t.length===0?"":t.length===1?t[0]:"(?:"+t.join("|")+")"}},fP=Object.defineProperty,hP=d((e,t)=>fP(e,"name",{value:t,configurable:!0}),"p$q"),mP=class{static{d(this,"g")}static{hP(this,"Trie")}#e={varIndex:0};#t=new dP;insert(t,r,n){const s=[],i=[];for(let a=0;;){let c=!1;if(t=t.replace(/\{[^}]+\}/g,l=>{const u=`@\\${a}`;return i[a]=[u,l],a++,c=!0,u}),!c)break}const o=t.match(/(?::[^\/]+)|(?:\/\*$)|./g)||[];for(let a=i.length-1;a>=0;a--){const[c]=i[a];for(let l=o.length-1;l>=0;l--)if(o[l].indexOf(c)!==-1){o[l]=o[l].replace(c,i[a][1]);break}}return this.#t.insert(o,r,s,this.#e,n),s}buildRegExp(){let t=this.#t.buildRegExpStr();if(t==="")return[/^$/,[],[]];let r=0;const n=[],s=[];return t=t.replace(/#(\d+)|@(\d+)|\.\*\$/g,(i,o,a)=>o!==void 0?(n[++r]=Number(o),"$()"):(a!==void 0&&(s[Number(a)]=++r),"")),[new RegExp(`^${t}`),n,s]}},gP=Object.defineProperty,Uo=d((e,t)=>gP(e,"name",{value:t,configurable:!0}),"g$e"),yP=[/^$/,[],Object.create(null)],z0=Object.create(null);function zd(e){return z0[e]??=new RegExp(e==="*"?"":`^${e.replace(/\/\*$|([.\\+*[^\]$()])/g,(t,r)=>r?`\\${r}`:"(?:|/.*)")}$`)}d(zd,"M$k");Uo(zd,"buildWildcardRegExp");function J0(){z0=Object.create(null)}d(J0,"D$i");Uo(J0,"clearWildcardRegExpCache");function K0(e){const t=new mP,r=[];if(e.length===0)return yP;const n=e.map(l=>[!/\*|\/:/.test(l[0]),...l]).sort(([l,u],[p,f])=>l?1:p?-1:u.length-f.length),s=Object.create(null);for(let l=0,u=-1,p=n.length;l<p;l++){const[f,m,$]=n[l];f?s[m]=[$.map(([k])=>[k,Object.create(null)]),qd]:u++;let b;try{b=t.insert(m,u,f)}catch(k){throw k===Ji?new V0(m):k}f||(r[u]=$.map(([k,S])=>{const y=Object.create(null);for(S-=1;S>=0;S--){const[h,v]=b[S];y[h]=v}return[k,y]}))}const[i,o,a]=t.buildRegExp();for(let l=0,u=r.length;l<u;l++)for(let p=0,f=r[l].length;p<f;p++){const m=r[l][p]?.[1];if(!m)continue;const $=Object.keys(m);for(let b=0,k=$.length;b<k;b++)m[$[b]]=a[m[$[b]]]}const c=[];for(const l in o)c[l]=r[o[l]];return[i,c,s]}d(K0,"H$c");Uo(K0,"buildMatcherFromPreprocessedRoutes");function Dn(e,t){if(e){for(const r of Object.keys(e).sort((n,s)=>s.length-n.length))if(zd(r).test(t))return[...e[r]]}}d(Dn,"p$p");Uo(Dn,"findMiddleware");var Y0=class{static{d(this,"I")}static{Uo(this,"RegExpRouter")}name="RegExpRouter";#e;#t;constructor(){this.#e={[Ne]:Object.create(null)},this.#t={[Ne]:Object.create(null)}}add(t,r,n){const s=this.#e,i=this.#t;if(!s||!i)throw new Error(W0);s[t]||[s,i].forEach(c=>{c[t]=Object.create(null),Object.keys(c[Ne]).forEach(l=>{c[t][l]=[...c[Ne][l]]})}),r==="/*"&&(r="*");const o=(r.match(/\/:/g)||[]).length;if(/\*$/.test(r)){const c=zd(r);t===Ne?Object.keys(s).forEach(l=>{s[l][r]||=Dn(s[l],r)||Dn(s[Ne],r)||[]}):s[t][r]||=Dn(s[t],r)||Dn(s[Ne],r)||[],Object.keys(s).forEach(l=>{(t===Ne||t===l)&&Object.keys(s[l]).forEach(u=>{c.test(u)&&s[l][u].push([n,o])})}),Object.keys(i).forEach(l=>{(t===Ne||t===l)&&Object.keys(i[l]).forEach(u=>c.test(u)&&i[l][u].push([n,o]))});return}const a=T0(r)||[r];for(let c=0,l=a.length;c<l;c++){const u=a[c];Object.keys(i).forEach(p=>{(t===Ne||t===p)&&(i[p][u]||=[...Dn(s[p],u)||Dn(s[Ne],u)||[]],i[p][u].push([n,o-l+c+1]))})}}match=Hd;buildAllMatchers(){const t=Object.create(null);return Object.keys(this.#t).concat(Object.keys(this.#e)).forEach(r=>{t[r]||=this.#r(r)}),this.#e=this.#t=void 0,J0(),t}#r(t){const r=[];let n=t===Ne;return[this.#e,this.#t].forEach(s=>{const i=s[t]?Object.keys(s[t]).map(o=>[o,s[t][o]]):[];i.length!==0?(n||=!0,r.push(...i)):t!==Ne&&r.push(...Object.keys(s[Ne]).map(o=>[o,s[Ne][o]]))}),n?K0(r):null}},vP=Object.defineProperty,Ya=d((e,t)=>vP(e,"name",{value:t,configurable:!0}),"a$u");(class{static{Ya(this,"PreparedRegExpRouter")}name="PreparedRegExpRouter";#e;#t;constructor(e,t){this.#e=e,this.#t=t}#r(e,t){const r=this.#e[e];r[1].forEach(n=>n&&n.push(t)),Object.values(r[2]).forEach(n=>n[0].push(t))}#i(e,t,r,n,s){const i=this.#e[e];s?n.forEach(o=>{typeof o=="number"?i[1][o].push([r,s]):i[2][o||t][0].push([r,s])}):i[2][t][0].push([r,{}])}add(e,t,r){if(!this.#e[e]){const s=this.#e[Ne],i={};for(const o in s[2])i[o]=[s[2][o][0].slice(),qd];this.#e[e]=[s[0],s[1].map(o=>Array.isArray(o)?o.slice():0),i]}if(t==="/*"||t==="*"){const s=[r,{}];if(e===Ne)for(const i in this.#e)this.#r(i,s);else this.#r(e,s);return}const n=this.#t[t];if(!n)throw new Error(`Path ${t} is not registered`);for(const[s,i]of n)if(e===Ne)for(const o in this.#e)this.#i(o,t,r,s,i);else this.#i(e,t,r,s,i)}buildAllMatchers(){return this.#e}match=Hd});Ya(({paths:e})=>{const t=class extends Y0{static{d(this,"e")}static{Ya(this,"RegExpRouterWithMatcherExport")}buildAndExportAllMatchers(){return this.buildAllMatchers()}},r=new t;for(const o of e)r.add(Ne,o,o);const n=r.buildAndExportAllMatchers(),s=n[Ne],i={};for(const o of e)if(!(o==="/*"||o==="*")){s[1].forEach((a,c)=>{a.forEach(([l,u])=>{l===o&&(i[o]?i[o][0][1]={...i[o][0][1],...u}:i[o]=[[[],u]],i[o][0][0].findIndex(p=>p===c)===-1&&i[o][0][0].push(c))})});for(const a in s[2])s[2][a][0].forEach(([c])=>{if(c===o){i[o]||=[[[]]];const l=a===o?"":a;i[o][0][0].findIndex(u=>u===l)===-1&&i[o][0][0].push(l)}})}for(let o=0,a=s[1].length;o<a;o++)s[1][o]=s[1][o]?[]:0;for(const o in s[2])s[2][o][0]=[];return[n,i]},"buildInitParams");Ya(([e,t])=>{const r=JSON.stringify(e,(s,i)=>i instanceof RegExp?`##${i.toString()}##`:i).replace(/"##(.+?)##"/g,(s,i)=>i.replace(/\\\\/g,"\\")),n=JSON.stringify(t);return`[${r},${n}]`},"serializeInitParams");var bP=Object.defineProperty,$P=d((e,t)=>bP(e,"name",{value:t,configurable:!0}),"c$w"),wP=class{static{d(this,"f")}static{$P(this,"SmartRouter")}name="SmartRouter";#e=[];#t=[];constructor(t){this.#e=t.routers}add(t,r,n){if(!this.#t)throw new Error(W0);this.#t.push([t,r,n])}match(t,r){if(!this.#t)throw new Error("Fatal error");const n=this.#e,s=this.#t,i=n.length;let o=0,a;for(;o<i;o++){const c=n[o];try{for(let l=0,u=s.length;l<u;l++)c.add(...s[l]);a=c.match(t,r)}catch(l){if(l instanceof V0)continue;throw l}this.match=c.match.bind(c),this.#e=[c],this.#t=void 0;break}if(o===i)throw new Error("Fatal error");return this.name=`SmartRouter + ${this.activeRouter.name}`,a}get activeRouter(){if(this.#t||this.#e.length!==1)throw new Error("No active router has been determined yet.");return this.#e[0]}},kP=Object.defineProperty,X0=d((e,t)=>kP(e,"name",{value:t,configurable:!0}),"k$m"),Ri=Object.create(null),SP=X0(e=>{for(const t in e)return!0;return!1},"hasChildren"),DP=class Q0{static{d(this,"E")}static{X0(this,"_Node")}#e;#t;#r;#i=0;#n=Ri;constructor(t,r,n){if(this.#t=n||Object.create(null),this.#e=[],t&&r){const s=Object.create(null);s[t]={handler:r,possibleKeys:[],score:0},this.#e=[s]}this.#r=[]}insert(t,r,n){this.#i=++this.#i;let s=this;const i=WO(r),o=[];for(let a=0,c=i.length;a<c;a++){const l=i[a],u=i[a+1],p=GO(l,u),f=Array.isArray(p)?p[0]:l;if(f in s.#t){s=s.#t[f],p&&o.push(p[1]);continue}s.#t[f]=new Q0,p&&(s.#r.push(p),o.push(p[1])),s=s.#t[f]}return s.#e.push({[t]:{handler:n,possibleKeys:o.filter((a,c,l)=>l.indexOf(a)===c),score:this.#i}}),s}#o(t,r,n,s,i){for(let o=0,a=r.#e.length;o<a;o++){const c=r.#e[o],l=c[n]||c[Ne],u={};if(l!==void 0&&(l.params=Object.create(null),t.push(l),s!==Ri||i&&i!==Ri))for(let p=0,f=l.possibleKeys.length;p<f;p++){const m=l.possibleKeys[p],$=u[l.score];l.params[m]=i?.[m]&&!$?i[m]:s[m]??i?.[m],u[l.score]=!0}}}search(t,r){const n=[];this.#n=Ri;let s=[this];const i=B0(r),o=[],a=i.length;let c=null;for(let l=0;l<a;l++){const u=i[l],p=l===a-1,f=[];for(let $=0,b=s.length;$<b;$++){const k=s[$],S=k.#t[u];S&&(S.#n=k.#n,p?(S.#t["*"]&&this.#o(n,S.#t["*"],t,k.#n),this.#o(n,S,t,k.#n)):f.push(S));for(let y=0,h=k.#r.length;y<h;y++){const v=k.#r[y],w=k.#n===Ri?{}:{...k.#n};if(v==="*"){const O=k.#t["*"];O&&(this.#o(n,O,t,k.#n),O.#n=w,f.push(O));continue}const[g,E,C]=v;if(!u&&!(C instanceof RegExp))continue;const A=k.#t[g];if(C instanceof RegExp){if(c===null){c=new Array(a);let V=r[0]==="/"?1:0;for(let fe=0;fe<a;fe++)c[fe]=V,V+=i[fe].length+1}const O=r.substring(c[l]),I=C.exec(O);if(I){if(w[E]=I[0],this.#o(n,A,t,k.#n,w),SP(A.#t)){A.#n=w;const V=I[0].match(/\//)?.length??0;(o[V]||=[]).push(A)}continue}}(C===!0||C.test(u))&&(w[E]=u,p?(this.#o(n,A,t,w,k.#n),A.#t["*"]&&this.#o(n,A.#t["*"],t,w,k.#n)):(A.#n=w,f.push(A)))}}const m=o.shift();s=m?f.concat(m):f}return n.length>1&&n.sort((l,u)=>l.score-u.score),[n.map(({handler:l,params:u})=>[l,u])]}},CP=Object.defineProperty,EP=d((e,t)=>CP(e,"name",{value:t,configurable:!0}),"s$s"),jP=class{static{d(this,"u")}static{EP(this,"TrieRouter")}name="TrieRouter";#e;constructor(){this.#e=new DP}add(t,r,n){const s=T0(r);if(s){for(let i=0,o=s.length;i<o;i++)this.#e.insert(t,s[i],n);return}this.#e.insert(t,r,n)}match(t,r){return this.#e.search(t,r)}},AP=Object.defineProperty,xP=d((e,t)=>AP(e,"name",{value:t,configurable:!0}),"o$G"),OP=class extends cP{static{d(this,"p")}static{xP(this,"Hono")}constructor(t={}){super(t),this.router=t.router??new wP({routers:[new Y0,new jP]})}},PP=Object.defineProperty,sm=d((e,t)=>PP(e,"name",{value:t,configurable:!0}),"r$F"),Z0=class{static{d(this,"n")}static{sm(this,"StreamingApi")}writer;encoder;writable;abortSubscribers=[];responseReadable;aborted=!1;closed=!1;constructor(t,r){this.writable=t,this.writer=t.getWriter(),this.encoder=new TextEncoder;const n=r.getReader();this.abortSubscribers.push(async()=>{await n.cancel()}),this.responseReadable=new ReadableStream({async pull(s){const{done:i,value:o}=await n.read();i?s.close():s.enqueue(o)},cancel:sm(()=>{this.closed||this.abort()},"cancel")})}async write(t){try{typeof t=="string"&&(t=this.encoder.encode(t)),await this.writer.write(t)}catch{}return this}async writeln(t){return await this.write(t+`
|
|
981
|
+
`),this}sleep(t){return new Promise(r=>setTimeout(r,t))}async close(){this.closed=!0;try{await this.writer.close()}catch{}}async pipe(t){this.writer.releaseLock(),await t.pipeTo(this.writable,{preventClose:!0}),this.writer=this.writable.getWriter()}onAbort(t){this.abortSubscribers.push(t)}abort(){this.aborted||(this.aborted=!0,this.abortSubscribers.forEach(t=>t()))}},FP=Object.defineProperty,im=d((e,t)=>FP(e,"name",{value:t,configurable:!0}),"r$E"),Jd=im(()=>{const e=typeof Bun<"u"?Bun.version:void 0;if(e===void 0)return!1;const t=e.startsWith("1.1")||e.startsWith("1.0")||e.startsWith("0.");return Jd=im(()=>t,"isOldBunVersion"),t},"isOldBunVersion"),BP=Object.defineProperty,RP=d((e,t)=>BP(e,"name",{value:t,configurable:!0}),"n$x"),TP=new WeakMap,NP=RP((e,t,r)=>{const{readable:n,writable:s}=new TransformStream,i=new Z0(s,n);return Jd()&&e.req.raw.signal.addEventListener("abort",()=>{i.closed||i.abort()}),TP.set(i.responseReadable,e),(async()=>{try{await t(i)}catch(o){o===void 0||(o instanceof Error&&r?await r(o,i):console.error(o))}finally{i.close()}})(),e.newResponse(i.responseReadable)},"stream"),IP=Object.defineProperty,Kd=d((e,t)=>IP(e,"name",{value:t,configurable:!0}),"i$p"),LP=class extends Z0{static{d(this,"s")}static{Kd(this,"SSEStreamingApi")}constructor(t,r){super(t,r)}async writeSSE(t){const r=(await Gd(t.data,Ud.Stringify,!1,{})).split(/\r\n|\r|\n/).map(s=>`data: ${s}`).join(`
|
|
982
982
|
`);for(const s of["event","id","retry"])if(t[s]&&/[\r\n]/.test(t[s]))throw new Error(`${s} must not contain "\\r" or "\\n"`);const n=[t.event&&`event: ${t.event}`,r,t.id&&`id: ${t.id}`,t.retry&&`retry: ${t.retry}`].filter(Boolean).join(`
|
|
983
983
|
`)+`
|
|
984
984
|
|
|
985
|
-
`;await this.write(n)}},_P=Kd(async(e,t,r)=>{try{await t(e)}catch(n){n instanceof Error&&r?(await r(n,e),await e.writeSSE({event:"error",data:n.message})):console.error(n)}finally{e.close()}},"run"),MP=new WeakMap,WP=Kd((e,t,r)=>{const{readable:n,writable:s}=new TransformStream,i=new LP(s,n);return Jd()&&e.req.raw.signal.addEventListener("abort",()=>{i.closed||i.abort()}),MP.set(i.responseReadable,e),e.header("Transfer-Encoding","chunked"),e.header("Content-Type","text/event-stream"),e.header("Cache-Control","no-cache"),e.header("Connection","keep-alive"),_P(i,t,r),e.newResponse(i.responseReadable)},"streamSSE"),VP=Object.defineProperty,UP=d((e,t)=>VP(e,"name",{value:t,configurable:!0}),"n$v");UP((e,t,r)=>(e.header("Content-Type",M0),e.header("X-Content-Type-Options","nosniff"),e.header("Transfer-Encoding","chunked"),NP(e,t,r)),"streamText");var GP=Object.defineProperty,qP=d((e,t)=>GP(e,"name",{value:t,configurable:!0}),"y$i"),HP=Object.defineProperty,zP=qP((e,t)=>HP(e,"name",{value:t,configurable:!0}),"y"),JP=Object.defineProperty,Lc=zP((e,t)=>JP(e,"name",{value:t,configurable:!0}),"i");const KP=/^(?<value>-?\d+(?:[.,]\d+)*) *(?<type>[a-z]+)?$/i,YP=/^KIBI/,XP=/^MIBI/,QP=/^GIBI/,ZP=/^TEBI/,eF=/^PEBI/,tF=/^EXBI/,rF=/^ZEBI/,nF=/^YIBI/,sF=/^(.)IB$/,e$={iec:[{long:"Bytes",short:"B"},{long:"Kibibytes",short:"KiB"},{long:"Mebibytes",short:"MiB"},{long:"Gibibytes",short:"GiB"},{long:"Tebibytes",short:"TiB"},{long:"Pebibytes",short:"PiB"},{long:"Exbibytes",short:"EiB"},{long:"Zebibytes",short:"ZiB"},{long:"Yobibytes",short:"YiB"}],iec_octet:[{long:"Octets",short:"o"},{long:"Kibioctets",short:"Kio"},{long:"Mebioctets",short:"Mio"},{long:"Gibioctets",short:"Gio"},{long:"Tebioctets",short:"Tio"},{long:"Pebioctets",short:"Pio"},{long:"Exbioctets",short:"Eio"},{long:"Zebioctets",short:"Zio"},{long:"Yobioctets",short:"Yio"}],metric:[{long:"Bytes",short:"Bytes"},{long:"Kilobytes",short:"KB"},{long:"Megabytes",short:"MB"},{long:"Gigabytes",short:"GB"},{long:"Terabytes",short:"TB"},{long:"Petabytes",short:"PB"},{long:"Exabytes",short:"EB"},{long:"Zettabytes",short:"ZB"},{long:"Yottabytes",short:"YB"}],metric_octet:[{long:"Octets",short:"o"},{long:"Kilo-octets",short:"ko"},{long:"Mega-octets",short:"Mo"},{long:"Giga-octets",short:"Go"},{long:"Tera-octets",short:"To"},{long:"Peta-octets",short:"Po"},{long:"Exa-octets",short:"Eo"},{long:"Zetta-octets",short:"Zo"},{long:"Yotta-octets",short:"Yo"}]},iF=Lc((e,t)=>{const r=new Intl.NumberFormat(t).format(11111).replaceAll(new RegExp("\\p{Number}","gu"),""),n=new Intl.NumberFormat(t).format(1.1).replaceAll(new RegExp("\\p{Number}","gu"),"");return Number.parseFloat(e.replaceAll(new RegExp(`\\${r}`,"g"),"").replace(new RegExp(`\\${n}`),"."))},"parseLocalizedNumber"),t$=Lc(e=>{switch(e){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},"fromBase");Lc((e,t)=>{const r={base:2,locale:"en-US",units:"metric",...t};if(typeof e!="string"||e.length===0)throw new TypeError("Value is not a string or is empty.");if(e.length>100)throw new TypeError("Value exceeds the maximum length of 100 characters.");const n=KP.exec(e)?.groups;if(!n)return Number.NaN;const s=iF(n.value,r.locale),i=(n.type??"Bytes").toUpperCase().replace(YP,"KILO").replace(XP,"MEGA").replace(QP,"GIGA").replace(ZP,"TERA").replace(eF,"PETA").replace(tF,"EXA").replace(rF,"ZETTA").replace(nF,"YOTTA").replace(sF,"$1B"),o=e$[r.units].findIndex(c=>c.short[0].toUpperCase()===i[0]),a=t$(r.base);return s*a**o},"parseBytes");const Ms=Lc((e,t)=>{if(typeof e!="number"||!Number.isFinite(e))throw new TypeError("Bytesize is not a number.");const{base:r,decimals:n,locale:s,long:i,unit:o,units:a,...c}={base:2,decimals:0,locale:"en-US",long:!1,units:"metric",...t},l=t$(r),u=Math.abs(e),p=t?.space??!0?" ":"",f=e$[a],m=f.findIndex(y=>y.short===o);if(e===0){const y=Math.min(0,Math.max(m,f.length-1));return"0"+p+f[y][i?"long":"short"]}const $=m===-1?Math.min(Math.floor(Math.log(u)/Math.log(l)),f.length-1):m,b=f[$][i?"long":"short"],k=e/l**$,S=n<0?void 0:n;return new Intl.NumberFormat(s,{maximumFractionDigits:S,minimumFractionDigits:S,...c}).format(k)+p+b},"formatBytes");var oF=Object.defineProperty,ke=d((e,t)=>oF(e,"name",{value:t,configurable:!0}),"f$d");const As=(1n<<128n)-1n,ie=(1n<<64n)-1n,Xa=(1n<<32n)-1n,r$=0x9E3779B1n,n$=0x85EBCA77n,aF=0xC2B2AE3Dn,sn=0x9E3779B185EBCA87n,Mn=0xC2B2AE3D27D4EB4Fn,s$=0x165667B19E3779F9n,Yd=0x85EBCA77C2B2AE63n,cF=0x27D4EB2F165667C5n,lF=0x165667919E3779F9n,uF=0x9FB21C651E98DF25n,Er=64,i$=Er/8,pF=8,Zt=Buffer.from("b8fe6c3923a44bbe7c01812cf721ad1cded46de9839097db7240a4a4b7b3671fcb79e64eccc0e578825ad07dccff7221b8084674f743248ee03590e6813a264c3c2852bb91c300cb88d0658b1b532ea371644897a20df94e3819ef46a9deacd8a8fa763fe39c343ff9dcbbc7c70b4f1d8a51e04bcdb45931c89f7ec9d9787364eac5ac8334d3ebc3c581a0fffa1363eb170ddd51b7f0da49d316552629d4689e2b16be587d47a1fc8ff8b8d17ad031ce45cb3a8f95160428afd7fbcabb4b407e","hex"),je=ke((e,t=0)=>Buffer.from(e.buffer,e.byteOffset+t,e.length-t),"getView"),dF=ke(e=>{const t=Buffer.allocUnsafe(8);return t.writeBigUInt64LE(e),t.readBigUInt64BE()},"bswap64"),fF=ke(e=>{let t=e;return t=(t&0x0000FFFFn)<<16n|(t&0xFFFF0000n)>>16n,t=(t&0x00FF00FFn)<<8n|(t&0xFF00FF00n)>>8n,t},"bswap32"),hF=ke((e,t)=>(e&Xa)*(t&Xa)&ie,"multU32ToU64"),mF=ke((e,t)=>(e<<t|e>>32n-t)&Xa,"rotl32"),zu=ke((e,t)=>e^e>>t,"xorshift64"),Ju=ke(e=>~e+1n&ie,"inv64"),o$=ke((e,t)=>{const r=e*t&As;return r&ie^r>>64n},"mul128Fold64"),rr=ke(e=>{let t=e;return t^=t>>37n,t=t*lF&ie,t^=t>>32n,t},"avalanche"),Qa=ke(e=>{let t=e;return t^=t>>33n,t=t*Mn&ie,t^=t>>29n,t=t*s$&ie,t^=t>>32n,t},"avalanche64"),a$=ke((e,t,r)=>{for(let n=0;n<i$;n++){const s=t.readBigUInt64LE(n*8),i=s^r.readBigUInt64LE(n*8);e[n^1]+=s,e[n]+=hF(i,i>>32n)}return e},"accumulate512"),om=ke((e,t,r,n)=>{for(let s=0;s<n;s++)a$(e,je(t,s*Er),je(r,s*8));return e},"accumulate"),gF=ke((e,t)=>{for(let r=0;r<i$;r++){const n=t.readBigUInt64LE(r*8);let s=e[r];s=zu(s,47n),s^=n,s*=r$,e[r]=s&ie}return e},"scrambleAcc"),aa=ke((e,t)=>o$(e[0]^t.readBigUInt64LE(0),e[1]^t.readBigUInt64LE(pF)),"mix2Accs"),am=ke((e,t,r)=>{let n=r;return n+=aa(e.slice(0),je(t,0)),n+=aa(e.slice(2),je(t,16)),n+=aa(e.slice(4),je(t,32)),n+=aa(e.slice(6),je(t,48)),rr(n&ie)},"mergeAccs"),yF=ke((e,t,r)=>{const n=Math.floor((r.byteLength-Er)/8),s=Er*n,i=Math.floor((t.byteLength-1)/s);for(let a=0;a<i;a++)om(e,je(t,a*s),r,n),gF(e,je(r,r.byteLength-Er));const o=Math.floor((t.byteLength-1-s*i)/Er);return om(e,je(t,i*s),r,o),a$(e,je(t,t.byteLength-Er),je(r,r.byteLength-Er-7)),e},"hashLong"),vF=ke((e,t)=>{const r=new BigUint64Array([aF,sn,Mn,s$,Yd,n$,cF,r$]);yF(r,e,t);const n=am(r,je(t,11),BigInt(e.byteLength)*sn&ie);return am(r,je(t,t.byteLength-Er-11),~(BigInt(e.byteLength)*Mn)&ie)<<64n|n},"hashLong128b"),cm=ke((e,t,r)=>o$((e.readBigUInt64LE(0)^t.readBigUInt64LE(0)+r)&ie,(e.readBigUInt64LE(8)^t.readBigUInt64LE(8)-r)&ie),"mix16B"),Sa=ke((e,t,r,n,s)=>{let i=e&ie,o=e>>64n&ie;return i+=cm(t,n,s),i^=r.readBigUInt64LE(0)+r.readBigUInt64LE(8),i&=ie,o+=cm(r,je(n,16),s),o^=t.readBigUInt64LE(0)+t.readBigUInt64LE(8),o&=ie,o<<64n|i},"mix32B"),bF=ke((e,t,r)=>{const n=e.byteLength,s=BigInt(e.readUInt8(n-1))|BigInt(n<<8)|BigInt(e.readUInt8(0)<<16)|BigInt(e.readUInt8(n>>1)<<24),i=(BigInt(t.readUInt32LE(0))^BigInt(t.readUInt32LE(4)))+r,o=(s^i)&ie,a=(BigInt(t.readUInt32LE(8))^BigInt(t.readUInt32LE(12)))-r,c=(mF(fF(s),13n)^a)&ie;return(Qa(c)&ie)<<64n|Qa(o)},"len1to3_128b"),$F=ke((e,t,r)=>{const n=e.byteLength,s=e.readUInt32LE(0),i=e.readUInt32LE(n-4),o=BigInt(s)|BigInt(i)<<32n,a=(t.readBigUInt64LE(16)^t.readBigUInt64LE(24))+r&ie;let c=(o^a)*(sn+(BigInt(n)<<2n))&As;return c+=(c&ie)<<65n,c&=As,c^=c>>67n,zu(zu(c&ie,35n)*uF&ie,28n)|rr(c>>64n)<<64n},"len4to8_128b"),wF=ke((e,t,r)=>{const n=e.byteLength,s=(t.readBigUInt64LE(32)^t.readBigUInt64LE(40))+r&ie,i=(t.readBigUInt64LE(48)^t.readBigUInt64LE(56))-r&ie,o=e.readBigUInt64LE();let a=e.readBigUInt64LE(n-8),c=(o^a^s)*sn;const l=(c&ie)+(BigInt(n-1)<<54n);c=c&(As^ie)|l,a^=i,c+=a+(a&Xa)*(n$-1n)<<64n,c&=As,c^=dF(c>>64n);let u=(c&ie)*Mn;return u+=(c>>64n)*Mn<<64n,u&=As,rr(u&ie)|rr(u>>64n)<<64n},"len9to16_128b"),kF=ke((e,t)=>{const r=e.byteLength;return r>8?wF(e,Zt,t):r>=4?$F(e,Zt,t):r>0?bF(e,Zt,t):Qa(t^Zt.readBigUInt64LE(64)^Zt.readBigUInt64LE(72))|Qa(t^Zt.readBigUInt64LE(80)^Zt.readBigUInt64LE(88))<<64n},"len0to16_128b"),SF=ke((e,t,r)=>{let n=BigInt(e.byteLength)*sn&ie,s=BigInt(e.byteLength-1)/32n;for(;s>=0n;){const a=Number(s);n=Sa(n,je(e,16*a),je(e,e.byteLength-16*(a+1)),je(t,32*a),r),s--}let i=n+(n>>64n)&ie;i=rr(i);let o=(n&ie)*sn+(n>>64n)*Yd+(BigInt(e.byteLength)-r&ie)*Mn;return o&=ie,o=Ju(rr(o)),i|o<<64n},"len17to128_128b"),DF=ke((e,t,r)=>{let n=BigInt(e.byteLength)*sn&ie;for(let o=32;o<160;o+=32)n=Sa(n,je(e,o-32),je(e,o-16),je(t,o-32),r);n=rr(n&ie)|rr(n>>64n)<<64n;for(let o=160;o<=e.byteLength;o+=32)n=Sa(n,je(e,o-32),je(e,o-16),je(t,3+o-160),r);n=Sa(n,je(e,e.byteLength-16),je(e,e.byteLength-32),je(t,103),Ju(r));let s=n+(n>>64n)&ie;s=rr(s);let i=(n&ie)*sn+(n>>64n)*Yd+(BigInt(e.byteLength)-r&ie)*Mn;return i&=ie,i=Ju(rr(i)),s|i<<64n},"len129to240_128b"),CF=ke((e,t=0n)=>{const r=e.byteLength;return r<=16?kF(e,t):r<=128?SF(e,Zt,t):r<=240?DF(e,Zt,t):vF(e,Zt)},"xxh3_128"),EF=ke(e=>{const t=e>>64n&ie,r=e&ie;return t.toString(16).padStart(16,"0")+r.toString(16).padStart(16,"0")},"bigintToHex"),Xd=ke(e=>EF(CF(e)),"xxh3Hash");let jF=class{static{d(this,"gn")}static{ke(this,"Xxh3Hasher")}#e=[];update(t){return typeof t=="string"?this.#e.push(Buffer.from(t)):this.#e.push(t),this}digest(){return Xd(Buffer.concat(this.#e))}};ke(()=>new jF,"createXxh3Hasher");var AF=Object.defineProperty,Yt=d((e,t)=>AF(e,"name",{value:t,configurable:!0}),"r$D");const es=Yt(()=>D(Ic(),"ai"),"getCacheDirectory"),xF=3600*1e3,OF=1800*1e3,c$=Yt(()=>{$t(es())},"ensureCacheDirectory"),dJ=Yt((e,t,r)=>{const n=r.map(i=>({currentRange:i.currentRange,name:i.packageName,targetVersion:i.targetVersion})).toSorted((i,o)=>i.name.localeCompare(o.name)),s=JSON.stringify({analysisType:t,packages:n,provider:e});return Xd(Buffer.from(s))},"buildCacheKey"),fJ=Yt(e=>{const t=D(es(),`${e}.json`);if(j(t))try{const r=le(t);if(Date.now()-r.createdAt>r.ttlMs){Nt(t,{force:!0});return}return r.result}catch{Nt(t,{force:!0});return}},"getCachedAnalysis"),hJ=Yt((e,t,r)=>{c$();const n=es(),s={createdAt:Date.now(),result:t,ttlMs:r};Oe(D(n,`${e}.json`),JSON.stringify(s,void 0,2),"utf8")},"setCachedAnalysis"),mJ=Yt((e,t)=>t!==void 0&&t>0?t:e==="security"?OF:xF,"getTtlForAnalysisType"),Ku=Yt(()=>{const e=es();if(!j(e))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const t=Ze(e).filter(i=>i.endsWith(".json"));let r=0,n,s;for(const i of t){const o=D(e,i),a=cr(o);r+=a.size;const{mtimeMs:c}=a;(n===void 0||c<n)&&(n=c),(s===void 0||c>s)&&(s=c)}return{entries:t.length,newestEntry:s,oldestEntry:n,totalSizeBytes:r}},"getCacheStats"),gJ=Yt(e=>Xd(Buffer.from(JSON.stringify(e))),"buildHashCacheKey"),yJ=Yt(e=>{const t=D(es(),`${e}.json`);if(j(t))try{const r=le(t);if(Date.now()-r.createdAt>r.ttlMs){Nt(t,{force:!0});return}return r.result}catch{Nt(t,{force:!0});return}},"getCachedJson"),vJ=Yt((e,t,r)=>{c$();const n=es(),s={createdAt:Date.now(),result:t,ttlMs:r};Oe(D(n,`${e}.json`),JSON.stringify(s,void 0,2),"utf8")},"setCachedJson"),PF=Yt(()=>{const e=es();if(!j(e))return 0;const t=Ze(e).filter(r=>r.endsWith(".json"));for(const r of t)Nt(D(e,r),{force:!0});return t.length},"clearCache");var FF=Object.defineProperty,Ir=d((e,t)=>FF(e,"name",{value:t,configurable:!0}),"w$c"),BF=Object.defineProperty,st=Ir((e,t)=>BF(e,"name",{value:t,configurable:!0}),"m");const RF=mt(import.meta.url),gs=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Qd=st(e=>{if(typeof gs<"u"&&gs.versions&&gs.versions.node){const[t,r]=gs.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return gs.getBuiltinModule(e)}return RF(e)},"__cjs_getBuiltinModule"),Fn=gs,{execFileSync:TF}=Qd("node:child_process"),Ki=Qd("node:fs"),NF=Qd("node:tty");var IF=Object.defineProperty,Zd=st((e,t)=>IF(e,"name",{value:t,configurable:!0}),"u$2"),LF=Object.defineProperty,_c=Zd((e,t)=>LF(e,"name",{value:t,configurable:!0}),"l");const _F=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],MF=12288,WF=65510,VF=[12288,12288,65281,65376,65504,65510],UF=8361,GF=65518,qF=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],HF=32,zF=10630,JF=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],KF=4352,YF=262141,l$=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var XF=Object.defineProperty,QF=_c((e,t)=>XF(e,"name",{value:t,configurable:!0}),"r$1");const Go=QF((e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){const s=Math.floor((r+n)/2),i=s*2;if(t<e[i])n=s-1;else if(t>e[i+1])r=s+1;else return!0}return!1},"isInRange");var ZF=Object.defineProperty,ts=_c((e,t)=>ZF(e,"name",{value:t,configurable:!0}),"r");const lm=19968,[eB,tB]=ei(l$);function ei(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){const s=e[n],i=e[n+1];if(lm>=s&&lm<=i)return[s,i];i-s>r-t&&(t=s,r=i)}return[t,r]}d(ei,"P$d");Ir(ei,"L");st(ei,"c$2");Zd(ei,"f");_c(ei,"k");ts(ei,"findWideFastPathRange");const u$=ts(e=>e<161||e>1114109?!1:Go(_F,e),"isAmbiguous"),p$=ts(e=>e<MF||e>WF?!1:Go(VF,e),"isFullWidth"),rB=ts(e=>e<UF||e>GF?!1:Go(qF,e),"isHalfWidth"),nB=ts(e=>e<HF||e>zF?!1:Go(JF,e),"isNarrow"),d$=ts(e=>e>=eB&&e<=tB?!0:e<KF||e>YF?!1:Go(l$,e),"isWide");function ti(e){return u$(e)?"ambiguous":p$(e)?"fullwidth":rB(e)?"halfwidth":nB(e)?"narrow":d$(e)?"wide":"neutral"}d(ti,"M$h");Ir(ti,"q");st(ti,"g$3");Zd(ti,"S");_c(ti,"getCategory");ts(ti,"getCategory");var sB=Object.defineProperty,Mc=st((e,t)=>sB(e,"name",{value:t,configurable:!0}),"i$2"),iB=Object.defineProperty,Wc=Mc((e,t)=>iB(e,"name",{value:t,configurable:!0}),"a"),oB=Object.defineProperty,ef=Wc((e,t)=>oB(e,"name",{value:t,configurable:!0}),"e");function rs(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}d(rs,"O$g");Ir(rs,"N");st(rs,"s$1");Mc(rs,"s");Wc(rs,"r");ef(rs,"validate");function ns(e){return rs(e),ti(e)}d(ns,"B$a");Ir(ns,"F");st(ns,"r$2");Mc(ns,"p");Wc(ns,"eastAsianWidthType");ef(ns,"eastAsianWidthType");function qo(e,{ambiguousAsWide:t=!1}={}){return rs(e),p$(e)||d$(e)||t&&u$(e)?2:1}d(qo,"z$8");Ir(qo,"re");st(qo,"o$2");Mc(qo,"W");Wc(qo,"eastAsianWidth");ef(qo,"eastAsianWidth");var aB=Object.defineProperty,cB=st((e,t)=>aB(e,"name",{value:t,configurable:!0}),"p$2"),lB=Object.defineProperty,f$=cB((e,t)=>lB(e,"name",{value:t,configurable:!0}),"e"),uB=Object.defineProperty,pB=f$((e,t)=>uB(e,"name",{value:t,configurable:!0}),"E");const h$=String.raw,um=h$`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,dB=pB(()=>new RegExp(h$`\p{RI}{2}|(?)${um}(?:\u200D${um})*`,"gu"),"default");var fB=Object.defineProperty,hB=f$((e,t)=>fB(e,"name",{value:t,configurable:!0}),"p");const ri=new Set(["\x1B",""]),Vc="\x07",m$="[",tf="m",Za="]8;;",mB=39,gB=/[\u200B\uFEFF\u2060-\u2064]/g,yB=new RegExp(`(?:\\${m$}(?<code>\\d+)m|\\${Za}(?<uri>.*)${Vc})`),vB=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),Ti=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,ca=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Da=dB();hB(e=>e.replace(Da,""),"stripEmoji");var bB=Object.defineProperty,$B=st((e,t)=>bB(e,"name",{value:t,configurable:!0}),"E"),wB=Object.defineProperty,kB=$B((e,t)=>wB(e,"name",{value:t,configurable:!0}),"A"),SB=Object.defineProperty,Uc=kB((e,t)=>SB(e,"name",{value:t,configurable:!0}),"d");const pm=new Map,la=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Ca=Uc(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),DB=Uc((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let s=pm.get(r);if(s||(s=new Map,pm.set(r,s)),s.has(n))return s.get(n);let i;if(Ca(e)==="latin")i=t.width.regular;else if(Ca(e)==="control")i=t.width.control;else if(Ca(e)==="wide")i=t.width.wide;else switch(ns(e)){case"ambiguous":{i=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{i=t.width.fullWidth;break}case"wide":{i=t.width.wide;break}default:i=t.width.regular}return s.set(n,i),i},"getCachedCharWidth"),CB=Uc(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),Yu=Uc((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?Yu(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},n=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:s}=e,i=s>1e4;let o=0,a=0,c=s,l=!1;const u=e.includes("\x1B")||e.includes("");for(;o<s;){if(u&&(e[o]==="\x1B"||e[o]==="")){if(e.startsWith("\x1B]8;;",o)){const k="\x1B]8;;\x07",S=k.length,y=e.indexOf("\x07",o+5);if(y!==-1){const h=e.indexOf(k,y+1);if(h!==-1){const v=h+S,w=e.slice(y+1,h).replace(Ti,""),g=Yu(w,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,n-a),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),E=g.width;if(g.truncated)l=!0,c=Math.min(c,o);else if(a+E>n&&(c=Math.min(c,o),l=!0,a+E>r.truncation.limit))break;if(a+=E,o=v,l&&a>=r.truncation.limit)break;continue}}}if(Ti.lastIndex=o,Ti.test(e)){const k=Ti.lastIndex-o,S=r.truncation.countAnsiEscapeCodes?k:r.width.ansi;if(a+S>n&&(c=Math.min(c,o),a+S>r.truncation.limit)){l=!0;break}a+=S,o=Ti.lastIndex;continue}}const m=e.codePointAt(o);if(m===8203||m===65279||m>=8288&&m<=8292){o+=1;continue}if(m===9){if(a+r.width.tab>n&&(c=Math.min(c,o),a+r.width.tab>r.truncation.limit)){l=!0;break}a+=r.width.tab,o+=1;continue}if(la.lastIndex=o,la.test(e)){const k=(la.lastIndex-o)*r.width.regular;if(a+k>n){const S=Math.floor((n-a)/r.width.regular);if(c=Math.min(c,o+S),a+k>r.truncation.limit){l=!0;break}}a+=k,o=la.lastIndex;continue}if((m<=31||m>=127&&m<=159)&&(ca.lastIndex=o,ca.test(e))){const k=(ca.lastIndex-o)*r.width.control;if(a+k>n&&(c=Math.min(c,o+Math.floor((n-a)/r.width.control)),a+k>r.truncation.limit)){l=!0;break}a+=k,o=ca.lastIndex;continue}if(Da.lastIndex=o,Da.test(e)){if(a+r.width.emoji>n&&(c=Math.min(c,o),a+r.width.emoji>r.truncation.limit)){l=!0;break}a+=r.width.emoji,o=Da.lastIndex;continue}const $=e.codePointAt(o)??0;if(CB($)){o+=$>65535?2:1;continue}let b;if(i)b=DB($,r);else switch(Ca($)){case"control":{b=r.width.control;break}case"latin":{b=r.width.regular;break}case"wide":{b=r.width.wide;break}case"zero":{b=0;break}default:switch(ns($)){case"ambiguous":{b=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{b=r.width.fullWidth;break}case"wide":{b=r.width.wide;break}default:b=r.width.regular}}if(a+b>n&&(c=Math.min(c,o),a+b>r.truncation.limit)){l=!0;break}a+=b,o+=$>65535?2:1}let p=a,f=!1;return l&&r.truncation.limit>=r.truncation.ellipsisWidth&&(p=r.truncation.limit,f=!0),{ellipsed:f,index:l?c:s,truncated:l,width:p}},"getStringTruncatedWidth");var EB=Object.defineProperty,jB=st((e,t)=>EB(e,"name",{value:t,configurable:!0}),"i"),AB=Object.defineProperty,xB=jB((e,t)=>AB(e,"name",{value:t,configurable:!0}),"e"),OB=Object.defineProperty,PB=xB((e,t)=>OB(e,"name",{value:t,configurable:!0}),"r");const Zr=PB((e,t={})=>Yu(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var FB=Object.defineProperty,g$=st((e,t)=>FB(e,"name",{value:t,configurable:!0}),"b"),BB=Object.defineProperty,ss=g$((e,t)=>BB(e,"name",{value:t,configurable:!0}),"d"),RB=Object.defineProperty,TB=ss((e,t)=>RB(e,"name",{value:t,configurable:!0}),"a");const NB=/\x1B\[(\d+)m/;let y$=class{static{d(this,"At")}static{Ir(this,"$e")}static{st(this,"T")}static{g$(this,"T")}static{ss(this,"d")}static{TB(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=NB.exec(t);if(!r)return;const n=Number.parseInt(r[1],10);switch(n){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(n>=30&&n<=37||n>=90&&n<=97)this.activeForeground=t;else if(n>=40&&n<=47||n>=100&&n<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(n))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(n)){const s={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[n];s&&(this.activeFormatting=this.activeFormatting.filter(i=>!i.includes(s)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const r={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(n=>{const s=r[n];s&&t.push(s)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}};var IB=Object.defineProperty,v$=ss((e,t)=>IB(e,"name",{value:t,configurable:!0}),"o");const b$=v$((e,t)=>{if(!ri.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+Za.length).join("")===Za;return{isInsideEscape:r,isInsideLinkEscape:n}},"checkEscapeSequence"),LB=v$((e,t={})=>{const r=new y$;let n="",s=!1,i="",o="",a=!1;const c=[...e];for(let l=0;l<c.length;l++){const u=c[l];if(u&&ri.has(u)){if(n){const b=t.getWidth?.(n)??0,k={isEscapeSequence:!1,isGrapheme:!0,text:n,width:b};if(a&&(k.isHyperlink=!0,k.hyperlinkUrl=o),t.onSegment?.(k,r)===!1)return;n=""}s=!0,i=u;const m=b$(c,l),{isInsideLinkEscape:$}=m;if($){let b=l+1;for(o="";b<c.length;){const S=c[b];if(S===Vc)break;o+=S,b+=1}o=o.slice(4);const k={hyperlinkUrl:o,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(k,r)===!1)return;l=b,a=!0,s=!1,i="";continue}if(l+1<c.length&&c[l+1]==="\\"&&a){const b={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(b,r)===!1)return;a=!1,o="",l+=1,s=!1,i="";continue}}if(s){if(i!==u&&(i+=u),u===tf){s=!1,r.processEscape(i);const m={isEscapeSequence:!0,isGrapheme:!1,text:i,width:0};if(t.onSegment?.(m,r)===!1)return;i=""}continue}n+=u;const p=t.getWidth?.(n)??0,f={isEscapeSequence:!1,isGrapheme:!0,text:n,width:p};if(a&&(f.isHyperlink=!0,f.hyperlinkUrl=o),t.onSegment?.(f,r)===!1)return;n=""}if(n){const l=t.getWidth?.(n)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:n,width:l};a&&(u.isHyperlink=!0,u.hyperlinkUrl=o),t.onSegment?.(u,r)}if(i){const l={isEscapeSequence:!0,isGrapheme:!1,text:i,width:0};t.onSegment?.(l,r)}},"processAnsiString");var _B=Object.defineProperty,MB=ss((e,t)=>_B(e,"name",{value:t,configurable:!0}),"t$1");const dm=MB(e=>`${ri.values().next().value}${m$}${String(e)}${tf}`,"wrapAnsiCode");var WB=Object.defineProperty,VB=ss((e,t)=>WB(e,"name",{value:t,configurable:!0}),"s");const fm=VB(e=>`${ri.values().next().value}${Za}${e}${Vc}`,"wrapAnsiHyperlink");var UB=Object.defineProperty,GB=ss((e,t)=>UB(e,"name",{value:t,configurable:!0}),"l");const qB=GB(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,n;const s=e.join(`
|
|
985
|
+
`;await this.write(n)}},_P=Kd(async(e,t,r)=>{try{await t(e)}catch(n){n instanceof Error&&r?(await r(n,e),await e.writeSSE({event:"error",data:n.message})):console.error(n)}finally{e.close()}},"run"),MP=new WeakMap,WP=Kd((e,t,r)=>{const{readable:n,writable:s}=new TransformStream,i=new LP(s,n);return Jd()&&e.req.raw.signal.addEventListener("abort",()=>{i.closed||i.abort()}),MP.set(i.responseReadable,e),e.header("Transfer-Encoding","chunked"),e.header("Content-Type","text/event-stream"),e.header("Cache-Control","no-cache"),e.header("Connection","keep-alive"),_P(i,t,r),e.newResponse(i.responseReadable)},"streamSSE"),VP=Object.defineProperty,UP=d((e,t)=>VP(e,"name",{value:t,configurable:!0}),"n$w");UP((e,t,r)=>(e.header("Content-Type",M0),e.header("X-Content-Type-Options","nosniff"),e.header("Transfer-Encoding","chunked"),NP(e,t,r)),"streamText");var GP=Object.defineProperty,qP=d((e,t)=>GP(e,"name",{value:t,configurable:!0}),"y$i"),HP=Object.defineProperty,zP=qP((e,t)=>HP(e,"name",{value:t,configurable:!0}),"y"),JP=Object.defineProperty,Lc=zP((e,t)=>JP(e,"name",{value:t,configurable:!0}),"i");const KP=/^(?<value>-?\d+(?:[.,]\d+)*) *(?<type>[a-z]+)?$/i,YP=/^KIBI/,XP=/^MIBI/,QP=/^GIBI/,ZP=/^TEBI/,eF=/^PEBI/,tF=/^EXBI/,rF=/^ZEBI/,nF=/^YIBI/,sF=/^(.)IB$/,e$={iec:[{long:"Bytes",short:"B"},{long:"Kibibytes",short:"KiB"},{long:"Mebibytes",short:"MiB"},{long:"Gibibytes",short:"GiB"},{long:"Tebibytes",short:"TiB"},{long:"Pebibytes",short:"PiB"},{long:"Exbibytes",short:"EiB"},{long:"Zebibytes",short:"ZiB"},{long:"Yobibytes",short:"YiB"}],iec_octet:[{long:"Octets",short:"o"},{long:"Kibioctets",short:"Kio"},{long:"Mebioctets",short:"Mio"},{long:"Gibioctets",short:"Gio"},{long:"Tebioctets",short:"Tio"},{long:"Pebioctets",short:"Pio"},{long:"Exbioctets",short:"Eio"},{long:"Zebioctets",short:"Zio"},{long:"Yobioctets",short:"Yio"}],metric:[{long:"Bytes",short:"Bytes"},{long:"Kilobytes",short:"KB"},{long:"Megabytes",short:"MB"},{long:"Gigabytes",short:"GB"},{long:"Terabytes",short:"TB"},{long:"Petabytes",short:"PB"},{long:"Exabytes",short:"EB"},{long:"Zettabytes",short:"ZB"},{long:"Yottabytes",short:"YB"}],metric_octet:[{long:"Octets",short:"o"},{long:"Kilo-octets",short:"ko"},{long:"Mega-octets",short:"Mo"},{long:"Giga-octets",short:"Go"},{long:"Tera-octets",short:"To"},{long:"Peta-octets",short:"Po"},{long:"Exa-octets",short:"Eo"},{long:"Zetta-octets",short:"Zo"},{long:"Yotta-octets",short:"Yo"}]},iF=Lc((e,t)=>{const r=new Intl.NumberFormat(t).format(11111).replaceAll(new RegExp("\\p{Number}","gu"),""),n=new Intl.NumberFormat(t).format(1.1).replaceAll(new RegExp("\\p{Number}","gu"),"");return Number.parseFloat(e.replaceAll(new RegExp(`\\${r}`,"g"),"").replace(new RegExp(`\\${n}`),"."))},"parseLocalizedNumber"),t$=Lc(e=>{switch(e){case 2:return 1024;case 10:return 1e3;default:throw new Error("Unsupported base.")}},"fromBase");Lc((e,t)=>{const r={base:2,locale:"en-US",units:"metric",...t};if(typeof e!="string"||e.length===0)throw new TypeError("Value is not a string or is empty.");if(e.length>100)throw new TypeError("Value exceeds the maximum length of 100 characters.");const n=KP.exec(e)?.groups;if(!n)return Number.NaN;const s=iF(n.value,r.locale),i=(n.type??"Bytes").toUpperCase().replace(YP,"KILO").replace(XP,"MEGA").replace(QP,"GIGA").replace(ZP,"TERA").replace(eF,"PETA").replace(tF,"EXA").replace(rF,"ZETTA").replace(nF,"YOTTA").replace(sF,"$1B"),o=e$[r.units].findIndex(c=>c.short[0].toUpperCase()===i[0]),a=t$(r.base);return s*a**o},"parseBytes");const Ms=Lc((e,t)=>{if(typeof e!="number"||!Number.isFinite(e))throw new TypeError("Bytesize is not a number.");const{base:r,decimals:n,locale:s,long:i,unit:o,units:a,...c}={base:2,decimals:0,locale:"en-US",long:!1,units:"metric",...t},l=t$(r),u=Math.abs(e),p=t?.space??!0?" ":"",f=e$[a],m=f.findIndex(y=>y.short===o);if(e===0){const y=Math.min(0,Math.max(m,f.length-1));return"0"+p+f[y][i?"long":"short"]}const $=m===-1?Math.min(Math.floor(Math.log(u)/Math.log(l)),f.length-1):m,b=f[$][i?"long":"short"],k=e/l**$,S=n<0?void 0:n;return new Intl.NumberFormat(s,{maximumFractionDigits:S,minimumFractionDigits:S,...c}).format(k)+p+b},"formatBytes");var oF=Object.defineProperty,ke=d((e,t)=>oF(e,"name",{value:t,configurable:!0}),"f$d");const As=(1n<<128n)-1n,ie=(1n<<64n)-1n,Xa=(1n<<32n)-1n,r$=0x9E3779B1n,n$=0x85EBCA77n,aF=0xC2B2AE3Dn,sn=0x9E3779B185EBCA87n,Mn=0xC2B2AE3D27D4EB4Fn,s$=0x165667B19E3779F9n,Yd=0x85EBCA77C2B2AE63n,cF=0x27D4EB2F165667C5n,lF=0x165667919E3779F9n,uF=0x9FB21C651E98DF25n,Er=64,i$=Er/8,pF=8,Zt=Buffer.from("b8fe6c3923a44bbe7c01812cf721ad1cded46de9839097db7240a4a4b7b3671fcb79e64eccc0e578825ad07dccff7221b8084674f743248ee03590e6813a264c3c2852bb91c300cb88d0658b1b532ea371644897a20df94e3819ef46a9deacd8a8fa763fe39c343ff9dcbbc7c70b4f1d8a51e04bcdb45931c89f7ec9d9787364eac5ac8334d3ebc3c581a0fffa1363eb170ddd51b7f0da49d316552629d4689e2b16be587d47a1fc8ff8b8d17ad031ce45cb3a8f95160428afd7fbcabb4b407e","hex"),je=ke((e,t=0)=>Buffer.from(e.buffer,e.byteOffset+t,e.length-t),"getView"),dF=ke(e=>{const t=Buffer.allocUnsafe(8);return t.writeBigUInt64LE(e),t.readBigUInt64BE()},"bswap64"),fF=ke(e=>{let t=e;return t=(t&0x0000FFFFn)<<16n|(t&0xFFFF0000n)>>16n,t=(t&0x00FF00FFn)<<8n|(t&0xFF00FF00n)>>8n,t},"bswap32"),hF=ke((e,t)=>(e&Xa)*(t&Xa)&ie,"multU32ToU64"),mF=ke((e,t)=>(e<<t|e>>32n-t)&Xa,"rotl32"),zu=ke((e,t)=>e^e>>t,"xorshift64"),Ju=ke(e=>~e+1n&ie,"inv64"),o$=ke((e,t)=>{const r=e*t&As;return r&ie^r>>64n},"mul128Fold64"),rr=ke(e=>{let t=e;return t^=t>>37n,t=t*lF&ie,t^=t>>32n,t},"avalanche"),Qa=ke(e=>{let t=e;return t^=t>>33n,t=t*Mn&ie,t^=t>>29n,t=t*s$&ie,t^=t>>32n,t},"avalanche64"),a$=ke((e,t,r)=>{for(let n=0;n<i$;n++){const s=t.readBigUInt64LE(n*8),i=s^r.readBigUInt64LE(n*8);e[n^1]+=s,e[n]+=hF(i,i>>32n)}return e},"accumulate512"),om=ke((e,t,r,n)=>{for(let s=0;s<n;s++)a$(e,je(t,s*Er),je(r,s*8));return e},"accumulate"),gF=ke((e,t)=>{for(let r=0;r<i$;r++){const n=t.readBigUInt64LE(r*8);let s=e[r];s=zu(s,47n),s^=n,s*=r$,e[r]=s&ie}return e},"scrambleAcc"),aa=ke((e,t)=>o$(e[0]^t.readBigUInt64LE(0),e[1]^t.readBigUInt64LE(pF)),"mix2Accs"),am=ke((e,t,r)=>{let n=r;return n+=aa(e.slice(0),je(t,0)),n+=aa(e.slice(2),je(t,16)),n+=aa(e.slice(4),je(t,32)),n+=aa(e.slice(6),je(t,48)),rr(n&ie)},"mergeAccs"),yF=ke((e,t,r)=>{const n=Math.floor((r.byteLength-Er)/8),s=Er*n,i=Math.floor((t.byteLength-1)/s);for(let a=0;a<i;a++)om(e,je(t,a*s),r,n),gF(e,je(r,r.byteLength-Er));const o=Math.floor((t.byteLength-1-s*i)/Er);return om(e,je(t,i*s),r,o),a$(e,je(t,t.byteLength-Er),je(r,r.byteLength-Er-7)),e},"hashLong"),vF=ke((e,t)=>{const r=new BigUint64Array([aF,sn,Mn,s$,Yd,n$,cF,r$]);yF(r,e,t);const n=am(r,je(t,11),BigInt(e.byteLength)*sn&ie);return am(r,je(t,t.byteLength-Er-11),~(BigInt(e.byteLength)*Mn)&ie)<<64n|n},"hashLong128b"),cm=ke((e,t,r)=>o$((e.readBigUInt64LE(0)^t.readBigUInt64LE(0)+r)&ie,(e.readBigUInt64LE(8)^t.readBigUInt64LE(8)-r)&ie),"mix16B"),Sa=ke((e,t,r,n,s)=>{let i=e&ie,o=e>>64n&ie;return i+=cm(t,n,s),i^=r.readBigUInt64LE(0)+r.readBigUInt64LE(8),i&=ie,o+=cm(r,je(n,16),s),o^=t.readBigUInt64LE(0)+t.readBigUInt64LE(8),o&=ie,o<<64n|i},"mix32B"),bF=ke((e,t,r)=>{const n=e.byteLength,s=BigInt(e.readUInt8(n-1))|BigInt(n<<8)|BigInt(e.readUInt8(0)<<16)|BigInt(e.readUInt8(n>>1)<<24),i=(BigInt(t.readUInt32LE(0))^BigInt(t.readUInt32LE(4)))+r,o=(s^i)&ie,a=(BigInt(t.readUInt32LE(8))^BigInt(t.readUInt32LE(12)))-r,c=(mF(fF(s),13n)^a)&ie;return(Qa(c)&ie)<<64n|Qa(o)},"len1to3_128b"),$F=ke((e,t,r)=>{const n=e.byteLength,s=e.readUInt32LE(0),i=e.readUInt32LE(n-4),o=BigInt(s)|BigInt(i)<<32n,a=(t.readBigUInt64LE(16)^t.readBigUInt64LE(24))+r&ie;let c=(o^a)*(sn+(BigInt(n)<<2n))&As;return c+=(c&ie)<<65n,c&=As,c^=c>>67n,zu(zu(c&ie,35n)*uF&ie,28n)|rr(c>>64n)<<64n},"len4to8_128b"),wF=ke((e,t,r)=>{const n=e.byteLength,s=(t.readBigUInt64LE(32)^t.readBigUInt64LE(40))+r&ie,i=(t.readBigUInt64LE(48)^t.readBigUInt64LE(56))-r&ie,o=e.readBigUInt64LE();let a=e.readBigUInt64LE(n-8),c=(o^a^s)*sn;const l=(c&ie)+(BigInt(n-1)<<54n);c=c&(As^ie)|l,a^=i,c+=a+(a&Xa)*(n$-1n)<<64n,c&=As,c^=dF(c>>64n);let u=(c&ie)*Mn;return u+=(c>>64n)*Mn<<64n,u&=As,rr(u&ie)|rr(u>>64n)<<64n},"len9to16_128b"),kF=ke((e,t)=>{const r=e.byteLength;return r>8?wF(e,Zt,t):r>=4?$F(e,Zt,t):r>0?bF(e,Zt,t):Qa(t^Zt.readBigUInt64LE(64)^Zt.readBigUInt64LE(72))|Qa(t^Zt.readBigUInt64LE(80)^Zt.readBigUInt64LE(88))<<64n},"len0to16_128b"),SF=ke((e,t,r)=>{let n=BigInt(e.byteLength)*sn&ie,s=BigInt(e.byteLength-1)/32n;for(;s>=0n;){const a=Number(s);n=Sa(n,je(e,16*a),je(e,e.byteLength-16*(a+1)),je(t,32*a),r),s--}let i=n+(n>>64n)&ie;i=rr(i);let o=(n&ie)*sn+(n>>64n)*Yd+(BigInt(e.byteLength)-r&ie)*Mn;return o&=ie,o=Ju(rr(o)),i|o<<64n},"len17to128_128b"),DF=ke((e,t,r)=>{let n=BigInt(e.byteLength)*sn&ie;for(let o=32;o<160;o+=32)n=Sa(n,je(e,o-32),je(e,o-16),je(t,o-32),r);n=rr(n&ie)|rr(n>>64n)<<64n;for(let o=160;o<=e.byteLength;o+=32)n=Sa(n,je(e,o-32),je(e,o-16),je(t,3+o-160),r);n=Sa(n,je(e,e.byteLength-16),je(e,e.byteLength-32),je(t,103),Ju(r));let s=n+(n>>64n)&ie;s=rr(s);let i=(n&ie)*sn+(n>>64n)*Yd+(BigInt(e.byteLength)-r&ie)*Mn;return i&=ie,i=Ju(rr(i)),s|i<<64n},"len129to240_128b"),CF=ke((e,t=0n)=>{const r=e.byteLength;return r<=16?kF(e,t):r<=128?SF(e,Zt,t):r<=240?DF(e,Zt,t):vF(e,Zt)},"xxh3_128"),EF=ke(e=>{const t=e>>64n&ie,r=e&ie;return t.toString(16).padStart(16,"0")+r.toString(16).padStart(16,"0")},"bigintToHex"),Xd=ke(e=>EF(CF(e)),"xxh3Hash");let jF=class{static{d(this,"gn")}static{ke(this,"Xxh3Hasher")}#e=[];update(t){return typeof t=="string"?this.#e.push(Buffer.from(t)):this.#e.push(t),this}digest(){return Xd(Buffer.concat(this.#e))}};ke(()=>new jF,"createXxh3Hasher");var AF=Object.defineProperty,Yt=d((e,t)=>AF(e,"name",{value:t,configurable:!0}),"r$C");const es=Yt(()=>D(Ic(),"ai"),"getCacheDirectory"),xF=3600*1e3,OF=1800*1e3,c$=Yt(()=>{$t(es())},"ensureCacheDirectory"),$J=Yt((e,t,r)=>{const n=r.map(i=>({currentRange:i.currentRange,name:i.packageName,targetVersion:i.targetVersion})).toSorted((i,o)=>i.name.localeCompare(o.name)),s=JSON.stringify({analysisType:t,packages:n,provider:e});return Xd(Buffer.from(s))},"buildCacheKey"),wJ=Yt(e=>{const t=D(es(),`${e}.json`);if(j(t))try{const r=le(t);if(Date.now()-r.createdAt>r.ttlMs){Nt(t,{force:!0});return}return r.result}catch{Nt(t,{force:!0});return}},"getCachedAnalysis"),kJ=Yt((e,t,r)=>{c$();const n=es(),s={createdAt:Date.now(),result:t,ttlMs:r};Oe(D(n,`${e}.json`),JSON.stringify(s,void 0,2),"utf8")},"setCachedAnalysis"),SJ=Yt((e,t)=>t!==void 0&&t>0?t:e==="security"?OF:xF,"getTtlForAnalysisType"),Ku=Yt(()=>{const e=es();if(!j(e))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const t=Ze(e).filter(i=>i.endsWith(".json"));let r=0,n,s;for(const i of t){const o=D(e,i),a=cr(o);r+=a.size;const{mtimeMs:c}=a;(n===void 0||c<n)&&(n=c),(s===void 0||c>s)&&(s=c)}return{entries:t.length,newestEntry:s,oldestEntry:n,totalSizeBytes:r}},"getCacheStats"),DJ=Yt(e=>Xd(Buffer.from(JSON.stringify(e))),"buildHashCacheKey"),CJ=Yt(e=>{const t=D(es(),`${e}.json`);if(j(t))try{const r=le(t);if(Date.now()-r.createdAt>r.ttlMs){Nt(t,{force:!0});return}return r.result}catch{Nt(t,{force:!0});return}},"getCachedJson"),EJ=Yt((e,t,r)=>{c$();const n=es(),s={createdAt:Date.now(),result:t,ttlMs:r};Oe(D(n,`${e}.json`),JSON.stringify(s,void 0,2),"utf8")},"setCachedJson"),PF=Yt(()=>{const e=es();if(!j(e))return 0;const t=Ze(e).filter(r=>r.endsWith(".json"));for(const r of t)Nt(D(e,r),{force:!0});return t.length},"clearCache");var FF=Object.defineProperty,Ir=d((e,t)=>FF(e,"name",{value:t,configurable:!0}),"w$c"),BF=Object.defineProperty,st=Ir((e,t)=>BF(e,"name",{value:t,configurable:!0}),"m");const RF=mt(import.meta.url),gs=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Qd=st(e=>{if(typeof gs<"u"&&gs.versions&&gs.versions.node){const[t,r]=gs.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return gs.getBuiltinModule(e)}return RF(e)},"__cjs_getBuiltinModule"),Fn=gs,{execFileSync:TF}=Qd("node:child_process"),Ki=Qd("node:fs"),NF=Qd("node:tty");var IF=Object.defineProperty,Zd=st((e,t)=>IF(e,"name",{value:t,configurable:!0}),"u$2"),LF=Object.defineProperty,_c=Zd((e,t)=>LF(e,"name",{value:t,configurable:!0}),"l");const _F=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],MF=12288,WF=65510,VF=[12288,12288,65281,65376,65504,65510],UF=8361,GF=65518,qF=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],HF=32,zF=10630,JF=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],KF=4352,YF=262141,l$=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var XF=Object.defineProperty,QF=_c((e,t)=>XF(e,"name",{value:t,configurable:!0}),"r$1");const Go=QF((e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){const s=Math.floor((r+n)/2),i=s*2;if(t<e[i])n=s-1;else if(t>e[i+1])r=s+1;else return!0}return!1},"isInRange");var ZF=Object.defineProperty,ts=_c((e,t)=>ZF(e,"name",{value:t,configurable:!0}),"r");const lm=19968,[eB,tB]=ei(l$);function ei(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){const s=e[n],i=e[n+1];if(lm>=s&&lm<=i)return[s,i];i-s>r-t&&(t=s,r=i)}return[t,r]}d(ei,"P$d");Ir(ei,"L");st(ei,"c$2");Zd(ei,"f");_c(ei,"k");ts(ei,"findWideFastPathRange");const u$=ts(e=>e<161||e>1114109?!1:Go(_F,e),"isAmbiguous"),p$=ts(e=>e<MF||e>WF?!1:Go(VF,e),"isFullWidth"),rB=ts(e=>e<UF||e>GF?!1:Go(qF,e),"isHalfWidth"),nB=ts(e=>e<HF||e>zF?!1:Go(JF,e),"isNarrow"),d$=ts(e=>e>=eB&&e<=tB?!0:e<KF||e>YF?!1:Go(l$,e),"isWide");function ti(e){return u$(e)?"ambiguous":p$(e)?"fullwidth":rB(e)?"halfwidth":nB(e)?"narrow":d$(e)?"wide":"neutral"}d(ti,"M$h");Ir(ti,"q");st(ti,"g$3");Zd(ti,"S");_c(ti,"getCategory");ts(ti,"getCategory");var sB=Object.defineProperty,Mc=st((e,t)=>sB(e,"name",{value:t,configurable:!0}),"i$2"),iB=Object.defineProperty,Wc=Mc((e,t)=>iB(e,"name",{value:t,configurable:!0}),"a"),oB=Object.defineProperty,ef=Wc((e,t)=>oB(e,"name",{value:t,configurable:!0}),"e");function rs(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}d(rs,"O$h");Ir(rs,"N");st(rs,"s$1");Mc(rs,"s");Wc(rs,"r");ef(rs,"validate");function ns(e){return rs(e),ti(e)}d(ns,"B$a");Ir(ns,"F");st(ns,"r$2");Mc(ns,"p");Wc(ns,"eastAsianWidthType");ef(ns,"eastAsianWidthType");function qo(e,{ambiguousAsWide:t=!1}={}){return rs(e),p$(e)||d$(e)||t&&u$(e)?2:1}d(qo,"z$8");Ir(qo,"re");st(qo,"o$2");Mc(qo,"W");Wc(qo,"eastAsianWidth");ef(qo,"eastAsianWidth");var aB=Object.defineProperty,cB=st((e,t)=>aB(e,"name",{value:t,configurable:!0}),"p$2"),lB=Object.defineProperty,f$=cB((e,t)=>lB(e,"name",{value:t,configurable:!0}),"e"),uB=Object.defineProperty,pB=f$((e,t)=>uB(e,"name",{value:t,configurable:!0}),"E");const h$=String.raw,um=h$`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,dB=pB(()=>new RegExp(h$`\p{RI}{2}|(?)${um}(?:\u200D${um})*`,"gu"),"default");var fB=Object.defineProperty,hB=f$((e,t)=>fB(e,"name",{value:t,configurable:!0}),"p");const ri=new Set(["\x1B",""]),Vc="\x07",m$="[",tf="m",Za="]8;;",mB=39,gB=/[\u200B\uFEFF\u2060-\u2064]/g,yB=new RegExp(`(?:\\${m$}(?<code>\\d+)m|\\${Za}(?<uri>.*)${Vc})`),vB=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),Ti=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,ca=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Da=dB();hB(e=>e.replace(Da,""),"stripEmoji");var bB=Object.defineProperty,$B=st((e,t)=>bB(e,"name",{value:t,configurable:!0}),"E"),wB=Object.defineProperty,kB=$B((e,t)=>wB(e,"name",{value:t,configurable:!0}),"A"),SB=Object.defineProperty,Uc=kB((e,t)=>SB(e,"name",{value:t,configurable:!0}),"d");const pm=new Map,la=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Ca=Uc(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),DB=Uc((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let s=pm.get(r);if(s||(s=new Map,pm.set(r,s)),s.has(n))return s.get(n);let i;if(Ca(e)==="latin")i=t.width.regular;else if(Ca(e)==="control")i=t.width.control;else if(Ca(e)==="wide")i=t.width.wide;else switch(ns(e)){case"ambiguous":{i=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{i=t.width.fullWidth;break}case"wide":{i=t.width.wide;break}default:i=t.width.regular}return s.set(n,i),i},"getCachedCharWidth"),CB=Uc(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),Yu=Uc((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?Yu(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},n=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:s}=e,i=s>1e4;let o=0,a=0,c=s,l=!1;const u=e.includes("\x1B")||e.includes("");for(;o<s;){if(u&&(e[o]==="\x1B"||e[o]==="")){if(e.startsWith("\x1B]8;;",o)){const k="\x1B]8;;\x07",S=k.length,y=e.indexOf("\x07",o+5);if(y!==-1){const h=e.indexOf(k,y+1);if(h!==-1){const v=h+S,w=e.slice(y+1,h).replace(Ti,""),g=Yu(w,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,n-a),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),E=g.width;if(g.truncated)l=!0,c=Math.min(c,o);else if(a+E>n&&(c=Math.min(c,o),l=!0,a+E>r.truncation.limit))break;if(a+=E,o=v,l&&a>=r.truncation.limit)break;continue}}}if(Ti.lastIndex=o,Ti.test(e)){const k=Ti.lastIndex-o,S=r.truncation.countAnsiEscapeCodes?k:r.width.ansi;if(a+S>n&&(c=Math.min(c,o),a+S>r.truncation.limit)){l=!0;break}a+=S,o=Ti.lastIndex;continue}}const m=e.codePointAt(o);if(m===8203||m===65279||m>=8288&&m<=8292){o+=1;continue}if(m===9){if(a+r.width.tab>n&&(c=Math.min(c,o),a+r.width.tab>r.truncation.limit)){l=!0;break}a+=r.width.tab,o+=1;continue}if(la.lastIndex=o,la.test(e)){const k=(la.lastIndex-o)*r.width.regular;if(a+k>n){const S=Math.floor((n-a)/r.width.regular);if(c=Math.min(c,o+S),a+k>r.truncation.limit){l=!0;break}}a+=k,o=la.lastIndex;continue}if((m<=31||m>=127&&m<=159)&&(ca.lastIndex=o,ca.test(e))){const k=(ca.lastIndex-o)*r.width.control;if(a+k>n&&(c=Math.min(c,o+Math.floor((n-a)/r.width.control)),a+k>r.truncation.limit)){l=!0;break}a+=k,o=ca.lastIndex;continue}if(Da.lastIndex=o,Da.test(e)){if(a+r.width.emoji>n&&(c=Math.min(c,o),a+r.width.emoji>r.truncation.limit)){l=!0;break}a+=r.width.emoji,o=Da.lastIndex;continue}const $=e.codePointAt(o)??0;if(CB($)){o+=$>65535?2:1;continue}let b;if(i)b=DB($,r);else switch(Ca($)){case"control":{b=r.width.control;break}case"latin":{b=r.width.regular;break}case"wide":{b=r.width.wide;break}case"zero":{b=0;break}default:switch(ns($)){case"ambiguous":{b=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{b=r.width.fullWidth;break}case"wide":{b=r.width.wide;break}default:b=r.width.regular}}if(a+b>n&&(c=Math.min(c,o),a+b>r.truncation.limit)){l=!0;break}a+=b,o+=$>65535?2:1}let p=a,f=!1;return l&&r.truncation.limit>=r.truncation.ellipsisWidth&&(p=r.truncation.limit,f=!0),{ellipsed:f,index:l?c:s,truncated:l,width:p}},"getStringTruncatedWidth");var EB=Object.defineProperty,jB=st((e,t)=>EB(e,"name",{value:t,configurable:!0}),"i"),AB=Object.defineProperty,xB=jB((e,t)=>AB(e,"name",{value:t,configurable:!0}),"e"),OB=Object.defineProperty,PB=xB((e,t)=>OB(e,"name",{value:t,configurable:!0}),"r");const Zr=PB((e,t={})=>Yu(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var FB=Object.defineProperty,g$=st((e,t)=>FB(e,"name",{value:t,configurable:!0}),"b"),BB=Object.defineProperty,ss=g$((e,t)=>BB(e,"name",{value:t,configurable:!0}),"d"),RB=Object.defineProperty,TB=ss((e,t)=>RB(e,"name",{value:t,configurable:!0}),"a");const NB=/\x1B\[(\d+)m/;let y$=class{static{d(this,"At")}static{Ir(this,"$e")}static{st(this,"T")}static{g$(this,"T")}static{ss(this,"d")}static{TB(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=NB.exec(t);if(!r)return;const n=Number.parseInt(r[1],10);switch(n){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(n>=30&&n<=37||n>=90&&n<=97)this.activeForeground=t;else if(n>=40&&n<=47||n>=100&&n<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(n))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(n)){const s={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[n];s&&(this.activeFormatting=this.activeFormatting.filter(i=>!i.includes(s)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const r={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(n=>{const s=r[n];s&&t.push(s)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}};var IB=Object.defineProperty,v$=ss((e,t)=>IB(e,"name",{value:t,configurable:!0}),"o");const b$=v$((e,t)=>{if(!ri.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+Za.length).join("")===Za;return{isInsideEscape:r,isInsideLinkEscape:n}},"checkEscapeSequence"),LB=v$((e,t={})=>{const r=new y$;let n="",s=!1,i="",o="",a=!1;const c=[...e];for(let l=0;l<c.length;l++){const u=c[l];if(u&&ri.has(u)){if(n){const b=t.getWidth?.(n)??0,k={isEscapeSequence:!1,isGrapheme:!0,text:n,width:b};if(a&&(k.isHyperlink=!0,k.hyperlinkUrl=o),t.onSegment?.(k,r)===!1)return;n=""}s=!0,i=u;const m=b$(c,l),{isInsideLinkEscape:$}=m;if($){let b=l+1;for(o="";b<c.length;){const S=c[b];if(S===Vc)break;o+=S,b+=1}o=o.slice(4);const k={hyperlinkUrl:o,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(k,r)===!1)return;l=b,a=!0,s=!1,i="";continue}if(l+1<c.length&&c[l+1]==="\\"&&a){const b={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(b,r)===!1)return;a=!1,o="",l+=1,s=!1,i="";continue}}if(s){if(i!==u&&(i+=u),u===tf){s=!1,r.processEscape(i);const m={isEscapeSequence:!0,isGrapheme:!1,text:i,width:0};if(t.onSegment?.(m,r)===!1)return;i=""}continue}n+=u;const p=t.getWidth?.(n)??0,f={isEscapeSequence:!1,isGrapheme:!0,text:n,width:p};if(a&&(f.isHyperlink=!0,f.hyperlinkUrl=o),t.onSegment?.(f,r)===!1)return;n=""}if(n){const l=t.getWidth?.(n)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:n,width:l};a&&(u.isHyperlink=!0,u.hyperlinkUrl=o),t.onSegment?.(u,r)}if(i){const l={isEscapeSequence:!0,isGrapheme:!1,text:i,width:0};t.onSegment?.(l,r)}},"processAnsiString");var _B=Object.defineProperty,MB=ss((e,t)=>_B(e,"name",{value:t,configurable:!0}),"t$1");const dm=MB(e=>`${ri.values().next().value}${m$}${String(e)}${tf}`,"wrapAnsiCode");var WB=Object.defineProperty,VB=ss((e,t)=>WB(e,"name",{value:t,configurable:!0}),"s");const fm=VB(e=>`${ri.values().next().value}${Za}${e}${Vc}`,"wrapAnsiHyperlink");var UB=Object.defineProperty,GB=ss((e,t)=>UB(e,"name",{value:t,configurable:!0}),"l");const qB=GB(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,n;const s=e.join(`
|
|
986
986
|
`),i=[...s];let o=0;for(const[a,c]of i.entries()){if(t+=c,ri.has(c)){const u=yB.exec(s.slice(o))?.groups??{};if(u.code!==void 0){const p=Number.parseFloat(u.code);r=p===mB?void 0:p}else u.uri!==void 0&&(n=u.uri.length===0?void 0:u.uri)}const l=vB.get(Number(r));i[a+1]===`
|
|
987
987
|
`?(n&&(t+=fm("")),r&&l&&(t+=dm(l))):c===`
|
|
988
988
|
`&&(r&&l&&(t+=dm(r)),n&&(t+=fm(n))),o+=c.length}return t},"preserveAnsi");var HB=Object.defineProperty,on=ss((e,t)=>HB(e,"name",{value:t,configurable:!0}),"f");const $$=/(?=\s)|(?<=\s)/,w$=/^\s+$/,Jl=on(e=>{if(!e.includes("\x1B"))return e;let t=e;return e.includes("\x1B[30m")&&(t+="\x1B[39m"),e.includes("\x1B[42m")&&(t+="\x1B[49m"),t},"resetAnsiAtLineBreak"),Bn=on(e=>{const t=e.split(" ");let r=t.length;for(;r>0&&Zr(t[r-1])===0;)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},"stringVisibleTrimSpacesRight"),k$=on((e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],s=new y$;let i="",o=0,a=!1,c=!1,l="",u=0;for(;u<e.length;){const p=e[u];if(ri.has(p)){a=!0,l=p,i+=p,c=b$([...e],u).isInsideLinkEscape,u+=1;continue}if(a){l+=p,i+=p,c?p===Vc&&(a=c=!1):p===tf&&(a=!1,s.processEscape(l)),u+=1;continue}const f=Zr(p),m=p===" ";if(f===0){i+=p,u+=1;continue}if(o+f>t&&(i&&n.push(i+s.getEndEscapesForAllActiveAttributes()),i=s.getStartEscapesForAllActiveAttributes(),o=Zr(i),m&&r)){for(;u<e.length&&e[u]===" ";)u+=1;continue}if(i+=p,o+=f,o===t&&u<e.length-1&&(n.push(i+s.getEndEscapesForAllActiveAttributes()),i=s.getStartEscapesForAllActiveAttributes(),o=Zr(i),u+1<e.length&&e[u+1]===" "&&r)){for(u+=1;u<e.length&&e[u]===" ";)u+=1;continue}u+=1}return i&&n.push(i+s.getEndEscapesForAllActiveAttributes()),r?n.map(p=>Bn(p)):n},"wrapWithBreakAtWidth"),zB=on((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const s=[];let i="",o=0;return LB(n,{getWidth:Zr,onSegment:on((a,c)=>{const l=a.text??"";if(a.isEscapeSequence)i+=l;else{const u=l===" ";if(a.width===0)return i+=l,!0;if(o+a.width>t&&(i&&s.push(i),i=c.getStartEscapesForAllActiveAttributes(),o=0,u))return r||s.push(c.getStartEscapesForAllActiveAttributes()+l),!0;i+=l,o+=a.width}return!0},"onSegment")}),i&&s.push(i),r?s.map(a=>Bn(a)):s},"wrapCharByChar"),JB=on((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const s=n.split($$),i=[];let o="",a=0,c=0;for(;c<s.length;){const l=s[c],u=w$.test(l),p=Zr(l);if(l.length===0){c+=1;continue}if(r&&u&&a===0){c+=1;continue}if(a+p>t&&a>0){r?i.push(Bn(o)):i.push(o),o="",a=0;continue}o+=l,a+=p,c+=1}return o&&(r?i.push(Bn(o)):i.push(o)),i},"wrapWithWordBoundaries"),KB=on((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const s=n.split($$),i=[];let o="",a=0,c=0;for(;c<s.length;){const l=s[c],u=w$.test(l),p=Zr(l);if(l.length===0){c+=1;continue}if(r&&u&&a===0){c+=1;continue}if(p>t){o&&i.push(Jl(r?Bn(o):o));const f=k$(l,t,r);if(f.length>0){for(let m=0;m<f.length-1;m+=1)i.push(f[m]);o=f.at(-1),a=Zr(o)}else o="",a=0;c+=1;continue}if(a+p>t&&a>0&&(i.push(Jl(r?Bn(o):o)),o="",a=0,r&&u)){c+=1;continue}o+=l,a+=p,c+=1}return o&&i.push(Jl(r?Bn(o):o)),i},"wrapAndBreakWords"),Yi={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},YB=on((e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:s=80,wrapMode:i=Yi.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let o=e.normalize("NFC").replaceAll(`\r
|
|
@@ -991,18 +991,18 @@ ${n.join(`\r
|
|
|
991
991
|
`).map(a=>{if(n&&a.trim()==="")return"";let c;switch(i){case Yi.BREAK_AT_CHARACTERS:{c=zB(a,s,n);break}case Yi.BREAK_WORDS:{c=KB(a,s,n);break}case Yi.STRICT_WIDTH:{c=k$(a,s,n);break}default:c=JB(a,s,n)}return qB(c)}).join(`
|
|
992
992
|
`)},"wordWrap");var XB=Object.defineProperty,mn=st((e,t)=>XB(e,"name",{value:t,configurable:!0}),"n");const S$=80,D$=24,Xu=mn((e,t,{shell:r,env:n}={})=>TF(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),Ea=mn((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),C$=mn((e,t)=>{const{columns:r,rows:n}=Ea(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===S$&&n===D$))return{columns:r,rows:n}},"createIfNotDefault"),QB=mn(()=>{if(Fn.platform!=="linux")return!0;try{const e=Ki.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const r=e.slice(t+2).trim().split(/\s+/),n=Number.parseInt(r[2],10),s=Number.parseInt(r[5],10);return Number.isNaN(n)||Number.isNaN(s)||s<=0?!1:n===s}catch{return!1}},"isForegroundProcess");function Gc(){const{env:e,stdout:t,stderr:r}=Fn;if(t?.columns&&t?.rows)return Ea(t.columns,t.rows);if(r?.columns&&r?.rows)return Ea(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return Ea(e.COLUMNS,e.LINES);const n={columns:S$,rows:D$};return Fn.platform==="win32"?Kl()??n:Fn.platform==="darwin"?hm()??Kl()??n:hm()??Kl()??ZB()??n}d(Gc,"ot$2");Ir(Gc,"Oe");st(Gc,"O");mn(Gc,"terminalSize");const hm=mn(()=>{try{const e=Fn.platform==="darwin"?Ki.constants.O_EVTONLY|Ki.constants.O_NONBLOCK:Ki.constants.O_NONBLOCK,{columns:t,rows:r}=NF.WriteStream(Ki.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),Kl=mn(()=>{try{const e=Xu("tput",["cols"],{env:{TERM:"dumb",...Fn.env}}),t=Xu("tput",["lines"],{env:{TERM:"dumb",...Fn.env}});if(e&&t)return C$(e,t)}catch{}},"tput"),ZB=mn(()=>{try{if(!QB())return;const e=Xu("resize",["-u"]).match(/\d+/g);if(e.length===2)return C$(e[0],e[1])}catch{}},"resize");var eR=Object.defineProperty,tR=st((e,t)=>eR(e,"name",{value:t,configurable:!0}),"c");let rR=class{static{d(this,"ri")}static{Ir(this,"ni")}static{st(this,"k")}static{tR(this,"InteractiveManager")}#e;#t=!1;#r=!1;#i=0;#n=0;constructor(t,r){this.#e={stderr:r,stdout:t}}get lastLength(){return this.#i}get outside(){return this.#n}get isHooked(){return this.#t}get isSuspended(){return this.#r}erase(t,r=this.#i){this.#e[t].erase(r)}hook(){if(this.#t)return!1;const t=Object.values(this.#e);for(const r of t)r.active();return this.#o(!0),!0}resume(t,r){if(this.#r){this.#r=!1,r&&this.erase(t,r),this.#i=0;const n=Object.values(this.#e);for(const s of n)s.active()}}suspend(t,r=!0){if(!this.#r){this.#r=!0,r&&this.erase(t);const n=Object.values(this.#e);for(const s of n)s.renew()}}unhook(t=!0){if(!this.#t)return!1;const r=Object.values(this.#e);for(const n of r)n.inactive(t);return this.#o(),!0}update(t,r,n=0){if(r.length>0){const s=this.#e[t],{columns:i,rows:o}=Gc(),a=n>o?o-1:Math.max(0,Math.min(o-1,n)),c=this.lastLength-a,l=Math.max(c-o,this.outside);let u=r.reduce((p,f)=>[...p,YB(f,{trim:!1,width:i,wrapMode:Yi.STRICT_WIDTH})],[]);o<=c?(s.erase(o),a<l&&(u=u.slice(l-a+1))):c&&s.erase(c),s.write(`${u.join(`
|
|
993
993
|
`)}
|
|
994
|
-
`),this.#i=l?l+u.length+1:u.length,this.#n=Math.max(this.lastLength-o,this.outside)}}#o(t=!1){this.#t=t,this.#i=0,this.#n=0}};var nR=Object.defineProperty,E$=d((e,t)=>nR(e,"name",{value:t,configurable:!0}),"c$s"),sR=Object.defineProperty,Ho=E$((e,t)=>sR(e,"name",{value:t,configurable:!0}),"o");const iR=mt(import.meta.url),Ni=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,oR=Ho(e=>{if(typeof Ni<"u"&&Ni.versions&&Ni.versions.node){const[t,r]=Ni.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ni.getBuiltinModule(e)}return iR(e)},"__cjs_getBuiltinModule"),{StringDecoder:aR}=oR("node:string_decoder"),Ie="\x1B[",j$=";";var cR=Object.defineProperty,
|
|
995
|
-
`),this.#t.forEach(r=>{this.write(r)}),this.#t=[]),this.renew()}renew(){this.#i.write=this.#r,this.write(
|
|
996
|
-
`),"inspectNodeCollection"),P$=zc((e,t,r,n)=>{const s=e.getAttributeNames(),i=e.tagName.toLowerCase(),o=r.stylize(`<${i}`,"special"),a=r.stylize(">","special"),c=r.stylize(`</${i}>`,"special");r.truncate-=i.length*2+5;let l="";s.length>0&&(l+=" ",l+=Ht(s.map(f=>[f,e.getAttribute(f)]),t,r,n,
|
|
997
|
-
${Array.from({length:t+1}).join(r)}`}},"getIndent"),Jc=F$((e,t)=>{if(e.length===0)return"";const r=t.prev+t.base;return r+e.split(", ").join(`,${r}`)+t.prev},"indentedJoin");var GR=Object.defineProperty,B$=Re((e,t)=>GR(e,"name",{value:t,configurable:!0}),"i$5");const qR=/^[a-z_]\w*$/i,HR=/^"|"$/g,zR=B$((e,t)=>{if(qR.test(e))return e;const r=JSON.stringify(e);return t.quoteStyle==="double"?r.replaceAll('"',String.raw`\"`):r.replaceAll("'",String.raw`\'`).replaceAll(String.raw`\"`,'"').replaceAll(HR,"'")},"quoteComplexKey"),bo=B$(([e,t],r,n,s)=>{n.truncate-=2;let i;typeof e=="string"?i=zR(e,n):typeof e=="number"?i=String(e):i=`[${s(e,r,n)}]`,n.truncate-=i.length;const o=s(t,r,n);return`${i}: ${o}`},"inspectProperty");var JR=Object.defineProperty,R$=Re((e,t)=>JR(e,"name",{value:t,configurable:!0}),"p$4");const KR=R$(e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},"multiLineValues"),YR=R$((e,t,r,n)=>{const s=Object.keys(e).slice(e.length);if(e.length===0&&s.length===0)return"[]";t.truncate-=4;let i=Ht(e,e,t,r);t.truncate-=i.length;let o="";s.length>0&&(o=Ht(s.map(c=>[c,e[c]]),e,t,r,bo));const a=n&&KR(e);return a&&(i=Jc(i,n)),`[${a?"":" "}${i}${o?`, ${o}`:""}${a?"":" "}]`},"inspectArray");var XR=Object.defineProperty,QR=Re((e,t)=>XR(e,"name",{value:t,configurable:!0}),"o$7");const gm=/\d(?=(?:\d{3})+(?!\d))/g,ZR=/\d{3}/g,eT=/_$/,T$=QR((e,t)=>{if(e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY||t.includes("e"))return t;if(typeof e=="number"){const r=e<0?-Math.floor(-e):Math.floor(e);if(r!==e){const n=String(r),s=t.slice(n.length+1);return`${n.replace(gm,"$&_")}.${s.replace(ZR,"$&_").replace(eT,"")}`}}return t.replace(gm,"$&_")},"addNumericSeparator");var tT=Object.defineProperty,N$=Re((e,t)=>tT(e,"name",{value:t,configurable:!0}),"i$4");const rT=N$(e=>e>="\uD800"&&e<="\uDBFF","isHighSurrogate"),gn=N$((e,t,r="…")=>{e=String(e);const n=r.length,s=e.length;if(n>t&&s>n)return r;if(s>t&&s>n){let i=t-n;return i>0&&rT(e[i-1])&&(i-=1),`${e.slice(0,i)}${r}`}return e},"truncate");var nT=Object.defineProperty,sT=Re((e,t)=>nT(e,"name",{value:t,configurable:!0}),"e$4");const ym=sT((e,t)=>{let r=gn(e.toString(),t.truncate-1);return r!=="…"&&(r+="n"),t.stylize(t.numericSeparator?T$(e,r):r,"bigint")},"inspectBigInt");var iT=Object.defineProperty,oT=Re((e,t)=>iT(e,"name",{value:t,configurable:!0}),"y");const aT=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),ja=oT((e,t,r,n)=>{if("window"in globalThis&&e===globalThis)return"{ [object Window] }";if(e===globalThis||"global"in globalThis&&e===globalThis)return"{ [object globalThis] }";const s=Object.getOwnPropertyNames(e),i=Object.getOwnPropertySymbols(e),o=aT(e)===Object.prototype||e.constructor===Object,a=e instanceof Object?"":"null prototype";let c;!o&&Symbol.toStringTag in e?c=e[Symbol.toStringTag]:c=a?"Object":"";const l=c||a?`[${[c,a].filter(Boolean).join(": ")}] `:"";if(s.length===0&&i.length===0)return`${l}{}`;t.truncate-=4;const u=Ht(s.map(m=>[m,e[m]]),e,t,r,bo),p=Ht(i.map(m=>[m,e[m]]),e,t,r,bo);let f="";return u&&p&&(f=", "),n?`${l}{${Jc(u+f+p,n)}}`:`${l}{ ${u}${f}${p} }`},"inspectObject");var cT=Object.defineProperty,lT=Re((e,t)=>cT(e,"name",{value:t,configurable:!0}),"s$3");const uT=lT((e,t,r,n)=>{let s="";return s=s||e.constructor.name,(!s||s==="_class")&&(s="<Anonymous Class>"),t.truncate-=s.length,`${s} ${ja(e,t,r,n)}`},"inspectClass");var pT=Object.defineProperty,dT=Re((e,t)=>pT(e,"name",{value:t,configurable:!0}),"i$3");const fT=dT((e,t)=>{const r=e.toJSON();if(r===null)return"Invalid Date";const n=r.split("T"),s=n[0];return t.stylize(`${s}T${gn(n[1],t.truncate-s.length-1)}`,"date")},"inspectDate");var hT=Object.defineProperty,mT=Re((e,t)=>hT(e,"name",{value:t,configurable:!0}),"c$4");const gT=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),yT=mT((e,t,r)=>{const n=Object.getOwnPropertyNames(e).filter(a=>!gT.has(a)),{name:s}=e;t.truncate-=s.length;let i="";typeof e.message=="string"?i=gn(e.message,t.truncate):n.unshift("message"),i=i?`: ${i}`:"",t.truncate-=i.length+5;const o=Ht(n.map(a=>[a,e[a]]),e,t,r,bo);return`${s}${i}${o?` { ${o} }`:""}`},"inspectObject");var vT=Object.defineProperty,bT=Re((e,t)=>vT(e,"name",{value:t,configurable:!0}),"c$3");const vm=bT((e,t)=>{const r=e[Symbol.toStringTag]||"Function",n=e.toString();if(n.length<t.truncate-12)return t.stylize(`[${r}: ${n}]`,"special");const{name:s}=e;return s?t.stylize(`[${r} ${gn(s,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")},"inspectFunction");var $T=Object.defineProperty,I$=Re((e,t)=>$T(e,"name",{value:t,configurable:!0}),"p$3");const wT=I$(([e,t],r,n,s)=>(n.truncate-=4,e=s(e,r,n),n.truncate-=e.length,`${e} => ${s(t,r,n)}`),"inspectMapEntry"),kT=I$((e,t,r,n)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let s=Ht([...e.entries()],e,t,r,wT);return n&&(s=Jc(s,n)),`Map (${String(e.size)}) {${n?"":" "}${s}${n?"":" "}}`},"inspectMap");var ST=Object.defineProperty,DT=Re((e,t)=>ST(e,"name",{value:t,configurable:!0}),"e$3");function Wn(e,t){return Number.isNaN(e)?t.stylize("NaN","number"):e===Number.POSITIVE_INFINITY?t.stylize("Infinity","number"):e===Number.NEGATIVE_INFINITY?t.stylize("-Infinity","number"):e===0?t.stylize(1/e===Number.POSITIVE_INFINITY?"+0":"-0","number"):t.stylize(gn(t.numericSeparator?T$(e,e.toString()):e.toString(),t.truncate),"number")}d(Wn,"R$9");yr(Wn,"Y");Ce(Wn,"j$5");O$(Wn,"P");Re(Wn,"u$3");DT(Wn,"inspectNumber");var CT=Object.defineProperty,ET=Re((e,t)=>CT(e,"name",{value:t,configurable:!0}),"e$2");const jT=ET(()=>"Promise{…}","getPromiseValue");var AT=Object.defineProperty,xT=Re((e,t)=>AT(e,"name",{value:t,configurable:!0}),"p$1");const OT=xT((e,t)=>{const r=t.truncate-(2+e.flags.length);return t.stylize(`/${gn(e.source,r)}/${e.flags}`,"regexp")},"inspectRegExp");var PT=Object.defineProperty,FT=Re((e,t)=>PT(e,"name",{value:t,configurable:!0}),"i$1");const BT=FT((e,t,r,n)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let s=Ht([...e],e,t,r);return n&&(s=Jc(s,n)),`Set (${String(e.size)}) {${n?"":" "}${s}${n?"":" "}}`},"inspectSet");var RT=Object.defineProperty,TT=Re((e,t)=>RT(e,"name",{value:t,configurable:!0}),"l");const NT=TT((e,t)=>{const r=t.quoteStyle==="double"?'"':"'";return t.quoteStyle==="double"&&(e=e.replaceAll('"','"')),r+e+r},"wrapQuotes");var IT=Object.defineProperty,L$=Re((e,t)=>IT(e,"name",{value:t,configurable:!0}),"e$1");const bm=new RegExp(String.raw`['\0-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5`+String.raw`\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]`,"g"),LT={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},_T=16,MT=L$(e=>LT[e]||String.raw`\u${`0000${e.codePointAt(0).toString(_T)}`.slice(-4)}`,"escape"),$m=L$((e,t)=>(bm.test(e)&&(e=e.replaceAll(bm,MT)),t.stylize(NT(gn(e,t.truncate-2),t),"string")),"inspectString");var WT=Object.defineProperty,VT=Re((e,t)=>WT(e,"name",{value:t,configurable:!0}),"o");const wm=VT(e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),"inspectSymbol");var UT=Object.defineProperty,_$=Re((e,t)=>UT(e,"name",{value:t,configurable:!0}),"f");const GT=_$(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],"getArrayName"),wr=_$((e,t,r)=>{const n=GT(e);t.truncate-=n.length+4;const s=Object.keys(e).slice(e.length);if(e.length===0&&s.length===0)return`${n}[]`;let i="";for(let a=0;a<e.length;a++){const c=`${t.stylize(gn(e[a],t.truncate),"number")}${a===e.length-1?"":", "}`;if(t.truncate-=c.length,e[a]!==e.length&&t.truncate<=3){i+=`…(${String(e.length-e[a]+1)})`;break}i+=c}let o="";return s.length>0&&(o=Ht(s.map(a=>[a,e[a]]),e,t,r,bo)),`${n}[ ${i}${o?`, ${o}`:""} ]`},"inspectTypedArray");var qT=Object.defineProperty,ot=Re((e,t)=>qT(e,"name",{value:t,configurable:!0}),"r");const tc=new WeakMap,Zu={},HT={Arguments:WR,Array:YR,ArrayBuffer:ot(()=>"","ArrayBuffer"),BigInt:ym,bigint:ym,Boolean:ot((e,t)=>t.stylize(String(e),"boolean"),"Boolean"),boolean:ot((e,t)=>t.stylize(String(e),"boolean"),"boolean"),DataView:ot(()=>"","DataView"),Date:fT,Error:yT,Float32Array:wr,Float64Array:wr,Function:vm,function:vm,Generator:ot(()=>"","Generator"),HTMLCollection:Qu,Int8Array:wr,Int16Array:wr,Int32Array:wr,Map:kT,NodeList:Qu,null:ot((e,t)=>t.stylize("null","null"),"null"),Number:Wn,number:Wn,Promise:jT,RegExp:OT,Set:BT,String:$m,string:$m,Symbol:wm,symbol:wm,Uint8Array:wr,Uint8ClampedArray:wr,Uint16Array:wr,Uint32Array:wr,undefined:ot((e,t)=>t.stylize("undefined","undefined"),"undefined"),WeakMap:ot((e,t)=>t.stylize("WeakMap{…}","special"),"WeakMap"),WeakSet:ot((e,t)=>t.stylize("WeakSet{…}","special"),"WeakSet")},km=Symbol.for("nodejs.util.inspect.custom"),zT=ot((e,t,r,n)=>{if(!("window"in globalThis)&&typeof e[km]=="function")return e[km](n,t);if("inspect"in e&&typeof e.inspect=="function")return e.inspect(n,t);if("constructor"in e&&tc.has(e.constructor))return tc.get(e.constructor)?.(e,t)??"unknown";const s=Zu[r];return s?s(e,t):""},"inspectCustom"),M$=ot((e,t,r,n)=>{if(n.includes(e))return"[Circular]";if(r>=t.depth&&t.depth>0&&typeof e=="object")return Array.isArray(e)?"[Array]":"[Object]";const s=ot((l,u,p)=>(u&&(n=[...n,u]),M$(l,p,r+1,n)),"inspect"),i=t.indent?UR(t.indent,r):void 0;let o=e===null?"null":typeof e;o==="object"&&(o=Object.prototype.toString.call(e).slice(8,-1));const a=HT[o];if(a!==void 0)return a(e,t,s,i);if(t.customInspect&&e){const l=zT(e,t,o,t.depth-r);if(l)return typeof l=="string"?l:s(l,e,t)}const c=e?Object.getPrototypeOf(e):!1;return c===Object.prototype||c===null?ja(e,t,s,i):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?P$(e,e,t,s):"constructor"in e?e.constructor!==Object?uT(e,t,s,i):ja(e,t,s,i):e===Object(e)?ja(e,t,s,i):t.stylize(String(e),o)},"internalInspect"),rc=ot((e,t={})=>{const r={breakLength:Number.POSITIVE_INFINITY,customInspect:!0,depth:5,indent:void 0,maxArrayLength:Number.POSITIVE_INFINITY,numericSeparator:!0,quoteStyle:"single",showHidden:!1,showProxy:!1,stylize:ot(n=>n,"stylize"),truncate:Number.POSITIVE_INFINITY,...t};if(r.indent!==void 0&&r.indent!==" "&&!(Number.parseInt(r.indent,10)===r.indent&&r.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `undefined`');return M$(e,r,0,[])},"inspect");ot((e,t)=>tc.has(e)?!1:(tc.set(e,t),!0),"registerConstructor");ot((e,t)=>e in Zu?!1:(Zu[e]=t,!0),"registerStringTag");var JT=Object.defineProperty,KT=Ce((e,t)=>JT(e,"name",{value:t,configurable:!0}),"r$6");const W$=KT((e,t)=>(t.__write??t.write.bind(t)).call(t,e),"writeStream");var YT=Object.defineProperty,XT=Ce((e,t)=>YT(e,"name",{value:t,configurable:!0}),"A$4"),QT=Object.defineProperty,of=XT((e,t)=>QT(e,"name",{value:t,configurable:!0}),"$"),ZT=Object.defineProperty,e3=of((e,t)=>ZT(e,"name",{value:t,configurable:!0}),"r$1");const t3=e3(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
998
|
-
`),"normalizeLF"),
|
|
999
|
-
`);typeof n.tabWidth=="number"&&(i=i.map($=>$.replaceAll(" "," ".repeat(n.tabWidth))));const{end:o,markerLines:a,start:c}=
|
|
1000
|
-
`,n.prefix+u(v.replaceAll(/\d/g," "))," ",g,p("^").repeat(E)].join(""),h&&n.message&&(w+=` ${f(n.message)}`)}return[n.prefix+p(
|
|
994
|
+
`),this.#i=l?l+u.length+1:u.length,this.#n=Math.max(this.lastLength-o,this.outside)}}#o(t=!1){this.#t=t,this.#i=0,this.#n=0}};var nR=Object.defineProperty,E$=d((e,t)=>nR(e,"name",{value:t,configurable:!0}),"c$s"),sR=Object.defineProperty,Ho=E$((e,t)=>sR(e,"name",{value:t,configurable:!0}),"o");const iR=mt(import.meta.url),Ni=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,oR=Ho(e=>{if(typeof Ni<"u"&&Ni.versions&&Ni.versions.node){const[t,r]=Ni.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ni.getBuiltinModule(e)}return iR(e)},"__cjs_getBuiltinModule"),{StringDecoder:aR}=oR("node:string_decoder"),Ie="\x1B[",j$=";";var cR=Object.defineProperty,lR=Ho((e,t)=>cR(e,"name",{value:t,configurable:!0}),"t"),uR=Object.defineProperty,pR=lR((e,t)=>uR(e,"name",{value:t,configurable:!0}),"t"),dR=Object.defineProperty,lt=pR((e,t)=>dR(e,"name",{value:t,configurable:!0}),"n");const fR=lt((e=1)=>`${Ie}${String(e)}D`,"cursorBackward");lt((e=1)=>`${Ie}${String(e)}B`,"cursorDown");lt((e=1)=>`${Ie}${String(e)}C`,"cursorForward");const hR=`${Ie}?25l`,mR=`${Ie}G`;lt((e=1)=>fR(e),"cursorLeft");const gR=lt((e=1)=>`${Ie}${String(e)}G`,"cursorHorizontalAbsolute");lt((e,t)=>{let r="";return e<0?r+=`${Ie}${String(-e)}D`:e>0&&(r+=`${Ie}${String(e)}C`),t<0?r+=`${Ie}${String(-t)}A`:t>0&&(r+=`${Ie}${String(t)}B`),r},"cursorMove");lt((e=1)=>`${Ie}${String(e)}E`,"cursorNextLine");lt((e=1)=>`${Ie}${String(e)}F`,"cursorPreviousLine");const yR=`${Ie}?25h`;lt((e,t)=>t===void 0?gR(e+1):`${Ie}${String(t+1)}${j$}${String(e+1)}H`,"cursorTo");lt((e,t)=>t===void 0?`${Ie}${String(e)}H`:`${Ie}${String(e)}${j$}${String(t)}H`,"cursorPosition");lt((e=1)=>`${Ie}${String(e)}I`,"cursorHorizontalForwardTab");lt((e=1)=>`${Ie}${String(e)}Z`,"cursorBackwardTab");lt((e=1)=>`${Ie}${String(e)}X`,"eraseCharacter");lt((e=1)=>`${Ie}${String(e)}d`,"cursorVerticalAbsolute");const vR=lt((e=1)=>`${Ie}${String(e)}A`,"cursorUp");var bR=(e=>(e[e.Default=0]="Default",e[e.BlinkingBlock=1]="BlinkingBlock",e[e.SteadyBlock=2]="SteadyBlock",e[e.BlinkingUnderline=3]="BlinkingUnderline",e[e.SteadyUnderline=4]="SteadyUnderline",e[e.BlinkingBar=5]="BlinkingBar",e[e.SteadyBar=6]="SteadyBar",e))(bR||{});lt(e=>`${Ie}${String(e)} q`,"setCursorStyle");var $R=Object.defineProperty,wR=Ho((e,t)=>$R(e,"name",{value:t,configurable:!0}),"o$1"),kR=Object.defineProperty,SR=wR((e,t)=>kR(e,"name",{value:t,configurable:!0}),"s"),DR=Object.defineProperty,rf=SR((e,t)=>DR(e,"name",{value:t,configurable:!0}),"o"),CR=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireScreen=2]="EntireScreen",e[e.EntireScreenAndScrollback=3]="EntireScreenAndScrollback",e))(CR||{});const qc=rf(e=>{const t=e>=0&&e<=3?e:0;return`${Ie}${t===0?"":String(t)}J`},"eraseDisplay");var ER=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireLine=2]="EntireLine",e))(ER||{});const nf=rf(e=>{const t=e>=0&&e<=2?e:0;return`${Ie}${t===0?"":String(t)}K`},"eraseInLine");qc(0);const jR=nf(2);nf(0);nf(1);const AR=rf(e=>{if(e<=0)return"";let t="";for(let r=0;r<e;r+=1)t+=jR,r<e-1&&(t+=vR());return t+=mR,t},"eraseLines");qc(2);qc(1);qc(3);var xR=Object.defineProperty,OR=Ho((e,t)=>xR(e,"name",{value:t,configurable:!0}),"o");let mm=class A${static{d(this,"g")}static{E$(this,"$")}static{Ho(this,"e")}static{OR(this,"InteractiveStreamHook")}static DRAIN=!0;#e=new aR;#t=[];#r;#i;constructor(t){this.#r=t.write.bind(t),this.#i=t}active(){this.write(hR),this.#i.write=(t,...r)=>{const n=r.at(-1);return this.#t.push(this.#e.write(typeof t=="string"?Buffer.from(t,typeof r[0]=="string"?r[0]:void 0):Buffer.from(t))),typeof n=="function"&&n(),A$.DRAIN}}erase(t){t>0&&this.write(AR(t+1))}inactive(t=!1){this.#t.length>0&&(t&&this.write(`
|
|
995
|
+
`),this.#t.forEach(r=>{this.write(r)}),this.#t=[]),this.renew()}renew(){this.#i.write=this.#r,this.write(yR)}write(t){this.#r.apply(this.#i,[t])}};var PR=Object.defineProperty,yr=d((e,t)=>PR(e,"name",{value:t,configurable:!0}),"S$d"),FR=Object.defineProperty,Ce=yr((e,t)=>FR(e,"name",{value:t,configurable:!0}),"b");const BR=mt(import.meta.url),ys=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Hc=Ce(e=>{if(typeof ys<"u"&&ys.versions&&ys.versions.node){const[t,r]=ys.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return ys.getBuiltinModule(e)}return BR(e)},"__cjs_getBuiltinModule"),{createRequire:RR}=Hc("node:module"),Rn=ys,{execFileSync:TR}=Hc("node:child_process"),Xi=Hc("node:fs"),NR=Hc("node:tty"),IR={alert:7,critical:6,debug:1,emergency:8,error:5,informational:2,notice:3,trace:2,warning:4},x$={alert:{color:"red",label:"alert",logLevel:"alert"},await:{color:"blue",label:"awaiting",logLevel:"informational"},complete:{color:"cyan",label:"complete",logLevel:"informational"},critical:{color:"redBright",label:"critical",logLevel:"critical"},debug:{color:"gray",label:"debug",logLevel:"debug"},emergency:{color:"redBright",label:"emergency",logLevel:"emergency"},error:{color:"red",label:"error",logLevel:"error"},info:{color:"blueBright",label:"info",logLevel:"informational"},log:{label:"",logLevel:"informational"},notice:{color:"magentaBright",label:"notice",logLevel:"notice"},pending:{color:"magenta",label:"pending",logLevel:"informational"},start:{color:"greenBright",label:"start",logLevel:"informational"},stop:{color:"red",label:"stop",logLevel:"informational"},success:{color:"green",label:"success",logLevel:"informational"},trace:{color:"cyanBright",label:"trace",logLevel:"trace"},wait:{color:"blue",label:"waiting",logLevel:"informational"},warn:{color:"yellow",label:"warning",logLevel:"warning"},warning:{color:"yellow",label:"warning",logLevel:"warning"},watch:{color:"yellowBright",label:"watching",logLevel:"informational"}},sf=Symbol("EMPTY");var LR=Object.defineProperty,_R=Ce((e,t)=>LR(e,"name",{value:t,configurable:!0}),"g$6");const ec=_R(e=>{const t=Object.keys(e).map(r=>e[r].label??"");return t.length===0?"":t.reduce((r,n)=>r.length>n.length?r:n,"")},"getLongestLabel");var MR=Object.defineProperty,O$=Ce((e,t)=>MR(e,"name",{value:t,configurable:!0}),"T$4"),WR=Object.defineProperty,Re=O$((e,t)=>WR(e,"name",{value:t,configurable:!0}),"l"),VR=Object.defineProperty,UR=Re((e,t)=>VR(e,"name",{value:t,configurable:!0}),"L");const Ht=UR((e,t,r,n,s,i=", ")=>{const o=e.length;if(o===0)return"";let a=n;s!==void 0&&(a=s);const c=r.truncate;let l="",u="",p="";for(let f=0;f<o;f+=1){const m=f+1===e.length,$=f+2===e.length;p=`…(${String(e.length-f)})`;let b=e[f];r.truncate=c-l.length-(m?0:i.length);const k=u||a(b,t,r,n)+(m?"":i),S=l.length+k.length,y=S+p.length;if(m&&S>c&&l.length+p.length<=c||!m&&!$&&y>c)break;b=e[f+1];const h=$?"":i;if(m?u="":u=a(b,t,r,n)+h,!m&&$&&y>c&&S+u.length>c)break;if(l+=k,!m&&!$&&S+u.length>=c){p=`…(${String(e.length-f-1)})`;break}p=""}return`${l}${p}`},"inspectList");var GR=Object.defineProperty,zc=Re((e,t)=>GR(e,"name",{value:t,configurable:!0}),"s$6");const qR=zc(([e,t],r,n)=>(n.truncate-=3,t?`${n.stylize(String(e),"yellow")}=${n.stylize(`"${t}"`,"string")}`:n.stylize(String(e),"yellow")),"inspectAttribute"),HR=zc((e,t,r)=>{switch(e.nodeType){case 1:return P$(e,e,r,t);case 3:return t(e.data,t,r);default:return t(e,t,r)}},"inspectNode"),Qu=zc((e,t,r,n)=>Ht(e,e,t,r,HR,`
|
|
996
|
+
`),"inspectNodeCollection"),P$=zc((e,t,r,n)=>{const s=e.getAttributeNames(),i=e.tagName.toLowerCase(),o=r.stylize(`<${i}`,"special"),a=r.stylize(">","special"),c=r.stylize(`</${i}>`,"special");r.truncate-=i.length*2+5;let l="";s.length>0&&(l+=" ",l+=Ht(s.map(f=>[f,e.getAttribute(f)]),t,r,n,qR," ")),r.truncate-=l.length;const{truncate:u}=r;let p=Qu(e.children,r,n,void 0);return p&&p.length>u&&(p=`…(${String(e.children.length)})`),`${o}${l}${a}${p}${c}`},"inspectHTMLElement");var zR=Object.defineProperty,JR=Re((e,t)=>zR(e,"name",{value:t,configurable:!0}),"n$4");const KR=JR((e,t,r)=>e.length===0?"Arguments []":(t.truncate-=13,`Arguments [ ${Ht(e,e,t,r)} ]`),"inspectArguments");var YR=Object.defineProperty,F$=Re((e,t)=>YR(e,"name",{value:t,configurable:!0}),"r$3");const XR=F$((e,t)=>{let r;if(e===" ")r=" ";else if(typeof e=="number"&&e>0)r=Array.from({length:e+1}).join(" ");else return;return{base:r,prev:`
|
|
997
|
+
${Array.from({length:t+1}).join(r)}`}},"getIndent"),Jc=F$((e,t)=>{if(e.length===0)return"";const r=t.prev+t.base;return r+e.split(", ").join(`,${r}`)+t.prev},"indentedJoin");var QR=Object.defineProperty,B$=Re((e,t)=>QR(e,"name",{value:t,configurable:!0}),"i$5");const ZR=/^[a-z_]\w*$/i,eT=/^"|"$/g,tT=B$((e,t)=>{if(ZR.test(e))return e;const r=JSON.stringify(e);return t.quoteStyle==="double"?r.replaceAll('"',String.raw`\"`):r.replaceAll("'",String.raw`\'`).replaceAll(String.raw`\"`,'"').replaceAll(eT,"'")},"quoteComplexKey"),bo=B$(([e,t],r,n,s)=>{n.truncate-=2;let i;typeof e=="string"?i=tT(e,n):typeof e=="number"?i=String(e):i=`[${s(e,r,n)}]`,n.truncate-=i.length;const o=s(t,r,n);return`${i}: ${o}`},"inspectProperty");var rT=Object.defineProperty,R$=Re((e,t)=>rT(e,"name",{value:t,configurable:!0}),"p$4");const nT=R$(e=>{for(const t of e)if(Array.isArray(t)||typeof t=="object"&&t!==null)return!0;return!1},"multiLineValues"),sT=R$((e,t,r,n)=>{const s=Object.keys(e).slice(e.length);if(e.length===0&&s.length===0)return"[]";t.truncate-=4;let i=Ht(e,e,t,r);t.truncate-=i.length;let o="";s.length>0&&(o=Ht(s.map(c=>[c,e[c]]),e,t,r,bo));const a=n&&nT(e);return a&&(i=Jc(i,n)),`[${a?"":" "}${i}${o?`, ${o}`:""}${a?"":" "}]`},"inspectArray");var iT=Object.defineProperty,oT=Re((e,t)=>iT(e,"name",{value:t,configurable:!0}),"o$7");const gm=/\d(?=(?:\d{3})+(?!\d))/g,aT=/\d{3}/g,cT=/_$/,T$=oT((e,t)=>{if(e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY||t.includes("e"))return t;if(typeof e=="number"){const r=e<0?-Math.floor(-e):Math.floor(e);if(r!==e){const n=String(r),s=t.slice(n.length+1);return`${n.replace(gm,"$&_")}.${s.replace(aT,"$&_").replace(cT,"")}`}}return t.replace(gm,"$&_")},"addNumericSeparator");var lT=Object.defineProperty,N$=Re((e,t)=>lT(e,"name",{value:t,configurable:!0}),"i$4");const uT=N$(e=>e>="\uD800"&&e<="\uDBFF","isHighSurrogate"),gn=N$((e,t,r="…")=>{e=String(e);const n=r.length,s=e.length;if(n>t&&s>n)return r;if(s>t&&s>n){let i=t-n;return i>0&&uT(e[i-1])&&(i-=1),`${e.slice(0,i)}${r}`}return e},"truncate");var pT=Object.defineProperty,dT=Re((e,t)=>pT(e,"name",{value:t,configurable:!0}),"e$4");const ym=dT((e,t)=>{let r=gn(e.toString(),t.truncate-1);return r!=="…"&&(r+="n"),t.stylize(t.numericSeparator?T$(e,r):r,"bigint")},"inspectBigInt");var fT=Object.defineProperty,hT=Re((e,t)=>fT(e,"name",{value:t,configurable:!0}),"y");const mT=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:void 0),ja=hT((e,t,r,n)=>{if("window"in globalThis&&e===globalThis)return"{ [object Window] }";if(e===globalThis||"global"in globalThis&&e===globalThis)return"{ [object globalThis] }";const s=Object.getOwnPropertyNames(e),i=Object.getOwnPropertySymbols(e),o=mT(e)===Object.prototype||e.constructor===Object,a=e instanceof Object?"":"null prototype";let c;!o&&Symbol.toStringTag in e?c=e[Symbol.toStringTag]:c=a?"Object":"";const l=c||a?`[${[c,a].filter(Boolean).join(": ")}] `:"";if(s.length===0&&i.length===0)return`${l}{}`;t.truncate-=4;const u=Ht(s.map(m=>[m,e[m]]),e,t,r,bo),p=Ht(i.map(m=>[m,e[m]]),e,t,r,bo);let f="";return u&&p&&(f=", "),n?`${l}{${Jc(u+f+p,n)}}`:`${l}{ ${u}${f}${p} }`},"inspectObject");var gT=Object.defineProperty,yT=Re((e,t)=>gT(e,"name",{value:t,configurable:!0}),"s$3");const vT=yT((e,t,r,n)=>{let s="";return s=s||e.constructor.name,(!s||s==="_class")&&(s="<Anonymous Class>"),t.truncate-=s.length,`${s} ${ja(e,t,r,n)}`},"inspectClass");var bT=Object.defineProperty,$T=Re((e,t)=>bT(e,"name",{value:t,configurable:!0}),"i$3");const wT=$T((e,t)=>{const r=e.toJSON();if(r===null)return"Invalid Date";const n=r.split("T"),s=n[0];return t.stylize(`${s}T${gn(n[1],t.truncate-s.length-1)}`,"date")},"inspectDate");var kT=Object.defineProperty,ST=Re((e,t)=>kT(e,"name",{value:t,configurable:!0}),"c$4");const DT=new Set(["column","columnNumber","description","fileName","line","lineNumber","message","name","number","stack"]),CT=ST((e,t,r)=>{const n=Object.getOwnPropertyNames(e).filter(a=>!DT.has(a)),{name:s}=e;t.truncate-=s.length;let i="";typeof e.message=="string"?i=gn(e.message,t.truncate):n.unshift("message"),i=i?`: ${i}`:"",t.truncate-=i.length+5;const o=Ht(n.map(a=>[a,e[a]]),e,t,r,bo);return`${s}${i}${o?` { ${o} }`:""}`},"inspectObject");var ET=Object.defineProperty,jT=Re((e,t)=>ET(e,"name",{value:t,configurable:!0}),"c$3");const vm=jT((e,t)=>{const r=e[Symbol.toStringTag]||"Function",n=e.toString();if(n.length<t.truncate-12)return t.stylize(`[${r}: ${n}]`,"special");const{name:s}=e;return s?t.stylize(`[${r} ${gn(s,t.truncate-11)}]`,"special"):t.stylize(`[${r}]`,"special")},"inspectFunction");var AT=Object.defineProperty,I$=Re((e,t)=>AT(e,"name",{value:t,configurable:!0}),"p$3");const xT=I$(([e,t],r,n,s)=>(n.truncate-=4,e=s(e,r,n),n.truncate-=e.length,`${e} => ${s(t,r,n)}`),"inspectMapEntry"),OT=I$((e,t,r,n)=>{if(e.size<=0)return"Map (0) {}";t.truncate-=7;let s=Ht([...e.entries()],e,t,r,xT);return n&&(s=Jc(s,n)),`Map (${String(e.size)}) {${n?"":" "}${s}${n?"":" "}}`},"inspectMap");var PT=Object.defineProperty,FT=Re((e,t)=>PT(e,"name",{value:t,configurable:!0}),"e$3");function Wn(e,t){return Number.isNaN(e)?t.stylize("NaN","number"):e===Number.POSITIVE_INFINITY?t.stylize("Infinity","number"):e===Number.NEGATIVE_INFINITY?t.stylize("-Infinity","number"):e===0?t.stylize(1/e===Number.POSITIVE_INFINITY?"+0":"-0","number"):t.stylize(gn(t.numericSeparator?T$(e,e.toString()):e.toString(),t.truncate),"number")}d(Wn,"R$9");yr(Wn,"Y");Ce(Wn,"j$5");O$(Wn,"P");Re(Wn,"u$3");FT(Wn,"inspectNumber");var BT=Object.defineProperty,RT=Re((e,t)=>BT(e,"name",{value:t,configurable:!0}),"e$2");const TT=RT(()=>"Promise{…}","getPromiseValue");var NT=Object.defineProperty,IT=Re((e,t)=>NT(e,"name",{value:t,configurable:!0}),"p$1");const LT=IT((e,t)=>{const r=t.truncate-(2+e.flags.length);return t.stylize(`/${gn(e.source,r)}/${e.flags}`,"regexp")},"inspectRegExp");var _T=Object.defineProperty,MT=Re((e,t)=>_T(e,"name",{value:t,configurable:!0}),"i$1");const WT=MT((e,t,r,n)=>{if(e.size===0)return"Set (0) {}";t.truncate-=7;let s=Ht([...e],e,t,r);return n&&(s=Jc(s,n)),`Set (${String(e.size)}) {${n?"":" "}${s}${n?"":" "}}`},"inspectSet");var VT=Object.defineProperty,UT=Re((e,t)=>VT(e,"name",{value:t,configurable:!0}),"l");const GT=UT((e,t)=>{const r=t.quoteStyle==="double"?'"':"'";return t.quoteStyle==="double"&&(e=e.replaceAll('"','"')),r+e+r},"wrapQuotes");var qT=Object.defineProperty,L$=Re((e,t)=>qT(e,"name",{value:t,configurable:!0}),"e$1");const bm=new RegExp(String.raw`['\0-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5`+String.raw`\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]`,"g"),HT={" ":String.raw`\t`,"\n":String.raw`\n`,"\f":String.raw`\f`,"\r":String.raw`\r`,"\b":String.raw`\b`,"'":String.raw`\'`,"\\":"\\\\"},zT=16,JT=L$(e=>HT[e]||String.raw`\u${`0000${e.codePointAt(0).toString(zT)}`.slice(-4)}`,"escape"),$m=L$((e,t)=>(bm.test(e)&&(e=e.replaceAll(bm,JT)),t.stylize(GT(gn(e,t.truncate-2),t),"string")),"inspectString");var KT=Object.defineProperty,YT=Re((e,t)=>KT(e,"name",{value:t,configurable:!0}),"o");const wm=YT(e=>"description"in Symbol.prototype?e.description?`Symbol(${e.description})`:"Symbol()":e.toString(),"inspectSymbol");var XT=Object.defineProperty,_$=Re((e,t)=>XT(e,"name",{value:t,configurable:!0}),"f");const QT=_$(e=>typeof Buffer=="function"&&e instanceof Buffer?"Buffer":e[Symbol.toStringTag],"getArrayName"),wr=_$((e,t,r)=>{const n=QT(e);t.truncate-=n.length+4;const s=Object.keys(e).slice(e.length);if(e.length===0&&s.length===0)return`${n}[]`;let i="";for(let a=0;a<e.length;a++){const c=`${t.stylize(gn(e[a],t.truncate),"number")}${a===e.length-1?"":", "}`;if(t.truncate-=c.length,e[a]!==e.length&&t.truncate<=3){i+=`…(${String(e.length-e[a]+1)})`;break}i+=c}let o="";return s.length>0&&(o=Ht(s.map(a=>[a,e[a]]),e,t,r,bo)),`${n}[ ${i}${o?`, ${o}`:""} ]`},"inspectTypedArray");var ZT=Object.defineProperty,ot=Re((e,t)=>ZT(e,"name",{value:t,configurable:!0}),"r");const tc=new WeakMap,Zu={},e3={Arguments:KR,Array:sT,ArrayBuffer:ot(()=>"","ArrayBuffer"),BigInt:ym,bigint:ym,Boolean:ot((e,t)=>t.stylize(String(e),"boolean"),"Boolean"),boolean:ot((e,t)=>t.stylize(String(e),"boolean"),"boolean"),DataView:ot(()=>"","DataView"),Date:wT,Error:CT,Float32Array:wr,Float64Array:wr,Function:vm,function:vm,Generator:ot(()=>"","Generator"),HTMLCollection:Qu,Int8Array:wr,Int16Array:wr,Int32Array:wr,Map:OT,NodeList:Qu,null:ot((e,t)=>t.stylize("null","null"),"null"),Number:Wn,number:Wn,Promise:TT,RegExp:LT,Set:WT,String:$m,string:$m,Symbol:wm,symbol:wm,Uint8Array:wr,Uint8ClampedArray:wr,Uint16Array:wr,Uint32Array:wr,undefined:ot((e,t)=>t.stylize("undefined","undefined"),"undefined"),WeakMap:ot((e,t)=>t.stylize("WeakMap{…}","special"),"WeakMap"),WeakSet:ot((e,t)=>t.stylize("WeakSet{…}","special"),"WeakSet")},km=Symbol.for("nodejs.util.inspect.custom"),t3=ot((e,t,r,n)=>{if(!("window"in globalThis)&&typeof e[km]=="function")return e[km](n,t);if("inspect"in e&&typeof e.inspect=="function")return e.inspect(n,t);if("constructor"in e&&tc.has(e.constructor))return tc.get(e.constructor)?.(e,t)??"unknown";const s=Zu[r];return s?s(e,t):""},"inspectCustom"),M$=ot((e,t,r,n)=>{if(n.includes(e))return"[Circular]";if(r>=t.depth&&t.depth>0&&typeof e=="object")return Array.isArray(e)?"[Array]":"[Object]";const s=ot((l,u,p)=>(u&&(n=[...n,u]),M$(l,p,r+1,n)),"inspect"),i=t.indent?XR(t.indent,r):void 0;let o=e===null?"null":typeof e;o==="object"&&(o=Object.prototype.toString.call(e).slice(8,-1));const a=e3[o];if(a!==void 0)return a(e,t,s,i);if(t.customInspect&&e){const l=t3(e,t,o,t.depth-r);if(l)return typeof l=="string"?l:s(l,e,t)}const c=e?Object.getPrototypeOf(e):!1;return c===Object.prototype||c===null?ja(e,t,s,i):e&&typeof HTMLElement=="function"&&e instanceof HTMLElement?P$(e,e,t,s):"constructor"in e?e.constructor!==Object?vT(e,t,s,i):ja(e,t,s,i):e===Object(e)?ja(e,t,s,i):t.stylize(String(e),o)},"internalInspect"),rc=ot((e,t={})=>{const r={breakLength:Number.POSITIVE_INFINITY,customInspect:!0,depth:5,indent:void 0,maxArrayLength:Number.POSITIVE_INFINITY,numericSeparator:!0,quoteStyle:"single",showHidden:!1,showProxy:!1,stylize:ot(n=>n,"stylize"),truncate:Number.POSITIVE_INFINITY,...t};if(r.indent!==void 0&&r.indent!==" "&&!(Number.parseInt(r.indent,10)===r.indent&&r.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `undefined`');return M$(e,r,0,[])},"inspect");ot((e,t)=>tc.has(e)?!1:(tc.set(e,t),!0),"registerConstructor");ot((e,t)=>e in Zu?!1:(Zu[e]=t,!0),"registerStringTag");var r3=Object.defineProperty,n3=Ce((e,t)=>r3(e,"name",{value:t,configurable:!0}),"r$6");const W$=n3((e,t)=>(t.__write??t.write.bind(t)).call(t,e),"writeStream");var s3=Object.defineProperty,i3=Ce((e,t)=>s3(e,"name",{value:t,configurable:!0}),"A$4"),o3=Object.defineProperty,of=i3((e,t)=>o3(e,"name",{value:t,configurable:!0}),"$"),a3=Object.defineProperty,c3=of((e,t)=>a3(e,"name",{value:t,configurable:!0}),"r$1");const l3=c3(e=>e.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
998
|
+
`),"normalizeLF"),u3=globalThis.process??Object.create(null),Sm={versions:{}},Dm=new Proxy(u3,{get(e,t){if(t in e)return e[t];if(t in Sm)return Sm[t]}});var p3=Object.defineProperty,d3=of((e,t)=>p3(e,"name",{value:t,configurable:!0}),"b");const f3=d3((e,t,r,n)=>{const s={column:0,line:-1,...e.start},i={...s,...e.end},o=s.line,a=s.column,c=i.line,l=i.column;let u=Math.max(o-(r+1),0),p=Math.min(t.length,c+n);o===-1&&(u=0),c===-1&&(p=t.length);const f=c-o,m={};if(f)for(let $=0;$<=f;$++){const b=$+o;if(!a)m[b]=!0;else if($===0){const k=t[b-1]?.length;m[b]=[a,(k??0)-a+1]}else if($===f)m[b]=[0,l];else{const k=t[b-$]?.length;m[b]=[0,k]}}else a===l?m[o]=a?[a,0]:!0:m[o]=[a,(l??0)-(a??0)];return{end:p,markerLines:m,start:u}},"getMarkerLines");var h3=Object.defineProperty,ua=of((e,t)=>h3(e,"name",{value:t,configurable:!0}),"t");const m3=Dm.platform==="win32"&&!Dm.env?.WT_SESSION?">":"❯",g3=ua((e,t,r)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...r,color:{gutter:ua($=>$,"gutter"),marker:ua($=>$,"marker"),message:ua($=>$,"message"),...r?.color}},s=typeof t.start.column=="number";let i=l3(e).split(`
|
|
999
|
+
`);typeof n.tabWidth=="number"&&(i=i.map($=>$.replaceAll(" "," ".repeat(n.tabWidth))));const{end:o,markerLines:a,start:c}=f3(t,i,n.linesAbove,n.linesBelow),l=String(o).length,{gutter:u,marker:p,message:f}=n.color;let m=i.slice(c,o).map(($,b)=>{const k=c+1+b,S=a[k],y=` ${String(k)}`.slice(-l),h=!a[k+1],v=` ${y}${n.showGutter?" |":""}`;if(S){let w="";if(Array.isArray(S)){const g=$.replaceAll(/[^\t]/g," ").slice(0,Math.max(S[0]-1,0)),E=S[1]||1;w=[`
|
|
1000
|
+
`,n.prefix+u(v.replaceAll(/\d/g," "))," ",g,p("^").repeat(E)].join(""),h&&n.message&&(w+=` ${f(n.message)}`)}return[n.prefix+p(m3),u(v),$.length>0?` ${$}`:"",w].join("")}return`${n.prefix} ${u(v)}${$.length>0?` ${$}`:""}`}).join(`
|
|
1001
1001
|
`);return n.message&&!s&&(m=`${n.prefix+" ".repeat(l+1)+n.message}
|
|
1002
|
-
${m}`),m},"codeFrame");var
|
|
1003
|
-
`).map(i=>(Cm.test(i)?i.replace(Cm,"$1"):i).trim()).filter(i=>!
|
|
1002
|
+
${m}`),m},"codeFrame");var y3=Object.defineProperty,v3=Ce((e,t)=>y3(e,"name",{value:t,configurable:!0}),"x$3"),b3=Object.defineProperty,$3=v3((e,t)=>b3(e,"name",{value:t,configurable:!0}),"x"),w3=Object.defineProperty,Lr=$3((e,t)=>w3(e,"name",{value:t,configurable:!0}),"u");const Vn=Lr((e,...t)=>{process.env.DEBUG&&process.env.DEBUG==="true"&&console.debug(`error:parse-stacktrace: ${e}`,...t)},"debugLog"),Un="<unknown>",k3=/^.*?\s*at\s(?:(.+?\)(?:\s\[.+\])?|\(?.*?)\s?\((?:address\sat\s)?)?(?:async\s)?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,S3=/\((\S+)\),\s(<[^>]+>)?:(\d+)?:(\d+)?\)?/,D3=/(.*?):(\d+):(\d+)(?:\s<-\s.+:\d+:\d+)?/,C3=/eval\sat\s(<anonymous>)\s\((.*)\)?:(\d+)?:(\d+)\),\s*<anonymous>?:(\d+)?:(\d+)/,E3=/^\s*in\s(?:([^\\/]+(?:\s\[as\s\S+\])?)\s\(?)?\(at?\s?(.*?):(\d+)(?::(\d+))?\)?\s*$/,j3=/in\s(.*)\s\(at\s(.+)\)\sat/,A3=/^(?:.*@)?(.*):(\d+):(\d+)$/,x3=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. \/=]+)(?::(\d+))?(?::(\d+))?\s*$/i,O3=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,P3=/(\S[^\s[]*\[.*\]|.*?)@(.*):(\d+):(\d+)/,Cm=/\(error: (.*)\)/,F3=/at\s/,B3=/^(\S+):(\d+):(\d+)$|^(\S+):(\d+)$/,R3=/\S*(?:Error: |AggregateError:)/,V$=/^Anonymous function$/,T3=/^\s*in\s.*/,N3=/^.*?\s*at\s.*/,I3=/^.*?\s*@.*|\[native code\]/,U$=Lr((e,t)=>{const r=e.includes("safari-extension"),n=e.includes("safari-web-extension");return r||n?[e.includes("@")?e.split("@")[0]:Un,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},"extractSafariExtensionDetails"),G$=Lr((e,t)=>{const r=D3.exec(t);r&&(e.file=r[1],e.line=+r[2],e.column=+r[3])},"parseMapped"),L3=Lr(e=>{const t=j3.exec(e);if(t){Vn(`parse nested node error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const n=t[2].split(":");return{column:n[2]?+n[2]:void 0,file:n[0],line:n[1]?+n[1]:void 0,methodName:t[1]??Un,raw:e,type:void 0}}const r=E3.exec(e);if(r){Vn(`parse node error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n={column:r[4]?+r[4]:void 0,file:r[2]?r[2].replace(F3,""):void 0,line:r[3]?+r[3]:void 0,methodName:r[1]??Un,raw:e,type:e.startsWith("internal")?"internal":void 0};return G$(n,`${r[2]}:${r[3]}:${r[4]}`),n}},"parseNode"),_3=Lr(e=>{const t=k3.exec(e);if(t){Vn(`parse chrome error stack line: "${e}"`,`found: ${JSON.stringify(t)}`);const r=t[2]?.startsWith("native"),n=t[2]?.startsWith("eval")||t[1]?.startsWith("eval");let s,i;if(n){const l=S3.exec(e);if(l){const u=B3.exec(l[1]);u?(t[2]=u[4]??u[1],t[3]=u[5]??u[2],t[4]=u[3]):l[2]&&(t[2]=l[1]),l[2]&&(s={column:l[4]?+l[4]:void 0,file:l[2],line:l[3]?+l[3]:void 0,methodName:"eval",raw:e,type:"eval"})}else{const u=C3.exec(e);u&&(i={column:u[4]?+u[4]:void 0,file:u[2],line:u[3]?+u[3]:void 0},s={column:u[6]?+u[6]:void 0,file:u[1],line:u[5]?+u[5]:void 0,methodName:"eval",raw:u[0],type:"eval"})}}const[o,a]=U$(t[1]?t[1].replace(V$,"<anonymous>"):Un,t[2]),c={column:t[4]?+t[4]:void 0,evalOrigin:s,file:a,line:t[3]?+t[3]:void 0,methodName:o,raw:e,type:n?"eval":r?"native":void 0};return i?(c.column=i.column,c.file=i.file,c.line=i.line):G$(c,`${a}:${t[3]}:${t[4]}`),c}},"parseChromium"),M3=Lr((e,t)=>{const r=x3.exec(e);if(r){Vn(`parse gecko error stack line: "${e}"`,`found: ${JSON.stringify(r)}`);const n=r[3]?.includes(" > eval"),s=n&&r[3]&&O3.exec(r[3]);let i;n&&s&&(r[3]=s[1],i={column:r[5]?+r[5]:void 0,file:r[3],line:r[4]?+r[4]:void 0,methodName:"eval",raw:e,type:"eval"},r[4]=s[2]);const[o,a]=U$(r[1]?r[1].replace(V$,"<anonymous>"):Un,r[3]);let c;(t?.type==="safari"||!n&&t?.type==="firefox")&&t.column?c=t.column:!n&&r[5]&&(c=+r[5]);let l;return(t?.type==="safari"||!n&&t?.type==="firefox")&&t.line?l=t.line:r[4]&&(l=+r[4]),{column:c,evalOrigin:i,file:a,line:l,methodName:o,raw:e,type:n?"eval":a.includes("[native code]")?"native":void 0}}},"parseGecko"),W3=Lr((e,t)=>{const r=P3.exec(e);if(!(r&&r[2].includes(" > eval"))&&r)return Vn(`parse firefox error stack line: "${e}"`,`found: ${JSON.stringify(r)}`),{column:r[4]?+r[4]:t?.column??void 0,file:r[2],line:r[3]?+r[3]:t?.line??void 0,methodName:r[1]||Un,raw:e,type:void 0}},"parseFirefox"),V3=Lr(e=>{const t=A3.exec(e);if(t)return Vn(`parse react android native error stack line: "${e}"`,`found: ${JSON.stringify(t)}`),{column:t[3]?+t[3]:void 0,file:t[1],line:t[2]?+t[2]:void 0,methodName:Un,raw:e,type:void 0}},"parseReactAndroidNative"),q$=Lr((e,{filter:t,frameLimit:r=50}={})=>{const n=e;let s=(typeof n.stacktrace=="string"?n.stacktrace:e.stack??"").split(`
|
|
1003
|
+
`).map(i=>(Cm.test(i)?i.replace(Cm,"$1"):i).trim()).filter(i=>!R3.test(i)&&i!=="eval code");return t&&(s=s.filter(i=>t(i))),s=s.slice(0,r),s.reduce((i,o,a)=>{if(!o||o.length>1024)return i;let c;if(T3.test(o))c=L3(o);else if(N3.test(o))c=_3(o);else if(I3.test(o)){let l;if(a===0){const u=e,p=u.columnNumber,f=u.lineNumber,m=u.line,$=u.column;p||f?l={column:p,line:f,type:"firefox"}:(m||$)&&(l={column:$,line:m,type:"safari"})}c=W3(o,l)??M3(o,l)}else c=V3(o);return c?i.push(c):Vn(`parse error stack line: "${o}"`,"not parser found"),i},[])},"parseStacktrace");var U3=Object.defineProperty,G3=Ce((e,t)=>U3(e,"name",{value:t,configurable:!0}),"p$6"),q3=Object.defineProperty,H$=G3((e,t)=>q3(e,"name",{value:t,configurable:!0}),"m");const H3=RR(import.meta.url),vs=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,af=H$(e=>{if(typeof vs<"u"&&vs.versions&&vs.versions.node){const[t,r]=vs.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return vs.getBuiltinModule(e)}return H3(e)},"__cjs_getBuiltinModule"),{existsSync:z3,readFileSync:J3}=af("node:fs"),{relative:K3}=af("node:path"),{cwd:Y3}=vs,{fileURLToPath:X3}=af("node:url");var Q3=Object.defineProperty,ze=H$((e,t)=>Q3(e,"name",{value:t,configurable:!0}),"o");const ni=ze((e,t,r)=>r===0?e:t===" "?e+" ".repeat(r):e+" ".repeat(t*r),"getPrefix"),Z3=ze((e,t)=>{const r=e.replace("async file:","file:");return K3(t,r.startsWith("file:")?X3(r):r)},"getRelativePath"),e8=ze((e,t,r)=>{if(t)return r.title(e.message);const n=e.message?`: ${e.message}`:"";return r.title(e.name+n)},"getTitleText"),z$=ze((e,{color:t,hideErrorTitle:r,indentation:n,prefix:s},i)=>`${ni(s,n,i)}${e8(e,r,t)}
|
|
1004
1004
|
`,"getMessage"),J$=ze((e,{color:t,indentation:r,prefix:n},s)=>{if(e.hint===void 0)return;const i=ni(n,r,s);let o="";if(Array.isArray(e.hint))for(const a of e.hint)o+=`${i+a}
|
|
1005
|
-
`;else o+=i+e.hint;return t.hint(o)},"getHint"),cf=ze((e,{color:t,cwd:r,displayShortPath:n,indentation:s,prefix:i},o=0)=>{const a=n?
|
|
1005
|
+
`;else o+=i+e.hint;return t.hint(o)},"getHint"),cf=ze((e,{color:t,cwd:r,displayShortPath:n,indentation:s,prefix:i},o=0)=>{const a=n?Z3(e.file,r):e.file,{fileLine:c,method:l}=t;return`${ni(i,s,o)}at ${e.methodName?`${l(e.methodName)} `:""}${c(a)}:${c(e.line?.toString()??"")}`},"getMainFrame"),K$=ze((e,{color:t,indentation:r,linesAbove:n,linesBelow:s,prefix:i,showGutter:o,showLineNumbers:a,tabWidth:c},l)=>{if(e.file===void 0)return;const u=e.file.replace("file://","");if(!z3(u))return;const p=J3(u,"utf8");return g3(p,{start:{column:e.column,line:e.line}},{color:t,linesAbove:n,linesBelow:s,prefix:ni(i,r,l),showGutter:o,showLineNumbers:a,tabWidth:c})},"getCode"),Y$=ze((e,t,r)=>{if(e.errors.length===0)return;let n=`${ni(t.prefix,t.indentation,r)}Errors:
|
|
1006
1006
|
|
|
1007
1007
|
`,s=!0;for(const i of e.errors)s?s=!1:n+=`
|
|
1008
1008
|
|
|
@@ -1014,17 +1014,17 @@ ${n}`},"getErrors"),X$=ze((e,t,r)=>{let n=`${ni(t.prefix,t.indentation,r)}Caused
|
|
|
1014
1014
|
${a}`)}if(s.cause)n+=`
|
|
1015
1015
|
${X$(s,t,r+1)}`;else if(s instanceof AggregateError){const a=Y$(s,t,r);a!==void 0&&(n+=`
|
|
1016
1016
|
${a}`)}return`
|
|
1017
|
-
${n}`},"getCause"),
|
|
1017
|
+
${n}`},"getCause"),t8=ze((e,t)=>(e.length>0?`
|
|
1018
1018
|
`:"")+e.map(r=>cf(r,t)).join(`
|
|
1019
|
-
`),"getStacktrace"),Q$=ze((e,t,r)=>{const n={cwd:
|
|
1020
|
-
`).replaceAll("\\","/")},"internalRenderError"),Yl=ze((e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return Q$(e,t,0)},"renderError");var J3=Object.defineProperty,lf=Ce((e,t)=>J3(e,"name",{value:t,configurable:!0}),"u$3"),K3=Object.defineProperty,Kc=lf((e,t)=>K3(e,"name",{value:t,configurable:!0}),"l");const Y3=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],X3=12288,Q3=65510,Z3=[12288,12288,65281,65376,65504,65510],e8=8361,t8=65518,r8=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],n8=32,s8=10630,i8=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],o8=4352,a8=262141,Z$=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var c8=Object.defineProperty,l8=Kc((e,t)=>c8(e,"name",{value:t,configurable:!0}),"r$1");const zo=l8((e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){const s=Math.floor((r+n)/2),i=s*2;if(t<e[i])n=s-1;else if(t>e[i+1])r=s+1;else return!0}return!1},"isInRange");var u8=Object.defineProperty,is=Kc((e,t)=>u8(e,"name",{value:t,configurable:!0}),"r");const Em=19968,[p8,d8]=si(Z$);function si(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){const s=e[n],i=e[n+1];if(Em>=s&&Em<=i)return[s,i];i-s>r-t&&(t=s,r=i)}return[t,r]}d(si,"X$3");yr(si,"de");Ce(si,"c$2");lf(si,"f");Kc(si,"k");is(si,"findWideFastPathRange");const ew=is(e=>e<161||e>1114109?!1:zo(Y3,e),"isAmbiguous"),tw=is(e=>e<X3||e>Q3?!1:zo(Z3,e),"isFullWidth"),f8=is(e=>e<e8||e>t8?!1:zo(r8,e),"isHalfWidth"),h8=is(e=>e<n8||e>s8?!1:zo(i8,e),"isNarrow"),rw=is(e=>e>=p8&&e<=d8?!0:e<o8||e>a8?!1:zo(Z$,e),"isWide");function ii(e){return ew(e)?"ambiguous":tw(e)?"fullwidth":f8(e)?"halfwidth":h8(e)?"narrow":rw(e)?"wide":"neutral"}d(ii,"ee$2");yr(ii,"ge");Ce(ii,"g$4");lf(ii,"S");Kc(ii,"getCategory");is(ii,"getCategory");var m8=Object.defineProperty,Yc=Ce((e,t)=>m8(e,"name",{value:t,configurable:!0}),"i$3"),g8=Object.defineProperty,Xc=Yc((e,t)=>g8(e,"name",{value:t,configurable:!0}),"a"),y8=Object.defineProperty,uf=Xc((e,t)=>y8(e,"name",{value:t,configurable:!0}),"e");function os(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}d(os,"V$6");yr(os,"J");Ce(os,"s$2");Yc(os,"s");Xc(os,"r");uf(os,"validate");function as(e){return os(e),ii(e)}d(as,"H$8");yr(as,"K");Ce(as,"r$5");Yc(as,"p");Xc(as,"eastAsianWidthType");uf(as,"eastAsianWidthType");function Jo(e,{ambiguousAsWide:t=!1}={}){return os(e),tw(e)||rw(e)||t&&ew(e)?2:1}d(Jo,"be$3");yr(Jo,"Pe");Ce(Jo,"o$5");Yc(Jo,"W");Xc(Jo,"eastAsianWidth");uf(Jo,"eastAsianWidth");var v8=Object.defineProperty,b8=Ce((e,t)=>v8(e,"name",{value:t,configurable:!0}),"p$3"),$8=Object.defineProperty,nw=b8((e,t)=>$8(e,"name",{value:t,configurable:!0}),"e"),w8=Object.defineProperty,k8=nw((e,t)=>w8(e,"name",{value:t,configurable:!0}),"E");const sw=String.raw,jm=sw`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,S8=k8(()=>new RegExp(sw`\p{RI}{2}|(?)${jm}(?:\u200D${jm})*`,"gu"),"default");var D8=Object.defineProperty,C8=nw((e,t)=>D8(e,"name",{value:t,configurable:!0}),"p");const oi=new Set(["\x1B",""]),Qc="\x07",iw="[",pf="m",nc="]8;;",E8=39,j8=/[\u200B\uFEFF\u2060-\u2064]/g,A8=new RegExp(`(?:\\${iw}(?<code>\\d+)m|\\${nc}(?<uri>.*)${Qc})`),x8=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),Ii=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,pa=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Aa=S8();C8(e=>e.replace(Aa,""),"stripEmoji");var O8=Object.defineProperty,P8=Ce((e,t)=>O8(e,"name",{value:t,configurable:!0}),"E"),F8=Object.defineProperty,B8=P8((e,t)=>F8(e,"name",{value:t,configurable:!0}),"A"),R8=Object.defineProperty,Zc=B8((e,t)=>R8(e,"name",{value:t,configurable:!0}),"d");const Am=new Map,da=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,xa=Zc(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),T8=Zc((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let s=Am.get(r);if(s||(s=new Map,Am.set(r,s)),s.has(n))return s.get(n);let i;if(xa(e)==="latin")i=t.width.regular;else if(xa(e)==="control")i=t.width.control;else if(xa(e)==="wide")i=t.width.wide;else switch(as(e)){case"ambiguous":{i=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{i=t.width.fullWidth;break}case"wide":{i=t.width.wide;break}default:i=t.width.regular}return s.set(n,i),i},"getCachedCharWidth"),N8=Zc(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),ep=Zc((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?ep(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},n=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:s}=e,i=s>1e4;let o=0,a=0,c=s,l=!1;const u=e.includes("\x1B")||e.includes("");for(;o<s;){if(u&&(e[o]==="\x1B"||e[o]==="")){if(e.startsWith("\x1B]8;;",o)){const k="\x1B]8;;\x07",S=k.length,y=e.indexOf("\x07",o+5);if(y!==-1){const h=e.indexOf(k,y+1);if(h!==-1){const v=h+S,w=e.slice(y+1,h).replace(Ii,""),g=ep(w,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,n-a),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),E=g.width;if(g.truncated)l=!0,c=Math.min(c,o);else if(a+E>n&&(c=Math.min(c,o),l=!0,a+E>r.truncation.limit))break;if(a+=E,o=v,l&&a>=r.truncation.limit)break;continue}}}if(Ii.lastIndex=o,Ii.test(e)){const k=Ii.lastIndex-o,S=r.truncation.countAnsiEscapeCodes?k:r.width.ansi;if(a+S>n&&(c=Math.min(c,o),a+S>r.truncation.limit)){l=!0;break}a+=S,o=Ii.lastIndex;continue}}const m=e.codePointAt(o);if(m===8203||m===65279||m>=8288&&m<=8292){o+=1;continue}if(m===9){if(a+r.width.tab>n&&(c=Math.min(c,o),a+r.width.tab>r.truncation.limit)){l=!0;break}a+=r.width.tab,o+=1;continue}if(da.lastIndex=o,da.test(e)){const k=(da.lastIndex-o)*r.width.regular;if(a+k>n){const S=Math.floor((n-a)/r.width.regular);if(c=Math.min(c,o+S),a+k>r.truncation.limit){l=!0;break}}a+=k,o=da.lastIndex;continue}if((m<=31||m>=127&&m<=159)&&(pa.lastIndex=o,pa.test(e))){const k=(pa.lastIndex-o)*r.width.control;if(a+k>n&&(c=Math.min(c,o+Math.floor((n-a)/r.width.control)),a+k>r.truncation.limit)){l=!0;break}a+=k,o=pa.lastIndex;continue}if(Aa.lastIndex=o,Aa.test(e)){if(a+r.width.emoji>n&&(c=Math.min(c,o),a+r.width.emoji>r.truncation.limit)){l=!0;break}a+=r.width.emoji,o=Aa.lastIndex;continue}const $=e.codePointAt(o)??0;if(N8($)){o+=$>65535?2:1;continue}let b;if(i)b=T8($,r);else switch(xa($)){case"control":{b=r.width.control;break}case"latin":{b=r.width.regular;break}case"wide":{b=r.width.wide;break}case"zero":{b=0;break}default:switch(as($)){case"ambiguous":{b=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{b=r.width.fullWidth;break}case"wide":{b=r.width.wide;break}default:b=r.width.regular}}if(a+b>n&&(c=Math.min(c,o),a+b>r.truncation.limit)){l=!0;break}a+=b,o+=$>65535?2:1}let p=a,f=!1;return l&&r.truncation.limit>=r.truncation.ellipsisWidth&&(p=r.truncation.limit,f=!0),{ellipsed:f,index:l?c:s,truncated:l,width:p}},"getStringTruncatedWidth");var I8=Object.defineProperty,L8=Ce((e,t)=>I8(e,"name",{value:t,configurable:!0}),"i$1"),_8=Object.defineProperty,M8=L8((e,t)=>_8(e,"name",{value:t,configurable:!0}),"e"),W8=Object.defineProperty,V8=M8((e,t)=>W8(e,"name",{value:t,configurable:!0}),"r");const Rt=V8((e,t={})=>ep(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var U8=Object.defineProperty,ow=Ce((e,t)=>U8(e,"name",{value:t,configurable:!0}),"b"),G8=Object.defineProperty,cs=ow((e,t)=>G8(e,"name",{value:t,configurable:!0}),"d"),q8=Object.defineProperty,H8=cs((e,t)=>q8(e,"name",{value:t,configurable:!0}),"a");const z8=/\x1B\[(\d+)m/;let aw=class{static{d(this,"It")}static{yr(this,"At")}static{Ce(this,"T")}static{ow(this,"T")}static{cs(this,"d")}static{H8(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=z8.exec(t);if(!r)return;const n=Number.parseInt(r[1],10);switch(n){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(n>=30&&n<=37||n>=90&&n<=97)this.activeForeground=t;else if(n>=40&&n<=47||n>=100&&n<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(n))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(n)){const s={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[n];s&&(this.activeFormatting=this.activeFormatting.filter(i=>!i.includes(s)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const r={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(n=>{const s=r[n];s&&t.push(s)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}};var J8=Object.defineProperty,cw=cs((e,t)=>J8(e,"name",{value:t,configurable:!0}),"o");const lw=cw((e,t)=>{if(!oi.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+nc.length).join("")===nc;return{isInsideEscape:r,isInsideLinkEscape:n}},"checkEscapeSequence"),K8=cw((e,t={})=>{const r=new aw;let n="",s=!1,i="",o="",a=!1;const c=[...e];for(let l=0;l<c.length;l++){const u=c[l];if(u&&oi.has(u)){if(n){const b=t.getWidth?.(n)??0,k={isEscapeSequence:!1,isGrapheme:!0,text:n,width:b};if(a&&(k.isHyperlink=!0,k.hyperlinkUrl=o),t.onSegment?.(k,r)===!1)return;n=""}s=!0,i=u;const m=lw(c,l),{isInsideLinkEscape:$}=m;if($){let b=l+1;for(o="";b<c.length;){const S=c[b];if(S===Qc)break;o+=S,b+=1}o=o.slice(4);const k={hyperlinkUrl:o,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(k,r)===!1)return;l=b,a=!0,s=!1,i="";continue}if(l+1<c.length&&c[l+1]==="\\"&&a){const b={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(b,r)===!1)return;a=!1,o="",l+=1,s=!1,i="";continue}}if(s){if(i!==u&&(i+=u),u===pf){s=!1,r.processEscape(i);const m={isEscapeSequence:!0,isGrapheme:!1,text:i,width:0};if(t.onSegment?.(m,r)===!1)return;i=""}continue}n+=u;const p=t.getWidth?.(n)??0,f={isEscapeSequence:!1,isGrapheme:!0,text:n,width:p};if(a&&(f.isHyperlink=!0,f.hyperlinkUrl=o),t.onSegment?.(f,r)===!1)return;n=""}if(n){const l=t.getWidth?.(n)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:n,width:l};a&&(u.isHyperlink=!0,u.hyperlinkUrl=o),t.onSegment?.(u,r)}if(i){const l={isEscapeSequence:!0,isGrapheme:!1,text:i,width:0};t.onSegment?.(l,r)}},"processAnsiString");var Y8=Object.defineProperty,X8=cs((e,t)=>Y8(e,"name",{value:t,configurable:!0}),"t$1");const xm=X8(e=>`${oi.values().next().value}${iw}${String(e)}${pf}`,"wrapAnsiCode");var Q8=Object.defineProperty,Z8=cs((e,t)=>Q8(e,"name",{value:t,configurable:!0}),"s");const Om=Z8(e=>`${oi.values().next().value}${nc}${e}${Qc}`,"wrapAnsiHyperlink");var eN=Object.defineProperty,tN=cs((e,t)=>eN(e,"name",{value:t,configurable:!0}),"l");const rN=tN(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,n;const s=e.join(`
|
|
1021
|
-
`),i=[...s];let o=0;for(const[a,c]of i.entries()){if(t+=c,oi.has(c)){const u=
|
|
1019
|
+
`),"getStacktrace"),Q$=ze((e,t,r)=>{const n={cwd:Y3(),displayShortPath:!1,filterStacktrace:void 0,framesMaxLimit:Number.POSITIVE_INFINITY,hideErrorCauseCodeView:!1,hideErrorCodeView:!1,hideErrorErrorsCodeView:!1,hideErrorTitle:!1,hideMessage:!1,indentation:4,linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,showLineNumbers:!0,tabWidth:4,...t,color:{fileLine:ze(o=>o,"fileLine"),gutter:ze(o=>o,"gutter"),hint:ze(o=>o,"hint"),marker:ze(o=>o,"marker"),message:ze(o=>o,"message"),method:ze(o=>o,"method"),title:ze(o=>o,"title"),...t.color}},s=q$(e,{filter:t.filterStacktrace,frameLimit:n.framesMaxLimit}),i=s.shift();return[t.hideMessage?void 0:z$(e,n,r),J$(e,n,r),i?cf(i,n,r):void 0,i&&!n.hideErrorCodeView?K$(i,n,r):void 0,e instanceof AggregateError?Y$(e,n,r):void 0,e.cause===void 0?void 0:X$(e,n,r),s.length>0?t8(s,n):void 0].filter(Boolean).join(`
|
|
1020
|
+
`).replaceAll("\\","/")},"internalRenderError"),Yl=ze((e,t={})=>{if(t.framesMaxLimit!==void 0&&t.framesMaxLimit<=0)throw new RangeError("The 'framesMaxLimit' option must be a positive number");return Q$(e,t,0)},"renderError");var r8=Object.defineProperty,lf=Ce((e,t)=>r8(e,"name",{value:t,configurable:!0}),"u$3"),n8=Object.defineProperty,Kc=lf((e,t)=>n8(e,"name",{value:t,configurable:!0}),"l");const s8=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],i8=12288,o8=65510,a8=[12288,12288,65281,65376,65504,65510],c8=8361,l8=65518,u8=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],p8=32,d8=10630,f8=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],h8=4352,m8=262141,Z$=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var g8=Object.defineProperty,y8=Kc((e,t)=>g8(e,"name",{value:t,configurable:!0}),"r$1");const zo=y8((e,t)=>{let r=0,n=Math.floor(e.length/2)-1;for(;r<=n;){const s=Math.floor((r+n)/2),i=s*2;if(t<e[i])n=s-1;else if(t>e[i+1])r=s+1;else return!0}return!1},"isInRange");var v8=Object.defineProperty,is=Kc((e,t)=>v8(e,"name",{value:t,configurable:!0}),"r");const Em=19968,[b8,$8]=si(Z$);function si(e){let t=e[0],r=e[1];for(let n=0;n<e.length;n+=2){const s=e[n],i=e[n+1];if(Em>=s&&Em<=i)return[s,i];i-s>r-t&&(t=s,r=i)}return[t,r]}d(si,"X$3");yr(si,"de");Ce(si,"c$2");lf(si,"f");Kc(si,"k");is(si,"findWideFastPathRange");const ew=is(e=>e<161||e>1114109?!1:zo(s8,e),"isAmbiguous"),tw=is(e=>e<i8||e>o8?!1:zo(a8,e),"isFullWidth"),w8=is(e=>e<c8||e>l8?!1:zo(u8,e),"isHalfWidth"),k8=is(e=>e<p8||e>d8?!1:zo(f8,e),"isNarrow"),rw=is(e=>e>=b8&&e<=$8?!0:e<h8||e>m8?!1:zo(Z$,e),"isWide");function ii(e){return ew(e)?"ambiguous":tw(e)?"fullwidth":w8(e)?"halfwidth":k8(e)?"narrow":rw(e)?"wide":"neutral"}d(ii,"ee$2");yr(ii,"ge");Ce(ii,"g$4");lf(ii,"S");Kc(ii,"getCategory");is(ii,"getCategory");var S8=Object.defineProperty,Yc=Ce((e,t)=>S8(e,"name",{value:t,configurable:!0}),"i$3"),D8=Object.defineProperty,Xc=Yc((e,t)=>D8(e,"name",{value:t,configurable:!0}),"a"),C8=Object.defineProperty,uf=Xc((e,t)=>C8(e,"name",{value:t,configurable:!0}),"e");function os(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}d(os,"V$6");yr(os,"J");Ce(os,"s$2");Yc(os,"s");Xc(os,"r");uf(os,"validate");function as(e){return os(e),ii(e)}d(as,"H$8");yr(as,"K");Ce(as,"r$5");Yc(as,"p");Xc(as,"eastAsianWidthType");uf(as,"eastAsianWidthType");function Jo(e,{ambiguousAsWide:t=!1}={}){return os(e),tw(e)||rw(e)||t&&ew(e)?2:1}d(Jo,"be$3");yr(Jo,"Pe");Ce(Jo,"o$5");Yc(Jo,"W");Xc(Jo,"eastAsianWidth");uf(Jo,"eastAsianWidth");var E8=Object.defineProperty,j8=Ce((e,t)=>E8(e,"name",{value:t,configurable:!0}),"p$3"),A8=Object.defineProperty,nw=j8((e,t)=>A8(e,"name",{value:t,configurable:!0}),"e"),x8=Object.defineProperty,O8=nw((e,t)=>x8(e,"name",{value:t,configurable:!0}),"E");const sw=String.raw,jm=sw`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,P8=O8(()=>new RegExp(sw`\p{RI}{2}|(?)${jm}(?:\u200D${jm})*`,"gu"),"default");var F8=Object.defineProperty,B8=nw((e,t)=>F8(e,"name",{value:t,configurable:!0}),"p");const oi=new Set(["\x1B",""]),Qc="\x07",iw="[",pf="m",nc="]8;;",R8=39,T8=/[\u200B\uFEFF\u2060-\u2064]/g,N8=new RegExp(`(?:\\${iw}(?<code>\\d+)m|\\${nc}(?<uri>.*)${Qc})`),I8=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),Ii=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,pa=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Aa=P8();B8(e=>e.replace(Aa,""),"stripEmoji");var L8=Object.defineProperty,_8=Ce((e,t)=>L8(e,"name",{value:t,configurable:!0}),"E"),M8=Object.defineProperty,W8=_8((e,t)=>M8(e,"name",{value:t,configurable:!0}),"A"),V8=Object.defineProperty,Zc=W8((e,t)=>V8(e,"name",{value:t,configurable:!0}),"d");const Am=new Map,da=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,xa=Zc(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),U8=Zc((e,t)=>{const r=Math.floor(e/65536),n=e%65536;let s=Am.get(r);if(s||(s=new Map,Am.set(r,s)),s.has(n))return s.get(n);let i;if(xa(e)==="latin")i=t.width.regular;else if(xa(e)==="control")i=t.width.control;else if(xa(e)==="wide")i=t.width.wide;else switch(as(e)){case"ambiguous":{i=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{i=t.width.fullWidth;break}case"wide":{i=t.width.wide;break}default:i=t.width.regular}return s.set(n,i),i},"getCachedCharWidth"),G8=Zc(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),ep=Zc((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const r={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?ep(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},n=Math.max(0,r.truncation.limit-r.truncation.ellipsisWidth),{length:s}=e,i=s>1e4;let o=0,a=0,c=s,l=!1;const u=e.includes("\x1B")||e.includes("");for(;o<s;){if(u&&(e[o]==="\x1B"||e[o]==="")){if(e.startsWith("\x1B]8;;",o)){const k="\x1B]8;;\x07",S=k.length,y=e.indexOf("\x07",o+5);if(y!==-1){const h=e.indexOf(k,y+1);if(h!==-1){const v=h+S,w=e.slice(y+1,h).replace(Ii,""),g=ep(w,{ambiguousIsNarrow:r.width.ambiguousIsNarrow,ansiWidth:r.width.ansi,controlWidth:r.width.control,countAnsiEscapeCodes:!1,ellipsis:r.truncation.ellipsis,ellipsisWidth:r.truncation.ellipsisWidth,emojiWidth:r.width.emoji,fullWidth:r.width.fullWidth,halfWidth:r.width.halfWidth,limit:Math.max(0,n-a),regularWidth:r.width.regular,tabWidth:r.width.tab,wideWidth:r.width.wide}),E=g.width;if(g.truncated)l=!0,c=Math.min(c,o);else if(a+E>n&&(c=Math.min(c,o),l=!0,a+E>r.truncation.limit))break;if(a+=E,o=v,l&&a>=r.truncation.limit)break;continue}}}if(Ii.lastIndex=o,Ii.test(e)){const k=Ii.lastIndex-o,S=r.truncation.countAnsiEscapeCodes?k:r.width.ansi;if(a+S>n&&(c=Math.min(c,o),a+S>r.truncation.limit)){l=!0;break}a+=S,o=Ii.lastIndex;continue}}const m=e.codePointAt(o);if(m===8203||m===65279||m>=8288&&m<=8292){o+=1;continue}if(m===9){if(a+r.width.tab>n&&(c=Math.min(c,o),a+r.width.tab>r.truncation.limit)){l=!0;break}a+=r.width.tab,o+=1;continue}if(da.lastIndex=o,da.test(e)){const k=(da.lastIndex-o)*r.width.regular;if(a+k>n){const S=Math.floor((n-a)/r.width.regular);if(c=Math.min(c,o+S),a+k>r.truncation.limit){l=!0;break}}a+=k,o=da.lastIndex;continue}if((m<=31||m>=127&&m<=159)&&(pa.lastIndex=o,pa.test(e))){const k=(pa.lastIndex-o)*r.width.control;if(a+k>n&&(c=Math.min(c,o+Math.floor((n-a)/r.width.control)),a+k>r.truncation.limit)){l=!0;break}a+=k,o=pa.lastIndex;continue}if(Aa.lastIndex=o,Aa.test(e)){if(a+r.width.emoji>n&&(c=Math.min(c,o),a+r.width.emoji>r.truncation.limit)){l=!0;break}a+=r.width.emoji,o=Aa.lastIndex;continue}const $=e.codePointAt(o)??0;if(G8($)){o+=$>65535?2:1;continue}let b;if(i)b=U8($,r);else switch(xa($)){case"control":{b=r.width.control;break}case"latin":{b=r.width.regular;break}case"wide":{b=r.width.wide;break}case"zero":{b=0;break}default:switch(as($)){case"ambiguous":{b=r.width.ambiguousIsNarrow?r.width.regular:r.width.wide;break}case"fullwidth":{b=r.width.fullWidth;break}case"wide":{b=r.width.wide;break}default:b=r.width.regular}}if(a+b>n&&(c=Math.min(c,o),a+b>r.truncation.limit)){l=!0;break}a+=b,o+=$>65535?2:1}let p=a,f=!1;return l&&r.truncation.limit>=r.truncation.ellipsisWidth&&(p=r.truncation.limit,f=!0),{ellipsed:f,index:l?c:s,truncated:l,width:p}},"getStringTruncatedWidth");var q8=Object.defineProperty,H8=Ce((e,t)=>q8(e,"name",{value:t,configurable:!0}),"i$1"),z8=Object.defineProperty,J8=H8((e,t)=>z8(e,"name",{value:t,configurable:!0}),"e"),K8=Object.defineProperty,Y8=J8((e,t)=>K8(e,"name",{value:t,configurable:!0}),"r");const Rt=Y8((e,t={})=>ep(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var X8=Object.defineProperty,ow=Ce((e,t)=>X8(e,"name",{value:t,configurable:!0}),"b"),Q8=Object.defineProperty,cs=ow((e,t)=>Q8(e,"name",{value:t,configurable:!0}),"d"),Z8=Object.defineProperty,eN=cs((e,t)=>Z8(e,"name",{value:t,configurable:!0}),"a");const tN=/\x1B\[(\d+)m/;let aw=class{static{d(this,"It")}static{yr(this,"At")}static{Ce(this,"T")}static{ow(this,"T")}static{cs(this,"d")}static{eN(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const r=tN.exec(t);if(!r)return;const n=Number.parseInt(r[1],10);switch(n){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(n>=30&&n<=37||n>=90&&n<=97)this.activeForeground=t;else if(n>=40&&n<=47||n>=100&&n<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(n))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(n)){const s={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[n];s&&(this.activeFormatting=this.activeFormatting.filter(i=>!i.includes(s)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const r={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(n=>{const s=r[n];s&&t.push(s)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}};var rN=Object.defineProperty,cw=cs((e,t)=>rN(e,"name",{value:t,configurable:!0}),"o");const lw=cw((e,t)=>{if(!oi.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const r=!0,n=e.slice(t+1,t+1+nc.length).join("")===nc;return{isInsideEscape:r,isInsideLinkEscape:n}},"checkEscapeSequence"),nN=cw((e,t={})=>{const r=new aw;let n="",s=!1,i="",o="",a=!1;const c=[...e];for(let l=0;l<c.length;l++){const u=c[l];if(u&&oi.has(u)){if(n){const b=t.getWidth?.(n)??0,k={isEscapeSequence:!1,isGrapheme:!0,text:n,width:b};if(a&&(k.isHyperlink=!0,k.hyperlinkUrl=o),t.onSegment?.(k,r)===!1)return;n=""}s=!0,i=u;const m=lw(c,l),{isInsideLinkEscape:$}=m;if($){let b=l+1;for(o="";b<c.length;){const S=c[b];if(S===Qc)break;o+=S,b+=1}o=o.slice(4);const k={hyperlinkUrl:o,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(k,r)===!1)return;l=b,a=!0,s=!1,i="";continue}if(l+1<c.length&&c[l+1]==="\\"&&a){const b={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(b,r)===!1)return;a=!1,o="",l+=1,s=!1,i="";continue}}if(s){if(i!==u&&(i+=u),u===pf){s=!1,r.processEscape(i);const m={isEscapeSequence:!0,isGrapheme:!1,text:i,width:0};if(t.onSegment?.(m,r)===!1)return;i=""}continue}n+=u;const p=t.getWidth?.(n)??0,f={isEscapeSequence:!1,isGrapheme:!0,text:n,width:p};if(a&&(f.isHyperlink=!0,f.hyperlinkUrl=o),t.onSegment?.(f,r)===!1)return;n=""}if(n){const l=t.getWidth?.(n)??0,u={isEscapeSequence:!1,isGrapheme:!0,text:n,width:l};a&&(u.isHyperlink=!0,u.hyperlinkUrl=o),t.onSegment?.(u,r)}if(i){const l={isEscapeSequence:!0,isGrapheme:!1,text:i,width:0};t.onSegment?.(l,r)}},"processAnsiString");var sN=Object.defineProperty,iN=cs((e,t)=>sN(e,"name",{value:t,configurable:!0}),"t$1");const xm=iN(e=>`${oi.values().next().value}${iw}${String(e)}${pf}`,"wrapAnsiCode");var oN=Object.defineProperty,aN=cs((e,t)=>oN(e,"name",{value:t,configurable:!0}),"s");const Om=aN(e=>`${oi.values().next().value}${nc}${e}${Qc}`,"wrapAnsiHyperlink");var cN=Object.defineProperty,lN=cs((e,t)=>cN(e,"name",{value:t,configurable:!0}),"l");const uN=lN(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",r,n;const s=e.join(`
|
|
1021
|
+
`),i=[...s];let o=0;for(const[a,c]of i.entries()){if(t+=c,oi.has(c)){const u=N8.exec(s.slice(o))?.groups??{};if(u.code!==void 0){const p=Number.parseFloat(u.code);r=p===R8?void 0:p}else u.uri!==void 0&&(n=u.uri.length===0?void 0:u.uri)}const l=I8.get(Number(r));i[a+1]===`
|
|
1022
1022
|
`?(n&&(t+=Om("")),r&&l&&(t+=xm(l))):c===`
|
|
1023
|
-
`&&(r&&l&&(t+=xm(r)),n&&(t+=Om(n))),o+=c.length}return t},"preserveAnsi");var
|
|
1023
|
+
`&&(r&&l&&(t+=xm(r)),n&&(t+=Om(n))),o+=c.length}return t},"preserveAnsi");var pN=Object.defineProperty,an=cs((e,t)=>pN(e,"name",{value:t,configurable:!0}),"f");const uw=/(?=\s)|(?<=\s)/,pw=/^\s+$/,Xl=an(e=>{if(!e.includes("\x1B"))return e;let t=e;return e.includes("\x1B[30m")&&(t+="\x1B[39m"),e.includes("\x1B[42m")&&(t+="\x1B[49m"),t},"resetAnsiAtLineBreak"),Tn=an(e=>{const t=e.split(" ");let r=t.length;for(;r>0&&Rt(t[r-1])===0;)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},"stringVisibleTrimSpacesRight"),dw=an((e,t,r)=>{if(e.length===0)return[""];if(t<=0)return[e];const n=[],s=new aw;let i="",o=0,a=!1,c=!1,l="",u=0;for(;u<e.length;){const p=e[u];if(oi.has(p)){a=!0,l=p,i+=p,c=lw([...e],u).isInsideLinkEscape,u+=1;continue}if(a){l+=p,i+=p,c?p===Qc&&(a=c=!1):p===pf&&(a=!1,s.processEscape(l)),u+=1;continue}const f=Rt(p),m=p===" ";if(f===0){i+=p,u+=1;continue}if(o+f>t&&(i&&n.push(i+s.getEndEscapesForAllActiveAttributes()),i=s.getStartEscapesForAllActiveAttributes(),o=Rt(i),m&&r)){for(;u<e.length&&e[u]===" ";)u+=1;continue}if(i+=p,o+=f,o===t&&u<e.length-1&&(n.push(i+s.getEndEscapesForAllActiveAttributes()),i=s.getStartEscapesForAllActiveAttributes(),o=Rt(i),u+1<e.length&&e[u+1]===" "&&r)){for(u+=1;u<e.length&&e[u]===" ";)u+=1;continue}u+=1}return i&&n.push(i+s.getEndEscapesForAllActiveAttributes()),r?n.map(p=>Tn(p)):n},"wrapWithBreakAtWidth"),dN=an((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const s=[];let i="",o=0;return nN(n,{getWidth:Rt,onSegment:an((a,c)=>{const l=a.text??"";if(a.isEscapeSequence)i+=l;else{const u=l===" ";if(a.width===0)return i+=l,!0;if(o+a.width>t&&(i&&s.push(i),i=c.getStartEscapesForAllActiveAttributes(),o=0,u))return r||s.push(c.getStartEscapesForAllActiveAttributes()+l),!0;i+=l,o+=a.width}return!0},"onSegment")}),i&&s.push(i),r?s.map(a=>Tn(a)):s},"wrapCharByChar"),fN=an((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const s=n.split(uw),i=[];let o="",a=0,c=0;for(;c<s.length;){const l=s[c],u=pw.test(l),p=Rt(l);if(l.length===0){c+=1;continue}if(r&&u&&a===0){c+=1;continue}if(a+p>t&&a>0){r?i.push(Tn(o)):i.push(o),o="",a=0;continue}o+=l,a+=p,c+=1}return o&&(r?i.push(Tn(o)):i.push(o)),i},"wrapWithWordBoundaries"),hN=an((e,t,r)=>{if(e.length===0)return[];const n=r?e.trim():e;if(n.length===0)return[];const s=n.split(uw),i=[];let o="",a=0,c=0;for(;c<s.length;){const l=s[c],u=pw.test(l),p=Rt(l);if(l.length===0){c+=1;continue}if(r&&u&&a===0){c+=1;continue}if(p>t){o&&i.push(Xl(r?Tn(o):o));const f=dw(l,t,r);if(f.length>0){for(let m=0;m<f.length-1;m+=1)i.push(f[m]);o=f.at(-1),a=Rt(o)}else o="",a=0;c+=1;continue}if(a+p>t&&a>0&&(i.push(Xl(r?Tn(o):o)),o="",a=0,r&&u)){c+=1;continue}o+=l,a+=p,c+=1}return o&&i.push(Xl(r?Tn(o):o)),i},"wrapAndBreakWords"),Qi={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},mN=an((e,t={})=>{const{removeZeroWidthCharacters:r=!0,trim:n=!0,width:s=80,wrapMode:i=Qi.PRESERVE_WORDS}=t;if(n&&e.trim()==="")return"";let o=e.normalize("NFC").replaceAll(`\r
|
|
1024
1024
|
`,`
|
|
1025
|
-
`);return r&&(o=o.replaceAll(
|
|
1026
|
-
`).map(a=>{if(n&&a.trim()==="")return"";let c;switch(i){case Qi.BREAK_AT_CHARACTERS:{c=
|
|
1027
|
-
`)},"wordWrap");var cN=Object.defineProperty,yn=Ce((e,t)=>cN(e,"name",{value:t,configurable:!0}),"n$2");const fw=80,hw=24,tp=yn((e,t,{shell:r,env:n}={})=>jR(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),Oa=yn((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),mw=yn((e,t)=>{const{columns:r,rows:n}=Oa(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===fw&&n===hw))return{columns:r,rows:n}},"createIfNotDefault"),lN=yn(()=>{if(Rn.platform!=="linux")return!0;try{const e=Xi.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const r=e.slice(t+2).trim().split(/\s+/),n=Number.parseInt(r[2],10),s=Number.parseInt(r[5],10);return Number.isNaN(n)||Number.isNaN(s)||s<=0?!1:n===s}catch{return!1}},"isForegroundProcess");function el(){const{env:e,stdout:t,stderr:r}=Rn;if(t?.columns&&t?.rows)return Oa(t.columns,t.rows);if(r?.columns&&r?.rows)return Oa(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return Oa(e.COLUMNS,e.LINES);const n={columns:fw,rows:hw};return Rn.platform==="win32"?Ql()??n:Rn.platform==="darwin"?Pm()??Ql()??n:Pm()??Ql()??uN()??n}d(el,"We$1");yr(el,"Oa");Ce(el,"O");yn(el,"terminalSize");const Pm=yn(()=>{try{const e=Rn.platform==="darwin"?Xi.constants.O_EVTONLY|Xi.constants.O_NONBLOCK:Xi.constants.O_NONBLOCK,{columns:t,rows:r}=AR.WriteStream(Xi.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),Ql=yn(()=>{try{const e=tp("tput",["cols"],{env:{TERM:"dumb",...Rn.env}}),t=tp("tput",["lines"],{env:{TERM:"dumb",...Rn.env}});if(e&&t)return mw(e,t)}catch{}},"tput"),uN=yn(()=>{try{if(!lN())return;const e=tp("resize",["-u"]).match(/\d+/g);if(e.length===2)return mw(e[0],e[1])}catch{}},"resize");var pN=Object.defineProperty,dN=Ce((e,t)=>pN(e,"name",{value:t,configurable:!0}),"r$2");const fN=dN(e=>{const t=Object.keys(e).map(r=>e[r].badge??"");return t.length===0?"":t.reduce((r,n)=>r.length>n.length?r:n,"")},"getLongestBadge");var hN=Object.defineProperty,mN=Ce((e,t)=>hN(e,"name",{value:t,configurable:!0}),"r$1");const{bold:gN,cyan:yN,green:Fm,grey:vN,magenta:bN,red:$N,yellow:Zl}=dc,wN={indent:2,quoteStyle:"single",stylize:mN((e,t)=>{const r={bigint:Zl,boolean:Zl,date:bN,null:gN,number:Zl,regexp:$N,special:yN,string:Fm,symbol:Fm,undefined:vN};return Object.hasOwn(r,t)?r[t](e):e},"stylize")};var kN=Object.defineProperty,SN=Ce((e,t)=>kN(e,"name",{value:t,configurable:!0}),"o$1");const{bold:DN,underline:CN}=dc,EN=SN((e,t)=>{let r=t.uppercase.label?e.toUpperCase():e;return r=t.underline.label?CN(r):r,t.bold.label&&(r=DN(r)),r},"formatLabel");var jN=Object.defineProperty,gw=Ce((e,t)=>jN(e,"name",{value:t,configurable:!0}),"o");const AN=gw(e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":"),"dateFormatter");class xN{static{d(this,"Za")}static{yr(this,"Xa")}static{Ce(this,"AbstractPrettyReporter")}static{gw(this,"AbstractPrettyReporter")}styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:AN,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=x$}setLoggerTypes(t){this.loggerTypes=t}}var ON=Object.defineProperty,$e=d((e,t)=>ON(e,"name",{value:t,configurable:!0}),"k$h"),PN=Object.defineProperty,te=$e((e,t)=>PN(e,"name",{value:t,configurable:!0}),"p");mt(import.meta.url);const FN=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:df,stderr:ff,env:co}=FN,BN="\x1B",xe="\x1B[",yw=";";var RN=Object.defineProperty,TN=te((e,t)=>RN(e,"name",{value:t,configurable:!0}),"t$3"),NN=Object.defineProperty,IN=TN((e,t)=>NN(e,"name",{value:t,configurable:!0}),"t");const LN=typeof globalThis<"u"&&typeof globalThis.window=="object"&&globalThis.window.document!==void 0,_N=/^(?:msys|cygwin)$/,MN=!LN&&(process.platform==="win32"||_N.test(process.env.OSTYPE));var WN=Object.defineProperty,ut=IN((e,t)=>WN(e,"name",{value:t,configurable:!0}),"n");const VN=ut((e=1)=>`${xe}${String(e)}D`,"cursorBackward");ut((e=1)=>`${xe}${String(e)}B`,"cursorDown");ut((e=1)=>`${xe}${String(e)}C`,"cursorForward");const UN=`${xe}G`;ut((e=1)=>VN(e),"cursorLeft");const GN=ut((e=1)=>`${xe}${String(e)}G`,"cursorHorizontalAbsolute");ut((e,t)=>{let r="";return e<0?r+=`${xe}${String(-e)}D`:e>0&&(r+=`${xe}${String(e)}C`),t<0?r+=`${xe}${String(-t)}A`:t>0&&(r+=`${xe}${String(t)}B`),r},"cursorMove");ut((e=1)=>`${xe}${String(e)}E`,"cursorNextLine");ut((e=1)=>`${xe}${String(e)}F`,"cursorPreviousLine");const qN=ut((e,t)=>t===void 0?GN(e+1):`${xe}${String(t+1)}${yw}${String(e+1)}H`,"cursorTo");ut((e,t)=>t===void 0?`${xe}${String(e)}H`:`${xe}${String(e)}${yw}${String(t)}H`,"cursorPosition");ut((e=1)=>`${xe}${String(e)}I`,"cursorHorizontalForwardTab");ut((e=1)=>`${xe}${String(e)}Z`,"cursorBackwardTab");ut((e=1)=>`${xe}${String(e)}X`,"eraseCharacter");ut((e=1)=>`${xe}${String(e)}d`,"cursorVerticalAbsolute");const HN=ut((e=1)=>`${xe}${String(e)}A`,"cursorUp");var zN=(e=>(e[e.Default=0]="Default",e[e.BlinkingBlock=1]="BlinkingBlock",e[e.SteadyBlock=2]="SteadyBlock",e[e.BlinkingUnderline=3]="BlinkingUnderline",e[e.SteadyUnderline=4]="SteadyUnderline",e[e.BlinkingBar=5]="BlinkingBar",e[e.SteadyBar=6]="SteadyBar",e))(zN||{});ut(e=>`${xe}${String(e)} q`,"setCursorStyle");var JN=Object.defineProperty,KN=te((e,t)=>JN(e,"name",{value:t,configurable:!0}),"o$3"),YN=Object.defineProperty,XN=KN((e,t)=>YN(e,"name",{value:t,configurable:!0}),"s"),QN=Object.defineProperty,hf=XN((e,t)=>QN(e,"name",{value:t,configurable:!0}),"o"),xs=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireScreen=2]="EntireScreen",e[e.EntireScreenAndScrollback=3]="EntireScreenAndScrollback",e))(xs||{});const Br=hf(e=>{const t=e>=0&&e<=3?e:0;return`${xe}${t===0?"":String(t)}J`},"eraseDisplay");var vw=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireLine=2]="EntireLine",e))(vw||{});const tl=hf(e=>{const t=e>=0&&e<=2?e:0;return`${xe}${t===0?"":String(t)}K`},"eraseInLine");Br(0);const ZN=tl(2);tl(0);tl(1);hf(e=>{if(e<=0)return"";let t="";for(let r=0;r<e;r+=1)t+=ZN,r<e-1&&(t+=HN());return t+=UN,t},"eraseLines");Br(2);Br(1);Br(3);qN(0,0)+Br(xs.ToEnd);`${tl(vw.EntireLine)}${xe}`;`${xe}${Br(xs.EntireScreen)}`;const Bm=MN?`${Br(xs.EntireScreen)}${xe}0f`:`${Br(xs.EntireScreen)}${Br(xs.EntireScreenAndScrollback)}${xe}H${BN}c`;var eI=Object.defineProperty,Ws=te((e,t)=>eI(e,"name",{value:t,configurable:!0}),"t$2");function rl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}d(rl,"ke$2");$e(rl,"Ie");te(rl,"getDefaultExportFromCjs");Ws(rl,"getDefaultExportFromCjs");function mf(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}d(mf,"qe$1");$e(mf,"Tt");te(mf,"getDefaultExportFromNamespaceIfPresent");Ws(mf,"getDefaultExportFromNamespaceIfPresent");function gf(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}d(gf,"Ve$1");$e(gf,"kt");te(gf,"getDefaultExportFromNamespaceIfNotNamed");Ws(gf,"getDefaultExportFromNamespaceIfNotNamed");function yf(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=Ws(te($e(d(function n(){var s=!1;try{s=this instanceof n}catch{}return s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)},"s"),"s"),"a"),"a");r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:Ws(function(){return e[n]},"get")})}),r}d(yf,"Je");$e(yf,"Mt");te(yf,"getAugmentedNamespace");Ws(yf,"getAugmentedNamespace");var eu={exports:{}},Rm;function vf(){return Rm||(Rm=1,(function(e,t){var r=Object.defineProperty,n=te((v,w)=>r(v,"name",{value:w,configurable:!0}),"$");const{hasOwnProperty:s}=Object.prototype,i=h();i.configure=h,i.stringify=i,i.default=i,t.stringify=i,t.configure=h,e.exports=i;const o=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function a(v){return v.length<5e3&&!o.test(v)?`"${v}"`:JSON.stringify(v)}d(a,"o"),$e(a,"n"),te(a,"strEscape"),n(a,"strEscape");function c(v,w){if(v.length>200||w)return v.sort(w);for(let g=1;g<v.length;g++){const E=v[g];let C=g;for(;C!==0&&v[C-1]>E;)v[C]=v[C-1],C--;v[C]=E}return v}d(c,"u"),$e(c,"g"),te(c,"sort"),n(c,"sort");const l=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function u(v){return l.call(v)!==void 0&&v.length!==0}d(u,"c"),$e(u,"c"),te(u,"isTypedArrayWithEntries"),n(u,"isTypedArrayWithEntries");function p(v,w,g){v.length<g&&(g=v.length);const E=w===","?"":" ";let C=`"0":${E}${v[0]}`;for(let A=1;A<g;A++)C+=`${w}"${A}":${E}${v[A]}`;return C}d(p,"d"),$e(p,"d"),te(p,"stringifyTypedArray"),n(p,"stringifyTypedArray");function f(v){if(s.call(v,"circularValue")){const w=v.circularValue;if(typeof w=="string")return`"${w}"`;if(w==null)return w;if(w===Error||w===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}d(f,"y"),$e(f,"b"),te(f,"getCircularValueOption"),n(f,"getCircularValueOption");function m(v){let w;if(s.call(v,"deterministic")&&(w=v.deterministic,typeof w!="boolean"&&typeof w!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return w===void 0?!0:w}d(m,"E"),$e(m,"A"),te(m,"getDeterministicOption"),n(m,"getDeterministicOption");function $(v,w){let g;if(s.call(v,w)&&(g=v[w],typeof g!="boolean"))throw new TypeError(`The "${w}" argument must be of type boolean`);return g===void 0?!0:g}d($,"V"),$e($,"q"),te($,"getBooleanOption"),n($,"getBooleanOption");function b(v,w){let g;if(s.call(v,w)){if(g=v[w],typeof g!="number")throw new TypeError(`The "${w}" argument must be of type number`);if(!Number.isInteger(g))throw new TypeError(`The "${w}" argument must be an integer`);if(g<1)throw new RangeError(`The "${w}" argument must be >= 1`)}return g===void 0?1/0:g}d(b,"J"),$e(b,"z"),te(b,"getPositiveIntegerOption"),n(b,"getPositiveIntegerOption");function k(v){return v===1?"1 item":`${v} items`}d(k,"R"),$e(k,"R"),te(k,"getItemCount"),n(k,"getItemCount");function S(v){const w=new Set;for(const g of v)(typeof g=="string"||typeof g=="number")&&w.add(String(g));return w}d(S,"q"),$e(S,"F"),te(S,"getUniqueReplacerSet"),n(S,"getUniqueReplacerSet");function y(v){if(s.call(v,"strict")){const w=v.strict;if(typeof w!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(w)return g=>{let E=`Object can not safely be stringified. Received type ${typeof g}`;throw typeof g!="function"&&(E+=` (${g.toString()})`),new Error(E)}}}d(y,"Q"),$e(y,"Y"),te(y,"getStrictOption"),n(y,"getStrictOption");function h(v){v={...v};const w=y(v);w&&(v.bigint===void 0&&(v.bigint=!1),"circularValue"in v||(v.circularValue=Error));const g=f(v),E=$(v,"bigint"),C=m(v),A=typeof C=="function"?C:void 0,O=b(v,"maximumDepth"),I=b(v,"maximumBreadth");function V(X,x,W,Z,z,J){let K=x[X];switch(typeof K=="object"&&K!==null&&typeof K.toJSON=="function"&&(K=K.toJSON(X)),K=Z.call(x,X,K),typeof K){case"string":return a(K);case"object":{if(K===null)return"null";if(W.indexOf(K)!==-1)return g;let ee="",De=",";const ve=J;if(Array.isArray(K)){if(K.length===0)return"[]";if(O<W.length+1)return'"[Array]"';W.push(K),z!==""&&(J+=z,ee+=`
|
|
1025
|
+
`);return r&&(o=o.replaceAll(T8,"")),o.split(`
|
|
1026
|
+
`).map(a=>{if(n&&a.trim()==="")return"";let c;switch(i){case Qi.BREAK_AT_CHARACTERS:{c=dN(a,s,n);break}case Qi.BREAK_WORDS:{c=hN(a,s,n);break}case Qi.STRICT_WIDTH:{c=dw(a,s,n);break}default:c=fN(a,s,n)}return uN(c)}).join(`
|
|
1027
|
+
`)},"wordWrap");var gN=Object.defineProperty,yn=Ce((e,t)=>gN(e,"name",{value:t,configurable:!0}),"n$2");const fw=80,hw=24,tp=yn((e,t,{shell:r,env:n}={})=>TR(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:r,env:n}).trim(),"exec"),Oa=yn((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),mw=yn((e,t)=>{const{columns:r,rows:n}=Oa(e,t);if(!(Number.isNaN(r)||Number.isNaN(n))&&!(r===fw&&n===hw))return{columns:r,rows:n}},"createIfNotDefault"),yN=yn(()=>{if(Rn.platform!=="linux")return!0;try{const e=Xi.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const r=e.slice(t+2).trim().split(/\s+/),n=Number.parseInt(r[2],10),s=Number.parseInt(r[5],10);return Number.isNaN(n)||Number.isNaN(s)||s<=0?!1:n===s}catch{return!1}},"isForegroundProcess");function el(){const{env:e,stdout:t,stderr:r}=Rn;if(t?.columns&&t?.rows)return Oa(t.columns,t.rows);if(r?.columns&&r?.rows)return Oa(r.columns,r.rows);if(e.COLUMNS&&e.LINES)return Oa(e.COLUMNS,e.LINES);const n={columns:fw,rows:hw};return Rn.platform==="win32"?Ql()??n:Rn.platform==="darwin"?Pm()??Ql()??n:Pm()??Ql()??vN()??n}d(el,"We$1");yr(el,"Oa");Ce(el,"O");yn(el,"terminalSize");const Pm=yn(()=>{try{const e=Rn.platform==="darwin"?Xi.constants.O_EVTONLY|Xi.constants.O_NONBLOCK:Xi.constants.O_NONBLOCK,{columns:t,rows:r}=NR.WriteStream(Xi.openSync("/dev/tty",e));return{columns:t,rows:r}}catch{}},"devTty"),Ql=yn(()=>{try{const e=tp("tput",["cols"],{env:{TERM:"dumb",...Rn.env}}),t=tp("tput",["lines"],{env:{TERM:"dumb",...Rn.env}});if(e&&t)return mw(e,t)}catch{}},"tput"),vN=yn(()=>{try{if(!yN())return;const e=tp("resize",["-u"]).match(/\d+/g);if(e.length===2)return mw(e[0],e[1])}catch{}},"resize");var bN=Object.defineProperty,$N=Ce((e,t)=>bN(e,"name",{value:t,configurable:!0}),"r$2");const wN=$N(e=>{const t=Object.keys(e).map(r=>e[r].badge??"");return t.length===0?"":t.reduce((r,n)=>r.length>n.length?r:n,"")},"getLongestBadge");var kN=Object.defineProperty,SN=Ce((e,t)=>kN(e,"name",{value:t,configurable:!0}),"r$1");const{bold:DN,cyan:CN,green:Fm,grey:EN,magenta:jN,red:AN,yellow:Zl}=dc,xN={indent:2,quoteStyle:"single",stylize:SN((e,t)=>{const r={bigint:Zl,boolean:Zl,date:jN,null:DN,number:Zl,regexp:AN,special:CN,string:Fm,symbol:Fm,undefined:EN};return Object.hasOwn(r,t)?r[t](e):e},"stylize")};var ON=Object.defineProperty,PN=Ce((e,t)=>ON(e,"name",{value:t,configurable:!0}),"o$1");const{bold:FN,underline:BN}=dc,RN=PN((e,t)=>{let r=t.uppercase.label?e.toUpperCase():e;return r=t.underline.label?BN(r):r,t.bold.label&&(r=FN(r)),r},"formatLabel");var TN=Object.defineProperty,gw=Ce((e,t)=>TN(e,"name",{value:t,configurable:!0}),"o");const NN=gw(e=>[e.getHours(),e.getMinutes(),e.getSeconds()].map(t=>String(t).padStart(2,"0")).join(":"),"dateFormatter");class IN{static{d(this,"Za")}static{yr(this,"Xa")}static{Ce(this,"AbstractPrettyReporter")}static{gw(this,"AbstractPrettyReporter")}styles;loggerTypes;constructor(t){this.styles={bold:{label:!1},dateFormatter:NN,underline:{label:!1,message:!1,prefix:!1,suffix:!1},uppercase:{label:!1},...t},this.loggerTypes=x$}setLoggerTypes(t){this.loggerTypes=t}}var LN=Object.defineProperty,$e=d((e,t)=>LN(e,"name",{value:t,configurable:!0}),"k$h"),_N=Object.defineProperty,te=$e((e,t)=>_N(e,"name",{value:t,configurable:!0}),"p");mt(import.meta.url);const MN=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{stdout:df,stderr:ff,env:co}=MN,WN="\x1B",xe="\x1B[",yw=";";var VN=Object.defineProperty,UN=te((e,t)=>VN(e,"name",{value:t,configurable:!0}),"t$3"),GN=Object.defineProperty,qN=UN((e,t)=>GN(e,"name",{value:t,configurable:!0}),"t");const HN=typeof globalThis<"u"&&typeof globalThis.window=="object"&&globalThis.window.document!==void 0,zN=/^(?:msys|cygwin)$/,JN=!HN&&(process.platform==="win32"||zN.test(process.env.OSTYPE));var KN=Object.defineProperty,ut=qN((e,t)=>KN(e,"name",{value:t,configurable:!0}),"n");const YN=ut((e=1)=>`${xe}${String(e)}D`,"cursorBackward");ut((e=1)=>`${xe}${String(e)}B`,"cursorDown");ut((e=1)=>`${xe}${String(e)}C`,"cursorForward");const XN=`${xe}G`;ut((e=1)=>YN(e),"cursorLeft");const QN=ut((e=1)=>`${xe}${String(e)}G`,"cursorHorizontalAbsolute");ut((e,t)=>{let r="";return e<0?r+=`${xe}${String(-e)}D`:e>0&&(r+=`${xe}${String(e)}C`),t<0?r+=`${xe}${String(-t)}A`:t>0&&(r+=`${xe}${String(t)}B`),r},"cursorMove");ut((e=1)=>`${xe}${String(e)}E`,"cursorNextLine");ut((e=1)=>`${xe}${String(e)}F`,"cursorPreviousLine");const ZN=ut((e,t)=>t===void 0?QN(e+1):`${xe}${String(t+1)}${yw}${String(e+1)}H`,"cursorTo");ut((e,t)=>t===void 0?`${xe}${String(e)}H`:`${xe}${String(e)}${yw}${String(t)}H`,"cursorPosition");ut((e=1)=>`${xe}${String(e)}I`,"cursorHorizontalForwardTab");ut((e=1)=>`${xe}${String(e)}Z`,"cursorBackwardTab");ut((e=1)=>`${xe}${String(e)}X`,"eraseCharacter");ut((e=1)=>`${xe}${String(e)}d`,"cursorVerticalAbsolute");const eI=ut((e=1)=>`${xe}${String(e)}A`,"cursorUp");var tI=(e=>(e[e.Default=0]="Default",e[e.BlinkingBlock=1]="BlinkingBlock",e[e.SteadyBlock=2]="SteadyBlock",e[e.BlinkingUnderline=3]="BlinkingUnderline",e[e.SteadyUnderline=4]="SteadyUnderline",e[e.BlinkingBar=5]="BlinkingBar",e[e.SteadyBar=6]="SteadyBar",e))(tI||{});ut(e=>`${xe}${String(e)} q`,"setCursorStyle");var rI=Object.defineProperty,nI=te((e,t)=>rI(e,"name",{value:t,configurable:!0}),"o$3"),sI=Object.defineProperty,iI=nI((e,t)=>sI(e,"name",{value:t,configurable:!0}),"s"),oI=Object.defineProperty,hf=iI((e,t)=>oI(e,"name",{value:t,configurable:!0}),"o"),xs=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireScreen=2]="EntireScreen",e[e.EntireScreenAndScrollback=3]="EntireScreenAndScrollback",e))(xs||{});const Br=hf(e=>{const t=e>=0&&e<=3?e:0;return`${xe}${t===0?"":String(t)}J`},"eraseDisplay");var vw=(e=>(e[e.ToEnd=0]="ToEnd",e[e.ToBeginning=1]="ToBeginning",e[e.EntireLine=2]="EntireLine",e))(vw||{});const tl=hf(e=>{const t=e>=0&&e<=2?e:0;return`${xe}${t===0?"":String(t)}K`},"eraseInLine");Br(0);const aI=tl(2);tl(0);tl(1);hf(e=>{if(e<=0)return"";let t="";for(let r=0;r<e;r+=1)t+=aI,r<e-1&&(t+=eI());return t+=XN,t},"eraseLines");Br(2);Br(1);Br(3);ZN(0,0)+Br(xs.ToEnd);`${tl(vw.EntireLine)}${xe}`;`${xe}${Br(xs.EntireScreen)}`;const Bm=JN?`${Br(xs.EntireScreen)}${xe}0f`:`${Br(xs.EntireScreen)}${Br(xs.EntireScreenAndScrollback)}${xe}H${WN}c`;var cI=Object.defineProperty,Ws=te((e,t)=>cI(e,"name",{value:t,configurable:!0}),"t$2");function rl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}d(rl,"ke$2");$e(rl,"Ie");te(rl,"getDefaultExportFromCjs");Ws(rl,"getDefaultExportFromCjs");function mf(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}d(mf,"qe$1");$e(mf,"Tt");te(mf,"getDefaultExportFromNamespaceIfPresent");Ws(mf,"getDefaultExportFromNamespaceIfPresent");function gf(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}d(gf,"Ve$1");$e(gf,"kt");te(gf,"getDefaultExportFromNamespaceIfNotNamed");Ws(gf,"getDefaultExportFromNamespaceIfNotNamed");function yf(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=Ws(te($e(d(function n(){var s=!1;try{s=this instanceof n}catch{}return s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)},"s"),"s"),"a"),"a");r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:Ws(function(){return e[n]},"get")})}),r}d(yf,"Je");$e(yf,"Mt");te(yf,"getAugmentedNamespace");Ws(yf,"getAugmentedNamespace");var eu={exports:{}},Rm;function vf(){return Rm||(Rm=1,(function(e,t){var r=Object.defineProperty,n=te((v,w)=>r(v,"name",{value:w,configurable:!0}),"$");const{hasOwnProperty:s}=Object.prototype,i=h();i.configure=h,i.stringify=i,i.default=i,t.stringify=i,t.configure=h,e.exports=i;const o=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function a(v){return v.length<5e3&&!o.test(v)?`"${v}"`:JSON.stringify(v)}d(a,"o"),$e(a,"n"),te(a,"strEscape"),n(a,"strEscape");function c(v,w){if(v.length>200||w)return v.sort(w);for(let g=1;g<v.length;g++){const E=v[g];let C=g;for(;C!==0&&v[C-1]>E;)v[C]=v[C-1],C--;v[C]=E}return v}d(c,"u"),$e(c,"g"),te(c,"sort"),n(c,"sort");const l=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function u(v){return l.call(v)!==void 0&&v.length!==0}d(u,"c"),$e(u,"c"),te(u,"isTypedArrayWithEntries"),n(u,"isTypedArrayWithEntries");function p(v,w,g){v.length<g&&(g=v.length);const E=w===","?"":" ";let C=`"0":${E}${v[0]}`;for(let A=1;A<g;A++)C+=`${w}"${A}":${E}${v[A]}`;return C}d(p,"d"),$e(p,"d"),te(p,"stringifyTypedArray"),n(p,"stringifyTypedArray");function f(v){if(s.call(v,"circularValue")){const w=v.circularValue;if(typeof w=="string")return`"${w}"`;if(w==null)return w;if(w===Error||w===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}d(f,"y"),$e(f,"b"),te(f,"getCircularValueOption"),n(f,"getCircularValueOption");function m(v){let w;if(s.call(v,"deterministic")&&(w=v.deterministic,typeof w!="boolean"&&typeof w!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return w===void 0?!0:w}d(m,"E"),$e(m,"A"),te(m,"getDeterministicOption"),n(m,"getDeterministicOption");function $(v,w){let g;if(s.call(v,w)&&(g=v[w],typeof g!="boolean"))throw new TypeError(`The "${w}" argument must be of type boolean`);return g===void 0?!0:g}d($,"V"),$e($,"q"),te($,"getBooleanOption"),n($,"getBooleanOption");function b(v,w){let g;if(s.call(v,w)){if(g=v[w],typeof g!="number")throw new TypeError(`The "${w}" argument must be of type number`);if(!Number.isInteger(g))throw new TypeError(`The "${w}" argument must be an integer`);if(g<1)throw new RangeError(`The "${w}" argument must be >= 1`)}return g===void 0?1/0:g}d(b,"J"),$e(b,"z"),te(b,"getPositiveIntegerOption"),n(b,"getPositiveIntegerOption");function k(v){return v===1?"1 item":`${v} items`}d(k,"R"),$e(k,"R"),te(k,"getItemCount"),n(k,"getItemCount");function S(v){const w=new Set;for(const g of v)(typeof g=="string"||typeof g=="number")&&w.add(String(g));return w}d(S,"q"),$e(S,"F"),te(S,"getUniqueReplacerSet"),n(S,"getUniqueReplacerSet");function y(v){if(s.call(v,"strict")){const w=v.strict;if(typeof w!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(w)return g=>{let E=`Object can not safely be stringified. Received type ${typeof g}`;throw typeof g!="function"&&(E+=` (${g.toString()})`),new Error(E)}}}d(y,"Q"),$e(y,"Y"),te(y,"getStrictOption"),n(y,"getStrictOption");function h(v){v={...v};const w=y(v);w&&(v.bigint===void 0&&(v.bigint=!1),"circularValue"in v||(v.circularValue=Error));const g=f(v),E=$(v,"bigint"),C=m(v),A=typeof C=="function"?C:void 0,O=b(v,"maximumDepth"),I=b(v,"maximumBreadth");function V(X,x,W,Z,z,J){let K=x[X];switch(typeof K=="object"&&K!==null&&typeof K.toJSON=="function"&&(K=K.toJSON(X)),K=Z.call(x,X,K),typeof K){case"string":return a(K);case"object":{if(K===null)return"null";if(W.indexOf(K)!==-1)return g;let ee="",De=",";const ve=J;if(Array.isArray(K)){if(K.length===0)return"[]";if(O<W.length+1)return'"[Array]"';W.push(K),z!==""&&(J+=z,ee+=`
|
|
1028
1028
|
${J}`,De=`,
|
|
1029
1029
|
${J}`);const be=Math.min(K.length,I);let it=0;for(;it<be-1;it++){const Wr=V(String(it),K,W,Z,z,J);ee+=Wr!==void 0?Wr:"null",ee+=De}const St=V(String(it),K,W,Z,z,J);if(ee+=St!==void 0?St:"null",K.length-1>I){const Wr=K.length-I-1;ee+=`${De}"... ${k(Wr)} not stringified"`}return z!==""&&(ee+=`
|
|
1030
1030
|
${ve}`),W.pop(),`[${ee}]`}let R=Object.keys(K);const F=R.length;if(F===0)return"{}";if(O<W.length+1)return'"[Object]"';let N="",Q="";z!==""&&(J+=z,De=`,
|
|
@@ -1042,10 +1042,10 @@ ${z}`,oe=Math.min(x.length,I);let be=0;for(;be<oe-1;be++){const St=Y(String(be),
|
|
|
1042
1042
|
${J}`,W.pop(),`[${N}]`}let K=Object.keys(x);const ee=K.length;if(ee===0)return"{}";if(O<W.length+1)return'"[Object]"';z+=Z;const De=`,
|
|
1043
1043
|
${z}`;let ve="",R="",F=Math.min(ee,I);u(x)&&(ve+=p(x,De,I),K=K.slice(x.length),F-=x.length,R=De),C&&(K=c(K,A)),W.push(x);for(let N=0;N<F;N++){const Q=K[N],oe=Y(Q,x[Q],W,Z,z);oe!==void 0&&(ve+=`${R}${a(Q)}: ${oe}`,R=De)}if(ee>I){const N=ee-I;ve+=`${R}"...": "${k(N)} not stringified"`,R=De}return R!==""&&(ve=`
|
|
1044
1044
|
${z}${ve}
|
|
1045
|
-
${J}`),W.pop(),`{${ve}}`}case"number":return isFinite(x)?String(x):w?w(x):"null";case"boolean":return x===!0?"true":"false";case"undefined":return;case"bigint":if(E)return String(x);default:return w?w(x):void 0}}d(Y,"X"),$e(Y,"K"),te(Y,"V"),n(Y,"stringifyIndent");function U(X,x,W){switch(typeof x){case"string":return a(x);case"object":{if(x===null)return"null";if(typeof x.toJSON=="function"){if(x=x.toJSON(X),typeof x!="object")return U(X,x,W);if(x===null)return"null"}if(W.indexOf(x)!==-1)return g;let Z="";const z=x.length!==void 0;if(z&&Array.isArray(x)){if(x.length===0)return"[]";if(O<W.length+1)return'"[Array]"';W.push(x);const ve=Math.min(x.length,I);let R=0;for(;R<ve-1;R++){const N=U(String(R),x[R],W);Z+=N!==void 0?N:"null",Z+=","}const F=U(String(R),x[R],W);if(Z+=F!==void 0?F:"null",x.length-1>I){const N=x.length-I-1;Z+=`,"... ${k(N)} not stringified"`}return W.pop(),`[${Z}]`}let J=Object.keys(x);const K=J.length;if(K===0)return"{}";if(O<W.length+1)return'"[Object]"';let ee="",De=Math.min(K,I);z&&u(x)&&(Z+=p(x,",",I),J=J.slice(x.length),De-=x.length,ee=","),C&&(J=c(J,A)),W.push(x);for(let ve=0;ve<De;ve++){const R=J[ve],F=U(R,x[R],W);F!==void 0&&(Z+=`${ee}${a(R)}:${F}`,ee=",")}if(K>I){const ve=K-I;Z+=`${ee}"...":"${k(ve)} not stringified"`}return W.pop(),`{${Z}}`}case"number":return isFinite(x)?String(x):w?w(x):"null";case"boolean":return x===!0?"true":"false";case"undefined":return;case"bigint":if(E)return String(x);default:return w?w(x):void 0}}d(U,"Z"),$e(U,"X"),te(U,"N"),n(U,"stringifySimple");function M(X,x,W){if(arguments.length>1){let Z="";if(typeof W=="number"?Z=" ".repeat(Math.min(W,10)):typeof W=="string"&&(Z=W.slice(0,10)),x!=null){if(typeof x=="function")return V("",{"":X},[],x,Z,"");if(Array.isArray(x))return fe("",X,[],S(x),Z,"")}if(Z.length!==0)return Y("",X,[],Z,"")}return U("",X,[])}return d(M,"ue"),$e(M,"ke"),te(M,"M"),n(M,"stringify"),M}d(h,"K"),$e(h,"Q"),te(h,"configure"),n(h,"configure")})(eu,eu.exports)),eu.exports}d(vf,"We");$e(vf,"Ot");te(vf,"requireSafeStableStringify");var tI=vf();const rI=rl(tI),nI=rI.configure;var sI=Object.defineProperty,iI=te((e,t)=>sI(e,"name",{value:t,configurable:!0}),"o$1");const oI=iI(e=>{const t=console;return e==="error"?t.__error??console.error:e==="warn"?t.__warn??console.warn:e==="trace"?t.__trace??console.trace:t.__log??console.log},"writeConsoleLogBasedOnLevel");var aI=Object.defineProperty,cI=te((e,t)=>aI(e,"name",{value:t,configurable:!0}),"t");let lI=class{static{d(this,"Vt")}static{$e(this,"Ct")}static{te(this,"a")}static{cI(this,"RawReporter")}log(t){const{context:r=[],message:n,type:s}=t;oI(s.level)(n,...r)}};var uI=Object.defineProperty,pI=te((e,t)=>uI(e,"name",{value:t,configurable:!0}),"a");const rp=pI(e=>e===void 0?[]:Array.isArray(e)?e:[e],"arrayify");var dI=Object.defineProperty,fI=te((e,t)=>dI(e,"name",{value:t,configurable:!0}),"g$3");const np=fI((e,t)=>{const r={...e};return Object.keys(t).forEach(n=>{r[n]={...r[n],...t[n]}}),r},"mergeTypes");var hI=Object.defineProperty,sp=te((e,t)=>hI(e,"name",{value:t,configurable:!0}),"d");const mI=sp(e=>{let t=!1;return function(...r){if(!t){t=!0;try{const n=e.apply(this,r);return t=!1,n}catch(n){throw t=!1,n}}}},"preventLoop");let gI=class bw{static{d(this,"Te")}static{$e(this,"xe")}static{te(this,"PailBrowserImpl")}static{sp(this,"PailBrowserImpl")}timersMap;countMap;seqTimers;lastLog;logLevels;disabled;paused;messageQueue;scopeName;types;longestLabel;processors;generalLogLevel;reporters;throttle;throttleMin;stringify;groups;startTimerMessage;endTimerMessage;rawReporter;force={};constructor(t){this.throttle=t.throttle??1e3,this.throttleMin=t.throttleMin??5;const r=t.parentLongestLabel,n=t.parentTypes,s=t.parentStringify,i=t.parentLogLevels;this.stringify=s??nI({strict:!0}),this.startTimerMessage=t.messages?.timerStart??"Initialized timer...",this.endTimerMessage=t.messages?.timerEnd??"Timer run for:",n&&r?(this.types=n,this.longestLabel=r):(this.types=np(x$,t.types??{}),this.longestLabel=ec(this.types)),this.logLevels=i&&!t.logLevels?i:{...xR,...t.logLevels},this.generalLogLevel=this.#r(t.logLevel),this.reporters=new Set,this.processors=new Set,this.disabled=t.disabled??!1,this.paused=!1,this.messageQueue=[],this.scopeName=rp(t.scope).filter(Boolean),this.timersMap=new Map,this.countMap=new Map,this.groups=[],this.seqTimers=new Set,this.lastLog={},this.logger=mI(this.logger.bind(this)),this.#e(),Array.isArray(t.reporters)&&this.registerReporters(t.reporters),this.rawReporter=this.extendReporter(t.rawReporter??new lI),Array.isArray(t.processors)&&this.registerProcessors(t.processors)}#e(){for(const t in this.types)this[t]=this.logger.bind(this,t,!1,!1);for(const t in this.types)this.force[t]=this.logger.bind(this,t,!1,!0);this.raw=this.raw.bind(this)}wrapConsole(){for(const t in this.types)console[`__${t}`]||(console[`__${t}`]=console[t]),console[t]=this[t]}restoreConsole(){for(const t in this.types)console[`__${t}`]&&(console[t]=console[`__${t}`],delete console[`__${t}`])}wrapException(){process.on("uncaughtException",t=>{this.error(t)}),process.on("unhandledRejection",t=>{this.error(t)})}disable(){this.disabled=!0}enable(){this.disabled=!1}isEnabled(){return!this.disabled}pause(){this.paused=!0}resume(){this.paused=!1;const t=this.messageQueue.splice(0);for(let r=0;r<t.length;r+=1){const{messageObject:n,raw:s,type:i}=t[r];this.logger(i,s,!1,...n)}}scope(...t){if(t.length===0)throw new Error("No scope name was defined.");return this.scopeName=t.flat(),this}unscope(){this.scopeName=[]}child(t){const r=t?.types!==void 0,n=r?np(this.types,t.types):this.types,s=t?.reporters??[],i=s.length>0?[...this.reporters,...s]:[...this.reporters],o=t?.processors??[],a=o.length>0?[...this.processors,...o]:[...this.processors],c=t?.logLevels?{...this.logLevels,...t.logLevels}:this.logLevels;let l;if(t?.scope){const f=rp(t.scope).filter(Boolean);l=this.scopeName.length>0?[...this.scopeName,...f]:f}else l=this.scopeName.length>0?this.scopeName:[];const u=t?.messages?{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage,...t.messages}:{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage},p={disabled:t?.disabled??this.disabled,logLevel:t?.logLevel??this.generalLogLevel,logLevels:c,messages:u,processors:a,rawReporter:t?.rawReporter??this.rawReporter,reporters:i,scope:l,throttle:t?.throttle??this.throttle,throttleMin:t?.throttleMin??this.throttleMin};return r?(p.parentTypes=n,p.parentLongestLabel=ec(n)):(p.parentTypes=this.types,p.parentLongestLabel=this.longestLabel),t?.logLevels||(p.parentLogLevels=this.logLevels),t?.messages||(p.parentMessages={timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage}),p.parentStringify=this.stringify,new bw(p)}time(t="default"){this.seqTimers.has(t)?this.logger("warn",!1,!1,{message:`Timer '${t}' already exists`,prefix:t}):(this.seqTimers.add(t),this.timersMap.set(t,Date.now()),this.logger("start",!1,!1,{message:this.startTimerMessage,prefix:t}))}timeLog(t,...r){if(!t&&this.seqTimers.size>0&&(t=[...this.seqTimers].pop()),t&&this.timersMap.has(t)){const n=Date.now()-this.timersMap.get(t);this.logger("info",!1,!1,{context:r,message:n<1e3?`${String(n)} ms`:`${(n/1e3).toFixed(2)} s`,prefix:t})}else this.logger("warn",!1,!1,{context:r,message:"Timer not found",prefix:t})}timeEnd(t){if(!t&&this.seqTimers.size>0&&(t=[...this.seqTimers].pop()),t&&this.timersMap.has(t)){const r=Date.now()-this.timersMap.get(t);this.timersMap.delete(t),this.logger("stop",!1,!1,{message:`${this.endTimerMessage} ${r<1e3?`${String(r)} ms`:`${(r/1e3).toFixed(2)} s`}`,prefix:t})}else this.logger("warn",!1,!1,{message:"Timer not found",prefix:t})}group(t="console.group"){globalThis.window===void 0?this.groups.push(t):console.group(t)}groupEnd(){globalThis.window===void 0?this.groups.pop():console.groupEnd()}count(t="default"){const r=this.countMap.get(t)??0;this.countMap.set(t,r+1),this.logger("log",!1,!1,{message:`${t}: ${String(r+1)}`,prefix:t})}countReset(t="default"){this.countMap.has(t)?this.countMap.delete(t):this.logger("warn",!1,!1,{message:`Count for ${t} does not exist`,prefix:t})}clear(){console.clear()}raw(t,...r){this.disabled||this.logger("log",!0,!1,{context:r,message:t})}extendReporter(t){return typeof t.setLoggerTypes=="function"&&t.setLoggerTypes(this.types),typeof t.setStringify=="function"&&t.setStringify(this.stringify),t}registerReporters(t){for(let r=0;r<t.length;r+=1)this.reporters.add(this.extendReporter(t[r]))}registerProcessors(t){for(let r=0;r<t.length;r+=1){const n=t[r];typeof n.setStringify=="function"&&n.setStringify(this.stringify),this.processors.add(n)}}#t(t,r){if(r)this.rawReporter.log(Object.freeze(t));else for(const n of this.reporters)n.log(Object.freeze(t))}#r(t){return t&&this.logLevels[t]?t:"debug"}#i(t,r,...n){const s={badge:void 0,context:void 0,error:void 0,label:void 0,message:sf,prefix:void 0,repeated:void 0,scope:void 0,suffix:void 0};if(s.type={level:r.logLevel,name:t},s.groups=this.groups,s.scope=this.scopeName,s.date=new Date,n.length>0&&n[0]instanceof Error)s.error=n[0],n.length>1&&(s.context=n.slice(1));else if(n.length>0&&typeof n[0]=="object"&&n[0]!==null&&"message"in n[0]){const{context:i,message:o,prefix:a,suffix:c}=n[0];if(i&&(s.context=i),a&&(s.prefix=a),c&&(s.suffix=c),s.message=o,n.length>1){const l=n.slice(1);s.context?s.context=Array.isArray(s.context)?[...s.context,...l]:[s.context,...l]:s.context=l}}else n.length>1?(s.message=n[0],s.context=n.slice(1)):n.length===1?s.message=n[0]:s.message=void 0;return r.logLevel==="trace"&&(s.traceError=new Error("Trace")),r.badge&&(s.badge=r.badge),r.label&&(s.label=r.label),s}logger(t,r,n,...s){if(this.disabled)return;if(this.paused){this.messageQueue.push({messageObject:s,raw:r,type:t});return}const i=this.types[t],o=this.#r(i.logLevel);if(n||this.logLevels[o]>=this.logLevels[this.generalLogLevel]){let a=this.#i(t,i,...s);const c=sp((u=!1)=>{const p=(this.lastLog.count??0)-this.throttleMin;if(this.lastLog.object&&p>0){const f={...this.lastLog.object};p>1&&(f.repeated=p),this.#t(f,r),this.lastLog.count=1}if(u){for(const f of this.processors)a={...f.process(a)};this.lastLog.object=a,this.#t(a,r)}},"resolveLog");clearTimeout(this.lastLog.timeout);const l=this.lastLog.time&&a.date?new Date(a.date).getTime()-this.lastLog.time.getTime():0;if(this.lastLog.time=new Date(a.date),l<this.throttle)try{if(this.lastLog.object&&JSON.stringify([a.label,a.scope,a.type,a.message,a.prefix,a.suffix,a.context])===JSON.stringify([this.lastLog.object.label,this.lastLog.object.scope,this.lastLog.object.type,this.lastLog.object.message,this.lastLog.object.prefix,this.lastLog.object.suffix,this.lastLog.object.context])&&(this.lastLog.count=(this.lastLog.count??0)+1,this.lastLog.count>this.throttleMin)){this.lastLog.timeout=setTimeout(c,this.throttle);return}}catch{}c(!0)}}};var yI=Object.defineProperty,vI=te((e,t)=>yI(e,"name",{value:t,configurable:!0}),"c$1");let bI=class{static{d(this,"Kt")}static{$e(this,"Ht")}static{te(this,"v")}static{vI(this,"RawReporter")}#e;#t;#r;#i=!1;#n;constructor(e={}){this.#e=df,this.#t=ff,this.#n=e}setStdout(e){this.#e=e}setStderr(e){this.#t=e}setInteractiveManager(e){this.#r=e}setIsInteractive(e){this.#i=e}log(e){const{context:t,groups:r,message:n,type:s}=e,i=[];if(n!==sf){const l=typeof n=="string"?n:rc(n,this.#n);i.push(l)}t&&i.push(...t.map(l=>typeof l=="object"?` ${rc(l,this.#n)}`:` ${String(l)}`));const o=["error","trace","warn"].includes(s.level)?"stderr":"stdout",a=o==="stderr"?this.#t:this.#e,c=r.map(()=>" ").join("");this.#i&&this.#r!==void 0&&a.isTTY?this.#r.update(o,(c+i.join("")).split(`
|
|
1046
|
-
`),0):W$(c+i.join(""),a)}};var $I=Object.defineProperty,wI=te((e,t)=>$I(e,"name",{value:t,configurable:!0}),"m$1");let kI=class $w extends gI{static{d(this,"Me")}static{$e(this,"Le")}static{te(this,"c")}constructor(t){const r=t.parentStderr,n=t.parentStdout,{interactive:s,processors:i,rawReporter:o,reporters:a,stderr:c,stdout:l}=t,u=r??c,p=n??l,f=t.parentLongestLabel,m=t.parentTypes,{parentLogLevels:$,parentMessages:b,parentStringify:k}=t,S={disabled:t.disabled,logLevel:t.logLevel,logLevels:t.logLevels,messages:t.messages,processors:[],rawReporter:t.rawReporter,reporters:[],scope:t.scope,throttle:t.throttle,throttleMin:t.throttleMin},y="types"in t;m&&f&&!y?(S.parentTypes=m,S.parentLongestLabel=f):y&&t.types!==void 0&&(S.types=t.types),k&&(S.parentStringify=k),$&&!t.logLevels&&(S.parentLogLevels=$),b&&!t.messages&&(S.parentMessages=b),super(S),this.options=t,this.interactive=s??!1,this.stdout=p,this.stderr=u,this.interactive&&(this.interactiveManager=new rR(new mm(this.stdout),new mm(this.stderr))),Array.isArray(a)&&this.registerReporters(a),this.rawReporter=this.extendReporter(o??new bI),Array.isArray(i)&&this.registerProcessors(i)}options;static{wI(this,"PailServerImpl")}stdout;stderr;interactiveManager;interactive;scope(...t){if(t.length===0)throw new Error("No scope name was defined.");return this.scopeName=t.flat(),this}child(t){const r=t?.types!==void 0,n=r?np(this.types,t.types):this.types,s=t?.reporters??[],i=s.length>0?[...this.reporters,...s]:[...this.reporters],o=t?.processors??[],a=o.length>0?[...this.processors,...o]:[...this.processors],c=t?.logLevels?{...this.logLevels,...t.logLevels}:this.logLevels;let l;if(t?.scope){const f=rp(t.scope).filter(Boolean);l=this.scopeName.length>0?[...this.scopeName,...f]:f}else l=this.scopeName.length>0?this.scopeName:[];const u=t?.messages?{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage,...t.messages}:{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage},p={disabled:t?.disabled??this.disabled,interactive:t?.interactive??this.interactive,logLevel:t?.logLevel??this.generalLogLevel,logLevels:c,messages:u,processors:a,rawReporter:t?.rawReporter??this.rawReporter,reporters:i,scope:l,stderr:t?.stderr??this.stderr,stdout:t?.stdout??this.stdout,throttle:t?.throttle??this.throttle,throttleMin:t?.throttleMin??this.throttleMin};return this.#e(p,t,r,n),new $w(p)}#e(t,r,n,s){n?(t.parentTypes=s,t.parentLongestLabel=ec(s)):(t.parentTypes=this.types,t.parentLongestLabel=this.longestLabel),r?.logLevels||(t.parentLogLevels=this.logLevels),r?.messages||(t.parentMessages={timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage}),t.parentStringify=this.stringify,r?.stdout||(t.parentStdout=this.stdout),r?.stderr||(t.parentStderr=this.stderr)}getInteractiveManager(){return this.interactiveManager}wrapStd(){this.#t(this.stdout,"log"),this.#t(this.stderr,"log")}restoreStd(){this.#r(this.stdout),this.#r(this.stderr)}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}clear(){this.stdout.write(Bm),this.stderr.write(Bm)}extendReporter(t){return typeof t.setStdout=="function"&&t.setStdout(this.stdout),typeof t.setStderr=="function"&&t.setStderr(this.stderr),typeof t.setLoggerTypes=="function"&&t.setLoggerTypes(this.types),typeof t.setStringify=="function"&&t.setStringify(this.stringify),typeof t.setIsInteractive=="function"&&t.setIsInteractive(this.interactive),this.interactive&&typeof t.setInteractiveManager=="function"&&t.setInteractiveManager(this.interactiveManager),t}#t(t,r){t&&(t.__write||(t.__write=t.write),t.write=n=>{this[r](String(n).trim())})}#r(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}};const SI=kI;var DI=Object.defineProperty,CI=te((e,t)=>DI(e,"name",{value:t,configurable:!0}),"x"),EI=Object.defineProperty,ww=CI((e,t)=>EI(e,"name",{value:t,configurable:!0}),"h"),jI=Object.defineProperty,Ko=ww((e,t)=>jI(e,"name",{value:t,configurable:!0}),"g$1");const Tm=new Map([["aliceblue","#f0f8ff"],["antiquewhite","#faebd7"],["aqua","#00ffff"],["aquamarine","#7fffd4"],["azure","#f0ffff"],["beige","#f5f5dc"],["bisque","#ffe4c4"],["black","#000000"],["blanchedalmond","#ffebcd"],["blue","#0000ff"],["blueviolet","#8a2be2"],["brown","#a52a2a"],["burlywood","#deb887"],["cadetblue","#5f9ea0"],["chartreuse","#7fff00"],["chocolate","#d2691e"],["coral","#ff7f50"],["cornflowerblue","#6495ed"],["cornsilk","#fff8dc"],["crimson","#dc143c"],["cyan","#00ffff"],["darkblue","#00008b"],["darkcyan","#008b8b"],["darkgoldenrod","#b8860b"],["darkgray","#a9a9a9"],["darkgreen","#006400"],["darkgrey","#a9a9a9"],["darkkhaki","#bdb76b"],["darkmagenta","#8b008b"],["darkolivegreen","#556b2f"],["darkorange","#ff8c00"],["darkorchid","#9932cc"],["darkred","#8b0000"],["darksalmon","#e9967a"],["darkseagreen","#8fbc8f"],["darkslateblue","#483d8b"],["darkslategray","#2f4f4f"],["darkslategrey","#2f4f4f"],["darkturquoise","#00ced1"],["darkviolet","#9400d3"],["deeppink","#ff1493"],["deepskyblue","#00bfff"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1e90ff"],["firebrick","#b22222"],["floralwhite","#fffaf0"],["forestgreen","#228b22"],["fuchsia","#ff00ff"],["gainsboro","#dcdcdc"],["ghostwhite","#f8f8ff"],["gold","#ffd700"],["goldenrod","#daa520"],["gray","#808080"],["green","#008000"],["greenyellow","#adff2f"],["grey","#808080"],["honeydew","#f0fff0"],["hotpink","#ff69b4"],["indianred","#cd5c5c"],["indigo","#4b0082"],["ivory","#fffff0"],["khaki","#f0e68c"],["lavender","#e6e6fa"],["lavenderblush","#fff0f5"],["lawngreen","#7cfc00"],["lemonchiffon","#fffacd"],["lightblue","#add8e6"],["lightcoral","#f08080"],["lightcyan","#e0ffff"],["lightgoldenrodyellow","#fafad2"],["lightgray","#d3d3d3"],["lightgreen","#90ee90"],["lightgrey","#d3d3d3"],["lightpink","#ffb6c1"],["lightsalmon","#ffa07a"],["lightseagreen","#20b2aa"],["lightskyblue","#87cefa"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#b0c4de"],["lightyellow","#ffffe0"],["lime","#00ff00"],["limegreen","#32cd32"],["linen","#faf0e6"],["magenta","#ff00ff"],["maroon","#800000"],["mediumaquamarine","#66cdaa"],["mediumblue","#0000cd"],["mediumorchid","#ba55d3"],["mediumpurple","#9370db"],["mediumseagreen","#3cb371"],["mediumslateblue","#7b68ee"],["mediumspringgreen","#00fa9a"],["mediumturquoise","#48d1cc"],["mediumvioletred","#c71585"],["midnightblue","#191970"],["mintcream","#f5fffa"],["mistyrose","#ffe4e1"],["moccasin","#ffe4b5"],["navajowhite","#ffdead"],["navy","#000080"],["oldlace","#fdf5e6"],["olive","#808000"],["olivedrab","#6b8e23"],["orange","#ffa500"],["orangered","#ff4500"],["orchid","#da70d6"],["palegoldenrod","#eee8aa"],["palegreen","#98fb98"],["paleturquoise","#afeeee"],["palevioletred","#db7093"],["papayawhip","#ffefd5"],["peachpuff","#ffdab9"],["peru","#cd853f"],["pink","#ffc0cb"],["plum","#dda0dd"],["powderblue","#b0e0e6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#ff0000"],["rosybrown","#bc8f8f"],["royalblue","#4169e1"],["saddlebrown","#8b4513"],["salmon","#fa8072"],["sandybrown","#f4a460"],["seagreen","#2e8b57"],["seashell","#fff5ee"],["sienna","#a0522d"],["silver","#c0c0c0"],["skyblue","#87ceeb"],["slateblue","#6a5acd"],["slategray","#708090"],["slategrey","#708090"],["snow","#fffafa"],["springgreen","#00ff7f"],["steelblue","#4682b4"],["tan","#d2b48c"],["teal","#008080"],["thistle","#d8bfd8"],["tomato","#ff6347"],["turquoise","#40e0d0"],["violet","#ee82ee"],["wheat","#f5deb3"],["white","#ffffff"],["whitesmoke","#f5f5f5"],["yellow","#ffff00"],["yellowgreen","#9acd32"]]),AI=/^#([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})?$/i,xI=/^#([\dA-F])([\dA-F])([\dA-F])([\dA-F])?$/i,OI=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,PI=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,kw=Ko(()=>({__proto__:null,backgroundColor:null,color:null,fontStyle:null,fontWeight:null,textDecorationColor:null,textDecorationLine:[]}),"getDefaultCss"),Nm=/\s+/,sc=Ko(e=>{Tm.has(e)&&(e=Tm.get(e));const t=AI.exec(e);if(t)return[Number.parseInt(t[1],16),Number.parseInt(t[2],16),Number.parseInt(t[3],16)];const r=xI.exec(e);if(r)return[Number.parseInt(`${r[1]}${r[1]}`,16),Number.parseInt(`${r[2]}${r[2]}`,16),Number.parseInt(`${r[3]}${r[3]}`,16)];const n=OI.exec(e);if(n)return[Math.round(Math.max(0,Math.min(255,Number(n[1])))),Math.round(Math.max(0,Math.min(255,Number(n[2])))),Math.round(Math.max(0,Math.min(255,Number(n[3]))))];const s=PI.exec(e);if(s){let i=Number(s[1])%360;i<0&&(i+=360);const o=Math.max(0,Math.min(100,Number(s[2])))/100,a=Math.max(0,Math.min(100,Number(s[3])))/100,c=(1-Math.abs(2*a-1))*o,l=c*(1-Math.abs(i/60%2-1)),u=a-c/2;let p,f,m;return i<60?{0:p,1:f,2:m}=[c,l,0]:i<120?{0:p,1:f,2:m}=[l,c,0]:i<180?{0:p,1:f,2:m}=[0,c,l]:i<240?{0:p,1:f,2:m}=[0,l,c]:i<300?{0:p,1:f,2:m}=[l,0,c]:{0:p,1:f,2:m}=[c,0,l],[Math.round((p+u)*255),Math.round((f+u)*255),Math.round((m+u)*255)]}return null},"parseCssColor"),tu=Ko((e,t)=>e?.[0]===t?.[0]&&e?.[1]===t?.[1]&&e?.[2]===t?.[2],"colorEquals"),FI=Ko(e=>{const t=kw(),r=[];let n=!1,s=null,i=0,o="";for(const a of e){if(a==="(")i+=1;else if(i>0)a===")"&&(i-=1);else if(n){if(a===";"){const c=o.trim();c!==""&&r.push([s,c]),s=null,o="",n=!1;continue}}else if(a===":"){s=o.trim(),o="",n=!0;continue}o+=a}if(n&&i===0){const a=o.trim();a!==""&&r.push([s,a]),s=null,o=""}for(const{0:a,1:c}of r)switch(a){case"background-color":{c!=null&&(t.backgroundColor=c);break}case"color":{c!=null&&(t.color=c);break}case"font-style":{["italic","oblique","oblique 14deg"].includes(c)&&(t.fontStyle="italic");break}case"font-weight":{c==="bold"&&(t.fontWeight=c);break}case"text-decoration":{t.textDecorationColor=null,t.textDecorationLine=[];const l=c.split(Nm);for(const u of l){const p=sc(u);p!=null?t.textDecorationColor=p:["line-through","overline","underline"].includes(u)&&t.textDecorationLine.push(u)}break}case"text-decoration-color":{const l=sc(c);l!=null&&(t.textDecorationColor=l);break}case"text-decoration-line":{t.textDecorationLine=[];const l=c.split(Nm);for(const u of l)["line-through","overline","underline"].includes(u)&&t.textDecorationLine.push(u);break}}return t},"parseCss"),BI=Ko((e,t)=>{t=t??kw();let r="";if(!tu(e.backgroundColor,t.backgroundColor))if(e.backgroundColor==null)r+="\x1B[49m";else switch(e.backgroundColor){case"black":{r+="\x1B[40m";break}case"blue":{r+="\x1B[44m";break}case"cyan":{r+="\x1B[46m";break}case"green":{r+="\x1B[42m";break}case"magenta":{r+="\x1B[45m";break}case"red":{r+="\x1B[41m";break}case"white":{r+="\x1B[47m";break}case"yellow":{r+="\x1B[43m";break}default:if(Array.isArray(e.backgroundColor)){const{0:n,1:s,2:i}=e.backgroundColor;r+=`\x1B[48;2;${String(n)};${String(s)};${String(i)}m`}else{const n=sc(e.backgroundColor);if(n===null)r+="\x1B[49m";else{const{0:s,1:i,2:o}=n;r+=`\x1B[48;2;${String(s)};${String(i)};${String(o)}m`}}}if(!tu(e.color,t.color))if(e.color==null)r+="\x1B[39m";else switch(e.color){case"black":{r+="\x1B[30m";break}case"blue":{r+="\x1B[34m";break}case"cyan":{r+="\x1B[36m";break}case"green":{r+="\x1B[32m";break}case"magenta":{r+="\x1B[35m";break}case"red":{r+="\x1B[31m";break}case"white":{r+="\x1B[37m";break}case"yellow":{r+="\x1B[33m";break}default:if(Array.isArray(e.color)){const{0:n,1:s,2:i}=e.color;r+=`\x1B[38;2;${String(n)};${String(s)};${String(i)}m`}else{const n=sc(e.color);if(n===null)r+="\x1B[39m";else{const{0:s,1:i,2:o}=n;r+=`\x1B[38;2;${String(s)};${String(i)};${String(o)}m`}}}if(e.fontWeight!==t.fontWeight&&(r+=e.fontWeight==="bold"?"\x1B[1m":"\x1B[22m"),e.fontStyle!==t.fontStyle&&(r+=e.fontStyle==="italic"?"\x1B[3m":"\x1B[23m"),!tu(e.textDecorationColor,t.textDecorationColor))if(e.textDecorationColor==null)r+="\x1B[59m";else{const{0:n,1:s,2:i}=e.textDecorationColor;r+=`\x1B[58;2;${String(n)};${String(s)};${String(i)}m`}return e.textDecorationLine.includes("line-through")!==t.textDecorationLine.includes("line-through")&&(r+=e.textDecorationLine.includes("line-through")?"\x1B[9m":"\x1B[29m"),e.textDecorationLine.includes("overline")!==t.textDecorationLine.includes("overline")&&(r+=e.textDecorationLine.includes("overline")?"\x1B[53m":"\x1B[55m"),e.textDecorationLine.includes("underline")!==t.textDecorationLine.includes("underline")&&(r+=e.textDecorationLine.includes("underline")?"\x1B[4m":"\x1B[24m"),r},"cssToAnsi");var RI=Object.defineProperty,bf=ww((e,t)=>RI(e,"name",{value:t,configurable:!0}),"y");const TI=bf(e=>{try{return JSON.stringify(e)}catch{return'"[Circular]"'}},"tryStringify"),Im="%".codePointAt(0),NI="s".codePointAt(0),II="d".codePointAt(0),LI="f".codePointAt(0),_I="i".codePointAt(0),MI="O".codePointAt(0),WI="o".codePointAt(0),VI="j".codePointAt(0),UI="c".codePointAt(0),GI=bf((e,t=[],r={})=>{if(typeof e!="string"&&typeof e!="object"||e===null)throw new TypeError(`fmt must be a string or object, got ${e===null?"null":typeof e}`);const n=r.stringify??TI,s=1;if(typeof e=="object"){const u=t.length+s;if(u===1)return"{}";const p=Array.from({length:u});p[0]=n(e);for(let f=1;f<u;f+=1)p[f]=n(t[f-s]);return p.join(" ")}if(t.length===0)return e;let i="",o=1-s,a=-1,c=!1,l;for(let u=0;u<e.length;){if(e.codePointAt(u)===Im&&u+1<e.length){a=a>-1?a:0;const p=e.codePointAt(u+1);if(p===void 0){o+=1;break}switch(p){case UI:{if(globalThis.window===void 0){const f=FI(t[o]);a<u&&(i+=e.slice(a,u)),i+=BI(f,l),i!==""&&(c=!0,l=f)}a=u+2,u+=1;break}case II:case LI:{if(o>=t.length||t[o]==null)break;a<u&&(i+=e.slice(a,u)),i+=Number(t[o]).toString(),a=u+2,u+=1;break}case _I:{if(o>=t.length||t[o]==null)break;a<u&&(i+=e.slice(a,u)),i+=Math.floor(Number(t[o])).toString(),a=u+2,u+=1;break}case VI:case MI:case WI:{if(o>=t.length||t[o]===void 0)break;a<u&&(i+=e.slice(a,u));const f=t[o],m=typeof f;if(m==="string"){i+=`'${f}'`,a=u+2;break}if(m==="function"){i+=f.name?`[Function: ${f.name}]`:"[Function: <anonymous>]",a=u+2;break}i+=n(f),a=u+2,u+=1;break}case Im:{a<u&&(i+=e.slice(a,u)),i+="%",a=u+2,u+=1,o-=1;break}case NI:{if(o>=t.length)break;a<u&&(i+=e.slice(a,u)),i+=typeof t[o]=="object"?n(t[o]):String(t[o]),a=u+2,u+=1;break}default:typeof r.formatters?.[p]=="function"&&(a<u&&(i+=e.slice(a,u)),i+=r.formatters[p](t[o]),a=u+2,u+=1)}o+=1}u+=1}return a===-1?e:(a<e.length&&(i+=e.slice(a)),c&&(i+="\x1B[0m"),i)},"format"),qI=bf((e={})=>{const t={};return typeof e.formatters=="object"&&Object.entries(e.formatters).forEach(([r,n])=>{if(r.length===0)throw new Error(`Formatter %${r} has no characters`);if(r.length>1)throw new Error(`Formatter %${r} has more than one character`);if(typeof n!="function")throw new TypeError(`Formatter for %${r} is not a function`);const s=r.codePointAt(0);if(s===void 0)throw new Error(`${r}.codePointAt(0) failed to return a value, please report this issue`);t[s]=n}),(r,n=[],s={})=>GI(r,n,{...s,formatters:t})},"build");var HI=Object.defineProperty,Lm=te((e,t)=>HI(e,"name",{value:t,configurable:!0}),"i$1");let zI=class{static{d(this,"xr")}static{$e(this,"$r")}static{te(this,"g")}static{Lm(this,"MessageFormatterProcessor")}#e;#t;constructor(e={}){this.#t=e.formatters}setStringify(e){this.#e=e}process(e){const t=qI({formatters:this.#t,stringify:Lm(r=>this.#e?this.#e(r):JSON.stringify(r),"stringify")});return e.message!==void 0&&(e.message=this.#r(t,e.message,e.context??[])),e}#r(e,t,r=[]){if(typeof t=="string")return e(t,r);if(typeof t=="object"&&t!==null){const n=t,s=Object.keys(n);for(let i=0;i<s.length;i+=1){const o=s[i],a=n[o];(typeof a=="string"||Array.isArray(a)||typeof a=="object")&&(n[o]=this.#r(e,a,r))}}return t}};var JI=Object.defineProperty,Sw=te((e,t)=>JI(e,"name",{value:t,configurable:!0}),"M");const{bgGrey:KI,cyan:YI,green:XI,greenBright:QI,grey:Mt,red:ru,underline:_m,white:ZI}=dc,eL=/[\\/]pail[\\/]dist/,nu=Sw(e=>!eL.test(e),"pailFileFilter");class tL extends xN{static{d(this,"Br")}static{$e(this,"Mr")}static{te(this,"PrettyReporter")}static{Sw(this,"PrettyReporter")}#e;#t;#r;#i=!1;#n;#o;constructor(t={}){const{error:r,inspect:n,...s}=t;super({uppercase:{label:!0,...s.uppercase},...s}),this.#n={...wN,...n},this.#o={...r,color:{fileLine:XI,hint:YI,marker:ru,message:ru,method:QI,title:ru}},this.#e=df,this.#t=ff}setStdout(t){this.#e=t}setStderr(t){this.#t=t}setInteractiveManager(t){this.#r=t}setIsInteractive(t){this.#i=t}log(t){this._log(this._formatMessage(t),t.type.level)}_formatMessage(t){const{columns:r}=el();let n=r;typeof this.styles.messageLength=="number"&&(n=this.styles.messageLength);const{badge:s,context:i,date:o,error:a,file:c,groups:l,label:u,message:p,prefix:f,repeated:m,scope:$,suffix:b,traceError:k,type:S}=t,{color:y}=this.loggerTypes[S.name],h=y?dc[y]:ZI,v=l.map(()=>" ").join(""),w=[];if(l.length>0&&w.push(`${v+Mt(`[${l.at(-1)??""}]`)} `),o&&w.push(`${Mt(this.styles.dateFormatter(typeof o=="string"?new Date(o):o))} `),s)w.push(h(s));else{const C=fN(this.loggerTypes);C.length>0&&w.push(`${Mt(".".repeat(C.length))} `)}const g=ec(this.loggerTypes);if(u){const C=Rt(g),A=Rt(u);w.push(`${h(EN(u,this.styles))} `,Mt(".".repeat(Math.max(0,C-A))))}else w.push(Mt(".".repeat(g.length+2)));m&&w.push(`${KI.white(`[${String(m)}x]`)} `),Array.isArray($)&&$.length>0&&w.push(` ${Mt(`[${$.join(" > ")}]`)} `),f&&w.push(`${Mt(`${Array.isArray($)&&$.length>0?". ":" "}[${this.styles.underline.prefix?_m(f):f}]`)} `);const E=Rt(w.join(" "));if(c){const C=(c.name??"")+(c.line?`:${String(c.line)}`:""),A=Rt(C);if(A+E+2>n)w.push(Mt(` ${C}`));else{const O=Math.max(0,n-E-A-2);w.push(Mt(`${".".repeat(O)} ${C}`))}}else w.push(Mt(".".repeat(Math.max(0,n-E-1))));if(w.length>0&&w.push(`
|
|
1045
|
+
${J}`),W.pop(),`{${ve}}`}case"number":return isFinite(x)?String(x):w?w(x):"null";case"boolean":return x===!0?"true":"false";case"undefined":return;case"bigint":if(E)return String(x);default:return w?w(x):void 0}}d(Y,"X"),$e(Y,"K"),te(Y,"V"),n(Y,"stringifyIndent");function U(X,x,W){switch(typeof x){case"string":return a(x);case"object":{if(x===null)return"null";if(typeof x.toJSON=="function"){if(x=x.toJSON(X),typeof x!="object")return U(X,x,W);if(x===null)return"null"}if(W.indexOf(x)!==-1)return g;let Z="";const z=x.length!==void 0;if(z&&Array.isArray(x)){if(x.length===0)return"[]";if(O<W.length+1)return'"[Array]"';W.push(x);const ve=Math.min(x.length,I);let R=0;for(;R<ve-1;R++){const N=U(String(R),x[R],W);Z+=N!==void 0?N:"null",Z+=","}const F=U(String(R),x[R],W);if(Z+=F!==void 0?F:"null",x.length-1>I){const N=x.length-I-1;Z+=`,"... ${k(N)} not stringified"`}return W.pop(),`[${Z}]`}let J=Object.keys(x);const K=J.length;if(K===0)return"{}";if(O<W.length+1)return'"[Object]"';let ee="",De=Math.min(K,I);z&&u(x)&&(Z+=p(x,",",I),J=J.slice(x.length),De-=x.length,ee=","),C&&(J=c(J,A)),W.push(x);for(let ve=0;ve<De;ve++){const R=J[ve],F=U(R,x[R],W);F!==void 0&&(Z+=`${ee}${a(R)}:${F}`,ee=",")}if(K>I){const ve=K-I;Z+=`${ee}"...":"${k(ve)} not stringified"`}return W.pop(),`{${Z}}`}case"number":return isFinite(x)?String(x):w?w(x):"null";case"boolean":return x===!0?"true":"false";case"undefined":return;case"bigint":if(E)return String(x);default:return w?w(x):void 0}}d(U,"Z"),$e(U,"X"),te(U,"N"),n(U,"stringifySimple");function M(X,x,W){if(arguments.length>1){let Z="";if(typeof W=="number"?Z=" ".repeat(Math.min(W,10)):typeof W=="string"&&(Z=W.slice(0,10)),x!=null){if(typeof x=="function")return V("",{"":X},[],x,Z,"");if(Array.isArray(x))return fe("",X,[],S(x),Z,"")}if(Z.length!==0)return Y("",X,[],Z,"")}return U("",X,[])}return d(M,"ue"),$e(M,"ke"),te(M,"M"),n(M,"stringify"),M}d(h,"K"),$e(h,"Q"),te(h,"configure"),n(h,"configure")})(eu,eu.exports)),eu.exports}d(vf,"We");$e(vf,"Ot");te(vf,"requireSafeStableStringify");var lI=vf();const uI=rl(lI),pI=uI.configure;var dI=Object.defineProperty,fI=te((e,t)=>dI(e,"name",{value:t,configurable:!0}),"o$1");const hI=fI(e=>{const t=console;return e==="error"?t.__error??console.error:e==="warn"?t.__warn??console.warn:e==="trace"?t.__trace??console.trace:t.__log??console.log},"writeConsoleLogBasedOnLevel");var mI=Object.defineProperty,gI=te((e,t)=>mI(e,"name",{value:t,configurable:!0}),"t");let yI=class{static{d(this,"Vt")}static{$e(this,"Ct")}static{te(this,"a")}static{gI(this,"RawReporter")}log(t){const{context:r=[],message:n,type:s}=t;hI(s.level)(n,...r)}};var vI=Object.defineProperty,bI=te((e,t)=>vI(e,"name",{value:t,configurable:!0}),"a");const rp=bI(e=>e===void 0?[]:Array.isArray(e)?e:[e],"arrayify");var $I=Object.defineProperty,wI=te((e,t)=>$I(e,"name",{value:t,configurable:!0}),"g$3");const np=wI((e,t)=>{const r={...e};return Object.keys(t).forEach(n=>{r[n]={...r[n],...t[n]}}),r},"mergeTypes");var kI=Object.defineProperty,sp=te((e,t)=>kI(e,"name",{value:t,configurable:!0}),"d");const SI=sp(e=>{let t=!1;return function(...r){if(!t){t=!0;try{const n=e.apply(this,r);return t=!1,n}catch(n){throw t=!1,n}}}},"preventLoop");let DI=class bw{static{d(this,"Te")}static{$e(this,"xe")}static{te(this,"PailBrowserImpl")}static{sp(this,"PailBrowserImpl")}timersMap;countMap;seqTimers;lastLog;logLevels;disabled;paused;messageQueue;scopeName;types;longestLabel;processors;generalLogLevel;reporters;throttle;throttleMin;stringify;groups;startTimerMessage;endTimerMessage;rawReporter;force={};constructor(t){this.throttle=t.throttle??1e3,this.throttleMin=t.throttleMin??5;const r=t.parentLongestLabel,n=t.parentTypes,s=t.parentStringify,i=t.parentLogLevels;this.stringify=s??pI({strict:!0}),this.startTimerMessage=t.messages?.timerStart??"Initialized timer...",this.endTimerMessage=t.messages?.timerEnd??"Timer run for:",n&&r?(this.types=n,this.longestLabel=r):(this.types=np(x$,t.types??{}),this.longestLabel=ec(this.types)),this.logLevels=i&&!t.logLevels?i:{...IR,...t.logLevels},this.generalLogLevel=this.#r(t.logLevel),this.reporters=new Set,this.processors=new Set,this.disabled=t.disabled??!1,this.paused=!1,this.messageQueue=[],this.scopeName=rp(t.scope).filter(Boolean),this.timersMap=new Map,this.countMap=new Map,this.groups=[],this.seqTimers=new Set,this.lastLog={},this.logger=SI(this.logger.bind(this)),this.#e(),Array.isArray(t.reporters)&&this.registerReporters(t.reporters),this.rawReporter=this.extendReporter(t.rawReporter??new yI),Array.isArray(t.processors)&&this.registerProcessors(t.processors)}#e(){for(const t in this.types)this[t]=this.logger.bind(this,t,!1,!1);for(const t in this.types)this.force[t]=this.logger.bind(this,t,!1,!0);this.raw=this.raw.bind(this)}wrapConsole(){for(const t in this.types)console[`__${t}`]||(console[`__${t}`]=console[t]),console[t]=this[t]}restoreConsole(){for(const t in this.types)console[`__${t}`]&&(console[t]=console[`__${t}`],delete console[`__${t}`])}wrapException(){process.on("uncaughtException",t=>{this.error(t)}),process.on("unhandledRejection",t=>{this.error(t)})}disable(){this.disabled=!0}enable(){this.disabled=!1}isEnabled(){return!this.disabled}pause(){this.paused=!0}resume(){this.paused=!1;const t=this.messageQueue.splice(0);for(let r=0;r<t.length;r+=1){const{messageObject:n,raw:s,type:i}=t[r];this.logger(i,s,!1,...n)}}scope(...t){if(t.length===0)throw new Error("No scope name was defined.");return this.scopeName=t.flat(),this}unscope(){this.scopeName=[]}child(t){const r=t?.types!==void 0,n=r?np(this.types,t.types):this.types,s=t?.reporters??[],i=s.length>0?[...this.reporters,...s]:[...this.reporters],o=t?.processors??[],a=o.length>0?[...this.processors,...o]:[...this.processors],c=t?.logLevels?{...this.logLevels,...t.logLevels}:this.logLevels;let l;if(t?.scope){const f=rp(t.scope).filter(Boolean);l=this.scopeName.length>0?[...this.scopeName,...f]:f}else l=this.scopeName.length>0?this.scopeName:[];const u=t?.messages?{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage,...t.messages}:{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage},p={disabled:t?.disabled??this.disabled,logLevel:t?.logLevel??this.generalLogLevel,logLevels:c,messages:u,processors:a,rawReporter:t?.rawReporter??this.rawReporter,reporters:i,scope:l,throttle:t?.throttle??this.throttle,throttleMin:t?.throttleMin??this.throttleMin};return r?(p.parentTypes=n,p.parentLongestLabel=ec(n)):(p.parentTypes=this.types,p.parentLongestLabel=this.longestLabel),t?.logLevels||(p.parentLogLevels=this.logLevels),t?.messages||(p.parentMessages={timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage}),p.parentStringify=this.stringify,new bw(p)}time(t="default"){this.seqTimers.has(t)?this.logger("warn",!1,!1,{message:`Timer '${t}' already exists`,prefix:t}):(this.seqTimers.add(t),this.timersMap.set(t,Date.now()),this.logger("start",!1,!1,{message:this.startTimerMessage,prefix:t}))}timeLog(t,...r){if(!t&&this.seqTimers.size>0&&(t=[...this.seqTimers].pop()),t&&this.timersMap.has(t)){const n=Date.now()-this.timersMap.get(t);this.logger("info",!1,!1,{context:r,message:n<1e3?`${String(n)} ms`:`${(n/1e3).toFixed(2)} s`,prefix:t})}else this.logger("warn",!1,!1,{context:r,message:"Timer not found",prefix:t})}timeEnd(t){if(!t&&this.seqTimers.size>0&&(t=[...this.seqTimers].pop()),t&&this.timersMap.has(t)){const r=Date.now()-this.timersMap.get(t);this.timersMap.delete(t),this.logger("stop",!1,!1,{message:`${this.endTimerMessage} ${r<1e3?`${String(r)} ms`:`${(r/1e3).toFixed(2)} s`}`,prefix:t})}else this.logger("warn",!1,!1,{message:"Timer not found",prefix:t})}group(t="console.group"){globalThis.window===void 0?this.groups.push(t):console.group(t)}groupEnd(){globalThis.window===void 0?this.groups.pop():console.groupEnd()}count(t="default"){const r=this.countMap.get(t)??0;this.countMap.set(t,r+1),this.logger("log",!1,!1,{message:`${t}: ${String(r+1)}`,prefix:t})}countReset(t="default"){this.countMap.has(t)?this.countMap.delete(t):this.logger("warn",!1,!1,{message:`Count for ${t} does not exist`,prefix:t})}clear(){console.clear()}raw(t,...r){this.disabled||this.logger("log",!0,!1,{context:r,message:t})}extendReporter(t){return typeof t.setLoggerTypes=="function"&&t.setLoggerTypes(this.types),typeof t.setStringify=="function"&&t.setStringify(this.stringify),t}registerReporters(t){for(let r=0;r<t.length;r+=1)this.reporters.add(this.extendReporter(t[r]))}registerProcessors(t){for(let r=0;r<t.length;r+=1){const n=t[r];typeof n.setStringify=="function"&&n.setStringify(this.stringify),this.processors.add(n)}}#t(t,r){if(r)this.rawReporter.log(Object.freeze(t));else for(const n of this.reporters)n.log(Object.freeze(t))}#r(t){return t&&this.logLevels[t]?t:"debug"}#i(t,r,...n){const s={badge:void 0,context:void 0,error:void 0,label:void 0,message:sf,prefix:void 0,repeated:void 0,scope:void 0,suffix:void 0};if(s.type={level:r.logLevel,name:t},s.groups=this.groups,s.scope=this.scopeName,s.date=new Date,n.length>0&&n[0]instanceof Error)s.error=n[0],n.length>1&&(s.context=n.slice(1));else if(n.length>0&&typeof n[0]=="object"&&n[0]!==null&&"message"in n[0]){const{context:i,message:o,prefix:a,suffix:c}=n[0];if(i&&(s.context=i),a&&(s.prefix=a),c&&(s.suffix=c),s.message=o,n.length>1){const l=n.slice(1);s.context?s.context=Array.isArray(s.context)?[...s.context,...l]:[s.context,...l]:s.context=l}}else n.length>1?(s.message=n[0],s.context=n.slice(1)):n.length===1?s.message=n[0]:s.message=void 0;return r.logLevel==="trace"&&(s.traceError=new Error("Trace")),r.badge&&(s.badge=r.badge),r.label&&(s.label=r.label),s}logger(t,r,n,...s){if(this.disabled)return;if(this.paused){this.messageQueue.push({messageObject:s,raw:r,type:t});return}const i=this.types[t],o=this.#r(i.logLevel);if(n||this.logLevels[o]>=this.logLevels[this.generalLogLevel]){let a=this.#i(t,i,...s);const c=sp((u=!1)=>{const p=(this.lastLog.count??0)-this.throttleMin;if(this.lastLog.object&&p>0){const f={...this.lastLog.object};p>1&&(f.repeated=p),this.#t(f,r),this.lastLog.count=1}if(u){for(const f of this.processors)a={...f.process(a)};this.lastLog.object=a,this.#t(a,r)}},"resolveLog");clearTimeout(this.lastLog.timeout);const l=this.lastLog.time&&a.date?new Date(a.date).getTime()-this.lastLog.time.getTime():0;if(this.lastLog.time=new Date(a.date),l<this.throttle)try{if(this.lastLog.object&&JSON.stringify([a.label,a.scope,a.type,a.message,a.prefix,a.suffix,a.context])===JSON.stringify([this.lastLog.object.label,this.lastLog.object.scope,this.lastLog.object.type,this.lastLog.object.message,this.lastLog.object.prefix,this.lastLog.object.suffix,this.lastLog.object.context])&&(this.lastLog.count=(this.lastLog.count??0)+1,this.lastLog.count>this.throttleMin)){this.lastLog.timeout=setTimeout(c,this.throttle);return}}catch{}c(!0)}}};var CI=Object.defineProperty,EI=te((e,t)=>CI(e,"name",{value:t,configurable:!0}),"c$1");let jI=class{static{d(this,"Kt")}static{$e(this,"Ht")}static{te(this,"v")}static{EI(this,"RawReporter")}#e;#t;#r;#i=!1;#n;constructor(e={}){this.#e=df,this.#t=ff,this.#n=e}setStdout(e){this.#e=e}setStderr(e){this.#t=e}setInteractiveManager(e){this.#r=e}setIsInteractive(e){this.#i=e}log(e){const{context:t,groups:r,message:n,type:s}=e,i=[];if(n!==sf){const l=typeof n=="string"?n:rc(n,this.#n);i.push(l)}t&&i.push(...t.map(l=>typeof l=="object"?` ${rc(l,this.#n)}`:` ${String(l)}`));const o=["error","trace","warn"].includes(s.level)?"stderr":"stdout",a=o==="stderr"?this.#t:this.#e,c=r.map(()=>" ").join("");this.#i&&this.#r!==void 0&&a.isTTY?this.#r.update(o,(c+i.join("")).split(`
|
|
1046
|
+
`),0):W$(c+i.join(""),a)}};var AI=Object.defineProperty,xI=te((e,t)=>AI(e,"name",{value:t,configurable:!0}),"m$1");let OI=class $w extends DI{static{d(this,"Me")}static{$e(this,"Le")}static{te(this,"c")}constructor(t){const r=t.parentStderr,n=t.parentStdout,{interactive:s,processors:i,rawReporter:o,reporters:a,stderr:c,stdout:l}=t,u=r??c,p=n??l,f=t.parentLongestLabel,m=t.parentTypes,{parentLogLevels:$,parentMessages:b,parentStringify:k}=t,S={disabled:t.disabled,logLevel:t.logLevel,logLevels:t.logLevels,messages:t.messages,processors:[],rawReporter:t.rawReporter,reporters:[],scope:t.scope,throttle:t.throttle,throttleMin:t.throttleMin},y="types"in t;m&&f&&!y?(S.parentTypes=m,S.parentLongestLabel=f):y&&t.types!==void 0&&(S.types=t.types),k&&(S.parentStringify=k),$&&!t.logLevels&&(S.parentLogLevels=$),b&&!t.messages&&(S.parentMessages=b),super(S),this.options=t,this.interactive=s??!1,this.stdout=p,this.stderr=u,this.interactive&&(this.interactiveManager=new rR(new mm(this.stdout),new mm(this.stderr))),Array.isArray(a)&&this.registerReporters(a),this.rawReporter=this.extendReporter(o??new jI),Array.isArray(i)&&this.registerProcessors(i)}options;static{xI(this,"PailServerImpl")}stdout;stderr;interactiveManager;interactive;scope(...t){if(t.length===0)throw new Error("No scope name was defined.");return this.scopeName=t.flat(),this}child(t){const r=t?.types!==void 0,n=r?np(this.types,t.types):this.types,s=t?.reporters??[],i=s.length>0?[...this.reporters,...s]:[...this.reporters],o=t?.processors??[],a=o.length>0?[...this.processors,...o]:[...this.processors],c=t?.logLevels?{...this.logLevels,...t.logLevels}:this.logLevels;let l;if(t?.scope){const f=rp(t.scope).filter(Boolean);l=this.scopeName.length>0?[...this.scopeName,...f]:f}else l=this.scopeName.length>0?this.scopeName:[];const u=t?.messages?{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage,...t.messages}:{timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage},p={disabled:t?.disabled??this.disabled,interactive:t?.interactive??this.interactive,logLevel:t?.logLevel??this.generalLogLevel,logLevels:c,messages:u,processors:a,rawReporter:t?.rawReporter??this.rawReporter,reporters:i,scope:l,stderr:t?.stderr??this.stderr,stdout:t?.stdout??this.stdout,throttle:t?.throttle??this.throttle,throttleMin:t?.throttleMin??this.throttleMin};return this.#e(p,t,r,n),new $w(p)}#e(t,r,n,s){n?(t.parentTypes=s,t.parentLongestLabel=ec(s)):(t.parentTypes=this.types,t.parentLongestLabel=this.longestLabel),r?.logLevels||(t.parentLogLevels=this.logLevels),r?.messages||(t.parentMessages={timerEnd:this.endTimerMessage,timerStart:this.startTimerMessage}),t.parentStringify=this.stringify,r?.stdout||(t.parentStdout=this.stdout),r?.stderr||(t.parentStderr=this.stderr)}getInteractiveManager(){return this.interactiveManager}wrapStd(){this.#t(this.stdout,"log"),this.#t(this.stderr,"log")}restoreStd(){this.#r(this.stdout),this.#r(this.stderr)}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}clear(){this.stdout.write(Bm),this.stderr.write(Bm)}extendReporter(t){return typeof t.setStdout=="function"&&t.setStdout(this.stdout),typeof t.setStderr=="function"&&t.setStderr(this.stderr),typeof t.setLoggerTypes=="function"&&t.setLoggerTypes(this.types),typeof t.setStringify=="function"&&t.setStringify(this.stringify),typeof t.setIsInteractive=="function"&&t.setIsInteractive(this.interactive),this.interactive&&typeof t.setInteractiveManager=="function"&&t.setInteractiveManager(this.interactiveManager),t}#t(t,r){t&&(t.__write||(t.__write=t.write),t.write=n=>{this[r](String(n).trim())})}#r(t){t&&t.__write&&(t.write=t.__write,delete t.__write)}};const PI=OI;var FI=Object.defineProperty,BI=te((e,t)=>FI(e,"name",{value:t,configurable:!0}),"x"),RI=Object.defineProperty,ww=BI((e,t)=>RI(e,"name",{value:t,configurable:!0}),"h"),TI=Object.defineProperty,Ko=ww((e,t)=>TI(e,"name",{value:t,configurable:!0}),"g$1");const Tm=new Map([["aliceblue","#f0f8ff"],["antiquewhite","#faebd7"],["aqua","#00ffff"],["aquamarine","#7fffd4"],["azure","#f0ffff"],["beige","#f5f5dc"],["bisque","#ffe4c4"],["black","#000000"],["blanchedalmond","#ffebcd"],["blue","#0000ff"],["blueviolet","#8a2be2"],["brown","#a52a2a"],["burlywood","#deb887"],["cadetblue","#5f9ea0"],["chartreuse","#7fff00"],["chocolate","#d2691e"],["coral","#ff7f50"],["cornflowerblue","#6495ed"],["cornsilk","#fff8dc"],["crimson","#dc143c"],["cyan","#00ffff"],["darkblue","#00008b"],["darkcyan","#008b8b"],["darkgoldenrod","#b8860b"],["darkgray","#a9a9a9"],["darkgreen","#006400"],["darkgrey","#a9a9a9"],["darkkhaki","#bdb76b"],["darkmagenta","#8b008b"],["darkolivegreen","#556b2f"],["darkorange","#ff8c00"],["darkorchid","#9932cc"],["darkred","#8b0000"],["darksalmon","#e9967a"],["darkseagreen","#8fbc8f"],["darkslateblue","#483d8b"],["darkslategray","#2f4f4f"],["darkslategrey","#2f4f4f"],["darkturquoise","#00ced1"],["darkviolet","#9400d3"],["deeppink","#ff1493"],["deepskyblue","#00bfff"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1e90ff"],["firebrick","#b22222"],["floralwhite","#fffaf0"],["forestgreen","#228b22"],["fuchsia","#ff00ff"],["gainsboro","#dcdcdc"],["ghostwhite","#f8f8ff"],["gold","#ffd700"],["goldenrod","#daa520"],["gray","#808080"],["green","#008000"],["greenyellow","#adff2f"],["grey","#808080"],["honeydew","#f0fff0"],["hotpink","#ff69b4"],["indianred","#cd5c5c"],["indigo","#4b0082"],["ivory","#fffff0"],["khaki","#f0e68c"],["lavender","#e6e6fa"],["lavenderblush","#fff0f5"],["lawngreen","#7cfc00"],["lemonchiffon","#fffacd"],["lightblue","#add8e6"],["lightcoral","#f08080"],["lightcyan","#e0ffff"],["lightgoldenrodyellow","#fafad2"],["lightgray","#d3d3d3"],["lightgreen","#90ee90"],["lightgrey","#d3d3d3"],["lightpink","#ffb6c1"],["lightsalmon","#ffa07a"],["lightseagreen","#20b2aa"],["lightskyblue","#87cefa"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#b0c4de"],["lightyellow","#ffffe0"],["lime","#00ff00"],["limegreen","#32cd32"],["linen","#faf0e6"],["magenta","#ff00ff"],["maroon","#800000"],["mediumaquamarine","#66cdaa"],["mediumblue","#0000cd"],["mediumorchid","#ba55d3"],["mediumpurple","#9370db"],["mediumseagreen","#3cb371"],["mediumslateblue","#7b68ee"],["mediumspringgreen","#00fa9a"],["mediumturquoise","#48d1cc"],["mediumvioletred","#c71585"],["midnightblue","#191970"],["mintcream","#f5fffa"],["mistyrose","#ffe4e1"],["moccasin","#ffe4b5"],["navajowhite","#ffdead"],["navy","#000080"],["oldlace","#fdf5e6"],["olive","#808000"],["olivedrab","#6b8e23"],["orange","#ffa500"],["orangered","#ff4500"],["orchid","#da70d6"],["palegoldenrod","#eee8aa"],["palegreen","#98fb98"],["paleturquoise","#afeeee"],["palevioletred","#db7093"],["papayawhip","#ffefd5"],["peachpuff","#ffdab9"],["peru","#cd853f"],["pink","#ffc0cb"],["plum","#dda0dd"],["powderblue","#b0e0e6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#ff0000"],["rosybrown","#bc8f8f"],["royalblue","#4169e1"],["saddlebrown","#8b4513"],["salmon","#fa8072"],["sandybrown","#f4a460"],["seagreen","#2e8b57"],["seashell","#fff5ee"],["sienna","#a0522d"],["silver","#c0c0c0"],["skyblue","#87ceeb"],["slateblue","#6a5acd"],["slategray","#708090"],["slategrey","#708090"],["snow","#fffafa"],["springgreen","#00ff7f"],["steelblue","#4682b4"],["tan","#d2b48c"],["teal","#008080"],["thistle","#d8bfd8"],["tomato","#ff6347"],["turquoise","#40e0d0"],["violet","#ee82ee"],["wheat","#f5deb3"],["white","#ffffff"],["whitesmoke","#f5f5f5"],["yellow","#ffff00"],["yellowgreen","#9acd32"]]),NI=/^#([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})?$/i,II=/^#([\dA-F])([\dA-F])([\dA-F])([\dA-F])?$/i,LI=/^rgba?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,_I=/^hsla?\(\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))%\s*(,\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*)?\)$/,kw=Ko(()=>({__proto__:null,backgroundColor:null,color:null,fontStyle:null,fontWeight:null,textDecorationColor:null,textDecorationLine:[]}),"getDefaultCss"),Nm=/\s+/,sc=Ko(e=>{Tm.has(e)&&(e=Tm.get(e));const t=NI.exec(e);if(t)return[Number.parseInt(t[1],16),Number.parseInt(t[2],16),Number.parseInt(t[3],16)];const r=II.exec(e);if(r)return[Number.parseInt(`${r[1]}${r[1]}`,16),Number.parseInt(`${r[2]}${r[2]}`,16),Number.parseInt(`${r[3]}${r[3]}`,16)];const n=LI.exec(e);if(n)return[Math.round(Math.max(0,Math.min(255,Number(n[1])))),Math.round(Math.max(0,Math.min(255,Number(n[2])))),Math.round(Math.max(0,Math.min(255,Number(n[3]))))];const s=_I.exec(e);if(s){let i=Number(s[1])%360;i<0&&(i+=360);const o=Math.max(0,Math.min(100,Number(s[2])))/100,a=Math.max(0,Math.min(100,Number(s[3])))/100,c=(1-Math.abs(2*a-1))*o,l=c*(1-Math.abs(i/60%2-1)),u=a-c/2;let p,f,m;return i<60?{0:p,1:f,2:m}=[c,l,0]:i<120?{0:p,1:f,2:m}=[l,c,0]:i<180?{0:p,1:f,2:m}=[0,c,l]:i<240?{0:p,1:f,2:m}=[0,l,c]:i<300?{0:p,1:f,2:m}=[l,0,c]:{0:p,1:f,2:m}=[c,0,l],[Math.round((p+u)*255),Math.round((f+u)*255),Math.round((m+u)*255)]}return null},"parseCssColor"),tu=Ko((e,t)=>e?.[0]===t?.[0]&&e?.[1]===t?.[1]&&e?.[2]===t?.[2],"colorEquals"),MI=Ko(e=>{const t=kw(),r=[];let n=!1,s=null,i=0,o="";for(const a of e){if(a==="(")i+=1;else if(i>0)a===")"&&(i-=1);else if(n){if(a===";"){const c=o.trim();c!==""&&r.push([s,c]),s=null,o="",n=!1;continue}}else if(a===":"){s=o.trim(),o="",n=!0;continue}o+=a}if(n&&i===0){const a=o.trim();a!==""&&r.push([s,a]),s=null,o=""}for(const{0:a,1:c}of r)switch(a){case"background-color":{c!=null&&(t.backgroundColor=c);break}case"color":{c!=null&&(t.color=c);break}case"font-style":{["italic","oblique","oblique 14deg"].includes(c)&&(t.fontStyle="italic");break}case"font-weight":{c==="bold"&&(t.fontWeight=c);break}case"text-decoration":{t.textDecorationColor=null,t.textDecorationLine=[];const l=c.split(Nm);for(const u of l){const p=sc(u);p!=null?t.textDecorationColor=p:["line-through","overline","underline"].includes(u)&&t.textDecorationLine.push(u)}break}case"text-decoration-color":{const l=sc(c);l!=null&&(t.textDecorationColor=l);break}case"text-decoration-line":{t.textDecorationLine=[];const l=c.split(Nm);for(const u of l)["line-through","overline","underline"].includes(u)&&t.textDecorationLine.push(u);break}}return t},"parseCss"),WI=Ko((e,t)=>{t=t??kw();let r="";if(!tu(e.backgroundColor,t.backgroundColor))if(e.backgroundColor==null)r+="\x1B[49m";else switch(e.backgroundColor){case"black":{r+="\x1B[40m";break}case"blue":{r+="\x1B[44m";break}case"cyan":{r+="\x1B[46m";break}case"green":{r+="\x1B[42m";break}case"magenta":{r+="\x1B[45m";break}case"red":{r+="\x1B[41m";break}case"white":{r+="\x1B[47m";break}case"yellow":{r+="\x1B[43m";break}default:if(Array.isArray(e.backgroundColor)){const{0:n,1:s,2:i}=e.backgroundColor;r+=`\x1B[48;2;${String(n)};${String(s)};${String(i)}m`}else{const n=sc(e.backgroundColor);if(n===null)r+="\x1B[49m";else{const{0:s,1:i,2:o}=n;r+=`\x1B[48;2;${String(s)};${String(i)};${String(o)}m`}}}if(!tu(e.color,t.color))if(e.color==null)r+="\x1B[39m";else switch(e.color){case"black":{r+="\x1B[30m";break}case"blue":{r+="\x1B[34m";break}case"cyan":{r+="\x1B[36m";break}case"green":{r+="\x1B[32m";break}case"magenta":{r+="\x1B[35m";break}case"red":{r+="\x1B[31m";break}case"white":{r+="\x1B[37m";break}case"yellow":{r+="\x1B[33m";break}default:if(Array.isArray(e.color)){const{0:n,1:s,2:i}=e.color;r+=`\x1B[38;2;${String(n)};${String(s)};${String(i)}m`}else{const n=sc(e.color);if(n===null)r+="\x1B[39m";else{const{0:s,1:i,2:o}=n;r+=`\x1B[38;2;${String(s)};${String(i)};${String(o)}m`}}}if(e.fontWeight!==t.fontWeight&&(r+=e.fontWeight==="bold"?"\x1B[1m":"\x1B[22m"),e.fontStyle!==t.fontStyle&&(r+=e.fontStyle==="italic"?"\x1B[3m":"\x1B[23m"),!tu(e.textDecorationColor,t.textDecorationColor))if(e.textDecorationColor==null)r+="\x1B[59m";else{const{0:n,1:s,2:i}=e.textDecorationColor;r+=`\x1B[58;2;${String(n)};${String(s)};${String(i)}m`}return e.textDecorationLine.includes("line-through")!==t.textDecorationLine.includes("line-through")&&(r+=e.textDecorationLine.includes("line-through")?"\x1B[9m":"\x1B[29m"),e.textDecorationLine.includes("overline")!==t.textDecorationLine.includes("overline")&&(r+=e.textDecorationLine.includes("overline")?"\x1B[53m":"\x1B[55m"),e.textDecorationLine.includes("underline")!==t.textDecorationLine.includes("underline")&&(r+=e.textDecorationLine.includes("underline")?"\x1B[4m":"\x1B[24m"),r},"cssToAnsi");var VI=Object.defineProperty,bf=ww((e,t)=>VI(e,"name",{value:t,configurable:!0}),"y");const UI=bf(e=>{try{return JSON.stringify(e)}catch{return'"[Circular]"'}},"tryStringify"),Im="%".codePointAt(0),GI="s".codePointAt(0),qI="d".codePointAt(0),HI="f".codePointAt(0),zI="i".codePointAt(0),JI="O".codePointAt(0),KI="o".codePointAt(0),YI="j".codePointAt(0),XI="c".codePointAt(0),QI=bf((e,t=[],r={})=>{if(typeof e!="string"&&typeof e!="object"||e===null)throw new TypeError(`fmt must be a string or object, got ${e===null?"null":typeof e}`);const n=r.stringify??UI,s=1;if(typeof e=="object"){const u=t.length+s;if(u===1)return"{}";const p=Array.from({length:u});p[0]=n(e);for(let f=1;f<u;f+=1)p[f]=n(t[f-s]);return p.join(" ")}if(t.length===0)return e;let i="",o=1-s,a=-1,c=!1,l;for(let u=0;u<e.length;){if(e.codePointAt(u)===Im&&u+1<e.length){a=a>-1?a:0;const p=e.codePointAt(u+1);if(p===void 0){o+=1;break}switch(p){case XI:{if(globalThis.window===void 0){const f=MI(t[o]);a<u&&(i+=e.slice(a,u)),i+=WI(f,l),i!==""&&(c=!0,l=f)}a=u+2,u+=1;break}case qI:case HI:{if(o>=t.length||t[o]==null)break;a<u&&(i+=e.slice(a,u)),i+=Number(t[o]).toString(),a=u+2,u+=1;break}case zI:{if(o>=t.length||t[o]==null)break;a<u&&(i+=e.slice(a,u)),i+=Math.floor(Number(t[o])).toString(),a=u+2,u+=1;break}case YI:case JI:case KI:{if(o>=t.length||t[o]===void 0)break;a<u&&(i+=e.slice(a,u));const f=t[o],m=typeof f;if(m==="string"){i+=`'${f}'`,a=u+2;break}if(m==="function"){i+=f.name?`[Function: ${f.name}]`:"[Function: <anonymous>]",a=u+2;break}i+=n(f),a=u+2,u+=1;break}case Im:{a<u&&(i+=e.slice(a,u)),i+="%",a=u+2,u+=1,o-=1;break}case GI:{if(o>=t.length)break;a<u&&(i+=e.slice(a,u)),i+=typeof t[o]=="object"?n(t[o]):String(t[o]),a=u+2,u+=1;break}default:typeof r.formatters?.[p]=="function"&&(a<u&&(i+=e.slice(a,u)),i+=r.formatters[p](t[o]),a=u+2,u+=1)}o+=1}u+=1}return a===-1?e:(a<e.length&&(i+=e.slice(a)),c&&(i+="\x1B[0m"),i)},"format"),ZI=bf((e={})=>{const t={};return typeof e.formatters=="object"&&Object.entries(e.formatters).forEach(([r,n])=>{if(r.length===0)throw new Error(`Formatter %${r} has no characters`);if(r.length>1)throw new Error(`Formatter %${r} has more than one character`);if(typeof n!="function")throw new TypeError(`Formatter for %${r} is not a function`);const s=r.codePointAt(0);if(s===void 0)throw new Error(`${r}.codePointAt(0) failed to return a value, please report this issue`);t[s]=n}),(r,n=[],s={})=>QI(r,n,{...s,formatters:t})},"build");var eL=Object.defineProperty,Lm=te((e,t)=>eL(e,"name",{value:t,configurable:!0}),"i$1");let tL=class{static{d(this,"xr")}static{$e(this,"$r")}static{te(this,"g")}static{Lm(this,"MessageFormatterProcessor")}#e;#t;constructor(e={}){this.#t=e.formatters}setStringify(e){this.#e=e}process(e){const t=ZI({formatters:this.#t,stringify:Lm(r=>this.#e?this.#e(r):JSON.stringify(r),"stringify")});return e.message!==void 0&&(e.message=this.#r(t,e.message,e.context??[])),e}#r(e,t,r=[]){if(typeof t=="string")return e(t,r);if(typeof t=="object"&&t!==null){const n=t,s=Object.keys(n);for(let i=0;i<s.length;i+=1){const o=s[i],a=n[o];(typeof a=="string"||Array.isArray(a)||typeof a=="object")&&(n[o]=this.#r(e,a,r))}}return t}};var rL=Object.defineProperty,Sw=te((e,t)=>rL(e,"name",{value:t,configurable:!0}),"M");const{bgGrey:nL,cyan:sL,green:iL,greenBright:oL,grey:Mt,red:ru,underline:_m,white:aL}=dc,cL=/[\\/]pail[\\/]dist/,nu=Sw(e=>!cL.test(e),"pailFileFilter");class lL extends IN{static{d(this,"Br")}static{$e(this,"Mr")}static{te(this,"PrettyReporter")}static{Sw(this,"PrettyReporter")}#e;#t;#r;#i=!1;#n;#o;constructor(t={}){const{error:r,inspect:n,...s}=t;super({uppercase:{label:!0,...s.uppercase},...s}),this.#n={...xN,...n},this.#o={...r,color:{fileLine:iL,hint:sL,marker:ru,message:ru,method:oL,title:ru}},this.#e=df,this.#t=ff}setStdout(t){this.#e=t}setStderr(t){this.#t=t}setInteractiveManager(t){this.#r=t}setIsInteractive(t){this.#i=t}log(t){this._log(this._formatMessage(t),t.type.level)}_formatMessage(t){const{columns:r}=el();let n=r;typeof this.styles.messageLength=="number"&&(n=this.styles.messageLength);const{badge:s,context:i,date:o,error:a,file:c,groups:l,label:u,message:p,prefix:f,repeated:m,scope:$,suffix:b,traceError:k,type:S}=t,{color:y}=this.loggerTypes[S.name],h=y?dc[y]:aL,v=l.map(()=>" ").join(""),w=[];if(l.length>0&&w.push(`${v+Mt(`[${l.at(-1)??""}]`)} `),o&&w.push(`${Mt(this.styles.dateFormatter(typeof o=="string"?new Date(o):o))} `),s)w.push(h(s));else{const C=wN(this.loggerTypes);C.length>0&&w.push(`${Mt(".".repeat(C.length))} `)}const g=ec(this.loggerTypes);if(u){const C=Rt(g),A=Rt(u);w.push(`${h(RN(u,this.styles))} `,Mt(".".repeat(Math.max(0,C-A))))}else w.push(Mt(".".repeat(g.length+2)));m&&w.push(`${nL.white(`[${String(m)}x]`)} `),Array.isArray($)&&$.length>0&&w.push(` ${Mt(`[${$.join(" > ")}]`)} `),f&&w.push(`${Mt(`${Array.isArray($)&&$.length>0?". ":" "}[${this.styles.underline.prefix?_m(f):f}]`)} `);const E=Rt(w.join(" "));if(c){const C=(c.name??"")+(c.line?`:${String(c.line)}`:""),A=Rt(C);if(A+E+2>n)w.push(Mt(` ${C}`));else{const O=Math.max(0,n-E-A-2);w.push(Mt(`${".".repeat(O)} ${C}`))}}else w.push(Mt(".".repeat(Math.max(0,n-E-1))));if(w.length>0&&w.push(`
|
|
1047
1047
|
|
|
1048
|
-
`),p!==sf){const C=typeof p=="string"?p:rc(p,this.#n);w.push(v+
|
|
1048
|
+
`),p!==sf){const C=typeof p=="string"?p:rc(p,this.#n);w.push(v+mN(C,{trim:!1,width:n-3,wrapMode:Qi.STRICT_WIDTH}))}if(i){let C=!1;w.push(...i.map(A=>{if(A instanceof Error)return C=!0,`
|
|
1049
1049
|
|
|
1050
1050
|
${Yl(A,{...this.#o,filterStacktrace:nu,prefix:v})}`;if(typeof A=="object")return` ${rc(A,this.#n)}`;const O=(C?`
|
|
1051
1051
|
|
|
@@ -1054,28 +1054,28 @@ ${Yl(A,{...this.#o,filterStacktrace:nu,prefix:v})}`;if(typeof A=="object")return
|
|
|
1054
1054
|
${Yl(k,{...this.#o,filterStacktrace:nu,hideErrorCauseCodeView:!0,hideErrorCodeView:!0,hideErrorErrorsCodeView:!0,hideMessage:!0,prefix:v})}`),b&&w.push(`
|
|
1055
1055
|
`,v+Mt(this.styles.underline.suffix?_m(b):b)),w.join("")}_log(t,r){const n=["error","trace","warn"].includes(r)?"stderr":"stdout",s=n==="stderr"?this.#t:this.#e;this.#i&&this.#r!==void 0&&s.isTTY?this.#r.update(n,t.split(`
|
|
1056
1056
|
`),0):W$(`${t}
|
|
1057
|
-
`,s)}}var rL=Object.defineProperty,Dw=te((e,t)=>rL(e,"name",{value:t,configurable:!0}),"o");const nL=Dw(()=>co.NODE_ENV==="debug"||co.DEBUG!==void 0?"debug":co.NODE_ENV==="test"?"warning":"informational","getDefaultLogLevel"),Cw=Dw(e=>{let t=nL();return co.PAIL_LOG_LEVEL!==void 0&&(t=co.PAIL_LOG_LEVEL),new SI({logLevel:t,processors:[new zI],reporters:[new tL],stderr:ff,stdout:df,...e})},"createPail");Cw();const P=Cw();var sL=Object.defineProperty,ai=d((e,t)=>sL(e,"name",{value:t,configurable:!0}),"m$l");const ip=ai((e,t)=>e.tasks.find(r=>r.taskId===t),"findTaskInSummary"),su=ai((e,t)=>{const r=e??{},n=t??{},s=[],i=[],o=[];for(const a of Object.keys(r))a in n?r[a]!==n[a]&&o.push(a):s.push(a);for(const a of Object.keys(n))a in r||i.push(a);return s.sort(),i.sort(),o.sort(),{added:s,changed:o,removed:i}},"diffHashBuckets"),iL=ai((e,t)=>({commandChanged:(e?.command??"")!==(t?.command??""),implicitDeps:su(e?.implicitDeps,t?.implicitDeps),nodes:su(e?.nodes,t?.nodes),runtime:su(e?.runtime,t?.runtime)}),"diffHashDetails"),Ew=ai(async(e,t)=>{const r=D(hn(e),`${t}.json`);try{const n=await Ug(r,"utf8");return JSON.parse(n)}catch{return}},"readRunSummaryById"),oL=ai(async(e,t)=>{const r=hn(e);let n;try{n=await So(r)}catch{return}const s=[];for(const i of n){if(!i.endsWith(".json")||t!==void 0&&i===`${t}.json`)continue;const o=D(r,i);try{const a=await qs(o);a.isFile()&&s.push({mtimeMs:a.mtimeMs,path:o})}catch{}}if(s.length!==0){s.sort((i,o)=>o.mtimeMs-i.mtimeMs);try{const i=await Ug(s[0].path,"utf8");return JSON.parse(i)}catch{return}}},"readPreviousRunSummary"),SJ=ai(async e=>{const t=hn(e);let r;try{r=await So(t)}catch{return[]}const n=[];for(const s of r){if(!s.endsWith(".json"))continue;const i=D(t,s);try{const o=await qs(i);o.isFile()&&n.push({id:s.slice(0,-5),mtimeMs:o.mtimeMs,path:i})}catch{}}return n.sort((s,i)=>i.mtimeMs-s.mtimeMs),n},"listRunSummaries");var aL=Object.defineProperty,Ue=d((e,t)=>aL(e,"name",{value:t,configurable:!0}),"i$o");const $f="https://api.deps.dev/v3",cL=15e3,lL=10080*60*1e3,uL=1440*60*1e3,pL=10080*60*1e3,iu=8,Os=Ue(e=>D(Ic(),"deps-dev",e),"getCacheDirectory"),dL={"Binary-Artifacts":"supplyChain","Branch-Protection":"supplyChain","CII-Best-Practices":"quality","Code-Review":"maintenance",Contributors:"maintenance","Dangerous-Workflow":"supplyChain","Dependency-Update-Tool":"maintenance",Fuzzing:"quality",License:"license",Maintained:"maintenance",Packaging:"quality","Pinned-Dependencies":"supplyChain",SAST:"quality","Security-Policy":"quality","Signed-Releases":"supplyChain","Token-Permissions":"supplyChain",Vulnerabilities:"vulnerability",Webhooks:"supplyChain"},wf=Ue(e=>e.map(t=>encodeURIComponent(t)).join("__"),"buildCacheKey"),kf=Ue((e,t)=>{try{const r=le(D(e,`${t}.json`));if(Date.now()-r.createdAt>r.ttlMs){Nt(D(e,`${t}.json`),{force:!0});return}return r.payload}catch{return}},"readCache"),Sf=Ue((e,t,r,n)=>{$t(e);const s={createdAt:Date.now(),payload:r,ttlMs:n};Oe(D(e,`${t}.json`),JSON.stringify(s),"utf8")},"writeCache"),Df=Ue(async(e,t)=>{const r=new AbortController,n=setTimeout(()=>{r.abort()},t);try{const s=await fetch(e,{headers:{Accept:"application/json","User-Agent":"@visulima/vis"},signal:r.signal});return s.ok?await s.json():void 0}catch{return}finally{clearTimeout(n)}},"fetchJson"),fL=Ue(async(e,t,r,n)=>{const s=Os("versions"),i=wf([e,t]),o=kf(s,i);if(o)return o;const a=`${$f}/systems/npm/packages/${encodeURIComponent(e)}/versions/${encodeURIComponent(t)}`,c=await Df(a,r);return c&&Sf(s,i,c,n),c},"fetchVersion"),hL=Ue(async(e,t,r)=>{const n=Os("projects"),s=wf([e]),i=kf(n,s);if(i)return i;const o=`${$f}/projects/${encodeURIComponent(e)}`,a=await Df(o,t);return a&&Sf(n,s,a,r),a},"fetchProject"),mL=Ue(async(e,t,r)=>{const n=Os("advisories"),s=wf([e]),i=kf(n,s);if(i)return i;const o=`${$f}/advisories/${encodeURIComponent(e)}`,a=await Df(o,t);return a&&Sf(n,s,a,r),a},"fetchAdvisory"),gL=Ue(e=>{const t={license:[],maintenance:[],quality:[],supplyChain:[],vulnerability:[]};if(e?.checks)for(const s of e.checks){if(s.score<0)continue;const i=dL[s.name];i&&t[i].push(s.score/10)}const r=Ue(s=>s.length===0?.5:Number((s.reduce((i,o)=>i+o,0)/s.length).toFixed(2)),"avg"),n=e?.overallScore===void 0?Number(((r(t.license)+r(t.maintenance)+r(t.quality)+r(t.supplyChain)+r(t.vulnerability))/5).toFixed(2)):Number((e.overallScore/10).toFixed(2));return{license:r(t.license),maintenance:r(t.maintenance),overall:n,quality:r(t.quality),supplyChain:r(t.supplyChain),vulnerability:r(t.vulnerability)}},"scorecardToScore"),jw=Ue(e=>e===void 0?"medium":e>=9?"critical":e>=7?"high":e>=4?"medium":"low","cvssToSeverity"),yL=Ue((e,t,r)=>{const n=t?.aliases?.find(i=>i.startsWith("CVE-")),s={category:"vulnerability",key:e,severity:jw(t?.cvss3Score),type:"vulnerability"};return n?s.props={cveId:n,lastPublish:r??""}:r&&(s.props={lastPublish:r}),s},"advisoryToAlert"),vL=Ue(e=>e?e.find(t=>t.relationType==="SOURCE_REPO"&&t.projectKey?.id)?.projectKey?.id??e.find(t=>t.projectKey?.id)?.projectKey?.id:void 0,"pickProjectId"),bL=Ue(async(e,t={})=>{const r=new Map;if(e.length===0)return r;const{advisoryCacheTtlMs:n=pL,projectCacheTtlMs:s=uL,timeoutMs:i=cL,versionCacheTtlMs:o=lL}=t,a=new Map,c=[...e],l=Ue(async()=>{for(;;){const h=c.shift();if(!h)return;const v=await fL(h.name,h.version,i,o);v&&a.set(`${h.name}@${h.version}`,v)}},"versionWorker");await Promise.all(Array.from({length:Math.min(iu,e.length)},l));const u=new Set,p=new Set,f=new Map;for(const[h,v]of a){const w=vL(v.relatedProjects);f.set(h,w),w&&u.add(w);for(const g of v.advisoryKeys??[])p.add(g.id)}const m=new Map,$=new Map,b=[...u],k=[...p],S=Ue(async()=>{for(;;){const h=b.shift();if(!h)return;m.set(h,await hL(h,i,s))}},"projectWorker"),y=Ue(async()=>{for(;;){const h=k.shift();if(!h)return;$.set(h,await mL(h,i,n))}},"advisoryWorker");await Promise.all([...Array.from({length:Math.min(iu,u.size)},S),...Array.from({length:Math.min(iu,p.size)},y)]);for(const h of e){const v=`${h.name}@${h.version}`,w=a.get(v);if(!w)continue;const g=f.get(v),E=g?m.get(g):void 0,C=gL(E?.scorecard),A=(w.advisoryKeys??[]).map(U=>yL(U.id,$.get(U.id),w.publishedAt));if(A.length>0){const U=A.some(M=>M.severity==="critical"||M.severity==="high");C.vulnerability=Math.min(C.vulnerability,U?.2:.5),C.overall=Number(((C.license+C.maintenance+C.quality+C.supplyChain+C.vulnerability)/5).toFixed(2))}const{versionKey:O}=w,I=O?.name??h.name,V=I.startsWith("@")?I.slice(0,I.indexOf("/")):void 0,fe=V?I.slice(V.length+1):I,Y={alerts:A,author:[],id:`pkg:npm/${I}@${h.version}`,license:E?.license??w.licenses?.[0]??"",name:fe,score:C,size:0,type:"npm",version:h.version};V&&(Y.namespace=V),r.set(v,Y)}return r},"fetchDepsDevReports"),Aw=Ue(()=>[Os("versions"),Os("projects"),Os("advisories")],"cacheDirectories"),xw=Ue(()=>{let e=0;for(const t of Aw()){if(!j(t))continue;const r=Ze(t).filter(n=>n.endsWith(".json"));for(const n of r)Nt(D(t,n),{force:!0}),e+=1}return e},"clearDepsDevCache"),ic=Ue(()=>{let e=0,t=0,r,n;for(const s of Aw())if(j(s))for(const i of Ze(s).filter(o=>o.endsWith(".json"))){const o=cr(D(s,i));e+=1,t+=o.size,(r===void 0||o.mtimeMs<r)&&(r=o.mtimeMs),(n===void 0||o.mtimeMs>n)&&(n=o.mtimeMs)}return{entries:e,newestEntry:n,oldestEntry:r,totalSizeBytes:t}},"getDepsDevCacheStats"),$L=Ue(e=>{if(!e?.enabled)return;const t={advisoryCacheTtlMs:e.advisoryCacheTtlMs,projectCacheTtlMs:e.projectCacheTtlMs,timeoutMs:e.timeoutMs,versionCacheTtlMs:e.versionCacheTtlMs};return{clearCache:xw,displayName:"deps.dev",fetchReports:Ue(r=>bL(r,t),"fetchReports"),getCacheStats:ic,id:"deps-dev"}},"createDepsDevProvider");var wL=Object.defineProperty,et=d((e,t)=>wL(e,"name",{value:t,configurable:!0}),"a$p");const op="https://api.snyk.io",kL="2024-10-15",SL=15e3,DL=360*60*1e3,CL=6,EL=10,jL=1e3,Cf=et(()=>D(Ic(),"snyk","issues"),"getCacheDirectory"),AL=et((e,t)=>`${encodeURIComponent(e)}__${encodeURIComponent(t)}`,"buildCacheKey"),xL=et((e,t)=>{try{const r=le(D(e,`${t}.json`));if(Date.now()-r.createdAt>r.ttlMs){Nt(D(e,`${t}.json`),{force:!0});return}return r.payload}catch{return}},"readCache"),OL=et((e,t,r,n)=>{$t(e);const s={createdAt:Date.now(),payload:r,ttlMs:n};Oe(D(e,`${t}.json`),JSON.stringify(s),"utf8")},"writeCache"),PL=et((e,t)=>encodeURIComponent(`pkg:npm/${e}@${t}`),"toPurl"),FL=et(e=>{try{const t=new URL(e,`${op}/`);return t.origin===op?t.toString():void 0}catch{return}},"resolveNextUrl"),BL=et(async(e,t,r)=>{const n=new AbortController,s=setTimeout(()=>{n.abort()},r);try{const i=await fetch(e,{headers:{Accept:"application/vnd.api+json",Authorization:`token ${t}`,"User-Agent":"@visulima/vis"},signal:n.signal});return i.ok?await i.json():void 0}catch{return}finally{clearTimeout(s)}},"fetchJson"),RL=et(async(e,t,r)=>{const n=Cf(),s=AL(e,t),i=xL(n,s);if(i)return i;const{apiToken:o,apiVersion:a,cacheTtlMs:c,orgId:l,timeoutMs:u}=r;let p=`${op}/rest/orgs/${encodeURIComponent(l)}/packages/${PL(e,t)}/issues?version=${encodeURIComponent(a)}&limit=${String(jL)}`;const f=[];for(let m=0;p&&m<EL;m+=1){const $=await BL(p,o,u);if(!$)return m===0?void 0:f;f.push(...$.data??[]),p=$.links?.next?FL($.links.next):void 0}return OL(n,s,f,c),f},"fetchIssues"),Mm=new Set(["critical","high","low","medium"]),TL=et(e=>{const t=e.attributes?.effective_severity_level?.toLowerCase();if(t&&Mm.has(t))return t;const r=e.attributes?.severities??[],n=r.find(i=>i.type==="primary")??r[0],s=n?.level?.toLowerCase();return s&&Mm.has(s)?s:jw(n?.score)},"issueSeverity"),NL=et(e=>{const t=e.attributes?.problems??[],r=t.find(i=>i.source==="CVE"||i.id.startsWith("CVE-")),n=t.filter(i=>i.source==="CWE"||i.id.startsWith("CWE-")).map(i=>({id:i.id})),s={category:"vulnerability",key:e.id,severity:TL(e),type:"vulnerability"};if(r){const i=e.attributes?.slots?.publication_time??e.attributes?.created_at??"";s.props={cveId:r.id,lastPublish:i},n.length>0&&(s.props.cwes=n)}return s},"issueToAlert"),IL=et(()=>({license:.5,maintenance:.5,overall:.5,quality:.5,supplyChain:.5,vulnerability:.5}),"neutralScore"),LL=et((e,t,r)=>{const n=r.map(c=>NL(c)),s=IL();if(n.length>0){const c=n.some(l=>l.severity==="critical"||l.severity==="high");s.vulnerability=c?.2:.5,s.overall=Number(((s.license+s.maintenance+s.quality+s.supplyChain+s.vulnerability)/5).toFixed(2))}const i=e.startsWith("@")?e.slice(0,e.indexOf("/")):void 0,o=i?e.slice(i.length+1):e,a={alerts:n,author:[],id:`pkg:npm/${e}@${t}`,license:"",name:o,score:s,size:0,type:"npm",version:t};return i&&(a.namespace=i),a},"buildReport"),_L=et(async(e,t)=>{const r=new Map;if(e.length===0)return r;const n={apiToken:t.apiToken,apiVersion:t.apiVersion??kL,cacheTtlMs:t.cacheTtlMs??DL,orgId:t.orgId,timeoutMs:t.timeoutMs??SL},s=[...e],i=et(async()=>{for(;;){const o=s.shift();if(!o)return;const a=await RL(o.name,o.version,n);a!==void 0&&r.set(`${o.name}@${o.version}`,LL(o.name,o.version,a))}},"worker");return await Promise.all(Array.from({length:Math.min(CL,e.length)},i)),r},"fetchSnykReports"),Ow=et(()=>{const e=Cf();if(!j(e))return 0;let t=0;for(const r of Ze(e).filter(n=>n.endsWith(".json")))Nt(D(e,r),{force:!0}),t+=1;return t},"clearSnykCache"),oc=et(()=>{const e=Cf();let t=0,r=0,n,s;if(j(e))for(const i of Ze(e).filter(o=>o.endsWith(".json"))){const o=cr(D(e,i));t+=1,r+=o.size,(n===void 0||o.mtimeMs<n)&&(n=o.mtimeMs),(s===void 0||o.mtimeMs>s)&&(s=o.mtimeMs)}return{entries:t,newestEntry:s,oldestEntry:n,totalSizeBytes:r}},"getSnykCacheStats"),ML=et(e=>{if(!e?.enabled)return;const t=e.apiToken??process.env.VIS_SNYK_TOKEN,r=e.orgId??process.env.VIS_SNYK_ORG;if(!t||!r)return;const n={apiToken:t,apiVersion:e.apiVersion,cacheTtlMs:e.cacheTtlMs,orgId:r,timeoutMs:e.timeoutMs};return{clearCache:Ow,displayName:"Snyk",fetchReports:et(s=>_L(s,n),"fetchReports"),getCacheStats:oc,id:"snyk"}},"createSnykProvider");var WL=Object.defineProperty,Ve=d((e,t)=>WL(e,"name",{value:t,configurable:!0}),"c$r");const VL="https://api.socket.dev/v0/purl?alerts=true",Yo=Ve(()=>D(Ic(),"socket-security"),"getCacheDirectory"),UL=3600*1e3,Ef=.4,Wm=100,GL=Ve(e=>typeof e=="object"&&e!==null&&"id"in e&&"type"in e&&"name"in e&&"version"in e&&"alerts"in e&&"score"in e&&e.type==="npm","isPackageReportData"),qL=Ve(()=>{$t(Yo())},"ensureCacheDirectory"),Pw=Ve((e,t)=>`${encodeURIComponent(e)}@${encodeURIComponent(t)}`,"buildCacheKey"),HL=Ve((e,t)=>{const r=Pw(e,t),n=D(Yo(),`${r}.json`);try{const s=le(n);if(Date.now()-s.createdAt>s.ttlMs){Nt(n,{force:!0});return}return s.report}catch{return}},"getCachedReport"),zL=Ve((e,t,r,n)=>{const s=Pw(e,t),i={createdAt:Date.now(),report:r,ttlMs:n};Oe(D(Yo(),`${s}.json`),JSON.stringify(i),"utf8")},"setCachedReport"),JL=Ve(e=>{const t=[e.license,e.maintenance,e.quality,e.supplyChain,e.vulnerability];return Number((t.reduce((r,n)=>r+n,0)/t.length).toFixed(2))},"calculateOverallScore"),KL=Ve(async(e,t={})=>{const{apiToken:r,cacheTtlMs:n=UL,timeoutMs:s=15e3}=t,i=new Map;if(e.length===0||!r)return i;const o=[];for(const l of e){const u=HL(l.name,l.version);u?i.set(`${l.name}@${l.version}`,u):o.push(l)}if(o.length===0)return i;const a=`Basic ${Buffer.from(`${r}:`).toString("base64")}`;qL();const c=[];for(let l=0;l<o.length;l+=Wm)c.push(o.slice(l,l+Wm));for(const l of c){const u=l.map(m=>({purl:`pkg:npm/${m.name}@${m.version}`})),p=new AbortController,f=setTimeout(()=>{p.abort()},s);try{const m=await fetch(VL,{body:JSON.stringify({components:u}),headers:{Authorization:a,"Content-Type":"application/json","User-Agent":"@visulima/vis"},method:"POST",signal:p.signal});if(!m.ok)continue;const $=await m.text();YL($,l,i,n)}catch{}finally{clearTimeout(f)}}return i},"fetchSocketReports"),YL=Ve((e,t,r,n)=>{const s=new Map;for(const o of t)s.set(`${o.name}@${o.version}`,o);const i=e.split(`}
|
|
1058
|
-
`);for(const o of i){const a=o.trim();if(a)try{const c=JSON.parse(a.endsWith("}")?a:`${a}}`),l=`${c.namespace?`${c.namespace}/`:""}${c.name}`,u=`${l}@${c.version}`;if(!s.has(u))continue;const p=c.score.overall??
|
|
1059
|
-
`)},"formatReportDetailed");const
|
|
1060
|
-
`)},"formatSecurityOverview"),Bw=Ve(()=>{const e=Yo();if(!j(e))return 0;const t=Ze(e).filter(r=>r.endsWith(".json"));for(const r of t)Nt(D(e,r),{force:!0});return t.length},"clearSocketCache"),ac=Ve(()=>{const e=Yo();if(!j(e))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const t=Ze(e).filter(i=>i.endsWith(".json"));let r=0,n,s;for(const i of t){const o=cr(D(e,i));r+=o.size;const{mtimeMs:a}=o;(n===void 0||a<n)&&(n=a),(s===void 0||a>s)&&(s=a)}return{entries:t.length,newestEntry:s,oldestEntry:n,totalSizeBytes:r}},"getSocketCacheStats"),
|
|
1061
|
-
`),"formatAcceptedRiskSnippet"),
|
|
1057
|
+
`,s)}}var uL=Object.defineProperty,Dw=te((e,t)=>uL(e,"name",{value:t,configurable:!0}),"o");const pL=Dw(()=>co.NODE_ENV==="debug"||co.DEBUG!==void 0?"debug":co.NODE_ENV==="test"?"warning":"informational","getDefaultLogLevel"),Cw=Dw(e=>{let t=pL();return co.PAIL_LOG_LEVEL!==void 0&&(t=co.PAIL_LOG_LEVEL),new PI({logLevel:t,processors:[new tL],reporters:[new lL],stderr:ff,stdout:df,...e})},"createPail");Cw();const P=Cw();var dL=Object.defineProperty,ai=d((e,t)=>dL(e,"name",{value:t,configurable:!0}),"m$l");const ip=ai((e,t)=>e.tasks.find(r=>r.taskId===t),"findTaskInSummary"),su=ai((e,t)=>{const r=e??{},n=t??{},s=[],i=[],o=[];for(const a of Object.keys(r))a in n?r[a]!==n[a]&&o.push(a):s.push(a);for(const a of Object.keys(n))a in r||i.push(a);return s.sort(),i.sort(),o.sort(),{added:s,changed:o,removed:i}},"diffHashBuckets"),fL=ai((e,t)=>({commandChanged:(e?.command??"")!==(t?.command??""),implicitDeps:su(e?.implicitDeps,t?.implicitDeps),nodes:su(e?.nodes,t?.nodes),runtime:su(e?.runtime,t?.runtime)}),"diffHashDetails"),Ew=ai(async(e,t)=>{const r=D(hn(e),`${t}.json`);try{const n=await Ug(r,"utf8");return JSON.parse(n)}catch{return}},"readRunSummaryById"),hL=ai(async(e,t)=>{const r=hn(e);let n;try{n=await So(r)}catch{return}const s=[];for(const i of n){if(!i.endsWith(".json")||t!==void 0&&i===`${t}.json`)continue;const o=D(r,i);try{const a=await qs(o);a.isFile()&&s.push({mtimeMs:a.mtimeMs,path:o})}catch{}}if(s.length!==0){s.sort((i,o)=>o.mtimeMs-i.mtimeMs);try{const i=await Ug(s[0].path,"utf8");return JSON.parse(i)}catch{return}}},"readPreviousRunSummary"),PJ=ai(async e=>{const t=hn(e);let r;try{r=await So(t)}catch{return[]}const n=[];for(const s of r){if(!s.endsWith(".json"))continue;const i=D(t,s);try{const o=await qs(i);o.isFile()&&n.push({id:s.slice(0,-5),mtimeMs:o.mtimeMs,path:i})}catch{}}return n.sort((s,i)=>i.mtimeMs-s.mtimeMs),n},"listRunSummaries");var mL=Object.defineProperty,Ue=d((e,t)=>mL(e,"name",{value:t,configurable:!0}),"i$o");const $f="https://api.deps.dev/v3",gL=15e3,yL=10080*60*1e3,vL=1440*60*1e3,bL=10080*60*1e3,iu=8,Os=Ue(e=>D(Ic(),"deps-dev",e),"getCacheDirectory"),$L={"Binary-Artifacts":"supplyChain","Branch-Protection":"supplyChain","CII-Best-Practices":"quality","Code-Review":"maintenance",Contributors:"maintenance","Dangerous-Workflow":"supplyChain","Dependency-Update-Tool":"maintenance",Fuzzing:"quality",License:"license",Maintained:"maintenance",Packaging:"quality","Pinned-Dependencies":"supplyChain",SAST:"quality","Security-Policy":"quality","Signed-Releases":"supplyChain","Token-Permissions":"supplyChain",Vulnerabilities:"vulnerability",Webhooks:"supplyChain"},wf=Ue(e=>e.map(t=>encodeURIComponent(t)).join("__"),"buildCacheKey"),kf=Ue((e,t)=>{try{const r=le(D(e,`${t}.json`));if(Date.now()-r.createdAt>r.ttlMs){Nt(D(e,`${t}.json`),{force:!0});return}return r.payload}catch{return}},"readCache"),Sf=Ue((e,t,r,n)=>{$t(e);const s={createdAt:Date.now(),payload:r,ttlMs:n};Oe(D(e,`${t}.json`),JSON.stringify(s),"utf8")},"writeCache"),Df=Ue(async(e,t)=>{const r=new AbortController,n=setTimeout(()=>{r.abort()},t);try{const s=await fetch(e,{headers:{Accept:"application/json","User-Agent":"@visulima/vis"},signal:r.signal});return s.ok?await s.json():void 0}catch{return}finally{clearTimeout(n)}},"fetchJson"),wL=Ue(async(e,t,r,n)=>{const s=Os("versions"),i=wf([e,t]),o=kf(s,i);if(o)return o;const a=`${$f}/systems/npm/packages/${encodeURIComponent(e)}/versions/${encodeURIComponent(t)}`,c=await Df(a,r);return c&&Sf(s,i,c,n),c},"fetchVersion"),kL=Ue(async(e,t,r)=>{const n=Os("projects"),s=wf([e]),i=kf(n,s);if(i)return i;const o=`${$f}/projects/${encodeURIComponent(e)}`,a=await Df(o,t);return a&&Sf(n,s,a,r),a},"fetchProject"),SL=Ue(async(e,t,r)=>{const n=Os("advisories"),s=wf([e]),i=kf(n,s);if(i)return i;const o=`${$f}/advisories/${encodeURIComponent(e)}`,a=await Df(o,t);return a&&Sf(n,s,a,r),a},"fetchAdvisory"),DL=Ue(e=>{const t={license:[],maintenance:[],quality:[],supplyChain:[],vulnerability:[]};if(e?.checks)for(const s of e.checks){if(s.score<0)continue;const i=$L[s.name];i&&t[i].push(s.score/10)}const r=Ue(s=>s.length===0?.5:Number((s.reduce((i,o)=>i+o,0)/s.length).toFixed(2)),"avg"),n=e?.overallScore===void 0?Number(((r(t.license)+r(t.maintenance)+r(t.quality)+r(t.supplyChain)+r(t.vulnerability))/5).toFixed(2)):Number((e.overallScore/10).toFixed(2));return{license:r(t.license),maintenance:r(t.maintenance),overall:n,quality:r(t.quality),supplyChain:r(t.supplyChain),vulnerability:r(t.vulnerability)}},"scorecardToScore"),jw=Ue(e=>e===void 0?"medium":e>=9?"critical":e>=7?"high":e>=4?"medium":"low","cvssToSeverity"),CL=Ue((e,t,r)=>{const n=t?.aliases?.find(i=>i.startsWith("CVE-")),s={category:"vulnerability",key:e,severity:jw(t?.cvss3Score),type:"vulnerability"};return n?s.props={cveId:n,lastPublish:r??""}:r&&(s.props={lastPublish:r}),s},"advisoryToAlert"),EL=Ue(e=>e?e.find(t=>t.relationType==="SOURCE_REPO"&&t.projectKey?.id)?.projectKey?.id??e.find(t=>t.projectKey?.id)?.projectKey?.id:void 0,"pickProjectId"),jL=Ue(async(e,t={})=>{const r=new Map;if(e.length===0)return r;const{advisoryCacheTtlMs:n=bL,projectCacheTtlMs:s=vL,timeoutMs:i=gL,versionCacheTtlMs:o=yL}=t,a=new Map,c=[...e],l=Ue(async()=>{for(;;){const h=c.shift();if(!h)return;const v=await wL(h.name,h.version,i,o);v&&a.set(`${h.name}@${h.version}`,v)}},"versionWorker");await Promise.all(Array.from({length:Math.min(iu,e.length)},l));const u=new Set,p=new Set,f=new Map;for(const[h,v]of a){const w=EL(v.relatedProjects);f.set(h,w),w&&u.add(w);for(const g of v.advisoryKeys??[])p.add(g.id)}const m=new Map,$=new Map,b=[...u],k=[...p],S=Ue(async()=>{for(;;){const h=b.shift();if(!h)return;m.set(h,await kL(h,i,s))}},"projectWorker"),y=Ue(async()=>{for(;;){const h=k.shift();if(!h)return;$.set(h,await SL(h,i,n))}},"advisoryWorker");await Promise.all([...Array.from({length:Math.min(iu,u.size)},S),...Array.from({length:Math.min(iu,p.size)},y)]);for(const h of e){const v=`${h.name}@${h.version}`,w=a.get(v);if(!w)continue;const g=f.get(v),E=g?m.get(g):void 0,C=DL(E?.scorecard),A=(w.advisoryKeys??[]).map(U=>CL(U.id,$.get(U.id),w.publishedAt));if(A.length>0){const U=A.some(M=>M.severity==="critical"||M.severity==="high");C.vulnerability=Math.min(C.vulnerability,U?.2:.5),C.overall=Number(((C.license+C.maintenance+C.quality+C.supplyChain+C.vulnerability)/5).toFixed(2))}const{versionKey:O}=w,I=O?.name??h.name,V=I.startsWith("@")?I.slice(0,I.indexOf("/")):void 0,fe=V?I.slice(V.length+1):I,Y={alerts:A,author:[],id:`pkg:npm/${I}@${h.version}`,license:E?.license??w.licenses?.[0]??"",name:fe,score:C,size:0,type:"npm",version:h.version};V&&(Y.namespace=V),r.set(v,Y)}return r},"fetchDepsDevReports"),Aw=Ue(()=>[Os("versions"),Os("projects"),Os("advisories")],"cacheDirectories"),xw=Ue(()=>{let e=0;for(const t of Aw()){if(!j(t))continue;const r=Ze(t).filter(n=>n.endsWith(".json"));for(const n of r)Nt(D(t,n),{force:!0}),e+=1}return e},"clearDepsDevCache"),ic=Ue(()=>{let e=0,t=0,r,n;for(const s of Aw())if(j(s))for(const i of Ze(s).filter(o=>o.endsWith(".json"))){const o=cr(D(s,i));e+=1,t+=o.size,(r===void 0||o.mtimeMs<r)&&(r=o.mtimeMs),(n===void 0||o.mtimeMs>n)&&(n=o.mtimeMs)}return{entries:e,newestEntry:n,oldestEntry:r,totalSizeBytes:t}},"getDepsDevCacheStats"),AL=Ue(e=>{if(!e?.enabled)return;const t={advisoryCacheTtlMs:e.advisoryCacheTtlMs,projectCacheTtlMs:e.projectCacheTtlMs,timeoutMs:e.timeoutMs,versionCacheTtlMs:e.versionCacheTtlMs};return{clearCache:xw,displayName:"deps.dev",fetchReports:Ue(r=>jL(r,t),"fetchReports"),getCacheStats:ic,id:"deps-dev"}},"createDepsDevProvider");var xL=Object.defineProperty,et=d((e,t)=>xL(e,"name",{value:t,configurable:!0}),"a$p");const op="https://api.snyk.io",OL="2024-10-15",PL=15e3,FL=360*60*1e3,BL=6,RL=10,TL=1e3,Cf=et(()=>D(Ic(),"snyk","issues"),"getCacheDirectory"),NL=et((e,t)=>`${encodeURIComponent(e)}__${encodeURIComponent(t)}`,"buildCacheKey"),IL=et((e,t)=>{try{const r=le(D(e,`${t}.json`));if(Date.now()-r.createdAt>r.ttlMs){Nt(D(e,`${t}.json`),{force:!0});return}return r.payload}catch{return}},"readCache"),LL=et((e,t,r,n)=>{$t(e);const s={createdAt:Date.now(),payload:r,ttlMs:n};Oe(D(e,`${t}.json`),JSON.stringify(s),"utf8")},"writeCache"),_L=et((e,t)=>encodeURIComponent(`pkg:npm/${e}@${t}`),"toPurl"),ML=et(e=>{try{const t=new URL(e,`${op}/`);return t.origin===op?t.toString():void 0}catch{return}},"resolveNextUrl"),WL=et(async(e,t,r)=>{const n=new AbortController,s=setTimeout(()=>{n.abort()},r);try{const i=await fetch(e,{headers:{Accept:"application/vnd.api+json",Authorization:`token ${t}`,"User-Agent":"@visulima/vis"},signal:n.signal});return i.ok?await i.json():void 0}catch{return}finally{clearTimeout(s)}},"fetchJson"),VL=et(async(e,t,r)=>{const n=Cf(),s=NL(e,t),i=IL(n,s);if(i)return i;const{apiToken:o,apiVersion:a,cacheTtlMs:c,orgId:l,timeoutMs:u}=r;let p=`${op}/rest/orgs/${encodeURIComponent(l)}/packages/${_L(e,t)}/issues?version=${encodeURIComponent(a)}&limit=${String(TL)}`;const f=[];for(let m=0;p&&m<RL;m+=1){const $=await WL(p,o,u);if(!$)return m===0?void 0:f;f.push(...$.data??[]),p=$.links?.next?ML($.links.next):void 0}return LL(n,s,f,c),f},"fetchIssues"),Mm=new Set(["critical","high","low","medium"]),UL=et(e=>{const t=e.attributes?.effective_severity_level?.toLowerCase();if(t&&Mm.has(t))return t;const r=e.attributes?.severities??[],n=r.find(i=>i.type==="primary")??r[0],s=n?.level?.toLowerCase();return s&&Mm.has(s)?s:jw(n?.score)},"issueSeverity"),GL=et(e=>{const t=e.attributes?.problems??[],r=t.find(i=>i.source==="CVE"||i.id.startsWith("CVE-")),n=t.filter(i=>i.source==="CWE"||i.id.startsWith("CWE-")).map(i=>({id:i.id})),s={category:"vulnerability",key:e.id,severity:UL(e),type:"vulnerability"};if(r){const i=e.attributes?.slots?.publication_time??e.attributes?.created_at??"";s.props={cveId:r.id,lastPublish:i},n.length>0&&(s.props.cwes=n)}return s},"issueToAlert"),qL=et(()=>({license:.5,maintenance:.5,overall:.5,quality:.5,supplyChain:.5,vulnerability:.5}),"neutralScore"),HL=et((e,t,r)=>{const n=r.map(c=>GL(c)),s=qL();if(n.length>0){const c=n.some(l=>l.severity==="critical"||l.severity==="high");s.vulnerability=c?.2:.5,s.overall=Number(((s.license+s.maintenance+s.quality+s.supplyChain+s.vulnerability)/5).toFixed(2))}const i=e.startsWith("@")?e.slice(0,e.indexOf("/")):void 0,o=i?e.slice(i.length+1):e,a={alerts:n,author:[],id:`pkg:npm/${e}@${t}`,license:"",name:o,score:s,size:0,type:"npm",version:t};return i&&(a.namespace=i),a},"buildReport"),zL=et(async(e,t)=>{const r=new Map;if(e.length===0)return r;const n={apiToken:t.apiToken,apiVersion:t.apiVersion??OL,cacheTtlMs:t.cacheTtlMs??FL,orgId:t.orgId,timeoutMs:t.timeoutMs??PL},s=[...e],i=et(async()=>{for(;;){const o=s.shift();if(!o)return;const a=await VL(o.name,o.version,n);a!==void 0&&r.set(`${o.name}@${o.version}`,HL(o.name,o.version,a))}},"worker");return await Promise.all(Array.from({length:Math.min(BL,e.length)},i)),r},"fetchSnykReports"),Ow=et(()=>{const e=Cf();if(!j(e))return 0;let t=0;for(const r of Ze(e).filter(n=>n.endsWith(".json")))Nt(D(e,r),{force:!0}),t+=1;return t},"clearSnykCache"),oc=et(()=>{const e=Cf();let t=0,r=0,n,s;if(j(e))for(const i of Ze(e).filter(o=>o.endsWith(".json"))){const o=cr(D(e,i));t+=1,r+=o.size,(n===void 0||o.mtimeMs<n)&&(n=o.mtimeMs),(s===void 0||o.mtimeMs>s)&&(s=o.mtimeMs)}return{entries:t,newestEntry:s,oldestEntry:n,totalSizeBytes:r}},"getSnykCacheStats"),JL=et(e=>{if(!e?.enabled)return;const t=e.apiToken??process.env.VIS_SNYK_TOKEN,r=e.orgId??process.env.VIS_SNYK_ORG;if(!t||!r)return;const n={apiToken:t,apiVersion:e.apiVersion,cacheTtlMs:e.cacheTtlMs,orgId:r,timeoutMs:e.timeoutMs};return{clearCache:Ow,displayName:"Snyk",fetchReports:et(s=>zL(s,n),"fetchReports"),getCacheStats:oc,id:"snyk"}},"createSnykProvider");var KL=Object.defineProperty,Ve=d((e,t)=>KL(e,"name",{value:t,configurable:!0}),"c$r");const YL="https://api.socket.dev/v0/purl?alerts=true",Yo=Ve(()=>D(Ic(),"socket-security"),"getCacheDirectory"),XL=3600*1e3,Ef=.4,Wm=100,QL=Ve(e=>typeof e=="object"&&e!==null&&"id"in e&&"type"in e&&"name"in e&&"version"in e&&"alerts"in e&&"score"in e&&e.type==="npm","isPackageReportData"),ZL=Ve(()=>{$t(Yo())},"ensureCacheDirectory"),Pw=Ve((e,t)=>`${encodeURIComponent(e)}@${encodeURIComponent(t)}`,"buildCacheKey"),e9=Ve((e,t)=>{const r=Pw(e,t),n=D(Yo(),`${r}.json`);try{const s=le(n);if(Date.now()-s.createdAt>s.ttlMs){Nt(n,{force:!0});return}return s.report}catch{return}},"getCachedReport"),t9=Ve((e,t,r,n)=>{const s=Pw(e,t),i={createdAt:Date.now(),report:r,ttlMs:n};Oe(D(Yo(),`${s}.json`),JSON.stringify(i),"utf8")},"setCachedReport"),r9=Ve(e=>{const t=[e.license,e.maintenance,e.quality,e.supplyChain,e.vulnerability];return Number((t.reduce((r,n)=>r+n,0)/t.length).toFixed(2))},"calculateOverallScore"),n9=Ve(async(e,t={})=>{const{apiToken:r,cacheTtlMs:n=XL,timeoutMs:s=15e3}=t,i=new Map;if(e.length===0||!r)return i;const o=[];for(const l of e){const u=e9(l.name,l.version);u?i.set(`${l.name}@${l.version}`,u):o.push(l)}if(o.length===0)return i;const a=`Basic ${Buffer.from(`${r}:`).toString("base64")}`;ZL();const c=[];for(let l=0;l<o.length;l+=Wm)c.push(o.slice(l,l+Wm));for(const l of c){const u=l.map(m=>({purl:`pkg:npm/${m.name}@${m.version}`})),p=new AbortController,f=setTimeout(()=>{p.abort()},s);try{const m=await fetch(YL,{body:JSON.stringify({components:u}),headers:{Authorization:a,"Content-Type":"application/json","User-Agent":"@visulima/vis"},method:"POST",signal:p.signal});if(!m.ok)continue;const $=await m.text();s9($,l,i,n)}catch{}finally{clearTimeout(f)}}return i},"fetchSocketReports"),s9=Ve((e,t,r,n)=>{const s=new Map;for(const o of t)s.set(`${o.name}@${o.version}`,o);const i=e.split(`}
|
|
1058
|
+
`);for(const o of i){const a=o.trim();if(a)try{const c=JSON.parse(a.endsWith("}")?a:`${a}}`),l=`${c.namespace?`${c.namespace}/`:""}${c.name}`,u=`${l}@${c.version}`;if(!s.has(u))continue;const p=c.score.overall??r9(c.score),f={alerts:c.alerts,author:c.author,id:c.id,license:c.license,name:c.name,score:{...c.score,overall:p},size:c.size,type:"npm",version:c.version};c.namespace&&(f.namespace=c.namespace),QL(f)&&(r.set(u,f),t9(l,c.version,f,n))}catch{}}},"parseNdjsonResponse"),Fw=Ve(e=>e.namespace?`${e.namespace}/${e.name}`:e.name,"getFullPackageName"),i9=Ve(e=>e>=.8?"excellent":e>=.6?"good":e>=.4?"fair":e>=.2?"poor":"critical","scoreLabel"),FJ=Ve(e=>e>=.6?"green":e>=.4?"yellow":"red","scoreColor"),BJ=Ve(e=>{const t=Fw(e),r=`score: ${String(Math.round(e.score.overall*100))}%`,n=e.alerts.length,s=n>0?`${String(n)} alert${n===1?"":"s"}`:"no alerts";return`${t}@${e.version} (${r}, ${s})`},"formatReportSummary");Ve(e=>{const t=[`${Fw(e)}@${e.version}`,` License: ${e.license||"unknown"}`,` Overall Score: ${String(Math.round(e.score.overall*100))}% (${i9(e.score.overall)})`,` Supply Chain: ${String(Math.round(e.score.supplyChain*100))}%`,` Quality: ${String(Math.round(e.score.quality*100))}%`,` Maintenance: ${String(Math.round(e.score.maintenance*100))}%`,` Vulnerability: ${String(Math.round(e.score.vulnerability*100))}%`,` License: ${String(Math.round(e.score.license*100))}%`];if(e.alerts.length>0){t.push(` Alerts (${String(e.alerts.length)}):`);for(const r of e.alerts){const n=r.props?.cveId?` (${r.props.cveId})`:"";t.push(` [${r.severity.toUpperCase()}] ${r.type}${n} — ${r.category}`)}}return t.join(`
|
|
1059
|
+
`)},"formatReportDetailed");const o9=Ve((e,t=Ef)=>{if(e.size===0)return"";let r=0,n=0,s=0,i=0,o=0,a=0;for(const l of e.values()){for(const u of l.alerts)switch(r++,u.severity){case"critical":{n++;break}case"high":{s++;break}case"medium":{i++;break}default:o++}l.score.overall<t&&a++}const c=[`Socket.dev: scanned ${String(e.size)} package${e.size===1?"":"s"}`];if(r>0){const l=[];n>0&&l.push(`${String(n)} critical`),s>0&&l.push(`${String(s)} high`),i>0&&l.push(`${String(i)} medium`),o>0&&l.push(`${String(o)} low`),c.push(` Alerts: ${String(r)} total (${l.join(", ")})`)}else c.push(" No security alerts found.");if(a>0){const l=Math.round(t*100);c.push(` ${String(a)} package${a===1?"":"s"} with low security score (<${String(l)}%)`)}return c.join(`
|
|
1060
|
+
`)},"formatSecurityOverview"),Bw=Ve(()=>{const e=Yo();if(!j(e))return 0;const t=Ze(e).filter(r=>r.endsWith(".json"));for(const r of t)Nt(D(e,r),{force:!0});return t.length},"clearSocketCache"),ac=Ve(()=>{const e=Yo();if(!j(e))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const t=Ze(e).filter(i=>i.endsWith(".json"));let r=0,n,s;for(const i of t){const o=cr(D(e,i));r+=o.size;const{mtimeMs:a}=o;(n===void 0||a<n)&&(n=a),(s===void 0||a>s)&&(s=a)}return{entries:t.length,newestEntry:s,oldestEntry:n,totalSizeBytes:r}},"getSocketCacheStats"),a9=Ve((e,t)=>e?.enabled?{apiToken:e.apiToken??process.env.VIS_SOCKET_TOKEN,cacheTtlMs:e.cacheTtlMs,minimumScore:t??Ef,timeoutMs:e.timeoutMs}:void 0,"buildSocketOptions"),c9=Ve((e,t,r,n)=>{if(!r)return;const s=Date.now(),i=Ve(a=>{if(a.expiresAt){const c=Date.parse(a.expiresAt);if(!Number.isNaN(c)&&c<s)return!1}return!(n&&a.policies&&!a.policies.includes(n))},"matches"),o=`${e}@${t}`;if(r[o]&&i(r[o]))return r[o];if(r[e]&&i(r[e]))return r[e];for(const[a,c]of Object.entries(r))if(a.endsWith("*")&&e.startsWith(a.slice(0,-1))&&i(c))return c},"findAcceptedRisk"),RJ=Ve((e,t,r,n)=>[" // Add to security.acceptedRisks in vis.config.ts:",` ${`"${e}"`}: {`,` reason: "${n}",`,` acceptedAt: "${new Date().toISOString()}",`,` acceptedScore: ${String(r)},`,' policies: ["score"],'," },"].join(`
|
|
1061
|
+
`),"formatAcceptedRiskSnippet"),l9=Ve((e,t={})=>{const r=a9(e,t.minimumScore);if(r)return{clearCache:Bw,displayName:"Socket.dev",fetchReports:Ve(n=>n9(n,r),"fetchReports"),getCacheStats:ac,id:"socket"}},"createSocketProvider");var u9=Object.defineProperty,he=d((e,t)=>u9(e,"name",{value:t,configurable:!0}),"f$b");const Rw=he(async e=>{let t=0;try{const r=await So(e,{withFileTypes:!0});for(const n of r){const s=D(e,n.name);if(n.isDirectory())t+=await Rw(s);else if(n.isFile()){const i=await qs(s);t+=i.size}}}catch{}return t},"sumDirectorySize"),cn=he(async e=>{const t=[];let r;try{r=await So(e)}catch{return[]}for(const n of r){if(n.startsWith("."))continue;const s=D(e,n);try{const i=await qs(s);if(!i.isDirectory())continue;const o=await Rw(s);t.push({hash:n,mtimeMs:i.mtimeMs,path:s,sizeBytes:o})}catch{}}return t.sort((n,s)=>s.mtimeMs-n.mtimeMs),t},"collectCacheEntries"),Tw=he((e,t=Date.now())=>{const r=Math.max(0,Math.floor((t-e)/1e3));return r<60?`${String(r)}s`:r<3600?`${String(Math.floor(r/60))}m`:r<86400?`${String(Math.floor(r/3600))}h`:`${String(Math.floor(r/86400))}d`},"formatAge"),p9=he(e=>new Promise(t=>{const r=Ap({input:process.stdin,output:process.stderr});r.question(`${e} (y/N) `,n=>{r.close();const s=n.trim().toLowerCase();t(s==="y"||s==="yes")})}),"confirmPrompt"),Nw=he(async(e,t,r)=>{if(!j(e)){if(t==="json"){process.stdout.write(`${JSON.stringify({directory:e,entries:[],totalBytes:0,totalCount:0},void 0,2)}
|
|
1062
1062
|
`);return}P.info(`No cache directory found at ${e}`);return}const n=await cn(e);if(n.length===0){if(t==="json"){process.stdout.write(`${JSON.stringify({directory:e,entries:[],totalBytes:0,totalCount:0},void 0,2)}
|
|
1063
1063
|
`);return}P.info(`Cache directory is empty: ${e}`);return}const s=n.reduce((u,p)=>u+p.sizeBytes,0);if(t==="json"){const u=Date.now();process.stdout.write(`${JSON.stringify({directory:e,entries:n.map(p=>({ageMs:u-p.mtimeMs,hash:p.hash,mtimeIso:new Date(p.mtimeMs).toISOString(),sizeBytes:p.sizeBytes})),totalBytes:s,totalCount:n.length},void 0,2)}
|
|
1064
|
-
`);return}P.info(`Cache directory: ${e}`),P.info(`Entries: ${String(n.length)} (${Ms(s,{decimals:1,space:!1})})`),r.info("");const i=Date.now(),o=n.map(u=>({age:Tw(u.mtimeMs,i),hash:u.hash.slice(0,12),size:Ms(u.sizeBytes,{decimals:1,space:!1})})),a=Math.max(4,...o.map(u=>u.hash.length)),c=Math.max(4,...o.map(u=>u.size.length)),l=Math.max(3,...o.map(u=>u.age.length));r.info(` ${"hash".padEnd(a)} ${"size".padEnd(c)} ${"age".padEnd(l)}`),r.info(` ${"-".repeat(a)} ${"-".repeat(c)} ${"-".repeat(l)}`);for(const u of o)r.info(` ${u.hash.padEnd(a)} ${u.size.padEnd(c)} ${u.age.padEnd(l)}`)},"runList"),Iw=he(()=>{try{const e=PF();e>0&&P.info(`Cleared ${String(e)} cached AI response${e===1?"":"s"}.`)}catch(e){P.warn(`Failed to clear AI response cache: ${e instanceof Error?e.message:String(e)}`)}},"clearAiCacheSafe"),Lw=he(()=>{try{const e=Bw();e>0&&P.info(`Cleared ${String(e)} cached Socket.dev report${e===1?"":"s"}.`)}catch(e){P.warn(`Failed to clear Socket.dev cache: ${e instanceof Error?e.message:String(e)}`)}},"clearSocketCacheSafe"),_w=he(()=>{try{const e=xw();e>0&&P.info(`Cleared ${String(e)} cached deps.dev record${e===1?"":"s"}.`)}catch(e){P.warn(`Failed to clear deps.dev cache: ${e instanceof Error?e.message:String(e)}`)}},"clearDepsDevCacheSafe"),Mw=he(()=>{try{const e=Ow();e>0&&P.info(`Cleared ${String(e)} cached Snyk record${e===1?"":"s"}.`)}catch(e){P.warn(`Failed to clear Snyk cache: ${e instanceof Error?e.message:String(e)}`)}},"clearSnykCacheSafe"),Ww=he(async(e,t,r)=>{if(!j(e)){P.info(`No cache directory to clean at ${e}`);return}if(r.dryRun){const s=await cn(e),i=s.reduce((o,a)=>o+a.sizeBytes,0);P.info(`Would remove ${String(s.length)} cache entr${s.length===1?"y":"ies"} (${Ms(i,{decimals:1,space:!1})}) from ${e}`);return}const n=qx(e,t);try{const s=await ph(e),i=await ph(t);if(s===i){P.error("Refusing to delete the workspace root. The cache directory resolved to the same path as the workspace."),process.exitCode=1;return}}catch{}if(!n&&!r.force){if(P.warn(`Cache directory is outside the workspace root: ${e}`),P.warn("This will recursively delete the entire directory, including anything stored there by other tools."),!process.stdin.isTTY){P.error("Refusing to clean an out-of-workspace cache without --force (stdin is not a TTY)."),process.exitCode=1;return}if(!await
|
|
1064
|
+
`);return}P.info(`Cache directory: ${e}`),P.info(`Entries: ${String(n.length)} (${Ms(s,{decimals:1,space:!1})})`),r.info("");const i=Date.now(),o=n.map(u=>({age:Tw(u.mtimeMs,i),hash:u.hash.slice(0,12),size:Ms(u.sizeBytes,{decimals:1,space:!1})})),a=Math.max(4,...o.map(u=>u.hash.length)),c=Math.max(4,...o.map(u=>u.size.length)),l=Math.max(3,...o.map(u=>u.age.length));r.info(` ${"hash".padEnd(a)} ${"size".padEnd(c)} ${"age".padEnd(l)}`),r.info(` ${"-".repeat(a)} ${"-".repeat(c)} ${"-".repeat(l)}`);for(const u of o)r.info(` ${u.hash.padEnd(a)} ${u.size.padEnd(c)} ${u.age.padEnd(l)}`)},"runList"),Iw=he(()=>{try{const e=PF();e>0&&P.info(`Cleared ${String(e)} cached AI response${e===1?"":"s"}.`)}catch(e){P.warn(`Failed to clear AI response cache: ${e instanceof Error?e.message:String(e)}`)}},"clearAiCacheSafe"),Lw=he(()=>{try{const e=Bw();e>0&&P.info(`Cleared ${String(e)} cached Socket.dev report${e===1?"":"s"}.`)}catch(e){P.warn(`Failed to clear Socket.dev cache: ${e instanceof Error?e.message:String(e)}`)}},"clearSocketCacheSafe"),_w=he(()=>{try{const e=xw();e>0&&P.info(`Cleared ${String(e)} cached deps.dev record${e===1?"":"s"}.`)}catch(e){P.warn(`Failed to clear deps.dev cache: ${e instanceof Error?e.message:String(e)}`)}},"clearDepsDevCacheSafe"),Mw=he(()=>{try{const e=Ow();e>0&&P.info(`Cleared ${String(e)} cached Snyk record${e===1?"":"s"}.`)}catch(e){P.warn(`Failed to clear Snyk cache: ${e instanceof Error?e.message:String(e)}`)}},"clearSnykCacheSafe"),Ww=he(async(e,t,r)=>{if(!j(e)){P.info(`No cache directory to clean at ${e}`);return}if(r.dryRun){const s=await cn(e),i=s.reduce((o,a)=>o+a.sizeBytes,0);P.info(`Would remove ${String(s.length)} cache entr${s.length===1?"y":"ies"} (${Ms(i,{decimals:1,space:!1})}) from ${e}`);return}const n=qx(e,t);try{const s=await ph(e),i=await ph(t);if(s===i){P.error("Refusing to delete the workspace root. The cache directory resolved to the same path as the workspace."),process.exitCode=1;return}}catch{}if(!n&&!r.force){if(P.warn(`Cache directory is outside the workspace root: ${e}`),P.warn("This will recursively delete the entire directory, including anything stored there by other tools."),!process.stdin.isTTY){P.error("Refusing to clean an out-of-workspace cache without --force (stdin is not a TTY)."),process.exitCode=1;return}if(!await p9(" Continue?")){P.info("Aborted.");return}}n?await new Ra({cacheDirectory:e,workspaceRoot:t}).clear():await Ep(e,{force:!0,recursive:!0}),P.success(`Cleared cache: ${e}`)},"runClean"),Vw=he(async(e,t,r)=>{if(!j(e)){P.info(`No cache directory to prune at ${e}`);return}if(r.maxCacheAgeDays!==void 0&&(!Number.isFinite(r.maxCacheAgeDays)||r.maxCacheAgeDays<0)){P.error(`Invalid --max-age-days value: expected a finite number >= 0, got ${String(r.maxCacheAgeDays)}`),process.exitCode=1;return}if(r.keepLast!==void 0&&(!Number.isFinite(r.keepLast)||r.keepLast<0||!Number.isInteger(r.keepLast))){P.error(`Invalid --keep-last value: expected a non-negative integer, got ${String(r.keepLast)}`),process.exitCode=1;return}if(r.maxCacheSize!==void 0){let u;try{u=iS(r.maxCacheSize)}catch(p){P.error(`Invalid --max-size value: ${p instanceof Error?p.message:String(p)}`),process.exitCode=1;return}if(!Number.isFinite(u)||u<=0){P.error(`Invalid --max-size value: expected a positive size, got "${r.maxCacheSize}" (${String(u)} bytes)`),process.exitCode=1;return}}const n=r.maxCacheAgeDays===void 0?void 0:r.maxCacheAgeDays*24*60*60*1e3,s=await cn(e),i=s.reduce((u,p)=>u+p.sizeBytes,0);if(r.keepLast!==void 0&&s.length>r.keepLast){const u=s.slice(r.keepLast);await Promise.all(u.map(p=>Ep(p.path,{force:!0,recursive:!0})))}await new Ra({cacheDirectory:e,maxCacheAge:n,maxCacheSize:r.maxCacheSize,workspaceRoot:t}).removeOldEntries();const o=await cn(e),a=o.reduce((u,p)=>u+p.sizeBytes,0),c=s.length-o.length,l=i-a;if(c<=0){P.info("Nothing to prune — all entries are within the configured limits.");return}P.success(`Pruned ${String(c)} entr${c===1?"y":"ies"}, freed ${Ms(l,{decimals:1,space:!1})}.`)},"runPrune"),Vm=16,Uw=he(e=>e.length>Vm?`${e.slice(0,Vm)}…`:e,"truncateHash"),ou=he((e,t,r)=>{const n=Object.entries(t??{});if(n.length!==0){r.info(` ${e}:`),n.sort(([s],[i])=>s.localeCompare(i));for(const[s,i]of n)r.info(` ${s.padEnd(40)} ${Uw(i)}`)}},"renderHashDetailsBucket"),Gw=he(async(e,t,r)=>{const{format:n,runId:s,workspaceRoot:i}=t,o=s===void 0?await Jg(i,{dataDirectory:Pr(i)}):await Ew(i,s);if(!o){if(n==="json"){process.stdout.write(`${JSON.stringify({error:"no-summary",runId:s??null,taskId:e},void 0,2)}
|
|
1065
1065
|
`),process.exitCode=1;return}s===void 0?P.error(`No previous run summary found. Run a task first to populate \`${vu(i,{dataDirectory:Pr(i)})}\`.`):P.error(`Run summary "${s}" not found in ${hn(i)}/.`),process.exitCode=1;return}const a=ip(o,e);if(!a){if(n==="json"){process.stdout.write(`${JSON.stringify({error:"task-not-in-summary",runId:o.id,taskId:e},void 0,2)}
|
|
1066
|
-
`),process.exitCode=1;return}P.error(`Task "${e}" was not part of run ${o.id}.`),P.info(`Tasks in this run: ${o.tasks.map(p=>p.taskId).join(", ")||"(none)"}`),process.exitCode=1;return}const c=await
|
|
1066
|
+
`),process.exitCode=1;return}P.error(`Task "${e}" was not part of run ${o.id}.`),P.info(`Tasks in this run: ${o.tasks.map(p=>p.taskId).join(", ")||"(none)"}`),process.exitCode=1;return}const c=await hL(i,o.id),l=c?ip(c,e):void 0,u=fL(a.hashDetails,l?.hashDetails);if(n==="json"){process.stdout.write(`${JSON.stringify({diff:u,previousRunId:c?.id??null,previousTask:l?{cacheStatus:l.cacheStatus,hash:l.hash??null,hashDetails:l.hashDetails??null}:null,runId:o.id,task:{cacheStatus:a.cacheStatus,hash:a.hash??null,hashDetails:a.hashDetails??null,taskId:a.taskId}},void 0,2)}
|
|
1067
1067
|
`);return}if(P.info(`Why ${e}? (run ${o.id})`),r.info(""),r.info(` status: ${a.cacheStatus}`),r.info(` hash: ${a.hash??"(none)"}`),l?r.info(` prev: ${l.hash??"(none)"} [run ${c?.id??"?"}]`):r.info(" prev: (no prior run found)"),r.info(""),!l){P.info("No previous run to diff against — first time this task was recorded.");return}if(!u.commandChanged&&u.nodes.added.length===0&&u.nodes.changed.length===0&&u.nodes.removed.length===0&&u.runtime.added.length===0&&u.runtime.changed.length===0&&u.runtime.removed.length===0&&u.implicitDeps.added.length===0&&u.implicitDeps.changed.length===0&&u.implicitDeps.removed.length===0){P.success("No hash inputs changed since the previous run.");return}r.info("Hash inputs that changed since the previous run:"),r.info(""),u.commandChanged&&r.info(" command: changed");for(const p of["nodes","runtime","implicitDeps"]){const f=u[p];if(!(f.added.length===0&&f.changed.length===0&&f.removed.length===0)){r.info(` ${p}:`);for(const m of f.added)r.info(` + ${m}`);for(const m of f.changed)r.info(` ~ ${m}`);for(const m of f.removed)r.info(` - ${m}`)}}r.info(""),P.info(`Last summary file: ${vu(i,{dataDirectory:Pr(i)})}`)},"runWhy"),qw=he(async(e,t,r)=>{const{format:n,runId:s,workspaceRoot:i}=t,o=s===void 0?await Jg(i,{dataDirectory:Pr(i)}):await Ew(i,s);if(!o){if(n==="json"){process.stdout.write(`${JSON.stringify({error:"no-summary",runId:s??null,taskId:e},void 0,2)}
|
|
1068
1068
|
`),process.exitCode=1;return}s===void 0?P.error(`No previous run summary found. Run a task first to populate \`${vu(i,{dataDirectory:Pr(i)})}\`.`):P.error(`Run summary "${s}" not found in ${hn(i)}/.`),process.exitCode=1;return}const a=ip(o,e);if(!a){if(n==="json"){process.stdout.write(`${JSON.stringify({error:"task-not-in-summary",runId:o.id,taskId:e},void 0,2)}
|
|
1069
1069
|
`),process.exitCode=1;return}P.error(`Task "${e}" was not part of run ${o.id}.`),process.exitCode=1;return}if(n==="json"){process.stdout.write(`${JSON.stringify({cacheStatus:a.cacheStatus,hash:a.hash??null,hashDetails:a.hashDetails??null,runId:o.id,taskId:a.taskId},void 0,2)}
|
|
1070
1070
|
`);return}P.info(`Hash for ${e} (run ${o.id})`),r.info(""),r.info(` status: ${a.cacheStatus}`),r.info(` hash: ${a.hash??"(none)"}`),a.hashDetails?(r.info(""),r.info(` command: ${Uw(a.hashDetails.command)}`),ou("nodes",a.hashDetails.nodes,r),ou("runtime",a.hashDetails.runtime,r),ou("implicitDeps",a.hashDetails.implicitDeps,r)):(r.info(""),P.info("No hash details recorded for this task."))},"runHash"),Hw=he(async(e,t)=>{if(!j(e)){if(t==="json"){process.stdout.write(`${JSON.stringify({directory:e,exists:!1,totalBytes:0,totalCount:0})}
|
|
1071
1071
|
`);return}P.info(`No cache directory at ${e}`);return}const r=await cn(e),n=r.reduce((s,i)=>s+i.sizeBytes,0);if(t==="json"){process.stdout.write(`${JSON.stringify({directory:e,exists:!0,totalBytes:n,totalCount:r.length})}
|
|
1072
|
-
`);return}P.info(`Cache directory: ${e}`),P.info(`Entries: ${String(r.length)}`),P.info(`Total size: ${Ms(n,{decimals:1,space:!1})}`)},"runSize"),
|
|
1072
|
+
`);return}P.info(`Cache directory: ${e}`),P.info(`Entries: ${String(r.length)}`),P.info(`Total size: ${Ms(n,{decimals:1,space:!1})}`)},"runSize"),d9=he(async e=>{const t=[],r=he(async n=>{const s=(await So(n,{withFileTypes:!0})).toSorted((i,o)=>i.name.localeCompare(o.name));for(const i of s){const o=D(n,i.name);if(i.isDirectory()){await r(o);continue}if(!i.isFile())continue;const[a,c]=await Promise.all([qs(o),Kg(o)]);t.push({hash:c?.hash??"",mode:a.mode&4095,mtimeMs:a.mtimeMs,relativePath:zn(e,o).replaceAll("\\","/"),sizeBytes:a.size})}},"walk");return await r(e),t},"walkAndDigest"),f9=he((e,t)=>Math.floor(e/1e3)===Math.floor(t/1e3),"compareSecondsTruncated"),Um=16,h9=he(async(e,t)=>{const r=D(t,e.relativePath),n=await qs(r).catch(()=>{});if(!n)return{expected:{hash:e.hash,mode:e.mode,mtimeMs:e.mtimeMs},issues:["missing"],relativePath:e.relativePath};const s=await Kg(r),i=[];(s?.hash??"")!==e.hash&&i.push("content");const o=n.mode&4095;if(process.platform!=="win32"&&o!==e.mode&&i.push("mode"),f9(n.mtimeMs,e.mtimeMs)||i.push("mtime"),i.length!==0)return{actual:{hash:s?.hash,mode:o,mtimeMs:n.mtimeMs},expected:{hash:e.hash,mode:e.mode,mtimeMs:e.mtimeMs},issues:i,relativePath:e.relativePath}},"computeFileDiff"),zw=he(async(e,t,r)=>{const{cacheDirectories:n,format:s,workspaceRoot:i}=t;if(n.length===0){s==="json"?process.stdout.write(`${JSON.stringify({error:"no-cache-directory",taskId:e},void 0,2)}
|
|
1073
1073
|
`):P.error("No cache directory resolved — pass --cache-dir or run inside a workspace."),process.exitCode=1;return}let o,a;for(const l of n){const u=await new Ra({cacheDirectory:l,workspaceRoot:i}).getByTaskId(e);if(u){o=l,a=u;break}}if(!a||!o){s==="json"?process.stdout.write(`${JSON.stringify({error:"no-cached-entry",searchedCaches:n,taskId:e},void 0,2)}
|
|
1074
1074
|
`):P.error(`No cached entry found for task "${e}". Run it once before verifying.`),process.exitCode=1;return}const c=await qk(D(lS(),"vis-cache-verify-"));try{if(!await new Ra({cacheDirectory:o,workspaceRoot:c}).restoreOutputs(a.hash)){s==="json"?process.stdout.write(`${JSON.stringify({error:"restore-failed",hash:a.hash,taskId:e},void 0,2)}
|
|
1075
|
-
`):P.error(`Cache restore failed for ${e} (hash ${a.hash}).`),process.exitCode=1;return}const l=await
|
|
1076
|
-
`):P.info(`Cached entry for ${e} has no recorded outputs — nothing to verify.`);return}const u=Array.from({length:l.length});for(let f=0;f<l.length;f+=Um){const m=l.slice(f,f+Um),$=await Promise.all(m.map(async b=>
|
|
1077
|
-
`),p.length>0&&(process.exitCode=1);return}if(P.info(`Verify ${e} (hash ${a.hash})`),r.info(""),r.info(` cache: ${o}`),r.info(` files: ${String(l.length)}`),p.length===0){r.info(""),P.success("Cache restore is faithful — all files match content, mode, and mtime.");return}r.info(` drift: ${String(p.length)} file(s)`),r.info("");for(const f of p){const m=f.issues.includes("missing")?"MISSING":f.issues.join(",").toUpperCase();r.info(` [${m}] ${f.relativePath}`),!f.issues.includes("missing")&&f.expected&&f.actual&&(f.issues.includes("content")&&(r.info(` expected hash: ${f.expected.hash||"(none)"}`),r.info(` actual hash: ${f.actual.hash??"(unreadable)"}`)),f.issues.includes("mode")&&(r.info(` expected mode: ${f.expected.mode.toString(8)}`),r.info(` actual mode: ${(f.actual.mode??0).toString(8)}`)),f.issues.includes("mtime")&&(r.info(` expected mtime: ${new Date(f.expected.mtimeMs).toISOString()}`),r.info(` actual mtime: ${f.actual.mtimeMs===void 0?"(unreadable)":new Date(f.actual.mtimeMs).toISOString()}`)))}process.exitCode=1}finally{await Ep(c,{force:!0,recursive:!0}).catch(()=>{})}},"runVerify"),Jw=he(e=>e==="task"||e==="ai"||e==="socket"||e==="deps-dev"||e==="snyk"||e==="all"?e:(e&&e.length>0&&P.warn(`Unknown --type value '${e}'; falling back to 'all'.`),"all"),"parseCacheTarget"),ft=he((e,t)=>e==="all"||e===t,"includesTarget"),Xt=he(e=>e===void 0?null:new Date(e).toISOString(),"isoOrNull"),fa=he((e,t)=>{P.info(`${e}:`),P.info(` Entries: ${String(t.entries)}`),P.info(` Total size: ${Ms(t.totalSizeBytes,{decimals:1,space:!1})}`),P.info(` Oldest: ${t.oldestEntry?new Date(t.oldestEntry).toISOString():"N/A"}`),P.info(` Newest: ${t.newestEntry?new Date(t.newestEntry).toISOString():"N/A"}`)},"printAuxStatsBlock"),
|
|
1078
|
-
`);return}if(ft(n,"task")){const{cacheDirectories:s}=Vs(r,e,t);for(const i of s)s.length>1&&P.info(`# ${i}`),await Hw(i,"table")}ft(n,"ai")&&fa("AI response cache",Ku()),ft(n,"socket")&&fa("Socket.dev report cache",ac()),ft(n,"deps-dev")&&fa("deps.dev cache",ic()),ft(n,"snyk")&&fa("Snyk issue cache",oc())},"cacheSizeExecute"),
|
|
1075
|
+
`):P.error(`Cache restore failed for ${e} (hash ${a.hash}).`),process.exitCode=1;return}const l=await d9(c);if(l.length===0){s==="json"?process.stdout.write(`${JSON.stringify({diffs:[],hash:a.hash,status:"no-outputs",taskId:e},void 0,2)}
|
|
1076
|
+
`):P.info(`Cached entry for ${e} has no recorded outputs — nothing to verify.`);return}const u=Array.from({length:l.length});for(let f=0;f<l.length;f+=Um){const m=l.slice(f,f+Um),$=await Promise.all(m.map(async b=>h9(b,i)));for(const[b,k]of $.entries())u[f+b]=k}const p=u.filter(f=>f!==void 0);if(s==="json"){process.stdout.write(`${JSON.stringify({cachedFileCount:l.length,cacheDirectory:o,diffs:p,hash:a.hash,status:p.length===0?"ok":"drift",taskId:e},void 0,2)}
|
|
1077
|
+
`),p.length>0&&(process.exitCode=1);return}if(P.info(`Verify ${e} (hash ${a.hash})`),r.info(""),r.info(` cache: ${o}`),r.info(` files: ${String(l.length)}`),p.length===0){r.info(""),P.success("Cache restore is faithful — all files match content, mode, and mtime.");return}r.info(` drift: ${String(p.length)} file(s)`),r.info("");for(const f of p){const m=f.issues.includes("missing")?"MISSING":f.issues.join(",").toUpperCase();r.info(` [${m}] ${f.relativePath}`),!f.issues.includes("missing")&&f.expected&&f.actual&&(f.issues.includes("content")&&(r.info(` expected hash: ${f.expected.hash||"(none)"}`),r.info(` actual hash: ${f.actual.hash??"(unreadable)"}`)),f.issues.includes("mode")&&(r.info(` expected mode: ${f.expected.mode.toString(8)}`),r.info(` actual mode: ${(f.actual.mode??0).toString(8)}`)),f.issues.includes("mtime")&&(r.info(` expected mtime: ${new Date(f.expected.mtimeMs).toISOString()}`),r.info(` actual mtime: ${f.actual.mtimeMs===void 0?"(unreadable)":new Date(f.actual.mtimeMs).toISOString()}`)))}process.exitCode=1}finally{await Ep(c,{force:!0,recursive:!0}).catch(()=>{})}},"runVerify"),Jw=he(e=>e==="task"||e==="ai"||e==="socket"||e==="deps-dev"||e==="snyk"||e==="all"?e:(e&&e.length>0&&P.warn(`Unknown --type value '${e}'; falling back to 'all'.`),"all"),"parseCacheTarget"),ft=he((e,t)=>e==="all"||e===t,"includesTarget"),Xt=he(e=>e===void 0?null:new Date(e).toISOString(),"isoOrNull"),fa=he((e,t)=>{P.info(`${e}:`),P.info(` Entries: ${String(t.entries)}`),P.info(` Total size: ${Ms(t.totalSizeBytes,{decimals:1,space:!1})}`),P.info(` Oldest: ${t.oldestEntry?new Date(t.oldestEntry).toISOString():"N/A"}`),P.info(` Newest: ${t.newestEntry?new Date(t.newestEntry).toISOString():"N/A"}`)},"printAuxStatsBlock"),m9=he(e=>e==="worktree"||e==="shared"||e==="all"?e:(e&&e.length>0&&P.warn(`Unknown --scope value '${e}'; falling back to 'shared'.`),"shared"),"parseScope"),Vs=he((e,t,r)=>{const n=e??process.cwd(),s=r??{},i=s.taskRunner??{},o=m9(t.scope),a=t.cacheDir,c=Xh(n,a,i.cacheDirectory,!1),l=Xh(n,a,i.cacheDirectory,s.sharedWorktreeCache);let u,p;switch(o){case"all":{u=l,p=l===c?[l]:[l,c];break}case"worktree":{u=c,p=[c];break}default:u=l,p=[l]}return{cacheDirectories:p,cacheDirectory:u,scope:o,sharedWorktreeCache:s.sharedWorktreeCache,workspaceRoot:n}},"resolveCacheDirectoryFromContext"),g9=he(async({logger:e,options:t,visConfig:r,workspaceRoot:n})=>{const{cacheDirectories:s}=Vs(n,t,r),i=t.format??"table";for(const o of s)s.length>1&&P.info(`# ${o}`),await Nw(o,i,e)},"cacheListExecute"),y9=he(async({options:e,visConfig:t,workspaceRoot:r})=>{const n=Jw(e.type),s=!!e.dryRun;if(ft(n,"task")){const{cacheDirectory:i,workspaceRoot:o}=Vs(r,e,t);await Ww(i,o,{dryRun:s,force:!!e.force})}if(ft(n,"ai"))if(s){const i=Ku();P.info(`Would clear ${String(i.entries)} cached AI response${i.entries===1?"":"s"}.`)}else Iw();if(ft(n,"socket"))if(s){const i=ac();P.info(`Would clear ${String(i.entries)} cached Socket.dev report${i.entries===1?"":"s"}.`)}else Lw();if(ft(n,"deps-dev"))if(s){const i=ic();P.info(`Would clear ${String(i.entries)} cached deps.dev record${i.entries===1?"":"s"}.`)}else _w();if(ft(n,"snyk"))if(s){const i=oc();P.info(`Would clear ${String(i.entries)} cached Snyk record${i.entries===1?"":"s"}.`)}else Mw()},"cacheCleanExecute"),v9=he(async({options:e,visConfig:t,workspaceRoot:r})=>{const{cacheDirectories:n,workspaceRoot:s}=Vs(r,e,t);for(const i of n)n.length>1&&P.info(`# ${i}`),await Vw(i,s,{keepLast:typeof e.keepLast=="number"?e.keepLast:void 0,maxCacheAgeDays:typeof e.maxAgeDays=="number"?e.maxAgeDays:void 0,maxCacheSize:e.maxSize})},"cachePruneExecute"),Kw=he(e=>e??process.cwd(),"resolveWorkspaceRoot"),b9=he(async({argument:e,logger:t,options:r,workspaceRoot:n})=>{const s=e[0];if(!s){P.error("No task ID specified. Usage: vis cache why <project>:<target>"),process.exitCode=1;return}await Gw(s,{format:r.format??"table",runId:r.run,workspaceRoot:Kw(n)},t)},"cacheWhyExecute"),$9=he(async({argument:e,logger:t,options:r,workspaceRoot:n})=>{const s=e[0];if(!s){P.error("No task ID specified. Usage: vis cache hash <project>:<target>"),process.exitCode=1;return}await qw(s,{format:r.format??"table",runId:r.run,workspaceRoot:Kw(n)},t)},"cacheHashExecute"),w9=he(async({options:e,visConfig:t,workspaceRoot:r})=>{const n=Jw(e.type);if((e.format??"table")==="json"){const s={};if(ft(n,"task")){const{cacheDirectories:i}=Vs(r,e,t);s.task=await Promise.all(i.map(async o=>{const a=j(o),c=a?await cn(o):[],l=c.reduce((u,p)=>u+p.sizeBytes,0);return{directory:o,entries:c.length,exists:a,newestEntry:Xt(c[0]?.mtimeMs),oldestEntry:Xt(c.at(-1)?.mtimeMs),totalBytes:l}}))}if(ft(n,"ai")){const i=Ku();s.ai={entries:i.entries,newestEntry:Xt(i.newestEntry),oldestEntry:Xt(i.oldestEntry),totalBytes:i.totalSizeBytes}}if(ft(n,"socket")){const i=ac();s.socket={entries:i.entries,newestEntry:Xt(i.newestEntry),oldestEntry:Xt(i.oldestEntry),totalBytes:i.totalSizeBytes}}if(ft(n,"deps-dev")){const i=ic();s["deps-dev"]={entries:i.entries,newestEntry:Xt(i.newestEntry),oldestEntry:Xt(i.oldestEntry),totalBytes:i.totalSizeBytes}}if(ft(n,"snyk")){const i=oc();s.snyk={entries:i.entries,newestEntry:Xt(i.newestEntry),oldestEntry:Xt(i.oldestEntry),totalBytes:i.totalSizeBytes}}process.stdout.write(`${JSON.stringify(s,void 0,2)}
|
|
1078
|
+
`);return}if(ft(n,"task")){const{cacheDirectories:s}=Vs(r,e,t);for(const i of s)s.length>1&&P.info(`# ${i}`),await Hw(i,"table")}ft(n,"ai")&&fa("AI response cache",Ku()),ft(n,"socket")&&fa("Socket.dev report cache",ac()),ft(n,"deps-dev")&&fa("deps.dev cache",ic()),ft(n,"snyk")&&fa("Snyk issue cache",oc())},"cacheSizeExecute"),k9=he(async({argument:e,logger:t,options:r,visConfig:n,workspaceRoot:s})=>{const i=e[0];if(!i){P.error("No task ID specified. Usage: vis cache verify <project>:<target>"),process.exitCode=1;return}const{cacheDirectories:o,workspaceRoot:a}=Vs(s,r,n);await zw(i,{cacheDirectories:o,format:r.format??"table",workspaceRoot:a},t)},"cacheVerifyExecute"),ls=Object.defineProperty({__proto__:null,cacheCleanExecute:y9,cacheHashExecute:$9,cacheListExecute:g9,cachePruneExecute:v9,cacheSizeExecute:w9,cacheVerifyExecute:k9,cacheWhyExecute:b9,clearAiCacheSafe:Iw,clearDepsDevCacheSafe:_w,clearSnykCacheSafe:Mw,clearSocketCacheSafe:Lw,collectCacheEntries:cn,formatAge:Tw,runClean:Ww,runHash:qw,runList:Nw,runPrune:Vw,runSize:Hw,runVerify:zw,runWhy:Gw},Symbol.toStringTag,{value:"Module"});var S9=Object.defineProperty,jf=d((e,t)=>S9(e,"name",{value:t,configurable:!0}),"i$n");const TJ=jf((e,t)=>{let r=0,n=0,s=0;for(const[,a]of e)switch(a.status){case"failure":{s+=1;break}case"local-cache":case"local-cache-kept-existing":case"remote-cache":{n+=1;break}case"success":{r+=1;break}}const i=[];r>0&&i.push(`${String(r)} succeeded`),n>0&&i.push(`${String(n)} cached`),s>0&&i.push(`${String(s)} failed`);const o=(t/1e3).toFixed(1);return i.push(`${o}s`),i.join(" · ")},"formatTimingSummary"),lo=jf(e=>{const t=hn(e);if(j(t)){const n=Ze(t).filter(i=>i.endsWith(".json")),s=[];for(const i of n)try{s.push(le(D(t,i)))}catch{}if(s.length>0)return s}const r=m0(e);if(j(r))try{return[le(r)]}catch{}return[]},"loadRunSummaries"),NJ=jf((e,t,r)=>{const n=r??lo(e);if(n.length<2)return;let s=0,i=0;for(const c of n)typeof c.duration=="number"&&c.duration>0&&(s+=c.duration,i+=1);if(i<2)return;const o=s/i-t,a=Math.abs(o/1e3).toFixed(1);return Math.abs(o)<500?"(about average)":o>0?`(${a}s faster than avg)`:`(${a}s slower than avg)`},"compareDuration");var D9=Object.defineProperty,ap=d((e,t)=>D9(e,"name",{value:t,configurable:!0}),"o$C");const C9=ap((e,t={},r)=>{const n=r??lo(e);if(n.length===0)return[];const s=new Map;for(const a of n)if(!(t.since&&(a.startTime===void 0||a.startTime<t.since))&&Array.isArray(a.tasks))for(const c of a.tasks){if(c.cacheStatus==="HIT"||c.cacheStatus==="REMOTE_HIT"||c.cacheStatus==="SKIPPED")continue;const l=s.get(c.taskId)??{failures:0,project:c.target.project,retriedSuccesses:0,successes:0,target:c.target.target,totalRuns:0};l.totalRuns+=1,c.exitCode!==void 0&&c.exitCode!==0?(l.failures+=1,l.lastFailure=c.startTime??a.startTime):(c.retryAttempts&&c.retryAttempts>0&&(l.retriedSuccesses+=1,l.lastRetry=c.startTime??a.startTime),l.successes+=1),s.set(c.taskId,l)}const i=t.minRuns??2,o=[];for(const[a,c]of s){if(c.totalRuns<i||c.failures===0&&c.retriedSuccesses===0)continue;const l=(c.failures+.5*c.retriedSuccesses)/c.totalRuns;o.push({failures:c.failures,flakinessRate:l,lastFailure:c.lastFailure,lastRetry:c.lastRetry,project:c.project,retriedSuccesses:c.retriedSuccesses,successes:c.successes,target:c.target,taskId:a,totalRuns:c.totalRuns})}return o.sort((a,c)=>c.flakinessRate-a.flakinessRate),o},"analyzeFlakiness"),IJ=ap(e=>{if(e.length===0)return["No flaky tasks detected."];const t=["Task","Runs","Failures","Retried","Rate","Last Failure"],r=e.map(a=>[a.taskId,String(a.totalRuns),String(a.failures),String(a.retriedSuccesses),`${(a.flakinessRate*100).toFixed(1)}%`,a.lastFailure??a.lastRetry??"—"]),n=t.map((a,c)=>{let l=0;for(const u of r)l=Math.max(l,(u[c]??"").length);return Math.max(a.length,l)}),s=ap((a,c)=>a.padEnd(c),"pad"),i=n.map(a=>"─".repeat(a)).join("──"),o=[t.map((a,c)=>s(a,n[c])).join(" "),i];for(const a of r)o.push(a.map((c,l)=>s(c,n[l])).join(" "));return o},"formatFlakinessTable");var E9=Object.defineProperty,nl=d((e,t)=>E9(e,"name",{value:t,configurable:!0}),"u$k");const au=nl((e,t,r)=>{const n=[],s=t??{},i=r??{},o=new Set([...Object.keys(s),...Object.keys(i)]);for(const a of o){const c=s[a],l=i[a];c!==l&&(c===void 0?n.push({change:"added",current:l,key:a,kind:e,previous:void 0}):l===void 0?n.push({change:"removed",current:void 0,key:a,kind:e,previous:c}):n.push({change:"modified",current:l,key:a,kind:e,previous:c}))}return n.sort((a,c)=>a.key.localeCompare(c.key)),n},"diffRecords"),j9=nl(e=>{if(e.length===0)return"No input changes detected. The cache may have been evicted or was never stored.";if(e.some(s=>s.kind==="command"))return"The resolved command changed.";const t=new Map;for(const s of e)t.set(s.kind,(t.get(s.kind)??0)+1);const[r]=[...t.entries()].sort((s,i)=>i[1]-s[1])[0]??["nodes",0],n={command:"command",implicitDeps:"lockfile or dependency",nodes:"input file",runtime:"runtime value"};return`${String(e.length)} ${n[r]??r} change(s) detected.`},"summarize"),A9=nl((e,t,r)=>{const n=e.find(i=>i.id===r)?.startTime,s=[...e].sort((i,o)=>(o.startTime??"").localeCompare(i.startTime??"")).filter(i=>!(i.id!==void 0&&i.id===r||n!==void 0&&i.startTime!==void 0&&i.startTime>n));for(const i of s){const o=i.tasks?.find(a=>a.taskId===t);if(o&&(o.cacheStatus==="HIT"||o.cacheStatus==="REMOTE_HIT"))return{run:i,task:o}}for(const i of s){const o=i.tasks?.find(a=>a.taskId===t);if(o?.hashDetails)return{run:i,task:o}}},"findReferenceTask"),x9=nl((e,t,r)=>{const n=e,s=r.taskId??"",i=A9(n,s,t);if(!i)return{currentHash:r.hash,entries:[],previousHash:void 0,previousRunId:void 0,previousRunStartTime:void 0,reason:"No previous run recorded this task — first observation.",taskId:s};const o=[],a=i.task.hashDetails?.command,c=r.hashDetails?.command;return a!==c&&o.push({change:a===void 0?"added":c===void 0?"removed":"modified",current:c,key:"command",kind:"command",previous:a}),o.push(...au("nodes",i.task.hashDetails?.nodes,r.hashDetails?.nodes)),o.push(...au("implicitDeps",i.task.hashDetails?.implicitDeps,r.hashDetails?.implicitDeps)),o.push(...au("runtime",i.task.hashDetails?.runtime,r.hashDetails?.runtime)),{currentHash:r.hash,entries:o,previousHash:i.task.hash,previousRunId:i.run.id,previousRunStartTime:i.run.startTime,reason:j9(o),taskId:s}},"analyzeCacheMiss");var O9=Object.defineProperty,Yw=d((e,t)=>O9(e,"name",{value:t,configurable:!0}),"d$f");const Gm=zk(Qk(import.meta.url)),P9=[Ps(Gm,"..","..","dashboard","dist","index.html"),Ps(Gm,"..","dashboard","dist","index.html")],qm=`<!DOCTYPE html>
|
|
1079
1079
|
<html lang="en">
|
|
1080
1080
|
<head>
|
|
1081
1081
|
<meta charset="UTF-8" />
|
|
@@ -1093,7 +1093,7 @@ ${Yl(k,{...this.#o,filterStacktrace:nu,hideErrorCauseCodeView:!0,hideErrorCodeVi
|
|
|
1093
1093
|
<p>Or run the full vis build:</p>
|
|
1094
1094
|
<pre><code>pnpm --filter @visulima/vis run build</code></pre>
|
|
1095
1095
|
</body>
|
|
1096
|
-
</html>`;let wn;const D9=Yw(()=>{for(const e of S9)try{if(cr(e).isFile())return e}catch{}},"findBuiltHtml"),C9=Yw(()=>{if(wn!==void 0&&!process.env.VIS_DASHBOARD_NO_CACHE)return wn;const e=D9();if(!e)return wn=qm,wn;try{const t=Gg(e,"utf8");return wn=t,t}catch{return wn=qm,wn}},"renderDashboardHtml");var E9=Object.defineProperty,Af=d((e,t)=>E9(e,"name",{value:t,configurable:!0}),"l$h");const j9=Af(e=>{if(e.length===0)return;const t=[...e].sort((n,s)=>n-s),r=Math.floor(t.length/2);return t.length%2===0?(t[r-1]+t[r])/2:t[r]},"median"),A9=Af(e=>{const t=new Map;for(const n of e)if(Array.isArray(n.tasks))for(const s of n.tasks){if(!s.taskId)continue;const i=t.get(s.taskId)??{durations:[],failures:0,hits:0,misses:0,project:s.target?.project??"",runs:0,target:s.target?.target??"",taskId:s.taskId};s.cacheStatus==="HIT"||s.cacheStatus==="REMOTE_HIT"?(i.runs+=1,i.hits+=1):s.cacheStatus==="MISS"&&(i.runs+=1,i.misses+=1,typeof s.duration=="number"&&s.duration>0&&i.durations.push(s.duration),s.exitCode!==void 0&&s.exitCode!==0&&(i.failures+=1)),t.set(s.taskId,i)}const r=new Map;for(const[n,s]of t){const i=s.durations.length===0?0:s.durations.reduce((o,a)=>o+a,0)/s.durations.length;r.set(n,{averageDurationMs:i,failures:s.failures,hitRate:s.runs===0?0:s.hits/s.runs,hits:s.hits,misses:s.misses,project:s.project,runs:s.runs,target:s.target,taskId:n,timeSavedMs:i*s.hits})}return r},"aggregateTaskStats"),x9=Af(e=>{const t=e,r=[...t].sort((S,y)=>(S.startTime??"").localeCompare(y.startTime??""));let n=0,s=0,i=0,o=0,a=0,c=0;const l=[],u=[],p=[];for(const S of r){const y=S.stats??{};n+=y.total??0,s+=y.succeeded??0,i+=y.failed??0,o+=y.cached??0,a+=y.skipped??0,typeof S.duration=="number"&&S.duration>0&&(c+=S.duration,l.push(S.duration),S.startTime&&p.push({timestamp:S.startTime,value:S.duration})),(y.total??0)>0&&S.startTime&&u.push({timestamp:S.startTime,value:(y.cached??0)/(y.total??1)})}const f=[...A9(r).values()],m=f.filter(S=>S.averageDurationMs>0).sort((S,y)=>y.averageDurationMs-S.averageDurationMs).slice(0,10),$=f.filter(S=>S.runs>=2).sort((S,y)=>y.timeSavedMs-S.timeSavedMs||y.hitRate-S.hitRate).slice(0,10),b=f.filter(S=>S.runs>=3&&S.hits>0&&S.misses>0).sort((S,y)=>y.misses/y.runs-S.misses/S.runs).slice(0,10),k=f.reduce((S,y)=>S+y.timeSavedMs,0);return{averageRunDurationMs:l.length===0?null:l.reduce((S,y)=>S+y,0)/l.length,cacheHitRate:o+s+i===0?null:o/(o+s+i),durationOverTime:p,hitRateOverTime:u,medianRunDurationMs:j9(l)??null,mostCachedTasks:$,mostInvalidatedTasks:b,slowestTasks:m,totals:{cached:o,estimatedTimeSavedMs:k,failed:i,runs:t.length,skipped:a,succeeded:s,tasks:n,totalDurationMs:c}}},"computeDashboardMetrics");var O9=Object.defineProperty,Kr=d((e,t)=>O9(e,"name",{value:t,configurable:!0}),"u$i");const Hm=Kr((e,t)=>{const r=t.replaceAll(/[^\w.\-:]/g,"");if(r.length===0||r!==t)return;const n=D(hn(e),`${r}.json`);if(j(n))try{return le(n)}catch{return}const s=m0(e);if(j(s))try{const i=le(s);return i.id===r?i:void 0}catch{return}},"readRunById"),P9=Kr(async e=>{const t=new Set,r=hn(e);try{await Hk(r,{recursive:!0})}catch{}let n,s;const i=Kr(a=>{s=a,n&&clearTimeout(n),n=setTimeout(()=>{if(n=void 0,!s)return;const c=s;s=void 0;for(const l of t)try{l(c)}catch{}},200)},"dispatch");let o;try{o=Jk(r,(a,c)=>{if(!c||typeof c!="string"||!c.endsWith(".json"))return;const l=c.slice(0,-5);i({id:l,type:"run-changed"})})}catch{o=void 0}return{close:Kr(()=>{n&&clearTimeout(n),o?.close(),t.clear()},"close"),subscribe:Kr(a=>(t.add(a),()=>{t.delete(a)}),"subscribe")}},"createRunsWatcher"),F9=Kr((e,t)=>{const r=new OP;return r.get("/",n=>n.html(C9())),r.get("/api/overview",n=>{const s=lo(e.workspaceRoot),i=x9(s),o=y9(e.workspaceRoot,{minRuns:2},s);return n.json({flaky:o,metrics:i})}),r.get("/api/runs",n=>{const s=lo(e.workspaceRoot).filter(i=>typeof i.id=="string"&&typeof i.startTime=="string"&&typeof i.endTime=="string"&&typeof i.duration=="number").map(i=>{const o=i.stats,a=o?{cached:typeof o.cached=="number"?o.cached:void 0,failed:typeof o.failed=="number"?o.failed:void 0,skipped:typeof o.skipped=="number"?o.skipped:void 0,succeeded:typeof o.succeeded=="number"?o.succeeded:void 0,total:typeof o.total=="number"?o.total:void 0}:void 0;return{duration:i.duration,endTime:i.endTime,id:i.id,startTime:i.startTime,stats:a}}).sort((i,o)=>o.startTime.localeCompare(i.startTime));return n.json({runs:s})}),r.get("/api/runs/:id",n=>{const s=Hm(e.workspaceRoot,n.req.param("id"));return s?n.json(s):n.json({error:"Not found"},404)}),r.get("/api/runs/:runId/tasks/:taskId/diff",n=>{const s=Hm(e.workspaceRoot,n.req.param("runId"));if(!s)return n.json({error:"Run not found"},404);const i=n.req.param("taskId"),o=s.tasks?.find(l=>l.taskId===i);if(!o)return n.json({error:"Task not found"},404);const a=lo(e.workspaceRoot),c=w9(a,s.id,o);return n.json(c)}),r.get("/api/cache",async n=>{if(!j(e.cacheDirectory))return n.json({directory:e.cacheDirectory,entries:[],exists:!1,totalBytes:0});const s=await cn(e.cacheDirectory),i=s.reduce((a,c)=>a+c.sizeBytes,0),o=Date.now();return n.json({directory:e.cacheDirectory,entries:s.map(a=>({ageMs:o-a.mtimeMs,hash:a.hash,mtimeIso:new Date(a.mtimeMs).toISOString(),sizeBytes:a.sizeBytes})),exists:!0,totalBytes:i})}),r.get("/api/environment",n=>n.json({arch:process.arch,cacheDirectory:e.cacheDirectory,node:process.version,platform:process.platform,workspaceRoot:e.workspaceRoot})),r.get("/api/events",n=>WP(n,async s=>{const i=[];let o;const a=t(l=>{if(i.push(l),o){const u=o;o=void 0,u()}});s.onAbort(()=>{if(a(),o){const l=o;o=void 0,l()}}),await s.writeSSE({data:JSON.stringify({ok:!0}),event:"ready"});const c=15e3;for(;!s.aborted;){if(i.length===0){const u=s.sleep(c),p=new Promise(f=>{o=f});if(await Promise.race([u,p]),s.aborted)break;if(i.length===0){await s.writeSSE({data:"",event:"heartbeat"});continue}}const l=i.shift();await s.writeSSE({data:JSON.stringify(l),event:"change"})}})),r},"createDashboardApp"),B9=Kr(async e=>{const t=await P9(e.workspaceRoot),r=F9(e,t.subscribe),n=xO({fetch:r.fetch,hostname:e.host,port:e.port});await new Promise((a,c)=>{n.once("listening",()=>{a()}),n.once("error",l=>{c(l)})});const s=n.address(),i=typeof s=="object"&&s?s.port:e.port,o=`http://${e.host==="0.0.0.0"||e.host==="::"||e.host==="::0"?"localhost":e.host}:${String(i)}`;return{close:Kr(()=>new Promise((a,c)=>{t.close(),n.close(l=>{l?c(l):a()})}),"close"),port:i,url:o}},"startDashboardServer");var R9=Object.defineProperty,cp=d((e,t)=>R9(e,"name",{value:t,configurable:!0}),"s$p");const T9=cp(e=>{const{platform:t}=process,[r,n]=t==="darwin"?["open",[e]]:t==="win32"?["cmd",["/c","start","",e]]:["xdg-open",[e]];nS(r,n,s=>{})},"openInBrowser"),N9={description:"Open a browser dashboard with cache, run history, and cache-miss diffs",examples:[["vis dashboard","Start the dashboard on a random port (server only — does not open a browser)"],["vis dashboard --open","Start the dashboard and open it in the default browser"],["vis dashboard --port=7788","Pin the server to a specific port"],["vis dashboard --host=0.0.0.0 --port=7788","Expose the dashboard on all interfaces"]],execute:cp(async({options:e,process:t,visConfig:r,workspaceRoot:n})=>{const s=n??t.cwd,i=g0(s,e.cacheDir,r?.taskRunner?.cacheDirectory),o=typeof e.port=="number"&&Number.isFinite(e.port)?e.port:0,a=typeof e.host=="string"&&e.host.length>0?e.host:"127.0.0.1",c=await B9({cacheDirectory:i,host:a,port:o,workspaceRoot:s});P.success(`Dashboard listening on ${c.url}`),P.info(`Workspace: ${s}`),P.info(`Cache: ${i}`),P.info("Press Ctrl+C to stop."),e.open===!0&&T9(c.url),await new Promise(l=>{let u=!1;const p=cp(()=>{u||(u=!0,process.off("SIGINT",p),process.off("SIGTERM",p),(async()=>{try{await c.close()}catch{}finally{l()}})())},"shutdown");process.once("SIGINT",p),process.once("SIGTERM",p)})},"execute"),group:"Workspace",name:"dashboard",options:[{defaultValue:0,description:"Port to bind the dashboard server to (0 = auto-assign)",name:"port",type:Number},{defaultValue:"127.0.0.1",description:"Host interface to bind to. Default binds to localhost only.",name:"host",type:String},{defaultValue:!1,description:"Open the dashboard in the default browser after starting",name:"open",type:Boolean},{description:"Cache directory to inspect (overrides config and default). Relative paths resolve against the workspace root.",name:"cache-dir",type:String}]};var I9=Object.defineProperty,L9=d((e,t)=>I9(e,"name",{value:t,configurable:!0}),"e$O");const _9={description:"Deduplicate dependencies using the detected package manager",examples:[["vis dedupe","Run deduplication"],["vis dedupe --check","Preview changes without modifying (CI-friendly)"]],group:"Dependencies",loader:L9(()=>import("./handler8.js"),"loader"),name:"dedupe",options:[{defaultValue:!1,description:"Preview changes without modifying files (dry-run)",name:"check",type:Boolean}]};var M9=Object.defineProperty,W9=d((e,t)=>M9(e,"name",{value:t,configurable:!0}),"e$N");const V9={alias:"dc",description:"Create or update .devcontainer/devcontainer.json interactively",examples:[["vis devcontainer","Launch interactive devcontainer config editor"],["vis dc","Alias for devcontainer"],["vis devcontainer --template node-pnpm","Start from Node.js + pnpm template"]],group:"Scaffold & Config",loader:W9(()=>import("./handler46.js"),"loader"),name:"devcontainer",options:[{alias:"t",description:"Start from a template: node, node-pnpm, node-postgres, node-dind, fullstack, python, go, rust, java, devops, minimal, custom",name:"template",type:String},{alias:"o",description:"Output path (default: .devcontainer/devcontainer.json)",name:"output",type:String}]};var U9=Object.defineProperty,G9=d((e,t)=>U9(e,"name",{value:t,configurable:!0}),"e$M");const q9={argument:{description:"Docker subcommand: scaffold | prune",name:"subcommand",type:String},description:"Docker integration — scaffold a minimal context or prune unfocused deps",examples:[["vis docker scaffold --focus=my-app","Generate .vis/docker/workspace for my-app + its deps"],["vis docker scaffold --focus=my-app --include-sources","Also copy focus source trees"],["vis docker scaffold --focus=my-app,other --out=.vis/docker","Focus multiple projects"],["vis docker prune --context=.vis/docker","Strip unfocused projects inside a build stage"]],group:"Workspace",loader:G9(()=>import("./handler10.js"),"loader"),name:"docker",options:[{description:"Project name(s) to focus on — comma-separated for multiple",name:"focus",type:String},{description:"Output directory for the scaffold (default: .vis/docker)",name:"out",type:String},{defaultValue:!1,description:"Also copy focus project source trees to <out>/sources",name:"include-sources",type:Boolean},{description:"Scaffold root for `vis docker prune` (default: .vis/docker)",name:"context",type:String},{defaultValue:!0,description:"Rewrite the workspace lockfile to drop unfocused projects (use --no-prune-lockfile to copy verbatim)",name:"prune-lockfile",type:Boolean}]};var H9=Object.defineProperty,z9=d((e,t)=>H9(e,"name",{value:t,configurable:!0}),"e$L");const J9={description:"Run a full project health check (outdated, security, duplicates, optimizations)",examples:[["vis doctor","Full project health check"],["vis doctor --fix","Check and auto-apply safe fixes"],["vis doctor --format json","Machine-readable output for CI"],["vis doctor --only security","Only run the security scans"],["vis doctor --skip optimization,runtime","Skip the listed sections"],["vis doctor --quiet","Summary only, no per-section breakdown"],["vis doctor --no-progress","Disable live progress UI (sequential logs)"],["vis doctor --exit-code","Exit with code 1 if security issues found"],["vis doctor --exit-code --strict","Fail on any issue (outdated, duplicates, security)"]],group:"Security & Health",loader:z9(()=>import("./handler40.js"),"loader"),name:"doctor",options:[{description:"Output format: table or json (default: table). Alias: --json",name:"format",type:String},{defaultValue:!1,description:"Shorthand for --format json",name:"json",type:Boolean},{defaultValue:!1,description:"Exit with code 1 if issues found",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Auto-apply safe fixes (security overrides + codemods, SIGTERM orphans)",name:"fix",type:Boolean},{defaultValue:!1,description:"With --fix: escalate orphan cleanup to SIGKILL / taskkill /F (use when SIGTERM is ignored)",name:"fix-force",type:Boolean},{defaultValue:!1,description:"With --exit-code: also fail on outdated and duplicate deps",name:"strict",type:Boolean},{description:"Comma-separated sections to run: dependencies,security,optimization,runtime",name:"only",type:String},{description:"Comma-separated sections to skip",name:"skip",type:String},{defaultValue:!1,description:"Suppress per-section detail; print summary only",name:"quiet",type:Boolean},{defaultValue:!1,description:"Disable live progress UI (forces sequential logs)",name:"no-progress",type:Boolean},{defaultValue:!1,description:"Bypass the doctor result cache (~/.vis/cache/doctor)",name:"no-cache",type:Boolean},{description:"Comma-separated package name patterns to scope findings (supports * globs, e.g. '@types/*,react')",name:"filter",type:String}]};var K9=Object.defineProperty,Y9=d((e,t)=>K9(e,"name",{value:t,configurable:!0}),"e$K");const X9={argument:{description:"Command to execute followed by arguments",name:"command",type:String},description:"Execute a local node_modules/.bin command (no remote fallback)",examples:[["vis exec eslint .","Run local eslint"],["vis exec tsc --noEmit","Run local TypeScript check"],["vis exec -r -- eslint .","Run in all workspace packages"],["vis exec -c 'echo $PATH'","Shell mode"]],group:"Run & Execute",loader:Y9(()=>import("./handler11.js"),"loader"),name:"exec",options:[{alias:"c",defaultValue:!1,description:"Execute within shell environment",name:"shell-mode",type:Boolean},{alias:"r",defaultValue:!1,description:"Run in every workspace package",name:"recursive",type:Boolean},{alias:"w",defaultValue:!1,description:"Run on workspace root only",name:"workspace-root",type:Boolean},{alias:"F",description:"Filter packages by name pattern",multiple:!0,name:"filter",type:String},{defaultValue:!1,description:"Run concurrently without topological ordering",name:"parallel",type:Boolean},{defaultValue:!1,description:"Reverse topological execution order",name:"reverse",type:Boolean}]};var Q9=Object.defineProperty,Z9=d((e,t)=>Q9(e,"name",{value:t,configurable:!0}),"e$J");const e_={argument:{description:"Template name (or remote source like git://… or npm://…) — omit for interactive picker",name:"template",type:String},description:"Scaffold files from an in-repo template",examples:[["vis generate","Pick a template interactively"],["vis generate package","Run the 'package' template"],["vis generate component -- --name=Button --style=primary","Pre-fill option values"],["vis generate package --to=./packages/new --force","Custom destination + overwrite"],["vis generate package --dry-run","Print planned writes without touching disk"],["vis generate git://github.com/org/template#main","Fetch and run a remote template"],["vis generate --list","Show discovered templates"],["vis generate --list --json","Machine-readable template list"],["vis generate package --describe --json","Print template metadata (variables, destination) as JSON"]],group:"Scaffold & Config",loader:Z9(()=>import("./handler35.js"),"loader"),name:"generate",options:[{defaultValue:!1,description:"List discovered templates",name:"list",type:Boolean},{defaultValue:!1,description:"Print template metadata (about, destination, variables) without running produce",name:"describe",type:Boolean},{defaultValue:!1,description:"Emit JSON output (with --list or --describe)",name:"json",type:Boolean},{description:"Destination directory",name:"to",type:String},{defaultValue:!1,description:"Print planned writes without touching disk",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Overwrite existing files without prompting",name:"force",type:Boolean},{defaultValue:!1,description:"Skip prompts; use template defaults",name:"defaults",type:Boolean},{defaultValue:!1,description:"Skip running post-generation scripts",name:"skip-scripts",type:Boolean},{defaultValue:!1,description:"Skip interactive prompts (errors on missing required values)",name:"no-interactive",type:Boolean},{defaultValue:!1,description:"Prefer locally cached remote templates over re-downloading",name:"prefer-offline",type:Boolean}]};var t_=Object.defineProperty,r_=d((e,t)=>t_(e,"name",{value:t,configurable:!0}),"t$u");const n_={description:"Visualize the project dependency graph",examples:[["vis graph","Show colored dependency graph (TUI in TTY, ASCII otherwise)"],["vis graph --format=ascii","Force ASCII tree output"],["vis graph --format=dot","Output in Graphviz DOT format"],["vis graph --format=html --output=graph.html","Generate interactive HTML graph"],["vis graph --format=json --output=graph.json","Save JSON graph to file"]],group:"Workspace",loader:r_(()=>import("./handler42.js"),"loader"),name:"graph",options:[{alias:"f",defaultValue:void 0,description:"Output format: tui, ascii, dot, json, html (default: tui in TTY, ascii otherwise)",name:"format",type:String},{alias:"o",description:"Write output to file instead of stdout",name:"output",type:String},{alias:"d",description:"Maximum dependency tree depth for ASCII output (default: unlimited)",name:"depth",type:Number}]},Xw=["pre-commit","pre-merge-commit","prepare-commit-msg","commit-msg","post-commit","applypatch-msg","pre-applypatch","post-applypatch","pre-rebase","post-rewrite","post-checkout","post-merge","pre-push","pre-auto-gc"],Qw=".vis-hooks",OJ=[".pre-commit-config.yaml",".pre-commit-config.yml","prek.toml"],PJ={commit:"pre-commit","merge-commit":"pre-merge-commit",push:"pre-push"},FJ=new Set(["commit-msg","post-checkout","post-commit","post-merge","post-rewrite","pre-commit","pre-merge-commit","pre-push","pre-rebase","prepare-commit-msg"]),BJ=new Set(["commit-msg","post-checkout","post-merge","post-rewrite","pre-rebase","prepare-commit-msg"]),RJ=new Set(["fail","script","system"]);var s_=Object.defineProperty,us=d((e,t)=>s_(e,"name",{value:t,configurable:!0}),"e$H");const ps={defaultValue:Qw,description:"Custom hooks directory",name:"hooks-dir",type:String},ds=[{defaultValue:void 0,description:"Set to 0 to disable git hooks, set to 2 for debug output",name:"VIS_GIT_HOOKS",type:String}],i_={commandPath:["hook"],description:"Install git hooks for the workspace (migrates husky / prek on prompt)",env:[...ds],examples:[["vis hook install","Install git hooks in .vis-hooks/"],["vis hook install --hooks-dir=.githooks","Install hooks in a custom directory"]],group:"Git Hooks",loader:us(()=>import("./handler43.js").then(e=>({default:e.hookInstallExecute})),"loader"),name:"install",options:[ps]},o_={commandPath:["hook"],description:"Remove git hooks and reset core.hooksPath",env:[...ds],examples:[["vis hook uninstall","Remove git hooks and reset core.hooksPath"]],group:"Git Hooks",loader:us(()=>import("./handler43.js").then(e=>({default:e.hookUninstallExecute})),"loader"),name:"uninstall",options:[ps]},a_={commandPath:["hook"],description:"Migrate from husky or prek to vis hooks (auto-detected)",env:[...ds],examples:[["vis hook migrate","Migrate from husky or prek to vis hooks (auto-detected)"],["vis hook migrate --dry-run","Preview what a migration would write without touching disk"]],group:"Git Hooks",loader:us(()=>import("./handler43.js").then(e=>({default:e.hookMigrateExecute})),"loader"),name:"migrate",options:[ps,{defaultValue:!1,description:"Preview migrate without writing files",name:"dry-run",type:Boolean}]},c_={commandPath:["hook"],description:"Show configured hooks grouped by stage",env:[...ds],examples:[["vis hook list","Show configured hooks grouped by stage"]],group:"Git Hooks",loader:us(()=>import("./handler43.js").then(e=>({default:e.hookListExecute})),"loader"),name:"list",options:[ps]},l_={commandPath:["hook"],description:"Sanity-check installed hooks and the bundled runner",env:[...ds],examples:[["vis hook validate","Sanity-check installed hooks and the bundled runner"]],group:"Git Hooks",loader:us(()=>import("./handler43.js").then(e=>({default:e.hookValidateExecute})),"loader"),name:"validate",options:[ps]},u_={argument:{description:"Hook stage to run (e.g. pre-commit, commit-msg). Defaults to pre-commit.",name:"stage",type:String},commandPath:["hook"],description:"Run a specific hook stage against tracked files",env:[...ds],examples:[["vis hook run pre-commit --all-files","Run the pre-commit hooks against every tracked file"],["vis hook run pre-commit --from-ref=main --to-ref=HEAD","Run pre-commit hooks on files changed between two refs"],["vis hook run pre-commit --last-commit","Shortcut for --from-ref HEAD~1 --to-ref HEAD"]],group:"Git Hooks",loader:us(()=>import("./handler43.js").then(e=>({default:e.hookRunExecute})),"loader"),name:"run",options:[ps,{defaultValue:!1,description:"Run against every tracked file",name:"all-files",type:Boolean},{defaultValue:void 0,description:"Include files changed since this ref",name:"from-ref",type:String},{defaultValue:void 0,description:"Include files changed up to this ref",name:"to-ref",type:String},{defaultValue:!1,description:"Shortcut for --from-ref HEAD~1 --to-ref HEAD",name:"last-commit",type:Boolean}]},p_={argument:{description:"Target to add (currently: `secrets`)",name:"target",type:String},commandPath:["hook"],description:"Add a managed hook snippet (e.g. `vis secrets --staged`)",env:[...ds],examples:[["vis hook add secrets","Add a pre-commit hook that runs `vis secrets --staged`"]],group:"Git Hooks",loader:us(()=>import("./handler43.js").then(e=>({default:e.hookAddExecute})),"loader"),name:"add",options:[ps]},d_=[i_,o_,a_,c_,l_,u_,p_];var f_=Object.defineProperty,h_=d((e,t)=>f_(e,"name",{value:t,configurable:!0}),"e$G");const m_={argument:{description:"Project name to check (required)",name:"project",type:String},description:'Exit with inverted codes for CI "Ignored Build Step" gating (Vercel/Netlify)',examples:[["vis ignore my-app","Check if my-app is affected and decide whether to build"],["vis ignore my-app --base $VERCEL_GIT_PREVIOUS_SHA","Explicit base ref"],["vis ignore my-app --json","Emit the decision as JSON instead of text"],["vis ignore my-app --verbose","Print debug info about the decision path"],["vis ignore my-app --exit-zero-on-build","Normal exit semantics (0=build, 0=skip)"]],group:"Run & Execute",loader:h_(()=>import("./handler32.js"),"loader"),name:"ignore",options:[{description:"Git base ref for comparison. Defaults to CI provider env vars, then HEAD~1.",name:"base",type:String},{defaultValue:"HEAD",description:"Git head ref for comparison",name:"head",type:String},{defaultValue:"deep",description:'Downstream scope: "none", "direct", or "deep"',name:"downstream",type:String},{defaultValue:"none",description:'Upstream scope: "none", "direct", or "deep"',name:"upstream",type:String},{defaultValue:!1,description:"Emit the decision as JSON on stdout instead of human text",name:"json",type:Boolean},{defaultValue:!1,description:"Exit 0 on build (normal semantics) instead of 1 (inverted Vercel/Netlify semantics)",name:"exit-zero-on-build",type:Boolean},{defaultValue:!1,description:"Enable verbose debug output",name:"verbose",type:Boolean}]};var g_=Object.defineProperty,y_=d((e,t)=>g_(e,"name",{value:t,configurable:!0}),"e$F");const v_={description:"Remove vis from the system (self-uninstall)",examples:[["vis implode","Interactive uninstall"],["vis implode --yes","Non-interactive uninstall (CI)"]],group:"System",loader:y_(()=>import("./handler12.js"),"loader"),name:"implode",options:[{alias:"y",defaultValue:!1,description:"Skip confirmation prompt",name:"yes",type:Boolean}]};var b_=Object.defineProperty,$_=d((e,t)=>b_(e,"name",{value:t,configurable:!0}),"e$E");const w_={alias:"view",argument:{description:"Package name followed by optional metadata fields (e.g. 'react version dependencies')",name:"args",type:String},description:"Show npm registry metadata for a package (alias of `npm view` / `pnpm view` / `yarn info` / `bun pm view`)",examples:[["vis info react","Full registry metadata for react"],["vis info react version","Latest version only"],["vis info react versions","All published versions"],["vis info react@18 dependencies","Dependencies of react@18"],["vis info react --json","Emit JSON"],["vis view react","Alias matching npm/pnpm"]],group:"Dependencies",loader:$_(()=>import("./handler13.js"),"loader"),name:"info",options:[{defaultValue:!1,description:"Output as JSON",name:"json",type:Boolean}]};var k_=Object.defineProperty,S_=d((e,t)=>k_(e,"name",{value:t,configurable:!0}),"e$D");const D_={description:"Initialize vis.config.ts with best-practice security defaults",examples:[["vis init","Interactive setup wizard"],["vis init --no-interactive","Create minimal config without prompts"],["vis init --force","Overwrite existing config"],["vis init --sync-native","Also sync to native PM config files"],["vis init --schema","Print the workspace-relative `$schema` refs to paste into project.json and vis.config.ts"]],group:"Scaffold & Config",loader:S_(()=>import("./handler14.js"),"loader"),name:"init",options:[{defaultValue:!1,description:"Overwrite existing config file",name:"force",type:Boolean},{defaultValue:!1,description:"Skip interactive prompts",name:"no-interactive",type:Boolean},{defaultValue:!1,description:"Sync settings to native PM config files",name:"sync-native",type:Boolean},{defaultValue:!1,description:"Print workspace-relative $schema paths for project.json and vis.config.ts, then exit",name:"schema",type:Boolean}]};var C_=Object.defineProperty,E_=d((e,t)=>C_(e,"name",{value:t,configurable:!0}),"e$C");const j_={argument:{description:"Package to inspect, optionally pinned: `<name>` or `<name>@<spec>`. `<spec>` may be a version, range, or dist-tag.",name:"package"},description:"Run all marshalls against a package without installing it",examples:[["vis inspect express","Run every marshall against express@latest"],["vis inspect lodash@4.17.21","Pin to an exact version"],["vis inspect react@^18","Resolve a semver range, then inspect the best match"],["vis inspect express --json","Emit findings as JSON for CI integration"],["vis inspect express --strict","Exit non-zero on any warning, not just errors"],["vis inspect express --only author,downloads","Run a subset of marshalls"],["vis inspect express --only signatures","Signatures are off by default; opt in with --only"]],group:"Security & Health",loader:E_(()=>import("./handler15.js"),"loader"),name:"inspect",options:[{defaultValue:!1,description:"Emit findings as a JSON document instead of the human-readable table.",name:"json",type:Boolean},{defaultValue:!1,description:"Exit non-zero on any finding (warnings included). Default exits non-zero only on errors.",name:"strict",type:Boolean},{description:"Comma-separated subset of marshalls to run. Known: author, archivedRepo, downloads, expiredDomains, metadata, newBin, provenance, signatures. Signatures only runs when explicitly requested here.",name:"only",type:String}]};var A_=Object.defineProperty,x_=d((e,t)=>A_(e,"name",{value:t,configurable:!0}),"e$B");const O_={alias:"i",argument:{description:"Optional package names. When provided, delegates to `vis add` (enables npm-style `alias npm='vis install'` wrappers).",name:"packages",type:String},description:"Install dependencies using the detected package manager",examples:[["vis install","Install all dependencies (frozen-lockfile by default when a lockfile is present)"],["vis install react react-dom","Delegates to `vis add` — enables shell aliases like `alias npm='vis install'`"],["vis i --no-frozen-lockfile","Allow lockfile updates (escape hatch for the default)"],["vis install --ci","Clean install: wipe node_modules + frozen lockfile (mirrors npm ci / pnpm ci)"],["vis install --prefer-offline","Use cached packages when available, fall back to network"],["vis install --prod","Install production dependencies only"],["vis install --filter app","Install for specific workspace package"],["vis install --run-scripts","Run lifecycle scripts (opts out of vis's default block-by-default policy; allowlisted packages run via security.policies.installScripts.allow)"],["vis install --no-typosquat-check","Skip typosquat name check"],["vis install --installer aube","Force aube as the installer (errors if not on PATH)"],["vis install --no-aube","Bypass aube; use the lockfile-detected PM"]],group:"Dependencies",loader:x_(()=>import("./handler16.js"),"loader"),name:"install",options:[{alias:"P",conflicts:"dev",description:"Skip devDependencies (no positional args) / add as peer (with positional args, npm-style)",name:"prod",type:Boolean},{alias:"D",conflicts:"prod",description:"Install devDependencies only (no positional args) / add as dev (with positional args, npm-style)",name:"dev",type:Boolean},{defaultValue:!1,description:"Add as optional dependency (only with positional args; mirrors `npm install -O`)",name:"save-optional",type:Boolean},{alias:"E",defaultValue:!1,description:"Save exact version (only with positional args; mirrors `npm install -E`)",name:"exact",type:Boolean},{defaultValue:!1,description:"Skip Socket.dev security check (only with positional args; mirrors `vis add --no-socket-check`)",name:"no-socket-check",type:Boolean},{defaultValue:!1,description:"Skip the offline marshall pipeline (only with positional args; mirrors `vis add --no-marshall-check`)",name:"no-marshall-check",type:Boolean},{defaultValue:!1,description:"Use frozen lockfile (CI mode, maps to npm ci)",name:"frozen-lockfile",type:Boolean},{defaultValue:!1,description:"Opt out of vis's default frozen-lockfile behavior and allow lockfile updates",name:"no-frozen-lockfile",type:Boolean},{defaultValue:!1,description:"Clean install: wipe node_modules then install with frozen lockfile",name:"ci",type:Boolean},{alias:"f",defaultValue:!1,description:"Force reinstall all dependencies",name:"force",type:Boolean},{defaultValue:!1,description:"Run lifecycle scripts (opts out of vis's default block-by-default policy; allowlisted packages run via security.policies.installScripts.allow)",name:"run-scripts",type:Boolean},{defaultValue:!1,description:"Update lockfile without installing",name:"lockfile-only",type:Boolean},{defaultValue:!1,description:"Skip optional dependencies",name:"no-optional",type:Boolean},{defaultValue:!1,description:"Use only cached packages",name:"offline",type:Boolean},{defaultValue:!1,description:"Prefer cached packages, fall back to network when missing",name:"prefer-offline",type:Boolean},{alias:"s",defaultValue:!1,description:"Suppress output",name:"silent",type:Boolean},{alias:"r",defaultValue:!1,description:"Install in all workspace packages",name:"recursive",type:Boolean},{alias:"w",defaultValue:!1,description:"Target workspace root",name:"workspace-root",type:Boolean},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String},{defaultValue:!1,description:"Skip typosquat name check",name:"no-typosquat-check",type:Boolean},{description:"Pick the installer explicitly. One of: auto, aube, pnpm, npm, yarn, bun. Overrides VIS_INSTALLER and install.backend in vis.config.",name:"installer",type:String},{defaultValue:!1,description:"Skip aube and use the lockfile-detected PM. Wins over --installer / VIS_INSTALLER / install.backend.",name:"no-aube",type:Boolean}]};var P_=Object.defineProperty,F_=d((e,t)=>P_(e,"name",{value:t,configurable:!0}),"e$A");const B_={alias:"ln",argument:{description:"Package name or directory path to link (omit to register current package)",name:"target",type:String},description:"Link a local package for development",examples:[["vis link ./packages/utils","Link local directory package (works on all PMs)"],["vis link","Register current package globally (pnpm <=10, yarn, npm, bun)"],["vis link react","Link global package into current project (pnpm <=10, yarn, npm, bun)"]],group:"Dependencies",loader:F_(()=>import("./handler18.js"),"loader"),name:"link"};var R_=Object.defineProperty,T_=d((e,t)=>R_(e,"name",{value:t,configurable:!0}),"e$z");const N_={description:"Lint workspace dependency policies (workspace-protocol, banned-deps, redefine-root, workspace-versions, custom-types, empty-deps, root-private, root-package-manager, root-deps, missing-package-json, dead-workspace-patterns, types-in-deps, similar-deps)",examples:[["vis lint","Run every enabled lint and exit non-zero on failures"],["vis lint --workspace-protocol","Only check that internal deps use workspace:*"],["vis lint --workspace-protocol --fix","Auto-rewrite internal deps to use workspace:*"],["vis lint --redefine-root","Flag deps duplicated between root and child packages"],["vis lint --banned-deps","Flag deps matching policy.bannedDeps in vis config"],["vis lint --workspace-versions","Flag external deps declared at different versions across packages"],["vis lint --workspace-versions --fix","Rewrite drifting deps to the highest sibling version"],["vis lint --workspace-versions --dep react","Limit version-drift check to a single dep"],["vis lint --workspace-versions --resolve catalog --fix","Rewrite drifting deps to catalog: when a catalog already pins them"],["vis lint --workspace-versions --resolve catalog --propose-min 3","Suggest new catalog entries for deps ≥3 packages already agree on"],["vis lint --custom-types","Flag drift in engines.{node,pnpm}, packageManager, volta.{node,pnpm,yarn}, devEngines"],["vis lint --custom-types --fix","Align all engines/packageManager/volta versions to the highest sibling"],["vis lint --empty-deps --fix","Drop empty `dependencies` / `devDependencies` / etc. blocks across the workspace"],["vis lint --root-private --fix",'Ensure the workspace root package.json has "private": true'],["vis lint --root-package-manager","Ensure the root package.json declares a `packageManager` field"],["vis lint --root-deps --fix","Move runtime deps off the private workspace root into devDependencies"],["vis lint --missing-package-json","Flag workspace dirs that don't contain a package.json"],["vis lint --dead-workspace-patterns --fix","Drop workspace patterns that match zero packages"],["vis lint --types-in-deps --fix","Move @types/* out of dependencies on private packages"],["vis lint --similar-deps","Flag drift across related dep families (react+react-dom, @babel/*, …)"],["vis lint --ban left-pad --ban request","One-off ban: flag any package declaring left-pad or request"],["vis lint --pin react@18.2.0","One-off pin: flag any package declaring react at a different version"],["vis lint --format json","Emit findings as JSON for CI / editor integrations"]],group:"Security & Health",loader:T_(()=>import("./handler41.js"),"loader"),name:"lint",options:[{defaultValue:!1,description:"Lint that internal deps use the workspace: protocol",name:"workspace-protocol",type:Boolean},{defaultValue:!1,description:"Lint that no child re-declares a dep already pinned in the workspace root",name:"redefine-root",type:Boolean},{defaultValue:!1,description:"Lint deps against policy.bannedDeps in vis config",name:"banned-deps",type:Boolean},{defaultValue:!1,description:"Lint that all packages declare external deps at the same version",name:"workspace-versions",type:Boolean},{defaultValue:!1,description:"Lint engines.{node,pnpm}, packageManager, volta.*, devEngines.* for drift across packages",name:"custom-types",type:Boolean},{defaultValue:!1,description:"Flag empty dependency blocks (`dependencies: {}`, `devDependencies: {}`, …) across the workspace",name:"empty-deps",type:Boolean},{defaultValue:!1,description:'Ensure the workspace root package.json sets `"private": true`',name:"root-private",type:Boolean},{defaultValue:!1,description:"Ensure the workspace root package.json declares a `packageManager` field",name:"root-package-manager",type:Boolean},{defaultValue:!1,description:"Flag runtime dependencies on the private workspace root (move them to devDependencies)",name:"root-deps",type:Boolean},{defaultValue:!1,description:"Flag workspace directories that lack a package.json",name:"missing-package-json",type:Boolean},{defaultValue:!1,description:"Flag workspace patterns (in `pnpm-workspace.yaml` / `package.json#workspaces`) that match zero packages",name:"dead-workspace-patterns",type:Boolean},{defaultValue:!1,description:"Flag `@types/*` declared in `dependencies` on a private package (should be in devDependencies)",name:"types-in-deps",type:Boolean},{defaultValue:!1,description:"Flag version drift across related dep families (react+react-dom, @babel/*, @storybook/*, …)",name:"similar-deps",type:Boolean},{description:"Restrict --workspace-versions to a single dep",name:"dep",type:String},{description:"Ban a dep name or glob for this run (repeatable). Auto-enables --banned-deps.",multiple:!0,name:"ban",type:String},{description:"Pin a dep to an exact specifier for this run, e.g. react@^18.2.0 (repeatable). Auto-enables --workspace-versions.",multiple:!0,name:"pin",type:String},{description:"Conflict resolution for --workspace-versions: highest, lowest, or catalog (default: highest)",name:"resolve",type:String},{description:"Propose catalog entries for deps ≥N packages already agree on. Activates with --resolve catalog.",name:"propose-min",type:Number},{defaultValue:!1,description:"Auto-fix violations in place (writes package.json files)",name:"fix",type:Boolean},{description:"Specifier used by --fix for workspace-protocol (default: workspace:*)",name:"fix-specifier",type:String},{description:"Output format: human, json, or minimal (default: human)",name:"format",type:String},{defaultValue:!1,description:"Suppress all output except errors",name:"quiet",type:Boolean}]};var I_=Object.defineProperty,L_=d((e,t)=>I_(e,"name",{value:t,configurable:!0}),"e$y");const __={description:"List all workspace projects with metadata",examples:[["vis list","Show all projects"],["vis list --targets","Per-target rows with type, cache status and description"],["vis list --targets --inferred","Only show targets synthesized by Project Crystal-style inference"],["vis list --deps","Human-readable table of every dep-instance across the workspace"],["vis list --deps --internal-only","Only workspace deps in human form"],["vis list --deps --format=ndjson","Stream every dep-instance as NDJSON for jq pipelines"],["vis list --deps --format=json --pretty","Single pretty-printed JSON array of dep-instances"],["vis list --format=json","Machine-readable project listing"],['vis list --query "tag=frontend"',"Filter by query"]],group:"Workspace",loader:L_(()=>import("./handler33.js"),"loader"),name:"list",options:[{defaultValue:!1,description:"Filter target rows to only inferred targets (implies --targets)",name:"inferred",type:Boolean},{description:"Output format: table (default), json (single document), or ndjson (one record per line; --deps only)",name:"format",type:String},{defaultValue:!1,description:"Pretty-print with 2-space indent (only meaningful with --format=json)",name:"pretty",type:Boolean},{description:"Filter projects by query",name:"query",type:String},{defaultValue:!1,description:"Show per-target rows (type, cache, description)",name:"targets",type:Boolean},{defaultValue:!1,description:"Render a dep-instance view (table by default; use --format=ndjson|json for jq-friendly streams)",name:"deps",type:Boolean},{description:"Restrict --deps to specific dep blocks (repeatable)",multiple:!0,name:"dep-type",type:String},{defaultValue:!1,description:"With --deps: only show internal/workspace deps",name:"internal-only",type:Boolean},{defaultValue:!1,description:"With --deps: only show external/registry deps",name:"external-only",type:Boolean},{description:"With --deps: glob of declaring package names to keep (repeatable)",multiple:!0,name:"include",type:String},{description:"With --deps: glob of declaring package names to drop (repeatable)",multiple:!0,name:"exclude",type:String}]};var M_=Object.defineProperty,yt=d((e,t)=>M_(e,"name",{value:t,configurable:!0}),"t$n");const At=[{defaultValue:!1,description:"Preview changes without applying",name:"dry-run",type:Boolean},{alias:"y",defaultValue:!1,description:"Skip the confirmation prompt",name:"yes",type:Boolean}],W_={commandPath:["migrate"],description:"Migrate dependencies and scripts to vis",group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateDepsExecute})),"loader"),name:"deps",options:[...At]},V_={commandPath:["migrate"],description:"Inline lint-staged configuration into vis",group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateLintStagedExecute})),"loader"),name:"lint-staged",options:[...At]},U_={commandPath:["migrate"],description:"Inline nano-staged configuration into vis",group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateNanoStagedExecute})),"loader"),name:"nano-staged",options:[...At]},G_={commandPath:["migrate"],description:"Migrate turborepo tasks/config to vis",group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateTurborepoExecute})),"loader"),name:"turborepo",options:[...At]},q_={commandPath:["migrate"],description:"Migrate nx targets/config to vis",group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateNxExecute})),"loader"),name:"nx",options:[...At,{defaultValue:!1,description:"Overwrite an existing vis.config.ts (a .bak is taken first)",name:"force",type:Boolean},{defaultValue:!1,description:"For each project.json `syncGenerators`, add a `pre<target>` script to sibling package.json (with a TODO for the user to wire up)",name:"rewrite-sync-generators",type:Boolean},{defaultValue:!1,description:"Auto-apply the safe cleanup items the migrator would otherwise leave on the checklist: delete nx.json + ignore-files-for-nx-affected.yml, strip nx/@nx/*/@nrwl/* devDependencies, rewrite mechanical `nx run-many|run|affected` scripts. Implies --force.",name:"aggressive",type:Boolean}]},H_={commandPath:["migrate"],description:"Migrate moon tasks/templates to vis",group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateMoonExecute})),"loader"),name:"moon",options:[...At,{defaultValue:!1,description:"Copy .moon/templates/* into .vis/templates/* so `vis generate` works without .moon/",name:"copy-templates",type:Boolean}]},z_={commandPath:["migrate"],description:"Migrate gitleaks config/baseline/hooks to `vis secrets`",examples:[["vis migrate gitleaks","Migrate gitleaks config/baseline/hooks to `vis secrets`"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateGitleaksExecute})),"loader"),name:"gitleaks",options:[...At]},J_={commandPath:["migrate"],description:"Migrate Kingfisher baseline/hooks/scripts to `vis secrets`",examples:[["vis migrate kingfisher","Migrate Kingfisher baseline/hooks/scripts to `vis secrets`"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateKingfisherExecute})),"loader"),name:"kingfisher",options:[...At]},K_={commandPath:["migrate"],description:"Replace secretlint with `vis secrets`",examples:[["vis migrate secretlint","Replace secretlint with `vis secrets`"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateSecretlintExecute})),"loader"),name:"secretlint",options:[...At]},Y_={commandPath:["migrate"],description:"Translate syncpack customTypes into vis policy and strip the syncpack dep/scripts",examples:[["vis migrate syncpack","Translate syncpack customTypes into vis policy and strip the syncpack dep/scripts"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateSyncpackExecute})),"loader"),name:"syncpack",options:[...At]},X_={commandPath:["migrate"],description:"Strip sherif config/dep/scripts and surface ignore-rules as a positive `vis lint --<rule>` command",examples:[["vis migrate sherif","Strip sherif config/dep/scripts and surface ignore-rules as a positive `vis lint --<rule>` command"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateSherifExecute})),"loader"),name:"sherif",options:[...At]},Q_={commandPath:["migrate"],description:"Auto-rewrite vis.config.ts to use renamed fields (targetDefaults → tasks, taskDefaults → scopedTasks, taskRunnerOptions → taskRunner)",examples:[["vis migrate self","Rewrite vis.config.ts in-place (a .bak is taken first)"],["vis migrate self --dry-run","Preview the rewrite without writing"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateSelfExecute})),"loader"),name:"self",options:[...At]},Z_={commandPath:["migrate"],description:"Audit the workspace for stray gitleaks/secretlint/sherif/syncpack references (exit 1 on issues)",examples:[["vis migrate verify","Audit the workspace for stray gitleaks/secretlint/sherif/syncpack references (exit 1 on issues)"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateVerifyExecute})),"loader"),name:"verify",options:[]},e4={commandPath:["migrate"],description:"Prove a turbo/nx/moon → vis migration preserved the task graph + cache-key surface (exit 1 on divergence)",examples:[["vis migrate verify-graph","Auto-detect the source tool and diff its task graph against the migrated vis.config.ts"],["vis migrate verify-graph --from turbo --format json","Machine-readable equivalence report on stdout (Axis A)"],["vis migrate verify-graph --fail-on warning","Also gate CI on additive/extra-target warnings"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateVerifyGraphExecute})),"loader"),name:"verify-graph",options:[{description:"Source tool to compare against (turbo|nx|moon). Auto-detected when omitted.",name:"from",type:String},{description:"Output format: table | json | ndjson (default: table)",name:"format",type:String},{description:"Exit non-zero on: error (default) | warning",name:"fail-on",type:String}]},t4={commandPath:["migrate"],description:"Run every applicable migration non-interactively (autodetected)",examples:[["vis migrate all --yes","Run every detected migration without prompting (CI-friendly)"],["vis migrate all --dry-run","Preview every detected migration without writing files"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateAllExecute})),"loader"),name:"all",options:[...At]},r4=[t4,W_,V_,U_,G_,q_,H_,Q_,z_,J_,K_,Y_,X_,Z_,e4];var n4=Object.defineProperty,s4=d((e,t)=>n4(e,"name",{value:t,configurable:!0}),"r$w");const i4=new Set(["--cwd"]),o4=new Set(["--help","--version","-h","-V"]),a4=s4(e=>{const t=[];for(let r=0;r<e.length;r+=1){const n=e[r];if(n!==void 0){if(o4.has(n))return!1;if(n.startsWith("-")){const s=n.indexOf("="),i=s===-1?n:n.slice(0,s);if(i4.has(i)&&s===-1){const o=e[r+1];o!==void 0&&!o.startsWith("-")&&(r+=1)}continue}t.push(n)}}return t.length===1&&t[0]==="migrate"},"isBareMigrateInvocation");var c4=Object.defineProperty,l4=d((e,t)=>c4(e,"name",{value:t,configurable:!0}),"t$m");const zm=l4(e=>e in Sl&&Sl[e]!=="0"&&Sl[e]!=="false","check"),Rr=zm("CI")||zm("CONTINUOUS_INTEGRATION");var u4=Object.defineProperty,cu=d((e,t)=>u4(e,"name",{value:t,configurable:!0}),"i$g");class p4{static{d(this,"MigrateStore")}static{cu(this,"MigrateStore")}#e;#t=new Set;constructor(t){this.#e={applyProgress:null,checkedItems:new Set(t.map(r=>r.entry.id)),error:null,focusedPanel:"list",items:t,phase:"browsing",selectedIndex:0}}getSnapshot=cu(()=>this.#e,"getSnapshot");subscribe=cu(t=>(this.#t.add(t),()=>{this.#t.delete(t)}),"subscribe");getCheckedItems(){return this.#e.items.filter(t=>this.#e.checkedItems.has(t.entry.id))}getSelectedItem(){return this.#e.items[this.#e.selectedIndex]??null}setSelectedIndex(t){const r=Math.max(0,Math.min(t,this.#e.items.length-1));r!==this.#e.selectedIndex&&this.#r({...this.#e,selectedIndex:r})}setFocusedPanel(t){t!==this.#e.focusedPanel&&this.#r({...this.#e,focusedPanel:t})}toggleCheck(t){const r=new Set(this.#e.checkedItems);r.has(t)?r.delete(t):r.add(t),this.#r({...this.#e,checkedItems:r})}checkAll(){this.#r({...this.#e,checkedItems:new Set(this.#e.items.map(t=>t.entry.id))})}uncheckAll(){this.#r({...this.#e,checkedItems:new Set})}toggleAll(){this.#e.checkedItems.size===this.#e.items.length?this.uncheckAll():this.checkAll()}startApply(){const t=this.getCheckedItems().length;this.#r({...this.#e,applyProgress:{current:0,total:t},phase:"applying"})}updateApplyProgress(t){this.#e.applyProgress&&this.#r({...this.#e,applyProgress:{...this.#e.applyProgress,current:t}})}markDone(){this.#r({...this.#e,phase:"done"})}setError(t){this.#r({...this.#e,error:t,phase:"error"})}#r(t){this.#e=t;for(const r of this.#t)try{r()}catch{}}}var d4=Object.defineProperty,f4=d((e,t)=>d4(e,"name",{value:t,configurable:!0}),"f$7");const Jm=f4(({autoExitSeconds:e,onCancel:t,visible:r})=>{const{exit:n}=ey(),[s,i]=Mi(e||3),o=eo(null),a=eo(0);Qg(()=>{if(!r)return;const l=e||3;i(l),a.current=Date.now();let u=l;return o.current=setInterval(()=>{u-=1,u<=0?(o.current&&(clearInterval(o.current),o.current=null),i(0),n()):i(u)},1e3),()=>{o.current&&(clearInterval(o.current),o.current=null)}},[r,e,n]);const c=Zg(()=>{o.current&&(clearInterval(o.current),o.current=null),t()},[t]);return ty((l,u)=>{Date.now()-a.current<200||(l==="q"?n():c())},{isActive:r}),L($u,{backgroundColor:"#1e1e1e",footer:ce(_,{dimColor:!0,children:["Press"," ",L(_,{bold:!0,color:"white",children:"q"})," ","to exit,"," ",L(_,{bold:!0,color:"white",children:"any key"})," ","to stay"]}),title:`Exiting in ${s}…`,visible:r,width:50,children:L(_,{dimColor:!0,children:"Stay to explore the results interactively."})})},"QuitDialog");var h4=Object.defineProperty,Zw=d((e,t)=>h4(e,"name",{value:t,configurable:!0}),"n$l");const m4=Zw(e=>{if(e.startsWith("⚠"))return"yellow";e.startsWith("── ")||e.startsWith("[dry-run]")},"colorForPreviewLine"),g4=Zw(({focused:e,item:t,scrollRef:r})=>t?ce(de,{borderColor:e?"white":"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,children:[L(de,{flexShrink:0,paddingTop:1,paddingX:2,children:L(_,{bold:!0,color:"white",children:t.entry.title})}),L(de,{flexShrink:0,paddingBottom:1,paddingX:2,children:L(_,{dimColor:!0,children:t.entry.description})}),L(vS,{flexGrow:1,flexShrink:1,paddingX:2,ref:r,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:ce(de,{flexDirection:"column",children:[L(_,{dimColor:!0,children:"── What will change ──"}),L(_,{}),t.preview.length===0&&L(_,{dimColor:!0,children:"(no preview available)"}),t.preview.map((s,i)=>{const o=m4(s);return s===""?L(_,{},`blank-${String(i)}`):L(_,{color:o,children:s},`${String(i)}-${s.slice(0,20)}`)})]})})]}):L(de,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:L(_,{dimColor:!0,children:"No migration selected"})}),"MigrateDetailPanel");var y4=Object.defineProperty,e1=d((e,t)=>y4(e,"name",{value:t,configurable:!0}),"g$9");const v4=e1(({checked:e,isSelected:t,item:r})=>{const n=e?"☑":"☐",s=r.preview.length;return ce(de,{flexShrink:0,height:1,children:[L(_,{children:t?">":" "}),ce(_,{color:e?"white":"gray",children:[" ",n," "]}),L(de,{flexGrow:1,children:L(_,{bold:t,inverse:t,wrap:"truncate",children:r.entry.title})}),ce(_,{dimColor:!0,children:[" ",s," ","change",s===1?"":"s"," "]})]})},"MigrationRow"),b4=e1(({checkedItems:e,focused:t,isDryRun:r,items:n,scrollOffset:s,selectedIndex:i,viewportHeight:o})=>{const a=t?"white":"gray",c=n.filter(f=>e.has(f.entry.id)).length,l=n.map((f,m)=>L(v4,{checked:e.has(f.entry.id),isSelected:m===i,item:f},f.entry.id)),u=n.length,p=u>o&&o>0;return ce(de,{borderColor:a,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[ce(de,{flexShrink:0,gap:1,paddingX:1,children:[L(_,{bold:!0,inverse:!0,children:" MIGRATE "}),ce(_,{wrap:"truncate",children:[n.length," ","applicable"]}),c>0&&ce(_,{dimColor:!0,children:[" — ",c," selected"]}),r&&L(_,{color:"yellow",children:" (dry-run)"})]}),ce(de,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[L(de,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:L(de,{flexDirection:"column",marginTop:-s,children:l})}),p&&L(de,{flexShrink:0,marginLeft:1,marginRight:1,children:L(bS,{contentHeight:u,placement:"inset",scrollOffset:s,style:"block",viewportHeight:o})})]})]})},"MigrateListPanel");var $4=Object.defineProperty,w4=d((e,t)=>$4(e,"name",{value:t,configurable:!0}),"N$8");const k4=100,S4=40,D4=10,C4=w4(({autoExitSeconds:e=0,isDryRun:t,store:r})=>{const{exit:n}=ey(),{columns:s,rows:i}=yS(),o=gS(r.subscribe,r.getSnapshot),[a,c]=Mi(!1),[l,u]=Mi(!1),[p,f]=Mi(!1),[m,$]=Mi(0),b=eo(null),k=eo(null),S=eo(null),y=o.items[o.selectedIndex]??null,h=Math.max(1,i-6),v=Zg(U=>{$(M=>U>=M+h?Math.max(0,U-h+1):U<M?Math.max(0,U):M)},[h]);if(Qg(()=>{k.current?.scrollToTop()},[y?.entry.id]),ty((U,M)=>{if(U==="c"&&M.ctrl){n();return}if(!p){if(l){U==="u"||M.return?(u(!1),r.startApply(),n(r.getCheckedItems())):M.escape||U==="q"?u(!1):M.downArrow||U==="j"?S.current?.scrollBy(1):(M.upArrow||U==="k")&&S.current?.scrollBy(-1);return}if(a){M.escape||U==="?"?c(!1):U==="q"?(c(!1),f(!0)):M.downArrow||U==="j"?b.current?.scrollBy(1):(M.upArrow||U==="k")&&b.current?.scrollBy(-1);return}if(U==="?"){c(!0);return}if(U==="q"){f(!0);return}if(M.tab){r.setFocusedPanel(o.focusedPanel==="list"?"detail":"list");return}if(o.focusedPanel==="list"){if(M.downArrow||U==="j"){const X=Math.min(o.selectedIndex+1,o.items.length-1);r.setSelectedIndex(X),v(X);return}if(M.upArrow||U==="k"){const X=Math.max(o.selectedIndex-1,0);r.setSelectedIndex(X),v(X);return}if(M.pageDown){const X=Math.min(o.selectedIndex+10,o.items.length-1);r.setSelectedIndex(X),v(X);return}if(M.pageUp){const X=Math.max(o.selectedIndex-10,0);r.setSelectedIndex(X),v(X);return}if(M.home){r.setSelectedIndex(0),$(0);return}if(M.end){const X=o.items.length-1;r.setSelectedIndex(X),v(X);return}if(U===" "||M.return){y&&r.toggleCheck(y.entry.id);return}if(U==="a"){r.toggleAll();return}if(U==="u"&&!t&&o.checkedItems.size>0){u(!0);return}M.rightArrow&&r.setFocusedPanel("detail");return}if(o.focusedPanel==="detail"){if(M.escape||M.leftArrow){r.setFocusedPanel("list");return}if(M.downArrow||U==="j"){k.current?.scrollBy(1);return}if(M.upArrow||U==="k"){k.current?.scrollBy(-1);return}if(M.pageDown){k.current?.scrollBy(10);return}if(M.pageUp){k.current?.scrollBy(-10);return}if(M.home){k.current?.scrollToTop();return}M.end&&k.current?.scrollToBottom()}}},{isActive:!0}),s<S4||i<D4)return L(de,{alignItems:"center",height:i,justifyContent:"center",width:s,children:ce(_,{color:"yellow",children:["Terminal too small (",s,"x",i,")"]})});const w=s>=k4,g=[ce(de,{gap:1,children:[L(_,{bold:!0,color:"white",children:"q"}),L(_,{dimColor:!0,children:"QUIT"})]},"q"),ce(de,{gap:1,children:[L(_,{bold:!0,color:"white",children:"?"}),L(_,{dimColor:!0,children:"HELP"})]},"?"),ce(de,{gap:1,children:[L(_,{bold:!0,color:"white",children:"↑↓"}),L(_,{dimColor:!0,children:"NAV"})]},"nav"),ce(de,{gap:1,children:[L(_,{bold:!0,color:"white",children:"Space"}),L(_,{dimColor:!0,children:"CHECK"})]},"sp"),ce(de,{gap:1,children:[L(_,{bold:!0,color:"white",children:"a"}),L(_,{dimColor:!0,children:"ALL"})]},"a")];!t&&o.checkedItems.size>0&&g.push(ce(de,{gap:1,children:[L(_,{bold:!0,color:"green",children:"u"}),L(_,{dimColor:!0,children:"APPLY"})]},"u")),g.push(ce(de,{gap:1,children:[L(_,{bold:!0,color:"white",children:"Tab"}),L(_,{dimColor:!0,children:"PANEL"})]},"tab"));const E=L(de,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:L(de,{flexWrap:"wrap",gap:2,paddingX:1,children:g})}),C=ce($u,{footer:ce(_,{dimColor:!0,children:[L(_,{bold:!0,color:"white",children:"↑↓"})," scroll ",L(_,{bold:!0,color:"white",children:"?"}),"/",L(_,{bold:!0,color:"white",children:"Esc"})," close"]}),scrollRef:b,title:"KEYBOARD SHORTCUTS",visible:a,width:52,children:[ce(de,{flexDirection:"column",marginBottom:1,children:[L(_,{bold:!0,color:"white",children:"NAVIGATION"}),ce(_,{children:[L(_,{bold:!0,color:"white",children:" ↑/k"}),L(_,{dimColor:!0,children:" Move up"})]}),ce(_,{children:[L(_,{bold:!0,color:"white",children:" ↓/j"}),L(_,{dimColor:!0,children:" Move down"})]}),ce(_,{children:[L(_,{bold:!0,color:"white",children:" Tab"}),L(_,{dimColor:!0,children:" Switch panel"})]}),ce(_,{children:[L(_,{bold:!0,color:"white",children:" →/←"}),L(_,{dimColor:!0,children:" Focus detail/list"})]})]}),ce(de,{flexDirection:"column",marginBottom:1,children:[L(_,{bold:!0,color:"white",children:"SELECTION"}),ce(_,{children:[L(_,{bold:!0,color:"white",children:" Space"}),L(_,{dimColor:!0,children:" Toggle migration"})]}),ce(_,{children:[L(_,{bold:!0,color:"white",children:" a"}),L(_,{dimColor:!0,children:" Toggle all"})]})]}),ce(de,{flexDirection:"column",children:[L(_,{bold:!0,color:"white",children:"ACTIONS"}),!t&&ce(_,{children:[L(_,{bold:!0,color:"white",children:" u"}),L(_,{dimColor:!0,children:" Apply selected migrations"})]}),ce(_,{children:[L(_,{bold:!0,color:"white",children:" q"}),L(_,{dimColor:!0,children:" Quit"})]}),ce(_,{children:[L(_,{bold:!0,color:"white",children:" ?"}),L(_,{dimColor:!0,children:" Toggle help"})]})]})]}),A=r.getCheckedItems(),O=L(de,{alignItems:"center",flexDirection:"column",children:ce(_,{dimColor:!0,children:["Press ",L(_,{bold:!0,color:"white",children:"u"})," or ",L(_,{bold:!0,color:"white",children:"Enter"})," to confirm, ",L(_,{bold:!0,color:"white",children:"Esc"})," to cancel"]})}),I=L($u,{footer:O,scrollRef:S,title:`Apply ${String(A.length)} migration${A.length===1?"":"s"}?`,visible:l,width:70,children:A.map(U=>ce(de,{gap:1,children:[ce(_,{children:[" ",U.entry.title]}),ce(_,{dimColor:!0,children:["(",U.preview.length," ","change",U.preview.length===1?"":"s",")"]})]},U.entry.id))}),V=L(b4,{checkedItems:o.checkedItems,focused:o.focusedPanel==="list",isDryRun:t,items:o.items,scrollOffset:m,selectedIndex:o.selectedIndex,viewportHeight:h}),fe=L(g4,{focused:o.focusedPanel==="detail",item:y,scrollRef:k});if(w){const U=Math.floor(s*.55);return ce(de,{flexDirection:"column",height:i,width:s,children:[ce(de,{flexDirection:"row",flexGrow:1,children:[L(de,{flexGrow:1,children:V}),L(de,{width:U,children:fe})]}),E,I,L(Jm,{autoExitSeconds:e||3,onCancel:d(()=>{f(!1)},"onCancel"),visible:p}),C]})}const Y=Math.floor(i*.45);return ce(de,{flexDirection:"column",height:i,width:s,children:[L(de,{height:Y,children:V}),L(de,{flexGrow:1,children:fe}),E,I,L(Jm,{autoExitSeconds:e||3,onCancel:d(()=>{f(!1)},"onCancel"),visible:p}),C]})},"VisMigrateApp");var E4=Object.defineProperty,xf=d((e,t)=>E4(e,"name",{value:t,configurable:!0}),"r$u");const j4=/\n([ \t]+)/,A4=xf(e=>{const{indent:t,lineEnding:r}=$S(e),n={};return t!==void 0&&(n.indent=t),(r==="lf"||r==="crlf")&&(n.lineEnding=r),n},"resolveEditorConfigDefaults"),vr=xf((e,t,r={})=>{const{defaultIndent:n=" ",useEditorconfig:s=!0}=r;if(s){const{indent:i}=A4(e);if(i!==void 0)return i}if(t!==void 0){const i=j4.exec(t);if(i?.[1]!==void 0)return i[1]}return n},"resolveIndentForFile"),Of=xf((e,t={})=>{const r=j(e)?H(e):void 0;return vr(e,r,t)},"resolveIndentForExistingFile");var x4=Object.defineProperty,O4=d((e,t)=>x4(e,"name",{value:t,configurable:!0}),"t$l");const t1=[".lintstagedrc.json",".lintstagedrc"],r1=[".lintstagedrc.yaml",".lintstagedrc.yml",".lintstagedrc.mjs","lint-staged.config.mjs",".lintstagedrc.cjs","lint-staged.config.cjs",".lintstagedrc.js","lint-staged.config.js",".lintstagedrc.ts","lint-staged.config.ts",".lintstagedrc.mts","lint-staged.config.mts",".lintstagedrc.cts","lint-staged.config.cts"],Pf=[...t1,...r1],P4=[/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)(pnpm|pnpm exec|npx|yarn|yarn run|npm exec|npm run|bunx|bun run|bun x)\s+lint-staged\b/,/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)lint-staged\b/],n1=[".nano-staged.json",".nanostagedrc"],s1=[".nano-staged.mjs",".nano-staged.cjs",".nano-staged.js","nano-staged.config.mjs","nano-staged.config.cjs","nano-staged.config.js","nano-staged.config.mts","nano-staged.config.cts","nano-staged.config.ts"],Ff=[...n1,...s1],F4=[/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)(pnpm|pnpm exec|npx|yarn|yarn run|npm exec|npm run|bunx|bun run|bun x)\s+nano-staged\b/,/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)nano-staged\b/],i1=["husky","lint-staged","nano-staged"],B4=/\(is-ci \|\| husky \|\| exit 0\)\s*&&\s*/g,R4=/\bhusky(?:\s+install)?\s*&&\s*/g,T4=/\s*&&\s*husky(?:\s+install)?/g,N4=/\s*\|\|\s*husky(?:\s+install)?/g,I4=[B4,R4,T4,N4],o1=O4(e=>{if(e==="husky"||e==="husky install")return;let t=e;for(const r of I4)t=t.replace(r,"");return t=t.trim(),t===e?e:t||void 0},"cleanHuskyFromScript");var L4=Object.defineProperty,cc=d((e,t)=>L4(e,"name",{value:t,configurable:!0}),"o$q");const _4=/\/$/,M4=cc(e=>{let t='"$0"';for(let r=0;r<e;r+=1)t=`"$(dirname ${t})"`;return t},"nestedDirname"),W4=cc(e=>{const t=e.split("/").filter(r=>r!==""&&r!==".").length+2;return`#!/usr/bin/env sh
|
|
1096
|
+
</html>`;let wn;const F9=Yw(()=>{for(const e of P9)try{if(cr(e).isFile())return e}catch{}},"findBuiltHtml"),B9=Yw(()=>{if(wn!==void 0&&!process.env.VIS_DASHBOARD_NO_CACHE)return wn;const e=F9();if(!e)return wn=qm,wn;try{const t=Gg(e,"utf8");return wn=t,t}catch{return wn=qm,wn}},"renderDashboardHtml");var R9=Object.defineProperty,Af=d((e,t)=>R9(e,"name",{value:t,configurable:!0}),"l$h");const T9=Af(e=>{if(e.length===0)return;const t=[...e].sort((n,s)=>n-s),r=Math.floor(t.length/2);return t.length%2===0?(t[r-1]+t[r])/2:t[r]},"median"),N9=Af(e=>{const t=new Map;for(const n of e)if(Array.isArray(n.tasks))for(const s of n.tasks){if(!s.taskId)continue;const i=t.get(s.taskId)??{durations:[],failures:0,hits:0,misses:0,project:s.target?.project??"",runs:0,target:s.target?.target??"",taskId:s.taskId};s.cacheStatus==="HIT"||s.cacheStatus==="REMOTE_HIT"?(i.runs+=1,i.hits+=1):s.cacheStatus==="MISS"&&(i.runs+=1,i.misses+=1,typeof s.duration=="number"&&s.duration>0&&i.durations.push(s.duration),s.exitCode!==void 0&&s.exitCode!==0&&(i.failures+=1)),t.set(s.taskId,i)}const r=new Map;for(const[n,s]of t){const i=s.durations.length===0?0:s.durations.reduce((o,a)=>o+a,0)/s.durations.length;r.set(n,{averageDurationMs:i,failures:s.failures,hitRate:s.runs===0?0:s.hits/s.runs,hits:s.hits,misses:s.misses,project:s.project,runs:s.runs,target:s.target,taskId:n,timeSavedMs:i*s.hits})}return r},"aggregateTaskStats"),I9=Af(e=>{const t=e,r=[...t].sort((S,y)=>(S.startTime??"").localeCompare(y.startTime??""));let n=0,s=0,i=0,o=0,a=0,c=0;const l=[],u=[],p=[];for(const S of r){const y=S.stats??{};n+=y.total??0,s+=y.succeeded??0,i+=y.failed??0,o+=y.cached??0,a+=y.skipped??0,typeof S.duration=="number"&&S.duration>0&&(c+=S.duration,l.push(S.duration),S.startTime&&p.push({timestamp:S.startTime,value:S.duration})),(y.total??0)>0&&S.startTime&&u.push({timestamp:S.startTime,value:(y.cached??0)/(y.total??1)})}const f=[...N9(r).values()],m=f.filter(S=>S.averageDurationMs>0).sort((S,y)=>y.averageDurationMs-S.averageDurationMs).slice(0,10),$=f.filter(S=>S.runs>=2).sort((S,y)=>y.timeSavedMs-S.timeSavedMs||y.hitRate-S.hitRate).slice(0,10),b=f.filter(S=>S.runs>=3&&S.hits>0&&S.misses>0).sort((S,y)=>y.misses/y.runs-S.misses/S.runs).slice(0,10),k=f.reduce((S,y)=>S+y.timeSavedMs,0);return{averageRunDurationMs:l.length===0?null:l.reduce((S,y)=>S+y,0)/l.length,cacheHitRate:o+s+i===0?null:o/(o+s+i),durationOverTime:p,hitRateOverTime:u,medianRunDurationMs:T9(l)??null,mostCachedTasks:$,mostInvalidatedTasks:b,slowestTasks:m,totals:{cached:o,estimatedTimeSavedMs:k,failed:i,runs:t.length,skipped:a,succeeded:s,tasks:n,totalDurationMs:c}}},"computeDashboardMetrics");var L9=Object.defineProperty,Kr=d((e,t)=>L9(e,"name",{value:t,configurable:!0}),"u$i");const Hm=Kr((e,t)=>{const r=t.replaceAll(/[^\w.\-:]/g,"");if(r.length===0||r!==t)return;const n=D(hn(e),`${r}.json`);if(j(n))try{return le(n)}catch{return}const s=m0(e);if(j(s))try{const i=le(s);return i.id===r?i:void 0}catch{return}},"readRunById"),_9=Kr(async e=>{const t=new Set,r=hn(e);try{await Hk(r,{recursive:!0})}catch{}let n,s;const i=Kr(a=>{s=a,n&&clearTimeout(n),n=setTimeout(()=>{if(n=void 0,!s)return;const c=s;s=void 0;for(const l of t)try{l(c)}catch{}},200)},"dispatch");let o;try{o=Jk(r,(a,c)=>{if(!c||typeof c!="string"||!c.endsWith(".json"))return;const l=c.slice(0,-5);i({id:l,type:"run-changed"})})}catch{o=void 0}return{close:Kr(()=>{n&&clearTimeout(n),o?.close(),t.clear()},"close"),subscribe:Kr(a=>(t.add(a),()=>{t.delete(a)}),"subscribe")}},"createRunsWatcher"),M9=Kr((e,t)=>{const r=new OP;return r.get("/",n=>n.html(B9())),r.get("/api/overview",n=>{const s=lo(e.workspaceRoot),i=I9(s),o=C9(e.workspaceRoot,{minRuns:2},s);return n.json({flaky:o,metrics:i})}),r.get("/api/runs",n=>{const s=lo(e.workspaceRoot).filter(i=>typeof i.id=="string"&&typeof i.startTime=="string"&&typeof i.endTime=="string"&&typeof i.duration=="number").map(i=>{const o=i.stats,a=o?{cached:typeof o.cached=="number"?o.cached:void 0,failed:typeof o.failed=="number"?o.failed:void 0,skipped:typeof o.skipped=="number"?o.skipped:void 0,succeeded:typeof o.succeeded=="number"?o.succeeded:void 0,total:typeof o.total=="number"?o.total:void 0}:void 0;return{duration:i.duration,endTime:i.endTime,id:i.id,startTime:i.startTime,stats:a}}).sort((i,o)=>o.startTime.localeCompare(i.startTime));return n.json({runs:s})}),r.get("/api/runs/:id",n=>{const s=Hm(e.workspaceRoot,n.req.param("id"));return s?n.json(s):n.json({error:"Not found"},404)}),r.get("/api/runs/:runId/tasks/:taskId/diff",n=>{const s=Hm(e.workspaceRoot,n.req.param("runId"));if(!s)return n.json({error:"Run not found"},404);const i=n.req.param("taskId"),o=s.tasks?.find(l=>l.taskId===i);if(!o)return n.json({error:"Task not found"},404);const a=lo(e.workspaceRoot),c=x9(a,s.id,o);return n.json(c)}),r.get("/api/cache",async n=>{if(!j(e.cacheDirectory))return n.json({directory:e.cacheDirectory,entries:[],exists:!1,totalBytes:0});const s=await cn(e.cacheDirectory),i=s.reduce((a,c)=>a+c.sizeBytes,0),o=Date.now();return n.json({directory:e.cacheDirectory,entries:s.map(a=>({ageMs:o-a.mtimeMs,hash:a.hash,mtimeIso:new Date(a.mtimeMs).toISOString(),sizeBytes:a.sizeBytes})),exists:!0,totalBytes:i})}),r.get("/api/environment",n=>n.json({arch:process.arch,cacheDirectory:e.cacheDirectory,node:process.version,platform:process.platform,workspaceRoot:e.workspaceRoot})),r.get("/api/events",n=>WP(n,async s=>{const i=[];let o;const a=t(l=>{if(i.push(l),o){const u=o;o=void 0,u()}});s.onAbort(()=>{if(a(),o){const l=o;o=void 0,l()}}),await s.writeSSE({data:JSON.stringify({ok:!0}),event:"ready"});const c=15e3;for(;!s.aborted;){if(i.length===0){const u=s.sleep(c),p=new Promise(f=>{o=f});if(await Promise.race([u,p]),s.aborted)break;if(i.length===0){await s.writeSSE({data:"",event:"heartbeat"});continue}}const l=i.shift();await s.writeSSE({data:JSON.stringify(l),event:"change"})}})),r},"createDashboardApp"),W9=Kr(async e=>{const t=await _9(e.workspaceRoot),r=M9(e,t.subscribe),n=xO({fetch:r.fetch,hostname:e.host,port:e.port});await new Promise((a,c)=>{n.once("listening",()=>{a()}),n.once("error",l=>{c(l)})});const s=n.address(),i=typeof s=="object"&&s?s.port:e.port,o=`http://${e.host==="0.0.0.0"||e.host==="::"||e.host==="::0"?"localhost":e.host}:${String(i)}`;return{close:Kr(()=>new Promise((a,c)=>{t.close(),n.close(l=>{l?c(l):a()})}),"close"),port:i,url:o}},"startDashboardServer");var V9=Object.defineProperty,cp=d((e,t)=>V9(e,"name",{value:t,configurable:!0}),"s$p");const U9=cp(e=>{const{platform:t}=process,[r,n]=t==="darwin"?["open",[e]]:t==="win32"?["cmd",["/c","start","",e]]:["xdg-open",[e]];nS(r,n,s=>{})},"openInBrowser"),G9={description:"Open a browser dashboard with cache, run history, and cache-miss diffs",examples:[["vis dashboard","Start the dashboard on a random port (server only — does not open a browser)"],["vis dashboard --open","Start the dashboard and open it in the default browser"],["vis dashboard --port=7788","Pin the server to a specific port"],["vis dashboard --host=0.0.0.0 --port=7788","Expose the dashboard on all interfaces"]],execute:cp(async({options:e,process:t,visConfig:r,workspaceRoot:n})=>{const s=n??t.cwd,i=g0(s,e.cacheDir,r?.taskRunner?.cacheDirectory),o=typeof e.port=="number"&&Number.isFinite(e.port)?e.port:0,a=typeof e.host=="string"&&e.host.length>0?e.host:"127.0.0.1",c=await W9({cacheDirectory:i,host:a,port:o,workspaceRoot:s});P.success(`Dashboard listening on ${c.url}`),P.info(`Workspace: ${s}`),P.info(`Cache: ${i}`),P.info("Press Ctrl+C to stop."),e.open===!0&&U9(c.url),await new Promise(l=>{let u=!1;const p=cp(()=>{u||(u=!0,process.off("SIGINT",p),process.off("SIGTERM",p),(async()=>{try{await c.close()}catch{}finally{l()}})())},"shutdown");process.once("SIGINT",p),process.once("SIGTERM",p)})},"execute"),group:"Workspace",name:"dashboard",options:[{defaultValue:0,description:"Port to bind the dashboard server to (0 = auto-assign)",name:"port",type:Number},{defaultValue:"127.0.0.1",description:"Host interface to bind to. Default binds to localhost only.",name:"host",type:String},{defaultValue:!1,description:"Open the dashboard in the default browser after starting",name:"open",type:Boolean},{description:"Cache directory to inspect (overrides config and default). Relative paths resolve against the workspace root.",name:"cache-dir",type:String}]};var q9=Object.defineProperty,H9=d((e,t)=>q9(e,"name",{value:t,configurable:!0}),"e$O");const z9={description:"Deduplicate dependencies using the detected package manager",examples:[["vis dedupe","Run deduplication"],["vis dedupe --check","Preview changes without modifying (CI-friendly)"]],group:"Dependencies",loader:H9(()=>import("./handler8.js"),"loader"),name:"dedupe",options:[{defaultValue:!1,description:"Preview changes without modifying files (dry-run)",name:"check",type:Boolean}]};var J9=Object.defineProperty,K9=d((e,t)=>J9(e,"name",{value:t,configurable:!0}),"e$N");const Y9={alias:"dc",description:"Create or update .devcontainer/devcontainer.json interactively",examples:[["vis devcontainer","Launch interactive devcontainer config editor"],["vis dc","Alias for devcontainer"],["vis devcontainer --template node-pnpm","Start from Node.js + pnpm template"]],group:"Scaffold & Config",loader:K9(()=>import("./handler46.js"),"loader"),name:"devcontainer",options:[{alias:"t",description:"Start from a template: node, node-pnpm, node-postgres, node-dind, fullstack, python, go, rust, java, devops, minimal, custom",name:"template",type:String},{alias:"o",description:"Output path (default: .devcontainer/devcontainer.json)",name:"output",type:String}]};var X9=Object.defineProperty,Q9=d((e,t)=>X9(e,"name",{value:t,configurable:!0}),"e$M");const Z9={argument:{description:"Docker subcommand: scaffold | prune",name:"subcommand",type:String},description:"Docker integration — scaffold a minimal context or prune unfocused deps",examples:[["vis docker scaffold --focus=my-app","Generate .vis/docker/workspace for my-app + its deps"],["vis docker scaffold --focus=my-app --include-sources","Also copy focus source trees"],["vis docker scaffold --focus=my-app,other --out=.vis/docker","Focus multiple projects"],["vis docker prune --context=.vis/docker","Strip unfocused projects inside a build stage"]],group:"Workspace",loader:Q9(()=>import("./handler10.js"),"loader"),name:"docker",options:[{description:"Project name(s) to focus on — comma-separated for multiple",name:"focus",type:String},{description:"Output directory for the scaffold (default: .vis/docker)",name:"out",type:String},{defaultValue:!1,description:"Also copy focus project source trees to <out>/sources",name:"include-sources",type:Boolean},{description:"Scaffold root for `vis docker prune` (default: .vis/docker)",name:"context",type:String},{defaultValue:!0,description:"Rewrite the workspace lockfile to drop unfocused projects (use --no-prune-lockfile to copy verbatim)",name:"prune-lockfile",type:Boolean}]};var e_=Object.defineProperty,t_=d((e,t)=>e_(e,"name",{value:t,configurable:!0}),"e$L");const r_={description:"Run a full project health check (outdated, security, duplicates, optimizations)",examples:[["vis doctor","Full project health check"],["vis doctor --fix","Check and auto-apply safe fixes"],["vis doctor --format json","Machine-readable output for CI"],["vis doctor --only security","Only run the security scans"],["vis doctor --skip optimization,runtime","Skip the listed sections"],["vis doctor --quiet","Summary only, no per-section breakdown"],["vis doctor --no-progress","Disable live progress UI (sequential logs)"],["vis doctor --exit-code","Exit with code 1 if security issues found"],["vis doctor --exit-code --strict","Fail on any issue (outdated, duplicates, security)"]],group:"Security & Health",loader:t_(()=>import("./handler40.js"),"loader"),name:"doctor",options:[{description:"Output format: table or json (default: table). Alias: --json",name:"format",type:String},{defaultValue:!1,description:"Shorthand for --format json",name:"json",type:Boolean},{defaultValue:!1,description:"Exit with code 1 if issues found",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Auto-apply safe fixes (security overrides + codemods, SIGTERM orphans)",name:"fix",type:Boolean},{defaultValue:!1,description:"With --fix: escalate orphan cleanup to SIGKILL / taskkill /F (use when SIGTERM is ignored)",name:"fix-force",type:Boolean},{defaultValue:!1,description:"With --exit-code: also fail on outdated and duplicate deps",name:"strict",type:Boolean},{description:"Comma-separated sections to run: dependencies,security,optimization,runtime",name:"only",type:String},{description:"Comma-separated sections to skip",name:"skip",type:String},{defaultValue:!1,description:"Suppress per-section detail; print summary only",name:"quiet",type:Boolean},{defaultValue:!1,description:"Disable live progress UI (forces sequential logs)",name:"no-progress",type:Boolean},{defaultValue:!1,description:"Bypass the doctor result cache (~/.vis/cache/doctor)",name:"no-cache",type:Boolean},{description:"Comma-separated package name patterns to scope findings (supports * globs, e.g. '@types/*,react')",name:"filter",type:String}]};var n_=Object.defineProperty,s_=d((e,t)=>n_(e,"name",{value:t,configurable:!0}),"e$K");const i_={argument:{description:"Command to execute followed by arguments",name:"command",type:String},description:"Execute a local node_modules/.bin command (no remote fallback)",examples:[["vis exec eslint .","Run local eslint"],["vis exec tsc --noEmit","Run local TypeScript check"],["vis exec -r -- eslint .","Run in all workspace packages"],["vis exec -c 'echo $PATH'","Shell mode"]],group:"Run & Execute",loader:s_(()=>import("./handler11.js"),"loader"),name:"exec",options:[{alias:"c",defaultValue:!1,description:"Execute within shell environment",name:"shell-mode",type:Boolean},{alias:"r",defaultValue:!1,description:"Run in every workspace package",name:"recursive",type:Boolean},{alias:"w",defaultValue:!1,description:"Run on workspace root only",name:"workspace-root",type:Boolean},{alias:"F",description:"Filter packages by name pattern",multiple:!0,name:"filter",type:String},{defaultValue:!1,description:"Run concurrently without topological ordering",name:"parallel",type:Boolean},{defaultValue:!1,description:"Reverse topological execution order",name:"reverse",type:Boolean}]};var o_=Object.defineProperty,a_=d((e,t)=>o_(e,"name",{value:t,configurable:!0}),"e$J");const c_={argument:{description:"Template name (or remote source like git://… or npm://…) — omit for interactive picker",name:"template",type:String},description:"Scaffold files from an in-repo template",examples:[["vis generate","Pick a template interactively"],["vis generate package","Run the 'package' template"],["vis generate component -- --name=Button --style=primary","Pre-fill option values"],["vis generate package --to=./packages/new --force","Custom destination + overwrite"],["vis generate package --dry-run","Print planned writes without touching disk"],["vis generate git://github.com/org/template#main","Fetch and run a remote template"],["vis generate --list","Show discovered templates"],["vis generate --list --json","Machine-readable template list"],["vis generate package --describe --json","Print template metadata (variables, destination) as JSON"]],group:"Scaffold & Config",loader:a_(()=>import("./handler35.js"),"loader"),name:"generate",options:[{defaultValue:!1,description:"List discovered templates",name:"list",type:Boolean},{defaultValue:!1,description:"Print template metadata (about, destination, variables) without running produce",name:"describe",type:Boolean},{defaultValue:!1,description:"Emit JSON output (with --list or --describe)",name:"json",type:Boolean},{description:"Destination directory",name:"to",type:String},{defaultValue:!1,description:"Print planned writes without touching disk",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Overwrite existing files without prompting",name:"force",type:Boolean},{defaultValue:!1,description:"Skip prompts; use template defaults",name:"defaults",type:Boolean},{defaultValue:!1,description:"Skip running post-generation scripts",name:"skip-scripts",type:Boolean},{defaultValue:!1,description:"Skip interactive prompts (errors on missing required values)",name:"no-interactive",type:Boolean},{defaultValue:!1,description:"Prefer locally cached remote templates over re-downloading",name:"prefer-offline",type:Boolean}]};var l_=Object.defineProperty,u_=d((e,t)=>l_(e,"name",{value:t,configurable:!0}),"t$u");const p_={description:"Visualize the project dependency graph",examples:[["vis graph","Show colored dependency graph (TUI in TTY, ASCII otherwise)"],["vis graph --format=ascii","Force ASCII tree output"],["vis graph --format=dot","Output in Graphviz DOT format"],["vis graph --format=html --output=graph.html","Generate interactive HTML graph"],["vis graph --format=json --output=graph.json","Save JSON graph to file"]],group:"Workspace",loader:u_(()=>import("./handler42.js"),"loader"),name:"graph",options:[{alias:"f",defaultValue:void 0,description:"Output format: tui, ascii, dot, json, html (default: tui in TTY, ascii otherwise)",name:"format",type:String},{alias:"o",description:"Write output to file instead of stdout",name:"output",type:String},{alias:"d",description:"Maximum dependency tree depth for ASCII output (default: unlimited)",name:"depth",type:Number}]},Xw=["pre-commit","pre-merge-commit","prepare-commit-msg","commit-msg","post-commit","applypatch-msg","pre-applypatch","post-applypatch","pre-rebase","post-rewrite","post-checkout","post-merge","pre-push","pre-auto-gc"],Qw=".vis-hooks",LJ=[".pre-commit-config.yaml",".pre-commit-config.yml","prek.toml"],_J={commit:"pre-commit","merge-commit":"pre-merge-commit",push:"pre-push"},MJ=new Set(["commit-msg","post-checkout","post-commit","post-merge","post-rewrite","pre-commit","pre-merge-commit","pre-push","pre-rebase","prepare-commit-msg"]),WJ=new Set(["commit-msg","post-checkout","post-merge","post-rewrite","pre-rebase","prepare-commit-msg"]),VJ=new Set(["fail","script","system"]);var d_=Object.defineProperty,us=d((e,t)=>d_(e,"name",{value:t,configurable:!0}),"e$H");const ps={defaultValue:Qw,description:"Custom hooks directory",name:"hooks-dir",type:String},ds=[{defaultValue:void 0,description:"Set to 0 to disable git hooks, set to 2 for debug output",name:"VIS_GIT_HOOKS",type:String}],f_={commandPath:["hook"],description:"Install git hooks for the workspace (migrates husky / prek on prompt)",env:[...ds],examples:[["vis hook install","Install git hooks in .vis-hooks/"],["vis hook install --hooks-dir=.githooks","Install hooks in a custom directory"]],group:"Git Hooks",loader:us(()=>import("./handler43.js").then(e=>({default:e.hookInstallExecute})),"loader"),name:"install",options:[ps]},h_={commandPath:["hook"],description:"Remove git hooks and reset core.hooksPath",env:[...ds],examples:[["vis hook uninstall","Remove git hooks and reset core.hooksPath"]],group:"Git Hooks",loader:us(()=>import("./handler43.js").then(e=>({default:e.hookUninstallExecute})),"loader"),name:"uninstall",options:[ps]},m_={commandPath:["hook"],description:"Migrate from husky or prek to vis hooks (auto-detected)",env:[...ds],examples:[["vis hook migrate","Migrate from husky or prek to vis hooks (auto-detected)"],["vis hook migrate --dry-run","Preview what a migration would write without touching disk"]],group:"Git Hooks",loader:us(()=>import("./handler43.js").then(e=>({default:e.hookMigrateExecute})),"loader"),name:"migrate",options:[ps,{defaultValue:!1,description:"Preview migrate without writing files",name:"dry-run",type:Boolean}]},g_={commandPath:["hook"],description:"Show configured hooks grouped by stage",env:[...ds],examples:[["vis hook list","Show configured hooks grouped by stage"]],group:"Git Hooks",loader:us(()=>import("./handler43.js").then(e=>({default:e.hookListExecute})),"loader"),name:"list",options:[ps]},y_={commandPath:["hook"],description:"Sanity-check installed hooks and the bundled runner",env:[...ds],examples:[["vis hook validate","Sanity-check installed hooks and the bundled runner"]],group:"Git Hooks",loader:us(()=>import("./handler43.js").then(e=>({default:e.hookValidateExecute})),"loader"),name:"validate",options:[ps]},v_={argument:{description:"Hook stage to run (e.g. pre-commit, commit-msg). Defaults to pre-commit.",name:"stage",type:String},commandPath:["hook"],description:"Run a specific hook stage against tracked files",env:[...ds],examples:[["vis hook run pre-commit --all-files","Run the pre-commit hooks against every tracked file"],["vis hook run pre-commit --from-ref=main --to-ref=HEAD","Run pre-commit hooks on files changed between two refs"],["vis hook run pre-commit --last-commit","Shortcut for --from-ref HEAD~1 --to-ref HEAD"]],group:"Git Hooks",loader:us(()=>import("./handler43.js").then(e=>({default:e.hookRunExecute})),"loader"),name:"run",options:[ps,{defaultValue:!1,description:"Run against every tracked file",name:"all-files",type:Boolean},{defaultValue:void 0,description:"Include files changed since this ref",name:"from-ref",type:String},{defaultValue:void 0,description:"Include files changed up to this ref",name:"to-ref",type:String},{defaultValue:!1,description:"Shortcut for --from-ref HEAD~1 --to-ref HEAD",name:"last-commit",type:Boolean}]},b_={argument:{description:"Target to add (currently: `secrets`)",name:"target",type:String},commandPath:["hook"],description:"Add a managed hook snippet (e.g. `vis secrets --staged`)",env:[...ds],examples:[["vis hook add secrets","Add a pre-commit hook that runs `vis secrets --staged`"]],group:"Git Hooks",loader:us(()=>import("./handler43.js").then(e=>({default:e.hookAddExecute})),"loader"),name:"add",options:[ps]},$_=[f_,h_,m_,g_,y_,v_,b_];var w_=Object.defineProperty,k_=d((e,t)=>w_(e,"name",{value:t,configurable:!0}),"e$G");const S_={argument:{description:"Project name to check (required)",name:"project",type:String},description:'Exit with inverted codes for CI "Ignored Build Step" gating (Vercel/Netlify)',examples:[["vis ignore my-app","Check if my-app is affected and decide whether to build"],["vis ignore my-app --base $VERCEL_GIT_PREVIOUS_SHA","Explicit base ref"],["vis ignore my-app --json","Emit the decision as JSON instead of text"],["vis ignore my-app --verbose","Print debug info about the decision path"],["vis ignore my-app --exit-zero-on-build","Normal exit semantics (0=build, 0=skip)"]],group:"Run & Execute",loader:k_(()=>import("./handler32.js"),"loader"),name:"ignore",options:[{description:"Git base ref for comparison. Defaults to CI provider env vars, then HEAD~1.",name:"base",type:String},{defaultValue:"HEAD",description:"Git head ref for comparison",name:"head",type:String},{defaultValue:"deep",description:'Downstream scope: "none", "direct", or "deep"',name:"downstream",type:String},{defaultValue:"none",description:'Upstream scope: "none", "direct", or "deep"',name:"upstream",type:String},{defaultValue:!1,description:"Emit the decision as JSON on stdout instead of human text",name:"json",type:Boolean},{defaultValue:!1,description:"Exit 0 on build (normal semantics) instead of 1 (inverted Vercel/Netlify semantics)",name:"exit-zero-on-build",type:Boolean},{defaultValue:!1,description:"Enable verbose debug output",name:"verbose",type:Boolean}]};var D_=Object.defineProperty,C_=d((e,t)=>D_(e,"name",{value:t,configurable:!0}),"e$F");const E_={description:"Remove vis from the system (self-uninstall)",examples:[["vis implode","Interactive uninstall"],["vis implode --yes","Non-interactive uninstall (CI)"]],group:"System",loader:C_(()=>import("./handler12.js"),"loader"),name:"implode",options:[{alias:"y",defaultValue:!1,description:"Skip confirmation prompt",name:"yes",type:Boolean}]};var j_=Object.defineProperty,A_=d((e,t)=>j_(e,"name",{value:t,configurable:!0}),"e$E");const x_={alias:"view",argument:{description:"Package name followed by optional metadata fields (e.g. 'react version dependencies')",name:"args",type:String},description:"Show npm registry metadata for a package (alias of `npm view` / `pnpm view` / `yarn info` / `bun pm view`)",examples:[["vis info react","Full registry metadata for react"],["vis info react version","Latest version only"],["vis info react versions","All published versions"],["vis info react@18 dependencies","Dependencies of react@18"],["vis info react --json","Emit JSON"],["vis view react","Alias matching npm/pnpm"]],group:"Dependencies",loader:A_(()=>import("./handler13.js"),"loader"),name:"info",options:[{defaultValue:!1,description:"Output as JSON",name:"json",type:Boolean}]};var O_=Object.defineProperty,P_=d((e,t)=>O_(e,"name",{value:t,configurable:!0}),"e$D");const F_={description:"Initialize vis.config.ts with best-practice security defaults",examples:[["vis init","Interactive setup wizard"],["vis init --no-interactive","Create minimal config without prompts"],["vis init --force","Overwrite existing config"],["vis init --sync-native","Also sync to native PM config files"],["vis init --schema","Print the workspace-relative `$schema` refs to paste into project.json and vis.config.ts"]],group:"Scaffold & Config",loader:P_(()=>import("./handler14.js"),"loader"),name:"init",options:[{defaultValue:!1,description:"Overwrite existing config file",name:"force",type:Boolean},{defaultValue:!1,description:"Skip interactive prompts",name:"no-interactive",type:Boolean},{defaultValue:!1,description:"Sync settings to native PM config files",name:"sync-native",type:Boolean},{defaultValue:!1,description:"Print workspace-relative $schema paths for project.json and vis.config.ts, then exit",name:"schema",type:Boolean}]};var B_=Object.defineProperty,R_=d((e,t)=>B_(e,"name",{value:t,configurable:!0}),"e$C");const T_={argument:{description:"Package to inspect, optionally pinned: `<name>` or `<name>@<spec>`. `<spec>` may be a version, range, or dist-tag.",name:"package"},description:"Run all marshalls against a package without installing it",examples:[["vis inspect express","Run every marshall against express@latest"],["vis inspect lodash@4.17.21","Pin to an exact version"],["vis inspect react@^18","Resolve a semver range, then inspect the best match"],["vis inspect express --json","Emit findings as JSON for CI integration"],["vis inspect express --strict","Exit non-zero on any warning, not just errors"],["vis inspect express --only author,downloads","Run a subset of marshalls"],["vis inspect express --only signatures","Signatures are off by default; opt in with --only"]],group:"Security & Health",loader:R_(()=>import("./handler15.js"),"loader"),name:"inspect",options:[{defaultValue:!1,description:"Emit findings as a JSON document instead of the human-readable table.",name:"json",type:Boolean},{defaultValue:!1,description:"Exit non-zero on any finding (warnings included). Default exits non-zero only on errors.",name:"strict",type:Boolean},{description:"Comma-separated subset of marshalls to run. Known: author, archivedRepo, downloads, expiredDomains, metadata, newBin, provenance, signatures. Signatures only runs when explicitly requested here.",name:"only",type:String}]};var N_=Object.defineProperty,I_=d((e,t)=>N_(e,"name",{value:t,configurable:!0}),"e$B");const L_={alias:"i",argument:{description:"Optional package names. When provided, delegates to `vis add` (enables npm-style `alias npm='vis install'` wrappers).",name:"packages",type:String},description:"Install dependencies using the detected package manager",examples:[["vis install","Install all dependencies (frozen-lockfile by default when a lockfile is present)"],["vis install react react-dom","Delegates to `vis add` — enables shell aliases like `alias npm='vis install'`"],["vis i --no-frozen-lockfile","Allow lockfile updates (escape hatch for the default)"],["vis install --ci","Clean install: wipe node_modules + frozen lockfile (mirrors npm ci / pnpm ci)"],["vis install --prefer-offline","Use cached packages when available, fall back to network"],["vis install --prod","Install production dependencies only"],["vis install --filter app","Install for specific workspace package"],["vis install --run-scripts","Run lifecycle scripts (opts out of vis's default block-by-default policy; allowlisted packages run via security.policies.installScripts.allow)"],["vis install --no-typosquat-check","Skip typosquat name check"],["vis install --installer aube","Force aube as the installer (errors if not on PATH)"],["vis install --no-aube","Bypass aube; use the lockfile-detected PM"]],group:"Dependencies",loader:I_(()=>import("./handler16.js"),"loader"),name:"install",options:[{alias:"P",conflicts:"dev",description:"Skip devDependencies (no positional args) / add as peer (with positional args, npm-style)",name:"prod",type:Boolean},{alias:"D",conflicts:"prod",description:"Install devDependencies only (no positional args) / add as dev (with positional args, npm-style)",name:"dev",type:Boolean},{defaultValue:!1,description:"Add as optional dependency (only with positional args; mirrors `npm install -O`)",name:"save-optional",type:Boolean},{alias:"E",defaultValue:!1,description:"Save exact version (only with positional args; mirrors `npm install -E`)",name:"exact",type:Boolean},{defaultValue:!1,description:"Skip Socket.dev security check (only with positional args; mirrors `vis add --no-socket-check`)",name:"no-socket-check",type:Boolean},{defaultValue:!1,description:"Skip the offline marshall pipeline (only with positional args; mirrors `vis add --no-marshall-check`)",name:"no-marshall-check",type:Boolean},{defaultValue:!1,description:"Use frozen lockfile (CI mode, maps to npm ci)",name:"frozen-lockfile",type:Boolean},{defaultValue:!1,description:"Opt out of vis's default frozen-lockfile behavior and allow lockfile updates",name:"no-frozen-lockfile",type:Boolean},{defaultValue:!1,description:"Clean install: wipe node_modules then install with frozen lockfile",name:"ci",type:Boolean},{alias:"f",defaultValue:!1,description:"Force reinstall all dependencies",name:"force",type:Boolean},{defaultValue:!1,description:"Run lifecycle scripts (opts out of vis's default block-by-default policy; allowlisted packages run via security.policies.installScripts.allow)",name:"run-scripts",type:Boolean},{defaultValue:!1,description:"Update lockfile without installing",name:"lockfile-only",type:Boolean},{defaultValue:!1,description:"Skip optional dependencies",name:"no-optional",type:Boolean},{defaultValue:!1,description:"Use only cached packages",name:"offline",type:Boolean},{defaultValue:!1,description:"Prefer cached packages, fall back to network when missing",name:"prefer-offline",type:Boolean},{alias:"s",defaultValue:!1,description:"Suppress output",name:"silent",type:Boolean},{alias:"r",defaultValue:!1,description:"Install in all workspace packages",name:"recursive",type:Boolean},{alias:"w",defaultValue:!1,description:"Target workspace root",name:"workspace-root",type:Boolean},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String},{defaultValue:!1,description:"Skip typosquat name check",name:"no-typosquat-check",type:Boolean},{description:"Pick the installer explicitly. One of: auto, aube, pnpm, npm, yarn, bun. Overrides VIS_INSTALLER and install.backend in vis.config.",name:"installer",type:String},{defaultValue:!1,description:"Skip aube and use the lockfile-detected PM. Wins over --installer / VIS_INSTALLER / install.backend.",name:"no-aube",type:Boolean}]};var __=Object.defineProperty,M_=d((e,t)=>__(e,"name",{value:t,configurable:!0}),"e$A");const W_={alias:"ln",argument:{description:"Package name or directory path to link (omit to register current package)",name:"target",type:String},description:"Link a local package for development",examples:[["vis link ./packages/utils","Link local directory package (works on all PMs)"],["vis link","Register current package globally (pnpm <=10, yarn, npm, bun)"],["vis link react","Link global package into current project (pnpm <=10, yarn, npm, bun)"]],group:"Dependencies",loader:M_(()=>import("./handler18.js"),"loader"),name:"link"};var V_=Object.defineProperty,U_=d((e,t)=>V_(e,"name",{value:t,configurable:!0}),"e$z");const G_={description:"Lint workspace dependency policies (workspace-protocol, banned-deps, redefine-root, workspace-versions, custom-types, empty-deps, root-private, root-package-manager, root-deps, missing-package-json, dead-workspace-patterns, types-in-deps, similar-deps)",examples:[["vis lint","Run every enabled lint and exit non-zero on failures"],["vis lint --workspace-protocol","Only check that internal deps use workspace:*"],["vis lint --workspace-protocol --fix","Auto-rewrite internal deps to use workspace:*"],["vis lint --redefine-root","Flag deps duplicated between root and child packages"],["vis lint --banned-deps","Flag deps matching policy.bannedDeps in vis config"],["vis lint --workspace-versions","Flag external deps declared at different versions across packages"],["vis lint --workspace-versions --fix","Rewrite drifting deps to the highest sibling version"],["vis lint --workspace-versions --dep react","Limit version-drift check to a single dep"],["vis lint --workspace-versions --resolve catalog --fix","Rewrite drifting deps to catalog: when a catalog already pins them"],["vis lint --workspace-versions --resolve catalog --propose-min 3","Suggest new catalog entries for deps ≥3 packages already agree on"],["vis lint --custom-types","Flag drift in engines.{node,pnpm}, packageManager, volta.{node,pnpm,yarn}, devEngines"],["vis lint --custom-types --fix","Align all engines/packageManager/volta versions to the highest sibling"],["vis lint --empty-deps --fix","Drop empty `dependencies` / `devDependencies` / etc. blocks across the workspace"],["vis lint --root-private --fix",'Ensure the workspace root package.json has "private": true'],["vis lint --root-package-manager","Ensure the root package.json declares a `packageManager` field"],["vis lint --root-deps --fix","Move runtime deps off the private workspace root into devDependencies"],["vis lint --missing-package-json","Flag workspace dirs that don't contain a package.json"],["vis lint --dead-workspace-patterns --fix","Drop workspace patterns that match zero packages"],["vis lint --types-in-deps --fix","Move @types/* out of dependencies on private packages"],["vis lint --similar-deps","Flag drift across related dep families (react+react-dom, @babel/*, …)"],["vis lint --ban left-pad --ban request","One-off ban: flag any package declaring left-pad or request"],["vis lint --pin react@18.2.0","One-off pin: flag any package declaring react at a different version"],["vis lint --format json","Emit findings as JSON for CI / editor integrations"]],group:"Security & Health",loader:U_(()=>import("./handler41.js"),"loader"),name:"lint",options:[{defaultValue:!1,description:"Lint that internal deps use the workspace: protocol",name:"workspace-protocol",type:Boolean},{defaultValue:!1,description:"Lint that no child re-declares a dep already pinned in the workspace root",name:"redefine-root",type:Boolean},{defaultValue:!1,description:"Lint deps against policy.bannedDeps in vis config",name:"banned-deps",type:Boolean},{defaultValue:!1,description:"Lint that all packages declare external deps at the same version",name:"workspace-versions",type:Boolean},{defaultValue:!1,description:"Lint engines.{node,pnpm}, packageManager, volta.*, devEngines.* for drift across packages",name:"custom-types",type:Boolean},{defaultValue:!1,description:"Flag empty dependency blocks (`dependencies: {}`, `devDependencies: {}`, …) across the workspace",name:"empty-deps",type:Boolean},{defaultValue:!1,description:'Ensure the workspace root package.json sets `"private": true`',name:"root-private",type:Boolean},{defaultValue:!1,description:"Ensure the workspace root package.json declares a `packageManager` field",name:"root-package-manager",type:Boolean},{defaultValue:!1,description:"Flag runtime dependencies on the private workspace root (move them to devDependencies)",name:"root-deps",type:Boolean},{defaultValue:!1,description:"Flag workspace directories that lack a package.json",name:"missing-package-json",type:Boolean},{defaultValue:!1,description:"Flag workspace patterns (in `pnpm-workspace.yaml` / `package.json#workspaces`) that match zero packages",name:"dead-workspace-patterns",type:Boolean},{defaultValue:!1,description:"Flag `@types/*` declared in `dependencies` on a private package (should be in devDependencies)",name:"types-in-deps",type:Boolean},{defaultValue:!1,description:"Flag version drift across related dep families (react+react-dom, @babel/*, @storybook/*, …)",name:"similar-deps",type:Boolean},{description:"Restrict --workspace-versions to a single dep",name:"dep",type:String},{description:"Ban a dep name or glob for this run (repeatable). Auto-enables --banned-deps.",multiple:!0,name:"ban",type:String},{description:"Pin a dep to an exact specifier for this run, e.g. react@^18.2.0 (repeatable). Auto-enables --workspace-versions.",multiple:!0,name:"pin",type:String},{description:"Conflict resolution for --workspace-versions: highest, lowest, or catalog (default: highest)",name:"resolve",type:String},{description:"Propose catalog entries for deps ≥N packages already agree on. Activates with --resolve catalog.",name:"propose-min",type:Number},{defaultValue:!1,description:"Auto-fix violations in place (writes package.json files)",name:"fix",type:Boolean},{description:"Specifier used by --fix for workspace-protocol (default: workspace:*)",name:"fix-specifier",type:String},{description:"Output format: human, json, or minimal (default: human)",name:"format",type:String},{defaultValue:!1,description:"Suppress all output except errors",name:"quiet",type:Boolean}]};var q_=Object.defineProperty,H_=d((e,t)=>q_(e,"name",{value:t,configurable:!0}),"e$y");const z_={description:"List all workspace projects with metadata",examples:[["vis list","Show all projects"],["vis list --targets","Per-target rows with type, cache status and description"],["vis list --targets --inferred","Only show targets synthesized by Project Crystal-style inference"],["vis list --deps","Human-readable table of every dep-instance across the workspace"],["vis list --deps --internal-only","Only workspace deps in human form"],["vis list --deps --format=ndjson","Stream every dep-instance as NDJSON for jq pipelines"],["vis list --deps --format=json --pretty","Single pretty-printed JSON array of dep-instances"],["vis list --format=json","Machine-readable project listing"],['vis list --query "tag=frontend"',"Filter by query"]],group:"Workspace",loader:H_(()=>import("./handler33.js"),"loader"),name:"list",options:[{defaultValue:!1,description:"Filter target rows to only inferred targets (implies --targets)",name:"inferred",type:Boolean},{description:"Output format: table (default), json (single document), or ndjson (one record per line; --deps only)",name:"format",type:String},{defaultValue:!1,description:"Pretty-print with 2-space indent (only meaningful with --format=json)",name:"pretty",type:Boolean},{description:"Filter projects by query",name:"query",type:String},{defaultValue:!1,description:"Show per-target rows (type, cache, description)",name:"targets",type:Boolean},{defaultValue:!1,description:"Render a dep-instance view (table by default; use --format=ndjson|json for jq-friendly streams)",name:"deps",type:Boolean},{description:"Restrict --deps to specific dep blocks (repeatable)",multiple:!0,name:"dep-type",type:String},{defaultValue:!1,description:"With --deps: only show internal/workspace deps",name:"internal-only",type:Boolean},{defaultValue:!1,description:"With --deps: only show external/registry deps",name:"external-only",type:Boolean},{description:"With --deps: glob of declaring package names to keep (repeatable)",multiple:!0,name:"include",type:String},{description:"With --deps: glob of declaring package names to drop (repeatable)",multiple:!0,name:"exclude",type:String}]};var J_=Object.defineProperty,yt=d((e,t)=>J_(e,"name",{value:t,configurable:!0}),"t$n");const At=[{defaultValue:!1,description:"Preview changes without applying",name:"dry-run",type:Boolean},{alias:"y",defaultValue:!1,description:"Skip the confirmation prompt",name:"yes",type:Boolean}],K_={commandPath:["migrate"],description:"Migrate dependencies and scripts to vis",group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateDepsExecute})),"loader"),name:"deps",options:[...At]},Y_={commandPath:["migrate"],description:"Inline lint-staged configuration into vis",group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateLintStagedExecute})),"loader"),name:"lint-staged",options:[...At]},X_={commandPath:["migrate"],description:"Inline nano-staged configuration into vis",group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateNanoStagedExecute})),"loader"),name:"nano-staged",options:[...At]},Q_={commandPath:["migrate"],description:"Migrate turborepo tasks/config to vis",group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateTurborepoExecute})),"loader"),name:"turborepo",options:[...At]},Z_={commandPath:["migrate"],description:"Migrate nx targets/config to vis",group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateNxExecute})),"loader"),name:"nx",options:[...At,{defaultValue:!1,description:"Overwrite an existing vis.config.ts (a .bak is taken first)",name:"force",type:Boolean},{defaultValue:!1,description:"For each project.json `syncGenerators`, add a `pre<target>` script to sibling package.json (with a TODO for the user to wire up)",name:"rewrite-sync-generators",type:Boolean},{defaultValue:!1,description:"Auto-apply the safe cleanup items the migrator would otherwise leave on the checklist: delete nx.json + ignore-files-for-nx-affected.yml, strip nx/@nx/*/@nrwl/* devDependencies, rewrite mechanical `nx run-many|run|affected` scripts. Implies --force.",name:"aggressive",type:Boolean}]},e4={commandPath:["migrate"],description:"Migrate moon tasks/templates to vis",group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateMoonExecute})),"loader"),name:"moon",options:[...At,{defaultValue:!1,description:"Copy .moon/templates/* into .vis/templates/* so `vis generate` works without .moon/",name:"copy-templates",type:Boolean}]},t4={commandPath:["migrate"],description:"Migrate gitleaks config/baseline/hooks to `vis secrets`",examples:[["vis migrate gitleaks","Migrate gitleaks config/baseline/hooks to `vis secrets`"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateGitleaksExecute})),"loader"),name:"gitleaks",options:[...At]},r4={commandPath:["migrate"],description:"Migrate Kingfisher baseline/hooks/scripts to `vis secrets`",examples:[["vis migrate kingfisher","Migrate Kingfisher baseline/hooks/scripts to `vis secrets`"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateKingfisherExecute})),"loader"),name:"kingfisher",options:[...At]},n4={commandPath:["migrate"],description:"Replace secretlint with `vis secrets`",examples:[["vis migrate secretlint","Replace secretlint with `vis secrets`"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateSecretlintExecute})),"loader"),name:"secretlint",options:[...At]},s4={commandPath:["migrate"],description:"Translate syncpack customTypes into vis policy and strip the syncpack dep/scripts",examples:[["vis migrate syncpack","Translate syncpack customTypes into vis policy and strip the syncpack dep/scripts"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateSyncpackExecute})),"loader"),name:"syncpack",options:[...At]},i4={commandPath:["migrate"],description:"Strip sherif config/dep/scripts and surface ignore-rules as a positive `vis lint --<rule>` command",examples:[["vis migrate sherif","Strip sherif config/dep/scripts and surface ignore-rules as a positive `vis lint --<rule>` command"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateSherifExecute})),"loader"),name:"sherif",options:[...At]},o4={commandPath:["migrate"],description:"Auto-rewrite vis.config.ts to use renamed fields (targetDefaults → tasks, taskDefaults → scopedTasks, taskRunnerOptions → taskRunner)",examples:[["vis migrate self","Rewrite vis.config.ts in-place (a .bak is taken first)"],["vis migrate self --dry-run","Preview the rewrite without writing"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateSelfExecute})),"loader"),name:"self",options:[...At]},a4={commandPath:["migrate"],description:"Audit the workspace for stray gitleaks/secretlint/sherif/syncpack references (exit 1 on issues)",examples:[["vis migrate verify","Audit the workspace for stray gitleaks/secretlint/sherif/syncpack references (exit 1 on issues)"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateVerifyExecute})),"loader"),name:"verify",options:[]},c4={commandPath:["migrate"],description:"Prove a turbo/nx/moon → vis migration preserved the task graph + cache-key surface (exit 1 on divergence)",examples:[["vis migrate verify-graph","Auto-detect the source tool and diff its task graph against the migrated vis.config.ts"],["vis migrate verify-graph --from turbo --format json","Machine-readable equivalence report on stdout (Axis A)"],["vis migrate verify-graph --fail-on warning","Also gate CI on additive/extra-target warnings"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateVerifyGraphExecute})),"loader"),name:"verify-graph",options:[{description:"Source tool to compare against (turbo|nx|moon). Auto-detected when omitted.",name:"from",type:String},{description:"Output format: table | json | ndjson (default: table)",name:"format",type:String},{description:"Exit non-zero on: error (default) | warning",name:"fail-on",type:String}]},l4={commandPath:["migrate"],description:"Run every applicable migration non-interactively (autodetected)",examples:[["vis migrate all --yes","Run every detected migration without prompting (CI-friendly)"],["vis migrate all --dry-run","Preview every detected migration without writing files"]],group:"Migrate",loader:yt(()=>import("./handler34.js").then(e=>({default:e.migrateAllExecute})),"loader"),name:"all",options:[...At]},u4=[l4,K_,Y_,X_,Q_,Z_,e4,o4,t4,r4,n4,s4,i4,a4,c4];var p4=Object.defineProperty,d4=d((e,t)=>p4(e,"name",{value:t,configurable:!0}),"r$w");const f4=new Set(["--cwd"]),h4=new Set(["--help","--version","-h","-V"]),m4=d4(e=>{const t=[];for(let r=0;r<e.length;r+=1){const n=e[r];if(n!==void 0){if(h4.has(n))return!1;if(n.startsWith("-")){const s=n.indexOf("="),i=s===-1?n:n.slice(0,s);if(f4.has(i)&&s===-1){const o=e[r+1];o!==void 0&&!o.startsWith("-")&&(r+=1)}continue}t.push(n)}}return t.length===1&&t[0]==="migrate"},"isBareMigrateInvocation");var g4=Object.defineProperty,y4=d((e,t)=>g4(e,"name",{value:t,configurable:!0}),"t$m");const zm=y4(e=>e in Sl&&Sl[e]!=="0"&&Sl[e]!=="false","check"),Rr=zm("CI")||zm("CONTINUOUS_INTEGRATION");var v4=Object.defineProperty,cu=d((e,t)=>v4(e,"name",{value:t,configurable:!0}),"i$g");class b4{static{d(this,"MigrateStore")}static{cu(this,"MigrateStore")}#e;#t=new Set;constructor(t){this.#e={applyProgress:null,checkedItems:new Set(t.map(r=>r.entry.id)),error:null,focusedPanel:"list",items:t,phase:"browsing",selectedIndex:0}}getSnapshot=cu(()=>this.#e,"getSnapshot");subscribe=cu(t=>(this.#t.add(t),()=>{this.#t.delete(t)}),"subscribe");getCheckedItems(){return this.#e.items.filter(t=>this.#e.checkedItems.has(t.entry.id))}getSelectedItem(){return this.#e.items[this.#e.selectedIndex]??null}setSelectedIndex(t){const r=Math.max(0,Math.min(t,this.#e.items.length-1));r!==this.#e.selectedIndex&&this.#r({...this.#e,selectedIndex:r})}setFocusedPanel(t){t!==this.#e.focusedPanel&&this.#r({...this.#e,focusedPanel:t})}toggleCheck(t){const r=new Set(this.#e.checkedItems);r.has(t)?r.delete(t):r.add(t),this.#r({...this.#e,checkedItems:r})}checkAll(){this.#r({...this.#e,checkedItems:new Set(this.#e.items.map(t=>t.entry.id))})}uncheckAll(){this.#r({...this.#e,checkedItems:new Set})}toggleAll(){this.#e.checkedItems.size===this.#e.items.length?this.uncheckAll():this.checkAll()}startApply(){const t=this.getCheckedItems().length;this.#r({...this.#e,applyProgress:{current:0,total:t},phase:"applying"})}updateApplyProgress(t){this.#e.applyProgress&&this.#r({...this.#e,applyProgress:{...this.#e.applyProgress,current:t}})}markDone(){this.#r({...this.#e,phase:"done"})}setError(t){this.#r({...this.#e,error:t,phase:"error"})}#r(t){this.#e=t;for(const r of this.#t)try{r()}catch{}}}var $4=Object.defineProperty,w4=d((e,t)=>$4(e,"name",{value:t,configurable:!0}),"f$7");const Jm=w4(({autoExitSeconds:e,onCancel:t,visible:r})=>{const{exit:n}=ey(),[s,i]=Mi(e||3),o=eo(null),a=eo(0);Qg(()=>{if(!r)return;const l=e||3;i(l),a.current=Date.now();let u=l;return o.current=setInterval(()=>{u-=1,u<=0?(o.current&&(clearInterval(o.current),o.current=null),i(0),n()):i(u)},1e3),()=>{o.current&&(clearInterval(o.current),o.current=null)}},[r,e,n]);const c=Zg(()=>{o.current&&(clearInterval(o.current),o.current=null),t()},[t]);return ty((l,u)=>{Date.now()-a.current<200||(l==="q"?n():c())},{isActive:r}),L($u,{backgroundColor:"#1e1e1e",footer:ce(_,{dimColor:!0,children:["Press"," ",L(_,{bold:!0,color:"white",children:"q"})," ","to exit,"," ",L(_,{bold:!0,color:"white",children:"any key"})," ","to stay"]}),title:`Exiting in ${s}…`,visible:r,width:50,children:L(_,{dimColor:!0,children:"Stay to explore the results interactively."})})},"QuitDialog");var k4=Object.defineProperty,Zw=d((e,t)=>k4(e,"name",{value:t,configurable:!0}),"n$l");const S4=Zw(e=>{if(e.startsWith("⚠"))return"yellow";e.startsWith("── ")||e.startsWith("[dry-run]")},"colorForPreviewLine"),D4=Zw(({focused:e,item:t,scrollRef:r})=>t?ce(de,{borderColor:e?"white":"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,children:[L(de,{flexShrink:0,paddingTop:1,paddingX:2,children:L(_,{bold:!0,color:"white",children:t.entry.title})}),L(de,{flexShrink:0,paddingBottom:1,paddingX:2,children:L(_,{dimColor:!0,children:t.entry.description})}),L(vS,{flexGrow:1,flexShrink:1,paddingX:2,ref:r,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:ce(de,{flexDirection:"column",children:[L(_,{dimColor:!0,children:"── What will change ──"}),L(_,{}),t.preview.length===0&&L(_,{dimColor:!0,children:"(no preview available)"}),t.preview.map((s,i)=>{const o=S4(s);return s===""?L(_,{},`blank-${String(i)}`):L(_,{color:o,children:s},`${String(i)}-${s.slice(0,20)}`)})]})})]}):L(de,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:L(_,{dimColor:!0,children:"No migration selected"})}),"MigrateDetailPanel");var C4=Object.defineProperty,e1=d((e,t)=>C4(e,"name",{value:t,configurable:!0}),"g$9");const E4=e1(({checked:e,isSelected:t,item:r})=>{const n=e?"☑":"☐",s=r.preview.length;return ce(de,{flexShrink:0,height:1,children:[L(_,{children:t?">":" "}),ce(_,{color:e?"white":"gray",children:[" ",n," "]}),L(de,{flexGrow:1,children:L(_,{bold:t,inverse:t,wrap:"truncate",children:r.entry.title})}),ce(_,{dimColor:!0,children:[" ",s," ","change",s===1?"":"s"," "]})]})},"MigrationRow"),j4=e1(({checkedItems:e,focused:t,isDryRun:r,items:n,scrollOffset:s,selectedIndex:i,viewportHeight:o})=>{const a=t?"white":"gray",c=n.filter(f=>e.has(f.entry.id)).length,l=n.map((f,m)=>L(E4,{checked:e.has(f.entry.id),isSelected:m===i,item:f},f.entry.id)),u=n.length,p=u>o&&o>0;return ce(de,{borderColor:a,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[ce(de,{flexShrink:0,gap:1,paddingX:1,children:[L(_,{bold:!0,inverse:!0,children:" MIGRATE "}),ce(_,{wrap:"truncate",children:[n.length," ","applicable"]}),c>0&&ce(_,{dimColor:!0,children:[" — ",c," selected"]}),r&&L(_,{color:"yellow",children:" (dry-run)"})]}),ce(de,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[L(de,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:L(de,{flexDirection:"column",marginTop:-s,children:l})}),p&&L(de,{flexShrink:0,marginLeft:1,marginRight:1,children:L(bS,{contentHeight:u,placement:"inset",scrollOffset:s,style:"block",viewportHeight:o})})]})]})},"MigrateListPanel");var A4=Object.defineProperty,x4=d((e,t)=>A4(e,"name",{value:t,configurable:!0}),"N$8");const O4=100,P4=40,F4=10,B4=x4(({autoExitSeconds:e=0,isDryRun:t,store:r})=>{const{exit:n}=ey(),{columns:s,rows:i}=yS(),o=gS(r.subscribe,r.getSnapshot),[a,c]=Mi(!1),[l,u]=Mi(!1),[p,f]=Mi(!1),[m,$]=Mi(0),b=eo(null),k=eo(null),S=eo(null),y=o.items[o.selectedIndex]??null,h=Math.max(1,i-6),v=Zg(U=>{$(M=>U>=M+h?Math.max(0,U-h+1):U<M?Math.max(0,U):M)},[h]);if(Qg(()=>{k.current?.scrollToTop()},[y?.entry.id]),ty((U,M)=>{if(U==="c"&&M.ctrl){n();return}if(!p){if(l){U==="u"||M.return?(u(!1),r.startApply(),n(r.getCheckedItems())):M.escape||U==="q"?u(!1):M.downArrow||U==="j"?S.current?.scrollBy(1):(M.upArrow||U==="k")&&S.current?.scrollBy(-1);return}if(a){M.escape||U==="?"?c(!1):U==="q"?(c(!1),f(!0)):M.downArrow||U==="j"?b.current?.scrollBy(1):(M.upArrow||U==="k")&&b.current?.scrollBy(-1);return}if(U==="?"){c(!0);return}if(U==="q"){f(!0);return}if(M.tab){r.setFocusedPanel(o.focusedPanel==="list"?"detail":"list");return}if(o.focusedPanel==="list"){if(M.downArrow||U==="j"){const X=Math.min(o.selectedIndex+1,o.items.length-1);r.setSelectedIndex(X),v(X);return}if(M.upArrow||U==="k"){const X=Math.max(o.selectedIndex-1,0);r.setSelectedIndex(X),v(X);return}if(M.pageDown){const X=Math.min(o.selectedIndex+10,o.items.length-1);r.setSelectedIndex(X),v(X);return}if(M.pageUp){const X=Math.max(o.selectedIndex-10,0);r.setSelectedIndex(X),v(X);return}if(M.home){r.setSelectedIndex(0),$(0);return}if(M.end){const X=o.items.length-1;r.setSelectedIndex(X),v(X);return}if(U===" "||M.return){y&&r.toggleCheck(y.entry.id);return}if(U==="a"){r.toggleAll();return}if(U==="u"&&!t&&o.checkedItems.size>0){u(!0);return}M.rightArrow&&r.setFocusedPanel("detail");return}if(o.focusedPanel==="detail"){if(M.escape||M.leftArrow){r.setFocusedPanel("list");return}if(M.downArrow||U==="j"){k.current?.scrollBy(1);return}if(M.upArrow||U==="k"){k.current?.scrollBy(-1);return}if(M.pageDown){k.current?.scrollBy(10);return}if(M.pageUp){k.current?.scrollBy(-10);return}if(M.home){k.current?.scrollToTop();return}M.end&&k.current?.scrollToBottom()}}},{isActive:!0}),s<P4||i<F4)return L(de,{alignItems:"center",height:i,justifyContent:"center",width:s,children:ce(_,{color:"yellow",children:["Terminal too small (",s,"x",i,")"]})});const w=s>=O4,g=[ce(de,{gap:1,children:[L(_,{bold:!0,color:"white",children:"q"}),L(_,{dimColor:!0,children:"QUIT"})]},"q"),ce(de,{gap:1,children:[L(_,{bold:!0,color:"white",children:"?"}),L(_,{dimColor:!0,children:"HELP"})]},"?"),ce(de,{gap:1,children:[L(_,{bold:!0,color:"white",children:"↑↓"}),L(_,{dimColor:!0,children:"NAV"})]},"nav"),ce(de,{gap:1,children:[L(_,{bold:!0,color:"white",children:"Space"}),L(_,{dimColor:!0,children:"CHECK"})]},"sp"),ce(de,{gap:1,children:[L(_,{bold:!0,color:"white",children:"a"}),L(_,{dimColor:!0,children:"ALL"})]},"a")];!t&&o.checkedItems.size>0&&g.push(ce(de,{gap:1,children:[L(_,{bold:!0,color:"green",children:"u"}),L(_,{dimColor:!0,children:"APPLY"})]},"u")),g.push(ce(de,{gap:1,children:[L(_,{bold:!0,color:"white",children:"Tab"}),L(_,{dimColor:!0,children:"PANEL"})]},"tab"));const E=L(de,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:L(de,{flexWrap:"wrap",gap:2,paddingX:1,children:g})}),C=ce($u,{footer:ce(_,{dimColor:!0,children:[L(_,{bold:!0,color:"white",children:"↑↓"})," scroll ",L(_,{bold:!0,color:"white",children:"?"}),"/",L(_,{bold:!0,color:"white",children:"Esc"})," close"]}),scrollRef:b,title:"KEYBOARD SHORTCUTS",visible:a,width:52,children:[ce(de,{flexDirection:"column",marginBottom:1,children:[L(_,{bold:!0,color:"white",children:"NAVIGATION"}),ce(_,{children:[L(_,{bold:!0,color:"white",children:" ↑/k"}),L(_,{dimColor:!0,children:" Move up"})]}),ce(_,{children:[L(_,{bold:!0,color:"white",children:" ↓/j"}),L(_,{dimColor:!0,children:" Move down"})]}),ce(_,{children:[L(_,{bold:!0,color:"white",children:" Tab"}),L(_,{dimColor:!0,children:" Switch panel"})]}),ce(_,{children:[L(_,{bold:!0,color:"white",children:" →/←"}),L(_,{dimColor:!0,children:" Focus detail/list"})]})]}),ce(de,{flexDirection:"column",marginBottom:1,children:[L(_,{bold:!0,color:"white",children:"SELECTION"}),ce(_,{children:[L(_,{bold:!0,color:"white",children:" Space"}),L(_,{dimColor:!0,children:" Toggle migration"})]}),ce(_,{children:[L(_,{bold:!0,color:"white",children:" a"}),L(_,{dimColor:!0,children:" Toggle all"})]})]}),ce(de,{flexDirection:"column",children:[L(_,{bold:!0,color:"white",children:"ACTIONS"}),!t&&ce(_,{children:[L(_,{bold:!0,color:"white",children:" u"}),L(_,{dimColor:!0,children:" Apply selected migrations"})]}),ce(_,{children:[L(_,{bold:!0,color:"white",children:" q"}),L(_,{dimColor:!0,children:" Quit"})]}),ce(_,{children:[L(_,{bold:!0,color:"white",children:" ?"}),L(_,{dimColor:!0,children:" Toggle help"})]})]})]}),A=r.getCheckedItems(),O=L(de,{alignItems:"center",flexDirection:"column",children:ce(_,{dimColor:!0,children:["Press ",L(_,{bold:!0,color:"white",children:"u"})," or ",L(_,{bold:!0,color:"white",children:"Enter"})," to confirm, ",L(_,{bold:!0,color:"white",children:"Esc"})," to cancel"]})}),I=L($u,{footer:O,scrollRef:S,title:`Apply ${String(A.length)} migration${A.length===1?"":"s"}?`,visible:l,width:70,children:A.map(U=>ce(de,{gap:1,children:[ce(_,{children:[" ",U.entry.title]}),ce(_,{dimColor:!0,children:["(",U.preview.length," ","change",U.preview.length===1?"":"s",")"]})]},U.entry.id))}),V=L(j4,{checkedItems:o.checkedItems,focused:o.focusedPanel==="list",isDryRun:t,items:o.items,scrollOffset:m,selectedIndex:o.selectedIndex,viewportHeight:h}),fe=L(D4,{focused:o.focusedPanel==="detail",item:y,scrollRef:k});if(w){const U=Math.floor(s*.55);return ce(de,{flexDirection:"column",height:i,width:s,children:[ce(de,{flexDirection:"row",flexGrow:1,children:[L(de,{flexGrow:1,children:V}),L(de,{width:U,children:fe})]}),E,I,L(Jm,{autoExitSeconds:e||3,onCancel:d(()=>{f(!1)},"onCancel"),visible:p}),C]})}const Y=Math.floor(i*.45);return ce(de,{flexDirection:"column",height:i,width:s,children:[L(de,{height:Y,children:V}),L(de,{flexGrow:1,children:fe}),E,I,L(Jm,{autoExitSeconds:e||3,onCancel:d(()=>{f(!1)},"onCancel"),visible:p}),C]})},"VisMigrateApp");var R4=Object.defineProperty,xf=d((e,t)=>R4(e,"name",{value:t,configurable:!0}),"r$u");const T4=/\n([ \t]+)/,N4=xf(e=>{const{indent:t,lineEnding:r}=$S(e),n={};return t!==void 0&&(n.indent=t),(r==="lf"||r==="crlf")&&(n.lineEnding=r),n},"resolveEditorConfigDefaults"),vr=xf((e,t,r={})=>{const{defaultIndent:n=" ",useEditorconfig:s=!0}=r;if(s){const{indent:i}=N4(e);if(i!==void 0)return i}if(t!==void 0){const i=T4.exec(t);if(i?.[1]!==void 0)return i[1]}return n},"resolveIndentForFile"),Of=xf((e,t={})=>{const r=j(e)?H(e):void 0;return vr(e,r,t)},"resolveIndentForExistingFile");var I4=Object.defineProperty,L4=d((e,t)=>I4(e,"name",{value:t,configurable:!0}),"t$l");const t1=[".lintstagedrc.json",".lintstagedrc"],r1=[".lintstagedrc.yaml",".lintstagedrc.yml",".lintstagedrc.mjs","lint-staged.config.mjs",".lintstagedrc.cjs","lint-staged.config.cjs",".lintstagedrc.js","lint-staged.config.js",".lintstagedrc.ts","lint-staged.config.ts",".lintstagedrc.mts","lint-staged.config.mts",".lintstagedrc.cts","lint-staged.config.cts"],Pf=[...t1,...r1],_4=[/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)(pnpm|pnpm exec|npx|yarn|yarn run|npm exec|npm run|bunx|bun run|bun x)\s+lint-staged\b/,/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)lint-staged\b/],n1=[".nano-staged.json",".nanostagedrc"],s1=[".nano-staged.mjs",".nano-staged.cjs",".nano-staged.js","nano-staged.config.mjs","nano-staged.config.cjs","nano-staged.config.js","nano-staged.config.mts","nano-staged.config.cts","nano-staged.config.ts"],Ff=[...n1,...s1],M4=[/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)(pnpm|pnpm exec|npx|yarn|yarn run|npm exec|npm run|bunx|bun run|bun x)\s+nano-staged\b/,/^((?:[A-Z_][A-Z0-9_]*(?:=\S*)?\s+)*)nano-staged\b/],i1=["husky","lint-staged","nano-staged"],W4=/\(is-ci \|\| husky \|\| exit 0\)\s*&&\s*/g,V4=/\bhusky(?:\s+install)?\s*&&\s*/g,U4=/\s*&&\s*husky(?:\s+install)?/g,G4=/\s*\|\|\s*husky(?:\s+install)?/g,q4=[W4,V4,U4,G4],o1=L4(e=>{if(e==="husky"||e==="husky install")return;let t=e;for(const r of q4)t=t.replace(r,"");return t=t.trim(),t===e?e:t||void 0},"cleanHuskyFromScript");var H4=Object.defineProperty,cc=d((e,t)=>H4(e,"name",{value:t,configurable:!0}),"o$q");const z4=/\/$/,J4=cc(e=>{let t='"$0"';for(let r=0;r<e;r+=1)t=`"$(dirname ${t})"`;return t},"nestedDirname"),K4=cc(e=>{const t=e.split("/").filter(r=>r!==""&&r!==".").length+2;return`#!/usr/bin/env sh
|
|
1097
1097
|
{ [ "$VIS_GIT_HOOKS" = "2" ]; } && set -x
|
|
1098
1098
|
n=$(basename "$0")
|
|
1099
1099
|
s=$(dirname "$(dirname "$0")")/$n
|
|
@@ -1102,69 +1102,69 @@ s=$(dirname "$(dirname "$0")")/$n
|
|
|
1102
1102
|
|
|
1103
1103
|
{ [ "\${VIS_GIT_HOOKS-}" = "0" ]; } && exit 0
|
|
1104
1104
|
|
|
1105
|
-
d=${
|
|
1105
|
+
d=${J4(t)}
|
|
1106
1106
|
export PATH="$d/node_modules/.bin:$PATH"
|
|
1107
1107
|
sh -e "$s" "$@"
|
|
1108
1108
|
c=$?
|
|
1109
1109
|
|
|
1110
1110
|
[ $c != 0 ] && echo "vis - $n script failed (code $c)"
|
|
1111
1111
|
[ $c = 127 ] && echo "vis - command not found in PATH=$PATH"
|
|
1112
|
-
exit $c`},"hookScript"),
|
|
1113
|
-
. "$(dirname "$0")/h"`,{mode:493});return{isError:!1,message:""}},"installHooks");var
|
|
1114
|
-
`,"utf8")}return{modified:i.length>0,removedScriptReferences:i}},"cleanPackageJsonScripts"),TJ=vn((e,t,r,n={})=>{const s=H4(e),i=n.dryRun===!0;if(!s)return{isError:!0,message:"No husky installation found (.husky/ or .config/husky/)"};r.info(`Found husky at ${s}/`);const o=z4(e,s);if(o.size===0&&r.info("No user-defined hooks found in husky directory."),!i){const l=Ss("git",["config","--local","core.hooksPath"]),u=l.status===0?l.stdout?.toString().trim():"";u&&(u===".husky/_"||u.startsWith(".husky"))&&Ss("git",["config","--local","--unset","core.hooksPath"]);const p=V4(t);if(p.isError)return p;p.message&&r.info(p.message)}const a=D(e,t);i||$t(a);let c=0;for(const[l,u]of o){if(l==="common.sh"){i?r.info(" (would copy) common.sh"):(Oe(D(a,l),u,{mode:493}),r.info(" Copied common.sh"));continue}if(i)r.info(` (would migrate) ${l}`);else{const p=J4(u);Oe(D(a,l),p,{mode:493}),r.info(` Migrated ${l}`)}c+=1}if(i)r.info(" (would remove) husky npm package and clean package.json scripts"),r.info(` (would remove) ${s}/ directory`);else{K4(e,r);const l=X4(e,n.useEditorconfig);if(l.modified){r.info("Updated package.json scripts:");for(const p of l.removedScriptReferences)r.info(` ${p}`)}const u=D(e,s);Nt(u,{force:!0,recursive:!0}),r.info(`Removed ${s}/`)}return{isError:!1,message:`${i?"would migrate":"Migration complete:"} ${c} hook${c===1?"":"s"} ${i?"from":"migrated from"} ${s}/ to ${t}/`}},"migrateFromHusky");var Q4=Object.defineProperty,Z4=d((e,t)=>Q4(e,"name",{value:t,configurable:!0}),"e$w");const e6={configFiles:["api-extractor.json"],detect:Z4(({matchedConfigs:e})=>({targets:{"api-extract":{command:"api-extractor run --local",description:"api-extractor (inferred)",inputs:["{projectRoot}/dist/**/*.d.ts","{projectRoot}/lib/**/*.d.ts",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist/*.api.json","{projectRoot}/etc/*.api.md","{projectRoot}/temp"],type:"build"}}}),"detect"),fallbackDependency:"@microsoft/api-extractor",name:"api-extractor"};var t6=Object.defineProperty,r6=d((e,t)=>t6(e,"name",{value:t,configurable:!0}),"s$k");const n6={configFiles:["astro.config.ts","astro.config.js","astro.config.mjs","astro.config.mts","astro.config.cjs"],detect:r6(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"astro build",description:"astro build (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/public/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/dist"],type:"build"}};return e&&(n.dev={command:"astro dev",description:"astro dev (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"astro",name:"astro"};var s6=Object.defineProperty,i6=d((e,t)=>s6(e,"name",{value:t,configurable:!0}),"o$p");const o6={configFiles:["biome.json","biome.jsonc"],detect:i6(({matchedConfigs:e})=>{const t=["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...e.map(r=>`{projectRoot}/${r}`),"{projectRoot}/package.json"];return{targets:{format:{command:"biome format --write .",description:"biome format (inferred)"},lint:{command:"biome check .",description:"biome check (inferred)",inputs:t,outputs:[],type:"build"}}}},"detect"),fallbackDependency:"@biomejs/biome",name:"biome"};var a6=Object.defineProperty,c6=d((e,t)=>a6(e,"name",{value:t,configurable:!0}),"o$o");const l6={configFiles:["bunfig.toml"],detect:c6(({matchedConfigs:e})=>({targets:{test:{command:"bun test",description:"bun test (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"test"}}}),"detect"),name:"bun"};var u6=Object.defineProperty,p6=d((e,t)=>u6(e,"name",{value:t,configurable:!0}),"e$v");const d6={configFiles:[".changeset/config.json"],detect:p6(()=>({targets:{"changeset:publish":{command:"changeset publish",description:"changeset publish (inferred)"},"changeset:status":{command:"changeset status",description:"changeset status (inferred)"},"changeset:version":{command:"changeset version",description:"changeset version (inferred)"}}}),"detect"),name:"changeset"};var f6=Object.defineProperty,h6=d((e,t)=>f6(e,"name",{value:t,configurable:!0}),"r$q");const m6={configFiles:["cypress.config.ts","cypress.config.js","cypress.config.mjs","cypress.config.mts","cypress.config.cjs"],detect:h6(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={"test:e2e":{command:"cypress run",description:"cypress run (inferred)",inputs:["{projectRoot}/cypress/**/*","{projectRoot}/e2e/**/*","{projectRoot}/src/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/cypress/screenshots","{projectRoot}/cypress/videos"],type:"test"}};return e&&(n["cypress:open"]={command:"cypress open",description:"cypress open (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"cypress",name:"cypress"};var g6=Object.defineProperty,y6=d((e,t)=>g6(e,"name",{value:t,configurable:!0}),"n$j");const v6={configFiles:["deno.json","deno.jsonc"],detect:y6(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0,r=["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...t?[t]:[]];return{targets:{check:{command:"deno check **/*.ts",description:"deno check (inferred)",inputs:r,outputs:[],type:"build"},fmt:{command:"deno fmt",description:"deno fmt (inferred)"},lint:{command:"deno lint",description:"deno lint (inferred)",inputs:r,outputs:[],type:"build"},test:{command:"deno test",description:"deno test (inferred)",inputs:r,outputs:[],type:"test"}}}},"detect"),name:"deno"};var b6=Object.defineProperty,$6=d((e,t)=>b6(e,"name",{value:t,configurable:!0}),"r$p");const w6={configFiles:["docusaurus.config.ts","docusaurus.config.js","docusaurus.config.mjs","docusaurus.config.mts","docusaurus.config.cjs"],detect:$6(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"docusaurus build",description:"docusaurus build (inferred)",inputs:["{projectRoot}/blog/**/*","{projectRoot}/docs/**/*","{projectRoot}/src/**/*","{projectRoot}/static/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/build"],type:"build"}};return e&&(n.start={command:"docusaurus start",description:"docusaurus start (inferred)",preset:"server"},n.serve={command:"docusaurus serve",description:"docusaurus serve (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"@docusaurus/core",name:"docusaurus"};var k6=Object.defineProperty,S6=d((e,t)=>k6(e,"name",{value:t,configurable:!0}),"r$o");const D6={configFiles:["drizzle.config.ts","drizzle.config.js","drizzle.config.mjs","drizzle.config.mts","drizzle.config.cjs"],detect:S6(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0;return{targets:{"db:generate":{command:"drizzle-kit generate",description:"drizzle-kit generate (inferred)",inputs:["{projectRoot}/src/**/*",...t?[t]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/drizzle"],type:"build"},"db:migrate":{command:"drizzle-kit migrate",description:"drizzle-kit migrate (inferred)"},"db:push":{command:"drizzle-kit push",description:"drizzle-kit push (inferred)"},"db:studio":{command:"drizzle-kit studio",description:"drizzle-kit studio (inferred)",preset:"server"}}}},"detect"),fallbackDependency:"drizzle-kit",name:"drizzle"};var C6=Object.defineProperty,E6=d((e,t)=>C6(e,"name",{value:t,configurable:!0}),"o$m");const j6={configFiles:["eslint.config.ts","eslint.config.js","eslint.config.mjs","eslint.config.mts","eslint.config.cjs",".eslintrc.json",".eslintrc.js",".eslintrc.cjs",".eslintrc"],detect:E6(({matchedConfigs:e})=>({targets:{lint:{command:"eslint .",description:"eslint . (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"eslint",name:"eslint"};var A6=Object.defineProperty,x6=d((e,t)=>A6(e,"name",{value:t,configurable:!0}),"r$n");const O6={configFiles:["gatsby-config.ts","gatsby-config.js","gatsby-config.mjs","gatsby-config.mts","gatsby-config.cjs"],detect:x6(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"gatsby build",description:"gatsby build (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/static/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/gatsby-node.js","{projectRoot}/gatsby-node.ts","{projectRoot}/gatsby-browser.js","{projectRoot}/gatsby-ssr.js"],outputs:["{projectRoot}/public","{projectRoot}/.cache"],type:"build"}};return e&&(n.develop={command:"gatsby develop",description:"gatsby develop (inferred)",preset:"server"},n.serve={command:"gatsby serve",description:"gatsby serve (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"gatsby",name:"gatsby"};var P6=Object.defineProperty,F6=d((e,t)=>P6(e,"name",{value:t,configurable:!0}),"c$k");const B6={configFiles:["codegen.ts","codegen.js","codegen.mjs","codegen.mts","codegen.cjs","codegen.yml","codegen.yaml","codegen.json",".graphqlrc",".graphqlrc.json",".graphqlrc.yml",".graphqlrc.yaml",".graphqlrc.ts",".graphqlrc.js"],detect:F6(({matchedConfigs:e})=>({targets:{codegen:{command:"graphql-codegen",description:"graphql-codegen (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/schema/**/*","{projectRoot}/**/*.graphql","{projectRoot}/**/*.gql",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:["{projectRoot}/src/generated","{projectRoot}/src/__generated__","{projectRoot}/src/gql"],type:"build"}}}),"detect"),fallbackDependency:"@graphql-codegen/cli",name:"graphql-codegen"};var R6=Object.defineProperty,T6=d((e,t)=>R6(e,"name",{value:t,configurable:!0}),"c$j");const N6={configFiles:["jest.config.ts","jest.config.js","jest.config.mjs","jest.config.mts","jest.config.cjs","jest.config.json"],detect:T6(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={test:{command:"jest",description:"jest (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/coverage"],type:"test"}};return e&&(n["test:watch"]={command:"jest --watch",description:"jest watch mode (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"jest",name:"jest"};var I6=Object.defineProperty,L6=d((e,t)=>I6(e,"name",{value:t,configurable:!0}),"n$i");const _6={configFiles:["knip.config.ts","knip.config.js","knip.config.mjs","knip.config.mts","knip.config.cjs","knip.json","knip.jsonc",".knip.json",".knip.jsonc"],detect:L6(({matchedConfigs:e})=>({targets:{knip:{command:"knip",description:"knip (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"knip",name:"knip"};var M6=Object.defineProperty,W6=d((e,t)=>M6(e,"name",{value:t,configurable:!0}),"s$h");const V6={configFiles:["nest-cli.json"],detect:W6(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"nest build",description:"nest build (inferred)",inputs:["{projectRoot}/src/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/tsconfig.json","{projectRoot}/tsconfig.build.json"],outputs:["{projectRoot}/dist"],type:"build"}};return e&&(n.start={command:"nest start",description:"nest start (inferred)",preset:"server"},n["start:dev"]={command:"nest start --watch",description:"nest start --watch (inferred)",preset:"server"}),{targets:n}},"detect"),name:"nest"};var U6=Object.defineProperty,G6=d((e,t)=>U6(e,"name",{value:t,configurable:!0}),"r$k");const q6={configFiles:["next.config.ts","next.config.js","next.config.mjs","next.config.mts","next.config.cjs"],detect:G6(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"next build",description:"next build (inferred)",inputs:["{projectRoot}/app/**/*","{projectRoot}/pages/**/*","{projectRoot}/src/**/*","{projectRoot}/public/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/.next","!{projectRoot}/.next/cache"],type:"build"}};return e&&(n.dev={command:"next dev",description:"next dev (inferred)",preset:"server"},n.start={command:"next start",description:"next start (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"next",name:"next"};var H6=Object.defineProperty,z6=d((e,t)=>H6(e,"name",{value:t,configurable:!0}),"c$h");const J6={configFiles:["nuxt.config.ts","nuxt.config.js","nuxt.config.mjs","nuxt.config.mts","nuxt.config.cjs"],detect:z6(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n=["{projectRoot}/app/**/*","{projectRoot}/components/**/*","{projectRoot}/composables/**/*","{projectRoot}/layouts/**/*","{projectRoot}/pages/**/*","{projectRoot}/plugins/**/*","{projectRoot}/public/**/*","{projectRoot}/server/**/*","{projectRoot}/src/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],s={build:{command:"nuxt build",description:"nuxt build (inferred)",inputs:n,outputs:["{projectRoot}/.output","{projectRoot}/.nuxt"],type:"build"},generate:{command:"nuxt generate",description:"nuxt generate static site (inferred)",inputs:n,outputs:["{projectRoot}/.output","{projectRoot}/dist"],type:"build"}};return e&&(s.dev={command:"nuxt dev",description:"nuxt dev (inferred)",preset:"server"},s.preview={command:"nuxt preview",description:"nuxt preview (inferred)",preset:"server"}),{targets:s}},"detect"),fallbackDependency:"nuxt",name:"nuxt"};var K6=Object.defineProperty,Y6=d((e,t)=>K6(e,"name",{value:t,configurable:!0}),"e$t");const X6={configFiles:[".oxfmtrc.json",".oxfmtrc.jsonc","oxfmt.config.ts","oxfmt.config.js","oxfmt.config.mjs","oxfmt.config.mts","oxfmt.config.cjs"],detect:Y6(({matchedConfigs:e})=>{const t=["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...e.map(r=>`{projectRoot}/${r}`),"{projectRoot}/package.json"];return{targets:{format:{command:"oxfmt",description:"oxfmt (inferred)"},"format:check":{command:"oxfmt --check",description:"oxfmt --check (inferred)",inputs:t,outputs:[],type:"build"}}}},"detect"),fallbackDependency:"oxfmt",name:"oxfmt"};var Q6=Object.defineProperty,Z6=d((e,t)=>Q6(e,"name",{value:t,configurable:!0}),"e$s");const e7={configFiles:[".oxlintrc.json","oxlint.json"],detect:Z6(({matchedConfigs:e})=>({targets:{lint:{command:"oxlint",description:"oxlint (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"oxlint",name:"oxlint"};var t7=Object.defineProperty,r7=d((e,t)=>t7(e,"name",{value:t,configurable:!0}),"c$g");const n7={configFiles:["packem.config.ts","packem.config.js","packem.config.mjs","packem.config.mts","packem.config.cjs"],detect:r7(({matchedConfigs:e})=>({targets:{build:{command:"packem build",description:"@visulima/packem build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]??"packem.config.ts"}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),fallbackDependency:"@visulima/packem",name:"packem"};var s7=Object.defineProperty,i7=d((e,t)=>s7(e,"name",{value:t,configurable:!0}),"o$k");const o7={configFiles:["playwright.config.ts","playwright.config.js","playwright.config.mjs","playwright.config.mts","playwright.config.cjs"],detect:i7(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0;return{targets:{"test:e2e":{command:"playwright test",description:"playwright test (inferred)",inputs:["{projectRoot}/e2e/**/*","{projectRoot}/tests/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/src/**/*",...t?[t]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/playwright-report","{projectRoot}/test-results"],type:"test"}}}},"detect"),fallbackDependency:"@playwright/test",name:"playwright"};var a7=Object.defineProperty,c7=d((e,t)=>a7(e,"name",{value:t,configurable:!0}),"r$h");const l7={configFiles:["prettier.config.ts","prettier.config.js","prettier.config.mjs","prettier.config.mts","prettier.config.cjs",".prettierrc",".prettierrc.json",".prettierrc.js",".prettierrc.cjs",".prettierrc.mjs",".prettierrc.yml",".prettierrc.yaml"],detect:c7(({matchedConfigs:e})=>{const t=["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...e.map(r=>`{projectRoot}/${r}`),"{projectRoot}/package.json"];return{targets:{format:{command:"prettier --write .",description:"prettier --write (inferred)"},"format:check":{command:"prettier --check .",description:"prettier --check (inferred)",inputs:t,outputs:[],type:"build"}}}},"detect"),fallbackDependency:"prettier",name:"prettier"};var u7=Object.defineProperty,p7=d((e,t)=>u7(e,"name",{value:t,configurable:!0}),"t$k");const d7={configFiles:["prisma/schema.prisma","schema.prisma"],detect:p7(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0;return{targets:{"db:generate":{command:"prisma generate",description:"prisma generate (inferred)",inputs:[...t?[t]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/node_modules/.prisma","{projectRoot}/node_modules/@prisma/client"],type:"build"},"db:migrate":{command:"prisma migrate dev",description:"prisma migrate dev (inferred)"},"db:push":{command:"prisma db push",description:"prisma db push (inferred)"},"db:studio":{command:"prisma studio",description:"prisma studio (inferred)",preset:"server"}}}},"detect"),fallbackDependency:"prisma",name:"prisma"};var f7=Object.defineProperty,h7=d((e,t)=>f7(e,"name",{value:t,configurable:!0}),"o$j");const m7={configFiles:["remix.config.ts","remix.config.js","remix.config.mjs","remix.config.cjs"],detect:h7(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"remix vite:build",description:"remix build (inferred)",inputs:["{projectRoot}/app/**/*","{projectRoot}/public/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/build"],type:"build"}};return e&&(n.dev={command:"remix vite:dev",description:"remix dev (inferred)",preset:"server"},n.start={command:"remix-serve ./build/server/index.js",description:"remix-serve (inferred)",preset:"server"}),{targets:n}},"detect"),name:"remix"};var g7=Object.defineProperty,y7=d((e,t)=>g7(e,"name",{value:t,configurable:!0}),"t$j");const v7={configFiles:["rolldown.config.ts","rolldown.config.js","rolldown.config.mjs","rolldown.config.mts","rolldown.config.cjs"],detect:y7(({matchedConfigs:e})=>({targets:{build:{command:"rolldown -c",description:"rolldown build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),name:"rolldown"};var b7=Object.defineProperty,$7=d((e,t)=>b7(e,"name",{value:t,configurable:!0}),"t$i");const w7={configFiles:["rollup.config.ts","rollup.config.js","rollup.config.mjs","rollup.config.mts","rollup.config.cjs"],detect:$7(({matchedConfigs:e})=>({targets:{build:{command:"rollup -c",description:"rollup build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),name:"rollup"};var k7=Object.defineProperty,S7=d((e,t)=>k7(e,"name",{value:t,configurable:!0}),"r$g");const D7={configFiles:[".storybook/main.ts",".storybook/main.js",".storybook/main.mjs",".storybook/main.mts",".storybook/main.cjs"],detect:S7(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0;return{targets:{"build-storybook":{command:"storybook build",description:"storybook build (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/.storybook/**/*","{projectRoot}/stories/**/*",...t?[t]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/storybook-static"],type:"build"},storybook:{command:"storybook dev -p 6006",description:"storybook dev (inferred)",preset:"server"}}}},"detect"),name:"storybook"};var C7=Object.defineProperty,E7=d((e,t)=>C7(e,"name",{value:t,configurable:!0}),"e$o");const j7={configFiles:["stylelint.config.ts","stylelint.config.js","stylelint.config.mjs","stylelint.config.cjs",".stylelintrc",".stylelintrc.json",".stylelintrc.js",".stylelintrc.cjs",".stylelintrc.yml",".stylelintrc.yaml"],detect:E7(({matchedConfigs:e})=>({targets:{"lint:css":{command:'stylelint "**/*.{css,scss,sass,less,vue,svelte,astro}"',description:"stylelint (inferred)",inputs:["{projectRoot}/src/**/*.css","{projectRoot}/src/**/*.scss","{projectRoot}/src/**/*.sass","{projectRoot}/src/**/*.less","{projectRoot}/src/**/*.vue","{projectRoot}/src/**/*.svelte","{projectRoot}/src/**/*.astro",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"stylelint",name:"stylelint"};var A7=Object.defineProperty,x7=d((e,t)=>A7(e,"name",{value:t,configurable:!0}),"o$h");const O7={configFiles:["tsdown.config.ts","tsdown.config.js","tsdown.config.mjs","tsdown.config.mts","tsdown.config.cjs"],detect:x7(({matchedConfigs:e})=>({targets:{build:{command:"tsdown",description:"tsdown build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]??"tsdown.config.ts"}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),fallbackDependency:"tsdown",name:"tsdown"};var P7=Object.defineProperty,F7=d((e,t)=>P7(e,"name",{value:t,configurable:!0}),"o$g");const B7={configFiles:["tsup.config.ts","tsup.config.js","tsup.config.mjs","tsup.config.mts","tsup.config.cjs"],detect:F7(({matchedConfigs:e})=>({targets:{build:{command:"tsup",description:"tsup build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]??"tsup.config.ts"}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),fallbackDependency:"tsup",name:"tsup"};var R7=Object.defineProperty,T7=d((e,t)=>R7(e,"name",{value:t,configurable:!0}),"e$m");const N7={configFiles:["typedoc.json","typedoc.jsonc","typedoc.config.ts","typedoc.config.js","typedoc.config.mjs","typedoc.config.mts","typedoc.config.cjs"],detect:T7(({matchedConfigs:e})=>({targets:{docs:{command:"typedoc",description:"typedoc (inferred)",inputs:["{projectRoot}/src/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/docs"],type:"build"}}}),"detect"),fallbackDependency:"typedoc",name:"typedoc"};var I7=Object.defineProperty,L7=d((e,t)=>I7(e,"name",{value:t,configurable:!0}),"e$l");const _7={configFiles:["tsconfig.json","tsconfig.build.json"],detect:L7(({matchedConfigs:e})=>({targets:{typecheck:{command:"tsc --noEmit",description:"tsc --noEmit (inferred)",inputs:["{projectRoot}/src/**/*.ts","{projectRoot}/src/**/*.tsx","{projectRoot}/__tests__/**/*.ts","{projectRoot}/__tests__/**/*.tsx","{projectRoot}/test/**/*.ts","{projectRoot}/tests/**/*.ts",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"typescript",name:"typescript"};var M7=Object.defineProperty,W7=d((e,t)=>M7(e,"name",{value:t,configurable:!0}),"t$h");const V7={configFiles:["vite.config.ts","vite.config.js","vite.config.mjs","vite.config.mts","vite.config.cjs"],detect:W7(({matchedConfigs:e})=>({targets:{build:{command:"vite build",description:"vite production build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]}`,"{projectRoot}/package.json"],outputs:["{projectRoot}/dist"],type:"build"},dev:{command:"vite",description:"vite dev server (inferred)",preset:"server"},preview:{command:"vite preview",description:"vite preview server (inferred)",preset:"server"}}}),"detect"),name:"vite"};var U7=Object.defineProperty,G7=d((e,t)=>U7(e,"name",{value:t,configurable:!0}),"r$e");const q7={configFiles:[".vitepress/config.ts",".vitepress/config.js",".vitepress/config.mjs",".vitepress/config.mts",".vitepress/config.cjs","docs/.vitepress/config.ts","docs/.vitepress/config.js","docs/.vitepress/config.mjs","docs/.vitepress/config.mts","docs/.vitepress/config.cjs"],detect:G7(({matchedConfigs:e})=>{const t=e[0]?.startsWith("docs/"),r=t?"docs":".",n=e[0]?`{projectRoot}/${e[0]}`:void 0,s=["{projectRoot}/.vitepress/**/*","{projectRoot}/docs/**/*",...n?[n]:[],"{projectRoot}/package.json"];return{targets:{"docs:build":{command:`vitepress build ${r}`,description:"vitepress build (inferred)",inputs:s,outputs:[`{projectRoot}/${t?"docs/":""}.vitepress/dist`],type:"build"},"docs:dev":{command:`vitepress dev ${r}`,description:"vitepress dev (inferred)",preset:"server"},"docs:preview":{command:`vitepress preview ${r}`,description:"vitepress preview (inferred)",preset:"server"}}}},"detect"),name:"vitepress"};var H7=Object.defineProperty,z7=d((e,t)=>H7(e,"name",{value:t,configurable:!0}),"c$c");const J7={configFiles:["vitest.config.ts","vitest.config.js","vitest.config.mjs","vitest.config.mts","vitest.config.cjs"],detect:z7(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={test:{command:"vitest run",description:"vitest run (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/coverage"],type:"test"}};return e&&(n["test:watch"]={command:"vitest",description:"vitest watch mode (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"vitest",name:"vitest"};var K7=Object.defineProperty,Y7=d((e,t)=>K7(e,"name",{value:t,configurable:!0}),"t$g");const X7={configFiles:["webpack.config.ts","webpack.config.js","webpack.config.mjs","webpack.config.mts","webpack.config.cjs"],detect:Y7(({matchedConfigs:e})=>({targets:{build:{command:"webpack --mode=production",description:"webpack production build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),name:"webpack"};var Q7=Object.defineProperty,Bf=d((e,t)=>Q7(e,"name",{value:t,configurable:!0}),"n$f");const Rf=[J6,q6,m7,n6,O6,w6,V7,q7,V6,v7,O7,B7,n7,w7,X7,J7,N6,l6,o7,m6,D7,_7,N7,j6,l7,o6,e7,X6,j7,_6,v6,d7,D6,B6,e6,d6],Z7=Bf((e,t)=>e.dependencies!==void 0&&Object.hasOwn(e.dependencies,t)||e.devDependencies!==void 0&&Object.hasOwn(e.devDependencies,t)||e.peerDependencies!==void 0&&Object.hasOwn(e.peerDependencies,t)||e.optionalDependencies!==void 0&&Object.hasOwn(e.optionalDependencies,t),"hasDependency"),eM=Bf((e,t)=>{const r=[];for(const n of t)pc(D(e,n))&&r.push(n);return r},"matchConfigFiles"),tM=Bf((e,t=Rf)=>{const r={},n=[];for(const s of t){const i=eM(e.projectRoot,s.configFiles),o=s.fallbackDependency!==void 0&&Z7(e.pkg,s.fallbackDependency);if(i.length===0&&!o)continue;const a=s.detect({...e,hasConfigFile:i.length>0,matchedConfigs:i});let c=!1;for(const[l,u]of Object.entries(a.targets))r[l]===void 0&&(r[l]=u,c=!0);c&&n.push(s.name)}return{sources:n,targets:r}},"inferProjectTargets");var rM=Object.defineProperty,br=d((e,t)=>rM(e,"name",{value:t,configurable:!0}),"s$d");const nM={server:{cache:!1,interactive:!1,persistent:!0,runInCI:!1},utility:{cache:!1,runInCI:!1}},sM=br(e=>{const t=e.preset??e.options?.preset;if(!t)return e;const r=nM[t];if(!r)return e;const{cache:n,...s}=r;return{...e,cache:e.cache??n,options:{...s,...e.options}}},"applyPreset"),iM=br(()=>{const e=jp();return e==="darwin"?"macos":e==="win32"?"windows":"linux"},"detectCurrentOs"),NJ=br((e,t)=>{if(!t||t.size===0)return!0;const r=e?.runnerTags;return!r||r.length===0?!0:r.some(n=>t.has(n))},"matchesRunnerTags"),IJ=br((e,t,r=!0)=>{const n=e?.runInCI??!0;return n===!0||n==="always"?!0:n===!1?!t:n==="affected"?!t||r:!0},"shouldRunInCI"),LJ=br((e,t,r)=>r||!t?e:tn(t)?t:D(e,t),"resolveTaskCwd"),_J=br((e,t)=>{if(t===!1)return{};const r=t===!0?oM("production"):Array.isArray(t)?t:[t],n={};for(const s of r)Object.assign(n,aM(e,s));return n},"loadEnvFile"),oM=br(e=>{const t=[".env"];return e&&t.push(`.env.${e}`),e!=="test"&&t.push(".env.local"),e&&e!=="test"&&t.push(`.env.${e}.local`),t},"resolveEnvCascade"),aM=br((e,t)=>{const r=tn(t)?t:D(e,t);if(!j(r))return{};let n;try{n=H(r)}catch{return{}}const s={};for(const i of n.split(/\r?\n/)){const o=i.trim();if(o===""||o.startsWith("#"))continue;const a=o.indexOf("=");if(a===-1)continue;const c=o.slice(0,a).trim();if(c==="")continue;let l=o.slice(a+1).trim();(l.startsWith('"')&&l.endsWith('"')||l.startsWith("'")&&l.endsWith("'"))&&(l=l.slice(1,-1)),s[c]=l}return s},"loadSingleEnvFile"),MJ=br((e,t=iM())=>{if(e)return t==="windows"&&e.windowsShell?e.windowsShell:(t==="linux"||t==="macos")&&e.unixShell?e.unixShell:e.shell},"resolveTargetShell"),c1=br(e=>{if(e==="run")return!1;if(e==="build"||e==="test")return!0},"defaultCacheForType");var lu={exports:{}},Km;function cM(){return Km||(Km=1,(function(e){var t=Object.defineProperty,r=d((R,F)=>t(R,"name",{value:F,configurable:!0}),"i");function n(R){return Array.isArray(R)?R:[R]}d(n,"makeArray"),r(n,"makeArray");const s=void 0,i="",o=" ",a="\\",c=/^\s+$/,l=/(?:[^\\]|^)\\$/,u=/^\\!/,p=/^\\#/,f=/\r?\n/g,m=/^\.{0,2}\/|^\.{1,2}$/,$=/\/$/,b="/";let k="node-ignore";typeof Symbol<"u"&&(k=Symbol.for("node-ignore"));const S=k,y=r((R,F,N)=>(Object.defineProperty(R,F,{value:N}),N),"define"),h=/([0-z])-([0-z])/g,v=r(()=>!1,"RETURN_FALSE"),w=r(R=>R.replace(h,(F,N,Q)=>N.charCodeAt(0)<=Q.charCodeAt(0)?F:i),"sanitizeRange"),g=r(R=>{const{length:F}=R;return R.slice(0,F-F%2)},"cleanRangeBackSlash"),E=[[/^\uFEFF/,()=>i],[/((?:\\\\)*?)(\\?\s+)$/,(R,F,N)=>F+(N.indexOf("\\")===0?o:i)],[/(\\+?)\s/g,(R,F)=>{const{length:N}=F;return F.slice(0,N-N%2)+o}],[/[\\$.|*+(){^]/g,R=>`\\${R}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,r(function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"},"startingReplacer")],[/\\\/\\\*\\\*(?=\\\/|$)/g,(R,F,N)=>F+6<N.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(R,F,N)=>{const Q=N.replace(/\\\*/g,"[^\\/]*");return F+Q}],[/\\\\\\(?=[$.|*+(){^])/g,()=>a],[/\\\\/g,()=>a],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(R,F,N,Q,oe)=>F===a?`\\[${N}${g(Q)}${oe}`:oe==="]"&&Q.length%2===0?`[${w(N)}${Q}]`:"[]"],[/(?:[^*])$/,R=>/\/$/.test(R)?`${R}$`:`${R}(?=$|\\/$)`]],C=/(^|\\\/)?\\\*$/,A="regex",O="checkRegex",I="_",V={[A](R,F){return`${F?`${F}[^/]+`:"[^/]*"}(?=$|\\/$)`},[O](R,F){return`${F?`${F}[^/]*`:"[^/]*"}(?=$|\\/$)`}},fe=r(R=>E.reduce((F,[N,Q])=>F.replace(N,Q.bind(R)),R),"makeRegexPrefix"),Y=r(R=>typeof R=="string","isString"),U=r(R=>R&&Y(R)&&!c.test(R)&&!l.test(R)&&R.indexOf("#")!==0,"checkPattern"),M=r(R=>R.split(f).filter(Boolean),"splitPattern");class X{static{d(this,"IgnoreRule")}static{r(this,"IgnoreRule")}constructor(F,N,Q,oe,be,it){this.pattern=F,this.mark=N,this.negative=be,y(this,"body",Q),y(this,"ignoreCase",oe),y(this,"regexPrefix",it)}get regex(){const F=I+A;return this[F]?this[F]:this._make(A,F)}get checkRegex(){const F=I+O;return this[F]?this[F]:this._make(O,F)}_make(F,N){const Q=this.regexPrefix.replace(C,V[F]),oe=this.ignoreCase?new RegExp(Q,"i"):new RegExp(Q);return y(this,N,oe)}}const x=r(({pattern:R,mark:F},N)=>{let Q=!1,oe=R;oe.indexOf("!")===0&&(Q=!0,oe=oe.substr(1)),oe=oe.replace(u,"!").replace(p,"#");const be=fe(oe);return new X(R,F,oe,N,Q,be)},"createRule");class W{static{d(this,"RuleManager")}static{r(this,"RuleManager")}constructor(F){this._ignoreCase=F,this._rules=[]}_add(F){if(F&&F[S]){this._rules=this._rules.concat(F._rules._rules),this._added=!0;return}if(Y(F)&&(F={pattern:F}),U(F.pattern)){const N=x(F,this._ignoreCase);this._added=!0,this._rules.push(N)}}add(F){return this._added=!1,n(Y(F)?M(F):F).forEach(this._add,this),this._added}test(F,N,Q){let oe=!1,be=!1,it;this._rules.forEach(Wr=>{const{negative:bi}=Wr;be===bi&&oe!==be||bi&&!oe&&!be&&!N||!Wr[Q].test(F)||(oe=!bi,be=bi,it=bi?s:Wr)});const St={ignored:oe,unignored:be};return it&&(St.rule=it),St}}const Z=r((R,F)=>{throw new F(R)},"throwError"),z=r((R,F,N)=>Y(R)?R?z.isNotRelative(R)?N(`path should be a \`path.relative()\`d string, but got "${F}"`,RangeError):!0:N("path must not be empty",TypeError):N(`path must be a string, but got \`${F}\``,TypeError),"checkPath"),J=r(R=>m.test(R),"isNotRelative");z.isNotRelative=J,z.convert=R=>R;class K{static{d(this,"Ignore")}static{r(this,"Ignore")}constructor({ignorecase:F=!0,ignoreCase:N=F,allowRelativePaths:Q=!1}={}){y(this,S,!0),this._rules=new W(N),this._strictPathCheck=!Q,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(F){return this._rules.add(F)&&this._initCache(),this}addPattern(F){return this.add(F)}_test(F,N,Q,oe){const be=F&&z.convert(F);return z(be,F,this._strictPathCheck?Z:v),this._t(be,N,Q,oe)}checkIgnore(F){if(!$.test(F))return this.test(F);const N=F.split(b).filter(Boolean);if(N.pop(),N.length){const Q=this._t(N.join(b)+b,this._testCache,!0,N);if(Q.ignored)return Q}return this._rules.test(F,!1,O)}_t(F,N,Q,oe){if(F in N)return N[F];if(oe||(oe=F.split(b).filter(Boolean)),oe.pop(),!oe.length)return N[F]=this._rules.test(F,Q,A);const be=this._t(oe.join(b)+b,N,Q,oe);return N[F]=be.ignored?be:this._rules.test(F,Q,A)}ignores(F){return this._test(F,this._ignoreCache,!1).ignored}createFilter(){return F=>!this.ignores(F)}filter(F){return n(F).filter(this.createFilter())}test(F){return this._test(F,this._testCache,!0)}}const ee=r(R=>new K(R),"factory"),De=r(R=>z(R&&z.convert(R),R,v),"isPathValid"),ve=r(()=>{const R=r(N=>/^\\\\\?\\/.test(N)||/["<>|\u0000-\u001F]+/u.test(N)?N:N.replace(/\\/g,"/"),"makePosix");z.convert=R;const F=/^[a-z]:\//i;z.isNotRelative=N=>F.test(N)||J(N)},"setupWindows");process.platform==="win32"&&ve(),e.exports=ee,ee.default=ee,e.exports.isPathValid=De,y(e.exports,Symbol.for("setupWindows"),ve)})(lu)),lu.exports}d(cM,"requireIgnore");var lM=cM();const Ym=Ng(lM);var uM=Object.defineProperty,Hr=d((e,t)=>uM(e,"name",{value:t,configurable:!0}),"i$c");const pM=Ym.default??Ym,dM=[".git/","node_modules/"],fM=/\/+$/,Xm=Hr(e=>{try{return Gg(e,"utf8")}catch{return}},"safeRead"),hM=Hr(e=>e.replaceAll("\\","/"),"toForwardSlashes"),WJ=Hr(e=>{if(!e||e.length===0)return[];const t=[];for(const r of e){const n=r.replace(fM,"");if(n.startsWith("!")){const s=n.slice(1);s.length>0&&t.push(s)}}return t},"extractWorkspaceExcludePatterns"),mM=Hr(e=>{const{cwd:t}=e,r=pM();if(e.builtinExcludes!==!1&&r.add(dM),e.rootGitignore!==!1){const i=Xm(Ke(t,".gitignore"));i!==void 0&&r.add(i)}for(const i of e.extraIgnoreFiles??[]){const o=tn(i)?i:Ke(t,i),a=Xm(o);a!==void 0&&r.add(a)}e.extraPatterns&&e.extraPatterns.length>0&&r.add(e.extraPatterns);const n=Hr(i=>{const o=i.endsWith("/")||i.endsWith("\\"),a=tn(i)?i:Ke(t,i),c=hM(zn(t,a));return c===""||c.startsWith("../")||c===".."?!1:r.ignores(o?`${c}/`:c)},"ignores"),s={add:Hr(i=>(r.add(i),s),"add"),filter:Hr(i=>i.filter(o=>!n(o)),"filter"),filterDirectories:Hr(i=>i.filter(o=>!n(o.endsWith("/")||o.endsWith("\\")?o:`${o}/`)),"filterDirectories"),ignores:n};return s},"buildGitignoreMatcher");var gM=Object.defineProperty,Te=d((e,t)=>gM(e,"name",{value:t,configurable:!0}),"c$a");const yM=/\/+$/,vM=/\/\*\*$/,bM=/\/\*\/\*$/,$M=/^['"]|['"]$/g,Tf=/node_modules/,Nf=/\.git/,en=Te(e=>{try{return le(e)}catch{return}},"readJsonFileSafe"),wM=Te((e,t,r)=>{for(const n of un(e,{includeFiles:!1,includeSymlinks:!1,skip:[Tf,Nf]}))if(n.path!==e&&j(D(n.path,"package.json"))){const s=n.path.slice(e.length+1);r.push(`${t}/${s}`)}},"scanDirectoryRecursive"),kM=Te((e,t,r)=>{const n=t.slice(0,-2),s=Ke(e,n);if(j(s))for(const i of un(s,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[Tf,Nf]}))i.path!==s&&j(D(i.path,"package.json"))&&r.push(D(n,i.name))},"resolveSimpleGlob"),SM=Te((e,t,r)=>{const n=t.replace(vM,"").replace(bM,""),s=Ke(e,n);j(s)&&wM(s,n,r)},"resolveDoubleGlob"),DM=Te((e,t,r)=>{const n=Ke(e,t);j(n)&&j(D(n,"package.json"))&&r.push(t)},"resolveExactDirectory"),CM=/[$()+.?[\\\]^{|}]/g,EM=Te((e,t,r)=>{const n=t.replaceAll(CM,String.raw`\$&`).replaceAll("*",".*"),s=new RegExp(`^${n}$`);for(const i of un(e,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[Tf,Nf]}))i.path!==e&&s.test(i.name)&&j(D(i.path,"package.json"))&&r.push(i.name)},"resolveBareGlob"),ln=Te((e,t)=>{const r=[],n=[];for(const i of t){const o=i.replace(yM,"");if(o.startsWith("!")){const a=o.slice(1);a.length>0&&(n.push(a),a.endsWith("/**")&&n.push(`${a.slice(0,-3)}/`));continue}r.push(o)}const s=[];for(const i of r)i.endsWith("/**")||i.endsWith("/*/*")?SM(e,i,s):i.endsWith("/*")?kM(e,i,s):!i.includes("/")&&i.includes("*")?EM(e,i,s):DM(e,i,s);return s.length===0?s:mM({cwd:e,extraPatterns:n}).filterDirectories(s)},"resolveWorkspacePatterns"),l1=Te((e,t,r=new Set)=>{if(!e)return[];const n=[];for(const s of e){if(typeof s=="object"&&s&&"group"in s){const i=s.group;if(r.has(i))throw new Error(`Cycle detected in vis.config taskGroups: ${[...r,i].join(" → ")}`);const o=t?.[i];if(!o)throw new Error(`Unknown taskGroup "${i}" referenced in dependsOn. Declare it under \`taskGroups\` in vis.config.ts.`);n.push(...l1(o,t,new Set([...r,i])));continue}n.push(s)}return n},"expandTaskGroups"),sl=Te(e=>{if(Array.isArray(e)){if(e.length===0)throw new Error('Invalid package.json `workspaces`: empty array. Add at least one pattern like "packages/*" or remove the field.');for(const t of e)if(typeof t!="string"||t.trim().length===0)throw new TypeError(`Invalid package.json \`workspaces\` entry: expected a non-empty glob string, got ${JSON.stringify(t)}.`);return e}if(e&&typeof e=="object"){const{packages:t}=e;if(t===void 0)throw new Error('Invalid package.json `workspaces`: object form requires a `packages` array (e.g. `{ "packages": ["packages/*"] }`).');if(!Array.isArray(t))throw new TypeError(`Invalid package.json \`workspaces.packages\`: expected an array of glob strings, got ${typeof t}.`);return sl(t)}throw new TypeError(`Invalid package.json \`workspaces\`: expected an array or { packages: string[] } object, got ${typeof e}.`)},"validateWorkspacesField"),u1=["aube-workspace.yaml","pnpm-workspace.yaml"],jM=Te((e,t)=>{const r=D(e,t);if(!j(r))return;let n;try{n=Is(H(r))}catch{return}if(typeof n!="object"||n===null)return;const{overrides:s}=n;if(typeof s!="object"||s===null||Array.isArray(s))return;const i={};for(const[o,a]of Object.entries(s))typeof a=="string"&&(i[o]=a);return Object.keys(i).length>0?i:void 0},"readWorkspaceYamlOverrides"),AM=Te((e,t)=>{const r=D(e,t);if(!j(r))return;const n=H(r),s=[];let i=!1;for(const o of n.split(`
|
|
1115
|
-
`)){const a=o.trim();if(a==="packages:"){i=!0;continue}if(i){if(a.startsWith("- ")){const c=a.slice(2).replaceAll(
|
|
1116
|
-
`,"utf8"),!0},"editJsonFile");var
|
|
1117
|
-
`),{entries:i,indent:o}=
|
|
1118
|
-
`),"utf8")},"updatePnpmWorkspaceCatalog"),eg=bn((e,t,r,n,s,i)=>{const o=r.overrides??{};if(n.dryRun){s.info("[dry-run] Would rewrite package.json files (remove husky/lint-staged, rewrite scripts)"),Object.keys(o).length>0&&s.info(`[dry-run] Would add overrides: ${JSON.stringify(o)}`);return}d1(e,t,o,i),s.info("Rewritten root package.json"),
|
|
1119
|
-
`),r.info(`Converted ${i} -> ${o} (${String(c.length)} findings)`),at(n,"gitleaks","rewrittenScriptCount")},"migrateBaseline"),
|
|
1120
|
-
`)},"rewriteScripts"),
|
|
1121
|
-
`),Jn(i),r.info(`Merged ${String(o.length)} fingerprint(s) from ${i} into ${a}; removed .gitleaksignore.`),at(n,"gitleaks","rewrittenScriptCount",o.length)},"migrateIgnoreFile"),tg=$r((e,t,r,n)=>{const s=al(e),i=If(e);return s??i??Lf(e)?(s&&(r.info(`Keeping ${s} as-is (compatible with vis secrets --config).`),ye(n,`Run \`vis secrets --config ${s}\` or rename to .gitleaksignore-compatible defaults.`)),i&&
|
|
1122
|
-
`),r.info(`Converted ${i} -> .secrets-baseline.json (${String(l.length)} placeholder finding(s))`),ye(n,"Run `vis secrets --update-baseline` — the converted entries are placeholders until the scanner computes real fingerprints."),at(n,"kingfisher","rewrittenScriptCount")},"migrateBaseline"),f1=/\bkingfisher(?:\s+(?:scan|validate|rules|update|manage-baseline|report|github|gitlab|bitbucket))?\b[^\n&|;]*/g,
|
|
1123
|
-
`)},"rewriteScripts")
|
|
1112
|
+
exit $c`},"hookScript"),Y4=cc((e=Qw)=>{if(process.env.VIS_GIT_HOOKS==="0")return{isError:!1,message:"skip install (git hooks disabled via VIS_GIT_HOOKS=0)"};if(e.includes(".."))return{isError:!0,message:'".." is not allowed in hooks directory path'};const t=Ss("git",["rev-parse","--show-prefix"]);if(t.status===null)return{isError:!0,message:"git command not found"};if(t.status!==0)return{isError:!1,message:".git directory not found (not a git repository)"};const r=cc((l="")=>D(e,"_",l),"internal"),n=t.stdout.toString().trim().replace(z4,""),s=n?`${n}/${e}/_`:`${e}/_`,i=Ss("git",["config","--local","core.hooksPath"]),o=i.status===0?i.stdout?.toString().trim():"";if(o&&o!==s)return{isError:!1,message:`core.hooksPath is already set to "${o}", skipping`};const{status:a,stderr:c}=Ss("git",["config","core.hooksPath",s]);if(a===null)return{isError:!0,message:"git command not found"};if(a)return{isError:!0,message:String(c)};$t(r()),Oe(r(".gitignore"),"*"),Oe(r("h"),K4(e),{mode:493});for(const l of Xw)Oe(r(l),`#!/usr/bin/env sh
|
|
1113
|
+
. "$(dirname "$0")/h"`,{mode:493});return{isError:!1,message:""}},"installHooks");var X4=Object.defineProperty,vn=d((e,t)=>X4(e,"name",{value:t,configurable:!0}),"f$6");const Q4=[".husky",".config/husky"],Z4=/^\. "\$\(dirname "\$0"\)\/common\.sh"\s*/m,e6=vn(e=>{for(const t of Q4)if(j(D(e,t))&&cr(D(e,t)).isDirectory())return t},"detectHuskyDirectory"),t6=vn((e,t)=>{const r=new Map,n=D(e,t),s=new Set(Xw);for(const i of Ze(n)){if(i==="_"||i===".gitignore"||i.startsWith("."))continue;const o=D(n,i);cr(o).isFile()&&(!s.has(i)&&i!=="common.sh"||r.set(i,H(o)))}return r},"readHuskyHooks"),r6=vn(e=>e.replace(Z4,""),"transformHookScript"),a1=vn(e=>j(D(e,"pnpm-lock.yaml"))||j(D(e,"pnpm-workspace.yaml"))?"pnpm":j(D(e,"yarn.lock"))?"yarn":j(D(e,"bun.lockb"))||j(D(e,"bun.lock"))?"bun":"npm","detectPackageManager"),n6=vn((e,t)=>{const r=a1(e),n={bun:["bun","remove","husky"],npm:["npm","uninstall","husky"],pnpm:["pnpm","remove","husky"],yarn:["yarn","remove","husky"]},[s,...i]=n[r];t.info(`Removing husky package via ${r}...`);const o=Ss(s,i,{cwd:e,encoding:"utf8",stdio:"pipe"});return o.status!==0?(t.info(`Warning: failed to remove husky via ${r} (${o.stderr?.trim()??"unknown error"})`),!1):!0},"uninstallHuskyPackage"),s6=vn((e,t,r)=>{const n=o1(r);if(n!==r)return n?(e[t]=n,`updated "${t}" script`):(delete e[t],`removed "${t}" script (was: "${r}")`)},"processScript"),i6=vn((e,t)=>{const r=D(e,"package.json");if(!j(r))return{modified:!1,removedScriptReferences:[]};const n=H(r),s=JSON.parse(n),i=[],o=s.scripts;if(o)for(const[a,c]of Object.entries(o)){if(typeof c!="string")continue;const l=s6(o,a,c);l&&i.push(l)}if(i.length>0){const a=vr(r,n,{defaultIndent:" ",useEditorconfig:t});Oe(r,`${JSON.stringify(s,void 0,a)}
|
|
1114
|
+
`,"utf8")}return{modified:i.length>0,removedScriptReferences:i}},"cleanPackageJsonScripts"),UJ=vn((e,t,r,n={})=>{const s=e6(e),i=n.dryRun===!0;if(!s)return{isError:!0,message:"No husky installation found (.husky/ or .config/husky/)"};r.info(`Found husky at ${s}/`);const o=t6(e,s);if(o.size===0&&r.info("No user-defined hooks found in husky directory."),!i){const l=Ss("git",["config","--local","core.hooksPath"]),u=l.status===0?l.stdout?.toString().trim():"";u&&(u===".husky/_"||u.startsWith(".husky"))&&Ss("git",["config","--local","--unset","core.hooksPath"]);const p=Y4(t);if(p.isError)return p;p.message&&r.info(p.message)}const a=D(e,t);i||$t(a);let c=0;for(const[l,u]of o){if(l==="common.sh"){i?r.info(" (would copy) common.sh"):(Oe(D(a,l),u,{mode:493}),r.info(" Copied common.sh"));continue}if(i)r.info(` (would migrate) ${l}`);else{const p=r6(u);Oe(D(a,l),p,{mode:493}),r.info(` Migrated ${l}`)}c+=1}if(i)r.info(" (would remove) husky npm package and clean package.json scripts"),r.info(` (would remove) ${s}/ directory`);else{n6(e,r);const l=i6(e,n.useEditorconfig);if(l.modified){r.info("Updated package.json scripts:");for(const p of l.removedScriptReferences)r.info(` ${p}`)}const u=D(e,s);Nt(u,{force:!0,recursive:!0}),r.info(`Removed ${s}/`)}return{isError:!1,message:`${i?"would migrate":"Migration complete:"} ${c} hook${c===1?"":"s"} ${i?"from":"migrated from"} ${s}/ to ${t}/`}},"migrateFromHusky");var o6=Object.defineProperty,a6=d((e,t)=>o6(e,"name",{value:t,configurable:!0}),"e$w");const c6={configFiles:["api-extractor.json"],detect:a6(({matchedConfigs:e})=>({targets:{"api-extract":{command:"api-extractor run --local",description:"api-extractor (inferred)",inputs:["{projectRoot}/dist/**/*.d.ts","{projectRoot}/lib/**/*.d.ts",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist/*.api.json","{projectRoot}/etc/*.api.md","{projectRoot}/temp"],type:"build"}}}),"detect"),fallbackDependency:"@microsoft/api-extractor",name:"api-extractor"};var l6=Object.defineProperty,u6=d((e,t)=>l6(e,"name",{value:t,configurable:!0}),"s$k");const p6={configFiles:["astro.config.ts","astro.config.js","astro.config.mjs","astro.config.mts","astro.config.cjs"],detect:u6(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"astro build",description:"astro build (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/public/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/dist"],type:"build"}};return e&&(n.dev={command:"astro dev",description:"astro dev (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"astro",name:"astro"};var d6=Object.defineProperty,f6=d((e,t)=>d6(e,"name",{value:t,configurable:!0}),"o$p");const h6={configFiles:["biome.json","biome.jsonc"],detect:f6(({matchedConfigs:e})=>{const t=["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...e.map(r=>`{projectRoot}/${r}`),"{projectRoot}/package.json"];return{targets:{format:{command:"biome format --write .",description:"biome format (inferred)"},lint:{command:"biome check .",description:"biome check (inferred)",inputs:t,outputs:[],type:"build"}}}},"detect"),fallbackDependency:"@biomejs/biome",name:"biome"};var m6=Object.defineProperty,g6=d((e,t)=>m6(e,"name",{value:t,configurable:!0}),"o$o");const y6={configFiles:["bunfig.toml"],detect:g6(({matchedConfigs:e})=>({targets:{test:{command:"bun test",description:"bun test (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"test"}}}),"detect"),name:"bun"};var v6=Object.defineProperty,b6=d((e,t)=>v6(e,"name",{value:t,configurable:!0}),"e$v");const $6={configFiles:[".changeset/config.json"],detect:b6(()=>({targets:{"changeset:publish":{command:"changeset publish",description:"changeset publish (inferred)"},"changeset:status":{command:"changeset status",description:"changeset status (inferred)"},"changeset:version":{command:"changeset version",description:"changeset version (inferred)"}}}),"detect"),name:"changeset"};var w6=Object.defineProperty,k6=d((e,t)=>w6(e,"name",{value:t,configurable:!0}),"r$q");const S6={configFiles:["cypress.config.ts","cypress.config.js","cypress.config.mjs","cypress.config.mts","cypress.config.cjs"],detect:k6(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={"test:e2e":{command:"cypress run",description:"cypress run (inferred)",inputs:["{projectRoot}/cypress/**/*","{projectRoot}/e2e/**/*","{projectRoot}/src/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/cypress/screenshots","{projectRoot}/cypress/videos"],type:"test"}};return e&&(n["cypress:open"]={command:"cypress open",description:"cypress open (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"cypress",name:"cypress"};var D6=Object.defineProperty,C6=d((e,t)=>D6(e,"name",{value:t,configurable:!0}),"n$j");const E6={configFiles:["deno.json","deno.jsonc"],detect:C6(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0,r=["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...t?[t]:[]];return{targets:{check:{command:"deno check **/*.ts",description:"deno check (inferred)",inputs:r,outputs:[],type:"build"},fmt:{command:"deno fmt",description:"deno fmt (inferred)"},lint:{command:"deno lint",description:"deno lint (inferred)",inputs:r,outputs:[],type:"build"},test:{command:"deno test",description:"deno test (inferred)",inputs:r,outputs:[],type:"test"}}}},"detect"),name:"deno"};var j6=Object.defineProperty,A6=d((e,t)=>j6(e,"name",{value:t,configurable:!0}),"r$p");const x6={configFiles:["docusaurus.config.ts","docusaurus.config.js","docusaurus.config.mjs","docusaurus.config.mts","docusaurus.config.cjs"],detect:A6(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"docusaurus build",description:"docusaurus build (inferred)",inputs:["{projectRoot}/blog/**/*","{projectRoot}/docs/**/*","{projectRoot}/src/**/*","{projectRoot}/static/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/build"],type:"build"}};return e&&(n.start={command:"docusaurus start",description:"docusaurus start (inferred)",preset:"server"},n.serve={command:"docusaurus serve",description:"docusaurus serve (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"@docusaurus/core",name:"docusaurus"};var O6=Object.defineProperty,P6=d((e,t)=>O6(e,"name",{value:t,configurable:!0}),"r$o");const F6={configFiles:["drizzle.config.ts","drizzle.config.js","drizzle.config.mjs","drizzle.config.mts","drizzle.config.cjs"],detect:P6(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0;return{targets:{"db:generate":{command:"drizzle-kit generate",description:"drizzle-kit generate (inferred)",inputs:["{projectRoot}/src/**/*",...t?[t]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/drizzle"],type:"build"},"db:migrate":{command:"drizzle-kit migrate",description:"drizzle-kit migrate (inferred)"},"db:push":{command:"drizzle-kit push",description:"drizzle-kit push (inferred)"},"db:studio":{command:"drizzle-kit studio",description:"drizzle-kit studio (inferred)",preset:"server"}}}},"detect"),fallbackDependency:"drizzle-kit",name:"drizzle"};var B6=Object.defineProperty,R6=d((e,t)=>B6(e,"name",{value:t,configurable:!0}),"o$m");const T6={configFiles:["eslint.config.ts","eslint.config.js","eslint.config.mjs","eslint.config.mts","eslint.config.cjs",".eslintrc.json",".eslintrc.js",".eslintrc.cjs",".eslintrc"],detect:R6(({matchedConfigs:e})=>({targets:{lint:{command:"eslint .",description:"eslint . (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"eslint",name:"eslint"};var N6=Object.defineProperty,I6=d((e,t)=>N6(e,"name",{value:t,configurable:!0}),"r$n");const L6={configFiles:["gatsby-config.ts","gatsby-config.js","gatsby-config.mjs","gatsby-config.mts","gatsby-config.cjs"],detect:I6(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"gatsby build",description:"gatsby build (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/static/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/gatsby-node.js","{projectRoot}/gatsby-node.ts","{projectRoot}/gatsby-browser.js","{projectRoot}/gatsby-ssr.js"],outputs:["{projectRoot}/public","{projectRoot}/.cache"],type:"build"}};return e&&(n.develop={command:"gatsby develop",description:"gatsby develop (inferred)",preset:"server"},n.serve={command:"gatsby serve",description:"gatsby serve (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"gatsby",name:"gatsby"};var _6=Object.defineProperty,M6=d((e,t)=>_6(e,"name",{value:t,configurable:!0}),"c$k");const W6={configFiles:["codegen.ts","codegen.js","codegen.mjs","codegen.mts","codegen.cjs","codegen.yml","codegen.yaml","codegen.json",".graphqlrc",".graphqlrc.json",".graphqlrc.yml",".graphqlrc.yaml",".graphqlrc.ts",".graphqlrc.js"],detect:M6(({matchedConfigs:e})=>({targets:{codegen:{command:"graphql-codegen",description:"graphql-codegen (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/schema/**/*","{projectRoot}/**/*.graphql","{projectRoot}/**/*.gql",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:["{projectRoot}/src/generated","{projectRoot}/src/__generated__","{projectRoot}/src/gql"],type:"build"}}}),"detect"),fallbackDependency:"@graphql-codegen/cli",name:"graphql-codegen"};var V6=Object.defineProperty,U6=d((e,t)=>V6(e,"name",{value:t,configurable:!0}),"c$j");const G6={configFiles:["jest.config.ts","jest.config.js","jest.config.mjs","jest.config.mts","jest.config.cjs","jest.config.json"],detect:U6(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={test:{command:"jest",description:"jest (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/coverage"],type:"test"}};return e&&(n["test:watch"]={command:"jest --watch",description:"jest watch mode (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"jest",name:"jest"};var q6=Object.defineProperty,H6=d((e,t)=>q6(e,"name",{value:t,configurable:!0}),"n$i");const z6={configFiles:["knip.config.ts","knip.config.js","knip.config.mjs","knip.config.mts","knip.config.cjs","knip.json","knip.jsonc",".knip.json",".knip.jsonc"],detect:H6(({matchedConfigs:e})=>({targets:{knip:{command:"knip",description:"knip (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"knip",name:"knip"};var J6=Object.defineProperty,K6=d((e,t)=>J6(e,"name",{value:t,configurable:!0}),"s$h");const Y6={configFiles:["nest-cli.json"],detect:K6(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"nest build",description:"nest build (inferred)",inputs:["{projectRoot}/src/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/tsconfig.json","{projectRoot}/tsconfig.build.json"],outputs:["{projectRoot}/dist"],type:"build"}};return e&&(n.start={command:"nest start",description:"nest start (inferred)",preset:"server"},n["start:dev"]={command:"nest start --watch",description:"nest start --watch (inferred)",preset:"server"}),{targets:n}},"detect"),name:"nest"};var X6=Object.defineProperty,Q6=d((e,t)=>X6(e,"name",{value:t,configurable:!0}),"r$k");const Z6={configFiles:["next.config.ts","next.config.js","next.config.mjs","next.config.mts","next.config.cjs"],detect:Q6(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"next build",description:"next build (inferred)",inputs:["{projectRoot}/app/**/*","{projectRoot}/pages/**/*","{projectRoot}/src/**/*","{projectRoot}/public/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/.next","!{projectRoot}/.next/cache"],type:"build"}};return e&&(n.dev={command:"next dev",description:"next dev (inferred)",preset:"server"},n.start={command:"next start",description:"next start (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"next",name:"next"};var e7=Object.defineProperty,t7=d((e,t)=>e7(e,"name",{value:t,configurable:!0}),"c$h");const r7={configFiles:["nuxt.config.ts","nuxt.config.js","nuxt.config.mjs","nuxt.config.mts","nuxt.config.cjs"],detect:t7(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n=["{projectRoot}/app/**/*","{projectRoot}/components/**/*","{projectRoot}/composables/**/*","{projectRoot}/layouts/**/*","{projectRoot}/pages/**/*","{projectRoot}/plugins/**/*","{projectRoot}/public/**/*","{projectRoot}/server/**/*","{projectRoot}/src/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],s={build:{command:"nuxt build",description:"nuxt build (inferred)",inputs:n,outputs:["{projectRoot}/.output","{projectRoot}/.nuxt"],type:"build"},generate:{command:"nuxt generate",description:"nuxt generate static site (inferred)",inputs:n,outputs:["{projectRoot}/.output","{projectRoot}/dist"],type:"build"}};return e&&(s.dev={command:"nuxt dev",description:"nuxt dev (inferred)",preset:"server"},s.preview={command:"nuxt preview",description:"nuxt preview (inferred)",preset:"server"}),{targets:s}},"detect"),fallbackDependency:"nuxt",name:"nuxt"};var n7=Object.defineProperty,s7=d((e,t)=>n7(e,"name",{value:t,configurable:!0}),"e$t");const i7={configFiles:[".oxfmtrc.json",".oxfmtrc.jsonc","oxfmt.config.ts","oxfmt.config.js","oxfmt.config.mjs","oxfmt.config.mts","oxfmt.config.cjs"],detect:s7(({matchedConfigs:e})=>{const t=["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...e.map(r=>`{projectRoot}/${r}`),"{projectRoot}/package.json"];return{targets:{format:{command:"oxfmt",description:"oxfmt (inferred)"},"format:check":{command:"oxfmt --check",description:"oxfmt --check (inferred)",inputs:t,outputs:[],type:"build"}}}},"detect"),fallbackDependency:"oxfmt",name:"oxfmt"};var o7=Object.defineProperty,a7=d((e,t)=>o7(e,"name",{value:t,configurable:!0}),"e$s");const c7={configFiles:[".oxlintrc.json","oxlint.json"],detect:a7(({matchedConfigs:e})=>({targets:{lint:{command:"oxlint",description:"oxlint (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"oxlint",name:"oxlint"};var l7=Object.defineProperty,u7=d((e,t)=>l7(e,"name",{value:t,configurable:!0}),"c$g");const p7={configFiles:["packem.config.ts","packem.config.js","packem.config.mjs","packem.config.mts","packem.config.cjs"],detect:u7(({matchedConfigs:e})=>({targets:{build:{command:"packem build",description:"@visulima/packem build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]??"packem.config.ts"}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),fallbackDependency:"@visulima/packem",name:"packem"};var d7=Object.defineProperty,f7=d((e,t)=>d7(e,"name",{value:t,configurable:!0}),"o$k");const h7={configFiles:["playwright.config.ts","playwright.config.js","playwright.config.mjs","playwright.config.mts","playwright.config.cjs"],detect:f7(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0;return{targets:{"test:e2e":{command:"playwright test",description:"playwright test (inferred)",inputs:["{projectRoot}/e2e/**/*","{projectRoot}/tests/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/src/**/*",...t?[t]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/playwright-report","{projectRoot}/test-results"],type:"test"}}}},"detect"),fallbackDependency:"@playwright/test",name:"playwright"};var m7=Object.defineProperty,g7=d((e,t)=>m7(e,"name",{value:t,configurable:!0}),"r$h");const y7={configFiles:["prettier.config.ts","prettier.config.js","prettier.config.mjs","prettier.config.mts","prettier.config.cjs",".prettierrc",".prettierrc.json",".prettierrc.js",".prettierrc.cjs",".prettierrc.mjs",".prettierrc.yml",".prettierrc.yaml"],detect:g7(({matchedConfigs:e})=>{const t=["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*",...e.map(r=>`{projectRoot}/${r}`),"{projectRoot}/package.json"];return{targets:{format:{command:"prettier --write .",description:"prettier --write (inferred)"},"format:check":{command:"prettier --check .",description:"prettier --check (inferred)",inputs:t,outputs:[],type:"build"}}}},"detect"),fallbackDependency:"prettier",name:"prettier"};var v7=Object.defineProperty,b7=d((e,t)=>v7(e,"name",{value:t,configurable:!0}),"t$k");const $7={configFiles:["prisma/schema.prisma","schema.prisma"],detect:b7(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0;return{targets:{"db:generate":{command:"prisma generate",description:"prisma generate (inferred)",inputs:[...t?[t]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/node_modules/.prisma","{projectRoot}/node_modules/@prisma/client"],type:"build"},"db:migrate":{command:"prisma migrate dev",description:"prisma migrate dev (inferred)"},"db:push":{command:"prisma db push",description:"prisma db push (inferred)"},"db:studio":{command:"prisma studio",description:"prisma studio (inferred)",preset:"server"}}}},"detect"),fallbackDependency:"prisma",name:"prisma"};var w7=Object.defineProperty,k7=d((e,t)=>w7(e,"name",{value:t,configurable:!0}),"o$j");const S7={configFiles:["remix.config.ts","remix.config.js","remix.config.mjs","remix.config.cjs"],detect:k7(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={build:{command:"remix vite:build",description:"remix build (inferred)",inputs:["{projectRoot}/app/**/*","{projectRoot}/public/**/*",...r?[r]:[],"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/build"],type:"build"}};return e&&(n.dev={command:"remix vite:dev",description:"remix dev (inferred)",preset:"server"},n.start={command:"remix-serve ./build/server/index.js",description:"remix-serve (inferred)",preset:"server"}),{targets:n}},"detect"),name:"remix"};var D7=Object.defineProperty,C7=d((e,t)=>D7(e,"name",{value:t,configurable:!0}),"t$j");const E7={configFiles:["rolldown.config.ts","rolldown.config.js","rolldown.config.mjs","rolldown.config.mts","rolldown.config.cjs"],detect:C7(({matchedConfigs:e})=>({targets:{build:{command:"rolldown -c",description:"rolldown build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),name:"rolldown"};var j7=Object.defineProperty,A7=d((e,t)=>j7(e,"name",{value:t,configurable:!0}),"t$i");const x7={configFiles:["rollup.config.ts","rollup.config.js","rollup.config.mjs","rollup.config.mts","rollup.config.cjs"],detect:A7(({matchedConfigs:e})=>({targets:{build:{command:"rollup -c",description:"rollup build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),name:"rollup"};var O7=Object.defineProperty,P7=d((e,t)=>O7(e,"name",{value:t,configurable:!0}),"r$g");const F7={configFiles:[".storybook/main.ts",".storybook/main.js",".storybook/main.mjs",".storybook/main.mts",".storybook/main.cjs"],detect:P7(({matchedConfigs:e})=>{const t=e[0]?`{projectRoot}/${e[0]}`:void 0;return{targets:{"build-storybook":{command:"storybook build",description:"storybook build (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/.storybook/**/*","{projectRoot}/stories/**/*",...t?[t]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/storybook-static"],type:"build"},storybook:{command:"storybook dev -p 6006",description:"storybook dev (inferred)",preset:"server"}}}},"detect"),name:"storybook"};var B7=Object.defineProperty,R7=d((e,t)=>B7(e,"name",{value:t,configurable:!0}),"e$o");const T7={configFiles:["stylelint.config.ts","stylelint.config.js","stylelint.config.mjs","stylelint.config.cjs",".stylelintrc",".stylelintrc.json",".stylelintrc.js",".stylelintrc.cjs",".stylelintrc.yml",".stylelintrc.yaml"],detect:R7(({matchedConfigs:e})=>({targets:{"lint:css":{command:'stylelint "**/*.{css,scss,sass,less,vue,svelte,astro}"',description:"stylelint (inferred)",inputs:["{projectRoot}/src/**/*.css","{projectRoot}/src/**/*.scss","{projectRoot}/src/**/*.sass","{projectRoot}/src/**/*.less","{projectRoot}/src/**/*.vue","{projectRoot}/src/**/*.svelte","{projectRoot}/src/**/*.astro",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"stylelint",name:"stylelint"};var N7=Object.defineProperty,I7=d((e,t)=>N7(e,"name",{value:t,configurable:!0}),"o$h");const L7={configFiles:["tsdown.config.ts","tsdown.config.js","tsdown.config.mjs","tsdown.config.mts","tsdown.config.cjs"],detect:I7(({matchedConfigs:e})=>({targets:{build:{command:"tsdown",description:"tsdown build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]??"tsdown.config.ts"}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),fallbackDependency:"tsdown",name:"tsdown"};var _7=Object.defineProperty,M7=d((e,t)=>_7(e,"name",{value:t,configurable:!0}),"o$g");const W7={configFiles:["tsup.config.ts","tsup.config.js","tsup.config.mjs","tsup.config.mts","tsup.config.cjs"],detect:M7(({matchedConfigs:e})=>({targets:{build:{command:"tsup",description:"tsup build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]??"tsup.config.ts"}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),fallbackDependency:"tsup",name:"tsup"};var V7=Object.defineProperty,U7=d((e,t)=>V7(e,"name",{value:t,configurable:!0}),"e$m");const G7={configFiles:["typedoc.json","typedoc.jsonc","typedoc.config.ts","typedoc.config.js","typedoc.config.mjs","typedoc.config.mts","typedoc.config.cjs"],detect:U7(({matchedConfigs:e})=>({targets:{docs:{command:"typedoc",description:"typedoc (inferred)",inputs:["{projectRoot}/src/**/*",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/docs"],type:"build"}}}),"detect"),fallbackDependency:"typedoc",name:"typedoc"};var q7=Object.defineProperty,H7=d((e,t)=>q7(e,"name",{value:t,configurable:!0}),"e$l");const z7={configFiles:["tsconfig.json","tsconfig.build.json"],detect:H7(({matchedConfigs:e})=>({targets:{typecheck:{command:"tsc --noEmit",description:"tsc --noEmit (inferred)",inputs:["{projectRoot}/src/**/*.ts","{projectRoot}/src/**/*.tsx","{projectRoot}/__tests__/**/*.ts","{projectRoot}/__tests__/**/*.tsx","{projectRoot}/test/**/*.ts","{projectRoot}/tests/**/*.ts",...e.map(t=>`{projectRoot}/${t}`),"{projectRoot}/package.json"],outputs:[],type:"build"}}}),"detect"),fallbackDependency:"typescript",name:"typescript"};var J7=Object.defineProperty,K7=d((e,t)=>J7(e,"name",{value:t,configurable:!0}),"t$h");const Y7={configFiles:["vite.config.ts","vite.config.js","vite.config.mjs","vite.config.mts","vite.config.cjs"],detect:K7(({matchedConfigs:e})=>({targets:{build:{command:"vite build",description:"vite production build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]}`,"{projectRoot}/package.json"],outputs:["{projectRoot}/dist"],type:"build"},dev:{command:"vite",description:"vite dev server (inferred)",preset:"server"},preview:{command:"vite preview",description:"vite preview server (inferred)",preset:"server"}}}),"detect"),name:"vite"};var X7=Object.defineProperty,Q7=d((e,t)=>X7(e,"name",{value:t,configurable:!0}),"r$e");const Z7={configFiles:[".vitepress/config.ts",".vitepress/config.js",".vitepress/config.mjs",".vitepress/config.mts",".vitepress/config.cjs","docs/.vitepress/config.ts","docs/.vitepress/config.js","docs/.vitepress/config.mjs","docs/.vitepress/config.mts","docs/.vitepress/config.cjs"],detect:Q7(({matchedConfigs:e})=>{const t=e[0]?.startsWith("docs/"),r=t?"docs":".",n=e[0]?`{projectRoot}/${e[0]}`:void 0,s=["{projectRoot}/.vitepress/**/*","{projectRoot}/docs/**/*",...n?[n]:[],"{projectRoot}/package.json"];return{targets:{"docs:build":{command:`vitepress build ${r}`,description:"vitepress build (inferred)",inputs:s,outputs:[`{projectRoot}/${t?"docs/":""}.vitepress/dist`],type:"build"},"docs:dev":{command:`vitepress dev ${r}`,description:"vitepress dev (inferred)",preset:"server"},"docs:preview":{command:`vitepress preview ${r}`,description:"vitepress preview (inferred)",preset:"server"}}}},"detect"),name:"vitepress"};var eM=Object.defineProperty,tM=d((e,t)=>eM(e,"name",{value:t,configurable:!0}),"c$c");const rM={configFiles:["vitest.config.ts","vitest.config.js","vitest.config.mjs","vitest.config.mts","vitest.config.cjs"],detect:tM(({hasConfigFile:e,matchedConfigs:t})=>{const r=t[0]?`{projectRoot}/${t[0]}`:void 0,n={test:{command:"vitest run",description:"vitest run (inferred)",inputs:["{projectRoot}/src/**/*","{projectRoot}/__tests__/**/*","{projectRoot}/test/**/*","{projectRoot}/tests/**/*",...r?[r]:[],"{projectRoot}/package.json"],outputs:["{projectRoot}/coverage"],type:"test"}};return e&&(n["test:watch"]={command:"vitest",description:"vitest watch mode (inferred)",preset:"server"}),{targets:n}},"detect"),fallbackDependency:"vitest",name:"vitest"};var nM=Object.defineProperty,sM=d((e,t)=>nM(e,"name",{value:t,configurable:!0}),"t$g");const iM={configFiles:["webpack.config.ts","webpack.config.js","webpack.config.mjs","webpack.config.mts","webpack.config.cjs"],detect:sM(({matchedConfigs:e})=>({targets:{build:{command:"webpack --mode=production",description:"webpack production build (inferred)",inputs:["{projectRoot}/src/**/*",`{projectRoot}/${e[0]}`,"{projectRoot}/package.json","{projectRoot}/tsconfig.json"],outputs:["{projectRoot}/dist"],type:"build"}}}),"detect"),name:"webpack"};var oM=Object.defineProperty,Bf=d((e,t)=>oM(e,"name",{value:t,configurable:!0}),"n$f");const Rf=[r7,Z6,S7,p6,L6,x6,Y7,Z7,Y6,E7,L7,W7,p7,x7,iM,rM,G6,y6,h7,S6,F7,z7,G7,T6,y7,h6,c7,i7,T7,z6,E6,$7,F6,W6,c6,$6],aM=Bf((e,t)=>e.dependencies!==void 0&&Object.hasOwn(e.dependencies,t)||e.devDependencies!==void 0&&Object.hasOwn(e.devDependencies,t)||e.peerDependencies!==void 0&&Object.hasOwn(e.peerDependencies,t)||e.optionalDependencies!==void 0&&Object.hasOwn(e.optionalDependencies,t),"hasDependency"),cM=Bf((e,t)=>{const r=[];for(const n of t)pc(D(e,n))&&r.push(n);return r},"matchConfigFiles"),lM=Bf((e,t=Rf)=>{const r={},n=[];for(const s of t){const i=cM(e.projectRoot,s.configFiles),o=s.fallbackDependency!==void 0&&aM(e.pkg,s.fallbackDependency);if(i.length===0&&!o)continue;const a=s.detect({...e,hasConfigFile:i.length>0,matchedConfigs:i});let c=!1;for(const[l,u]of Object.entries(a.targets))r[l]===void 0&&(r[l]=u,c=!0);c&&n.push(s.name)}return{sources:n,targets:r}},"inferProjectTargets");var uM=Object.defineProperty,br=d((e,t)=>uM(e,"name",{value:t,configurable:!0}),"s$d");const pM={server:{cache:!1,interactive:!1,persistent:!0,runInCI:!1},utility:{cache:!1,runInCI:!1}},dM=br(e=>{const t=e.preset??e.options?.preset;if(!t)return e;const r=pM[t];if(!r)return e;const{cache:n,...s}=r;return{...e,cache:e.cache??n,options:{...s,...e.options}}},"applyPreset"),fM=br(()=>{const e=jp();return e==="darwin"?"macos":e==="win32"?"windows":"linux"},"detectCurrentOs"),GJ=br((e,t)=>{if(!t||t.size===0)return!0;const r=e?.runnerTags;return!r||r.length===0?!0:r.some(n=>t.has(n))},"matchesRunnerTags"),qJ=br((e,t,r=!0)=>{const n=e?.runInCI??!0;return n===!0||n==="always"?!0:n===!1?!t:n==="affected"?!t||r:!0},"shouldRunInCI"),HJ=br((e,t,r)=>r||!t?e:tn(t)?t:D(e,t),"resolveTaskCwd"),zJ=br((e,t)=>{if(t===!1)return{};const r=t===!0?hM("production"):Array.isArray(t)?t:[t],n={};for(const s of r)Object.assign(n,mM(e,s));return n},"loadEnvFile"),hM=br(e=>{const t=[".env"];return e&&t.push(`.env.${e}`),e!=="test"&&t.push(".env.local"),e&&e!=="test"&&t.push(`.env.${e}.local`),t},"resolveEnvCascade"),mM=br((e,t)=>{const r=tn(t)?t:D(e,t);if(!j(r))return{};let n;try{n=H(r)}catch{return{}}const s={};for(const i of n.split(/\r?\n/)){const o=i.trim();if(o===""||o.startsWith("#"))continue;const a=o.indexOf("=");if(a===-1)continue;const c=o.slice(0,a).trim();if(c==="")continue;let l=o.slice(a+1).trim();(l.startsWith('"')&&l.endsWith('"')||l.startsWith("'")&&l.endsWith("'"))&&(l=l.slice(1,-1)),s[c]=l}return s},"loadSingleEnvFile"),JJ=br((e,t=fM())=>{if(e)return t==="windows"&&e.windowsShell?e.windowsShell:(t==="linux"||t==="macos")&&e.unixShell?e.unixShell:e.shell},"resolveTargetShell"),c1=br(e=>{if(e==="run")return!1;if(e==="build"||e==="test")return!0},"defaultCacheForType");var lu={exports:{}},Km;function gM(){return Km||(Km=1,(function(e){var t=Object.defineProperty,r=d((R,F)=>t(R,"name",{value:F,configurable:!0}),"i");function n(R){return Array.isArray(R)?R:[R]}d(n,"makeArray"),r(n,"makeArray");const s=void 0,i="",o=" ",a="\\",c=/^\s+$/,l=/(?:[^\\]|^)\\$/,u=/^\\!/,p=/^\\#/,f=/\r?\n/g,m=/^\.{0,2}\/|^\.{1,2}$/,$=/\/$/,b="/";let k="node-ignore";typeof Symbol<"u"&&(k=Symbol.for("node-ignore"));const S=k,y=r((R,F,N)=>(Object.defineProperty(R,F,{value:N}),N),"define"),h=/([0-z])-([0-z])/g,v=r(()=>!1,"RETURN_FALSE"),w=r(R=>R.replace(h,(F,N,Q)=>N.charCodeAt(0)<=Q.charCodeAt(0)?F:i),"sanitizeRange"),g=r(R=>{const{length:F}=R;return R.slice(0,F-F%2)},"cleanRangeBackSlash"),E=[[/^\uFEFF/,()=>i],[/((?:\\\\)*?)(\\?\s+)$/,(R,F,N)=>F+(N.indexOf("\\")===0?o:i)],[/(\\+?)\s/g,(R,F)=>{const{length:N}=F;return F.slice(0,N-N%2)+o}],[/[\\$.|*+(){^]/g,R=>`\\${R}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,r(function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"},"startingReplacer")],[/\\\/\\\*\\\*(?=\\\/|$)/g,(R,F,N)=>F+6<N.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(R,F,N)=>{const Q=N.replace(/\\\*/g,"[^\\/]*");return F+Q}],[/\\\\\\(?=[$.|*+(){^])/g,()=>a],[/\\\\/g,()=>a],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(R,F,N,Q,oe)=>F===a?`\\[${N}${g(Q)}${oe}`:oe==="]"&&Q.length%2===0?`[${w(N)}${Q}]`:"[]"],[/(?:[^*])$/,R=>/\/$/.test(R)?`${R}$`:`${R}(?=$|\\/$)`]],C=/(^|\\\/)?\\\*$/,A="regex",O="checkRegex",I="_",V={[A](R,F){return`${F?`${F}[^/]+`:"[^/]*"}(?=$|\\/$)`},[O](R,F){return`${F?`${F}[^/]*`:"[^/]*"}(?=$|\\/$)`}},fe=r(R=>E.reduce((F,[N,Q])=>F.replace(N,Q.bind(R)),R),"makeRegexPrefix"),Y=r(R=>typeof R=="string","isString"),U=r(R=>R&&Y(R)&&!c.test(R)&&!l.test(R)&&R.indexOf("#")!==0,"checkPattern"),M=r(R=>R.split(f).filter(Boolean),"splitPattern");class X{static{d(this,"IgnoreRule")}static{r(this,"IgnoreRule")}constructor(F,N,Q,oe,be,it){this.pattern=F,this.mark=N,this.negative=be,y(this,"body",Q),y(this,"ignoreCase",oe),y(this,"regexPrefix",it)}get regex(){const F=I+A;return this[F]?this[F]:this._make(A,F)}get checkRegex(){const F=I+O;return this[F]?this[F]:this._make(O,F)}_make(F,N){const Q=this.regexPrefix.replace(C,V[F]),oe=this.ignoreCase?new RegExp(Q,"i"):new RegExp(Q);return y(this,N,oe)}}const x=r(({pattern:R,mark:F},N)=>{let Q=!1,oe=R;oe.indexOf("!")===0&&(Q=!0,oe=oe.substr(1)),oe=oe.replace(u,"!").replace(p,"#");const be=fe(oe);return new X(R,F,oe,N,Q,be)},"createRule");class W{static{d(this,"RuleManager")}static{r(this,"RuleManager")}constructor(F){this._ignoreCase=F,this._rules=[]}_add(F){if(F&&F[S]){this._rules=this._rules.concat(F._rules._rules),this._added=!0;return}if(Y(F)&&(F={pattern:F}),U(F.pattern)){const N=x(F,this._ignoreCase);this._added=!0,this._rules.push(N)}}add(F){return this._added=!1,n(Y(F)?M(F):F).forEach(this._add,this),this._added}test(F,N,Q){let oe=!1,be=!1,it;this._rules.forEach(Wr=>{const{negative:bi}=Wr;be===bi&&oe!==be||bi&&!oe&&!be&&!N||!Wr[Q].test(F)||(oe=!bi,be=bi,it=bi?s:Wr)});const St={ignored:oe,unignored:be};return it&&(St.rule=it),St}}const Z=r((R,F)=>{throw new F(R)},"throwError"),z=r((R,F,N)=>Y(R)?R?z.isNotRelative(R)?N(`path should be a \`path.relative()\`d string, but got "${F}"`,RangeError):!0:N("path must not be empty",TypeError):N(`path must be a string, but got \`${F}\``,TypeError),"checkPath"),J=r(R=>m.test(R),"isNotRelative");z.isNotRelative=J,z.convert=R=>R;class K{static{d(this,"Ignore")}static{r(this,"Ignore")}constructor({ignorecase:F=!0,ignoreCase:N=F,allowRelativePaths:Q=!1}={}){y(this,S,!0),this._rules=new W(N),this._strictPathCheck=!Q,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(F){return this._rules.add(F)&&this._initCache(),this}addPattern(F){return this.add(F)}_test(F,N,Q,oe){const be=F&&z.convert(F);return z(be,F,this._strictPathCheck?Z:v),this._t(be,N,Q,oe)}checkIgnore(F){if(!$.test(F))return this.test(F);const N=F.split(b).filter(Boolean);if(N.pop(),N.length){const Q=this._t(N.join(b)+b,this._testCache,!0,N);if(Q.ignored)return Q}return this._rules.test(F,!1,O)}_t(F,N,Q,oe){if(F in N)return N[F];if(oe||(oe=F.split(b).filter(Boolean)),oe.pop(),!oe.length)return N[F]=this._rules.test(F,Q,A);const be=this._t(oe.join(b)+b,N,Q,oe);return N[F]=be.ignored?be:this._rules.test(F,Q,A)}ignores(F){return this._test(F,this._ignoreCache,!1).ignored}createFilter(){return F=>!this.ignores(F)}filter(F){return n(F).filter(this.createFilter())}test(F){return this._test(F,this._testCache,!0)}}const ee=r(R=>new K(R),"factory"),De=r(R=>z(R&&z.convert(R),R,v),"isPathValid"),ve=r(()=>{const R=r(N=>/^\\\\\?\\/.test(N)||/["<>|\u0000-\u001F]+/u.test(N)?N:N.replace(/\\/g,"/"),"makePosix");z.convert=R;const F=/^[a-z]:\//i;z.isNotRelative=N=>F.test(N)||J(N)},"setupWindows");process.platform==="win32"&&ve(),e.exports=ee,ee.default=ee,e.exports.isPathValid=De,y(e.exports,Symbol.for("setupWindows"),ve)})(lu)),lu.exports}d(gM,"requireIgnore");var yM=gM();const Ym=Ng(yM);var vM=Object.defineProperty,Hr=d((e,t)=>vM(e,"name",{value:t,configurable:!0}),"i$c");const bM=Ym.default??Ym,$M=[".git/","node_modules/"],wM=/\/+$/,Xm=Hr(e=>{try{return Gg(e,"utf8")}catch{return}},"safeRead"),kM=Hr(e=>e.replaceAll("\\","/"),"toForwardSlashes"),KJ=Hr(e=>{if(!e||e.length===0)return[];const t=[];for(const r of e){const n=r.replace(wM,"");if(n.startsWith("!")){const s=n.slice(1);s.length>0&&t.push(s)}}return t},"extractWorkspaceExcludePatterns"),SM=Hr(e=>{const{cwd:t}=e,r=bM();if(e.builtinExcludes!==!1&&r.add($M),e.rootGitignore!==!1){const i=Xm(Ke(t,".gitignore"));i!==void 0&&r.add(i)}for(const i of e.extraIgnoreFiles??[]){const o=tn(i)?i:Ke(t,i),a=Xm(o);a!==void 0&&r.add(a)}e.extraPatterns&&e.extraPatterns.length>0&&r.add(e.extraPatterns);const n=Hr(i=>{const o=i.endsWith("/")||i.endsWith("\\"),a=tn(i)?i:Ke(t,i),c=kM(zn(t,a));return c===""||c.startsWith("../")||c===".."?!1:r.ignores(o?`${c}/`:c)},"ignores"),s={add:Hr(i=>(r.add(i),s),"add"),filter:Hr(i=>i.filter(o=>!n(o)),"filter"),filterDirectories:Hr(i=>i.filter(o=>!n(o.endsWith("/")||o.endsWith("\\")?o:`${o}/`)),"filterDirectories"),ignores:n};return s},"buildGitignoreMatcher");var DM=Object.defineProperty,Te=d((e,t)=>DM(e,"name",{value:t,configurable:!0}),"c$a");const CM=/\/+$/,EM=/\/\*\*$/,jM=/\/\*\/\*$/,AM=/^['"]|['"]$/g,Tf=/node_modules/,Nf=/\.git/,en=Te(e=>{try{return le(e)}catch{return}},"readJsonFileSafe"),xM=Te((e,t,r)=>{for(const n of un(e,{includeFiles:!1,includeSymlinks:!1,skip:[Tf,Nf]}))if(n.path!==e&&j(D(n.path,"package.json"))){const s=n.path.slice(e.length+1);r.push(`${t}/${s}`)}},"scanDirectoryRecursive"),OM=Te((e,t,r)=>{const n=t.slice(0,-2),s=Ke(e,n);if(j(s))for(const i of un(s,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[Tf,Nf]}))i.path!==s&&j(D(i.path,"package.json"))&&r.push(D(n,i.name))},"resolveSimpleGlob"),PM=Te((e,t,r)=>{const n=t.replace(EM,"").replace(jM,""),s=Ke(e,n);j(s)&&xM(s,n,r)},"resolveDoubleGlob"),FM=Te((e,t,r)=>{const n=Ke(e,t);j(n)&&j(D(n,"package.json"))&&r.push(t)},"resolveExactDirectory"),BM=/[$()+.?[\\\]^{|}]/g,RM=Te((e,t,r)=>{const n=t.replaceAll(BM,String.raw`\$&`).replaceAll("*",".*"),s=new RegExp(`^${n}$`);for(const i of un(e,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[Tf,Nf]}))i.path!==e&&s.test(i.name)&&j(D(i.path,"package.json"))&&r.push(i.name)},"resolveBareGlob"),ln=Te((e,t)=>{const r=[],n=[];for(const i of t){const o=i.replace(CM,"");if(o.startsWith("!")){const a=o.slice(1);a.length>0&&(n.push(a),a.endsWith("/**")&&n.push(`${a.slice(0,-3)}/`));continue}r.push(o)}const s=[];for(const i of r)i.endsWith("/**")||i.endsWith("/*/*")?PM(e,i,s):i.endsWith("/*")?OM(e,i,s):!i.includes("/")&&i.includes("*")?RM(e,i,s):FM(e,i,s);return s.length===0?s:SM({cwd:e,extraPatterns:n}).filterDirectories(s)},"resolveWorkspacePatterns"),l1=Te((e,t,r=new Set)=>{if(!e)return[];const n=[];for(const s of e){if(typeof s=="object"&&s&&"group"in s){const i=s.group;if(r.has(i))throw new Error(`Cycle detected in vis.config taskGroups: ${[...r,i].join(" → ")}`);const o=t?.[i];if(!o)throw new Error(`Unknown taskGroup "${i}" referenced in dependsOn. Declare it under \`taskGroups\` in vis.config.ts.`);n.push(...l1(o,t,new Set([...r,i])));continue}n.push(s)}return n},"expandTaskGroups"),sl=Te(e=>{if(Array.isArray(e)){if(e.length===0)throw new Error('Invalid package.json `workspaces`: empty array. Add at least one pattern like "packages/*" or remove the field.');for(const t of e)if(typeof t!="string"||t.trim().length===0)throw new TypeError(`Invalid package.json \`workspaces\` entry: expected a non-empty glob string, got ${JSON.stringify(t)}.`);return e}if(e&&typeof e=="object"){const{packages:t}=e;if(t===void 0)throw new Error('Invalid package.json `workspaces`: object form requires a `packages` array (e.g. `{ "packages": ["packages/*"] }`).');if(!Array.isArray(t))throw new TypeError(`Invalid package.json \`workspaces.packages\`: expected an array of glob strings, got ${typeof t}.`);return sl(t)}throw new TypeError(`Invalid package.json \`workspaces\`: expected an array or { packages: string[] } object, got ${typeof e}.`)},"validateWorkspacesField"),u1=["aube-workspace.yaml","pnpm-workspace.yaml"],TM=Te((e,t)=>{const r=D(e,t);if(!j(r))return;let n;try{n=Is(H(r))}catch{return}if(typeof n!="object"||n===null)return;const{overrides:s}=n;if(typeof s!="object"||s===null||Array.isArray(s))return;const i={};for(const[o,a]of Object.entries(s))typeof a=="string"&&(i[o]=a);return Object.keys(i).length>0?i:void 0},"readWorkspaceYamlOverrides"),NM=Te((e,t)=>{const r=D(e,t);if(!j(r))return;const n=H(r),s=[];let i=!1;for(const o of n.split(`
|
|
1115
|
+
`)){const a=o.trim();if(a==="packages:"){i=!0;continue}if(i){if(a.startsWith("- ")){const c=a.slice(2).replaceAll(AM,"");s.push(c)}else if(a&&!a.startsWith("#"))break}}return s.length>0?s:void 0},"readWorkspaceYamlPatterns"),IM=Te(e=>{for(const t of u1){const r=TM(e,t);if(r)return r}},"readPnpmWorkspaceOverrides"),ci=Te(e=>{for(const t of u1){const r=NM(e,t);if(r)return r}},"readPnpmWorkspacePatterns"),YJ=Te(e=>{const t=ci(e);if(t)return t;const r=en(D(e,"package.json"));if(r?.workspaces!==void 0)try{return sl(r.workspaces)}catch{return}},"readWorkspacePatterns"),Qm="@filegroup:",LM=Te((e,t,r)=>{if(!e)return!0;if(e.projectType&&e.projectType!==r)return!1;if(e.tags&&e.tags.length>0){const n=new Set(t?.tags);if(!e.tags.some(s=>n.has(s)))return!1}if(e.layer){const n=Array.isArray(e.layer)?e.layer:[e.layer];if(t?.layer===void 0||!n.includes(t.layer))return!1}if(e.stack){const n=Array.isArray(e.stack)?e.stack:[e.stack];if(t?.stack===void 0||!n.includes(t.stack))return!1}if(e.language){const n=Array.isArray(e.language)?e.language:[e.language];if(t?.language===void 0||!n.includes(t.language))return!1}return!0},"scopeMatches"),_M=Te((e,t,r)=>{const n={};for(const[s,i]of Object.entries(e.tasks??{}))n[s]=Ba(void 0,i);for(const s of e.scopedTasks??[])if(LM(s.match,t,r))for(const[i,o]of Object.entries(s.tasks))n[i]=Ba(n[i],o);return n},"collectTargetDefaults"),p1=Te((e,t)=>{if(!e)return e;const r=[];for(const n of e){if(typeof n=="string"&&n.startsWith(Qm)){const s=n.slice(Qm.length),i=t?.[s];i&&r.push(...i);continue}r.push(n)}for(const n of r)typeof n=="string"&&oS(n)&&aS(n);return r},"resolveFileGroupInputs"),Zm=new Set,MM=Te(e=>{if(e===!0||e===void 0)return()=>!0;if(e===!1)return;const t=new Set(Rf.map(n=>n.name)),r=Object.keys(e).filter(n=>!t.has(n));if(r.length>0){const n=[...r].sort().join(",");Zm.has(n)||(Zm.add(n),process.emitWarning(`vis: inferTargets references unknown detector(s): ${r.join(", ")}. Known detectors: ${[...t].join(", ")}.`,"VisConfigWarning"))}return n=>e[n]!==!1},"resolveInferTargetOption"),lp=Te((e,t,r,n,s)=>{const i={...Ba(n,r),options:{...n?.options,...r?.options}};t&&i.command===void 0&&i.executor===void 0&&(i.command=t),i.inputs&&(i.inputs=p1(i.inputs,s));const o=dM(i);return o.cache===void 0&&(o.cache=c1(o.type)),o},"mergeTarget"),WM=Te((e,t,r,n)=>{const s={},i=new Set;for(const[o,a]of Object.entries(e??{}))i.add(o),s[o]=lp(o,a,t?.[o],r[o],n);for(const[o,a]of Object.entries(t??{}))i.has(o)||(s[o]=lp(o,void 0,a,r[o],n));return s},"createTargetsFromScripts"),VM=Te((e,t)=>{if(e===void 0&&t===void 0)return;const r=new Set([...Object.keys(e??{}),...Object.keys(t??{})]),n={};for(const s of r)n[s]=Ba(e?.[s],t?.[s]);return n},"mergeProjectTargets"),UM=Te((e,t)=>{if(typeof e!="string"||typeof t!="string"||t.length===0)return!1;const r=e.trim();return/[\n\r;&|`]|\$\(/.test(r)?!1:r===t||r.startsWith(`${t} `)},"scriptMatchesInferredCommand"),GM=Te((e,t={},r)=>{const n={},s=new Map,i=new Map,o=ci(e),a=en(D(e,"package.json"));let c;if(o?c=o:a?.workspaces!==void 0&&(c=sl(a.workspaces)),!c)throw new Error("No workspace configuration found. Expected pnpm-workspace.yaml or package.json workspaces field.");const l=ln(e,c);for(const u of l){const p=D(e,u,"package.json"),f=en(p);if(!f)continue;const m=D(e,u,"project.json"),$=en(m),b=$?.name??f.name;if(!b)continue;i.set(b,f);let k="library";$?.projectType?k=$.projectType:f.bin!==void 0&&(k="application");const S=_M(t,$,k),y=VM($?.targets,r?.get(u)?.tasks),h=WM(f.scripts,y,S,t.fileGroups),v=MM(t.inferTargets);if(v!==void 0){const g=D(e,u),E=Rf.filter(A=>v(A.name)),C=lM({pkg:f,projectDirectory:u,projectRoot:g},E);for(const[A,O]of Object.entries(C.targets)){const I=h[A];if(I===void 0){h[A]={...lp(A,O.command,O,S[A],t.fileGroups),inferred:!0};continue}if(I.inputs!==void 0||I.outputs!==void 0)continue;const V=I.type??O.type,fe=UM(I.command,O.command),Y={...I,...fe&&O.inputs?{inputs:p1(O.inputs,t.fileGroups)}:{},...fe&&O.outputs?{outputs:O.outputs}:{},type:V};Y.cache===void 0&&(Y.cache=c1(V)),h[A]=Y}}for(const[g,E]of Object.entries(h)){const C=!!E.outputs?.length;E.type==="build"&&E.cache===!0&&!C&&(h[g]={...E,outputs:[{auto:!0}]})}s.set(b,h);const w={};for(const[g,E]of Object.entries(h)){const{options:C}=E,A={...E};delete A.inferred,delete A.options,delete A.preset,delete A.type;const O=E.dependsOn?l1(E.dependsOn,t.taskGroups):void 0;w[g]={...A,...O?{dependsOn:O}:{},...C?{options:C}:{}}}n[b]={implicitDependencies:$?.implicitDependencies,language:$?.language,layer:$?.layer,owners:$?.owners,project:$?.project,projectType:k,restricted:$?.restricted,root:u,sourceRoot:$?.sourceRoot??`${u}/src`,stack:$?.stack,tags:$?.tags,targets:w}}return{config:t,packageJsons:i,projectOptions:s,workspace:{projects:n}}},"discoverWorkspace"),XJ=Te((e,t,r)=>{const n={},s={},i=new Set(Object.keys(t.projects)),o=new Map,a=new Map;for(const[c,l]of Object.entries(t.projects)){const u=r?.get(c)??en(D(e,l.root,"package.json"));u&&(o.set(c,u),u.name&&a.set(u.name,c))}for(const[c,l]of Object.entries(t.projects)){n[c]={data:l,name:c,type:l.projectType??"library"},s[c]=[];const u=o.get(c);if(!u)continue;const p=[[u.dependencies,"static"],[u.devDependencies,"devDependency"],[u.peerDependencies,"peerDependency"]],f=new Set;for(const[m,$]of p)if(m)for(const b of Object.keys(m)){const k=i.has(b)?b:a.get(b);k&&!f.has(k)&&(f.add(k),s[c]?.push({source:c,target:k,type:$}))}}return{dependencies:s,nodes:n}},"buildProjectGraph"),QJ=Te(async e=>{const{loadVisTaskConfig:t}=await import("../packem_shared/applyDefaults-KxZkvlp3.js"),r=ci(e),n=en(D(e,"package.json"));let s;if(r?s=r:n?.workspaces!==void 0&&(s=sl(n.workspaces)),!s)return new Map;const i=ln(e,s),o=new Map;return await Promise.all(i.map(async a=>{const c=en(D(e,a,"package.json")),l=en(D(e,a,"project.json"))?.name??c?.name;if(!l||!c)return;const u=await t(e,D(e,a),l);u!==void 0&&o.set(a,u)})),o},"loadVisTaskConfigsForWorkspace");var qM=Object.defineProperty,HM=d((e,t)=>qM(e,"name",{value:t,configurable:!0}),"t$f");const we=HM((e,t)=>{if(!j(e))return;const r=`${e}.bak`;j(r)||(t?.backupsCreated.includes(r)??!1)||(Kk(e,r),t&&t.backupsCreated.push(r))},"backupFile");var zM=Object.defineProperty,il=d((e,t)=>zM(e,"name",{value:t,configurable:!0}),"e$k");const rt=il(e=>{try{const t=H(e);return JSON.parse(t)}catch{return}},"readJsonFile"),li=il(e=>{if(!j(e))return!1;try{return JSON.parse(H(e)),!0}catch{return!1}},"isJsonFile"),Xo=il((e,t,r={})=>vr(e,t,{defaultIndent:" ",useEditorconfig:r.useEditorconfig}),"detectJsonIndent"),Gn=il((e,t,r,n={})=>{if(!j(e))return!1;const s=H(e);let i;try{i=JSON.parse(s)}catch{return!1}const o=t(i);if(o===void 0)return!1;const a=Xo(e,s,n);return r&&we(e,r),Oe(e,`${JSON.stringify(o,void 0,a)}
|
|
1116
|
+
`,"utf8"),!0},"editJsonFile");var JM=Object.defineProperty,bn=d((e,t)=>JM(e,"name",{value:t,configurable:!0}),"f$4");const KM=/\blint-staged\b/g,YM=bn((e,t)=>{let r=!1;const n={...e};for(const[s,i]of Object.entries(n)){if(typeof i!="string")continue;let o=o1(i);o&&(o=o.replaceAll(KM,"vis staged").trim()||void 0),o!==i&&(o?n[s]=o:delete n[s],r=!0,t.rewrittenScriptCount+=1)}return{modified:r,scripts:n}},"rewriteScripts"),d1=bn((e,t,r,n)=>{const s=D(e,"package.json");j(s)&&Gn(s,i=>{let o=!1;for(const c of i1){const l=i.dependencies,u=i.devDependencies;l?.[c]&&(delete l[c],o=!0,n.removedPackageCount+=1),u?.[c]&&(delete u[c],o=!0,n.removedPackageCount+=1)}if(Object.keys(r).length>0)switch(t){case"bun":{const c=i.workspaces,l=c&&!Array.isArray(c)?c:void 0,u={...l?.catalog??i.catalog};for(const[f,m]of Object.entries(r))u[f]=m;l?.catalog===void 0?i.catalog=u:l.catalog=u;const p=i.overrides??{};for(const f of Object.keys(r))p[f]="catalog:";i.overrides=p,o=!0;break}case"npm":{const c=i.overrides??{};i.overrides={...c,...r},o=!0;break}case"pnpm":{const c=i.pnpm??{},l=c.overrides??{};c.overrides={...l,...r},i.pnpm=c,o=!0;break}case"yarn":{const c=i.resolutions??{};i.resolutions={...c,...r},o=!0;break}}const a=i.scripts;if(a){const c=YM(a,n);c.modified&&(i.scripts=c.scripts,o=!0)}return o?i:void 0})},"rewritePackageJson"),XM=bn((e,t,r,n)=>{try{const{workspace:s}=GM(e);for(const i of Object.values(s.projects)){const o=D(e,i.root);d1(o,t,r,n)}}catch{}},"migrateMonorepoPackages"),QM=bn(e=>e.startsWith("- ")||e!==""&&!e.includes(":")&&!e.startsWith("#"),"isCatalogSectionEnd"),ZM=bn(e=>{let t=!1,r="";const n=new Set;for(const s of e){const i=s.trim();if(i==="catalog:"){t=!0;continue}if(!t)continue;if(QM(i))break;const o=i.includes(":")?i.split(":")[0]?.trim():void 0;o&&(n.add(o),r=r||s.slice(0,s.indexOf(i)))}return{entries:n,indent:r||" "}},"parseCatalogEntries"),e5=bn((e,t,r)=>{const n=[];let s=!1,i=!1;for(let o=0;o<e.length;o+=1){const a=e[o],c=a.trim();if(n.push(a),c==="catalog:"){i=!0;continue}if(i&&!s){const l=e[o+1]?.trim()??"";(!l.includes(":")||l.startsWith("- ")||!l||l==="catalog:")&&(n.push(...t),s=!0,i=!1)}}return s||(r.includes("catalog:")||n.push("catalog:"),n.push(...t)),n},"insertCatalogEntries"),t5=bn((e,t)=>{const r=D(e,"pnpm-workspace.yaml");if(!j(r)||Object.keys(t).length===0)return;const n=H(r),s=n.split(`
|
|
1117
|
+
`),{entries:i,indent:o}=ZM(s),a=[];for(const[l,u]of Object.entries(t))i.has(l)||a.push(`${o}${l}: "${u}"`);if(a.length===0)return;const c=e5(s,a,n);we(r),Oe(r,c.join(`
|
|
1118
|
+
`),"utf8")},"updatePnpmWorkspaceCatalog"),eg=bn((e,t,r,n,s,i)=>{const o=r.overrides??{};if(n.dryRun){s.info("[dry-run] Would rewrite package.json files (remove husky/lint-staged, rewrite scripts)"),Object.keys(o).length>0&&s.info(`[dry-run] Would add overrides: ${JSON.stringify(o)}`);return}d1(e,t,o,i),s.info("Rewritten root package.json"),XM(e,t,o,i),t==="pnpm"&&t5(e,o)},"migrateDeps");var r5=Object.defineProperty,ol=d((e,t)=>r5(e,"name",{value:t,configurable:!0}),"t$e");const Ft=ol(()=>({backupsCreated:[],gitHooksConfigured:!1,inlinedLintStagedConfigCount:0,manualSteps:[],mergedStagedConfigCount:0,perMigration:{},removedConfigCount:0,removedPackageCount:0,rewrittenScriptCount:0,warnings:[]}),"createMigrationReport"),ue=ol((e,t)=>{!e||e.warnings.includes(t)||e.warnings.push(t)},"addMigrationWarning"),ye=ol((e,t)=>{!e||e.manualSteps.includes(t)||e.manualSteps.push(t)},"addManualStep"),at=ol((e,t,r,n=1)=>{const s=e.perMigration[t]??{removedConfigCount:0,removedPackageCount:0,rewrittenScriptCount:0};s[r]+=n,e.perMigration[t]=s,e[r]+=n},"bumpPerMigration");var n5=Object.defineProperty,$r=d((e,t)=>n5(e,"name",{value:t,configurable:!0}),"d$9");const s5=["gitleaks.toml",".gitleaks.toml"],i5=["gitleaks-report.json",".gitleaks-report.json","baseline.json"],al=$r(e=>s5.find(t=>j(D(e,t))),"detectGitleaksConfig"),If=$r(e=>{const t=D(e,".gitleaksignore");return j(t)?t:void 0},"detectGitleaksIgnore"),Lf=$r(e=>{for(const t of i5){const r=D(e,t);if(j(r))try{const n=JSON.parse(H(r));if(Array.isArray(n)&&n.length>0&&typeof n[0]=="object"&&n[0]!==null&&"RuleID"in n[0])return r}catch{}}},"detectGitleaksBaseline"),o5=$r(e=>e.map(t=>({description:t.Description??"",endColumn:t.EndColumn??0,endLine:t.EndLine??t.StartLine??0,entropy:t.Entropy??0,file:t.File??"",match:t.Match??"",ruleId:t.RuleID??"",secret:t.Secret??"",startColumn:t.StartColumn??0,startLine:t.StartLine??0,tags:t.Tags??[]})),"convertBaseline"),a5=$r((e,t,r,n,s)=>{const i=Lf(e);if(!i)return;const o=D(e,".secrets-baseline.json");if(j(o)&&i!==o){ue(n,`.secrets-baseline.json already exists — leaving ${i} in place`);return}const a=rt(i);if(!Array.isArray(a)){ue(n,`Could not parse ${i} as a gitleaks baseline`);return}const c=o5(a);if(t){r.info(`[dry-run] Would convert ${i} -> ${o} (${String(c.length)} findings)`);return}we(i,n),qe(o,`${JSON.stringify(c,null,vr(o,void 0,{defaultIndent:" ",useEditorconfig:s}))}
|
|
1119
|
+
`),r.info(`Converted ${i} -> ${o} (${String(c.length)} findings)`),at(n,"gitleaks","rewrittenScriptCount")},"migrateBaseline"),c5=$r((e,t,r,n,s)=>{const i=D(e,"package.json");if(!j(i))return;const o=rt(i);if(!o)return;const a=al(e),c=a?`vis secrets --config ${a}`:"vis secrets";let l=!1;if(o.scripts){for(const[p,f]of Object.entries(o.scripts))if(typeof f=="string"&&/\bgitleaks\b/.test(f)){const m=f.replaceAll(/\bgitleaks(?:\s+(?:detect|protect))?\b[^\n&|;]*/g,c).trim();m!==f&&(o.scripts[p]=m,l=!0,r.info(` scripts.${p}: "${f}" -> "${m}"`),at(n,"gitleaks","rewrittenScriptCount"))}}if(o.devDependencies){const p=o.devDependencies;for(const f of["gitleaks","@gitleaks/cli"])f in p&&(delete p[f],l=!0,at(n,"gitleaks","removedPackageCount"),r.info(` removed devDependency: ${f}`))}if(!l)return;if(t){r.info(`[dry-run] Would update ${i}`);return}const u=vr(i,H(i),{defaultIndent:" ",useEditorconfig:s});we(i,n),qe(i,`${JSON.stringify(o,null,u)}
|
|
1120
|
+
`)},"rewriteScripts"),l5=$r((e,t,r,n)=>{const s=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"],i=al(e),o=i?`vis secrets --staged --config ${i}`:"vis secrets --staged";for(const a of s){const c=D(e,a);if(!j(c))continue;const l=H(c);if(!/\bgitleaks\b/.test(l))continue;const u=l.replaceAll(/\bgitleaks(?:\s+(?:detect|protect))?\b[^\n&|;]*/g,o);if(t){r.info(`[dry-run] Would rewrite ${c}`);continue}we(c,n),qe(c,u),n.gitHooksConfigured=!0,r.info(`Rewrote gitleaks invocation in ${a}`)}},"rewriteHooks"),u5=/^([^:#][^:]*):([^:]+):(\d+)$/,p5=$r(e=>{const t=u5.exec(e.trim());if(!t)return;const[,r,n,s]=t,i=Number.parseInt(s??"0",10);return{description:"",endColumn:0,endLine:i,entropy:0,file:r??"",match:"",ruleId:n??"",secret:"",startColumn:0,startLine:i,tags:[]}},"fingerprintToBaselineEntry"),d5=$r((e,t,r,n,s)=>{const i=If(e);if(!i)return;const o=H(i).split(/\r?\n/).map(m=>m.trim()).filter(m=>m.length>0&&!m.startsWith("#")).map(m=>p5(m)).filter(m=>m!==void 0);o.length===0&&ue(n,`${i} contained no recognisable fingerprint lines — deleting it.`);const a=D(e,".secrets-baseline.json"),c=j(a)?rt(a)??[]:[],l=new Set(c.map(m=>`${m.file}:${m.ruleId}:${String(m.startLine)}`)),u=[...c];for(const m of o){const $=`${m.file}:${m.ruleId}:${String(m.startLine)}`;l.has($)||(l.add($),u.push(m))}if(t){r.info(`[dry-run] Would merge ${String(o.length)} .gitleaksignore fingerprint(s) into ${a}, then delete ${i}.`);return}we(i,n);const p=j(a)?H(a):void 0;p!==void 0&&we(a,n);const f=vr(a,p,{defaultIndent:" ",useEditorconfig:s});qe(a,`${JSON.stringify(u,null,f)}
|
|
1121
|
+
`),Jn(i),r.info(`Merged ${String(o.length)} fingerprint(s) from ${i} into ${a}; removed .gitleaksignore.`),at(n,"gitleaks","rewrittenScriptCount",o.length)},"migrateIgnoreFile"),tg=$r((e,t,r,n)=>{const s=al(e),i=If(e);return s??i??Lf(e)?(s&&(r.info(`Keeping ${s} as-is (compatible with vis secrets --config).`),ye(n,`Run \`vis secrets --config ${s}\` or rename to .gitleaksignore-compatible defaults.`)),i&&d5(e,t.dryRun,r,n,t.useEditorconfig),a5(e,t.dryRun,r,n,t.useEditorconfig),c5(e,t.dryRun,r,n,t.useEditorconfig),l5(e,t.dryRun,r,n),ye(n,"Review CI workflows (.github/workflows/*.yml) for gitleaks-action calls — replace with `vis secrets`."),!0):(t.silent||r.info("No gitleaks artifacts found — nothing to migrate."),!1)},"migrateGitleaks");var f5=Object.defineProperty,_r=d((e,t)=>f5(e,"name",{value:t,configurable:!0}),"f$3");const h5=["kingfisher-baseline.yaml",".kingfisher-baseline.yaml","kingfisher-baseline.yml",".kingfisher-baseline.yml"],m5=["kingfisher-rules.yml","kingfisher-rules.yaml",".kingfisher-rules.yml",".kingfisher-rules.yaml"],_f=_r(e=>h5.find(t=>j(D(e,t))),"detectKingfisherBaseline"),cl=_r(e=>m5.find(t=>j(D(e,t))),"detectKingfisherRules"),g5=_r(e=>{const t=[];let r={};for(const n of e.split(/\r?\n/)){const s=n.replace(/#.*$/,"");(/^\s*-\s*filepath\s*:/.test(s)||/^\s*-\s*$/.test(s))&&(r.filepath&&typeof r.linenum=="number"&&r.fingerprint&&t.push(r),r={});const i=/filepath\s*:\s*(.+?)\s*$/.exec(s);if(i?.[1]){r.filepath=i[1].replaceAll(/^["']|["']$/g,"");continue}const o=/fingerprint\s*:\s*(.+?)\s*$/.exec(s);if(o?.[1]){r.fingerprint=o[1].replaceAll(/^["']|["']$/g,"");continue}const a=/linenum\s*:\s*(\d+)/.exec(s);a?.[1]&&(r.linenum=Number.parseInt(a[1],10))}return r.filepath&&typeof r.linenum=="number"&&r.fingerprint&&t.push(r),t},"parseKingfisherBaseline"),y5=_r(e=>({_kingfisherMigration:{legacyFingerprint:e.fingerprint,note:"Kingfisher xxhash — regenerate by running `vis secrets --update-baseline`."},description:"",endColumn:0,endLine:e.linenum,entropy:0,file:e.filepath,match:"",ruleId:"",secret:"",startColumn:0,startLine:e.linenum,tags:[]}),"toPlaceholderEntry"),v5=_r((e,t,r,n,s)=>{const i=_f(e);if(!i)return;const o=D(e,i);let a;try{a=g5(H(o))}catch(u){const p=u instanceof Error?u.message:String(u);ue(n,`Could not parse ${i} as a Kingfisher baseline: ${p}`);return}if(a.length===0){ue(n,`${i} contained no recognisable records — leaving it in place for manual review.`);return}const c=D(e,".secrets-baseline.json");if(j(c)){ue(n,`.secrets-baseline.json already exists — leaving Kingfisher baseline at ${i} for manual merge.`);return}const l=a.map(u=>y5(u));if(t){r.info(`[dry-run] Would convert ${i} -> .secrets-baseline.json (${String(l.length)} placeholder finding(s))`),ye(n,"Run `vis secrets --update-baseline` after migration — Kingfisher xxhash fingerprints aren't interchangeable with our content-hash.");return}we(o,n),qe(c,`${JSON.stringify(l,null,vr(c,void 0,{defaultIndent:" ",useEditorconfig:s}))}
|
|
1122
|
+
`),r.info(`Converted ${i} -> .secrets-baseline.json (${String(l.length)} placeholder finding(s))`),ye(n,"Run `vis secrets --update-baseline` — the converted entries are placeholders until the scanner computes real fingerprints."),at(n,"kingfisher","rewrittenScriptCount")},"migrateBaseline"),f1=/\bkingfisher(?:\s+(?:scan|validate|rules|update|manage-baseline|report|github|gitlab|bitbucket))?\b[^\n&|;]*/g,b5=_r((e,t,r,n,s)=>{const i=D(e,"package.json");if(!j(i))return;const o=rt(i);if(!o)return;const a=cl(e),c=a?`vis secrets --config ${a}`:"vis secrets";let l=!1;if(o.scripts)for(const[p,f]of Object.entries(o.scripts)){if(typeof f!="string"||!/\bkingfisher\b/.test(f))continue;const m=f.replaceAll(f1,$=>$.includes("validate")?`${c} --validate`:c).trim();m!==f&&(o.scripts[p]=m,l=!0,r.info(` scripts.${p}: "${f}" -> "${m}"`),at(n,"kingfisher","rewrittenScriptCount"))}if(o.devDependencies){const p=o.devDependencies;for(const f of["kingfisher","@mongodb/kingfisher","kingfisher-scanner"])f in p&&(delete p[f],l=!0,at(n,"kingfisher","removedPackageCount"),r.info(` removed devDependency: ${f}`))}if(!l)return;if(t){r.info(`[dry-run] Would update ${i}`);return}const u=vr(i,H(i),{defaultIndent:" ",useEditorconfig:s});we(i,n),qe(i,`${JSON.stringify(o,null,u)}
|
|
1123
|
+
`)},"rewriteScripts"),$5=_r((e,t,r,n)=>{const s=cl(e),i=s?`vis secrets --staged --config ${s}`:"vis secrets --staged";for(const o of h1){const a=D(e,o);if(!j(a))continue;const c=H(a);if(!/\bkingfisher\b/.test(c))continue;const l=c.replaceAll(f1,i);if(t){r.info(`[dry-run] Would rewrite ${a}`);continue}we(a,n),qe(a,l),n.gitHooksConfigured=!0,r.info(`Rewrote kingfisher invocation in ${o}`)}},"rewriteHooks"),h1=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"],rg=_r(e=>{if(!j(e))return!1;try{return/\bkingfisher\b/.test(H(e))}catch{return!1}},"hasKingfisherRef"),ng=_r((e,t,r,n)=>{const s=_f(e),i=cl(e),o=rg(D(e,"package.json")),a=h1.some(c=>rg(D(e,c)));return(s??i)||o||a?(i&&(r.info(`Found custom Kingfisher ruleset at ${i} — keeping it for now.`),ye(n,`Convert ${i} to gitleaks-shaped JSON using \`packages/tooling/secret-scanner/scripts/kingfisher-converter.mjs\`, then point \`vis secrets --config\` at the result.`)),s&&v5(e,t.dryRun,r,n,t.useEditorconfig),b5(e,t.dryRun,r,n,t.useEditorconfig),$5(e,t.dryRun,r,n),ye(n,"Replace `# kingfisher:ignore` markers with `# secret-scanner:allow` (or keep `# gitleaks:allow` — the scanner accepts both)."),ye(n,"Review CI workflows (.github/workflows/*.yml) for Kingfisher action/docker invocations — replace with `vis secrets`."),!0):(t.silent||r.info("No Kingfisher artifacts found — nothing to migrate."),!1)},"migrateKingfisher");var w5=Object.defineProperty,pt=d((e,t)=>w5(e,"name",{value:t,configurable:!0}),"r$c");const k5=/\bstaged\s*:/,sg=/(defineConfig\(\{)/,ig=/(export\s+default\s+\{)/;pt(e=>Pf.some(t=>j(D(e,t))),"hasStandaloneLintStagedConfig");const S5=pt(e=>{for(const r of r1)if(j(D(e,r)))return!0;const t=D(e,".lintstagedrc");return j(t)&&!li(t)},"hasUnsupportedLintStagedConfig"),D5=pt(e=>{const t=Hn(e);if(!t)return!1;const r=H(t);return k5.test(r)},"hasStagedConfigInVisConfig"),m1=pt(e=>{const t=D(e,"package.json");if(j(t)&&rt(t)?.["lint-staged"])return"package.json";for(const r of Pf)if(j(D(e,r)))return r},"detectLintStagedConfig"),C5=pt(e=>rt(D(e,"package.json"))?.["lint-staged"],"extractLintStagedFromPackageJson"),E5=pt(e=>rt(e),"parseLintStagedJsonFile"),up=pt(e=>` staged: {
|
|
1124
1124
|
${Object.entries(e).map(([t,r])=>{const n=Array.isArray(r)?`[${r.map(s=>JSON.stringify(s)).join(", ")}]`:JSON.stringify(r);return` ${JSON.stringify(t)}: ${n}`}).join(`,
|
|
1125
1125
|
`)},
|
|
1126
|
-
}`,"generateStagedConfigSnippet"),
|
|
1126
|
+
}`,"generateStagedConfigSnippet"),j5=pt((e,t,r)=>{const n=Hn(e);if(n){const o=H(n),a=up(t);let c;return sg.test(o)?c=o.replace(sg,`$1
|
|
1127
1127
|
${a},`):ig.test(o)&&(c=o.replace(ig,`$1
|
|
1128
1128
|
${a},`)),c?(we(n),Oe(n,c,"utf8"),r.info(`Merged staged config into ${n}`),!0):(r.warn(`Could not auto-insert staged config into ${n} — please add manually`),!1)}const s=D(e,"vis.config.ts"),i=`import { defineConfig } from "@visulima/vis/config";
|
|
1129
1129
|
|
|
1130
1130
|
export default defineConfig({
|
|
1131
1131
|
${up(t)},
|
|
1132
1132
|
});
|
|
1133
|
-
`;return Oe(s,i,"utf8"),r.info(`Created ${s} with staged config`),!0},"insertStagedIntoVisConfig")
|
|
1134
|
-
`,"utf8")}return n},"removeLintStagedFromPackageJson"),
|
|
1135
|
-
`);let i=!1;const o=[];for(const a of s){const c=a.trim();if(!i){let l=!1;for(const u of
|
|
1136
|
-
`)),!0):!1},"rewritePreCommitHook"),
|
|
1137
|
-
`)},"renderVisConfig"),
|
|
1133
|
+
`;return Oe(s,i,"utf8"),r.info(`Created ${s} with staged config`),!0},"insertStagedIntoVisConfig"),A5=pt((e,t)=>{const r=D(e,"package.json"),n={configRemoved:!1,dependencyRemoved:!1};if(!j(r))return n;const s=H(r),i=JSON.parse(s);let o=!1;i["lint-staged"]&&(delete i["lint-staged"],o=!0,n.configRemoved=!0);const a=i.devDependencies,c=i.dependencies;if(a?.["lint-staged"]&&(delete a["lint-staged"],o=!0,n.dependencyRemoved=!0),c?.["lint-staged"]&&(delete c["lint-staged"],o=!0,n.dependencyRemoved=!0),o){const l=Xo(r,s,{useEditorconfig:t});we(r),Oe(r,`${JSON.stringify(i,void 0,l)}
|
|
1134
|
+
`,"utf8")}return n},"removeLintStagedFromPackageJson"),x5=pt((e,t)=>{for(const r of Pf){const n=D(e,r);j(n)&&(we(n,t),Jn(n),t.removedConfigCount+=1)}},"removeLintStagedConfigFiles"),O5=pt((e,t)=>{const r=D(e,t,"pre-commit");if(!j(r))return!1;const n=H(r);if(n.includes("vis staged"))return!1;const s=n.split(`
|
|
1135
|
+
`);let i=!1;const o=[];for(const a of s){const c=a.trim();if(!i){let l=!1;for(const u of _4){const p=u.exec(c);if(p){const f=a.slice(0,a.length-a.trimStart().length),m=p[1]?.trim()??"",$=c.slice(p[0].length).trim(),b=[m,"vis staged",$].filter(Boolean);o.push(`${f}${b.join(" ")}`),i=!0,l=!0;break}}if(l)continue}o.push(a)}return i?(we(r),Oe(r,o.join(`
|
|
1136
|
+
`)),!0):!1},"rewritePreCommitHook"),P5=pt((e,t,r)=>{if(t==="package.json")return C5(e);const n=D(e,t);if(!t1.includes(t)){ue(r,`${t} cannot be auto-migrated — please add "staged" config to vis.config.ts manually`),ye(r,`Manually convert ${t} to staged config in vis.config.ts`);return}if(t===".lintstagedrc"&&!li(n)){ue(r,".lintstagedrc is not JSON format — please migrate manually");return}return E5(n)},"extractConfig"),g1=pt((e,t,r)=>{const{configRemoved:n,dependencyRemoved:s}=A5(e,r);n&&(t.inlinedLintStagedConfigCount+=1),s&&(t.removedPackageCount+=1),x5(e,t)},"cleanupLintStagedArtifacts"),F5=pt((e,t,r,n)=>{const s=[".vis-hooks",".husky"];for(const i of s)j(D(e,i))&&O5(e,i)&&(n.gitHooksConfigured=!0,t.silent||r.info(`Rewrote pre-commit hook in ${i}/ to use "vis staged"`))},"rewriteHooks"),B5=pt((e,t,r,n,s)=>{j5(e,t,n)&&(s.mergedStagedConfigCount+=1),g1(e,s,r.useEditorconfig),F5(e,r,n,s)},"applyMigration"),og=pt((e,t,r,n)=>{const s=m1(e);if(!s)return t.silent||r.info("No lint-staged configuration found — nothing to migrate."),!1;if(S5(e)&&(ue(n,'Non-JSON lint-staged config found — please migrate to "staged" in vis.config.ts manually'),ye(n,"Convert your lint-staged config file to JSON format or add staged config to vis.config.ts manually")),D5(e))return ue(n,'vis.config.ts already has a "staged" config — skipping lint-staged merge'),t.silent||r.warn('vis.config.ts already has a "staged" config — skipping'),t.dryRun||g1(e,n,t.useEditorconfig),!0;const i=P5(e,s,n);return!i||Object.keys(i).length===0?(t.silent||r.warn("lint-staged config is empty — skipping"),!1):t.dryRun?(t.silent||(r.info("[dry-run] Would insert staged config into vis.config.ts:"),r.info(up(i))),!0):(B5(e,i,t,r,n),!0)},"migrateLintStaged");var R5=Object.defineProperty,Mf=d((e,t)=>R5(e,"name",{value:t,configurable:!0}),"o$f");const Wf=Mf((e,t,r)=>{const n=t?vr(t,void 0,{defaultIndent:" ",useEditorconfig:r}):" ";return JSON.stringify(e,null,n).replaceAll(/"(\w+)":/g,"$1:")},"serializeConfigObject"),Vf=Mf((e,t,r,n,s)=>{const i=D(e,"vis.config.ts"),o=j(i);return o&&!r.dryRun&&!r.force?(n.warn("vis.config.ts already exists — refusing to overwrite. Re-run with --force to replace it (a .bak is taken first), or run with --dry-run to preview."),s.warnings.push("vis.config.ts already exists; migration skipped writing the file. Re-run with --force to overwrite."),!1):(r.dryRun?(n.info("── vis.config.ts (preview) ──"),n.info(t),n.info("── end preview ──")):(o&&r.force&&(we(i,s),n.info(`Replacing ${i} (backup at ${i}.bak)`)),qe(i,t),n.info(`Wrote ${i}`)),!0)},"writeVisConfig"),y1=Mf((e,t)=>{const r=D(e,t);if(j(r))try{return JSON.parse(H(r))}catch(n){throw new Error(`Failed to parse ${r}: ${n.message}`,{cause:n})}},"readJsonConfig");var T5=Object.defineProperty,ui=d((e,t)=>T5(e,"name",{value:t,configurable:!0}),"l$a");const N5=ui(e=>{const t={};return e.command&&(t.command=Array.isArray(e.args)?`${e.command} ${e.args.join(" ")}`:e.args?`${e.command} ${e.args}`:e.command),e.deps&&e.deps.length>0&&(t.dependsOn=e.deps),e.inputs&&e.inputs.length>0&&(t.inputs=e.inputs),e.outputs&&e.outputs.length>0&&(t.outputs=e.outputs),e.type&&(t.type=e.type),e.preset&&(t.preset=e.preset),e.options&&(t.options=e.options),t},"taskToVisTarget"),I5=ui((e,t,r)=>{const n={};e.fileGroups&&(n.fileGroups=e.fileGroups);const s={};for(const[i,o]of Object.entries(e.tasks??{}))s[i]=N5(o);return Object.keys(s).length>0&&(n.tasks=s),e.implicitInputs&&e.implicitInputs.length>0&&(n.namedInputs={default:e.implicitInputs}),["// Migrated from moon's .moon/tasks.yml by `vis migrate moon`.","// Per-project moon.yml files can be converted to project.json —","// review the generated file and move project-specific tasks there.","",'import { defineConfig } from "@visulima/vis/config";',"",`export default defineConfig(${Wf(n,D(t,"vis.config.ts"),r)});`,""].join(`
|
|
1137
|
+
`)},"renderVisConfig"),L5=ui(e=>{const t=D(e,".moon");if(!j(t))return;for(const n of["tasks.yml","tasks.yaml"]){const s=D(t,n);if(j(s))return s}const r=D(t,"tasks");if(j(r)){const n=Ze(r).filter(s=>s.endsWith(".yml")||s.endsWith(".yaml")).sort();if(n.length>0)return D(r,n[0])}},"findMoonTasksFile"),_5=ui(e=>{const t=D(e,".moon","templates");if(!j(t))return[];const r=[];try{for(const n of Ze(t,{withFileTypes:!0}))n.isDirectory()&&j(D(t,n.name,"template.yml"))&&r.push(n.name)}catch{}return r.sort()},"findMoonTemplates"),M5=ui((e,t,r,n,s)=>{const i=D(e,".moon","templates"),o=D(e,".vis","templates");r||Yk(o,{recursive:!0});for(const a of t){const c=D(i,a),l=D(o,a);if(j(l)){s.warnings.push(`Template "${a}" already exists at .vis/templates/${a} — left untouched. Remove or rename either copy to resolve.`);continue}if(r){n.info(`Would copy .moon/templates/${a} → .vis/templates/${a}`);continue}try{Xk(c,l,{recursive:!0}),n.info(`Copied .moon/templates/${a} → .vis/templates/${a}`)}catch(u){const p=u instanceof Error?u.message:String(u);s.warnings.push(`Failed to copy template "${a}": ${p}`)}}!r&&t.length>0&&s.manualSteps.push(`Copied ${String(t.length)} template${t.length===1?"":"s"} from .moon/templates/ to .vis/templates/. Remove the .moon/templates/ directory when ready.`)},"copyMoonTemplatesToVis"),ag=ui((e,t,r,n)=>{const s=L5(e);if(!s){r.warn("No .moon/tasks.yml (or .moon/tasks/<scope>.yml) found — nothing to migrate."),n.warnings.push("No moon tasks file at workspace root.");return}let i;try{i=Lt(s)}catch(l){throw new Error(`Failed to parse ${s}: ${l.message}`,{cause:l})}for(const[l,u]of Object.entries(i.tasks??{}))u.env&&Object.keys(u.env).length>0&&n.warnings.push(`Task "${l}" has an \`env\` block which vis does not support — set environment variables in the command or a wrapper script.`),u.platform&&n.warnings.push(`Task "${l}" has a \`platform\` field ("${u.platform}") which vis does not support — review and remove.`),u.toolchain&&n.warnings.push(`Task "${l}" has a \`toolchain\` field ("${u.toolchain}") which vis does not support — review and remove.`),Array.isArray(u.args)&&u.args.some(p=>p.includes(" "))&&n.warnings.push(`Task "${l}" has \`args\` entries containing spaces — vis flattens args into the command string so quoting may need manual adjustment.`);i.extends&&i.extends.length>0&&n.warnings.push("`extends` was found in the moon config but has no direct vis equivalent — inline the referenced files or use vis's `scopedTasks` blocks."),i.implicitDeps&&i.implicitDeps.length>0&&n.warnings.push("`implicitDeps` was found in the moon config but has no direct vis equivalent — add explicit `dependsOn` entries in project.json instead."),i.taskOptions&&Object.keys(i.taskOptions).length>0&&n.warnings.push("`taskOptions` was found in the moon config but has no direct vis equivalent — review and apply settings per-target in vis.config.ts.");const o=I5(i,e,t.useEditorconfig);if(!Vf(e,o,t,r,n))return;n.manualSteps.push("moon's per-project `moon.yml` files should be converted to `project.json`. vis reads targets, tags, layer, stack, language, and owners from project.json — the field names match."),n.manualSteps.push("Scoped `.moon/tasks/<scope>.yml` files map to vis's `scopedTasks` with a `match` block. Only the first scope file was parsed — review the generated file."),n.manualSteps.push("vis tasks support `when: { os, env, branch, ci, not.* }` for conditional execution and `always: true` for cleanup tasks that fire even when upstream fails. Review tasks that used moon's `local: true`, `options.runInCI`, or shell-based platform gating — the new surface is more expressive and may simplify them. See docs/guides/conditional-and-finally-tasks.mdx.");const a=_5(e);if(a.length===0)return;const c=a.map(l=>`"${l}"`).join(", ");t.copyTemplates?M5(e,a,!!t.dryRun,r,n):n.manualSteps.push(`Detected ${String(a.length)} template${a.length===1?"":"s"} under .moon/templates/ (${c}). They are already usable via \`vis generate <name>\` — vis auto-discovers moon-format template directories at runtime. To decouple from moon entirely, re-run \`vis migrate moon --copy-templates\` to physically move them to .vis/templates/.`)},"migrateMoon");var W5=Object.defineProperty,dt=d((e,t)=>W5(e,"name",{value:t,configurable:!0}),"r$b");const V5=/\bstaged\s*:/,cg=/(defineConfig\(\{)/,lg=/(export\s+default\s+\{)/;dt(e=>Ff.some(t=>j(D(e,t))),"hasStandaloneNanoStagedConfig");const U5=dt(e=>{for(const r of s1)if(j(D(e,r)))return!0;const t=D(e,".nanostagedrc");return j(t)&&!li(t)},"hasUnsupportedNanoStagedConfig"),G5=dt(e=>{const t=Hn(e);return t?V5.test(H(t)):!1},"hasStagedConfigInVisConfig"),v1=dt(e=>{const t=D(e,"package.json");if(j(t)&&rt(t)?.["nano-staged"])return"package.json";for(const r of Ff)if(j(D(e,r)))return r},"detectNanoStagedConfig"),q5=dt(e=>rt(D(e,"package.json"))?.["nano-staged"],"extractNanoStagedFromPackageJson"),H5=dt(e=>rt(e),"parseNanoStagedJsonFile"),pp=dt(e=>` staged: {
|
|
1138
1138
|
${Object.entries(e).map(([t,r])=>{const n=Array.isArray(r)?`[${r.map(s=>JSON.stringify(s)).join(", ")}]`:JSON.stringify(r);return` ${JSON.stringify(t)}: ${n}`}).join(`,
|
|
1139
1139
|
`)},
|
|
1140
|
-
}`,"generateStagedConfigSnippet"),
|
|
1140
|
+
}`,"generateStagedConfigSnippet"),z5=dt((e,t,r)=>{const n=Hn(e);if(n){const o=H(n),a=pp(t);let c;return cg.test(o)?c=o.replace(cg,`$1
|
|
1141
1141
|
${a},`):lg.test(o)&&(c=o.replace(lg,`$1
|
|
1142
1142
|
${a},`)),c?(we(n),Oe(n,c,"utf8"),r.info(`Merged staged config into ${n}`),!0):(r.warn(`Could not auto-insert staged config into ${n} — please add manually`),!1)}const s=D(e,"vis.config.ts"),i=`import { defineConfig } from "@visulima/vis/config";
|
|
1143
1143
|
|
|
1144
1144
|
export default defineConfig({
|
|
1145
1145
|
${pp(t)},
|
|
1146
1146
|
});
|
|
1147
|
-
`;return Oe(s,i,"utf8"),r.info(`Created ${s} with staged config`),!0},"insertStagedIntoVisConfig"),
|
|
1148
|
-
`,"utf8")}return n},"removeNanoStagedFromPackageJson"),
|
|
1149
|
-
`);let i=!1;const o=[];for(const a of s){const c=a.trim();if(!i){let l=!1;for(const u of
|
|
1150
|
-
`)),!0):!1},"rewritePreCommitHook"),
|
|
1151
|
-
`)},"renderVisConfig"),uu=/node_modules\/nx\/schemas\/project-schema\.json$/u,Z5=Pe((e,t,r,n)=>{let s=0;for(const i of e){if(t.dryRun){const o=Uf(i);o?.$schema&&uu.test(o.$schema)&&(r.info(`Would rewrite $schema in ${i}`),s+=1);continue}Gn(i,o=>{if(!(!o.$schema||!uu.test(o.$schema)))return o.$schema=o.$schema.replace(uu,"node_modules/@visulima/vis/schemas/project.schema.json"),o},n,{useEditorconfig:t.useEditorconfig})&&(s+=1)}return s>0&&r.info(`Rewrote $schema in ${String(s)} project.json file(s).`),s},"rewriteProjectJsonSchemas"),Uf=Pe(e=>{if(j(e))try{return JSON.parse(H(e))}catch{return}},"readProjectJsonSafe"),eW=Pe(e=>{const t=new Map,r=new Set;for(const n of e){const s=Uf(n);if(!s?.name)continue;r.add(s.name);const i=D(Je(n),"package.json");if(j(i))try{const o=JSON.parse(H(i));o.name&&o.name!==s.name&&t.set(o.name,s.name)}catch{}}return{knownProjects:r,pkgToProject:t}},"discoverPackageToProjectMap"),tW=/&&|\|\||[;|><`]|\$\(/u,rW=/[*[\]^.]/u,pu=Pe((e,t)=>{if(t===""){e.complex=!0;return}if(t.startsWith("!")){e.hasExclusion=!0;return}if(rW.test(t)||t.includes("...")){e.hasGlob=!0;return}e.filters.push(t)},"collectFilterValue"),nW=Pe(e=>{if(typeof e!="string"||e.trim()===""||tW.test(e)||/['"]/u.test(e))return null;const t=e.trim().split(/\s+/u);if(t[0]!=="pnpm"&&t[0]!=="pnpm.cmd")return null;const r={complex:!1,filters:[],hasExclusion:!1,hasGlob:!1,parallel:!1,recursive:!1,target:""};let n=1;for(;n<t.length;){const s=t[n];if(s==="--filter"||s==="-F"){const i=t[n+1];if(i===void 0)return r.complex=!0,r;pu(r,i),n+=2;continue}if(s.startsWith("--filter=")){pu(r,s.slice(9)),n+=1;continue}if(s.startsWith("-F=")){pu(r,s.slice(3)),n+=1;continue}if(s==="--parallel"){r.parallel=!0,n+=1;continue}if(s==="-r"||s==="--recursive"){r.recursive=!0,n+=1;continue}if(s==="--workspace-root"||s==="-w")return r.complex=!0,r;if(s==="run"||s==="exec"){if(s==="exec")return r.complex=!0,r;n+=1;continue}return s.startsWith("-")?(r.complex=!0,r):(r.target=s,n+=1,n<t.length&&(r.complex=!0),r)}return r.complex=!0,r},"parsePnpmFilterCommand"),sW=Pe((e,t)=>{const r=[],n=[];for(const s of e){const i=t.pkgToProject.get(s);if(i!==void 0){r.push(i);continue}if(t.knownProjects.has(s)){r.push(s);continue}n.push(s)}return{mapped:r,unmapped:n}},"mapFiltersToProjects"),iW=Pe((e,t)=>{const r=["vis","run",e.target];if(t.length>0){const n=[...t].sort((s,i)=>s.localeCompare(i)).join(",");r.push(`--projects=${n}`)}return r.join(" ")},"renderVisRunScript"),oW=new Set(["dev","dev:server","dev:watch","serve","start:dev","storybook","watch"]),aW=Pe((e,t,r,n,s)=>{const i={rewrittenTargets:new Set,unmappedHits:[]},o=D(e,"package.json");if(!j(o))return i;let a;try{a=JSON.parse(H(o))}catch{return i}if(!a.scripts)return i;const c=new Map;for(const[l,u]of Object.entries(a.scripts)){const p=nW(u);if(!p||p.target===""||p.complex)continue;if(p.hasExclusion||p.hasGlob){s.warnings.push(`pnpm filter in scripts.${l} uses ${p.hasExclusion?"an exclusion (!)":"a glob/dependency selector"} — left untouched. Translate by hand to \`vis run ${p.target} --projects=...\` once you decide which projects should be selected.`);continue}if(p.filters.length===0&&!p.recursive)continue;const f=sW(p.filters,t);if(f.unmapped.length>0){i.unmappedHits.push({filters:f.unmapped,script:l});continue}const m=iW(p,f.mapped);m!==u&&(c.set(l,m),i.rewrittenTargets.add(p.target))}if(c.size===0)return i;if(r.dryRun){for(const[l,u]of c){const p=a.scripts[l];n.info(`Would rewrite scripts.${l}: \`${p??""}\` → \`${u}\``)}return i}return Gn(o,l=>{if(!l.scripts)return;const u={...l.scripts};let p=!1;for(const[f,m]of c)u[f]!==void 0&&u[f]!==m&&(u[f]=m,p=!0);if(p)return l.scripts=u,l},s,{useEditorconfig:r.useEditorconfig}),n.info(`Rewrote ${String(c.size)} pnpm-filter script(s) in package.json to use \`vis run\`.`),i},"applyPnpmFilterScriptRewrites"),cW=Pe((e,t,r)=>{let n=e.targetDefaults??{},s=!1;for(const i of t){if(!oW.has(i))continue;const o={...n[i]??{}};let a=!1;o.persistent!==!0&&(o.persistent=!0,a=!0),o.cache!==!1&&(o.cache=!1,a=!0),a&&(n={...n,[i]:o},s=!0,r.manualSteps.push(`tasks.${i} set to { persistent: true, cache: false } — long-running task auto-detected from rewritten pnpm filter scripts. Adjust if your ${i} is actually short-lived.`))}s&&(e.targetDefaults=n)},"ensurePersistentTargetDefaults"),lW=Pe(e=>{if(e.executor!=="nx:run-script")return!1;const t=Object.keys(e.options??{});return t.length===0||t.length===1&&t[0]==="script"},"isNxRunScriptShim"),uW=Pe((e,t,r,n)=>{let s=0,i=0,o=0;const a=[];for(const c of e){const l=Uf(c);if(!l?.targets||Object.keys(l.targets).length===0)continue;const u=l.name??"<unnamed>",p=[],f=[],m=[];for(const[k,S]of Object.entries(l.targets))S.syncGenerators&&S.syncGenerators.length>0&&m.push({sync:[...S.syncGenerators],target:k}),lW(S)?f.push(k):p.push(k);const $=p.length===0&&f.length>0,b=f.length>0;$?(t.dryRun?(r.info(`Would remove targets block from ${c} (all entries are nx:run-script shims).`),s+=1):(Gn(c,k=>{if(k.targets)return delete k.targets,k},n,{useEditorconfig:t.useEditorconfig}),s+=1),m.length>0&&a.push({file:c,name:u,nonShimTargets:[],syncGenerators:m})):b?(t.dryRun?r.info(`Would strip ${String(f.length)} nx:run-script shim entr(y/ies) from ${c} (non-shim entries kept: ${p.join(", ")}).`):Gn(c,k=>{if(k.targets){for(const S of f)delete k.targets[S];return k}},n,{useEditorconfig:t.useEditorconfig}),i+=1,o+=f.length,a.push({file:c,name:u,nonShimTargets:p,syncGenerators:m})):a.push({file:c,name:u,nonShimTargets:p,syncGenerators:m})}return s>0&&r.info(`Removed targets block from ${String(s)} project.json file(s) (entries were nx:run-script shims).`),o>0&&!t.dryRun&&r.info(`Stripped ${String(o)} nx:run-script shim entr(y/ies) across ${String(i)} project.json file(s) (non-shim entries remain for manual review).`),{droppedTargetBlocks:s,partialTargetBlocks:i,punchList:a,strippedShimEntries:o}},"translateProjectJsonTargets"),pW=Pe((e,t,r,n)=>{const s=D(e,"pnpm-workspace.yaml");if(!j(s))return{catalogEntriesRemoved:0,onlyBuiltRemoved:!1};let i;try{i=Lt(s)}catch{return{catalogEntriesRemoved:0,onlyBuiltRemoved:!1}}if(!i||typeof i!="object")return{catalogEntriesRemoved:0,onlyBuiltRemoved:!1};let o=0;const a=Pe(f=>f==="nx"||f.startsWith("@nx/"),"isNxKey"),c=Pe((f,m,$)=>{if(!f||typeof f!="object")return;const b=Object.keys(f).length,k=Object.fromEntries(Object.entries(f).filter(([y])=>!a(y))),S=b-Object.keys(k).length;S>0&&(o+=S,m[$]=k)},"stripBucketInto");c(i.catalog,i,"catalog");const l=i.catalogs;if(l&&typeof l=="object")for(const[f,m]of Object.entries(l))c(m,l,f);let u=!1;const p=i.onlyBuiltDependencies;if(Array.isArray(p)){const f=p.filter(m=>m!=="nx");f.length!==p.length&&(i.onlyBuiltDependencies=f,u=!0)}return(o>0||u)&&(t.dryRun?(o>0&&r.info(`Would remove ${String(o)} nx-related catalog entr(y/ies) from pnpm-workspace.yaml.`),u&&r.info("Would remove `nx` from pnpm-workspace.yaml#onlyBuiltDependencies.")):(we(s,n),No(s,i),o>0&&r.info(`Removed ${String(o)} nx-related catalog entr(y/ies) from pnpm-workspace.yaml.`),u&&r.info("Removed `nx` from pnpm-workspace.yaml#onlyBuiltDependencies."))),{catalogEntriesRemoved:o,onlyBuiltRemoved:u}},"cleanPnpmWorkspaceYaml"),dW=Pe((e,t,r,n,s,i,o)=>{const a=D(Je(e),"package.json");if(!j(a))return{reason:"no sibling package.json"};const c=`pre${r}`,l=`echo "TODO(vis): replace with logic equivalent to nx syncGenerators: ${n.join(", ")}" && exit 1`;if(s.dryRun){let p;try{p=JSON.parse(H(a)).scripts}catch{return{reason:"package.json unreadable"}}return p?.[c]?{reason:`\`${c}\` script already exists in ${bt(t,a)}`}:(i.info(`Would add \`${c}\` script to ${bt(t,a)} (TODO for nx syncGenerators: ${n.join(", ")}).`),{pkgPath:bt(t,a),preScript:c})}let u;return Gn(a,p=>{if(p.scripts?.[c]){u=`\`${c}\` script already exists in ${bt(t,a)}`;return}return p.scripts={...p.scripts??{},[c]:l},p},o,{useEditorconfig:s.useEditorconfig})?(i.info(`Added \`${c}\` script (TODO) to ${bt(t,a)} — wire up replacement for: ${n.join(", ")}.`),{pkgPath:bt(t,a),preScript:c}):{reason:u??"package.json unwritable"}},"rewriteSyncGeneratorToPreScript"),fW=/^nx\s+(?:run-many|run|affected|reset|repair)\b|^nx\s+exec\b/u,hW=new Set(["affected","exec","repair","reset","run","run-many"]),mW=Pe((e,t)=>{const r=e.trim();if(/[;&|]|"|'/u.test(r))return;const n=/^nx\s+run-many\s+(?:-t|--target=?)\s*([\w:-]+)\s*$/u.exec(r);if(n)return`vis run ${n[1]}`;const s=/^nx\s+affected\s+(?:-t|--target=?)\s*([\w:-]+)\s*$/u.exec(r);if(s)return`vis run ${s[1]} --affected`;const i=/^nx\s+run\s+([\w@/-]+):([\w:-]+)\s*$/u.exec(r);if(i?.[1]&&i[2]&&t.has(i[1]))return`vis run ${i[2]} --projects=${i[1]}`;const o=/^nx\s+([\w:-]+)\s*$/u.exec(r);if(o?.[1]&&!hW.has(o[1]))return`vis run ${o[1]}`},"rewriteNxScript"),gW=Pe((e,t,r,n,s)=>{const i={deletedFiles:[],rewrittenScripts:[],skippedScripts:[],strippedDevDeps:[]},o=D(e,".github","ignore-files-for-nx-affected.yml");if(j(o))if(r.dryRun)n.info(`Would delete ${bt(e,o)}.`),i.deletedFiles.push(bt(e,o));else{we(o,s);try{Jn(o),n.info(`Removed ${bt(e,o)} (backup at \`${bt(e,o)}.bak\`).`),i.deletedFiles.push(bt(e,o))}catch{}}const a=D(e,"package.json");if(!j(a))return i;if(Gn(a,c=>{let l=!1;if(c.devDependencies)for(const u of Object.keys(c.devDependencies))(u==="nx"||u.startsWith("@nx/")||u.startsWith("@nrwl/"))&&(r.dryRun||delete c.devDependencies[u],i.strippedDevDeps.push(u),l=!0);if(c.scripts)for(const[u,p]of Object.entries(c.scripts)){if(typeof p!="string"||!(fW.test(p)||p.startsWith("nx ")))continue;const f=mW(p,t);if(f===void 0){i.skippedScripts.push(u);continue}r.dryRun||(c.scripts[u]=f),i.rewrittenScripts.push({from:p,name:u,to:f}),l=!0}return l?c:void 0},r.dryRun?void 0:s,{useEditorconfig:r.useEditorconfig}),i.strippedDevDeps.length>0){const c=r.dryRun?"Would strip":"Stripped";n.info(`${c} ${String(i.strippedDevDeps.length)} nx-related devDependenc(y/ies) from package.json: ${i.strippedDevDeps.join(", ")}.`)}for(const c of i.rewrittenScripts){const l=r.dryRun?"Would rewrite":"Rewrote";n.info(`${l} \`scripts.${c.name}\`: \`${c.from}\` -> \`${c.to}\``)}return i.skippedScripts.length>0&&s.manualSteps.push(`--aggressive could not rewrite these package.json scripts (they have shell complexity or unknown flags): ${i.skippedScripts.join(", ")}. Rewrite them manually to use \`vis run\`.`),i},"applyAggressiveCleanup"),yW=Pe(e=>{const t={eslintHits:[],ignoreFile:!1,nxJson:!1,pkgDevDeps:[],pkgScripts:[],workflowHits:[]};j(D(e,"nx.json"))&&(t.nxJson=!0),j(D(e,".github/ignore-files-for-nx-affected.yml"))&&(t.ignoreFile=!0);const r=D(e,"package.json");if(j(r))try{const s=JSON.parse(H(r));if(s.devDependencies)for(const i of Object.keys(s.devDependencies))(i==="nx"||i.startsWith("@nx/")||i.startsWith("@nrwl/"))&&t.pkgDevDeps.push(i);if(s.scripts)for(const[i,o]of Object.entries(s.scripts))typeof o=="string"&&(/\bnx\s+(?:run-many|run|affected|exec|reset|repair)\b/u.test(o)||o.startsWith("nx "))&&t.pkgScripts.push(i)}catch{}const n=D(e,".github/workflows");if(j(n))try{for(const s of Ze(n)){if(!s.endsWith(".yml")&&!s.endsWith(".yaml"))continue;const i=D(n,s),o=H(i);/nrwl\/nx-set-shas/u.test(o)&&t.workflowHits.push({file:`.github/workflows/${s}`,reason:"uses nrwl/nx-set-shas action"}),/\bNX_BRANCH\b|\bNX_RUN_GROUP\b/u.test(o)&&t.workflowHits.push({file:`.github/workflows/${s}`,reason:"sets NX_BRANCH / NX_RUN_GROUP env"}),(/--files=\$\{\{[^}]*tj-actions/u.test(o)||/tj-actions\/changed-files/u.test(o))&&t.workflowHits.push({file:`.github/workflows/${s}`,reason:"uses tj-actions/changed-files (no longer needed; vis does its own affected diff)"})}}catch{}for(const s of["eslint.config.mjs","eslint.config.js","eslint.config.cjs","eslint.config.ts",".eslintrc.json",".eslintrc.js"]){const i=D(e,s);if(!j(i))continue;const o=H(i);/@nx\/eslint-plugin|@nx\/enforce-module-boundaries|@nx\/dependency-checks|@nx\/nx-plugin-checks/u.test(o)&&t.eslintHits.push(s)}return t},"collectCleanupChecklist"),vW=Pe((e,t,r)=>{const n=[];if(e.nxJson&&!r.backedUpNxJson&&n.push(`Remove ${D(t,"nx.json")} once you're satisfied with vis.config.ts.`),e.ignoreFile&&n.push("Delete .github/ignore-files-for-nx-affected.yml — vis uses git-based affected diff and has no equivalent."),e.pkgDevDeps.length>0&&n.push(`Remove these nx devDependencies from package.json: ${e.pkgDevDeps.join(", ")}.`),e.pkgScripts.length>0&&n.push(`Rewrite these package.json scripts to use \`vis run\`: ${e.pkgScripts.join(", ")}.`),e.workflowHits.length>0){const s=new Map;for(const i of e.workflowHits){const o=s.get(i.file)??new Set;o.add(i.reason),s.set(i.file,o)}for(const[i,o]of s)n.push(`Update ${i}: ${[...o].join("; ")}.`)}return e.eslintHits.length>0&&n.push(`Remove @nx/eslint-plugin imports + rules (enforce-module-boundaries, dependency-checks, nx-plugin-checks) from: ${e.eslintHits.join(", ")}. There is no vis equivalent yet.`),n.map((s,i)=>`${String(i+1)}. ${s}`)},"formatChecklist"),bW=Pe((e,t)=>{if(e.length!==0){t.info(""),t.info("── Post-migrate cleanup ──");for(const r of e)t.info(r)}},"printChecklist"),pg=Pe((e,t,r,n)=>{t.aggressive&&(t={...t,force:!0,rewriteSyncGenerators:!0});const s=y1(e,"nx.json");if(!s){r.warn("No nx.json found in workspace root — nothing to migrate."),n.warnings.push("No nx.json at workspace root.");return}s.targetDefaults&&(s.targetDefaults=X5(s.targetDefaults,n,r));const i=J5(e),o=eW(i),a=aW(e,o,t,r,n);cW(s,a.rewrittenTargets,n);for(const m of a.unmappedHits)n.warnings.push(`scripts.${m.script}: pnpm filter(s) ${m.filters.map($=>`\`${$}\``).join(", ")} don't match any known project.json#name or sibling package.json#name. Left untouched — fix the filter or add the missing project.json before re-running.`);const c=Q5(s,e,t.useEditorconfig);if(!Vf(e,c,t,r,n))return;Z5(i,t,r,n);const{punchList:l}=uW(i,t,r,n);for(const m of l){m.nonShimTargets.length>0&&n.manualSteps.push(`Review targets in ${bt(e,m.file)} (project: ${m.name}) — non-shim targets need manual review: ${m.nonShimTargets.join(", ")}.`);for(const $ of m.syncGenerators){if(t.rewriteSyncGenerators){const b=dW(m.file,e,$.target,$.sync,t,r,n);if("preScript"in b){n.manualSteps.push(`${b.pkgPath} now has a \`${b.preScript}\` script that fails with a TODO. Replace it with the real equivalent of nx syncGenerators: ${$.sync.join(", ")}.`);continue}n.warnings.push(`syncGenerators on \`${m.name}#${$.target}\` (${bt(e,m.file)}) not auto-rewritten — ${b.reason}. Move ${$.sync.join(", ")} into a \`pre${$.target}\` script in package.json manually.`);continue}n.warnings.push(`syncGenerators on \`${m.name}#${$.target}\` (${bt(e,m.file)}) has no vis equivalent. Move ${$.sync.join(", ")} into a \`pre${$.target}\` script in package.json (or re-run with --rewrite-sync-generators to insert a TODO automatically).`)}}pW(e,t,r,n),t.aggressive&&gW(e,o.knownProjects,t,r,n),n.manualSteps.push("vis adds two task primitives nx doesn't expose declaratively: `when: { os, env, branch, ci, not.* }` for conditional execution (replaces ad-hoc `configurations`) and `always: true` for finally/teardown tasks that run even when upstream fails. See docs/guides/conditional-and-finally-tasks.mdx.");const u=s.affected?.defaultBase??s.defaultBase;typeof u=="string"&&u.length>0&&u!=="main"&&r.info(`Translated nx's default base branch (${u}) into vis.config.ts#defaultBase.`);const p=yW(e),f=vW(p,e,{});if(bW(f,r),t.force&&!t.dryRun&&p.nxJson){const m=D(e,"nx.json");we(m,n);try{Jn(m),r.info(`Removed ${m} (backup at ${m}.bak).`)}catch{}}},"migrateNx");var $W=Object.defineProperty,Tr=d((e,t)=>$W(e,"name",{value:t,configurable:!0}),"a$e");const $1=[".secretlintrc",".secretlintrc.json",".secretlintrc.js",".secretlintrc.mjs",".secretlintrc.cjs",".secretlintrc.yml",".secretlintrc.yaml"],w1=[".secretlintignore"],k1=Tr(e=>$1.find(t=>j(D(e,t))),"detectSecretlintConfig"),S1=Tr(e=>w1.find(t=>j(D(e,t))),"detectSecretlintIgnore"),wW=Tr((e,t,r)=>{if(t.endsWith(".js")||t.endsWith(".mjs")||t.endsWith(".cjs"))return ue(r,`${t} is a JS config — cannot auto-extract rule IDs. Review manually to confirm coverage.`),[];if(t.endsWith(".yml")||t.endsWith(".yaml"))return ue(r,`${t} is YAML — cannot auto-extract rule IDs without a YAML parser. Review manually.`),[];const n=rt(D(e,t));if(!n)return[];const s=new Set,i=Tr(o=>{if(o)for(const a of o)a.id&&s.add(a.id),a.rules&&i(a.rules)},"walk");return i(n.rules),[...s]},"extractRuleIds"),kW=Tr((e,t,r,n)=>{for(const s of[...$1,...w1]){const i=D(e,s);if(j(i)){if(t){r.info(`[dry-run] Would remove ${i}`);continue}we(i,n),Jn(i),at(n,"secretlint","removedConfigCount"),r.info(`Removed ${i}`)}}},"removeSecretlintConfigFiles"),SW=Tr((e,t,r,n)=>{const s=D(e,".secretlintignore");if(!j(s))return;const i=H(s).split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("#"));i.length!==0&&(ye(n,`.secretlintignore contained ${String(i.length)} path pattern(s). vis secrets uses .gitignore + --exclude / --exclude-from; add these globs to your .gitignore or pass --exclude: ${i.slice(0,5).join(", ")}${i.length>5?", ...":""}`),t&&r.info(`[dry-run] Would consume ${s} (${String(i.length)} patterns) and surface as manual step.`))},"convertIgnoreFile"),DW=Tr((e,t,r,n,s)=>{const i=D(e,"package.json");if(!j(i))return;const o=rt(i);if(!o)return;let a=!1;if(o.scripts){for(const[l,u]of Object.entries(o.scripts))if(typeof u=="string"&&/\bsecretlint\b/.test(u)){const p=u.replaceAll(/\bsecretlint\b[^\n&|;]*/g,"vis secrets").trim();p!==u&&(o.scripts[l]=p,a=!0,at(n,"secretlint","rewrittenScriptCount"),r.info(` scripts.${l}: "${u}" -> "${p}"`))}}if(o.devDependencies){const l=o.devDependencies,u=[];for(const p of Object.keys(l))(p==="secretlint"||p.startsWith("@secretlint/"))&&(delete l[p],u.push(p),a=!0,at(n,"secretlint","removedPackageCount"));u.length>0&&r.info(` removed ${String(u.length)} secretlint devDependencies: ${u.join(", ")}`)}if(!a)return;if(t){r.info(`[dry-run] Would update ${i}`);return}const c=vr(i,H(i),{defaultIndent:" ",useEditorconfig:s});we(i,n),qe(i,`${JSON.stringify(o,null,c)}
|
|
1152
|
-
`)},"rewriteScripts"),
|
|
1153
|
-
`,"utf8")}return n},"removeSherifFromPackageJson"),
|
|
1154
|
-
`)){const i=s.trimStart(),o=s.length-i.length;if(o===0&&i.length>0&&!i.startsWith("#")){r=N1(i),r==="catalogs"&&(n="");continue}i.length===0||i.startsWith("#")||(r==="catalog"&&
|
|
1155
|
-
`)){const i=s.trim();if(!i||i.startsWith("#")||i.startsWith(";"))continue;const o=i.indexOf("=");if(o===-1)continue;const a=i.slice(0,o).trim(),c=i.slice(o+1).trim(),l=
|
|
1156
|
-
`),"formatOutdatedMinimal"),
|
|
1147
|
+
`;return Oe(s,i,"utf8"),r.info(`Created ${s} with staged config`),!0},"insertStagedIntoVisConfig"),J5=dt((e,t)=>{const r=D(e,"package.json"),n={configRemoved:!1,dependencyRemoved:!1};if(!j(r))return n;const s=H(r),i=JSON.parse(s);let o=!1;i["nano-staged"]&&(delete i["nano-staged"],o=!0,n.configRemoved=!0);const a=i.devDependencies,c=i.dependencies;if(a?.["nano-staged"]&&(delete a["nano-staged"],o=!0,n.dependencyRemoved=!0),c?.["nano-staged"]&&(delete c["nano-staged"],o=!0,n.dependencyRemoved=!0),o){const l=Xo(r,s,{useEditorconfig:t});we(r),Oe(r,`${JSON.stringify(i,void 0,l)}
|
|
1148
|
+
`,"utf8")}return n},"removeNanoStagedFromPackageJson"),K5=dt((e,t)=>{for(const r of Ff){const n=D(e,r);j(n)&&(we(n,t),Jn(n),t.removedConfigCount+=1)}},"removeNanoStagedConfigFiles"),Y5=dt((e,t)=>{const r=D(e,t,"pre-commit");if(!j(r))return!1;const n=H(r);if(n.includes("vis staged"))return!1;const s=n.split(`
|
|
1149
|
+
`);let i=!1;const o=[];for(const a of s){const c=a.trim();if(!i){let l=!1;for(const u of M4){const p=u.exec(c);if(p){const f=a.slice(0,a.length-a.trimStart().length),m=p[1]?.trim()??"",$=c.slice(p[0].length).trim(),b=[m,"vis staged",$].filter(Boolean);o.push(`${f}${b.join(" ")}`),i=!0,l=!0;break}}if(l)continue}o.push(a)}return i?(we(r),Oe(r,o.join(`
|
|
1150
|
+
`)),!0):!1},"rewritePreCommitHook"),X5=dt((e,t,r)=>{if(t==="package.json")return q5(e);const n=D(e,t);if(!n1.includes(t)){ue(r,`${t} cannot be auto-migrated — please add "staged" config to vis.config.ts manually`),ye(r,`Manually convert ${t} to staged config in vis.config.ts`);return}if(t===".nanostagedrc"&&!li(n)){ue(r,".nanostagedrc is not JSON format — please migrate manually");return}return H5(n)},"extractConfig"),b1=dt((e,t,r)=>{const{configRemoved:n,dependencyRemoved:s}=J5(e,r);n&&(t.inlinedLintStagedConfigCount+=1),s&&(t.removedPackageCount+=1),K5(e,t)},"cleanupNanoStagedArtifacts"),Q5=dt((e,t,r,n)=>{const s=[".vis-hooks",".husky"];for(const i of s)j(D(e,i))&&Y5(e,i)&&(n.gitHooksConfigured=!0,t.silent||r.info(`Rewrote pre-commit hook in ${i}/ to use "vis staged"`))},"rewriteHooks"),Z5=dt((e,t,r,n,s)=>{z5(e,t,n)&&(s.mergedStagedConfigCount+=1),b1(e,s,r.useEditorconfig),Q5(e,r,n,s)},"applyMigration"),ug=dt((e,t,r,n)=>{const s=v1(e);if(!s)return t.silent||r.info("No nano-staged configuration found — nothing to migrate."),!1;if(U5(e)&&(ue(n,'Non-JSON nano-staged config found — please migrate to "staged" in vis.config.ts manually'),ye(n,"Convert your nano-staged config file to JSON format or add staged config to vis.config.ts manually")),G5(e))return ue(n,'vis.config.ts already has a "staged" config — skipping nano-staged merge'),t.silent||r.warn('vis.config.ts already has a "staged" config — skipping'),t.dryRun||b1(e,n,t.useEditorconfig),!0;const i=X5(e,s,n);return!i||Object.keys(i).length===0?(t.silent||r.warn("nano-staged config is empty — skipping"),!1):t.dryRun?(t.silent||(r.info("[dry-run] Would insert staged config into vis.config.ts:"),r.info(pp(i))),!0):(Z5(e,i,t,r,n),!0)},"migrateNanoStaged");var eW=Object.defineProperty,Pe=d((e,t)=>eW(e,"name",{value:t,configurable:!0}),"d$8");const bt=Pe((e,t)=>{const r=zn(e,t);return r.startsWith("..")?t:r.split(Gk).join("/")},"relativeFromRoot"),tW=new Set([".cache",".git",".next",".nx",".output",".svelte-kit",".turbo",".vercel",".vis","build","coverage","dist","node_modules"]),rW=Pe((e,t=8)=>{const r=[],n=Pe((s,i)=>{if(i>t)return;let o;try{o=Ze(s)}catch{return}for(const a of o){if(tW.has(a)||a.startsWith("."))continue;const c=D(s,a);let l;try{l=cr(c)}catch{continue}l.isDirectory()?n(c,i+1):a==="project.json"&&r.push(c)}},"walk");return n(e,0),r},"findProjectJsonFiles"),nW={"@nx/eslint:lint":"lint:eslint","@nx/jest:jest":"test","@nx/js:tsc":"build","@nx/next:build":"build","@nx/playwright:playwright":"test:e2e","@nx/storybook:build":"build-storybook","@nx/vite:build":"build","@nx/vite:test":"test","@nx/webpack:webpack":"build"},sW=["cache","dependsOn","inputs","outputs","persistent"],iW=Pe((e,t,r)=>{const n={};for(const[s,i]of Object.entries(e))s.includes(":")||(n[s]=i);for(const[s,i]of Object.entries(e)){if(!s.includes(":"))continue;const o=nW[s];if(!o){t.warnings.push(`Dropped \`${s}\` from tasks — vis only supports script-name targets, not nx-namespaced executors.`);continue}if(n[o]){t.warnings.push(`Dropped \`${s}\` from tasks — \`${o}\` already has an explicit entry; the explicit one was kept.`);continue}const a={},c=[];for(const u of sW)i[u]!==void 0&&(a[u]=i[u],c.push(u));n[o]=a;const l=c.length>0?`carried ${c.join(", ")}`:"no settings to carry";r?.info(`Translated \`${s}\` → \`${o}\` in tasks (${l}).`)}return n},"translateNamespacedTargetDefaults"),oW=Pe((e,t,r)=>{const n={},s=e.affected?.defaultBase??e.defaultBase;return typeof s=="string"&&s.length>0&&s!=="main"&&(n.defaultBase=s),e.namedInputs&&Object.keys(e.namedInputs).length>0&&(n.namedInputs=e.namedInputs),e.targetDefaults&&Object.keys(e.targetDefaults).length>0&&(n.tasks=e.targetDefaults),["// Migrated from nx.json by `vis migrate nx`.","// Per-project project.json files are compatible with vis and do not need to be rewritten —","// vis already reads targets, tags, implicitDependencies, and sourceRoot.","",'import { defineConfig } from "@visulima/vis/config";',"",`export default defineConfig(${Wf(n,D(t,"vis.config.ts"),r)});`,""].join(`
|
|
1151
|
+
`)},"renderVisConfig"),uu=/node_modules\/nx\/schemas\/project-schema\.json$/u,aW=Pe((e,t,r,n)=>{let s=0;for(const i of e){if(t.dryRun){const o=Uf(i);o?.$schema&&uu.test(o.$schema)&&(r.info(`Would rewrite $schema in ${i}`),s+=1);continue}Gn(i,o=>{if(!(!o.$schema||!uu.test(o.$schema)))return o.$schema=o.$schema.replace(uu,"node_modules/@visulima/vis/schemas/project.schema.json"),o},n,{useEditorconfig:t.useEditorconfig})&&(s+=1)}return s>0&&r.info(`Rewrote $schema in ${String(s)} project.json file(s).`),s},"rewriteProjectJsonSchemas"),Uf=Pe(e=>{if(j(e))try{return JSON.parse(H(e))}catch{return}},"readProjectJsonSafe"),cW=Pe(e=>{const t=new Map,r=new Set;for(const n of e){const s=Uf(n);if(!s?.name)continue;r.add(s.name);const i=D(Je(n),"package.json");if(j(i))try{const o=JSON.parse(H(i));o.name&&o.name!==s.name&&t.set(o.name,s.name)}catch{}}return{knownProjects:r,pkgToProject:t}},"discoverPackageToProjectMap"),lW=/&&|\|\||[;|><`]|\$\(/u,uW=/[*[\]^.]/u,pu=Pe((e,t)=>{if(t===""){e.complex=!0;return}if(t.startsWith("!")){e.hasExclusion=!0;return}if(uW.test(t)||t.includes("...")){e.hasGlob=!0;return}e.filters.push(t)},"collectFilterValue"),pW=Pe(e=>{if(typeof e!="string"||e.trim()===""||lW.test(e)||/['"]/u.test(e))return null;const t=e.trim().split(/\s+/u);if(t[0]!=="pnpm"&&t[0]!=="pnpm.cmd")return null;const r={complex:!1,filters:[],hasExclusion:!1,hasGlob:!1,parallel:!1,recursive:!1,target:""};let n=1;for(;n<t.length;){const s=t[n];if(s==="--filter"||s==="-F"){const i=t[n+1];if(i===void 0)return r.complex=!0,r;pu(r,i),n+=2;continue}if(s.startsWith("--filter=")){pu(r,s.slice(9)),n+=1;continue}if(s.startsWith("-F=")){pu(r,s.slice(3)),n+=1;continue}if(s==="--parallel"){r.parallel=!0,n+=1;continue}if(s==="-r"||s==="--recursive"){r.recursive=!0,n+=1;continue}if(s==="--workspace-root"||s==="-w")return r.complex=!0,r;if(s==="run"||s==="exec"){if(s==="exec")return r.complex=!0,r;n+=1;continue}return s.startsWith("-")?(r.complex=!0,r):(r.target=s,n+=1,n<t.length&&(r.complex=!0),r)}return r.complex=!0,r},"parsePnpmFilterCommand"),dW=Pe((e,t)=>{const r=[],n=[];for(const s of e){const i=t.pkgToProject.get(s);if(i!==void 0){r.push(i);continue}if(t.knownProjects.has(s)){r.push(s);continue}n.push(s)}return{mapped:r,unmapped:n}},"mapFiltersToProjects"),fW=Pe((e,t)=>{const r=["vis","run",e.target];if(t.length>0){const n=[...t].sort((s,i)=>s.localeCompare(i)).join(",");r.push(`--projects=${n}`)}return r.join(" ")},"renderVisRunScript"),hW=new Set(["dev","dev:server","dev:watch","serve","start:dev","storybook","watch"]),mW=Pe((e,t,r,n,s)=>{const i={rewrittenTargets:new Set,unmappedHits:[]},o=D(e,"package.json");if(!j(o))return i;let a;try{a=JSON.parse(H(o))}catch{return i}if(!a.scripts)return i;const c=new Map;for(const[l,u]of Object.entries(a.scripts)){const p=pW(u);if(!p||p.target===""||p.complex)continue;if(p.hasExclusion||p.hasGlob){s.warnings.push(`pnpm filter in scripts.${l} uses ${p.hasExclusion?"an exclusion (!)":"a glob/dependency selector"} — left untouched. Translate by hand to \`vis run ${p.target} --projects=...\` once you decide which projects should be selected.`);continue}if(p.filters.length===0&&!p.recursive)continue;const f=dW(p.filters,t);if(f.unmapped.length>0){i.unmappedHits.push({filters:f.unmapped,script:l});continue}const m=fW(p,f.mapped);m!==u&&(c.set(l,m),i.rewrittenTargets.add(p.target))}if(c.size===0)return i;if(r.dryRun){for(const[l,u]of c){const p=a.scripts[l];n.info(`Would rewrite scripts.${l}: \`${p??""}\` → \`${u}\``)}return i}return Gn(o,l=>{if(!l.scripts)return;const u={...l.scripts};let p=!1;for(const[f,m]of c)u[f]!==void 0&&u[f]!==m&&(u[f]=m,p=!0);if(p)return l.scripts=u,l},s,{useEditorconfig:r.useEditorconfig}),n.info(`Rewrote ${String(c.size)} pnpm-filter script(s) in package.json to use \`vis run\`.`),i},"applyPnpmFilterScriptRewrites"),gW=Pe((e,t,r)=>{let n=e.targetDefaults??{},s=!1;for(const i of t){if(!hW.has(i))continue;const o={...n[i]??{}};let a=!1;o.persistent!==!0&&(o.persistent=!0,a=!0),o.cache!==!1&&(o.cache=!1,a=!0),a&&(n={...n,[i]:o},s=!0,r.manualSteps.push(`tasks.${i} set to { persistent: true, cache: false } — long-running task auto-detected from rewritten pnpm filter scripts. Adjust if your ${i} is actually short-lived.`))}s&&(e.targetDefaults=n)},"ensurePersistentTargetDefaults"),yW=Pe(e=>{if(e.executor!=="nx:run-script")return!1;const t=Object.keys(e.options??{});return t.length===0||t.length===1&&t[0]==="script"},"isNxRunScriptShim"),vW=Pe((e,t,r,n)=>{let s=0,i=0,o=0;const a=[];for(const c of e){const l=Uf(c);if(!l?.targets||Object.keys(l.targets).length===0)continue;const u=l.name??"<unnamed>",p=[],f=[],m=[];for(const[k,S]of Object.entries(l.targets))S.syncGenerators&&S.syncGenerators.length>0&&m.push({sync:[...S.syncGenerators],target:k}),yW(S)?f.push(k):p.push(k);const $=p.length===0&&f.length>0,b=f.length>0;$?(t.dryRun?(r.info(`Would remove targets block from ${c} (all entries are nx:run-script shims).`),s+=1):(Gn(c,k=>{if(k.targets)return delete k.targets,k},n,{useEditorconfig:t.useEditorconfig}),s+=1),m.length>0&&a.push({file:c,name:u,nonShimTargets:[],syncGenerators:m})):b?(t.dryRun?r.info(`Would strip ${String(f.length)} nx:run-script shim entr(y/ies) from ${c} (non-shim entries kept: ${p.join(", ")}).`):Gn(c,k=>{if(k.targets){for(const S of f)delete k.targets[S];return k}},n,{useEditorconfig:t.useEditorconfig}),i+=1,o+=f.length,a.push({file:c,name:u,nonShimTargets:p,syncGenerators:m})):a.push({file:c,name:u,nonShimTargets:p,syncGenerators:m})}return s>0&&r.info(`Removed targets block from ${String(s)} project.json file(s) (entries were nx:run-script shims).`),o>0&&!t.dryRun&&r.info(`Stripped ${String(o)} nx:run-script shim entr(y/ies) across ${String(i)} project.json file(s) (non-shim entries remain for manual review).`),{droppedTargetBlocks:s,partialTargetBlocks:i,punchList:a,strippedShimEntries:o}},"translateProjectJsonTargets"),bW=Pe((e,t,r,n)=>{const s=D(e,"pnpm-workspace.yaml");if(!j(s))return{catalogEntriesRemoved:0,onlyBuiltRemoved:!1};let i;try{i=Lt(s)}catch{return{catalogEntriesRemoved:0,onlyBuiltRemoved:!1}}if(!i||typeof i!="object")return{catalogEntriesRemoved:0,onlyBuiltRemoved:!1};let o=0;const a=Pe(f=>f==="nx"||f.startsWith("@nx/"),"isNxKey"),c=Pe((f,m,$)=>{if(!f||typeof f!="object")return;const b=Object.keys(f).length,k=Object.fromEntries(Object.entries(f).filter(([y])=>!a(y))),S=b-Object.keys(k).length;S>0&&(o+=S,m[$]=k)},"stripBucketInto");c(i.catalog,i,"catalog");const l=i.catalogs;if(l&&typeof l=="object")for(const[f,m]of Object.entries(l))c(m,l,f);let u=!1;const p=i.onlyBuiltDependencies;if(Array.isArray(p)){const f=p.filter(m=>m!=="nx");f.length!==p.length&&(i.onlyBuiltDependencies=f,u=!0)}return(o>0||u)&&(t.dryRun?(o>0&&r.info(`Would remove ${String(o)} nx-related catalog entr(y/ies) from pnpm-workspace.yaml.`),u&&r.info("Would remove `nx` from pnpm-workspace.yaml#onlyBuiltDependencies.")):(we(s,n),No(s,i),o>0&&r.info(`Removed ${String(o)} nx-related catalog entr(y/ies) from pnpm-workspace.yaml.`),u&&r.info("Removed `nx` from pnpm-workspace.yaml#onlyBuiltDependencies."))),{catalogEntriesRemoved:o,onlyBuiltRemoved:u}},"cleanPnpmWorkspaceYaml"),$W=Pe((e,t,r,n,s,i,o)=>{const a=D(Je(e),"package.json");if(!j(a))return{reason:"no sibling package.json"};const c=`pre${r}`,l=`echo "TODO(vis): replace with logic equivalent to nx syncGenerators: ${n.join(", ")}" && exit 1`;if(s.dryRun){let p;try{p=JSON.parse(H(a)).scripts}catch{return{reason:"package.json unreadable"}}return p?.[c]?{reason:`\`${c}\` script already exists in ${bt(t,a)}`}:(i.info(`Would add \`${c}\` script to ${bt(t,a)} (TODO for nx syncGenerators: ${n.join(", ")}).`),{pkgPath:bt(t,a),preScript:c})}let u;return Gn(a,p=>{if(p.scripts?.[c]){u=`\`${c}\` script already exists in ${bt(t,a)}`;return}return p.scripts={...p.scripts??{},[c]:l},p},o,{useEditorconfig:s.useEditorconfig})?(i.info(`Added \`${c}\` script (TODO) to ${bt(t,a)} — wire up replacement for: ${n.join(", ")}.`),{pkgPath:bt(t,a),preScript:c}):{reason:u??"package.json unwritable"}},"rewriteSyncGeneratorToPreScript"),wW=/^nx\s+(?:run-many|run|affected|reset|repair)\b|^nx\s+exec\b/u,kW=new Set(["affected","exec","repair","reset","run","run-many"]),SW=Pe((e,t)=>{const r=e.trim();if(/[;&|]|"|'/u.test(r))return;const n=/^nx\s+run-many\s+(?:-t|--target=?)\s*([\w:-]+)\s*$/u.exec(r);if(n)return`vis run ${n[1]}`;const s=/^nx\s+affected\s+(?:-t|--target=?)\s*([\w:-]+)\s*$/u.exec(r);if(s)return`vis run ${s[1]} --affected`;const i=/^nx\s+run\s+([\w@/-]+):([\w:-]+)\s*$/u.exec(r);if(i?.[1]&&i[2]&&t.has(i[1]))return`vis run ${i[2]} --projects=${i[1]}`;const o=/^nx\s+([\w:-]+)\s*$/u.exec(r);if(o?.[1]&&!kW.has(o[1]))return`vis run ${o[1]}`},"rewriteNxScript"),DW=Pe((e,t,r,n,s)=>{const i={deletedFiles:[],rewrittenScripts:[],skippedScripts:[],strippedDevDeps:[]},o=D(e,".github","ignore-files-for-nx-affected.yml");if(j(o))if(r.dryRun)n.info(`Would delete ${bt(e,o)}.`),i.deletedFiles.push(bt(e,o));else{we(o,s);try{Jn(o),n.info(`Removed ${bt(e,o)} (backup at \`${bt(e,o)}.bak\`).`),i.deletedFiles.push(bt(e,o))}catch{}}const a=D(e,"package.json");if(!j(a))return i;if(Gn(a,c=>{let l=!1;if(c.devDependencies)for(const u of Object.keys(c.devDependencies))(u==="nx"||u.startsWith("@nx/")||u.startsWith("@nrwl/"))&&(r.dryRun||delete c.devDependencies[u],i.strippedDevDeps.push(u),l=!0);if(c.scripts)for(const[u,p]of Object.entries(c.scripts)){if(typeof p!="string"||!(wW.test(p)||p.startsWith("nx ")))continue;const f=SW(p,t);if(f===void 0){i.skippedScripts.push(u);continue}r.dryRun||(c.scripts[u]=f),i.rewrittenScripts.push({from:p,name:u,to:f}),l=!0}return l?c:void 0},r.dryRun?void 0:s,{useEditorconfig:r.useEditorconfig}),i.strippedDevDeps.length>0){const c=r.dryRun?"Would strip":"Stripped";n.info(`${c} ${String(i.strippedDevDeps.length)} nx-related devDependenc(y/ies) from package.json: ${i.strippedDevDeps.join(", ")}.`)}for(const c of i.rewrittenScripts){const l=r.dryRun?"Would rewrite":"Rewrote";n.info(`${l} \`scripts.${c.name}\`: \`${c.from}\` -> \`${c.to}\``)}return i.skippedScripts.length>0&&s.manualSteps.push(`--aggressive could not rewrite these package.json scripts (they have shell complexity or unknown flags): ${i.skippedScripts.join(", ")}. Rewrite them manually to use \`vis run\`.`),i},"applyAggressiveCleanup"),CW=Pe(e=>{const t={eslintHits:[],ignoreFile:!1,nxJson:!1,pkgDevDeps:[],pkgScripts:[],workflowHits:[]};j(D(e,"nx.json"))&&(t.nxJson=!0),j(D(e,".github/ignore-files-for-nx-affected.yml"))&&(t.ignoreFile=!0);const r=D(e,"package.json");if(j(r))try{const s=JSON.parse(H(r));if(s.devDependencies)for(const i of Object.keys(s.devDependencies))(i==="nx"||i.startsWith("@nx/")||i.startsWith("@nrwl/"))&&t.pkgDevDeps.push(i);if(s.scripts)for(const[i,o]of Object.entries(s.scripts))typeof o=="string"&&(/\bnx\s+(?:run-many|run|affected|exec|reset|repair)\b/u.test(o)||o.startsWith("nx "))&&t.pkgScripts.push(i)}catch{}const n=D(e,".github/workflows");if(j(n))try{for(const s of Ze(n)){if(!s.endsWith(".yml")&&!s.endsWith(".yaml"))continue;const i=D(n,s),o=H(i);/nrwl\/nx-set-shas/u.test(o)&&t.workflowHits.push({file:`.github/workflows/${s}`,reason:"uses nrwl/nx-set-shas action"}),/\bNX_BRANCH\b|\bNX_RUN_GROUP\b/u.test(o)&&t.workflowHits.push({file:`.github/workflows/${s}`,reason:"sets NX_BRANCH / NX_RUN_GROUP env"}),(/--files=\$\{\{[^}]*tj-actions/u.test(o)||/tj-actions\/changed-files/u.test(o))&&t.workflowHits.push({file:`.github/workflows/${s}`,reason:"uses tj-actions/changed-files (no longer needed; vis does its own affected diff)"})}}catch{}for(const s of["eslint.config.mjs","eslint.config.js","eslint.config.cjs","eslint.config.ts",".eslintrc.json",".eslintrc.js"]){const i=D(e,s);if(!j(i))continue;const o=H(i);/@nx\/eslint-plugin|@nx\/enforce-module-boundaries|@nx\/dependency-checks|@nx\/nx-plugin-checks/u.test(o)&&t.eslintHits.push(s)}return t},"collectCleanupChecklist"),EW=Pe((e,t,r)=>{const n=[];if(e.nxJson&&!r.backedUpNxJson&&n.push(`Remove ${D(t,"nx.json")} once you're satisfied with vis.config.ts.`),e.ignoreFile&&n.push("Delete .github/ignore-files-for-nx-affected.yml — vis uses git-based affected diff and has no equivalent."),e.pkgDevDeps.length>0&&n.push(`Remove these nx devDependencies from package.json: ${e.pkgDevDeps.join(", ")}.`),e.pkgScripts.length>0&&n.push(`Rewrite these package.json scripts to use \`vis run\`: ${e.pkgScripts.join(", ")}.`),e.workflowHits.length>0){const s=new Map;for(const i of e.workflowHits){const o=s.get(i.file)??new Set;o.add(i.reason),s.set(i.file,o)}for(const[i,o]of s)n.push(`Update ${i}: ${[...o].join("; ")}.`)}return e.eslintHits.length>0&&n.push(`Remove @nx/eslint-plugin imports + rules (enforce-module-boundaries, dependency-checks, nx-plugin-checks) from: ${e.eslintHits.join(", ")}. There is no vis equivalent yet.`),n.map((s,i)=>`${String(i+1)}. ${s}`)},"formatChecklist"),jW=Pe((e,t)=>{if(e.length!==0){t.info(""),t.info("── Post-migrate cleanup ──");for(const r of e)t.info(r)}},"printChecklist"),pg=Pe((e,t,r,n)=>{t.aggressive&&(t={...t,force:!0,rewriteSyncGenerators:!0});const s=y1(e,"nx.json");if(!s){r.warn("No nx.json found in workspace root — nothing to migrate."),n.warnings.push("No nx.json at workspace root.");return}s.targetDefaults&&(s.targetDefaults=iW(s.targetDefaults,n,r));const i=rW(e),o=cW(i),a=mW(e,o,t,r,n);gW(s,a.rewrittenTargets,n);for(const m of a.unmappedHits)n.warnings.push(`scripts.${m.script}: pnpm filter(s) ${m.filters.map($=>`\`${$}\``).join(", ")} don't match any known project.json#name or sibling package.json#name. Left untouched — fix the filter or add the missing project.json before re-running.`);const c=oW(s,e,t.useEditorconfig);if(!Vf(e,c,t,r,n))return;aW(i,t,r,n);const{punchList:l}=vW(i,t,r,n);for(const m of l){m.nonShimTargets.length>0&&n.manualSteps.push(`Review targets in ${bt(e,m.file)} (project: ${m.name}) — non-shim targets need manual review: ${m.nonShimTargets.join(", ")}.`);for(const $ of m.syncGenerators){if(t.rewriteSyncGenerators){const b=$W(m.file,e,$.target,$.sync,t,r,n);if("preScript"in b){n.manualSteps.push(`${b.pkgPath} now has a \`${b.preScript}\` script that fails with a TODO. Replace it with the real equivalent of nx syncGenerators: ${$.sync.join(", ")}.`);continue}n.warnings.push(`syncGenerators on \`${m.name}#${$.target}\` (${bt(e,m.file)}) not auto-rewritten — ${b.reason}. Move ${$.sync.join(", ")} into a \`pre${$.target}\` script in package.json manually.`);continue}n.warnings.push(`syncGenerators on \`${m.name}#${$.target}\` (${bt(e,m.file)}) has no vis equivalent. Move ${$.sync.join(", ")} into a \`pre${$.target}\` script in package.json (or re-run with --rewrite-sync-generators to insert a TODO automatically).`)}}bW(e,t,r,n),t.aggressive&&DW(e,o.knownProjects,t,r,n),n.manualSteps.push("vis adds two task primitives nx doesn't expose declaratively: `when: { os, env, branch, ci, not.* }` for conditional execution (replaces ad-hoc `configurations`) and `always: true` for finally/teardown tasks that run even when upstream fails. See docs/guides/conditional-and-finally-tasks.mdx.");const u=s.affected?.defaultBase??s.defaultBase;typeof u=="string"&&u.length>0&&u!=="main"&&r.info(`Translated nx's default base branch (${u}) into vis.config.ts#defaultBase.`);const p=CW(e),f=EW(p,e,{});if(jW(f,r),t.force&&!t.dryRun&&p.nxJson){const m=D(e,"nx.json");we(m,n);try{Jn(m),r.info(`Removed ${m} (backup at ${m}.bak).`)}catch{}}},"migrateNx");var AW=Object.defineProperty,Tr=d((e,t)=>AW(e,"name",{value:t,configurable:!0}),"a$e");const $1=[".secretlintrc",".secretlintrc.json",".secretlintrc.js",".secretlintrc.mjs",".secretlintrc.cjs",".secretlintrc.yml",".secretlintrc.yaml"],w1=[".secretlintignore"],k1=Tr(e=>$1.find(t=>j(D(e,t))),"detectSecretlintConfig"),S1=Tr(e=>w1.find(t=>j(D(e,t))),"detectSecretlintIgnore"),xW=Tr((e,t,r)=>{if(t.endsWith(".js")||t.endsWith(".mjs")||t.endsWith(".cjs"))return ue(r,`${t} is a JS config — cannot auto-extract rule IDs. Review manually to confirm coverage.`),[];if(t.endsWith(".yml")||t.endsWith(".yaml"))return ue(r,`${t} is YAML — cannot auto-extract rule IDs without a YAML parser. Review manually.`),[];const n=rt(D(e,t));if(!n)return[];const s=new Set,i=Tr(o=>{if(o)for(const a of o)a.id&&s.add(a.id),a.rules&&i(a.rules)},"walk");return i(n.rules),[...s]},"extractRuleIds"),OW=Tr((e,t,r,n)=>{for(const s of[...$1,...w1]){const i=D(e,s);if(j(i)){if(t){r.info(`[dry-run] Would remove ${i}`);continue}we(i,n),Jn(i),at(n,"secretlint","removedConfigCount"),r.info(`Removed ${i}`)}}},"removeSecretlintConfigFiles"),PW=Tr((e,t,r,n)=>{const s=D(e,".secretlintignore");if(!j(s))return;const i=H(s).split(/\r?\n/).map(o=>o.trim()).filter(o=>o&&!o.startsWith("#"));i.length!==0&&(ye(n,`.secretlintignore contained ${String(i.length)} path pattern(s). vis secrets uses .gitignore + --exclude / --exclude-from; add these globs to your .gitignore or pass --exclude: ${i.slice(0,5).join(", ")}${i.length>5?", ...":""}`),t&&r.info(`[dry-run] Would consume ${s} (${String(i.length)} patterns) and surface as manual step.`))},"convertIgnoreFile"),FW=Tr((e,t,r,n,s)=>{const i=D(e,"package.json");if(!j(i))return;const o=rt(i);if(!o)return;let a=!1;if(o.scripts){for(const[l,u]of Object.entries(o.scripts))if(typeof u=="string"&&/\bsecretlint\b/.test(u)){const p=u.replaceAll(/\bsecretlint\b[^\n&|;]*/g,"vis secrets").trim();p!==u&&(o.scripts[l]=p,a=!0,at(n,"secretlint","rewrittenScriptCount"),r.info(` scripts.${l}: "${u}" -> "${p}"`))}}if(o.devDependencies){const l=o.devDependencies,u=[];for(const p of Object.keys(l))(p==="secretlint"||p.startsWith("@secretlint/"))&&(delete l[p],u.push(p),a=!0,at(n,"secretlint","removedPackageCount"));u.length>0&&r.info(` removed ${String(u.length)} secretlint devDependencies: ${u.join(", ")}`)}if(!a)return;if(t){r.info(`[dry-run] Would update ${i}`);return}const c=vr(i,H(i),{defaultIndent:" ",useEditorconfig:s});we(i,n),qe(i,`${JSON.stringify(o,null,c)}
|
|
1152
|
+
`)},"rewriteScripts"),BW=Tr((e,t,r,n)=>{const s=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"];for(const i of s){const o=D(e,i);if(!j(o))continue;const a=H(o);if(!/\bsecretlint\b/.test(a))continue;const c=a.replaceAll(/\bsecretlint\b[^\n&|;]*/g,"vis secrets --staged");if(t){r.info(`[dry-run] Would rewrite ${o}`);continue}we(o,n),qe(o,c),n.gitHooksConfigured=!0,r.info(`Rewrote secretlint invocation in ${i}`)}},"rewriteHooks"),dg=Tr((e,t,r,n)=>{const s=k1(e),i=S1(e);if(!(s??i))return t.silent||r.info("No secretlint artifacts found — nothing to migrate."),!1;if(s){const o=xW(e,s,n);r.info(`Found ${s}`),o.length>0?(r.info(` active rules/presets: ${o.join(", ")}`),ye(n,`secretlint used these rules: ${o.join(", ")}. vis secrets ships the gitleaks ruleset (177 rules covering AWS/GCP/Azure/GitHub/Slack/Stripe and more). Verify parity before removing secretlint.`)):ye(n,`Rule IDs could not be auto-extracted from ${s}. Verify that the bundled gitleaks ruleset covers your secretlint rule set.`)}return PW(e,t.dryRun,r,n),FW(e,t.dryRun,r,n,t.useEditorconfig),BW(e,t.dryRun,r,n),OW(e,t.dryRun,r,n),!0},"migrateSecretlint");var RW=Object.defineProperty,zt=d((e,t)=>RW(e,"name",{value:t,configurable:!0}),"c$8");const du="sherif",ll=/\bsherif\b/,dp={"empty-dependencies":"empty-deps","multiple-dependency-versions":"workspace-versions","non-existant-packages":"dead-workspace-patterns","packages-without-package-json":"missing-package-json","root-package-dependencies":"root-deps","root-package-manager-field":"root-package-manager","root-package-private-field":"root-private","types-in-dependencies":"types-in-deps","unordered-dependencies":void 0,"unsync-similar-dependencies":"similar-deps"},TW=Object.values(dp).filter(e=>e!==void 0),D1=zt(e=>{const t=D(e,"package.json");return j(t)&&rt(t)?.sherif?"package.json":void 0},"detectSherifConfig"),C1=zt(e=>{const t=D(e,"package.json");if(!j(t))return!1;const r=rt(t);if(!r)return!1;if(r.devDependencies?.sherif||r.dependencies?.sherif)return!0;if(r.scripts){for(const n of Object.values(r.scripts))if(typeof n=="string"&&ll.test(n))return!0}return!1},"detectSherifInstallation"),NW=zt(e=>rt(D(e,"package.json"))?.sherif,"extractSherifFromPackageJson"),E1=zt((e,t)=>{const r={unmapped:[],visDisabled:[]};if(!Array.isArray(e["ignore-rules"]))return r;for(const n of e["ignore-rules"]){if(typeof n!="string"||n.length===0)continue;const s=dp[n];if(s===void 0){n==="unordered-dependencies"?ue(t,"sherif rule `unordered-dependencies` has no `vis lint` equivalent — vis covers ordering via `vis sort-package-json` (separate command). No migration needed; skip running it if you don't want it."):Object.hasOwn(dp,n)?r.unmapped.push(n):ue(t,`sherif rule \`${n}\` is unknown to vis migrate — skipped.`);continue}r.visDisabled.push(s)}return r},"translateIgnoreRules"),j1=zt(e=>{const t=TW.filter(r=>!e.includes(r));return t.length===0?"vis lint":`vis lint ${t.map(r=>`--${r}`).join(" ")}`},"buildPositiveLintCommand"),IW=zt((e,t)=>{const r=D(e,"package.json"),n={configRemoved:!1,dependencyRemoved:!1,removedScripts:[],scriptCount:0};if(!j(r))return n;const s=H(r),i=JSON.parse(s);let o=!1;i.sherif&&(delete i.sherif,o=!0,n.configRemoved=!0);for(const c of["dependencies","devDependencies"]){const l=i[c];l?.sherif&&(delete l.sherif,o=!0,n.dependencyRemoved=!0)}const a=i.scripts;if(a){const c={};for(const[l,u]of Object.entries(a))typeof u=="string"&&ll.test(u)?(n.scriptCount+=1,n.removedScripts.push({name:l,value:u}),o=!0):c[l]=u;n.scriptCount>0&&(Object.keys(c).length===0?delete i.scripts:i.scripts=c)}if(o){const c=Xo(r,s,{useEditorconfig:t});we(r),Oe(r,`${JSON.stringify(i,void 0,c)}
|
|
1153
|
+
`,"utf8")}return n},"removeSherifFromPackageJson"),LW=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"],_W=[".github/workflows",".gitlab-ci.yml",".circleci/config.yml",".woodpecker.yml",".drone.yml"],A1=zt((e,t)=>{const r=[];for(const n of LW){const s=D(e,n);j(s)&&ll.test(H(s))&&(r.push(n),ye(t,`Update ${n} — replace \`sherif\` invocation with \`vis lint\`.`))}return r},"detectHookReferences"),x1=zt((e,t)=>{const r=[],n=zt(s=>{const i=D(e,s);j(i)&&ll.test(H(i))&&(r.push(s),ye(t,`Update ${s} — replace \`sherif\` invocation with \`vis lint\`.`))},"scanFile");for(const s of _W){const i=D(e,s);if(j(i)){if(s===".github/workflows"){try{for(const o of Ze(i))(o.endsWith(".yml")||o.endsWith(".yaml"))&&n(`.github/workflows/${o}`)}catch{}continue}n(s)}}return r},"detectCiReferences"),MW=zt((e,t,r,n,s)=>{const i=E1(t,s);if(i.visDisabled.length>0){const f=j1(i.visDisabled);ye(s,`sherif's \`ignore-rules\` was set to [${i.visDisabled.map(m=>JSON.stringify(m)).join(", ")}] (vis names). vis has no global rule-disable; replace any \`sherif\` script with the explicit positive list: \`${f}\`.`)}i.unmapped.length>0&&ue(s,`sherif rule(s) [${i.unmapped.map(f=>JSON.stringify(f)).join(", ")}] could not be mapped — please re-evaluate manually.`),Array.isArray(t["ignore-dependencies"])&&t["ignore-dependencies"].length>0&&ye(s,`sherif's \`ignore-dependencies\` was set to [${t["ignore-dependencies"].map(f=>JSON.stringify(f)).join(", ")}]. Mirror this in vis.config.ts under \`policy.workspaceVersions.ignore\`, \`policy.customTypes.ignore\`, \`policy.typesInDeps.ignore\` (and \`policy.redefineRoot.ignore\`) for the lints where it applies.`),Array.isArray(t["ignore-packages"])&&t["ignore-packages"].length>0&&(ue(s,`sherif's \`ignore-packages\` was set to [${t["ignore-packages"].map(f=>JSON.stringify(f)).join(", ")}] — vis has no global package-skip yet (only per-rule scoping via policy.bannedDeps.{packages,paths}). Tracked alongside the dep filter work.`),ye(s,"Re-evaluate sherif `ignore-packages` — vis has no equivalent global filter yet.")),Array.isArray(t["ignore-paths"])&&t["ignore-paths"].length>0&&(ue(s,`sherif's \`ignore-paths\` was set to [${t["ignore-paths"].map(f=>JSON.stringify(f)).join(", ")}] — vis has no global path-skip yet.`),ye(s,"Re-evaluate sherif `ignore-paths` — vis has no equivalent global filter yet."));const o=A1(e,s);o.length>0&&!r.silent&&n.warn(`Found sherif reference in ${String(o.length)} hook file(s) — see manualSteps for details.`);const a=x1(e,s);a.length>0&&!r.silent&&n.warn(`Found sherif reference in ${String(a.length)} CI file(s) — see manualSteps for details.`);const{configRemoved:c,dependencyRemoved:l,removedScripts:u,scriptCount:p}=IW(e,r.useEditorconfig);if(c&&!r.silent&&n.info("Removed `sherif` block from package.json"),c&&at(s,du,"removedConfigCount"),l&&at(s,du,"removedPackageCount"),p>0){at(s,du,"rewrittenScriptCount",p);for(const{name:f,value:m}of u)ye(s,`Recreate script \`${f}\` (removed; was \`${m}\`). Replace \`sherif\` with \`vis lint\` (sherif's lint surface ≈ \`vis lint\`).`);r.silent||n.info(`Removed ${String(p)} script(s) referencing \`sherif\`. Replace with \`vis lint\`.`)}},"applyMigration"),fg=zt((e,t,r,n)=>{const s=D1(e),i=C1(e);if(!s&&!i)return t.silent||r.info("No sherif configuration or installation found — nothing to migrate."),!1;const o=NW(e)??{};if(t.dryRun){const a=E1(o,n);if(A1(e,n),x1(e,n),!t.silent&&(s&&r.info("[dry-run] Would remove `sherif` block from package.json"),i&&r.info("[dry-run] Would strip `sherif` from devDependencies/scripts"),a.visDisabled.length>0)){const c=j1(a.visDisabled);r.info(`[dry-run] Suggested replacement script: ${c}`)}return!0}return MW(e,o,t,r,n),!0},"migrateSherif");var WW=Object.defineProperty,VW=d((e,t)=>WW(e,"name",{value:t,configurable:!0}),"o$e");const UW=VW(e=>{const t=new Map;for(const r of e)for(const[n,s]of r){const i=t.get(n);if(!i){t.set(n,{...s,alerts:[...s.alerts]});continue}const o=new Set(i.alerts.map(c=>c.key)),a=s.alerts.filter(c=>!o.has(c.key));t.set(n,{...i,alerts:[...i.alerts,...a],author:i.author.length>0?i.author:s.author,license:i.license||s.license,size:i.size||s.size})}return t},"mergeReports");var GW=Object.defineProperty,O1=d((e,t)=>GW(e,"name",{value:t,configurable:!0}),"a$d");const qW=O1((e,t={})=>{const{disabled:r,minimumScore:n}=t,s=[];if(!r?.has("socket")){const o=l9(e?.socket,{minimumScore:n});o&&s.push(o)}if(!r?.has("deps-dev")){const o=AL(e?.depsDev);o&&s.push(o)}if(!r?.has("snyk")){const o=JL(e?.snyk);o&&s.push(o)}const i=e?.primaryProvider;return i&&s.length>1&&s.sort((o,a)=>o.id===i?-1:a.id===i?1:0),s},"buildEnabledProviders"),P1=O1(async(e,t)=>{if(e.length===0||t.length===0)return new Map;const r=(await Promise.allSettled(e.map(n=>n.fetchReports(t)))).map(n=>n.status==="fulfilled"?n.value:new Map);return UW(r)},"fetchAllReports");var HW=Object.defineProperty,T=d((e,t)=>HW(e,"name",{value:t,configurable:!0}),"c$7");const zW=/^([\^~]|>=|<=|[><=])/,JW=/^(?:'([^']+)'|"([^"]+)"|([^:\s]+)):\s*(?:'([^']+)'|"([^"]+)"|(\S+))/,KW=/^catalog:/m,YW=/^catalogs:/m,XW=/^(@[^:]+):registry$/,QW=/^\/\/(.+)\/:_authToken$/,ZW=/\*+/g,eV=/[.+^${}()|[\]\\]/g,hg=/[.*+?^${}()|[\]\\]/g,F1=/^['"]|['"]$/g,tV=/^https?:\/\//,Gf=/\/$/,rV=/\n(\s+)/,fp=["dependencies","devDependencies","optionalDependencies"],nV=new Set([...fp,"overrides","peerDependencies","pnpm.overrides","resolutions"]),ul=T(e=>{const t=Ig("vis",{create:!0,cwd:e});if(!t)throw new Error("Cannot resolve cache directory. Ensure node_modules exists in your workspace. Run your package manager's install command first.");return D(t,"backup")},"getBackupDir"),jt=T(e=>{const t=e.replace(/^[\^~]|^>=|^<=|^[><]/,""),r=Fs.parse(t);if(r)return{major:r.major,minor:r.minor,patch:r.patch,prerelease:Array.isArray(r.prerelease)?r.prerelease.join("."):String(r.prerelease??"")};const n=Fs.coerce(e);if(n)return{major:n.major,minor:n.minor,patch:n.patch,prerelease:""}},"parseVersion"),pl=T(e=>zW.exec(e)?.[1]??"","extractPrefix"),mg=T(e=>{if(!e.prerelease)return"";const t=e.prerelease.split(".")[0]??"";return/^\d+$/.test(t)?"":t},"extractChannel"),B1=T((e,t,r)=>r==="any"?!0:r==="same"?mg(e)===mg(t):e.prerelease==="","matchesReleaseChannel"),sV=T(e=>{const t=`${String(e.major)}.${String(e.minor)}.${String(e.patch)}`;return e.prerelease?`${t}-${e.prerelease}`:t},"versionToString"),qf=T((e,t)=>e.major!==t.major?"major":e.minor!==t.minor?"minor":e.patch!==t.patch||e.prerelease!==t.prerelease?"patch":"none","getUpdateType"),iV=T((e,t)=>e.major!==t.major?e.major-t.major:e.minor!==t.minor?e.minor-t.minor:e.patch!==t.patch?e.patch-t.patch:!e.prerelease&&t.prerelease?1:e.prerelease&&!t.prerelease?-1:e.prerelease&&t.prerelease?e.prerelease<t.prerelease?-1:e.prerelease>t.prerelease?1:0:0,"compareVersions"),Us=T((e,t)=>iV(t,e)>0,"isNewer"),qn=T((e,t)=>{const r=t.replaceAll(ZW,"*").replaceAll(eV,String.raw`\$&`);return new RegExp(`^${r.replaceAll("*",".*").replaceAll("?",".")}$`).test(e)},"matchesPattern"),Hf=T((e,t,r)=>r.some(n=>qn(e,n))?!1:t.length>0?t.some(n=>qn(e,n)):!0,"matchesFilters"),R1=T(e=>{const t=JW.exec(e);if(!t)return;const r=t[1]??t[2]??t[3],n=t[4]??t[5]??t[6];if(!(!r||!n))return[r,n]},"parseYamlEntry"),T1=T((e,t,r,n)=>{e.has(t)||e.set(t,new Map);const s=e.get(t);s&&s.set(r,n)},"setCatalogEntry"),oV=T((e,t,r)=>{if(r<2)return;const n=R1(t);n&&T1(e,"default",n[0],n[1])},"parseCatalogSection"),aV=T((e,t,r,n)=>{if(r===2&&t.endsWith(":"))return t.slice(0,-1).trim().replaceAll(F1,"");if(r>=4&&n){const s=R1(t);s&&T1(e,n,s[0],s[1])}return n},"parseCatalogsSection"),N1=T(e=>e==="catalog:"||e.startsWith("catalog:")?"catalog":e==="catalogs:"||e.startsWith("catalogs:")?"catalogs":"none","detectTopLevelSection"),I1=T(e=>{const t=new Map;let r="none",n="";for(const s of e.split(`
|
|
1154
|
+
`)){const i=s.trimStart(),o=s.length-i.length;if(o===0&&i.length>0&&!i.startsWith("#")){r=N1(i),r==="catalogs"&&(n="");continue}i.length===0||i.startsWith("#")||(r==="catalog"&&oV(t,i,o),r==="catalogs"&&(n=aV(t,i,o,n)))}return t},"parseCatalogsFromYaml"),cV=T(e=>{const t=D(e,"pnpm-workspace.yaml");if(!j(t))return!1;const r=H(t);return KW.test(r)||YW.test(r)},"hasPnpmCatalogs"),lV=T(e=>{const t=D(e,"pnpm-workspace.yaml");if(!j(t))return new Map;const r=H(t);return I1(r)},"readPnpmCatalogs"),L1=T(e=>{if(j(e))try{return le(e)}catch{return}},"readPackageJsonSafe"),uV=T(e=>{const t=L1(D(e,"package.json"));return!!(t?.workspaces?.catalog||t?.workspaces?.catalogs)},"hasBunCatalogs"),_1=T(e=>{const t=new Map;if(e.workspaces?.catalog&&typeof e.workspaces.catalog=="object"&&t.set("default",new Map(Object.entries(e.workspaces.catalog))),e.workspaces?.catalogs&&typeof e.workspaces.catalogs=="object")for(const[r,n]of Object.entries(e.workspaces.catalogs))n&&typeof n=="object"&&t.set(r,new Map(Object.entries(n)));return t},"parseBunCatalogs"),pV=T(e=>{const t=L1(D(e,"package.json"));return t?_1(t):new Map},"readBunCatalogs"),pi=T(e=>{const t=e.lastIndexOf(":");if(t===-1)return;const r=e.slice(t+1);if(nV.has(r))return{depType:r,relativePath:e.slice(0,t)}},"parseCompositeCatalogName"),M1=T(e=>e?.dev?["devDependencies"]:e?.prod?["dependencies"]:e?.depFields&&e.depFields.length>0?e.depFields:e?.peer?[...fp,"peerDependencies"]:fp,"getDepTypesToInclude"),dV=T((e,t,r)=>{const n=new Set;t&&n.add(t);for(const s of r){const i=D(e,s,"package.json");if(j(i))try{const o=le(i);o.name&&n.add(o.name)}catch{}}return n},"collectInternalPackageNames"),zf=T((e,t)=>{const r=t.split(".");let n=e;for(const s of r)if(n&&typeof n=="object")n=n[s];else return;return typeof n=="object"&&n!==null?n:void 0},"getNestedField"),fV=T((e,t,r,n)=>{const s=t.split(".");let i=e;for(const a of s.slice(0,-1))(!i[a]||typeof i[a]!="object")&&(i[a]={}),i=i[a];const o=s.at(-1);(!i[o]||typeof i[o]!="object")&&(i[o]={}),i[o][r]=n},"setNestedField"),hV=T((e,t)=>{const r=new Map;for(const[n,s]of Object.entries(e))t.has(n)||s.startsWith("workspace:")||s.startsWith("file:")||s.startsWith("link:")||s.startsWith("catalog:")||s.startsWith("$")||r.set(n,s);return r},"filterExternalDeps"),mV=T((e,t,r,n,s,i)=>{const o=t==="."?r:D(e,t,"package.json");if(!j(o))return;let a;try{a=le(o)}catch{return}for(const c of n){const l=c.includes(".")?zf(a,c):a[c];if(!l||typeof l!="object")continue;const u=hV(l,s);u.size>0&&i.set(`${t}:${c}`,u)}},"scanDirectoryDeps"),W1=T((e,t)=>{const r=new Map,n=D(e,"package.json");if(!j(n))return r;const s=le(n);let i=[];const o=ci(e);if(o)i=ln(e,o);else{const u=s.workspaces;if(u){const p=Array.isArray(u)?u:u.packages;p&&(i=ln(e,p))}}const a=t?.includeInternal?new Set:dV(e,s.name,i),c=M1(t),l=[".",...i];for(const u of l)mV(e,u,n,c,a,r);return r},"readPackageJsonDeps"),Pa=T(e=>{const t=D(e,"package.json");if(!j(t))return!1;try{const r=le(t);return!!(r.dependencies||r.devDependencies||r.peerDependencies||r.optionalDependencies||r.overrides||r.resolutions||zf(r,"pnpm.overrides"))}catch{return!1}},"hasPackageJsonDeps"),hp=T((e,t,r)=>{const n=new Map;for(const s of t){const i=pi(s.catalogName);if(!i)continue;const o=i.relativePath==="."?D(e,"package.json"):D(e,i.relativePath,"package.json");n.has(o)||n.set(o,[]);const a=n.get(o);a&&a.push({depType:i.depType,newRange:s.newRange,packageName:s.packageName})}for(const[s,i]of n){const o=le(s);for(const{depType:a,newRange:c,packageName:l}of i)a.includes(".")?fV(o,a,l,c):o[a]&&(o[a][l]=c);wo(s,o,{indent:Of(s,{useEditorconfig:r}),overwrite:!0})}},"applyPackageJsonUpdates"),gV=T((e,t)=>t==="bun"?uV(e)||Pa(e):t==="npm"||t==="yarn"?Pa(e):cV(e)||Pa(e),"hasCatalogs"),yV=T((e,t,r)=>{let n;t==="bun"?n=pV(e):t==="npm"||t==="yarn"?n=new Map:n=lV(e);const s=W1(e,r);for(const[i,o]of s)n.has(i)||n.set(i,o);return n},"readCatalogs"),vV=T((e,t)=>{const r=new Map;for(const n of t){const s=D(e,n,"package.json");if(j(s))try{const i=le(s);i.name&&i.version&&r.set(i.name,i.version)}catch{}}return r},"collectInternalPackageVersions"),bV=T((e,t)=>{const r=D(e,"package.json");if(!j(r))return{ignored:[],outdated:[]};const n=le(r);let s=[];const i=ci(e);if(i)s=ln(e,i);else{const b=n.workspaces;if(b){const k=Array.isArray(b)?b:b.packages;k&&(s=ln(e,k))}}const o=vV(e,s);if(o.size===0)return{ignored:[],outdated:[]};const a=M1(t),c=[".",...s],l=t?.include??[],u=t?.exclude??[],p=t?.ignore??[],f=t?.target??"latest",m=new Set,$=[];for(const b of c){const k=b==="."?r:D(e,b,"package.json");if(!j(k))continue;let S;try{S=le(k)}catch{continue}for(const y of a){const h=y.includes(".")?zf(S,y):S[y];if(!(!h||typeof h!="object"))for(const[v,w]of Object.entries(h)){const g=o.get(v);if(!g||w.startsWith("workspace:")||w.startsWith("file:")||w.startsWith("link:")||w.startsWith("catalog:")||w.startsWith("$")||w==="*")continue;if(p.some(V=>qn(v,V))){m.add(v);continue}if(!Hf(v,l,u))continue;const E=jt(w),C=jt(g);if(!E||!C||!Us(E,C))continue;const A=qf(E,C);if(A==="none")continue;const O=Kf(v,f,t?.packageMode);if(O==="patch"&&A!=="patch"||O==="minor"&&A==="major")continue;const I=pl(w);$.push({catalogName:`${b}:${y}`,currentRange:w,newRange:`${I}${g}`,packageName:v,targetVersion:g,updateType:A})}}}return{ignored:[...m],outdated:$}},"collectInternalOutdated"),mp=T(e=>{const t=new Map,r=new Map;let n="https://registry.npmjs.org";for(const s of e.split(`
|
|
1155
|
+
`)){const i=s.trim();if(!i||i.startsWith("#")||i.startsWith(";"))continue;const o=i.indexOf("=");if(o===-1)continue;const a=i.slice(0,o).trim(),c=i.slice(o+1).trim(),l=XW.exec(a);if(l?.[1]){t.set(l[1],c);continue}if(a==="registry"){n=c;continue}const u=QW.exec(a);u?.[1]&&r.set(u[1],c)}return{authTokens:r,defaultRegistry:n,registries:t}},"parseNpmrc"),$V=T((e,t)=>({authTokens:new Map([...e.authTokens,...t.authTokens]),defaultRegistry:t.defaultRegistry==="https://registry.npmjs.org"?e.defaultRegistry:t.defaultRegistry,registries:new Map([...e.registries,...t.registries])}),"mergeNpmrcConfigs"),wV=T(e=>{const t={authTokens:new Map,defaultRegistry:"https://registry.npmjs.org",registries:new Map},r=process.env.HOME??process.env.USERPROFILE??"",n=D(r,".npmrc");let s=r&&j(n)?mp(H(n)):t;const i=D(e,".npmrc");return j(i)&&(s=$V(s,mp(H(i)))),s},"loadNpmrc"),Jf=T((e,t)=>{let r=t.defaultRegistry;if(e.startsWith("@")){const s=e.split("/")[0];if(s&&t.registries.has(s)){const i=t.registries.get(s);i&&(r=i)}}const n=r.replace(tV,"").replace(Gf,"");return{token:t.authTokens.get(n),url:r}},"getRegistryForPackage"),V1=15e3,U1=T(async(e,t,r=V1,n=!1)=>{const s=`${(t?.url??"https://registry.npmjs.org").replace(Gf,"")}/${e}`,i=n?{Accept:"application/json"}:{Accept:"application/vnd.npm.install-v1+json"};t?.authToken&&(i.Authorization=`Bearer ${t.authToken}`);const o=new AbortController,a=setTimeout(()=>{o.abort()},r);try{const c=await fetch(s,{headers:i,signal:o.signal});if(!c.ok)throw new Error(`Failed to fetch ${e}: ${String(c.status)} ${c.statusText}`);const l=await c.json(),u={latest:l["dist-tags"]?.latest??"",versions:Object.keys(l.versions??{})};return n&&l.time&&(u.publishTimes=new Map(Object.entries(l.time))),u}finally{clearTimeout(a)}},"fetchPackageVersions"),kV=T(e=>{const t=e.database_specific?.severity?.toUpperCase();if(t==="CRITICAL"||t==="HIGH"||t==="MODERATE"||t==="LOW")return t;const r=e.severity?.find(n=>n.type==="CVSS_V3")?.score;if(r){const n=Number.parseFloat(r);return n>=9?"CRITICAL":n>=7?"HIGH":n>=4?"MODERATE":"LOW"}return"UNKNOWN"},"mapOsvSeverity"),SV=T(e=>{const t=e.severity?.find(r=>r.type==="CVSS_V3")?.score;return t?Number.parseFloat(t):void 0},"mapOsvCvss"),DV=T(e=>{const t=[];for(const r of e.affected??[])for(const n of r.ranges??[])for(const s of n.events??[])s.fixed&&t.push(s.fixed);return t},"mapOsvFixedVersions"),CV=T(e=>({aliases:e.aliases?.length?e.aliases:void 0,cvssScore:SV(e),fixedVersions:DV(e),id:e.id,severity:kV(e),summary:e.summary??""}),"mapOsvVuln"),G1=T(async(e,t=1e4)=>{if(e.length===0)return new Map;const r=e.map(i=>({package:{ecosystem:"npm",name:i.name},version:i.version})),n=new AbortController,s=setTimeout(()=>{n.abort()},t);try{const i=await fetch("https://api.osv.dev/v1/querybatch",{body:JSON.stringify({queries:r}),headers:{"Content-Type":"application/json"},method:"POST",signal:n.signal});if(!i.ok)return new Map;const o=await i.json(),a=new Map;for(const[c,l]of e.entries()){const u=o.results[c]?.vulns;u&&u.length>0&&a.set(l.name,u.map(p=>CV(p)))}return a}catch{return new Map}finally{clearTimeout(s)}},"fetchVulnerabilities"),gg=new Map,Kf=T((e,t,r)=>{if(!r)return t;const n=r[e];if(n!==void 0)return n;for(const[s,i]of Object.entries(r))if(s!==e){if(s.startsWith("/")&&s.endsWith("/")){let o=gg.get(s);if(o||(o=new RegExp(s.slice(1,-1)),gg.set(s,o)),o.test(e))return i}else if(qn(e,s))return i}return t},"resolvePackageTarget"),q1=T((e,t,r)=>{const n=t?.get(e);return n?Date.now()-new Date(n).getTime()<r:!1},"isTooNew"),EV=T(e=>e?.minimumReleaseAge?e.packageName&&e.minimumReleaseAgeExclude?.some(t=>qn(e.packageName,t))?0:e.minimumReleaseAge*60*1e3:0,"resolveMinAgeMs"),H1=T((e,t)=>t??(e?"any":"stable"),"resolveReleaseChannel"),fu=T((e,t,r,n,s,i,o)=>{const a=H1(r,o);return e.map(c=>({parsed:jt(c),raw:c})).filter(c=>!c.parsed||!B1(c.parsed,t,a)||!Us(t,c.parsed)||n&&q1(c.raw,s,n)?!1:i?i(c.parsed):!0).toSorted((c,l)=>Fs.rcompare(c.raw,l.raw))[0]?.raw},"filterCandidates"),z1=T((e,t,r,n,s,i,o)=>{const a=jt(r);if(!a)return;const c=EV(i),l=H1(s,o);if(n==="latest"){const p=jt(t);return p?B1(p,a,l)?Us(a,p)?!c||!q1(t,i?.publishTimes,c)?t:fu(e,a,s,c,i?.publishTimes,void 0,l):void 0:fu(e,a,s,c,i?.publishTimes,void 0,l):void 0}const u=n==="patch"?p=>p.major===a.major&&p.minor===a.minor:p=>p.major===a.major;return fu(e,a,s,c,i?.publishTimes,u,l)},"findTargetVersion"),jV=T((e,t)=>{const r=[],n=new Set;for(const[s,i]of e)for(const[o,a]of i)if(!(a.startsWith("workspace:")||a.startsWith("file:")||a.startsWith("link:")||a==="*")&&!(!t.includeLocked&&!pl(a))){if(t.ignore.some(c=>qn(o,c))){n.add(o);continue}Hf(o,t.include,t.exclude)&&r.push({catalogName:s,packageName:o,range:a})}return{entries:r,ignored:[...n]}},"collectEntries"),AV=T(async(e,t,r,n=!1,s)=>{const i=new Map,o=[],a=Math.max(1,Math.min(64,Math.floor(s??8)||8));let c=0;for(let l=0;l<e.length;l+=a){const u=e.slice(l,l+a),p=await Promise.allSettled(u.map(async f=>{const m=t?Jf(f,t):void 0,$=await U1(f,m?{authToken:m.token,url:m.url}:void 0,V1,n);return i.set(f,$),f}));for(const[f,m]of p.entries())if(c+=1,m.status==="rejected"){const $=u[f];$&&o.push($)}r&&r(c,e.length)}return{failed:o,versionCache:i}},"fetchVersionsBatched"),yg=T((e,t,r)=>{const n=[];for(const s of e){const i=t.get(s.packageName);if(!i)continue;const o=Kf(s.packageName,r.target,r.packageMode),a=z1(i.versions,i.latest,s.range,o,r.includePrerelease,{minimumReleaseAge:r.minimumReleaseAge,minimumReleaseAgeExclude:r.minimumReleaseAgeExclude,packageName:s.packageName,publishTimes:i.publishTimes},r.releaseChannel);if(!a)continue;const c=jt(s.range),l=jt(a);if(!c||!l)continue;const u=qf(c,l);if(u==="none")continue;const p=pl(s.range);n.push({catalogName:s.catalogName,currentRange:s.range,newRange:`${p}${a}`,packageName:s.packageName,targetVersion:a,updateType:u})}return n},"buildOutdatedEntries"),vg=T(e=>e?sV(e):"","formatVersionString"),xV=T(async(e,t,r,n)=>{const s=[...new Map(t.map(c=>{const l=jt(c.range);return[c.packageName,{name:c.packageName,version:vg(l)}]})).values()].filter(c=>c.version),i=r&&r.length>0?P1(r,s):void 0,[o,a]=await Promise.all([G1(s),i]);for(const c of e){const l=o.get(c.packageName);l&&l.length>0&&(c.vulnerabilities=l);const u=jt(c.currentRange),p=vg(u);if(a){const f=a.get(`${c.packageName}@${p}`);f&&(c.socketReport={alerts:f.alerts,license:f.license,score:f.score})}if(n){const f=c9(c.packageName,p,n);f&&(c.acceptedRisk=f)}}},"enrichWithSecurity"),OV=6e4,PV=T((e,t,r,n)=>{const s=[];for(const[a,c]of e)for(const[l,u]of c)s.push(`${a}:${l}=${u}`);if(s.push(`target=${t.target},pre=${String(t.includePrerelease)},chan=${t.releaseChannel??"_"},sec=${String(t.security??!1)}`),s.push(`in=${t.include.join(",")},ex=${t.exclude.join(",")},ig=${t.ignore.join(",")}`),s.push(`locked=${String(t.includeLocked)}`),s.push(`mra=${String(t.minimumReleaseAge??0)}`),t.packageMode){const a=Object.entries(t.packageMode).map(([c,l])=>`${c}=${l}`).toSorted().join(",");s.push(`pkgMode=${a}`)}s.push(`socket=${String(r??!1)}`),n&&n.length>0&&s.push(`risks=${n.toSorted().join(",")}`);let i=5381;const o=s.join("|");for(let a=0;a<o.length;a++)i=(i<<5)+i+o.charCodeAt(a)|0;return String(i)},"computeCacheHash"),J1=T(e=>{const t=Ig("vis",{create:!0,cwd:e});return t?D(t,"outdated-cache.json"):void 0},"getOutdatedCachePath"),FV=T((e,t)=>{const r=J1(e);if(!(!r||!j(r)))try{const n=le(r);if(n.hash===t&&Date.now()-n.timestamp<OV)return n.result}catch{}},"readOutdatedCache"),BV=T((e,t,r)=>{const n=J1(e);if(n)try{$t(Je(n)),wo(n,{hash:t,result:r,timestamp:Date.now()})}catch{}},"writeOutdatedCache"),RV=T(async(e,t,r,n,s,i,o)=>{const a=!!(i&&i.length>0),c=PV(e,t,a,o?Object.keys(o):void 0);if(s){const y=FV(s,c);if(y)return y}const{entries:l,ignored:u}=jV(e,t),p=[...new Set(l.map(y=>y.packageName))],f=!!(t.minimumReleaseAge&&t.minimumReleaseAge>0),{failed:m,versionCache:$}=await AV(p,r,n,f,t.maxConcurrentRequests),b=yg(l,$,t);let k=[];if(t.target!=="latest"){const y=new Set(b.map(v=>v.packageName)),h={...t,packageMode:void 0,target:"latest"};k=yg(l,$,h).filter(v=>!y.has(v.packageName))}(t.security||a)&&b.length>0&&await xV(b,l,i,o);const S={checkedCount:p.length,failed:m,filteredByTarget:k,ignored:u,outdated:b};return s&&BV(s,c,S),S},"checkOutdated"),Yf=T((e,t)=>t==="bun"?D(e,"package.json"):D(e,"pnpm-workspace.yaml"),"getCatalogFilePath"),bg=T((e,t)=>{const r=ul(e),n=new Set;for(const s of t){const i=pi(s.catalogName);i&&n.add(i.relativePath==="."?"package.json":D(i.relativePath,"package.json"))}if(n.size!==0){$t(r);for(const s of n){const i=D(e,s);if(j(i)){const o=D(r,s),a=Je(o);$t(a),qe(o,H(i))}}return r}},"createPackageJsonBackup"),Xf=T((e,t)=>{const r=Yf(e,t),n=ul(e);return D(n,`${_g(r)}.bak`)},"getCatalogBackupPath"),K1=T((e,t,r)=>{if((t==="npm"||t==="yarn")&&r)return bg(e,r);let n;const s=Yf(e,t);if(j(s)&&(n=Xf(e,t),$t(Je(n)),qe(n,H(s))),r){const i=r.filter(o=>pi(o.catalogName));i.length>0&&bg(e,i)}return n},"createBackup"),TV=T(e=>{const t=ul(e);if(!j(t))return!1;for(const r of un(t,{includeDirs:!1})){const n=r.path.slice(t.length+1),s=D(e,n);qe(s,H(r.path))}return MD(t),!0},"restorePackageJsonBackup"),NV=T((e,t)=>{if(t==="npm"||t==="yarn")return TV(e);const r=Yf(e,t),n=Xf(e,t);if(!j(n))return!1;const s=H(n);return qe(r,s),!0},"restoreFromBackup"),IV=T((e,t)=>{if(t==="npm"||t==="yarn")try{const r=ul(e);return j(r)}catch{return!1}try{return j(Xf(e,t))}catch{return!1}},"hasBackup"),LV=T(e=>JSON.stringify(e,void 0,2),"formatOutdatedJson"),_V=T(e=>e.map(t=>`${t.packageName} ${t.currentRange} → ${t.newRange}`).join(`
|
|
1156
|
+
`),"formatOutdatedMinimal"),MV=T(e=>e?Array.isArray(e)?e:[e]:[],"toFilterArray"),Y1=T(e=>{const t=new Map;for(const r of e){t.has(r.catalogName)||t.set(r.catalogName,[]);const n=t.get(r.catalogName);n&&n.push(r)}return t},"groupByCatalog"),WV=T(e=>{const t=pi(e);return t?`${t.relativePath==="."?"root":t.relativePath} (${t.depType})`:`Catalog: ${e}`},"formatCatalogDisplayName"),VV=T((e,t)=>{const r=Y1(e),n=process.stdout.columns||80,s=e.some(i=>i.socketReport);for(const[i,o]of r){const a=o.flatMap(u=>{const p=u.vulnerabilities&&u.vulnerabilities.length>0,f=u.socketReport&&u.socketReport.alerts.length>0,m=`${p||f?"[SEC] ":""}${u.packageName}`,$=u.socketReport?`${String(Math.round(u.socketReport.score.overall*100))}%`:"",b={current:u.currentRange,package:m,target:u.newRange,type:u.updateType};s&&(b.score=$);const k=[b];if(u.vulnerabilities)for(const S of u.vulnerabilities){const y={current:S.summary,package:` ${S.severity} ${S.id}`,target:"",type:""};s&&(y.score=""),k.push(y)}if(u.socketReport)for(const S of u.socketReport.alerts){const y={current:S.category,package:` [${S.severity.toUpperCase()}] ${S.type}`,target:"",type:""};s&&(y.score=""),k.push(y)}return k}),c=WV(i),l=Xg(bs.createElement(wS,{data:a}),{columns:n});t.info(`${c}
|
|
1157
1157
|
${l}
|
|
1158
|
-
`)}},"formatOutdatedTable"),
|
|
1159
|
-
`),s=
|
|
1160
|
-
`))},"applyPnpmCatalogUpdates");T(e=>{const t=
|
|
1158
|
+
`)}},"formatOutdatedTable"),UV=T((e,t=Ef)=>{let r=0,n=0,s=0,i=0,o=0,a=0;for(const f of e)f.updateType==="major"?r++:f.updateType==="minor"?n++:s++,f.vulnerabilities&&f.vulnerabilities.length>0&&i++,f.socketReport?.alerts.length&&o++,f.socketReport&&f.socketReport.score.overall<t&&a++;const c=[];r&&c.push(`${String(r)} major`),n&&c.push(`${String(n)} minor`),s&&c.push(`${String(s)} patch`),i&&c.push(`${String(i)} with vulnerabilities`),o&&c.push(`${String(o)} with Socket.dev alerts`);const l=`Found ${String(e.length)} outdated (${c.join(", ")})`,u=process.stdout.columns||80,p=[bs.createElement(_,{bold:!0},"─ Summary"),bs.createElement(_,null,` ${l}`)];return a>0&&p.push(bs.createElement(_,{color:"yellow"},` ${String(a)} package${a===1?"":"s"} with low Socket.dev score (<${String(Math.round(t*100))}%)`)),Xg(bs.createElement(de,{flexDirection:"column",paddingX:1},...p),{columns:u})},"formatSummary"),GV=T((e,t)=>{const r=e.replaceAll(hg,String.raw`\$&`),n=t.replaceAll(hg,String.raw`\$&`);return new RegExp(String.raw`^(?:'${r}'|"${r}"|${r}):\s*['"]?${n}['"]?`)},"buildLineMatchRegex"),qV=T((e,t,r)=>GV(t,r).test(e),"lineMatchesPackage"),HV=T(e=>{const t=new Map;for(const r of e){t.has(r.catalogName)||t.set(r.catalogName,new Map);const n=t.get(r.catalogName);n&&n.set(r.packageName,{newRange:r.newRange,oldRange:r.currentRange})}return t},"buildUpdateMap"),$g=T((e,t,r)=>{if(!r)return e;for(const[n,{newRange:s,oldRange:i}]of r)if(qV(t,n,i))return e.replace(i,s);return e},"applyLineUpdate"),zV=T((e,t,r,n)=>{const s=e.trimStart(),i=e.length-s.length;return s.length===0||s.startsWith("#")?e:t==="catalog"&&i>=2?$g(e,s,n.get("default")):t==="catalogs"&&i>=4&&r?$g(e,s,n.get(r)):e},"processYamlLineForUpdate"),JV=T((e,t)=>{const r=D(e,"pnpm-workspace.yaml"),n=H(r).split(`
|
|
1159
|
+
`),s=HV(t);let i="none",o="";const a=[];for(const c of n){const l=c.trimStart(),u=c.length-l.length;u===0&&l.length>0&&!l.startsWith("#")&&(i=N1(l),i==="catalogs"&&(o="")),i==="catalogs"&&u===2&&l.endsWith(":")&&(o=l.slice(0,-1).trim().replaceAll(F1,"")),a.push(zV(c,i,o,s))}qe(r,a.join(`
|
|
1160
|
+
`))},"applyPnpmCatalogUpdates");T(e=>{const t=rV.exec(e);if(!t)return 2;const r=t[1];return r?r.includes(" ")?r:r.length:2},"detectJsonIndent");const KV=T((e,t,r)=>{const n=D(e,"package.json"),s=le(n);for(const i of t)if(i.catalogName==="default")s.workspaces?.catalog&&(s.workspaces.catalog[i.packageName]=i.newRange);else{const o=s.workspaces?.catalogs?.[i.catalogName];o&&(o[i.packageName]=i.newRange)}wo(n,s,{indent:Of(n,{useEditorconfig:r}),overwrite:!0})},"applyBunCatalogUpdates"),YV=T((e,t,r,n=!0,s={})=>{const{useEditorconfig:i}=s;let o;n&&(o=K1(e,r,t));const a=[],c=[];for(const l of t)pi(l.catalogName)?c.push(l):a.push(l);return a.length>0&&(r==="npm"||r==="yarn"?hp(e,a,i):r==="bun"?KV(e,a,i):JV(e,a)),c.length>0&&hp(e,c,i),o},"applyCatalogUpdates"),XV=T(async e=>{const t=Ap({input:process.stdin,output:process.stdout}),r=T(s=>new Promise(i=>{t.question(s,o=>{i(o.trim())})}),"ask");process.stdout.write(`
|
|
1161
1161
|
Outdated catalog dependencies:
|
|
1162
1162
|
`);for(const[s,i]of e.entries())i&&process.stdout.write(` ${String(s+1)}. ${i.packageName}: ${i.currentRange} → ${i.newRange} (${i.updateType})
|
|
1163
1163
|
`);process.stdout.write(`
|
|
1164
|
-
`);const n=await r("Apply updates? [a]ll / [n]one / [s]elect: ");if(n.toLowerCase()==="a"||n.toLowerCase()==="all")return t.close(),e;if(n.toLowerCase()==="n"||n.toLowerCase()==="none")return t.close(),[];if(n.toLowerCase()==="s"||n.toLowerCase()==="select"){const s=await r("Enter numbers to apply (comma-separated): ");return t.close(),s.split(",").map(i=>Number.parseInt(i.trim(),10)-1).filter(i=>i>=0&&i<e.length).map(i=>e[i]).filter(i=>i!==void 0)}return t.close(),[]},"promptPackageSelection"),GV=/github\.com[/:]([\w.-]+)\/([\w.-]+?)(?:\.git|\/|$)/,qV=T(async(e,t=1e4,r)=>{const n=[],s=new AbortController,i=setTimeout(()=>{s.abort()},t);try{const o=e.map(async a=>{const c=`https://www.npmjs.com/package/${a.packageName}`;try{const l=r?Jf(a.packageName,r):{url:"https://registry.npmjs.org"},u=l.url.replace(Gf,""),p={Accept:"application/json"};l.token&&(p.Authorization=`Bearer ${l.token}`);const f=await fetch(`${u}/${a.packageName}`,{headers:p,signal:s.signal});if(!f.ok)return{npmUrl:c,packageName:a.packageName};const m=(await f.json()).repository?.url;if(!m)return{npmUrl:c,packageName:a.packageName};const $=GV.exec(m);if(!$)return{npmUrl:c,packageName:a.packageName,repoUrl:m};const b=$[1],k=$[2],S=`https://github.com/${b}/${k}/releases/tag/v${a.targetVersion}`;return{npmUrl:c,packageName:a.packageName,releaseUrl:S,repoUrl:`https://github.com/${b}/${k}`}}catch{return{npmUrl:c,packageName:a.packageName}}});n.push(...await Promise.all(o))}finally{clearTimeout(i)}return n},"fetchChangelogInfo"),qJ=Object.defineProperty({__proto__:null,applyCatalogUpdates:VV,applyPackageJsonUpdates:hp,checkOutdated:EV,collectInternalOutdated:pV,createBackup:K1,extractPrefix:pl,fetchChangelogInfo:qV,fetchPackageVersions:U1,fetchVulnerabilities:G1,findTargetVersion:z1,formatOutdatedJson:OV,formatOutdatedMinimal:PV,formatOutdatedTable:RV,formatSummary:TV,getRegistryForPackage:Jf,getUpdateType:qf,groupByCatalog:Y1,hasBackup:xV,hasCatalogs:cV,hasPackageJsonDeps:Pa,isNewer:Us,loadNpmrc:fV,matchesFilters:Hf,matchesPattern:qn,parseBunCatalogs:_1,parseCatalogsFromYaml:I1,parseCompositeCatalogName:pi,parseNpmrc:mp,parseVersion:jt,promptPackageSelection:UV,readCatalogs:lV,readPackageJsonDeps:W1,resolvePackageTarget:Kf,restoreFromBackup:AV,toFilterArray:FV},Symbol.toStringTag,{value:"Module"});var HV=Object.defineProperty,di=d((e,t)=>HV(e,"name",{value:t,configurable:!0}),"c$6");const zV=["dependencies","devDependencies","peerDependencies","optionalDependencies","overrides","resolutions","pnpm.overrides"],JV=di((e,t)=>{const r=t.split(".");let n=e;for(const s of r){if(typeof n!="object"||n===null)return;n=n[s]}return typeof n=="object"&&n!==null?n:void 0},"getNested"),Qf=di(e=>{const t=D(e,"package.json");if(!j(t))return["."];const r=le(t).workspaces;let n=[];if(r){const s=Array.isArray(r)?r:r.packages;s&&(n=ln(e,s))}if(n.length===0){const s=ci(e);s&&(n=ln(e,s))}return[".",...n]},"collectWorkspaceDirectories"),dl=di(e=>{if(j(e))try{return le(e)}catch{return}},"readPkg"),KV=di(e=>{const t=new Set,r=Qf(e);for(const n of r){const s=dl(D(e,n,"package.json"));s&&typeof s.name=="string"&&t.add(s.name)}return t},"collectWorkspacePackageNames"),HJ=di((e,t={})=>{const r=t.includeInternal??!0,n=t.depTypes??zV,s=Qf(e),i=KV(e),o=[],a=n.includes("pnpm.overrides")?xM(e):void 0,c=a?D(e,"pnpm-workspace.yaml"):void 0;for(const l of s){const u=D(e,l,"package.json"),p=dl(u);if(!p)continue;const f=typeof p.name=="string"?p.name:void 0,m=l==="."?".":zn(e,D(e,l));for(const $ of n){const b=$.includes(".")?JV(p,$):p[$];if(!(!b||typeof b!="object"))for(const[k,S]of Object.entries(b)){if(typeof S!="string")continue;const y=i.has(k);!r&&y||o.push({depName:k,depType:$,isInternal:y,packageDir:m,packageJsonPath:u,packageName:f,specifier:S})}}}if(a&&c)for(const[l,u]of Object.entries(a)){const p=i.has(l);!r&&p||o.push({depName:l,depType:"pnpm.overrides",isInternal:p,packageDir:".",packageJsonPath:c,packageName:void 0,specifier:u})}return o},"iterateWorkspaceDeps");di(e=>{const t=new Map;for(const r of e){const n=t.get(r.depName);n?n.push(r):t.set(r.depName,[r])}return t},"groupInstancesByDep");var YV=Object.defineProperty,xt=d((e,t)=>YV(e,"name",{value:t,configurable:!0}),"u$8");const Zf=new Set(["devEngines.packageManager","devEngines.runtime","engines","packageManager","volta"]),XV=["engines","volta"],QV=new Set(["extends"]),ZV=/^([@\w./-]+?)@([^+]+)(\+.+)?$/,eU=/^([@\w./-]+)~(.+)$/,fl=xt(e=>{const t=ZV.exec(e.trim());if(!(!t?.[1]||!t[2]))return{hash:t[3]??"",name:t[1],version:t[2]}},"parsePackageManager"),X1=xt(e=>{const t=eU.exec(e.trim());if(!(!t?.[1]||!t[2]))return{name:t[1],version:t[2]}},"parseNameTildeVersion"),$o=xt(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isPlainObject"),Q1=xt(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.name=="string","isDevEnginesEntry"),tU=new Set(["name@version","name~version","string","versionsByName"]),zJ=xt(e=>{const t=[];if(!e)return t;const r=new Set;for(const n of e){const s=typeof n?.name=="string"&&n.name.length>0?n.name:"<unnamed>";if(typeof n?.name!="string"||n.name.length===0){t.push("extraTypes entry missing 'name'");continue}Zf.has(n.name)&&t.push(`extraTypes[${s}]: name collides with a built-in customType`),r.has(n.name)&&t.push(`extraTypes[${s}]: duplicate name`),r.add(n.name),(typeof n.path!="string"||n.path.length===0)&&t.push(`extraTypes[${s}]: missing 'path'`),tU.has(n.strategy)||t.push(`extraTypes[${s}]: invalid strategy "${String(n.strategy)}" (expected name@version | name~version | string | versionsByName)`),n.strategy==="string"&&(typeof n.depName!="string"||n.depName.length===0)&&t.push(`extraTypes[${s}]: strategy 'string' requires 'depName'`)}return t},"validateExtraTypes"),rU=xt((e,t)=>{if(t.length===0)return;let r=e;for(const n of t.split(".")){if(typeof r!="object"||r===null||Array.isArray(r))return;r=r[n]}return r},"getNested"),nU=xt((e,t,r,n,s)=>{const i=rU(t,e.path);if(i===void 0)return[];const o=Object.freeze({depName:e.depName,path:e.path,strategy:e.strategy});if(e.strategy==="versionsByName"){if(!$o(i))return[];const a=[];for(const[c,l]of Object.entries(i))typeof l=="string"&&a.push({customType:e.name,depName:c,extra:o,packageDir:r,packageJsonPath:n,packageName:s,rawValue:l,specifier:l});return a}if(e.strategy==="name@version"){if(typeof i!="string")return[];const a=fl(i);return a?[{customType:e.name,depName:a.name,extra:o,packageDir:r,packageJsonPath:n,packageName:s,rawValue:i,specifier:a.version}]:[]}if(e.strategy==="name~version"){if(typeof i!="string")return[];const a=X1(i);return a?[{customType:e.name,depName:a.name,extra:o,packageDir:r,packageJsonPath:n,packageName:s,rawValue:i,specifier:a.version}]:[]}return typeof i!="string"||typeof e.depName!="string"||e.depName.length===0?[]:[{customType:e.name,depName:e.depName,extra:o,packageDir:r,packageJsonPath:n,packageName:s,rawValue:i,specifier:i}]},"iterateExtraType"),JJ=xt((e,t)=>{const r=Qf(e),n=[];for(const s of r){const i=D(e,s,"package.json"),o=dl(i);if(!o)continue;const a=typeof o.name=="string"?o.name:void 0,c=s==="."?".":zn(e,D(e,s));for(const u of XV){const p=o[u];if($o(p))for(const[f,m]of Object.entries(p))typeof m=="string"&&(u==="volta"&&QV.has(f)||n.push({customType:u,depName:f,packageDir:c,packageJsonPath:i,packageName:a,rawValue:m,specifier:m}))}if(typeof o.packageManager=="string"){const u=fl(o.packageManager);u&&n.push({customType:"packageManager",depName:u.name,packageDir:c,packageJsonPath:i,packageName:a,rawValue:o.packageManager,specifier:u.version})}const{devEngines:l}=o;if(typeof l=="object"&&l!==null&&!Array.isArray(l))for(const u of["runtime","packageManager"]){const p=l[u];if(p===void 0)continue;const f=Array.isArray(p)?p:[p];for(const m of f)!Q1(m)||typeof m.version!="string"||n.push({customType:u==="runtime"?"devEngines.runtime":"devEngines.packageManager",depName:m.name,packageDir:c,packageJsonPath:i,packageName:a,rawValue:m.version,specifier:m.version})}if(t){for(const u of t)if(!(typeof u?.name!="string"||u.name.length===0)&&!Zf.has(u.name))for(const p of nU(u,o,c,i,a))n.push(p)}}return n},"iterateCustomTypeDeps"),sU=xt((e,t)=>`${e} ${t}`,"pinKey"),iU=xt((e,t)=>{const r=[...e].sort((s,i)=>(s.packageName??s.packageDir).localeCompare(i.packageName??i.packageDir));let n;for(const s of r){const i=jt(s.specifier);if(!i)continue;if(!n){n=s;continue}const o=jt(n.specifier);if(!o){n=s;continue}const a=Us(o,i),c=Us(i,o);(t==="highest"&&a||t==="lowest"&&c)&&(n=s)}return n},"pickCanonical"),KJ=xt((e,t={})=>{const r=new Set(t.ignoreDeps),n=t.resolve??"highest",s=[],i=e.filter(a=>t.dep!==void 0&&a.depName!==t.dep?!1:!r.has(a.depName)),o=new Map;for(const a of i){const c=sU(a.customType,a.depName),l=o.get(c);l?l.push(a):o.set(c,[a])}for(const[,a]of o){if(a.length<2||new Set(a.map(l=>l.specifier)).size<=1)continue;const c=iU(a,n);if(c)for(const l of a)l.specifier!==c.specifier&&jt(l.specifier)!==void 0&&s.push({canonicalSource:c.packageName??c.packageDir,customType:l.customType,depName:l.depName,...l.extra?{extra:l.extra}:{},fix:c.specifier,packageDir:l.packageDir,packageJsonPath:l.packageJsonPath,packageName:l.packageName,specifier:l.specifier})}return s},"lintCustomTypes"),oU=xt((e,t)=>{const r=t.extra;if(!r)return!1;const n=r.path.split(".");if(n.length===0||n.some(o=>o.length===0))return!1;let s=e;for(let o=0;o<n.length-1;o+=1){const a=s[n[o]];if(typeof a!="object"||a===null||Array.isArray(a))return!1;s=a}const i=n.at(-1);if(r.strategy==="versionsByName"){const o=s[i];return $o(o)?(o[t.depName]=t.fix,!0):!1}if(r.strategy==="name@version"){const o=s[i];if(typeof o!="string")return!1;const a=fl(o);return a?(s[i]=`${a.name}@${t.fix}`,!0):!1}if(r.strategy==="name~version"){const o=s[i];if(typeof o!="string")return!1;const a=X1(o);return a?(s[i]=`${a.name}~${t.fix}`,!0):!1}return typeof s[i]!="string"?!1:(s[i]=t.fix,!0)},"applyExtraTypeFix"),YJ=xt((e,t={})=>{const{useEditorconfig:r}=t,n=new Map;for(const i of e){const o=n.get(i.packageJsonPath);o?o.push(i):n.set(i.packageJsonPath,[i])}const s=[];for(const[i,o]of n){const a=dl(i);if(!a)continue;let c=!1;for(const l of o){if(l.extra){oU(a,l)&&(c=!0);continue}if(l.customType==="engines"||l.customType==="volta"){const $=a[l.customType];$o($)&&($[l.depName]=l.fix,c=!0);continue}if(l.customType==="packageManager"){const $=a.packageManager;if(typeof $=="string"){const b=fl($);b&&(a.packageManager=`${b.name}@${l.fix}`,c=!0)}continue}const u=l.customType==="devEngines.runtime"?"runtime":"packageManager",{devEngines:p}=a;if(!$o(p))continue;const f=p[u];if(f===void 0)continue;const m=Array.isArray(f)?f:[f];for(const $ of m)Q1($)&&$.name===l.depName&&($.version=l.fix,c=!0)}c&&(wo(i,a,{indent:Of(i,{useEditorconfig:r}),overwrite:!0}),s.push(i))}return s},"applyCustomTypeFixes");var aU=Object.defineProperty,Le=d((e,t)=>aU(e,"name",{value:t,configurable:!0}),"a$c");const gp="syncpack",Z1=[".syncpackrc",".syncpackrc.json"],eh=[".syncpackrc.yaml",".syncpackrc.yml"],th=[".syncpackrc.cjs",".syncpackrc.js",".syncpackrc.mjs",".syncpackrc.ts","syncpack.config.cjs","syncpack.config.js","syncpack.config.mjs","syncpack.config.ts"],cU=[...Z1,...eh,...th],lU=/\bextraTypes\s*:/,uU=/\bpolicy\s*:/,wg=/(defineConfig\(\{)/,kg=/(export\s+default\s+\{)/,rh=/\bsyncpack\b/,ek=Le(e=>{const t=D(e,"package.json");if(j(t)&&rt(t)?.syncpack)return"package.json";for(const r of cU)if(j(D(e,r)))return r},"detectSyncpackConfig"),pU=Le(e=>{for(const r of th)if(j(D(e,r)))return r;const t=D(e,".syncpackrc");if(j(t)&&!li(t))try{Lt(t);return}catch{return".syncpackrc"}},"hasUnsupportedSyncpackConfig"),dU=Le(e=>{const t=Hn(e);return t?lU.test(H(t)):!1},"hasPolicyExtraTypesInVisConfig"),fU=Le(e=>rt(D(e,"package.json"))?.syncpack,"extractSyncpackFromPackageJson"),hU=Le(e=>rt(e),"parseSyncpackJsonFile"),Sg=Le(e=>{try{return Lt(e)}catch{return}},"parseSyncpackYamlFile"),mU=Le((e,t,r)=>{if(t==="package.json")return fU(e);if(th.includes(t)){ue(r,`${t} is a TS/JS config and cannot be auto-migrated — vis migrate does not load executable config. Convert to .syncpackrc.json and re-run, or translate directly into vis.config.ts. Tracked in https://github.com/visulima/visulima/issues/622.`),ye(r,`Translate ${t} into vis.config.ts (policy.* and security.*) — see https://github.com/visulima/visulima/issues/622`);return}const n=D(e,t);if(eh.includes(t))return Sg(n);if(t===".syncpackrc"&&!li(n)){const s=Sg(n);if(s)return s;ue(r,".syncpackrc is neither valid JSON nor YAML — please migrate manually.");return}return hU(n)},"extractConfig"),tk=Le((e,t)=>{const r=[];if(!e.customTypes)return r;for(const[n,s]of Object.entries(e.customTypes)){if(!s||typeof s!="object")continue;const{strategy:i}=s,{path:o}=s;if(typeof o!="string"||o.length===0){ue(t,`customType "${n}" has no \`path\` — skipped.`);continue}if(i!=="name@version"&&i!=="string"&&i!=="versionsByName"){ue(t,`customType "${n}" has unsupported strategy ${JSON.stringify(i)} — skipped.`);continue}if(Zf.has(n)){ue(t,`customType "${n}" collides with a vis built-in and was dropped — vis already lints this surface.`);continue}const a={name:n,path:o,strategy:i};if(i==="string"){const{depName:c}=s;typeof c=="string"&&c.length>0?a.depName=c:(ue(t,`customType "${n}" uses strategy "string" but has no \`depName\` — vis requires it. Add it manually after migration.`),ye(t,`Set policy.customTypes.extraTypes[name="${n}"].depName before running vis lint`))}r.push(a)}return r},"translateCustomTypes"),rk=Le(e=>e.isBanned===!0,"isVersionGroupBanned"),nk=Le((e,t)=>{if(Array.isArray(e.versionGroups)&&e.versionGroups.length>0){const r=e.versionGroups.filter(n=>n&&typeof n=="object"&&!rk(n));r.length>0&&(ue(t,`${String(r.length)} versionGroups rule(s) cannot be migrated — \`pinVersion\`, \`snapTo\`, and \`policy: "sameRange"\` (and other versionGroups DSL surfaces) are tracked in https://github.com/visulima/visulima/issues/622.`),ye(t,'Re-implement versionGroups rules using `pinVersion` / `snapTo` / `policy: "sameRange"` once the vis DSL ships (issue #622).'))}Array.isArray(e.semverGroups)&&e.semverGroups.length>0&&(ue(t,`${String(e.semverGroups.length)} semverGroups rule(s) cannot be migrated — semverGroups DSL is tracked in https://github.com/visulima/visulima/issues/622.`),ye(t,"Re-implement semverGroups rules manually once the vis DSL ships (issue #622)")),Array.isArray(e.dependencyTypes)&&e.dependencyTypes.length>0&&ye(t,"Review syncpack `dependencyTypes` — vis applies policies to dependencies/devDependencies/peerDependencies/optionalDependencies/overrides by default. Narrow via policy.* filters if needed."),Array.isArray(e.specifierTypes)&&e.specifierTypes.length>0&&ye(t,"Review syncpack `specifierTypes` — vis has no direct equivalent today; specifier filtering belongs in versionGroups (issue #622)."),typeof e.filter=="string"&&e.filter.length>0&&ye(t,`Re-implement syncpack \`filter\` regex (${e.filter}) once vis exposes a top-level dep filter.`),(Array.isArray(e.sortAz)&&e.sortAz.length>0||Array.isArray(e.sortFirst)&&e.sortFirst.length>0||Array.isArray(e.sortExports)&&e.sortExports.length>0)&&ue(t,"syncpack sort options (sortAz / sortFirst / sortExports) are superseded by `vis sort-package-json` — no migration needed."),(e.sortPackages!==void 0||e.formatBugs!==void 0||e.formatRepository!==void 0)&&ue(t,"syncpack package.json shape options (sortPackages / formatBugs / formatRepository) are superseded by `vis sort-package-json` — no migration needed."),(e.lintFormatting!==void 0||e.lintSemverRanges!==void 0||e.lintVersions!==void 0)&&ue(t,"syncpack lint toggles (lintFormatting / lintSemverRanges / lintVersions) are covered by `vis lint` by default — no migration needed."),Array.isArray(e.source)&&e.source.length>0&&ye(t,`syncpack \`source\` was set to [${e.source.map(r=>JSON.stringify(r)).join(", ")}]. vis derives workspace globs from pnpm-workspace.yaml / package.json#workspaces — verify they match before relying on \`vis lint\`.`),typeof e.indent=="string"&&e.indent.length>0&&ue(t,"syncpack `indent` is implicit in vis — JSON writers honor `.editorconfig` (and the source file's existing indentation). No migration needed.")},"noteUnsupportedKeys"),sk=Le((e,t)=>{const r={};if(!Array.isArray(e.versionGroups))return r;for(const n of e.versionGroups){if(!n||typeof n!="object")continue;const s=n;if(!rk(s))continue;const i=Array.isArray(s.dependencies)?s.dependencies.filter(l=>typeof l=="string"&&l.length>0):[];if(i.length===0){ue(t,"versionGroup with `isBanned: true` has no `dependencies` entries — skipped.");continue}const o=Array.isArray(s.packages)?s.packages.filter(l=>typeof l=="string"&&l.length>0):[],a=s.label,c=typeof a=="string"&&a.length>0?a:"banned via syncpack versionGroups";for(const l of i){if(r[l]!==void 0){ue(t,`Multiple banned versionGroups target "${l}" — kept the first match; merge manually if needed.`);continue}r[l]=o.length>0?{packages:o,reason:c}:c}}return r},"translateBannedDeps"),gU=Le(e=>{const t=[`name: ${JSON.stringify(e.name)}`,`path: ${JSON.stringify(e.path)}`,`strategy: ${JSON.stringify(e.strategy)}`];return e.depName!==void 0&&t.push(`depName: ${JSON.stringify(e.depName)}`),` { ${t.join(", ")} }`},"formatExtraTypeLiteral"),yU=Le((e,t)=>{if(typeof t=="string")return` ${JSON.stringify(e)}: ${JSON.stringify(t)}`;const r=[`reason: ${JSON.stringify(t.reason)}`];return t.packages&&t.packages.length>0&&r.push(`packages: [${t.packages.map(n=>JSON.stringify(n)).join(", ")}]`),t.paths&&t.paths.length>0&&r.push(`paths: [${t.paths.map(n=>JSON.stringify(n)).join(", ")}]`),t.replacement!==void 0&&r.push(`replacement: ${JSON.stringify(t.replacement)}`),` ${JSON.stringify(e)}: { ${r.join(", ")} }`},"formatBannedDepRule"),yp=Le((e,t={})=>{const r=[],n=Object.entries(t);if(n.length>0){const s=n.map(([i,o])=>yU(i,o)).join(`,
|
|
1164
|
+
`);const n=await r("Apply updates? [a]ll / [n]one / [s]elect: ");if(n.toLowerCase()==="a"||n.toLowerCase()==="all")return t.close(),e;if(n.toLowerCase()==="n"||n.toLowerCase()==="none")return t.close(),[];if(n.toLowerCase()==="s"||n.toLowerCase()==="select"){const s=await r("Enter numbers to apply (comma-separated): ");return t.close(),s.split(",").map(i=>Number.parseInt(i.trim(),10)-1).filter(i=>i>=0&&i<e.length).map(i=>e[i]).filter(i=>i!==void 0)}return t.close(),[]},"promptPackageSelection"),QV=/github\.com[/:]([\w.-]+)\/([\w.-]+?)(?:\.git|\/|$)/,ZV=T(async(e,t=1e4,r)=>{const n=[],s=new AbortController,i=setTimeout(()=>{s.abort()},t);try{const o=e.map(async a=>{const c=`https://www.npmjs.com/package/${a.packageName}`;try{const l=r?Jf(a.packageName,r):{url:"https://registry.npmjs.org"},u=l.url.replace(Gf,""),p={Accept:"application/json"};l.token&&(p.Authorization=`Bearer ${l.token}`);const f=await fetch(`${u}/${a.packageName}`,{headers:p,signal:s.signal});if(!f.ok)return{npmUrl:c,packageName:a.packageName};const m=(await f.json()).repository?.url;if(!m)return{npmUrl:c,packageName:a.packageName};const $=QV.exec(m);if(!$)return{npmUrl:c,packageName:a.packageName,repoUrl:m};const b=$[1],k=$[2],S=`https://github.com/${b}/${k}/releases/tag/v${a.targetVersion}`;return{npmUrl:c,packageName:a.packageName,releaseUrl:S,repoUrl:`https://github.com/${b}/${k}`}}catch{return{npmUrl:c,packageName:a.packageName}}});n.push(...await Promise.all(o))}finally{clearTimeout(i)}return n},"fetchChangelogInfo"),ZJ=Object.defineProperty({__proto__:null,applyCatalogUpdates:YV,applyPackageJsonUpdates:hp,checkOutdated:RV,collectInternalOutdated:bV,createBackup:K1,extractPrefix:pl,fetchChangelogInfo:ZV,fetchPackageVersions:U1,fetchVulnerabilities:G1,findTargetVersion:z1,formatOutdatedJson:LV,formatOutdatedMinimal:_V,formatOutdatedTable:VV,formatSummary:UV,getRegistryForPackage:Jf,getUpdateType:qf,groupByCatalog:Y1,hasBackup:IV,hasCatalogs:gV,hasPackageJsonDeps:Pa,isNewer:Us,loadNpmrc:wV,matchesFilters:Hf,matchesPattern:qn,parseBunCatalogs:_1,parseCatalogsFromYaml:I1,parseCompositeCatalogName:pi,parseNpmrc:mp,parseVersion:jt,promptPackageSelection:XV,readCatalogs:yV,readPackageJsonDeps:W1,resolvePackageTarget:Kf,restoreFromBackup:NV,toFilterArray:MV},Symbol.toStringTag,{value:"Module"});var eU=Object.defineProperty,di=d((e,t)=>eU(e,"name",{value:t,configurable:!0}),"c$6");const tU=["dependencies","devDependencies","peerDependencies","optionalDependencies","overrides","resolutions","pnpm.overrides"],rU=di((e,t)=>{const r=t.split(".");let n=e;for(const s of r){if(typeof n!="object"||n===null)return;n=n[s]}return typeof n=="object"&&n!==null?n:void 0},"getNested"),Qf=di(e=>{const t=D(e,"package.json");if(!j(t))return["."];const r=le(t).workspaces;let n=[];if(r){const s=Array.isArray(r)?r:r.packages;s&&(n=ln(e,s))}if(n.length===0){const s=ci(e);s&&(n=ln(e,s))}return[".",...n]},"collectWorkspaceDirectories"),dl=di(e=>{if(j(e))try{return le(e)}catch{return}},"readPkg"),nU=di(e=>{const t=new Set,r=Qf(e);for(const n of r){const s=dl(D(e,n,"package.json"));s&&typeof s.name=="string"&&t.add(s.name)}return t},"collectWorkspacePackageNames"),eK=di((e,t={})=>{const r=t.includeInternal??!0,n=t.depTypes??tU,s=Qf(e),i=nU(e),o=[],a=n.includes("pnpm.overrides")?IM(e):void 0,c=a?D(e,"pnpm-workspace.yaml"):void 0;for(const l of s){const u=D(e,l,"package.json"),p=dl(u);if(!p)continue;const f=typeof p.name=="string"?p.name:void 0,m=l==="."?".":zn(e,D(e,l));for(const $ of n){const b=$.includes(".")?rU(p,$):p[$];if(!(!b||typeof b!="object"))for(const[k,S]of Object.entries(b)){if(typeof S!="string")continue;const y=i.has(k);!r&&y||o.push({depName:k,depType:$,isInternal:y,packageDir:m,packageJsonPath:u,packageName:f,specifier:S})}}}if(a&&c)for(const[l,u]of Object.entries(a)){const p=i.has(l);!r&&p||o.push({depName:l,depType:"pnpm.overrides",isInternal:p,packageDir:".",packageJsonPath:c,packageName:void 0,specifier:u})}return o},"iterateWorkspaceDeps");di(e=>{const t=new Map;for(const r of e){const n=t.get(r.depName);n?n.push(r):t.set(r.depName,[r])}return t},"groupInstancesByDep");var sU=Object.defineProperty,xt=d((e,t)=>sU(e,"name",{value:t,configurable:!0}),"u$8");const Zf=new Set(["devEngines.packageManager","devEngines.runtime","engines","packageManager","volta"]),iU=["engines","volta"],oU=new Set(["extends"]),aU=/^([@\w./-]+?)@([^+]+)(\+.+)?$/,cU=/^([@\w./-]+)~(.+)$/,fl=xt(e=>{const t=aU.exec(e.trim());if(!(!t?.[1]||!t[2]))return{hash:t[3]??"",name:t[1],version:t[2]}},"parsePackageManager"),X1=xt(e=>{const t=cU.exec(e.trim());if(!(!t?.[1]||!t[2]))return{name:t[1],version:t[2]}},"parseNameTildeVersion"),$o=xt(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isPlainObject"),Q1=xt(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.name=="string","isDevEnginesEntry"),lU=new Set(["name@version","name~version","string","versionsByName"]),tK=xt(e=>{const t=[];if(!e)return t;const r=new Set;for(const n of e){const s=typeof n?.name=="string"&&n.name.length>0?n.name:"<unnamed>";if(typeof n?.name!="string"||n.name.length===0){t.push("extraTypes entry missing 'name'");continue}Zf.has(n.name)&&t.push(`extraTypes[${s}]: name collides with a built-in customType`),r.has(n.name)&&t.push(`extraTypes[${s}]: duplicate name`),r.add(n.name),(typeof n.path!="string"||n.path.length===0)&&t.push(`extraTypes[${s}]: missing 'path'`),lU.has(n.strategy)||t.push(`extraTypes[${s}]: invalid strategy "${String(n.strategy)}" (expected name@version | name~version | string | versionsByName)`),n.strategy==="string"&&(typeof n.depName!="string"||n.depName.length===0)&&t.push(`extraTypes[${s}]: strategy 'string' requires 'depName'`)}return t},"validateExtraTypes"),uU=xt((e,t)=>{if(t.length===0)return;let r=e;for(const n of t.split(".")){if(typeof r!="object"||r===null||Array.isArray(r))return;r=r[n]}return r},"getNested"),pU=xt((e,t,r,n,s)=>{const i=uU(t,e.path);if(i===void 0)return[];const o=Object.freeze({depName:e.depName,path:e.path,strategy:e.strategy});if(e.strategy==="versionsByName"){if(!$o(i))return[];const a=[];for(const[c,l]of Object.entries(i))typeof l=="string"&&a.push({customType:e.name,depName:c,extra:o,packageDir:r,packageJsonPath:n,packageName:s,rawValue:l,specifier:l});return a}if(e.strategy==="name@version"){if(typeof i!="string")return[];const a=fl(i);return a?[{customType:e.name,depName:a.name,extra:o,packageDir:r,packageJsonPath:n,packageName:s,rawValue:i,specifier:a.version}]:[]}if(e.strategy==="name~version"){if(typeof i!="string")return[];const a=X1(i);return a?[{customType:e.name,depName:a.name,extra:o,packageDir:r,packageJsonPath:n,packageName:s,rawValue:i,specifier:a.version}]:[]}return typeof i!="string"||typeof e.depName!="string"||e.depName.length===0?[]:[{customType:e.name,depName:e.depName,extra:o,packageDir:r,packageJsonPath:n,packageName:s,rawValue:i,specifier:i}]},"iterateExtraType"),rK=xt((e,t)=>{const r=Qf(e),n=[];for(const s of r){const i=D(e,s,"package.json"),o=dl(i);if(!o)continue;const a=typeof o.name=="string"?o.name:void 0,c=s==="."?".":zn(e,D(e,s));for(const u of iU){const p=o[u];if($o(p))for(const[f,m]of Object.entries(p))typeof m=="string"&&(u==="volta"&&oU.has(f)||n.push({customType:u,depName:f,packageDir:c,packageJsonPath:i,packageName:a,rawValue:m,specifier:m}))}if(typeof o.packageManager=="string"){const u=fl(o.packageManager);u&&n.push({customType:"packageManager",depName:u.name,packageDir:c,packageJsonPath:i,packageName:a,rawValue:o.packageManager,specifier:u.version})}const{devEngines:l}=o;if(typeof l=="object"&&l!==null&&!Array.isArray(l))for(const u of["runtime","packageManager"]){const p=l[u];if(p===void 0)continue;const f=Array.isArray(p)?p:[p];for(const m of f)!Q1(m)||typeof m.version!="string"||n.push({customType:u==="runtime"?"devEngines.runtime":"devEngines.packageManager",depName:m.name,packageDir:c,packageJsonPath:i,packageName:a,rawValue:m.version,specifier:m.version})}if(t){for(const u of t)if(!(typeof u?.name!="string"||u.name.length===0)&&!Zf.has(u.name))for(const p of pU(u,o,c,i,a))n.push(p)}}return n},"iterateCustomTypeDeps"),dU=xt((e,t)=>`${e} ${t}`,"pinKey"),fU=xt((e,t)=>{const r=[...e].sort((s,i)=>(s.packageName??s.packageDir).localeCompare(i.packageName??i.packageDir));let n;for(const s of r){const i=jt(s.specifier);if(!i)continue;if(!n){n=s;continue}const o=jt(n.specifier);if(!o){n=s;continue}const a=Us(o,i),c=Us(i,o);(t==="highest"&&a||t==="lowest"&&c)&&(n=s)}return n},"pickCanonical"),nK=xt((e,t={})=>{const r=new Set(t.ignoreDeps),n=t.resolve??"highest",s=[],i=e.filter(a=>t.dep!==void 0&&a.depName!==t.dep?!1:!r.has(a.depName)),o=new Map;for(const a of i){const c=dU(a.customType,a.depName),l=o.get(c);l?l.push(a):o.set(c,[a])}for(const[,a]of o){if(a.length<2||new Set(a.map(l=>l.specifier)).size<=1)continue;const c=fU(a,n);if(c)for(const l of a)l.specifier!==c.specifier&&jt(l.specifier)!==void 0&&s.push({canonicalSource:c.packageName??c.packageDir,customType:l.customType,depName:l.depName,...l.extra?{extra:l.extra}:{},fix:c.specifier,packageDir:l.packageDir,packageJsonPath:l.packageJsonPath,packageName:l.packageName,specifier:l.specifier})}return s},"lintCustomTypes"),hU=xt((e,t)=>{const r=t.extra;if(!r)return!1;const n=r.path.split(".");if(n.length===0||n.some(o=>o.length===0))return!1;let s=e;for(let o=0;o<n.length-1;o+=1){const a=s[n[o]];if(typeof a!="object"||a===null||Array.isArray(a))return!1;s=a}const i=n.at(-1);if(r.strategy==="versionsByName"){const o=s[i];return $o(o)?(o[t.depName]=t.fix,!0):!1}if(r.strategy==="name@version"){const o=s[i];if(typeof o!="string")return!1;const a=fl(o);return a?(s[i]=`${a.name}@${t.fix}`,!0):!1}if(r.strategy==="name~version"){const o=s[i];if(typeof o!="string")return!1;const a=X1(o);return a?(s[i]=`${a.name}~${t.fix}`,!0):!1}return typeof s[i]!="string"?!1:(s[i]=t.fix,!0)},"applyExtraTypeFix"),sK=xt((e,t={})=>{const{useEditorconfig:r}=t,n=new Map;for(const i of e){const o=n.get(i.packageJsonPath);o?o.push(i):n.set(i.packageJsonPath,[i])}const s=[];for(const[i,o]of n){const a=dl(i);if(!a)continue;let c=!1;for(const l of o){if(l.extra){hU(a,l)&&(c=!0);continue}if(l.customType==="engines"||l.customType==="volta"){const $=a[l.customType];$o($)&&($[l.depName]=l.fix,c=!0);continue}if(l.customType==="packageManager"){const $=a.packageManager;if(typeof $=="string"){const b=fl($);b&&(a.packageManager=`${b.name}@${l.fix}`,c=!0)}continue}const u=l.customType==="devEngines.runtime"?"runtime":"packageManager",{devEngines:p}=a;if(!$o(p))continue;const f=p[u];if(f===void 0)continue;const m=Array.isArray(f)?f:[f];for(const $ of m)Q1($)&&$.name===l.depName&&($.version=l.fix,c=!0)}c&&(wo(i,a,{indent:Of(i,{useEditorconfig:r}),overwrite:!0}),s.push(i))}return s},"applyCustomTypeFixes");var mU=Object.defineProperty,Le=d((e,t)=>mU(e,"name",{value:t,configurable:!0}),"a$c");const gp="syncpack",Z1=[".syncpackrc",".syncpackrc.json"],eh=[".syncpackrc.yaml",".syncpackrc.yml"],th=[".syncpackrc.cjs",".syncpackrc.js",".syncpackrc.mjs",".syncpackrc.ts","syncpack.config.cjs","syncpack.config.js","syncpack.config.mjs","syncpack.config.ts"],gU=[...Z1,...eh,...th],yU=/\bextraTypes\s*:/,vU=/\bpolicy\s*:/,wg=/(defineConfig\(\{)/,kg=/(export\s+default\s+\{)/,rh=/\bsyncpack\b/,ek=Le(e=>{const t=D(e,"package.json");if(j(t)&&rt(t)?.syncpack)return"package.json";for(const r of gU)if(j(D(e,r)))return r},"detectSyncpackConfig"),bU=Le(e=>{for(const r of th)if(j(D(e,r)))return r;const t=D(e,".syncpackrc");if(j(t)&&!li(t))try{Lt(t);return}catch{return".syncpackrc"}},"hasUnsupportedSyncpackConfig"),$U=Le(e=>{const t=Hn(e);return t?yU.test(H(t)):!1},"hasPolicyExtraTypesInVisConfig"),wU=Le(e=>rt(D(e,"package.json"))?.syncpack,"extractSyncpackFromPackageJson"),kU=Le(e=>rt(e),"parseSyncpackJsonFile"),Sg=Le(e=>{try{return Lt(e)}catch{return}},"parseSyncpackYamlFile"),SU=Le((e,t,r)=>{if(t==="package.json")return wU(e);if(th.includes(t)){ue(r,`${t} is a TS/JS config and cannot be auto-migrated — vis migrate does not load executable config. Convert to .syncpackrc.json and re-run, or translate directly into vis.config.ts. Tracked in https://github.com/visulima/visulima/issues/622.`),ye(r,`Translate ${t} into vis.config.ts (policy.* and security.*) — see https://github.com/visulima/visulima/issues/622`);return}const n=D(e,t);if(eh.includes(t))return Sg(n);if(t===".syncpackrc"&&!li(n)){const s=Sg(n);if(s)return s;ue(r,".syncpackrc is neither valid JSON nor YAML — please migrate manually.");return}return kU(n)},"extractConfig"),tk=Le((e,t)=>{const r=[];if(!e.customTypes)return r;for(const[n,s]of Object.entries(e.customTypes)){if(!s||typeof s!="object")continue;const{strategy:i}=s,{path:o}=s;if(typeof o!="string"||o.length===0){ue(t,`customType "${n}" has no \`path\` — skipped.`);continue}if(i!=="name@version"&&i!=="string"&&i!=="versionsByName"){ue(t,`customType "${n}" has unsupported strategy ${JSON.stringify(i)} — skipped.`);continue}if(Zf.has(n)){ue(t,`customType "${n}" collides with a vis built-in and was dropped — vis already lints this surface.`);continue}const a={name:n,path:o,strategy:i};if(i==="string"){const{depName:c}=s;typeof c=="string"&&c.length>0?a.depName=c:(ue(t,`customType "${n}" uses strategy "string" but has no \`depName\` — vis requires it. Add it manually after migration.`),ye(t,`Set policy.customTypes.extraTypes[name="${n}"].depName before running vis lint`))}r.push(a)}return r},"translateCustomTypes"),rk=Le(e=>e.isBanned===!0,"isVersionGroupBanned"),nk=Le((e,t)=>{if(Array.isArray(e.versionGroups)&&e.versionGroups.length>0){const r=e.versionGroups.filter(n=>n&&typeof n=="object"&&!rk(n));r.length>0&&(ue(t,`${String(r.length)} versionGroups rule(s) cannot be migrated — \`pinVersion\`, \`snapTo\`, and \`policy: "sameRange"\` (and other versionGroups DSL surfaces) are tracked in https://github.com/visulima/visulima/issues/622.`),ye(t,'Re-implement versionGroups rules using `pinVersion` / `snapTo` / `policy: "sameRange"` once the vis DSL ships (issue #622).'))}Array.isArray(e.semverGroups)&&e.semverGroups.length>0&&(ue(t,`${String(e.semverGroups.length)} semverGroups rule(s) cannot be migrated — semverGroups DSL is tracked in https://github.com/visulima/visulima/issues/622.`),ye(t,"Re-implement semverGroups rules manually once the vis DSL ships (issue #622)")),Array.isArray(e.dependencyTypes)&&e.dependencyTypes.length>0&&ye(t,"Review syncpack `dependencyTypes` — vis applies policies to dependencies/devDependencies/peerDependencies/optionalDependencies/overrides by default. Narrow via policy.* filters if needed."),Array.isArray(e.specifierTypes)&&e.specifierTypes.length>0&&ye(t,"Review syncpack `specifierTypes` — vis has no direct equivalent today; specifier filtering belongs in versionGroups (issue #622)."),typeof e.filter=="string"&&e.filter.length>0&&ye(t,`Re-implement syncpack \`filter\` regex (${e.filter}) once vis exposes a top-level dep filter.`),(Array.isArray(e.sortAz)&&e.sortAz.length>0||Array.isArray(e.sortFirst)&&e.sortFirst.length>0||Array.isArray(e.sortExports)&&e.sortExports.length>0)&&ue(t,"syncpack sort options (sortAz / sortFirst / sortExports) are superseded by `vis sort-package-json` — no migration needed."),(e.sortPackages!==void 0||e.formatBugs!==void 0||e.formatRepository!==void 0)&&ue(t,"syncpack package.json shape options (sortPackages / formatBugs / formatRepository) are superseded by `vis sort-package-json` — no migration needed."),(e.lintFormatting!==void 0||e.lintSemverRanges!==void 0||e.lintVersions!==void 0)&&ue(t,"syncpack lint toggles (lintFormatting / lintSemverRanges / lintVersions) are covered by `vis lint` by default — no migration needed."),Array.isArray(e.source)&&e.source.length>0&&ye(t,`syncpack \`source\` was set to [${e.source.map(r=>JSON.stringify(r)).join(", ")}]. vis derives workspace globs from pnpm-workspace.yaml / package.json#workspaces — verify they match before relying on \`vis lint\`.`),typeof e.indent=="string"&&e.indent.length>0&&ue(t,"syncpack `indent` is implicit in vis — JSON writers honor `.editorconfig` (and the source file's existing indentation). No migration needed.")},"noteUnsupportedKeys"),sk=Le((e,t)=>{const r={};if(!Array.isArray(e.versionGroups))return r;for(const n of e.versionGroups){if(!n||typeof n!="object")continue;const s=n;if(!rk(s))continue;const i=Array.isArray(s.dependencies)?s.dependencies.filter(l=>typeof l=="string"&&l.length>0):[];if(i.length===0){ue(t,"versionGroup with `isBanned: true` has no `dependencies` entries — skipped.");continue}const o=Array.isArray(s.packages)?s.packages.filter(l=>typeof l=="string"&&l.length>0):[],a=s.label,c=typeof a=="string"&&a.length>0?a:"banned via syncpack versionGroups";for(const l of i){if(r[l]!==void 0){ue(t,`Multiple banned versionGroups target "${l}" — kept the first match; merge manually if needed.`);continue}r[l]=o.length>0?{packages:o,reason:c}:c}}return r},"translateBannedDeps"),DU=Le(e=>{const t=[`name: ${JSON.stringify(e.name)}`,`path: ${JSON.stringify(e.path)}`,`strategy: ${JSON.stringify(e.strategy)}`];return e.depName!==void 0&&t.push(`depName: ${JSON.stringify(e.depName)}`),` { ${t.join(", ")} }`},"formatExtraTypeLiteral"),CU=Le((e,t)=>{if(typeof t=="string")return` ${JSON.stringify(e)}: ${JSON.stringify(t)}`;const r=[`reason: ${JSON.stringify(t.reason)}`];return t.packages&&t.packages.length>0&&r.push(`packages: [${t.packages.map(n=>JSON.stringify(n)).join(", ")}]`),t.paths&&t.paths.length>0&&r.push(`paths: [${t.paths.map(n=>JSON.stringify(n)).join(", ")}]`),t.replacement!==void 0&&r.push(`replacement: ${JSON.stringify(t.replacement)}`),` ${JSON.stringify(e)}: { ${r.join(", ")} }`},"formatBannedDepRule"),yp=Le((e,t={})=>{const r=[],n=Object.entries(t);if(n.length>0){const s=n.map(([i,o])=>CU(i,o)).join(`,
|
|
1165
1165
|
`);r.push(` bannedDeps: {
|
|
1166
1166
|
${s},
|
|
1167
|
-
}`)}if(e.length>0){const s=e.map(i=>
|
|
1167
|
+
}`)}if(e.length>0){const s=e.map(i=>DU(i)).join(`,
|
|
1168
1168
|
`);r.push(` customTypes: {
|
|
1169
1169
|
extraTypes: [
|
|
1170
1170
|
${s},
|
|
@@ -1172,29 +1172,29 @@ ${s},
|
|
|
1172
1172
|
}`)}return` policy: {
|
|
1173
1173
|
${r.join(`,
|
|
1174
1174
|
`)},
|
|
1175
|
-
}`},"generatePolicySnippet"),ik=Le((e,t)=>{const r=[],n=Object.keys(t).length;return e.length>0&&r.push(`${String(e.length)} customType(s)`),n>0&&r.push(`${String(n)} bannedDep(s)`),r.join(" + ")},"summarizePolicyContents"),
|
|
1175
|
+
}`},"generatePolicySnippet"),ik=Le((e,t)=>{const r=[],n=Object.keys(t).length;return e.length>0&&r.push(`${String(e.length)} customType(s)`),n>0&&r.push(`${String(n)} bannedDep(s)`),r.join(" + ")},"summarizePolicyContents"),EU=Le((e,t,r,n={})=>{const s=ik(t,n);if(s==="")return!1;const i=Hn(e);if(i){const c=H(i);if(vU.test(c))return r.warn(`vis.config.ts already has a "policy" block — please merge ${s} manually.`),!1;const l=yp(t,n);let u;return wg.test(c)?u=c.replace(wg,`$1
|
|
1176
1176
|
${l},`):kg.test(c)&&(u=c.replace(kg,`$1
|
|
1177
1177
|
${l},`)),u?(we(i),Oe(i,u,"utf8"),r.info(`Merged ${s} into ${i}`),!0):(r.warn(`Could not auto-insert policy block into ${i} — please add manually`),!1)}const o=D(e,"vis.config.ts"),a=`import { defineConfig } from "@visulima/vis/config";
|
|
1178
1178
|
|
|
1179
1179
|
export default defineConfig({
|
|
1180
1180
|
${yp(t,n)},
|
|
1181
1181
|
});
|
|
1182
|
-
`;return Oe(o,a,"utf8"),r.info(`Created ${o} with ${s}`),!0},"insertPolicyIntoVisConfig"),
|
|
1183
|
-
`,"utf8")}return n},"removeSyncpackFromPackageJson")
|
|
1184
|
-
`)},"renderVisConfig"),Cg=nh((e,t,r,n)=>{const s=y1(e,"turbo.json");if(!s){r.warn("No turbo.json found in workspace root — nothing to migrate."),n.warnings.push("No turbo.json at workspace root.");return}const i=
|
|
1185
|
-
`);for(const r of e){t.info(` • ${r.entry.title} — ${r.entry.description}`);for(const n of r.preview)t.info(` ${n}`);t.info("")}t.info("Run a specific migration with `vis migrate <name>` (e.g. `vis migrate deps`).")},"renderFallbackTable"),UU=ck(async e=>{const t=e.workspaceRoot??process.cwd(),r=e.visConfig??{},n=IU(t,r),s=NU(n).map(p=>({entry:p,preview:p.probe(n)}));if(!(process.stdout.isTTY&&!Rr)){VU(s,e.logger);return}if(s.length===0){e.logger.info("No applicable migrations detected in this workspace.");return}const i=new p4(s),o=r.tui?.autoExit??!1,a=o===!0?3:typeof o=="number"?o:0,c=await mS(bs.createElement(C4,{autoExitSeconds:a,isDryRun:!1,store:i}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit();if(!c||c.length===0){e.logger.info("No migrations selected — exiting.");return}const l=Ft(),u=[];for(const p of c)try{e.logger.info(`── Applying ${p.entry.title} ──`),p.entry.apply(n,l,e.logger),e.logger.info("")}catch(f){u.push({entry:p.entry,error:f}),e.logger.warn(`Failed to apply ${p.entry.title}: ${f.message}`)}MU(l,e.logger),u.length>0&&(e.logger.warn(""),e.logger.warn(`${String(u.length)} migration(s) failed — see messages above.`),process.exitCode=1)},"runMigrateInteractive");var GU=Object.defineProperty,qU=d((e,t)=>GU(e,"name",{value:t,configurable:!0}),"e$j");const HU={description:"Analyze and optimize dependencies using e18e replacements and @socketregistry overrides",examples:[["vis optimize","Interactive TUI to select and apply optimizations"],["vis optimize --dry-run","Preview available optimizations"],["vis optimize --pin","Pin Socket.dev overrides to exact versions"],["vis optimize --prod","Only optimize production dependencies"]],group:"Workspace",loader:qU(()=>import("./handler38.js").then(e=>e.h),"loader"),name:"optimize",options:[{alias:"d",defaultValue:!1,description:"Preview available optimizations without applying",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Pin Socket.dev overrides to exact versions",name:"pin",type:Boolean},{defaultValue:!1,description:"Only optimize production dependencies",name:"prod",type:Boolean},{defaultValue:!1,description:"Skip running install after applying overrides",name:"no-install",type:Boolean},{description:"Output format: table or json (default: table)",name:"format",type:String}]};var zU=Object.defineProperty,JU=d((e,t)=>zU(e,"name",{value:t,configurable:!0}),"e$i");const KU={argument:{description:"Subcommand and arguments (e.g., cache dir, publish --dry-run, list --depth 0)",name:"args",type:String},description:"Package manager utilities (cache, publish, audit, list, config, etc.)",examples:[["vis pm cache dir","Show cache directory"],["vis pm cache clean","Clean cache"],["vis pm publish --dry-run","Preview publishing"],["vis pm list --depth 0","List direct dependencies"],["vis pm audit","Run security audit"],["vis pm whoami","Show logged-in user"]],group:"System",loader:JU(()=>import("./handler19.js"),"loader"),name:"pm"};var YU=Object.defineProperty,XU=d((e,t)=>YU(e,"name",{value:t,configurable:!0}),"e$h");const QU={alias:["rm","un","uninstall"],argument:{description:"Packages to remove",name:"packages",type:String},description:"Remove packages using the detected package manager",examples:[["vis remove lodash","Remove a package"],["vis rm old-package","Remove using alias"],["vis remove --filter app react","Remove from specific workspace"],["vis remove -g typescript","Remove global package"]],group:"Dependencies",loader:XU(()=>import("./handler20.js"),"loader"),name:"remove",options:[{alias:"D",defaultValue:!1,description:"Remove from devDependencies",name:"save-dev",type:Boolean},{alias:"g",defaultValue:!1,description:"Remove global package",name:"global",type:Boolean},{alias:"r",defaultValue:!1,description:"Remove from all workspace packages",name:"recursive",type:Boolean},{alias:"w",defaultValue:!1,description:"Remove from workspace root",name:"workspace-root",type:Boolean},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String}]},ZU={description:"Replay a previous task run from .vis/runs/ — show task results without re-executing",examples:[["vis replay","Show the most recent run summary"],["vis replay --run 2026-04-28T12-34-56_ab12","Inspect a specific historical run"],["vis replay --list","List every recorded run, newest first"],["vis replay --task @myorg/app:build","Focus on one task within the loaded run"],["vis replay --failed","Filter to only failed tasks"],["vis replay --format=json","Machine-readable output for CI"]],group:"Workspace",loader:Se(()=>import("./handler21.js"),"replayExecute"),name:"replay",options:[{description:"Run id to replay (defaults to the most recent run)",name:"run",type:String},{defaultValue:!1,description:"List every available run instead of replaying one",name:"list",type:Boolean},{description:"Filter the replay to a single task id (e.g. @my/app:build)",name:"task",type:String},{defaultValue:!1,description:"Filter the replay to failed tasks only",name:"failed",type:Boolean},{description:"Output format: table or json (default: table)",name:"format",type:String}]};var eG=Object.defineProperty,tG=d((e,t)=>eG(e,"name",{value:t,configurable:!0}),"e$g");const rG={argument:{description:"The target to run (e.g., build, test, lint)",name:"target",type:String},description:"Run a target across workspace projects",examples:[["vis run","List all available targets"],["vis run build","Run build on all projects"],["vis run :build","Run build on all projects (moon-style)"],["vis run ~:test","Run test on the project closest to the current directory"],['vis run "#frontend:build"',"Run build on projects tagged 'frontend'"],['vis run :build --query "language=typescript"',"Filter by project metadata"],["vis run test --affected","Run test only on git-changed projects"],["vis run build --fail-fast","Stop on first failure"],["vis run build --dry-run","Show execution plan without running"],["vis run destroy --reverse","Run leaves-first (teardown order, e.g. CDK/Pulumi destroy)"]],group:"Run & Execute",loader:tG(()=>import("./handler48.js"),"loader"),name:"run",options:[{alias:"p",description:"Comma-separated list of projects to run",name:"projects",type:String},{defaultValue:!1,description:"Skip the toolchain pre-flight (no auto-install for any pinned tool: node / pnpm / yarn / npm / bun / deno / go / python / ruby / rust)",name:"skip-toolchain",type:Boolean},{description:"Detect lockfile/node_modules drift before running (warns in TTY, fails in CI). Use --no-preflight to disable.",name:"preflight",type:Boolean},{defaultValue:3,description:"Maximum number of parallel tasks (falls back to VIS_RUN_CONCURRENCY_LIMIT env var, then 3)",name:"parallel",type:Number},{defaultValue:!0,description:"Enable caching (use --no-cache to disable)",name:"cache",type:Boolean},{description:"Comma-separated selectors of tasks to bypass cache for (e.g. 'app:test', ':e2e', '#flaky:lint'). Other tasks in the run still cache normally. --no-cache wins when both are set.",name:"skip-cache",type:String},{description:"Custom cache directory",name:"cache-dir",type:String},{description:"Remote cache mode: read | write | readwrite (defaults to readwrite when remoteCache is configured)",name:"cache-mode",type:String},{description:"Remote cache wire backend: http (Turborepo-compatible) or reapi (Bazel Remote Execution API gRPC)",name:"cache-backend",type:String},{defaultValue:!1,description:"Show what would run without executing",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Generate a run summary after execution",name:"summarize",type:Boolean},{description:'Partition tasks for distributed CI (e.g., "1/4" for first of four runners). Falls back to VIS_PARTITION env var.',name:"partition",type:String},{defaultValue:!1,description:"Skip project constraint validation",name:"skip-constraints",type:Boolean},{description:"Filter matched projects by a query (e.g. 'language=typescript && tag=lib')",name:"query",type:String},{defaultValue:!1,description:"Only run on projects affected by git changes (shorthand for vis affected)",name:"affected",type:Boolean},{defaultValue:!1,description:"Rerun affected tasks on file change. Ctrl+C to exit.",name:"watch",type:Boolean},{defaultValue:!1,description:"Stop all tasks on first failure",name:"fail-fast",type:Boolean},{defaultValue:!1,description:"Run the dependency graph in reverse (leaves first, then their dependents). Useful for teardown targets like `destroy`/`undeploy` where dependents must run before the things they depend on.",name:"reverse",type:Boolean},{description:"Output mode: interleaved (pass-through), labeled (prefix each line with [pkg#task]), or grouped (vite-task-style block)",name:"log",type:String},{description:"Output style: normal (print every task) or quiet (skip output for successful/cached tasks; failed tasks still print in CI mode, and remain in TUI scrollback in interactive mode). Per-target options.outputStyle overrides this.",name:"output-style",type:String},{defaultValue:!1,description:"Run every task through a pseudo-terminal so color-aware tools render as if attached to a TTY (disables caching)",name:"pty",type:Boolean},{description:"Global retry budget: cap on total task retries across the run (per-target retryCount is still honored up to the budget)",name:"retry-budget",type:Number},{description:"Write a Chrome Tracing JSON profile of the run to this path (open in chrome://tracing or Perfetto)",name:"profile",type:String},{defaultValue:!1,description:"Render the most-recent run's saved summary (from .vis/last-summary.json) and exit without executing any tasks",name:"last-details",type:Boolean},{defaultValue:!0,description:"Show flaky task report on failure (use --no-flaky to suppress)",name:"flaky",type:Boolean},{defaultValue:!1,description:"Treat any task that needed at least one retry as a run failure (exit non-zero), even when retries eventually succeeded. Use in CI to surface flakes that retries would otherwise mask.",name:"fail-on-retry",type:Boolean},{description:"Fail a task if its command references an env var that is unset (no silent empty-string substitution). Use --no-strict-env to disable when set in config.",name:"strict-env",type:Boolean},{description:"Comma-separated tags this runner advertises (e.g. 'gpu,slow'). Tasks declaring `options.runnerTags` only run when at least one tag overlaps. Untagged tasks always run. Falls back to VIS_RUNNER_TAGS env var.",name:"runner-tags",type:String},{description:"Auto-start service deps. One of: auto | ephemeral | persistent | off. Defaults to `auto` in TTY, `off` in CI.",name:"services",type:String},{defaultValue:!1,description:"Stop services this run auto-started in registry mode when the run exits (clean, q, or Ctrl+C). Ephemeral services already die with the run.",name:"stop-services",type:Boolean}]};var nG=Object.defineProperty,sG=d((e,t)=>nG(e,"name",{value:t,configurable:!0}),"e$f");const iG={description:"Generate a CycloneDX 1.7 Software Bill of Materials for the workspace",examples:[["vis sbom","Write the full-workspace SBOM to sbom.cdx.json"],["vis sbom --focus=my-app","Scope the SBOM to my-app's transitive closure"],["vis sbom --focus=my-app,other","Focus multiple projects"],["vis sbom --format=xml --output=sbom.cdx.xml","Emit XML instead of JSON"],["vis sbom --include-dev","Include devDependencies (default: production only)"],["vis sbom --output=-","Write to stdout"]],group:"Security & Health",loader:sG(()=>import("./handler22.js"),"loader"),name:"sbom",options:[{description:"Project name(s) to focus on — comma-separated for multiple",name:"focus",type:String},{defaultValue:"json",description:"Output format: json (default) or xml",name:"format",type:String},{description:"Output path (use '-' for stdout; default: sbom.cdx.json)",name:"output",type:String},{defaultValue:!1,description:"Include devDependencies (default: production only)",name:"include-dev",type:Boolean}]};var oG=Object.defineProperty,aG=d((e,t)=>oG(e,"name",{value:t,configurable:!0}),"e$e");const cG={argument:{description:"One or more paths to scan (defaults to workspace root)",name:"paths",type:String},description:"Scan a repository for hardcoded secrets and credentials",examples:[["vis secrets","Scan the workspace with grouped, colourised output"],["vis secrets --staged","Scan only files staged for the current commit (pre-commit hooks)"],["vis secrets --since main","Scan only files changed since the `main` branch"],["vis secrets --affected","Scan only projects affected by the current branch"],["vis secrets --init","Write an initial baseline from current findings"],["vis secrets --list-rules","Print all bundled detection rules"],["vis secrets --list-validators","Print non-HTTP validator types in the ruleset + install hints for each"],["vis secrets --exclude-rule generic-api-key --exclude-rule aws-access-token","Drop noisy rules"],["vis secrets --include-rule stripe-access-token","Check a single rule"],["vis secrets --enable-rule tag:preset:weak-passwords","Enable an opt-in rule group additively (defaults still fire)"],["vis secrets --include-rule tag:preset:password-manager","Restrict output to one opt-in group only"],["vis secrets --min-confidence high","Drop rules without a high confidence label (CI-friendly precision filter)"],["vis secrets --validate --only-verified","Live-verify each finding against its provider (one HTTP call per finding)"],["vis secrets --exclude 'dist/**' --exclude-from .secretsignore","Extra gitignore-syntax exclusions for the walker"],["vis secrets --config ./leaks.json --no-extend-bundled","Use only the supplied config, skip the bundled ruleset"],["vis secrets --concurrency 4","Cap the rayon thread pool (0 / omit = auto)"],["vis secrets --baseline .secrets-baseline.json","Suppress known findings; print diff vs. baseline"],["vis secrets --update-baseline","Merge current findings into the baseline (use --replace-baseline to overwrite)"],["vis secrets --format sarif > report.sarif","SARIF output for GitHub code-scanning"]],group:"Security",loader:aG(()=>import("./handler49.js"),"loader"),name:"secrets",options:[{description:"Path to a JSON config (gitleaks-compatible shape). Defaults to the bundled ruleset.",name:"config",type:String},{description:"Drop rules below this author-declared confidence: low (default), medium, high. Rules without a declared confidence (every gitleaks rule) are treated as low, so --min-confidence medium or higher drops them along with explicit low-confidence rules.",name:"min-confidence",type:String},{defaultValue:!1,description:"Live-verify each finding against its provider (one HTTP call per finding, max 8 concurrent). Only supports Kingfisher-style HTTP validators with StatusMatch / WordMatch response matchers; other types (gRPC, multi-step, checksum) mark the finding as validation=skipped. WARNING: sends candidate secrets to the provider — some providers alert their security team on failed auth attempts.",name:"validate",type:Boolean},{defaultValue:!1,description:"With --validate, drop every finding whose validation is not 'verified'. Useful for CI gating.",name:"only-verified",type:Boolean},{defaultValue:!1,description:"With --config, do not merge on top of the bundled ruleset — replace it.",name:"no-extend-bundled",type:Boolean},{defaultValue:"text",description:"Output format: text (default), json, sarif",name:"format",type:String},{description:"Path to a baseline JSON of previously-triaged findings",name:"baseline",type:String},{defaultValue:!1,description:"Scan only files staged for commit",name:"staged",type:Boolean},{description:"Scan only files changed since <ref> (e.g. main, origin/HEAD)",name:"since",type:String},{defaultValue:!1,description:"Scan only projects affected by the current branch",name:"affected",type:Boolean},{description:"Enable an opt-in rule or tag without restricting output — additive (e.g. tag:preset:weak-passwords, tag:preset:password-manager). Repeatable.",multiple:!0,name:"enable-rule",type:String},{description:"Rule id or tag:<name> selector — whitelist, only matching findings are emitted. Implies enablement. Repeatable.",multiple:!0,name:"include-rule",type:String},{description:"Rule id or tag:<name> selector — drop matching findings. Repeatable.",multiple:!0,name:"exclude-rule",type:String},{description:"Gitignore-syntax pattern to exclude from the walk (repeatable)",multiple:!0,name:"exclude",type:String},{description:"Path to a gitignore-shaped file the walker should honor (repeatable)",multiple:!0,name:"exclude-from",type:String},{defaultValue:!1,description:"Mask secret values in output",name:"redact",type:Boolean},{defaultValue:!1,description:"Scan dotfiles",name:"include-hidden",type:Boolean},{defaultValue:!1,description:"Do not respect .gitignore",name:"no-gitignore",type:Boolean},{description:"Skip files larger than this (bytes). Default: 10 MiB",name:"max-size",type:Number},{description:"Rayon worker threads (0 / omit = auto)",name:"concurrency",type:Number},{defaultValue:!1,description:"Merge current findings into the baseline and exit 0",name:"update-baseline",type:Boolean},{defaultValue:!1,description:"With --update-baseline, replace rather than merge",name:"replace-baseline",type:Boolean},{defaultValue:!1,description:"Scaffold a baseline from current findings",name:"init",type:Boolean},{defaultValue:!1,description:"With --init, preview the baseline without writing files",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Print all bundled detection rules and exit",name:"list-rules",type:Boolean},{defaultValue:!1,description:"Print non-HTTP validator types referenced by the current ruleset, with install hints for their optional peer dependencies.",name:"list-validators",type:Boolean},{defaultValue:!1,description:"Suppress all progress output (only emit findings)",name:"quiet",type:Boolean},{defaultValue:!1,description:"Print diagnostic info (skipped rules, etc.)",name:"verbose",type:Boolean}]};var lG=Object.defineProperty,fi=d((e,t)=>lG(e,"name",{value:t,configurable:!0}),"e$d");const uG={commandPath:["security"],description:"List build-script status — allowed, unapproved, and stale allowlist entries",examples:[["vis security list","Show the full build-script triage report"],["vis security list --json","Emit the report as JSON for tooling"]],group:"Security & Health",loader:fi(()=>import("./list.js"),"loader"),name:"list",options:[{defaultValue:!1,description:"Emit the report as JSON instead of human-readable text",name:"json",type:Boolean}]},pG={commandPath:["security"],description:"Push vis.config security settings to the package manager's native config",examples:[["vis security sync","Sync allowBuilds + minimumReleaseAge to the PM-native config files"],["vis security sync --skip-allow-builds","Sync only the minimumReleaseAge knobs"],["vis security sync --skip-min-release-age","Sync only allowBuilds (trustedDependencies / onlyBuiltDependencies)"]],group:"Security & Health",loader:fi(()=>import("./sync2.js"),"loader"),name:"sync",options:[{defaultValue:!1,description:"Skip syncing allowBuilds (trustedDependencies, onlyBuiltDependencies)",name:"skip-allow-builds",type:Boolean},{defaultValue:!1,description:"Skip syncing minimumReleaseAge and its excludes",name:"skip-min-release-age",type:Boolean}]},dG={commandPath:["security"],description:"Run lifecycle scripts for packages in security.policies.installScripts.allow (LavaMoat 'run' parity)",examples:[["vis security run","Run preinstall/install/postinstall for every approved package"],["vis security run --with-root","Also run the workspace root's prepublish + prepare hooks"],["vis security run --root-only","Run only the workspace root's prepublish + prepare hooks"]],group:"Security & Health",loader:fi(()=>import("./run.js"),"loader"),name:"run",options:[{defaultValue:!1,description:"Also run the workspace root's prepublish + prepare hooks after dependencies",name:"with-root",type:Boolean},{defaultValue:!1,description:"Skip dependency scripts and only run the workspace root's prepublish + prepare hooks",name:"root-only",type:Boolean}]},fG={commandPath:["security"],description:"Install @lavamoat/preinstall-always-fail as a devDep so a missing ignore-scripts setting fails loudly",examples:[["vis security tripwire","Install the tripwire devDependency"],["vis security tripwire --status","Report whether the tripwire is installed"],["vis security tripwire --remove","Remove the tripwire from package.json"]],group:"Security & Health",loader:fi(()=>import("./tripwire.js"),"loader"),name:"tripwire",options:[{defaultValue:!1,description:"Report whether @lavamoat/preinstall-always-fail is installed",name:"status",type:Boolean},{defaultValue:!1,description:"Remove @lavamoat/preinstall-always-fail from package.json",name:"remove",type:Boolean}]},hG={commandPath:["security"],description:"Force-refresh the cached npm signing keys used by the signatures marshall",examples:[["vis security keys-refresh","Drop the disk cache and fetch a fresh key set from registry.npmjs.org"],["vis security keys-refresh --clear","Only drop the cache, do not refetch"],["vis security keys-refresh --json","Emit the refresh result as JSON for tooling"]],group:"Security & Health",loader:fi(()=>import("./keys-refresh.js"),"loader"),name:"keys-refresh",options:[{defaultValue:!1,description:"Only clear the cache, do not refetch",name:"clear",type:Boolean},{defaultValue:!1,description:"Emit the result as JSON instead of human-readable text",name:"json",type:Boolean}]},mG={commandPath:["security"],description:"Verify the entire lockfile closure against supply-chain policies (firstSeen, publisherChange, blockExoticSubdeps)",examples:[["vis security verify-lockfile","Re-validate every locked entry; exit non-zero on a policy violation"],["vis security verify-lockfile --offline","Verify without network (skips firstSeen / publisherChange)"],["vis security verify-lockfile --json","Emit the verification result as JSON for CI"]],group:"Security & Health",loader:fi(()=>import("./verify-lockfile.js"),"loader"),name:"verify-lockfile",options:[{defaultValue:!1,description:"Emit the result as JSON instead of human-readable text",name:"json",type:Boolean},{defaultValue:!1,description:"Skip network-bound policies (firstSeen, publisherChange)",name:"offline",type:Boolean}]},gG=[uG,pG,dG,fG,hG,mG],hl={description:"Target id, e.g. @my/api:db",name:"targetId",type:String},yG={description:"Output format: table or json (default: table)",name:"format",type:String},vG={argument:hl,commandPath:["service"],description:"Start a service target detached so it survives across `vis run` invocations",examples:[["vis service start @my/api:db","Boot the db target as a long-lived service"],["vis service start @my/api:db --timeout=60000","Override readiness timeout"],["vis service start @my/api:db --no-readiness","Skip the readiness probe"]],group:"Workspace",loader:Se(()=>import("./handler23.js"),"serviceStartExecute"),name:"start",options:[{description:"Readiness probe timeout in milliseconds",name:"timeout",type:Number},{defaultValue:!1,description:"Skip the readiness probe",name:"no-readiness",type:Boolean}]},bG={argument:{description:"Target id to stop, or omit when using --all",name:"targetId",required:!1,type:String},commandPath:["service"],description:"Stop a running service",examples:[["vis service stop @my/api:db","Stop the db service"],["vis service stop --all","Stop every running service in this workspace"]],group:"Workspace",loader:Se(()=>import("./handler23.js"),"serviceStopExecute"),name:"stop",options:[{defaultValue:!1,description:"Stop every service registered for this workspace",name:"all",type:Boolean},{description:"Override the SIGTERM→SIGKILL grace period in milliseconds",name:"grace-ms",type:Number}]},$G={commandPath:["service"],description:"List services registered for this workspace",examples:[["vis service list","Print running services"],["vis service list --format=json","Machine-readable list"]],group:"Workspace",loader:Se(()=>import("./handler23.js"),"serviceListExecute"),name:"list",options:[yG]},wG={argument:hl,commandPath:["service"],description:"Re-run the readiness probe and report a service's health",examples:[["vis service status @my/api:db","Check whether the db service is reachable"]],group:"Workspace",loader:Se(()=>import("./handler23.js"),"serviceStatusExecute"),name:"status",options:[{description:"Probe timeout in milliseconds",name:"timeout",type:Number}]},kG={argument:hl,commandPath:["service"],description:"Stop and re-start a running service",examples:[["vis service restart @my/api:db","Recycle the db service"],["vis service restart @my/api:db --no-readiness","Recycle and skip the readiness probe"]],group:"Workspace",loader:Se(()=>import("./handler23.js"),"serviceRestartExecute"),name:"restart",options:[{description:"Readiness probe timeout in milliseconds",name:"timeout",type:Number},{description:"Override the SIGTERM→SIGKILL grace period in milliseconds",name:"grace-ms",type:Number},{defaultValue:!1,description:"Skip the readiness probe after restart",name:"no-readiness",type:Boolean}]},SG={argument:hl,commandPath:["service"],description:"Print or tail a service's captured stdout/stderr",examples:[["vis service logs @my/api:db","Print the captured log"],["vis service logs @my/api:db -f","Tail the log (Ctrl-C to exit)"]],group:"Workspace",loader:Se(()=>import("./handler23.js"),"serviceLogsExecute"),name:"logs",options:[{alias:"f",defaultValue:!1,description:"Follow the log file (like `tail -f`)",name:"follow",type:Boolean}]},DG=[vG,bG,$G,wG,kG,SG];var CG=Object.defineProperty,EG=d((e,t)=>CG(e,"name",{value:t,configurable:!0}),"e$c");const jG={description:"Sort package.json files across the workspace using the sort-package-json Rust crate",examples:[["vis sort-package-json","Sort all package.json files in the workspace"],["vis sort-package-json --check","Check if files are already sorted (exit 1 if not)"],["vis sort-package-json --sort-scripts","Also sort the scripts field alphabetically"],["vis sort-package-json --indent 4","Force 4-space indentation (overrides per-file detection)"],["vis sort-package-json --indent tab","Force tab indentation"],["vis sort-package-json --ignore '**/fixtures/**'","Skip files matching one or more glob patterns"],["vis sort-package-json --sort-order name,version,license","Pin a custom prefix order before the default field order"],["vis sort-package-json --unsorted dependencies,devDependencies","Preserve original key order for the listed top-level sections"],["vis sort-package-json --no-final-newline","Do not append a trailing newline"],["vis sort-package-json --line-ending crlf","Force CRLF line endings (default: auto-detect per file)"]],group:"Workspace",loader:EG(()=>import("./handler37.js"),"loader"),name:"sort-package-json",options:[{alias:"c",defaultValue:!1,description:"Check if package.json files are sorted without writing (exits 1 if unsorted)",name:"check",type:Boolean},{defaultValue:!1,description:"Also sort the scripts field alphabetically",name:"sort-scripts",type:Boolean},{description:"Indent override: a number of spaces, the literal `tab`, or a literal whitespace string. When unset, the original file's indent is preserved.",name:"indent",type:String},{description:"Glob pattern of files to skip (basename match, or path-relative when the pattern contains `/`). Repeatable.",multiple:!0,name:"ignore",type:String},{description:"Comma-separated list of top-level keys to place first, before the default field order. Repeatable.",multiple:!0,name:"sort-order",type:String},{description:"Comma-separated list of top-level sections whose key order should be preserved (e.g. dependencies,devDependencies). Repeatable.",multiple:!0,name:"unsorted",type:String},{defaultValue:!1,description:"Do not append a trailing newline to the output (default: append one).",name:"no-final-newline",type:Boolean},{defaultValue:"auto",description:"Line ending to write: auto (per-file detection, default), lf, or crlf.",name:"line-ending",type:String},{description:"Disable collapsing `bugs: { url }` to the bare string form (default: enabled).",name:"no-format-bugs",type:Boolean},{description:"Disable collapsing `repository: { type, url }` to the GitHub `owner/repo` shorthand (default: enabled).",name:"no-format-repository",type:Boolean},{description:"Disable canonical sorting of `exports` condition keys (default: enabled).",name:"no-sort-exports",type:Boolean},{description:"Disable .editorconfig discovery for indent / line-ending defaults (default: enabled).",name:"no-editorconfig",type:Boolean}]};var AG=Object.defineProperty,xG=d((e,t)=>AG(e,"name",{value:t,configurable:!0}),"e$b");const OG={description:"Run linters on staged files using config from vis.config.ts",examples:[["vis staged","Run staged linters"],["vis staged --verbose","Run with verbose output"],["vis staged --no-stash","Run without backup stash"],["vis staged --diff HEAD~1","Run against a specific diff"]],group:"Run & Execute",loader:xG(()=>import("./handler47.js"),"loader"),name:"staged",options:[{defaultValue:!1,description:"Allow empty commits when tasks revert all staged changes",name:"allow-empty",type:Boolean},{defaultValue:!1,description:"Automatically stage new files that tasks create during the run",name:"auto-stage",type:Boolean},{description:"Number of concurrent tasks or false for serial",name:"concurrent",type:String},{defaultValue:!1,description:"Run all tasks to completion even if one fails",name:"continue-on-error",type:Boolean},{description:"Working directory to run all tasks in",name:"cwd",type:String},{defaultValue:!1,description:"Enable debug output",name:"debug",type:Boolean},{description:"Override the default --staged flag of git diff",name:"diff",type:String},{description:"Override the default diff-filter",name:"diff-filter",type:String},{defaultValue:!1,description:"Fail with exit code 1 when tasks modify tracked files",name:"fail-on-changes",type:Boolean},{defaultValue:!1,description:"Kill in-flight tasks with SIGKILL on fast-fail instead of the default SIGTERM",name:"force-kill",type:Boolean},{defaultValue:!1,description:"Hide unstaged changes from partially staged files",name:"hide-partially-staged",type:Boolean},{defaultValue:!1,description:"Hide all unstaged changes before running tasks",name:"hide-unstaged",type:Boolean},{defaultValue:!1,description:"Suppress console output",name:"quiet",type:Boolean},{defaultValue:!1,description:"Pass filepaths relative to cwd to tasks",name:"relative",type:Boolean},{defaultValue:!1,description:"Revert to original state in case of errors",name:"revert",type:Boolean},{defaultValue:!0,description:"Enable backup stash",name:"stash",type:Boolean},{defaultValue:!1,description:"Show task output even when tasks succeed",name:"verbose",type:Boolean}]};var PG=Object.defineProperty,FG=d((e,t)=>PG(e,"name",{value:t,configurable:!0}),"t$9");const BG={description:"Show a workspace health dashboard at a glance",examples:[["vis status","Full status overview"],["vis status --json","Machine-readable output"]],group:"Workspace",loader:FG(()=>import("./handler24.js"),"loader"),name:"status",options:[{defaultValue:!1,description:"Emit JSON output",name:"json",type:Boolean}]};var RG=Object.defineProperty,TG=d((e,t)=>RG(e,"name",{value:t,configurable:!0}),"e$a");const NG={argument:{description:"What to sync: codeowners | package-json-fields",name:"kind",type:String},description:"Synchronise derived workspace artefacts (codeowners, package.json fields, tsconfig refs, …)",examples:[["vis sync codeowners","Generate CODEOWNERS at the repository root"],["vis sync codeowners --out=.github/CODEOWNERS","Write to .github/CODEOWNERS instead"],["vis sync codeowners --check","Fail if the existing file is stale"],["vis sync codeowners --from=project-json,nested-codeowners","Also aggregate nested CODEOWNERS files in the tree"],["vis sync codeowners --regeneration-command='pnpm codeowners'","Set a custom header instruction"],["vis sync codeowners --preserve-block","Splice the generated block between markers in an existing CODEOWNERS"],["vis sync codeowners --write-guard","Also emit GitHub + GitLab Write Guard CI for restricted projects"],["vis sync package-json-fields","Mirror license/author/repository/bugs/homepage/engines from root to every workspace package"],["vis sync package-json-fields --check","Fail if any workspace package.json is out of sync"],["vis sync package-json-fields --fields license,engines","Override the default field list for this run"]],group:"Workspace",loader:TG(()=>import("./handler36.js"),"loader"),name:"sync",options:[{description:"Output path for the generated file (default: <workspace>/CODEOWNERS) — codeowners kind only",name:"out",type:String},{defaultValue:!1,description:"Verify state without writing (exit non-zero if drift is found)",name:"check",type:Boolean},{description:"Input sources for codeowners. Comma-separated or repeated. Values: project-json | nested-codeowners | package-json-maintainers. Defaults to project-json.",multiple:!0,name:"from",type:String},{description:"Glob (repeatable) used to discover nested CODEOWNERS files. Defaults to `**/CODEOWNERS`.",multiple:!0,name:"nested-includes",type:String},{description:"Header instruction shown to reviewers (replaces the default 'update project.json' note). Codeowners kind only.",name:"regeneration-command",type:String},{defaultValue:!1,description:"Splice the generated block between markers in the existing file instead of overwriting it. Codeowners kind only.",name:"preserve-block",type:Boolean},{defaultValue:!1,description:"Also emit a .github/workflows/write-guard.yml scoped to projects with `restricted: true` in project.json. Codeowners kind only.",name:"write-guard",type:Boolean},{description:"Comma-separated list of fields to mirror from root → workspace packages (package-json-fields kind only). Repeatable.",multiple:!0,name:"fields",type:String},{description:"Glob pattern of package names to skip (package-json-fields kind only). Repeatable.",multiple:!0,name:"ignore-package-name",type:String},{defaultValue:"human",description:"Output format for package-json-fields: human | json",name:"format",type:String},{defaultValue:!1,description:"Suppress per-package log lines; print only the summary (package-json-fields kind only)",name:"quiet",type:Boolean}]};var IG=Object.defineProperty,LG=d((e,t)=>IG(e,"name",{value:t,configurable:!0}),"t$7");const _G={argument:{description:"Task ID to explain (e.g. @my/app:build)",name:"taskId",type:String},description:"Explain why a task is included in the graph by walking its dependency chain to a root",examples:[["vis task-why @myorg/app:build","Show what pulls build in"],["vis task-why lib-a:test","Check the test task's triggers"]],group:"Workspace",loader:LG(()=>import("./handler25.js"),"loader"),name:"task-why"};var MG=Object.defineProperty,WG=d((e,t)=>MG(e,"name",{value:t,configurable:!0}),"e$9");const VG={argument:{description:"Subcommand: status | detect | install | use | which",name:"action",type:String},description:"Inspect and delegate to the workspace version managers (proto, mise, fnm, volta, asdf, nvm, corepack)",examples:[["vis toolchain status","Show every detected manager + expected vs actual tool versions"],["vis toolchain install","Install pinned versions — per-tool delegation"],["vis toolchain use node@22.13.0","Pin node 22.13.0 via the best runtime manager"],["vis toolchain use pnpm@10.32.1","Update the packageManager field; pnpm self-activates"],["vis toolchain which node","Resolve the node binary the manager would launch"],["vis toolchain detect","Print the primary manager's name"]],group:"Workspace",loader:WG(()=>import("./handler26.js"),"loader"),name:"toolchain",options:[{defaultValue:!1,description:"With `status`: exit 1 if any tool mismatches",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Print the command that would run, but don't execute",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Emit JSON (status subcommand only)",name:"json",type:Boolean},{defaultValue:!0,description:"With `use`: also mirror the version into engines.<tool> when that field already exists. --no-engines to skip.",name:"engines",type:Boolean}]};var UG=Object.defineProperty,GG=d((e,t)=>UG(e,"name",{value:t,configurable:!0}),"e$8");const qG={argument:{description:"Packages to unlink (omit for current package)",name:"packages",type:String},description:"Unlink a previously linked package",examples:[["vis unlink","Unlink current package"],["vis unlink react","Unlink specific package"],["vis unlink -r","Unlink in all workspace packages"]],group:"Dependencies",loader:GG(()=>import("./handler27.js"),"loader"),name:"unlink",options:[{alias:"r",defaultValue:!1,description:"Unlink in all workspace packages",name:"recursive",type:Boolean}]};var HG=Object.defineProperty,zG=d((e,t)=>HG(e,"name",{value:t,configurable:!0}),"e$7");const JG={alias:"up",argument:{description:"Packages to update (updates all if omitted)",name:"packages",type:String},description:"Update packages to their latest versions",examples:[["vis update react","Update react within semver range"],["vis up react -L","Update react to latest"],["vis update -i","Interactive mode"],["vis update --filter app","Update in specific workspace"],["vis update -r","Update in all workspaces"],["vis update --target minor","Only apply minor/patch updates (catalog mode)"],["vis update --dry-run","Preview changes without applying"],["vis update --exclude '@types/*'","Exclude packages by pattern"],["vis update --changelog","Show changelog links after updating"],["vis update --rollback","Restore catalog from last backup"],["vis update --ai","Run AI analysis before applying updates"]],group:"Dependencies",loader:zG(()=>import("./handler45.js"),"loader"),name:"update",options:[{alias:"L",conflicts:"target",description:"Update to latest version (ignore semver range; equivalent to --target latest)",name:"latest",type:Boolean},{alias:"t",conflicts:"latest",description:"Update target: latest, minor, or patch (default: latest, catalog mode)",name:"target",type:String},{alias:"d",defaultValue:!1,description:"Preview changes without applying",name:"dry-run",type:Boolean},{alias:"g",defaultValue:!1,description:"Update global packages",name:"global",type:Boolean},{alias:"r",defaultValue:!1,description:"Update recursively in all workspace packages",name:"recursive",type:Boolean},{description:"Filter packages in monorepo (pm-wrapper mode; catalog mode uses --include/--exclude)",name:"filter",type:String},{alias:"w",defaultValue:!1,description:"Include workspace root",name:"workspace-root",type:Boolean},{alias:"D",conflicts:"prod",description:"Update only devDependencies",name:"dev",type:Boolean},{alias:"P",conflicts:"dev",description:"Update only dependencies",name:"prod",type:Boolean},{alias:"i",defaultValue:!1,description:"Interactive mode",name:"interactive",type:Boolean},{defaultValue:!1,description:"Don't update optionalDependencies",name:"no-optional",type:Boolean},{defaultValue:!1,description:"Include peerDependencies in update checks",name:"peer",type:Boolean},{defaultValue:!1,description:"Also check workspace-owned package names against the registry (catalog mode)",name:"include-internal",type:Boolean},{alias:"l",defaultValue:!1,description:"Include packages with pinned/exact versions (no ^ or ~ prefix; catalog mode)",name:"include-locked",type:Boolean},{defaultValue:!1,description:"Update lockfile only",name:"no-save",type:Boolean},{description:"Glob pattern to include packages (repeatable, catalog mode)",lazyMultiple:!0,name:"include",type:String},{description:"Glob pattern to exclude packages (repeatable, catalog mode)",lazyMultiple:!0,name:"exclude",type:String},{defaultValue:!1,description:"Include prerelease versions (catalog mode)",name:"prerelease",type:Boolean},{description:"Check for known security vulnerabilities via OSV.dev (default: true; --no-security to skip)",name:"security",type:Boolean},{defaultValue:!1,description:"Skip catalog mode, use package manager directly",name:"no-catalog",type:Boolean},{description:"Output format: table, json, or minimal (default: table)",name:"format",type:String},{defaultValue:!1,description:"Show changelog URLs for updated packages",name:"changelog",type:Boolean},{description:"Run install after catalog update, --no-install to skip (default: true)",name:"install",type:Boolean},{defaultValue:!1,description:"Restore catalog file from the last backup",name:"rollback",type:Boolean},{defaultValue:!1,description:"Run AI analysis on outdated packages before updating (catalog mode)",name:"ai",type:Boolean},{description:"AI analysis type: impact, security, compatibility, or recommend (default: impact)",name:"ai-type",type:String},{defaultValue:!1,description:"Skip typosquat name check for package arguments",name:"no-typosquat-check",type:Boolean},{defaultValue:!1,description:"Skip the offline marshall pipeline (author, provenance, metadata, downloads, expired-domains, new-bin, signatures, archived-repo) when explicit package arguments are supplied",name:"no-marshall-check",type:Boolean},{description:"Cap concurrent registry requests during outdated checks (default: 8)",name:"max-concurrent-requests",type:Number},{description:"Release channel filter: stable (default), same (match current's prerelease channel), or any",name:"release-channel",type:String},{alias:"y",defaultValue:!1,description:"Skip the confirmation prompt for blanket --latest updates. Required in non-TTY contexts (CI) when running `vis update --latest` without explicit package arguments.",name:"yes",type:Boolean},{defaultValue:!1,description:"Skip the GitHub Actions ecosystem scan (workflows + composite action.yml files)",name:"no-actions",type:Boolean},{defaultValue:!1,description:"Skip the Docker ecosystem scan (Dockerfile + docker-compose images)",name:"no-docker",type:Boolean},{defaultValue:!1,description:"Skip the GitLab CI ecosystem scan (.gitlab-ci.yml + .gitlab/ci/**)",name:"no-gitlab",type:Boolean},{defaultValue:!1,description:"Include branch references (e.g. actions/checkout@main) when scanning workflows",name:"include-branches",type:Boolean},{description:"Reference style for GitHub Actions updates: sha (default, pin to commit SHA + version comment) or preserve",name:"style",type:String},{description:"GitHub token for actions resolution (overrides GITHUB_TOKEN / GH_TOKEN env)",name:"actions-token",type:String},{description:"GitLab token for include-ref resolution (overrides GITLAB_TOKEN / CI_JOB_TOKEN env)",name:"gitlab-token",type:String}]};var KG=Object.defineProperty,YG=d((e,t)=>KG(e,"name",{value:t,configurable:!0}),"e$6");const XG={argument:{description:"Target version (defaults to latest)",name:"version",type:String},description:"Update vis itself to the latest version",examples:[["vis self-update","Update to latest"],["vis self-update 2.0.0","Install specific version"],["vis self-update --check","Check for updates without installing"]],group:"System",loader:YG(()=>import("./handler28.js"),"loader"),name:"self-update",options:[{defaultValue:!1,description:"Check for updates without installing",name:"check",type:Boolean},{defaultValue:!1,description:"Reinstall even if already current",name:"force",type:Boolean},{defaultValue:!1,description:"Suppress output (CI mode)",name:"silent",type:Boolean}]};var QG=Object.defineProperty,ZG=d((e,t)=>QG(e,"name",{value:t,configurable:!0}),"e$5");const eq={alias:"explain",argument:{description:"Package(s) to explain",name:"packages",type:String},description:"Show why a package is installed (dependency chain)",examples:[["vis why react","Show why react is installed"],["vis why react --json","Output as JSON"],["vis why react -r","Check across all workspaces"],["vis explain react","Alias matching npm's command"]],group:"Dependencies",loader:ZG(()=>import("./handler29.js"),"loader"),name:"why",options:[{defaultValue:!1,description:"Output as JSON",name:"json",type:Boolean},{defaultValue:!1,description:"Show extended information (pnpm)",name:"long",type:Boolean},{defaultValue:!1,description:"Machine-readable output (pnpm)",name:"parseable",type:Boolean},{alias:"r",defaultValue:!1,description:"Check across all workspaces",name:"recursive",type:Boolean},{alias:"D",conflicts:"prod",description:"Filter to dev dependencies (pnpm)",name:"dev",type:Boolean},{alias:"P",conflicts:"dev",description:"Filter to production dependencies (pnpm)",name:"prod",type:Boolean},{defaultValue:!1,description:"Exclude optional dependencies (pnpm)",name:"no-optional",type:Boolean},{alias:"g",defaultValue:!1,description:"Check globally installed packages (pnpm)",name:"global",type:Boolean},{description:"Limit dependency tree depth",name:"depth",type:Number},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String}]},Eg="\x1B]",jg="\x07",ha=";";var tq=Object.defineProperty,rq=d((e,t)=>tq(e,"name",{value:t,configurable:!0}),"n$7"),nq=Object.defineProperty,sq=rq((e,t)=>nq(e,"name",{value:t,configurable:!0}),"n"),iq=Object.defineProperty,oq=sq((e,t)=>iq(e,"name",{value:t,configurable:!0}),"n");const aq=oq((e,t)=>[Eg,"8",ha,ha,t,jg,e,Eg,"8",ha,ha,jg].join(""),"hyperlink");var cq=Object.defineProperty,ml=d((e,t)=>cq(e,"name",{value:t,configurable:!0}),"e$4");ml((e,t)=>!process.stderr.isTTY||process.env.TERM==="dumb"?e===t?t:`${e} (${On(t)})`:aq(e,t),"link");const lq=ml(()=>{if(process.env.VIS_VERSION)return process.env.VIS_VERSION;try{const e=new URL("../../package.json",import.meta.url);return le(e).version}catch{return"0.0.0"}},"getVersion"),uq=ml(()=>{process.env.VIS_VERSION=lq()},"injectVersion"),pq=ml(e=>{!process.stdout.isTTY||Rr||process.env.TERM==="dumb"||process.stdout.write(`\x1B]0;${e}\x07`)},"setTerminalTitle");var dq=Object.defineProperty,fq=d((e,t)=>dq(e,"name",{value:t,configurable:!0}),"v$2");const hq={beforeCommand:fq(async e=>{try{const t=e.options?.cwd,r=e.options?.config;let n;if(t)n=Ke(process.cwd(),t);else{const a=process.env.VIS_MONOREPO_ROOT;n=a&&a.length>0?a:o0(process.cwd()).path}e.workspaceRoot=n;const s=r?Ke(process.cwd(),r):void 0;let i=s??Hn(n);try{e.visConfig=await uh(n,s?{explicitConfigPath:s}:void 0);const a=e.visConfig?.versionConstraint;if(a&&!Fs.validRange(a)){e.logger.error(""),e.logger.error(Dl(Qt("✖ Invalid versionConstraint"))),e.logger.error(` vis.config.ts has versionConstraint ${Qt(JSON.stringify(a))}, which is not a valid semver range.`),e.logger.error(""),process.exitCode=1;return}if(a&&!Fs.satisfies(Fa.version,a)){e.logger.error(""),e.logger.error(Dl(Qt("✖ vis version too old"))),e.logger.error(` vis.config.ts requires vis ${Qt(a)}, but the current version is ${Qt(Fa.version)}.`),e.logger.error(` ${_i("→")} Upgrade: ${Gr("pnpm add -D @visulima/vis@latest")}`),e.logger.error(""),process.exitCode=1;return}}catch(a){const c=i,l=a instanceof Error?a.message:String(a);e.visConfigError={file:c??void 0,message:l};const u=!!process.stdout.isTTY&&!Rr;if(c&&!u){if(e.logger.error(""),e.logger.error(Dl(Qt(`✖ Failed to load ${c}`))),e.logger.error(` ${l}`),e.logger.error(""),l.includes("Cannot find module")){const p=/Cannot find module '([^']+)'/.exec(l)?.[1]??"unknown";e.logger.error(`${_i("→ Hint:")} The module ${Qt(p)} could not be resolved.`),p.includes("@visulima/vis")?(e.logger.error(" This usually means the package isn't installed or the export path changed."),e.logger.error(` Try: ${Gr("pnpm add @visulima/vis")}`),e.logger.error(` Or regenerate: ${Gr("vis init --force")}`)):e.logger.error(` Try: ${Gr(`pnpm add ${p}`)}`)}else l.includes("SyntaxError")||l.includes("Unexpected token")?(e.logger.error(`${_i("→ Hint:")} The config file has a syntax error.`),e.logger.error(" Check your config for typos or invalid syntax."),e.logger.error(` Or regenerate: ${Gr("vis init --force")}`)):(e.logger.error(`${_i("→ Hint:")} Delete the broken config and recreate it:`),e.logger.error(` ${Gr(`rm ${c} && vis init`)}`));e.logger.error(""),e.logger.error(` Continuing with default settings.
|
|
1182
|
+
`;return Oe(o,a,"utf8"),r.info(`Created ${o} with ${s}`),!0},"insertPolicyIntoVisConfig"),jU=Le((e,t)=>{const r=D(e,"package.json"),n={catalogStripped:!1,configRemoved:!1,dependencyRemoved:!1,removedScripts:[],scriptCount:0};if(!j(r))return n;const s=H(r),i=JSON.parse(s);let o=!1;i.syncpack&&(delete i.syncpack,o=!0,n.configRemoved=!0);for(const u of["dependencies","devDependencies"]){const p=i[u];p?.syncpack&&(delete p.syncpack,o=!0,n.dependencyRemoved=!0)}const a=i.workspaces;if(a&&typeof a=="object"&&!Array.isArray(a)){const u=a.catalog;u&&typeof u.syncpack=="string"&&(delete u.syncpack,o=!0,n.catalogStripped=!0);const p=a.catalogs;if(p&&typeof p=="object")for(const f of Object.values(p))f&&typeof f.syncpack=="string"&&(delete f.syncpack,o=!0,n.catalogStripped=!0)}const c=i.catalog;c&&typeof c.syncpack=="string"&&(delete c.syncpack,o=!0,n.catalogStripped=!0);const l=i.scripts;if(l){const u={};for(const[p,f]of Object.entries(l))typeof f=="string"&&rh.test(f)?(n.scriptCount+=1,n.removedScripts.push({name:p,value:f}),o=!0):u[p]=f;n.scriptCount>0&&(Object.keys(u).length===0?delete i.scripts:i.scripts=u)}if(o){const u=Xo(r,s,{useEditorconfig:t});we(r),Oe(r,`${JSON.stringify(i,void 0,u)}
|
|
1183
|
+
`,"utf8")}return n},"removeSyncpackFromPackageJson"),AU=[".husky/pre-commit",".vis-hooks/pre-commit",".git/hooks/pre-commit"],xU=[".github/workflows",".gitlab-ci.yml",".circleci/config.yml",".woodpecker.yml",".drone.yml"],ok=Le((e,t)=>{const r=[],n=Le(s=>{const i=D(e,s);j(i)&&rh.test(H(i))&&(r.push(s),ye(t,`Update ${s} — replace \`syncpack\` invocation(s) with \`vis lint\` / \`vis sort-package-json\` as appropriate.`))},"scanFile");for(const s of xU){const i=D(e,s);if(j(i)){if(s===".github/workflows"){try{for(const o of Ze(i))(o.endsWith(".yml")||o.endsWith(".yaml"))&&n(`.github/workflows/${o}`)}catch{}continue}n(s)}}return r},"detectCiReferences"),ak=Le((e,t)=>{const r=[];for(const n of AU){const s=D(e,n);j(s)&&rh.test(H(s))&&(r.push(n),ye(t,`Update ${n} — replace \`syncpack\` invocation with \`vis lint\` / \`vis sort-package-json\` as appropriate.`))}return r},"detectHookReferences"),OU=Le(e=>{const t=D(e,"pnpm-workspace.yaml");if(!j(t))return!1;let r;try{r=Lt(t)}catch{return!1}if(!r||typeof r!="object")return!1;let n=!1;const s=r.catalog;s&&typeof s.syncpack=="string"&&(delete s.syncpack,n=!0);const i=r.catalogs;if(i&&typeof i=="object")for(const o of Object.values(i))o&&typeof o.syncpack=="string"&&(delete o.syncpack,n=!0);return n&&(we(t),No(t,r)),n},"removeSyncpackFromPnpmCatalogs"),PU=Le((e,t)=>{for(const r of[...Z1,...eh]){const n=D(e,r);j(n)&&(we(n,t),Jn(n),at(t,gp,"removedConfigCount"))}},"removeSyncpackConfigFiles"),FU=Le((e,t,r,n,s)=>{const i=tk(t,s);nk(t,s);const o=ak(e,s);o.length>0&&!r.silent&&n.warn(`Found syncpack reference in ${String(o.length)} hook file(s) — see manualSteps for details.`);const a=ok(e,s);a.length>0&&!r.silent&&n.warn(`Found syncpack reference in ${String(a.length)} CI file(s) — see manualSteps for details.`);const c=sk(t,s);(i.length>0||Object.keys(c).length>0)&&EU(e,i,n,c);const{catalogStripped:l,configRemoved:u,dependencyRemoved:p,removedScripts:f,scriptCount:m}=jU(e,r.useEditorconfig);u&&!r.silent&&n.info("Removed `syncpack` block from package.json"),p&&at(s,gp,"removedPackageCount");const $=OU(e);if((l||$)&&!r.silent&&n.info("Stripped `syncpack` from catalog protocol entries."),m>0){at(s,gp,"rewrittenScriptCount",m);for(const{name:b,value:k}of f)ye(s,`Recreate script \`${b}\` (removed; was \`${k}\`). Replace \`syncpack\` with \`vis lint\` / \`vis sort-package-json\` as appropriate.`);r.silent||n.info(`Removed ${String(m)} script(s) referencing \`syncpack\`. Replace with \`vis lint\` / \`vis sort-package-json\` as appropriate.`)}PU(e,s)},"applyMigration"),Dg=Le((e,t,r,n)=>{const s=ek(e);if(!s)return t.silent||r.info("No syncpack configuration found — nothing to migrate."),!1;const i=bU(e);i&&(ue(n,`Syncpack config ${i} is a TS/JS format vis migrate cannot load — executable config support is tracked in https://github.com/visulima/visulima/issues/622. Convert to .syncpackrc.json and re-run.`),ye(n,`Convert ${i} to .syncpackrc.json (or translate it directly into policy.customTypes.extraTypes in vis.config.ts) — see https://github.com/visulima/visulima/issues/622`),t.silent||r.warn(`Cannot read ${i} — manual migration required (https://github.com/visulima/visulima/issues/622).`)),$U(e)&&(ue(n,"vis.config.ts already declares `policy.customTypes.extraTypes` — skipping syncpack customTypes merge to avoid duplicates."),t.silent||r.warn("vis.config.ts already has policy.customTypes.extraTypes — skipping merge"));const o=SU(e,s,n);if(!o)return!1;if(t.dryRun){const a=tk(o,n),c=sk(o,n);nk(o,n),ak(e,n),ok(e,n);const l=ik(a,c);return t.silent||(l===""?r.info("[dry-run] No policy entries to merge — manualSteps will surface the rest."):(r.info(`[dry-run] Would merge ${l} into vis.config.ts:`),r.info(yp(a,c)))),!0}return FU(e,o,t,r,n),!0},"migrateSyncpack");var BU=Object.defineProperty,nh=d((e,t)=>BU(e,"name",{value:t,configurable:!0}),"l$8");const RU=nh(e=>e.map(t=>{if(t.startsWith("^"))return{dependencies:!0,target:t.slice(1)};if(t.includes("#")){const[r,n]=t.split("#");return{projects:r,target:n}}return t}),"convertDependsOn"),TU=nh((e,t,r)=>{const n=e.tasks??e.pipeline??{},s={};for(const[a,c]of Object.entries(n)){if(a.includes("#"))continue;const l={};c.persistent&&(l.persistent=!0),c.interactive&&(l.interactive=!0);const u={};c.cache===!1&&(u.cache=!1),c.dependsOn&&c.dependsOn.length>0&&(u.dependsOn=RU(c.dependsOn)),c.inputs&&c.inputs.length>0&&(u.inputs=c.inputs),c.outputs&&c.outputs.length>0&&(u.outputs=c.outputs),c.env&&c.env.length>0&&(u.env=c.env),c.passThroughEnv&&c.passThroughEnv.length>0&&(u.passThroughEnv=c.passThroughEnv),Object.keys(l).length>0&&(u.options=l),s[a]=u}const i={};Object.keys(s).length>0&&(i.tasks=s);const o={};return e.globalDependencies&&e.globalDependencies.length>0&&(o.globalInputs=e.globalDependencies),e.globalEnv&&e.globalEnv.length>0&&(o.globalEnv=e.globalEnv),e.globalPassThroughEnv&&e.globalPassThroughEnv.length>0&&(o.globalPassThroughEnv=e.globalPassThroughEnv),Object.keys(o).length>0&&(i.taskRunner=o),["// Migrated from turbo.json by `vis migrate turborepo`.","// Review the generated `tasks` block and move project-specific tasks","// into each project's project.json.","",'import { defineConfig } from "@visulima/vis/config";',"",`export default defineConfig(${Wf(i,D(t,"vis.config.ts"),r)});`,""].join(`
|
|
1184
|
+
`)},"renderVisConfig"),Cg=nh((e,t,r,n)=>{const s=y1(e,"turbo.json");if(!s){r.warn("No turbo.json found in workspace root — nothing to migrate."),n.warnings.push("No turbo.json at workspace root.");return}const i=TU(s,e,t.useEditorconfig);if(!Vf(e,i,t,r,n))return;n.manualSteps.push("Review the `tasks` block in vis.config.ts — project-specific tasks (turbo's project#task syntax) were skipped and should be moved into each project's project.json."),n.manualSteps.push("vis adds two task primitives turbo doesn't have: `when: { os, env, branch, ci, not.* }` for conditional execution and `always: true` for finally/teardown tasks that run even when upstream fails. See docs/guides/conditional-and-finally-tasks.mdx.");const o=s.tasks??s.pipeline??{};Object.values(o).some(a=>a.outputLogs!==void 0)&&n.warnings.push("`outputLogs` was found on one or more tasks but vis has no equivalent setting — review and remove."),s.remoteCache?.enabled&&n.manualSteps.push("turbo remote cache detected. vis speaks the same HTTP protocol — set taskRunner.remoteCache { url, token, teamId } in vis.config.ts, or keep your TURBO_API / TURBO_TOKEN / TURBO_TEAM env vars (vis honours them as fallbacks).")},"migrateTurborepo");var NU=Object.defineProperty,ne=d((e,t)=>NU(e,"name",{value:t,configurable:!0}),"n$e");const IU=/\b(?:husky|lint-staged|nano-staged)\b/,LU=ne(e=>{const t=D(e,"package.json");if(j(t))try{return JSON.parse(H(t))}catch{return}},"readPackageJson"),_U=ne((e,t)=>{const r=LU(e);if(!r)return!1;const n={...r.dependencies,...r.devDependencies};for(const i of i1)if(n[i])return!0;if(r.scripts){for(const i of Object.values(r.scripts))if(typeof i=="string"&&IU.test(i))return!0}const{overrides:s}=t;return s?Object.keys(s).length>0:!1},"detectDepsNeedsMigration"),MU=ne(e=>j(D(e,"turbo.json")),"detectTurborepo"),WU=ne(e=>j(D(e,"nx.json")),"detectNx"),VU=ne(e=>j(D(e,".moon")),"detectMoon"),Wt=ne(()=>{const e=[];return{lines:e,logger:{info:ne(t=>{e.push(t)},"info"),warn:ne(t=>{e.push(`⚠ ${t}`)},"warn")}}},"createCapturingLogger"),UU=[{apply:ne(({packageManager:e,root:t,visConfig:r},n,s)=>{eg(t,e,r,{dryRun:!1},s,n)},"apply"),description:"Remove husky/lint-staged/nano-staged from package.json and rewrite scripts to `vis staged`.",detect:ne(({root:e,visConfig:t})=>_U(e,t),"detect"),id:"deps",probe:ne(({packageManager:e,root:t,visConfig:r})=>{const{lines:n,logger:s}=Wt(),i=Ft();return eg(t,e,r,{dryRun:!0},s,i),n},"probe"),title:"Dependencies & scripts"},{apply:ne(({root:e},t,r)=>{og(e,{dryRun:!1},r,t)},"apply"),description:"Inline lint-staged configuration into vis.config.ts.",detect:ne(({root:e})=>!!m1(e),"detect"),id:"lint-staged",probe:ne(({root:e})=>{const{lines:t,logger:r}=Wt(),n=Ft();return og(e,{dryRun:!0},r,n),t},"probe"),title:"lint-staged"},{apply:ne(({root:e},t,r)=>{ug(e,{dryRun:!1},r,t)},"apply"),description:"Inline nano-staged configuration into vis.config.ts.",detect:ne(({root:e})=>!!v1(e),"detect"),id:"nano-staged",probe:ne(({root:e})=>{const{lines:t,logger:r}=Wt(),n=Ft();return ug(e,{dryRun:!0},r,n),t},"probe"),title:"nano-staged"},{apply:ne(({root:e},t,r)=>{Cg(e,{dryRun:!1},r,t)},"apply"),description:"Translate turbo.json tasks into vis.config.ts.",detect:ne(({root:e})=>MU(e),"detect"),id:"turborepo",probe:ne(({root:e})=>{const{lines:t,logger:r}=Wt(),n=Ft();return Cg(e,{dryRun:!0},r,n),t},"probe"),title:"Turborepo"},{apply:ne(({root:e},t,r)=>{pg(e,{dryRun:!1},r,t)},"apply"),description:"Translate nx.json targets into vis.config.ts.",detect:ne(({root:e})=>WU(e),"detect"),id:"nx",probe:ne(({root:e})=>{const{lines:t,logger:r}=Wt(),n=Ft();return pg(e,{dryRun:!0},r,n),t},"probe"),title:"Nx"},{apply:ne(({root:e},t,r)=>{ag(e,{copyTemplates:!1,dryRun:!1},r,t)},"apply"),description:"Translate .moon/tasks.yml into vis.config.ts.",detect:ne(({root:e})=>VU(e),"detect"),id:"moon",probe:ne(({root:e})=>{const{lines:t,logger:r}=Wt(),n=Ft();return ag(e,{copyTemplates:!1,dryRun:!0},r,n),t},"probe"),title:"Moon"},{apply:ne(({root:e},t,r)=>{tg(e,{dryRun:!1},r,t)},"apply"),description:"Convert gitleaks config/baseline/hooks to `vis secrets`.",detect:ne(({root:e})=>!!(al(e)??If(e)??Lf(e)),"detect"),id:"gitleaks",probe:ne(({root:e})=>{const{lines:t,logger:r}=Wt(),n=Ft();return tg(e,{dryRun:!0},r,n),t},"probe"),title:"Gitleaks"},{apply:ne(({root:e},t,r)=>{ng(e,{dryRun:!1},r,t)},"apply"),description:"Convert Kingfisher baseline/rules/hooks to `vis secrets`.",detect:ne(({root:e})=>!!(_f(e)??cl(e)),"detect"),id:"kingfisher",probe:ne(({root:e})=>{const{lines:t,logger:r}=Wt(),n=Ft();return ng(e,{dryRun:!0},r,n),t},"probe"),title:"Kingfisher"},{apply:ne(({root:e},t,r)=>{dg(e,{dryRun:!1},r,t)},"apply"),description:"Replace secretlint config/hooks with `vis secrets`.",detect:ne(({root:e})=>!!(k1(e)??S1(e)),"detect"),id:"secretlint",probe:ne(({root:e})=>{const{lines:t,logger:r}=Wt(),n=Ft();return dg(e,{dryRun:!0},r,n),t},"probe"),title:"Secretlint"},{apply:ne(({root:e},t,r)=>{Dg(e,{dryRun:!1},r,t)},"apply"),description:"Translate syncpack customTypes into policy.customTypes.extraTypes and strip the syncpack dep/scripts.",detect:ne(({root:e})=>!!ek(e),"detect"),id:"syncpack",probe:ne(({root:e})=>{const{lines:t,logger:r}=Wt(),n=Ft();return Dg(e,{dryRun:!0},r,n),t},"probe"),title:"Syncpack"},{apply:ne(({root:e},t,r)=>{fg(e,{dryRun:!1},r,t)},"apply"),description:"Strip sherif config/dep/scripts and surface ignore-rules as a positive `vis lint --<rule>` command.",detect:ne(({root:e})=>!!D1(e)||C1(e),"detect"),id:"sherif",probe:ne(({root:e})=>{const{lines:t,logger:r}=Wt(),n=Ft();return fg(e,{dryRun:!0},r,n),t},"probe"),title:"Sherif"}],GU=ne(e=>UU.filter(t=>t.detect(e)),"getApplicableMigrations"),qU=ne((e,t)=>({packageManager:a1(e),root:e,visConfig:t}),"buildProbeContext");var HU=Object.defineProperty,zU=d((e,t)=>HU(e,"name",{value:t,configurable:!0}),"s$a");const JU=zU((e,t)=>{t.info("── Migration Summary ──");const r=[["Staged configs merged into vis.config.ts",e.mergedStagedConfigCount],["Lint-staged configs inlined",e.inlinedLintStagedConfigCount],["Config files removed",e.removedConfigCount],["Packages removed",e.removedPackageCount],["Scripts rewritten",e.rewrittenScriptCount]];for(const[s,i]of r)i>0&&t.info(` ${s}: ${String(i)}`);e.gitHooksConfigured&&t.info(" Pre-commit hook updated to use vis staged");const n=Object.entries(e.perMigration);if(n.length>0){t.info(""),t.info("By migration:");for(const[s,i]of n){const o=[];i.removedConfigCount>0&&o.push(`${String(i.removedConfigCount)} config(s) removed`),i.removedPackageCount>0&&o.push(`${String(i.removedPackageCount)} package(s) removed`),i.rewrittenScriptCount>0&&o.push(`${String(i.rewrittenScriptCount)} script(s) rewritten`),t.info(` ${s}: ${o.join(", ")||"no changes"}`)}}if(e.backupsCreated.length>0&&(t.info(""),t.info(`Created ${String(e.backupsCreated.length)} .bak file(s) for rollback. Remove them once you're happy.`)),e.warnings.length>0){t.info(""),t.warn("Warnings:");for(const s of e.warnings)t.warn(` - ${s}`)}if(e.manualSteps.length>0){t.info(""),t.info("Manual steps required:");for(const s of e.manualSteps)t.info(` - ${s}`)}},"printSummary");var KU=Object.defineProperty,ck=d((e,t)=>KU(e,"name",{value:t,configurable:!0}),"c$5");const YU=ck((e,t)=>{if(e.length===0){t.info("No applicable migrations detected in this workspace.");return}t.info(`Detected migrations (non-interactive preview):
|
|
1185
|
+
`);for(const r of e){t.info(` • ${r.entry.title} — ${r.entry.description}`);for(const n of r.preview)t.info(` ${n}`);t.info("")}t.info("Run a specific migration with `vis migrate <name>` (e.g. `vis migrate deps`).")},"renderFallbackTable"),XU=ck(async e=>{const t=e.workspaceRoot??process.cwd(),r=e.visConfig??{},n=qU(t,r),s=GU(n).map(p=>({entry:p,preview:p.probe(n)}));if(!(process.stdout.isTTY&&!Rr)){YU(s,e.logger);return}if(s.length===0){e.logger.info("No applicable migrations detected in this workspace.");return}const i=new b4(s),o=r.tui?.autoExit??!1,a=o===!0?3:typeof o=="number"?o:0,c=await mS(bs.createElement(B4,{autoExitSeconds:a,isDryRun:!1,store:i}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit();if(!c||c.length===0){e.logger.info("No migrations selected — exiting.");return}const l=Ft(),u=[];for(const p of c)try{e.logger.info(`── Applying ${p.entry.title} ──`),p.entry.apply(n,l,e.logger),e.logger.info("")}catch(f){u.push({entry:p.entry,error:f}),e.logger.warn(`Failed to apply ${p.entry.title}: ${f.message}`)}JU(l,e.logger),u.length>0&&(e.logger.warn(""),e.logger.warn(`${String(u.length)} migration(s) failed — see messages above.`),process.exitCode=1)},"runMigrateInteractive");var QU=Object.defineProperty,ZU=d((e,t)=>QU(e,"name",{value:t,configurable:!0}),"e$j");const eG={description:"Analyze and optimize dependencies using e18e replacements and @socketregistry overrides",examples:[["vis optimize","Interactive TUI to select and apply optimizations"],["vis optimize --dry-run","Preview available optimizations"],["vis optimize --pin","Pin Socket.dev overrides to exact versions"],["vis optimize --prod","Only optimize production dependencies"]],group:"Workspace",loader:ZU(()=>import("./handler38.js").then(e=>e.h),"loader"),name:"optimize",options:[{alias:"d",defaultValue:!1,description:"Preview available optimizations without applying",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Pin Socket.dev overrides to exact versions",name:"pin",type:Boolean},{defaultValue:!1,description:"Only optimize production dependencies",name:"prod",type:Boolean},{defaultValue:!1,description:"Skip running install after applying overrides",name:"no-install",type:Boolean},{description:"Output format: table or json (default: table)",name:"format",type:String}]};var tG=Object.defineProperty,rG=d((e,t)=>tG(e,"name",{value:t,configurable:!0}),"e$i");const nG={argument:{description:"Subcommand and arguments (e.g., cache dir, publish --dry-run, list --depth 0)",name:"args",type:String},description:"Package manager utilities (cache, publish, audit, list, config, etc.)",examples:[["vis pm cache dir","Show cache directory"],["vis pm cache clean","Clean cache"],["vis pm publish --dry-run","Preview publishing"],["vis pm list --depth 0","List direct dependencies"],["vis pm audit","Run security audit"],["vis pm whoami","Show logged-in user"]],group:"System",loader:rG(()=>import("./handler19.js"),"loader"),name:"pm"};var sG=Object.defineProperty,iG=d((e,t)=>sG(e,"name",{value:t,configurable:!0}),"e$h");const oG={alias:["rm","un","uninstall"],argument:{description:"Packages to remove",name:"packages",type:String},description:"Remove packages using the detected package manager",examples:[["vis remove lodash","Remove a package"],["vis rm old-package","Remove using alias"],["vis remove --filter app react","Remove from specific workspace"],["vis remove -g typescript","Remove global package"]],group:"Dependencies",loader:iG(()=>import("./handler20.js"),"loader"),name:"remove",options:[{alias:"D",defaultValue:!1,description:"Remove from devDependencies",name:"save-dev",type:Boolean},{alias:"g",defaultValue:!1,description:"Remove global package",name:"global",type:Boolean},{alias:"r",defaultValue:!1,description:"Remove from all workspace packages",name:"recursive",type:Boolean},{alias:"w",defaultValue:!1,description:"Remove from workspace root",name:"workspace-root",type:Boolean},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String}]},aG={description:"Replay a previous task run from .vis/runs/ — show task results without re-executing",examples:[["vis replay","Show the most recent run summary"],["vis replay --run 2026-04-28T12-34-56_ab12","Inspect a specific historical run"],["vis replay --list","List every recorded run, newest first"],["vis replay --task @myorg/app:build","Focus on one task within the loaded run"],["vis replay --failed","Filter to only failed tasks"],["vis replay --format=json","Machine-readable output for CI"]],group:"Workspace",loader:Se(()=>import("./handler21.js"),"replayExecute"),name:"replay",options:[{description:"Run id to replay (defaults to the most recent run)",name:"run",type:String},{defaultValue:!1,description:"List every available run instead of replaying one",name:"list",type:Boolean},{description:"Filter the replay to a single task id (e.g. @my/app:build)",name:"task",type:String},{defaultValue:!1,description:"Filter the replay to failed tasks only",name:"failed",type:Boolean},{description:"Output format: table or json (default: table)",name:"format",type:String}]};var cG=Object.defineProperty,lG=d((e,t)=>cG(e,"name",{value:t,configurable:!0}),"e$g");const uG={argument:{description:"The target to run (e.g., build, test, lint)",name:"target",type:String},description:"Run a target across workspace projects",examples:[["vis run","List all available targets"],["vis run build","Run build on all projects"],["vis run :build","Run build on all projects (moon-style)"],["vis run ~:test","Run test on the project closest to the current directory"],['vis run "#frontend:build"',"Run build on projects tagged 'frontend'"],['vis run :build --query "language=typescript"',"Filter by project metadata"],["vis run test --affected","Run test only on git-changed projects"],["vis run build --fail-fast","Stop on first failure"],["vis run build --dry-run","Show execution plan without running"],["vis run destroy --reverse","Run leaves-first (teardown order, e.g. CDK/Pulumi destroy)"]],group:"Run & Execute",loader:lG(()=>import("./handler48.js"),"loader"),name:"run",options:[{alias:"p",description:"Comma-separated list of projects to run",name:"projects",type:String},{defaultValue:!1,description:"Skip the toolchain pre-flight (no auto-install for any pinned tool: node / pnpm / yarn / npm / bun / deno / go / python / ruby / rust)",name:"skip-toolchain",type:Boolean},{description:"Detect lockfile/node_modules drift before running (warns in TTY, fails in CI). Use --no-preflight to disable.",name:"preflight",type:Boolean},{defaultValue:3,description:"Maximum number of parallel tasks (falls back to VIS_RUN_CONCURRENCY_LIMIT env var, then 3)",name:"parallel",type:Number},{defaultValue:!0,description:"Enable caching (use --no-cache to disable)",name:"cache",type:Boolean},{description:"Comma-separated selectors of tasks to bypass cache for (e.g. 'app:test', ':e2e', '#flaky:lint'). Other tasks in the run still cache normally. --no-cache wins when both are set.",name:"skip-cache",type:String},{description:"Custom cache directory",name:"cache-dir",type:String},{description:"Remote cache mode: read | write | readwrite (defaults to readwrite when remoteCache is configured)",name:"cache-mode",type:String},{description:"Remote cache wire backend: http (Turborepo-compatible) or reapi (Bazel Remote Execution API gRPC)",name:"cache-backend",type:String},{defaultValue:!1,description:"Show what would run without executing",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Generate a run summary after execution",name:"summarize",type:Boolean},{description:'Partition tasks for distributed CI (e.g., "1/4" for first of four runners). Falls back to VIS_PARTITION env var.',name:"partition",type:String},{defaultValue:!1,description:"Skip project constraint validation",name:"skip-constraints",type:Boolean},{description:"Filter matched projects by a query (e.g. 'language=typescript && tag=lib')",name:"query",type:String},{defaultValue:!1,description:"Only run on projects affected by git changes (shorthand for vis affected)",name:"affected",type:Boolean},{defaultValue:!1,description:"Rerun affected tasks on file change. Ctrl+C to exit.",name:"watch",type:Boolean},{defaultValue:!1,description:"Stop all tasks on first failure",name:"fail-fast",type:Boolean},{defaultValue:!1,description:"Run the dependency graph in reverse (leaves first, then their dependents). Useful for teardown targets like `destroy`/`undeploy` where dependents must run before the things they depend on.",name:"reverse",type:Boolean},{description:"Output mode: interleaved (pass-through), labeled (prefix each line with [pkg#task]), or grouped (vite-task-style block)",name:"log",type:String},{description:"Output style: normal (print every task) or quiet (skip output for successful/cached tasks; failed tasks still print in CI mode, and remain in TUI scrollback in interactive mode). Per-target options.outputStyle overrides this.",name:"output-style",type:String},{defaultValue:!1,description:"Run every task through a pseudo-terminal so color-aware tools render as if attached to a TTY (disables caching)",name:"pty",type:Boolean},{description:"Global retry budget: cap on total task retries across the run (per-target retryCount is still honored up to the budget)",name:"retry-budget",type:Number},{description:"Write a Chrome Tracing JSON profile of the run to this path (open in chrome://tracing or Perfetto)",name:"profile",type:String},{defaultValue:!1,description:"Render the most-recent run's saved summary (from .vis/last-summary.json) and exit without executing any tasks",name:"last-details",type:Boolean},{defaultValue:!0,description:"Show flaky task report on failure (use --no-flaky to suppress)",name:"flaky",type:Boolean},{defaultValue:!1,description:"Treat any task that needed at least one retry as a run failure (exit non-zero), even when retries eventually succeeded. Use in CI to surface flakes that retries would otherwise mask.",name:"fail-on-retry",type:Boolean},{description:"Fail a task if its command references an env var that is unset (no silent empty-string substitution). Use --no-strict-env to disable when set in config.",name:"strict-env",type:Boolean},{description:"Comma-separated tags this runner advertises (e.g. 'gpu,slow'). Tasks declaring `options.runnerTags` only run when at least one tag overlaps. Untagged tasks always run. Falls back to VIS_RUNNER_TAGS env var.",name:"runner-tags",type:String},{description:"Auto-start service deps. One of: auto | ephemeral | persistent | off. Defaults to `auto` in TTY, `off` in CI.",name:"services",type:String},{defaultValue:!1,description:"Stop services this run auto-started in registry mode when the run exits (clean, q, or Ctrl+C). Ephemeral services already die with the run.",name:"stop-services",type:Boolean}]};var pG=Object.defineProperty,dG=d((e,t)=>pG(e,"name",{value:t,configurable:!0}),"e$f");const fG={description:"Generate a CycloneDX 1.7 Software Bill of Materials for the workspace",examples:[["vis sbom","Write the full-workspace SBOM to sbom.cdx.json"],["vis sbom --focus=my-app","Scope the SBOM to my-app's transitive closure"],["vis sbom --focus=my-app,other","Focus multiple projects"],["vis sbom --format=xml --output=sbom.cdx.xml","Emit XML instead of JSON"],["vis sbom --include-dev","Include devDependencies (default: production only)"],["vis sbom --output=-","Write to stdout"]],group:"Security & Health",loader:dG(()=>import("./handler22.js"),"loader"),name:"sbom",options:[{description:"Project name(s) to focus on — comma-separated for multiple",name:"focus",type:String},{defaultValue:"json",description:"Output format: json (default) or xml",name:"format",type:String},{description:"Output path (use '-' for stdout; default: sbom.cdx.json)",name:"output",type:String},{defaultValue:!1,description:"Include devDependencies (default: production only)",name:"include-dev",type:Boolean}]};var hG=Object.defineProperty,mG=d((e,t)=>hG(e,"name",{value:t,configurable:!0}),"e$e");const gG={argument:{description:"One or more paths to scan (defaults to workspace root)",name:"paths",type:String},description:"Scan a repository for hardcoded secrets and credentials",examples:[["vis secrets","Scan the workspace with grouped, colourised output"],["vis secrets --staged","Scan only files staged for the current commit (pre-commit hooks)"],["vis secrets --since main","Scan only files changed since the `main` branch"],["vis secrets --affected","Scan only projects affected by the current branch"],["vis secrets --init","Write an initial baseline from current findings"],["vis secrets --list-rules","Print all bundled detection rules"],["vis secrets --list-validators","Print non-HTTP validator types in the ruleset + install hints for each"],["vis secrets --exclude-rule generic-api-key --exclude-rule aws-access-token","Drop noisy rules"],["vis secrets --include-rule stripe-access-token","Check a single rule"],["vis secrets --enable-rule tag:preset:weak-passwords","Enable an opt-in rule group additively (defaults still fire)"],["vis secrets --include-rule tag:preset:password-manager","Restrict output to one opt-in group only"],["vis secrets --min-confidence high","Drop rules without a high confidence label (CI-friendly precision filter)"],["vis secrets --validate --only-verified","Live-verify each finding against its provider (one HTTP call per finding)"],["vis secrets --exclude 'dist/**' --exclude-from .secretsignore","Extra gitignore-syntax exclusions for the walker"],["vis secrets --config ./leaks.json --no-extend-bundled","Use only the supplied config, skip the bundled ruleset"],["vis secrets --concurrency 4","Cap the rayon thread pool (0 / omit = auto)"],["vis secrets --baseline .secrets-baseline.json","Suppress known findings; print diff vs. baseline"],["vis secrets --update-baseline","Merge current findings into the baseline (use --replace-baseline to overwrite)"],["vis secrets --format sarif > report.sarif","SARIF output for GitHub code-scanning"]],group:"Security",loader:mG(()=>import("./handler49.js"),"loader"),name:"secrets",options:[{description:"Path to a JSON config (gitleaks-compatible shape). Defaults to the bundled ruleset.",name:"config",type:String},{description:"Drop rules below this author-declared confidence: low (default), medium, high. Rules without a declared confidence (every gitleaks rule) are treated as low, so --min-confidence medium or higher drops them along with explicit low-confidence rules.",name:"min-confidence",type:String},{defaultValue:!1,description:"Live-verify each finding against its provider (one HTTP call per finding, max 8 concurrent). Only supports Kingfisher-style HTTP validators with StatusMatch / WordMatch response matchers; other types (gRPC, multi-step, checksum) mark the finding as validation=skipped. WARNING: sends candidate secrets to the provider — some providers alert their security team on failed auth attempts.",name:"validate",type:Boolean},{defaultValue:!1,description:"With --validate, drop every finding whose validation is not 'verified'. Useful for CI gating.",name:"only-verified",type:Boolean},{defaultValue:!1,description:"With --config, do not merge on top of the bundled ruleset — replace it.",name:"no-extend-bundled",type:Boolean},{defaultValue:"text",description:"Output format: text (default), json, sarif",name:"format",type:String},{description:"Path to a baseline JSON of previously-triaged findings",name:"baseline",type:String},{defaultValue:!1,description:"Scan only files staged for commit",name:"staged",type:Boolean},{description:"Scan only files changed since <ref> (e.g. main, origin/HEAD)",name:"since",type:String},{defaultValue:!1,description:"Scan only projects affected by the current branch",name:"affected",type:Boolean},{description:"Enable an opt-in rule or tag without restricting output — additive (e.g. tag:preset:weak-passwords, tag:preset:password-manager). Repeatable.",multiple:!0,name:"enable-rule",type:String},{description:"Rule id or tag:<name> selector — whitelist, only matching findings are emitted. Implies enablement. Repeatable.",multiple:!0,name:"include-rule",type:String},{description:"Rule id or tag:<name> selector — drop matching findings. Repeatable.",multiple:!0,name:"exclude-rule",type:String},{description:"Gitignore-syntax pattern to exclude from the walk (repeatable)",multiple:!0,name:"exclude",type:String},{description:"Path to a gitignore-shaped file the walker should honor (repeatable)",multiple:!0,name:"exclude-from",type:String},{defaultValue:!1,description:"Mask secret values in output",name:"redact",type:Boolean},{defaultValue:!1,description:"Scan dotfiles",name:"include-hidden",type:Boolean},{defaultValue:!1,description:"Do not respect .gitignore",name:"no-gitignore",type:Boolean},{description:"Skip files larger than this (bytes). Default: 10 MiB",name:"max-size",type:Number},{description:"Rayon worker threads (0 / omit = auto)",name:"concurrency",type:Number},{defaultValue:!1,description:"Merge current findings into the baseline and exit 0",name:"update-baseline",type:Boolean},{defaultValue:!1,description:"With --update-baseline, replace rather than merge",name:"replace-baseline",type:Boolean},{defaultValue:!1,description:"Scaffold a baseline from current findings",name:"init",type:Boolean},{defaultValue:!1,description:"With --init, preview the baseline without writing files",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Print all bundled detection rules and exit",name:"list-rules",type:Boolean},{defaultValue:!1,description:"Print non-HTTP validator types referenced by the current ruleset, with install hints for their optional peer dependencies.",name:"list-validators",type:Boolean},{defaultValue:!1,description:"Suppress all progress output (only emit findings)",name:"quiet",type:Boolean},{defaultValue:!1,description:"Print diagnostic info (skipped rules, etc.)",name:"verbose",type:Boolean}]};var yG=Object.defineProperty,fi=d((e,t)=>yG(e,"name",{value:t,configurable:!0}),"e$d");const vG={commandPath:["security"],description:"List build-script status — allowed, unapproved, and stale allowlist entries",examples:[["vis security list","Show the full build-script triage report"],["vis security list --json","Emit the report as JSON for tooling"]],group:"Security & Health",loader:fi(()=>import("./list.js"),"loader"),name:"list",options:[{defaultValue:!1,description:"Emit the report as JSON instead of human-readable text",name:"json",type:Boolean}]},bG={commandPath:["security"],description:"Push vis.config security settings to the package manager's native config",examples:[["vis security sync","Sync allowBuilds + minimumReleaseAge to the PM-native config files"],["vis security sync --skip-allow-builds","Sync only the minimumReleaseAge knobs"],["vis security sync --skip-min-release-age","Sync only allowBuilds (trustedDependencies / onlyBuiltDependencies)"]],group:"Security & Health",loader:fi(()=>import("./sync2.js"),"loader"),name:"sync",options:[{defaultValue:!1,description:"Skip syncing allowBuilds (trustedDependencies, onlyBuiltDependencies)",name:"skip-allow-builds",type:Boolean},{defaultValue:!1,description:"Skip syncing minimumReleaseAge and its excludes",name:"skip-min-release-age",type:Boolean}]},$G={commandPath:["security"],description:"Run lifecycle scripts for packages in security.policies.installScripts.allow (LavaMoat 'run' parity)",examples:[["vis security run","Run preinstall/install/postinstall for every approved package"],["vis security run --with-root","Also run the workspace root's prepublish + prepare hooks"],["vis security run --root-only","Run only the workspace root's prepublish + prepare hooks"]],group:"Security & Health",loader:fi(()=>import("./run.js"),"loader"),name:"run",options:[{defaultValue:!1,description:"Also run the workspace root's prepublish + prepare hooks after dependencies",name:"with-root",type:Boolean},{defaultValue:!1,description:"Skip dependency scripts and only run the workspace root's prepublish + prepare hooks",name:"root-only",type:Boolean}]},wG={commandPath:["security"],description:"Install @lavamoat/preinstall-always-fail as a devDep so a missing ignore-scripts setting fails loudly",examples:[["vis security tripwire","Install the tripwire devDependency"],["vis security tripwire --status","Report whether the tripwire is installed"],["vis security tripwire --remove","Remove the tripwire from package.json"]],group:"Security & Health",loader:fi(()=>import("./tripwire.js"),"loader"),name:"tripwire",options:[{defaultValue:!1,description:"Report whether @lavamoat/preinstall-always-fail is installed",name:"status",type:Boolean},{defaultValue:!1,description:"Remove @lavamoat/preinstall-always-fail from package.json",name:"remove",type:Boolean}]},kG={commandPath:["security"],description:"Force-refresh the cached npm signing keys used by the signatures marshall",examples:[["vis security keys-refresh","Drop the disk cache and fetch a fresh key set from registry.npmjs.org"],["vis security keys-refresh --clear","Only drop the cache, do not refetch"],["vis security keys-refresh --json","Emit the refresh result as JSON for tooling"]],group:"Security & Health",loader:fi(()=>import("./keys-refresh.js"),"loader"),name:"keys-refresh",options:[{defaultValue:!1,description:"Only clear the cache, do not refetch",name:"clear",type:Boolean},{defaultValue:!1,description:"Emit the result as JSON instead of human-readable text",name:"json",type:Boolean}]},SG={commandPath:["security"],description:"Verify the entire lockfile closure against supply-chain policies (firstSeen, publisherChange, blockExoticSubdeps)",examples:[["vis security verify-lockfile","Re-validate every locked entry; exit non-zero on a policy violation"],["vis security verify-lockfile --offline","Verify without network (skips firstSeen / publisherChange)"],["vis security verify-lockfile --json","Emit the verification result as JSON for CI"]],group:"Security & Health",loader:fi(()=>import("./verify-lockfile.js"),"loader"),name:"verify-lockfile",options:[{defaultValue:!1,description:"Emit the result as JSON instead of human-readable text",name:"json",type:Boolean},{defaultValue:!1,description:"Skip network-bound policies (firstSeen, publisherChange)",name:"offline",type:Boolean}]},DG=[vG,bG,$G,wG,kG,SG],hl={description:"Target id, e.g. @my/api:db",name:"targetId",type:String},CG={description:"Output format: table or json (default: table)",name:"format",type:String},EG={argument:hl,commandPath:["service"],description:"Start a service target detached so it survives across `vis run` invocations",examples:[["vis service start @my/api:db","Boot the db target as a long-lived service"],["vis service start @my/api:db --timeout=60000","Override readiness timeout"],["vis service start @my/api:db --no-readiness","Skip the readiness probe"]],group:"Workspace",loader:Se(()=>import("./handler23.js"),"serviceStartExecute"),name:"start",options:[{description:"Readiness probe timeout in milliseconds",name:"timeout",type:Number},{defaultValue:!1,description:"Skip the readiness probe",name:"no-readiness",type:Boolean}]},jG={argument:{description:"Target id to stop, or omit when using --all",name:"targetId",required:!1,type:String},commandPath:["service"],description:"Stop a running service",examples:[["vis service stop @my/api:db","Stop the db service"],["vis service stop --all","Stop every running service in this workspace"]],group:"Workspace",loader:Se(()=>import("./handler23.js"),"serviceStopExecute"),name:"stop",options:[{defaultValue:!1,description:"Stop every service registered for this workspace",name:"all",type:Boolean},{description:"Override the SIGTERM→SIGKILL grace period in milliseconds",name:"grace-ms",type:Number}]},AG={commandPath:["service"],description:"List services registered for this workspace",examples:[["vis service list","Print running services"],["vis service list --format=json","Machine-readable list"]],group:"Workspace",loader:Se(()=>import("./handler23.js"),"serviceListExecute"),name:"list",options:[CG]},xG={argument:hl,commandPath:["service"],description:"Re-run the readiness probe and report a service's health",examples:[["vis service status @my/api:db","Check whether the db service is reachable"]],group:"Workspace",loader:Se(()=>import("./handler23.js"),"serviceStatusExecute"),name:"status",options:[{description:"Probe timeout in milliseconds",name:"timeout",type:Number}]},OG={argument:hl,commandPath:["service"],description:"Stop and re-start a running service",examples:[["vis service restart @my/api:db","Recycle the db service"],["vis service restart @my/api:db --no-readiness","Recycle and skip the readiness probe"]],group:"Workspace",loader:Se(()=>import("./handler23.js"),"serviceRestartExecute"),name:"restart",options:[{description:"Readiness probe timeout in milliseconds",name:"timeout",type:Number},{description:"Override the SIGTERM→SIGKILL grace period in milliseconds",name:"grace-ms",type:Number},{defaultValue:!1,description:"Skip the readiness probe after restart",name:"no-readiness",type:Boolean}]},PG={argument:hl,commandPath:["service"],description:"Print or tail a service's captured stdout/stderr",examples:[["vis service logs @my/api:db","Print the captured log"],["vis service logs @my/api:db -f","Tail the log (Ctrl-C to exit)"]],group:"Workspace",loader:Se(()=>import("./handler23.js"),"serviceLogsExecute"),name:"logs",options:[{alias:"f",defaultValue:!1,description:"Follow the log file (like `tail -f`)",name:"follow",type:Boolean}]},FG=[EG,jG,AG,xG,OG,PG];var BG=Object.defineProperty,RG=d((e,t)=>BG(e,"name",{value:t,configurable:!0}),"e$c");const TG={description:"Sort package.json files across the workspace using the sort-package-json Rust crate",examples:[["vis sort-package-json","Sort all package.json files in the workspace"],["vis sort-package-json --check","Check if files are already sorted (exit 1 if not)"],["vis sort-package-json --sort-scripts","Also sort the scripts field alphabetically"],["vis sort-package-json --indent 4","Force 4-space indentation (overrides per-file detection)"],["vis sort-package-json --indent tab","Force tab indentation"],["vis sort-package-json --ignore '**/fixtures/**'","Skip files matching one or more glob patterns"],["vis sort-package-json --sort-order name,version,license","Pin a custom prefix order before the default field order"],["vis sort-package-json --unsorted dependencies,devDependencies","Preserve original key order for the listed top-level sections"],["vis sort-package-json --no-final-newline","Do not append a trailing newline"],["vis sort-package-json --line-ending crlf","Force CRLF line endings (default: auto-detect per file)"]],group:"Workspace",loader:RG(()=>import("./handler37.js"),"loader"),name:"sort-package-json",options:[{alias:"c",defaultValue:!1,description:"Check if package.json files are sorted without writing (exits 1 if unsorted)",name:"check",type:Boolean},{defaultValue:!1,description:"Also sort the scripts field alphabetically",name:"sort-scripts",type:Boolean},{description:"Indent override: a number of spaces, the literal `tab`, or a literal whitespace string. When unset, the original file's indent is preserved.",name:"indent",type:String},{description:"Glob pattern of files to skip (basename match, or path-relative when the pattern contains `/`). Repeatable.",multiple:!0,name:"ignore",type:String},{description:"Comma-separated list of top-level keys to place first, before the default field order. Repeatable.",multiple:!0,name:"sort-order",type:String},{description:"Comma-separated list of top-level sections whose key order should be preserved (e.g. dependencies,devDependencies). Repeatable.",multiple:!0,name:"unsorted",type:String},{defaultValue:!1,description:"Do not append a trailing newline to the output (default: append one).",name:"no-final-newline",type:Boolean},{defaultValue:"auto",description:"Line ending to write: auto (per-file detection, default), lf, or crlf.",name:"line-ending",type:String},{description:"Disable collapsing `bugs: { url }` to the bare string form (default: enabled).",name:"no-format-bugs",type:Boolean},{description:"Disable collapsing `repository: { type, url }` to the GitHub `owner/repo` shorthand (default: enabled).",name:"no-format-repository",type:Boolean},{description:"Disable canonical sorting of `exports` condition keys (default: enabled).",name:"no-sort-exports",type:Boolean},{description:"Disable .editorconfig discovery for indent / line-ending defaults (default: enabled).",name:"no-editorconfig",type:Boolean}]};var NG=Object.defineProperty,IG=d((e,t)=>NG(e,"name",{value:t,configurable:!0}),"e$b");const LG={description:"Run linters on staged files using config from vis.config.ts",examples:[["vis staged","Run staged linters"],["vis staged --verbose","Run with verbose output"],["vis staged --no-stash","Run without backup stash"],["vis staged --diff HEAD~1","Run against a specific diff"]],group:"Run & Execute",loader:IG(()=>import("./handler47.js"),"loader"),name:"staged",options:[{defaultValue:!1,description:"Allow empty commits when tasks revert all staged changes",name:"allow-empty",type:Boolean},{defaultValue:!1,description:"Automatically stage new files that tasks create during the run",name:"auto-stage",type:Boolean},{description:"Number of concurrent tasks or false for serial",name:"concurrent",type:String},{defaultValue:!1,description:"Run all tasks to completion even if one fails",name:"continue-on-error",type:Boolean},{description:"Working directory to run all tasks in",name:"cwd",type:String},{defaultValue:!1,description:"Enable debug output",name:"debug",type:Boolean},{description:"Override the default --staged flag of git diff",name:"diff",type:String},{description:"Override the default diff-filter",name:"diff-filter",type:String},{defaultValue:!1,description:"Fail with exit code 1 when tasks modify tracked files",name:"fail-on-changes",type:Boolean},{defaultValue:!1,description:"Kill in-flight tasks with SIGKILL on fast-fail instead of the default SIGTERM",name:"force-kill",type:Boolean},{defaultValue:!1,description:"Hide unstaged changes from partially staged files",name:"hide-partially-staged",type:Boolean},{defaultValue:!1,description:"Hide all unstaged changes before running tasks",name:"hide-unstaged",type:Boolean},{defaultValue:!1,description:"Suppress console output",name:"quiet",type:Boolean},{defaultValue:!1,description:"Pass filepaths relative to cwd to tasks",name:"relative",type:Boolean},{defaultValue:!1,description:"Revert to original state in case of errors",name:"revert",type:Boolean},{defaultValue:!0,description:"Enable backup stash",name:"stash",type:Boolean},{defaultValue:!1,description:"Show task output even when tasks succeed",name:"verbose",type:Boolean}]};var _G=Object.defineProperty,MG=d((e,t)=>_G(e,"name",{value:t,configurable:!0}),"t$9");const WG={description:"Show a workspace health dashboard at a glance",examples:[["vis status","Full status overview"],["vis status --json","Machine-readable output"]],group:"Workspace",loader:MG(()=>import("./handler24.js"),"loader"),name:"status",options:[{defaultValue:!1,description:"Emit JSON output",name:"json",type:Boolean}]};var VG=Object.defineProperty,UG=d((e,t)=>VG(e,"name",{value:t,configurable:!0}),"e$a");const GG={argument:{description:"What to sync: codeowners | package-json-fields",name:"kind",type:String},description:"Synchronise derived workspace artefacts (codeowners, package.json fields, tsconfig refs, …)",examples:[["vis sync codeowners","Generate CODEOWNERS at the repository root"],["vis sync codeowners --out=.github/CODEOWNERS","Write to .github/CODEOWNERS instead"],["vis sync codeowners --check","Fail if the existing file is stale"],["vis sync codeowners --from=project-json,nested-codeowners","Also aggregate nested CODEOWNERS files in the tree"],["vis sync codeowners --regeneration-command='pnpm codeowners'","Set a custom header instruction"],["vis sync codeowners --preserve-block","Splice the generated block between markers in an existing CODEOWNERS"],["vis sync codeowners --write-guard","Also emit GitHub + GitLab Write Guard CI for restricted projects"],["vis sync package-json-fields","Mirror license/author/repository/bugs/homepage/engines from root to every workspace package"],["vis sync package-json-fields --check","Fail if any workspace package.json is out of sync"],["vis sync package-json-fields --fields license,engines","Override the default field list for this run"]],group:"Workspace",loader:UG(()=>import("./handler36.js"),"loader"),name:"sync",options:[{description:"Output path for the generated file (default: <workspace>/CODEOWNERS) — codeowners kind only",name:"out",type:String},{defaultValue:!1,description:"Verify state without writing (exit non-zero if drift is found)",name:"check",type:Boolean},{description:"Input sources for codeowners. Comma-separated or repeated. Values: project-json | nested-codeowners | package-json-maintainers. Defaults to project-json.",multiple:!0,name:"from",type:String},{description:"Glob (repeatable) used to discover nested CODEOWNERS files. Defaults to `**/CODEOWNERS`.",multiple:!0,name:"nested-includes",type:String},{description:"Header instruction shown to reviewers (replaces the default 'update project.json' note). Codeowners kind only.",name:"regeneration-command",type:String},{defaultValue:!1,description:"Splice the generated block between markers in the existing file instead of overwriting it. Codeowners kind only.",name:"preserve-block",type:Boolean},{defaultValue:!1,description:"Also emit a .github/workflows/write-guard.yml scoped to projects with `restricted: true` in project.json. Codeowners kind only.",name:"write-guard",type:Boolean},{description:"Comma-separated list of fields to mirror from root → workspace packages (package-json-fields kind only). Repeatable.",multiple:!0,name:"fields",type:String},{description:"Glob pattern of package names to skip (package-json-fields kind only). Repeatable.",multiple:!0,name:"ignore-package-name",type:String},{defaultValue:"human",description:"Output format for package-json-fields: human | json",name:"format",type:String},{defaultValue:!1,description:"Suppress per-package log lines; print only the summary (package-json-fields kind only)",name:"quiet",type:Boolean}]};var qG=Object.defineProperty,HG=d((e,t)=>qG(e,"name",{value:t,configurable:!0}),"t$7");const zG={argument:{description:"Task ID to explain (e.g. @my/app:build)",name:"taskId",type:String},description:"Explain why a task is included in the graph by walking its dependency chain to a root",examples:[["vis task-why @myorg/app:build","Show what pulls build in"],["vis task-why lib-a:test","Check the test task's triggers"]],group:"Workspace",loader:HG(()=>import("./handler25.js"),"loader"),name:"task-why"};var JG=Object.defineProperty,KG=d((e,t)=>JG(e,"name",{value:t,configurable:!0}),"e$9");const YG={argument:{description:"Subcommand: status | detect | install | use | which",name:"action",type:String},description:"Inspect and delegate to the workspace version managers (proto, mise, fnm, volta, asdf, nvm, corepack)",examples:[["vis toolchain status","Show every detected manager + expected vs actual tool versions"],["vis toolchain install","Install pinned versions — per-tool delegation"],["vis toolchain use node@22.13.0","Pin node 22.13.0 via the best runtime manager"],["vis toolchain use pnpm@10.32.1","Update the packageManager field; pnpm self-activates"],["vis toolchain which node","Resolve the node binary the manager would launch"],["vis toolchain detect","Print the primary manager's name"]],group:"Workspace",loader:KG(()=>import("./handler26.js"),"loader"),name:"toolchain",options:[{defaultValue:!1,description:"With `status`: exit 1 if any tool mismatches",name:"exit-code",type:Boolean},{defaultValue:!1,description:"Print the command that would run, but don't execute",name:"dry-run",type:Boolean},{defaultValue:!1,description:"Emit JSON (status subcommand only)",name:"json",type:Boolean},{defaultValue:!0,description:"With `use`: also mirror the version into engines.<tool> when that field already exists. --no-engines to skip.",name:"engines",type:Boolean}]};var XG=Object.defineProperty,QG=d((e,t)=>XG(e,"name",{value:t,configurable:!0}),"e$8");const ZG={argument:{description:"Packages to unlink (omit for current package)",name:"packages",type:String},description:"Unlink a previously linked package",examples:[["vis unlink","Unlink current package"],["vis unlink react","Unlink specific package"],["vis unlink -r","Unlink in all workspace packages"]],group:"Dependencies",loader:QG(()=>import("./handler27.js"),"loader"),name:"unlink",options:[{alias:"r",defaultValue:!1,description:"Unlink in all workspace packages",name:"recursive",type:Boolean}]};var eq=Object.defineProperty,tq=d((e,t)=>eq(e,"name",{value:t,configurable:!0}),"e$7");const rq={alias:"up",argument:{description:"Packages to update (updates all if omitted)",name:"packages",type:String},description:"Update packages to their latest versions",examples:[["vis update react","Update react within semver range"],["vis up react -L","Update react to latest"],["vis update -i","Interactive mode"],["vis update --filter app","Update in specific workspace"],["vis update -r","Update in all workspaces"],["vis update --target minor","Only apply minor/patch updates (catalog mode)"],["vis update --dry-run","Preview changes without applying"],["vis update --exclude '@types/*'","Exclude packages by pattern"],["vis update --changelog","Show changelog links after updating"],["vis update --rollback","Restore catalog from last backup"],["vis update --ai","Run AI analysis before applying updates"]],group:"Dependencies",loader:tq(()=>import("./handler45.js"),"loader"),name:"update",options:[{alias:"L",conflicts:"target",description:"Update to latest version (ignore semver range; equivalent to --target latest)",name:"latest",type:Boolean},{alias:"t",conflicts:"latest",description:"Update target: latest, minor, or patch (default: latest, catalog mode)",name:"target",type:String},{alias:"d",defaultValue:!1,description:"Preview changes without applying",name:"dry-run",type:Boolean},{alias:"g",defaultValue:!1,description:"Update global packages",name:"global",type:Boolean},{alias:"r",defaultValue:!1,description:"Update recursively in all workspace packages",name:"recursive",type:Boolean},{description:"Filter packages in monorepo (pm-wrapper mode; catalog mode uses --include/--exclude)",name:"filter",type:String},{alias:"w",defaultValue:!1,description:"Include workspace root",name:"workspace-root",type:Boolean},{alias:"D",conflicts:"prod",description:"Update only devDependencies",name:"dev",type:Boolean},{alias:"P",conflicts:"dev",description:"Update only dependencies",name:"prod",type:Boolean},{alias:"i",defaultValue:!1,description:"Interactive mode",name:"interactive",type:Boolean},{defaultValue:!1,description:"Don't update optionalDependencies",name:"no-optional",type:Boolean},{defaultValue:!1,description:"Include peerDependencies in update checks",name:"peer",type:Boolean},{defaultValue:!1,description:"Also check workspace-owned package names against the registry (catalog mode)",name:"include-internal",type:Boolean},{alias:"l",defaultValue:!1,description:"Include packages with pinned/exact versions (no ^ or ~ prefix; catalog mode)",name:"include-locked",type:Boolean},{defaultValue:!1,description:"Update lockfile only",name:"no-save",type:Boolean},{description:"Glob pattern to include packages (repeatable, catalog mode)",lazyMultiple:!0,name:"include",type:String},{description:"Glob pattern to exclude packages (repeatable, catalog mode)",lazyMultiple:!0,name:"exclude",type:String},{defaultValue:!1,description:"Include prerelease versions (catalog mode)",name:"prerelease",type:Boolean},{description:"Check for known security vulnerabilities via OSV.dev (default: true; --no-security to skip)",name:"security",type:Boolean},{defaultValue:!1,description:"Skip catalog mode, use package manager directly",name:"no-catalog",type:Boolean},{description:"Output format: table, json, or minimal (default: table)",name:"format",type:String},{defaultValue:!1,description:"Show changelog URLs for updated packages",name:"changelog",type:Boolean},{description:"Run install after catalog update, --no-install to skip (default: true)",name:"install",type:Boolean},{defaultValue:!1,description:"Restore catalog file from the last backup",name:"rollback",type:Boolean},{defaultValue:!1,description:"Run AI analysis on outdated packages before updating (catalog mode)",name:"ai",type:Boolean},{description:"AI analysis type: impact, security, compatibility, or recommend (default: impact)",name:"ai-type",type:String},{defaultValue:!1,description:"Skip typosquat name check for package arguments",name:"no-typosquat-check",type:Boolean},{defaultValue:!1,description:"Skip the offline marshall pipeline (author, provenance, metadata, downloads, expired-domains, new-bin, signatures, archived-repo) when explicit package arguments are supplied",name:"no-marshall-check",type:Boolean},{description:"Cap concurrent registry requests during outdated checks (default: 8)",name:"max-concurrent-requests",type:Number},{description:"Release channel filter: stable (default), same (match current's prerelease channel), or any",name:"release-channel",type:String},{alias:"y",defaultValue:!1,description:"Skip the confirmation prompt for blanket --latest updates. Required in non-TTY contexts (CI) when running `vis update --latest` without explicit package arguments.",name:"yes",type:Boolean},{defaultValue:!1,description:"Skip the GitHub Actions ecosystem scan (workflows + composite action.yml files)",name:"no-actions",type:Boolean},{defaultValue:!1,description:"Skip the Docker ecosystem scan (Dockerfile + docker-compose images)",name:"no-docker",type:Boolean},{defaultValue:!1,description:"Skip the GitLab CI ecosystem scan (.gitlab-ci.yml + .gitlab/ci/**)",name:"no-gitlab",type:Boolean},{defaultValue:!1,description:"Include branch references (e.g. actions/checkout@main) when scanning workflows",name:"include-branches",type:Boolean},{description:"Reference style for GitHub Actions updates: sha (default, pin to commit SHA + version comment) or preserve",name:"style",type:String},{description:"GitHub token for actions resolution (overrides GITHUB_TOKEN / GH_TOKEN env)",name:"actions-token",type:String},{description:"GitLab token for include-ref resolution (overrides GITLAB_TOKEN / CI_JOB_TOKEN env)",name:"gitlab-token",type:String}]};var nq=Object.defineProperty,sq=d((e,t)=>nq(e,"name",{value:t,configurable:!0}),"e$6");const iq={argument:{description:"Target version (defaults to latest)",name:"version",type:String},description:"Update vis itself to the latest version",examples:[["vis self-update","Update to latest"],["vis self-update 2.0.0","Install specific version"],["vis self-update --check","Check for updates without installing"]],group:"System",loader:sq(()=>import("./handler28.js"),"loader"),name:"self-update",options:[{defaultValue:!1,description:"Check for updates without installing",name:"check",type:Boolean},{defaultValue:!1,description:"Reinstall even if already current",name:"force",type:Boolean},{defaultValue:!1,description:"Suppress output (CI mode)",name:"silent",type:Boolean}]};var oq=Object.defineProperty,aq=d((e,t)=>oq(e,"name",{value:t,configurable:!0}),"e$5");const cq={alias:"explain",argument:{description:"Package(s) to explain",name:"packages",type:String},description:"Show why a package is installed (dependency chain)",examples:[["vis why react","Show why react is installed"],["vis why react --json","Output as JSON"],["vis why react -r","Check across all workspaces"],["vis explain react","Alias matching npm's command"]],group:"Dependencies",loader:aq(()=>import("./handler29.js"),"loader"),name:"why",options:[{defaultValue:!1,description:"Output as JSON",name:"json",type:Boolean},{defaultValue:!1,description:"Show extended information (pnpm)",name:"long",type:Boolean},{defaultValue:!1,description:"Machine-readable output (pnpm)",name:"parseable",type:Boolean},{alias:"r",defaultValue:!1,description:"Check across all workspaces",name:"recursive",type:Boolean},{alias:"D",conflicts:"prod",description:"Filter to dev dependencies (pnpm)",name:"dev",type:Boolean},{alias:"P",conflicts:"dev",description:"Filter to production dependencies (pnpm)",name:"prod",type:Boolean},{defaultValue:!1,description:"Exclude optional dependencies (pnpm)",name:"no-optional",type:Boolean},{alias:"g",defaultValue:!1,description:"Check globally installed packages (pnpm)",name:"global",type:Boolean},{description:"Limit dependency tree depth",name:"depth",type:Number},{alias:"F",description:"Filter by workspace package name",multiple:!0,name:"filter",type:String}]},Eg="\x1B]",jg="\x07",ha=";";var lq=Object.defineProperty,uq=d((e,t)=>lq(e,"name",{value:t,configurable:!0}),"n$7"),pq=Object.defineProperty,dq=uq((e,t)=>pq(e,"name",{value:t,configurable:!0}),"n"),fq=Object.defineProperty,hq=dq((e,t)=>fq(e,"name",{value:t,configurable:!0}),"n");const mq=hq((e,t)=>[Eg,"8",ha,ha,t,jg,e,Eg,"8",ha,ha,jg].join(""),"hyperlink");var gq=Object.defineProperty,ml=d((e,t)=>gq(e,"name",{value:t,configurable:!0}),"e$4");ml((e,t)=>!process.stderr.isTTY||process.env.TERM==="dumb"?e===t?t:`${e} (${On(t)})`:mq(e,t),"link");const yq=ml(()=>{if(process.env.VIS_VERSION)return process.env.VIS_VERSION;try{const e=new URL("../../package.json",import.meta.url);return le(e).version}catch{return"0.0.0"}},"getVersion"),vq=ml(()=>{process.env.VIS_VERSION=yq()},"injectVersion"),bq=ml(e=>{!process.stdout.isTTY||Rr||process.env.TERM==="dumb"||process.stdout.write(`\x1B]0;${e}\x07`)},"setTerminalTitle");var $q=Object.defineProperty,wq=d((e,t)=>$q(e,"name",{value:t,configurable:!0}),"v$2");const kq={beforeCommand:wq(async e=>{try{const t=e.options?.cwd,r=e.options?.config;let n;if(t)n=Ke(process.cwd(),t);else{const a=process.env.VIS_MONOREPO_ROOT;n=a&&a.length>0?a:o0(process.cwd()).path}e.workspaceRoot=n;const s=r?Ke(process.cwd(),r):void 0;let i=s??Hn(n);try{e.visConfig=await uh(n,s?{explicitConfigPath:s}:void 0);const a=e.visConfig?.versionConstraint;if(a&&!Fs.validRange(a)){e.logger.error(""),e.logger.error(Dl(Qt("✖ Invalid versionConstraint"))),e.logger.error(` vis.config.ts has versionConstraint ${Qt(JSON.stringify(a))}, which is not a valid semver range.`),e.logger.error(""),process.exitCode=1;return}if(a&&!Fs.satisfies(Fa.version,a)){e.logger.error(""),e.logger.error(Dl(Qt("✖ vis version too old"))),e.logger.error(` vis.config.ts requires vis ${Qt(a)}, but the current version is ${Qt(Fa.version)}.`),e.logger.error(` ${_i("→")} Upgrade: ${Gr("pnpm add -D @visulima/vis@latest")}`),e.logger.error(""),process.exitCode=1;return}}catch(a){const c=i,l=a instanceof Error?a.message:String(a);e.visConfigError={file:c??void 0,message:l};const u=!!process.stdout.isTTY&&!Rr;if(c&&!u){if(e.logger.error(""),e.logger.error(Dl(Qt(`✖ Failed to load ${c}`))),e.logger.error(` ${l}`),e.logger.error(""),l.includes("Cannot find module")){const p=/Cannot find module '([^']+)'/.exec(l)?.[1]??"unknown";e.logger.error(`${_i("→ Hint:")} The module ${Qt(p)} could not be resolved.`),p.includes("@visulima/vis")?(e.logger.error(" This usually means the package isn't installed or the export path changed."),e.logger.error(` Try: ${Gr("pnpm add @visulima/vis")}`),e.logger.error(` Or regenerate: ${Gr("vis init --force")}`)):e.logger.error(` Try: ${Gr(`pnpm add ${p}`)}`)}else l.includes("SyntaxError")||l.includes("Unexpected token")?(e.logger.error(`${_i("→ Hint:")} The config file has a syntax error.`),e.logger.error(" Check your config for typos or invalid syntax."),e.logger.error(` Or regenerate: ${Gr("vis init --force")}`)):(e.logger.error(`${_i("→ Hint:")} Delete the broken config and recreate it:`),e.logger.error(` ${Gr(`rm ${c} && vis init`)}`));e.logger.error(""),e.logger.error(` Continuing with default settings.
|
|
1186
1186
|
`)}e.visConfig={}}const o=process.argv[2]??"";if(!new Set(["--help","--version","-h","-V","create","help","implode","init"]).has(o)&&!i&&!Rr)if(process.stdin.isTTY){const a=Ap({input:process.stdin,output:process.stderr}),c=await new Promise(l=>{a.question("\x1B[36;1m?\x1B[0m \x1B[1mNo vis.config.ts found. Create one with best-practice security defaults?\x1B[0m \x1B[90m(\x1B[92mY\x1B[90m/n)\x1B[0m ",l),a.on("SIGINT",()=>{a.close(),l("n")})});if(a.close(),!c.trim()||c.trim().toLowerCase()==="y"||c.trim().toLowerCase()==="yes"){const l=D(n,"vis.config.ts"),u=['import { defineConfig } from "@visulima/vis/config";',"","// Secure defaults are applied automatically by defineConfig().","// You only need to add allowBuilds for packages with build scripts.","// Run 'vis check --security-config' to see all active settings.","export default defineConfig({"," security: {"," allowBuilds: {",' // "esbuild": true,'," },"," },","});",""].join(`
|
|
1187
1187
|
`);Oe(l,u),e.logger.info(`✓ Created ${l}
|
|
1188
|
-
`),e.visConfig=await uh(n),i=l}}else e.logger.warn("No vis.config.ts found. Run 'vis init' to create one with best-practice security defaults.")}catch(t){t instanceof Error&&!t.message.includes("monorepo root")&&e.logger.warn(`Failed to detect workspace: ${t.message}`),e.visConfig={}}},"beforeCommand"),name:"config-loader"};var
|
|
1188
|
+
`),e.visConfig=await uh(n),i=l}}else e.logger.warn("No vis.config.ts found. Run 'vis init' to create one with best-practice security defaults.")}catch(t){t instanceof Error&&!t.message.includes("monorepo root")&&e.logger.warn(`Failed to detect workspace: ${t.message}`),e.visConfig={}}},"beforeCommand"),name:"config-loader"};var Sq=Object.defineProperty,kt=d((e,t)=>Sq(e,"name",{value:t,configurable:!0}),"r$3");const Dq=336*60*60*1e3,vp=D(fn(),"mcp-promote.json"),$n="@visulima/vis-mcp",Cq=new Set(["--help","--version","-h","-V","ai","help","implode","mcp"]),Eq=kt(()=>{try{if(j(vp))return le(vp)}catch{}return{lastShown:0}},"readState"),jq=kt(e=>{try{$t(fn()),qe(vp,JSON.stringify(e))}catch{}},"writeState"),hi=kt(e=>{try{return j(e)?le(e):void 0}catch{return}},"readJsonSafe"),mi=kt(e=>{if(typeof e!="object"||e===null)return!1;for(const t of Object.values(e)){if(typeof t!="object"||t===null)continue;const r=t,n=Array.isArray(r.args)?r.args.join(" "):"",s=`${typeof r.command=="string"?r.command:""} ${n}`;if(s.includes($n)||s.includes("vis-mcp"))return!0}return!1},"mapHasVisMcp"),Aq=kt(e=>{if(!Array.isArray(e))return!1;for(const t of e){if(typeof t!="object"||t===null)continue;const r=t,n=Array.isArray(r.args)?r.args.join(" "):"",s=`${typeof r.command=="string"?r.command:""} ${n} ${typeof r.name=="string"?r.name:""}`;if(s.includes($n)||s.includes("vis-mcp"))return!0}return!1},"arrayHasVisMcp"),xq=kt(e=>{const t=D(e,".claude"),r=D(e,".claude.json"),n=j(t)||j(r);let s=!1;if(n){const i=hi(r);s=mi(i?.mcpServers)}return{displayName:"Claude Code",id:"claude-code",installCommand:`claude mcp add vis -- npx -y ${$n}@latest`,isConfigured:s,isInstalled:n}},"detectClaudeCode"),Oq=kt(e=>{const t=D(e,".cursor","mcp.json"),r=j(D(e,".cursor"));let n=!1;if(r){const s=hi(t);n=mi(s?.mcpServers)}return{displayName:"Cursor",id:"cursor",installCommand:`Add to ~/.cursor/mcp.json: "vis": { "command": "npx", "args": ["-y", "${$n}@latest"] }`,isConfigured:n,isInstalled:r}},"detectCursor"),Pq=kt(e=>{const t=D(e,".codeium","windsurf"),r=D(t,"mcp_config.json"),n=j(t);let s=!1;if(n){const i=hi(r);s=mi(i?.mcpServers)}return{displayName:"Windsurf",id:"windsurf",installCommand:`Add to ~/.codeium/windsurf/mcp_config.json: "vis": { "command": "npx", "args": ["-y", "${$n}@latest"] }`,isConfigured:s,isInstalled:n}},"detectWindsurf"),Fq=kt(e=>{const t=D(e,".continue"),r=D(t,"config.json"),n=j(t);let s=!1;if(n){const i=hi(r);s=mi(i?.mcpServers)||Aq(i?.mcpServers)}return{displayName:"Continue",id:"continue",installCommand:`Add to ~/.continue/config.json mcpServers: { "name": "vis", "command": "npx", "args": ["-y", "${$n}@latest"] }`,isConfigured:s,isInstalled:n}},"detectContinue"),Bq=kt(e=>{const t=D(e,"Library","Application Support","Zed","settings.json"),r=D(e,".config","zed","settings.json"),n=jp()==="darwin"?t:r,s=j(n);let i=!1;if(s){const o=hi(n);i=mi(o?.context_servers)}return{displayName:"Zed",id:"zed",installCommand:`Add to Zed settings.json under context_servers: "vis": { "command": "npx", "args": ["-y", "${$n}@latest"] }`,isConfigured:i,isInstalled:s}},"detectZed"),Rq=kt(e=>{const t=[D(e,".config","Code","User","globalStorage","saoudrizwan.claude-dev","settings","cline_mcp_settings.json"),D(e,"Library","Application Support","Code","User","globalStorage","saoudrizwan.claude-dev","settings","cline_mcp_settings.json")];let r;for(const i of t)if(j(i)){r=i;break}const n=r!==void 0;let s=!1;if(r!==void 0){const i=hi(r);s=mi(i?.mcpServers)}return{displayName:"Cline",id:"cline",installCommand:`In VS Code: open Cline > MCP Servers, add "vis" with command "npx" and args ["-y", "${$n}@latest"]`,isConfigured:s,isInstalled:n}},"detectCline"),Tq=kt(()=>{const e=Yg();return[xq(e),Oq(e),Pq(e),Fq(e),Bq(e),Rq(e)]},"detectAiClis"),Nq=kt(e=>{if(!e.success||process.env.VIS_CLI_TEST||Rr||process.env.VIS_NO_MCP_PROMOTE==="1"||e.visConfig?.mcpPromote?.enabled===!1||!process.stderr.isTTY||e.command!==void 0&&Cq.has(e.command))return!1;const t=new Set(process.argv.slice(2));return!(t.has("--silent")||t.has("-s")||t.has("--json"))},"shouldRun"),Iq=kt(e=>{if(!Nq(e))return;const t=Date.now(),r=Eq();if(t-r.lastShown<Dq)return;const n=Tq().find(s=>s.isInstalled&&!s.isConfigured);n!==void 0&&(process.stderr.write(`
|
|
1189
1189
|
${Gr("✨")} ${Qt(`vis ships an MCP server for ${n.displayName}.`)}
|
|
1190
1190
|
${n.installCommand}
|
|
1191
1191
|
${On("Hide this with VIS_NO_MCP_PROMOTE=1 or mcpPromote: { enabled: false } in vis.config.ts")}
|
|
1192
|
-
`),
|
|
1193
|
-
${fS("♥")} ${Qt("Enjoying visulima?")} ${On(`Consider sponsoring at ${
|
|
1192
|
+
`),jq({lastShown:t}))},"showMcpPromote");var Lq=Object.defineProperty,sh=d((e,t)=>Lq(e,"name",{value:t,configurable:!0}),"t$5");const _q=336*60*60*1e3,Mq="https://github.com/sponsors/prisis",bp=D(fn(),"sponsor.json"),Wq=sh(()=>{try{if(j(bp))return le(bp)}catch{}return{lastShown:0}},"readState"),Vq=sh(e=>{try{$t(fn()),qe(bp,JSON.stringify(e))}catch{}},"writeState"),Uq=sh(e=>{if(!e.success||process.env.VIS_CLI_TEST||Rr||process.env.VIS_NO_SPONSOR==="1"||e.visConfig?.sponsor?.enabled===!1||!process.stderr.isTTY)return;const t=Date.now(),r=Wq();t-r.lastShown<_q||(process.stderr.write(`
|
|
1193
|
+
${fS("♥")} ${Qt("Enjoying visulima?")} ${On(`Consider sponsoring at ${Mq}`)}
|
|
1194
1194
|
${On(" Hide this with VIS_NO_SPONSOR=1 or sponsor.enabled = false in vis.config.ts")}
|
|
1195
|
-
`),
|
|
1195
|
+
`),Vq({lastShown:t}))},"showSponsorNotice");var Gq=Object.defineProperty,me=d((e,t)=>Gq(e,"name",{value:t,configurable:!0}),"e$3");const Ag=300*1e3,$p=D(fn(),"tips.json"),qq=me(()=>{try{if(j($p))return le($p)}catch{}return{lastGlobal:0,perTip:{}}},"readState"),Hq=me(e=>{try{$t(fn()),qe($p,JSON.stringify(e))}catch{}},"writeState"),zq=[{cooldownMs:1800*1e3,id:"short-aliases",matches:me(e=>["install","link","remove","uninstall","update"].includes(e.command),"matches"),message:me(e=>{const t={install:"i",link:"ln",remove:"rm",uninstall:"rm",update:"up"}[e.command];return t?`You can use 'vis ${t}' as a shorthand for 'vis ${e.command}'`:""},"message"),probability:.5},{id:"use-exec",matches:me(e=>e.command==="dlx"&&e.success,"matches"),message:me(()=>"Use 'vis exec' to run locally installed binaries without downloading.","message")},{id:"security-check",matches:me(e=>(e.command==="check"||e.command==="update")&&e.success&&!e.args.includes("--security"),"matches"),message:me(()=>"Add --security to check for known vulnerabilities via OSV.dev","message"),probability:.3},{cooldownMs:3600*1e3,id:"ai-analysis",matches:me(e=>(e.command==="check"||e.command==="update")&&e.success&&!e.args.includes("--ai"),"matches"),message:me(()=>"Add --ai to run AI analysis on outdated packages before updating.","message"),probability:.2},{cooldownMs:1440*60*1e3,id:"socket-security",matches:me(e=>(e.command==="install"||e.command==="update"||e.command==="check")&&e.success,"matches"),message:me(()=>"Enable Socket.dev in vis.config.ts for security scores and supply chain alerts: security.socket.enabled = true","message"),probability:.15},{id:"dedupe-after-install",matches:me(e=>e.command==="install"&&e.success,"matches"),message:me(()=>"Run 'vis dedupe' periodically to remove duplicate dependencies.","message"),probability:.15},{cooldownMs:720*60*1e3,id:"doctor-checkup",matches:me(e=>(e.command==="install"||e.command==="add"||e.command==="update")&&e.success,"matches"),message:me(()=>"Run 'vis doctor' for a full project health check — outdated, security, duplicates, and optimizations in one view.","message"),probability:.25},{cooldownMs:10080*60*1e3,id:"init-config",matches:me(e=>(e.command==="install"||e.command==="run")&&e.success&&!e.hasVisConfig,"matches"),message:me(()=>"Run 'vis init' to create a vis.config.ts with secure defaults — supply chain protection enabled automatically.","message"),probability:.4},{id:"why-command",matches:me(e=>e.command==="outdated"&&e.success,"matches"),message:me(()=>"Use 'vis why <package>' to understand why a dependency is installed.","message"),probability:.3},{id:"graph-command",matches:me(e=>e.command==="run"&&e.success,"matches"),message:me(()=>"Use 'vis graph' to visualize your project dependency graph.","message"),probability:.1},{id:"affected-command",matches:me(e=>e.command==="run"&&e.success&&!e.args.includes("--projects"),"matches"),message:me(()=>"Use 'vis affected <target>' to run tasks only on changed projects.","message"),probability:.2},{id:"pm-cache",matches:me(e=>e.command==="install"&&e.success,"matches"),message:me(()=>"Use 'vis pm cache dir' to find your package manager's cache location.","message"),probability:.1},{id:"create-editor",matches:me(e=>e.command==="create"&&e.success,"matches"),message:me(()=>"Add --editor vscode to generate VS Code configuration during project creation.","message"),probability:.5},{id:"env-pin",matches:me(e=>e.command==="env"&&e.args.includes("install")&&e.success,"matches"),message:me(()=>"Use 'vis env pin <version>' to pin the Node.js version for your project.","message"),probability:.5},{id:"upgrade-check",matches:me(e=>e.command!=="self-update"&&e.success,"matches"),message:me(()=>"Run 'vis self-update --check' to see if a newer version of vis is available.","message"),probability:.05}],Jq=me(e=>{if(process.env.VIS_CLI_TEST||Rr)return;const t=Date.now(),r=qq();if(t-r.lastGlobal<Ag)return;const n=zq.filter(o=>{if(!o.matches(e))return!1;const a=r.perTip[o.id]??0,c=o.cooldownMs??Ag;return t-a>=c});if(n.length===0)return;const s=n.find(o=>{const a=o.probability??1;return Math.random()<a});if(!s)return;const i=s.message(e);i&&(process.stderr.write(`
|
|
1196
1196
|
\x1B[2mtip: ${i}\x1B[0m
|
|
1197
|
-
`),r.lastGlobal=t,r.perTip[s.id]=t,
|
|
1197
|
+
`),r.lastGlobal=t,r.perTip[s.id]=t,Hq(r))},"showTip");var Kq=Object.defineProperty,xg=d((e,t)=>Kq(e,"name",{value:t,configurable:!0}),"n$4");const Yq=xg(e=>({afterCommand:xg(async t=>{const r=process.argv.slice(2),n=r[0]??"",s=process.exitCode===void 0||process.exitCode===0;e&&e(),Jq({args:r,command:n,hasVisConfig:t.visConfig!==void 0&&Object.keys(t.visConfig).length>0,success:s}),Uq({success:s,visConfig:t.visConfig}),Iq({command:n,success:s,visConfig:t.visConfig})},"afterCommand"),name:"post-command"}),"postCommandPlugin");var Xq=Object.defineProperty,ih=d((e,t)=>Xq(e,"name",{value:t,configurable:!0}),"s$2");const Qq=ih(e=>`MARSHALL_DISABLE_${e.replaceAll(/([A-Z])/g,"_$1").toUpperCase()}`,"envVarFor"),Og=ih(e=>{if(e===void 0||e==="")return!1;const t=e.toLowerCase();return t!=="0"&&t!=="false"&&t!=="no"},"isTruthyEnv"),hu=ih((e,t=process.env)=>Og(t.MARSHALL_DISABLE_ALL)?!0:Og(t[Qq(e)]),"isMarshallDisabled");var Zq=Object.defineProperty,gl=d((e,t)=>Zq(e,"name",{value:t,configurable:!0}),"p$5");const lk=gl((e,t)=>{const r={errors:[],warnings:[]},{security:n}=e;if(!n)return r.warnings.push("No security settings configured. Use defineConfig() from '@visulima/vis/config' to get secure defaults automatically."),r;const s=n.policies??{},{installScripts:i}=s,o=i?.allow,a=o&&Object.keys(o).length>0;if(a||r.warnings.push(t==="pnpm"?"security.policies.installScripts.allow is not configured. pnpm blocks build scripts by default since v10. Run 'vis approve-builds' to review.":"security.policies.installScripts.allow is not configured. Consider listing which packages are allowed to run install/postinstall scripts."),s.firstSeen?.minutes===0&&r.warnings.push("security.policies.firstSeen.minutes is explicitly set to 0. New packages can be installed immediately after publishing."),s.publisherChange?.mode==="off"&&r.warnings.push("security.policies.publisherChange.mode is explicitly 'off'. Packages whose trust level has decreased will not be blocked."),n.blockExoticSubdeps===!1&&r.warnings.push("security.blockExoticSubdeps is explicitly disabled. Transitive dependencies can pull code from git repos or tarball URLs."),i?.strict===!1&&r.warnings.push("security.policies.installScripts.strict is explicitly disabled. Unapproved build scripts will only produce warnings, not errors."),i?.strict&&!a&&r.errors.push("security.policies.installScripts.strict is enabled but `.allow` is empty. All dependencies with build scripts will be blocked. Run 'vis approve-builds' to review and add packages."),n.acceptedRisks){const c=Date.now();for(const[l,u]of Object.entries(n.acceptedRisks)){const p=new Date(u.acceptedAt).getTime();c-p>7776e6&&r.warnings.push(`Accepted risk for "${l}" is over 90 days old (accepted ${u.acceptedAt}). Consider re-evaluating with 'vis audit'.`)}}return r},"checkSecurityConfig"),eH=gl((e,t,r=!1)=>{if(Rr&&!process.env.VIS_SECURITY_WARNINGS)return;const n=lk(e,t);for(const i of n.errors)P.error(i);const s=r?n.warnings.filter(i=>!i.startsWith("security.policies.installScripts.allow is not configured")):n.warnings;s.length>0&&P.warn(`${s.length} security recommendation${s.length===1?"":"s"} found. Run 'vis check --security-config' for details.`)},"emitSecurityWarnings"),iK=gl((e,t)=>{const r=lk(e,t),{security:n}=e;if(n){const s=n.policies??{},{firstSeen:i}=s,{publisherChange:o}=s,{installScripts:a}=s,{score:c}=s;if(P.info("Active security settings:"),P.info(` policies.firstSeen.minutes: ${i?.minutes??"not set"} minutes`),P.info(` policies.publisherChange.mode: ${o?.mode??"not set"}`),P.info(` policies.publisherChange.ignoreAfter: ${o?.ignoreAfter??"not set"} minutes`),P.info(` blockExoticSubdeps: ${n.blockExoticSubdeps??!1}`),P.info(` policies.installScripts.strict: ${a?.strict??!1}`),P.info(` policies.installScripts.allow: ${a?.allow?`${Object.keys(a.allow).length} entries`:"not configured"}`),P.info(""),P.info("Socket.dev integration:"),P.info(` socket.enabled: ${n.socket?.enabled??!1}`),P.info(` socket.apiToken: ${n.socket?.apiToken||process.env.VIS_SOCKET_TOKEN?"configured":"using public token"}`),P.info(` policies.score.minimum: ${c?.minimum??"default (0.4)"}`),P.info(` socket.cacheTtlMs: ${n.socket?.cacheTtlMs??"default (1 hour)"}`),P.info(` socket.timeoutMs: ${n.socket?.timeoutMs??"default (15s)"}`),n.acceptedRisks){const l=Object.entries(n.acceptedRisks);P.info(` acceptedRisks: ${String(l.length)} entr${l.length===1?"y":"ies"}`);for(const[u,p]of l)P.info(` ${u}: ${p.reason} (accepted ${p.acceptedAt.slice(0,10)})`)}else P.info(" acceptedRisks: none");P.info("")}if(r.errors.length===0&&r.warnings.length===0){P.info("All recommended security settings are configured.");return}for(const s of r.errors)P.error(s);for(const s of r.warnings)P.warn(s);P.notice(""),P.notice("Secure defaults are applied by defineConfig(). You only need to add install-script allowances:"),P.notice(""),P.notice(" import { defineConfig } from '@visulima/vis/config';"),P.notice(""),P.notice(" export default defineConfig({"),P.notice(" security: {"),P.notice(" policies: {"),P.notice(" installScripts: {"),P.notice(" allow: {"),P.notice(" esbuild: true,"),P.notice(" '@prisma/client': true,"),P.notice(" },"),P.notice(" },"),P.notice(" },"),P.notice(" },"),P.notice(" });")},"printSecurityReport"),oK=gl(e=>{const{security:t}=e;if(!t)return[];const r=t.policies??{},{firstSeen:n}=r,{publisherChange:s}=r,{installScripts:i}=r,o=[];return n?.minutes!==void 0&&o.push(`minimumReleaseAge: ${n.minutes}`),s?.mode&&s.mode!=="off"&&o.push(`trustPolicy: ${s.mode}`),t.blockExoticSubdeps&&o.push("blockExoticSubdeps: true"),i?.allow&&o.push(`allowBuilds: ${Object.keys(i.allow).length} entries`),i?.strict&&o.push("strictDepBuilds: true"),s?.ignoreAfter!==void 0&&o.push(`trustPolicyIgnoreAfter: ${s.ignoreAfter}`),o},"previewPnpmSync");var tH=Object.defineProperty,oh=d((e,t)=>tH(e,"name",{value:t,configurable:!0}),"i$1");/*!
|
|
1198
1198
|
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
1199
1199
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1200
1200
|
*
|
|
@@ -1224,14 +1224,14 @@ ${On(" Hide this with VIS_NO_SPONSOR=1 or sponsor.enabled = false in vis.confi
|
|
|
1224
1224
|
`,o===t&&(s+=" ".repeat(i+r+2),s+=`^
|
|
1225
1225
|
`))}return s}d(pk,"m$4");oh(pk,"makeCodeBlock");class ge extends Error{static{d(this,"TomlError")}static{oh(this,"TomlError")}line;column;codeblock;constructor(t,r){const[n,s]=uk(r.toml,r.ptr),i=pk(r.toml,n,s);super(`Invalid TOML document: ${t}
|
|
1226
1226
|
|
|
1227
|
-
${i}`,r),this.line=n,this.column=s,this.codeblock=i}}var
|
|
1227
|
+
${i}`,r),this.line=n,this.column=s,this.codeblock=i}}var rH=Object.defineProperty,gi=d((e,t)=>rH(e,"name",{value:t,configurable:!0}),"e$2");function dk(e,t){let r=0;for(;e[t-++r]==="\\";);return--r&&r%2}d(dk,"h$6");gi(dk,"isEscaped");function lc(e,t=0,r=e.length){let n=e.indexOf(`
|
|
1228
1228
|
`,t);return e[n-1]==="\r"&&n--,n<=r?n:-1}d(lc,"indexOfNewline");gi(lc,"indexOfNewline");function Qo(e,t){for(let r=t;r<e.length;r++){let n=e[r];if(n===`
|
|
1229
1229
|
`)return r;if(n==="\r"&&e[r+1]===`
|
|
1230
1230
|
`)return r+1;if(n<" "&&n!==" "||n==="")throw new ge("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}d(Qo,"skipComment");gi(Qo,"skipComment");function ar(e,t,r,n){let s;for(;;){for(;(s=e[t])===" "||s===" "||!r&&(s===`
|
|
1231
1231
|
`||s==="\r"&&e[t+1]===`
|
|
1232
1232
|
`);)t++;if(n||s!=="#")break;t=Qo(e,t)}return t}d(ar,"skipVoid");gi(ar,"skipVoid");function fk(e,t,r,n,s=!1){if(!n)return t=lc(e,t),t<0?e.length:t;for(let i=t;i<e.length;i++){let o=e[i];if(o==="#")i=lc(e,i);else{if(o===r)return i+1;if(o===n||s&&(o===`
|
|
1233
1233
|
`||o==="\r"&&e[i+1]===`
|
|
1234
|
-
`))return i}}throw new ge("cannot find end of structure",{toml:e,ptr:t})}d(fk,"skipUntil");gi(fk,"skipUntil");function ah(e,t){let r=e[t],n=r===e[t+1]&&e[t+1]===e[t+2]?e.slice(t,t+3):r;t+=n.length-1;do t=e.indexOf(n,++t);while(t>-1&&r!=="'"&&dk(e,t));return t>-1&&(t+=n.length,n.length>1&&(e[t]===r&&t++,e[t]===r&&t++)),t}d(ah,"getStringEnd");gi(ah,"getStringEnd");var
|
|
1234
|
+
`))return i}}throw new ge("cannot find end of structure",{toml:e,ptr:t})}d(fk,"skipUntil");gi(fk,"skipUntil");function ah(e,t){let r=e[t],n=r===e[t+1]&&e[t+1]===e[t+2]?e.slice(t,t+3):r;t+=n.length-1;do t=e.indexOf(n,++t);while(t>-1&&r!=="'"&&dk(e,t));return t>-1&&(t+=n.length,n.length>1&&(e[t]===r&&t++,e[t]===r&&t++)),t}d(ah,"getStringEnd");gi(ah,"getStringEnd");var nH=Object.defineProperty,sH=d((e,t)=>nH(e,"name",{value:t,configurable:!0}),"l$3");/*!
|
|
1235
1235
|
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
1236
1236
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1237
1237
|
*
|
|
@@ -1257,17 +1257,17 @@ ${i}`,r),this.line=n,this.column=s,this.codeblock=i}}var Jq=Object.definePropert
|
|
|
1257
1257
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
1258
1258
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
1259
1259
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1260
|
-
*/let
|
|
1260
|
+
*/let iH=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;class ks extends Date{static{d(this,"TomlDate")}static{sH(this,"TomlDate")}#e=!1;#t=!1;#r=null;constructor(t){let r=!0,n=!0,s="Z";if(typeof t=="string"){let i=t.match(iH);i?(i[1]||(r=!1,t=`0000-01-01T${t}`),n=!!i[2],n&&t[10]===" "&&(t=t.replace(" ","T")),i[2]&&+i[2]>23?t="":(s=i[3]||null,t=t.toUpperCase(),!s&&n&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#e=r,this.#t=n,this.#r=s)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#r}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#r===null)return t.slice(0,-1);if(this.#r==="Z")return t;let r=+this.#r.slice(1,3)*60+ +this.#r.slice(4,6);return r=this.#r[0]==="-"?r:-r,new Date(this.getTime()-r*6e4).toISOString().slice(0,-1)+this.#r}static wrapAsOffsetDateTime(t,r="Z"){let n=new ks(t);return n.#r=r,n}static wrapAsLocalDateTime(t){let r=new ks(t);return r.#r=null,r}static wrapAsLocalDate(t){let r=new ks(t);return r.#t=!1,r.#r=null,r}static wrapAsLocalTime(t){let r=new ks(t);return r.#e=!1,r.#r=null,r}}var oH=Object.defineProperty,hk=d((e,t)=>oH(e,"name",{value:t,configurable:!0}),"w$1");let aH=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,cH=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,lH=/^[+-]?0[0-9_]/,uH=/^[0-9a-f]{2,8}$/i,Pg={b:"\b",t:" ",n:`
|
|
1261
1261
|
`,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function ch(e,t=0,r=e.length){let n=e[t]==="'",s=e[t++]===e[t]&&e[t]===e[t+1];s&&(r-=2,e[t+=2]==="\r"&&t++,e[t]===`
|
|
1262
1262
|
`&&t++);let i=0,o,a="",c=t;for(;t<r-1;){let l=e[t++];if(l===`
|
|
1263
1263
|
`||l==="\r"&&e[t]===`
|
|
1264
|
-
`){if(!s)throw new ge("newlines are not allowed in strings",{toml:e,ptr:t-1})}else if(l<" "&&l!==" "||l==="")throw new ge("control characters are not allowed in strings",{toml:e,ptr:t-1});if(o){if(o=!1,l==="x"||l==="u"||l==="U"){let u=e.slice(t,t+=l==="x"?2:l==="u"?4:8);if(!
|
|
1264
|
+
`){if(!s)throw new ge("newlines are not allowed in strings",{toml:e,ptr:t-1})}else if(l<" "&&l!==" "||l==="")throw new ge("control characters are not allowed in strings",{toml:e,ptr:t-1});if(o){if(o=!1,l==="x"||l==="u"||l==="U"){let u=e.slice(t,t+=l==="x"?2:l==="u"?4:8);if(!uH.test(u))throw new ge("invalid unicode escape",{toml:e,ptr:i});try{a+=String.fromCodePoint(parseInt(u,16))}catch{throw new ge("invalid unicode escape",{toml:e,ptr:i})}}else if(s&&(l===`
|
|
1265
1265
|
`||l===" "||l===" "||l==="\r")){if(t=ar(e,t-1,!0),e[t]!==`
|
|
1266
|
-
`&&e[t]!=="\r")throw new ge("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:i});t=ar(e,t)}else if(l in Pg)a+=Pg[l];else throw new ge("unrecognized escape sequence",{toml:e,ptr:i});c=t}else!n&&l==="\\"&&(i=t-1,o=!0,a+=e.slice(c,i))}return a+e.slice(c,r-1)}d(ch,"parseString");hk(ch,"parseString");function mk(e,t,r,n){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return n?0n:0;let s=
|
|
1267
|
-
`&&e[o]!=="\r")throw new ge("unexpected character encountered",{toml:e,ptr:o});o+=+(e[o]===",")}return[c,o]}o=fk(e,t,",",r);let a=yk(e,t,o-+(e[o-1]===","));if(!a[0])throw new ge("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return r&&a[1]>-1&&(o=ar(e,t+a[1]),o+=+(e[o]===",")),[mk(a[0],e,t,s),o]}d(yl,"extractValue");gk(yl,"extractValue");var
|
|
1266
|
+
`&&e[t]!=="\r")throw new ge("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:i});t=ar(e,t)}else if(l in Pg)a+=Pg[l];else throw new ge("unrecognized escape sequence",{toml:e,ptr:i});c=t}else!n&&l==="\\"&&(i=t-1,o=!0,a+=e.slice(c,i))}return a+e.slice(c,r-1)}d(ch,"parseString");hk(ch,"parseString");function mk(e,t,r,n){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return n?0n:0;let s=aH.test(e);if(s||cH.test(e)){if(lH.test(e))throw new ge("leading zeroes are not allowed",{toml:t,ptr:r});e=e.replace(/_/g,"");let o=+e;if(isNaN(o))throw new ge("invalid number",{toml:t,ptr:r});if(s){if((s=!Number.isSafeInteger(o))&&!n)throw new ge("integer value cannot be represented losslessly",{toml:t,ptr:r});(s||n===!0)&&(o=BigInt(e))}return o}const i=new ks(e);if(!i.isValid())throw new ge("invalid value",{toml:t,ptr:r});return i}d(mk,"parseValue");hk(mk,"parseValue");var pH=Object.defineProperty,gk=d((e,t)=>pH(e,"name",{value:t,configurable:!0}),"t$3");function yk(e,t,r){let n=e.slice(t,r),s=n.indexOf("#");return s>-1&&(Qo(e,s),n=n.slice(0,s)),[n.trimEnd(),s]}d(yk,"T$1");gk(yk,"sliceAndTrimEndOf");function yl(e,t,r,n,s){if(n===0)throw new ge("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let i=e[t];if(i==="["||i==="{"){let[c,l]=i==="["?bk(e,t,n,s):vk(e,t,n,s);if(r){if(l=ar(e,l),e[l]===",")l++;else if(e[l]!==r)throw new ge("expected comma or end of structure",{toml:e,ptr:l})}return[c,l]}let o;if(i==='"'||i==="'"){o=ah(e,t);let c=ch(e,t,o);if(r){if(o=ar(e,o),e[o]&&e[o]!==","&&e[o]!==r&&e[o]!==`
|
|
1267
|
+
`&&e[o]!=="\r")throw new ge("unexpected character encountered",{toml:e,ptr:o});o+=+(e[o]===",")}return[c,o]}o=fk(e,t,",",r);let a=yk(e,t,o-+(e[o-1]===","));if(!a[0])throw new ge("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return r&&a[1]>-1&&(o=ar(e,t+a[1]),o+=+(e[o]===",")),[mk(a[0],e,t,s),o]}d(yl,"extractValue");gk(yl,"extractValue");var dH=Object.defineProperty,lh=d((e,t)=>dH(e,"name",{value:t,configurable:!0}),"m$3");let fH=/^[a-zA-Z0-9-_]+[ \t]*$/;function uc(e,t,r="="){let n=t-1,s=[],i=e.indexOf(r,t);if(i<0)throw new ge("incomplete key-value: cannot find end of key",{toml:e,ptr:t});do{let o=e[t=++n];if(o!==" "&&o!==" ")if(o==='"'||o==="'"){if(o===e[t+1]&&o===e[t+2])throw new ge("multiline strings are not allowed in keys",{toml:e,ptr:t});let a=ah(e,t);if(a<0)throw new ge("unfinished string encountered",{toml:e,ptr:t});n=e.indexOf(".",a);let c=e.slice(a,n<0||n>i?i:n),l=lc(c);if(l>-1)throw new ge("newlines are not allowed in keys",{toml:e,ptr:t+n+l});if(c.trimStart())throw new ge("found extra tokens after the string part",{toml:e,ptr:a});if(i<a&&(i=e.indexOf(r,a),i<0))throw new ge("incomplete key-value: cannot find end of key",{toml:e,ptr:t});s.push(ch(e,t,a))}else{n=e.indexOf(".",t);let a=e.slice(t,n<0||n>i?i:n);if(!fH.test(a))throw new ge("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:t});s.push(a.trimEnd())}}while(n+1&&n<i);return[s,ar(e,i+1,!0,!0)]}d(uc,"parseKey");lh(uc,"parseKey");function vk(e,t,r,n){let s={},i=new Set,o;for(t++;(o=e[t++])!=="}"&&o;){if(o===",")throw new ge("expected value, found comma",{toml:e,ptr:t-1});if(o==="#")t=Qo(e,t);else if(o!==" "&&o!==" "&&o!==`
|
|
1268
1268
|
`&&o!=="\r"){let a,c=s,l=!1,[u,p]=uc(e,t-1);for(let $=0;$<u.length;$++){if($&&(c=l?c[a]:c[a]={}),a=u[$],(l=Object.hasOwn(c,a))&&(typeof c[a]!="object"||i.has(c[a])))throw new ge("trying to redefine an already defined value",{toml:e,ptr:t});!l&&a==="__proto__"&&Object.defineProperty(c,a,{enumerable:!0,configurable:!0,writable:!0})}if(l)throw new ge("trying to redefine an already defined value",{toml:e,ptr:t});let[f,m]=yl(e,p,"}",r-1,n);i.add(f),c[a]=f,t=m}}if(!o)throw new ge("unfinished table encountered",{toml:e,ptr:t});return[s,t]}d(vk,"parseInlineTable");lh(vk,"parseInlineTable");function bk(e,t,r,n){let s=[],i;for(t++;(i=e[t++])!=="]"&&i;){if(i===",")throw new ge("expected value, found comma",{toml:e,ptr:t-1});if(i==="#")t=Qo(e,t);else if(i!==" "&&i!==" "&&i!==`
|
|
1269
|
-
`&&i!=="\r"){let o=yl(e,t-1,"]",r-1,n);s.push(o[0]),t=o[1]}}if(!i)throw new ge("unfinished array encountered",{toml:e,ptr:t});return[s,t]}d(bk,"parseArray");lh(bk,"parseArray");var
|
|
1270
|
-
`&&e[a]!=="\r")throw new ge("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:a});a=ar(e,a)}return n}d(wk,"parse");$k(wk,"parse");var
|
|
1269
|
+
`&&i!=="\r"){let o=yl(e,t-1,"]",r-1,n);s.push(o[0]),t=o[1]}}if(!i)throw new ge("unfinished array encountered",{toml:e,ptr:t});return[s,t]}d(bk,"parseArray");lh(bk,"parseArray");var hH=Object.defineProperty,$k=d((e,t)=>hH(e,"name",{value:t,configurable:!0}),"b$4");function wp(e,t,r,n){let s=t,i=r,o,a=!1,c;for(let l=0;l<e.length;l++){if(l){if(s=a?s[o]:s[o]={},i=(c=i[o]).c,n===0&&(c.t===1||c.t===2))return null;if(c.t===2){let u=s.length-1;s=s[u],i=i[u].c}}if(o=e[l],(a=Object.hasOwn(s,o))&&i[o]?.t===0&&i[o]?.d)return null;a||(o==="__proto__"&&(Object.defineProperty(s,o,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(i,o,{enumerable:!0,configurable:!0,writable:!0})),i[o]={t:l<e.length-1&&n===2?3:n,d:!1,i:0,c:{}})}if(c=i[o],c.t!==n&&!(n===1&&c.t===3)||(n===2&&(c.d||(c.d=!0,s[o]=[]),s[o].push(s={}),c.c[c.i++]=c={t:1,d:!1,i:0,c:{}}),c.d))return null;if(c.d=!0,n===1)s=a?s[o]:s[o]={};else if(n===0&&a)return null;return[o,s,c.c]}d(wp,"w");$k(wp,"peekTable");function wk(e,{maxDepth:t=1e3,integersAsBigInt:r}={}){let n={},s={},i=n,o=s;for(let a=ar(e,0);a<e.length;){if(e[a]==="["){let c=e[++a]==="[",l=uc(e,a+=+c,"]");if(c){if(e[l[1]-1]!=="]")throw new ge("expected end of table declaration",{toml:e,ptr:l[1]-1});l[1]++}let u=wp(l[0],n,s,c?2:1);if(!u)throw new ge("trying to redefine an already defined table or value",{toml:e,ptr:a});o=u[2],i=u[1],a=l[1]}else{let c=uc(e,a),l=wp(c[0],i,o,0);if(!l)throw new ge("trying to redefine an already defined table or value",{toml:e,ptr:a});let u=yl(e,c[1],void 0,t,r);l[1][l[0]]=u[0],a=u[1]}if(a=ar(e,a,!0),e[a]&&e[a]!==`
|
|
1270
|
+
`&&e[a]!=="\r")throw new ge("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:a});a=ar(e,a)}return n}d(wk,"parse");$k(wk,"parse");var mH=Object.defineProperty,Mr=d((e,t)=>mH(e,"name",{value:t,configurable:!0}),"l$2");/*!
|
|
1271
1271
|
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
1272
1272
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1273
1273
|
*
|
|
@@ -1300,11 +1300,11 @@ ${i}`,r),this.line=n,this.column=s,this.codeblock=i}}var Jq=Object.definePropert
|
|
|
1300
1300
|
`)+$l(f,t[l],f,n-1,s)}else i+=p,i+=" = ",i+=bl(t[l],u,n,s),i+=`
|
|
1301
1301
|
`}}return e&&(i||!o)&&(i=i?`[${e}]
|
|
1302
1302
|
${i}`:`[${e}]`),i&&o?`${i}
|
|
1303
|
-
${o}`:i||o}d($l,"h$2");Mr($l,"stringifyTable");function
|
|
1303
|
+
${o}`:i||o}d($l,"h$2");Mr($l,"stringifyTable");function gH(e,{maxDepth:t=1e3,numbersAsFloat:r=!1}={}){if(yi(e)!=="object")throw new TypeError("stringify can only be called with an object");let n=$l(0,e,"",t,r);return n[n.length-1]!==`
|
|
1304
1304
|
`?n+`
|
|
1305
|
-
`:n}d(cH,"stringify");Mr(cH,"stringify");var lH=Object.defineProperty,uH=d((e,t)=>lH(e,"name",{value:t,configurable:!0}),"a$2"),pH=Object.defineProperty,dH=uH((e,t)=>pH(e,"name",{value:t,configurable:!0}),"t"),fH=Object.defineProperty,hH=dH((e,t)=>fH(e,"name",{value:t,configurable:!0}),"n");const mH=hH((e,t)=>{const r=H(e,{encoding:"utf8",...t});return wk(r)},"readTomlSync");var gH=Object.defineProperty,wl=d((e,t)=>gH(e,"name",{value:t,configurable:!0}),"t$1");wl(e=>{if(!Number.isFinite(e)||e<=0)return"0m";const t=Math.max(1,Math.round(e));return t%1440===0?`${String(t/1440)}d`:t%60===0?`${String(t/60)}h`:`${String(t)}m`},"formatMinutesAsTimeString");const jk=wl(e=>{const t=e.trim();if(t==="")return;const r=/^(\d+(?:\.\d+)?)\s*([mhdw]?)$/i.exec(t);if(!r)return;const n=Number.parseFloat(r[1]);if(!(!Number.isFinite(n)||n<0))switch(r[2]?.toLowerCase()){case"":case"m":case void 0:return Math.round(n);case"d":return Math.round(n*1440);case"h":return Math.round(n*60);case"w":return Math.round(n*10080);default:return}},"parseDurationToMinutes"),yH=wl(e=>e.startsWith("@")||e.includes("/")||/[:#\s]/.test(e),"needsYamlQuote"),ZJ=wl(e=>yH(e)?`'${e.replaceAll("'","''")}'`:e,"renderYamlKey");var vH=Object.defineProperty,kl=d((e,t)=>vH(e,"name",{value:t,configurable:!0}),"p$2");const bH=kl(e=>{const t=e.trim();return/^\d+$/.test(t)?Number.parseInt(t,10)*1440:jk(t)},"parseNpmReleaseAgeValue"),$H=kl((e,t)=>{const r={};try{switch(e){case"bun":{const n=D(t,"package.json");if(j(n)){const i=le(n);Array.isArray(i.trustedDependencies)&&(r.allowBuilds=new Set(i.trustedDependencies))}const s=D(t,"bunfig.toml");if(j(s)){const i=mH(s),o=i?.install?.minimumReleaseAge;typeof o=="number"&&(r.minReleaseAgeMinutes=Math.round(o/60)),Array.isArray(i?.install?.minimumReleaseAgeExcludes)&&(r.minReleaseAgeExcludes=new Set(i.install.minimumReleaseAgeExcludes))}break}case"npm":{const n=D(t,".npmrc");if(j(n)){const s=H(n),i=/^\s*min-release-age\s*=\s*([^\s#;]+)/m.exec(s);i&&(r.minReleaseAgeMinutes=bH(i[1]))}break}case"pnpm":{const n=D(t,"pnpm-workspace.yaml");if(j(n)){const s=Lt(n);s?.allowBuilds&&typeof s.allowBuilds=="object"?r.allowBuilds=new Set(Object.entries(s.allowBuilds).filter(([,i])=>i).map(([i])=>i)):Array.isArray(s?.onlyBuiltDependencies)&&(r.allowBuilds=new Set(s.onlyBuiltDependencies)),typeof s?.minimumReleaseAge=="number"&&(r.minReleaseAgeMinutes=s.minimumReleaseAge),Array.isArray(s?.minimumReleaseAgeExclude)&&(r.minReleaseAgeExcludes=new Set(s.minimumReleaseAgeExclude))}break}case"yarn":{const n=D(t,".yarnrc.yml");if(j(n)){const s=Lt(n),i=s?.npmMinimalAgeGate;typeof i=="string"?r.minReleaseAgeMinutes=jk(i):typeof i=="number"&&(r.minReleaseAgeMinutes=i),Array.isArray(s?.npmPreapprovedPackages)&&(r.minReleaseAgeExcludes=new Set(s.npmPreapprovedPackages))}break}}}catch{}return r},"readPmNativeSnapshot"),wH=kl((e,t,r)=>{const n=$H(t,r),s={hasDrift:!1,packageManager:t},i=(e.security??{}).policies??{},{installScripts:o}=i,{firstSeen:a}=i;if(o?.allow&&(t==="pnpm"||t==="bun")){const c=new Set(Object.entries(o.allow).filter(([,f])=>f).map(([f])=>f)),l=n.allowBuilds??new Set,u=[...c].filter(f=>!l.has(f)),p=[...l].filter(f=>!c.has(f));(u.length>0||p.length>0)&&(s.allowBuilds={onlyInPm:p,onlyInVis:u},s.hasDrift=!0)}if(a?.minutes!==void 0&&!(t==="yarn"&&n.minReleaseAgeMinutes===void 0&&!j(D(r,".yarnrc.yml")))&&n.minReleaseAgeMinutes!==a.minutes&&(s.minReleaseAge={pm:n.minReleaseAgeMinutes,vis:a.minutes},s.hasDrift=!0),a?.exclude&&(t==="pnpm"||t==="bun"||t==="yarn")){const c=new Set(a.exclude),l=n.minReleaseAgeExcludes??new Set,u=[...c].filter(f=>!l.has(f)),p=[...l].filter(f=>!c.has(f));(u.length>0||p.length>0)&&(s.minReleaseAgeExcludes={onlyInPm:p,onlyInVis:u},s.hasDrift=!0)}return s},"checkPmNativeConfigDrift"),kH=kl(e=>{if(!e.hasDrift)return[];const t=[`vis.config and ${e.packageManager}-native config disagree on security settings:`];if(e.allowBuilds&&(e.allowBuilds.onlyInVis.length>0&&t.push(` security.policies.installScripts.allow — only in vis.config: ${e.allowBuilds.onlyInVis.join(", ")}`),e.allowBuilds.onlyInPm.length>0&&t.push(` security.policies.installScripts.allow — only in ${e.packageManager} config: ${e.allowBuilds.onlyInPm.join(", ")}`)),e.minReleaseAge){const r=e.minReleaseAge.vis===void 0?"unset":`${String(e.minReleaseAge.vis)} min`,n=e.minReleaseAge.pm===void 0?"unset":`${String(e.minReleaseAge.pm)} min`;t.push(` security.policies.firstSeen.minutes — vis.config: ${r}, ${e.packageManager}: ${n}`)}return e.minReleaseAgeExcludes&&(e.minReleaseAgeExcludes.onlyInVis.length>0&&t.push(` security.policies.firstSeen.exclude — only in vis.config: ${e.minReleaseAgeExcludes.onlyInVis.join(", ")}`),e.minReleaseAgeExcludes.onlyInPm.length>0&&t.push(` security.policies.firstSeen.exclude — only in ${e.packageManager} config: ${e.minReleaseAgeExcludes.onlyInPm.join(", ")}`)),t.push(" Run 'vis security sync' to push vis.config values to the native config."),t},"formatDriftReport");var SH=Object.defineProperty,DH=d((e,t)=>SH(e,"name",{value:t,configurable:!0}),"o$2");const CH=DH(e=>j(D(e,".yarnrc.yml")),"isYarnBerry");var EH=Object.defineProperty,jH=d((e,t)=>EH(e,"name",{value:t,configurable:!0}),"l$1");const AH=jH((e,t,r)=>{const n={extraArgs:[],postInstallPackages:[],scriptsBlockedByDefault:!1,warnings:[]},s=r.security?.policies?.installScripts?.allow??{},i=Object.keys(s).length>0;switch(e){case"bun":{if(n.scriptsBlockedByDefault=!0,i){const o=D(t,"package.json");try{(j(o)?le(o):{}).trustedDependencies?.length||n.warnings.push("vis security.policies.installScripts.allow is configured but trustedDependencies is empty. Run 'vis approve-builds --sync-native'.")}catch{}}break}case"npm":{n.scriptsBlockedByDefault=!1;const o=D(t,".npmrc"),a=j(o)&&/^\s*ignore-scripts\s*=\s*true\s*$/m.test(H(o));if(!a&&i?(n.warnings.push("npm does not block lifecycle scripts. vis will add --ignore-scripts automatically."),n.extraArgs.push("--ignore-scripts")):!a&&!i&&n.warnings.push("npm does not block lifecycle scripts. Add 'ignore-scripts=true' to .npmrc and configure security.policies.installScripts.allow."),i)for(const[c,l]of Object.entries(s))l&&n.postInstallPackages.push(c);break}case"pnpm":{n.scriptsBlockedByDefault=!0,i||n.warnings.push("pnpm blocks build scripts by default. Run 'vis approve-builds' to review packages that need scripts.");break}case"yarn":{if(n.scriptsBlockedByDefault=!1,CH(t)){const o=H(D(t,".yarnrc.yml"));/^\s*enableScripts\s*:\s*false\s*$/m.test(o)?n.scriptsBlockedByDefault=!0:n.warnings.push("yarn berry supports enableScripts. Add 'enableScripts: false' to .yarnrc.yml.")}else if(n.warnings.push("yarn classic does not support blocking lifecycle scripts. Consider upgrading to yarn berry."),i){n.extraArgs.push("--ignore-scripts");for(const[o,a]of Object.entries(s))a&&n.postInstallPackages.push(o)}break}}return n},"enforceScriptSecurity");var xH=Object.defineProperty,Zo=d((e,t)=>xH(e,"name",{value:t,configurable:!0}),"p$1");const Ak=Zo((...e)=>{const t={...process.env},r=t.PATH??t.Path??"",n=e.filter(s=>s.length>0).join(dh);return t.PATH=n.length>0?r?`${n}${dh}${r}`:n:r,t},"envWithBin"),OH=Zo(e=>{if(e.endsWith("*"))return e.endsWith("@*")?e.slice(0,-2):e;const t=e.startsWith("@"),r=e.indexOf("@",t?1:0);return r===-1?e:e.slice(0,r)},"stripVersionSuffix"),PH=Zo((e,t)=>{const r=D(e,"node_modules"),n=[];for(const s of t){if(!s.endsWith("*")){n.push(OH(s));continue}const i=s.slice(0,-1);try{if(i.startsWith("@")&&i.endsWith("/")){const o=D(r,i.slice(0,-1));for(const a of Ze(o))!a.startsWith(".")&&cr(D(o,a)).isDirectory()&&n.push(`${i.slice(0,-1)}/${a}`)}else for(const o of Ze(r))o.startsWith(i)&&cr(D(r,o)).isDirectory()&&n.push(o)}catch{}}return n},"expandPatterns"),FH=Zo((e,t)=>{if(t.length===0)return;const r=PH(e,t);if(r.length===0)return;const n=D(e,"node_modules"),s=D(n,".bin");let i=!1;for(const o of r){if(o.includes("..")||o.startsWith("/")||o.startsWith("\\")){P.warn(`Skipping invalid package name: ${o}`);continue}const a=(o.match(/\//g)??[]).length;if(a>1||a===1&&!o.startsWith("@")){P.warn(`Skipping invalid package name: ${o}`);continue}const c=D(n,o),l=D(c,"package.json");if(j(l))try{const u=le(l).scripts??{},p=D(c,"node_modules",".bin"),f=Ak(p,s);for(const m of["preinstall","install","postinstall"])if(u[m]){P.info(`Running ${m} for ${o}...`);try{const $=u[m];zg($,{cwd:c,env:f,stdio:"inherit"})}catch{P.error(`${m} script failed for ${o}`),i=!0}}}catch{}}i&&(process.exitCode=1)},"runApprovedScripts"),eK=Zo((e,t=["prepublish","prepare"])=>{const r=D(e,"package.json");if(!j(r))return;let n;try{n=le(r).scripts??{}}catch{return}let s=!1;const i=Ak(D(e,"node_modules",".bin"));for(const o of t){const a=n[o];if(a){P.info(`Running root ${o}...`);try{zg(a,{cwd:e,env:i,stdio:"inherit"})}catch{P.error(`Root ${o} script failed.`),s=!0}}}s&&(process.exitCode=1)},"runRootLifecycleScripts");var BH=Object.defineProperty,kp=d((e,t)=>BH(e,"name",{value:t,configurable:!0}),"m");const mu=new Set(["add","install","update"]),RH=new Set(["add","dedupe","install","remove","update"]),TH=/(\d+\.\d+\.\d+)/,NH=kp(e=>{const t=D(e,"package.json");if(!j(t))return[];const r=[];try{const n=le(t),s={...n.dependencies,...n.devDependencies};for(const[i,o]of Object.entries(s)){const a=D(e,"node_modules",i,"package.json");if(j(a))try{const l=le(a);if(l.version){r.push({name:i,version:l.version});continue}}catch{}const c=TH.exec(o);c?.[1]&&r.push({name:i,version:c[1]})}}catch{}return r},"resolveInstalledPackages"),IH={afterCommand:kp(async e=>{if(process.exitCode&&process.exitCode!==0)return;const t=e.scriptEnforcement;t?.postInstallPackages.length&&e.workspaceRoot&&FH(e.workspaceRoot,t.postInstallPackages);const r=process.argv[2]??"",n=mu.has(r)&&e.workspaceRoot?fh(e.workspaceRoot):void 0;if(n&&e.visConfig&&e.workspaceRoot&&new Set(["bun","npm","pnpm","yarn"]).has(n.name)){const s=wH(e.visConfig,n.name,e.workspaceRoot);if(s.hasDrift){P.info("");for(const i of kH(s))P.warn(i)}}if(mu.has(r)&&e.workspaceRoot){const s=new Set;hu("socket")&&s.add("socket"),hu("depsDev")&&s.add("deps-dev");const i=e.visConfig?.security?.policies?.score?.minimum,o=IW(e.visConfig?.security,{disabled:s,minimumScore:i});if(o.length>0)try{const a=NH(e.workspaceRoot);if(a.length>0){const c=await P1(o,a);if(c.size>0){const l=QL(c,i);if(l){P.info(""),P.info(l);let u=0;for(const p of c.values())for(const f of p.alerts)(f.severity==="critical"||f.severity==="high")&&u++;u>0&&P.warn(`${String(u)} critical/high severity alert${u===1?"":"s"} detected. Run 'vis check --security' for details.`)}}}}catch{}}},"afterCommand"),beforeCommand:kp(async e=>{const t=process.argv[2]??"";if(RH.has(t)&&e.visConfig&&e.workspaceRoot){const r=fh(e.workspaceRoot),n=mu.has(t);if(Hq(e.visConfig,r.name,n),n&&!hu("installScripts")){const s=AH(r.name,e.workspaceRoot,e.visConfig);for(const i of s.warnings)e.logger.warn(`security: ${i}`);e.scriptEnforcement=s}}},"beforeCommand"),name:"security-enforcement"};var LH=Object.defineProperty,_H=d((e,t)=>LH(e,"name",{value:t,configurable:!0}),"i");const MH=_H(e=>{for(let t=0;t<e.length;t+=1){const r=e[t];if(r==="--ca-cert"){const n=e[t+1];return n===void 0||n.startsWith("-")?void 0:Ps(n)}if(r.startsWith("--ca-cert=")){const n=r.slice(10);return n===""?void 0:Ps(n)}}},"parseEarlyCaCert");var WH=Object.defineProperty,VH=d((e,t)=>WH(e,"name",{value:t,configurable:!0}),"n$1");const UH=VH(()=>process.platform==="win32"?!!process.env.WT_SESSION||process.env.TERM_PROGRAM==="vscode"||process.env.TERM==="xterm-256color":process.env.TERM!=="linux","isUnicodeSupported"),Li=UH(),GH={arrow:Li?"→":"->",dash:Li?"—":"-",failure:Li?"✗":"x",success:Li?"✓":"v",warning:Li?"⚠":"!"};var qH=Object.defineProperty,vi=d((e,t)=>qH(e,"name",{value:t,configurable:!0}),"s");const Sp=D(fn(),"upgrade-check.json"),HH=1440*60*1e3,zH=1440*60*1e3,JH=500,KH=new Set(["--help","--version","-h","-V","help","implode","self-update","upgrade"]),YH=vi(()=>{try{if(j(Sp))return le(Sp)}catch{}},"readCache"),xk=vi(e=>{try{$t(fn()),qe(Sp,JSON.stringify(e))}catch{}},"writeCache"),XH=vi(async e=>{try{const t=new AbortController,r=setTimeout(()=>{t.abort()},JH),n=await fetch(`https://registry.npmjs.org/${e}/latest`,{headers:{accept:"application/json"},signal:t.signal});return clearTimeout(r),n.ok?(await n.json()).version:void 0}catch{return}},"fetchLatestVersion"),Fg=vi((e,t)=>{let r;try{r=Fs.gt(t.latestVersion,e,{loose:!0})}catch{return}if(!r)return;const n=Date.now();n-t.lastNoticeAt<zH||(process.stderr.write(`
|
|
1306
|
-
${On("vis update available:")} ${_i(e)} ${On(
|
|
1307
|
-
`),t.lastNoticeAt=n,xk(t))},"showUpgradeNotice"),
|
|
1305
|
+
`:n}d(gH,"stringify");Mr(gH,"stringify");var yH=Object.defineProperty,vH=d((e,t)=>yH(e,"name",{value:t,configurable:!0}),"a$2"),bH=Object.defineProperty,$H=vH((e,t)=>bH(e,"name",{value:t,configurable:!0}),"t"),wH=Object.defineProperty,kH=$H((e,t)=>wH(e,"name",{value:t,configurable:!0}),"n");const SH=kH((e,t)=>{const r=H(e,{encoding:"utf8",...t});return wk(r)},"readTomlSync");var DH=Object.defineProperty,wl=d((e,t)=>DH(e,"name",{value:t,configurable:!0}),"t$1");wl(e=>{if(!Number.isFinite(e)||e<=0)return"0m";const t=Math.max(1,Math.round(e));return t%1440===0?`${String(t/1440)}d`:t%60===0?`${String(t/60)}h`:`${String(t)}m`},"formatMinutesAsTimeString");const jk=wl(e=>{const t=e.trim();if(t==="")return;const r=/^(\d+(?:\.\d+)?)\s*([mhdw]?)$/i.exec(t);if(!r)return;const n=Number.parseFloat(r[1]);if(!(!Number.isFinite(n)||n<0))switch(r[2]?.toLowerCase()){case"":case"m":case void 0:return Math.round(n);case"d":return Math.round(n*1440);case"h":return Math.round(n*60);case"w":return Math.round(n*10080);default:return}},"parseDurationToMinutes"),CH=wl(e=>e.startsWith("@")||e.includes("/")||/[:#\s]/.test(e),"needsYamlQuote"),aK=wl(e=>CH(e)?`'${e.replaceAll("'","''")}'`:e,"renderYamlKey");var EH=Object.defineProperty,kl=d((e,t)=>EH(e,"name",{value:t,configurable:!0}),"p$2");const jH=kl(e=>{const t=e.trim();return/^\d+$/.test(t)?Number.parseInt(t,10)*1440:jk(t)},"parseNpmReleaseAgeValue"),AH=kl((e,t)=>{const r={};try{switch(e){case"bun":{const n=D(t,"package.json");if(j(n)){const i=le(n);Array.isArray(i.trustedDependencies)&&(r.allowBuilds=new Set(i.trustedDependencies))}const s=D(t,"bunfig.toml");if(j(s)){const i=SH(s),o=i?.install?.minimumReleaseAge;typeof o=="number"&&(r.minReleaseAgeMinutes=Math.round(o/60)),Array.isArray(i?.install?.minimumReleaseAgeExcludes)&&(r.minReleaseAgeExcludes=new Set(i.install.minimumReleaseAgeExcludes))}break}case"npm":{const n=D(t,".npmrc");if(j(n)){const s=H(n),i=/^\s*min-release-age\s*=\s*([^\s#;]+)/m.exec(s);i&&(r.minReleaseAgeMinutes=jH(i[1]))}break}case"pnpm":{const n=D(t,"pnpm-workspace.yaml");if(j(n)){const s=Lt(n);s?.allowBuilds&&typeof s.allowBuilds=="object"?r.allowBuilds=new Set(Object.entries(s.allowBuilds).filter(([,i])=>i).map(([i])=>i)):Array.isArray(s?.onlyBuiltDependencies)&&(r.allowBuilds=new Set(s.onlyBuiltDependencies)),typeof s?.minimumReleaseAge=="number"&&(r.minReleaseAgeMinutes=s.minimumReleaseAge),Array.isArray(s?.minimumReleaseAgeExclude)&&(r.minReleaseAgeExcludes=new Set(s.minimumReleaseAgeExclude))}break}case"yarn":{const n=D(t,".yarnrc.yml");if(j(n)){const s=Lt(n),i=s?.npmMinimalAgeGate;typeof i=="string"?r.minReleaseAgeMinutes=jk(i):typeof i=="number"&&(r.minReleaseAgeMinutes=i),Array.isArray(s?.npmPreapprovedPackages)&&(r.minReleaseAgeExcludes=new Set(s.npmPreapprovedPackages))}break}}}catch{}return r},"readPmNativeSnapshot"),xH=kl((e,t,r)=>{const n=AH(t,r),s={hasDrift:!1,packageManager:t},i=(e.security??{}).policies??{},{installScripts:o}=i,{firstSeen:a}=i;if(o?.allow&&(t==="pnpm"||t==="bun")){const c=new Set(Object.entries(o.allow).filter(([,f])=>f).map(([f])=>f)),l=n.allowBuilds??new Set,u=[...c].filter(f=>!l.has(f)),p=[...l].filter(f=>!c.has(f));(u.length>0||p.length>0)&&(s.allowBuilds={onlyInPm:p,onlyInVis:u},s.hasDrift=!0)}if(a?.minutes!==void 0&&!(t==="yarn"&&n.minReleaseAgeMinutes===void 0&&!j(D(r,".yarnrc.yml")))&&n.minReleaseAgeMinutes!==a.minutes&&(s.minReleaseAge={pm:n.minReleaseAgeMinutes,vis:a.minutes},s.hasDrift=!0),a?.exclude&&(t==="pnpm"||t==="bun"||t==="yarn")){const c=new Set(a.exclude),l=n.minReleaseAgeExcludes??new Set,u=[...c].filter(f=>!l.has(f)),p=[...l].filter(f=>!c.has(f));(u.length>0||p.length>0)&&(s.minReleaseAgeExcludes={onlyInPm:p,onlyInVis:u},s.hasDrift=!0)}return s},"checkPmNativeConfigDrift"),OH=kl(e=>{if(!e.hasDrift)return[];const t=[`vis.config and ${e.packageManager}-native config disagree on security settings:`];if(e.allowBuilds&&(e.allowBuilds.onlyInVis.length>0&&t.push(` security.policies.installScripts.allow — only in vis.config: ${e.allowBuilds.onlyInVis.join(", ")}`),e.allowBuilds.onlyInPm.length>0&&t.push(` security.policies.installScripts.allow — only in ${e.packageManager} config: ${e.allowBuilds.onlyInPm.join(", ")}`)),e.minReleaseAge){const r=e.minReleaseAge.vis===void 0?"unset":`${String(e.minReleaseAge.vis)} min`,n=e.minReleaseAge.pm===void 0?"unset":`${String(e.minReleaseAge.pm)} min`;t.push(` security.policies.firstSeen.minutes — vis.config: ${r}, ${e.packageManager}: ${n}`)}return e.minReleaseAgeExcludes&&(e.minReleaseAgeExcludes.onlyInVis.length>0&&t.push(` security.policies.firstSeen.exclude — only in vis.config: ${e.minReleaseAgeExcludes.onlyInVis.join(", ")}`),e.minReleaseAgeExcludes.onlyInPm.length>0&&t.push(` security.policies.firstSeen.exclude — only in ${e.packageManager} config: ${e.minReleaseAgeExcludes.onlyInPm.join(", ")}`)),t.push(" Run 'vis security sync' to push vis.config values to the native config."),t},"formatDriftReport");var PH=Object.defineProperty,FH=d((e,t)=>PH(e,"name",{value:t,configurable:!0}),"o$2");const BH=FH(e=>j(D(e,".yarnrc.yml")),"isYarnBerry");var RH=Object.defineProperty,TH=d((e,t)=>RH(e,"name",{value:t,configurable:!0}),"l$1");const NH=TH((e,t,r)=>{const n={extraArgs:[],postInstallPackages:[],scriptsBlockedByDefault:!1,warnings:[]},s=r.security?.policies?.installScripts?.allow??{},i=Object.keys(s).length>0;switch(e){case"bun":{if(n.scriptsBlockedByDefault=!0,i){const o=D(t,"package.json");try{(j(o)?le(o):{}).trustedDependencies?.length||n.warnings.push("vis security.policies.installScripts.allow is configured but trustedDependencies is empty. Run 'vis approve-builds --sync-native'.")}catch{}}break}case"npm":{n.scriptsBlockedByDefault=!1;const o=D(t,".npmrc"),a=j(o)&&/^\s*ignore-scripts\s*=\s*true\s*$/m.test(H(o));if(!a&&i?(n.warnings.push("npm does not block lifecycle scripts. vis will add --ignore-scripts automatically."),n.extraArgs.push("--ignore-scripts")):!a&&!i&&n.warnings.push("npm does not block lifecycle scripts. Add 'ignore-scripts=true' to .npmrc and configure security.policies.installScripts.allow."),i)for(const[c,l]of Object.entries(s))l&&n.postInstallPackages.push(c);break}case"pnpm":{n.scriptsBlockedByDefault=!0,i||n.warnings.push("pnpm blocks build scripts by default. Run 'vis approve-builds' to review packages that need scripts.");break}case"yarn":{if(n.scriptsBlockedByDefault=!1,BH(t)){const o=H(D(t,".yarnrc.yml"));/^\s*enableScripts\s*:\s*false\s*$/m.test(o)?n.scriptsBlockedByDefault=!0:n.warnings.push("yarn berry supports enableScripts. Add 'enableScripts: false' to .yarnrc.yml.")}else if(n.warnings.push("yarn classic does not support blocking lifecycle scripts. Consider upgrading to yarn berry."),i){n.extraArgs.push("--ignore-scripts");for(const[o,a]of Object.entries(s))a&&n.postInstallPackages.push(o)}break}}return n},"enforceScriptSecurity");var IH=Object.defineProperty,Zo=d((e,t)=>IH(e,"name",{value:t,configurable:!0}),"p$1");const Ak=Zo((...e)=>{const t={...process.env},r=t.PATH??t.Path??"",n=e.filter(s=>s.length>0).join(dh);return t.PATH=n.length>0?r?`${n}${dh}${r}`:n:r,t},"envWithBin"),LH=Zo(e=>{if(e.endsWith("*"))return e.endsWith("@*")?e.slice(0,-2):e;const t=e.startsWith("@"),r=e.indexOf("@",t?1:0);return r===-1?e:e.slice(0,r)},"stripVersionSuffix"),_H=Zo((e,t)=>{const r=D(e,"node_modules"),n=[];for(const s of t){if(!s.endsWith("*")){n.push(LH(s));continue}const i=s.slice(0,-1);try{if(i.startsWith("@")&&i.endsWith("/")){const o=D(r,i.slice(0,-1));for(const a of Ze(o))!a.startsWith(".")&&cr(D(o,a)).isDirectory()&&n.push(`${i.slice(0,-1)}/${a}`)}else for(const o of Ze(r))o.startsWith(i)&&cr(D(r,o)).isDirectory()&&n.push(o)}catch{}}return n},"expandPatterns"),MH=Zo((e,t)=>{if(t.length===0)return;const r=_H(e,t);if(r.length===0)return;const n=D(e,"node_modules"),s=D(n,".bin");let i=!1;for(const o of r){if(o.includes("..")||o.startsWith("/")||o.startsWith("\\")){P.warn(`Skipping invalid package name: ${o}`);continue}const a=(o.match(/\//g)??[]).length;if(a>1||a===1&&!o.startsWith("@")){P.warn(`Skipping invalid package name: ${o}`);continue}const c=D(n,o),l=D(c,"package.json");if(j(l))try{const u=le(l).scripts??{},p=D(c,"node_modules",".bin"),f=Ak(p,s);for(const m of["preinstall","install","postinstall"])if(u[m]){P.info(`Running ${m} for ${o}...`);try{const $=u[m];zg($,{cwd:c,env:f,stdio:"inherit"})}catch{P.error(`${m} script failed for ${o}`),i=!0}}}catch{}}i&&(process.exitCode=1)},"runApprovedScripts"),cK=Zo((e,t=["prepublish","prepare"])=>{const r=D(e,"package.json");if(!j(r))return;let n;try{n=le(r).scripts??{}}catch{return}let s=!1;const i=Ak(D(e,"node_modules",".bin"));for(const o of t){const a=n[o];if(a){P.info(`Running root ${o}...`);try{zg(a,{cwd:e,env:i,stdio:"inherit"})}catch{P.error(`Root ${o} script failed.`),s=!0}}}s&&(process.exitCode=1)},"runRootLifecycleScripts");var WH=Object.defineProperty,kp=d((e,t)=>WH(e,"name",{value:t,configurable:!0}),"m");const mu=new Set(["add","install","update"]),VH=new Set(["add","dedupe","install","remove","update"]),UH=/(\d+\.\d+\.\d+)/,GH=kp(e=>{const t=D(e,"package.json");if(!j(t))return[];const r=[];try{const n=le(t),s={...n.dependencies,...n.devDependencies};for(const[i,o]of Object.entries(s)){const a=D(e,"node_modules",i,"package.json");if(j(a))try{const l=le(a);if(l.version){r.push({name:i,version:l.version});continue}}catch{}const c=UH.exec(o);c?.[1]&&r.push({name:i,version:c[1]})}}catch{}return r},"resolveInstalledPackages"),qH={afterCommand:kp(async e=>{if(process.exitCode&&process.exitCode!==0)return;const t=e.scriptEnforcement;t?.postInstallPackages.length&&e.workspaceRoot&&MH(e.workspaceRoot,t.postInstallPackages);const r=process.argv[2]??"",n=mu.has(r)&&e.workspaceRoot?fh(e.workspaceRoot):void 0;if(n&&e.visConfig&&e.workspaceRoot&&new Set(["bun","npm","pnpm","yarn"]).has(n.name)){const s=xH(e.visConfig,n.name,e.workspaceRoot);if(s.hasDrift){P.info("");for(const i of OH(s))P.warn(i)}}if(mu.has(r)&&e.workspaceRoot){const s=new Set;hu("socket")&&s.add("socket"),hu("depsDev")&&s.add("deps-dev");const i=e.visConfig?.security?.policies?.score?.minimum,o=qW(e.visConfig?.security,{disabled:s,minimumScore:i});if(o.length>0)try{const a=GH(e.workspaceRoot);if(a.length>0){const c=await P1(o,a);if(c.size>0){const l=o9(c,i);if(l){P.info(""),P.info(l);let u=0;for(const p of c.values())for(const f of p.alerts)(f.severity==="critical"||f.severity==="high")&&u++;u>0&&P.warn(`${String(u)} critical/high severity alert${u===1?"":"s"} detected. Run 'vis check --security' for details.`)}}}}catch{}}},"afterCommand"),beforeCommand:kp(async e=>{const t=process.argv[2]??"";if(VH.has(t)&&e.visConfig&&e.workspaceRoot){const r=fh(e.workspaceRoot),n=mu.has(t);if(eH(e.visConfig,r.name,n),n&&!hu("installScripts")){const s=NH(r.name,e.workspaceRoot,e.visConfig);for(const i of s.warnings)e.logger.warn(`security: ${i}`);e.scriptEnforcement=s}}},"beforeCommand"),name:"security-enforcement"};var HH=Object.defineProperty,zH=d((e,t)=>HH(e,"name",{value:t,configurable:!0}),"i");const JH=zH(e=>{for(let t=0;t<e.length;t+=1){const r=e[t];if(r==="--ca-cert"){const n=e[t+1];return n===void 0||n.startsWith("-")?void 0:Ps(n)}if(r.startsWith("--ca-cert=")){const n=r.slice(10);return n===""?void 0:Ps(n)}}},"parseEarlyCaCert");var KH=Object.defineProperty,YH=d((e,t)=>KH(e,"name",{value:t,configurable:!0}),"n$1");const XH=YH(()=>process.platform==="win32"?!!process.env.WT_SESSION||process.env.TERM_PROGRAM==="vscode"||process.env.TERM==="xterm-256color":process.env.TERM!=="linux","isUnicodeSupported"),Li=XH(),QH={arrow:Li?"→":"->",dash:Li?"—":"-",failure:Li?"✗":"x",success:Li?"✓":"v",warning:Li?"⚠":"!"};var ZH=Object.defineProperty,vi=d((e,t)=>ZH(e,"name",{value:t,configurable:!0}),"s");const Sp=D(fn(),"upgrade-check.json"),ez=1440*60*1e3,tz=1440*60*1e3,rz=500,nz=new Set(["--help","--version","-h","-V","help","implode","self-update","upgrade"]),sz=vi(()=>{try{if(j(Sp))return le(Sp)}catch{}},"readCache"),xk=vi(e=>{try{$t(fn()),qe(Sp,JSON.stringify(e))}catch{}},"writeCache"),iz=vi(async e=>{try{const t=new AbortController,r=setTimeout(()=>{t.abort()},rz),n=await fetch(`https://registry.npmjs.org/${e}/latest`,{headers:{accept:"application/json"},signal:t.signal});return clearTimeout(r),n.ok?(await n.json()).version:void 0}catch{return}},"fetchLatestVersion"),Fg=vi((e,t)=>{let r;try{r=Fs.gt(t.latestVersion,e,{loose:!0})}catch{return}if(!r)return;const n=Date.now();n-t.lastNoticeAt<tz||(process.stderr.write(`
|
|
1306
|
+
${On("vis update available:")} ${_i(e)} ${On(QH.arrow)} ${hS(Qt(t.latestVersion))}${On(", run")} ${Gr("vis upgrade")}
|
|
1307
|
+
`),t.lastNoticeAt=n,xk(t))},"showUpgradeNotice"),oz=vi(e=>{if(Rr||process.env.VIS_CLI_TEST||process.env.VIS_NO_UPDATE_CHECK==="1"||!process.stderr.isTTY||nz.has(e))return!1;const t=new Set(process.argv.slice(2));return!(t.has("--silent")||t.has("-s")||t.has("--json"))},"shouldCheck"),az=vi((e,t)=>{if(!oz(t))return;const r=sz(),n=Date.now();if(r&&n-r.lastQueryAt<ez)return()=>{Fg(e,r)};let s=r;return iz("@visulima/vis").then(i=>{i&&(s={lastNoticeAt:r?.lastNoticeAt??0,lastQueryAt:n,latestVersion:i},xk(s))}).catch(()=>{}),()=>{s&&Fg(e,s)}},"startUpgradeCheck");var cz=Object.defineProperty,Bg=d((e,t)=>cz(e,"name",{value:t,configurable:!0}),"n");Rk();process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");const Rg=JH(process.argv);Rg!==void 0&&!process.env.NODE_EXTRA_CA_CERTS&&(process.env.NODE_EXTRA_CA_CERTS=Rg);vq();try{const e=o0(process.cwd()).path;process.env.VIS_MONOREPO_ROOT=e;const t=le(D(e,"package.json"));t.name&&bq(t.name)}catch{}const lz=az(Fa.version,process.argv[2]??"");Tk();const q=Nk("vis",{packageName:"vis",packageVersion:Fa.version}),uz=process.argv.includes("--debug")||!!process.env.DEBUG;q.addPlugin(Ik({detailed:uz,exitOnError:!1}));q.addGlobalOption({description:"Override workspace root directory",name:"cwd",type:String});q.addGlobalOption({description:"Path to a vis config file (overrides discovery)",name:"config",type:String});q.addGlobalOption({description:"Path to a CA bundle (PEM) to trust for HTTPS — for corporate proxies. Equivalent to NODE_EXTRA_CA_CERTS.",name:"ca-cert",type:String});q.addPlugin(kq);q.addPlugin(qH);q.addCommand(uG);q.addCommand(Ox);q.addCommand(p_);q.addCommand(LA);q.addCommand(YA);q.addCommand(zG);q.addCommand(aG);q.addCommand(S_);q.addCommand(rq);q.addCommand(jx);q.addCommand(G_);q.addCommand(ox);q.addCommand(TG);q.addCommand(LG);q.addCommand(WG);q.addCommand(G9);q.addCommand(GG);q.addCommand(Z9);q.addCommand(z_);q.addCommand(YG);q.addCommand(RC);q.addCommand(WC);q.addCommand(L_);q.addCommand(WA);q.addCommand(oG);q.addCommand(z9);q.addCommand(cq);q.addCommand(x_);q.addCommand(W_);q.addCommand(ZG);q.addCommand(Lk);q.addCommand(i_);q.addCommand(nG);q.addCommand(F_);q.addCommand(Bx);q.addCommand(Nx);q.addCommand(c_);q.addCommand(Y9);q.addCommand(iq);q.addCommand(E_);q.addCommand(lx);q.addCommand(mx);q.addCommand(T_);q.addCommand(r_);q.addCommand(eG);q.addCommand(fG);q.addCommand(gG);for(const e of $_)q.addCommand(e);for(const e of u4)q.addCommand(e);for(const e of Dx)q.addCommand(e);for(const e of zA)q.addCommand(e);for(const e of l0)q.addCommand(e);for(const e of FG)q.addCommand(e);for(const e of DG)q.addCommand(e);for(const e of dx)q.addCommand(e);q.addPlugin(Yq(lz));if(m4(process.argv.slice(2))){const{loadVisConfig:e}=await import("../packem_shared/applyDefaults-KxZkvlp3.js"),t=process.env.VIS_MONOREPO_ROOT||process.cwd();let r;try{r=await e(t)}catch{r=void 0}try{await XU({logger:{info:Bg(n=>{process.stdout.write(`${n}
|
|
1308
1308
|
`)},"info"),warn:Bg(n=>{process.stderr.write(`${n}
|
|
1309
1309
|
`)},"warn")},visConfig:r,workspaceRoot:t})}catch(n){process.stderr.write(`${n.message}
|
|
1310
|
-
`),process.exitCode=1}}else(async()=>{try{await q.run({shouldExitProcess:!1})}catch{process.exitCode=process.exitCode||1}finally{process.exit(process.exitCode??0)}})();export{ip as $,Tw as A,xr as B,
|
|
1310
|
+
`),process.exitCode=1}}else(async()=>{try{await q.run({shouldExitProcess:!1})}catch{process.exitCode=process.exitCode||1}finally{process.exit(process.exitCode??0)}})();export{ip as $,Tw as A,xr as B,GM as C,cK as D,C9 as E,MV as F,VV as G,UV as H,Fw as I,ln as J,FJ as K,c9 as L,BJ as M,i9 as N,wV as O,U1 as P,RJ as Q,yV as R,XJ as S,G1 as T,xA as U,RV as V,_V as W,Of as X,Ef as Y,QH as Z,pl as _,jt as a,IV as a$,hL as a0,fL as a1,DJ as a2,CJ as a3,EJ as a4,eK as a5,xH as a6,OH as a7,$J as a8,wJ as a9,N4 as aA,rJ as aB,Eo as aC,vr as aD,Xd as aE,Is as aF,Us as aG,tK as aH,rK as aI,nK as aJ,sK as aK,Xw as aL,Qw as aM,LJ as aN,_J as aO,WJ as aP,VJ as aQ,MJ as aR,SH as aS,Y4 as aT,e6 as aU,UJ as aV,LV as aW,YV as aX,ZV as aY,bV as aZ,XV as a_,kJ as aa,SJ as ab,un as ac,we as ad,Ft as ae,a1 as af,eg as ag,JU as ah,og as ai,ug as aj,Cg as ak,pg as al,ag as am,tg as an,ng as ao,dg as ap,Dg as aq,fg as ar,qU as as,GU as at,Jm as au,dl as av,Qf as aw,YJ as ax,SM as ay,KJ as az,qW as b,NV as b0,gV as b1,eJ as b2,MD as b3,JJ as b4,sJ as b5,fM as b6,qJ as b7,GJ as b8,Xh as b9,iJ as ba,TJ as bb,lo as bc,NJ as bd,IJ as be,lj as bf,Jv as bg,rR as bh,mm as bi,tJ as bj,ZJ as bk,iK as c,nJ as d,BH as e,P1 as f,Ic as g,ci as h,hu as i,Co as j,Do as k,Ld as l,aK as m,hn as n,Lt as o,P as p,Pr as q,Ew as r,Rr as s,PJ as t,MH as u,QJ as v,HJ as w,zJ as x,oK as y,qf as z};
|