@visulima/vis 1.0.0-alpha.16 → 1.0.0-alpha.18
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 +50 -0
- package/README.md +66 -26
- package/dist/config/index.d.ts +125 -2
- package/dist/packem_chunks/bin.js +255 -251
- package/dist/packem_chunks/doctor-probe.js +2 -2
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler20.js +2 -2
- package/dist/packem_chunks/handler22.js +1 -1
- package/dist/packem_chunks/handler37.js +1 -1
- package/dist/packem_chunks/handler38.js +3 -3
- package/dist/packem_chunks/handler39.js +6 -6
- package/dist/packem_chunks/handler40.js +1 -1
- package/dist/packem_chunks/handler42.js +6 -6
- package/dist/packem_chunks/handler44.js +2 -2
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler47.js +44 -44
- package/dist/packem_chunks/handler48.js +22 -22
- package/dist/packem_chunks/index.js +1 -1
- package/dist/packem_shared/{docker-Dl0AoVTZ.js → docker-Cw5IT5Ow.js} +26 -26
- package/dist/packem_shared/flakiness-DUtrm-wS.js +1 -0
- package/dist/packem_shared/lifecycle-C7vfQmA3.js +2 -0
- package/index.js +729 -556
- package/package.json +12 -12
- package/schemas/vis-config.schema.json +85 -1
- package/dist/packem_shared/flakiness-Dzz-I3dB.js +0 -1
- package/dist/packem_shared/lifecycle-BC6Nst6i.js +0 -2
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var jr=Object.defineProperty;var k=(e,t)=>jr(e,"name",{value:t,configurable:!0});import{createRequire as
|
|
1
|
+
var jr=Object.defineProperty;var k=(e,t)=>jr(e,"name",{value:t,configurable:!0});import{createRequire as Fr}from"node:module";import{a8 as yr,u as Br,aX as Ur,aJ as qr,aK as Wr,aL as Yt,A as Kr,p as z,x as Xr,s as zr}from"./bin.js";import{M as Te,a as Gt,$ as Xe,B as Ue,n as vr,C as Jr}from"./config.js";import{render as Vr}from"@visulima/tui";import Yr from"module-replacements/manifests/micro-utilities.json"with{type:"json"};import Zr from"module-replacements/manifests/native.json"with{type:"json"};import en from"module-replacements/manifests/preferred.json"with{type:"json"};import tn,{useSyncExternalStore as rn,useRef as nn,useState as Zt,useCallback as on}from"react";import{jsx as R,jsxs as M,Fragment as it}from"react/jsx-runtime";import{Box as G}from"@visulima/tui/components/box";import{Text as P}from"@visulima/tui/components/text";import{useApp as sn}from"@visulima/tui/hooks/use-app";import{useInput as an}from"@visulima/tui/hooks/use-input";import{useWindowSize as cn}from"@visulima/tui/hooks/use-window-size";import{ScrollView as ln}from"@visulima/tui/components/scroll-view";import{ScrollBar as un}from"@visulima/tui/components/scroll-bar";import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
|
|
2
2
|
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
3
|
-
const Fr=Mr(import.meta.url),Ge=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,mr=k(e=>{if(typeof Ge<"u"&&Ge.versions&&Ge.versions.node){const[t,r]=Ge.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ge.getBuiltinModule(e)}return Fr(e)},"__cjs_getBuiltinModule"),{writeFileSync:Gr}=mr("node:fs"),{createRequire:Qr}=mr("node:module");var pn=Object.defineProperty,Ie=k((e,t)=>pn(e,"name",{value:t,configurable:!0}),"r$2"),fn=Object.defineProperty,je=Ie((e,t)=>fn(e,"name",{value:t,configurable:!0}),"r"),hn=Object.defineProperty,He=je((e,t)=>hn(e,"name",{value:t,configurable:!0}),"t");function at(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}k(at,"p$1");Ie(at,"f");je(at,"getDefaultExportFromCjs");He(at,"getDefaultExportFromCjs");function Bt(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}k(Bt,"f$1");Ie(Bt,"l");je(Bt,"getDefaultExportFromNamespaceIfPresent");He(Bt,"getDefaultExportFromNamespaceIfPresent");function Ut(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}k(Ut,"l$1");Ie(Ut,"s");je(Ut,"getDefaultExportFromNamespaceIfNotNamed");He(Ut,"getDefaultExportFromNamespaceIfNotNamed");function qt(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=He(je(Ie(k(function n(){var s=!1;try{s=this instanceof n}catch{}return s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)},"u"),"n"),"a"),"a");r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:He(function(){return e[n]},"get")})}),r}k(qt,"s$1");Ie(qt,"m");je(qt,"getAugmentedNamespace");He(qt,"getAugmentedNamespace");var dn=Object.defineProperty,we=k((e,t)=>dn(e,"name",{value:t,configurable:!0}),"lt$1"),gn=Object.defineProperty,de=we((e,t)=>gn(e,"name",{value:t,configurable:!0}),"ut"),er={},Tt,tr;function Me(){if(tr)return Tt;tr=1;const e="[^\\\\/]",t=Symbol("unignore"),r="\\.",n="\\+",s="\\?",i="\\/",a="(?=.)",f="[^/]",l=`(?:${i}|$)`,g=`(?:^|${i})`,y=`${r}{1,2}${l}`,h=`(?!${r})`,v=`(?!${g}${y})`,m=`(?!${r}{0,1}${l})`,_=`(?!${y})`,A=`[^.${i}]`,b=`${f}*?`,q="/",H={DOT_LITERAL:r,PLUS_LITERAL:n,QMARK_LITERAL:s,SLASH_LITERAL:i,ONE_CHAR:a,QMARK:f,END_ANCHOR:l,DOTS_SLASH:y,NO_DOT:h,NO_DOTS:v,NO_DOT_SLASH:m,NO_DOTS_SLASH:_,QMARK_NO_DOT:A,STAR:b,START_ANCHOR:g,SEP:q},W={...H,SLASH_LITERAL:"[\\\\/]",QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${r}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[\\\\/])${r}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},d={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return Tt={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:d,UNIGNORE:t,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(E){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${E.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(E){return E===!0?W:H}},Tt}k(Me,"_t$1");we(Me,"bt");de(Me,"requireConstants");var rr;function Fe(){return rr||(rr=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:s}=Me();e.isObject=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),e.hasRegexChars=i=>n.test(i),e.isRegexChar=i=>i.length===1&&e.hasRegexChars(i),e.escapeRegex=i=>i.replace(s,"\\$1"),e.toPosixSlashes=i=>i.replace(t,"/"),e.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const i=navigator.platform.toLowerCase();return i==="win32"||i==="windows"}return process.platform?process.platform==="win32":!1},e.removeBackslashes=i=>i.replace(r,a=>a==="\\"?"":a),e.escapeLast=(i,a,f)=>{const l=i.lastIndexOf(a,f);return l===-1?i:i[l-1]==="\\"?e.escapeLast(i,a,l-1):`${i.slice(0,l)}\\${i.slice(l)}`},e.removePrefix=(i,a={})=>{let f=i;return f.startsWith("./")&&(f=f.slice(2),a.prefix="./"),f},e.wrapOutput=(i,a={},f={})=>{const l=f.contains?"":"^",g=f.contains?"":"$";let y=`${l}(?:${i})${g}`;return a.negated===!0&&(y=`(?:^(?!${y}).*$)`),y},e.basename=(i,{windows:a}={})=>{const f=i.split(a?/[\\/]/:"/"),l=f[f.length-1];return l===""?f[f.length-2]:l}})(er)),er}k(Fe,"Et$1");we(Fe,"yt");de(Fe,"requireUtils");var Nt,nr;function Wt(){if(nr)return Nt;nr=1;var e=Object.defineProperty,t=de((d,E)=>e(d,"name",{value:E,configurable:!0}),"k");const r=Fe(),{CHAR_ASTERISK:n,CHAR_AT:s,CHAR_BACKWARD_SLASH:i,CHAR_COMMA:a,CHAR_DOT:f,CHAR_EXCLAMATION_MARK:l,CHAR_FORWARD_SLASH:g,CHAR_LEFT_CURLY_BRACE:y,CHAR_LEFT_PARENTHESES:h,CHAR_LEFT_SQUARE_BRACKET:v,CHAR_PLUS:m,CHAR_QUESTION_MARK:_,CHAR_RIGHT_CURLY_BRACE:A,CHAR_RIGHT_PARENTHESES:b,CHAR_RIGHT_SQUARE_BRACKET:q}=Me(),H=t(d=>d===g||d===i,"isPathSeparator"),W=t(d=>{d.isPrefix!==!0&&(d.depth=d.isGlobstar?1/0:1)},"depth");return Nt=t((d,E)=>{const o=E||{},S=d.length-1,T=o.parts===!0||o.scanToEnd===!0,C=[],w=[],N=[];let j=d,J=-1,V=0,ge=0,ae=!1,me=!1,Z=!1,ke=!1,Re=!1,ye=!1,Q=!1,ve=!1,Ce=!1,ce=!1,se=0,ue,I,U={value:"",depth:0,isGlob:!1};const p=t(()=>J>=S,"eos"),le=t(()=>j.charCodeAt(J+1),"peek"),ne=t(()=>(ue=I,j.charCodeAt(++J)),"advance");for(;J<S;){I=ne();let K;if(I===i){Q=U.backslashes=!0,I=ne(),I===y&&(ye=!0);continue}if(ye===!0||I===y){for(se++;p()!==!0&&(I=ne());){if(I===i){Q=U.backslashes=!0,ne();continue}if(I===y){se++;continue}if(ye!==!0&&I===f&&(I=ne())===f){if(ae=U.isBrace=!0,Z=U.isGlob=!0,ce=!0,T===!0)continue;break}if(ye!==!0&&I===a){if(ae=U.isBrace=!0,Z=U.isGlob=!0,ce=!0,T===!0)continue;break}if(I===A&&(se--,se===0)){ye=!1,ae=U.isBrace=!0,ce=!0;break}}if(T===!0)continue;break}if(I===g){if(C.push(J),w.push(U),U={value:"",depth:0,isGlob:!1},ce===!0)continue;if(ue===f&&J===V+1){V+=2;continue}ge=J+1;continue}if(o.noext!==!0&&(I===m||I===s||I===n||I===_||I===l)&&le()===h){if(Z=U.isGlob=!0,ke=U.isExtglob=!0,ce=!0,I===l&&J===V&&(Ce=!0),T===!0){for(;p()!==!0&&(I=ne());){if(I===i){Q=U.backslashes=!0,I=ne();continue}if(I===b){Z=U.isGlob=!0,ce=!0;break}}continue}break}if(I===n){if(ue===n&&(Re=U.isGlobstar=!0),Z=U.isGlob=!0,ce=!0,T===!0)continue;break}if(I===_){if(Z=U.isGlob=!0,ce=!0,T===!0)continue;break}if(I===v){for(;p()!==!0&&(K=ne());){if(K===i){Q=U.backslashes=!0,ne();continue}if(K===q){me=U.isBracket=!0,Z=U.isGlob=!0,ce=!0;break}}if(T===!0)continue;break}if(o.nonegate!==!0&&I===l&&J===V){ve=U.negated=!0,V++;continue}if(o.noparen!==!0&&I===h){if(Z=U.isGlob=!0,T===!0){for(;p()!==!0&&(I=ne());){if(I===h){Q=U.backslashes=!0,I=ne();continue}if(I===b){ce=!0;break}}continue}break}if(Z===!0){if(ce=!0,T===!0)continue;break}}o.noext===!0&&(ke=!1,Z=!1);let re=j,c="",u="";V>0&&(c=j.slice(0,V),j=j.slice(V),ge-=V),re&&Z===!0&&ge>0?(re=j.slice(0,ge),u=j.slice(ge)):Z===!0?(re="",u=j):re=j,re&&re!==""&&re!=="/"&&re!==j&&H(re.charCodeAt(re.length-1))&&(re=re.slice(0,-1)),o.unescape===!0&&(u&&(u=r.removeBackslashes(u)),re&&Q===!0&&(re=r.removeBackslashes(re)));const fe={prefix:c,input:d,start:V,base:re,glob:u,isBrace:ae,isBracket:me,isGlob:Z,isExtglob:ke,isGlobstar:Re,negated:ve,negatedExtglob:Ce};if(o.tokens===!0&&(fe.maxDepth=0,H(I)||w.push(U),fe.tokens=w),o.parts===!0||o.tokens===!0){let K;for(let ee=0;ee<C.length;ee++){const xe=K?K+1:V,pe=C[ee],_e=d.slice(xe,pe);o.tokens&&(ee===0&&V!==0?(w[ee].isPrefix=!0,w[ee].value=c):w[ee].value=_e,W(w[ee]),fe.maxDepth+=w[ee].depth),(ee!==0||_e!=="")&&N.push(_e),K=pe}if(K&&K+1<d.length){const ee=d.slice(K+1);N.push(ee),o.tokens&&(w[w.length-1].value=ee,W(w[w.length-1]),fe.maxDepth+=w[w.length-1].depth)}fe.slashes=C,fe.parts=N}return fe},"scan"),Nt}k(Wt,"Nt$1");we(Wt,"wt");de(Wt,"requireScan");var Dt,or;function Kt(){if(or)return Dt;or=1;var e=Object.defineProperty,t=de((d,E)=>e(d,"name",{value:E,configurable:!0}),"y");const r=Me(),n=Fe(),{MAX_LENGTH:s,POSIX_REGEX_SOURCE:i,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:f,REPLACEMENTS:l}=r,g=t((d,E)=>typeof E.expandRange=="function"?E.expandRange(...d,E):(d.sort(),`[${d.join("-")}]`),"expandRange"),y=t((d,E)=>`Missing ${d}: "${E}" - use "\\\\${E}" to match literal characters`,"syntaxError"),h=t(d=>{const E=[];let o=0,S=0,T=0,C="",w=!1;for(const N of d){if(w===!0){C+=N,w=!1;continue}if(N==="\\"){C+=N,w=!0;continue}if(N==='"'){T=T===1?0:1,C+=N;continue}if(T===0){if(N==="[")o++;else if(N==="]"&&o>0)o--;else if(o===0){if(N==="(")S++;else if(N===")"&&S>0)S--;else if(N==="|"&&S===0){E.push(C),C="";continue}}}C+=N}return E.push(C),E},"splitTopLevel"),v=t(d=>{let E=!1;for(const o of d){if(E===!0){E=!1;continue}if(o==="\\"){E=!0;continue}if(/[?*+@!()[\]{}]/.test(o))return!1}return!0},"isPlainBranch"),m=t(d=>{let E=d.trim(),o=!0;for(;o===!0;)o=!1,/^@\([^\\()[\]{}|]+\)$/.test(E)&&(E=E.slice(2,-1),o=!0);if(v(E))return E.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),_=t(d=>{const E=d.map(m).filter(Boolean);for(let o=0;o<E.length;o++)for(let S=o+1;S<E.length;S++){const T=E[o],C=E[S],w=T[0];if(!(!w||T!==w.repeat(T.length)||C!==w.repeat(C.length))&&(T===C||T.startsWith(C)||C.startsWith(T)))return!0}return!1},"hasRepeatedCharPrefixOverlap"),A=t((d,E=!0)=>{if(d[0]!=="+"&&d[0]!=="*"||d[1]!=="(")return;let o=0,S=0,T=0,C=!1;for(let w=1;w<d.length;w++){const N=d[w];if(C===!0){C=!1;continue}if(N==="\\"){C=!0;continue}if(N==='"'){T=T===1?0:1;continue}if(T!==1){if(N==="["){o++;continue}if(N==="]"&&o>0){o--;continue}if(!(o>0)){if(N==="("){S++;continue}if(N===")"&&(S--,S===0))return E===!0&&w!==d.length-1?void 0:{type:d[0],body:d.slice(2,w),end:w}}}}},"parseRepeatedExtglob"),b=t(d=>{let E=0;const o=[];for(;E<d.length;){const S=A(d.slice(E),!1);if(!S||S.type!=="*")return;const T=h(S.body).map(w=>w.trim());if(T.length!==1)return;const C=m(T[0]);if(!C||C.length!==1)return;o.push(C),E+=S.end+1}return o.length<1?void 0:`${o.length===1?n.escapeRegex(o[0]):`[${o.map(S=>n.escapeRegex(S)).join("")}]`}*`},"getStarExtglobSequenceOutput"),q=t(d=>{let E=0,o=d.trim(),S=A(o);for(;S;)E++,o=S.body.trim(),S=A(o);return E},"repeatedExtglobRecursion"),H=t((d,E)=>{if(E.maxExtglobRecursion===!1)return{risky:!1};const o=typeof E.maxExtglobRecursion=="number"?E.maxExtglobRecursion:r.DEFAULT_MAX_EXTGLOB_RECURSION,S=h(d).map(T=>T.trim());if(S.length>1&&(S.some(T=>T==="")||S.some(T=>/^[*?]+$/.test(T))||_(S)))return{risky:!0};for(const T of S){const C=b(T);if(C)return{risky:!0,safeOutput:C};if(q(T)>o)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),W=t((d,E)=>{if(typeof d!="string")throw new TypeError("Expected a string");d=l[d]||d;const o={...E},S=typeof o.maxLength=="number"?Math.min(s,o.maxLength):s;let T=d.length;if(T>S)throw new SyntaxError(`Input length: ${T}, exceeds maximum allowed length: ${S}`);const C={type:"bos",value:"",output:o.prepend||""},w=[C],N=o.capture?"":"?:",j=r.globChars(o.windows),J=r.extglobChars(j),{DOT_LITERAL:V,PLUS_LITERAL:ge,SLASH_LITERAL:ae,ONE_CHAR:me,DOTS_SLASH:Z,NO_DOT:ke,NO_DOT_SLASH:Re,NO_DOTS_SLASH:ye,QMARK:Q,QMARK_NO_DOT:ve,STAR:Ce,START_ANCHOR:ce}=j,se=t(x=>`(${N}(?:(?!${ce}${x.dot?Z:V}).)*?)`,"globstar"),ue=o.dot?"":ke,I=o.dot?Q:ve;let U=o.bash===!0?se(o):Ce;o.capture&&(U=`(${U})`),typeof o.noext=="boolean"&&(o.noextglob=o.noext);const p={input:d,index:-1,start:0,dot:o.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:w};d=n.removePrefix(d,p),T=d.length;const le=[],ne=[],re=[];let c=C,u;const fe=t(()=>p.index===T-1,"eos"),K=p.peek=(x=1)=>d[p.index+x],ee=p.advance=()=>d[++p.index]||"",xe=t(()=>d.slice(p.index+1),"remaining"),pe=t((x="",Y=0)=>{p.consumed+=x,p.index+=Y},"consume"),_e=t(x=>{p.output+=x.output!=null?x.output:x.value,pe(x.value)},"append"),Hr=t(()=>{let x=1;for(;K()==="!"&&(K(2)!=="("||K(3)==="?");)ee(),p.start++,x++;return x%2===0?!1:(p.negated=!0,p.start++,!0)},"negate"),nt=t(x=>{p[x]++,re.push(x)},"increment"),Ee=t(x=>{p[x]--,re.pop()},"decrement"),M=t(x=>{if(c.type==="globstar"){const Y=p.braces>0&&(x.type==="comma"||x.type==="brace"),$=x.extglob===!0||le.length&&(x.type==="pipe"||x.type==="paren");x.type!=="slash"&&x.type!=="paren"&&!Y&&!$&&(p.output=p.output.slice(0,-c.output.length),c.type="star",c.value="*",c.output=U,p.output+=c.output)}if(le.length&&x.type!=="paren"&&(le[le.length-1].inner+=x.value),(x.value||x.output)&&_e(x),c&&c.type==="text"&&x.type==="text"){c.output=(c.output||c.value)+x.value,c.value+=x.value;return}x.prev=c,w.push(x),c=x},"push"),ot=t((x,Y)=>{const $={...J[Y],conditions:1,inner:""};$.prev=c,$.parens=p.parens,$.output=p.output,$.startIndex=p.index,$.tokensIndex=w.length;const B=(o.capture?"(":"")+$.open;nt("parens"),M({type:x,value:Y,output:p.output?"":me}),M({type:"paren",extglob:!0,value:ee(),output:B}),le.push($)},"extglobOpen"),Ir=t(x=>{const Y=d.slice(x.startIndex,p.index+1),$=d.slice(x.startIndex+2,p.index),B=H($,o);if((x.type==="plus"||x.type==="star")&&B.risky){const X=B.safeOutput?(x.output?"":me)+(o.capture?`(${B.safeOutput})`:B.safeOutput):void 0,be=w[x.tokensIndex];be.type="text",be.value=Y,be.output=X||n.escapeRegex(Y);for(let $e=x.tokensIndex+1;$e<w.length;$e++)w[$e].value="",w[$e].output="",delete w[$e].suffix;p.output=x.output+be.output,p.backtrack=!0,M({type:"paren",extglob:!0,value:u,output:""}),Ee("parens");return}let te=x.close+(o.capture?")":""),oe;if(x.type==="negate"){let X=U;if(x.inner&&x.inner.length>1&&x.inner.includes("/")&&(X=se(o)),(X!==U||fe()||/^\)+$/.test(xe()))&&(te=x.close=`)$))${X}`),x.inner.includes("*")&&(oe=xe())&&/^\.[^\\/.]+$/.test(oe)){const be=W(oe,{...E,fastpaths:!1}).output;te=x.close=`)${be})${X})`}x.prev.type==="bos"&&(p.negatedExtglob=!0)}M({type:"paren",extglob:!0,value:u,output:te}),Ee("parens")},"extglobClose");if(o.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(d)){let x=!1,Y=d.replace(f,($,B,te,oe,X,be)=>oe==="\\"?(x=!0,$):oe==="?"?B?B+oe+(X?Q.repeat(X.length):""):be===0?I+(X?Q.repeat(X.length):""):Q.repeat(te.length):oe==="."?V.repeat(te.length):oe==="*"?B?B+oe+(X?U:""):U:B?$:`\\${$}`);return x===!0&&(o.unescape===!0?Y=Y.replace(/\\/g,""):Y=Y.replace(/\\+/g,$=>$.length%2===0?"\\\\":$?"\\":"")),Y===d&&o.contains===!0?(p.output=d,p):(p.output=n.wrapOutput(Y,p,E),p)}for(;!fe();){if(u=ee(),u==="\0")continue;if(u==="\\"){const $=K();if($==="/"&&o.bash!==!0||$==="."||$===";")continue;if(!$){u+="\\",M({type:"text",value:u});continue}const B=/^\\+/.exec(xe());let te=0;if(B&&B[0].length>2&&(te=B[0].length,p.index+=te,te%2!==0&&(u+="\\")),o.unescape===!0?u=ee():u+=ee(),p.brackets===0){M({type:"text",value:u});continue}}if(p.brackets>0&&(u!=="]"||c.value==="["||c.value==="[^")){if(o.posix!==!1&&u===":"){const $=c.value.slice(1);if($.includes("[")&&(c.posix=!0,$.includes(":"))){const B=c.value.lastIndexOf("["),te=c.value.slice(0,B),oe=c.value.slice(B+2),X=i[oe];if(X){c.value=te+X,p.backtrack=!0,ee(),!C.output&&w.indexOf(c)===1&&(C.output=me);continue}}}(u==="["&&K()!==":"||u==="-"&&K()==="]")&&(u=`\\${u}`),u==="]"&&(c.value==="["||c.value==="[^")&&(u=`\\${u}`),o.posix===!0&&u==="!"&&c.value==="["&&(u="^"),c.value+=u,_e({value:u});continue}if(p.quotes===1&&u!=='"'){u=n.escapeRegex(u),c.value+=u,_e({value:u});continue}if(u==='"'){p.quotes=p.quotes===1?0:1,o.keepQuotes===!0&&M({type:"text",value:u});continue}if(u==="("){nt("parens"),M({type:"paren",value:u});continue}if(u===")"){if(p.parens===0&&o.strictBrackets===!0)throw new SyntaxError(y("opening","("));const $=le[le.length-1];if($&&p.parens===$.parens+1){Ir(le.pop());continue}M({type:"paren",value:u,output:p.parens?")":"\\)"}),Ee("parens");continue}if(u==="["){if(o.nobracket===!0||!xe().includes("]")){if(o.nobracket!==!0&&o.strictBrackets===!0)throw new SyntaxError(y("closing","]"));u=`\\${u}`}else nt("brackets");M({type:"bracket",value:u});continue}if(u==="]"){if(o.nobracket===!0||c&&c.type==="bracket"&&c.value.length===1){M({type:"text",value:u,output:`\\${u}`});continue}if(p.brackets===0){if(o.strictBrackets===!0)throw new SyntaxError(y("opening","["));M({type:"text",value:u,output:`\\${u}`});continue}Ee("brackets");const $=c.value.slice(1);if(c.posix!==!0&&$[0]==="^"&&!$.includes("/")&&(u=`/${u}`),c.value+=u,_e({value:u}),o.literalBrackets===!1||n.hasRegexChars($))continue;const B=n.escapeRegex(c.value);if(p.output=p.output.slice(0,-c.value.length),o.literalBrackets===!0){p.output+=B,c.value=B;continue}c.value=`(${N}${B}|${c.value})`,p.output+=c.value;continue}if(u==="{"&&o.nobrace!==!0){nt("braces");const $={type:"brace",value:u,output:"(",outputIndex:p.output.length,tokensIndex:p.tokens.length};ne.push($),M($);continue}if(u==="}"){const $=ne[ne.length-1];if(o.nobrace===!0||!$){M({type:"text",value:u,output:u});continue}let B=")";if($.dots===!0){const te=w.slice(),oe=[];for(let X=te.length-1;X>=0&&(w.pop(),te[X].type!=="brace");X--)te[X].type!=="dots"&&oe.unshift(te[X].value);B=g(oe,o),p.backtrack=!0}if($.comma!==!0&&$.dots!==!0){const te=p.output.slice(0,$.outputIndex),oe=p.tokens.slice($.tokensIndex);$.value=$.output="\\{",u=B="\\}",p.output=te;for(const X of oe)p.output+=X.output||X.value}M({type:"brace",value:u,output:B}),Ee("braces"),ne.pop();continue}if(u==="|"){le.length>0&&le[le.length-1].conditions++,M({type:"text",value:u});continue}if(u===","){let $=u;const B=ne[ne.length-1];B&&re[re.length-1]==="braces"&&(B.comma=!0,$="|"),M({type:"comma",value:u,output:$});continue}if(u==="/"){if(c.type==="dot"&&p.index===p.start+1){p.start=p.index+1,p.consumed="",p.output="",w.pop(),c=C;continue}M({type:"slash",value:u,output:ae});continue}if(u==="."){if(p.braces>0&&c.type==="dot"){c.value==="."&&(c.output=V);const $=ne[ne.length-1];c.type="dots",c.output+=u,c.value+=u,$.dots=!0;continue}if(p.braces+p.parens===0&&c.type!=="bos"&&c.type!=="slash"){M({type:"text",value:u,output:V});continue}M({type:"dot",value:u,output:V});continue}if(u==="?"){if(!(c&&c.value==="(")&&o.noextglob!==!0&&K()==="("&&K(2)!=="?"){ot("qmark",u);continue}if(c&&c.type==="paren"){const $=K();let B=u;(c.value==="("&&!/[!=<:]/.test($)||$==="<"&&!/<([!=]|\w+>)/.test(xe()))&&(B=`\\${u}`),M({type:"text",value:u,output:B});continue}if(o.dot!==!0&&(c.type==="slash"||c.type==="bos")){M({type:"qmark",value:u,output:ve});continue}M({type:"qmark",value:u,output:Q});continue}if(u==="!"){if(o.noextglob!==!0&&K()==="("&&(K(2)!=="?"||!/[!=<:]/.test(K(3)))){ot("negate",u);continue}if(o.nonegate!==!0&&p.index===0){Hr();continue}}if(u==="+"){if(o.noextglob!==!0&&K()==="("&&K(2)!=="?"){ot("plus",u);continue}if(c&&c.value==="("||o.regex===!1){M({type:"plus",value:u,output:ge});continue}if(c&&(c.type==="bracket"||c.type==="paren"||c.type==="brace")||p.parens>0){M({type:"plus",value:u});continue}M({type:"plus",value:ge});continue}if(u==="@"){if(o.noextglob!==!0&&K()==="("&&K(2)!=="?"){M({type:"at",extglob:!0,value:u,output:""});continue}M({type:"text",value:u});continue}if(u!=="*"){(u==="$"||u==="^")&&(u=`\\${u}`);const $=a.exec(xe());$&&(u+=$[0],p.index+=$[0].length),M({type:"text",value:u});continue}if(c&&(c.type==="globstar"||c.star===!0)){c.type="star",c.star=!0,c.value+=u,c.output=U,p.backtrack=!0,p.globstar=!0,pe(u);continue}let x=xe();if(o.noextglob!==!0&&/^\([^?]/.test(x)){ot("star",u);continue}if(c.type==="star"){if(o.noglobstar===!0){pe(u);continue}const $=c.prev,B=$.prev,te=$.type==="slash"||$.type==="bos",oe=B&&(B.type==="star"||B.type==="globstar");if(o.bash===!0&&(!te||x[0]&&x[0]!=="/")){M({type:"star",value:u,output:""});continue}const X=p.braces>0&&($.type==="comma"||$.type==="brace"),be=le.length&&($.type==="pipe"||$.type==="paren");if(!te&&$.type!=="paren"&&!X&&!be){M({type:"star",value:u,output:""});continue}for(;x.slice(0,3)==="/**";){const $e=d[p.index+4];if($e&&$e!=="/")break;x=x.slice(3),pe("/**",3)}if($.type==="bos"&&fe()){c.type="globstar",c.value+=u,c.output=se(o),p.output=c.output,p.globstar=!0,pe(u);continue}if($.type==="slash"&&$.prev.type!=="bos"&&!oe&&fe()){p.output=p.output.slice(0,-($.output+c.output).length),$.output=`(?:${$.output}`,c.type="globstar",c.output=se(o)+(o.strictSlashes?")":"|$)"),c.value+=u,p.globstar=!0,p.output+=$.output+c.output,pe(u);continue}if($.type==="slash"&&$.prev.type!=="bos"&&x[0]==="/"){const $e=x[1]!==void 0?"|$":"";p.output=p.output.slice(0,-($.output+c.output).length),$.output=`(?:${$.output}`,c.type="globstar",c.output=`${se(o)}${ae}|${ae}${$e})`,c.value+=u,p.output+=$.output+c.output,p.globstar=!0,pe(u+ee()),M({type:"slash",value:"/",output:""});continue}if($.type==="bos"&&x[0]==="/"){c.type="globstar",c.value+=u,c.output=`(?:^|${ae}|${se(o)}${ae})`,p.output=c.output,p.globstar=!0,pe(u+ee()),M({type:"slash",value:"/",output:""});continue}if(X&&x[0]==="/"){c.type="globstar",c.value+=u,c.output=`(?:^|${ae}|${se(o)}${ae})`,p.output+=c.output,p.globstar=!0,pe(u+ee()),M({type:"slash",value:"/",output:""});continue}p.output=p.output.slice(0,-c.output.length),c.type="globstar",c.output=se(o),c.value+=u,p.output+=c.output,p.globstar=!0,pe(u);continue}const Y={type:"star",value:u,output:U};if(o.bash===!0){Y.output=".*?",(c.type==="bos"||c.type==="slash")&&(Y.output=ue+Y.output),M(Y);continue}if(c&&(c.type==="bracket"||c.type==="paren")&&o.regex===!0){Y.output=u,M(Y);continue}(p.index===p.start||c.type==="slash"||c.type==="dot")&&(c.type==="dot"?(p.output+=Re,c.output+=Re):o.dot===!0?(p.output+=ye,c.output+=ye):(p.output+=ue,c.output+=ue),K()!=="*"&&(p.output+=me,c.output+=me)),M(Y)}for(;p.brackets>0;){if(o.strictBrackets===!0)throw new SyntaxError(y("closing","]"));p.output=n.escapeLast(p.output,"["),Ee("brackets")}for(;p.parens>0;){if(o.strictBrackets===!0)throw new SyntaxError(y("closing",")"));p.output=n.escapeLast(p.output,"("),Ee("parens")}for(;p.braces>0;){if(o.strictBrackets===!0)throw new SyntaxError(y("closing","}"));p.output=n.escapeLast(p.output,"{"),Ee("braces")}if(o.strictSlashes!==!0&&(c.type==="star"||c.type==="bracket")&&M({type:"maybe_slash",value:"",output:`${ae}?`}),p.backtrack===!0){p.output="";for(const x of p.tokens)p.output+=x.output!=null?x.output:x.value,x.suffix&&(p.output+=x.suffix)}return p},"parse");return W.fastpaths=(d,E)=>{const o={...E},S=typeof o.maxLength=="number"?Math.min(s,o.maxLength):s,T=d.length;if(T>S)throw new SyntaxError(`Input length: ${T}, exceeds maximum allowed length: ${S}`);d=l[d]||d;const{DOT_LITERAL:C,SLASH_LITERAL:w,ONE_CHAR:N,DOTS_SLASH:j,NO_DOT:J,NO_DOTS:V,NO_DOTS_SLASH:ge,STAR:ae,START_ANCHOR:me}=r.globChars(o.windows),Z=o.dot?V:J,ke=o.dot?ge:J,Re=o.capture?"":"?:",ye={negated:!1,prefix:""};let Q=o.bash===!0?".*?":ae;o.capture&&(Q=`(${Q})`);const ve=t(ue=>ue.noglobstar===!0?Q:`(${Re}(?:(?!${me}${ue.dot?j:C}).)*?)`,"globstar"),Ce=t(ue=>{switch(ue){case"*":return`${Z}${N}${Q}`;case".*":return`${C}${N}${Q}`;case"*.*":return`${Z}${Q}${C}${N}${Q}`;case"*/*":return`${Z}${Q}${w}${N}${ke}${Q}`;case"**":return Z+ve(o);case"**/*":return`(?:${Z}${ve(o)}${w})?${ke}${N}${Q}`;case"**/*.*":return`(?:${Z}${ve(o)}${w})?${ke}${Q}${C}${N}${Q}`;case"**/.*":return`(?:${Z}${ve(o)}${w})?${C}${N}${Q}`;default:{const I=/^(.*?)\.(\w+)$/.exec(ue);if(!I)return;const U=Ce(I[1]);return U?U+C+I[2]:void 0}}},"create"),ce=n.removePrefix(d,ye);let se=Ce(ce);return se&&o.strictSlashes!==!0&&(se+=`${w}?`),se},Dt=W,Dt}k(Kt,"It$1");we(Kt,"Bt");de(Kt,"requireParse");var Lt,ir;function Xt(){if(ir)return Lt;ir=1;var e=Object.defineProperty,t=de((l,g)=>e(l,"name",{value:g,configurable:!0}),"h");const r=Wt(),n=Kt(),s=Fe(),i=Me(),a=t(l=>l&&typeof l=="object"&&!Array.isArray(l),"isObject"),f=t((l,g,y=!1)=>{if(Array.isArray(l)){const H=l.map(W=>f(W,g,y));return t(W=>{for(const d of H){const E=d(W);if(E)return E}return!1},"arrayMatcher")}const h=a(l)&&l.tokens&&l.input;if(l===""||typeof l!="string"&&!h)throw new TypeError("Expected pattern to be a non-empty string");const v=g||{},m=v.windows,_=h?f.compileRe(l,g):f.makeRe(l,g,!1,!0),A=_.state;delete _.state;let b=t(()=>!1,"isIgnored");if(v.ignore){const H={...g,ignore:null,onMatch:null,onResult:null};b=f(v.ignore,H,y)}const q=t((H,W=!1)=>{const{isMatch:d,match:E,output:o}=f.test(H,_,g,{glob:l,posix:m}),S={glob:l,state:A,regex:_,posix:m,input:H,output:o,match:E,isMatch:d};if(typeof v.onResult=="function"&&v.onResult(S),d===!1)return S.isMatch=!1,W?S:!1;e:if(b(H)){if(typeof v.onIgnore=="function"&&v.onIgnore(S)===i.UNIGNORE){S.isMatch=!0;break e}return S.isMatch=!1,W?S:!1}return typeof v.onMatch=="function"&&v.onMatch(S),W?S:!0},"matcher");return y&&(q.state=A),q},"picomatch");return f.test=(l,g,y,{glob:h,posix:v}={})=>{if(typeof l!="string")throw new TypeError("Expected input to be a string");if(l==="")return{isMatch:!1,output:""};const m=y||{},_=m.format||(v?s.toPosixSlashes:null);let A=l===h,b=A&&_?_(l):l;return A===!1&&(b=_?_(l):l,A=b===h),(A===!1||m.capture===!0)&&(m.matchBase===!0||m.basename===!0?A=f.matchBase(l,g,y,v):A=g.exec(b)),{isMatch:!!A,match:A,output:b}},f.matchBase=(l,g,y)=>(g instanceof RegExp?g:f.makeRe(g,y)).test(s.basename(l)),f.isMatch=(l,g,y)=>f(g,y)(l),f.parse=(l,g)=>Array.isArray(l)?l.map(y=>f.parse(y,g)):n(l,{...g,fastpaths:!1}),f.scan=(l,g)=>r(l,g),f.compileRe=(l,g,y=!1,h=!1)=>{if(y===!0)return l.output;const v=g||{},m=v.contains?"":"^",_=v.contains?"":"$";let A=`${m}(?:${l.output})${_}`;l&&l.negated===!0&&(A=`^(?!${A}).*$`);const b=f.toRegex(A,g);return h===!0&&(b.state=l),b},f.makeRe=(l,g={},y=!1,h=!1)=>{if(!l||typeof l!="string")throw new TypeError("Expected a non-empty string");let v={negated:!1,fastpaths:!0};return g.fastpaths!==!1&&(l[0]==="."||l[0]==="*")&&(v.output=n.fastpaths(l,g)),v.output||(v=n(l,g)),f.compileRe(v,g,y,h)},f.toRegex=(l,g)=>{try{const y=g||{};return new RegExp(l,y.flags||(y.nocase?"i":""))}catch(y){if(g&&g.debug===!0)throw y;return/$^/}},f.constants=i,Lt=f,Lt}k(Xt,"wt");we(Xt,"Gt");de(Xt,"requirePicomatch$1");var Ht,sr;function zt(){if(sr)return Ht;sr=1;var e=Object.defineProperty,t=de((i,a)=>e(i,"name",{value:a,configurable:!0}),"c");const r=Xt(),n=Fe();function s(i,a,f=!1){return a&&(a.windows===null||a.windows===void 0)&&(a={...a,windows:n.isWindows()}),r(i,a,f)}return k(s,"D"),we(s,"D"),de(s,"picomatch"),t(s,"picomatch"),Object.assign(s,r),Ht=s,Ht}k(zt,"Pt$1");we(zt,"Mt");de(zt,"requirePicomatch");var mn=zt();const Oe=at(mn);var yn=Object.defineProperty,L=k((e,t)=>yn(e,"name",{value:t,configurable:!0}),"u$1"),vn=Object.defineProperty,D=L((e,t)=>vn(e,"name",{value:t,configurable:!0}),"l");const bn=Qr(import.meta.url),Be=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ze=D(e=>{if(typeof Be<"u"&&Be.versions&&Be.versions.node){const[t,r]=Be.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Be.getBuiltinModule(e)}return bn(e)},"__cjs_getBuiltinModule"),ar=ze("fs"),$n={...ar,default:ar},{statSync:An,stat:kn,realpathSync:xn,realpath:_n,readdirSync:En,readdir:Sn}=ze("fs"),{sep:br,basename:wn,dirname:Mt,resolve:$r,normalize:Rn,relative:Cn,posix:Pe,isAbsolute:On}=ze("path"),{fileURLToPath:Pn}=ze("url"),{createRequire:Tn}=ze("module");var Nn=Object.defineProperty,O=D((e,t)=>Nn(e,"name",{value:t,configurable:!0}),"r"),cr=Tn(import.meta.url);function ct(e){let t=Rn(e);return t.length>1&&t[t.length-1]===br&&(t=t.substring(0,t.length-1)),t}k(ct,"H");L(ct,"tt");D(ct,"M$1");O(ct,"cleanPath");const Dn=/[\\/]/g;function Qe(e,t){return e.replace(Dn,t)}k(Qe,"M$1");L(Qe,"T");D(Qe,"D$1");O(Qe,"convertSlashes");const Ln=/^[a-z]:[\\/]$/i;function lt(e){return e==="/"||Ln.test(e)}k(lt,"J");L(lt,"et");D(lt,"T$1");O(lt,"isRootDirectory");function De(e,t){const{resolvePaths:r,normalizePath:n,pathSeparator:s}=t,i=process.platform==="win32"&&e.includes("/")||e.startsWith(".");if(r&&(e=$r(e)),(n||i)&&(e=ct(e)),e===".")return"";const a=e[e.length-1]!==s;return Qe(a?e+s:e,s)}k(De,"q$1");L(De,"q");D(De,"w");O(De,"normalizePath");function Je(e,t){return t+e}k(Je,"B$1");L(Je,"I");D(Je,"P");O(Je,"joinPathWithBasePath");function ut(e,t){return function(r,n){return n.startsWith(e)?n.slice(e.length)+r:Qe(Cn(e,n),t.pathSeparator)+t.pathSeparator+r}}k(ut,"K");L(ut,"st");D(ut,"X");O(ut,"joinPathWithRelativePath");function pt(e){return e}k(pt,"V");L(pt,"rt");D(pt,"H");O(pt,"joinPath");function ft(e,t,r){return t+e+r}k(ft,"X$1");L(ft,"nt");D(ft,"U$1");O(ft,"joinDirectoryPath");function ht(e,t){const{relativePaths:r,includeBasePath:n}=t;return r&&e?ut(e,t):n?Je:pt}k(ht,"Z");L(ht,"it");D(ht,"J");O(ht,"build$7");function dt(e){return function(t,r){r.push(t.substring(e.length)||".")}}k(dt,"tt");L(dt,"ot");D(dt,"K$1");O(dt,"pushDirectoryWithRelativePath");function gt(e){return function(t,r,n){const s=t.substring(e.length)||".";n.every(i=>i(s,!0))&&r.push(s)}}k(gt,"et");L(gt,"ut");D(gt,"V");O(gt,"pushDirectoryFilterWithRelativePath");const Hn=O((e,t)=>{t.push(e||".")},"pushDirectory"),In=O((e,t,r)=>{const n=e||".";r.every(s=>s(n,!0))&&t.push(n)},"pushDirectoryFilter"),jn=O(()=>{},"empty$2");function mt(e,t){const{includeDirs:r,filters:n,relativePaths:s}=t;return r?s?n&&n.length?gt(e):dt(e):n&&n.length?In:Hn:jn}k(mt,"st");L(mt,"lt");D(mt,"st$1");O(mt,"build$6");const Mn=O((e,t,r,n)=>{n.every(s=>s(e,!1))&&r.files++},"pushFileFilterAndCount"),Fn=O((e,t,r,n)=>{n.every(s=>s(e,!1))&&t.push(e)},"pushFileFilter"),Gn=O((e,t,r,n)=>{r.files++},"pushFileCount"),Bn=O((e,t)=>{t.push(e)},"pushFile"),Un=O(()=>{},"empty$1");function yt(e){const{excludeFiles:t,filters:r,onlyCounts:n}=e;return t?Un:r&&r.length?n?Mn:Fn:n?Gn:Bn}k(yt,"it");L(yt,"at");D(yt,"ut$1");O(yt,"build$5");const qn=O(e=>e,"getArray"),Wn=O(()=>[""].slice(0,0),"getArrayGroup");function vt(e){return e.group?Wn:qn}k(vt,"nt");L(vt,"ct");D(vt,"ct$1");O(vt,"build$4");const Kn=O((e,t,r)=>{e.push({directory:t,files:r,dir:t})},"groupFiles"),Xn=O(()=>{},"empty");function bt(e){return e.group?Kn:Xn}k(bt,"rt");L(bt,"ht");D(bt,"ft$1");O(bt,"build$3");const zn=O(function(e,t,r){const{queue:n,fs:s,options:{suppressErrors:i}}=t;n.enqueue(),s.realpath(e,(a,f)=>{if(a)return n.dequeue(i?null:a,t);s.stat(f,(l,g)=>{if(l)return n.dequeue(i?null:l,t);if(g.isDirectory()&&Ve(e,f,t))return n.dequeue(null,t);r(g,f),n.dequeue(null,t)})})},"resolveSymlinksAsync"),Qn=O(function(e,t,r){const{queue:n,fs:s,options:{suppressErrors:i}}=t;n.enqueue();try{const a=s.realpathSync(e),f=s.statSync(a);if(f.isDirectory()&&Ve(e,a,t))return;r(f,a)}catch(a){if(!i)throw a}},"resolveSymlinks");function $t(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?Qn:zn}k($t,"ot");L($t,"pt");D($t,"gt$1");O($t,"build$2");function Ve(e,t,r){if(r.options.useRealPaths)return At(t,r);let n=Mt(e),s=1;for(;n!==r.root&&s<2;){const i=r.symlinks.get(n);i&&(i===t||i.startsWith(t)||t.startsWith(i))?s++:n=Mt(n)}return r.symlinks.set(e,t),s>1}k(Ve,"_$2");L(Ve,"L");D(Ve,"E$1");O(Ve,"isRecursive");function At(e,t){return t.visited.includes(e+t.options.pathSeparator)}k(At,"lt");L(At,"ft");D(At,"dt$1");O(At,"isRecursiveUsingRealPaths");const Jn=O(e=>e.counts,"onlyCountsSync"),Vn=O(e=>e.groups,"groupsSync"),Yn=O(e=>e.paths,"defaultSync"),Zn=O(e=>e.paths.slice(0,e.options.maxFiles),"limitFilesSync"),eo=O((e,t,r)=>(Ne(t,r,e.counts,e.options.suppressErrors),null),"onlyCountsAsync"),to=O((e,t,r)=>(Ne(t,r,e.paths,e.options.suppressErrors),null),"defaultAsync"),ro=O((e,t,r)=>(Ne(t,r,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),"limitFilesAsync"),no=O((e,t,r)=>(Ne(t,r,e.groups,e.options.suppressErrors),null),"groupsAsync");function Ne(e,t,r,n){t(e&&!n?e:null,r)}k(Ne,"A$3");L(Ne,"j");D(Ne,"y");O(Ne,"report");function kt(e,t){const{onlyCounts:r,group:n,maxFiles:s}=e;return r?t?Jn:eo:n?t?Vn:no:s?t?Zn:ro:t?Yn:to}k(kt,"at");L(kt,"gt");D(kt,"Et");O(kt,"build$1");const Ar={withFileTypes:!0},oo=O((e,t,r,n,s)=>{if(e.queue.enqueue(),n<0)return e.queue.dequeue(null,e);const{fs:i}=e;e.visited.push(t),e.counts.directories++,i.readdir(t||".",Ar,(a,f=[])=>{s(f,r,n),e.queue.dequeue(e.options.suppressErrors?null:a,e)})},"walkAsync"),io=O((e,t,r,n,s)=>{const{fs:i}=e;if(n<0)return;e.visited.push(t),e.counts.directories++;let a=[];try{a=i.readdirSync(t||".",Ar)}catch(f){if(!e.options.suppressErrors)throw f}s(a,r,n)},"walkSync");function xt(e){return e?io:oo}k(xt,"ut");L(xt,"yt");D(xt,"xt$1");O(xt,"build");var so=class{static{k(this,"De")}static{L(this,"we")}static{D(this,"_t")}static{O(this,"Queue")}count=0;constructor(e){this.onQueueEmpty=e}enqueue(){return this.count++,this.count}dequeue(e,t){this.onQueueEmpty&&(--this.count<=0||e)&&(this.onQueueEmpty(e,t),e&&(t.controller.abort(),this.onQueueEmpty=void 0))}},ao=class{static{k(this,"Ae")}static{L(this,"$e")}static{D(this,"At")}static{O(this,"Counter")}_files=0;_directories=0;set files(e){this._files=e}get files(){return this._files}set directories(e){this._directories=e}get directories(){return this._directories}get dirs(){return this._directories}},co=class{static{k(this,"Ee")}static{L(this,"Se")}static{D(this,"Wt")}static{O(this,"Aborter")}aborted=!1;abort(){this.aborted=!0}},kr=class{static{k(this,"Dt")}static{L(this,"mt")}static{D(this,"q")}static{O(this,"Walker")}root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,t,r){this.isSynchronous=!r,this.callbackInvoker=kt(t,this.isSynchronous),this.root=De(e,t),this.state={root:lt(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new ao,options:t,queue:new so((n,s)=>this.callbackInvoker(s,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new co,fs:t.fs||$n},this.joinPath=ht(this.root,t),this.pushDirectory=mt(this.root,t),this.pushFile=yt(t),this.getArray=vt(t),this.groupFiles=bt(t),this.resolveSymlink=$t(t,this.isSynchronous),this.walkDirectory=xt(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=O((e,t,r)=>{const{paths:n,options:{filters:s,resolveSymlinks:i,excludeSymlinks:a,exclude:f,maxFiles:l,signal:g,useRealPaths:y,pathSeparator:h},controller:v}=this.state;if(v.aborted||g&&g.aborted||l&&n.length>l)return;const m=this.getArray(this.state.paths);for(let _=0;_<e.length;++_){const A=e[_];if(A.isFile()||A.isSymbolicLink()&&!i&&!a){const b=this.joinPath(A.name,t);this.pushFile(b,m,this.state.counts,s)}else if(A.isDirectory()){let b=ft(A.name,t,this.state.options.pathSeparator);if(f&&f(A.name,b))continue;this.pushDirectory(b,n,s),this.walkDirectory(this.state,b,b,r-1,this.walk)}else if(this.resolveSymlink&&A.isSymbolicLink()){let b=Je(A.name,t);this.resolveSymlink(b,this.state,(q,H)=>{if(q.isDirectory()){if(H=De(H,this.state.options),f&&f(A.name,y?H:b+h))return;this.walkDirectory(this.state,H,y?H:b+h,r-1,this.walk)}else{H=y?H:b;const W=wn(H),d=De(Mt(H),this.state.options);H=this.joinPath(W,d),this.pushFile(H,m,this.state.counts,s)}})}}this.groupFiles(this.state.groups,t,m)},"walk")};function _t(e,t){return new Promise((r,n)=>{Ye(e,t,(s,i)=>{if(s)return n(s);r(i)})})}k(_t,"ct");L(_t,"bt");D(_t,"Ct");O(_t,"promise");function Ye(e,t,r){new kr(e,t,r).start()}k(Ye,"T$1");L(Ye,"G");D(Ye,"x");O(Ye,"callback");function Et(e,t){return new kr(e,t).start()}k(Et,"ht");L(Et,"vt");D(Et,"jt");O(Et,"sync");var lr=class{static{k(this,"kt")}static{L(this,"J")}static{D(this,"F")}static{O(this,"APIBuilder")}constructor(e,t){this.root=e,this.options=t}withPromise(){return _t(this.root,this.options)}withCallback(e){Ye(this.root,this.options,e)}sync(){return Et(this.root,this.options)}};let xr=null;try{cr.resolve("picomatch"),xr=cr("picomatch")}catch{}var lo=class{static{k(this,"We")}static{L(this,"ke")}static{D(this,"$t")}static{O(this,"Builder")}globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:br,filters:[]};globFunction;constructor(e){this.options={...this.options,...e},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(e){return this.options.pathSeparator=e,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(e){return this.options.maxDepth=e,this}withMaxFiles(e){return this.options.maxFiles=e,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:e=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=e,this.withFullPaths()}withAbortSignal(e){return this.options.signal=e,this}normalize(){return this.options.normalizePath=!0,this}filter(e){return this.options.filters.push(e),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(e){return this.options.exclude=e,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(e){return new lr(e||".",this.options)}withGlobFunction(e){return this.globFunction=e,this}crawlWithOptions(e,t){return this.options={...this.options,...t},new lr(e||".",this.options)}glob(...e){return this.globFunction?this.globWithOptions(e):this.globWithOptions(e,{dot:!0})}globWithOptions(e,...t){const r=this.globFunction||xr;if(!r)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[e.join("\0")];return n||(n=r(e,...t),this.globCache[e.join("\0")]=n),this.options.filters.push(s=>n(s)),this}},uo=Object.defineProperty,ie=D((e,t)=>uo(e,"name",{value:t,configurable:!0}),"a");const po=Array.isArray,_r=/\\/g,Er=process.platform==="win32",fo=/^(\/?\.\.)+$/;function We(e,t={}){const r=e.length,n=Array(r),s=Array(r);let i,a;for(i=0;i<r;i++){const f=Ze(e[i]);n[i]=f;const l=f.length,g=Array(l);for(a=0;a<l;a++)g[a]=Oe(f[a],t);s[i]=g}return f=>{const l=f.split("/");if(l[0]===".."&&fo.test(f))return!0;for(i=0;i<r;i++){const g=n[i],y=s[i],h=l.length,v=Math.min(h,g.length);for(a=0;a<v;){const m=g[a];if(m.includes("/"))return!0;if(!y[a](l[a]))break;if(!t.noglobstar&&m==="**")return!0;a++}if(a===h)return!0}return!1}}k(We,"R$1");L(We,"B");D(We,"D");ie(We,"getPartialMatcher");const ho=/^[A-Z]:\/$/i,go=Er?e=>ho.test(e):e=>e==="/";function Ke(e,t,r){if(e===t||t.startsWith(`${e}/`)){if(r){const s=e.length+ +!go(e);return(i,a)=>i.slice(s,a?-1:void 0)||"."}const n=t.slice(e.length+1);return n?(s,i)=>{if(s===".")return n;const a=`${n}/${s}`;return i?a.slice(0,-1):a}:(s,i)=>i&&s!=="."?s.slice(0,-1):s}return r?n=>Pe.relative(e,n)||".":n=>Pe.relative(e,`${t}/${n}`)||"."}k(Ke,"O$2");L(Ke,"M");D(Ke,"M");ie(Ke,"buildFormat");function St(e,t){if(t.startsWith(`${e}/`)){const r=t.slice(e.length+1);return n=>`${r}/${n}`}return r=>{const n=Pe.relative(e,`${t}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}k(St,"pt");L(St,"St");D(St,"at");ie(St,"buildRelative");const mo={parts:!0};function Ze(e){var t;const r=Oe.scan(e,mo);return!((t=r.parts)===null||t===void 0)&&t.length?r.parts:[e]}k(Ze,"I$3");L(Ze,"z");D(Ze,"N");ie(Ze,"splitPattern");const yo=/\\(?![()[\]{}!+@])/g;function Qt(e){return Sr(e)}k(Qt,"qt");L(Qt,"Ee");D(Qt,"ut");ie(Qt,"convertPosixPathToPattern");function Jt(e){return wr(e).replace(yo,"/")}k(Jt,"jt");L(Jt,"Re");D(Jt,"ft");ie(Jt,"convertWin32PathToPattern");const vo=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,bo=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Sr=ie(e=>e.replace(vo,"\\$&"),"escapePosixPath"),wr=ie(e=>e.replace(bo,"\\$&"),"escapeWin32Path"),$o=Er?wr:Sr;function wt(e,t){if(t?.caseSensitiveMatch===!1)return!0;const r=Oe.scan(e);return r.isGlob||r.negated}k(wt,"ft");L(wt,"Dt");D(wt,"k");ie(wt,"isDynamicPattern");function Se(...e){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...e)}k(Se,"D$1");L(Se,"D");D(Se,"E");ie(Se,"log");function et(e){return typeof e=="string"?[e]:e??[]}k(et,"L$1");L(et,"U");D(et,"W");ie(et,"ensureStringArray");const Ao=/^(\/?\.\.)+/,ko=/\\(?=[()[\]{}!*+?@|])/g;function Le(e,t,r,n){var s;const i=t.cwd;let a=e;e[e.length-1]==="/"&&(a=e.slice(0,-1));const f=a.lastIndexOf("/"),l=(f===-1?a:a.slice(f+1)).startsWith("!(");a[a.length-1]!=="*"&&!l&&t.expandDirectories&&(a+="/**");const g=$o(i);a=On(a.replace(ko,""))?Pe.relative(g,a):Pe.normalize(a);const y=(s=Ao.exec(a))===null||s===void 0?void 0:s[0],h=Ze(a);if(y){const m=(y.length+1)/3;let _=0;const A=g.split("/");for(;_<m&&h[_+m]===A[A.length+_-m];)a=a.slice(0,(m-_-1)*3)+a.slice((m-_)*3+h[_+m].length+1)||".",_++;const b=Pe.join(i,y.slice(_*3));b[0]!=="."&&r.root.length>b.length&&(r.root=b,r.depthOffset=-m+_)}if(!n&&r.depthOffset>=0){var v;(v=r.commonPath)!==null&&v!==void 0||(r.commonPath=h);const m=[],_=Math.min(r.commonPath.length,h.length);for(let A=0;A<_;A++){const b=h[A];if(b==="**"&&!h[A+1]){m.pop();break}if(A===h.length-1||b!==r.commonPath[A]||wt(b))break;m.push(b)}r.depthOffset=m.length,r.commonPath=m,r.root=m.length>0?Pe.join(i,...m):i}return a}k(Le,"j$1");L(Le,"E");D(Le,"$");ie(Le,"normalizePattern");function Rt(e,t,r){const n=[],s=[],i=[];for(const a of e.ignore)a&&(a[0]!=="!"||a[1]==="("?s.push(Le(a,e,r,!0)):i.push(a.slice(1)));for(const a of t)a&&(a[0]!=="!"||a[1]==="("?n.push(Le(a,e,r,!1)):(a[1]!=="!"||a[2]==="(")&&s.push(Le(a.slice(1),e,r,!0)));return{match:n,ignore:s,unignore:i}}k(Rt,"gt");L(Rt,"xt");D(Rt,"St");ie(Rt,"processPatterns");function Ct(e,t){const r=e.cwd,n={root:r,depthOffset:0},s=Rt(e,t,n);e.debug&&Se("internal processing patterns:",s);const{absolute:i,caseSensitiveMatch:a,debug:f,dot:l,followSymbolicLinks:g,onlyDirectories:y}=e,h=n.root.replace(_r,""),v={dot:l,nobrace:e.braceExpansion===!1,nocase:!a,noextglob:e.extglob===!1,noglobstar:e.globstar===!1,posix:!0},m=s.unignore.length>0,_=m?Oe(s.unignore,v):void 0,A=m?We(s.unignore,v):void 0,b=Oe(s.match,{...v,ignore:s.ignore,onIgnore:_?C=>_(C.output)&&Oe.constants.UNIGNORE:void 0}),q=Oe(s.ignore,v),H=We(s.match,v),W=Ke(r,h,i),d=i?W:Ke(r,h,!0),E=s.match.length>0&&s.match.every(C=>C==="**"||C==="**/*"),o=s.ignore.length>0||m||!E?(C,w)=>{const N=d(w,!0);return N==="."||A&&A(N)?!1:!H(N)||q(N)}:void 0;let S;e.deep!==void 0&&(S=Math.round(e.deep-n.depthOffset));const T=new lo({filters:[f?(C,w)=>{const N=W(C,w),j=b(N);return j&&Se(`matched ${N}`),j}:(C,w)=>{const N=W(C,w);return b(N)}],exclude:f&&o?(C,w)=>{const N=o(C,w);return Se(`${N?"skipped":"crawling"} ${w}`),N}:o,fs:e.fs,pathSeparator:"/",relativePaths:!i,resolvePaths:i,includeBasePath:i,resolveSymlinks:g,excludeSymlinks:!g,excludeFiles:y,includeDirs:y||!e.onlyFiles,maxDepth:S,signal:e.signal}).crawl(h);return e.debug&&Se("internal properties:",{...n,root:h}),[T,r!==h&&!i&&St(r,h)]}k(Ct,"dt");L(Ct,"At");D(Ct,"vt");ie(Ct,"buildCrawler");function tt(e,t){if(t)for(let r=e.length-1;r>=0;r--)e[r]=t(e[r]);return e}k(tt,"z$1");L(tt,"N");D(tt,"U");ie(tt,"formatPaths");const xo={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Ot(e){const t={...xo,...e};return t.cwd=(t.cwd instanceof URL?Pn(t.cwd):$r(t.cwd)).replace(_r,"/"),t.ignore=et(t.ignore),t.fs&&(t.fs={readdir:t.fs.readdir||Sn,readdirSync:t.fs.readdirSync||En,realpath:t.fs.realpath||_n,realpathSync:t.fs.realpathSync||xn,stat:t.fs.stat||kn,statSync:t.fs.statSync||An}),t.debug&&Se("globbing with options:",t),t}k(Ot,"yt");L(Ot,"_t");D(Ot,"pt");ie(Ot,"getOptions");function rt(e,t={}){var r;if(e&&t?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const n=po(e)||typeof e=="string",s=et((r=n?e:e.patterns)!==null&&r!==void 0?r:"**/*"),i=Ot(n?t:e);return s.length>0?Ct(i,s):[]}k(rt,"G$1");L(rt,"Q");D(rt,"G");ie(rt,"getCrawler");async function Pt(e,t){const[r,n]=rt(e,t);return r?tt(await r.withPromise(),n):[]}k(Pt,"mt");L(Pt,"Ie");D(Pt,"bt");ie(Pt,"glob");function Vt(e,t){const[r,n]=rt(e,t);return r?tt(r.sync(),n):[]}k(Vt,"vt");L(Vt,"Le");D(Vt,"xt");ie(Vt,"globSync");var _o=Object.defineProperty,Eo=k((e,t)=>_o(e,"name",{value:t,configurable:!0}),"r$1"),So=Object.defineProperty,wo=Eo((e,t)=>So(e,"name",{value:t,configurable:!0}),"r"),Ro=Object.defineProperty,Co=wo((e,t)=>Ro(e,"name",{value:t,configurable:!0}),"r");const Oo=Co(async(e,t)=>await Pt(e,t),"glob");var Po=Object.defineProperty,Ae=k((e,t)=>Po(e,"name",{value:t,configurable:!0}),"d$1");const To=["dependencies","devDependencies","peerDependencies","peerDependenciesMeta","optionalDependencies","bundleDependencies"],No=["overrides","pnpm","resolutions"],Do=["engines","files"],Lo=Ae(e=>{const t=yr.coerce(e)?.major;return t!==void 0&&t>=10},"isPnpmV10Plus"),Ho=Ae(e=>{const t=Te(e,"pnpm-workspace.yaml");if(!Gt(t))return{overrides:{},source:"pnpm-workspace.yaml"};try{return{overrides:Br(t)?.overrides??{},source:"pnpm-workspace.yaml"}}catch{return{overrides:{},source:"pnpm-workspace.yaml"}}},"readPnpmWorkspaceOverrides"),Io=Ae((e,t)=>{let r={};return t==="deno"?{overrides:{},source:"package.json"}:(t==="pnpm"?r=e.pnpm?.overrides??{}:t==="yarn"||t==="bun"?r=e.resolutions??{}:r=e.overrides??{},{overrides:r,source:"package.json"})},"readPkgJsonOverrides"),jo=Ae((e,t,r)=>r.name==="pnpm"&&Lo(r.version)?Ho(e):Io(t,r.name),"readOverrides"),ur=Ae((e,t)=>{const r=t;for(const s of No){const i=e.indexOf(s);if(i!==-1&&s!==r)return r==="overrides"?i:i+1}let n=-1;for(const s of To){const i=e.indexOf(s);i>n&&(n=i)}if(n!==-1)return n+1;for(const s of Do){const i=e.indexOf(s);if(i!==-1)return i}return e.length},"findInsertIndex"),Mo=Ae((e,t)=>{const r=Te(e,"pnpm-workspace.yaml");if(!Gt(r))throw new Error(`pnpm-workspace.yaml not found at ${r}. Cannot write overrides for pnpm v10+.`);let n=Xe(r);const s=`overrides:
|
|
3
|
+
const Mr=Fr(import.meta.url),Ge=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,mr=k(e=>{if(typeof Ge<"u"&&Ge.versions&&Ge.versions.node){const[t,r]=Ge.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Ge.getBuiltinModule(e)}return Mr(e)},"__cjs_getBuiltinModule"),{writeFileSync:Gr}=mr("node:fs"),{createRequire:Qr}=mr("node:module");var pn=Object.defineProperty,Ie=k((e,t)=>pn(e,"name",{value:t,configurable:!0}),"r$2"),fn=Object.defineProperty,je=Ie((e,t)=>fn(e,"name",{value:t,configurable:!0}),"r"),hn=Object.defineProperty,He=je((e,t)=>hn(e,"name",{value:t,configurable:!0}),"t");function at(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}k(at,"p$1");Ie(at,"f");je(at,"getDefaultExportFromCjs");He(at,"getDefaultExportFromCjs");function Bt(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}k(Bt,"f$1");Ie(Bt,"l");je(Bt,"getDefaultExportFromNamespaceIfPresent");He(Bt,"getDefaultExportFromNamespaceIfPresent");function Ut(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}k(Ut,"l$1");Ie(Ut,"s");je(Ut,"getDefaultExportFromNamespaceIfNotNamed");He(Ut,"getDefaultExportFromNamespaceIfNotNamed");function qt(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=He(je(Ie(k(function n(){var s=!1;try{s=this instanceof n}catch{}return s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)},"u"),"n"),"a"),"a");r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:He(function(){return e[n]},"get")})}),r}k(qt,"s$1");Ie(qt,"m");je(qt,"getAugmentedNamespace");He(qt,"getAugmentedNamespace");var dn=Object.defineProperty,we=k((e,t)=>dn(e,"name",{value:t,configurable:!0}),"lt$1"),gn=Object.defineProperty,de=we((e,t)=>gn(e,"name",{value:t,configurable:!0}),"ut"),er={},Tt,tr;function Fe(){if(tr)return Tt;tr=1;const e="[^\\\\/]",t=Symbol("unignore"),r="\\.",n="\\+",s="\\?",i="\\/",a="(?=.)",f="[^/]",l=`(?:${i}|$)`,g=`(?:^|${i})`,y=`${r}{1,2}${l}`,h=`(?!${r})`,v=`(?!${g}${y})`,m=`(?!${r}{0,1}${l})`,_=`(?!${y})`,A=`[^.${i}]`,b=`${f}*?`,q="/",H={DOT_LITERAL:r,PLUS_LITERAL:n,QMARK_LITERAL:s,SLASH_LITERAL:i,ONE_CHAR:a,QMARK:f,END_ANCHOR:l,DOTS_SLASH:y,NO_DOT:h,NO_DOTS:v,NO_DOT_SLASH:m,NO_DOTS_SLASH:_,QMARK_NO_DOT:A,STAR:b,START_ANCHOR:g,SEP:q},W={...H,SLASH_LITERAL:"[\\\\/]",QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${r}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${r})`,NO_DOTS:`(?!(?:^|[\\\\/])${r}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${r}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${r}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},d={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return Tt={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:d,UNIGNORE:t,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(E){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${E.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(E){return E===!0?W:H}},Tt}k(Fe,"_t$1");we(Fe,"bt");de(Fe,"requireConstants");var rr;function Me(){return rr||(rr=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:r,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:s}=Fe();e.isObject=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),e.hasRegexChars=i=>n.test(i),e.isRegexChar=i=>i.length===1&&e.hasRegexChars(i),e.escapeRegex=i=>i.replace(s,"\\$1"),e.toPosixSlashes=i=>i.replace(t,"/"),e.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const i=navigator.platform.toLowerCase();return i==="win32"||i==="windows"}return process.platform?process.platform==="win32":!1},e.removeBackslashes=i=>i.replace(r,a=>a==="\\"?"":a),e.escapeLast=(i,a,f)=>{const l=i.lastIndexOf(a,f);return l===-1?i:i[l-1]==="\\"?e.escapeLast(i,a,l-1):`${i.slice(0,l)}\\${i.slice(l)}`},e.removePrefix=(i,a={})=>{let f=i;return f.startsWith("./")&&(f=f.slice(2),a.prefix="./"),f},e.wrapOutput=(i,a={},f={})=>{const l=f.contains?"":"^",g=f.contains?"":"$";let y=`${l}(?:${i})${g}`;return a.negated===!0&&(y=`(?:^(?!${y}).*$)`),y},e.basename=(i,{windows:a}={})=>{const f=i.split(a?/[\\/]/:"/"),l=f[f.length-1];return l===""?f[f.length-2]:l}})(er)),er}k(Me,"Et$1");we(Me,"yt");de(Me,"requireUtils");var Nt,nr;function Wt(){if(nr)return Nt;nr=1;var e=Object.defineProperty,t=de((d,E)=>e(d,"name",{value:E,configurable:!0}),"k");const r=Me(),{CHAR_ASTERISK:n,CHAR_AT:s,CHAR_BACKWARD_SLASH:i,CHAR_COMMA:a,CHAR_DOT:f,CHAR_EXCLAMATION_MARK:l,CHAR_FORWARD_SLASH:g,CHAR_LEFT_CURLY_BRACE:y,CHAR_LEFT_PARENTHESES:h,CHAR_LEFT_SQUARE_BRACKET:v,CHAR_PLUS:m,CHAR_QUESTION_MARK:_,CHAR_RIGHT_CURLY_BRACE:A,CHAR_RIGHT_PARENTHESES:b,CHAR_RIGHT_SQUARE_BRACKET:q}=Fe(),H=t(d=>d===g||d===i,"isPathSeparator"),W=t(d=>{d.isPrefix!==!0&&(d.depth=d.isGlobstar?1/0:1)},"depth");return Nt=t((d,E)=>{const o=E||{},S=d.length-1,T=o.parts===!0||o.scanToEnd===!0,C=[],w=[],N=[];let j=d,J=-1,V=0,ge=0,ae=!1,me=!1,Z=!1,ke=!1,Re=!1,ye=!1,Q=!1,ve=!1,Ce=!1,ce=!1,se=0,ue,I,U={value:"",depth:0,isGlob:!1};const p=t(()=>J>=S,"eos"),le=t(()=>j.charCodeAt(J+1),"peek"),ne=t(()=>(ue=I,j.charCodeAt(++J)),"advance");for(;J<S;){I=ne();let K;if(I===i){Q=U.backslashes=!0,I=ne(),I===y&&(ye=!0);continue}if(ye===!0||I===y){for(se++;p()!==!0&&(I=ne());){if(I===i){Q=U.backslashes=!0,ne();continue}if(I===y){se++;continue}if(ye!==!0&&I===f&&(I=ne())===f){if(ae=U.isBrace=!0,Z=U.isGlob=!0,ce=!0,T===!0)continue;break}if(ye!==!0&&I===a){if(ae=U.isBrace=!0,Z=U.isGlob=!0,ce=!0,T===!0)continue;break}if(I===A&&(se--,se===0)){ye=!1,ae=U.isBrace=!0,ce=!0;break}}if(T===!0)continue;break}if(I===g){if(C.push(J),w.push(U),U={value:"",depth:0,isGlob:!1},ce===!0)continue;if(ue===f&&J===V+1){V+=2;continue}ge=J+1;continue}if(o.noext!==!0&&(I===m||I===s||I===n||I===_||I===l)&&le()===h){if(Z=U.isGlob=!0,ke=U.isExtglob=!0,ce=!0,I===l&&J===V&&(Ce=!0),T===!0){for(;p()!==!0&&(I=ne());){if(I===i){Q=U.backslashes=!0,I=ne();continue}if(I===b){Z=U.isGlob=!0,ce=!0;break}}continue}break}if(I===n){if(ue===n&&(Re=U.isGlobstar=!0),Z=U.isGlob=!0,ce=!0,T===!0)continue;break}if(I===_){if(Z=U.isGlob=!0,ce=!0,T===!0)continue;break}if(I===v){for(;p()!==!0&&(K=ne());){if(K===i){Q=U.backslashes=!0,ne();continue}if(K===q){me=U.isBracket=!0,Z=U.isGlob=!0,ce=!0;break}}if(T===!0)continue;break}if(o.nonegate!==!0&&I===l&&J===V){ve=U.negated=!0,V++;continue}if(o.noparen!==!0&&I===h){if(Z=U.isGlob=!0,T===!0){for(;p()!==!0&&(I=ne());){if(I===h){Q=U.backslashes=!0,I=ne();continue}if(I===b){ce=!0;break}}continue}break}if(Z===!0){if(ce=!0,T===!0)continue;break}}o.noext===!0&&(ke=!1,Z=!1);let re=j,c="",u="";V>0&&(c=j.slice(0,V),j=j.slice(V),ge-=V),re&&Z===!0&&ge>0?(re=j.slice(0,ge),u=j.slice(ge)):Z===!0?(re="",u=j):re=j,re&&re!==""&&re!=="/"&&re!==j&&H(re.charCodeAt(re.length-1))&&(re=re.slice(0,-1)),o.unescape===!0&&(u&&(u=r.removeBackslashes(u)),re&&Q===!0&&(re=r.removeBackslashes(re)));const fe={prefix:c,input:d,start:V,base:re,glob:u,isBrace:ae,isBracket:me,isGlob:Z,isExtglob:ke,isGlobstar:Re,negated:ve,negatedExtglob:Ce};if(o.tokens===!0&&(fe.maxDepth=0,H(I)||w.push(U),fe.tokens=w),o.parts===!0||o.tokens===!0){let K;for(let ee=0;ee<C.length;ee++){const xe=K?K+1:V,pe=C[ee],_e=d.slice(xe,pe);o.tokens&&(ee===0&&V!==0?(w[ee].isPrefix=!0,w[ee].value=c):w[ee].value=_e,W(w[ee]),fe.maxDepth+=w[ee].depth),(ee!==0||_e!=="")&&N.push(_e),K=pe}if(K&&K+1<d.length){const ee=d.slice(K+1);N.push(ee),o.tokens&&(w[w.length-1].value=ee,W(w[w.length-1]),fe.maxDepth+=w[w.length-1].depth)}fe.slashes=C,fe.parts=N}return fe},"scan"),Nt}k(Wt,"Nt$1");we(Wt,"wt");de(Wt,"requireScan");var Dt,or;function Kt(){if(or)return Dt;or=1;var e=Object.defineProperty,t=de((d,E)=>e(d,"name",{value:E,configurable:!0}),"y");const r=Fe(),n=Me(),{MAX_LENGTH:s,POSIX_REGEX_SOURCE:i,REGEX_NON_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_BACKREF:f,REPLACEMENTS:l}=r,g=t((d,E)=>typeof E.expandRange=="function"?E.expandRange(...d,E):(d.sort(),`[${d.join("-")}]`),"expandRange"),y=t((d,E)=>`Missing ${d}: "${E}" - use "\\\\${E}" to match literal characters`,"syntaxError"),h=t(d=>{const E=[];let o=0,S=0,T=0,C="",w=!1;for(const N of d){if(w===!0){C+=N,w=!1;continue}if(N==="\\"){C+=N,w=!0;continue}if(N==='"'){T=T===1?0:1,C+=N;continue}if(T===0){if(N==="[")o++;else if(N==="]"&&o>0)o--;else if(o===0){if(N==="(")S++;else if(N===")"&&S>0)S--;else if(N==="|"&&S===0){E.push(C),C="";continue}}}C+=N}return E.push(C),E},"splitTopLevel"),v=t(d=>{let E=!1;for(const o of d){if(E===!0){E=!1;continue}if(o==="\\"){E=!0;continue}if(/[?*+@!()[\]{}]/.test(o))return!1}return!0},"isPlainBranch"),m=t(d=>{let E=d.trim(),o=!0;for(;o===!0;)o=!1,/^@\([^\\()[\]{}|]+\)$/.test(E)&&(E=E.slice(2,-1),o=!0);if(v(E))return E.replace(/\\(.)/g,"$1")},"normalizeSimpleBranch"),_=t(d=>{const E=d.map(m).filter(Boolean);for(let o=0;o<E.length;o++)for(let S=o+1;S<E.length;S++){const T=E[o],C=E[S],w=T[0];if(!(!w||T!==w.repeat(T.length)||C!==w.repeat(C.length))&&(T===C||T.startsWith(C)||C.startsWith(T)))return!0}return!1},"hasRepeatedCharPrefixOverlap"),A=t((d,E=!0)=>{if(d[0]!=="+"&&d[0]!=="*"||d[1]!=="(")return;let o=0,S=0,T=0,C=!1;for(let w=1;w<d.length;w++){const N=d[w];if(C===!0){C=!1;continue}if(N==="\\"){C=!0;continue}if(N==='"'){T=T===1?0:1;continue}if(T!==1){if(N==="["){o++;continue}if(N==="]"&&o>0){o--;continue}if(!(o>0)){if(N==="("){S++;continue}if(N===")"&&(S--,S===0))return E===!0&&w!==d.length-1?void 0:{type:d[0],body:d.slice(2,w),end:w}}}}},"parseRepeatedExtglob"),b=t(d=>{let E=0;const o=[];for(;E<d.length;){const S=A(d.slice(E),!1);if(!S||S.type!=="*")return;const T=h(S.body).map(w=>w.trim());if(T.length!==1)return;const C=m(T[0]);if(!C||C.length!==1)return;o.push(C),E+=S.end+1}return o.length<1?void 0:`${o.length===1?n.escapeRegex(o[0]):`[${o.map(S=>n.escapeRegex(S)).join("")}]`}*`},"getStarExtglobSequenceOutput"),q=t(d=>{let E=0,o=d.trim(),S=A(o);for(;S;)E++,o=S.body.trim(),S=A(o);return E},"repeatedExtglobRecursion"),H=t((d,E)=>{if(E.maxExtglobRecursion===!1)return{risky:!1};const o=typeof E.maxExtglobRecursion=="number"?E.maxExtglobRecursion:r.DEFAULT_MAX_EXTGLOB_RECURSION,S=h(d).map(T=>T.trim());if(S.length>1&&(S.some(T=>T==="")||S.some(T=>/^[*?]+$/.test(T))||_(S)))return{risky:!0};for(const T of S){const C=b(T);if(C)return{risky:!0,safeOutput:C};if(q(T)>o)return{risky:!0}}return{risky:!1}},"analyzeRepeatedExtglob"),W=t((d,E)=>{if(typeof d!="string")throw new TypeError("Expected a string");d=l[d]||d;const o={...E},S=typeof o.maxLength=="number"?Math.min(s,o.maxLength):s;let T=d.length;if(T>S)throw new SyntaxError(`Input length: ${T}, exceeds maximum allowed length: ${S}`);const C={type:"bos",value:"",output:o.prepend||""},w=[C],N=o.capture?"":"?:",j=r.globChars(o.windows),J=r.extglobChars(j),{DOT_LITERAL:V,PLUS_LITERAL:ge,SLASH_LITERAL:ae,ONE_CHAR:me,DOTS_SLASH:Z,NO_DOT:ke,NO_DOT_SLASH:Re,NO_DOTS_SLASH:ye,QMARK:Q,QMARK_NO_DOT:ve,STAR:Ce,START_ANCHOR:ce}=j,se=t(x=>`(${N}(?:(?!${ce}${x.dot?Z:V}).)*?)`,"globstar"),ue=o.dot?"":ke,I=o.dot?Q:ve;let U=o.bash===!0?se(o):Ce;o.capture&&(U=`(${U})`),typeof o.noext=="boolean"&&(o.noextglob=o.noext);const p={input:d,index:-1,start:0,dot:o.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:w};d=n.removePrefix(d,p),T=d.length;const le=[],ne=[],re=[];let c=C,u;const fe=t(()=>p.index===T-1,"eos"),K=p.peek=(x=1)=>d[p.index+x],ee=p.advance=()=>d[++p.index]||"",xe=t(()=>d.slice(p.index+1),"remaining"),pe=t((x="",Y=0)=>{p.consumed+=x,p.index+=Y},"consume"),_e=t(x=>{p.output+=x.output!=null?x.output:x.value,pe(x.value)},"append"),Hr=t(()=>{let x=1;for(;K()==="!"&&(K(2)!=="("||K(3)==="?");)ee(),p.start++,x++;return x%2===0?!1:(p.negated=!0,p.start++,!0)},"negate"),nt=t(x=>{p[x]++,re.push(x)},"increment"),Ee=t(x=>{p[x]--,re.pop()},"decrement"),F=t(x=>{if(c.type==="globstar"){const Y=p.braces>0&&(x.type==="comma"||x.type==="brace"),$=x.extglob===!0||le.length&&(x.type==="pipe"||x.type==="paren");x.type!=="slash"&&x.type!=="paren"&&!Y&&!$&&(p.output=p.output.slice(0,-c.output.length),c.type="star",c.value="*",c.output=U,p.output+=c.output)}if(le.length&&x.type!=="paren"&&(le[le.length-1].inner+=x.value),(x.value||x.output)&&_e(x),c&&c.type==="text"&&x.type==="text"){c.output=(c.output||c.value)+x.value,c.value+=x.value;return}x.prev=c,w.push(x),c=x},"push"),ot=t((x,Y)=>{const $={...J[Y],conditions:1,inner:""};$.prev=c,$.parens=p.parens,$.output=p.output,$.startIndex=p.index,$.tokensIndex=w.length;const B=(o.capture?"(":"")+$.open;nt("parens"),F({type:x,value:Y,output:p.output?"":me}),F({type:"paren",extglob:!0,value:ee(),output:B}),le.push($)},"extglobOpen"),Ir=t(x=>{const Y=d.slice(x.startIndex,p.index+1),$=d.slice(x.startIndex+2,p.index),B=H($,o);if((x.type==="plus"||x.type==="star")&&B.risky){const X=B.safeOutput?(x.output?"":me)+(o.capture?`(${B.safeOutput})`:B.safeOutput):void 0,be=w[x.tokensIndex];be.type="text",be.value=Y,be.output=X||n.escapeRegex(Y);for(let $e=x.tokensIndex+1;$e<w.length;$e++)w[$e].value="",w[$e].output="",delete w[$e].suffix;p.output=x.output+be.output,p.backtrack=!0,F({type:"paren",extglob:!0,value:u,output:""}),Ee("parens");return}let te=x.close+(o.capture?")":""),oe;if(x.type==="negate"){let X=U;if(x.inner&&x.inner.length>1&&x.inner.includes("/")&&(X=se(o)),(X!==U||fe()||/^\)+$/.test(xe()))&&(te=x.close=`)$))${X}`),x.inner.includes("*")&&(oe=xe())&&/^\.[^\\/.]+$/.test(oe)){const be=W(oe,{...E,fastpaths:!1}).output;te=x.close=`)${be})${X})`}x.prev.type==="bos"&&(p.negatedExtglob=!0)}F({type:"paren",extglob:!0,value:u,output:te}),Ee("parens")},"extglobClose");if(o.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(d)){let x=!1,Y=d.replace(f,($,B,te,oe,X,be)=>oe==="\\"?(x=!0,$):oe==="?"?B?B+oe+(X?Q.repeat(X.length):""):be===0?I+(X?Q.repeat(X.length):""):Q.repeat(te.length):oe==="."?V.repeat(te.length):oe==="*"?B?B+oe+(X?U:""):U:B?$:`\\${$}`);return x===!0&&(o.unescape===!0?Y=Y.replace(/\\/g,""):Y=Y.replace(/\\+/g,$=>$.length%2===0?"\\\\":$?"\\":"")),Y===d&&o.contains===!0?(p.output=d,p):(p.output=n.wrapOutput(Y,p,E),p)}for(;!fe();){if(u=ee(),u==="\0")continue;if(u==="\\"){const $=K();if($==="/"&&o.bash!==!0||$==="."||$===";")continue;if(!$){u+="\\",F({type:"text",value:u});continue}const B=/^\\+/.exec(xe());let te=0;if(B&&B[0].length>2&&(te=B[0].length,p.index+=te,te%2!==0&&(u+="\\")),o.unescape===!0?u=ee():u+=ee(),p.brackets===0){F({type:"text",value:u});continue}}if(p.brackets>0&&(u!=="]"||c.value==="["||c.value==="[^")){if(o.posix!==!1&&u===":"){const $=c.value.slice(1);if($.includes("[")&&(c.posix=!0,$.includes(":"))){const B=c.value.lastIndexOf("["),te=c.value.slice(0,B),oe=c.value.slice(B+2),X=i[oe];if(X){c.value=te+X,p.backtrack=!0,ee(),!C.output&&w.indexOf(c)===1&&(C.output=me);continue}}}(u==="["&&K()!==":"||u==="-"&&K()==="]")&&(u=`\\${u}`),u==="]"&&(c.value==="["||c.value==="[^")&&(u=`\\${u}`),o.posix===!0&&u==="!"&&c.value==="["&&(u="^"),c.value+=u,_e({value:u});continue}if(p.quotes===1&&u!=='"'){u=n.escapeRegex(u),c.value+=u,_e({value:u});continue}if(u==='"'){p.quotes=p.quotes===1?0:1,o.keepQuotes===!0&&F({type:"text",value:u});continue}if(u==="("){nt("parens"),F({type:"paren",value:u});continue}if(u===")"){if(p.parens===0&&o.strictBrackets===!0)throw new SyntaxError(y("opening","("));const $=le[le.length-1];if($&&p.parens===$.parens+1){Ir(le.pop());continue}F({type:"paren",value:u,output:p.parens?")":"\\)"}),Ee("parens");continue}if(u==="["){if(o.nobracket===!0||!xe().includes("]")){if(o.nobracket!==!0&&o.strictBrackets===!0)throw new SyntaxError(y("closing","]"));u=`\\${u}`}else nt("brackets");F({type:"bracket",value:u});continue}if(u==="]"){if(o.nobracket===!0||c&&c.type==="bracket"&&c.value.length===1){F({type:"text",value:u,output:`\\${u}`});continue}if(p.brackets===0){if(o.strictBrackets===!0)throw new SyntaxError(y("opening","["));F({type:"text",value:u,output:`\\${u}`});continue}Ee("brackets");const $=c.value.slice(1);if(c.posix!==!0&&$[0]==="^"&&!$.includes("/")&&(u=`/${u}`),c.value+=u,_e({value:u}),o.literalBrackets===!1||n.hasRegexChars($))continue;const B=n.escapeRegex(c.value);if(p.output=p.output.slice(0,-c.value.length),o.literalBrackets===!0){p.output+=B,c.value=B;continue}c.value=`(${N}${B}|${c.value})`,p.output+=c.value;continue}if(u==="{"&&o.nobrace!==!0){nt("braces");const $={type:"brace",value:u,output:"(",outputIndex:p.output.length,tokensIndex:p.tokens.length};ne.push($),F($);continue}if(u==="}"){const $=ne[ne.length-1];if(o.nobrace===!0||!$){F({type:"text",value:u,output:u});continue}let B=")";if($.dots===!0){const te=w.slice(),oe=[];for(let X=te.length-1;X>=0&&(w.pop(),te[X].type!=="brace");X--)te[X].type!=="dots"&&oe.unshift(te[X].value);B=g(oe,o),p.backtrack=!0}if($.comma!==!0&&$.dots!==!0){const te=p.output.slice(0,$.outputIndex),oe=p.tokens.slice($.tokensIndex);$.value=$.output="\\{",u=B="\\}",p.output=te;for(const X of oe)p.output+=X.output||X.value}F({type:"brace",value:u,output:B}),Ee("braces"),ne.pop();continue}if(u==="|"){le.length>0&&le[le.length-1].conditions++,F({type:"text",value:u});continue}if(u===","){let $=u;const B=ne[ne.length-1];B&&re[re.length-1]==="braces"&&(B.comma=!0,$="|"),F({type:"comma",value:u,output:$});continue}if(u==="/"){if(c.type==="dot"&&p.index===p.start+1){p.start=p.index+1,p.consumed="",p.output="",w.pop(),c=C;continue}F({type:"slash",value:u,output:ae});continue}if(u==="."){if(p.braces>0&&c.type==="dot"){c.value==="."&&(c.output=V);const $=ne[ne.length-1];c.type="dots",c.output+=u,c.value+=u,$.dots=!0;continue}if(p.braces+p.parens===0&&c.type!=="bos"&&c.type!=="slash"){F({type:"text",value:u,output:V});continue}F({type:"dot",value:u,output:V});continue}if(u==="?"){if(!(c&&c.value==="(")&&o.noextglob!==!0&&K()==="("&&K(2)!=="?"){ot("qmark",u);continue}if(c&&c.type==="paren"){const $=K();let B=u;(c.value==="("&&!/[!=<:]/.test($)||$==="<"&&!/<([!=]|\w+>)/.test(xe()))&&(B=`\\${u}`),F({type:"text",value:u,output:B});continue}if(o.dot!==!0&&(c.type==="slash"||c.type==="bos")){F({type:"qmark",value:u,output:ve});continue}F({type:"qmark",value:u,output:Q});continue}if(u==="!"){if(o.noextglob!==!0&&K()==="("&&(K(2)!=="?"||!/[!=<:]/.test(K(3)))){ot("negate",u);continue}if(o.nonegate!==!0&&p.index===0){Hr();continue}}if(u==="+"){if(o.noextglob!==!0&&K()==="("&&K(2)!=="?"){ot("plus",u);continue}if(c&&c.value==="("||o.regex===!1){F({type:"plus",value:u,output:ge});continue}if(c&&(c.type==="bracket"||c.type==="paren"||c.type==="brace")||p.parens>0){F({type:"plus",value:u});continue}F({type:"plus",value:ge});continue}if(u==="@"){if(o.noextglob!==!0&&K()==="("&&K(2)!=="?"){F({type:"at",extglob:!0,value:u,output:""});continue}F({type:"text",value:u});continue}if(u!=="*"){(u==="$"||u==="^")&&(u=`\\${u}`);const $=a.exec(xe());$&&(u+=$[0],p.index+=$[0].length),F({type:"text",value:u});continue}if(c&&(c.type==="globstar"||c.star===!0)){c.type="star",c.star=!0,c.value+=u,c.output=U,p.backtrack=!0,p.globstar=!0,pe(u);continue}let x=xe();if(o.noextglob!==!0&&/^\([^?]/.test(x)){ot("star",u);continue}if(c.type==="star"){if(o.noglobstar===!0){pe(u);continue}const $=c.prev,B=$.prev,te=$.type==="slash"||$.type==="bos",oe=B&&(B.type==="star"||B.type==="globstar");if(o.bash===!0&&(!te||x[0]&&x[0]!=="/")){F({type:"star",value:u,output:""});continue}const X=p.braces>0&&($.type==="comma"||$.type==="brace"),be=le.length&&($.type==="pipe"||$.type==="paren");if(!te&&$.type!=="paren"&&!X&&!be){F({type:"star",value:u,output:""});continue}for(;x.slice(0,3)==="/**";){const $e=d[p.index+4];if($e&&$e!=="/")break;x=x.slice(3),pe("/**",3)}if($.type==="bos"&&fe()){c.type="globstar",c.value+=u,c.output=se(o),p.output=c.output,p.globstar=!0,pe(u);continue}if($.type==="slash"&&$.prev.type!=="bos"&&!oe&&fe()){p.output=p.output.slice(0,-($.output+c.output).length),$.output=`(?:${$.output}`,c.type="globstar",c.output=se(o)+(o.strictSlashes?")":"|$)"),c.value+=u,p.globstar=!0,p.output+=$.output+c.output,pe(u);continue}if($.type==="slash"&&$.prev.type!=="bos"&&x[0]==="/"){const $e=x[1]!==void 0?"|$":"";p.output=p.output.slice(0,-($.output+c.output).length),$.output=`(?:${$.output}`,c.type="globstar",c.output=`${se(o)}${ae}|${ae}${$e})`,c.value+=u,p.output+=$.output+c.output,p.globstar=!0,pe(u+ee()),F({type:"slash",value:"/",output:""});continue}if($.type==="bos"&&x[0]==="/"){c.type="globstar",c.value+=u,c.output=`(?:^|${ae}|${se(o)}${ae})`,p.output=c.output,p.globstar=!0,pe(u+ee()),F({type:"slash",value:"/",output:""});continue}if(X&&x[0]==="/"){c.type="globstar",c.value+=u,c.output=`(?:^|${ae}|${se(o)}${ae})`,p.output+=c.output,p.globstar=!0,pe(u+ee()),F({type:"slash",value:"/",output:""});continue}p.output=p.output.slice(0,-c.output.length),c.type="globstar",c.output=se(o),c.value+=u,p.output+=c.output,p.globstar=!0,pe(u);continue}const Y={type:"star",value:u,output:U};if(o.bash===!0){Y.output=".*?",(c.type==="bos"||c.type==="slash")&&(Y.output=ue+Y.output),F(Y);continue}if(c&&(c.type==="bracket"||c.type==="paren")&&o.regex===!0){Y.output=u,F(Y);continue}(p.index===p.start||c.type==="slash"||c.type==="dot")&&(c.type==="dot"?(p.output+=Re,c.output+=Re):o.dot===!0?(p.output+=ye,c.output+=ye):(p.output+=ue,c.output+=ue),K()!=="*"&&(p.output+=me,c.output+=me)),F(Y)}for(;p.brackets>0;){if(o.strictBrackets===!0)throw new SyntaxError(y("closing","]"));p.output=n.escapeLast(p.output,"["),Ee("brackets")}for(;p.parens>0;){if(o.strictBrackets===!0)throw new SyntaxError(y("closing",")"));p.output=n.escapeLast(p.output,"("),Ee("parens")}for(;p.braces>0;){if(o.strictBrackets===!0)throw new SyntaxError(y("closing","}"));p.output=n.escapeLast(p.output,"{"),Ee("braces")}if(o.strictSlashes!==!0&&(c.type==="star"||c.type==="bracket")&&F({type:"maybe_slash",value:"",output:`${ae}?`}),p.backtrack===!0){p.output="";for(const x of p.tokens)p.output+=x.output!=null?x.output:x.value,x.suffix&&(p.output+=x.suffix)}return p},"parse");return W.fastpaths=(d,E)=>{const o={...E},S=typeof o.maxLength=="number"?Math.min(s,o.maxLength):s,T=d.length;if(T>S)throw new SyntaxError(`Input length: ${T}, exceeds maximum allowed length: ${S}`);d=l[d]||d;const{DOT_LITERAL:C,SLASH_LITERAL:w,ONE_CHAR:N,DOTS_SLASH:j,NO_DOT:J,NO_DOTS:V,NO_DOTS_SLASH:ge,STAR:ae,START_ANCHOR:me}=r.globChars(o.windows),Z=o.dot?V:J,ke=o.dot?ge:J,Re=o.capture?"":"?:",ye={negated:!1,prefix:""};let Q=o.bash===!0?".*?":ae;o.capture&&(Q=`(${Q})`);const ve=t(ue=>ue.noglobstar===!0?Q:`(${Re}(?:(?!${me}${ue.dot?j:C}).)*?)`,"globstar"),Ce=t(ue=>{switch(ue){case"*":return`${Z}${N}${Q}`;case".*":return`${C}${N}${Q}`;case"*.*":return`${Z}${Q}${C}${N}${Q}`;case"*/*":return`${Z}${Q}${w}${N}${ke}${Q}`;case"**":return Z+ve(o);case"**/*":return`(?:${Z}${ve(o)}${w})?${ke}${N}${Q}`;case"**/*.*":return`(?:${Z}${ve(o)}${w})?${ke}${Q}${C}${N}${Q}`;case"**/.*":return`(?:${Z}${ve(o)}${w})?${C}${N}${Q}`;default:{const I=/^(.*?)\.(\w+)$/.exec(ue);if(!I)return;const U=Ce(I[1]);return U?U+C+I[2]:void 0}}},"create"),ce=n.removePrefix(d,ye);let se=Ce(ce);return se&&o.strictSlashes!==!0&&(se+=`${w}?`),se},Dt=W,Dt}k(Kt,"It$1");we(Kt,"Bt");de(Kt,"requireParse");var Lt,ir;function Xt(){if(ir)return Lt;ir=1;var e=Object.defineProperty,t=de((l,g)=>e(l,"name",{value:g,configurable:!0}),"h");const r=Wt(),n=Kt(),s=Me(),i=Fe(),a=t(l=>l&&typeof l=="object"&&!Array.isArray(l),"isObject"),f=t((l,g,y=!1)=>{if(Array.isArray(l)){const H=l.map(W=>f(W,g,y));return t(W=>{for(const d of H){const E=d(W);if(E)return E}return!1},"arrayMatcher")}const h=a(l)&&l.tokens&&l.input;if(l===""||typeof l!="string"&&!h)throw new TypeError("Expected pattern to be a non-empty string");const v=g||{},m=v.windows,_=h?f.compileRe(l,g):f.makeRe(l,g,!1,!0),A=_.state;delete _.state;let b=t(()=>!1,"isIgnored");if(v.ignore){const H={...g,ignore:null,onMatch:null,onResult:null};b=f(v.ignore,H,y)}const q=t((H,W=!1)=>{const{isMatch:d,match:E,output:o}=f.test(H,_,g,{glob:l,posix:m}),S={glob:l,state:A,regex:_,posix:m,input:H,output:o,match:E,isMatch:d};if(typeof v.onResult=="function"&&v.onResult(S),d===!1)return S.isMatch=!1,W?S:!1;e:if(b(H)){if(typeof v.onIgnore=="function"&&v.onIgnore(S)===i.UNIGNORE){S.isMatch=!0;break e}return S.isMatch=!1,W?S:!1}return typeof v.onMatch=="function"&&v.onMatch(S),W?S:!0},"matcher");return y&&(q.state=A),q},"picomatch");return f.test=(l,g,y,{glob:h,posix:v}={})=>{if(typeof l!="string")throw new TypeError("Expected input to be a string");if(l==="")return{isMatch:!1,output:""};const m=y||{},_=m.format||(v?s.toPosixSlashes:null);let A=l===h,b=A&&_?_(l):l;return A===!1&&(b=_?_(l):l,A=b===h),(A===!1||m.capture===!0)&&(m.matchBase===!0||m.basename===!0?A=f.matchBase(l,g,y,v):A=g.exec(b)),{isMatch:!!A,match:A,output:b}},f.matchBase=(l,g,y)=>(g instanceof RegExp?g:f.makeRe(g,y)).test(s.basename(l)),f.isMatch=(l,g,y)=>f(g,y)(l),f.parse=(l,g)=>Array.isArray(l)?l.map(y=>f.parse(y,g)):n(l,{...g,fastpaths:!1}),f.scan=(l,g)=>r(l,g),f.compileRe=(l,g,y=!1,h=!1)=>{if(y===!0)return l.output;const v=g||{},m=v.contains?"":"^",_=v.contains?"":"$";let A=`${m}(?:${l.output})${_}`;l&&l.negated===!0&&(A=`^(?!${A}).*$`);const b=f.toRegex(A,g);return h===!0&&(b.state=l),b},f.makeRe=(l,g={},y=!1,h=!1)=>{if(!l||typeof l!="string")throw new TypeError("Expected a non-empty string");let v={negated:!1,fastpaths:!0};return g.fastpaths!==!1&&(l[0]==="."||l[0]==="*")&&(v.output=n.fastpaths(l,g)),v.output||(v=n(l,g)),f.compileRe(v,g,y,h)},f.toRegex=(l,g)=>{try{const y=g||{};return new RegExp(l,y.flags||(y.nocase?"i":""))}catch(y){if(g&&g.debug===!0)throw y;return/$^/}},f.constants=i,Lt=f,Lt}k(Xt,"wt");we(Xt,"Gt");de(Xt,"requirePicomatch$1");var Ht,sr;function zt(){if(sr)return Ht;sr=1;var e=Object.defineProperty,t=de((i,a)=>e(i,"name",{value:a,configurable:!0}),"c");const r=Xt(),n=Me();function s(i,a,f=!1){return a&&(a.windows===null||a.windows===void 0)&&(a={...a,windows:n.isWindows()}),r(i,a,f)}return k(s,"D"),we(s,"D"),de(s,"picomatch"),t(s,"picomatch"),Object.assign(s,r),Ht=s,Ht}k(zt,"Pt$1");we(zt,"Mt");de(zt,"requirePicomatch");var mn=zt();const Oe=at(mn);var yn=Object.defineProperty,L=k((e,t)=>yn(e,"name",{value:t,configurable:!0}),"u$1"),vn=Object.defineProperty,D=L((e,t)=>vn(e,"name",{value:t,configurable:!0}),"l");const bn=Qr(import.meta.url),Be=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ze=D(e=>{if(typeof Be<"u"&&Be.versions&&Be.versions.node){const[t,r]=Be.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return Be.getBuiltinModule(e)}return bn(e)},"__cjs_getBuiltinModule"),ar=ze("fs"),$n={...ar,default:ar},{statSync:An,stat:kn,realpathSync:xn,realpath:_n,readdirSync:En,readdir:Sn}=ze("fs"),{sep:br,basename:wn,dirname:Ft,resolve:$r,normalize:Rn,relative:Cn,posix:Pe,isAbsolute:On}=ze("path"),{fileURLToPath:Pn}=ze("url"),{createRequire:Tn}=ze("module");var Nn=Object.defineProperty,O=D((e,t)=>Nn(e,"name",{value:t,configurable:!0}),"r"),cr=Tn(import.meta.url);function ct(e){let t=Rn(e);return t.length>1&&t[t.length-1]===br&&(t=t.substring(0,t.length-1)),t}k(ct,"H");L(ct,"tt");D(ct,"M$1");O(ct,"cleanPath");const Dn=/[\\/]/g;function Qe(e,t){return e.replace(Dn,t)}k(Qe,"M$1");L(Qe,"T");D(Qe,"D$1");O(Qe,"convertSlashes");const Ln=/^[a-z]:[\\/]$/i;function lt(e){return e==="/"||Ln.test(e)}k(lt,"J");L(lt,"et");D(lt,"T$1");O(lt,"isRootDirectory");function De(e,t){const{resolvePaths:r,normalizePath:n,pathSeparator:s}=t,i=process.platform==="win32"&&e.includes("/")||e.startsWith(".");if(r&&(e=$r(e)),(n||i)&&(e=ct(e)),e===".")return"";const a=e[e.length-1]!==s;return Qe(a?e+s:e,s)}k(De,"q$1");L(De,"q");D(De,"w");O(De,"normalizePath");function Je(e,t){return t+e}k(Je,"B$1");L(Je,"I");D(Je,"P");O(Je,"joinPathWithBasePath");function ut(e,t){return function(r,n){return n.startsWith(e)?n.slice(e.length)+r:Qe(Cn(e,n),t.pathSeparator)+t.pathSeparator+r}}k(ut,"K");L(ut,"st");D(ut,"X");O(ut,"joinPathWithRelativePath");function pt(e){return e}k(pt,"V");L(pt,"rt");D(pt,"H");O(pt,"joinPath");function ft(e,t,r){return t+e+r}k(ft,"X$1");L(ft,"nt");D(ft,"U$1");O(ft,"joinDirectoryPath");function ht(e,t){const{relativePaths:r,includeBasePath:n}=t;return r&&e?ut(e,t):n?Je:pt}k(ht,"Z");L(ht,"it");D(ht,"J");O(ht,"build$7");function dt(e){return function(t,r){r.push(t.substring(e.length)||".")}}k(dt,"tt");L(dt,"ot");D(dt,"K$1");O(dt,"pushDirectoryWithRelativePath");function gt(e){return function(t,r,n){const s=t.substring(e.length)||".";n.every(i=>i(s,!0))&&r.push(s)}}k(gt,"et");L(gt,"ut");D(gt,"V");O(gt,"pushDirectoryFilterWithRelativePath");const Hn=O((e,t)=>{t.push(e||".")},"pushDirectory"),In=O((e,t,r)=>{const n=e||".";r.every(s=>s(n,!0))&&t.push(n)},"pushDirectoryFilter"),jn=O(()=>{},"empty$2");function mt(e,t){const{includeDirs:r,filters:n,relativePaths:s}=t;return r?s?n&&n.length?gt(e):dt(e):n&&n.length?In:Hn:jn}k(mt,"st");L(mt,"lt");D(mt,"st$1");O(mt,"build$6");const Fn=O((e,t,r,n)=>{n.every(s=>s(e,!1))&&r.files++},"pushFileFilterAndCount"),Mn=O((e,t,r,n)=>{n.every(s=>s(e,!1))&&t.push(e)},"pushFileFilter"),Gn=O((e,t,r,n)=>{r.files++},"pushFileCount"),Bn=O((e,t)=>{t.push(e)},"pushFile"),Un=O(()=>{},"empty$1");function yt(e){const{excludeFiles:t,filters:r,onlyCounts:n}=e;return t?Un:r&&r.length?n?Fn:Mn:n?Gn:Bn}k(yt,"it");L(yt,"at");D(yt,"ut$1");O(yt,"build$5");const qn=O(e=>e,"getArray"),Wn=O(()=>[""].slice(0,0),"getArrayGroup");function vt(e){return e.group?Wn:qn}k(vt,"nt");L(vt,"ct");D(vt,"ct$1");O(vt,"build$4");const Kn=O((e,t,r)=>{e.push({directory:t,files:r,dir:t})},"groupFiles"),Xn=O(()=>{},"empty");function bt(e){return e.group?Kn:Xn}k(bt,"rt");L(bt,"ht");D(bt,"ft$1");O(bt,"build$3");const zn=O(function(e,t,r){const{queue:n,fs:s,options:{suppressErrors:i}}=t;n.enqueue(),s.realpath(e,(a,f)=>{if(a)return n.dequeue(i?null:a,t);s.stat(f,(l,g)=>{if(l)return n.dequeue(i?null:l,t);if(g.isDirectory()&&Ve(e,f,t))return n.dequeue(null,t);r(g,f),n.dequeue(null,t)})})},"resolveSymlinksAsync"),Qn=O(function(e,t,r){const{queue:n,fs:s,options:{suppressErrors:i}}=t;n.enqueue();try{const a=s.realpathSync(e),f=s.statSync(a);if(f.isDirectory()&&Ve(e,a,t))return;r(f,a)}catch(a){if(!i)throw a}},"resolveSymlinks");function $t(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?Qn:zn}k($t,"ot");L($t,"pt");D($t,"gt$1");O($t,"build$2");function Ve(e,t,r){if(r.options.useRealPaths)return At(t,r);let n=Ft(e),s=1;for(;n!==r.root&&s<2;){const i=r.symlinks.get(n);i&&(i===t||i.startsWith(t)||t.startsWith(i))?s++:n=Ft(n)}return r.symlinks.set(e,t),s>1}k(Ve,"_$2");L(Ve,"L");D(Ve,"E$1");O(Ve,"isRecursive");function At(e,t){return t.visited.includes(e+t.options.pathSeparator)}k(At,"lt");L(At,"ft");D(At,"dt$1");O(At,"isRecursiveUsingRealPaths");const Jn=O(e=>e.counts,"onlyCountsSync"),Vn=O(e=>e.groups,"groupsSync"),Yn=O(e=>e.paths,"defaultSync"),Zn=O(e=>e.paths.slice(0,e.options.maxFiles),"limitFilesSync"),eo=O((e,t,r)=>(Ne(t,r,e.counts,e.options.suppressErrors),null),"onlyCountsAsync"),to=O((e,t,r)=>(Ne(t,r,e.paths,e.options.suppressErrors),null),"defaultAsync"),ro=O((e,t,r)=>(Ne(t,r,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),"limitFilesAsync"),no=O((e,t,r)=>(Ne(t,r,e.groups,e.options.suppressErrors),null),"groupsAsync");function Ne(e,t,r,n){t(e&&!n?e:null,r)}k(Ne,"A$3");L(Ne,"j");D(Ne,"y");O(Ne,"report");function kt(e,t){const{onlyCounts:r,group:n,maxFiles:s}=e;return r?t?Jn:eo:n?t?Vn:no:s?t?Zn:ro:t?Yn:to}k(kt,"at");L(kt,"gt");D(kt,"Et");O(kt,"build$1");const Ar={withFileTypes:!0},oo=O((e,t,r,n,s)=>{if(e.queue.enqueue(),n<0)return e.queue.dequeue(null,e);const{fs:i}=e;e.visited.push(t),e.counts.directories++,i.readdir(t||".",Ar,(a,f=[])=>{s(f,r,n),e.queue.dequeue(e.options.suppressErrors?null:a,e)})},"walkAsync"),io=O((e,t,r,n,s)=>{const{fs:i}=e;if(n<0)return;e.visited.push(t),e.counts.directories++;let a=[];try{a=i.readdirSync(t||".",Ar)}catch(f){if(!e.options.suppressErrors)throw f}s(a,r,n)},"walkSync");function xt(e){return e?io:oo}k(xt,"ut");L(xt,"yt");D(xt,"xt$1");O(xt,"build");var so=class{static{k(this,"De")}static{L(this,"we")}static{D(this,"_t")}static{O(this,"Queue")}count=0;constructor(e){this.onQueueEmpty=e}enqueue(){return this.count++,this.count}dequeue(e,t){this.onQueueEmpty&&(--this.count<=0||e)&&(this.onQueueEmpty(e,t),e&&(t.controller.abort(),this.onQueueEmpty=void 0))}},ao=class{static{k(this,"Ae")}static{L(this,"$e")}static{D(this,"At")}static{O(this,"Counter")}_files=0;_directories=0;set files(e){this._files=e}get files(){return this._files}set directories(e){this._directories=e}get directories(){return this._directories}get dirs(){return this._directories}},co=class{static{k(this,"Ee")}static{L(this,"Se")}static{D(this,"Wt")}static{O(this,"Aborter")}aborted=!1;abort(){this.aborted=!0}},kr=class{static{k(this,"Dt")}static{L(this,"mt")}static{D(this,"q")}static{O(this,"Walker")}root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,t,r){this.isSynchronous=!r,this.callbackInvoker=kt(t,this.isSynchronous),this.root=De(e,t),this.state={root:lt(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new ao,options:t,queue:new so((n,s)=>this.callbackInvoker(s,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new co,fs:t.fs||$n},this.joinPath=ht(this.root,t),this.pushDirectory=mt(this.root,t),this.pushFile=yt(t),this.getArray=vt(t),this.groupFiles=bt(t),this.resolveSymlink=$t(t,this.isSynchronous),this.walkDirectory=xt(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=O((e,t,r)=>{const{paths:n,options:{filters:s,resolveSymlinks:i,excludeSymlinks:a,exclude:f,maxFiles:l,signal:g,useRealPaths:y,pathSeparator:h},controller:v}=this.state;if(v.aborted||g&&g.aborted||l&&n.length>l)return;const m=this.getArray(this.state.paths);for(let _=0;_<e.length;++_){const A=e[_];if(A.isFile()||A.isSymbolicLink()&&!i&&!a){const b=this.joinPath(A.name,t);this.pushFile(b,m,this.state.counts,s)}else if(A.isDirectory()){let b=ft(A.name,t,this.state.options.pathSeparator);if(f&&f(A.name,b))continue;this.pushDirectory(b,n,s),this.walkDirectory(this.state,b,b,r-1,this.walk)}else if(this.resolveSymlink&&A.isSymbolicLink()){let b=Je(A.name,t);this.resolveSymlink(b,this.state,(q,H)=>{if(q.isDirectory()){if(H=De(H,this.state.options),f&&f(A.name,y?H:b+h))return;this.walkDirectory(this.state,H,y?H:b+h,r-1,this.walk)}else{H=y?H:b;const W=wn(H),d=De(Ft(H),this.state.options);H=this.joinPath(W,d),this.pushFile(H,m,this.state.counts,s)}})}}this.groupFiles(this.state.groups,t,m)},"walk")};function _t(e,t){return new Promise((r,n)=>{Ye(e,t,(s,i)=>{if(s)return n(s);r(i)})})}k(_t,"ct");L(_t,"bt");D(_t,"Ct");O(_t,"promise");function Ye(e,t,r){new kr(e,t,r).start()}k(Ye,"T$1");L(Ye,"G");D(Ye,"x");O(Ye,"callback");function Et(e,t){return new kr(e,t).start()}k(Et,"ht");L(Et,"vt");D(Et,"jt");O(Et,"sync");var lr=class{static{k(this,"kt")}static{L(this,"J")}static{D(this,"F")}static{O(this,"APIBuilder")}constructor(e,t){this.root=e,this.options=t}withPromise(){return _t(this.root,this.options)}withCallback(e){Ye(this.root,this.options,e)}sync(){return Et(this.root,this.options)}};let xr=null;try{cr.resolve("picomatch"),xr=cr("picomatch")}catch{}var lo=class{static{k(this,"We")}static{L(this,"ke")}static{D(this,"$t")}static{O(this,"Builder")}globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:br,filters:[]};globFunction;constructor(e){this.options={...this.options,...e},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(e){return this.options.pathSeparator=e,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(e){return this.options.maxDepth=e,this}withMaxFiles(e){return this.options.maxFiles=e,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:e=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=e,this.withFullPaths()}withAbortSignal(e){return this.options.signal=e,this}normalize(){return this.options.normalizePath=!0,this}filter(e){return this.options.filters.push(e),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(e){return this.options.exclude=e,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(e){return new lr(e||".",this.options)}withGlobFunction(e){return this.globFunction=e,this}crawlWithOptions(e,t){return this.options={...this.options,...t},new lr(e||".",this.options)}glob(...e){return this.globFunction?this.globWithOptions(e):this.globWithOptions(e,{dot:!0})}globWithOptions(e,...t){const r=this.globFunction||xr;if(!r)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[e.join("\0")];return n||(n=r(e,...t),this.globCache[e.join("\0")]=n),this.options.filters.push(s=>n(s)),this}},uo=Object.defineProperty,ie=D((e,t)=>uo(e,"name",{value:t,configurable:!0}),"a");const po=Array.isArray,_r=/\\/g,Er=process.platform==="win32",fo=/^(\/?\.\.)+$/;function We(e,t={}){const r=e.length,n=Array(r),s=Array(r);let i,a;for(i=0;i<r;i++){const f=Ze(e[i]);n[i]=f;const l=f.length,g=Array(l);for(a=0;a<l;a++)g[a]=Oe(f[a],t);s[i]=g}return f=>{const l=f.split("/");if(l[0]===".."&&fo.test(f))return!0;for(i=0;i<r;i++){const g=n[i],y=s[i],h=l.length,v=Math.min(h,g.length);for(a=0;a<v;){const m=g[a];if(m.includes("/"))return!0;if(!y[a](l[a]))break;if(!t.noglobstar&&m==="**")return!0;a++}if(a===h)return!0}return!1}}k(We,"R$1");L(We,"B");D(We,"D");ie(We,"getPartialMatcher");const ho=/^[A-Z]:\/$/i,go=Er?e=>ho.test(e):e=>e==="/";function Ke(e,t,r){if(e===t||t.startsWith(`${e}/`)){if(r){const s=e.length+ +!go(e);return(i,a)=>i.slice(s,a?-1:void 0)||"."}const n=t.slice(e.length+1);return n?(s,i)=>{if(s===".")return n;const a=`${n}/${s}`;return i?a.slice(0,-1):a}:(s,i)=>i&&s!=="."?s.slice(0,-1):s}return r?n=>Pe.relative(e,n)||".":n=>Pe.relative(e,`${t}/${n}`)||"."}k(Ke,"O$2");L(Ke,"M");D(Ke,"M");ie(Ke,"buildFormat");function St(e,t){if(t.startsWith(`${e}/`)){const r=t.slice(e.length+1);return n=>`${r}/${n}`}return r=>{const n=Pe.relative(e,`${t}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}k(St,"pt");L(St,"St");D(St,"at");ie(St,"buildRelative");const mo={parts:!0};function Ze(e){var t;const r=Oe.scan(e,mo);return!((t=r.parts)===null||t===void 0)&&t.length?r.parts:[e]}k(Ze,"I$3");L(Ze,"z");D(Ze,"N");ie(Ze,"splitPattern");const yo=/\\(?![()[\]{}!+@])/g;function Qt(e){return Sr(e)}k(Qt,"qt");L(Qt,"Ee");D(Qt,"ut");ie(Qt,"convertPosixPathToPattern");function Jt(e){return wr(e).replace(yo,"/")}k(Jt,"jt");L(Jt,"Re");D(Jt,"ft");ie(Jt,"convertWin32PathToPattern");const vo=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,bo=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Sr=ie(e=>e.replace(vo,"\\$&"),"escapePosixPath"),wr=ie(e=>e.replace(bo,"\\$&"),"escapeWin32Path"),$o=Er?wr:Sr;function wt(e,t){if(t?.caseSensitiveMatch===!1)return!0;const r=Oe.scan(e);return r.isGlob||r.negated}k(wt,"ft");L(wt,"Dt");D(wt,"k");ie(wt,"isDynamicPattern");function Se(...e){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...e)}k(Se,"D$1");L(Se,"D");D(Se,"E");ie(Se,"log");function et(e){return typeof e=="string"?[e]:e??[]}k(et,"L$1");L(et,"U");D(et,"W");ie(et,"ensureStringArray");const Ao=/^(\/?\.\.)+/,ko=/\\(?=[()[\]{}!*+?@|])/g;function Le(e,t,r,n){var s;const i=t.cwd;let a=e;e[e.length-1]==="/"&&(a=e.slice(0,-1));const f=a.lastIndexOf("/"),l=(f===-1?a:a.slice(f+1)).startsWith("!(");a[a.length-1]!=="*"&&!l&&t.expandDirectories&&(a+="/**");const g=$o(i);a=On(a.replace(ko,""))?Pe.relative(g,a):Pe.normalize(a);const y=(s=Ao.exec(a))===null||s===void 0?void 0:s[0],h=Ze(a);if(y){const m=(y.length+1)/3;let _=0;const A=g.split("/");for(;_<m&&h[_+m]===A[A.length+_-m];)a=a.slice(0,(m-_-1)*3)+a.slice((m-_)*3+h[_+m].length+1)||".",_++;const b=Pe.join(i,y.slice(_*3));b[0]!=="."&&r.root.length>b.length&&(r.root=b,r.depthOffset=-m+_)}if(!n&&r.depthOffset>=0){var v;(v=r.commonPath)!==null&&v!==void 0||(r.commonPath=h);const m=[],_=Math.min(r.commonPath.length,h.length);for(let A=0;A<_;A++){const b=h[A];if(b==="**"&&!h[A+1]){m.pop();break}if(A===h.length-1||b!==r.commonPath[A]||wt(b))break;m.push(b)}r.depthOffset=m.length,r.commonPath=m,r.root=m.length>0?Pe.join(i,...m):i}return a}k(Le,"j$1");L(Le,"E");D(Le,"$");ie(Le,"normalizePattern");function Rt(e,t,r){const n=[],s=[],i=[];for(const a of e.ignore)a&&(a[0]!=="!"||a[1]==="("?s.push(Le(a,e,r,!0)):i.push(a.slice(1)));for(const a of t)a&&(a[0]!=="!"||a[1]==="("?n.push(Le(a,e,r,!1)):(a[1]!=="!"||a[2]==="(")&&s.push(Le(a.slice(1),e,r,!0)));return{match:n,ignore:s,unignore:i}}k(Rt,"gt");L(Rt,"xt");D(Rt,"St");ie(Rt,"processPatterns");function Ct(e,t){const r=e.cwd,n={root:r,depthOffset:0},s=Rt(e,t,n);e.debug&&Se("internal processing patterns:",s);const{absolute:i,caseSensitiveMatch:a,debug:f,dot:l,followSymbolicLinks:g,onlyDirectories:y}=e,h=n.root.replace(_r,""),v={dot:l,nobrace:e.braceExpansion===!1,nocase:!a,noextglob:e.extglob===!1,noglobstar:e.globstar===!1,posix:!0},m=s.unignore.length>0,_=m?Oe(s.unignore,v):void 0,A=m?We(s.unignore,v):void 0,b=Oe(s.match,{...v,ignore:s.ignore,onIgnore:_?C=>_(C.output)&&Oe.constants.UNIGNORE:void 0}),q=Oe(s.ignore,v),H=We(s.match,v),W=Ke(r,h,i),d=i?W:Ke(r,h,!0),E=s.match.length>0&&s.match.every(C=>C==="**"||C==="**/*"),o=s.ignore.length>0||m||!E?(C,w)=>{const N=d(w,!0);return N==="."||A&&A(N)?!1:!H(N)||q(N)}:void 0;let S;e.deep!==void 0&&(S=Math.round(e.deep-n.depthOffset));const T=new lo({filters:[f?(C,w)=>{const N=W(C,w),j=b(N);return j&&Se(`matched ${N}`),j}:(C,w)=>{const N=W(C,w);return b(N)}],exclude:f&&o?(C,w)=>{const N=o(C,w);return Se(`${N?"skipped":"crawling"} ${w}`),N}:o,fs:e.fs,pathSeparator:"/",relativePaths:!i,resolvePaths:i,includeBasePath:i,resolveSymlinks:g,excludeSymlinks:!g,excludeFiles:y,includeDirs:y||!e.onlyFiles,maxDepth:S,signal:e.signal}).crawl(h);return e.debug&&Se("internal properties:",{...n,root:h}),[T,r!==h&&!i&&St(r,h)]}k(Ct,"dt");L(Ct,"At");D(Ct,"vt");ie(Ct,"buildCrawler");function tt(e,t){if(t)for(let r=e.length-1;r>=0;r--)e[r]=t(e[r]);return e}k(tt,"z$1");L(tt,"N");D(tt,"U");ie(tt,"formatPaths");const xo={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Ot(e){const t={...xo,...e};return t.cwd=(t.cwd instanceof URL?Pn(t.cwd):$r(t.cwd)).replace(_r,"/"),t.ignore=et(t.ignore),t.fs&&(t.fs={readdir:t.fs.readdir||Sn,readdirSync:t.fs.readdirSync||En,realpath:t.fs.realpath||_n,realpathSync:t.fs.realpathSync||xn,stat:t.fs.stat||kn,statSync:t.fs.statSync||An}),t.debug&&Se("globbing with options:",t),t}k(Ot,"yt");L(Ot,"_t");D(Ot,"pt");ie(Ot,"getOptions");function rt(e,t={}){var r;if(e&&t?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const n=po(e)||typeof e=="string",s=et((r=n?e:e.patterns)!==null&&r!==void 0?r:"**/*"),i=Ot(n?t:e);return s.length>0?Ct(i,s):[]}k(rt,"G$1");L(rt,"Q");D(rt,"G");ie(rt,"getCrawler");async function Pt(e,t){const[r,n]=rt(e,t);return r?tt(await r.withPromise(),n):[]}k(Pt,"mt");L(Pt,"Ie");D(Pt,"bt");ie(Pt,"glob");function Vt(e,t){const[r,n]=rt(e,t);return r?tt(r.sync(),n):[]}k(Vt,"vt");L(Vt,"Le");D(Vt,"xt");ie(Vt,"globSync");var _o=Object.defineProperty,Eo=k((e,t)=>_o(e,"name",{value:t,configurable:!0}),"r$1"),So=Object.defineProperty,wo=Eo((e,t)=>So(e,"name",{value:t,configurable:!0}),"r"),Ro=Object.defineProperty,Co=wo((e,t)=>Ro(e,"name",{value:t,configurable:!0}),"r");const Oo=Co(async(e,t)=>await Pt(e,t),"glob");var Po=Object.defineProperty,Ae=k((e,t)=>Po(e,"name",{value:t,configurable:!0}),"d$1");const To=["dependencies","devDependencies","peerDependencies","peerDependenciesMeta","optionalDependencies","bundleDependencies"],No=["overrides","pnpm","resolutions"],Do=["engines","files"],Lo=Ae(e=>{const t=yr.coerce(e)?.major;return t!==void 0&&t>=10},"isPnpmV10Plus"),Ho=Ae(e=>{const t=Te(e,"pnpm-workspace.yaml");if(!Gt(t))return{overrides:{},source:"pnpm-workspace.yaml"};try{return{overrides:Br(t)?.overrides??{},source:"pnpm-workspace.yaml"}}catch{return{overrides:{},source:"pnpm-workspace.yaml"}}},"readPnpmWorkspaceOverrides"),Io=Ae((e,t)=>{let r={};return t==="deno"?{overrides:{},source:"package.json"}:(t==="pnpm"?r=e.pnpm?.overrides??{}:t==="yarn"||t==="bun"?r=e.resolutions??{}:r=e.overrides??{},{overrides:r,source:"package.json"})},"readPkgJsonOverrides"),jo=Ae((e,t,r)=>r.name==="pnpm"&&Lo(r.version)?Ho(e):Io(t,r.name),"readOverrides"),ur=Ae((e,t)=>{const r=t;for(const s of No){const i=e.indexOf(s);if(i!==-1&&s!==r)return r==="overrides"?i:i+1}let n=-1;for(const s of To){const i=e.indexOf(s);i>n&&(n=i)}if(n!==-1)return n+1;for(const s of Do){const i=e.indexOf(s);if(i!==-1)return i}return e.length},"findInsertIndex"),Fo=Ae((e,t)=>{const r=Te(e,"pnpm-workspace.yaml");if(!Gt(r))throw new Error(`pnpm-workspace.yaml not found at ${r}. Cannot write overrides for pnpm v10+.`);let n=Xe(r);const s=`overrides:
|
|
4
4
|
${Object.entries(t).map(([i,a])=>` '${i}': '${a}'`).join(`
|
|
5
5
|
`)}
|
|
6
6
|
`;n=/^overrides:\s*$/m.test(n)||/^overrides:\s*\n/m.test(n)?n.replace(/^overrides:\s*\n(?:(?:[ \t].*)?\n)*/m,s):`${n.trimEnd()}
|
|
7
7
|
|
|
8
|
-
${s}`,Ue(r,n)},"writePnpmWorkspaceOverrides"),
|
|
8
|
+
${s}`,Ue(r,n)},"writePnpmWorkspaceOverrides"),Mo=Ae((e,t,r,n,s)=>{const i=Xe(e),a=Ur(e,i,{useEditorconfig:s});if(n==="pnpm"){const f=t.pnpm??{};if(f.overrides=r,t.pnpm)t.pnpm=f,Ue(e,`${JSON.stringify(t,null,a)}
|
|
9
9
|
`);else{const l=Object.keys(t),g=ur(l,"pnpm"),y=Object.entries(t);y.splice(g,0,["pnpm",f]),Ue(e,`${JSON.stringify(Object.fromEntries(y),null,a)}
|
|
10
10
|
`)}}else{const f=n==="yarn"||n==="bun"?"resolutions":"overrides";if(t[f])t[f]=r,Ue(e,`${JSON.stringify(t,null,a)}
|
|
11
11
|
`);else{const l=Object.keys(t),g=ur(l,f),y=Object.entries(t);y.splice(g,0,[f,r]),Ue(e,`${JSON.stringify(Object.fromEntries(y),null,a)}
|
|
12
|
-
`)}}},"writePkgJsonOverrides"),Go=Ae((e,t,r,n,s)=>{if(n.name==="deno")return{added:[],updated:[]};const i=Xe(t),a=JSON.parse(i),{overrides:f,source:l}=jo(e,a,n),g=[],y=[],h=new Set;if(n.name==="npm")for(const m of["dependencies","devDependencies"]){const _=a[m];if(_)for(const A of Object.keys(_))h.add(A)}for(const m of r){const _=f[m.original];if(typeof _=="object")continue;let A=m.spec;n.name==="npm"&&h.has(m.original)&&(A=`$${m.original}`),_!==A&&(_?y.push(m.original):g.push(m.original),f[m.original]=A)}if(g.length===0&&y.length===0)return{added:g,updated:y};const v=Object.fromEntries(Object.entries(f).sort(([m],[_])=>m.localeCompare(_)));return l==="pnpm-workspace.yaml"?Mo(e,v):Fo(t,a,v,n.name,s),{added:g,updated:y}},"applyOverrides"),Bo=Ae((e,t)=>{const r={bun:["bun.lock"],deno:["deno.lock"],npm:["npm-shrinkwrap.json","package-lock.json"],pnpm:["pnpm-lock.yaml"],yarn:["yarn.lock"]};for(const n of r[t]??[]){const s=Te(e,n);try{return Xe(s)}catch{continue}}return""},"readLockfileText"),Uo=Ae((e,t,r)=>{if(!e)return!1;const n=t.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`);switch(r){case"bun":return e.includes(`"${t}":`)||new RegExp(String.raw`(^|\s|[",])${n}@`,"m").test(e);case"deno":return e.includes(`"${t}"`)||e.includes(`"npm:${t}@`)||e.includes(`"jsr:${t}@`);case"npm":return e.includes(`"${t}":`)||e.includes(`"node_modules/${t}":`);case"pnpm":return new RegExp(String.raw`(^|\s|['"/])${n}(@|['"]?:)`,"m").test(e);case"yarn":return new RegExp(String.raw`(^|\s|[",])${n}@`,"m").test(e);default:return!1}},"lockfileContainsPackage");var It={exports:{}},jt,pr;function fr(){if(pr)return jt;pr=1;var e=Object.defineProperty,t=k((h,v)=>e(h,"name",{value:v,configurable:!0}),"t"),r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,a=t((h,v)=>{for(var m in v)r(h,m,{get:v[m],enumerable:!0})},"__export"),f=t((h,v,m,_)=>{if(v&&typeof v=="object"||typeof v=="function")for(let A of s(v))!i.call(h,A)&&A!==m&&r(h,A,{get:t(()=>v[A],"get"),enumerable:!(_=n(v,A))||_.enumerable});return h},"__copyProps"),l=t(h=>f(r({},"__esModule",{value:!0}),h),"__toCommonJS"),g={};a(g,{PURL_Type:t(()=>y,"PURL_Type")}),jt=l(g);var y=(h=>(h.APK="apk",h.BITBUCKET="bitbucket",h.COCOAPODS="cocoapods",h.CARGO="cargo",h.CHROME="chrome",h.COMPOSER="composer",h.CONAN="conan",h.CONDA="conda",h.CRAN="cran",h.DEB="deb",h.DOCKER="docker",h.GEM="gem",h.GENERIC="generic",h.GITHUB="github",h.GOLANG="golang",h.HACKAGE="hackage",h.HEX="hex",h.HUGGINGFACE="huggingface",h.MAVEN="maven",h.MLFLOW="mlflow",h.NPM="npm",h.NUGET="nuget",h.OCI="oci",h.PUB="pub",h.PYPI="pypi",h.QPKG="qpkg",h.RPM="rpm",h.SWID="swid",h.SWIFT="swift",h.VCS="vcs",h))(y||{});return jt}k(fr,"requireTypes");var hr;function qo(){return hr||(hr=1,(function(e){var t=Object.defineProperty,r=k((v,m)=>t(v,"name",{value:m,configurable:!0}),"a"),n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,f=r((v,m)=>{for(var _ in m)n(v,_,{get:m[_],enumerable:!0})},"__export"),l=r((v,m,_,A)=>{if(m&&typeof m=="object"||typeof m=="function")for(let b of i(m))!a.call(v,b)&&b!==_&&n(v,b,{get:r(()=>m[b],"get"),enumerable:!(A=s(m,b))||A.enumerable});return v},"__copyProps"),g=r((v,m,_)=>(l(v,m,"default"),_&&l(_,m,"default")),"__reExport"),y={};f(y,{getManifestData:r(()=>h,"getManifestData")}),g(y,fr(),e.exports);function h(v,m){try{const _=require("../manifest.json");if(!v)return _;const A=_[v];if(!A)return;if(!m)return A;const b=A.find(([q,H])=>H.package===m);return b?b[1]:void 0}catch{return}}k(h,"getManifestData"),r(h,"getManifestData"),e.exports={getManifestData:h,...fr()}})(It)),It.exports}k(qo,"requireDist");var Wo=qo(),Ko=Object.defineProperty,qe=k((e,t)=>Ko(e,"name",{value:t,configurable:!0}),"s");const Xo=qe((e,t,r)=>{let n=e;if(t!=="all"&&(n=n.filter(s=>s.category===t)),r){const s=r.toLowerCase();n=n.filter(i=>i.packageName.toLowerCase().includes(s))}return n},"filterEntries");class zo{static{k(this,"h")}static{qe(this,"OptimizeStore")}#e;#r=new Set;constructor(t){this.#e={applyProgress:null,checkedEntries:new Set,entries:t,error:null,filterActive:!1,filterText:"",filterType:"all",focusedPanel:"list",phase:"browsing",selectedIndex:0}}getSnapshot=qe(()=>this.#e,"getSnapshot");subscribe=qe(t=>(this.#r.add(t),()=>{this.#r.delete(t)}),"subscribe");getFilteredEntries=qe(()=>Xo(this.#e.entries,this.#e.filterType,this.#e.filterText),"getFilteredEntries");#t(){this.#e={...this.#e};for(const t of this.#r)t()}select(t){const r=this.getFilteredEntries();this.#e.selectedIndex=r.length===0?-1:Math.max(0,Math.min(t,r.length-1)),this.#t()}toggleCheck(t){const r=new Set(this.#e.checkedEntries);r.has(t)?r.delete(t):r.add(t),this.#e.checkedEntries=r,this.#t()}toggleAll(){const t=this.getFilteredEntries(),r=new Set(this.#e.checkedEntries);if(t.every(n=>r.has(n.packageName)))for(const n of t)r.delete(n.packageName);else for(const n of t)r.add(n.packageName);this.#e.checkedEntries=r,this.#t()}setFilter(t){this.#e.filterType=t,this.#e.selectedIndex=0,this.#t()}setFilterText(t){this.#e.filterText=t,this.#e.selectedIndex=0,this.#t()}setFilterActive(t){this.#e.filterActive=t,this.#t()}setFocusedPanel(t){this.#e.focusedPanel=t,this.#t()}setPhase(t){this.#e.phase=t,this.#t()}setProgress(t,r){this.#e.applyProgress={current:t,total:r},this.#t()}setError(t){this.#e.error=t,this.#e.phase="error",this.#t()}getCheckedEntries(){return this.#e.entries.filter(t=>this.#e.checkedEntries.has(t.packageName))}}const Rr={"micro-utility":"gray",native:"green",preferred:"yellow",socket:"cyan"},Qo={"micro-utility":"MICRO",native:"NATIVE",preferred:"PREF",socket:"SOCKET"},Jo={"micro-utility":"Trivial utility package that can be replaced with inline code.",native:"Polyfill for a native JS/Node.js API. Use the built-in instead.",preferred:"A lighter or faster alternative package exists.",socket:"Security-hardened replacement from Socket.dev's @socketregistry."};var Vo=Object.defineProperty,Yo=k((e,t)=>Vo(e,"name",{value:t,configurable:!0}),"d");const Zo=Yo(({entry:e,focused:t,scrollRef:r})=>{const n=t?"white":"gray";if(!e)return R(G,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:R(P,{dimColor:!0,children:"No entry selected"})});const s=Rr[e.category]??"gray";return F(G,{borderColor:n,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[R(G,{flexShrink:0,paddingTop:1,paddingX:2,children:R(P,{bold:!0,color:"white",children:e.packageName})}),F(ln,{flexGrow:1,flexShrink:1,paddingX:2,ref:r,scrollbar:!0,scrollbarColor:"gray",children:[R(P,{}),F(G,{children:[R(G,{width:14,children:R(P,{dimColor:!0,children:"Category:"})}),R(P,{bold:!0,color:s,children:e.category})]}),F(G,{children:[R(G,{width:14,children:R(P,{dimColor:!0,children:"Replace with:"})}),R(P,{children:e.replacement})]}),e.overrideSpec&&F(G,{children:[R(G,{width:14,children:R(P,{dimColor:!0,children:"Override:"})}),R(P,{color:"cyan",children:e.overrideSpec})]}),F(G,{children:[R(G,{width:14,children:R(P,{dimColor:!0,children:"Codemod:"})}),R(P,{color:e.hasCodemod?"green":"gray",children:e.hasCodemod?"available ⚙":"not available"})]}),F(G,{flexDirection:"column",marginTop:1,children:[R(P,{dimColor:!0,children:"── "}),R(P,{bold:!0,color:"white",children:"DESCRIPTION"}),R(G,{marginTop:1,paddingLeft:2,children:R(P,{children:Jo[e.category]??""})})]}),e.category==="native"&&F(G,{flexDirection:"column",marginTop:1,children:[R(P,{dimColor:!0,children:"── "}),R(P,{bold:!0,color:"green",children:"ACTION"}),R(G,{flexDirection:"column",marginTop:1,paddingLeft:2,children:e.hasCodemod?F(it,{children:[F(P,{color:"green",children:["✓"," ","Codemod will rewrite imports to use native API."]}),R(P,{dimColor:!0,children:" The package can then be removed from dependencies."})]}):F(it,{children:[F(P,{color:"yellow",children:["ℹ"," ","No automated codemod available."]}),R(P,{dimColor:!0,children:" Manual migration required — replace usage with native equivalent."})]})})]}),e.category==="socket"&&F(G,{flexDirection:"column",marginTop:1,children:[R(P,{dimColor:!0,children:"── "}),R(P,{bold:!0,color:"cyan",children:"ACTION"}),F(G,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[F(P,{color:"cyan",children:["✓"," ","Override will redirect resolution to the hardened package."]}),R(P,{dimColor:!0,children:" No source code changes needed — drop-in replacement."})]})]}),(e.category==="preferred"||e.category==="micro-utility")&&F(G,{flexDirection:"column",marginTop:1,children:[R(P,{dimColor:!0,children:"── "}),R(P,{bold:!0,color:"yellow",children:"ACTION"}),R(G,{flexDirection:"column",marginTop:1,paddingLeft:2,children:e.hasCodemod?F(it,{children:[F(P,{color:"green",children:["✓"," ","Codemod will rewrite imports to the recommended alternative."]}),R(P,{dimColor:!0,children:" The original package can then be removed from dependencies."})]}):F(it,{children:[F(P,{color:"yellow",children:["ℹ"," ","Manual migration required."]}),e.docUrl?R(P,{dimColor:!0,children:" Open the migration guide below for the recommended alternative and steps."}):R(P,{dimColor:!0,children:" Consult the package's docs or the e18e module-replacements guide for an alternative."})]})})]}),F(G,{flexDirection:"column",marginTop:1,children:[R(P,{dimColor:!0,children:"── "}),R(P,{bold:!0,color:"white",children:"LINKS"}),F(G,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[F(P,{color:"cyan",underline:!0,children:["https://npmx.dev/",e.packageName]}),e.docUrl&&R(P,{color:"cyan",underline:!0,children:e.docUrl})]})]})]})]})},"OptimizeDetailPanel");var ei=Object.defineProperty,Cr=k((e,t)=>ei(e,"name",{value:t,configurable:!0}),"b$1");const ti=[{key:"all",label:"All",shortcut:"1"},{key:"native",label:"Native",shortcut:"2"},{key:"preferred",label:"Preferred",shortcut:"3"},{key:"micro-utility",label:"Micro",shortcut:"4"},{key:"socket",label:"Socket",shortcut:"5"}],ri=Cr(({checked:e,entry:t,isSelected:r})=>{const n=Rr[t.category]??"white",s=Qo[t.category]??t.category,i=e?"☑":"☐",a=t.hasCodemod?"⚙":" ";return F(G,{flexShrink:0,height:1,children:[R(P,{children:r?">":" "}),F(P,{color:e?"white":"gray",children:[" ",i," "]}),R(P,{bold:!0,color:n,children:`[${s}]`.padEnd(9)}),F(P,{children:[" ",a," "]}),R(G,{flexGrow:1,children:R(P,{bold:r,inverse:r,wrap:"truncate",children:t.packageName})}),R(P,{dimColor:!0,children:" → "}),R(P,{wrap:"truncate",children:t.replacement})]})},"EntryRow"),ni=Cr(({checkedEntries:e,entries:t,filterActive:r,filterText:n,filterType:s,focused:i,isDryRun:a,scrollOffset:f,selectedIndex:l,totalEntries:g,viewportHeight:y})=>{const h=i?"white":"gray";let v=0,m=0,_=0,A=0;for(const o of t)switch(o.category){case"micro-utility":{_++;break}case"native":{v++;break}case"preferred":{m++;break}case"socket":{A++;break}}const b=[];v>0&&b.push(`${v} native`),m>0&&b.push(`${m} preferred`),_>0&&b.push(`${_} micro`),A>0&&b.push(`${A} socket`);const q=b.length>0?` (${b.join(", ")})`:"",H=e.size,W=[];for(const[o,S]of t.entries())W.push(R(ri,{checked:e.has(S.packageName),entry:S,isSelected:o===l},S.packageName));const d=t.length,E=d>y&&y>0;return F(G,{borderColor:h,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[F(G,{flexShrink:0,gap:1,paddingX:1,children:[R(P,{bold:!0,inverse:!0,children:" VIS OPTIMIZE "}),F(P,{wrap:"truncate",children:[g," ","optimizations",q]}),!a&&H>0&&F(P,{dimColor:!0,children:[" ","—",H," ","selected"]})]}),R(G,{flexShrink:0,gap:1,paddingX:1,paddingY:1,children:ti.map(o=>{const S=s===o.key;return F(G,{children:[R(P,{dimColor:!S,children:"["}),R(P,{bold:S,color:S?"cyan":"gray",children:o.shortcut}),R(P,{dimColor:!S,children:"]"}),F(P,{color:S?"white":"gray",children:[" ",o.label]})]},o.key)})}),r&&F(G,{flexShrink:0,paddingX:1,children:[R(P,{bold:!0,color:"white",children:"/ "}),R(P,{children:n}),R(P,{inverse:!0,children:" "})]}),F(G,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[R(G,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:R(G,{flexDirection:"column",marginTop:-f,children:W})}),E&&R(G,{flexShrink:0,marginLeft:1,marginRight:1,children:R(un,{contentHeight:d,placement:"inset",scrollOffset:f,style:"block",viewportHeight:y})})]})]})},"OptimizeListPanel");var oi=Object.defineProperty,ii=k((e,t)=>oi(e,"name",{value:t,configurable:!0}),"I$1");const si=100,dr=10,gr={1:"all",2:"native",3:"preferred",4:"micro-utility",5:"socket"},ai=ii(({isDryRun:e,store:t})=>{const{exit:r}=sn(),{columns:n,rows:s}=cn(),i=rn(t.subscribe,t.getSnapshot),a=nn(null),[f,l]=Zt(0),[g,y]=Zt(!1),h=t.getFilteredEntries(),v=h[i.selectedIndex]??null,m=n>=si,_=Math.max(0,s-5),A=on(b=>{r(b)},[r]);return an((b,q)=>{if(g){b==="y"||b==="Y"?A():y(!1);return}if(i.filterActive){q.escape?(t.setFilterActive(!1),t.setFilterText("")):q.return?t.setFilterActive(!1):q.backspace||q.delete?t.setFilterText(i.filterText.slice(0,-1)):b&&!q.ctrl&&!q.meta&&t.setFilterText(i.filterText+b);return}if(b==="q"){!e&&i.checkedEntries.size>0?y(!0):A();return}if(b==="/"){t.setFilterActive(!0);return}if(gr[b]){t.setFilter(gr[b]);return}if(q.tab){t.setFocusedPanel(i.focusedPanel==="list"?"detail":"list");return}if(i.focusedPanel==="list")if(q.upArrow||b==="k"){const H=Math.max(0,i.selectedIndex-1);t.select(H),H<f&&l(H)}else if(q.downArrow||b==="j"){const H=Math.min(h.length-1,i.selectedIndex+1);t.select(H),H>=f+_&&l(H-_+1)}else b===" "?v&&t.toggleCheck(v.packageName):b==="a"?t.toggleAll():q.return&&!e&&i.checkedEntries.size>0&&A(t.getCheckedEntries());else i.focusedPanel==="detail"&&(q.upArrow||b==="k"?a.current?.scrollBy(-1):(q.downArrow||b==="j")&&a.current?.scrollBy(1))},{isActive:i.phase==="browsing"}),s<dr?R(G,{alignItems:"center",justifyContent:"center",children:F(P,{color:"yellow",children:["Terminal too small. Resize to at least",dr," ","rows."]})}):F(G,{flexDirection:"column",height:s,width:n,children:[F(G,{flexDirection:m?"row":"column",flexGrow:1,children:[R(G,{flexBasis:m?"50%":void 0,flexGrow:1,children:R(ni,{checkedEntries:i.checkedEntries,entries:h,filterActive:i.filterActive,filterText:i.filterText,filterType:i.filterType,focused:i.focusedPanel==="list",isDryRun:e,scrollOffset:f,selectedIndex:i.selectedIndex,totalEntries:i.entries.length,viewportHeight:_})}),R(G,{flexBasis:m?"50%":void 0,flexGrow:1,children:R(Zo,{entry:v,focused:i.focusedPanel==="detail",scrollRef:a})})]}),R(G,{flexShrink:0,paddingX:1,children:F(P,{dimColor:!0,children:[e?"Preview mode":"space:toggle a:all enter:apply"," ","| tab:switch panel /: filter q:quit |","⚙","=codemod available"]})}),R(qr,{autoExitSeconds:3,onCancel:k(()=>{y(!1)},"onCancel"),visible:g})]})},"VisOptimizeApp");var ci=Object.defineProperty,he=k((e,t)=>ci(e,"name",{value:t,configurable:!0}),"p");const Ft=he((e,t)=>{const r=new Set;try{const n=vr(e),s=t?[n.dependencies,n.optionalDependencies]:[n.dependencies,n.devDependencies,n.peerDependencies,n.optionalDependencies];for(const i of s)if(i)for(const a of Object.keys(i))r.add(a)}catch{}return r},"collectDepsFromPkgJson"),Or=he(e=>{const t=Wr(e);if(t)return Yt(e,t);const r=Te(e,"package.json");if(!Gt(r))return[];try{const n=vr(r),s=Array.isArray(n.workspaces)?n.workspaces:n.workspaces?.packages;return s?Yt(e,s):[]}catch{return[]}},"discoverWorkspacePackages"),li="https://github.com/es-tooling/module-replacements/blob/main/docs/modules",ui=he(e=>`${li}/${e}.md`,"buildE18eDocUrl"),pi=he(e=>{if(e.type==="simple"&&e.replacement)return e.replacement;if(e.type==="native"){const t=e.nodeVersion?` (Node ${e.nodeVersion}+)`:"";return e.replacement?`${e.replacement}${t}`:`Native API${t}`}return e.type==="documented"&&e.docPath?"see migration guide":""},"e18eReplacementHint"),Pr=he(e=>{const t=[],r=he((n,s)=>{const i=n.moduleReplacements;if(Array.isArray(i))for(const a of i)e.has(a.moduleName)&&t.push({category:s,docUrl:a.type==="documented"&&a.docPath?ui(a.docPath):void 0,hasCodemod:!1,overrideSpec:void 0,packageName:a.moduleName,replacement:pi(a)})},"scanManifest");return r(Zr,"native"),r(en,"preferred"),r(Yr,"micro-utility"),t},"buildE18eEntries"),Tr=he((e,t,r,n)=>{const s=Wo.getManifestData("npm")??[],i=[];for(const[,a]of s){if(a.deprecated)continue;const f=e.has(a.package),l=t?Uo(t,a.package,r.name):!1;if(!f&&!l)continue;const g=yr.coerce(a.version)?.major;if(g===void 0)continue;const y=n?`npm:${a.name}@${a.version}`:`npm:${a.name}@^${String(g)}`;i.push({category:"socket",hasCodemod:!1,overrideSpec:y,packageName:a.package,replacement:a.name})}return i},"buildSocketEntries");let st;const Nr=he(async()=>{if(st)return st;try{return st=(await import("module-replacements-codemods")).codemods,st}catch{return{}}},"loadCodemods"),Dr=he(async e=>{try{const t=await Nr();for(const r of e)r.category!=="socket"&&t[r.packageName]&&(r.hasCodemod=!0)}catch{}},"markCodemodAvailability"),Lr=he(async(e,t)=>{let r=0;try{const n=(await Nr())[t];if(!n)return{filesChanged:0,packageName:t};const s=n({}),i=await fi(e);for(const a of i){const f=Xe(a);if(f.includes(t))try{const l=await s.transform({file:{filename:a,source:f}});l!==f&&(Gr(a,l,"utf8"),r++)}catch(l){process.stderr.write(`warn: codemod transform failed for ${a}: ${l instanceof Error?l.message:String(l)}
|
|
13
|
-
`)}}}catch{}return{filesChanged:r,packageName:t}},"runCodemod"),fi=he(async e=>Oo("**/*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}",{absolute:!0,cwd:e,ignore:["**/.*/**","**/.*","**/node_modules/**","**/dist/**","**/coverage/**","**/.git/**","**/.next/**","**/.nuxt/**"]}),"collectSourceFiles"),hi=he(async({logger:e,options:t,visConfig:r,workspaceRoot:n})=>{if(!n)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const s=Kr(n),i=!!t.dryRun,a=!!t.prod,f=!!t.pin;z.info(`Detected ${s.name} v${s.version}.`);const l=
|
|
12
|
+
`)}}},"writePkgJsonOverrides"),Go=Ae((e,t,r,n,s)=>{if(n.name==="deno")return{added:[],updated:[]};const i=Xe(t),a=JSON.parse(i),{overrides:f,source:l}=jo(e,a,n),g=[],y=[],h=new Set;if(n.name==="npm")for(const m of["dependencies","devDependencies"]){const _=a[m];if(_)for(const A of Object.keys(_))h.add(A)}for(const m of r){const _=f[m.original];if(typeof _=="object")continue;let A=m.spec;n.name==="npm"&&h.has(m.original)&&(A=`$${m.original}`),_!==A&&(_?y.push(m.original):g.push(m.original),f[m.original]=A)}if(g.length===0&&y.length===0)return{added:g,updated:y};const v=Object.fromEntries(Object.entries(f).sort(([m],[_])=>m.localeCompare(_)));return l==="pnpm-workspace.yaml"?Fo(e,v):Mo(t,a,v,n.name,s),{added:g,updated:y}},"applyOverrides"),Bo=Ae((e,t)=>{const r={bun:["bun.lock"],deno:["deno.lock"],npm:["npm-shrinkwrap.json","package-lock.json"],pnpm:["pnpm-lock.yaml"],yarn:["yarn.lock"]};for(const n of r[t]??[]){const s=Te(e,n);try{return Xe(s)}catch{continue}}return""},"readLockfileText"),Uo=Ae((e,t,r)=>{if(!e)return!1;const n=t.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`);switch(r){case"bun":return e.includes(`"${t}":`)||new RegExp(String.raw`(^|\s|[",])${n}@`,"m").test(e);case"deno":return e.includes(`"${t}"`)||e.includes(`"npm:${t}@`)||e.includes(`"jsr:${t}@`);case"npm":return e.includes(`"${t}":`)||e.includes(`"node_modules/${t}":`);case"pnpm":return new RegExp(String.raw`(^|\s|['"/])${n}(@|['"]?:)`,"m").test(e);case"yarn":return new RegExp(String.raw`(^|\s|[",])${n}@`,"m").test(e);default:return!1}},"lockfileContainsPackage");var It={exports:{}},jt,pr;function fr(){if(pr)return jt;pr=1;var e=Object.defineProperty,t=k((h,v)=>e(h,"name",{value:v,configurable:!0}),"t"),r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,a=t((h,v)=>{for(var m in v)r(h,m,{get:v[m],enumerable:!0})},"__export"),f=t((h,v,m,_)=>{if(v&&typeof v=="object"||typeof v=="function")for(let A of s(v))!i.call(h,A)&&A!==m&&r(h,A,{get:t(()=>v[A],"get"),enumerable:!(_=n(v,A))||_.enumerable});return h},"__copyProps"),l=t(h=>f(r({},"__esModule",{value:!0}),h),"__toCommonJS"),g={};a(g,{PURL_Type:t(()=>y,"PURL_Type")}),jt=l(g);var y=(h=>(h.APK="apk",h.BITBUCKET="bitbucket",h.COCOAPODS="cocoapods",h.CARGO="cargo",h.CHROME="chrome",h.COMPOSER="composer",h.CONAN="conan",h.CONDA="conda",h.CRAN="cran",h.DEB="deb",h.DOCKER="docker",h.GEM="gem",h.GENERIC="generic",h.GITHUB="github",h.GOLANG="golang",h.HACKAGE="hackage",h.HEX="hex",h.HUGGINGFACE="huggingface",h.MAVEN="maven",h.MLFLOW="mlflow",h.NPM="npm",h.NUGET="nuget",h.OCI="oci",h.PUB="pub",h.PYPI="pypi",h.QPKG="qpkg",h.RPM="rpm",h.SWID="swid",h.SWIFT="swift",h.VCS="vcs",h))(y||{});return jt}k(fr,"requireTypes");var hr;function qo(){return hr||(hr=1,(function(e){var t=Object.defineProperty,r=k((v,m)=>t(v,"name",{value:m,configurable:!0}),"a"),n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,f=r((v,m)=>{for(var _ in m)n(v,_,{get:m[_],enumerable:!0})},"__export"),l=r((v,m,_,A)=>{if(m&&typeof m=="object"||typeof m=="function")for(let b of i(m))!a.call(v,b)&&b!==_&&n(v,b,{get:r(()=>m[b],"get"),enumerable:!(A=s(m,b))||A.enumerable});return v},"__copyProps"),g=r((v,m,_)=>(l(v,m,"default"),_&&l(_,m,"default")),"__reExport"),y={};f(y,{getManifestData:r(()=>h,"getManifestData")}),g(y,fr(),e.exports);function h(v,m){try{const _=require("../manifest.json");if(!v)return _;const A=_[v];if(!A)return;if(!m)return A;const b=A.find(([q,H])=>H.package===m);return b?b[1]:void 0}catch{return}}k(h,"getManifestData"),r(h,"getManifestData"),e.exports={getManifestData:h,...fr()}})(It)),It.exports}k(qo,"requireDist");var Wo=qo(),Ko=Object.defineProperty,qe=k((e,t)=>Ko(e,"name",{value:t,configurable:!0}),"s");const Xo=qe((e,t,r)=>{let n=e;if(t!=="all"&&(n=n.filter(s=>s.category===t)),r){const s=r.toLowerCase();n=n.filter(i=>i.packageName.toLowerCase().includes(s))}return n},"filterEntries");class zo{static{k(this,"h")}static{qe(this,"OptimizeStore")}#e;#r=new Set;constructor(t){this.#e={applyProgress:null,checkedEntries:new Set,entries:t,error:null,filterActive:!1,filterText:"",filterType:"all",focusedPanel:"list",phase:"browsing",selectedIndex:0}}getSnapshot=qe(()=>this.#e,"getSnapshot");subscribe=qe(t=>(this.#r.add(t),()=>{this.#r.delete(t)}),"subscribe");getFilteredEntries=qe(()=>Xo(this.#e.entries,this.#e.filterType,this.#e.filterText),"getFilteredEntries");#t(){this.#e={...this.#e};for(const t of this.#r)t()}select(t){const r=this.getFilteredEntries();this.#e.selectedIndex=r.length===0?-1:Math.max(0,Math.min(t,r.length-1)),this.#t()}toggleCheck(t){const r=new Set(this.#e.checkedEntries);r.has(t)?r.delete(t):r.add(t),this.#e.checkedEntries=r,this.#t()}toggleAll(){const t=this.getFilteredEntries(),r=new Set(this.#e.checkedEntries);if(t.every(n=>r.has(n.packageName)))for(const n of t)r.delete(n.packageName);else for(const n of t)r.add(n.packageName);this.#e.checkedEntries=r,this.#t()}setFilter(t){this.#e.filterType=t,this.#e.selectedIndex=0,this.#t()}setFilterText(t){this.#e.filterText=t,this.#e.selectedIndex=0,this.#t()}setFilterActive(t){this.#e.filterActive=t,this.#t()}setFocusedPanel(t){this.#e.focusedPanel=t,this.#t()}setPhase(t){this.#e.phase=t,this.#t()}setProgress(t,r){this.#e.applyProgress={current:t,total:r},this.#t()}setError(t){this.#e.error=t,this.#e.phase="error",this.#t()}getCheckedEntries(){return this.#e.entries.filter(t=>this.#e.checkedEntries.has(t.packageName))}}const Rr={"micro-utility":"gray",native:"green",preferred:"yellow",socket:"cyan"},Qo={"micro-utility":"MICRO",native:"NATIVE",preferred:"PREF",socket:"SOCKET"},Jo={"micro-utility":"Trivial utility package that can be replaced with inline code.",native:"Polyfill for a native JS/Node.js API. Use the built-in instead.",preferred:"A lighter or faster alternative package exists.",socket:"Security-hardened replacement from Socket.dev's @socketregistry."};var Vo=Object.defineProperty,Yo=k((e,t)=>Vo(e,"name",{value:t,configurable:!0}),"d");const Zo=Yo(({entry:e,focused:t,scrollRef:r})=>{const n=t?"white":"gray";if(!e)return R(G,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:R(P,{dimColor:!0,children:"No entry selected"})});const s=Rr[e.category]??"gray";return M(G,{borderColor:n,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[R(G,{flexShrink:0,paddingTop:1,paddingX:2,children:R(P,{bold:!0,color:"white",children:e.packageName})}),M(ln,{flexGrow:1,flexShrink:1,paddingX:2,ref:r,scrollbar:!0,scrollbarColor:"gray",children:[R(P,{}),M(G,{children:[R(G,{width:14,children:R(P,{dimColor:!0,children:"Category:"})}),R(P,{bold:!0,color:s,children:e.category})]}),M(G,{children:[R(G,{width:14,children:R(P,{dimColor:!0,children:"Replace with:"})}),R(P,{children:e.replacement})]}),e.overrideSpec&&M(G,{children:[R(G,{width:14,children:R(P,{dimColor:!0,children:"Override:"})}),R(P,{color:"cyan",children:e.overrideSpec})]}),M(G,{children:[R(G,{width:14,children:R(P,{dimColor:!0,children:"Codemod:"})}),R(P,{color:e.hasCodemod?"green":"gray",children:e.hasCodemod?"available ⚙":"not available"})]}),M(G,{flexDirection:"column",marginTop:1,children:[R(P,{dimColor:!0,children:"── "}),R(P,{bold:!0,color:"white",children:"DESCRIPTION"}),R(G,{marginTop:1,paddingLeft:2,children:R(P,{children:Jo[e.category]??""})})]}),e.category==="native"&&M(G,{flexDirection:"column",marginTop:1,children:[R(P,{dimColor:!0,children:"── "}),R(P,{bold:!0,color:"green",children:"ACTION"}),R(G,{flexDirection:"column",marginTop:1,paddingLeft:2,children:e.hasCodemod?M(it,{children:[M(P,{color:"green",children:["✓"," ","Codemod will rewrite imports to use native API."]}),R(P,{dimColor:!0,children:" The package can then be removed from dependencies."})]}):M(it,{children:[M(P,{color:"yellow",children:["ℹ"," ","No automated codemod available."]}),R(P,{dimColor:!0,children:" Manual migration required — replace usage with native equivalent."})]})})]}),e.category==="socket"&&M(G,{flexDirection:"column",marginTop:1,children:[R(P,{dimColor:!0,children:"── "}),R(P,{bold:!0,color:"cyan",children:"ACTION"}),M(G,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[M(P,{color:"cyan",children:["✓"," ","Override will redirect resolution to the hardened package."]}),R(P,{dimColor:!0,children:" No source code changes needed — drop-in replacement."})]})]}),(e.category==="preferred"||e.category==="micro-utility")&&M(G,{flexDirection:"column",marginTop:1,children:[R(P,{dimColor:!0,children:"── "}),R(P,{bold:!0,color:"yellow",children:"ACTION"}),R(G,{flexDirection:"column",marginTop:1,paddingLeft:2,children:e.hasCodemod?M(it,{children:[M(P,{color:"green",children:["✓"," ","Codemod will rewrite imports to the recommended alternative."]}),R(P,{dimColor:!0,children:" The original package can then be removed from dependencies."})]}):M(it,{children:[M(P,{color:"yellow",children:["ℹ"," ","Manual migration required."]}),e.docUrl?R(P,{dimColor:!0,children:" Open the migration guide below for the recommended alternative and steps."}):R(P,{dimColor:!0,children:" Consult the package's docs or the e18e module-replacements guide for an alternative."})]})})]}),M(G,{flexDirection:"column",marginTop:1,children:[R(P,{dimColor:!0,children:"── "}),R(P,{bold:!0,color:"white",children:"LINKS"}),M(G,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[M(P,{color:"cyan",underline:!0,children:["https://npmx.dev/",e.packageName]}),e.docUrl&&R(P,{color:"cyan",underline:!0,children:e.docUrl})]})]})]})]})},"OptimizeDetailPanel");var ei=Object.defineProperty,Cr=k((e,t)=>ei(e,"name",{value:t,configurable:!0}),"b$1");const ti=[{key:"all",label:"All",shortcut:"1"},{key:"native",label:"Native",shortcut:"2"},{key:"preferred",label:"Preferred",shortcut:"3"},{key:"micro-utility",label:"Micro",shortcut:"4"},{key:"socket",label:"Socket",shortcut:"5"}],ri=Cr(({checked:e,entry:t,isSelected:r})=>{const n=Rr[t.category]??"white",s=Qo[t.category]??t.category,i=e?"☑":"☐",a=t.hasCodemod?"⚙":" ";return M(G,{flexShrink:0,height:1,children:[R(P,{children:r?">":" "}),M(P,{color:e?"white":"gray",children:[" ",i," "]}),R(P,{bold:!0,color:n,children:`[${s}]`.padEnd(9)}),M(P,{children:[" ",a," "]}),R(G,{flexGrow:1,children:R(P,{bold:r,inverse:r,wrap:"truncate",children:t.packageName})}),R(P,{dimColor:!0,children:" → "}),R(P,{wrap:"truncate",children:t.replacement})]})},"EntryRow"),ni=Cr(({checkedEntries:e,entries:t,filterActive:r,filterText:n,filterType:s,focused:i,isDryRun:a,scrollOffset:f,selectedIndex:l,totalEntries:g,viewportHeight:y})=>{const h=i?"white":"gray";let v=0,m=0,_=0,A=0;for(const o of t)switch(o.category){case"micro-utility":{_++;break}case"native":{v++;break}case"preferred":{m++;break}case"socket":{A++;break}}const b=[];v>0&&b.push(`${v} native`),m>0&&b.push(`${m} preferred`),_>0&&b.push(`${_} micro`),A>0&&b.push(`${A} socket`);const q=b.length>0?` (${b.join(", ")})`:"",H=e.size,W=[];for(const[o,S]of t.entries())W.push(R(ri,{checked:e.has(S.packageName),entry:S,isSelected:o===l},S.packageName));const d=t.length,E=d>y&&y>0;return M(G,{borderColor:h,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[M(G,{flexShrink:0,gap:1,paddingX:1,children:[R(P,{bold:!0,inverse:!0,children:" VIS OPTIMIZE "}),M(P,{wrap:"truncate",children:[g," ","optimizations",q]}),!a&&H>0&&M(P,{dimColor:!0,children:[" ","—",H," ","selected"]})]}),R(G,{flexShrink:0,gap:1,paddingX:1,paddingY:1,children:ti.map(o=>{const S=s===o.key;return M(G,{children:[R(P,{dimColor:!S,children:"["}),R(P,{bold:S,color:S?"cyan":"gray",children:o.shortcut}),R(P,{dimColor:!S,children:"]"}),M(P,{color:S?"white":"gray",children:[" ",o.label]})]},o.key)})}),r&&M(G,{flexShrink:0,paddingX:1,children:[R(P,{bold:!0,color:"white",children:"/ "}),R(P,{children:n}),R(P,{inverse:!0,children:" "})]}),M(G,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[R(G,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:R(G,{flexDirection:"column",marginTop:-f,children:W})}),E&&R(G,{flexShrink:0,marginLeft:1,marginRight:1,children:R(un,{contentHeight:d,placement:"inset",scrollOffset:f,style:"block",viewportHeight:y})})]})]})},"OptimizeListPanel");var oi=Object.defineProperty,ii=k((e,t)=>oi(e,"name",{value:t,configurable:!0}),"I$1");const si=100,dr=10,gr={1:"all",2:"native",3:"preferred",4:"micro-utility",5:"socket"},ai=ii(({isDryRun:e,store:t})=>{const{exit:r}=sn(),{columns:n,rows:s}=cn(),i=rn(t.subscribe,t.getSnapshot),a=nn(null),[f,l]=Zt(0),[g,y]=Zt(!1),h=t.getFilteredEntries(),v=h[i.selectedIndex]??null,m=n>=si,_=Math.max(0,s-5),A=on(b=>{r(b)},[r]);return an((b,q)=>{if(g){b==="y"||b==="Y"?A():y(!1);return}if(i.filterActive){q.escape?(t.setFilterActive(!1),t.setFilterText("")):q.return?t.setFilterActive(!1):q.backspace||q.delete?t.setFilterText(i.filterText.slice(0,-1)):b&&!q.ctrl&&!q.meta&&t.setFilterText(i.filterText+b);return}if(b==="q"){!e&&i.checkedEntries.size>0?y(!0):A();return}if(b==="/"){t.setFilterActive(!0);return}if(gr[b]){t.setFilter(gr[b]);return}if(q.tab){t.setFocusedPanel(i.focusedPanel==="list"?"detail":"list");return}if(i.focusedPanel==="list")if(q.upArrow||b==="k"){const H=Math.max(0,i.selectedIndex-1);t.select(H),H<f&&l(H)}else if(q.downArrow||b==="j"){const H=Math.min(h.length-1,i.selectedIndex+1);t.select(H),H>=f+_&&l(H-_+1)}else b===" "?v&&t.toggleCheck(v.packageName):b==="a"?t.toggleAll():q.return&&!e&&i.checkedEntries.size>0&&A(t.getCheckedEntries());else i.focusedPanel==="detail"&&(q.upArrow||b==="k"?a.current?.scrollBy(-1):(q.downArrow||b==="j")&&a.current?.scrollBy(1))},{isActive:i.phase==="browsing"}),s<dr?R(G,{alignItems:"center",justifyContent:"center",children:M(P,{color:"yellow",children:["Terminal too small. Resize to at least",dr," ","rows."]})}):M(G,{flexDirection:"column",height:s,width:n,children:[M(G,{flexDirection:m?"row":"column",flexGrow:1,children:[R(G,{flexBasis:m?"50%":void 0,flexGrow:1,children:R(ni,{checkedEntries:i.checkedEntries,entries:h,filterActive:i.filterActive,filterText:i.filterText,filterType:i.filterType,focused:i.focusedPanel==="list",isDryRun:e,scrollOffset:f,selectedIndex:i.selectedIndex,totalEntries:i.entries.length,viewportHeight:_})}),R(G,{flexBasis:m?"50%":void 0,flexGrow:1,children:R(Zo,{entry:v,focused:i.focusedPanel==="detail",scrollRef:a})})]}),R(G,{flexShrink:0,paddingX:1,children:M(P,{dimColor:!0,children:[e?"Preview mode":"space:toggle a:all enter:apply"," ","| tab:switch panel /: filter q:quit |","⚙","=codemod available"]})}),R(qr,{autoExitSeconds:3,onCancel:k(()=>{y(!1)},"onCancel"),visible:g})]})},"VisOptimizeApp");var ci=Object.defineProperty,he=k((e,t)=>ci(e,"name",{value:t,configurable:!0}),"p");const Mt=he((e,t)=>{const r=new Set;try{const n=vr(e),s=t?[n.dependencies,n.optionalDependencies]:[n.dependencies,n.devDependencies,n.peerDependencies,n.optionalDependencies];for(const i of s)if(i)for(const a of Object.keys(i))r.add(a)}catch{}return r},"collectDepsFromPkgJson"),Or=he(e=>{const t=Wr(e);if(t)return Yt(e,t);const r=Te(e,"package.json");if(!Gt(r))return[];try{const n=vr(r),s=Array.isArray(n.workspaces)?n.workspaces:n.workspaces?.packages;return s?Yt(e,s):[]}catch{return[]}},"discoverWorkspacePackages"),li="https://github.com/es-tooling/module-replacements/blob/main/docs/modules",ui=he(e=>`${li}/${e}.md`,"buildE18eDocUrl"),pi=he(e=>{if(e.type==="simple"&&e.replacement)return e.replacement;if(e.type==="native"){const t=e.nodeVersion?` (Node ${e.nodeVersion}+)`:"";return e.replacement?`${e.replacement}${t}`:`Native API${t}`}return e.type==="documented"&&e.docPath?"see migration guide":""},"e18eReplacementHint"),Pr=he(e=>{const t=[],r=he((n,s)=>{const i=n.moduleReplacements;if(Array.isArray(i))for(const a of i)e.has(a.moduleName)&&t.push({category:s,docUrl:a.type==="documented"&&a.docPath?ui(a.docPath):void 0,hasCodemod:!1,overrideSpec:void 0,packageName:a.moduleName,replacement:pi(a)})},"scanManifest");return r(Zr,"native"),r(en,"preferred"),r(Yr,"micro-utility"),t},"buildE18eEntries"),Tr=he((e,t,r,n)=>{const s=Wo.getManifestData("npm")??[],i=[];for(const[,a]of s){if(a.deprecated)continue;const f=e.has(a.package),l=t?Uo(t,a.package,r.name):!1;if(!f&&!l)continue;const g=yr.coerce(a.version)?.major;if(g===void 0)continue;const y=n?`npm:${a.name}@${a.version}`:`npm:${a.name}@^${String(g)}`;i.push({category:"socket",hasCodemod:!1,overrideSpec:y,packageName:a.package,replacement:a.name})}return i},"buildSocketEntries");let st;const Nr=he(async()=>{if(st)return st;try{return st=(await import("module-replacements-codemods")).codemods,st}catch{return{}}},"loadCodemods"),Dr=he(async e=>{try{const t=await Nr();for(const r of e)r.category!=="socket"&&t[r.packageName]&&(r.hasCodemod=!0)}catch{}},"markCodemodAvailability"),Lr=he(async(e,t)=>{let r=0;try{const n=(await Nr())[t];if(!n)return{filesChanged:0,packageName:t};const s=n({}),i=await fi(e);for(const a of i){const f=Xe(a);if(f.includes(t))try{const l=await s.transform({file:{filename:a,source:f}});l!==f&&(Gr(a,l,"utf8"),r++)}catch(l){process.stderr.write(`warn: codemod transform failed for ${a}: ${l instanceof Error?l.message:String(l)}
|
|
13
|
+
`)}}}catch{}return{filesChanged:r,packageName:t}},"runCodemod"),fi=he(async e=>Oo("**/*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}",{absolute:!0,cwd:e,ignore:["**/.*/**","**/.*","**/node_modules/**","**/dist/**","**/coverage/**","**/.git/**","**/.next/**","**/.nuxt/**"]}),"collectSourceFiles"),hi=he(async({logger:e,options:t,visConfig:r,workspaceRoot:n})=>{if(!n)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const s=Kr(n),i=!!t.dryRun,a=!!t.prod,f=!!t.pin;z.info(`Detected ${s.name} v${s.version}.`);const l=Mt(Te(n,"package.json"),a),g=Or(n),y=new Set(l);for(const o of g){const S=Mt(Te(Jr(n,o),"package.json"),a);for(const T of S)y.add(T)}g.length>0&&z.info(`Scanned ${String(g.length)} workspace package${g.length===1?"":"s"}.`),z.info(`Scanning dependencies...
|
|
14
14
|
`);const h=Bo(n,s.name),v=Pr(y),m=Tr(y,h,s,f),_=new Set(v.map(o=>o.packageName)),A=m.filter(o=>!_.has(o.packageName)),b=[...v,...A];if(await Dr(b),b.length===0){z.info("No optimizations found for your dependencies.");return}const q=!!process.stdout.isTTY&&!zr,H=t.format==="json"||!!t.json;if(q&&!i&&!H){const o=new zo(b),S=await Vr(tn.createElement(ai,{isDryRun:!1,store:o}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit(),T=Array.isArray(S)?S:[];if(T.length===0){z.info("No optimizations selected.");return}const C=T.filter(j=>j.category!=="socket"&&j.hasCodemod),w=T.filter(j=>j.category!=="socket"&&!j.hasCodemod),N=T.filter(j=>j.category==="socket");if(C.length>0){z.info(`
|
|
15
15
|
Running ${String(C.length)} codemod${C.length===1?"":"s"}...
|
|
16
16
|
`);for(const j of C){const J=await Lr(n,j.packageName);J.filesChanged>0?z.success(` ${j.packageName}: ${String(J.filesChanged)} file${J.filesChanged===1?"":"s"} updated`):z.info(` ${j.packageName}: no files changed`)}}if(w.length>0){z.warn(`
|
|
@@ -21,4 +21,4 @@ Running ${s.name} install to update lockfile...`);const j=Xr(s,{dev:!1,filter:[]
|
|
|
21
21
|
Preferred alternatives (${String(d.length)}):`);for(const o of d)z.info(` ${o.hasCodemod?"⚙":" "} ${o.packageName} → ${o.replacement}`)}if(E.length>0){z.info(`
|
|
22
22
|
Micro-utilities (${String(E.length)}):`);for(const o of E)z.info(` ${o.hasCodemod?"⚙":" "} ${o.packageName} → ${o.replacement}`)}if(A.length>0){z.info(`
|
|
23
23
|
Socket.dev overrides (${String(A.length)}):`);for(const o of A)z.info(` ${o.packageName} → ${o.overrideSpec}`)}z.info(`
|
|
24
|
-
Total: ${String(b.length)} optimizations available (⚙ = codemod available).`),i&&z.notice("Run without --dry-run for interactive selection.")},"execute"),Pi=Object.defineProperty({__proto__:null,buildE18eEntries:Pr,buildSocketEntries:Tr,collectDepsFromPkgJson:
|
|
24
|
+
Total: ${String(b.length)} optimizations available (⚙ = codemod available).`),i&&z.notice("Run without --dry-run for interactive selection.")},"execute"),Pi=Object.defineProperty({__proto__:null,buildE18eEntries:Pr,buildSocketEntries:Tr,collectDepsFromPkgJson:Mt,default:hi,discoverWorkspacePackages:Or,markCodemodAvailability:Dr,runCodemod:Lr},Symbol.toStringTag,{value:"Module"});export{Or as A,Pr as F,Lr as I,Bo as L,Tr as T,Dr as U,Go as a,Pi as h,Mt as x};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var he=Object.defineProperty;var D=(e,s)=>he(e,"name",{value:s,configurable:!0});import{createRequire as ke}from"node:module";import{
|
|
1
|
+
var he=Object.defineProperty;var D=(e,s)=>he(e,"name",{value:s,configurable:!0});import{createRequire as ke}from"node:module";import{aK as re,aL as ee,a9 as E,aG as Pe,aF as L,aI as G,aM as ve,S as te,b6 as oe,c as w,j as v,E as u,q as R,e as x,d as b,af as we,R as De,b7 as be,b8 as xe,b9 as Ne,ba as Je}from"./bin.js";import{M,a as I,n as W,$ as Te,B as Se,w as C,C as K,z as P}from"./config.js";import{o as ie}from"../packem_shared/index-DH-5hsrC.js";const ye=ke(import.meta.url),z=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$e=D(e=>{if(typeof z<"u"&&z.versions&&z.versions.node){const[s,o]=z.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return z.getBuiltinModule(e)}return ye(e)},"__cjs_getBuiltinModule"),{readFileSync:pe,writeFileSync:se}=$e("node:fs");var Re=Object.defineProperty,O=D((e,s)=>Re(e,"name",{value:s,configurable:!0}),"r$3");const Me=O(e=>/[*?[\]{}!]/.test(e),"isGlob"),We=O(e=>typeof e=="string"?e:e.reason,"ruleReason"),je=O(e=>typeof e=="string"?void 0:e.replacement,"ruleReplacement"),ae=O((e,s)=>e.some(o=>ie(o,s)),"matchesAnyGlob"),ne=O((e,s)=>{if(typeof e=="string")return!0;const o=Array.isArray(e.packages)&&e.packages.length>0,t=Array.isArray(e.paths)&&e.paths.length>0;return!!(!o&&!t||o&&s.packageName!==void 0&&ae(e.packages,s.packageName)||t&&ae(e.paths,s.packageDir))},"ruleAppliesToInstance"),Fe=O((e,s)=>{const o=s[e.depName];if(o!==void 0&&ne(o,e))return{pattern:e.depName,rule:o};for(const[t,r]of Object.entries(s))if(Me(t)&&ie(t,e.depName)&&ne(r,e))return{pattern:t,rule:r}},"findMatchingRule"),Ie=O((e,s)=>{if(Object.keys(s).length===0)return[];const o=[];for(const t of e){if(t.isInternal)continue;const r=Fe(t,s);r&&o.push({depName:t.depName,depType:t.depType,matchedPattern:r.pattern,packageDir:t.packageDir,packageJsonPath:t.packageJsonPath,packageName:t.packageName,reason:We(r.rule),replacement:je(r.rule),specifier:t.specifier})}return o},"lintBannedDeps");var Ee=Object.defineProperty,_=D((e,s)=>Ee(e,"name",{value:s,configurable:!0}),"m");const Ce=new Set(["dependencies","devDependencies","peerDependencies"]),Ve=_(e=>e.startsWith("catalog:"),"isCatalogReference"),Ae=_(e=>e.startsWith("workspace:"),"isWorkspaceReference"),Oe=_((e,s)=>{if(!e)return!1;for(const o of e.values())if(o.has(s))return!0;return!1},"isPinnedInAnyCatalog"),He=_((e,s={})=>{const o=s.min??3,t=new Set(s.ignoreDeps),r=e.filter(i=>i.isInternal||!Ce.has(i.depType)||Ae(i.specifier)||s.dep!==void 0&&i.depName!==s.dep?!1:!t.has(i.depName)),n=new Map;for(const i of r){const p=n.get(i.depName);p?p.push(i):n.set(i.depName,[i])}const a=[];for(const[i,p]of n){if(Oe(s.catalogs,i)||p.some(m=>Ve(m.specifier)))continue;const c=new Map;for(const m of p){let d=c.get(m.specifier);d||(d=new Set,c.set(m.specifier,d)),d.add(m.packageJsonPath)}const f=[...c.entries()].sort((m,d)=>m[1].size!==d[1].size?d[1].size-m[1].size:m[0].localeCompare(d[0]))[0];!f||f[1].size<o||a.push({catalogName:"default",depName:i,instanceCount:f[1].size,specifier:f[0]})}return a.sort((i,p)=>i.depName.localeCompare(p.depName))},"proposeCatalogAdditions"),_e=_((e,s)=>{if(s.length===0)return;const o=M(e,"pnpm-workspace.yaml"),t=I(o)?pe(o,"utf8"):"",r=t.includes(`\r
|
|
2
2
|
`)?`\r
|
|
3
3
|
`:`
|
|
4
4
|
`,n=s.filter(d=>d.catalogName==="default").sort((d,g)=>d.depName.localeCompare(g.depName));if(n.length===0)return;const a=t.length>0?t.split(r):[],i=a.findIndex(d=>/^catalog\s*:\s*$/.test(d));if(i===-1){const d=["catalog:"];for(const $ of n)d.push(` ${$.depName}: "${$.specifier}"`);let g=0;for(;g<a.length&&(a[g]??"").trim().length===0;)g+=1;const h=[...a.slice(0,g),...d,"",...a.slice(g)].join(r);return se(o,h.endsWith(r)?h:`${h}${r}`),o}let p=a.length;const c=new Set;for(let d=i+1;d<a.length;d+=1){const g=a[d]??"",h=g.trimStart();if(g.length===0)continue;if(g.length-h.length===0&&h.length>0&&!h.startsWith("#")){p=d;break}const $=/^([\w./@-]+)\s*:/.exec(h);$?.[1]&&c.add($[1])}const f=[];for(const d of n)c.has(d.depName)||f.push(` ${d.depName}: "${d.specifier}"`);if(f.length===0)return;const m=[...a.slice(0,p),...f,...a.slice(p)].join(r);return se(o,m.endsWith(r)?m:`${m}${r}`),o},"applyCatalogProposals"),ze=_((e,s)=>{if(s.length===0)return"";const o=M(e,"pnpm-workspace.yaml"),t=I(o)?pe(o,"utf8"):"",r=[...s].sort((i,p)=>i.depName.localeCompare(p.depName)),n=["--- pnpm-workspace.yaml","+++ pnpm-workspace.yaml"],a=t.includes(`\r
|
|
@@ -6,7 +6,7 @@ var he=Object.defineProperty;var D=(e,s)=>he(e,"name",{value:s,configurable:!0})
|
|
|
6
6
|
`:`
|
|
7
7
|
`;if((t.length>0?t.split(a):[]).findIndex(i=>/^catalog\s*:\s*$/.test(i))===-1){n.push("@@ +1 @@","+catalog:");for(const i of r)n.push(`+ ${i.depName}: "${i.specifier}"`)}else{n.push("@@ catalog: @@");for(const i of r)n.push(`+ ${i.depName}: "${i.specifier}"`)}return n.join(a)},"renderCatalogProposalsDiff");var Be=Object.defineProperty,ce=D((e,s)=>Be(e,"name",{value:s,configurable:!0}),"l");const Le=ce(e=>{const s=[],o=re(e);if(o){const r=M(e,"pnpm-workspace.yaml");for(const n of o)n.startsWith("!")||ee(e,[n]).length===0&&s.push({pattern:n,source:"pnpm-workspace.yaml",sourcePath:r})}const t=M(e,"package.json");if(I(t)){const r=W(t).workspaces,n=Array.isArray(r)?r:r?.packages;if(n)for(const a of n)typeof a!="string"||a.startsWith("!")||ee(e,[a]).length===0&&s.push({pattern:a,source:"package.json",sourcePath:t})}return s},"lintDeadWorkspacePatterns"),qe=ce((e,s={})=>{const{useEditorconfig:o}=s,t=new Map;for(const n of e){const a=t.get(n.sourcePath);a?a.push(n):t.set(n.sourcePath,[n])}const r=[];for(const[n,a]of t){const i=new Set(a.map(f=>f.pattern));if(n.endsWith(".yaml")||n.endsWith(".yml")){const f=Te(n).split(`
|
|
8
8
|
`).filter(m=>{const d=m.trim();if(!d.startsWith("- "))return!0;const g=d.slice(2).replaceAll(/^['"]|['"]$/g,"");return!i.has(g)}).join(`
|
|
9
|
-
`);Se(n,f,{overwrite:!0}),r.push(n);continue}const p=W(n),c=p.workspaces;Array.isArray(c)?p.workspaces=c.filter(f=>typeof f!="string"||!i.has(f)):c&&Array.isArray(c.packages)&&(c.packages=c.packages.filter(f=>typeof f!="string"||!i.has(f))),C(n,p,{indent:E(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},"applyDeadWorkspacePatternFixes");var Ue=Object.defineProperty,fe=D((e,s)=>Ue(e,"name",{value:s,configurable:!0}),"f$2");const Ge=["dependencies","devDependencies","peerDependencies","optionalDependencies"],Ke=fe((e,s={})=>{const o=new Set(s.ignoreBlocks),t=Pe(e),r=[];for(const n of t){const a=M(e,n,"package.json"),i=L(a);if(!i)continue;const p=typeof i.name=="string"?i.name:void 0;for(const c of Ge){if(o.has(c))continue;const f=i[c];typeof f=="object"&&f!==null&&!Array.isArray(f)&&Object.keys(f).length===0&&r.push({depType:c,packageDir:n,packageJsonPath:a,packageName:p})}}return r},"lintEmptyDeps"),Qe=fe((e,s={})=>{const{useEditorconfig:o}=s,t=new Map;for(const n of e){const a=t.get(n.packageJsonPath);a?a.push(n):t.set(n.packageJsonPath,[n])}const r=[];for(const[n,a]of t){const i=W(n);for(const p of a){const c=i[p.depType];typeof c=="object"&&c!==null&&!Array.isArray(c)&&Object.keys(c).length===0&&Reflect.deleteProperty(i,p.depType)}C(n,i,{indent:E(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},"applyEmptyDepsFixes");var Xe=Object.defineProperty,le=D((e,s)=>Xe(e,"name",{value:s,configurable:!0}),"o");const Ye=/\/+$/,Q=/node_modules/,X=/\.git/,Ze=/[$()+.?[\\\]^{|}]/g,et=/\/\*\*$|\/\*\/\*$/,tt=le((e,s)=>{const o=s.replace(Ye,"");if(o.startsWith("!"))return[];const t=[];if(o.endsWith("/*")){const n=o.slice(0,-2),a=K(e,n);if(!I(a))return[];for(const i of G(a,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[Q,X]}))i.path===a||i.name.startsWith(".")||t.push(M(n,i.name));return t}if(o.endsWith("/**")||o.endsWith("/*/*")){const n=o.replace(et,""),a=K(e,n);if(!I(a))return[];for(const i of G(a,{includeFiles:!1,includeSymlinks:!1,skip:[Q,X]})){if(i.path===a)continue;const p=i.path.slice(a.length+1);t.push(`${n}/${p}`)}return t}if(!o.includes("/")&&o.includes("*")){const n=o.replaceAll(Ze,"\\$&").replaceAll("*",".*"),a=new RegExp(`^${n}$`);for(const i of G(e,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[Q,X]}))i.path!==e&&a.test(i.name)&&t.push(i.name);return t}const r=K(e,o);return I(r)&&t.push(o),t},"collectPatternMatches"),ot=le(e=>{const s=re(e)??ve(e)??[],o=new Set,t=[];for(const r of s)for(const n of tt(e,r))n==="."||o.has(n)||(o.add(n),I(M(e,n,"package.json"))||t.push({packageDir:n}));return t},"lintMissingPackageJson");var st=Object.defineProperty,at=D((e,s)=>st(e,"name",{value:s,configurable:!0}),"r$2");const nt=["dependencies","devDependencies","optionalDependencies","peerDependencies"],rt=at((e,s={})=>{const o=new Set(s.depTypes??nt),t=new Set(s.ignoreDeps),r=new Map;for(const a of e)a.packageDir!=="."||!o.has(a.depType)||r.set(a.depName,{depType:a.depType,specifier:a.specifier});if(r.size===0)return[];const n=[];for(const a of e){if(a.packageDir==="."||!o.has(a.depType)||t.has(a.depName))continue;const i=r.get(a.depName);i&&n.push({childSpecifier:a.specifier,depName:a.depName,depType:a.depType,packageDir:a.packageDir,packageJsonPath:a.packageJsonPath,packageName:a.packageName,rootDepType:i.depType,rootSpecifier:i.specifier})}return n},"lintRedefineRoot");var it=Object.defineProperty,ge=D((e,s)=>it(e,"name",{value:s,configurable:!0}),"a$1");const pt=ge((e,s)=>{if(!s)return[];const o=M(e,"package.json"),t=L(o);if(!t)return[];if(t.private!==!0)return[];const r=t.dependencies;if(typeof r!="object"||r===null||Array.isArray(r))return[];const n=Object.keys(r);return n.length===0?[]:[{depNames:n,packageJsonPath:o}]},"lintRootDeps"),ct=ge((e,s={})=>{const{useEditorconfig:o}=s,t=[];for(const r of e){const n=W(r.packageJsonPath),a=n.dependencies;if(typeof a!="object"||a===null)continue;const i=a;n.devDependencies??={};const p=n.devDependencies;for(const c of r.depNames){const f=i[c];typeof f=="string"&&(c in p||(p[c]=f),Reflect.deleteProperty(i,c))}Object.keys(i).length===0&&Reflect.deleteProperty(n,"dependencies"),C(r.packageJsonPath,n,{indent:E(r.packageJsonPath,{useEditorconfig:o}),overwrite:!0}),t.push(r.packageJsonPath)}return t},"applyRootDepsFixes");var ft=Object.defineProperty,de=D((e,s)=>ft(e,"name",{value:s,configurable:!0}),"r$1");const lt=/^[a-z][\w-]*@\S+$/i,gt=de((e,s,o={})=>{if(!s)return[];const t=M(e,"package.json"),r=L(t);if(!r)return[];const n=r.packageManager;return typeof n=="string"&<.test(n)?[]:[{packageJsonPath:t,suggested:o.suggested}]},"lintRootPackageManager"),dt=de((e,s={})=>{const{useEditorconfig:o}=s,t=[];for(const r of e){if(!r.suggested)continue;const n=W(r.packageJsonPath);n.packageManager=r.suggested,C(r.packageJsonPath,n,{indent:E(r.packageJsonPath,{useEditorconfig:o}),overwrite:!0}),t.push(r.packageJsonPath)}return t},"applyRootPackageManagerFixes");var ut=Object.defineProperty,ue=D((e,s)=>ut(e,"name",{value:s,configurable:!0}),"a");const mt=ue((e,s)=>{if(!s)return[];const o=M(e,"package.json"),t=L(o);return t?t.private===!0?[]:[{packageJsonPath:o,rawValue:t.private}]:[]},"lintRootPrivate"),ht=ue((e,s={})=>{const{useEditorconfig:o}=s,t=[];for(const r of e){const n=W(r.packageJsonPath);let a=n;if("private"in n)n.private=!0;else{const{name:i,version:p,...c}=n,f={};i!==void 0&&(f.name=i),p!==void 0&&(f.version=p),f.private=!0;for(const[m,d]of Object.entries(c))f[m]=d;a=f}C(r.packageJsonPath,a,{indent:E(r.packageJsonPath,{useEditorconfig:o}),overwrite:!0}),t.push(r.packageJsonPath)}return t},"applyRootPrivateFixes");var kt=Object.defineProperty,Z=D((e,s)=>kt(e,"name",{value:s,configurable:!0}),"p$1");const yt=[{id:"react",label:"React",members:["react","react-dom","react-test-renderer"]},{id:"next",label:"Next.js",members:["next","@next/font","@next/bundle-analyzer","@next/mdx","@next/third-parties","@next/eslint-plugin-next","eslint-config-next"]},{id:"babel",label:"Babel",prefixes:["@babel/"]},{id:"storybook",label:"Storybook",members:["storybook","sb"],prefixes:["@storybook/"]},{id:"vitest",label:"Vitest",members:["vitest"],prefixes:["@vitest/"]},{id:"playwright",label:"Playwright",members:["playwright","@playwright/test"]},{id:"trpc",label:"tRPC",prefixes:["@trpc/"]},{id:"prisma",label:"Prisma",members:["prisma"],prefixes:["@prisma/"]},{id:"turborepo",label:"Turborepo",members:["turbo","turbo-ignore","@turbo/gen","eslint-config-turbo","eslint-plugin-turbo"]},{id:"typescript-eslint",label:"typescript-eslint",members:["typescript-eslint"],prefixes:["@typescript-eslint/"]},{id:"eslint-stylistic",label:"ESLint Stylistic",prefixes:["@stylistic/"]},{id:"lexical",label:"Lexical",members:["lexical"],prefixes:["@lexical/"]},{id:"nx",label:"Nx",prefixes:["@nx/","@nrwl/"]}],$t=new Set(["dependencies","devDependencies","peerDependencies"]),Pt=Z((e,s)=>{for(const o of e)if(o.members?.includes(s)||o.prefixes?.some(t=>s.startsWith(t)))return o},"familyForDep"),vt=Z(e=>e.startsWith("workspace:")||e.startsWith("catalog:"),"isWorkspaceOrCatalogReference"),wt=Z((e,s={})=>{const o=new Set(s.ignoreFamilies),t=new Map;for(const i of yt)t.set(i.id,i);for(const i of s.extraFamilies??[])t.set(i.id,i);const r=[...t.values()],n=new Map;for(const i of e){if(i.isInternal||!$t.has(i.depType)||vt(i.specifier))continue;const p=Pt(r,i.depName);if(!p||o.has(p.id))continue;const c=n.get(p.id),f={depName:i.depName,depType:i.depType,packageDir:i.packageDir,packageJsonPath:i.packageJsonPath,packageName:i.packageName,specifier:i.specifier};c?c.push(f):n.set(p.id,[f])}const a=[];for(const[i,p]of n){const c=[...new Set(p.map(m=>m.specifier))];if(c.length<2)continue;const f=t.get(i);f&&a.push({family:i,familyLabel:f.label??i,members:p,specifiers:c})}return a},"lintSimilarDeps");var Dt=Object.defineProperty,B=D((e,s)=>Dt(e,"name",{value:s,configurable:!0}),"r");const bt=B(e=>e.startsWith("@types/"),"isTypesPackage"),xt=B((e,s={})=>{const o=new Set(s.ignoreDeps),t=new Map,r=B(a=>{const i=t.get(a);if(i!==void 0)return i;try{const p=W(a).private===!0;return t.set(a,p),p}catch{return t.set(a,!1),!1}},"isPrivate"),n=[];for(const a of e)a.depType==="dependencies"&&bt(a.depName)&&(o.has(a.depName)||r(a.packageJsonPath)&&n.push({childSpecifier:a.specifier,depName:a.depName,packageDir:a.packageDir,packageJsonPath:a.packageJsonPath,packageName:a.packageName}));return n},"lintTypesInDeps"),Nt=B((e,s={})=>{const{useEditorconfig:o}=s,t=new Map;for(const n of e){const a=t.get(n.packageJsonPath);a?a.push(n):t.set(n.packageJsonPath,[n])}const r=[];for(const[n,a]of t){const i=W(n),p=i.dependencies;if(typeof p!="object"||p===null)continue;const c=p;i.devDependencies??={};const f=i.devDependencies;for(const m of a){const d=c[m.depName];typeof d=="string"&&(m.depName in f||(f[m.depName]=d),Reflect.deleteProperty(c,m.depName))}Object.keys(c).length===0&&Reflect.deleteProperty(i,"dependencies"),C(n,i,{indent:E(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},"applyTypesInDepsFixes");var Jt=Object.defineProperty,q=D((e,s)=>Jt(e,"name",{value:s,configurable:!0}),"f");const Tt=q(e=>e.startsWith("workspace:"),"isWorkspaceSpecifier"),St=q((e,s={})=>{const o=s.fixSpecifier??"workspace:*",t=[];for(const r of e)r.isInternal&&(Tt(r.specifier)||t.push({depName:r.depName,depType:r.depType,fix:o,packageDir:r.packageDir,packageJsonPath:r.packageJsonPath,packageName:r.packageName,specifier:r.specifier}));return t},"lintWorkspaceProtocol"),Rt=q((e,s,o,t)=>{const r=s.split(".");let n=e;for(let p=0;p<r.length-1;p+=1){const c=r[p],f=n[c];(typeof f!="object"||f===null)&&(n[c]={}),n=n[c]}const a=r.at(-1);let i=n[a];(typeof i!="object"||i===null)&&(i={},n[a]=i),i[o]=t},"setNestedField"),Mt=q((e,s={})=>{const{useEditorconfig:o}=s,t=new Map;for(const n of e){const a=t.get(n.packageJsonPath);a?a.push(n):t.set(n.packageJsonPath,[n])}const r=[];for(const[n,a]of t){const i=W(n);for(const p of a)if(p.depType.includes("."))Rt(i,p.depType,p.depName,p.fix);else{const c=i[p.depType];typeof c=="object"&&c!==null&&(c[p.depName]=p.fix)}C(n,i,{indent:E(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},"applyWorkspaceProtocolFixes");var Wt=Object.defineProperty,V=D((e,s)=>Wt(e,"name",{value:s,configurable:!0}),"p");const jt=new Set(["dependencies","devDependencies","peerDependencies"]),Ft=V(e=>e.startsWith("catalog:"),"isCatalogReference"),It=V(e=>e.startsWith("workspace:"),"isWorkspaceReference"),Et=V(e=>{if(!e.startsWith("catalog:"))return;const s=e.slice(8);return s===""?"default":s},"catalogNameOf"),Ct=V((e,s)=>{if(e.get("default")?.has(s))return"default";const o=[...e.keys()].filter(t=>t!=="default").sort();for(const t of o)if(e.get(t)?.has(s))return t},"findCatalogPinning"),Vt=V(e=>e==="default"?"catalog:":`catalog:${e}`,"buildCatalogSpecifier"),At=V((e,s)=>{const o=[...e].sort((r,n)=>(r.packageName??r.packageDir).localeCompare(n.packageName??n.packageDir));let t;for(const r of o){const n=te(r.specifier);if(!n)continue;if(!t){t=r;continue}const a=te(t.specifier);if(!a){t=r;continue}const i=oe(a,n),p=oe(n,a);(s==="highest"&&i||s==="lowest"&&p)&&(t=r)}if(t)return{canonical:t,canonicalSource:t.packageName??t.packageDir}},"pickCanonicalBySemver"),Ot=V((e,s={})=>{const o=s.resolve??"highest",t=new Set(s.ignoreDeps),r=[],n=e.filter(i=>i.isInternal||!jt.has(i.depType)||It(i.specifier)||s.dep!==void 0&&i.depName!==s.dep?!1:!t.has(i.depName)),a=new Map;for(const i of n){const p=a.get(i.depName);p?p.push(i):a.set(i.depName,[i])}for(const[i,p]of a){const c=s.pinned?.get(i);if(c!==void 0){for(const g of p)g.specifier!==c&&r.push({canonicalSource:"cli:--pin",depName:i,depType:g.depType,fix:c,packageDir:g.packageDir,packageJsonPath:g.packageJsonPath,packageName:g.packageName,specifier:g.specifier});continue}if(o==="catalog"){const{catalogs:g}=s;if(!g)continue;const h=Ct(g,i);if(!h)continue;const $=Vt(h);for(const T of p)Et(T.specifier)!==h&&r.push({canonicalSource:`catalog:${h}`,depName:i,depType:T.depType,fix:$,packageDir:T.packageDir,packageJsonPath:T.packageJsonPath,packageName:T.packageName,specifier:T.specifier});continue}const f=p.filter(g=>!Ft(g.specifier));if(f.length<2||new Set(f.map(g=>g.specifier)).size<=1)continue;const m=At(f,o);if(!m)continue;const d=m.canonical.specifier;for(const g of f)g.specifier!==d&&r.push({canonicalSource:m.canonicalSource,depName:i,depType:g.depType,fix:d,packageDir:g.packageDir,packageJsonPath:g.packageJsonPath,packageName:g.packageName,specifier:g.specifier})}return r},"lintWorkspaceVersions"),Ht=V((e,s={})=>{const{useEditorconfig:o}=s,t=new Map;for(const n of e){const a=t.get(n.packageJsonPath);a?a.push(n):t.set(n.packageJsonPath,[n])}const r=[];for(const[n,a]of t){const i=W(n);for(const p of a){const c=i[p.depType];typeof c=="object"&&c!==null&&(c[p.depName]=p.fix)}C(n,i,{indent:E(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},"applyWorkspaceVersionsFixes");var _t=Object.defineProperty,y=D((e,s)=>_t(e,"name",{value:s,configurable:!0}),"u");const zt=y(e=>{if(I(M(e,"pnpm-workspace.yaml")))return!0;const s=M(e,"package.json");if(!I(s))return!1;try{return W(s).workspaces!==void 0}catch{return!1}},"detectWorkspaceConfig"),A=y((e,s)=>{const o=new Map;for(const t of e){const r=s(t),n=o.get(r);n?n.push(t):o.set(r,[t])}return o},"groupBy"),Bt=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ workspace-protocol: no violations"));return}const r=o?"Fixed":"Found",n=o?R:x;t.info(n(v(`${r} ${String(e.length)} workspace-protocol violation${e.length===1?"":"s"}`)));for(const[a,i]of A(e,p=>p.packageName??p.packageJsonPath)){const p=P(s,i[0].packageJsonPath);t.info(` ${v(a)} ${u(`(${p})`)}`);for(const c of i){const f=o?R("→"):x("→");t.info(` ${u(c.depType)} ${c.depName}: ${b(c.specifier)} ${f} ${w(c.fix)}`)}}o||t.info(u(" Run with --fix to rewrite specifiers in place."))},"printWorkspaceProtocolHuman"),Lt=y((e,s,o)=>{if(e.length===0){o.info(w("✓ redefine-root: no violations"));return}o.info(x(v(`Found ${String(e.length)} dep${e.length===1?"":"s"} re-declared from root`)));for(const[t,r]of A(e,n=>n.packageName??n.packageJsonPath)){const n=P(s,r[0].packageJsonPath);o.info(` ${v(t)} ${u(`(${n})`)}`);for(const a of r)o.info(` ${u(a.depType)} ${a.depName}: ${b(a.childSpecifier)} ${u(`(root ${a.rootDepType}: ${a.rootSpecifier})`)}`)}o.info(u(" Remove these from child package.json files — root pin will resolve."))},"printRedefineRootHuman"),qt=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ workspace-versions: no drift"));return}const r=o?"Fixed":"Found",n=o?R:x;t.info(n(v(`${r} ${String(e.length)} workspace-version drift${e.length===1?"":"s"}`)));for(const[a,i]of A(e,p=>p.depName)){const p=i[0].fix,c=i[0].canonicalSource;t.info(` ${v(a)} ${u(`canonical: ${p} (from ${c})`)}`);for(const f of i){const m=P(s,f.packageJsonPath),d=f.packageName??m,g=o?R("→"):x("→");t.info(` ${d} ${u(`(${m})`)} ${u(f.depType)}: ${b(f.specifier)} ${g} ${w(f.fix)}`)}}o||t.info(u(" Run with --fix to align drifting specifiers."))},"printWorkspaceVersionsHuman"),Ut=y((e,s,o)=>{if(e.length===0){o.info(w("✓ banned-deps: no violations"));return}o.info(b(v(`Found ${String(e.length)} banned dep${e.length===1?"":"s"}`)));for(const[t,r]of A(e,n=>n.packageName??n.packageJsonPath)){const n=P(s,r[0].packageJsonPath);o.info(` ${v(t)} ${u(`(${n})`)}`);for(const a of r){const i=a.replacement?` ${u("→")} ${w(a.replacement)}`:"";o.info(` ${u(a.depType)} ${b(a.depName)}${i}`),o.info(` ${u(a.reason)}`)}}},"printBannedDepsHuman"),Gt=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ catalog-proposals: nothing worth promoting"));return}const r=o?"Added":"Would add",n=o?R:x;t.info(n(v(`${r} ${String(e.length)} catalog entr${e.length===1?"y":"ies"}`)));for(const a of e)t.info(` ${v(a.depName)}: ${w(a.specifier)} ${u(`(${String(a.instanceCount)} packages agree)`)}`);if(!o){const a=ze(s,e);if(a){t.info(""),t.info(u("Proposed pnpm-workspace.yaml changes:"));for(const i of a.split(`
|
|
9
|
+
`);Se(n,f,{overwrite:!0}),r.push(n);continue}const p=W(n),c=p.workspaces;Array.isArray(c)?p.workspaces=c.filter(f=>typeof f!="string"||!i.has(f)):c&&Array.isArray(c.packages)&&(c.packages=c.packages.filter(f=>typeof f!="string"||!i.has(f))),C(n,p,{indent:E(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},"applyDeadWorkspacePatternFixes");var Ue=Object.defineProperty,fe=D((e,s)=>Ue(e,"name",{value:s,configurable:!0}),"f$2");const Ge=["dependencies","devDependencies","peerDependencies","optionalDependencies"],Ke=fe((e,s={})=>{const o=new Set(s.ignoreBlocks),t=Pe(e),r=[];for(const n of t){const a=M(e,n,"package.json"),i=L(a);if(!i)continue;const p=typeof i.name=="string"?i.name:void 0;for(const c of Ge){if(o.has(c))continue;const f=i[c];typeof f=="object"&&f!==null&&!Array.isArray(f)&&Object.keys(f).length===0&&r.push({depType:c,packageDir:n,packageJsonPath:a,packageName:p})}}return r},"lintEmptyDeps"),Qe=fe((e,s={})=>{const{useEditorconfig:o}=s,t=new Map;for(const n of e){const a=t.get(n.packageJsonPath);a?a.push(n):t.set(n.packageJsonPath,[n])}const r=[];for(const[n,a]of t){const i=W(n);for(const p of a){const c=i[p.depType];typeof c=="object"&&c!==null&&!Array.isArray(c)&&Object.keys(c).length===0&&Reflect.deleteProperty(i,p.depType)}C(n,i,{indent:E(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},"applyEmptyDepsFixes");var Xe=Object.defineProperty,le=D((e,s)=>Xe(e,"name",{value:s,configurable:!0}),"o");const Ye=/\/+$/,Q=/node_modules/,X=/\.git/,Ze=/[$()+.?[\\\]^{|}]/g,et=/\/\*\*$|\/\*\/\*$/,tt=le((e,s)=>{const o=s.replace(Ye,"");if(o.startsWith("!"))return[];const t=[];if(o.endsWith("/*")){const n=o.slice(0,-2),a=K(e,n);if(!I(a))return[];for(const i of G(a,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[Q,X]}))i.path===a||i.name.startsWith(".")||t.push(M(n,i.name));return t}if(o.endsWith("/**")||o.endsWith("/*/*")){const n=o.replace(et,""),a=K(e,n);if(!I(a))return[];for(const i of G(a,{includeFiles:!1,includeSymlinks:!1,skip:[Q,X]})){if(i.path===a)continue;const p=i.path.slice(a.length+1);t.push(`${n}/${p}`)}return t}if(!o.includes("/")&&o.includes("*")){const n=o.replaceAll(Ze,String.raw`\$&`).replaceAll("*",".*"),a=new RegExp(`^${n}$`);for(const i of G(e,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[Q,X]}))i.path!==e&&a.test(i.name)&&t.push(i.name);return t}const r=K(e,o);return I(r)&&t.push(o),t},"collectPatternMatches"),ot=le(e=>{const s=re(e)??ve(e)??[],o=new Set,t=[];for(const r of s)for(const n of tt(e,r))n==="."||o.has(n)||(o.add(n),I(M(e,n,"package.json"))||t.push({packageDir:n}));return t},"lintMissingPackageJson");var st=Object.defineProperty,at=D((e,s)=>st(e,"name",{value:s,configurable:!0}),"r$2");const nt=["dependencies","devDependencies","optionalDependencies","peerDependencies"],rt=at((e,s={})=>{const o=new Set(s.depTypes??nt),t=new Set(s.ignoreDeps),r=new Map;for(const a of e)a.packageDir!=="."||!o.has(a.depType)||r.set(a.depName,{depType:a.depType,specifier:a.specifier});if(r.size===0)return[];const n=[];for(const a of e){if(a.packageDir==="."||!o.has(a.depType)||t.has(a.depName))continue;const i=r.get(a.depName);i&&n.push({childSpecifier:a.specifier,depName:a.depName,depType:a.depType,packageDir:a.packageDir,packageJsonPath:a.packageJsonPath,packageName:a.packageName,rootDepType:i.depType,rootSpecifier:i.specifier})}return n},"lintRedefineRoot");var it=Object.defineProperty,ge=D((e,s)=>it(e,"name",{value:s,configurable:!0}),"a$1");const pt=ge((e,s)=>{if(!s)return[];const o=M(e,"package.json"),t=L(o);if(!t)return[];if(t.private!==!0)return[];const r=t.dependencies;if(typeof r!="object"||r===null||Array.isArray(r))return[];const n=Object.keys(r);return n.length===0?[]:[{depNames:n,packageJsonPath:o}]},"lintRootDeps"),ct=ge((e,s={})=>{const{useEditorconfig:o}=s,t=[];for(const r of e){const n=W(r.packageJsonPath),a=n.dependencies;if(typeof a!="object"||a===null)continue;const i=a;n.devDependencies??={};const p=n.devDependencies;for(const c of r.depNames){const f=i[c];typeof f=="string"&&(c in p||(p[c]=f),Reflect.deleteProperty(i,c))}Object.keys(i).length===0&&Reflect.deleteProperty(n,"dependencies"),C(r.packageJsonPath,n,{indent:E(r.packageJsonPath,{useEditorconfig:o}),overwrite:!0}),t.push(r.packageJsonPath)}return t},"applyRootDepsFixes");var ft=Object.defineProperty,de=D((e,s)=>ft(e,"name",{value:s,configurable:!0}),"r$1");const lt=/^[a-z][\w-]*@\S+$/i,gt=de((e,s,o={})=>{if(!s)return[];const t=M(e,"package.json"),r=L(t);if(!r)return[];const n=r.packageManager;return typeof n=="string"&<.test(n)?[]:[{packageJsonPath:t,suggested:o.suggested}]},"lintRootPackageManager"),dt=de((e,s={})=>{const{useEditorconfig:o}=s,t=[];for(const r of e){if(!r.suggested)continue;const n=W(r.packageJsonPath);n.packageManager=r.suggested,C(r.packageJsonPath,n,{indent:E(r.packageJsonPath,{useEditorconfig:o}),overwrite:!0}),t.push(r.packageJsonPath)}return t},"applyRootPackageManagerFixes");var ut=Object.defineProperty,ue=D((e,s)=>ut(e,"name",{value:s,configurable:!0}),"a");const mt=ue((e,s)=>{if(!s)return[];const o=M(e,"package.json"),t=L(o);return t?t.private===!0?[]:[{packageJsonPath:o,rawValue:t.private}]:[]},"lintRootPrivate"),ht=ue((e,s={})=>{const{useEditorconfig:o}=s,t=[];for(const r of e){const n=W(r.packageJsonPath);let a=n;if("private"in n)n.private=!0;else{const{name:i,version:p,...c}=n,f={};i!==void 0&&(f.name=i),p!==void 0&&(f.version=p),f.private=!0;for(const[m,d]of Object.entries(c))f[m]=d;a=f}C(r.packageJsonPath,a,{indent:E(r.packageJsonPath,{useEditorconfig:o}),overwrite:!0}),t.push(r.packageJsonPath)}return t},"applyRootPrivateFixes");var kt=Object.defineProperty,Z=D((e,s)=>kt(e,"name",{value:s,configurable:!0}),"p$1");const yt=[{id:"react",label:"React",members:["react","react-dom","react-test-renderer"]},{id:"next",label:"Next.js",members:["next","@next/font","@next/bundle-analyzer","@next/mdx","@next/third-parties","@next/eslint-plugin-next","eslint-config-next"]},{id:"babel",label:"Babel",prefixes:["@babel/"]},{id:"storybook",label:"Storybook",members:["storybook","sb"],prefixes:["@storybook/"]},{id:"vitest",label:"Vitest",members:["vitest"],prefixes:["@vitest/"]},{id:"playwright",label:"Playwright",members:["playwright","@playwright/test"]},{id:"trpc",label:"tRPC",prefixes:["@trpc/"]},{id:"prisma",label:"Prisma",members:["prisma"],prefixes:["@prisma/"]},{id:"turborepo",label:"Turborepo",members:["turbo","turbo-ignore","@turbo/gen","eslint-config-turbo","eslint-plugin-turbo"]},{id:"typescript-eslint",label:"typescript-eslint",members:["typescript-eslint"],prefixes:["@typescript-eslint/"]},{id:"eslint-stylistic",label:"ESLint Stylistic",prefixes:["@stylistic/"]},{id:"lexical",label:"Lexical",members:["lexical"],prefixes:["@lexical/"]},{id:"nx",label:"Nx",prefixes:["@nx/","@nrwl/"]}],$t=new Set(["dependencies","devDependencies","peerDependencies"]),Pt=Z((e,s)=>{for(const o of e)if(o.members?.includes(s)||o.prefixes?.some(t=>s.startsWith(t)))return o},"familyForDep"),vt=Z(e=>e.startsWith("workspace:")||e.startsWith("catalog:"),"isWorkspaceOrCatalogReference"),wt=Z((e,s={})=>{const o=new Set(s.ignoreFamilies),t=new Map;for(const i of yt)t.set(i.id,i);for(const i of s.extraFamilies??[])t.set(i.id,i);const r=[...t.values()],n=new Map;for(const i of e){if(i.isInternal||!$t.has(i.depType)||vt(i.specifier))continue;const p=Pt(r,i.depName);if(!p||o.has(p.id))continue;const c=n.get(p.id),f={depName:i.depName,depType:i.depType,packageDir:i.packageDir,packageJsonPath:i.packageJsonPath,packageName:i.packageName,specifier:i.specifier};c?c.push(f):n.set(p.id,[f])}const a=[];for(const[i,p]of n){const c=[...new Set(p.map(m=>m.specifier))];if(c.length<2)continue;const f=t.get(i);f&&a.push({family:i,familyLabel:f.label??i,members:p,specifiers:c})}return a},"lintSimilarDeps");var Dt=Object.defineProperty,B=D((e,s)=>Dt(e,"name",{value:s,configurable:!0}),"r");const bt=B(e=>e.startsWith("@types/"),"isTypesPackage"),xt=B((e,s={})=>{const o=new Set(s.ignoreDeps),t=new Map,r=B(a=>{const i=t.get(a);if(i!==void 0)return i;try{const p=W(a).private===!0;return t.set(a,p),p}catch{return t.set(a,!1),!1}},"isPrivate"),n=[];for(const a of e)a.depType==="dependencies"&&bt(a.depName)&&(o.has(a.depName)||r(a.packageJsonPath)&&n.push({childSpecifier:a.specifier,depName:a.depName,packageDir:a.packageDir,packageJsonPath:a.packageJsonPath,packageName:a.packageName}));return n},"lintTypesInDeps"),Nt=B((e,s={})=>{const{useEditorconfig:o}=s,t=new Map;for(const n of e){const a=t.get(n.packageJsonPath);a?a.push(n):t.set(n.packageJsonPath,[n])}const r=[];for(const[n,a]of t){const i=W(n),p=i.dependencies;if(typeof p!="object"||p===null)continue;const c=p;i.devDependencies??={};const f=i.devDependencies;for(const m of a){const d=c[m.depName];typeof d=="string"&&(m.depName in f||(f[m.depName]=d),Reflect.deleteProperty(c,m.depName))}Object.keys(c).length===0&&Reflect.deleteProperty(i,"dependencies"),C(n,i,{indent:E(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},"applyTypesInDepsFixes");var Jt=Object.defineProperty,q=D((e,s)=>Jt(e,"name",{value:s,configurable:!0}),"f");const Tt=q(e=>e.startsWith("workspace:"),"isWorkspaceSpecifier"),St=q((e,s={})=>{const o=s.fixSpecifier??"workspace:*",t=[];for(const r of e)r.isInternal&&(Tt(r.specifier)||t.push({depName:r.depName,depType:r.depType,fix:o,packageDir:r.packageDir,packageJsonPath:r.packageJsonPath,packageName:r.packageName,specifier:r.specifier}));return t},"lintWorkspaceProtocol"),Rt=q((e,s,o,t)=>{const r=s.split(".");let n=e;for(let p=0;p<r.length-1;p+=1){const c=r[p],f=n[c];(typeof f!="object"||f===null)&&(n[c]={}),n=n[c]}const a=r.at(-1);let i=n[a];(typeof i!="object"||i===null)&&(i={},n[a]=i),i[o]=t},"setNestedField"),Mt=q((e,s={})=>{const{useEditorconfig:o}=s,t=new Map;for(const n of e){const a=t.get(n.packageJsonPath);a?a.push(n):t.set(n.packageJsonPath,[n])}const r=[];for(const[n,a]of t){const i=W(n);for(const p of a)if(p.depType.includes("."))Rt(i,p.depType,p.depName,p.fix);else{const c=i[p.depType];typeof c=="object"&&c!==null&&(c[p.depName]=p.fix)}C(n,i,{indent:E(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},"applyWorkspaceProtocolFixes");var Wt=Object.defineProperty,V=D((e,s)=>Wt(e,"name",{value:s,configurable:!0}),"p");const jt=new Set(["dependencies","devDependencies","peerDependencies"]),Ft=V(e=>e.startsWith("catalog:"),"isCatalogReference"),It=V(e=>e.startsWith("workspace:"),"isWorkspaceReference"),Et=V(e=>{if(!e.startsWith("catalog:"))return;const s=e.slice(8);return s===""?"default":s},"catalogNameOf"),Ct=V((e,s)=>{if(e.get("default")?.has(s))return"default";const o=[...e.keys()].filter(t=>t!=="default").sort();for(const t of o)if(e.get(t)?.has(s))return t},"findCatalogPinning"),Vt=V(e=>e==="default"?"catalog:":`catalog:${e}`,"buildCatalogSpecifier"),At=V((e,s)=>{const o=[...e].sort((r,n)=>(r.packageName??r.packageDir).localeCompare(n.packageName??n.packageDir));let t;for(const r of o){const n=te(r.specifier);if(!n)continue;if(!t){t=r;continue}const a=te(t.specifier);if(!a){t=r;continue}const i=oe(a,n),p=oe(n,a);(s==="highest"&&i||s==="lowest"&&p)&&(t=r)}if(t)return{canonical:t,canonicalSource:t.packageName??t.packageDir}},"pickCanonicalBySemver"),Ot=V((e,s={})=>{const o=s.resolve??"highest",t=new Set(s.ignoreDeps),r=[],n=e.filter(i=>i.isInternal||!jt.has(i.depType)||It(i.specifier)||s.dep!==void 0&&i.depName!==s.dep?!1:!t.has(i.depName)),a=new Map;for(const i of n){const p=a.get(i.depName);p?p.push(i):a.set(i.depName,[i])}for(const[i,p]of a){const c=s.pinned?.get(i);if(c!==void 0){for(const g of p)g.specifier!==c&&r.push({canonicalSource:"cli:--pin",depName:i,depType:g.depType,fix:c,packageDir:g.packageDir,packageJsonPath:g.packageJsonPath,packageName:g.packageName,specifier:g.specifier});continue}if(o==="catalog"){const{catalogs:g}=s;if(!g)continue;const h=Ct(g,i);if(!h)continue;const $=Vt(h);for(const T of p)Et(T.specifier)!==h&&r.push({canonicalSource:`catalog:${h}`,depName:i,depType:T.depType,fix:$,packageDir:T.packageDir,packageJsonPath:T.packageJsonPath,packageName:T.packageName,specifier:T.specifier});continue}const f=p.filter(g=>!Ft(g.specifier));if(f.length<2||new Set(f.map(g=>g.specifier)).size<=1)continue;const m=At(f,o);if(!m)continue;const d=m.canonical.specifier;for(const g of f)g.specifier!==d&&r.push({canonicalSource:m.canonicalSource,depName:i,depType:g.depType,fix:d,packageDir:g.packageDir,packageJsonPath:g.packageJsonPath,packageName:g.packageName,specifier:g.specifier})}return r},"lintWorkspaceVersions"),Ht=V((e,s={})=>{const{useEditorconfig:o}=s,t=new Map;for(const n of e){const a=t.get(n.packageJsonPath);a?a.push(n):t.set(n.packageJsonPath,[n])}const r=[];for(const[n,a]of t){const i=W(n);for(const p of a){const c=i[p.depType];typeof c=="object"&&c!==null&&(c[p.depName]=p.fix)}C(n,i,{indent:E(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},"applyWorkspaceVersionsFixes");var _t=Object.defineProperty,y=D((e,s)=>_t(e,"name",{value:s,configurable:!0}),"u");const zt=y(e=>{if(I(M(e,"pnpm-workspace.yaml")))return!0;const s=M(e,"package.json");if(!I(s))return!1;try{return W(s).workspaces!==void 0}catch{return!1}},"detectWorkspaceConfig"),A=y((e,s)=>{const o=new Map;for(const t of e){const r=s(t),n=o.get(r);n?n.push(t):o.set(r,[t])}return o},"groupBy"),Bt=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ workspace-protocol: no violations"));return}const r=o?"Fixed":"Found",n=o?R:x;t.info(n(v(`${r} ${String(e.length)} workspace-protocol violation${e.length===1?"":"s"}`)));for(const[a,i]of A(e,p=>p.packageName??p.packageJsonPath)){const p=P(s,i[0].packageJsonPath);t.info(` ${v(a)} ${u(`(${p})`)}`);for(const c of i){const f=o?R("→"):x("→");t.info(` ${u(c.depType)} ${c.depName}: ${b(c.specifier)} ${f} ${w(c.fix)}`)}}o||t.info(u(" Run with --fix to rewrite specifiers in place."))},"printWorkspaceProtocolHuman"),Lt=y((e,s,o)=>{if(e.length===0){o.info(w("✓ redefine-root: no violations"));return}o.info(x(v(`Found ${String(e.length)} dep${e.length===1?"":"s"} re-declared from root`)));for(const[t,r]of A(e,n=>n.packageName??n.packageJsonPath)){const n=P(s,r[0].packageJsonPath);o.info(` ${v(t)} ${u(`(${n})`)}`);for(const a of r)o.info(` ${u(a.depType)} ${a.depName}: ${b(a.childSpecifier)} ${u(`(root ${a.rootDepType}: ${a.rootSpecifier})`)}`)}o.info(u(" Remove these from child package.json files — root pin will resolve."))},"printRedefineRootHuman"),qt=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ workspace-versions: no drift"));return}const r=o?"Fixed":"Found",n=o?R:x;t.info(n(v(`${r} ${String(e.length)} workspace-version drift${e.length===1?"":"s"}`)));for(const[a,i]of A(e,p=>p.depName)){const p=i[0].fix,c=i[0].canonicalSource;t.info(` ${v(a)} ${u(`canonical: ${p} (from ${c})`)}`);for(const f of i){const m=P(s,f.packageJsonPath),d=f.packageName??m,g=o?R("→"):x("→");t.info(` ${d} ${u(`(${m})`)} ${u(f.depType)}: ${b(f.specifier)} ${g} ${w(f.fix)}`)}}o||t.info(u(" Run with --fix to align drifting specifiers."))},"printWorkspaceVersionsHuman"),Ut=y((e,s,o)=>{if(e.length===0){o.info(w("✓ banned-deps: no violations"));return}o.info(b(v(`Found ${String(e.length)} banned dep${e.length===1?"":"s"}`)));for(const[t,r]of A(e,n=>n.packageName??n.packageJsonPath)){const n=P(s,r[0].packageJsonPath);o.info(` ${v(t)} ${u(`(${n})`)}`);for(const a of r){const i=a.replacement?` ${u("→")} ${w(a.replacement)}`:"";o.info(` ${u(a.depType)} ${b(a.depName)}${i}`),o.info(` ${u(a.reason)}`)}}},"printBannedDepsHuman"),Gt=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ catalog-proposals: nothing worth promoting"));return}const r=o?"Added":"Would add",n=o?R:x;t.info(n(v(`${r} ${String(e.length)} catalog entr${e.length===1?"y":"ies"}`)));for(const a of e)t.info(` ${v(a.depName)}: ${w(a.specifier)} ${u(`(${String(a.instanceCount)} packages agree)`)}`);if(!o){const a=ze(s,e);if(a){t.info(""),t.info(u("Proposed pnpm-workspace.yaml changes:"));for(const i of a.split(`
|
|
10
10
|
`))i.startsWith("+")?t.info(w(i)):i.startsWith("-")?t.info(b(i)):t.info(u(i))}t.info(u(" Run with --fix to write these entries to pnpm-workspace.yaml."))}},"printCatalogProposalsHuman"),Kt=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ custom-types: no engines / packageManager / volta drift"));return}const r=o?"Fixed":"Found",n=o?R:x;t.info(n(v(`${r} ${String(e.length)} custom-type drift${e.length===1?"":"s"}`)));for(const[a,i]of A(e,p=>`${p.customType} ${p.depName}`)){const p=i[0].fix,c=i[0].canonicalSource;t.info(` ${v(a)} ${u(`canonical: ${p} (from ${c})`)}`);for(const f of i){const m=P(s,f.packageJsonPath),d=f.packageName??m,g=o?R("→"):x("→");t.info(` ${d} ${u(`(${m})`)}: ${b(f.specifier)} ${g} ${w(f.fix)}`)}}o||t.info(u(" Run with --fix to align engines/packageManager/volta versions."))},"printCustomTypesHuman"),Qt=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ empty-deps: no empty dependency blocks"));return}const r=o?"Removed":"Found",n=o?R:x;t.info(n(v(`${r} ${String(e.length)} empty dependency block${e.length===1?"":"s"}`)));for(const[a,i]of A(e,p=>p.packageName??p.packageJsonPath)){const p=P(s,i[0].packageJsonPath);t.info(` ${v(a)} ${u(`(${p})`)}`);for(const c of i)t.info(` ${u(c.depType)}: ${b("{}")}`)}o||t.info(u(" Run with --fix to drop empty blocks."))},"printEmptyDepsHuman"),Xt=y((e,s,o,t)=>{if(e.length===0){t.info(w('✓ root-private: root package.json is "private": true'));return}const r=o?"Set":"Missing",n=o?R:b;for(const a of e){const i=P(s,a.packageJsonPath);if(t.info(n(v(`${r} "private": true on root ${u(`(${i})`)}`))),!o){const p=a.rawValue===void 0?"absent":JSON.stringify(a.rawValue);t.info(` ${u("current:")} ${b(p)}`)}}o||t.info(u(' Run with --fix to set "private": true.'))},"printRootPrivateHuman"),Yt=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ root-package-manager: packageManager field present"));return}const r=o?"Set":"Missing",n=o?R:b;for(const a of e){const i=P(s,a.packageJsonPath);t.info(n(v(`${r} packageManager on root ${u(`(${i})`)}`))),!o&&!a.suggested&&t.info(u(" no canonical specifier configured (set policy.rootPackageManager.suggested to enable --fix)"))}o||t.info(u(' e.g. "packageManager": "pnpm@10.32.1"'))},"printRootPackageManagerHuman"),Zt=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ root-deps: no runtime dependencies on private root"));return}const r=o?"Moved":"Found",n=o?R:x;for(const a of e){const i=P(s,a.packageJsonPath);t.info(n(v(`${r} ${String(a.depNames.length)} runtime dep${a.depNames.length===1?"":"s"} on private root ${u(`(${i})`)}`)));for(const p of a.depNames)t.info(` ${b(p)}`)}o||t.info(u(" Run with --fix to move them to devDependencies."))},"printRootDepsHuman"),eo=y((e,s)=>{if(e.length===0){s.info(w("✓ missing-package-json: every workspace dir has a package.json"));return}s.info(x(v(`Found ${String(e.length)} workspace dir${e.length===1?"":"s"} without a package.json`)));for(const o of e)s.info(` ${b(o.packageDir)}`);s.info(u(" Either delete the directory or scaffold a package.json (vis create)."))},"printMissingPackageJsonHuman"),to=y((e,s,o)=>{if(e.length===0){o.info(w("✓ dead-workspace-pattern: every workspace pattern matches at least one package"));return}const t=s?"Removed":"Found",r=s?R:x;o.info(r(v(`${t} ${String(e.length)} unmatched workspace pattern${e.length===1?"":"s"}`)));for(const[n,a]of A(e,i=>i.source)){o.info(` ${v(n)}`);for(const i of a)o.info(` ${b(i.pattern)}`)}s||o.info(u(" Run with --fix to drop dead patterns."))},"printDeadWorkspacePatternsHuman"),oo=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ types-in-deps: no @types/* in dependencies of private packages"));return}const r=o?"Moved":"Found",n=o?R:x;t.info(n(v(`${r} ${String(e.length)} @types/* dep${e.length===1?"":"s"} in dependencies`)));for(const[a,i]of A(e,p=>p.packageName??p.packageJsonPath)){const p=P(s,i[0].packageJsonPath);t.info(` ${v(a)} ${u(`(${p})`)}`);for(const c of i)t.info(` ${b(c.depName)} ${u(c.childSpecifier)}`)}o||t.info(u(" Run with --fix to move them to devDependencies."))},"printTypesInDepsHuman"),so=y((e,s,o)=>{if(e.length===0){o.info(w("✓ similar-deps: every related dep family is in sync"));return}o.info(x(v(`Found ${String(e.length)} family${e.length===1?"":" families"} with version drift`)));for(const t of e){o.info(` ${v(t.familyLabel)} ${u(`(${t.specifiers.join(", ")})`)}`);for(const r of t.members){const n=P(s,r.packageJsonPath),a=r.packageName??n;o.info(` ${a} ${u(`(${n})`)} ${u(r.depType)}: ${b(r.depName)}@${x(r.specifier)}`)}}o.info(u(" Pick a single specifier per family and align by hand — auto-fix is unsafe across name boundaries."))},"printSimilarDepsHuman"),ao=y((e,s,o,t,r)=>{let n=!0;const a=y(i=>{n||r.info(""),n=!1,i()},"section");t.workspaceProtocol&&a(()=>{Bt(e.workspaceProtocol??[],s,o.workspaceProtocol,r)}),t.redefineRoot&&a(()=>{Lt(e.redefineRoot??[],s,r)}),t.workspaceVersions&&a(()=>{qt(e.workspaceVersions??[],s,o.workspaceVersions,r)}),t.customTypes&&a(()=>{Kt(e.customTypes??[],s,o.customTypes,r)}),e.catalogProposals!==void 0&&a(()=>{Gt(e.catalogProposals??[],s,o.catalogProposals,r)}),t.bannedDeps&&a(()=>{Ut(e.bannedDeps??[],s,r)}),t.emptyDeps&&a(()=>{Qt(e.emptyDeps??[],s,o.emptyDeps,r)}),t.rootPrivate&&a(()=>{Xt(e.rootPrivate??[],s,o.rootPrivate,r)}),t.rootPackageManager&&a(()=>{Yt(e.rootPackageManager??[],s,o.rootPackageManager,r)}),t.rootDeps&&a(()=>{Zt(e.rootDeps??[],s,o.rootDeps,r)}),t.missingPackageJson&&a(()=>{eo(e.missingPackageJson??[],r)}),t.deadWorkspacePatterns&&a(()=>{to(e.deadWorkspacePatterns??[],o.deadWorkspacePatterns,r)}),t.typesInDeps&&a(()=>{oo(e.typesInDeps??[],s,o.typesInDeps,r)}),t.similarDeps&&a(()=>{so(e.similarDeps??[],s,r)})},"printHuman"),no=y((e,s)=>{for(const o of e.workspaceProtocol??[]){const t=P(s,o.packageJsonPath);process.stdout.write(`workspace-protocol ${t} ${o.depType} ${o.depName} ${o.specifier} → ${o.fix}
|
|
11
11
|
`)}for(const o of e.redefineRoot??[]){const t=P(s,o.packageJsonPath);process.stdout.write(`redefine-root ${t} ${o.depType} ${o.depName} ${o.childSpecifier}
|
|
12
12
|
`)}for(const o of e.workspaceVersions??[]){const t=P(s,o.packageJsonPath);process.stdout.write(`workspace-versions ${t} ${o.depType} ${o.depName} ${o.specifier} → ${o.fix}
|
|
@@ -14,7 +14,7 @@ Second attempt: ${n}`,{cause:s})}}async revert(){if(this.backupStashSha!==null){
|
|
|
14
14
|
`)},"print"),o=ee(a=>{switch(a){case"failed":return X(Ce);case"running":return J(">");case"skipped":return ce(q);case"success":return Ve(Ie);default:return I(q)}},"iconFor");return{commandEnd({commandId:a,durationMs:c,error:d,output:u,status:l}){const p=n.get(a)??a,w=I(`(${c}ms)`);if(i(` ${o(l)} ${p} ${w}`),l==="failed"&&d&&i(I(d.message)),(l==="failed"||r)&&u&&u.trim().length>0)for(const h of u.split(/\r?\n/))i(` ${I(h)}`)},commandStart({commandId:a}){if(!r)return;const c=n.get(a)??a;i(` ${I("…")} ${c}`)},error({error:a,message:c}){t?process.stderr.write(`${X(c)}
|
|
15
15
|
`):i(X(c)),a?.stack&&(r||!t)&&process.stderr.write(`${I(a.stack)}
|
|
16
16
|
`)},info({message:a}){i(I(a))},patternEnd({patternId:a,status:c}){const d=s.get(a)??a;i(`${o(c)} ${d}`)},patternStart({patternId:a}){const c=s.get(a)??a;i(`${J(">")} ${c}`)},start({patterns:a}){if(a.length===0){i(I("No staged files matched any pattern."));return}const c=new Set(a.flatMap(d=>d.files)).size;i(`${J(">")} Running staged tasks on ${c} file${c===1?"":"s"} across ${a.length} pattern${a.length===1?"":"s"}`);for(const d of a){s.set(d.id,d.title);for(const u of d.commands)n.set(u.id,u.title)}},stop(){},warn({message:a}){i(ce(a))}}},"createPlainRenderer");var er=Object.defineProperty,tr=f((e,t)=>er(e,"name",{value:t,configurable:!0}),"t");const rr=tr(async e=>{const{env:t}=process;if(e.debug===!0||e.quiet===!0||t.NODE_ENV==="test"||t.TERM==="dumb"||t.CI!==void 0||!process.stderr.isTTY)return be({quiet:e.quiet,verbose:e.verbose});try{return Xt({verbose:e.verbose})}catch{return be({quiet:e.quiet,verbose:e.verbose})}},"pickRenderer");var sr=Object.defineProperty,_=f((e,t)=>sr(e,"name",{value:t,configurable:!0}),"a");const te=_(e=>typeof e=="object"&&e!==null&&typeof e.title=="string"&&typeof e.task=="function","isCustomTask"),nr=_(async e=>{let t=0,r=0;const s=_(()=>(t+=1,`pattern-${t}`),"nextPatternId"),n=_(()=>(r+=1,`cmd-${r}`),"nextCommandId"),i=_(async(a,c,d)=>{if(typeof a=="string"){d.push({command:a,files:c,id:n(),source:"string",title:a});return}if(Array.isArray(a)){for(const u of a)await i(u,c,d);return}if(typeof a=="function"){const u=await a([...c]);if(typeof u=="string"){d.push({command:u,files:c,id:n(),source:"function",title:u});return}if(Array.isArray(u)){for(const l of u)if(typeof l=="string")d.push({command:l,files:c,id:n(),source:"function",title:l});else if(te(l))d.push({files:c,id:n(),run:l.task,source:"custom",title:l.title});else throw new S("Task function returned an array with an unsupported entry — expected strings or { title, task }.");return}if(te(u)){d.push({files:c,id:n(),run:u.task,source:"custom",title:u.title});return}throw new S("Task function returned an unsupported value — expected string, string[], or { title, task }.")}if(te(a)){d.push({files:c,id:n(),run:a.task,source:"custom",title:a.title});return}throw new S("Unsupported task value — expected string, string[], function, or { title, task }.")},"expandTask"),o=[];for(const[a,c]of Object.entries(e.config)){const d=Kt(a,e.files,e.cwd,{caseInsensitive:e.caseInsensitive===!0});if(d.length===0)continue;const u=e.relative?d.map(p=>B(e.cwd,p)):d,l=[];await i(c,u,l),l.length!==0&&o.push({commands:l,files:u,id:s(),pattern:a,title:`${a} — ${d.length} file${d.length===1?"":"s"}`})}return o},"buildTaskGraph");var ar=Object.defineProperty,Y=f((e,t)=>ar(e,"name",{value:t,configurable:!0}),"g");const ir=Y(e=>{const t=[];let r="",s=!1,n=!1;for(let i=0;i<e.length;i+=1){const o=e[i];if(o===void 0)break;if(o==="\\"&&!s&&i+1<e.length){const a=e[i+1];if(a!==void 0){n&&a!=='"'&&a!=="\\"&&(r+=o),r+=a,i+=1;continue}}if(o==='"'&&!s){n=!n;continue}if(o==="'"&&!n){s=!s;continue}if(!s&&!n&&/\s/.test(o)){r.length>0&&(t.push(r),r="");continue}r+=o}if(s||n)throw new S(`Unterminated ${s?"single":"double"} quote in command: ${e}`);return r.length>0&&t.push(r),t},"parseCommandString"),Re=process.platform==="win32"?28e3:131072,or=Y((e,t,r)=>{const s=[];let n=[],i=t;const o=r<=0?Re:r;for(const a of e){const c=Buffer.byteLength(a)+1;n.length>0&&i+c>o&&(s.push(n),n=[],i=t),n.push(a),i+=c}return n.length>0&&s.push(n),s},"chunkFiles"),cr=Y(async(e,t,r)=>{const s=ir(e);if(s.length===0)throw new O(e,"Empty command for staged task.");const[n,...i]=s;if(n===void 0)throw new O(e,"Empty command for staged task.");const o=Buffer.byteLength(n)+i.reduce((u,l)=>u+Buffer.byteLength(l)+1,0),a=or(t,o,r.maxArgLength??Re),c=Date.now(),d=[];for(const u of a){if(r.signal?.aborted===!0)throw new O(e,"Task aborted by earlier failure.");const l=$e(n,[...i,...u],{nodeOptions:{cwd:r.cwd,env:dr(r.env),killSignal:r.killSignal??"SIGTERM",stdio:["ignore","pipe","pipe"]},...r.signal===void 0?{}:{signal:r.signal}}),p=await l,w=[p.stdout,p.stderr].filter(m=>m.length>0).join(`
|
|
17
|
-
`);w.length>0&&d.push(w);const h=l.process?.signalCode??null;if(l.aborted||h!==null||p.exitCode===void 0){const m=l.aborted?"Task aborted by earlier failure.":h
|
|
17
|
+
`);w.length>0&&d.push(w);const h=l.process?.signalCode??null;if(l.aborted||h!==null||p.exitCode===void 0){const m=l.aborted?"Task aborted by earlier failure.":h===null?w.trim()||"Task exited without a numeric status code.":`Task killed by signal ${h}.`;throw new O(e,m)}if(p.exitCode!==0)throw new O(e,w.trim()||`Exit code ${p.exitCode} from ${n}`)}return{durationMs:Date.now()-c,output:d.join(`
|
|
18
18
|
`)}},"execCommand"),dr=Y(e=>{const t={...process.env};return process.stderr.isTTY&&t.FORCE_COLOR===void 0&&t.NO_COLOR===void 0&&(t.FORCE_COLOR="1"),e?{...t,...e}:t},"buildTaskEnv");var lr=Object.defineProperty,j=f((e,t)=>lr(e,"name",{value:t,configurable:!0}),"o");const ur=j(async(e,t,r)=>{const s=hr(r.concurrent,e.length),n=[],i=new AbortController;let o=!1,a=0;const c=j(()=>{o||(o=!0,r.continueOnError||i.abort())},"cancel");r.externalSignal&&(r.externalSignal.aborted?c():r.externalSignal.addEventListener("abort",()=>{c()},{once:!0}));const d=j(h=>{for(const m of h.commands)t.commandEnd({commandId:m.id,durationMs:0,patternId:h.id,status:"skipped"})},"emitSkippedCommands"),u=j(async h=>{if(o){d(h),t.patternEnd({patternId:h.id,status:"skipped"});return}t.patternStart({patternId:h.id});let m="success";for(const y of h.commands){if(o){t.commandEnd({commandId:y.id,durationMs:0,patternId:h.id,status:"skipped"}),m=m==="success"?"skipped":m;continue}t.commandStart({commandId:y.id,patternId:h.id});const k=await fr(y,r,i.signal),T=k.status==="failed"&&i.signal.aborted?{...k,status:"skipped"}:k;if(t.commandEnd({commandId:y.id,durationMs:T.durationMs,error:T.error,output:T.output,patternId:h.id,status:T.status}),T.status==="failed"){n.push(y.title),m="failed",c();break}if(T.status==="skipped"){m=m==="success"?"skipped":m;break}}t.patternEnd({patternId:h.id,status:m})},"runOne"),l=j(async()=>{for(;a<e.length;){const h=e[a];a+=1,h&&await u(h)}},"pickNext"),p=[];for(let h=0;h<Math.min(s,e.length);h+=1)p.push(l());await Promise.all(p);const w=r.externalSignal?.aborted===!0;return{failedCommands:n,success:n.length===0&&!w}},"runTasks"),fr=j(async(e,t,r)=>{const s=Date.now();try{if(e.source==="custom"&&e.run)return await e.run([...e.files]),{durationMs:Date.now()-s,status:"success"};if(e.command){const n=await cr(e.command,e.files,{cwd:t.cwd,killSignal:t.killSignal,maxArgLength:t.maxArgLength,signal:r});return{durationMs:n.durationMs,output:t.verbose?n.output:void 0,status:"success"}}return{durationMs:Date.now()-s,error:new O(e.title,"Command has no invocation target."),status:"failed"}}catch(n){const i=n instanceof Error?n:new Error(String(n));return{durationMs:Date.now()-s,error:i,output:i instanceof O?i.message:void 0,status:"failed"}}},"runCommand"),hr=j((e,t)=>{if(e===!1)return 1;if(e===!0){const s=Math.max(1,typeof de=="function"?de():4);return Math.min(Math.max(1,t),s)}const r=Math.floor(e);return r>0?r:1},"concurrencyLimit");var pr=Object.defineProperty,se=f((e,t)=>pr(e,"name",{value:t,configurable:!0}),"u");const gr=!0,mr=se(e=>{try{return!nt(e)}catch{return!1}},"detectCaseInsensitive"),wr=se(async(e={})=>{const t=e.cwd??process.cwd(),r=await rr(e),s=await bt(e);typeof s!="function"&&he(s);const n=new Vt({...e,cwd:t}),i=new AbortController;let o=!1;const a=se(l=>{if(o){process.removeListener("SIGINT",a),process.removeListener("SIGTERM",a),process.kill(process.pid,l);return}o=!0,r.warn({message:`Received ${l} — cancelling staged tasks and restoring state. Press Ctrl+C again to abort.`}),i.abort()},"onInterrupt");process.on("SIGINT",a),process.on("SIGTERM",a);let c={failedCommands:[],ranTasks:!1,success:!0},d=!1,u=!1;try{await n.prepare(),d=!0;for(const k of n.warnings)r.warn({message:k});if(n.stagedFiles.length===0)return e.allowEmpty!==!0&&r.info({message:"No staged files found."}),u=!0,{failedCommands:[],ranTasks:!1,success:!0};const l=mr(t),p=Yt(n.stagedFiles,e.ignore,t,{caseInsensitive:l});if(p.length===0&&n.stagedFiles.length>0)return r.info({message:"Every staged file was excluded by the `ignore` list."}),u=!0,{failedCommands:[],ranTasks:!1,success:!0};const w=typeof s=="function"?he(await s([...p])):s,h=await nr({caseInsensitive:l,config:w,cwd:t,files:p,relative:e.relative});if(r.start({patterns:h}),h.length===0)return r.info({message:"No staged files matched any pattern."}),u=!0,{failedCommands:[],ranTasks:!1,success:!0};const{failedCommands:m,success:y}=await ur(h,r,{concurrent:e.concurrent??gr,continueOnError:e.continueOnError===!0,cwd:t,externalSignal:i.signal,killSignal:e.killSignal,maxArgLength:e.maxArgLength,verbose:e.verbose});if(c={failedCommands:m,ranTasks:!0,success:y},y){if(e.diff===void 0&&(await n.applyModifications({autoStage:e.autoStage===!0}),e.failOnChanges===!0&&n.indexTreeChanged()&&(r.warn({message:"Tasks modified staged content — failing because --fail-on-changes is set."}),c={failedCommands:[...m],ranTasks:!0,success:!1}),e.allowEmpty!==!0&&n.postTaskIndexMatchesHead()))throw new dt("All staged changes were reverted by tasks. Re-stage changes or rerun with --allow-empty.")}else if(e.revert===!0)r.info({message:"Reverting working tree from backup stash."}),await n.revert();else{const k=n.recoveryHint();k&&r.warn({message:k})}return await n.restoreUnstagedChanges(),u=c.success,c}catch(l){const p=l instanceof Error?l.message:String(l),w=l instanceof Error?l:new Error(p);if(r.error({error:w,message:p}),l instanceof A)return{failedCommands:c.failedCommands,ranTasks:c.ranTasks,success:!1};throw l}finally{if(process.removeListener("SIGINT",a),process.removeListener("SIGTERM",a),d)try{await n.cleanup(u)}catch(l){r.error({error:l,message:"Cleanup failed."})}await r.stop()}},"runStaged");var vr=Object.defineProperty,yr=f((e,t)=>vr(e,"name",{value:t,configurable:!0}),"n");const kr="VIS_STAGED_CONCURRENT",Se=yr(e=>{const t=e.trim();if(t==="true"||t==="")return!0;if(t==="false")return!1;const r=Number(t);return Number.isNaN(r)?!0:r},"parseConcurrent");var br=Object.defineProperty,H=f((e,t)=>br(e,"name",{value:t,configurable:!0}),"d");const Sr=H((e,t)=>{const r={};t!==void 0&&(r.config=t);const s=H(v=>e[v]===void 0?void 0:!!e[v],"readBool"),n=H(v=>{const Q=e[v];return typeof Q=="string"&&Q.length>0?Q:void 0},"readString"),i=s("allow-empty");i!==void 0&&(r.allowEmpty=i);const o=s("auto-stage");o!==void 0&&(r.autoStage=o);const a=s("continue-on-error");a!==void 0&&(r.continueOnError=a);const c=s("debug");c!==void 0&&(r.debug=c);const d=s("fail-on-changes");d!==void 0&&(r.failOnChanges=d);const u=s("hide-partially-staged");u!==void 0&&(r.hidePartiallyStaged=u);const l=s("hide-unstaged");l!==void 0&&(r.hideUnstaged=l);const p=s("quiet");p!==void 0&&(r.quiet=p);const w=s("relative");w!==void 0&&(r.relative=w);const h=s("revert");h!==void 0&&(r.revert=h);const m=s("stash");m!==void 0&&(r.stash=m);const y=s("verbose");y!==void 0&&(r.verbose=y);const k=n("cwd");k!==void 0&&(r.cwd=k);const T=n("diff");T!==void 0&&(r.diff=T);const ie=n("diff-filter");if(ie!==void 0&&(r.diffFilter=ie),s("force-kill")===!0&&(r.killSignal="SIGKILL"),e.concurrent===void 0){const v=process.env[kr];v!==void 0&&(r.concurrent=Se(v.trim()))}else{const{concurrent:v}=e;r.concurrent=Se(typeof v=="string"?v:typeof v=="number"||typeof v=="boolean"?String(v):"")}return r},"buildRunOptions"),Fr=H(async({options:e,visConfig:t})=>{const r=(t??{}).staged;if(!r)throw new Error(`No "staged" config found in vis.config.ts. Add one:
|
|
19
19
|
|
|
20
20
|
// vis.config.ts
|