@visulima/vis 6.0.1 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/packem_chunks/catalog.js +1 -1
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +6 -6
- package/dist/packem_chunks/handler12.js +4 -4
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler26.js +4 -4
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler59.js +1 -1
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler61.js +3 -3
- package/dist/packem_chunks/handler65.js +4 -4
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +6 -6
- package/dist/packem_chunks/handler71.js +26 -46
- package/dist/packem_chunks/handler72.js +1 -1
- package/dist/packem_chunks/handler73.js +1 -1
- package/dist/packem_chunks/handler78.js +1 -1
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/{affected-selection-CrW7fWEd.js → affected-selection-DGb6Xu5K.js} +1 -1
- package/dist/packem_shared/{bin-D3TtXgz6.js → bin-AZQv95jh.js} +1 -1
- package/dist/packem_shared/dependency-scan-CawAKoU_.js +1 -0
- package/dist/packem_shared/detect-CbMRSXkM.js +1 -0
- package/dist/packem_shared/{ecosystem-gate-ByxWtzPE.js → ecosystem-gate-DiqQj0LJ.js} +1 -1
- package/dist/packem_shared/env-consistency-B4rU4MQb.js +1 -0
- package/dist/packem_shared/{index-DGdD4w-b.js → index-CDHP1kby.js} +1 -1
- package/dist/packem_shared/{index-BKbMnn8K.js → index-JRb5wabN.js} +1 -1
- package/dist/packem_shared/{package-version-QFmE9anh.js → package-version-KLwH0Ivy.js} +1 -1
- package/dist/packem_shared/{project-name-filter-DIqpdsvP.js → project-name-filter-B1ZCsbOW.js} +1 -1
- package/dist/packem_shared/runtime-check-D3cRDuoi.js +1 -0
- package/dist/packem_shared/scaffold-files-DVyfB0yz.js +28 -0
- package/dist/packem_shared/toolchain-CP79HNVy.js +5 -0
- package/dist/packem_shared/{vis-user-error-S0Fesz5y.js → vis-user-error-CRmrBaD1.js} +1 -1
- package/dist/packem_shared/watch-loop-D1_e-qIl.js +11 -0
- package/index.js +26 -26
- package/package.json +9 -9
- package/dist/packem_shared/dependency-scan-B8jroa1D.js +0 -1
- package/dist/packem_shared/env-consistency-Dt_uDbSP.js +0 -1
- package/dist/packem_shared/runtime-check-1U8HrQd9.js +0 -1
- package/dist/packem_shared/toolchain-Bz70UIcp.js +0 -5
- package/dist/packem_shared/watch-loop-BEnGuMBn.js +0 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as hr}from"node:module";import{e as le,m as Rs,$ as gr,a as wr,z as vr}from"../packem_shared/index-BzhrR_iC.js";import{expandAffected as yr,getChangedFiles as xr,buildEnhancedPath as jr,enforceProjectConstraints as kr,expandTokensInString as Zt,parsePartition as br,TaskScheduler as Sr,createTaskGraph as Tr,reverseTaskGraph as $r,splitCompoundTasks as Cr,resolveTurboEnvCompat as Ir,CompositeLifeCycle as es,defaultTaskRunner as ts,TerminalBuffer as Tt,runConcurrently as it,createLogReporter as Er,generateRunSummary as ss,writeRunSummary as Rr,readLastRunSummary as Pr,getLastRunSummaryPath as Mr,pickChildParentEnv as Fr,writeChromeTrace as Or}from"@visulima/task-runner";import{i as Ke}from"../packem_shared/index-BjdW45xX.js";import{U as Ps,W as Ar,T as Lr,C as rs,X as Dr,Y as Br,q as _r,Z as Nr,ar as Gr,as as Hr,at as Wr,au as qr,j as Vr,av as Ur}from"./cli-main.js";import{x as K,F as n,X as w,o as l,O as me,R as Q,C as zr,d as Yr,b as Kr,a4 as Xr}from"./catalog.js";import{V as Fe}from"../packem_shared/vis-user-error-
|
|
1
|
+
import{createRequire as hr}from"node:module";import{e as le,m as Rs,$ as gr,a as wr,z as vr}from"../packem_shared/index-BzhrR_iC.js";import{expandAffected as yr,getChangedFiles as xr,buildEnhancedPath as jr,enforceProjectConstraints as kr,expandTokensInString as Zt,parsePartition as br,TaskScheduler as Sr,createTaskGraph as Tr,reverseTaskGraph as $r,splitCompoundTasks as Cr,resolveTurboEnvCompat as Ir,CompositeLifeCycle as es,defaultTaskRunner as ts,TerminalBuffer as Tt,runConcurrently as it,createLogReporter as Er,generateRunSummary as ss,writeRunSummary as Rr,readLastRunSummary as Pr,getLastRunSummaryPath as Mr,pickChildParentEnv as Fr,writeChromeTrace as Or}from"@visulima/task-runner";import{i as Ke}from"../packem_shared/index-BjdW45xX.js";import{U as Ps,W as Ar,T as Lr,C as rs,X as Dr,Y as Br,q as _r,Z as Nr,ar as Gr,as as Hr,at as Wr,au as qr,j as Vr,av as Ur}from"./cli-main.js";import{x as K,F as n,X as w,o as l,O as me,R as Q,C as zr,d as Yr,b as Kr,a4 as Xr}from"./catalog.js";import{V as Fe}from"../packem_shared/vis-user-error-CRmrBaD1.js";import{d as Jr,r as Qr}from"../packem_shared/lockfile-CiUtEbnt.js";import{y as Ms}from"../packem_shared/index-BisalDCf.js";import{F as cn}from"../packem_shared/failure-log-BP-gCUb5.js";import{r as an}from"../packem_shared/command-runtime-HSsYGCQd.js";import{r as ln}from"../packem_shared/toolchain-CP79HNVy.js";import{i as dn,r as un,s as fn,a as hn,b as pn,c as mn,d as gn,e as wn,H as vn,f as yn}from"../packem_shared/lifecycle-DvmDIRbb.js";import{s as xn}from"../packem_shared/affected-selection-DGb6Xu5K.js";import{c as is,p as jn,a as kn,b as bn,r as Sn,f as Tn,s as $n}from"../packem_shared/project-name-filter-B1ZCsbOW.js";import{p as Cn,r as In,f as En,a as Rn}from"../packem_shared/selectors-edwcgNl3.js";import{r as Ct,l as Pn,d as Fs,s as Mn,m as Fn,a as Os}from"../packem_shared/target-options-DsHFmRZH.js";import{T as As,C as Ls,D as ft,E as Ds}from"../packem_shared/symbols-BXDZ_sKt.js";import{q as Bn,j as _n,X as wt,F as cs}from"../packem_shared/index.server-Ca_EEVfw.js";import{parseStacktrace as Nn,codeFrame as Gn}from"@visulima/error";import{originalPositionFor as Hn,sourceContentFor as Wn,loadSourceMap as qn}from"@visulima/source-map";import{l as Bs}from"../packem_shared/spinner-BJjbNl1F.js";import{Q as Kn,c as ot}from"../packem_shared/formatBytes-_HvjOy8a-B_qQr4Hw.js";import{c as as,a as Xn,s as ls}from"../packem_shared/watch-CcTketln.js";import xt from"./index.js";import{U as _s}from"../packem_shared/writeFileSync-DJoHk3Ks-BPRoepNw.js";import{A as Qn,T as Zn,g as Je,b as ei,r as Qe,d as ti,e as si}from"../packem_shared/task-env-DzR4RkOj.js";let pr;const mr=s=>(pr??=hr(import.meta.url))(s),Ye=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Pe=s=>{if(typeof Ye<"u"&&Ye.versions&&Ye.versions.node){const[e,t]=Ye.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return Ye.getBuiltinModule(s)}return mr(s)},{existsSync:Oe,mkdirSync:Zr,writeFileSync:$t,readFileSync:Ne,openSync:en,statSync:ns,readSync:tn,closeSync:sn,mkdtempSync:rn}=Pe("node:fs"),{createInterface:nn,emitKeypressEvents:on}=Pe("node:readline"),{isAbsolute:On,resolve:os,dirname:An,relative:Ln}=Pe("node:path"),{fileURLToPath:Dn}=Pe("node:url"),{createHash:Vn}=Pe("node:crypto"),{mkdir:Un,appendFile:ht}=Pe("node:fs/promises"),{platform:zn,homedir:It,tmpdir:Yn}=Pe("node:os"),{spawn:Jn}=Pe("node:child_process"),ri=(s,e,t,r,c,o,i,d,u,p,f,m,a,k)=>{const S={d:r,h:c,m:o,mo:e,ms:d,s:i,w:t,y:s};return S.future=u,S.past=p,S.decimal=f,m!==void 0&&(S.unitMap=m),S.groupSeparator=a,S.placeholderSeparator=k,S},ni={d:"d",day:"d",days:"d",h:"h",hour:"h",hours:"h",hr:"h",hrs:"h",m:"m",millisecond:"ms",milliseconds:"ms",min:"m",mins:"m",minute:"m",minutes:"m",mo:"mo",month:"mo",months:"mo",ms:"ms",s:"s",sec:"s",second:"s",seconds:"s",secs:"s",w:"w",week:"w",weeks:"w",y:"y",year:"y",years:"y",yr:"y",yrs:"y"},ii=ri(s=>`year${s===1?"":"s"}`,s=>`month${s===1?"":"s"}`,s=>`week${s===1?"":"s"}`,s=>`day${s===1?"":"s"}`,s=>`hour${s===1?"":"s"}`,s=>`minute${s===1?"":"s"}`,s=>`second${s===1?"":"s"}`,s=>`millisecond${s===1?"":"s"}`,"in %s","%s ago",".",ni,",","_"),ds=new WeakSet,oi=s=>{if(ds.has(s))return;const e=["y","mo","w","d","h","m","s","ms"];for(const r of e)if(!Object.hasOwn(s,r))throw new TypeError(`Missing required property: ${r}`);if(s.future!==void 0&&typeof s.future!="string")throw new TypeError("Properties future and past must be of type string");if(s.past!==void 0&&typeof s.past!="string")throw new TypeError("Properties future and past must be of type string");const t=["y","mo","w","d","h","m","s","ms"];for(const r of t)if(typeof s[r]!="string"&&typeof s[r]!="function")throw new TypeError(`Property ${r} must be of type string or function`);if(s.decimal&&typeof s.decimal!="string")throw new TypeError("Property decimal must be of type string");if(s.delimiter&&typeof s.delimiter!="string")throw new TypeError("Property delimiter must be of type string");if(s._digitReplacements&&!Array.isArray(s._digitReplacements))throw new TypeError("Property _digitReplacements must be an array");if(s._numberFirst&&typeof s._numberFirst!="boolean")throw new TypeError("Property _numberFirst must be of type boolean");if(s.unitMap&&typeof s.unitMap!="object")throw new TypeError("Property unitMap must be an object");if(s.unitMap&&Object.values(s.unitMap).some(r=>typeof r!="string"))throw new TypeError("All values in unitMap must be of type string");ds.add(s)},Ns=(s,e)=>{if(!Number.isFinite(s)||e<0||Number.isInteger(s))return s;const t=10**e,r=Number((s*t).toPrecision(15));return Math.trunc(r)/t},us=({unitCount:s,unitName:e},t,r)=>{let{spacer:c}=r;const{maxDecimalPoints:o}=r;let i=".";r.decimal!==void 0?i=r.decimal:t.decimal!==void 0&&(i=t.decimal);let d;"digitReplacements"in r?d=r.digitReplacements:"_digitReplacements"in t&&(d=t._digitReplacements);let u,p=s;o!==void 0&&(p=Ns(s,o));const f=p.toString();if(!t._hideCountIf2||s!==2)if(d){u="";for(const k of f)u+=k==="."?i:d[k]}else u=f.replace(".",i);else u="";const m=t[e];let a=m;return typeof m=="function"&&(a=m(s)),t._hideCountIf2&&s===2&&(c=""),t._numberFirst?a+c+u:u+c+a},ci=(s,e)=>{const{units:t}=e;if(t.length===0)return[];const{unitMeasures:r}=e,c=e.largest??Number.POSITIVE_INFINITY,o={};let i,d,u,p=s;for(d=0;d<t.length;d++){i=t[d];const m=r[i];u=d===t.length-1?p/m:Math.floor(p/m),o[i]=u,p-=u*m}if(e.round){let m=c;for(d=0;d<t.length;d++)if(i=t[d],u=o[i],u!==0&&(m--,m===0)){for(let a=d+1;a<t.length;a++){const k=t[a],S=o[k];o[i]=(o[i]??0)+S*r[k]/r[i],o[k]=0}break}for(d=t.length-1;d>=0;d--){if(i=t[d],u=o[i],u===0)continue;const a=Math.round(u);if(o[i]=a,d===0)break;const k=t[d-1],S=r[k],M=Math.floor(a*r[i]/S);if(M)o[k]=(o[k]??0)+M,o[i]=0;else break}}const f=[];for(d=0;d<t.length&&f.length<c;d++){if(i=t[d],u=o[i],u&&!e.round&&f.length===c-1){let m,a=0;for(m=d+1,t.length;m<t.length;m++){const k=t[m];a+=o[k]*(e.unitMeasures[k]/e.unitMeasures[i])}u+=a,e.maxDecimalPoints!==void 0&&(u=Ns(u,e.maxDecimalPoints))}u&&f.push({unitCount:u,unitName:i})}return f},ai=(s,e,t)=>{const{language:r,units:c}=e;if(s.length===0){const m=c.at(-1);return us({unitCount:0,unitName:m},r,e)}const{conjunction:o,serialComma:i}=e;let d=", ";e.delimiter!==void 0?d=e.delimiter:r.delimiter!==void 0&&(d=r.delimiter);let u="";e.timeAdverb&&t!==0&&(u=r.future??"",t<0&&(u=r.past??""));const p=s.map(m=>us(m,r,e));let f;return!o||s.length===1?f=p.join(d):s.length===2?f=p.join(o):f=p.slice(0,-1).join(d)+(i?",":"")+o+(p.at(-1)??""),u&&(f=u.replace("%s",f)),f},li=(s,e)=>{if(Number.isNaN(s))throw new TypeError("Expected a valid number");if(typeof s!="number")throw new TypeError("Expected a number for milliseconds input");const t={conjunction:"",language:ii,round:!1,serialComma:!0,spacer:" ",timeAdverb:!1,unitMeasures:{d:864e5,h:36e5,m:6e4,mo:2629746e3,ms:1,s:1e3,w:6048e5,y:31556952e3},units:["w","d","h","m","s"],...e};oi(t.language);const r=Math.abs(s),c=ci(r,t);return ai(c,t,s)},xe="@voidzero-dev/vite-task-client",Et="@visulima/task-runner-client",ct=`npm:${Et}@^1`,Gs=le(".vis",".vite-client-override-declined"),at="pnpm-workspace.yaml",di=["dependencies","devDependencies","optionalDependencies","peerDependencies"],Hs=s=>{try{return JSON.parse(Ne(s,"utf8"))}catch{return}},ui=s=>{const e=le(s,at);if(Oe(e))try{return Ms(Ne(e,"utf8")).toJS()?.overrides}catch{return}},fi=s=>s==="pnpm"||s==="aube"?"pnpm.overrides":s==="yarn"?"resolutions":"overrides",hi=s=>{const e=le(s,at);try{const t=Ms(Ne(e,"utf8"));return t.setIn(["overrides",xe],ct),$t(e,t.toString()),!0}catch{return!1}},fs=s=>s!==void 0&&di.some(e=>s[e]?.[xe]!==void 0),pi=(s,e)=>s!==void 0&&(s.pnpm?.overrides?.[xe]!==void 0||s.overrides?.[xe]!==void 0||s.resolutions?.[xe]!==void 0)||e?.[xe]!==void 0,mi=(s,e=[])=>{const t=Hs(le(s,"package.json")),r=Oe(le(s,"node_modules","@voidzero-dev","vite-task-client"));return{alreadyOverridden:pi(t,ui(s)),declined:Oe(le(s,Gs)),manager:Jr(s)?.manager,present:fs(t)||r||e.some(c=>fs(c))}},gi=s=>{try{const e=le(s,Gs);Zr(Rs(e),{recursive:!0}),$t(e,`Declined adding the ${xe} → ${Et} override.
|
|
2
2
|
Delete this file to be asked again.
|
|
3
3
|
`)}catch{}},wi=(s,e="npm")=>{const t=`${e} install`;if((e==="pnpm"||e==="aube")&&Oe(le(s,at))&&hi(s))return{file:at,installCommand:t};const r=le(s,"package.json"),c=Hs(r);if(!c)return;const o=fi(e);o==="pnpm.overrides"?(c.pnpm??={},c.pnpm.overrides??={},c.pnpm.overrides[xe]=ct):(c[o]??={},c[o][xe]=ct);try{$t(r,`${JSON.stringify(c,void 0,4)}
|
|
4
4
|
`)}catch{return}return{file:"package.json",installCommand:t}},vi=async(s,e)=>{const t=mi(s,e.projectManifests);if(!t.present||t.alreadyOverridden||t.declined)return!1;const r=nn({input:process.stdin,output:process.stdout});try{e.logger.info(`Detected ${xe}. Its cache hints no-op under @visulima/task-runner unless aliased to ${Et} (a drop-in replacement).`);const c=await new Promise(i=>{r.question("Add the override now? [y/N] ",i)});if(!/^y(?:es)?$/i.test(c.trim()))return gi(s),e.logger.info("Skipped. Delete .vis/.vite-client-override-declined to be asked again."),!1;const o=wi(s,t.manager);return o===void 0?(e.logger.warn("Could not write the override automatically — add it manually (see @visulima/task-runner-client README)."),!1):(e.logger.info(`Added "${xe}": "${ct}" to ${o.file}. Run \`${o.installCommand}\` to apply it.`),!0)}finally{r.close()}},yi=new Set(["cache","command","dependsOn","fingerprintEnv","hashMode","inputs","outputs","parallelism","splitCompound","untrackedEnv"]),xi=s=>s?Object.keys(s).filter(e=>yi.has(e)).toSorted():[],ji=(s,e)=>`${s}: ${e.map(t=>`"${t}"`).join(", ")} ${e.length===1?"is a target property, not an option":"are target properties, not options"}, so ${e.length===1?"it is":"they are"} ignored under "options". Move ${e.length===1?"it":"them"} next to "command".`,ki=({interactive:s,taskPty:e,workspacePty:t})=>e===!0?!0:e===!1?!1:s&&t!==!1,bi=s=>s.split(",").map(e=>e.trim()).filter(e=>e!==""),Si=(s,e,t)=>{const r=new Set,c=[];if(s===void 0||s.trim()==="")return{skipTaskIds:r,unmatchedPatterns:c};const o=[...t],i=new Set(o),d=new Map;for(const u of o){const p=u.lastIndexOf(":");if(p===-1)continue;const f=u.slice(p+1),m=d.get(f);m===void 0?d.set(f,[u]):m.push(u)}for(const u of bi(s)){if(u.startsWith("~:"))throw new Error(`--skip-cache does not support the closest-project selector "~:" (received "${u}"). Use \`pkg:target\`, \`:target\`, or \`#tag:target\`.`);if(i.has(u)){r.add(u);continue}const p=Cn(u);if(!p){c.push(u);continue}let f=!1;switch(p.kind){case"all":{const m=d.get(p.target)??[];for(const a of m)r.add(a),f=!0;break}case"project":{const m=p.projects?.[0];if(m!==void 0){const a=`${m}:${p.target}`;i.has(a)&&(r.add(a),f=!0)}break}case"tag":{const{tag:m}=p;if(m!==void 0){const a=d.get(p.target)??[];for(const k of a){const S=k.slice(0,k.lastIndexOf(":"));e.projects[S]?.tags?.includes(m)===!0&&(r.add(k),f=!0)}}break}}f||c.push(u)}return{skipTaskIds:r,unmatchedPatterns:c}},Ti=/\$(?:\{([A-Z_]\w*)(:-[^}]*)?\}|([A-Z_]\w*))/gi,$i=new Set(["0","!","#","$","*","-","?","@","_"]),Ci=s=>{const e=new Map;for(const t of s.matchAll(Ti)){const r=t[1],c=t[3],o=t[2],i=r??c;if(i===void 0||$i.has(i))continue;const d=o!==void 0,u=e.get(i);u===void 0?e.set(i,d):u&&!d&&e.set(i,!1)}return[...e.entries()].map(([t,r])=>({hasDefault:r,name:t}))},Ii=s=>{const{command:e,processEnv:t,taskEnv:r,taskId:c}=s,o=Ci(e);if(o.length===0)return;const i=[];for(const{hasDefault:d,name:u}of o){if(d)continue;const p=r[u],f=t[u];p===void 0&&f===void 0&&i.push(u)}if(i.length!==0)return{missing:i.toSorted(),taskId:c}},Ei=s=>{const e=s.missing.map(t=>`$${t}`).join(", ");return`Strict env: ${s.taskId} references unset variable${s.missing.length===1?"":"s"} ${e}. Set ${s.missing.length===1?"it":"them"} in the task env, an envFile, or the parent shell — or opt out with options.strictEnv: false.`},Ri=64*1024,hs=256,Pi=new RegExp("[\x1B]\\[[0-?]*[ -/]*[@-~]","g"),vt=s=>s.replaceAll(Pi,"").replaceAll("\r","");class ps{#e=[];#r=new Set;#s=new Map;#n=new Map;constructor(e=[]){for(const t of e)this.#n.set(t,{id:t,status:"pending",tailLines:[]});this.#e=[...e],this.#i()}getSnapshot=()=>this.#s;subscribe=e=>(this.#r.add(e),()=>{this.#r.delete(e)});getIds(){return this.#e}getState(e){return this.#n.get(e)}getDockState(){let e=!1,t=!1;for(const r of this.#n.values())r.status==="crashed"||r.status==="failed"?e=!0:(r.status==="pending"||r.status==="starting")&&(t=!0);return e?"crash":t?"boot":"ready"}registerService(e){this.#n.has(e)||(this.#n.set(e,{id:e,status:"pending",tailLines:[]}),this.#e=[...this.#e,e],this.#o())}markStarting(e){this.#t(e,t=>({...t,errorMessage:void 0,startedAt:t.startedAt??Date.now(),status:"starting"}))}markStarted(e,t){this.#t(e,r=>({...r,startedAt:r.startedAt??Date.now(),status:r.status==="ready"?"ready":"starting"}))}markReady(e,t){this.#t(e,r=>({...r,errorMessage:void 0,port:t.port,readyAt:Date.now(),status:"ready"}))}markFailed(e,t,r){const c=r?.message;this.#t(e,o=>({...o,errorMessage:vt(c??t),status:"failed"}))}markCrashed(e,t){const r=t.slice(-hs).map(c=>vt(c));this.#t(e,c=>({...c,errorMessage:r.length>0?r[r.length-1]:"process exited",status:"crashed",tailLines:r}))}appendLog(e,t){const r=t.split(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as At}from"node:module";import{Y as It,w as Wt,e as kt,j,P as b,q as x,J as N,b as L}from"../packem_shared/index.server-Ca_EEVfw.js";import{u as ut,c as B,e as Mt}from"../packem_shared/vis-user-error-
|
|
1
|
+
import{createRequire as At}from"node:module";import{Y as It,w as Wt,e as kt,j,P as b,q as x,J as N,b as L}from"../packem_shared/index.server-Ca_EEVfw.js";import{u as ut,c as B,e as Mt}from"../packem_shared/vis-user-error-CRmrBaD1.js";import{N as R,a as _}from"../packem_shared/Table-Bo1JKNCN-CGGet8ES.js";import{t as Ct}from"../packem_shared/package-version-KLwH0Ivy.js";let Ot;const xt=t=>(Ot??=At(import.meta.url))(t),E=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Et=t=>{if(typeof E<"u"&&E.versions&&E.versions.node){const[e,n]=E.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return E.getBuiltinModule(t)}return xt(t)},{createRequire:Bt}=Et("node:module"),jt=/^#?([a-f\d]{3}|[a-f\d]{6})$/i,z=t=>{let[,e]=jt.exec(t)??[];const n=e?e.length:0;if(n===3){const s=e.charAt(0),o=e.charAt(1),i=e.charAt(2);e=s+s+o+o+i+i}else if(n!==6)return globalThis.process?.env?.NODE_ENV!=="production"&&console.warn(`[@visulima/colorize] Invalid hex color "${t}"; expected a 3- or 6-digit hex string (e.g. "#96C" or "#E0115F"). Falling back to black.`),[0,0,0];const r=Number.parseInt(e,16);return[r>>16&255,r>>8&255,r&255]},dt=(t,e,n)=>t===e&&e===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/51)+6*Math.round(e/51)+Math.round(n/51),H=t=>{let e,n,r;if(t<8)return 30+t;if(t<16)return 90+(t-8);if(t>=232)e=n=r=((t-232)*10+8)/255;else{t-=16;const i=t%36;e=Math.floor(t/36)/5,n=Math.floor(i/6)/5,r=i%6/5}const s=Math.max(e,n,r)*2;if(s===0)return 30;const o=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(e));return s===2?o+60:o},Z=(t,e,n)=>H(dt(t,e,n));function Rt({onlyFirst:t=!1}={}){const e="(?:\\u001B\\][^\\u0007\\u001B\\u009C]*(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(e,t?void 0:"g")}const S=(t,e,n)=>e>t?e:Math.min(t,n),m=39,f=49,X=10,tt={close:"",open:""},ht=t=>{const e=t>0?(l,d)=>({close:`\x1B[${String(d)}m`,open:`\x1B[${String(l)}m`}):()=>tt,n=l=>(d,p,g)=>l(dt(Number(d),Number(p),Number(g))),r=l=>d=>{const[p,g,w]=z(d);return l(p,g,w)};let s=l=>e(`38;5;${String(l)}`,m),o=l=>e(`48;5;${String(l)}`,f),i=(l,d,p)=>e(`38;2;${String(l)};${String(d)};${String(p)}`,m),a=(l,d,p)=>e(`48;2;${String(l)};${String(d)};${String(p)}`,f);t===1?(s=l=>e(H(Number(l)),m),o=l=>e(H(Number(l))+X,f),i=(l,d,p)=>e(Z(Number(l),Number(d),Number(p)),m),a=(l,d,p)=>e(Z(Number(l),Number(d),Number(p))+X,f)):t===2&&(i=n(s),a=n(o));const u={bold:e(1,22),dim:e(2,22),hidden:e(8,28),inverse:e(7,27),italic:e(3,23),overline:e(53,55),reset:e(0,0),strike:e(9,29),strikethrough:e(9,29),underline:e(4,24),underlineCurly:e("4:3",24),underlineDashed:e("4:5",24),underlineDotted:e("4:4",24),underlineDouble:e("4:2",24),visible:tt},c={bgBlack:e(40,f),bgBlackBright:e(100,f),bgBlue:e(44,f),bgBlueBright:e(104,f),bgCyan:e(46,f),bgCyanBright:e(106,f),bgGray:e(100,f),bgGreen:e(42,f),bgGreenBright:e(102,f),bgGrey:e(100,f),bgMagenta:e(45,f),bgMagentaBright:e(105,f),bgRed:e(41,f),bgRedBright:e(101,f),bgWhite:e(47,f),bgWhiteBright:e(107,f),bgYellow:e(43,f),bgYellowBright:e(103,f),black:e(30,m),blackBright:e(90,m),blue:e(34,m),blueBright:e(94,m),cyan:e(36,m),cyanBright:e(96,m),gray:e(90,m),green:e(32,m),greenBright:e(92,m),grey:e(90,m),magenta:e(35,m),magentaBright:e(95,m),red:e(31,m),redBright:e(91,m),white:e(37,m),whiteBright:e(97,m),yellow:e(33,m),yellowBright:e(93,m)},h={bg:l=>o(S(l,0,255)),bgHex:r(a),bgRgb:(l,d,p)=>a(S(l,0,255),S(d,0,255),S(p,0,255)),fg:l=>s(S(l,0,255)),hex:r(i),rgb:(l,d,p)=>i(S(l,0,255),S(d,0,255),S(p,0,255))};return{baseColors:c,baseStyles:u,styleMethods:h}},pt=It();Wt();ht(pt);const _t=(t,e,n)=>{if(e==="")return t;let r=t.indexOf(e);if(r<0)return t;const s=e.length;let o=0,i="";for(;~r;)i+=t.slice(o,r)+n,o=r+s,r=t.indexOf(e,o);return i+t.slice(o)},Pt=(t,e,n)=>{if(t==null||t==="")return"";let r;if(t.raw===void 0?r=String(t):r=String.raw(t,...e),r.includes("\x1B"))for(let s=n;s;s=s.props)r=_t(r,s.close,s.open);return r.includes(`
|
|
2
2
|
`)&&(r=r.replace(/(\r*\n)/g,`${n.closeStack}$1${n.openStack}`)),n.openStack+r+n.closeStack},Tt=function(t){const e=t?.level??pt,{baseColors:n,baseStyles:r,styleMethods:s}=ht(e),o={};let i=null;const a=({props:c},{close:h,open:l})=>{const d=(c?.openStack??"")+l,p=h+(c?.closeStack??""),g=(w,...y)=>Pt(w,y,g.props);return Object.setPrototypeOf(g,i),g.props={close:h,closeStack:p,open:l,openStack:d,props:c},g.open=d,g.close=p,g},u=c=>String(c);u.strip=c=>c.replaceAll(Rt(),"");for(const c in n)o[c]={get(){const h=a(this,n[c]);return Object.defineProperty(this,c,{value:h}),h}};for(const c in r)o[c]={get(){const h=a(this,r[c]);return Object.defineProperty(this,c,{value:h}),h}};for(const c in s)o[c]={get(){return(...h)=>a(this,s[c](...h))}};return o.ansi256=o.fg,o.bgAnsi256=o.bg,i=Object.defineProperties({},o),Object.setPrototypeOf(u,i),u},Lt=t=>(e,...n)=>{if(!Array.isArray(e)||!Array.isArray(e.raw))throw new TypeError("A tagged template literal must be provided");const r=[e.raw[0]];for(let s=1;s<e.raw.length;s+=1)r.push(String(n[s-1]).replaceAll(/[{}\\]/g,String.raw`\$&`),String(e.raw[s]));return t(r.join(""))},Ft=new Map([["0","\0"],["\\","\\"],["a","\x07"],["b","\b"],["e","\x1B"],["f","\f"],["n",`
|
|
3
3
|
`],["r","\r"],["t"," "],["v","\v"]]),mt=t=>{const e=t.startsWith("u"),n=t[1]==="{";return e&&!n&&t.length===5||t.startsWith("x")&&t.length===3?String.fromCodePoint(Number.parseInt(t.slice(1),16)):e&&n?String.fromCodePoint(Number.parseInt(t.slice(2,-1),16)):Ft.get(t)??t},Dt=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|\{(~)?(#?[\w:]+(?:\([^)]*\))?(?:\.#?[\w:]+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n))|(\})|((?:.|[\r\n\f])+?)/gi,et=/(?:^|\.)(?:(\w+)(?:\(([^)]*)\))?|#(?=[:a-f\d]{2,})([a-f\d]{6})?(?::([a-f\d]{6}))?)/gi,Vt=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,qt=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,Ut=/\s*,\s*/,Gt=(t,e)=>{const n=[],r=e.trim().split(Ut);let s;for(const o of r){const i=Number(o);if(!Number.isNaN(i))n.push(i);else if(s=Vt.exec(o))n.push(s[2].replaceAll(qt,(a,u,c)=>u?mt(u):c));else throw new Error(`Invalid template style argument: ${o} (in style '${t}')`)}return n},zt=t=>{et.lastIndex=0;const e=[];let n;for(;(n=et.exec(t))!==null;){const r=n[1];n[2]?e.push([r,...Gt(r,n[2])]):n[3]||n[4]?(n[3]&&e.push(["rgb",...z(n[3])]),n[4]&&e.push(["bgRgb",...z(n[4])])):e.push([r])}return e},nt=(t,e)=>{const n={};for(const s of e)for(const o of s.styles)n[o[0]]=s.inverse?void 0:o.slice(1);let r=t;for(const[s,o]of Object.entries(n))if(Array.isArray(o)){if(!(s in r))throw new Error(`Unknown style: ${s}`);r=o.length>0?r[s](...o):r[s]}return r},Ht=t=>e=>{const n=[],r=[];let s=[];if(e.replaceAll(Dt,(o,i,a,u,c,h)=>{if(i)s.push(mt(i));else if(u){const l=s.join("");s=[],r.push(n.length===0?l:nt(t,n)(l)),n.push({inverse:a,styles:zt(u)})}else if(c){if(n.length===0)throw new Error("Found extraneous } in template literal");r.push(nt(t,n)(s.join(""))),s=[],n.pop()}else s.push(h)}),r.push(s.join("")),n.length>0)throw new Error(`template literal is missing ${String(n.length)} closing bracket${n.length===1?"":"s"} (\`}\`)`);return r.join("")},Yt=new Tt,Jt=Ht(Yt),Kt=Lt(Jt);let Qt;const Zt=t=>(Qt??=Bt(import.meta.url))(t),O=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:A,F=t=>{if(typeof O<"u"&&O.versions&&O.versions.node){const[e,n]=O.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return O.getBuiltinModule(t)}return Zt(t)},A=O,{execFileSync:Xt}=F("node:child_process"),W=F("node:fs"),te=F("node:tty"),ee=F("node:os"),ne=[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],re=12288,oe=65510,ie=[12288,12288,65281,65376,65504,65510],se=8361,ae=65518,le=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],ce=32,ue=10630,de=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],he=4352,pe=262141,ft=[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],k=(t,e)=>{let n=0,r=Math.floor(t.length/2)-1;for(;n<=r;){const s=Math.floor((n+r)/2),o=s*2;if(e<t[o])r=s-1;else if(e>t[o+1])n=s+1;else return!0}return!1},rt=19968,[me,fe]=ge(ft);function ge(t){let e=t[0],n=t[1];for(let r=0;r<t.length;r+=2){const s=t[r],o=t[r+1];if(rt>=s&&rt<=o)return[s,o];o-s>n-e&&(e=s,n=o)}return[e,n]}const we=t=>t<161||t>1114109?!1:k(ne,t),be=t=>t<re||t>oe?!1:k(ie,t),ye=t=>t<se||t>ae?!1:k(le,t),$e=t=>t<ce||t>ue?!1:k(de,t),Ne=t=>t>=me&&t<=fe?!0:t<he||t>pe?!1:k(ft,t);function ve(t){return we(t)?"ambiguous":be(t)?"fullwidth":ye(t)?"halfwidth":$e(t)?"narrow":Ne(t)?"wide":"neutral"}function Se(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function gt(t){return Se(t),ve(t)}const ot=new Map,Ae=t=>[t.ambiguousIsNarrow?1:0,t.control,t.fullWidth,t.regular,t.wide].join("|"),Oe=t=>{const e=Ae(t.width);let n=ot.get(e);return n||(n=new Map,ot.set(e,n)),n},M=new RegExp(ut.source,"y"),U=new RegExp(Mt.source,"uy"),C=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,wt=t=>t>=32&&t<=126?"latin":t===8203||t===8204||t===8205||t===8288?"zero":t<=31||t>=127&&t<=159?"control":t>=160&&t<=255||t>=9472&&t<=9599?"latin":t>=4352&&t<=4607||t>=11904&&t<=40959||t>=44032&&t<=55215||t>=63744&&t<=64255||t>=65280&&t<=65519&&!(t>=65377&&t<=65439)||t>=12352&&t<=12543?"wide":t===8230?"latin":"other",xe=(t,e)=>{const n=Oe(e),r=Math.floor(t/65536),s=t%65536;let o=n.get(r);if(o||(o=new Map,n.set(r,o)),o.has(s))return o.get(s);let i;switch(wt(t)){case"control":{i=e.width.control;break}case"latin":{i=e.width.regular;break}case"wide":{i=e.width.wide;break}case"zero":{i=0;break}default:switch(gt(t)){case"ambiguous":{i=e.width.ambiguousIsNarrow?e.width.regular:e.width.wide;break}case"fullwidth":{i=e.width.fullWidth;break}case"wide":{i=e.width.wide;break}default:i=e.width.regular}}return o.set(s,i),i},Ee=t=>t>=768&&t<=879||t>=6832&&t<=6911||t>=7616&&t<=7679||t>=8400&&t<=8447||t>=65056&&t<=65071||t>=917760&&t<=917999||t>=65024&&t<=65039||t>=3633&&t<=3642||t>=3655&&t<=3662||t>=3761&&t<=3769||t>=3771&&t<=3772||t>=3784&&t<=3789||t>=2304&&t<=2307||t>=2362&&t<=2383||t>=2385&&t<=2391||t>=2402&&t<=2403||t>=2433&&t<=2435||t>=2492&&t<=2500||t>=2509&&t<=2509||t>=2561&&t<=2563||t>=2620&&t<=2637||t>=1611&&t<=1631||t>=1648&&t<=1648||t>=1750&&t<=1773||t>=2276&&t<=2302||t>=1425&&t<=1469||t>=1471&&t<=1471||t>=1473&&t<=1474||t>=1476&&t<=1477||t>=1479&&t<=1479||t>=3893&&t<=3893||t>=3895&&t<=3895||t>=3897&&t<=3897||t>=3953&&t<=3966||t>=3968&&t<=3972||t>=3974&&t<=3975?!0:t>=768&&t<=777||t>=803&&t<=803,Y=(t,e={})=>{if(!t||t.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const n={truncation:{countAnsiEscapeCodes:e.countAnsiEscapeCodes??!1,ellipsis:e.ellipsis??"",ellipsisWidth:e.ellipsisWidth??(e.ellipsis?Y(e.ellipsis,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:e.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:e.ambiguousIsNarrow??!1,ansi:e.ansiWidth??0,control:e.controlWidth??0,emoji:e.emojiWidth??2,fullWidth:e.fullWidth??2,halfWidth:e.halfWidth??1,regular:e.regularWidth??1,tab:e.tabWidth??8,wide:e.wideWidth??2}},r=Math.max(0,n.truncation.limit-n.truncation.ellipsisWidth),{length:s}=t,o=s>1e4;let i=0,a=0,u=s,c=!1;const h=t.includes("\x1B")||t.includes("");for(;i<s;){if(h&&(t[i]==="\x1B"||t[i]==="")){if(t.startsWith("\x1B]8;;",i)){const y="\x1B]8;;\x07",v=y.length,D=t.indexOf("\x07",i+5);if(D!==-1){const V=t.indexOf(y,D+1);if(V!==-1){const vt=V+v,St=t.slice(D+1,V).replace(ut,""),Q=Y(St,{ambiguousIsNarrow:n.width.ambiguousIsNarrow,ansiWidth:n.width.ansi,controlWidth:n.width.control,countAnsiEscapeCodes:!1,ellipsis:n.truncation.ellipsis,ellipsisWidth:n.truncation.ellipsisWidth,emojiWidth:n.width.emoji,fullWidth:n.width.fullWidth,halfWidth:n.width.halfWidth,limit:Math.max(0,r-a),regularWidth:n.width.regular,tabWidth:n.width.tab,wideWidth:n.width.wide}),q=Q.width;if(Q.truncated)c=!0,u=Math.min(u,i);else if(a+q>r&&(u=Math.min(u,i),c=!0,a+q>n.truncation.limit))break;if(a+=q,i=vt,c&&a>=n.truncation.limit)break;continue}}}if(M.lastIndex=i,M.test(t)){const y=M.lastIndex-i,v=n.truncation.countAnsiEscapeCodes?y:n.width.ansi;if(a+v>r&&(u=Math.min(u,i),a+v>n.truncation.limit)){c=!0;break}a+=v,i=M.lastIndex;continue}}const p=t.codePointAt(i);if(p===8203||p===65279||p>=8288&&p<=8292){i+=1;continue}if(p===9){if(a+n.width.tab>r&&(u=Math.min(u,i),a+n.width.tab>n.truncation.limit)){c=!0;break}a+=n.width.tab,i+=1;continue}if(C.lastIndex=i,C.test(t)){const y=(C.lastIndex-i)*n.width.regular;if(a+y>r){const v=n.width.regular>0?Math.floor((r-a)/n.width.regular):0;if(u=Math.min(u,i+v),a+y>n.truncation.limit){c=!0;break}}a+=y,i=C.lastIndex;continue}if((p<=31||p>=127&&p<=159)&&(B.lastIndex=i,B.test(t))){const y=(B.lastIndex-i)*n.width.control;if(a+y>r){const v=n.width.control>0?Math.floor((r-a)/n.width.control):0;if(u=Math.min(u,i+v),a+y>n.truncation.limit){c=!0;break}}a+=y,i=B.lastIndex;continue}if(U.lastIndex=i,U.test(t)){if(a+n.width.emoji>r&&(u=Math.min(u,i),a+n.width.emoji>n.truncation.limit)){c=!0;break}a+=n.width.emoji,i=U.lastIndex;continue}const g=t.codePointAt(i)??0;if(Ee(g)){i+=g>65535?2:1;continue}let w;if(o)w=xe(g,n);else switch(wt(g)){case"control":{w=n.width.control;break}case"latin":{w=n.width.regular;break}case"wide":{w=n.width.wide;break}case"zero":{w=0;break}default:switch(gt(g)){case"ambiguous":{w=n.width.ambiguousIsNarrow?n.width.regular:n.width.wide;break}case"fullwidth":{w=n.width.fullWidth;break}case"wide":{w=n.width.wide;break}default:w=n.width.regular}}if(a+w>r&&(u=Math.min(u,i),a+w>n.truncation.limit)){c=!0;break}a+=w,i+=g>65535?2:1}let l=a,d=!1;return c&&n.truncation.limit>=n.truncation.ellipsisWidth&&(l=n.truncation.limit,d=!0),{ellipsed:d,index:c?u:s,truncated:c,width:l}},Ie=(t,e={})=>Y(t,{...e,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,bt=80,yt=24,J=(t,e,{shell:n,env:r}={})=>Xt(t,e,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:n,env:r}).trim(),P=(t,e)=>({columns:Number.parseInt(t,10),rows:Number.parseInt(e,10)}),$t=(t,e)=>{const{columns:n,rows:r}=P(t,e);if(!(Number.isNaN(n)||Number.isNaN(r))&&!(n===bt&&r===yt))return{columns:n,rows:r}},We=()=>{if(A.platform!=="linux")return!0;try{const t=W.readFileSync("/proc/self/stat","utf8"),e=t.lastIndexOf(") ");if(e===-1)return!1;const n=t.slice(e+2).trim().split(/\s+/),r=Number.parseInt(n[2],10),s=Number.parseInt(n[5],10);return Number.isNaN(r)||Number.isNaN(s)||s<=0?!1:r===s}catch{return!1}};function ke(){const{env:t,stdout:e,stderr:n}=A;if(e?.columns&&e?.rows)return P(e.columns,e.rows);if(n?.columns&&n?.rows)return P(n.columns,n.rows);if(t.COLUMNS&&t.LINES)return P(t.COLUMNS,t.LINES);const r={columns:bt,rows:yt};return A.platform==="win32"?G()??r:A.platform==="darwin"?it()??G()??r:it()??G()??Be()??r}const it=()=>{try{const t=A.platform==="darwin"?W.constants.O_EVTONLY|W.constants.O_NONBLOCK:W.constants.O_NONBLOCK,{columns:e,rows:n}=te.WriteStream(W.openSync("/dev/tty",t));return{columns:e,rows:n}}catch{}},G=()=>{try{const t=J("tput",["cols"],{env:{TERM:"dumb",...A.env}}),e=J("tput",["lines"],{env:{TERM:"dumb",...A.env}});if(t&&e)return $t(t,e)}catch{}},Be=()=>{try{if(!We())return;const t=J("resize",["-u"]).match(/\d+/g);if(t.length===2)return $t(t[0],t[1])}catch{}},I=new Map,Me=500,$=t=>{if(!t||t==="")return"";const e=I.get(t);if(e!==void 0)return e;let n;try{n=Kt(Object.assign([],{raw:[t]}))}catch{n=t}if(I.size>=Me){const r=I.keys().next().value;r!==void 0&&I.delete(r)}return I.set(t,n),n},T=()=>{const t=Ct().CEREBRO_TERMINAL_WIDTH;if(t===void 0)return;const e=Number.parseInt(t,10);if(!(Number.isNaN(e)||e<=0))return e};class Nt{lines;constructor(){this.lines=[]}add(e){this.lines.push(e)}toString(){return this.lines.join(ee.EOL)}header(e){this.add(j(e)),this.lines.push("")}}const Ce=t=>t!==void 0&&t>0?t:ke().columns,je=(t,e,n,r)=>{if(t.length===0||t.some(c=>c.length!==2))return;let s=0;for(const c of t){const h=c[0];if(h===void 0)continue;const l=Ie(h);l>s&&(s=l)}if(s===0)return;const o=n+r,i=s+o,a=20+o;if(i+a>e)return;const u=e-i;return[i,u]};class Re extends Nt{constructor(e){if(super(),e.header&&this.header($(e.header)),e.content){if(e.raw)if(Array.isArray(e.content)&&e.content.every(n=>typeof n=="string"))e.content.forEach(n=>{Array.isArray(n)?n.forEach(r=>{this.add($(r))}):this.add($(n))});else if(typeof e.content=="string")this.add($(e.content));else throw new TypeError("Invalid raw content, must be a string or array of strings.");else this.add(this.getContentLines(e.content));this.add("")}}getContentLines(e){if(typeof e=="string"){const n=R({showHeader:!1,style:{border:_,paddingLeft:4,paddingRight:1},terminalWidth:T(),truncateOverflow:!1,wordWrap:!0});return n.addRow([$(e)]),n.toString()}if(Array.isArray(e)&&e.every(n=>typeof n=="string"||Array.isArray(n)&&n.every(r=>typeof r=="string"))){const n=Ce(T()),r=a=>Array.isArray(a)?a.map(u=>$(u)):[$(a)],s=e.map(a=>r(a)),o=je(s,n,4,1),i=R({columnWidths:o,showHeader:!1,style:{border:_,paddingLeft:4,paddingRight:1},terminalWidth:n,truncateOverflow:!1,wordWrap:!0});return s.forEach(a=>{o!==void 0&&a.length===2?i.addRow([{content:a[0],wordWrap:!1},a[1]]):i.addRow(a)}),i.toString()}if(typeof e=="object"){const n=e;if(!n.options||!n.data)throw new Error(`Must have an "options" or "data" property
|
|
4
4
|
${JSON.stringify(e)}`);const r=R({showHeader:!1,style:{border:_,paddingLeft:4,paddingRight:1},terminalWidth:T(),truncateOverflow:!1,wordWrap:!0});return n.data.forEach(s=>{Array.isArray(s)?r.addRow(s.map(o=>$(o))):r.addRow([$(s)])}),r.toString()}throw new Error(`invalid input - 'content' must be a string, array of strings or a object:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p}from"./cli-main.js";import{d as b}from"../packem_shared/pm-runner-RM72mDZg.js";import{r as m,l as w,L as v}from"../packem_shared/dependency-scan-
|
|
1
|
+
import{p}from"./cli-main.js";import{d as b}from"../packem_shared/pm-runner-RM72mDZg.js";import{r as m,l as w,L as v}from"../packem_shared/dependency-scan-CawAKoU_.js";import{z as S,e as g}from"../packem_shared/index-BzhrR_iC.js";import{S as $}from"../packem_shared/lockfile-DhHAaHN5.js";import{e as x}from"../packem_shared/index-CDHP1kby.js";import{y as C}from"../packem_shared/isAccessibleSync-DYKTrrvc-C-_5cgwu.js";const E=e=>{const o=e.trim();return o===""?!1:/^(?:git\+|git:\/\/|git@|ssh:\/\/)/i.test(o)||/^(?:github|gitlab|bitbucket|gist):/i.test(o)||/^[\w.-]+\/[\w.-]+(?:#.+)?$/.test(o)&&!o.includes("@")?!0:/^https?:\/\//i.test(o)},M=(e,o)=>{for(const i of o)if(i===e||i.endsWith("*")&&e.startsWith(i.slice(0,-1)))return!0;return!1},L=(e,o,i={})=>{const t=m(e,o);if(!t)return[];let s;try{s=S(g(e,t.file))}catch{return[]}const n=$(s,t.type);if(n.length===0)return[];const r=i.allow??[],l=[],f=new Set;for(const c of n){const a=`${c.name}@${c.version}`;for(const d of[c.dependencies,c.optionalDependencies])if(d){for(const[u,h]of Object.entries(d))if(!M(u,r))for(const k of h){if(!E(k))continue;const y=`${a}->${u}@${k}`;f.has(y)||(f.add(y),l.push({declaredBy:a,packageName:u,source:k}))}}}return l.sort((c,a)=>c.packageName.localeCompare(a.packageName)||c.declaredBy.localeCompare(a.declaredBy))},D=new Set(["firstSeen","publisherChange"]),I=e=>e.severity==="block"&&e.acceptedRisk===void 0,N=e=>{const o=e.security?.policies?.firstSeen?.minutes,i=typeof o=="number"&&o>0,t=e.security?.policies?.publisherChange?.mode==="no-downgrade",s=e.security?.blockExoticSubdeps===!0;return i||t||s},O=async e=>{const{offline:o=!1,packageManager:i,visConfig:t,workspaceRoot:s}=e,n=Date.now();if(!N(t))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!1,status:"skipped"};const r=m(s,i);if(!r||!C(g(s,r.file)))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!0,status:"fail"};const l=w(s,i,{includeDev:!0}),f=l.length,c=await x({offline:o,packageManager:i,packages:l,workspaceRoot:s},"install",{enabledPolicies:new Set(D),visConfig:t}),a=t.security?.blockExoticSubdeps===!0?L(s,i,{allow:t.security.exoticSubdepsAllow}):[],d=c.some(u=>I(u))||a.length>0;return{decisions:c,durationMs:Date.now()-n,entryCount:f,exoticViolations:a,lockfileMissing:!1,status:d?"fail":"pass"}},P=e=>e<1e3?`${String(e)}ms`:`${(e/1e3).toFixed(1)}s`,V=e=>{if(e.status==="skipped")return["– Lockfile supply-chain verification skipped (no firstSeen / publisherChange / blockExoticSubdeps policy configured)"];if(e.lockfileMissing)return["✗ Lockfile supply-chain verification failed — no lockfile found, the resolved closure cannot be attested"];const o=`(${String(e.entryCount)} ${e.entryCount===1?"entry":"entries"}, ${P(e.durationMs)})`;if(e.status==="pass")return[`✓ Lockfile passes supply-chain policies ${o}`];const i=[`✗ Lockfile failed supply-chain policy check ${o}`];for(const t of e.decisions)t.severity==="block"&&t.acceptedRisk===void 0&&i.push(` [${t.policy}] ${t.reason}`);for(const t of e.exoticViolations)i.push(` [blockExoticSubdeps] ${t.packageName} pulled from exotic source by ${t.declaredBy}: ${t.source}`);return i},z=async({options:e,visConfig:o,workspaceRoot:i})=>{const t=i??process.cwd(),s=b(t);if(!v[s.name]){p.warn(`Package manager '${s.name}' has no lockfile vis can verify.`);return}const n=await O({offline:!!e.offline,packageManager:s.name,visConfig:o??{},workspaceRoot:t});if(e.json){process.stdout.write(`${JSON.stringify(n,void 0,2)}
|
|
2
2
|
`),n.status==="fail"&&(process.exitCode=1);return}const[r,...l]=V(n);if(n.status==="skipped"){p.info(r);return}if(n.status==="pass"){p.success(r);return}p.error(r);for(const f of l)p.error(f);process.exitCode=1};export{z as default};
|
package/dist/packem_shared/{affected-selection-CrW7fWEd.js → affected-selection-DGb6Xu5K.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as T}from"node:module";import{getAffectedProjects as W}from"@visulima/task-runner";import{i as A}from"./index-BjdW45xX.js";import{V as k}from"./vis-user-error-
|
|
1
|
+
import{createRequire as T}from"node:module";import{getAffectedProjects as W}from"@visulima/task-runner";import{i as A}from"./index-BjdW45xX.js";import{V as k}from"./vis-user-error-CRmrBaD1.js";import{r as B}from"./affected-shas-B_kfSKss.js";let I;const R=e=>(I??=T(import.meta.url))(e),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,F=e=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[t,s]=f.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return f.getBuiltinModule(e)}return R(e)},{spawnSync:S}=F("node:child_process"),b=new Set(["deep","direct","none"]),O=e=>{const t=[],s=e.split("\0");for(let n=0;n<s.length;n++){const o=s[n];if(!o||o.length<4)continue;const c=o.slice(0,2),p=o.slice(3);if(p&&t.push(p),c.includes("R")||c.includes("C")){n+=1;const l=s[n];l&&t.push(l)}}return t},P=e=>{const t=S("git",["status","--porcelain","-z"],{cwd:e,encoding:"utf8"});return t.error||t.status!==0||typeof t.stdout!="string"?[]:O(t.stdout)},D=async(e,t,s={})=>{const n=e.downstream??"deep",o=e.upstream??"none";if(!b.has(n))throw new k(`Invalid --downstream value: "${n}". Must be "none", "direct", or "deep".`);if(!b.has(o))throw new k(`Invalid --upstream value: "${o}". Must be "none", "direct", or "deep".`);const{fileOwners:c,projectGraph:p,projects:l,workspaceRoot:h}=t,a=[];let{base:g}=e,{head:i}=e;if(!g||!i){const u=B({defaultBase:s.defaultBase,workspaceRoot:h});g=g||u.base,i=i||u.head,a.push(`Resolved affected refs from ${u.provider} (${u.notes.join("; ")})`)}const y=s.runningInCi??A,w=i==="HEAD"||i==="",$=e.uncommitted??(!y&&w);let d=[];if($)if(w){const j=(s.readWorkingTreeChanges??P)(h),C=Object.values(l).map(r=>r.root?.replace(/\/$/,"")).filter(r=>!!r&&r!==".");d=j.filter(r=>c!==void 0&&Object.hasOwn(c,r)||C.some(v=>r===v||r.startsWith(`${v}/`)));const _=j.length-d.length;d.length>0&&a.push(`including ${d.length} uncommitted working-tree file(s)`),_>0&&a.push(`ignoring ${_} uncommitted path(s) outside any project (untracked scratch would otherwise mark every project affected)`)}else a.push(`ignoring --uncommitted: --head=${i} pins the comparison to a commit, not the working tree`);const m=await W({additionalChangedFiles:d,base:g,downstream:n,fileOwners:c,head:i,ignoredFiles:s.affectedIgnore,projectGraph:p,projects:l,upstream:o,workspaceRoot:h});return m.ignoredFiles.length>0&&a.push(`ignoring ${m.ignoredFiles.length} changed path(s) outside any project matching affectedIgnore`),{...m,notes:a,uncommittedFileCount:d.length}};export{D as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as v}from"node:module";import{t as T}from"./compile-cache-DoMHRsRZ.js";import{a as w,c as R,i as $,t as M,u as m,g as S}from"./package-version-
|
|
1
|
+
import{createRequire as v}from"node:module";import{t as T}from"./compile-cache-DoMHRsRZ.js";import{a as w,c as R,i as $,t as M,u as m,g as S}from"./package-version-KLwH0Ivy.js";import{i as j}from"./index-BjdW45xX.js";let _;const x=s=>(_??=v(import.meta.url))(s),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=s=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[e,o]=t.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return t.getBuiltinModule(s)}return x(s)},{createRequire:y}=b("node:module");let N;const O=s=>(N??=y(import.meta.url))(s),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=s=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[e,o]=r.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return r.getBuiltinModule(s)}return O(s)},{execFileSync:C}=f("node:child_process"),{totalmem:I}=f("node:os"),q=/--max-old-space-size=(\d+)/,z=/--max-semi-space-size=(\d+)/,E=s=>Math.floor(I()/1024/1024*s),P=s=>s<=512?4:s<=1024?8:s<=2048?16:s<=4096?32:s<=8192?64:Math.floor(Math.log2(s))*8,d=(s,e)=>{for(const o of e){const n=s.exec(o);if(n)return Number.parseInt(n[1],10)}},B=s=>{const o=[...w()],n=[...R()],a=d(q,o),p=d(z,o);if(a!==void 0&&p!==void 0)return;const l=a??E(.75),g=p??P(l),c=[];if(a===void 0&&c.push(`--max-old-space-size=${String(l)}`),p===void 0&&c.push(`--max-semi-space-size=${String(g)}`),c.length!==0)try{C($(),[...c,...o,...n.slice(1)],{env:M(),stdio:"inherit"}),m(0)}catch(h){const u=h.status;m(typeof u=="number"?u:1)}},V=()=>{process.env.VIS_VERSION=S()},H=s=>{!process.stdout.isTTY||j||process.env.TERM==="dumb"||process.stdout.write(`\x1B]0;${s}\x07`)},A=new Set(["","--help","--version","-h","-v","completion","dlx","exec","x"]),i=process.argv[2]??"";!A.has(i)&&!process.argv.includes("--help")&&!process.argv.includes("-h")&&B();process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");V();T();(async()=>{if(i==="__pm-shim"){const{dispatchShim:e}=await import("../packem_chunks/dispatch.js");e(process.argv[3]??"",process.argv.slice(4));return}if(i==="x"){const{runLeanX:e}=await import("../packem_chunks/lean.js");await e(process.argv.slice(3));return}if(i==="exec"||i==="dlx"){const{runExecCli:e}=await import("../packem_chunks/cli-exec.js");await e();return}const{runCli:s}=await import("../packem_chunks/cli-main.js").then(e=>e.ax);await s()})();export{H as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as l,z as d}from"./index-BzhrR_iC.js";import{S as m}from"./lockfile-DhHAaHN5.js";import{k as g,l as D}from"../packem_chunks/catalog.js";import{y as S}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";const k={vite:"Separate vite copies each load their own plugin and config state. Pin one version with a package manager override.",vitest:"Separate vitest copies each keep their own expect, mocks and runner state. Pin one version with a package manager override."},P={bun:{file:"bun.lock",type:"bun"},npm:{aliases:["npm-shrinkwrap.json"],file:"package-lock.json",type:"npm"},pnpm:{file:"pnpm-lock.yaml",type:"pnpm"},yarn:{file:"yarn.lock",type:"yarn"}},b=t=>{const o=P[t];return o?[...o.aliases??[],o.file].map(n=>({file:n,type:o.type})):[]},h=(t,o)=>{const n=b(o);if(n.length!==0)return n.find(r=>S(l(t,r.file)))??n[n.length-1]},v=t=>{try{return JSON.parse(d(t))}catch{return}},y=t=>{const o=[],n=v(l(t,"package.json"));n&&o.push(n);const r=g(t);let c;if(r?c=r:n?.workspaces&&(Array.isArray(n.workspaces)?c=n.workspaces:n.workspaces.packages&&(c=n.workspaces.packages)),!c)return o;const i=D(t,c);for(const s of i){const e=v(l(t,s,"package.json"));e&&o.push(e)}return o},w=(t,o)=>{const n=new Set,r=[],c=new Map;for(const s of o){const e=c.get(s.name);e?e.push(s):c.set(s.name,[s])}const i=s=>{if(s)for(const e of Object.keys(s))n.has(e)||(n.add(e),r.push(e))};for(const s of y(t))i(s.dependencies),i(s.peerDependencies),i(s.optionalDependencies);for(;r.length>0;){const s=r.shift(),e=c.get(s);if(e){for(const a of e)for(const f of[a.dependencies,a.peerDependencies,a.optionalDependencies])if(f)for(const p of Object.keys(f))n.has(p)||(n.add(p),r.push(p))}}return n},L=(t,o,n={})=>{const r=h(t,o);if(!r)return[];let c;try{c=d(l(t,r.file))}catch{return[]}const i=m(c,r.type);if(i.length===0)return[];const e=n.includeDev??!0?void 0:w(t,i),a=new Set,f=[];for(const p of i){if(e&&!e.has(p.name))continue;const u=`${p.name}@${p.version}`;a.has(u)||(a.add(u),f.push({isDev:!1,name:p.name,version:p.version}))}return f},O=(t,o)=>{const n=h(t,o);if(!n)return[];let r;try{r=d(l(t,n.file))}catch{return[]}const c=m(r,n.type);if(c.length===0)return[];const i=new Map;for(const e of c)i.has(e.name)||i.set(e.name,new Set),i.get(e.name).add(e.version);const s=[];for(const[e,a]of i){if(a.size<=1)continue;const f={name:e,versions:[...a]};k[e]&&(f.hint=k[e]),s.push(f)}return s.sort((e,a)=>e.name.localeCompare(a.name))},M=(t,o)=>{const n=h(t,o);if(!n)return;let r;try{r=d(l(t,n.file))}catch{return}const c=m(r,n.type);if(c.length===0)return;const i=[],s=new Set;for(const e of y(t))for(const a of[e.dependencies,e.devDependencies,e.peerDependencies,e.optionalDependencies])if(a)for(const[f,p]of Object.entries(a)){const u=`${f}@${p}`;s.has(u)||(s.add(u),i.push({name:f,version:p}))}return{entries:c,roots:i}};export{P as L,M as a,O as f,L as l,h as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as c}from"./index-BzhrR_iC.js";import{y as a}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as i}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";const g=(n,e)=>{for(const o of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){const t=n[o];if(t&&typeof t[e]=="string")return t[e]}},k=(n,e)=>{for(const o of e){const t=c(n,o);if(a(t))return t}},d=n=>{const e=c(n,"package.json");if(!a(e))return{};try{return i(e)}catch{return{}}},l=(n,e)=>{const o=d(n),t=new Map;for(const r of e){const s=r.detect(n,o);s&&t.set(r.id,s)}return t};export{l as a,g as d,k as f,d as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as ze}from"node:module";import{e as M,z as Fe}from"./index-BzhrR_iC.js";import{r as qe}from"./docker-DXqV-07f.js";import{parse as We}from"../packem_chunks/index4.js";import Re from"../packem_chunks/index.js";import{b as fe,l as Ke,a as Ze,d as Qe,e as en,f as nn,g as tn}from"./multi-eco-lockfiles-B2X3yhyo.js";import{p as ke,r as ue,c as sn}from"./composer-DR3D-Psb.js";import{p as Ie}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{e as on}from"./license-DvlYdo6T.js";import{S as rn}from"./lockfile-DhHAaHN5.js";import{a as cn}from"./index-B4AjSxHU.js";import{V as Le}from"./vis-user-error-
|
|
1
|
+
import{createRequire as ze}from"node:module";import{e as M,z as Fe}from"./index-BzhrR_iC.js";import{r as qe}from"./docker-DXqV-07f.js";import{parse as We}from"../packem_chunks/index4.js";import Re from"../packem_chunks/index.js";import{b as fe,l as Ke,a as Ze,d as Qe,e as en,f as nn,g as tn}from"./multi-eco-lockfiles-B2X3yhyo.js";import{p as ke,r as ue,c as sn}from"./composer-DR3D-Psb.js";import{p as Ie}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{e as on}from"./license-DvlYdo6T.js";import{S as rn}from"./lockfile-DhHAaHN5.js";import{a as cn}from"./index-B4AjSxHU.js";import{V as Le}from"./vis-user-error-CRmrBaD1.js";import{w as an,r as pn,Z as Ce}from"./zig-manifest-P7ydLEOa.js";let He;const Ve=e=>(He??=ze(import.meta.url))(e),ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,be=e=>{if(typeof ee<"u"&&ee.versions&&ee.versions.node){const[t,n]=ee.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return ee.getBuiltinModule(e)}return Ve(e)},{randomUUID:Be}=be("node:crypto"),{readFileSync:G,readdirSync:Pe,statSync:Xe,existsSync:Je}=be("node:fs"),{join:A,relative:$e,resolve:De,basename:Ye}=be("node:path"),ne=e=>e.replaceAll(/[^\w.~-]/g,t=>`%${(t.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),j=(e,t)=>{const n=e.toLowerCase();if(n.startsWith("@")){const s=n.indexOf("/");if(s>0){const o=n.slice(0,s),r=n.slice(s+1);return`pkg:npm/${ne(o)}/${ne(r)}@${ne(t)}`}}return`pkg:npm/${ne(n)}@${ne(t)}`},_={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},ln=[_.STRING,_.NUMBER,_.BOOLEAN],un='<?xml version="1.0" encoding="UTF-8"?>',Ee=["_selfCloseTag","_attrs"],fn=(e="",t=0)=>e.repeat(t),pe=e=>Array.isArray(e)&&_.ARRAY||typeof e===_.OBJECT&&e!==null&&e._name&&_.JSTOXML_OBJECT||e instanceof Date&&_.DATE||e===null&&_.NULL||typeof e,Ue=e=>e.startsWith("<![CDATA["),je=(e="",t={},n)=>{let s=e;if(typeof e===_.STRING){if(Ue(e))return e;const o=new RegExp(`(${Object.keys(t).join("|")})(?!(\\w|#)*;)`,"g");s=String(e).replace(o,(r,l)=>t[l]||"")}return typeof n=="function"?n(s):s},dn=(e={},t,n,s)=>(Array.isArray(e)?e:Object.entries(e).map(([r,l])=>({[r]:l}))).reduce((r,l)=>{const c=Object.keys(l)[0],i=l[c];if(typeof n===_.FUNCTION&&n(c,i))return r;const a=t?je(i,t):i,f=!s&&a===!0?"":`="${a}"`;return r.push(`${c}${f}`),r},[]),mn=(e={},t,n,s)=>{const o=dn(e,t,n,s);return o.length===0?"":` ${o.join(" ")}`},hn=(e={})=>Object.keys(e).map(t=>({_name:t,_content:e[t]})),gn=e=>ln.includes(pe(e)),vn=e=>!e.match("<"),yn=({header:e,isOutputStart:t})=>e&&t?typeof e===_.BOOLEAN?un:e:"",Ae={"<":"<",">":">","&":"&",'"':"""},q=(e={},t={})=>{const{depth:n=0,indent:s,_isFirstItem:o,_isOutputStart:r=!0,header:l,attributeReplacements:c={},attributeFilter:i,attributeExplicitTrue:a=!1,contentReplacements:f={},contentMap:g,selfCloseTags:y=!0}=t,X=typeof c=="boolean"&&!c?{}:{...Ae,...c},z=typeof f=="boolean"&&!f?{}:{...Ae,...f},N=typeof s=="string",H=fn(s,n),J=pe(e),Y=yn({header:l,isOutputStart:r}),O=r&&!Y&&o&&n===0,V=N&&!O?`
|
|
2
2
|
`:"";let k="";switch(J){case _.JSTOXML_OBJECT:{const{_name:b,_content:S}=e;if(S===null&&typeof g!="function"){k=`${V}${H}${b}`;break}if(Array.isArray(S)&&S.every(gn))return S.map(ae=>q({_name:b,_content:ae},{...t,depth:n,_isOutputStart:!1})).join("");if(Ee.includes(b))break;const $=q(S,{...t,depth:n+1,_isOutputStart:O}),B=pe($),E=vn($),oe=Ue($),T=`${V}${H}`;if(b==="_comment"){k+=`${T}<!-- ${S} -->`;break}const R=B==="undefined"||$==="",D=y,W=e._selfCloseTag,K=typeof W===_.BOOLEAN?R&&W:R&&D,I=K?"/":"",re=mn(e._attrs,X,i,a),Z=`<${b}${re}${I}>`,ce=N&&!E&&!oe?`
|
|
3
3
|
${H}`:"",ie=K?"":`${$}${ce}</${b}>`;k+=`${T}${Z}${ie}`;break}case _.OBJECT:{const b=Object.keys(e);k=b.map((v,$)=>{const B={...t,_isFirstItem:$===0,_isLastItem:$+1===b.length,_isOutputStart:O},E={_name:v};if(pe(e[v])===_.OBJECT&&(Ee.forEach(R=>{const D=e[v][R];typeof D<"u"&&(E[R]=D,delete e[v][R])}),typeof e[v]._content<"u"&&Object.keys(e[v]).length>1)){const R=Object.assign({},e[v]);delete R._content,E._content=[...hn(R),e[v]._content]}return typeof E._content>"u"&&(E._content=e[v]),q(E,B)},t).join("");break}case _.FUNCTION:{const b=e(t);k=q(b,t);break}case _.ARRAY:{k=e.map((S,v)=>{const $={...t,_isFirstItem:v===0,_isLastItem:v+1===e.length,_isOutputStart:O};return q(S,$)}).join("");break}default:{k=je(e,z,g);break}}return`${Y}${k}`},_n=(e,t)=>`pkg:cargo/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,se=e=>e,bn=e=>{const t=e.split(" ")[0];if(t===void 0||t==="")return;const n=/^\S+\s+(\d[^\s(]*)/.exec(e)?.[1],s=/\(([^)]+)\)/.exec(e)?.[1];return{kind:"main",name:t,source:s,version:n}},$n=e=>{const t=[];let n,s=!1;const o=()=>{n?.name!==void 0&&n.version!==void 0&&t.push({deps:n.deps,member:n.source===void 0,name:n.name,source:n.source,version:n.version})};for(const r of e.split(`
|
|
4
4
|
`)){const l=r.trim();if(l==="[[package]]"){o(),n={deps:[]},s=!1;continue}if(n===void 0)continue;if(s){const i=/^"([^"]+)",?$/.exec(l);if(i){const a=bn(i[1]);a!==void 0&&n.deps.push(a)}else l==="]"&&(s=!1);continue}if(l==="dependencies = ["){s=!0;continue}const c=/^(name|version|source)\s*=\s*"([^"]*)"$/.exec(l);if(c){const[,i="",a=""]=c;i==="name"?n.name=a:i==="version"?n.version=a:n.source=a}}return o(),t},Cn=(e,t)=>{const n=typeof t=="object"&&t!==null?t.package:void 0;return typeof n=="string"?n:e},Sn=(e,t)=>{const n=Array.isArray(t.workspace?.members)?t.workspace.members.filter(r=>typeof r=="string"):[],s=Array.isArray(t.workspace?.exclude)?t.workspace.exclude.filter(r=>typeof r=="string"):[],o=new Set;for(const r of n){let l=[e];for(const c of r.split("/").filter(i=>i!==""&&i!==".")){const i=[];for(const a of l){if(!/[*?[{]/.test(c)){i.push(A(a,c));continue}let f;try{f=Pe(a)}catch{f=[]}for(const g of f){const y=A(a,g);Re(c,g)&&Xe(y).isDirectory()&&i.push(y)}}l=i}for(const c of l){const i=c.slice(e.length+1).split("\\").join("/");s.some(a=>Re(a,i))||o.add(c)}}return[...o]},Rn=e=>{const t=new Map;let n;try{n=Oe(G(A(e,"Cargo.toml"),"utf8"))}catch{return t}const s=Sn(e,n);n.package?.name!==void 0&&s.push(e);for(const o of s){let r;try{r=Oe(G(A(o,"Cargo.toml"),"utf8"))}catch{continue}if(typeof r.package?.name!="string")continue;const l=new Set,c=i=>{for(const[a,f]of Object.entries(i??{}))l.add(se(Cn(a,f)))};c(r.dependencies),c(r["build-dependencies"]);for(const i of Object.values(r.target??{}))c(i.dependencies),c(i["build-dependencies"]);t.set(se(r.package.name),l)}return t},Oe=e=>We(e),kn=(e,t={})=>{let n;try{n=G(A(e,"Cargo.lock"),"utf8")}catch{return{components:[],dependencies:[]}}const s=Rn(e),o=$n(n).map(r=>{const l=r.member?s.get(se(r.name)):void 0;return l===void 0?r:{...r,deps:r.deps.map(c=>l.has(se(c.name))?c:{...c,kind:"dev"})}});return fe(o,{focusNames:t.focusNames,includeDev:t.includeDev,normalize:se,purl:_n})},En=(e,t)=>`pkg:composer/${e.split("/").map(n=>encodeURIComponent(n)).join("/")}@${encodeURIComponent(t)}`,te=e=>e.toLowerCase(),An=e=>{const t=[];for(const[n,s]of[["packages",!1],["packages-dev",!0]]){const o=e[n];if(Array.isArray(o))for(const r of o){if(typeof r.name!="string"||typeof r.version!="string")continue;const l=[...ue(r,"require").map(c=>({kind:s?"dev":"main",name:c})),...ue(r,"require-dev").map(c=>({kind:"dev",name:c}))];t.push({deps:l,member:!1,name:r.name,version:sn(r.version)})}}return t},On=(e,t={})=>{const n={components:[],dependencies:[]};let s,o;try{s=ke(G(A(e,"composer.lock"),"utf8")),o=ke(G(A(e,"composer.json"),"utf8"))}catch{return n}const r=typeof o.name=="string"?te(o.name):void 0;if(t.focusNames!==void 0&&!t.focusNames.some(i=>te(i)===r))return n;const l=new Set([...ue(o,"require"),...t.includeDev?ue(o,"require-dev"):[]].map(i=>te(i))),c=An(s).map(i=>({...i,member:l.has(te(i.name))}));return fe(c,{includeDev:t.includeDev,normalize:te,purl:En})},Te=e=>e.split("/").map(t=>encodeURIComponent(t)).join("/"),Tn={Go:(e,t)=>`pkg:golang/${Te(e)}@${encodeURIComponent(t)}`,Pub:(e,t)=>`pkg:pub/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,SwiftURL:(e,t)=>`pkg:swift/${Te(e)}@${encodeURIComponent(t)}`},wn=(e,t)=>{const n=Ke(e,t).map(s=>{const o=Tn[t](s.name,s.version);return{"bom-ref":o,name:s.name,purl:o,type:"library",version:s.version}}).sort((s,o)=>(s["bom-ref"]??"").localeCompare(o["bom-ref"]??""));return{components:n,dependencies:n.map(s=>({ref:s["bom-ref"]??""}))}},xn=(e,t)=>`pkg:gem/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,Nn=/^ {4}(\S+) \(([^()]+)\)\s*$/,Pn=/^ {6}(\S+)(?: \(.*\))?\s*$/,Dn=e=>{const t=new Map;let n,s,o;for(const r of e.split(/\r?\n/)){if(r.length>0&&!r.startsWith(" ")){n=r.trim(),s=void 0,o=void 0;continue}if(n!=="PATH"&&n!=="GEM"&&n!=="GIT")continue;const l=/^ {2}remote: (.+)$/.exec(r);if(l?.[1]!==void 0){s=l[1].trim();continue}const c=Nn.exec(r);if(c?.[1]!==void 0&&c[2]!==void 0){const a=c[1],f=c[2].split("-")[0]??c[2],g=n==="GIT"&&s!==void 0?`git:${s}`:void 0,y=`${a}\0${f}\0${g??""}`;o=t.get(y)??{deps:[],member:n==="PATH",name:a,source:g,version:f},t.set(y,o);continue}const i=Pn.exec(r);i?.[1]!==void 0&&o!==void 0&&o.deps.push({kind:"main",name:i[1]})}return[...t.values()]},In=(e,t={})=>{let n;try{n=G(A(e,"Gemfile.lock"),"utf8")}catch{return{components:[],dependencies:[]}}return fe(Dn(n),{focusNames:t.focusNames,includeDev:t.includeDev,normalize:s=>s,purl:xn})},ye=e=>{try{return Ie(e)}catch{return}},Ln=e=>{if(e.length===0||e.includes("..")||e.startsWith(".")||e.includes("\0")||e.includes("\\"))return!1;if(e.startsWith("@")){const t=e.indexOf("/");return t>1&&!e.includes("/",t+1)}return!e.includes("/")},Un=e=>e.length>0&&!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&!e.includes("\0"),jn=(e,t,n)=>{const o=`${t.replaceAll("/","+")}@${n}`,r=M(e,"node_modules",".pnpm"),l=ye(M(r,o,"node_modules",t,"package.json"));if(l)return l;let c;try{c=Pe(r)}catch{return}const i=`${o}_`;for(const a of c){if(!a.startsWith(i))continue;const f=ye(M(r,a,"node_modules",t,"package.json"));if(f)return f}},Mn=(e,t,n)=>{const s=ye(M(e,"node_modules",t,"package.json"));return s?.version===n?s:void 0},Gn=(e,t,n)=>{if(!(!Ln(t)||!Un(n)))return jn(e,t,n)??Mn(e,t,n)},zn={sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"},Hn={sha256:64,sha384:96,sha512:128},Vn=e=>{const t={name:e.name,version:e.version},{integrity:n}=e;return n&&n.hex.length===Hn[n.algorithm]&&(t.hash={alg:zn[n.algorithm],content:n.hex}),e.dependencies&&(t.dependencies=e.dependencies),e.peerDependencies&&(t.peerDependencies=e.peerDependencies),e.optionalDependencies&&(t.optionalDependencies=e.optionalDependencies),t},Bn=[{file:"pnpm-lock.yaml",type:"pnpm"},{file:"npm-shrinkwrap.json",type:"npm"},{file:"package-lock.json",type:"npm"},{file:"yarn.lock",type:"yarn"},{file:"bun.lock",type:"bun"}],Fn=e=>{for(const{file:t,type:n}of Bn){let s;try{s=Fe(M(e,t))}catch{continue}const o=new Map;for(const r of rn(s,n))o.set(`${r.name}@${r.version}`,Vn(r));return{packages:o,type:n}}},Me=e=>e.toLowerCase().replaceAll(/[-_.]+/g,"-"),qn=(e,t)=>`pkg:pypi/${encodeURIComponent(Me(e))}@${encodeURIComponent(t)}`,Xn=/^source\s*=\s*\{\s*(?:editable|virtual|directory)\s*=/,Jn=/\{\s*name\s*=\s*"([^"]+)"([^}]*)\}/,Yn=e=>{const t=[];let n,s="none",o=!1;const r=()=>{n?.name!==void 0&&n.version!==void 0&&t.push({deps:n.deps,member:n.member,name:n.name,source:n.source,version:n.version})};for(const l of e.split(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as d,z as u}from"./index-BzhrR_iC.js";import{s as l}from"./index-B4AjSxHU.js";import{y as f}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as m}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";const v={sha1:40,sha224:56,sha256:64,sha384:96,sha512:128},p=o=>{const n=o.indexOf("+");if(n===-1)return;const t=o.slice(n+1),e=/^([a-z0-9]+)\.([0-9a-f]+)$/.exec(t),s=e?v[e[1]]:void 0;if(!(e&&s!==void 0&&e[2].length===s))return`packageManager "${o}" has a malformed integrity suffix. Expected "+<algo>.<hex>" with algo sha1, sha224, sha256, sha384 or sha512 and lowercase hex of the matching length (sha512 = 128 characters).`},k=[".nvmrc",".node-version"],y=o=>{const n=d(o,"package.json");if(!f(n))return{};try{return m(n)??{}}catch{return{}}},c=(o,n)=>{const t=[];for(const{name:e,version:s}of n){const a=typeof s=="string"&&s.trim()!==""?s.trim():"*";l.validRange(a)!==null&&t.push({name:e,range:a})}if(t.length!==0)return{entries:t,label:o,value:n.map(e=>typeof e.version=="string"&&e.version!==""?`${e.name}@${e.version}`:e.name).join(" | ")}},h=(o,n)=>{const t=Array.isArray(o)?o:[o],e=[];for(const s of t){if(typeof s!="object"||s===null)continue;const{name:a,onFail:r,version:i}=s;typeof a!="string"||n!==void 0&&a!==n||e.push({name:a,onFail:typeof r=="string"?r:void 0,version:i})}return e},E=(o,n)=>{const t=d(o,n);if(f(t))try{const e=u(t).trim();return e===""?void 0:e}catch{return}},x=(o,n)=>{const t=[];for(const r of k){const i=E(o,r);i!==void 0&&t.push(c(r,[{name:"node",version:i}]))}const e=n.engines;e&&typeof e.node=="string"&&t.push(c("engines.node",[{name:"node",version:e.node}]));const s=n.devEngines;s?.runtime!==void 0&&t.push(c("devEngines.runtime",h(s.runtime,"node")));const a=n.volta;return a&&typeof a.node=="string"&&t.push(c("volta.node",[{name:"node",version:a.node}])),t.filter(r=>r!==void 0)},$=o=>{const n=[],t=[];if(typeof o.packageManager=="string"){const s=o.packageManager,a=p(s);a&&t.push(a);const[r]=s.split("+",1),i=/^([^@]+)@(.+)$/.exec(r??"");i&&n.push(c("packageManager",[{name:i[1],version:i[2]}]))}const e=o.devEngines;if(e?.packageManager!==void 0){const s=h(e.packageManager);n.push(c("devEngines.packageManager",s))}return{declarations:n.filter(s=>s!==void 0),integrityIssues:t}},M=(o,n)=>o.entries.some(t=>n.entries.some(e=>t.name===e.name&&l.intersects(t.range,e.range))),g=(o,n)=>{const t=[];for(let e=0;e<n.length;e++)for(let s=e+1;s<n.length;s++){const a=n[e],r=n[s];M(a,r)||t.push(`Conflicting ${o} declarations: ${a.label} (${a.value}) and ${r.label} (${r.value}) have no version in common. vis does not pick one; align them.`)}return t},P=o=>{const n=y(o),t=x(o,n),{declarations:e,integrityIssues:s}=$(n),a=t.length+e.length;if(a===0&&s.length===0)return[{id:"env-declarations",message:"No Node.js or package-manager declarations to cross-check.",status:"skip"}];const r=[...g("Node.js",t),...g("package-manager",e)].map(i=>({id:"env-conflict",message:i,status:"warn"}));for(const i of s)r.push({id:"env-integrity",message:i,status:"warn"});return r.length===0?[{id:"env-declarations",message:`Node.js and package-manager declarations agree (${a} checked).`,status:"ok"}]:r};export{P as c,h as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as k,D as S,f as L}from"./provenance-L1M2FPy_.js";import{g as $}from"./packument-zb18Jnlw.js";import{f}from"./formatBytes-_HvjOy8a-B_qQr4Hw.js";import{a as E}from"./build-scripts-CEDx_nJp.js";import{n as h}from"./license-DvlYdo6T.js";import{v as A,U as P,z as x}from"./index-BzhrR_iC.js";import{S as M}from"./lockfile-DhHAaHN5.js";import{L as b}from"./dependency-scan-
|
|
1
|
+
import{m as k,D as S,f as L}from"./provenance-L1M2FPy_.js";import{g as $}from"./packument-zb18Jnlw.js";import{f}from"./formatBytes-_HvjOy8a-B_qQr4Hw.js";import{a as E}from"./build-scripts-CEDx_nJp.js";import{n as h}from"./license-DvlYdo6T.js";import{v as A,U as P,z as x}from"./index-BzhrR_iC.js";import{S as M}from"./lockfile-DhHAaHN5.js";import{L as b}from"./dependency-scan-CawAKoU_.js";import{M as O}from"../packem_chunks/catalog.js";const C=2,m=4,y={CRITICAL:0,HIGH:1,LOW:3,MODERATE:C,UNKNOWN:m},le=(e,s)=>{const n=y[(e.vulnerability.severity??"UNKNOWN").toUpperCase()]??m,t=y[(s.vulnerability.severity??"UNKNOWN").toUpperCase()]??m;return n-t||e.packageName.localeCompare(s.packageName)||e.packageVersion.localeCompare(s.packageVersion)},D=(e,s)=>{const n=y[s.toUpperCase()]??C;return(y[e.toUpperCase()]??m)<=n},R=["firstSeen","installScripts","license","malware","publisherChange","score","unexpectedDeps","vulnerability"],w=6e4,W=(e,s,n)=>{for(const t of n)if(t===e||t===`${e}@${s}`||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},U=async(e,s)=>{const n=s.security?.policies?.firstSeen;if(n?.minutes===void 0||n.minutes<=0)return[];const{minutes:t}=n,r=n.exclude??[],c=s.security?.acceptedRisks,a=t*w,o=Date.now();return(await k(e.packages,S,async l=>{if(W(l.name,l.version,r))return;const p=await $(l.name,{workspaceRoot:e.workspaceRoot});if(p===void 0)return;const u=p.time?.[l.version];if(u===void 0)return;const d=Date.parse(u);if(Number.isNaN(d))return;const v=o-d;if(v>=a)return;const g=Math.max(0,Math.floor(v/w));return{acceptedRisk:f(l.name,l.version,c,"firstSeen"),data:{ageMinutes:g,minimumMinutes:t,publishedAt:u},packageName:l.name,policy:"firstSeen",reason:`${l.name}@${l.version} was published ${String(g)} min ago — below the ${String(t)} min firstSeen cooldown.`,severity:"block",version:l.version}})).filter(l=>l!==void 0)},_=(e,s)=>{const n=s.security?.policies?.installScripts;if(!n)return[];const t=n.allow??{},r=n.strict===!0;if(!r&&Object.keys(t).length===0)return[];const c=E(e.workspaceRoot,t,{pinVersions:s.security?.pinVersions===!0});if(c.unapproved.length===0)return[];const a=s.security?.acceptedRisks,o=r?"block":"warn";return c.unapproved.map(i=>({acceptedRisk:f(i.name,i.version??"*",a,"installScripts"),data:{hooks:i.hooks},packageName:i.name,policy:"installScripts",reason:`${i.name}${i.version?`@${i.version}`:""} declares unapproved build script(s): ${i.hooks.join(", ")}`,severity:o,version:i.version??"*"}))},I=new Set(["AND","OR"]),F=e=>{const s=e.replaceAll("("," ").replaceAll(")"," ").split(/\s+/).map(r=>r.trim()).filter(r=>r.length>0),n=[];let t=!1;for(const r of s){const c=r.toUpperCase();if(t){t=!1;continue}if(c==="WITH"){t=!0;continue}if(I.has(c))continue;const a=r.endsWith("+"),o=a?r.slice(0,-1):r,i=h(o)??o;n.push(i),a&&n.push(`${i}-or-later`)}return n},T=e=>{if(typeof e.license=="string"){const s=e.license.trim();return s.length>0?s:void 0}if(e.license&&typeof e.license=="object"&&typeof e.license.type=="string"){const s=e.license.type.trim();if(s.length>0)return s}if(Array.isArray(e.licenses)&&e.licenses.length>0){const s=e.licenses.map(n=>n&&typeof n.type=="string"?n.type.trim():"").filter(n=>n.length>0);if(s.length>0)return s.length===1?s[0]:`(${s.join(" OR ")})`}},V=(e,s)=>{if(s.length===0)return;const n=new Set(s.map(t=>h(t)??t).map(t=>t.toLowerCase()));for(const t of e)if(n.has(t.toLowerCase()))return t},K=(e,s)=>{if(s.length===0)return;const n=new Set(s.map(t=>h(t)??t).map(t=>t.toLowerCase()));for(const t of e)if(!n.has(t.toLowerCase()))return t},j=(e,s)=>{const n=s.security?.policies?.license;if(!n)return[];const t=n.allow??[],r=n.deny??[];if(t.length===0&&r.length===0)return[];const c=s.security?.acceptedRisks,a=[];for(const o of e.packages){const i=e.manifestData?.get(`${o.name}@${o.version}`),l=i?T(i):void 0;if(!l){t.length>0&&a.push({acceptedRisk:f(o.name,o.version,c,"license"),data:{declaredLicense:null},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} declares no license; allow-list mode requires one of: ${t.join(", ")}`,severity:"block",version:o.version});continue}const p=F(l),u=V(p,r);if(u){a.push({acceptedRisk:f(o.name,o.version,c,"license"),data:{declaredLicense:l,deniedLicense:u},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} uses denied license '${u}' (declared: ${l})`,severity:"block",version:o.version});continue}const d=K(p,t);d&&a.push({acceptedRisk:f(o.name,o.version,c,"license"),data:{allowList:t,declaredLicense:l,unallowedLicense:d},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} uses license '${d}' which is not on the allow-list (declared: ${l})`,severity:"block",version:o.version})}return a},z=6e4,B=(e,s,n)=>{for(const t of n)if(t===e||t===`${e}@${s}`||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},Y=async(e,s)=>{const n=s.security?.policies?.publisherChange;if(n?.mode!=="no-downgrade")return[];const t=n.exclude??[],r=typeof n.ignoreAfter=="number"?n.ignoreAfter*z:void 0,c=s.security?.acceptedRisks,a=Date.now();return(await k(e.packages,S,async i=>{if(B(i.name,i.version,t))return;const l=await $(i.name,{workspaceRoot:e.workspaceRoot});if(l===void 0)return;if(r!==void 0){const d=l.time?.[i.version],v=d===void 0?Number.NaN:Date.parse(d);if(!Number.isNaN(v)&&a-v>r)return}if(l.versions[i.version]?.dist?.attestations?.provenance!==void 0)return;const u=L(l,i.version);if(u!==void 0)return{acceptedRisk:f(i.name,i.version,c,"publisherChange"),data:{priorVersionWithProvenance:u},packageName:i.name,policy:"publisherChange",reason:`${i.name}@${i.version} dropped the provenance attestation that ${i.name}@${u} carried — publisher trust downgrade.`,severity:"block",version:i.version}})).filter(i=>i!==void 0)},H=e=>{for(const s of Object.values(b))for(const n of[s.file,...s.aliases??[]])if(e===n||e.endsWith(`/${n}`)||e.endsWith(`.${n}`))return s.type},q=(e,s,n)=>{const t=A(s)?s:P(e,s);let r;try{r=x(t)}catch{return}const c=H(t)??b[n]?.type;if(!c)return;const a=M(r,c);if(a.length===0)return;const o=new Set;for(const i of a)o.add(`${i.name}@${i.version}`);return o},G=(e,s)=>{for(const n of s)if(n===e||n.endsWith("*")&&e.startsWith(n.slice(0,-1)))return!0;return!1},X=(e,s)=>{const n=s.security?.policies?.unexpectedDeps;if(!n)return[];const t=n.allow??[],r=n.baselineLockfile;if(t.length===0&&!r)return[];const c=r?q(e.workspaceRoot,r,e.packageManager):void 0,a=s.security?.acceptedRisks,o=[];for(const i of e.packages){const l=t.length===0||G(i.name,t),p=c?c.has(`${i.name}@${i.version}`):!0;if(l&&p)continue;const u=[],d={};l||(u.push(`not on allow-list (${t.length} entr${t.length===1?"y":"ies"})`),d.allowList=t),!p&&c&&(u.push(`not present in baseline lockfile (${r})`),d.baselineLockfile=r),o.push({acceptedRisk:f(i.name,i.version,a,"unexpectedDeps"),data:d,packageName:i.name,policy:"unexpectedDeps",reason:`${i.name}@${i.version} is unexpected: ${u.join("; ")}`,severity:"block",version:i.version})}return o},J=(e,s)=>{if(!e.osvFindings||e.osvFindings.size===0)return[];const t=s.security?.policies?.vulnerability?.failOn,r=s.security?.acceptedRisks,c=[];for(const a of e.packages){const o=e.osvFindings.get(O(a.name,a.version))??e.osvFindings.get(a.name);if(!(!o||o.length===0))for(const i of o){const l=t?D(i.severity,t)?"block":"warn":"info";c.push({acceptedRisk:f(a.name,a.version,r,"vulnerability"),data:{advisoryId:i.id,aliases:i.aliases??[],cvssScore:i.cvssScore,fixedVersions:i.fixedVersions,severity:i.severity,summary:i.summary},packageName:a.name,policy:"vulnerability",reason:`${i.severity} ${i.id} affects ${a.name}@${a.version}: ${i.summary}`,severity:l,version:a.version})}}return c},N=[{evaluate:J,isConfigured:e=>e.security?.policies?.vulnerability!==void 0,name:"vulnerability",offlineSupported:!0,surfaces:["audit","doctor"]},{evaluate:j,isConfigured:e=>{const s=e.security?.policies?.license;return!!(s&&(s.allow&&s.allow.length>0||s.deny&&s.deny.length>0))},name:"license",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:_,isConfigured:e=>{const s=e.security?.policies?.installScripts;return!!(s&&(s.allow&&Object.keys(s.allow).length>0||s.strict===!0))},name:"installScripts",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:X,isConfigured:e=>{const s=e.security?.policies?.unexpectedDeps;return!!(s&&(s.allow&&s.allow.length>0||typeof s.baselineLockfile=="string"))},name:"unexpectedDeps",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:U,isConfigured:e=>{const s=e.security?.policies?.firstSeen?.minutes;return typeof s=="number"&&s>0},name:"firstSeen",offlineSupported:!1,surfaces:["audit","doctor","install"]},{evaluate:Y,isConfigured:e=>e.security?.policies?.publisherChange?.mode==="no-downgrade",name:"publisherChange",offlineSupported:!1,surfaces:["audit","doctor","install"]}],Q=(e,s,n)=>N.filter(t=>t.surfaces.includes(e)?n!==void 0?n.has(t.name):t.isConfigured(s):!1),ue=async(e,s,n)=>{const t=Q(s,n.visConfig,n.enabledPolicies),r=[];for(const c of t){if(e.offline&&!c.offlineSupported){r.push({packageName:"*",policy:c.name,reason:`policy.${c.name} skipped: requires network (--offline)`,severity:"info",version:"*"});continue}try{const a=await c.evaluate(e,n.visConfig);r.push(...a)}catch(a){const o=a instanceof Error?a.message:String(a);r.push({packageName:"*",policy:c.name,reason:`policy.${c.name} failed: ${o}`,severity:"info",version:"*"})}}return r},Z=(()=>{const e=new Map;for(const s of R)e.set(s.toLowerCase(),s);return e})(),de=()=>N.map(e=>e.name),pe=(e,s)=>{if(e===void 0)return;const n=e.trim().toLowerCase();if(n===""||n==="none")return new Set;if(n==="all")return new Set(R);const t=new Set;for(const r of e.split(",").map(c=>c.trim()).filter(c=>c.length>0)){const c=r.replace(/^_+/,"").replaceAll(/_+([a-z])/g,(o,i)=>i.toUpperCase()),a=Z.get(c.toLowerCase());a===void 0?s?.(r):t.add(a)}return t};export{le as c,ue as e,de as g,pe as p,D as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./vis-user-error-
|
|
1
|
+
import{b as e}from"./vis-user-error-CRmrBaD1.js";const o={filter:{alias:"F",description:"Filter packages by name pattern",multiple:!0,type:String},parallel:{defaultValue:!1,description:"Run concurrently without topological ordering",type:Boolean},recursive:{alias:"r",defaultValue:!1,description:"Run in every workspace package",type:Boolean},reverse:{defaultValue:!1,description:"Reverse topological execution order",type:Boolean},"shell-mode":{alias:"c",defaultValue:!1,description:"Execute within shell environment",type:Boolean},"workspace-root":{alias:"w",defaultValue:!1,description:"Run on workspace root only",type:Boolean}},l=e({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:()=>import("../packem_chunks/handler.js"),name:"exec",options:o});export{l as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{createRequire as ct}from"node:module";import{k as be,m as ee,z as te,a as mt,g as Lt,f as gt}from"./index-BzhrR_iC.js";import{L as De}from"./index-BisalDCf.js";import{a as ie,g as St}from"./_commonjsHelpers-DTfxOvZk.js";import{r as vt,a as Ct}from"./clean-DRiLimTx.js";import{p as yt}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";let ht;const ut=u=>(ht??=ct(import.meta.url))(u),F=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=u=>{if(typeof F<"u"&&F.versions&&F.versions.node){const[e,t]=F.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return F.getBuiltinModule(u)}return ut(u)},{dirname:pt}=R("node:path"),Pe=R("node:url"),{fileURLToPath:ft}=Pe,ye=R("node:module"),{createRequire:dt}=ye,Pt=R("util"),Di=u=>"Bun"in u,Ai=()=>process.argv,wi=()=>process.cwd(),xi=()=>process.env,Ei=()=>process.execArgv,Oi=()=>process.execPath,Ni=()=>process.platform,Fi=()=>process.arch,Gi=(u=0)=>{process.exit(u)},$i=(u,e)=>{const t=process;return t.on(u,e),()=>{t.removeListener(u,e)}};var T,ne;function Ae(){return ne||(ne=1,T=["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"]),T}var U,se;function bt(){return se||(se=1,U=["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"]),U}var M,oe;function Dt(){return oe||(oe=1,M=["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"]),M}var k,ae;function At(){if(ae)return k;ae=1;var u=[].concat(Ae()).concat(bt()),e=Dt();return k=function(t){var n=0;function s(){return n<t.length}function r(g){if(g instanceof RegExp){var c=t.slice(n),L=c.match(g);if(L)return n+=L[0].length,L[0]}else if(t.indexOf(g,n)===n)return n+=g.length,g}function a(){r(/[ ]*/)}function l(){for(var g,c=["WITH","AND","OR","(",")",":","+"],L=0;L<c.length&&(g=r(c[L]),!g);L++);if(g==="+"&&n>1&&t[n-2]===" ")throw new Error("Space before `+`");return g&&{type:"OPERATOR",string:g}}function o(){return r(/[A-Za-z0-9-.]+/)}function h(){var g=o();if(!g)throw new Error("Expected idstring at offset "+n);return g}function f(){if(r("DocumentRef-")){var g=h();return{type:"DOCUMENTREF",string:g}}}function S(){if(r("LicenseRef-")){var g=h();return{type:"LICENSEREF",string:g}}}function b(){var g=n,c=o();if(u.indexOf(c)!==-1)return{type:"LICENSE",string:c};if(e.indexOf(c)!==-1)return{type:"EXCEPTION",string:c};n=g}function v(){return l()||f()||S()||b()}for(var C=[];s()&&(a(),!!s());){var m=v();if(!m)throw new Error("Unexpected `"+t[n]+"` at offset "+n);C.push(m)}return C},k}var _,le;function wt(){return le||(le=1,_=function(u){var e=0;function t(){return e<u.length}function n(){return t()?u[e]:null}function s(){if(!t())throw new Error;e++}function r(m){var g=n();if(g&&g.type==="OPERATOR"&&m===g.string)return s(),g.string}function a(){if(r("WITH")){var m=n();if(m&&m.type==="EXCEPTION")return s(),m.string;throw new Error("Expected exception after `WITH`")}}function l(){var m=e,g="",c=n();if(c.type==="DOCUMENTREF"&&(s(),g+="DocumentRef-"+c.string+":",!r(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(c=n(),c.type==="LICENSEREF")return s(),g+="LicenseRef-"+c.string,{license:g};e=m}function o(){var m=n();if(m&&m.type==="LICENSE"){s();var g={license:m.string};r("+")&&(g.plus=!0);var c=a();return c&&(g.exception=c),g}}function h(){var m=r("(");if(m){var g=v();if(!r(")"))throw new Error("Expected `)`");return g}}function f(){return h()||l()||o()}function S(m,g){return function c(){var L=g();if(L){if(!r(m))return L;var y=c();if(!y)throw new Error("Expected expression");return{left:L,conjunction:m.toLowerCase(),right:y}}}}var b=S("AND",f),v=S("OR",b),C=v();if(!C||t())throw new Error("Syntax error");return C}),_}var W,ce;function we(){if(ce)return W;ce=1;var u=At(),e=wt();return W=function(t){return e(u(t))},W}var H,he;function xt(){if(he)return H;he=1;var u=we(),e=Ae();function t(c){try{return u(c),!0}catch{return!1}}function n(c,L){var y=L[0].length-c[0].length;return y!==0?y:c[0].toUpperCase().localeCompare(L[0].toUpperCase())}var s=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(n),r=0,a=1,l=[function(c){return c.toUpperCase()},function(c){return c.trim()},function(c){return c.replace(/\./g,"")},function(c){return c.replace(/\s+/g,"")},function(c){return c.replace(/\s+/g,"-")},function(c){return c.replace("v","-")},function(c){return c.replace(/,?\s*(\d)/,"-$1")},function(c){return c.replace(/,?\s*(\d)/,"-$1.0")},function(c){return c.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(c){return c.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(c){return c[0].toUpperCase()+c.slice(1)},function(c){return c.replace("/","-")},function(c){return c.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(c){return c.indexOf("3.0")!==-1?c+"-or-later":c+"-only"},function(c){return c+"only"},function(c){return c.replace(/(\d)$/,"-$1.0")},function(c){return c.replace(/(-| )?(\d)$/,"-$2-Clause")},function(c){return c.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(c){return c.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(c){return c.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(c){return c.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(c){return c.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(c){return c.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(c){return"CC-"+c},function(c){return"CC-"+c+"-4.0"},function(c){return c.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(c){return"CC-"+c.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],o=e.map(function(c){var L=/^(.*)-\d+\.\d+$/.exec(c);return L?[L[0],L[1]]:[c,null]}).reduce(function(c,L){var y=L[1];return c[y]=c[y]||[],c[y].push(L[0]),c},{}),h=Object.keys(o).map(function(L){return[L,o[L]]}).filter(function(L){return L[1].length===1&&L[0]!==null&&L[0]!=="APL"}).map(function(L){return[L[0],L[1][0]]});o=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(h).sort(n),S=0,b=1,v=function(c){for(var L=0;L<l.length;L++){var y=l[L](c).trim();if(y!==c&&t(y))return y}return null},C=function(c){for(var L=c.toUpperCase(),y=0;y<f.length;y++){var i=f[y];if(L.indexOf(i[S])>-1)return i[b]}return null},m=function(c,L){for(var y=0;y<s.length;y++){var i=s[y],p=i[r];if(c.indexOf(p)>-1){var d=c.replace(p,i[a]),P=L(d);if(P!==null)return P}}return null};H=function(c,L){L=L||{};var y=L.upgrade===void 0?!0:!!L.upgrade;function i(D){return y?g(D):D}var p=typeof c=="string"&&c.trim().length!==0;if(!p)throw Error("Invalid argument. Expected non-empty string.");if(c=c.trim(),t(c))return i(c);var d=c.replace(/\+$/,"").trim();if(t(d))return i(d);var P=v(c);return P!==null||(P=m(c,function(D){return t(D)?D:v(D)}),P!==null)||(P=C(c),P!==null)||(P=m(c,C),P!==null)?i(P):null};function g(c){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(c)!==-1?c+"-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(c)!==-1?c.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(c)!==-1?c+"-or-later":c}return H}var j,ue;function Et(){if(ue)return j;ue=1;var u=we(),e=xt(),t='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',n=/^SEE LICEN[CS]E IN (.+)$/;function s(a,l){return l.slice(0,a.length)===a}function r(a){if(a.hasOwnProperty("license")){var l=a.license;return s("LicenseRef",l)||s("DocumentRef",l)}else return r(a.left)||r(a.right)}return j=function(a){var l;try{l=u(a)}catch{var o;if(a==="UNLICENSED"||a==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(o=n.exec(a))return{validForOldPackages:!0,validForNewPackages:!0,inFile:o[1]};var h={validForOldPackages:!1,validForNewPackages:!1,warnings:[t]};if(a.trim().length!==0){var f=e(a);f&&h.warnings.push('license is similar to the valid expression "'+f+'"')}return h}return r(l)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[t]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}},j}var xe={hasSubscribers:!1},A=xe,N=xe;import("node:diagnostics_channel").then(u=>{A=u.channel("lru-cache:metrics"),N=u.tracingChannel("lru-cache")}).catch(()=>{});var Ot=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,z=()=>A.hasSubscribers||N.hasSubscribers,Ee=new Set,pe=process||{},Nt=(u,e,t,n)=>{typeof pe.emitWarning=="function"?pe.emitWarning(u,e,t,n):console.error(`[${t}] ${e}: ${u}`)},Ft=u=>!Ee.has(u),O=u=>!!u&&u===Math.floor(u)&&u>0&&isFinite(u),Oe=u=>O(u)?u<=Math.pow(2,8)?Uint8Array:u<=Math.pow(2,16)?Uint16Array:u<=Math.pow(2,32)?Uint32Array:u<=Number.MAX_SAFE_INTEGER?B:null:null,B=class extends Array{constructor(e){super(e),this.fill(0)}},Gt=class ${heap;length;static#n=!1;static create(e){let t=Oe(e);if(!t)return[];$.#n=!0;let n=new $(e,t);return $.#n=!1,n}constructor(e,t){if(!$.#n)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},$t=class Ne{#n;#c;#t;#O;#g;#R;#I;#S;get perf(){return this.#S}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#o;#v;#s;#r;#e;#u;#f;#h;#a;#C;#l;#P;#y;#d;#m;#b;#T;#p;#N;static unsafeExposeInternals(e){return{starts:e.#y,ttls:e.#d,autopurgeTimers:e.#m,sizes:e.#P,keyMap:e.#s,keyList:e.#r,valList:e.#e,next:e.#u,prev:e.#f,get head(){return e.#h},get tail(){return e.#a},free:e.#C,isBackgroundFetch:t=>e.#i(t),backgroundFetch:(t,n,s,r)=>e.#k(t,n,s,r),moveToTail:t=>e.#B(t),indexes:t=>e.#D(t),rindexes:t=>e.#A(t),isStale:t=>e.#L(t)}}get max(){return this.#n}get maxSize(){return this.#c}get calculatedSize(){return this.#v}get size(){return this.#o}get fetchMethod(){return this.#R}get memoMethod(){return this.#I}get dispose(){return this.#t}get onInsert(){return this.#O}get disposeAfter(){return this.#g}constructor(e){let{max:t=0,ttl:n,ttlResolution:s=1,ttlAutopurge:r,updateAgeOnGet:a,updateAgeOnHas:l,allowStale:o,dispose:h,onInsert:f,disposeAfter:S,noDisposeOnSet:b,noUpdateTTL:v,maxSize:C=0,maxEntrySize:m=0,sizeCalculation:g,fetchMethod:c,memoMethod:L,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:i,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:d,ignoreFetchAbort:P,backgroundFetchSize:D=1,perf:w}=e;if(this.backgroundFetchSize=D,w!==void 0&&typeof w?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#S=w??Ot,t!==0&&!O(t))throw new TypeError("max option must be a nonnegative integer");let x=t?Oe(t):Array;if(!x)throw new Error("invalid max value: "+t);if(this.#n=t,this.#c=C,this.maxEntrySize=m||this.#c,this.sizeCalculation=g,this.sizeCalculation){if(!this.#c&&!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(L!==void 0&&typeof L!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#I=L,c!==void 0&&typeof c!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#R=c,this.#T=!!c,this.#s=new Map,this.#r=Array.from({length:t}).fill(void 0),this.#e=Array.from({length:t}).fill(void 0),this.#u=new x(t),this.#f=new x(t),this.#h=0,this.#a=0,this.#C=Gt.create(t),this.#o=0,this.#v=0,typeof h=="function"&&(this.#t=h),typeof f=="function"&&(this.#O=f),typeof S=="function"?(this.#g=S,this.#l=[]):(this.#g=void 0,this.#l=void 0),this.#b=!!this.#t,this.#N=!!this.#O,this.#p=!!this.#g,this.noDisposeOnSet=!!b,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!d,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#c!==0&&!O(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!O(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!o,this.noDeleteOnStaleGet=!!i,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!l,this.ttlResolution=O(s)||s===0?s:1,this.ttlAutopurge=!!r,this.ttl=n||0,this.ttl){if(!O(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#_()}if(this.#n===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#n&&!this.#c){let I="LRU_CACHE_UNBOUNDED";Ft(I)&&(Ee.add(I),Nt("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",I,Ne))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#_(){let e=new B(this.#n),t=new B(this.#n);this.#d=e,this.#y=t;let n=this.ttlAutopurge?Array.from({length:this.#n}):void 0;this.#m=n,this.#W=(o,h,f=this.#S.now())=>{t[o]=h!==0?f:0,e[o]=h,s(o,h)},this.#F=o=>{t[o]=e[o]!==0?this.#S.now():0,s(o,e[o])};let s=this.ttlAutopurge?(o,h)=>{if(n?.[o]&&(clearTimeout(n[o]),n[o]=void 0),h&&h!==0&&n){let f=setTimeout(()=>{this.#L(o)?(this.#w(this.#r[o],"expire"),n[o]=void 0):s(o,l(o))},h+1);f.unref&&f.unref(),n[o]=f}}:()=>{};this.#x=(o,h)=>{if(e[h]){let f=e[h],S=t[h];if(!f||!S)return;o.ttl=f,o.start=S,o.now=r||a();let b=o.now-S;o.remainingTTL=f-b}};let r=0,a=()=>{let o=this.#S.now();if(this.ttlResolution>0){r=o;let h=setTimeout(()=>r=0,this.ttlResolution);h.unref&&h.unref()}return o};this.getRemainingTTL=o=>{let h=this.#s.get(o);return h===void 0?0:l(h)};let l=o=>{let h=e[o],f=t[o];if(!h||!f)return 1/0;let S=(r||a())-f;return h-S};this.#L=o=>{let h=t[o],f=e[o];return!!f&&!!h&&(r||a())-h>f}}#F=()=>{};#x=()=>{};#W=()=>{};#L=()=>!1;#V(){let e=new B(this.#n);this.#v=0,this.#P=e,this.#G=t=>{this.#v-=e[t],e[t]=0},this.#H=(t,n,s,r)=>{if(!O(s)){if(this.#i(n))return this.backgroundFetchSize;if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(s=r(n,t),!O(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#U=(t,n,s)=>{if(e[t]=n,this.#c){let r=this.#c-e[t];for(;this.#v>r;)this.#M(!0)}this.#v+=e[t],s&&(s.entrySize=n,s.totalCalculatedSize=this.#v)}}#G=e=>{};#U=(e,t,n)=>{};#H=(e,t,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#D({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#a;this.#j(t)&&((e||!this.#L(t))&&(yield t),t!==this.#h);)t=this.#f[t]}*#A({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#h;this.#j(t)&&((e||!this.#L(t))&&(yield t),t!==this.#a);)t=this.#u[t]}#j(e){return e!==void 0&&this.#s.get(this.#r[e])===e}*entries(){for(let e of this.#D())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#i(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*rentries(){for(let e of this.#A())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#i(this.#e[e])&&(yield[this.#r[e],this.#e[e]])}*keys(){for(let e of this.#D()){let t=this.#r[e];t!==void 0&&!this.#i(this.#e[e])&&(yield t)}}*rkeys(){for(let e of this.#A()){let t=this.#r[e];t!==void 0&&!this.#i(this.#e[e])&&(yield t)}}*values(){for(let e of this.#D())this.#e[e]!==void 0&&!this.#i(this.#e[e])&&(yield this.#e[e])}*rvalues(){for(let e of this.#A())this.#e[e]!==void 0&&!this.#i(this.#e[e])&&(yield this.#e[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let n of this.#D()){let s=this.#e[n],r=this.#i(s)?s.__staleWhileFetching:s;if(r!==void 0&&e(r,this.#r[n],this))return this.#$(this.#r[n],t)}}forEach(e,t=this){for(let n of this.#D()){let s=this.#e[n],r=this.#i(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#r[n],this)}}rforEach(e,t=this){for(let n of this.#A()){let s=this.#e[n],r=this.#i(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#r[n],this)}}purgeStale(){let e=!1;for(let t of this.#A({allowStale:!0}))this.#L(t)&&(this.#w(this.#r[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let n=this.#e[t],s=this.#i(n)?n.__staleWhileFetching:n;if(s===void 0)return;let r={value:s};if(this.#d&&this.#y){let a=this.#d[t],l=this.#y[t];if(a&&l){let o=a-(this.#S.now()-l);r.ttl=o,r.start=Date.now()}}return this.#P&&(r.size=this.#P[t]),r}dump(){let e=[];for(let t of this.#D({allowStale:!0})){let n=this.#r[t],s=this.#e[t],r=this.#i(s)?s.__staleWhileFetching:s;if(r===void 0||n===void 0)continue;let a={value:r};if(this.#d&&this.#y){a.ttl=this.#d[t];let l=this.#S.now()-this.#y[t];a.start=Math.floor(Date.now()-l)}this.#P&&(a.size=this.#P[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let s=Date.now()-n.start;n.start=this.#S.now()-s}this.#E(t,n.value,n)}}set(e,t,n={}){let{status:s=A.hasSubscribers?{}:void 0}=n;n.status=s,s&&(s.op="set",s.key=e,t!==void 0&&(s.value=t),s.cache=this);let r=this.#E(e,t,n);return s&&A.hasSubscribers&&A.publish(s),r}#E(e,t,n,s){let{ttl:r=this.ttl,start:a,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:h}=n,f=this.#i(t);if(t===void 0)return h&&(h.set="deleted"),this.delete(e),this;let{noUpdateTTL:S=this.noUpdateTTL}=n;h&&!f&&(h.value=t);let b=this.#H(e,t,n.size||0,o,h);if(this.maxEntrySize&&b>this.maxEntrySize)return this.#w(e,"set"),h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this;let v=this.#o===0?void 0:this.#s.get(e);if(v===void 0)v=this.#o===0?this.#a:this.#C.length!==0?this.#C.pop():this.#o===this.#n?this.#M(!1):this.#o,this.#r[v]=e,this.#e[v]=t,this.#s.set(e,v),this.#u[this.#a]=v,this.#f[v]=this.#a,this.#a=v,this.#o++,this.#U(v,b,h),h&&(h.set="add"),S=!1,this.#N&&!f&&this.#O?.(t,e,"add");else{this.#B(v);let C=this.#e[v];if(t!==C){if(!l)if(this.#i(C)){C!==s&&C.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=C;m!==void 0&&m!==t&&(this.#b&&this.#t?.(m,e,"set"),this.#p&&this.#l?.push([m,e,"set"]))}else this.#b&&this.#t?.(C,e,"set"),this.#p&&this.#l?.push([C,e,"set"]);if(this.#G(v),this.#U(v,b,h),this.#e[v]=t,!f){let m=C&&this.#i(C)?C.__staleWhileFetching:C,g=m===void 0?"add":t!==m?"replace":"update";h&&(h.set=g,m!==void 0&&(h.oldValue=m)),this.#N&&this.onInsert?.(t,e,g)}}else f||(h&&(h.set="update"),this.#N&&this.onInsert?.(t,e,"update"))}if(r!==0&&!this.#d&&this.#_(),this.#d&&(S||this.#W(v,r,a),h&&this.#x(h,v)),!l&&this.#p&&this.#l){let C=this.#l,m;for(;m=C?.shift();)this.#g?.(...m)}return this}pop(){try{for(;this.#o;){let e=this.#e[this.#h];if(this.#M(!0),this.#i(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#l){let e=this.#l,t;for(;t=e?.shift();)this.#g?.(...t)}}}#M(e){let t=this.#h,n=this.#r[t],s=this.#e[t],r=this.#i(s);r&&s.__abortController.abort(new Error("evicted"));let a=r?s.__staleWhileFetching:s;return(this.#b||this.#p)&&a!==void 0&&(this.#b&&this.#t?.(a,n,"evict"),this.#p&&this.#l?.push([a,n,"evict"])),this.#G(t),this.#m?.[t]&&(clearTimeout(this.#m[t]),this.#m[t]=void 0),e&&(this.#r[t]=void 0,this.#e[t]=void 0,this.#C.push(t)),this.#o===1?(this.#h=this.#a=0,this.#C.length=0):this.#h=this.#u[t],this.#s.delete(n),this.#o--,t}has(e,t={}){let{status:n=A.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="has",n.key=e,n.cache=this);let s=this.#K(e,t);return A.hasSubscribers&&A.publish(n),s}#K(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=t,r=this.#s.get(e);if(r!==void 0){let a=this.#e[r];if(this.#i(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#L(r))s&&(s.has="stale",this.#x(s,r));else return n&&this.#F(r),s&&(s.has="hit",this.#x(s,r)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{status:n=z()?{}:void 0}=t;n&&(n.op="peek",n.key=e,n.cache=this),t.status=n;let s=this.#X(e,t);return A.hasSubscribers&&A.publish(n),s}#X(e,t){let{status:n,allowStale:s=this.allowStale}=t,r=this.#s.get(e);if(r===void 0||!s&&this.#L(r)){n&&(n.peek=r===void 0?"miss":"stale");return}let a=this.#e[r],l=this.#i(a)?a.__staleWhileFetching:a;return n&&(l!==void 0?(n.peek="hit",n.value=l):n.peek="miss"),l}#k(e,t,n,s){let r=t===void 0?void 0:this.#e[t];if(this.#i(r))return r;let a=new AbortController,{signal:l}=n;l?.addEventListener("abort",()=>a.abort(l.reason),{signal:a.signal});let o={signal:a.signal,options:n,context:s},h=(m,g=!1)=>{let{aborted:c}=a.signal,L=n.ignoreFetchAbort&&m!==void 0,y=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&m!==void 0);if(n.status&&(c&&!g?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,L&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),c&&!L&&!g)return S(a.signal.reason,y);let i=v,p=this.#e[t];return(p===v||p===void 0&&L&&g)&&(m===void 0?i.__staleWhileFetching!==void 0?this.#e[t]=i.__staleWhileFetching:this.#w(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.#E(e,m,o.options,i))),m},f=m=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=m),S(m,!1)),S=(m,g)=>{let{aborted:c}=a.signal,L=c&&n.allowStaleOnFetchAbort,y=L||n.allowStaleOnFetchRejection,i=y||n.noDeleteOnFetchRejection,p=v;if(this.#e[t]===v&&(!i||!g&&p.__staleWhileFetching===void 0?this.#w(e,"fetch"):L||(this.#e[t]=p.__staleWhileFetching)),y)return n.status&&p.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw m},b=(m,g)=>{let c=this.#R?.(e,r,o);a.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(m(void 0),n.allowStaleOnFetchAbort&&(m=L=>h(L,!0)))}),c&&c instanceof Promise?c.then(L=>m(L===void 0?void 0:L),g):c!==void 0&&m(c)};n.status&&(n.status.fetchDispatched=!0);let v=new Promise(b).then(h,f),C=Object.assign(v,{__abortController:a,__staleWhileFetching:r,__returned:void 0});return t===void 0?(this.#E(e,C,{...o.options,status:void 0}),t=this.#s.get(e)):this.#e[t]=C,C}#i(e){if(!this.#T)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let n=N.hasSubscribers,{status:s=z()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let r=this.#z(e,t);return s&&n&&(s.trace=!0,N.tracePromise(()=>r,s).catch(()=>{})),r}async#z(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:o=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:S=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:b=this.allowStaleOnFetchRejection,ignoreFetchAbort:v=this.ignoreFetchAbort,allowStaleOnFetchAbort:C=this.allowStaleOnFetchAbort,context:m,forceRefresh:g=!1,status:c,signal:L}=t;if(c&&(c.op="fetch",c.key=e,g&&(c.forceRefresh=!0),c.cache=this),!this.#T)return c&&(c.fetch="get"),this.#$(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:r,status:c});let y={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:r,ttl:a,noDisposeOnSet:l,size:o,sizeCalculation:h,noUpdateTTL:f,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:C,ignoreFetchAbort:v,status:c,signal:L},i=this.#s.get(e);if(i===void 0){c&&(c.fetch="miss");let p=this.#k(e,i,y,m);return p.__returned=p}else{let p=this.#e[i];if(this.#i(p)){let w=n&&p.__staleWhileFetching!==void 0;return c&&(c.fetch="inflight",w&&(c.returnedStale=!0)),w?p.__staleWhileFetching:p.__returned=p}let d=this.#L(i);if(!g&&!d)return c&&(c.fetch="hit"),this.#B(i),s&&this.#F(i),c&&this.#x(c,i),p;let P=this.#k(e,i,y,m),D=P.__staleWhileFetching!==void 0&&n;return c&&(c.fetch=d?"stale":"refresh",D&&d&&(c.returnedStale=!0)),D?P.__staleWhileFetching:P.__returned=P}}forceFetch(e,t={}){let n=N.hasSubscribers,{status:s=z()?{}:void 0}=t;t.status=s,s&&t.context&&(s.context=t.context);let r=this.#J(e,t);return s&&n&&(s.trace=!0,N.tracePromise(()=>r,s).catch(()=>{})),r}async#J(e,t={}){let n=await this.#z(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let{status:n=A.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="memo",n.key=e,t.context&&(n.context=t.context),n.cache=this);let s=this.#Z(e,t);return n&&(n.value=s),A.hasSubscribers&&A.publish(n),s}#Z(e,t={}){let n=this.#I;if(!n)throw new Error("no memoMethod provided to constructor");let{context:s,status:r,forceRefresh:a,...l}=t;r&&a&&(r.forceRefresh=!0);let o=this.#$(e,l),h=a||o===void 0;if(r&&(r.memo=h?"miss":"hit",h||(r.value=o)),!h)return o;let f=n(e,o,{options:l,context:s});return r&&(r.value=f),this.#E(e,f,l),f}get(e,t={}){let{status:n=A.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="get",n.key=e,n.cache=this);let s=this.#$(e,t);return n&&(s!==void 0&&(n.value=s),A.hasSubscribers&&A.publish(n)),s}#$(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:a}=t,l=this.#s.get(e);if(l===void 0){a&&(a.get="miss");return}let o=this.#e[l],h=this.#i(o);return a&&this.#x(a,l),this.#L(l)?h?(a&&(a.get="stale-fetching"),n&&o.__staleWhileFetching!==void 0?(a&&(a.returnedStale=!0),o.__staleWhileFetching):void 0):(r||this.#w(e,"expire"),a&&(a.get="stale"),n?(a&&(a.returnedStale=!0),o):void 0):(a&&(a.get=h?"fetching":"hit"),this.#B(l),s&&this.#F(l),h?o.__staleWhileFetching:o)}#Y(e,t){this.#f[t]=e,this.#u[e]=t}#B(e){e!==this.#a&&(e===this.#h?this.#h=this.#u[e]:this.#Y(this.#f[e],this.#u[e]),this.#Y(this.#a,e),this.#a=e)}delete(e){return this.#w(e,"delete")}#w(e,t){A.hasSubscribers&&A.publish({op:"delete",delete:t,key:e,cache:this});let n=!1;if(this.#o!==0){let s=this.#s.get(e);if(s!==void 0)if(this.#m?.[s]&&(clearTimeout(this.#m[s]),this.#m[s]=void 0),n=!0,this.#o===1)this.#q(t);else{this.#G(s);let r=this.#e[s];if(this.#i(r)?r.__abortController.abort(new Error("deleted")):(this.#b||this.#p)&&(this.#b&&this.#t?.(r,e,t),this.#p&&this.#l?.push([r,e,t])),this.#s.delete(e),this.#r[s]=void 0,this.#e[s]=void 0,s===this.#a)this.#a=this.#f[s];else if(s===this.#h)this.#h=this.#u[s];else{let a=this.#f[s];this.#u[a]=this.#u[s];let l=this.#u[s];this.#f[l]=this.#f[s]}this.#o--,this.#C.push(s)}}if(this.#p&&this.#l?.length){let s=this.#l,r;for(;r=s?.shift();)this.#g?.(...r)}return n}clear(){return this.#q("delete")}#q(e){for(let t of this.#A({allowStale:!0})){let n=this.#e[t];if(this.#i(n))n.__abortController.abort(new Error("deleted"));else{let s=this.#r[t];this.#b&&this.#t?.(n,s,e),this.#p&&this.#l?.push([n,s,e])}}if(this.#s.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#d&&this.#y){this.#d.fill(0),this.#y.fill(0);for(let t of this.#m??[])t!==void 0&&clearTimeout(t);this.#m?.fill(void 0)}if(this.#P&&this.#P.fill(0),this.#h=0,this.#a=0,this.#C.length=0,this.#v=0,this.#o=0,this.#p&&this.#l){let t=this.#l,n;for(;n=t?.shift();)this.#g?.(...n)}}};const Bt=Object.defineProperty({__proto__:null,LRUCache:$t},Symbol.toStringTag,{value:"Module"}),Rt=ie(Bt);var Y,fe;function It(){if(fe)return Y;fe=1;const u=(...r)=>r.every(a=>a)?r.join(""):"",e=r=>r?encodeURIComponent(r):"",t=r=>r.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),n={sshtemplate:({domain:r,user:a,project:l,committish:o})=>`git@${r}:${a}/${l}.git${u("#",o)}`,sshurltemplate:({domain:r,user:a,project:l,committish:o})=>`git+ssh://git@${r}/${a}/${l}.git${u("#",o)}`,edittemplate:({domain:r,user:a,project:l,committish:o,editpath:h,path:f})=>`https://${r}/${a}/${l}${u("/",h,"/",e(o||"HEAD"),"/",f)}`,browsetemplate:({domain:r,user:a,project:l,committish:o,treepath:h})=>`https://${r}/${a}/${l}${u("/",h,"/",e(o))}`,browsetreetemplate:({domain:r,user:a,project:l,committish:o,treepath:h,path:f,fragment:S,hashformat:b})=>`https://${r}/${a}/${l}/${h}/${e(o||"HEAD")}/${f}${u("#",b(S||""))}`,browseblobtemplate:({domain:r,user:a,project:l,committish:o,blobpath:h,path:f,fragment:S,hashformat:b})=>`https://${r}/${a}/${l}/${h}/${e(o||"HEAD")}/${f}${u("#",b(S||""))}`,docstemplate:({domain:r,user:a,project:l,treepath:o,committish:h})=>`https://${r}/${a}/${l}${u("/",o,"/",e(h))}#readme`,httpstemplate:({auth:r,domain:a,user:l,project:o,committish:h})=>`git+https://${u(r,"@")}${a}/${l}/${o}.git${u("#",h)}`,filetemplate:({domain:r,user:a,project:l,committish:o,path:h})=>`https://${r}/${a}/${l}/raw/${e(o||"HEAD")}/${h}`,shortcuttemplate:({type:r,user:a,project:l,committish:o})=>`${r}:${a}/${l}${u("#",o)}`,pathtemplate:({user:r,project:a,committish:l})=>`${r}/${a}${u("#",l)}`,bugstemplate:({domain:r,user:a,project:l})=>`https://${r}/${a}/${l}/issues`,hashformat:t},s={};s.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:r,user:a,project:l,committish:o,path:h})=>`https://${u(r,"@")}raw.githubusercontent.com/${a}/${l}/${e(o||"HEAD")}/${h}`,gittemplate:({auth:r,domain:a,user:l,project:o,committish:h})=>`git://${u(r,"@")}${a}/${l}/${o}.git${u("#",h)}`,tarballtemplate:({domain:r,user:a,project:l,committish:o})=>`https://codeload.${r}/${a}/${l}/tar.gz/${e(o||"HEAD")}`,extract:r=>{let[,a,l,o,h]=r.pathname.split("/",5);if(!(o&&o!=="tree")&&(o||(h=r.hash.slice(1)),l&&l.endsWith(".git")&&(l=l.slice(0,-4)),!(!a||!l)))return{user:a,project:l,committish:h}}},s.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:r,user:a,project:l,committish:o,treepath:h,path:f,editpath:S})=>`https://${r}/${a}/${l}${u("/",h,"/",e(o||"HEAD"),"/",f,S)}`,tarballtemplate:({domain:r,user:a,project:l,committish:o})=>`https://${r}/${a}/${l}/get/${e(o||"HEAD")}.tar.gz`,extract:r=>{let[,a,l,o]=r.pathname.split("/",4);if(!["get"].includes(o)&&(l&&l.endsWith(".git")&&(l=l.slice(0,-4)),!(!a||!l)))return{user:a,project:l,committish:r.hash.slice(1)}}},s.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",tarballtemplate:({domain:r,user:a,project:l,committish:o})=>`https://${r}/api/v4/projects/${e(a+"/"+l)}/repository/archive.tar.gz?sha=${e(o||"HEAD")}`,extract:r=>{const a=r.pathname.slice(1);if(a.includes("/-/")||a.includes("/archive.tar.gz"))return;const l=a.split("/");let o=l.pop();o.endsWith(".git")&&(o=o.slice(0,-4));const h=l.join("/");if(!(!h||!o))return{user:h,project:o,committish:r.hash.slice(1)}}},s.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:r,project:a,committish:l})=>`git@${r}:${a}.git${u("#",l)}`,sshurltemplate:({domain:r,project:a,committish:l})=>`git+ssh://git@${r}/${a}.git${u("#",l)}`,edittemplate:({domain:r,user:a,project:l,committish:o,editpath:h})=>`https://${r}/${a}/${l}${u("/",e(o))}/${h}`,browsetemplate:({domain:r,project:a,committish:l})=>`https://${r}/${a}${u("/",e(l))}`,browsetreetemplate:({domain:r,project:a,committish:l,path:o,hashformat:h})=>`https://${r}/${a}${u("/",e(l))}${u("#",h(o))}`,browseblobtemplate:({domain:r,project:a,committish:l,path:o,hashformat:h})=>`https://${r}/${a}${u("/",e(l))}${u("#",h(o))}`,docstemplate:({domain:r,project:a,committish:l})=>`https://${r}/${a}${u("/",e(l))}`,httpstemplate:({domain:r,project:a,committish:l})=>`git+https://${r}/${a}.git${u("#",l)}`,filetemplate:({user:r,project:a,committish:l,path:o})=>`https://gist.githubusercontent.com/${r}/${a}/raw${u("/",e(l))}/${o}`,shortcuttemplate:({type:r,project:a,committish:l})=>`${r}:${a}${u("#",l)}`,pathtemplate:({project:r,committish:a})=>`${r}${u("#",a)}`,bugstemplate:({domain:r,project:a})=>`https://${r}/${a}`,gittemplate:({domain:r,project:a,committish:l})=>`git://${r}/${a}.git${u("#",l)}`,tarballtemplate:({project:r,committish:a})=>`https://codeload.github.com/gist/${r}/tar.gz/${e(a||"HEAD")}`,extract:r=>{let[,a,l,o]=r.pathname.split("/",4);if(o!=="raw"){if(!l){if(!a)return;l=a,a=null}return l.endsWith(".git")&&(l=l.slice(0,-4)),{user:a,project:l,committish:r.hash.slice(1)}}},hashformat:function(r){return r&&"file-"+t(r)}},s.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:r,user:a,project:l,committish:o,path:h})=>`https://${r}/${a}/${l}/blob/${e(o)||"HEAD"}/${h}`,httpstemplate:({domain:r,user:a,project:l,committish:o})=>`https://${r}/${a}/${l}${u("#",o)}`,tarballtemplate:({domain:r,user:a,project:l,committish:o})=>`https://${r}/${a}/${l}/archive/${e(o)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:r=>{let[,a,l,o]=r.pathname.split("/",4);if(!["archive"].includes(o)&&(l&&l.endsWith(".git")&&(l=l.slice(0,-4)),!(!a||!l)))return{user:a,project:l,committish:r.hash.slice(1)}}};for(const[r,a]of Object.entries(s))s[r]=Object.assign({},n,a);return Y=s,Y}var q,de;function Fe(){if(de)return q;de=1;const u=(s,r,a)=>{const l=s.indexOf(a);return s.lastIndexOf(r,l>-1?l:1/0)},e=s=>{try{return new URL(s)}catch{}},t=(s,r)=>{const a=s.indexOf(":"),l=s.slice(0,a+1);if(Object.prototype.hasOwnProperty.call(r,l)||s.substr(a,3)==="://")return s;const o=s.indexOf("@");return o>-1?o>a?`git+ssh://${s}`:s:`${s.slice(0,a+1)}//${s.slice(a+1)}`},n=s=>{const r=u(s,"@","#"),a=u(s,":","#");return a>r&&(s=s.slice(0,a)+"/"+s.slice(a+1)),u(s,":","#")===-1&&s.indexOf("//")===-1&&(s=`git+ssh://${s}`),s};return q=(s,r)=>{const a=r?t(s,r):s;return e(a)||e(n(a))},q}var V,me;function Tt(){if(me)return V;me=1;const u=Fe(),e=t=>{const n=t.indexOf("#"),s=t.indexOf("/"),r=t.indexOf("/",s+1),a=t.indexOf(":"),l=/\s/.exec(t),o=t.indexOf("@"),h=!l||n>-1&&l.index>n,f=o===-1||n>-1&&o>n,S=a===-1||n>-1&&a>n,b=r===-1||n>-1&&r>n,v=s>0,C=n>-1?t[n-1]!=="/":!t.endsWith("/"),m=!t.startsWith(".");return h&&v&&C&&m&&f&&S&&b};return V=(t,n,{gitHosts:s,protocols:r})=>{if(!t)return;const a=e(t)?`github:${t}`:t,l=u(a,r);if(!l)return;const o=s.byShortcut[l.protocol],h=s.byDomain[l.hostname.startsWith("www.")?l.hostname.slice(4):l.hostname],f=o||h;if(!f)return;const S=s[o||h];let b=null;r[l.protocol]?.auth&&(l.username||l.password)&&(b=`${l.username}${l.password?":"+l.password:""}`);let v=null,C=null,m=null,g=null;try{if(o){let c=l.pathname.startsWith("/")?l.pathname.slice(1):l.pathname;const L=c.indexOf("@");L>-1&&(c=c.slice(L+1));const y=c.lastIndexOf("/");y>-1?(C=decodeURIComponent(c.slice(0,y)),C||(C=null),m=decodeURIComponent(c.slice(y+1))):m=decodeURIComponent(c),m.endsWith(".git")&&(m=m.slice(0,-4)),l.hash&&(v=decodeURIComponent(l.hash.slice(1))),g="shortcut"}else{if(!S.protocols.includes(l.protocol))return;const c=S.extract(l);if(!c)return;C=c.user&&decodeURIComponent(c.user),m=decodeURIComponent(c.project),v=decodeURIComponent(c.committish),g=r[l.protocol]?.name||l.protocol.slice(0,-1)}}catch(c){if(c instanceof URIError)return;throw c}return[f,C,b,m,v,g,n]},V}var K,Le;function Ut(){if(Le)return K;Le=1;const{LRUCache:u}=Rt,e=It(),t=Tt(),n=Fe(),s=new u({max:1e3});function r(l){try{const{protocol:o,hostname:h,pathname:f}=new URL(l);if(!h)return null;const S=/(?:git\+)http:$/.test(o)?"http:":"https:",b=f.replace(/\.git$/,"");return`${S}//${h}${b}`}catch{return null}}class a{constructor(o,h,f,S,b,v,C={}){Object.assign(this,a.#n[o],{type:o,user:h,auth:f,project:S,committish:b,default:v,opts:C})}static#n={byShortcut:{},byDomain:{}};static#c={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(o,h){a.#n[o]=h,a.#n.byDomain[h.domain]=o,a.#n.byShortcut[`${o}:`]=o,a.#c[`${o}:`]={name:o}}static fromUrl(o,h){if(typeof o!="string")return;const f=o+JSON.stringify(h||{});if(!s.has(f)){const S=t(o,h,{gitHosts:a.#n,protocols:a.#c});s.set(f,S?new a(...S):void 0)}return s.get(f)}static fromManifest(o,h={}){if(!o||typeof o!="object")return;const f=o.repository,S=f&&(typeof f=="string"?f:typeof f=="object"&&typeof f.url=="string"?f.url:null);if(!S)throw new Error("no repository");const b=S&&a.fromUrl(S.replace(/^git\+/,""),h)||null;if(b)return b;const v=r(S);return a.fromUrl(v,h)||v}static parseUrl(o){return n(o)}#t(o,h){if(typeof o!="function")return null;const f={...this,...this.opts,...h};f.path||(f.path=""),f.path.startsWith("/")&&(f.path=f.path.slice(1)),f.noCommittish&&(f.committish=null);const S=o(f);return f.noGitPlus&&S.startsWith("git+")?S.slice(4):S}hash(){return this.committish?`#${this.committish}`:""}ssh(o){return this.#t(this.sshtemplate,o)}sshurl(o){return this.#t(this.sshurltemplate,o)}browse(o,...h){return typeof o!="string"?this.#t(this.browsetemplate,o):typeof h[0]!="string"?this.#t(this.browsetreetemplate,{...h[0],path:o}):this.#t(this.browsetreetemplate,{...h[1],fragment:h[0],path:o})}browseFile(o,...h){return typeof h[0]!="string"?this.#t(this.browseblobtemplate,{...h[0],path:o}):this.#t(this.browseblobtemplate,{...h[1],fragment:h[0],path:o})}docs(o){return this.#t(this.docstemplate,o)}bugs(o){return this.#t(this.bugstemplate,o)}https(o){return this.#t(this.httpstemplate,o)}git(o){return this.#t(this.gittemplate,o)}shortcut(o){return this.#t(this.shortcuttemplate,o)}path(o){return this.#t(this.pathtemplate,o)}tarball(o){return this.#t(this.tarballtemplate,{...o,noCommittish:!1})}file(o,h){return this.#t(this.filetemplate,{...h,path:o})}edit(o,h){return this.#t(this.edittemplate,{...h,path:o})}getDefaultRepresentation(){return this.default}toString(o){return this.default&&typeof this[this.default]=="function"?this[this.default](o):this.sshurl(o)}}for(const[l,o]of Object.entries(e))a.addHost(l,o);return K=a,K}var X,ge;function Mt(){if(ge)return X;ge=1,X=u;function u(e){if(!e||e==="ERROR: No README data found!")return;e=e.trim().split(`
|
|
2
2
|
`);let t=0;for(;e[t]&&e[t].trim().match(/^(#|$)/);)t++;const n=e.length;let s=t+1;for(;s<n&&e[s].trim();)s++;return e.slice(t,s).join(" ").trim()}return X}var Ge={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"},$e={web:"url",name:"url"},Be={server:"start",tests:"test"};const kt={topLevel:Ge,bugs:$e,script:Be},_t=Object.defineProperty({__proto__:null,bugs:$e,default:kt,script:Be,topLevel:Ge},Symbol.toStringTag,{value:"Module"}),Wt=ie(_t);var J,Se;function Ht(){if(Se)return J;Se=1;var{URL:u}=Pe,e=vt(),t=Ct(),n=Et(),s=Ut(),{isBuiltin:r}=ye,a=["dependencies","devDependencies","optionalDependencies"],l=Mt(),o=Wt,h=i=>i.includes("@")&&i.indexOf("@")<i.lastIndexOf(".");J={warn:function(){},fixRepositoryField:function(i){if(i.repositories&&(this.warn("repositories"),i.repository=i.repositories[0]),!i.repository)return this.warn("missingRepository");typeof i.repository=="string"&&(i.repository={type:"git",url:i.repository});var p=i.repository.url||"";if(p){var d=s.fromUrl(p);d&&(p=i.repository.url=d.getDefaultRepresentation()==="shortcut"?d.https():d.toString())}p.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",p)},fixTypos:function(i){Object.keys(o.topLevel).forEach(function(p){Object.prototype.hasOwnProperty.call(i,p)&&this.warn("typo",p,o.topLevel[p])},this)},fixScriptsField:function(i){if(i.scripts){if(typeof i.scripts!="object"){this.warn("nonObjectScripts"),delete i.scripts;return}Object.keys(i.scripts).forEach(function(p){typeof i.scripts[p]!="string"?(this.warn("nonStringScript"),delete i.scripts[p]):o.script[p]&&!i.scripts[o.script[p]]&&this.warn("typo",p,o.script[p],"scripts")},this)}},fixFilesField:function(i){var p=i.files;p&&!Array.isArray(p)?(this.warn("nonArrayFiles"),delete i.files):i.files&&(i.files=i.files.filter(function(d){return!d||typeof d!="string"?(this.warn("invalidFilename",d),!1):!0},this))},fixBinField:function(i){if(i.bin&&typeof i.bin=="string"){var p={},d;(d=i.name.match(/^@[^/]+[/](.*)$/))?p[d[1]]=i.bin:p[i.name]=i.bin,i.bin=p}},fixManField:function(i){i.man&&typeof i.man=="string"&&(i.man=[i.man])},fixBundleDependenciesField:function(i){var p="bundledDependencies",d="bundleDependencies";i[p]&&!i[d]&&(i[d]=i[p],delete i[p]),i[d]&&!Array.isArray(i[d])?(this.warn("nonArrayBundleDependencies"),delete i[d]):i[d]&&(i[d]=i[d].filter(function(P){return!P||typeof P!="string"?(this.warn("nonStringBundleDependency",P),!1):(i.dependencies||(i.dependencies={}),Object.prototype.hasOwnProperty.call(i.dependencies,P)||(this.warn("nonDependencyBundleDependency",P),i.dependencies[P]="*"),!0)},this))},fixDependencies:function(i){L(i,this.warn),g(i,this.warn),this.fixBundleDependenciesField(i),["dependencies","devDependencies"].forEach(function(p){if(p in i){if(!i[p]||typeof i[p]!="object"){this.warn("nonObjectDependencies",p),delete i[p];return}Object.keys(i[p]).forEach(function(d){var P=i[p][d];typeof P!="string"&&(this.warn("nonStringDependency",d,JSON.stringify(P)),delete i[p][d]);var D=s.fromUrl(i[p][d]);D&&(i[p][d]=D.toString())},this)}},this)},fixModulesField:function(i){i.modules&&(this.warn("deprecatedModules"),delete i.modules)},fixKeywordsField:function(i){typeof i.keywords=="string"&&(i.keywords=i.keywords.split(/,\s+/)),i.keywords&&!Array.isArray(i.keywords)?(delete i.keywords,this.warn("nonArrayKeywords")):i.keywords&&(i.keywords=i.keywords.filter(function(p){return typeof p!="string"||!p?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(i,p){var d=!p;if(!i.version)return i.version="",!0;if(!e(i.version,d))throw new Error('Invalid version: "'+i.version+'"');return i.version=t(i.version,d),!0},fixPeople:function(i){v(i,C),v(i,m)},fixNameField:function(i,p){typeof p=="boolean"?p={strict:p}:typeof p>"u"&&(p={});var d=p.strict;if(!i.name&&!d){i.name="";return}if(typeof i.name!="string")throw new Error("name field must be a string.");d||(i.name=i.name.trim()),b(i.name,d,p.allowLegacyCase),r(i.name)&&this.warn("conflictingName",i.name)},fixDescriptionField:function(i){i.description&&typeof i.description!="string"&&(this.warn("nonStringDescription"),delete i.description),i.readme&&!i.description&&(i.description=l(i.readme)),i.description===void 0&&delete i.description,i.description||this.warn("missingDescription")},fixReadmeField:function(i){i.readme||(this.warn("missingReadme"),i.readme="ERROR: No README data found!")},fixBugsField:function(i){if(!i.bugs&&i.repository&&i.repository.url){var p=s.fromUrl(i.repository.url);p&&p.bugs()&&(i.bugs={url:p.bugs()})}else if(i.bugs){if(typeof i.bugs=="string")h(i.bugs)?i.bugs={email:i.bugs}:u.canParse(i.bugs)?i.bugs={url:i.bugs}:this.warn("nonEmailUrlBugsString");else{y(i.bugs,this.warn);var d=i.bugs;i.bugs={},d.url&&(u.canParse(d.url)?i.bugs.url=d.url:this.warn("nonUrlBugsUrlField")),d.email&&(typeof d.email=="string"&&h(d.email)?i.bugs.email=d.email:this.warn("nonEmailBugsEmailField"))}!i.bugs.email&&!i.bugs.url&&(delete i.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(i){if(!i.homepage&&i.repository&&i.repository.url){var p=s.fromUrl(i.repository.url);p&&p.docs()&&(i.homepage=p.docs())}if(i.homepage){if(typeof i.homepage!="string")return this.warn("nonUrlHomepage"),delete i.homepage;u.canParse(i.homepage)||(i.homepage="http://"+i.homepage)}},fixLicenseField:function(i){const p=i.license||i.licence;if(!p)return this.warn("missingLicense");if(typeof p!="string"||p.length<1||p.trim()==="")return this.warn("invalidLicense");if(!n(p).validForNewPackages)return this.warn("invalidLicense")}};function f(i){if(i.charAt(0)!=="@")return!1;var p=i.slice(1).split("/");return p.length!==2?!1:p[0]&&p[1]&&p[0]===encodeURIComponent(p[0])&&p[1]===encodeURIComponent(p[1])}function S(i){return!i.match(/[/@\s+%:]/)&&i===encodeURIComponent(i)}function b(i,p,d){if(i.charAt(0)==="."||!(f(i)||S(i))||p&&!d&&i!==i.toLowerCase()||i.toLowerCase()==="node_modules"||i.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(i))}function v(i,p){return i.author&&(i.author=p(i.author)),["maintainers","contributors"].forEach(function(d){Array.isArray(i[d])&&(i[d]=i[d].map(p))}),i}function C(i){if(typeof i=="string")return i;var p=i.name||"",d=i.url||i.web,P=d?" ("+d+")":"",D=i.email||i.mail,w=D?" <"+D+">":"";return p+w+P}function m(i){if(typeof i!="string")return i;var p=i.match(/^([^(<]+)/),d=i.match(/\(([^()]+)\)/),P=i.match(/<([^<>]+)>/),D={};return p&&p[0].trim()&&(D.name=p[0].trim()),P&&(D.email=P[1]),d&&(D.url=d[1]),D}function g(i){var p=i.optionalDependencies;if(p){var d=i.dependencies||{};Object.keys(p).forEach(function(P){d[P]=p[P]}),i.dependencies=d}}function c(i,p,d){if(!i)return{};if(typeof i=="string"&&(i=i.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(i))return i;d("deprecatedArrayDependencies",p);var P={};return i.filter(function(D){return typeof D=="string"}).forEach(function(D){D=D.trim().split(/(:?[@\s><=])/);var w=D.shift(),x=D.join("");x=x.trim(),x=x.replace(/^@/,""),P[w]=x}),P}function L(i,p){a.forEach(function(d){i[d]&&(i[d]=c(i[d],d,p))})}function y(i,p){i&&Object.keys(i).forEach(function(d){o.bugs[d]&&(p("typo",d,o.bugs[d],"bugs"),i[o.bugs[d]]=i[d],delete i[d])})}return J}var Re="'repositories' (plural) Not supported. Please pick one as the 'repository' field",Ie="No repository field.",Te="Probably broken git url: %s",Ue="scripts must be an object",Me="script values must be string commands",ke="Invalid 'files' member",_e="Invalid filename in 'files' list: %s",We="Invalid 'bundleDependencies' list. Must be array of package names",He="Invalid bundleDependencies member: %s",je="Non-dependency in bundleDependencies: %s",ze="%s field must be an object",Ye="Invalid dependency: %s %s",qe="specifying %s as array is deprecated",Ve="modules field is deprecated",Ke="keywords should be an array of strings",Xe="keywords should be an array of strings",Je="%s is also the name of a node core module.",Ze="'description' field should be a string",Qe="No description",et="No README data",tt="No license field.",it="Bug string field must be url, email, or {email,url}",rt="bugs.url field must be a string url. Deleted.",nt="bugs.email field must be a string email. Deleted.",st="Normalized value of bugs field is an empty object. Deleted.",ot="homepage field must be a string url. Deleted.",at="license should be a valid SPDX license expression",lt="%s should probably be %s.";const jt={repositories:Re,missingRepository:Ie,brokenGitUrl:Te,nonObjectScripts:Ue,nonStringScript:Me,nonArrayFiles:ke,invalidFilename:_e,nonArrayBundleDependencies:We,nonStringBundleDependency:He,nonDependencyBundleDependency:je,nonObjectDependencies:ze,nonStringDependency:Ye,deprecatedArrayDependencies:qe,deprecatedModules:Ve,nonArrayKeywords:Ke,nonStringKeyword:Xe,conflictingName:Je,nonStringDescription:Ze,missingDescription:Qe,missingReadme:et,missingLicense:tt,nonEmailUrlBugsString:it,nonUrlBugsUrlField:rt,nonEmailBugsEmailField:nt,emptyNormalizedBugs:st,nonUrlHomepage:ot,invalidLicense:at,typo:lt},zt=Object.defineProperty({__proto__:null,brokenGitUrl:Te,conflictingName:Je,default:jt,deprecatedArrayDependencies:qe,deprecatedModules:Ve,emptyNormalizedBugs:st,invalidFilename:_e,invalidLicense:at,missingDescription:Qe,missingLicense:tt,missingReadme:et,missingRepository:Ie,nonArrayBundleDependencies:We,nonArrayFiles:ke,nonArrayKeywords:Ke,nonDependencyBundleDependency:je,nonEmailBugsEmailField:nt,nonEmailUrlBugsString:it,nonObjectDependencies:ze,nonObjectScripts:Ue,nonStringBundleDependency:He,nonStringDependency:Ye,nonStringDescription:Ze,nonStringKeyword:Xe,nonStringScript:Me,nonUrlBugsUrlField:rt,nonUrlHomepage:ot,repositories:Re,typo:lt},Symbol.toStringTag,{value:"Module"}),Yt=ie(zt);var Z,ve;function qt(){if(ve)return Z;ve=1;var u=Pt,e=Yt;Z=function(){var n=Array.prototype.slice.call(arguments,0),s=n.shift();if(s==="typo")return t.apply(null,n);var r=e[s]?e[s]:s+": '%s'";return n.unshift(r),u.format.apply(null,n)};function t(n,s,r){return r&&(n=r+"['"+n+"']",s=r+"['"+s+"']"),u.format(e.typo,n,s)}return Z}var Q,Ce;function Vt(){if(Ce)return Q;Ce=1,Q=r;var u=Ht();r.fixer=u;var e=qt(),t=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],n=["dependencies","people","typos"],s=t.map(function(l){return a(l)+"Field"});s=s.concat(n);function r(l,o,h){o===!0&&(o=null,h=!0),h||(h=!1),(!o||l.private)&&(o=function(){}),l.scripts&&l.scripts.install==="node-gyp rebuild"&&!l.scripts.preinstall&&(l.gypfile=!0),u.warn=function(){o(e.apply(null,arguments))},s.forEach(function(f){u["fix"+a(f)](l,h)}),l._id=l.name+"@"+l.version}function a(l){return l.charAt(0).toUpperCase()+l.slice(1)}return Q}var Kt=Vt();const Xt=St(Kt),Jt=(u,e,t)=>{const n=ee(u),s=ee(e),r=s===n?".":mt(n,s);return t.some(a=>{const l=a.startsWith("./")?a.slice(2):a,o=r.startsWith("./")?r.slice(2):r;if(l==="."&&o===".")return!0;if(l.endsWith("/**")){const h=l.slice(0,-3);return o===h||o.startsWith(`${h}/`)}if(l.endsWith("/*")){const h=l.slice(0,-2);return h===""?o!=="."&&!o.includes("/"):o.startsWith(`${h}/`)||o===h}return o===l||o.startsWith(`${l}/`)})},Zt=u=>{const e=be("pnpm-workspace.yaml",{cwd:ee(u),type:"file"});if(!e)return;const t=De(te(e)),n=Array.isArray(t.packages)?t.packages:[];if(!Jt(e,u,n))return;const s={};return t.catalog&&typeof t.catalog=="object"&&(s.catalog=t.catalog),t.catalogs&&typeof t.catalogs=="object"&&(s.catalogs=t.catalogs),Object.keys(s).length>0?s:void 0},Qt=(u,e,t)=>{if(e==="catalog:")return t.catalog?.[u];if(e.startsWith("catalog:")){const n=e.slice(8);return t.catalogs?.[n]?.[u]}},ei=(u,e)=>{for(const[t,n]of Object.entries(u)){if(typeof n!="string")continue;const s=Qt(t,n,e);s&&(u[t]=s)}},ti=(u,e)=>{const t=["dependencies","devDependencies","peerDependencies","optionalDependencies"];for(const n of t){if(!u[n]||typeof u[n]!="object")continue;const s=u[n];ei(s,e)}};let ii;const ri=u=>(ii??=dt(import.meta.url))(u),G=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,re=u=>{if(typeof G<"u"&&G.versions&&G.versions.node){const[e,t]=G.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return G.getBuiltinModule(u)}return ri(u)},{existsSync:Ri}=re("node:fs"),{createInterface:Ii}=re("node:readline"),{styleText:Ti}=re("node:util"),ni=new Set(["__proto__","prototype","constructor"]);Math.max(...[...ni].map(u=>u.length));typeof process.stdout<"u"&&globalThis.window;const si=/, ([^,]*)$/,oi=new Map,ai=(u,e={})=>{const t=e.strict&&e.ignoreWarnings?e.ignoreWarnings.map(String).toSorted((n,s)=>n.localeCompare(s)).join(","):"";return`${u}|s${String(e.strict?1:0)}|c${String(e.resolveCatalogs?1:0)}|j${String(e.json5===!1?0:1)}|y${String(e.yaml===!1?0:1)}|w${t}`};class li extends Error{constructor(e){super(`The following warnings were encountered while normalizing package data:
|
|
3
3
|
- ${e.join(`
|
|
4
|
-
- `)}`),this.name="PackageJsonValidationError"}}const ci=(u,e,t=[])=>{const n=[];if(Xt(u,s=>{n.push(s)},e),e&&n.length>0){const s=n.filter(r=>!t.some(a=>a instanceof RegExp?a.test(r):a===r));if(s.length>0)throw new li(s)}return u},hi=u=>{const e=te(u);return De(e)},ui=u=>{const e=te(u);return gt.parse(e)},pi=(u,e)=>e?.yaml!==!1&&(u.endsWith(".yaml")||u.endsWith(".yml"))?hi(u):e?.json5!==!1&&u.endsWith(".json5")?ui(u):yt(u),fi=(u,e={})=>{const t={type:"file"};u&&(t.cwd=u);const n=["package.json"];e.yaml!==!1&&n.push("package.yaml","package.yml"),e.json5!==!1&&n.push("package.json5");const s=be(n,t);if(!s)throw new Lt(`No such file or directory, for ${n.join(", ").replace(si," or $1")} found.`);const r=e.cache&&typeof e.cache!="boolean"?e.cache:oi,a=ai(s,e);if(e.cache&&r.has(a))return r.get(a);const l=pi(s,e);if(e.resolveCatalogs){const h=Zt(s);h&&ti(l,h)}ci(l,e.strict??!1,e.ignoreWarnings);const o={packageJson:l,path:s};return e.cache&&r.set(a,o),o};var di="6.0.
|
|
4
|
+
- `)}`),this.name="PackageJsonValidationError"}}const ci=(u,e,t=[])=>{const n=[];if(Xt(u,s=>{n.push(s)},e),e&&n.length>0){const s=n.filter(r=>!t.some(a=>a instanceof RegExp?a.test(r):a===r));if(s.length>0)throw new li(s)}return u},hi=u=>{const e=te(u);return De(e)},ui=u=>{const e=te(u);return gt.parse(e)},pi=(u,e)=>e?.yaml!==!1&&(u.endsWith(".yaml")||u.endsWith(".yml"))?hi(u):e?.json5!==!1&&u.endsWith(".json5")?ui(u):yt(u),fi=(u,e={})=>{const t={type:"file"};u&&(t.cwd=u);const n=["package.json"];e.yaml!==!1&&n.push("package.yaml","package.yml"),e.json5!==!1&&n.push("package.json5");const s=be(n,t);if(!s)throw new Lt(`No such file or directory, for ${n.join(", ").replace(si," or $1")} found.`);const r=e.cache&&typeof e.cache!="boolean"?e.cache:oi,a=ai(s,e);if(e.cache&&r.has(a))return r.get(a);const l=pi(s,e);if(e.resolveCatalogs){const h=Zt(s);h&&ti(l,h)}ci(l,e.strict??!1,e.ignoreWarnings);const o={packageJson:l,path:s};return e.cache&&r.set(a,o),o};var di="6.0.1";const mi={version:di},Li=mi.version,gi="@visulima/vis";let E;const Ui=()=>{if(E!==void 0)return E;const u=process.env.VIS_VERSION;if(u)return E=u,E;try{const{packageJson:e}=fi(pt(ft(import.meta.url)),{json5:!1,yaml:!1});if(e.name===gi&&typeof e.version=="string")return E=e.version,E}catch{}return E=Li,E};export{$i as P,Ei as a,Ni as b,Ai as c,Ui as g,Oi as i,wi as n,Fi as p,Di as r,xi as t,Gi as u};
|
package/dist/packem_shared/{project-name-filter-DIqpdsvP.js → project-name-filter-B1ZCsbOW.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as p}from"node:module";import{V as l}from"./vis-user-error-
|
|
1
|
+
import{createRequire as p}from"node:module";import{V as l}from"./vis-user-error-CRmrBaD1.js";let g;const m=e=>(g??=p(import.meta.url))(e),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[s,n]=c.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return c.getBuiltinModule(e)}return m(e)},{createInterface:j}=h("node:readline"),y=e=>{const s=new Set;for(const n of Object.values(e.projects))for(const t of Object.keys(n.targets??{}))s.add(t);return[...s].sort()},b=e=>{const s=new Map;for(const n of e.values())for(const[t,o]of Object.entries(n))for(const r of o.aliases??[])s.has(r)||s.set(r,t);return s},$=(e,s)=>s.get(e)??e,w=(e,s)=>{if(e.length===0)return s.length;if(s.length===0)return e.length;const n=[];for(let t=0;t<=s.length;t++)n[t]=[t];for(let t=0;t<=e.length;t++)n[0][t]=t;for(let t=1;t<=s.length;t++)for(let o=1;o<=e.length;o++){const r=s[t-1]===e[o-1]?0:1;n[t][o]=Math.min(n[t-1][o]+1,n[t][o-1]+1,n[t-1][o-1]+r)}return n[s.length][e.length]},v=(e,s,n=3)=>f(e,s,1,n)[0],f=(e,s,n=3,t=3)=>{const o=[];for(const r of s){const i=w(e.toLowerCase(),r.toLowerCase());i<=t&&o.push({distance:i,name:r})}return o.sort((r,i)=>r.distance-i.distance||r.name.localeCompare(i.name)),o.slice(0,n).map(r=>r.name)},M=e=>e.length===0?" (no targets found)":e.map(s=>` - ${s}`).join(`
|
|
2
2
|
`),S=async e=>{if(e.length===0||!process.stdin.isTTY||!process.stdout.isTTY)return;const s=j({input:process.stdin,output:process.stdout});try{process.stdout.write(`Available targets:
|
|
3
3
|
`);for(const[r,i]of e.entries())process.stdout.write(` ${String(r+1).padStart(2," ")}. ${i}
|
|
4
4
|
`);process.stdout.write(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as h,z as M}from"./index-BzhrR_iC.js";import{whichBin as b}from"#native";import{d as P}from"./env-consistency-B4rU4MQb.js";import{p as N}from"./readJsonSync-CbryXYxN-EWl7_7KX.js";import{y as x}from"./isAccessibleSync-DYKTrrvc-C-_5cgwu.js";const y=o=>{for(const n of[".nvmrc",".node-version"]){const i=h(o,n);if(x(i))try{return M(i).trim().replace(/^v/,"")}catch{}}},f=(o,n)=>{const i=o.split(/[.\-+]/).map(s=>Number.parseInt(s,10)||0),t=n.split(/[.\-+]/).map(s=>Number.parseInt(s,10)||0),e=Math.max(i.length,t.length);for(let s=0;s<e;s++){const r=i[s]??0,c=t[s]??0;if(r!==c)return r-c}return 0},k=(o,n)=>{const i=n.trim();if(i===""||i==="*")return!0;const t=i.split(/\s+/).filter(Boolean);for(const e of t)if(e.startsWith(">=")){if(f(o,e.slice(2).trim())<0)return!1}else if(e.startsWith("<=")){if(f(o,e.slice(2).trim())>0)return!1}else if(e.startsWith(">")){if(f(o,e.slice(1).trim())<=0)return!1}else if(e.startsWith("<")){if(f(o,e.slice(1).trim())>=0)return!1}else if(/^\d/.test(e)){const s=o.split("."),r=e.split(".");for(const[c,g]of r.entries())if(g!==s[c])return!1}return!0},v=(o,n,i,t)=>{const s=P(o).filter(u=>u.name===n&&typeof u.version=="string");if(s.some(u=>k(i,u.version)))return;const r=s.at(-1);if(!r?.version)return;const c=r.onFail??"warn";if(c==="ignore")return;const g=c==="download"?" vis does not install runtimes; install it yourself.":"";return{actual:i,expected:r.version,kind:t,message:`devEngines.${t==="node"?"runtime":"packageManager"} requires ${r.name??n}@${r.version}, but the current ${n} is ${i}.${g}`,severity:c==="error"?"error":"warning"}},I=o=>{const n=[],i=h(o,"package.json");let t;try{t=N(i)}catch{return n}const e=process.versions.node,{devEngines:s}=t,[r="",c=""]=(process.env.npm_config_user_agent??"").split(" ")[0]?.split("/")??[];if(t.engines?.node){const a=t.engines.node;k(e,a)||n.push({actual:e,expected:a,kind:"node",message:`package.json engines.node requires ${a}, but the current Node.js is ${e}.`,severity:"error"})}const g=v(s?.runtime,"node",e,"node");g&&n.push(g);const u=y(o);if(u){const[a,p]=u.split("."),[m,l]=e.split(".");(a!==m||p!==void 0&&p!==l)&&n.push({actual:e,expected:u,kind:"node",message:`.nvmrc pins Node ${u} but the current Node.js is ${e}. Run \`nvm use\` or switch runtimes.`,severity:"warning"})}if(t.packageManager){const[a,p]=t.packageManager.split("@"),m=r?`${r}/${c}`:"",l=r,d=c,$=a==="aube"&&b("aube")!==null;l&&a&&l!==a?n.push({actual:l,expected:a,kind:"packageManager",message:`package.json packageManager pins ${t.packageManager} but the current invocation is ${m}. Install the correct package manager.`,severity:$?"warning":"error"}):d&&p&&d!==p&&n.push({actual:d,expected:p,kind:"packageManager",message:`package.json packageManager pins ${a}@${p} but the current invocation uses ${a}@${d}.`,severity:"warning"})}if(!t.packageManager&&r&&c){const a=v(s?.packageManager,r,c,"packageManager");a&&n.push(a)}return n};export{I as c};
|