@kitelev/exocortex-cli 17.7.45 → 17.7.47
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/dist/index.js +3 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// @kitelev/exocortex-cli v17.7.
|
|
2
|
+
// @kitelev/exocortex-cli v17.7.47
|
|
3
3
|
// CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
|
|
4
4
|
// License: MIT
|
|
5
5
|
|
|
@@ -432,7 +432,7 @@ ${" ".repeat(r.indent*e)}`}function Vge(r,e,t,n,i,s){return{node:e,parent:t,leve
|
|
|
432
432
|
`:" ";n+=`---${d}${f}
|
|
433
433
|
`}else n+=qa(t,0,o.contents,null,{block:!0,compact:!0}).text+`
|
|
434
434
|
`;i=o.explicitEnd||t.openEnded,i&&(n+=`...
|
|
435
|
-
`)}return n}function Xge(r,e){let t=String(r),n=String(e);return t<n?-1:t>n?1:0}function qd(r,e={}){let t={...Yge,...e},n=Xme(r,t.schema,{noRefs:t.noRefs,skipInvalid:t.skipInvalid});if(t.flowLevel>=0&&j5(n,(i,s)=>{if(!(s.depth<t.flowLevel))return(i.kind==="sequence"||i.kind==="mapping")&&(i.style=ki.FLOW),o6}),t.sortKeys){let i=t.sortKeys===!0?Xge:t.sortKeys;j5(n,s=>{s.kind==="mapping"&&s.items.sort((o,c)=>i(o.key.kind==="scalar"?o.key.value:"",c.key.kind==="scalar"?c.key.value:""))})}return t.transform(n),Hge(n,{...zO(t,Object.keys(ux)),schema:t.schema})}var St,rhe,nhe,ihe,she,ohe,ahe,che,lhe,uhe,fhe,dhe,phe,hhe,mhe,ghe,yhe,bhe,G5,whe,Ehe,Ahe,Ihe,qO,Ohe,xhe,q5,Dhe,Lhe,Mhe,$he,jhe,WO,Vhe,Ghe,zhe,Khe,Hhe,Xhe,Qhe,Jhe,Zhe,eme,tme,hw,nx,Lke,_u,Gm,sme,Nke,kke,ome,zc,Sr,qe,ki,Ki,cme,K5,H5,gme,$d,yme,sx,vt,Z5,Ud,KO,e6,lw,vme,Tme,t6,HO,r6,Ame,Ime,Rme,ox,zme,hu,Qme,o6,B5,sge,oge,age,cx,c6,gw,l6,u6,cge,QO,JO,lge,uge,f6,d6,p6,h6,m6,g6,fge,dge,pge,hge,mge,gge,yge,bge,_ge,Sge,wge,Ege,vge,Tge,lx,Mge,fw,ux,Yge,Mke,$ke,jke,Bke,Uke,Vke,Gke,qke,Wke,zke,Kke,Hke,Yke,Xke,Qke,Jke,qm=$e(()=>{St=Symbol("NOT_RESOLVED");a(zn,"defineScalarTag");a(rx,"defineSequenceTag");a(dw,"defineMappingTag");rhe=zn("tag:yaml.org,2002:str",{resolve:a(r=>r,"resolve"),identify:a(r=>typeof r=="string","identify")}),nhe=["","~","null","Null","NULL"],ihe=zn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:a(r=>nhe.indexOf(r)!==-1?null:St,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),she=zn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:a((r,e)=>r==="null"||e&&r===""?null:St,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),ohe=["","~","null","Null","NULL"],ahe=zn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:a(r=>ohe.indexOf(r)!==-1?null:St,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),che=["true","True","TRUE"],lhe=["false","False","FALSE"],uhe=zn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:a(r=>che.indexOf(r)!==-1?!0:lhe.indexOf(r)!==-1?!1:St,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),fhe=["true"],dhe=["false"],phe=zn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:a(r=>fhe.indexOf(r)!==-1?!0:dhe.indexOf(r)!==-1?!1:St,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),hhe=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],mhe=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],ghe=zn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:a(r=>hhe.indexOf(r)!==-1?!0:mhe.indexOf(r)!==-1?!1:St,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),yhe=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),bhe=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");a(_he,"parseYamlInteger$2");a(She,"resolveYamlInteger$2");G5=zn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:She,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),whe=new RegExp("^-?(?:0|[1-9][0-9]*)$"),Ehe=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");a(vhe,"parseYamlInteger$1");a(The,"resolveYamlInteger$1");Ahe=zn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:The,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),Ihe=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");a(Rhe,"parseYamlInteger");a(Che,"resolveYamlInteger");qO=zn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:Che,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),Ohe=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),xhe=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(Phe,"resolveYamlFloat$2");a(Fhe,"representYamlFloat$2");q5=zn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:Phe,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:Fhe}),Dhe=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),Lhe=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(Nhe,"resolveYamlFloat$1");a(khe,"representYamlFloat$1");Mhe=zn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Nhe,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:khe}),$he=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),jhe=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(Bhe,"resolveYamlFloat");a(Uhe,"representYamlFloat");WO=zn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:Bhe,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:Uhe}),Vhe=zn("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:a((r,e)=>r==="<<"||e&&r===""?"<<":St,"resolve"),identify:a(()=>!1,"identify")}),Ghe=/^[A-Za-z0-9+/]*={0,2}$/;a(qhe,"resolveYamlBinary");a(Whe,"representYamlBinary");zhe=zn("tag:yaml.org,2002:binary",{resolve:qhe,identify:a(r=>Object.prototype.toString.call(r)==="[object Uint8Array]","identify"),represent:Whe}),Khe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Hhe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");a(R5,"makeUtcDate");a(Yhe,"resolveYamlTimestamp");Xhe=zn("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:Yhe,identify:a(r=>r instanceof Date,"identify"),represent:a(r=>r.toISOString(),"represent")}),Qhe=rx("tag:yaml.org,2002:seq",{create:a(()=>[],"create"),addItem:a((r,e)=>{r.push(e)},"addItem"),identify:Array.isArray});a(pw,"isPlainObject");a(zO,"pick");Jhe=rx("tag:yaml.org,2002:omap",{create:a(()=>({list:[],seen:new Set}),"create"),addItem:a((r,e)=>{let t;if(e instanceof Map){if(e.size!==1)return"cannot resolve an ordered map item";t=e.keys().next().value}else if(pw(e)){let n=Object.keys(e);if(n.length!==1)return"cannot resolve an ordered map item";t=n[0]}else return"cannot resolve an ordered map item";return r.seen.has(t)?"duplicate key in ordered map":(r.seen.add(t),r.list.push(e),"")},"addItem"),finalize:a(r=>r.list,"finalize"),identify:a(()=>!1,"identify")}),Zhe=rx("tag:yaml.org,2002:pairs",{create:a(()=>[],"create"),addItem:a((r,e)=>{if(e instanceof Map)return e.size!==1?"cannot resolve a pairs item":(r.push(e.entries().next().value),"");if(Object.prototype.toString.call(e)!=="[object Object]")return"cannot resolve a pairs item";let t=e,n=Object.keys(t);return n.length!==1?"cannot resolve a pairs item":(r.push([n[0],t[n[0]]]),"")},"addItem"),identify:a(()=>!1,"identify")}),eme=dw("tag:yaml.org,2002:map",{create:a(()=>({}),"create"),identify:pw,represent:a(r=>{let e=new Map;for(let t of Object.keys(r))e.set(t,r[t]);return e},"represent"),addPair:a((r,e,t)=>{if(e!==null&&typeof e=="object")return"object-based map does not support complex keys";let n=String(e);return n==="__proto__"?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,""},"addPair"),has:a((r,e)=>e!==null&&typeof e=="object"?!1:Object.prototype.hasOwnProperty.call(r,String(e)),"has"),keys:a(r=>Object.keys(r),"keys"),get:a((r,e)=>{let t=String(e);return Object.prototype.hasOwnProperty.call(r,t)?r[t]:null},"get")}),tme=dw("tag:yaml.org,2002:set",{create:a(()=>new Set,"create"),identify:a(r=>r instanceof Set,"identify"),represent:a(r=>{let e=new Map;for(let t of r)e.set(t,null);return e},"represent"),addPair:a((r,e,t)=>t!==null?"cannot resolve a set item":(r.add(e),""),"addPair"),has:a((r,e)=>r.has(e),"has"),keys:a(r=>r.keys(),"keys"),get:a(()=>null,"get")});a(rme,"createTagDefinitionMap");a(nme,"createTagDefinitionListMap");a(ime,"compileTags");hw=class W5{static{a(this,"Schema")}tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(e){let t=ime(e),n=[],i=rme(),s=nme();for(let f of t){if(f.nodeKind==="scalar"&&f.implicit){if(f.matchByTagPrefix)throw new Error("Implicit scalar tags cannot match by tag prefix");n.push(f)}switch(f.nodeKind){case"scalar":f.matchByTagPrefix?s.scalar.push(f):i.scalar[f.tagName]=f;break;case"sequence":f.matchByTagPrefix?s.sequence.push(f):i.sequence[f.tagName]=f;break;case"mapping":f.matchByTagPrefix?s.mapping.push(f):i.mapping[f.tagName]=f;break}}let o=n.filter(f=>f.implicitFirstChars===null),c=new Set;for(let f of n)if(f.implicitFirstChars!==null)for(let d of f.implicitFirstChars)c.add(d);let l=new Map;for(let f of c)l.set(f,n.filter(d=>d.implicitFirstChars===null||d.implicitFirstChars.indexOf(f)!==-1));let u=i.scalar["tag:yaml.org,2002:str"];if(!u)throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=t,this.implicitScalarTags=n,this.implicitScalarByFirstChar=l,this.implicitScalarAnyFirstChar=o,this.defaultScalarTag=u,this.defaultSequenceTag=i.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=i.mapping["tag:yaml.org,2002:map"],this.exact=i,this.prefix=s}lookupScalarTag(e){let t=this.exact.scalar[e];if(t)return t;for(let n of this.prefix.scalar)if(e.startsWith(n.tagName))return n}lookupSequenceTag(e){let t=this.exact.sequence[e];if(t)return t;for(let n of this.prefix.sequence)if(e.startsWith(n.tagName))return n}lookupMappingTag(e){let t=this.exact.mapping[e];if(t)return t;for(let n of this.prefix.mapping)if(e.startsWith(n.tagName))return n}resolveImplicitScalarTag(e){let t=this.implicitScalarByFirstChar.get(e.charAt(0))??this.implicitScalarAnyFirstChar;for(let i of t){let s=i.resolve(e,!1,i.tagName);if(s!==St)return{value:s,tag:i}}let n=this.defaultScalarTag;return{value:n.resolve(e,!1,n.tagName),tag:n}}withTags(...e){let t=[];for(let n of e)t=t.concat(n);return new W5([...this.tags,...t])}},nx=new hw([rhe,Qhe,eme]),Lke=new hw([...nx.tags,she,phe,Ahe,Mhe]),_u=new hw([...nx.tags,ihe,uhe,G5,q5]),Gm=new hw([...nx.tags,ahe,ghe,qO,WO,Xhe,Vhe,zhe,Jhe,Zhe,tme]),sme=Gm.withTags({...qO,resolve:a((r,e,t)=>{let n=qO.resolve(r,e,t);return n===St?G5.resolve(r,e,t):n},"resolve")},{...WO,resolve:a((r,e,t)=>{let n=WO.resolve(r,e,t);return n===St?q5.resolve(r,e,t):n},"resolve")}),Nke=dw("tag:yaml.org,2002:map",{create:a(()=>new Map,"create"),addPair:a((r,e,t)=>(r.set(e,t),""),"addPair"),has:a((r,e)=>r.has(e),"has"),keys:a(r=>r.keys(),"keys"),get:a((r,e)=>r.get(e),"get"),identify:a(r=>r instanceof Map||pw(r),"identify"),represent:a(r=>{if(r instanceof Map)return r;let e=new Map,t=r;for(let n of Object.keys(t))e.set(n,t[n]);return e},"represent")});a(C5,"normalizeKey");kke=dw("tag:yaml.org,2002:map",{create:a(()=>({}),"create"),identify:pw,represent:a(r=>{let e=new Map;for(let t of Object.keys(r))e.set(t,r[t]);return e},"represent"),addPair:a((r,e,t)=>{let n=C5(e);return n===null?"nested arrays are not supported inside keys":(n==="__proto__"?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,"")},"addPair"),has:a((r,e)=>{let t=C5(e);return t!==null&&Object.prototype.hasOwnProperty.call(r,t)},"has"),keys:a(r=>Object.keys(r),"keys"),get:a((r,e)=>{let t=String(e);return Object.prototype.hasOwnProperty.call(r,t)?r[t]:null},"get")}),ome={maxLength:79,indent:1,linesBefore:3,linesAfter:2};a($O,"getLine");a(jO,"padStart");a(ame,"makeSnippet");a(O5,"formatError");zc=class z5 extends Error{static{a(this,"YAMLException")}reason;mark;constructor(e,t){super(),this.name="YAMLException",this.reason=e,this.mark=t,this.message=O5(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(e){return`${this.name}: ${O5(this,e)}`}static throwAt(e,t,n,i=""){let s=0,o=0;for(let l=0;l<t;l++){let u=e.charCodeAt(l);u===10?(s++,o=l+1):u===13&&(s++,e.charCodeAt(l+1)===10&&l++,o=l+1)}let c={name:i,buffer:e,position:t,line:s,column:t-o};throw c.snippet=ame(c),new z5(n,c)}},Sr={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},qe={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},ki={BLOCK:1,FLOW:2},Ki={CLIP:1,STRIP:2,KEEP:3},cme=-1;a(x5,"simpleEscapeSequence");K5=new Array(256),H5=new Array(256);for(let r=0;r<256;r++)K5[r]=x5(r)?1:0,H5[r]=x5(r);a(lme,"charFromCodepoint");a(ume,"fromHexCode$1");a(fme,"escapedHexLen$1");a(cw,"skipFoldedBreaks");a(ix,"foldedBreaks");a(dme,"getPlainValue");a(pme,"getSingleQuotedValue");a(hme,"getDoubleQuotedValue");a(P5,"getBlockValue");a(mme,"getScalarValue");gme=Object.assign(Object.create(null),{"!":"!","!!":"tag:yaml.org,2002:"});a(BO,"tagPercentEncode");a(Y5,"tagNameFull");a(X5,"tagNameShort");$d=-1,yme="tag:yaml.org,2002:merge",sx={filename:"",schema:_u,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};a(bme,"eventPosition$1");a(xn,"throwError$1");a(Q5,"finalizeCollection");a(_me,"constructScalar");a(F5,"collectionTagName");a(J5,"isMappingTag");a(D5,"chargeMergeWork");a(L5,"mergeKeys");a(Sme,"mergeSource");a(wme,"addMappingValue");a(UO,"addValue");a(VO,"storeAnchor");a(Eme,"constructFromEvents");vt=-1,Z5=Object.prototype.hasOwnProperty,Ud=1,KO=2,e6=3,lw=4,vme=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Tme=/[,\[\]{}]/,t6=/^(?:!|!!|![0-9A-Za-z-]+!)$/,HO=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,r6=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,Ame=new RegExp(`^(?:${HO})*$`),Ime=new RegExp(`^(?:${r6})+$`),Rme=new RegExp(`^(?:!(?:${HO})*|${r6}(?:${HO})*)$`),ox={filename:"",maxDepth:100};a(Cme,"addDocumentEvent");a(n6,"addSequenceEvent");a(YO,"addMappingEvent");a(N5,"insertFlowPairMappingEvent");a(Gd,"addScalarEvent");a(Ome,"addAliasEvent");a(jd,"addPopEvent");a(fi,"addEmptyScalarEvent");a(k5,"emptyProperties");a(Bd,"snapshotState");a(mu,"restoreState");a(Ue,"throwError");a(an,"isEol");a(yu,"isWhiteSpace");a(qs,"isWsOrEol");a(Ga,"isWsOrEolOrEnd");a(bu,"isFlowIndicator");a(xme,"fromDecimalCode");a(Pme,"fromHexCode");a(Fme,"escapedHexLen");a(Dme,"isSimpleEscape");a(uw,"consumeLineBreak");a(Wn,"skipSeparationSpace");a(Vd,"testDocumentSeparator");a(i6,"skipByteOrderMark");a(ax,"testDocumentBoundary");a(M5,"skipUntilLineEnd");a(s6,"checkPrintable");a(Lme,"readTagProperty");a(Nme,"readAnchorProperty");a(kme,"readAlias");a(XO,"readFlowScalarBreak");a(Mme,"readSingleQuotedScalar");a($me,"readDoubleQuotedScalar");a(jme,"readBlockScalar");a(Bme,"canStartPlainScalar");a(Ume,"readPlainScalar");a(Bm,"skipFlowSeparationSpace");a(Vme,"readFlowCollection");a($5,"readBlockSequence");a(GO,"readBlockMapping");a(gu,"parseNode");a(Gme,"readDirective");a(qme,"readDocument");a(Wme,"parseEvents");zme={...ox,...sx};a(Kme,"loadDocuments");a(Kc,"load");hu=Symbol("INVALID");a(Hme,"buildRepresentTypes");a(Yme,"matchTag");a(Vm,"build");a(Xme,"jsToAst");Qme=Symbol("visit:break"),o6=Symbol("visit:skip");a(aw,"visitNode");a(j5,"visit");a(mw,"hasBit");B5={applyQuoteFlowKeysOption:Jme,doubleQuoteForInvisibles:Zme,doubleQuoteWhitespaceOnly:ege,applyForceQuotesOption:tge,tryLongOrMultilineAsBlock:rge,quoteInvalidPlain:nge,fallbackToDoubleQuoted:ige};a(a6,"_preferredQuotedStyle");a(Jme,"applyQuoteFlowKeysOption");a(Zme,"doubleQuoteForInvisibles");a(ege,"doubleQuoteWhitespaceOnly");a(tge,"applyForceQuotesOption");a(rge,"tryLongOrMultilineAsBlock");a(nge,"quoteInvalidPlain");a(ige,"fallbackToDoubleQuoted");a(Um,"setBit");sge="[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]",oge="[\\n\\r]",age="\\uFEFF",cx="[ \\t]",c6=`(?:(?!(?:${oge}|${age}))${sge})`,gw=`(?:(?!${cx})${c6})`,l6="[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]",u6="[-?:,\\[\\]{}#&*!|>'\"%@`]",cge="[,\\[\\]{}]",QO=gw,JO=`(?:(?!${cge})${gw})`,lge=`(?:(?:(?!${u6})${gw})|[?:-](?=${QO}))`,uge=`(?:(?:(?!${u6})${gw})|[?:-](?=${JO}))`,f6=`(?:(?:(?![:#])${QO})|:(?=${QO}))#*`,d6=`(?:(?:(?![:#])${JO})|:(?=${JO}))#*`,p6=`(?:${cx}*${f6})*`,h6=`(?:${cx}*${d6})*`,m6=`${lge}#*${p6}`,g6=`${uge}#*${h6}`,fge=m6,dge=g6,pge=`\\n+${f6}${p6}`,hge=`\\n+${d6}${h6}`,mge=`${m6}(?:${pge})*`,gge=`${g6}(?:${hge})*`,yge=new RegExp(`^(?:${mge})$`,"u"),bge=new RegExp(`^(?:${gge})$`,"u"),_ge=new RegExp(`^(?:${fge})$`,"u"),Sge=new RegExp(`^(?:${dge})$`,"u"),wge=new RegExp(`^(?:${l6})*$`,"u"),Ege=new RegExp(`^(?:${l6}|\\n)*$`,"u"),vge=new RegExp(`^(?:${c6}|\\n)*$`,"u"),Tge=/^(?:---|\.\.\.)(?=$|[ \t\n\r])/,lx=/^(?:---|\.\.\.)(?=$|[ \t\n\r])/m;a(Age,"canUsePlain");a(Ige,"canUseSingleQuoted");a(Rge,"canUseBlock");a(Cge,"detectAllowedStyles");a(Oge,"renderScalar");a(xge,"renderPlain");a(Pge,"renderSingleQuoted");a(Fge,"renderLiteralBlock");a(Dge,"renderFoldedBlock");a(Lge,"renderDoubleQuoted");a(y6,"encodeFlowBreaks");a(b6,"indentString");a(Nge,"needIndentIndicator");a(_6,"blockHeader");a(S6,"dropEndingNewline");a(ZO,"isMoreIndented");a(U5,"foldLine");a(kge,"foldBlockScalar");Mge=/["\\\x00-\x1F\x7F-\xA0\u2028\u2029\uD800-\uDFFF\uFEFF\uFFFE\uFFFF]/gu;a($ge,"escapeCharacter");a(jge,"escapeString");fw=10,ux={indent:2,seqNoIndent:!1,seqInlineFirst:!0,lineWidth:80,flowBracketPadding:!1,flowSkipCommaSpace:!1,flowSkipColonSpace:!1,quoteFlowKeys:!1,quoteStyle:"single",forceQuotes:!1,scalarStyleRules:Object.keys(B5).map(r=>Reflect.get(B5,r)),tagBeforeAnchor:!1};a(Bge,"nodeTagShort");a(Uge,"createPresenterState");a(ex,"generateNextLine");a(Vge,"scalarLayout");a(Gge,"writeFlowSequence");a(V5,"writeBlockSequence");a(qge,"writeFlowMapping");a(Wge,"writeBlockMapping");a(tx,"cannotBeCompact");a(qa,"writeNode");a(zge,"rootStartsOwnLine");a(Kge,"writeDocumentDirectives");a(Hge,"present");Yge={...ux,schema:sme,skipInvalid:!1,noRefs:!1,flowLevel:-1,sortKeys:!1,transform:a(()=>{},"transform")};a(Xge,"defaultCompareFn");a(qd,"dump");Mke=Sr.DOCUMENT,$ke=Sr.SEQUENCE,jke=Sr.MAPPING,Bke=Sr.SCALAR,Uke=Sr.ALIAS,Vke=Sr.POP,Gke=qe.PLAIN,qke=qe.SINGLE_QUOTED,Wke=qe.DOUBLE_QUOTED,zke=qe.LITERAL_BLOCK,Kke=qe.FOLDED_BLOCK,Hke=ki.BLOCK,Yke=ki.FLOW,Xke=Ki.CLIP,Qke=Ki.STRIP,Jke=Ki.KEEP});var fx,w6,Qge,E6=$e(()=>{fx=a((r,e,t)=>{let n=r instanceof RegExp?w6(r,t):r,i=e instanceof RegExp?w6(e,t):e,s=n!==null&&i!=null&&Qge(n,i,t);return s&&{start:s[0],end:s[1],pre:t.slice(0,s[0]),body:t.slice(s[0]+n.length,s[1]),post:t.slice(s[1]+i.length)}},"balanced"),w6=a((r,e)=>{let t=e.match(r);return t?t[0]:null},"maybeMatch"),Qge=a((r,e,t)=>{let n,i,s,o,c,l=t.indexOf(r),u=t.indexOf(e,l+1),f=l;if(l>=0&&u>0){if(r===e)return[l,u];for(n=[],s=t.length;f>=0&&!c;){if(f===l)n.push(f),l=t.indexOf(r,f+1);else if(n.length===1){let d=n.pop();d!==void 0&&(c=[d,u])}else i=n.pop(),i!==void 0&&i<s&&(s=i,o=u),u=t.indexOf(e,f+1);f=l<u&&l>=0?l:u}n.length&&o!==void 0&&(c=[s,o])}return c},"range")});function dx(r){return isNaN(r)?r.charCodeAt(0):parseInt(r,10)}function dye(r){return r.replace(nye,v6).replace(iye,T6).replace(sye,mx).replace(oye,A6).replace(aye,I6)}function pye(r){return r.replace(Jge,"\\").replace(Zge,"{").replace(eye,"}").replace(tye,",").replace(rye,".")}function px(r,e){for(let t=0;t<e.length;t++)r.push(e[t])}function hye(r){let e=[],t="";for(;;){let n=fx("{","}",r);if(!n){let l=r.split(",");return l[0]=t+l[0],px(e,l),e}let{pre:i,body:s,post:o}=n,c=i.split(",");if(c[0]=t+c[0],c[c.length-1]+="{"+s+"}",!o.length)return px(e,c),e;t=c.pop(),px(e,c),r=o}}function R6(r,e={}){if(!r)return[];let{max:t=cye,maxLength:n=lye,maxDepth:i=uye,maxRewrites:s=fye}=e;return r.slice(0,2)==="{}"&&(r="\\{\\}"+r.slice(2)),hx(dye(r),t,n,i,0,s,!0).map(pye)}function mye(r){return"{"+r+"}"}function gye(r){return/^-?0\d/.test(r)}function yye(r,e){return r<=e}function bye(r,e){return r>=e}function Wm(r,e,t,n,i,s){let o=[],c=0;for(let l=0;l<r.length;l++)for(let u=0;u<t.length;u++){if(o.length>=n)return o;let f=r[l]+e+t[u];if(!(s&&!f)){if(c+f.length>i)return o;o.push(f),c+=f.length}}return o}function _ye(r,e,t,n){let i=r.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=dx(i[0]),c=dx(i[1]),l=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(dx(i[2])),1):1,f=yye;c<o&&(u*=-1,f=bye);let p=i.some(gye),h=0;for(let g=o;f(g,c)&&s.length<t;g+=u){let m;if(e)m=String.fromCharCode(g),m==="\\"&&(m="");else if(m=String(g),p){let b=l-m.length;if(b>0){let S=new Array(b+1).join("0");g<0?m="-"+S+m.slice(1):m=S+m}}if(h+m.length>n)break;s.push(m),h+=m.length}return s}function hx(r,e,t,n,i,s,o){if(i>n)return[r];let c=[""],l=0,u=!1,f=!0;for(;;){let d=fx("{","}",r);if(!d)return Wm(c,r,[""],e,t,u);let p=d.pre;if(/\$$/.test(p)){if(c=Wm(c,p+"{"+d.body+"}",[""],e,t,u&&!d.post.length),f=!1,!d.post.length)break;r=d.post;continue}let h=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(d.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(d.body),m=h||g,b=d.body.indexOf(",")>=0;if(!m&&!b){if(l<s&&d.post.match(/,(?!,).*\}/)){l++,r=d.pre+"{"+d.body+mx+d.post,o=!0;continue}return Wm(c,p+"{"+d.body+"}"+d.post,[""],e,t,u)}f&&(u=o&&!m,f=!1);let S;if(m)S=_ye(d.body,g,e,t);else{let _=hye(d.body);if(_.length===1&&_[0]!==void 0&&(_=hx(_[0],e,t,n,i+1,s,!1).map(mye),_.length===1)){if(c=Wm(c,p+_[0],[""],e,t,u&&!d.post.length),!d.post.length)break;r=d.post;continue}let A=u&&!d.post.length&&!p;for(let w=0;A&&w<c.length;w++)c[w]&&(A=!1);S=[];let E=0;e:for(let w=0;w<_.length;w++){let R=hx(_[w],e,t,n,i+1,s,!1);for(let O=0;O<R.length;O++){let P=R[O];if(!(A&&!P)){if(S.length>=e||E+P.length>t)break e;S.push(P),E+=P.length}}}}if(c=Wm(c,p,S,e,t,u&&!d.post.length),!d.post.length)break;r=d.post}return c}var v6,T6,mx,A6,I6,Jge,Zge,eye,tye,rye,nye,iye,sye,oye,aye,cye,lye,uye,fye,C6=$e(()=>{E6();v6="\0SLASH"+Math.random()+"\0",T6="\0OPEN"+Math.random()+"\0",mx="\0CLOSE"+Math.random()+"\0",A6="\0COMMA"+Math.random()+"\0",I6="\0PERIOD"+Math.random()+"\0",Jge=new RegExp(v6,"g"),Zge=new RegExp(T6,"g"),eye=new RegExp(mx,"g"),tye=new RegExp(A6,"g"),rye=new RegExp(I6,"g"),nye=/\\\\/g,iye=/\\{/g,sye=/\\}/g,oye=/\\,/g,aye=/\\\./g,cye=1e5,lye=4e6,uye=1e3,fye=1e3;a(dx,"numeric");a(dye,"escapeBraces");a(pye,"unescapeBraces");a(px,"pushAll");a(hye,"parseCommaParts");a(R6,"expand");a(mye,"embrace");a(gye,"isPadded");a(yye,"lte");a(bye,"gte");a(Wm,"combine");a(_ye,"expandSequence");a(hx,"expand_")});var zm,O6=$e(()=>{zm=a(r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern")});var Sye,Km,wye,x6,P6,F6=$e(()=>{Sye={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Km=a(r=>r.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),wye=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),x6=a(r=>r.join(""),"rangesToString"),P6=a((r,e)=>{let t=e;if(r.charAt(t)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=t+1,o=!1,c=!1,l=!1,u=!1,f=t,d="";e:for(;s<r.length;){let m=r.charAt(s);if((m==="!"||m==="^")&&s===t+1){u=!0,s++;continue}if(m==="]"&&o&&!l){f=s+1;break}if(o=!0,m==="\\"&&!l){l=!0,s++;continue}if(m==="["&&!l){for(let[b,[S,_,A]]of Object.entries(Sye))if(r.startsWith(b,s)){if(d)return["$.",!1,r.length-t,!0];s+=b.length,A?i.push(S):n.push(S),c=c||_;continue e}}if(l=!1,d){m>d?n.push(Km(d)+"-"+Km(m)):m===d&&n.push(Km(m)),d="",s++;continue}if(r.startsWith("-]",s+1)){n.push(Km(m+"-")),s+=2;continue}if(r.startsWith("-",s+1)){d=m,s+=2;continue}n.push(Km(m)),s++}if(f<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,r.length-t,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let m=n[0].length===2?n[0].slice(-1):n[0];return[wye(m),!1,f-t,!1]}let p="["+(u?"^":"")+x6(n)+"]",h="["+(u?"":"^")+x6(i)+"]";return[n.length&&i.length?"("+p+"|"+h+")":n.length?p:h,c,f-t,!0]},"parseClass")});var Ws,bw=$e(()=>{Ws=a((r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!0}={})=>t?e?r.replace(/\[([^/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?r.replace(/\[([^/\\{}])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape")});var Mi,Eye,gx,D6,vye,Tye,Aye,L6,Iye,_w,Rye,Cye,Oye,xye,yx,N6,k6,Pye,Su,bx=$e(()=>{F6();bw();Eye=new Set(["!","?","+","*","@"]),gx=a(r=>Eye.has(r),"isExtglobType"),D6=a(r=>gx(r.type),"isExtglobAST"),vye=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Tye=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Aye=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),L6=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Iye="(?!(?:^|/)\\.\\.?(?:$|/))",_w="(?!\\.)",Rye=new Set(["[","."]),Cye=new Set(["..","."]),Oye=new Set("().*{}+?[]^$\\!"),xye=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),yx="[^/]",N6=yx+"*?",k6=yx+"+?",Pye=0,Su=class{static{a(this,"AST")}type;#t;#r;#n=!1;#e=[];#i;#a;#p;#u=!1;#c;#f;#l=!1;id=++Pye;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#t.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#e.length,parts:this.#e}}constructor(e,t,n={}){this.type=e,e&&(this.#r=!0),this.#i=t,this.#t=this.#i?this.#i.#t:this,this.#c=this.#t===this?n:this.#t.#c,this.#p=this.#t===this?[]:this.#t.#p,e==="!"&&!this.#t.#u&&this.#p.push(this),this.#a=this.#i?this.#i.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#f!==void 0?this.#f:this.type?this.#f=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#f=this.#e.map(e=>String(e)).join("")}#d(){if(this!==this.#t)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#p.pop();){if(e.type!=="!")continue;let t=e,n=t.#i;for(;n;){for(let i=t.#a+1;!n.type&&i<n.#e.length;i++)for(let s of e.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#e[i])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof Mi&&t.#i===this))throw new Error("invalid part: "+t);this.#e.push(t)}}toJSON(){let e=this.type===null?this.#e.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#e.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#u&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#e[t];if(!(n instanceof Mi&&n.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#e.length:0;return this.#a===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new Mi(this.type,e);for(let n of this.#e)t.copyIn(n);return t}static#o(e,t,n,i,s){let o=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,f=!1;if(t.type===null){let m=n,b="";for(;m<e.length;){let S=e.charAt(m++);if(c||S==="\\"){c=!c,b+=S;continue}if(l){m===u+1?(S==="^"||S==="!")&&(f=!0):S==="]"&&!(m===u+2&&f)&&(l=!1),b+=S;continue}else if(S==="["){l=!0,u=m,f=!1,b+=S;continue}if(!i.noext&&gx(S)&&e.charAt(m)==="("&&s<=o){t.push(b),b="";let A=new Mi(S,t);m=Mi.#o(e,A,m,i,s+1),t.push(A);continue}b+=S}return t.push(b),m}let d=n+1,p=new Mi(null,t),h=[],g="";for(;d<e.length;){let m=e.charAt(d++);if(c||m==="\\"){c=!c,g+=m;continue}if(l){d===u+1?(m==="^"||m==="!")&&(f=!0):m==="]"&&!(d===u+2&&f)&&(l=!1),g+=m;continue}else if(m==="["){l=!0,u=d,f=!1,g+=m;continue}if(!i.noext&&gx(m)&&e.charAt(d)==="("&&(s<=o||t&&t.#_(m))){let S=t&&t.#_(m)?0:1;p.push(g),g="";let _=new Mi(m,p);p.push(_),d=Mi.#o(e,_,d,i,s+S);continue}if(m==="|"){p.push(g),g="",h.push(p),p=new Mi(null,t);continue}if(m===")")return g===""&&t.#e.length===0&&(t.#l=!0),p.push(g),g="",t.push(...h,p),d;g+=m}return t.type=null,t.#r=void 0,t.#e=[e.substring(n-1)],d}#g(e){return this.#E(e,Tye)}#E(e,t=vye){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null)return!1;let n=e.#e[0];return!n||typeof n!="object"||n.type===null?!1:this.#_(n.type,t)}#_(e,t=Aye){return!!t.get(this.type)?.includes(e)}#S(e,t){let n=e.#e[0],i=new Mi(null,n,this.options);i.#e.push(""),n.push(i),this.#A(e,t)}#A(e,t){let n=e.#e[0];this.#e.splice(t,1,...n.#e);for(let i of n.#e)typeof i=="object"&&(i.#i=this);this.#f=void 0}#y(e){return!!L6.get(this.type)?.has(e)}#v(e){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let t=e.#e[0];return!t||typeof t!="object"||t.type===null?!1:this.#y(t.type)}#T(e){let t=L6.get(this.type),n=e.#e[0],i=t?.get(n.type);if(!i)return!1;this.#e=n.#e;for(let s of this.#e)typeof s=="object"&&(s.#i=this);this.type=i,this.#f=void 0,this.#l=!1}static fromGlob(e,t={}){let n=new Mi(null,void 0,t);return Mi.#o(e,n,0,t,0),n}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[t,n,i,s]=this.toRegExpSource();if(!(i||this.#r||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let c=(this.#c.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#t===this&&(this.#m(),this.#d()),!D6(this)){let l=this.isStart()&&this.isEnd()&&!this.#e.some(h=>typeof h!="string"),u=this.#e.map(h=>{let[g,m,b,S]=typeof h=="string"?Mi.#w(h,this.#r,l):h.toRegExpSource(e);return this.#r=this.#r||b,this.#n=this.#n||S,g}).join(""),f="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&Cye.has(this.#e[0]))){let g=Rye,m=t&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),b=!t&&!e&&g.has(u.charAt(0));f=m?Iye:b?_w:""}let d="";return this.isEnd()&&this.#t.#u&&this.#i?.type==="!"&&(d="(?:$|\\/)"),[f+u+d,Ws(u),this.#r=!!this.#r,this.#n]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString(),u=this;return u.#e=[l],u.type=null,u.#r=void 0,[l,Ws(this.toString()),!1,!1]}let o=!n||e||t||!_w?"":this.#b(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let c="";if(this.type==="!"&&this.#l)c=(this.isStart()&&!t?_w:"")+k6;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?_w:"")+N6+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;c=i+s+l}return[c,Ws(s),this.#r=!!this.#r,this.#n]}#m(){if(D6(this)){let e=0,t=!1;do{t=!0;for(let n=0;n<this.#e.length;n++){let i=this.#e[n];typeof i=="object"&&(i.#m(),this.#E(i)?(t=!1,this.#A(i,n)):this.#g(i)?(t=!1,this.#S(i,n)):this.#v(i)&&(t=!1,this.#T(i)))}}while(!t&&++e<10)}else for(let e of this.#e)typeof e=="object"&&e.#m();this.#f=void 0}#b(e){return this.#e.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=t.toRegExpSource(e);return this.#n=this.#n||o,n}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#w(e,t,n=!1){let i=!1,s="",o=!1,c=!1;for(let l=0;l<e.length;l++){let u=e.charAt(l);if(i){i=!1,s+=(Oye.has(u)?"\\":"")+u;continue}if(u==="*"){if(c)continue;c=!0,s+=n&&/^[*]+$/.test(e)?k6:N6,t=!0;continue}else c=!1;if(u==="\\"){l===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[f,d,p,h]=P6(e,l);if(p){s+=f,o=o||d,l+=p-1,t=t||h;continue}}if(u==="?"){s+=yx,t=!0;continue}s+=xye(u)}return[s,Ws(e),!!t,o]}};Mi=Su});var Wd,_x=$e(()=>{Wd=a((r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!1}={})=>t?e?r.replace(/[?*()[\]{}]/g,"[$&]"):r.replace(/[?*()[\]\\{}]/g,"\\$&"):e?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&"),"escape")});var di,Fye,Dye,Lye,Nye,kye,Mye,$ye,jye,Bye,Uye,Vye,Gye,qye,Wye,zye,Kye,Hye,Yye,j6,B6,U6,M6,Xye,Rr,Qye,Jye,Zye,e0e,t0e,fs,r0e,V6,n0e,i0e,$6,s0e,Hi,Hc=$e(()=>{C6();O6();bx();_x();bw();bx();_x();bw();di=a((r,e,t={})=>(zm(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Hi(e,t).match(r)),"minimatch"),Fye=/^\*+([^+@!?*[(]*)$/,Dye=a(r=>e=>!e.startsWith(".")&&e.endsWith(r),"starDotExtTest"),Lye=a(r=>e=>e.endsWith(r),"starDotExtTestDot"),Nye=a(r=>(r=r.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(r)),"starDotExtTestNocase"),kye=a(r=>(r=r.toLowerCase(),e=>e.toLowerCase().endsWith(r)),"starDotExtTestNocaseDot"),Mye=/^\*+\.\*+$/,$ye=a(r=>!r.startsWith(".")&&r.includes("."),"starDotStarTest"),jye=a(r=>r!=="."&&r!==".."&&r.includes("."),"starDotStarTestDot"),Bye=/^\.\*+$/,Uye=a(r=>r!=="."&&r!==".."&&r.startsWith("."),"dotStarTest"),Vye=/^\*+$/,Gye=a(r=>r.length!==0&&!r.startsWith("."),"starTest"),qye=a(r=>r.length!==0&&r!=="."&&r!=="..","starTestDot"),Wye=/^\?+([^+@!?*[(]*)?$/,zye=a(([r,e=""])=>{let t=j6([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),Kye=a(([r,e=""])=>{let t=B6([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),Hye=a(([r,e=""])=>{let t=B6([r]);return e?n=>t(n)&&n.endsWith(e):t},"qmarksTestDot"),Yye=a(([r,e=""])=>{let t=j6([r]);return e?n=>t(n)&&n.endsWith(e):t},"qmarksTest"),j6=a(([r])=>{let e=r.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),B6=a(([r])=>{let e=r.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),U6=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",M6={win32:{sep:"\\"},posix:{sep:"/"}},Xye=U6==="win32"?M6.win32.sep:M6.posix.sep;di.sep=Xye;Rr=Symbol("globstar **");di.GLOBSTAR=Rr;Qye="[^/]",Jye=Qye+"*?",Zye="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",e0e="(?:(?!(?:\\/|^)\\.).)*?",t0e=a((r,e={})=>t=>di(t,r,e),"filter");di.filter=t0e;fs=a((r,e={})=>Object.assign({},r,e),"ext"),r0e=a(r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return di;let e=di;return Object.assign(a((n,i,s={})=>e(n,i,fs(r,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(i,s={}){super(i,fs(r,s))}static defaults(i){return e.defaults(fs(r,i)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(i,s,o={}){super(i,s,fs(r,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,fs(r,s))}},unescape:a((n,i={})=>e.unescape(n,fs(r,i)),"unescape"),escape:a((n,i={})=>e.escape(n,fs(r,i)),"escape"),filter:a((n,i={})=>e.filter(n,fs(r,i)),"filter"),defaults:a(n=>e.defaults(fs(r,n)),"defaults"),makeRe:a((n,i={})=>e.makeRe(n,fs(r,i)),"makeRe"),braceExpand:a((n,i={})=>e.braceExpand(n,fs(r,i)),"braceExpand"),match:a((n,i,s={})=>e.match(n,i,fs(r,s)),"match"),sep:e.sep,GLOBSTAR:Rr})},"defaults");di.defaults=r0e;V6=a((r,e={})=>(zm(r),e.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:R6(r,{max:e.braceExpandMax})),"braceExpand");di.braceExpand=V6;n0e=a((r,e={})=>new Hi(r,e).makeRe(),"makeRe");di.makeRe=n0e;i0e=a((r,e,t={})=>{let n=new Hi(e,t);return r=r.filter(i=>n.match(i)),n.options.nonull&&!r.length&&r.push(e),r},"match");di.match=i0e;$6=/[?*]|[+@!]\(.*?\)|\[|\]/,s0e=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Hi=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){zm(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||U6,this.isWindows=this.platform==="win32";let n="allowWindowsEscape";this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t[n]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!$6.test(s[2]))&&!$6.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(u)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n of e)for(let i=0;i<n.length;i++)n[i]==="**"&&(n[i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let n=-1;for(;(n=t.indexOf("**",n+1))!==-1;){let i=n;for(;t[i+1]==="**";)i++;i!==n&&t.splice(n,i-n)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let c=n[i+1],l=n[i+2],u=n[i+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;t=!0,n.splice(i,1);let f=n.slice(0);f[i]="**",e.push(f),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let c=n[o];o===1&&c===""&&n[0]===""||(c==="."||c==="")&&(t=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(t=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let l=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...l),n.length===0&&n.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let i=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(i){e[t]=[],e[n]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,n=!1){let i=0,s=0,o=[],c="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])o.push(c==="b"?t[s]:e[i]),i++,s++;else if(n&&e[i]==="**"&&t[s]===e[i+1])o.push(e[i]),i++;else if(n&&t[s]==="**"&&e[i]===t[s+1])o.push(t[s]),s++;else if(e[i]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(c==="b")return!1;c="a",o.push(e[i]),i++,s++}else if(t[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(c==="a")return!1;c="b",o.push(t[s]),i++,s++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let i=0,s=0;if(this.isWindows){let c=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),l=!c&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),u=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),f=!u&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),d=l?3:c?0:void 0,p=f?3:u?0:void 0;if(typeof d=="number"&&typeof p=="number"){let[h,g]=[e[d],t[p]];h.toLowerCase()===g.toLowerCase()&&(t[p]=h,s=p,i=d)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(Rr)?this.#t(e,t,n,i,s):this.#n(e,t,n,i,s)}#t(e,t,n,i,s){let o=t.indexOf(Rr,s),c=t.lastIndexOf(Rr),[l,u,f]=n?[t.slice(s,o),t.slice(o+1),[]]:[t.slice(s,o),t.slice(o+1,c),t.slice(c+1)];if(l.length){let _=e.slice(i,i+l.length);if(!this.#n(_,l,n,0,0))return!1;i+=l.length,s+=l.length}let d=0;if(f.length){if(f.length+i>e.length)return!1;let _=e.length-f.length;if(this.#n(e,f,n,_,0))d=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(_--,!this.#n(e,f,n,_,0)))return!1;d=f.length+1}}if(!u.length){let _=!!d;for(let A=i;A<e.length-d;A++){let E=String(e[A]);if(_=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return n||_}let p=[[[],0]],h=p[0],g=0,m=[0];for(let _ of u)_===Rr?(m.push(g),h=[[],0],p.push(h)):(h[0].push(_),g++);let b=p.length-1,S=e.length-d;for(let _ of p)_[1]=S-(m[b--]+_[0].length);return!!this.#r(e,p,i,0,n,0,!!d)}#r(e,t,n,i,s,o,c){let l=t[i];if(!l){for(let d=n;d<e.length;d++){c=!0;let p=e[d];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return c}let[u,f]=l;for(;n<=f;){if(this.#n(e.slice(0,n+u.length),u,s,n,0)&&o<this.maxGlobstarRecursion){let h=this.#r(e,t,n+u.length,i+1,s,o+1,c);if(h!==!1)return h}let p=e[n];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;n++}return s||null}#n(e,t,n,i,s){let o,c,l,u;for(o=i,c=s,u=e.length,l=t.length;o<u&&c<l;o++,c++){this.debug("matchOne loop");let f=t[c],d=e[o];if(this.debug(t,f,d),f===!1||f===Rr)return!1;let p;if(typeof f=="string"?(p=d===f,this.debug("string match",f,d,p)):(p=f.test(d),this.debug("pattern match",f,d,p)),!p)return!1}if(o===u&&c===l)return!0;if(o===u)return n;if(c===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return V6(this.pattern,this.options)}parse(e){zm(e);let t=this.options;if(e==="**")return Rr;if(e==="")return"";let n,i=null;(n=e.match(Vye))?i=t.dot?qye:Gye:(n=e.match(Fye))?i=(t.nocase?t.dot?kye:Nye:t.dot?Lye:Dye)(n[1]):(n=e.match(Wye))?i=(t.nocase?t.dot?Kye:zye:t.dot?Hye:Yye)(n):(n=e.match(Mye))?i=t.dot?jye:$ye:(n=e.match(Bye))&&(i=Uye);let s=Su.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?Jye:t.dot?Zye:e0e,i=new Set(t.nocase?["i"]:[]),s=e.map(l=>{let u=l.map(d=>{if(d instanceof RegExp)for(let p of d.flags.split(""))i.add(p);return typeof d=="string"?s0e(d):d===Rr?Rr:d._src});u.forEach((d,p)=>{let h=u[p+1],g=u[p-1];d!==Rr||g===Rr||(g===void 0?h!==void 0&&h!==Rr?u[p+1]="(?:\\/|"+n+"\\/)?"+h:u[p]=n:h===void 0?u[p-1]=g+"(?:\\/|\\/"+n+")?":h!==Rr&&(u[p-1]=g+"(?:\\/|\\/"+n+"\\/)"+h,u[p+1]=Rr))});let f=u.filter(d=>d!==Rr);if(this.partial&&f.length>=1){let d=[];for(let p=1;p<=f.length;p++)d.push(f.slice(0,p).join("/"));return"(?:"+d.join("|")+")"}return f.join("/")}).join("|"),[o,c]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+c+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+c+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let c=i.length-2;!o&&c>=0;c--)o=i[c];for(let c of s){let l=i;if(n.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return di.defaults(e).Minimatch}};di.AST=Su;di.Minimatch=Hi;di.escape=Wd;di.unescape=Ws});var ww,Pn,Hm,o0e,Sx,q6,G6,a0e,c0e,Yc,W6,Sw,l0e,Xm,K6=$e(()=>{ww=require("node:diagnostics_channel"),Pn=(0,ww.channel)("lru-cache:metrics"),Hm=(0,ww.tracingChannel)("lru-cache"),o0e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Sx=a(()=>Pn.hasSubscribers||Hm.hasSubscribers,"R"),q6=new Set,G6=typeof process=="object"&&process?process:{},a0e=a((r,e,t,n)=>{typeof G6.emitWarning=="function"?G6.emitWarning(r,e,t,n):console.error(`[${t}] ${e}: ${r}`)},"k"),c0e=a(r=>!q6.has(r),"H"),Yc=a(r=>!!r&&r===Math.floor(r)&&r>0&&isFinite(r),"T"),W6=a(r=>Yc(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Sw:null:null,"j"),Sw=class extends Array{static{a(this,"O")}constructor(r){super(r),this.fill(0)}},l0e=class Ym{static{a(this,"d")}heap;length;static#t=!1;static create(e){let t=W6(e);if(!t)return[];Ym.#t=!0;let n=new Ym(e,t);return Ym.#t=!1,n}constructor(e,t){if(!Ym.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Xm=class z6{static{a(this,"d")}#t;#r;#n;#e;#i;#a;#p;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#c;#f;#l;#d;#o;#g;#E;#_;#S;#A;#y;#v;#T;#m;#b;#w;#R;#s;#O;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#m,autopurgeTimers:e.#b,sizes:e.#v,keyMap:e.#l,keyList:e.#d,valList:e.#o,next:e.#g,prev:e.#E,get head(){return e.#_},get tail(){return e.#S},free:e.#A,isBackgroundFetch:a(t=>e.#h(t),"isBackgroundFetch"),backgroundFetch:a((t,n,i,s)=>e.#M(t,n,i,s),"backgroundFetch"),moveToTail:a(t=>e.#H(t),"moveToTail"),indexes:a(t=>e.#P(t),"indexes"),rindexes:a(t=>e.#F(t),"rindexes"),isStale:a(t=>e.#I(t),"isStale")}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#f}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#p}get dispose(){return this.#n}get onInsert(){return this.#e}get disposeAfter(){return this.#i}constructor(e){let{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:l,dispose:u,onInsert:f,disposeAfter:d,noDisposeOnSet:p,noUpdateTTL:h,maxSize:g=0,maxEntrySize:m=0,sizeCalculation:b,fetchMethod:S,memoMethod:_,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:R,ignoreFetchAbort:O,backgroundFetchSize:P=1,perf:N}=e;if(this.backgroundFetchSize=P,N!==void 0&&typeof N?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=N??o0e,t!==0&&!Yc(t))throw new TypeError("max option must be a nonnegative integer");let j=t?W6(t):Array;if(!j)throw new Error("invalid max value: "+t);if(this.#t=t,this.#r=g,this.maxEntrySize=m||this.#r,this.sizeCalculation=b,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#p=_,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=S,this.#R=!!S,this.#l=new Map,this.#d=Array.from({length:t}).fill(void 0),this.#o=Array.from({length:t}).fill(void 0),this.#g=new j(t),this.#E=new j(t),this.#_=0,this.#S=0,this.#A=l0e.create(t),this.#c=0,this.#f=0,typeof u=="function"&&(this.#n=u),typeof f=="function"&&(this.#e=f),typeof d=="function"?(this.#i=d,this.#y=[]):(this.#i=void 0,this.#y=void 0),this.#w=!!this.#n,this.#O=!!this.#e,this.#s=!!this.#i,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!R,this.ignoreFetchAbort=!!O,this.maxEntrySize!==0){if(this.#r!==0&&!Yc(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!Yc(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#q()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=Yc(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!Yc(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#x()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let U="LRU_CACHE_UNBOUNDED";c0e(U)&&(q6.add(U),a0e("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",U,z6))}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#x(){let e=new Sw(this.#t),t=new Sw(this.#t);this.#m=e,this.#T=t;let n=this.ttlAutopurge?Array.from({length:this.#t}):void 0;this.#b=n,this.#j=(l,u,f=this.#u.now())=>{t[l]=u!==0?f:0,e[l]=u,i(l,u)},this.#C=l=>{t[l]=e[l]!==0?this.#u.now():0,i(l,e[l])};let i=this.ttlAutopurge?(l,u)=>{if(n?.[l]&&(clearTimeout(n[l]),n[l]=void 0),u&&u!==0&&n){let f=setTimeout(()=>{this.#I(l)?(this.#$(this.#d[l],"expire"),n[l]=void 0):i(l,c(l))},u+1);f.unref&&f.unref(),n[l]=f}}:()=>{};this.#D=(l,u)=>{if(e[u]){let f=e[u],d=t[u];if(!f||!d)return;l.ttl=f,l.start=d,l.now=s||o();let p=l.now-d;l.remainingTTL=f-p}};let s=0,o=a(()=>{let l=this.#u.now();if(this.ttlResolution>0){s=l;let u=setTimeout(()=>s=0,this.ttlResolution);u.unref&&u.unref()}return l},"o");this.getRemainingTTL=l=>{let u=this.#l.get(l);return u===void 0?0:c(u)};let c=a(l=>{let u=e[l],f=t[l];if(!u||!f)return 1/0;let d=(s||o())-f;return u-d},"l");this.#I=l=>{let u=t[l],f=e[l];return!!f&&!!u&&(s||o())-u>f}}#C=a(()=>{},"#R");#D=a(()=>{},"#v");#j=a(()=>{},"#H");#I=a(()=>!1,"#p");#q(){let e=new Sw(this.#t);this.#f=0,this.#v=e,this.#N=t=>{this.#f-=e[t],e[t]=0},this.#B=(t,n,i,s)=>{if(!Yc(i)){if(this.#h(n))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,t),!Yc(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return i},this.#L=(t,n,i)=>{if(e[t]=n,this.#r){let s=this.#r-e[t];for(;this.#f>s;)this.#G(!0)}this.#f+=e[t],i&&(i.entrySize=n,i.totalCalculatedSize=this.#f)}}#N=a(e=>{},"#x");#L=a((e,t,n)=>{},"#j");#B=a((e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#N");*#P({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#S;this.#U(t)&&((e||!this.#I(t))&&(yield t),t!==this.#_);)t=this.#E[t]}*#F({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#_;this.#U(t)&&((e||!this.#I(t))&&(yield t),t!==this.#S);)t=this.#g[t]}#U(e){return e!==void 0&&this.#l.get(this.#d[e])===e}*entries(){for(let e of this.#P())this.#o[e]!==void 0&&this.#d[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#d[e],this.#o[e]])}*rentries(){for(let e of this.#F())this.#o[e]!==void 0&&this.#d[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#d[e],this.#o[e]])}*keys(){for(let e of this.#P()){let t=this.#d[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*rkeys(){for(let e of this.#F()){let t=this.#d[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*values(){for(let e of this.#P())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}*rvalues(){for(let e of this.#F())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let n of this.#P()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#d[n],this))return this.#K(this.#d[n],t)}}forEach(e,t=this){for(let n of this.#P()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#d[n],this)}}rforEach(e,t=this){for(let n of this.#F()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#d[n],this)}}purgeStale(){let e=!1;for(let t of this.#F({allowStale:!0}))this.#I(t)&&(this.#$(this.#d[t],"expire"),e=!0);return e}info(e){let t=this.#l.get(e);if(t===void 0)return;let n=this.#o[t],i=this.#h(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#m&&this.#T){let o=this.#m[t],c=this.#T[t];if(o&&c){let l=o-(this.#u.now()-c);s.ttl=l,s.start=Date.now()}}return this.#v&&(s.size=this.#v[t]),s}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let n=this.#d[t],i=this.#o[t],s=this.#h(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#m&&this.#T){o.ttl=this.#m[t];let c=this.#u.now()-this.#T[t];o.start=Math.floor(Date.now()-c)}this.#v&&(o.size=this.#v[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let i=Date.now()-n.start;n.start=this.#u.now()-i}this.#k(t,n.value,n)}}set(e,t,n={}){let{status:i=Pn.hasSubscribers?{}:void 0}=n;n.status=i,i&&(i.op="set",i.key=e,t!==void 0&&(i.value=t),i.cache=this);let s=this.#k(e,t,n);return i&&Pn.hasSubscribers&&Pn.publish(i),s}#k(e,t,n,i){let{ttl:s=this.ttl,start:o,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,f=this.#h(t);if(t===void 0)return u&&(u.set="deleted"),this.delete(e),this;let{noUpdateTTL:d=this.noUpdateTTL}=n;u&&!f&&(u.value=t);let p=this.#B(e,t,n.size||0,l,u);if(this.maxEntrySize&&p>this.maxEntrySize)return this.#$(e,"set"),u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this;let h=this.#c===0?void 0:this.#l.get(e);if(h===void 0)h=this.#c===0?this.#S:this.#A.length!==0?this.#A.pop():this.#c===this.#t?this.#G(!1):this.#c,this.#d[h]=e,this.#o[h]=t,this.#l.set(e,h),this.#g[this.#S]=h,this.#E[h]=this.#S,this.#S=h,this.#c++,this.#L(h,p,u),u&&(u.set="add"),d=!1,this.#O&&!f&&this.#e?.(t,e,"add");else{this.#H(h);let g=this.#o[h];if(t!==g){if(!c)if(this.#h(g)){g!==i&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=g;m!==void 0&&m!==t&&(this.#w&&this.#n?.(m,e,"set"),this.#s&&this.#y?.push([m,e,"set"]))}else this.#w&&this.#n?.(g,e,"set"),this.#s&&this.#y?.push([g,e,"set"]);if(this.#N(h),this.#L(h,p,u),this.#o[h]=t,!f){let m=g&&this.#h(g)?g.__staleWhileFetching:g,b=m===void 0?"add":t!==m?"replace":"update";u&&(u.set=b,m!==void 0&&(u.oldValue=m)),this.#O&&this.onInsert?.(t,e,b)}}else f||(u&&(u.set="update"),this.#O&&this.onInsert?.(t,e,"update"))}if(s!==0&&!this.#m&&this.#x(),this.#m&&(d||this.#j(h,s,o),u&&this.#D(u,h)),!c&&this.#s&&this.#y){let g=this.#y,m;for(;m=g?.shift();)this.#i?.(...m)}return this}pop(){try{for(;this.#c;){let e=this.#o[this.#_];if(this.#G(!0),this.#h(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#s&&this.#y){let e=this.#y,t;for(;t=e?.shift();)this.#i?.(...t)}}}#G(e){let t=this.#_,n=this.#d[t],i=this.#o[t],s=this.#h(i);s&&i.__abortController.abort(new Error("evicted"));let o=s?i.__staleWhileFetching:i;return(this.#w||this.#s)&&o!==void 0&&(this.#w&&this.#n?.(o,n,"evict"),this.#s&&this.#y?.push([o,n,"evict"])),this.#N(t),this.#b?.[t]&&(clearTimeout(this.#b[t]),this.#b[t]=void 0),e&&(this.#d[t]=void 0,this.#o[t]=void 0,this.#A.push(t)),this.#c===1?(this.#_=this.#S=0,this.#A.length=0):this.#_=this.#g[t],this.#l.delete(n),this.#c--,t}has(e,t={}){let{status:n=Pn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="has",n.key=e,n.cache=this);let i=this.#Y(e,t);return Pn.hasSubscribers&&Pn.publish(n),i}#Y(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,s=this.#l.get(e);if(s!==void 0){let o=this.#o[s];if(this.#h(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#I(s))i&&(i.has="stale",this.#D(i,s));else return n&&this.#C(s),i&&(i.has="hit",this.#D(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{status:n=Sx()?{}:void 0}=t;n&&(n.op="peek",n.key=e,n.cache=this),t.status=n;let i=this.#W(e,t);return Pn.hasSubscribers&&Pn.publish(n),i}#W(e,t){let{status:n,allowStale:i=this.allowStale}=t,s=this.#l.get(e);if(s===void 0||!i&&this.#I(s)){n&&(n.peek=s===void 0?"miss":"stale");return}let o=this.#o[s],c=this.#h(o)?o.__staleWhileFetching:o;return n&&(c!==void 0?(n.peek="hit",n.value=c):n.peek="miss"),c}#M(e,t,n,i){let s=t===void 0?void 0:this.#o[t];if(this.#h(s))return s;let o=new AbortController,{signal:c}=n;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let l={signal:o.signal,options:n,context:i},u=a((m,b=!1)=>{let{aborted:S}=o.signal,_=n.ignoreFetchAbort&&m!==void 0,A=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&m!==void 0);if(n.status&&(S&&!b?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,_&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),S&&!_&&!b)return d(o.signal.reason,A);let E=h,w=this.#o[t];return(w===h||w===void 0&&_&&b)&&(m===void 0?E.__staleWhileFetching!==void 0?this.#o[t]=E.__staleWhileFetching:this.#$(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.#k(e,m,l.options,E))),m},"r"),f=a(m=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=m),d(m,!1)),"c"),d=a((m,b)=>{let{aborted:S}=o.signal,_=S&&n.allowStaleOnFetchAbort,A=_||n.allowStaleOnFetchRejection,E=A||n.noDeleteOnFetchRejection,w=h;if(this.#o[t]===h&&(!E||!b&&w.__staleWhileFetching===void 0?this.#$(e,"fetch"):_||(this.#o[t]=w.__staleWhileFetching)),A)return n.status&&w.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw m},"m"),p=a((m,b)=>{let S=this.#a?.(e,s,l);o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(m(void 0),n.allowStaleOnFetchAbort&&(m=a(_=>u(_,!0),"f")))}),S&&S instanceof Promise?S.then(_=>m(_===void 0?void 0:_),b):S!==void 0&&m(S)},"_");n.status&&(n.status.fetchDispatched=!0);let h=new Promise(p).then(u,f),g=Object.assign(h,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.#k(e,g,{...l.options,status:void 0}),t=this.#l.get(e)):this.#o[t]=g,g}#h(e){if(!this.#R)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let n=Hm.hasSubscribers,{status:i=Sx()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let s=this.#z(e,t);return i&&n&&(i.trace=!0,Hm.tracePromise(()=>s,i).catch(()=>{})),s}async#z(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:m,forceRefresh:b=!1,status:S,signal:_}=t;if(S&&(S.op="fetch",S.key=e,b&&(S.forceRefresh=!0),S.cache=this),!this.#R)return S&&(S.fetch="get"),this.#K(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:S});let A={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:g,ignoreFetchAbort:h,status:S,signal:_},E=this.#l.get(e);if(E===void 0){S&&(S.fetch="miss");let w=this.#M(e,E,A,m);return w.__returned=w}else{let w=this.#o[E];if(this.#h(w)){let N=n&&w.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",N&&(S.returnedStale=!0)),N?w.__staleWhileFetching:w.__returned=w}let R=this.#I(E);if(!b&&!R)return S&&(S.fetch="hit"),this.#H(E),i&&this.#C(E),S&&this.#D(S,E),w;let O=this.#M(e,E,A,m),P=O.__staleWhileFetching!==void 0&&n;return S&&(S.fetch=R?"stale":"refresh",P&&R&&(S.returnedStale=!0)),P?O.__staleWhileFetching:O.__returned=O}}forceFetch(e,t={}){let n=Hm.hasSubscribers,{status:i=Sx()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let s=this.#V(e,t);return i&&n&&(i.trace=!0,Hm.tracePromise(()=>s,i).catch(()=>{})),s}async#V(e,t={}){let n=await this.#z(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let{status:n=Pn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="memo",n.key=e,t.context&&(n.context=t.context),n.cache=this);let i=this.#J(e,t);return n&&(n.value=i),Pn.hasSubscribers&&Pn.publish(n),i}#J(e,t={}){let n=this.#p;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,status:s,forceRefresh:o,...c}=t;s&&o&&(s.forceRefresh=!0);let l=this.#K(e,c),u=o||l===void 0;if(s&&(s.memo=u?"miss":"hit",u||(s.value=l)),!u)return l;let f=n(e,l,{options:c,context:i});return s&&(s.value=f),this.#k(e,f,c),f}get(e,t={}){let{status:n=Pn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="get",n.key=e,n.cache=this);let i=this.#K(e,t);return n&&(i!==void 0&&(n.value=i),Pn.hasSubscribers&&Pn.publish(n)),i}#K(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,c=this.#l.get(e);if(c===void 0){o&&(o.get="miss");return}let l=this.#o[c],u=this.#h(l);return o&&this.#D(o,c),this.#I(c)?u?(o&&(o.get="stale-fetching"),n&&l.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),l.__staleWhileFetching):void 0):(s||this.#$(e,"expire"),o&&(o.get="stale"),n?(o&&(o.returnedStale=!0),l):void 0):(o&&(o.get=u?"fetching":"hit"),this.#H(c),i&&this.#C(c),u?l.__staleWhileFetching:l)}#X(e,t){this.#E[t]=e,this.#g[e]=t}#H(e){e!==this.#S&&(e===this.#_?this.#_=this.#g[e]:this.#X(this.#E[e],this.#g[e]),this.#X(this.#S,e),this.#S=e)}delete(e){return this.#$(e,"delete")}#$(e,t){Pn.hasSubscribers&&Pn.publish({op:"delete",delete:t,key:e,cache:this});let n=!1;if(this.#c!==0){let i=this.#l.get(e);if(i!==void 0)if(this.#b?.[i]&&(clearTimeout(this.#b[i]),this.#b[i]=void 0),n=!0,this.#c===1)this.#Q(t);else{this.#N(i);let s=this.#o[i];if(this.#h(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#s)&&(this.#w&&this.#n?.(s,e,t),this.#s&&this.#y?.push([s,e,t])),this.#l.delete(e),this.#d[i]=void 0,this.#o[i]=void 0,i===this.#S)this.#S=this.#E[i];else if(i===this.#_)this.#_=this.#g[i];else{let o=this.#E[i];this.#g[o]=this.#g[i];let c=this.#g[i];this.#E[c]=this.#E[i]}this.#c--,this.#A.push(i)}}if(this.#s&&this.#y?.length){let i=this.#y,s;for(;s=i?.shift();)this.#i?.(...s)}return n}clear(){return this.#Q("delete")}#Q(e){for(let t of this.#F({allowStale:!0})){let n=this.#o[t];if(this.#h(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#d[t];this.#w&&this.#n?.(n,i,e),this.#s&&this.#y?.push([n,i,e])}}if(this.#l.clear(),this.#o.fill(void 0),this.#d.fill(void 0),this.#m&&this.#T){this.#m.fill(0),this.#T.fill(0);for(let t of this.#b??[])t!==void 0&&clearTimeout(t);this.#b?.fill(void 0)}if(this.#v&&this.#v.fill(0),this.#_=0,this.#S=0,this.#A.length=0,this.#f=0,this.#c=0,this.#s&&this.#y){let t=this.#y,n;for(;n=t?.shift();)this.#i?.(...n)}}}});var Cw,Rx,J6,H6,u0e,f0e,d0e,Wa,za,Xc,Ew,Qm,vw,Y6,Tw,X6,zs,zd,cn,Jm,Kd,ln,pi,un,wx,Aw,Kn,Cr,Ex,vx,Q6,Tx,jo,Ax,Iw,Zm,wu,Yi,eg,p0e,h0e,m0e,g0e,Rw,Ix,y0e,b0e,Qc,Cx=$e(()=>{Cw=require("node:events"),Rx=Q(require("node:stream"),1),J6=require("node:string_decoder"),H6=typeof process=="object"&&process?process:{stdout:null,stderr:null},u0e=a(r=>!!r&&typeof r=="object"&&(r instanceof Qc||r instanceof Rx.default||f0e(r)||d0e(r)),"isStream"),f0e=a(r=>!!r&&typeof r=="object"&&r instanceof Cw.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==Rx.default.Writable.prototype.pipe,"isReadable"),d0e=a(r=>!!r&&typeof r=="object"&&r instanceof Cw.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function","isWritable"),Wa=Symbol("EOF"),za=Symbol("maybeEmitEnd"),Xc=Symbol("emittedEnd"),Ew=Symbol("emittingEnd"),Qm=Symbol("emittedError"),vw=Symbol("closed"),Y6=Symbol("read"),Tw=Symbol("flush"),X6=Symbol("flushChunk"),zs=Symbol("encoding"),zd=Symbol("decoder"),cn=Symbol("flowing"),Jm=Symbol("paused"),Kd=Symbol("resume"),ln=Symbol("buffer"),pi=Symbol("pipes"),un=Symbol("bufferLength"),wx=Symbol("bufferPush"),Aw=Symbol("bufferShift"),Kn=Symbol("objectMode"),Cr=Symbol("destroyed"),Ex=Symbol("error"),vx=Symbol("emitData"),Q6=Symbol("emitEnd"),Tx=Symbol("emitEnd2"),jo=Symbol("async"),Ax=Symbol("abort"),Iw=Symbol("aborted"),Zm=Symbol("signal"),wu=Symbol("dataListeners"),Yi=Symbol("discarded"),eg=a(r=>Promise.resolve().then(r),"defer"),p0e=a(r=>r(),"nodefer"),h0e=a(r=>r==="end"||r==="finish"||r==="prefinish","isEndish"),m0e=a(r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,"isArrayBufferLike"),g0e=a(r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),"isArrayBufferView"),Rw=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[Kd](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ix=class extends Rw{static{a(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},y0e=a(r=>!!r.objectMode,"isObjectModeOptions"),b0e=a(r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer","isEncodingOptions"),Qc=class extends Cw.EventEmitter{static{a(this,"Minipass")}[cn]=!1;[Jm]=!1;[pi]=[];[ln]=[];[Kn];[zs];[jo];[zd];[Wa]=!1;[Xc]=!1;[Ew]=!1;[vw]=!1;[Qm]=null;[un]=0;[Cr]=!1;[Zm];[Iw]=!1;[wu]=0;[Yi]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");y0e(t)?(this[Kn]=!0,this[zs]=null):b0e(t)?(this[zs]=t.encoding,this[Kn]=!1):(this[Kn]=!1,this[zs]=null),this[jo]=!!t.async,this[zd]=this[zs]?new J6.StringDecoder(this[zs]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[ln],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[pi],"get")});let{signal:n}=t;n&&(this[Zm]=n,n.aborted?this[Ax]():n.addEventListener("abort",()=>this[Ax]()))}get bufferLength(){return this[un]}get encoding(){return this[zs]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Kn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[jo]}set async(e){this[jo]=this[jo]||!!e}[Ax](){this[Iw]=!0,this.emit("abort",this[Zm]?.reason),this.destroy(this[Zm]?.reason)}get aborted(){return this[Iw]}set aborted(e){}write(e,t,n){if(this[Iw])return!1;if(this[Wa])throw new Error("write after end");if(this[Cr])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(n=t,t="utf8"),t||(t="utf8");let i=this[jo]?eg:p0e;if(!this[Kn]&&!Buffer.isBuffer(e)){if(g0e(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(m0e(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Kn]?(this[cn]&&this[un]!==0&&this[Tw](!0),this[cn]?this.emit("data",e):this[wx](e),this[un]!==0&&this.emit("readable"),n&&i(n),this[cn]):e.length?(typeof e=="string"&&!(t===this[zs]&&!this[zd]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[zs]&&(e=this[zd].write(e)),this[cn]&&this[un]!==0&&this[Tw](!0),this[cn]?this.emit("data",e):this[wx](e),this[un]!==0&&this.emit("readable"),n&&i(n),this[cn]):(this[un]!==0&&this.emit("readable"),n&&i(n),this[cn])}read(e){if(this[Cr])return null;if(this[Yi]=!1,this[un]===0||e===0||e&&e>this[un])return this[za](),null;this[Kn]&&(e=null),this[ln].length>1&&!this[Kn]&&(this[ln]=[this[zs]?this[ln].join(""):Buffer.concat(this[ln],this[un])]);let t=this[Y6](e||null,this[ln][0]);return this[za](),t}[Y6](e,t){if(this[Kn])this[Aw]();else{let n=t;e===n.length||e===null?this[Aw]():typeof n=="string"?(this[ln][0]=n.slice(e),t=n.slice(0,e),this[un]-=e):(this[ln][0]=n.subarray(e),t=n.subarray(0,e),this[un]-=e)}return this.emit("data",t),!this[ln].length&&!this[Wa]&&this.emit("drain"),t}end(e,t,n){return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t="utf8"),e!==void 0&&this.write(e,t),n&&this.once("end",n),this[Wa]=!0,this.writable=!1,(this[cn]||!this[Jm])&&this[za](),this}[Kd](){this[Cr]||(!this[wu]&&!this[pi].length&&(this[Yi]=!0),this[Jm]=!1,this[cn]=!0,this.emit("resume"),this[ln].length?this[Tw]():this[Wa]?this[za]():this.emit("drain"))}resume(){return this[Kd]()}pause(){this[cn]=!1,this[Jm]=!0,this[Yi]=!1}get destroyed(){return this[Cr]}get flowing(){return this[cn]}get paused(){return this[Jm]}[wx](e){this[Kn]?this[un]+=1:this[un]+=e.length,this[ln].push(e)}[Aw](){return this[Kn]?this[un]-=1:this[un]-=this[ln][0].length,this[ln].shift()}[Tw](e=!1){do;while(this[X6](this[Aw]())&&this[ln].length);!e&&!this[ln].length&&!this[Wa]&&this.emit("drain")}[X6](e){return this.emit("data",e),this[cn]}pipe(e,t){if(this[Cr])return e;this[Yi]=!1;let n=this[Xc];return t=t||{},e===H6.stdout||e===H6.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,n?t.end&&e.end():(this[pi].push(t.proxyErrors?new Ix(this,e,t):new Rw(this,e,t)),this[jo]?eg(()=>this[Kd]()):this[Kd]()),e}unpipe(e){let t=this[pi].find(n=>n.dest===e);t&&(this[pi].length===1?(this[cn]&&this[wu]===0&&(this[cn]=!1),this[pi]=[]):this[pi].splice(this[pi].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e==="data")this[Yi]=!1,this[wu]++,!this[pi].length&&!this[cn]&&this[Kd]();else if(e==="readable"&&this[un]!==0)super.emit("readable");else if(h0e(e)&&this[Xc])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Qm]){let i=t;this[jo]?eg(()=>i.call(this,this[Qm])):i.call(this,this[Qm])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e==="data"&&(this[wu]=this.listeners("data").length,this[wu]===0&&!this[Yi]&&!this[pi].length&&(this[cn]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[wu]=0,!this[Yi]&&!this[pi].length&&(this[cn]=!1)),t}get emittedEnd(){return this[Xc]}[za](){!this[Ew]&&!this[Xc]&&!this[Cr]&&this[ln].length===0&&this[Wa]&&(this[Ew]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[vw]&&this.emit("close"),this[Ew]=!1)}emit(e,...t){let n=t[0];if(e!=="error"&&e!=="close"&&e!==Cr&&this[Cr])return!1;if(e==="data")return!this[Kn]&&!n?!1:this[jo]?(eg(()=>this[vx](n)),!0):this[vx](n);if(e==="end")return this[Q6]();if(e==="close"){if(this[vw]=!0,!this[Xc]&&!this[Cr])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Qm]=n,super.emit(Ex,n);let s=!this[Zm]||this.listeners("error").length?super.emit("error",n):!1;return this[za](),s}else if(e==="resume"){let s=super.emit("resume");return this[za](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...t);return this[za](),i}[vx](e){for(let n of this[pi])n.dest.write(e)===!1&&this.pause();let t=this[Yi]?!1:super.emit("data",e);return this[za](),t}[Q6](){return this[Xc]?!1:(this[Xc]=!0,this.readable=!1,this[jo]?(eg(()=>this[Tx]()),!0):this[Tx]())}[Tx](){if(this[zd]){let t=this[zd].end();if(t){for(let n of this[pi])n.dest.write(t);this[Yi]||super.emit("data",t)}}for(let t of this[pi])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Kn]||(e.dataLength=0);let t=this.promise();return this.on("data",n=>{e.push(n),this[Kn]||(e.dataLength+=n.length)}),await t,e}async concat(){if(this[Kn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[zs]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(Cr,()=>t(new Error("stream destroyed"))),this.on("error",n=>t(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Yi]=!1;let e=!1,t=a(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:a(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[Wa])return t();let s,o,c=a(d=>{this.off("data",l),this.off("end",u),this.off(Cr,f),t(),o(d)},"onerr"),l=a(d=>{this.off("error",c),this.off("end",u),this.off(Cr,f),this.pause(),s({value:d,done:!!this[Wa]})},"ondata"),u=a(()=>{this.off("error",c),this.off("data",l),this.off(Cr,f),t(),s({done:!0,value:void 0})},"onend"),f=a(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((d,p)=>{o=p,s=d,this.once(Cr,f),this.once("error",c),this.once("end",u),this.once("data",l)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Yi]=!1;let e=!1,t=a(()=>(this.pause(),this.off(Ex,t),this.off(Cr,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),n=a(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(Ex,t),this.once(Cr,t),{next:n,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[Cr])return e?this.emit("error",e):this.emit(Cr),this;this[Cr]=!0,this[Yi]=!0,this[ln].length=0,this[un]=0;let t=this;return typeof t.close=="function"&&!this[vw]&&t.close(),e?this.emit("error",e):this.emit(Cr),this}static get isStream(){return u0e}}});var Hd,n8,Uo,_0e,Jc,S0e,rg,i8,s8,w0e,E0e,ps,o8,a8,Bo,c8,l8,Eu,u8,ds,tg,Ox,Z6,ng,Ks,Ow,Pw,e8,v0e,xx,t8,ig,r8,xw,Fw,Px,f8,Hn,Dw,Lw,Nw,Yd,Xd,sg,kMe,d8,p8=$e(()=>{K6();Hd=require("node:path"),n8=require("node:url"),Uo=require("fs"),_0e=Q(require("node:fs"),1),Jc=require("node:fs/promises");Cx();S0e=Uo.realpathSync.native,rg={lstatSync:Uo.lstatSync,readdir:Uo.readdir,readdirSync:Uo.readdirSync,readlinkSync:Uo.readlinkSync,realpathSync:S0e,promises:{lstat:Jc.lstat,readdir:Jc.readdir,readlink:Jc.readlink,realpath:Jc.realpath}},i8=a(r=>!r||r===rg||r===_0e?rg:{...rg,...r,promises:{...rg.promises,...r.promises||{}}},"fsFromOption"),s8=/^\\\\\?\\([a-z]:)\\?$/i,w0e=a(r=>r.replace(/\//g,"\\").replace(s8,"$1\\"),"uncToDrive"),E0e=/[\\\/]/,ps=0,o8=1,a8=2,Bo=4,c8=6,l8=8,Eu=10,u8=12,ds=15,tg=~ds,Ox=16,Z6=32,ng=64,Ks=128,Ow=256,Pw=512,e8=ng|Ks|Pw,v0e=1023,xx=a(r=>r.isFile()?l8:r.isDirectory()?Bo:r.isSymbolicLink()?Eu:r.isCharacterDevice()?a8:r.isBlockDevice()?c8:r.isSocket()?u8:r.isFIFO()?o8:ps,"entToType"),t8=new Xm({max:2**12}),ig=a(r=>{let e=t8.get(r);if(e)return e;let t=r.normalize("NFKD");return t8.set(r,t),t},"normalize"),r8=new Xm({max:2**12}),xw=a(r=>{let e=r8.get(r);if(e)return e;let t=ig(r.toLowerCase());return r8.set(r,t),t},"normalizeNocase"),Fw=class extends Xm{static{a(this,"ResolveCache")}constructor(){super({max:256})}},Px=class extends Xm{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(t=>t.length+1,"sizeCalculation")})}},f8=Symbol("PathScurry setAsCwd"),Hn=class{static{a(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#t;#r;get dev(){return this.#r}#n;get mode(){return this.#n}#e;get nlink(){return this.#e}#i;get uid(){return this.#i}#a;get gid(){return this.#a}#p;get rdev(){return this.#p}#u;get blksize(){return this.#u}#c;get ino(){return this.#c}#f;get size(){return this.#f}#l;get blocks(){return this.#l}#d;get atimeMs(){return this.#d}#o;get mtimeMs(){return this.#o}#g;get ctimeMs(){return this.#g}#E;get birthtimeMs(){return this.#E}#_;get atime(){return this.#_}#S;get mtime(){return this.#S}#A;get ctime(){return this.#A}#y;get birthtime(){return this.#y}#v;#T;#m;#b;#w;#R;#s;#O;#x;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=ps,n,i,s,o,c){this.name=e,this.#v=s?xw(e):ig(e),this.#s=t&v0e,this.nocase=s,this.roots=i,this.root=n||this,this.#O=o,this.#m=c.fullpath,this.#w=c.relative,this.#R=c.relativePosix,this.parent=c.parent,this.parent?this.#t=this.parent.#t:this.#t=i8(c.fs)}depth(){return this.#T!==void 0?this.#T:this.parent?this.#T=this.parent.depth()+1:this.#T=0}childrenCache(){return this.#O}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#D(i):this.#D(i)}#D(e){let t=this;for(let n of e)t=t.child(n);return t}children(){let e=this.#O.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#O.set(this,t),this.#s&=~Ox,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?xw(e):ig(e);for(let l of n)if(l.#v===i)return l;let s=this.parent?this.sep:"",o=this.#m?this.#m+s+e:void 0,c=this.newChild(e,ps,{...t,parent:this,fullpath:o});return this.canReaddir()||(c.#s|=Ks),n.push(c),c}relative(){if(this.isCWD)return"";if(this.#w!==void 0)return this.#w;let e=this.name,t=this.parent;if(!t)return this.#w=this.name;let n=t.relative();return n+(!n||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,t=this.parent;if(!t)return this.#R=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?"":"/")+e}fullpath(){if(this.#m!==void 0)return this.#m;let e=this.name,t=this.parent;if(!t)return this.#m=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#m=i}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep==="/")return this.#b=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#b=`//?/${i}`:this.#b=i}let e=this.parent,t=e.fullpathPosix(),n=t+(!t||!e.parent?"":"/")+this.name;return this.#b=n}isUnknown(){return(this.#s&ds)===ps}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#s&ds)===l8}isDirectory(){return(this.#s&ds)===Bo}isCharacterDevice(){return(this.#s&ds)===a8}isBlockDevice(){return(this.#s&ds)===c8}isFIFO(){return(this.#s&ds)===o8}isSocket(){return(this.#s&ds)===u8}isSymbolicLink(){return(this.#s&Eu)===Eu}lstatCached(){return this.#s&Z6?this:void 0}readlinkCached(){return this.#x}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#x)return!0;if(!this.parent)return!1;let e=this.#s&ds;return!(e!==ps&&e!==Eu||this.#s&Ow||this.#s&Ks)}calledReaddir(){return!!(this.#s&Ox)}isENOENT(){return!!(this.#s&Ks)}isNamed(e){return this.nocase?this.#v===xw(e):this.#v===ig(e)}async readlink(){let e=this.#x;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#t.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(t);if(n)return this.#x=n}catch(t){this.#F(t.code);return}}readlinkSync(){let e=this.#x;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#t.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(t);if(n)return this.#x=n}catch(t){this.#F(t.code);return}}#j(e){this.#s|=Ox;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#I()}}#I(){this.#s&Ks||(this.#s=(this.#s|Ks)&tg,this.#q())}#q(){let e=this.children();e.provisional=0;for(let t of e)t.#I()}#N(){this.#s|=Pw,this.#L()}#L(){if(this.#s&ng)return;let e=this.#s;(e&ds)===Bo&&(e&=tg),this.#s=e|ng,this.#q()}#B(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#I():this.children().provisional=0}#P(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#I()}#F(e=""){let t=this.#s;t|=Ow,e==="ENOENT"&&(t|=Ks),(e==="EINVAL"||e==="UNKNOWN")&&(t&=tg),this.#s=t,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#U(e,t){return this.#G(e,t)||this.#k(e,t)}#k(e,t){let n=xx(e),i=this.newChild(e.name,n,{parent:this}),s=i.#s&ds;return s!==Bo&&s!==Eu&&s!==ps&&(i.#s|=ng),t.unshift(i),t.provisional++,i}#G(e,t){for(let n=t.provisional;n<t.length;n++){let i=t[n];if((this.nocase?xw(e.name):ig(e.name))===i.#v)return this.#Y(e,i,n,t)}}#Y(e,t,n,i){let s=t.name;return t.#s=t.#s&tg|xx(e),s!==e.name&&(t.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#s&Ks)===0)try{return this.#W(await this.#t.promises.lstat(this.fullpath())),this}catch(e){this.#P(e.code)}}lstatSync(){if((this.#s&Ks)===0)try{return this.#W(this.#t.lstatSync(this.fullpath())),this}catch(e){this.#P(e.code)}}#W(e){let{atime:t,atimeMs:n,birthtime:i,birthtimeMs:s,blksize:o,blocks:c,ctime:l,ctimeMs:u,dev:f,gid:d,ino:p,mode:h,mtime:g,mtimeMs:m,nlink:b,rdev:S,size:_,uid:A}=e;this.#_=t,this.#d=n,this.#y=i,this.#E=s,this.#u=o,this.#l=c,this.#A=l,this.#g=u,this.#r=f,this.#a=d,this.#c=p,this.#n=h,this.#S=g,this.#o=m,this.#e=b,this.#p=S,this.#f=_,this.#i=A;let E=xx(e);this.#s=this.#s&tg|E|Z6,E!==ps&&E!==Bo&&E!==Eu&&(this.#s|=ng)}#M=[];#h=!1;#z(e){this.#h=!1;let t=this.#M.slice();this.#M.length=0,t.forEach(n=>n(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#M.push(e),this.#h)return;this.#h=!0;let i=this.fullpath();this.#t.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#B(s.code),n.provisional=0;else{for(let c of o)this.#U(c,n);this.#j(n)}this.#z(n.slice(0,n.provisional))})}#V;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#V)await this.#V;else{let n=a(()=>{},"resolve");this.#V=new Promise(i=>n=i);try{for(let i of await this.#t.promises.readdir(t,{withFileTypes:!0}))this.#U(i,e);this.#j(e)}catch(i){this.#B(i.code),e.provisional=0}this.#V=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let n of this.#t.readdirSync(t,{withFileTypes:!0}))this.#U(n,e);this.#j(e)}catch(n){this.#B(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#s&e8)return!1;let e=ds&this.#s;return e===ps||e===Bo||e===Eu}shouldWalk(e,t){return(this.#s&Bo)===Bo&&!(this.#s&e8)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((Pw|Ow|Ks)&this.#s))try{let e=await this.#t.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#N()}}realpathSync(){if(this.#C)return this.#C;if(!((Pw|Ow|Ks)&this.#s))try{let e=this.#t.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#N()}}[f8](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],i=this;for(;i&&i.parent;)t.add(i),i.#w=n.join(this.sep),i.#R=n.join("/"),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#w=void 0,i.#R=void 0,i=i.parent}},Dw=class r extends Hn{static{a(this,"PathWin32")}sep="\\";splitSep=E0e;constructor(e,t=ps,n,i,s,o,c){super(e,t,n,i,s,o,c)}newChild(e,t=ps,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return Hd.win32.parse(e).root}getRoot(e){if(e=w0e(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new Yd(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(s8,"$1\\"),e===t}},Lw=class r extends Hn{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=ps,n,i,s,o,c){super(e,t,n,i,s,o,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=ps,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Nw=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#t;#r;#n;nocase;#e;constructor(e=process.cwd(),t,n,{nocase:i,childrenCacheSize:s=16*1024,fs:o=rg}={}){this.#e=i8(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,n8.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#t=new Fw,this.#r=new Fw,this.#n=new Px(s);let l=c.substring(this.rootPath.length).split(n);if(l.length===1&&!l[0]&&l.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#e),this.roots[this.rootPath]=this.root;let u=this.root,f=l.length-1,d=t.sep,p=this.rootPath,h=!1;for(let g of l){let m=f--;u=u.child(g,{relative:new Array(m).fill("..").join(d),relativePosix:new Array(m).fill("..").join("/"),fullpath:p+=(h?"":d)+g}),h=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#n}resolve(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#t.get(t);if(n!==void 0)return n;let i=this.cwd.resolve(t).fullpath();return this.#t.set(t,i),i}resolvePosix(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#r.get(t);if(n!==void 0)return n;let i=this.cwd.resolve(t).fullpathPosix();return this.#r.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let i=await e.readdir();return n?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(n?e:e.fullpath());let l=new Set,u=a((d,p)=>{l.add(d),d.readdirCB((h,g)=>{if(h)return p(h);let m=g.length;if(!m)return p();let b=a(()=>{--m===0&&p()},"next");for(let S of g)(!s||s(S))&&c.push(n?S:S.fullpath()),i&&S.isSymbolicLink()?S.realpath().then(_=>_?.isUnknown()?_.lstat():_).then(_=>_?.shouldWalk(l,o)?u(_,b):b()):S.shouldWalk(l,o)?u(S,b):b()},!0)},"walk"),f=e;return new Promise((d,p)=>{u(f,h=>{if(h)return p(h);d(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(n?e:e.fullpath());let l=new Set([e]);for(let u of l){let f=u.readdirSync();for(let d of f){(!s||s(d))&&c.push(n?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(i&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(l,o)&&l.add(p)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t;(!s||s(e))&&(yield n?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let f of u){(!s||s(f))&&(yield n?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(c,o)&&c.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new Qc({objectMode:!0});(!s||s(e))&&c.write(n?e:e.fullpath());let l=new Set,u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&c.end();return}f++,l.add(h);let g=a((b,S,_=!1)=>{if(b)return c.emit("error",b);if(i&&!_){let A=[];for(let E of S)E.isSymbolicLink()&&A.push(E.realpath().then(w=>w?.isUnknown()?w.lstat():w));if(A.length){Promise.all(A).then(()=>g(null,S,!0));return}}for(let A of S)A&&(!s||s(A))&&(c.write(n?A:A.fullpath())||(p=!0));f--;for(let A of S){let E=A.realpathCached()||A;E.shouldWalk(l,o)&&u.push(E)}p&&!c.flowing?c.once("drain",d):m||d()},"onReaddir"),m=!0;h.readdirCB(g,!0),m=!1}},"process");return d(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new Qc({objectMode:!0}),l=new Set;(!s||s(e))&&c.write(n?e:e.fullpath());let u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&c.end();return}f++,l.add(h);let g=h.readdirSync();for(let m of g)(!s||s(m))&&(c.write(n?m:m.fullpath())||(p=!0));f--;for(let m of g){let b=m;if(m.isSymbolicLink()){if(!(i&&(b=m.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(l,o)&&u.push(b)}}p&&!c.flowing&&c.once("drain",d)},"process");return d(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[f8](t)}},Yd=class extends Nw{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,Hd.win32,"\\",{...t,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Hd.win32.parse(e).root.toUpperCase()}newRoot(e){return new Dw(this.rootPath,Bo,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Xd=class extends Nw{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,Hd.posix,"/",{...t,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new Lw(this.rootPath,Bo,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},sg=class extends Xd{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}},kMe=process.platform==="win32"?Dw:Lw,d8=process.platform==="win32"?Yd:process.platform==="darwin"?sg:Xd});var T0e,A0e,Qd,Fx=$e(()=>{Hc();T0e=a(r=>r.length>=1,"isPatternList"),A0e=a(r=>r.length>=1,"isGlobList"),Qd=class r{static{a(this,"Pattern")}#t;#r;#n;length;#e;#i;#a;#p;#u;#c;#f=!0;constructor(e,t,n,i){if(!T0e(e))throw new TypeError("empty pattern list");if(!A0e(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#t=e,this.#r=t,this.#n=n,this.#e=i,this.#n===0){if(this.isUNC()){let[s,o,c,l,...u]=this.#t,[f,d,p,h,...g]=this.#r;u[0]===""&&(u.shift(),g.shift());let m=[s,o,c,l,""].join("/"),b=[f,d,p,h,""].join("/");this.#t=[m,...u],this.#r=[b,...g],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#t,[c,...l]=this.#r;o[0]===""&&(o.shift(),l.shift());let u=s+"/",f=c+"/";this.#t=[u,...o],this.#r=[f,...l],this.length=this.#t.length}}}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===Rr}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#a=this.#a||(this.#n===0?this.isAbsolute()?this.#r[0]+this.#r.slice(1).join("/"):this.#r.join("/"):this.#r.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new r(this.#t,this.#r,this.#n+1,this.#e),this.#i.#c=this.#c,this.#i.#u=this.#u,this.#i.#p=this.#p,this.#i):this.#i=null}isUNC(){let e=this.#t;return this.#u!==void 0?this.#u:this.#u=this.#e==="win32"&&this.#n===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#t;return this.#p!==void 0?this.#p:this.#p=this.#e==="win32"&&this.#n===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#t;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#t[0];return typeof e=="string"&&this.isAbsolute()&&this.#n===0?e:""}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#f)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#f?!1:(this.#f=!1,!0)}}});var I0e,Jd,Dx=$e(()=>{Hc();Fx();I0e=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Jd=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:i,noglobstar:s,platform:o=I0e}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new Hi(e,this.mmopts);for(let n=0;n<t.set.length;n++){let i=t.set[n],s=t.globParts[n];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new Qd(i,s,0,this.platform),c=new Hi(o.globString(),this.mmopts),l=s[s.length-1]==="**",u=o.isAbsolute();u?this.absolute.push(c):this.relative.push(c),l&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),n=`${t}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(t)||o.match(n))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}}});var Lx,Nx,kx,og,h8=$e(()=>{Hc();Lx=class r{static{a(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new r(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),i=this.store.get(n);i?i.add(t.globString()):this.store.set(n,new Set([t.globString()]))}},Nx=class{static{a(this,"MatchRecord")}store=new Map;add(e,t,n){let i=(t?2:0)|(n?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},kx=class{static{a(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===t.globString())||n.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},og=class r{static{a(this,"Processor")}hasWalkedCache;matches=new Nx;subwalks=new kx;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new Lx}processPatterns(e,t){this.patterns=t;let n=t.map(i=>[e,i]);for(let[i,s]of n){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),c=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let l,u,f=!1;for(;typeof(l=s.pattern())=="string"&&(u=s.rest());)i=i.resolve(l),s=u,f=!0;if(l=s.pattern(),u=s.rest(),f){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof l=="string"){let d=l===".."||l===""||l===".";this.matches.add(i.resolve(l),c,d);continue}else if(l===Rr){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=u?.pattern(),p=u?.rest();if(!u||(d===""||d===".")&&!p)this.matches.add(i,c,d===""||d===".");else if(d===".."){let h=i.parent||i;p?this.hasWalkedCache.hasWalked(h,p)||this.subwalks.add(h,p):this.matches.add(h,c,!0)}}else l instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(e,t){let n=this.subwalks.get(e),i=this.child();for(let s of t)for(let o of n){let c=o.isAbsolute(),l=o.pattern(),u=o.rest();l===Rr?i.testGlobstar(s,o,u,c):l instanceof RegExp?i.testRegExp(s,l,u,c):i.testString(s,l,u,c)}return i}testGlobstar(e,t,n,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),i)}}testRegExp(e,t,n,i){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,t,n,i){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}}});var R0e,kw,ag,cg,m8=$e(()=>{Cx();Dx();h8();R0e=a((r,e)=>typeof r=="string"?new Jd([r],e):Array.isArray(r)?new Jd(r,e):r,"makeIgnore"),kw=class{static{a(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#r;#n;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#n=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#r=R0e(n.ignore??[],n),!this.includeChildMatches&&typeof this.#r.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#e(e){return this.seen.has(e)||!!this.#r?.ignored?.(e)}#i(e){return!!this.#r?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#t.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#t.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#e(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,t)}matchFinish(e,t){if(this.#e(e))return;if(!this.includeChildMatches&&this.#r?.add){let s=`${e.relativePosix()}/**`;this.#r.add(s)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,t,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,t)}matchSync(e,t,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new og(this.opts),n)}walkCB2(e,t,n,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,i));return}n.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||(s++,this.match(c,l,u).then(()=>o()));for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirCached();c.calledReaddir()?this.walkCB3(c,l,n,o):c.readdirCB((u,f)=>this.walkCB3(c,f,n,o),!0)}o()}walkCB3(e,t,n,i){n=n.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||(s++,this.match(c,l,u).then(()=>o()));for(let[c,l]of n.subwalks.entries())s++,this.walkCB2(c,l,n.child(),o);o()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new og(this.opts),n)}walkCB2Sync(e,t,n,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,i));return}n.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||this.matchSync(c,l,u);for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirSync();this.walkCB3Sync(c,l,n,o)}o()}walkCB3Sync(e,t,n,i){n=n.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||this.matchSync(c,l,u);for(let[c,l]of n.subwalks.entries())s++,this.walkCB2Sync(c,l,n.child(),o);o()}},ag=class extends kw{static{a(this,"GlobWalker")}matches=new Set;constructor(e,t,n){super(e,t,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},cg=class extends kw{static{a(this,"GlobStream")}results;constructor(e,t,n){super(e,t,n),this.results=new Qc({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}});var g8,C0e,Hs,Mx=$e(()=>{Hc();g8=require("node:url");p8();Fx();m8();C0e=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Hs=class{static{a(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,g8.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=e,this.platform=t.platform||C0e,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=t.platform==="win32"?Yd:t.platform==="darwin"?sg:t.platform?Xd:d8;this.scurry=new l(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(l=>new Hi(l,i)),[o,c]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=o.map((l,u)=>{let f=c[u];if(!f)throw new Error("invalid pattern object");return new Qd(l,f,0,this.platform)})}async walk(){return[...await new ag(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new ag(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new cg(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new cg(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}});var $x,jx=$e(()=>{Hc();$x=a((r,e={})=>{Array.isArray(r)||(r=[r]);for(let t of r)if(new Hi(t,e).hasMagic())return!0;return!1},"hasMagic")});function Mw(r,e={}){return new Hs(r,e).streamSync()}function b8(r,e={}){return new Hs(r,e).stream()}function _8(r,e={}){return new Hs(r,e).walkSync()}async function y8(r,e={}){return new Hs(r,e).walk()}function $w(r,e={}){return new Hs(r,e).iterateSync()}function S8(r,e={}){return new Hs(r,e).iterate()}var O0e,x0e,P0e,F0e,D0e,Zd,Bx=$e(()=>{Hc();Mx();jx();Hc();Mx();jx();Dx();a(Mw,"globStreamSync");a(b8,"globStream");a(_8,"globSync");a(y8,"glob_");a($w,"globIterateSync");a(S8,"globIterate");O0e=Mw,x0e=Object.assign(b8,{sync:Mw}),P0e=$w,F0e=Object.assign(S8,{sync:$w}),D0e=Object.assign(_8,{stream:Mw,iterate:$w}),Zd=Object.assign(y8,{glob:y8,globSync:_8,sync:D0e,globStream:b8,stream:x0e,globStreamSync:Mw,streamSync:O0e,globIterate:S8,iterate:F0e,globIterateSync:$w,iterateSync:P0e,Glob:Hs,hasMagic:$x,escape:Wd,unescape:Ws});Zd.glob=Zd});async function E8(r,e,t,n={}){let{excludeRelPath:i}=n,s=vu.default.join(r,"**/*.md"),o=await Zd(s,{nodir:!0,ignore:[vu.default.join(r,".obsidian/**"),vu.default.join(r,".trash/**"),vu.default.join(r,"**/.obsidian/**"),vu.default.join(r,"**/.trash/**")]}),c={filesScanned:0,filesModified:0,replacements:0,modifiedFiles:[]};for(let l of o){let u=vu.default.relative(r,l);if(i&&u===i)continue;c.filesScanned+=1;let f;try{f=await Ux.default.readFile(l,"utf-8")}catch{continue}let{updated:d,replacements:p}=L0e(f,e,t);p>0&&(c.filesModified+=1,c.replacements+=p,c.modifiedFiles.push(u),await Ux.default.writeFile(l,d,"utf-8"))}return c}function L0e(r,e,t){let n=r.split(/(^```[\s\S]*?^```)/m),i=0;for(let s=0;s<n.length;s++){if(s%2===1)continue;let o=n[s],c=N0e(o,e,t);i+=c.replacements,n[s]=c.updated}return{updated:n.join(""),replacements:i}}function N0e(r,e,t){let n=r.split(/(`[^`\n]*`)/),i=0;for(let s=0;s<n.length;s++){if(s%2===1)continue;let o=k0e(n[s],e,t);i+=o.replacements,n[s]=o.updated}return{updated:n.join(""),replacements:i}}function k0e(r,e,t){let n=/(?<!!)\[\[([^\[\]\n|#^]+)((?:[#^][^\[\]\n|]*)?)(?:\|[^\[\]\n]*)?\]\]/g,i=0;return{updated:r.replace(n,(o,c,l)=>c.trim()!==e?o:(i+=1,`[[${t}${l}]]`)),replacements:i}}var Ux,vu,v8=$e(()=>{"use strict";Ux=Q($o()),vu=Q(require("path"));Bx();a(E8,"rewriteInboundWikilinks");a(L0e,"rewriteContent");a(N0e,"rewriteProseSegment");a(k0e,"replaceWikilinks")});var Or,pr,Ys,M0e,Yt,Xs=$e(()=>{"use strict";Or=Q($o()),pr=Q(require("path"));qm();Ys=Q(Pe());v8();M0e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Yt=class{constructor(e){this.rootPath=e;this.uuidIndex=null;this.basenameIndex=null;this.aliasIndex=null}static{a(this,"FileSystemVaultAdapter")}async read(e){let t=this.resolvePath(e.path);if(!await Or.default.pathExists(t))throw new Error(`File not found: ${e.path}`);return Or.default.readFile(t,"utf-8")}async create(e,t){let n=this.resolvePath(e);if(await Or.default.pathExists(n))throw new Error(`File already exists: ${e}`);return await Or.default.ensureDir(pr.default.dirname(n)),await Or.default.writeFile(n,t,"utf-8"),this.createFileObject(e)}async modify(e,t){let n=this.resolvePath(e.path);if(!await Or.default.pathExists(n))throw new Error(`File not found: ${e.path}`);await Or.default.writeFile(n,t,"utf-8")}async delete(e){let t=this.resolvePath(e.path);if(!await Or.default.pathExists(t))throw new Error(`File not found: ${e.path}`);await Or.default.remove(t)}async exists(e){let t=this.resolvePath(e);return Or.default.pathExists(t)}getAbstractFileByPath(e){let t=this.resolvePath(e);try{let n=Or.default.statSync(t);if(n.isFile())return this.createFileObject(e);if(n.isDirectory())return this.createFolderObject(e)}catch{return null}return null}getAllFiles(){let e=[];return this.walkDirectory(this.rootPath,t=>{if(t.endsWith(".md")){let n=pr.default.relative(this.rootPath,t);e.push(this.createFileObject(n))}}),e}getFrontmatter(e){try{let t=Or.default.readFileSync(this.resolvePath(e.path),"utf-8");return this.extractFrontmatter(t)}catch{return null}}getFrontmatterParseFailure(e){let t;try{t=Or.default.readFileSync(this.resolvePath(e.path),"utf-8")}catch{return null}let n=(0,Ys.matchFrontmatterBlock)(t)?.body;if(n===void 0)return null;let i=/^[ \t]*(#.*)?\r?$/;if(!n.split(`
|
|
435
|
+
`)}return n}function Xge(r,e){let t=String(r),n=String(e);return t<n?-1:t>n?1:0}function qd(r,e={}){let t={...Yge,...e},n=Xme(r,t.schema,{noRefs:t.noRefs,skipInvalid:t.skipInvalid});if(t.flowLevel>=0&&j5(n,(i,s)=>{if(!(s.depth<t.flowLevel))return(i.kind==="sequence"||i.kind==="mapping")&&(i.style=ki.FLOW),o6}),t.sortKeys){let i=t.sortKeys===!0?Xge:t.sortKeys;j5(n,s=>{s.kind==="mapping"&&s.items.sort((o,c)=>i(o.key.kind==="scalar"?o.key.value:"",c.key.kind==="scalar"?c.key.value:""))})}return t.transform(n),Hge(n,{...zO(t,Object.keys(ux)),schema:t.schema})}var St,rhe,nhe,ihe,she,ohe,ahe,che,lhe,uhe,fhe,dhe,phe,hhe,mhe,ghe,yhe,bhe,G5,whe,Ehe,Ahe,Ihe,qO,Ohe,xhe,q5,Dhe,Lhe,Mhe,$he,jhe,WO,Vhe,Ghe,zhe,Khe,Hhe,Xhe,Qhe,Jhe,Zhe,eme,tme,hw,nx,Lke,_u,Gm,sme,Nke,kke,ome,zc,Sr,qe,ki,Ki,cme,K5,H5,gme,$d,yme,sx,vt,Z5,Ud,KO,e6,lw,vme,Tme,t6,HO,r6,Ame,Ime,Rme,ox,zme,hu,Qme,o6,B5,sge,oge,age,cx,c6,gw,l6,u6,cge,QO,JO,lge,uge,f6,d6,p6,h6,m6,g6,fge,dge,pge,hge,mge,gge,yge,bge,_ge,Sge,wge,Ege,vge,Tge,lx,Mge,fw,ux,Yge,Mke,$ke,jke,Bke,Uke,Vke,Gke,qke,Wke,zke,Kke,Hke,Yke,Xke,Qke,Jke,qm=$e(()=>{St=Symbol("NOT_RESOLVED");a(zn,"defineScalarTag");a(rx,"defineSequenceTag");a(dw,"defineMappingTag");rhe=zn("tag:yaml.org,2002:str",{resolve:a(r=>r,"resolve"),identify:a(r=>typeof r=="string","identify")}),nhe=["","~","null","Null","NULL"],ihe=zn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:a(r=>nhe.indexOf(r)!==-1?null:St,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),she=zn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:a((r,e)=>r==="null"||e&&r===""?null:St,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),ohe=["","~","null","Null","NULL"],ahe=zn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:a(r=>ohe.indexOf(r)!==-1?null:St,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),che=["true","True","TRUE"],lhe=["false","False","FALSE"],uhe=zn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:a(r=>che.indexOf(r)!==-1?!0:lhe.indexOf(r)!==-1?!1:St,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),fhe=["true"],dhe=["false"],phe=zn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:a(r=>fhe.indexOf(r)!==-1?!0:dhe.indexOf(r)!==-1?!1:St,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),hhe=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],mhe=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],ghe=zn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:a(r=>hhe.indexOf(r)!==-1?!0:mhe.indexOf(r)!==-1?!1:St,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),yhe=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),bhe=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");a(_he,"parseYamlInteger$2");a(She,"resolveYamlInteger$2");G5=zn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:She,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),whe=new RegExp("^-?(?:0|[1-9][0-9]*)$"),Ehe=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");a(vhe,"parseYamlInteger$1");a(The,"resolveYamlInteger$1");Ahe=zn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:The,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),Ihe=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");a(Rhe,"parseYamlInteger");a(Che,"resolveYamlInteger");qO=zn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:Che,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),Ohe=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),xhe=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(Phe,"resolveYamlFloat$2");a(Fhe,"representYamlFloat$2");q5=zn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:Phe,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:Fhe}),Dhe=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),Lhe=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(Nhe,"resolveYamlFloat$1");a(khe,"representYamlFloat$1");Mhe=zn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Nhe,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:khe}),$he=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),jhe=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(Bhe,"resolveYamlFloat");a(Uhe,"representYamlFloat");WO=zn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:Bhe,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:Uhe}),Vhe=zn("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:a((r,e)=>r==="<<"||e&&r===""?"<<":St,"resolve"),identify:a(()=>!1,"identify")}),Ghe=/^[A-Za-z0-9+/]*={0,2}$/;a(qhe,"resolveYamlBinary");a(Whe,"representYamlBinary");zhe=zn("tag:yaml.org,2002:binary",{resolve:qhe,identify:a(r=>Object.prototype.toString.call(r)==="[object Uint8Array]","identify"),represent:Whe}),Khe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Hhe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");a(R5,"makeUtcDate");a(Yhe,"resolveYamlTimestamp");Xhe=zn("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:Yhe,identify:a(r=>r instanceof Date,"identify"),represent:a(r=>r.toISOString(),"represent")}),Qhe=rx("tag:yaml.org,2002:seq",{create:a(()=>[],"create"),addItem:a((r,e)=>{r.push(e)},"addItem"),identify:Array.isArray});a(pw,"isPlainObject");a(zO,"pick");Jhe=rx("tag:yaml.org,2002:omap",{create:a(()=>({list:[],seen:new Set}),"create"),addItem:a((r,e)=>{let t;if(e instanceof Map){if(e.size!==1)return"cannot resolve an ordered map item";t=e.keys().next().value}else if(pw(e)){let n=Object.keys(e);if(n.length!==1)return"cannot resolve an ordered map item";t=n[0]}else return"cannot resolve an ordered map item";return r.seen.has(t)?"duplicate key in ordered map":(r.seen.add(t),r.list.push(e),"")},"addItem"),finalize:a(r=>r.list,"finalize"),identify:a(()=>!1,"identify")}),Zhe=rx("tag:yaml.org,2002:pairs",{create:a(()=>[],"create"),addItem:a((r,e)=>{if(e instanceof Map)return e.size!==1?"cannot resolve a pairs item":(r.push(e.entries().next().value),"");if(Object.prototype.toString.call(e)!=="[object Object]")return"cannot resolve a pairs item";let t=e,n=Object.keys(t);return n.length!==1?"cannot resolve a pairs item":(r.push([n[0],t[n[0]]]),"")},"addItem"),identify:a(()=>!1,"identify")}),eme=dw("tag:yaml.org,2002:map",{create:a(()=>({}),"create"),identify:pw,represent:a(r=>{let e=new Map;for(let t of Object.keys(r))e.set(t,r[t]);return e},"represent"),addPair:a((r,e,t)=>{if(e!==null&&typeof e=="object")return"object-based map does not support complex keys";let n=String(e);return n==="__proto__"?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,""},"addPair"),has:a((r,e)=>e!==null&&typeof e=="object"?!1:Object.prototype.hasOwnProperty.call(r,String(e)),"has"),keys:a(r=>Object.keys(r),"keys"),get:a((r,e)=>{let t=String(e);return Object.prototype.hasOwnProperty.call(r,t)?r[t]:null},"get")}),tme=dw("tag:yaml.org,2002:set",{create:a(()=>new Set,"create"),identify:a(r=>r instanceof Set,"identify"),represent:a(r=>{let e=new Map;for(let t of r)e.set(t,null);return e},"represent"),addPair:a((r,e,t)=>t!==null?"cannot resolve a set item":(r.add(e),""),"addPair"),has:a((r,e)=>r.has(e),"has"),keys:a(r=>r.keys(),"keys"),get:a(()=>null,"get")});a(rme,"createTagDefinitionMap");a(nme,"createTagDefinitionListMap");a(ime,"compileTags");hw=class W5{static{a(this,"Schema")}tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(e){let t=ime(e),n=[],i=rme(),s=nme();for(let f of t){if(f.nodeKind==="scalar"&&f.implicit){if(f.matchByTagPrefix)throw new Error("Implicit scalar tags cannot match by tag prefix");n.push(f)}switch(f.nodeKind){case"scalar":f.matchByTagPrefix?s.scalar.push(f):i.scalar[f.tagName]=f;break;case"sequence":f.matchByTagPrefix?s.sequence.push(f):i.sequence[f.tagName]=f;break;case"mapping":f.matchByTagPrefix?s.mapping.push(f):i.mapping[f.tagName]=f;break}}let o=n.filter(f=>f.implicitFirstChars===null),c=new Set;for(let f of n)if(f.implicitFirstChars!==null)for(let d of f.implicitFirstChars)c.add(d);let l=new Map;for(let f of c)l.set(f,n.filter(d=>d.implicitFirstChars===null||d.implicitFirstChars.indexOf(f)!==-1));let u=i.scalar["tag:yaml.org,2002:str"];if(!u)throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=t,this.implicitScalarTags=n,this.implicitScalarByFirstChar=l,this.implicitScalarAnyFirstChar=o,this.defaultScalarTag=u,this.defaultSequenceTag=i.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=i.mapping["tag:yaml.org,2002:map"],this.exact=i,this.prefix=s}lookupScalarTag(e){let t=this.exact.scalar[e];if(t)return t;for(let n of this.prefix.scalar)if(e.startsWith(n.tagName))return n}lookupSequenceTag(e){let t=this.exact.sequence[e];if(t)return t;for(let n of this.prefix.sequence)if(e.startsWith(n.tagName))return n}lookupMappingTag(e){let t=this.exact.mapping[e];if(t)return t;for(let n of this.prefix.mapping)if(e.startsWith(n.tagName))return n}resolveImplicitScalarTag(e){let t=this.implicitScalarByFirstChar.get(e.charAt(0))??this.implicitScalarAnyFirstChar;for(let i of t){let s=i.resolve(e,!1,i.tagName);if(s!==St)return{value:s,tag:i}}let n=this.defaultScalarTag;return{value:n.resolve(e,!1,n.tagName),tag:n}}withTags(...e){let t=[];for(let n of e)t=t.concat(n);return new W5([...this.tags,...t])}},nx=new hw([rhe,Qhe,eme]),Lke=new hw([...nx.tags,she,phe,Ahe,Mhe]),_u=new hw([...nx.tags,ihe,uhe,G5,q5]),Gm=new hw([...nx.tags,ahe,ghe,qO,WO,Xhe,Vhe,zhe,Jhe,Zhe,tme]),sme=Gm.withTags({...qO,resolve:a((r,e,t)=>{let n=qO.resolve(r,e,t);return n===St?G5.resolve(r,e,t):n},"resolve")},{...WO,resolve:a((r,e,t)=>{let n=WO.resolve(r,e,t);return n===St?q5.resolve(r,e,t):n},"resolve")}),Nke=dw("tag:yaml.org,2002:map",{create:a(()=>new Map,"create"),addPair:a((r,e,t)=>(r.set(e,t),""),"addPair"),has:a((r,e)=>r.has(e),"has"),keys:a(r=>r.keys(),"keys"),get:a((r,e)=>r.get(e),"get"),identify:a(r=>r instanceof Map||pw(r),"identify"),represent:a(r=>{if(r instanceof Map)return r;let e=new Map,t=r;for(let n of Object.keys(t))e.set(n,t[n]);return e},"represent")});a(C5,"normalizeKey");kke=dw("tag:yaml.org,2002:map",{create:a(()=>({}),"create"),identify:pw,represent:a(r=>{let e=new Map;for(let t of Object.keys(r))e.set(t,r[t]);return e},"represent"),addPair:a((r,e,t)=>{let n=C5(e);return n===null?"nested arrays are not supported inside keys":(n==="__proto__"?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,"")},"addPair"),has:a((r,e)=>{let t=C5(e);return t!==null&&Object.prototype.hasOwnProperty.call(r,t)},"has"),keys:a(r=>Object.keys(r),"keys"),get:a((r,e)=>{let t=String(e);return Object.prototype.hasOwnProperty.call(r,t)?r[t]:null},"get")}),ome={maxLength:79,indent:1,linesBefore:3,linesAfter:2};a($O,"getLine");a(jO,"padStart");a(ame,"makeSnippet");a(O5,"formatError");zc=class z5 extends Error{static{a(this,"YAMLException")}reason;mark;constructor(e,t){super(),this.name="YAMLException",this.reason=e,this.mark=t,this.message=O5(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(e){return`${this.name}: ${O5(this,e)}`}static throwAt(e,t,n,i=""){let s=0,o=0;for(let l=0;l<t;l++){let u=e.charCodeAt(l);u===10?(s++,o=l+1):u===13&&(s++,e.charCodeAt(l+1)===10&&l++,o=l+1)}let c={name:i,buffer:e,position:t,line:s,column:t-o};throw c.snippet=ame(c),new z5(n,c)}},Sr={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},qe={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},ki={BLOCK:1,FLOW:2},Ki={CLIP:1,STRIP:2,KEEP:3},cme=-1;a(x5,"simpleEscapeSequence");K5=new Array(256),H5=new Array(256);for(let r=0;r<256;r++)K5[r]=x5(r)?1:0,H5[r]=x5(r);a(lme,"charFromCodepoint");a(ume,"fromHexCode$1");a(fme,"escapedHexLen$1");a(cw,"skipFoldedBreaks");a(ix,"foldedBreaks");a(dme,"getPlainValue");a(pme,"getSingleQuotedValue");a(hme,"getDoubleQuotedValue");a(P5,"getBlockValue");a(mme,"getScalarValue");gme=Object.assign(Object.create(null),{"!":"!","!!":"tag:yaml.org,2002:"});a(BO,"tagPercentEncode");a(Y5,"tagNameFull");a(X5,"tagNameShort");$d=-1,yme="tag:yaml.org,2002:merge",sx={filename:"",schema:_u,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};a(bme,"eventPosition$1");a(xn,"throwError$1");a(Q5,"finalizeCollection");a(_me,"constructScalar");a(F5,"collectionTagName");a(J5,"isMappingTag");a(D5,"chargeMergeWork");a(L5,"mergeKeys");a(Sme,"mergeSource");a(wme,"addMappingValue");a(UO,"addValue");a(VO,"storeAnchor");a(Eme,"constructFromEvents");vt=-1,Z5=Object.prototype.hasOwnProperty,Ud=1,KO=2,e6=3,lw=4,vme=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Tme=/[,\[\]{}]/,t6=/^(?:!|!!|![0-9A-Za-z-]+!)$/,HO=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,r6=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,Ame=new RegExp(`^(?:${HO})*$`),Ime=new RegExp(`^(?:${r6})+$`),Rme=new RegExp(`^(?:!(?:${HO})*|${r6}(?:${HO})*)$`),ox={filename:"",maxDepth:100};a(Cme,"addDocumentEvent");a(n6,"addSequenceEvent");a(YO,"addMappingEvent");a(N5,"insertFlowPairMappingEvent");a(Gd,"addScalarEvent");a(Ome,"addAliasEvent");a(jd,"addPopEvent");a(fi,"addEmptyScalarEvent");a(k5,"emptyProperties");a(Bd,"snapshotState");a(mu,"restoreState");a(Ue,"throwError");a(an,"isEol");a(yu,"isWhiteSpace");a(qs,"isWsOrEol");a(Ga,"isWsOrEolOrEnd");a(bu,"isFlowIndicator");a(xme,"fromDecimalCode");a(Pme,"fromHexCode");a(Fme,"escapedHexLen");a(Dme,"isSimpleEscape");a(uw,"consumeLineBreak");a(Wn,"skipSeparationSpace");a(Vd,"testDocumentSeparator");a(i6,"skipByteOrderMark");a(ax,"testDocumentBoundary");a(M5,"skipUntilLineEnd");a(s6,"checkPrintable");a(Lme,"readTagProperty");a(Nme,"readAnchorProperty");a(kme,"readAlias");a(XO,"readFlowScalarBreak");a(Mme,"readSingleQuotedScalar");a($me,"readDoubleQuotedScalar");a(jme,"readBlockScalar");a(Bme,"canStartPlainScalar");a(Ume,"readPlainScalar");a(Bm,"skipFlowSeparationSpace");a(Vme,"readFlowCollection");a($5,"readBlockSequence");a(GO,"readBlockMapping");a(gu,"parseNode");a(Gme,"readDirective");a(qme,"readDocument");a(Wme,"parseEvents");zme={...ox,...sx};a(Kme,"loadDocuments");a(Kc,"load");hu=Symbol("INVALID");a(Hme,"buildRepresentTypes");a(Yme,"matchTag");a(Vm,"build");a(Xme,"jsToAst");Qme=Symbol("visit:break"),o6=Symbol("visit:skip");a(aw,"visitNode");a(j5,"visit");a(mw,"hasBit");B5={applyQuoteFlowKeysOption:Jme,doubleQuoteForInvisibles:Zme,doubleQuoteWhitespaceOnly:ege,applyForceQuotesOption:tge,tryLongOrMultilineAsBlock:rge,quoteInvalidPlain:nge,fallbackToDoubleQuoted:ige};a(a6,"_preferredQuotedStyle");a(Jme,"applyQuoteFlowKeysOption");a(Zme,"doubleQuoteForInvisibles");a(ege,"doubleQuoteWhitespaceOnly");a(tge,"applyForceQuotesOption");a(rge,"tryLongOrMultilineAsBlock");a(nge,"quoteInvalidPlain");a(ige,"fallbackToDoubleQuoted");a(Um,"setBit");sge="[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]",oge="[\\n\\r]",age="\\uFEFF",cx="[ \\t]",c6=`(?:(?!(?:${oge}|${age}))${sge})`,gw=`(?:(?!${cx})${c6})`,l6="[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]",u6="[-?:,\\[\\]{}#&*!|>'\"%@`]",cge="[,\\[\\]{}]",QO=gw,JO=`(?:(?!${cge})${gw})`,lge=`(?:(?:(?!${u6})${gw})|[?:-](?=${QO}))`,uge=`(?:(?:(?!${u6})${gw})|[?:-](?=${JO}))`,f6=`(?:(?:(?![:#])${QO})|:(?=${QO}))#*`,d6=`(?:(?:(?![:#])${JO})|:(?=${JO}))#*`,p6=`(?:${cx}*${f6})*`,h6=`(?:${cx}*${d6})*`,m6=`${lge}#*${p6}`,g6=`${uge}#*${h6}`,fge=m6,dge=g6,pge=`\\n+${f6}${p6}`,hge=`\\n+${d6}${h6}`,mge=`${m6}(?:${pge})*`,gge=`${g6}(?:${hge})*`,yge=new RegExp(`^(?:${mge})$`,"u"),bge=new RegExp(`^(?:${gge})$`,"u"),_ge=new RegExp(`^(?:${fge})$`,"u"),Sge=new RegExp(`^(?:${dge})$`,"u"),wge=new RegExp(`^(?:${l6})*$`,"u"),Ege=new RegExp(`^(?:${l6}|\\n)*$`,"u"),vge=new RegExp(`^(?:${c6}|\\n)*$`,"u"),Tge=/^(?:---|\.\.\.)(?=$|[ \t\n\r])/,lx=/^(?:---|\.\.\.)(?=$|[ \t\n\r])/m;a(Age,"canUsePlain");a(Ige,"canUseSingleQuoted");a(Rge,"canUseBlock");a(Cge,"detectAllowedStyles");a(Oge,"renderScalar");a(xge,"renderPlain");a(Pge,"renderSingleQuoted");a(Fge,"renderLiteralBlock");a(Dge,"renderFoldedBlock");a(Lge,"renderDoubleQuoted");a(y6,"encodeFlowBreaks");a(b6,"indentString");a(Nge,"needIndentIndicator");a(_6,"blockHeader");a(S6,"dropEndingNewline");a(ZO,"isMoreIndented");a(U5,"foldLine");a(kge,"foldBlockScalar");Mge=/["\\\x00-\x1F\x7F-\xA0\u2028\u2029\uD800-\uDFFF\uFEFF\uFFFE\uFFFF]/gu;a($ge,"escapeCharacter");a(jge,"escapeString");fw=10,ux={indent:2,seqNoIndent:!1,seqInlineFirst:!0,lineWidth:80,flowBracketPadding:!1,flowSkipCommaSpace:!1,flowSkipColonSpace:!1,quoteFlowKeys:!1,quoteStyle:"single",forceQuotes:!1,scalarStyleRules:Object.keys(B5).map(r=>Reflect.get(B5,r)),tagBeforeAnchor:!1};a(Bge,"nodeTagShort");a(Uge,"createPresenterState");a(ex,"generateNextLine");a(Vge,"scalarLayout");a(Gge,"writeFlowSequence");a(V5,"writeBlockSequence");a(qge,"writeFlowMapping");a(Wge,"writeBlockMapping");a(tx,"cannotBeCompact");a(qa,"writeNode");a(zge,"rootStartsOwnLine");a(Kge,"writeDocumentDirectives");a(Hge,"present");Yge={...ux,schema:sme,skipInvalid:!1,noRefs:!1,flowLevel:-1,sortKeys:!1,transform:a(()=>{},"transform")};a(Xge,"defaultCompareFn");a(qd,"dump");Mke=Sr.DOCUMENT,$ke=Sr.SEQUENCE,jke=Sr.MAPPING,Bke=Sr.SCALAR,Uke=Sr.ALIAS,Vke=Sr.POP,Gke=qe.PLAIN,qke=qe.SINGLE_QUOTED,Wke=qe.DOUBLE_QUOTED,zke=qe.LITERAL_BLOCK,Kke=qe.FOLDED_BLOCK,Hke=ki.BLOCK,Yke=ki.FLOW,Xke=Ki.CLIP,Qke=Ki.STRIP,Jke=Ki.KEEP});var fx,w6,Qge,E6=$e(()=>{fx=a((r,e,t)=>{let n=r instanceof RegExp?w6(r,t):r,i=e instanceof RegExp?w6(e,t):e,s=n!==null&&i!=null&&Qge(n,i,t);return s&&{start:s[0],end:s[1],pre:t.slice(0,s[0]),body:t.slice(s[0]+n.length,s[1]),post:t.slice(s[1]+i.length)}},"balanced"),w6=a((r,e)=>{let t=e.match(r);return t?t[0]:null},"maybeMatch"),Qge=a((r,e,t)=>{let n,i,s,o,c,l=t.indexOf(r),u=t.indexOf(e,l+1),f=l;if(l>=0&&u>0){if(r===e)return[l,u];for(n=[],s=t.length;f>=0&&!c;){if(f===l)n.push(f),l=t.indexOf(r,f+1);else if(n.length===1){let d=n.pop();d!==void 0&&(c=[d,u])}else i=n.pop(),i!==void 0&&i<s&&(s=i,o=u),u=t.indexOf(e,f+1);f=l<u&&l>=0?l:u}n.length&&o!==void 0&&(c=[s,o])}return c},"range")});function dx(r){return isNaN(r)?r.charCodeAt(0):parseInt(r,10)}function dye(r){return r.replace(nye,v6).replace(iye,T6).replace(sye,mx).replace(oye,A6).replace(aye,I6)}function pye(r){return r.replace(Jge,"\\").replace(Zge,"{").replace(eye,"}").replace(tye,",").replace(rye,".")}function px(r,e){for(let t=0;t<e.length;t++)r.push(e[t])}function hye(r){let e=[],t="";for(;;){let n=fx("{","}",r);if(!n){let l=r.split(",");return l[0]=t+l[0],px(e,l),e}let{pre:i,body:s,post:o}=n,c=i.split(",");if(c[0]=t+c[0],c[c.length-1]+="{"+s+"}",!o.length)return px(e,c),e;t=c.pop(),px(e,c),r=o}}function R6(r,e={}){if(!r)return[];let{max:t=cye,maxLength:n=lye,maxDepth:i=uye,maxRewrites:s=fye}=e;return r.slice(0,2)==="{}"&&(r="\\{\\}"+r.slice(2)),hx(dye(r),t,n,i,0,s,!0).map(pye)}function mye(r){return"{"+r+"}"}function gye(r){return/^-?0\d/.test(r)}function yye(r,e){return r<=e}function bye(r,e){return r>=e}function Wm(r,e,t,n,i,s){let o=[],c=0;for(let l=0;l<r.length;l++)for(let u=0;u<t.length;u++){if(o.length>=n)return o;let f=r[l]+e+t[u];if(!(s&&!f)){if(c+f.length>i)return o;o.push(f),c+=f.length}}return o}function _ye(r,e,t,n){let i=r.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=dx(i[0]),c=dx(i[1]),l=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(dx(i[2])),1):1,f=yye;c<o&&(u*=-1,f=bye);let p=i.some(gye),h=0;for(let g=o;f(g,c)&&s.length<t;g+=u){let m;if(e)m=String.fromCharCode(g),m==="\\"&&(m="");else if(m=String(g),p){let b=l-m.length;if(b>0){let S=new Array(b+1).join("0");g<0?m="-"+S+m.slice(1):m=S+m}}if(h+m.length>n)break;s.push(m),h+=m.length}return s}function hx(r,e,t,n,i,s,o){if(i>n)return[r];let c=[""],l=0,u=!1,f=!0;for(;;){let d=fx("{","}",r);if(!d)return Wm(c,r,[""],e,t,u);let p=d.pre;if(/\$$/.test(p)){if(c=Wm(c,p+"{"+d.body+"}",[""],e,t,u&&!d.post.length),f=!1,!d.post.length)break;r=d.post;continue}let h=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(d.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(d.body),m=h||g,b=d.body.indexOf(",")>=0;if(!m&&!b){if(l<s&&d.post.match(/,(?!,).*\}/)){l++,r=d.pre+"{"+d.body+mx+d.post,o=!0;continue}return Wm(c,p+"{"+d.body+"}"+d.post,[""],e,t,u)}f&&(u=o&&!m,f=!1);let S;if(m)S=_ye(d.body,g,e,t);else{let _=hye(d.body);if(_.length===1&&_[0]!==void 0&&(_=hx(_[0],e,t,n,i+1,s,!1).map(mye),_.length===1)){if(c=Wm(c,p+_[0],[""],e,t,u&&!d.post.length),!d.post.length)break;r=d.post;continue}let A=u&&!d.post.length&&!p;for(let w=0;A&&w<c.length;w++)c[w]&&(A=!1);S=[];let E=0;e:for(let w=0;w<_.length;w++){let R=hx(_[w],e,t,n,i+1,s,!1);for(let O=0;O<R.length;O++){let P=R[O];if(!(A&&!P)){if(S.length>=e||E+P.length>t)break e;S.push(P),E+=P.length}}}}if(c=Wm(c,p,S,e,t,u&&!d.post.length),!d.post.length)break;r=d.post}return c}var v6,T6,mx,A6,I6,Jge,Zge,eye,tye,rye,nye,iye,sye,oye,aye,cye,lye,uye,fye,C6=$e(()=>{E6();v6="\0SLASH"+Math.random()+"\0",T6="\0OPEN"+Math.random()+"\0",mx="\0CLOSE"+Math.random()+"\0",A6="\0COMMA"+Math.random()+"\0",I6="\0PERIOD"+Math.random()+"\0",Jge=new RegExp(v6,"g"),Zge=new RegExp(T6,"g"),eye=new RegExp(mx,"g"),tye=new RegExp(A6,"g"),rye=new RegExp(I6,"g"),nye=/\\\\/g,iye=/\\{/g,sye=/\\}/g,oye=/\\,/g,aye=/\\\./g,cye=1e5,lye=4e6,uye=1e3,fye=1e3;a(dx,"numeric");a(dye,"escapeBraces");a(pye,"unescapeBraces");a(px,"pushAll");a(hye,"parseCommaParts");a(R6,"expand");a(mye,"embrace");a(gye,"isPadded");a(yye,"lte");a(bye,"gte");a(Wm,"combine");a(_ye,"expandSequence");a(hx,"expand_")});var zm,O6=$e(()=>{zm=a(r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern")});var Sye,Km,wye,x6,P6,F6=$e(()=>{Sye={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Km=a(r=>r.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),wye=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),x6=a(r=>r.join(""),"rangesToString"),P6=a((r,e)=>{let t=e;if(r.charAt(t)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=t+1,o=!1,c=!1,l=!1,u=!1,f=t,d="";e:for(;s<r.length;){let m=r.charAt(s);if((m==="!"||m==="^")&&s===t+1){u=!0,s++;continue}if(m==="]"&&o&&!l){f=s+1;break}if(o=!0,m==="\\"&&!l){l=!0,s++;continue}if(m==="["&&!l){for(let[b,[S,_,A]]of Object.entries(Sye))if(r.startsWith(b,s)){if(d)return["$.",!1,r.length-t,!0];s+=b.length,A?i.push(S):n.push(S),c=c||_;continue e}}if(l=!1,d){m>d?n.push(Km(d)+"-"+Km(m)):m===d&&n.push(Km(m)),d="",s++;continue}if(r.startsWith("-]",s+1)){n.push(Km(m+"-")),s+=2;continue}if(r.startsWith("-",s+1)){d=m,s+=2;continue}n.push(Km(m)),s++}if(f<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,r.length-t,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let m=n[0].length===2?n[0].slice(-1):n[0];return[wye(m),!1,f-t,!1]}let p="["+(u?"^":"")+x6(n)+"]",h="["+(u?"":"^")+x6(i)+"]";return[n.length&&i.length?"("+p+"|"+h+")":n.length?p:h,c,f-t,!0]},"parseClass")});var Ws,bw=$e(()=>{Ws=a((r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!0}={})=>t?e?r.replace(/\[([^/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?r.replace(/\[([^/\\{}])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape")});var Mi,Eye,gx,D6,vye,Tye,Aye,L6,Iye,_w,Rye,Cye,Oye,xye,yx,N6,k6,Pye,Su,bx=$e(()=>{F6();bw();Eye=new Set(["!","?","+","*","@"]),gx=a(r=>Eye.has(r),"isExtglobType"),D6=a(r=>gx(r.type),"isExtglobAST"),vye=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Tye=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Aye=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),L6=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Iye="(?!(?:^|/)\\.\\.?(?:$|/))",_w="(?!\\.)",Rye=new Set(["[","."]),Cye=new Set(["..","."]),Oye=new Set("().*{}+?[]^$\\!"),xye=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),yx="[^/]",N6=yx+"*?",k6=yx+"+?",Pye=0,Su=class{static{a(this,"AST")}type;#t;#r;#n=!1;#e=[];#i;#a;#p;#u=!1;#c;#f;#l=!1;id=++Pye;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#t.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#e.length,parts:this.#e}}constructor(e,t,n={}){this.type=e,e&&(this.#r=!0),this.#i=t,this.#t=this.#i?this.#i.#t:this,this.#c=this.#t===this?n:this.#t.#c,this.#p=this.#t===this?[]:this.#t.#p,e==="!"&&!this.#t.#u&&this.#p.push(this),this.#a=this.#i?this.#i.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#f!==void 0?this.#f:this.type?this.#f=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#f=this.#e.map(e=>String(e)).join("")}#d(){if(this!==this.#t)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#p.pop();){if(e.type!=="!")continue;let t=e,n=t.#i;for(;n;){for(let i=t.#a+1;!n.type&&i<n.#e.length;i++)for(let s of e.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#e[i])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof Mi&&t.#i===this))throw new Error("invalid part: "+t);this.#e.push(t)}}toJSON(){let e=this.type===null?this.#e.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#e.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#u&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#e[t];if(!(n instanceof Mi&&n.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#e.length:0;return this.#a===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new Mi(this.type,e);for(let n of this.#e)t.copyIn(n);return t}static#o(e,t,n,i,s){let o=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,f=!1;if(t.type===null){let m=n,b="";for(;m<e.length;){let S=e.charAt(m++);if(c||S==="\\"){c=!c,b+=S;continue}if(l){m===u+1?(S==="^"||S==="!")&&(f=!0):S==="]"&&!(m===u+2&&f)&&(l=!1),b+=S;continue}else if(S==="["){l=!0,u=m,f=!1,b+=S;continue}if(!i.noext&&gx(S)&&e.charAt(m)==="("&&s<=o){t.push(b),b="";let A=new Mi(S,t);m=Mi.#o(e,A,m,i,s+1),t.push(A);continue}b+=S}return t.push(b),m}let d=n+1,p=new Mi(null,t),h=[],g="";for(;d<e.length;){let m=e.charAt(d++);if(c||m==="\\"){c=!c,g+=m;continue}if(l){d===u+1?(m==="^"||m==="!")&&(f=!0):m==="]"&&!(d===u+2&&f)&&(l=!1),g+=m;continue}else if(m==="["){l=!0,u=d,f=!1,g+=m;continue}if(!i.noext&&gx(m)&&e.charAt(d)==="("&&(s<=o||t&&t.#_(m))){let S=t&&t.#_(m)?0:1;p.push(g),g="";let _=new Mi(m,p);p.push(_),d=Mi.#o(e,_,d,i,s+S);continue}if(m==="|"){p.push(g),g="",h.push(p),p=new Mi(null,t);continue}if(m===")")return g===""&&t.#e.length===0&&(t.#l=!0),p.push(g),g="",t.push(...h,p),d;g+=m}return t.type=null,t.#r=void 0,t.#e=[e.substring(n-1)],d}#g(e){return this.#E(e,Tye)}#E(e,t=vye){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null)return!1;let n=e.#e[0];return!n||typeof n!="object"||n.type===null?!1:this.#_(n.type,t)}#_(e,t=Aye){return!!t.get(this.type)?.includes(e)}#S(e,t){let n=e.#e[0],i=new Mi(null,n,this.options);i.#e.push(""),n.push(i),this.#A(e,t)}#A(e,t){let n=e.#e[0];this.#e.splice(t,1,...n.#e);for(let i of n.#e)typeof i=="object"&&(i.#i=this);this.#f=void 0}#y(e){return!!L6.get(this.type)?.has(e)}#v(e){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let t=e.#e[0];return!t||typeof t!="object"||t.type===null?!1:this.#y(t.type)}#T(e){let t=L6.get(this.type),n=e.#e[0],i=t?.get(n.type);if(!i)return!1;this.#e=n.#e;for(let s of this.#e)typeof s=="object"&&(s.#i=this);this.type=i,this.#f=void 0,this.#l=!1}static fromGlob(e,t={}){let n=new Mi(null,void 0,t);return Mi.#o(e,n,0,t,0),n}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[t,n,i,s]=this.toRegExpSource();if(!(i||this.#r||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let c=(this.#c.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#t===this&&(this.#m(),this.#d()),!D6(this)){let l=this.isStart()&&this.isEnd()&&!this.#e.some(h=>typeof h!="string"),u=this.#e.map(h=>{let[g,m,b,S]=typeof h=="string"?Mi.#w(h,this.#r,l):h.toRegExpSource(e);return this.#r=this.#r||b,this.#n=this.#n||S,g}).join(""),f="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&Cye.has(this.#e[0]))){let g=Rye,m=t&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),b=!t&&!e&&g.has(u.charAt(0));f=m?Iye:b?_w:""}let d="";return this.isEnd()&&this.#t.#u&&this.#i?.type==="!"&&(d="(?:$|\\/)"),[f+u+d,Ws(u),this.#r=!!this.#r,this.#n]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString(),u=this;return u.#e=[l],u.type=null,u.#r=void 0,[l,Ws(this.toString()),!1,!1]}let o=!n||e||t||!_w?"":this.#b(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let c="";if(this.type==="!"&&this.#l)c=(this.isStart()&&!t?_w:"")+k6;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?_w:"")+N6+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;c=i+s+l}return[c,Ws(s),this.#r=!!this.#r,this.#n]}#m(){if(D6(this)){let e=0,t=!1;do{t=!0;for(let n=0;n<this.#e.length;n++){let i=this.#e[n];typeof i=="object"&&(i.#m(),this.#E(i)?(t=!1,this.#A(i,n)):this.#g(i)?(t=!1,this.#S(i,n)):this.#v(i)&&(t=!1,this.#T(i)))}}while(!t&&++e<10)}else for(let e of this.#e)typeof e=="object"&&e.#m();this.#f=void 0}#b(e){return this.#e.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=t.toRegExpSource(e);return this.#n=this.#n||o,n}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#w(e,t,n=!1){let i=!1,s="",o=!1,c=!1;for(let l=0;l<e.length;l++){let u=e.charAt(l);if(i){i=!1,s+=(Oye.has(u)?"\\":"")+u;continue}if(u==="*"){if(c)continue;c=!0,s+=n&&/^[*]+$/.test(e)?k6:N6,t=!0;continue}else c=!1;if(u==="\\"){l===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[f,d,p,h]=P6(e,l);if(p){s+=f,o=o||d,l+=p-1,t=t||h;continue}}if(u==="?"){s+=yx,t=!0;continue}s+=xye(u)}return[s,Ws(e),!!t,o]}};Mi=Su});var Wd,_x=$e(()=>{Wd=a((r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!1}={})=>t?e?r.replace(/[?*()[\]{}]/g,"[$&]"):r.replace(/[?*()[\]\\{}]/g,"\\$&"):e?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&"),"escape")});var di,Fye,Dye,Lye,Nye,kye,Mye,$ye,jye,Bye,Uye,Vye,Gye,qye,Wye,zye,Kye,Hye,Yye,j6,B6,U6,M6,Xye,Rr,Qye,Jye,Zye,e0e,t0e,fs,r0e,V6,n0e,i0e,$6,s0e,Hi,Hc=$e(()=>{C6();O6();bx();_x();bw();bx();_x();bw();di=a((r,e,t={})=>(zm(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Hi(e,t).match(r)),"minimatch"),Fye=/^\*+([^+@!?*[(]*)$/,Dye=a(r=>e=>!e.startsWith(".")&&e.endsWith(r),"starDotExtTest"),Lye=a(r=>e=>e.endsWith(r),"starDotExtTestDot"),Nye=a(r=>(r=r.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(r)),"starDotExtTestNocase"),kye=a(r=>(r=r.toLowerCase(),e=>e.toLowerCase().endsWith(r)),"starDotExtTestNocaseDot"),Mye=/^\*+\.\*+$/,$ye=a(r=>!r.startsWith(".")&&r.includes("."),"starDotStarTest"),jye=a(r=>r!=="."&&r!==".."&&r.includes("."),"starDotStarTestDot"),Bye=/^\.\*+$/,Uye=a(r=>r!=="."&&r!==".."&&r.startsWith("."),"dotStarTest"),Vye=/^\*+$/,Gye=a(r=>r.length!==0&&!r.startsWith("."),"starTest"),qye=a(r=>r.length!==0&&r!=="."&&r!=="..","starTestDot"),Wye=/^\?+([^+@!?*[(]*)?$/,zye=a(([r,e=""])=>{let t=j6([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),Kye=a(([r,e=""])=>{let t=B6([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),Hye=a(([r,e=""])=>{let t=B6([r]);return e?n=>t(n)&&n.endsWith(e):t},"qmarksTestDot"),Yye=a(([r,e=""])=>{let t=j6([r]);return e?n=>t(n)&&n.endsWith(e):t},"qmarksTest"),j6=a(([r])=>{let e=r.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),B6=a(([r])=>{let e=r.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),U6=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",M6={win32:{sep:"\\"},posix:{sep:"/"}},Xye=U6==="win32"?M6.win32.sep:M6.posix.sep;di.sep=Xye;Rr=Symbol("globstar **");di.GLOBSTAR=Rr;Qye="[^/]",Jye=Qye+"*?",Zye="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",e0e="(?:(?!(?:\\/|^)\\.).)*?",t0e=a((r,e={})=>t=>di(t,r,e),"filter");di.filter=t0e;fs=a((r,e={})=>Object.assign({},r,e),"ext"),r0e=a(r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return di;let e=di;return Object.assign(a((n,i,s={})=>e(n,i,fs(r,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(i,s={}){super(i,fs(r,s))}static defaults(i){return e.defaults(fs(r,i)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(i,s,o={}){super(i,s,fs(r,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,fs(r,s))}},unescape:a((n,i={})=>e.unescape(n,fs(r,i)),"unescape"),escape:a((n,i={})=>e.escape(n,fs(r,i)),"escape"),filter:a((n,i={})=>e.filter(n,fs(r,i)),"filter"),defaults:a(n=>e.defaults(fs(r,n)),"defaults"),makeRe:a((n,i={})=>e.makeRe(n,fs(r,i)),"makeRe"),braceExpand:a((n,i={})=>e.braceExpand(n,fs(r,i)),"braceExpand"),match:a((n,i,s={})=>e.match(n,i,fs(r,s)),"match"),sep:e.sep,GLOBSTAR:Rr})},"defaults");di.defaults=r0e;V6=a((r,e={})=>(zm(r),e.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:R6(r,{max:e.braceExpandMax})),"braceExpand");di.braceExpand=V6;n0e=a((r,e={})=>new Hi(r,e).makeRe(),"makeRe");di.makeRe=n0e;i0e=a((r,e,t={})=>{let n=new Hi(e,t);return r=r.filter(i=>n.match(i)),n.options.nonull&&!r.length&&r.push(e),r},"match");di.match=i0e;$6=/[?*]|[+@!]\(.*?\)|\[|\]/,s0e=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Hi=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){zm(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||U6,this.isWindows=this.platform==="win32";let n="allowWindowsEscape";this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t[n]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!$6.test(s[2]))&&!$6.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(u)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n of e)for(let i=0;i<n.length;i++)n[i]==="**"&&(n[i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let n=-1;for(;(n=t.indexOf("**",n+1))!==-1;){let i=n;for(;t[i+1]==="**";)i++;i!==n&&t.splice(n,i-n)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let c=n[i+1],l=n[i+2],u=n[i+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;t=!0,n.splice(i,1);let f=n.slice(0);f[i]="**",e.push(f),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let c=n[o];o===1&&c===""&&n[0]===""||(c==="."||c==="")&&(t=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(t=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let l=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...l),n.length===0&&n.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let i=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(i){e[t]=[],e[n]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,n=!1){let i=0,s=0,o=[],c="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])o.push(c==="b"?t[s]:e[i]),i++,s++;else if(n&&e[i]==="**"&&t[s]===e[i+1])o.push(e[i]),i++;else if(n&&t[s]==="**"&&e[i]===t[s+1])o.push(t[s]),s++;else if(e[i]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(c==="b")return!1;c="a",o.push(e[i]),i++,s++}else if(t[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(c==="a")return!1;c="b",o.push(t[s]),i++,s++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let i=0,s=0;if(this.isWindows){let c=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),l=!c&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),u=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),f=!u&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),d=l?3:c?0:void 0,p=f?3:u?0:void 0;if(typeof d=="number"&&typeof p=="number"){let[h,g]=[e[d],t[p]];h.toLowerCase()===g.toLowerCase()&&(t[p]=h,s=p,i=d)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(Rr)?this.#t(e,t,n,i,s):this.#n(e,t,n,i,s)}#t(e,t,n,i,s){let o=t.indexOf(Rr,s),c=t.lastIndexOf(Rr),[l,u,f]=n?[t.slice(s,o),t.slice(o+1),[]]:[t.slice(s,o),t.slice(o+1,c),t.slice(c+1)];if(l.length){let _=e.slice(i,i+l.length);if(!this.#n(_,l,n,0,0))return!1;i+=l.length,s+=l.length}let d=0;if(f.length){if(f.length+i>e.length)return!1;let _=e.length-f.length;if(this.#n(e,f,n,_,0))d=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(_--,!this.#n(e,f,n,_,0)))return!1;d=f.length+1}}if(!u.length){let _=!!d;for(let A=i;A<e.length-d;A++){let E=String(e[A]);if(_=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return n||_}let p=[[[],0]],h=p[0],g=0,m=[0];for(let _ of u)_===Rr?(m.push(g),h=[[],0],p.push(h)):(h[0].push(_),g++);let b=p.length-1,S=e.length-d;for(let _ of p)_[1]=S-(m[b--]+_[0].length);return!!this.#r(e,p,i,0,n,0,!!d)}#r(e,t,n,i,s,o,c){let l=t[i];if(!l){for(let d=n;d<e.length;d++){c=!0;let p=e[d];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return c}let[u,f]=l;for(;n<=f;){if(this.#n(e.slice(0,n+u.length),u,s,n,0)&&o<this.maxGlobstarRecursion){let h=this.#r(e,t,n+u.length,i+1,s,o+1,c);if(h!==!1)return h}let p=e[n];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;n++}return s||null}#n(e,t,n,i,s){let o,c,l,u;for(o=i,c=s,u=e.length,l=t.length;o<u&&c<l;o++,c++){this.debug("matchOne loop");let f=t[c],d=e[o];if(this.debug(t,f,d),f===!1||f===Rr)return!1;let p;if(typeof f=="string"?(p=d===f,this.debug("string match",f,d,p)):(p=f.test(d),this.debug("pattern match",f,d,p)),!p)return!1}if(o===u&&c===l)return!0;if(o===u)return n;if(c===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return V6(this.pattern,this.options)}parse(e){zm(e);let t=this.options;if(e==="**")return Rr;if(e==="")return"";let n,i=null;(n=e.match(Vye))?i=t.dot?qye:Gye:(n=e.match(Fye))?i=(t.nocase?t.dot?kye:Nye:t.dot?Lye:Dye)(n[1]):(n=e.match(Wye))?i=(t.nocase?t.dot?Kye:zye:t.dot?Hye:Yye)(n):(n=e.match(Mye))?i=t.dot?jye:$ye:(n=e.match(Bye))&&(i=Uye);let s=Su.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?Jye:t.dot?Zye:e0e,i=new Set(t.nocase?["i"]:[]),s=e.map(l=>{let u=l.map(d=>{if(d instanceof RegExp)for(let p of d.flags.split(""))i.add(p);return typeof d=="string"?s0e(d):d===Rr?Rr:d._src});u.forEach((d,p)=>{let h=u[p+1],g=u[p-1];d!==Rr||g===Rr||(g===void 0?h!==void 0&&h!==Rr?u[p+1]="(?:\\/|"+n+"\\/)?"+h:u[p]=n:h===void 0?u[p-1]=g+"(?:\\/|\\/"+n+")?":h!==Rr&&(u[p-1]=g+"(?:\\/|\\/"+n+"\\/)"+h,u[p+1]=Rr))});let f=u.filter(d=>d!==Rr);if(this.partial&&f.length>=1){let d=[];for(let p=1;p<=f.length;p++)d.push(f.slice(0,p).join("/"));return"(?:"+d.join("|")+")"}return f.join("/")}).join("|"),[o,c]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+c+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+c+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let c=i.length-2;!o&&c>=0;c--)o=i[c];for(let c of s){let l=i;if(n.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return di.defaults(e).Minimatch}};di.AST=Su;di.Minimatch=Hi;di.escape=Wd;di.unescape=Ws});var ww,Pn,Hm,o0e,Sx,q6,G6,a0e,c0e,Yc,W6,Sw,l0e,Xm,K6=$e(()=>{ww=require("node:diagnostics_channel"),Pn=(0,ww.channel)("lru-cache:metrics"),Hm=(0,ww.tracingChannel)("lru-cache"),o0e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Sx=a(()=>Pn.hasSubscribers||Hm.hasSubscribers,"R"),q6=new Set,G6=typeof process=="object"&&process?process:{},a0e=a((r,e,t,n)=>{typeof G6.emitWarning=="function"?G6.emitWarning(r,e,t,n):console.error(`[${t}] ${e}: ${r}`)},"k"),c0e=a(r=>!q6.has(r),"H"),Yc=a(r=>!!r&&r===Math.floor(r)&&r>0&&isFinite(r),"T"),W6=a(r=>Yc(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Sw:null:null,"j"),Sw=class extends Array{static{a(this,"O")}constructor(r){super(r),this.fill(0)}},l0e=class Ym{static{a(this,"d")}heap;length;static#t=!1;static create(e){let t=W6(e);if(!t)return[];Ym.#t=!0;let n=new Ym(e,t);return Ym.#t=!1,n}constructor(e,t){if(!Ym.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Xm=class z6{static{a(this,"d")}#t;#r;#n;#e;#i;#a;#p;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#c;#f;#l;#d;#o;#g;#E;#_;#S;#A;#y;#v;#T;#m;#b;#w;#R;#s;#O;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#m,autopurgeTimers:e.#b,sizes:e.#v,keyMap:e.#l,keyList:e.#d,valList:e.#o,next:e.#g,prev:e.#E,get head(){return e.#_},get tail(){return e.#S},free:e.#A,isBackgroundFetch:a(t=>e.#h(t),"isBackgroundFetch"),backgroundFetch:a((t,n,i,s)=>e.#M(t,n,i,s),"backgroundFetch"),moveToTail:a(t=>e.#H(t),"moveToTail"),indexes:a(t=>e.#P(t),"indexes"),rindexes:a(t=>e.#F(t),"rindexes"),isStale:a(t=>e.#I(t),"isStale")}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#f}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#p}get dispose(){return this.#n}get onInsert(){return this.#e}get disposeAfter(){return this.#i}constructor(e){let{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:l,dispose:u,onInsert:f,disposeAfter:d,noDisposeOnSet:p,noUpdateTTL:h,maxSize:g=0,maxEntrySize:m=0,sizeCalculation:b,fetchMethod:S,memoMethod:_,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:R,ignoreFetchAbort:O,backgroundFetchSize:P=1,perf:N}=e;if(this.backgroundFetchSize=P,N!==void 0&&typeof N?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=N??o0e,t!==0&&!Yc(t))throw new TypeError("max option must be a nonnegative integer");let j=t?W6(t):Array;if(!j)throw new Error("invalid max value: "+t);if(this.#t=t,this.#r=g,this.maxEntrySize=m||this.#r,this.sizeCalculation=b,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#p=_,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=S,this.#R=!!S,this.#l=new Map,this.#d=Array.from({length:t}).fill(void 0),this.#o=Array.from({length:t}).fill(void 0),this.#g=new j(t),this.#E=new j(t),this.#_=0,this.#S=0,this.#A=l0e.create(t),this.#c=0,this.#f=0,typeof u=="function"&&(this.#n=u),typeof f=="function"&&(this.#e=f),typeof d=="function"?(this.#i=d,this.#y=[]):(this.#i=void 0,this.#y=void 0),this.#w=!!this.#n,this.#O=!!this.#e,this.#s=!!this.#i,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!R,this.ignoreFetchAbort=!!O,this.maxEntrySize!==0){if(this.#r!==0&&!Yc(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!Yc(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#q()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=Yc(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!Yc(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#x()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let U="LRU_CACHE_UNBOUNDED";c0e(U)&&(q6.add(U),a0e("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",U,z6))}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#x(){let e=new Sw(this.#t),t=new Sw(this.#t);this.#m=e,this.#T=t;let n=this.ttlAutopurge?Array.from({length:this.#t}):void 0;this.#b=n,this.#j=(l,u,f=this.#u.now())=>{t[l]=u!==0?f:0,e[l]=u,i(l,u)},this.#C=l=>{t[l]=e[l]!==0?this.#u.now():0,i(l,e[l])};let i=this.ttlAutopurge?(l,u)=>{if(n?.[l]&&(clearTimeout(n[l]),n[l]=void 0),u&&u!==0&&n){let f=setTimeout(()=>{this.#I(l)?(this.#$(this.#d[l],"expire"),n[l]=void 0):i(l,c(l))},u+1);f.unref&&f.unref(),n[l]=f}}:()=>{};this.#D=(l,u)=>{if(e[u]){let f=e[u],d=t[u];if(!f||!d)return;l.ttl=f,l.start=d,l.now=s||o();let p=l.now-d;l.remainingTTL=f-p}};let s=0,o=a(()=>{let l=this.#u.now();if(this.ttlResolution>0){s=l;let u=setTimeout(()=>s=0,this.ttlResolution);u.unref&&u.unref()}return l},"o");this.getRemainingTTL=l=>{let u=this.#l.get(l);return u===void 0?0:c(u)};let c=a(l=>{let u=e[l],f=t[l];if(!u||!f)return 1/0;let d=(s||o())-f;return u-d},"l");this.#I=l=>{let u=t[l],f=e[l];return!!f&&!!u&&(s||o())-u>f}}#C=a(()=>{},"#R");#D=a(()=>{},"#v");#j=a(()=>{},"#H");#I=a(()=>!1,"#p");#q(){let e=new Sw(this.#t);this.#f=0,this.#v=e,this.#N=t=>{this.#f-=e[t],e[t]=0},this.#B=(t,n,i,s)=>{if(!Yc(i)){if(this.#h(n))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,t),!Yc(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return i},this.#L=(t,n,i)=>{if(e[t]=n,this.#r){let s=this.#r-e[t];for(;this.#f>s;)this.#G(!0)}this.#f+=e[t],i&&(i.entrySize=n,i.totalCalculatedSize=this.#f)}}#N=a(e=>{},"#x");#L=a((e,t,n)=>{},"#j");#B=a((e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#N");*#P({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#S;this.#U(t)&&((e||!this.#I(t))&&(yield t),t!==this.#_);)t=this.#E[t]}*#F({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#_;this.#U(t)&&((e||!this.#I(t))&&(yield t),t!==this.#S);)t=this.#g[t]}#U(e){return e!==void 0&&this.#l.get(this.#d[e])===e}*entries(){for(let e of this.#P())this.#o[e]!==void 0&&this.#d[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#d[e],this.#o[e]])}*rentries(){for(let e of this.#F())this.#o[e]!==void 0&&this.#d[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#d[e],this.#o[e]])}*keys(){for(let e of this.#P()){let t=this.#d[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*rkeys(){for(let e of this.#F()){let t=this.#d[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*values(){for(let e of this.#P())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}*rvalues(){for(let e of this.#F())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let n of this.#P()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#d[n],this))return this.#K(this.#d[n],t)}}forEach(e,t=this){for(let n of this.#P()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#d[n],this)}}rforEach(e,t=this){for(let n of this.#F()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#d[n],this)}}purgeStale(){let e=!1;for(let t of this.#F({allowStale:!0}))this.#I(t)&&(this.#$(this.#d[t],"expire"),e=!0);return e}info(e){let t=this.#l.get(e);if(t===void 0)return;let n=this.#o[t],i=this.#h(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#m&&this.#T){let o=this.#m[t],c=this.#T[t];if(o&&c){let l=o-(this.#u.now()-c);s.ttl=l,s.start=Date.now()}}return this.#v&&(s.size=this.#v[t]),s}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let n=this.#d[t],i=this.#o[t],s=this.#h(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#m&&this.#T){o.ttl=this.#m[t];let c=this.#u.now()-this.#T[t];o.start=Math.floor(Date.now()-c)}this.#v&&(o.size=this.#v[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let i=Date.now()-n.start;n.start=this.#u.now()-i}this.#k(t,n.value,n)}}set(e,t,n={}){let{status:i=Pn.hasSubscribers?{}:void 0}=n;n.status=i,i&&(i.op="set",i.key=e,t!==void 0&&(i.value=t),i.cache=this);let s=this.#k(e,t,n);return i&&Pn.hasSubscribers&&Pn.publish(i),s}#k(e,t,n,i){let{ttl:s=this.ttl,start:o,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,f=this.#h(t);if(t===void 0)return u&&(u.set="deleted"),this.delete(e),this;let{noUpdateTTL:d=this.noUpdateTTL}=n;u&&!f&&(u.value=t);let p=this.#B(e,t,n.size||0,l,u);if(this.maxEntrySize&&p>this.maxEntrySize)return this.#$(e,"set"),u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this;let h=this.#c===0?void 0:this.#l.get(e);if(h===void 0)h=this.#c===0?this.#S:this.#A.length!==0?this.#A.pop():this.#c===this.#t?this.#G(!1):this.#c,this.#d[h]=e,this.#o[h]=t,this.#l.set(e,h),this.#g[this.#S]=h,this.#E[h]=this.#S,this.#S=h,this.#c++,this.#L(h,p,u),u&&(u.set="add"),d=!1,this.#O&&!f&&this.#e?.(t,e,"add");else{this.#H(h);let g=this.#o[h];if(t!==g){if(!c)if(this.#h(g)){g!==i&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=g;m!==void 0&&m!==t&&(this.#w&&this.#n?.(m,e,"set"),this.#s&&this.#y?.push([m,e,"set"]))}else this.#w&&this.#n?.(g,e,"set"),this.#s&&this.#y?.push([g,e,"set"]);if(this.#N(h),this.#L(h,p,u),this.#o[h]=t,!f){let m=g&&this.#h(g)?g.__staleWhileFetching:g,b=m===void 0?"add":t!==m?"replace":"update";u&&(u.set=b,m!==void 0&&(u.oldValue=m)),this.#O&&this.onInsert?.(t,e,b)}}else f||(u&&(u.set="update"),this.#O&&this.onInsert?.(t,e,"update"))}if(s!==0&&!this.#m&&this.#x(),this.#m&&(d||this.#j(h,s,o),u&&this.#D(u,h)),!c&&this.#s&&this.#y){let g=this.#y,m;for(;m=g?.shift();)this.#i?.(...m)}return this}pop(){try{for(;this.#c;){let e=this.#o[this.#_];if(this.#G(!0),this.#h(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#s&&this.#y){let e=this.#y,t;for(;t=e?.shift();)this.#i?.(...t)}}}#G(e){let t=this.#_,n=this.#d[t],i=this.#o[t],s=this.#h(i);s&&i.__abortController.abort(new Error("evicted"));let o=s?i.__staleWhileFetching:i;return(this.#w||this.#s)&&o!==void 0&&(this.#w&&this.#n?.(o,n,"evict"),this.#s&&this.#y?.push([o,n,"evict"])),this.#N(t),this.#b?.[t]&&(clearTimeout(this.#b[t]),this.#b[t]=void 0),e&&(this.#d[t]=void 0,this.#o[t]=void 0,this.#A.push(t)),this.#c===1?(this.#_=this.#S=0,this.#A.length=0):this.#_=this.#g[t],this.#l.delete(n),this.#c--,t}has(e,t={}){let{status:n=Pn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="has",n.key=e,n.cache=this);let i=this.#Y(e,t);return Pn.hasSubscribers&&Pn.publish(n),i}#Y(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,s=this.#l.get(e);if(s!==void 0){let o=this.#o[s];if(this.#h(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#I(s))i&&(i.has="stale",this.#D(i,s));else return n&&this.#C(s),i&&(i.has="hit",this.#D(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{status:n=Sx()?{}:void 0}=t;n&&(n.op="peek",n.key=e,n.cache=this),t.status=n;let i=this.#W(e,t);return Pn.hasSubscribers&&Pn.publish(n),i}#W(e,t){let{status:n,allowStale:i=this.allowStale}=t,s=this.#l.get(e);if(s===void 0||!i&&this.#I(s)){n&&(n.peek=s===void 0?"miss":"stale");return}let o=this.#o[s],c=this.#h(o)?o.__staleWhileFetching:o;return n&&(c!==void 0?(n.peek="hit",n.value=c):n.peek="miss"),c}#M(e,t,n,i){let s=t===void 0?void 0:this.#o[t];if(this.#h(s))return s;let o=new AbortController,{signal:c}=n;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let l={signal:o.signal,options:n,context:i},u=a((m,b=!1)=>{let{aborted:S}=o.signal,_=n.ignoreFetchAbort&&m!==void 0,A=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&m!==void 0);if(n.status&&(S&&!b?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,_&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),S&&!_&&!b)return d(o.signal.reason,A);let E=h,w=this.#o[t];return(w===h||w===void 0&&_&&b)&&(m===void 0?E.__staleWhileFetching!==void 0?this.#o[t]=E.__staleWhileFetching:this.#$(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.#k(e,m,l.options,E))),m},"r"),f=a(m=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=m),d(m,!1)),"c"),d=a((m,b)=>{let{aborted:S}=o.signal,_=S&&n.allowStaleOnFetchAbort,A=_||n.allowStaleOnFetchRejection,E=A||n.noDeleteOnFetchRejection,w=h;if(this.#o[t]===h&&(!E||!b&&w.__staleWhileFetching===void 0?this.#$(e,"fetch"):_||(this.#o[t]=w.__staleWhileFetching)),A)return n.status&&w.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw m},"m"),p=a((m,b)=>{let S=this.#a?.(e,s,l);o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(m(void 0),n.allowStaleOnFetchAbort&&(m=a(_=>u(_,!0),"f")))}),S&&S instanceof Promise?S.then(_=>m(_===void 0?void 0:_),b):S!==void 0&&m(S)},"_");n.status&&(n.status.fetchDispatched=!0);let h=new Promise(p).then(u,f),g=Object.assign(h,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.#k(e,g,{...l.options,status:void 0}),t=this.#l.get(e)):this.#o[t]=g,g}#h(e){if(!this.#R)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let n=Hm.hasSubscribers,{status:i=Sx()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let s=this.#z(e,t);return i&&n&&(i.trace=!0,Hm.tracePromise(()=>s,i).catch(()=>{})),s}async#z(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:m,forceRefresh:b=!1,status:S,signal:_}=t;if(S&&(S.op="fetch",S.key=e,b&&(S.forceRefresh=!0),S.cache=this),!this.#R)return S&&(S.fetch="get"),this.#K(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:S});let A={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:g,ignoreFetchAbort:h,status:S,signal:_},E=this.#l.get(e);if(E===void 0){S&&(S.fetch="miss");let w=this.#M(e,E,A,m);return w.__returned=w}else{let w=this.#o[E];if(this.#h(w)){let N=n&&w.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",N&&(S.returnedStale=!0)),N?w.__staleWhileFetching:w.__returned=w}let R=this.#I(E);if(!b&&!R)return S&&(S.fetch="hit"),this.#H(E),i&&this.#C(E),S&&this.#D(S,E),w;let O=this.#M(e,E,A,m),P=O.__staleWhileFetching!==void 0&&n;return S&&(S.fetch=R?"stale":"refresh",P&&R&&(S.returnedStale=!0)),P?O.__staleWhileFetching:O.__returned=O}}forceFetch(e,t={}){let n=Hm.hasSubscribers,{status:i=Sx()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let s=this.#V(e,t);return i&&n&&(i.trace=!0,Hm.tracePromise(()=>s,i).catch(()=>{})),s}async#V(e,t={}){let n=await this.#z(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let{status:n=Pn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="memo",n.key=e,t.context&&(n.context=t.context),n.cache=this);let i=this.#J(e,t);return n&&(n.value=i),Pn.hasSubscribers&&Pn.publish(n),i}#J(e,t={}){let n=this.#p;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,status:s,forceRefresh:o,...c}=t;s&&o&&(s.forceRefresh=!0);let l=this.#K(e,c),u=o||l===void 0;if(s&&(s.memo=u?"miss":"hit",u||(s.value=l)),!u)return l;let f=n(e,l,{options:c,context:i});return s&&(s.value=f),this.#k(e,f,c),f}get(e,t={}){let{status:n=Pn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="get",n.key=e,n.cache=this);let i=this.#K(e,t);return n&&(i!==void 0&&(n.value=i),Pn.hasSubscribers&&Pn.publish(n)),i}#K(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,c=this.#l.get(e);if(c===void 0){o&&(o.get="miss");return}let l=this.#o[c],u=this.#h(l);return o&&this.#D(o,c),this.#I(c)?u?(o&&(o.get="stale-fetching"),n&&l.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),l.__staleWhileFetching):void 0):(s||this.#$(e,"expire"),o&&(o.get="stale"),n?(o&&(o.returnedStale=!0),l):void 0):(o&&(o.get=u?"fetching":"hit"),this.#H(c),i&&this.#C(c),u?l.__staleWhileFetching:l)}#X(e,t){this.#E[t]=e,this.#g[e]=t}#H(e){e!==this.#S&&(e===this.#_?this.#_=this.#g[e]:this.#X(this.#E[e],this.#g[e]),this.#X(this.#S,e),this.#S=e)}delete(e){return this.#$(e,"delete")}#$(e,t){Pn.hasSubscribers&&Pn.publish({op:"delete",delete:t,key:e,cache:this});let n=!1;if(this.#c!==0){let i=this.#l.get(e);if(i!==void 0)if(this.#b?.[i]&&(clearTimeout(this.#b[i]),this.#b[i]=void 0),n=!0,this.#c===1)this.#Q(t);else{this.#N(i);let s=this.#o[i];if(this.#h(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#s)&&(this.#w&&this.#n?.(s,e,t),this.#s&&this.#y?.push([s,e,t])),this.#l.delete(e),this.#d[i]=void 0,this.#o[i]=void 0,i===this.#S)this.#S=this.#E[i];else if(i===this.#_)this.#_=this.#g[i];else{let o=this.#E[i];this.#g[o]=this.#g[i];let c=this.#g[i];this.#E[c]=this.#E[i]}this.#c--,this.#A.push(i)}}if(this.#s&&this.#y?.length){let i=this.#y,s;for(;s=i?.shift();)this.#i?.(...s)}return n}clear(){return this.#Q("delete")}#Q(e){for(let t of this.#F({allowStale:!0})){let n=this.#o[t];if(this.#h(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#d[t];this.#w&&this.#n?.(n,i,e),this.#s&&this.#y?.push([n,i,e])}}if(this.#l.clear(),this.#o.fill(void 0),this.#d.fill(void 0),this.#m&&this.#T){this.#m.fill(0),this.#T.fill(0);for(let t of this.#b??[])t!==void 0&&clearTimeout(t);this.#b?.fill(void 0)}if(this.#v&&this.#v.fill(0),this.#_=0,this.#S=0,this.#A.length=0,this.#f=0,this.#c=0,this.#s&&this.#y){let t=this.#y,n;for(;n=t?.shift();)this.#i?.(...n)}}}});var Cw,Rx,J6,H6,u0e,f0e,d0e,Wa,za,Xc,Ew,Qm,vw,Y6,Tw,X6,zs,zd,cn,Jm,Kd,ln,pi,un,wx,Aw,Kn,Cr,Ex,vx,Q6,Tx,jo,Ax,Iw,Zm,wu,Yi,eg,p0e,h0e,m0e,g0e,Rw,Ix,y0e,b0e,Qc,Cx=$e(()=>{Cw=require("node:events"),Rx=Q(require("node:stream"),1),J6=require("node:string_decoder"),H6=typeof process=="object"&&process?process:{stdout:null,stderr:null},u0e=a(r=>!!r&&typeof r=="object"&&(r instanceof Qc||r instanceof Rx.default||f0e(r)||d0e(r)),"isStream"),f0e=a(r=>!!r&&typeof r=="object"&&r instanceof Cw.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==Rx.default.Writable.prototype.pipe,"isReadable"),d0e=a(r=>!!r&&typeof r=="object"&&r instanceof Cw.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function","isWritable"),Wa=Symbol("EOF"),za=Symbol("maybeEmitEnd"),Xc=Symbol("emittedEnd"),Ew=Symbol("emittingEnd"),Qm=Symbol("emittedError"),vw=Symbol("closed"),Y6=Symbol("read"),Tw=Symbol("flush"),X6=Symbol("flushChunk"),zs=Symbol("encoding"),zd=Symbol("decoder"),cn=Symbol("flowing"),Jm=Symbol("paused"),Kd=Symbol("resume"),ln=Symbol("buffer"),pi=Symbol("pipes"),un=Symbol("bufferLength"),wx=Symbol("bufferPush"),Aw=Symbol("bufferShift"),Kn=Symbol("objectMode"),Cr=Symbol("destroyed"),Ex=Symbol("error"),vx=Symbol("emitData"),Q6=Symbol("emitEnd"),Tx=Symbol("emitEnd2"),jo=Symbol("async"),Ax=Symbol("abort"),Iw=Symbol("aborted"),Zm=Symbol("signal"),wu=Symbol("dataListeners"),Yi=Symbol("discarded"),eg=a(r=>Promise.resolve().then(r),"defer"),p0e=a(r=>r(),"nodefer"),h0e=a(r=>r==="end"||r==="finish"||r==="prefinish","isEndish"),m0e=a(r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,"isArrayBufferLike"),g0e=a(r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),"isArrayBufferView"),Rw=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[Kd](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ix=class extends Rw{static{a(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=i=>this.dest.emit("error",i),e.on("error",this.proxyErrors)}},y0e=a(r=>!!r.objectMode,"isObjectModeOptions"),b0e=a(r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer","isEncodingOptions"),Qc=class extends Cw.EventEmitter{static{a(this,"Minipass")}[cn]=!1;[Jm]=!1;[pi]=[];[ln]=[];[Kn];[zs];[jo];[zd];[Wa]=!1;[Xc]=!1;[Ew]=!1;[vw]=!1;[Qm]=null;[un]=0;[Cr]=!1;[Zm];[Iw]=!1;[wu]=0;[Yi]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");y0e(t)?(this[Kn]=!0,this[zs]=null):b0e(t)?(this[zs]=t.encoding,this[Kn]=!1):(this[Kn]=!1,this[zs]=null),this[jo]=!!t.async,this[zd]=this[zs]?new J6.StringDecoder(this[zs]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[ln],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[pi],"get")});let{signal:n}=t;n&&(this[Zm]=n,n.aborted?this[Ax]():n.addEventListener("abort",()=>this[Ax]()))}get bufferLength(){return this[un]}get encoding(){return this[zs]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Kn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[jo]}set async(e){this[jo]=this[jo]||!!e}[Ax](){this[Iw]=!0,this.emit("abort",this[Zm]?.reason),this.destroy(this[Zm]?.reason)}get aborted(){return this[Iw]}set aborted(e){}write(e,t,n){if(this[Iw])return!1;if(this[Wa])throw new Error("write after end");if(this[Cr])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(n=t,t="utf8"),t||(t="utf8");let i=this[jo]?eg:p0e;if(!this[Kn]&&!Buffer.isBuffer(e)){if(g0e(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(m0e(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Kn]?(this[cn]&&this[un]!==0&&this[Tw](!0),this[cn]?this.emit("data",e):this[wx](e),this[un]!==0&&this.emit("readable"),n&&i(n),this[cn]):e.length?(typeof e=="string"&&!(t===this[zs]&&!this[zd]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[zs]&&(e=this[zd].write(e)),this[cn]&&this[un]!==0&&this[Tw](!0),this[cn]?this.emit("data",e):this[wx](e),this[un]!==0&&this.emit("readable"),n&&i(n),this[cn]):(this[un]!==0&&this.emit("readable"),n&&i(n),this[cn])}read(e){if(this[Cr])return null;if(this[Yi]=!1,this[un]===0||e===0||e&&e>this[un])return this[za](),null;this[Kn]&&(e=null),this[ln].length>1&&!this[Kn]&&(this[ln]=[this[zs]?this[ln].join(""):Buffer.concat(this[ln],this[un])]);let t=this[Y6](e||null,this[ln][0]);return this[za](),t}[Y6](e,t){if(this[Kn])this[Aw]();else{let n=t;e===n.length||e===null?this[Aw]():typeof n=="string"?(this[ln][0]=n.slice(e),t=n.slice(0,e),this[un]-=e):(this[ln][0]=n.subarray(e),t=n.subarray(0,e),this[un]-=e)}return this.emit("data",t),!this[ln].length&&!this[Wa]&&this.emit("drain"),t}end(e,t,n){return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t="utf8"),e!==void 0&&this.write(e,t),n&&this.once("end",n),this[Wa]=!0,this.writable=!1,(this[cn]||!this[Jm])&&this[za](),this}[Kd](){this[Cr]||(!this[wu]&&!this[pi].length&&(this[Yi]=!0),this[Jm]=!1,this[cn]=!0,this.emit("resume"),this[ln].length?this[Tw]():this[Wa]?this[za]():this.emit("drain"))}resume(){return this[Kd]()}pause(){this[cn]=!1,this[Jm]=!0,this[Yi]=!1}get destroyed(){return this[Cr]}get flowing(){return this[cn]}get paused(){return this[Jm]}[wx](e){this[Kn]?this[un]+=1:this[un]+=e.length,this[ln].push(e)}[Aw](){return this[Kn]?this[un]-=1:this[un]-=this[ln][0].length,this[ln].shift()}[Tw](e=!1){do;while(this[X6](this[Aw]())&&this[ln].length);!e&&!this[ln].length&&!this[Wa]&&this.emit("drain")}[X6](e){return this.emit("data",e),this[cn]}pipe(e,t){if(this[Cr])return e;this[Yi]=!1;let n=this[Xc];return t=t||{},e===H6.stdout||e===H6.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,n?t.end&&e.end():(this[pi].push(t.proxyErrors?new Ix(this,e,t):new Rw(this,e,t)),this[jo]?eg(()=>this[Kd]()):this[Kd]()),e}unpipe(e){let t=this[pi].find(n=>n.dest===e);t&&(this[pi].length===1?(this[cn]&&this[wu]===0&&(this[cn]=!1),this[pi]=[]):this[pi].splice(this[pi].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e==="data")this[Yi]=!1,this[wu]++,!this[pi].length&&!this[cn]&&this[Kd]();else if(e==="readable"&&this[un]!==0)super.emit("readable");else if(h0e(e)&&this[Xc])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Qm]){let i=t;this[jo]?eg(()=>i.call(this,this[Qm])):i.call(this,this[Qm])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e==="data"&&(this[wu]=this.listeners("data").length,this[wu]===0&&!this[Yi]&&!this[pi].length&&(this[cn]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[wu]=0,!this[Yi]&&!this[pi].length&&(this[cn]=!1)),t}get emittedEnd(){return this[Xc]}[za](){!this[Ew]&&!this[Xc]&&!this[Cr]&&this[ln].length===0&&this[Wa]&&(this[Ew]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[vw]&&this.emit("close"),this[Ew]=!1)}emit(e,...t){let n=t[0];if(e!=="error"&&e!=="close"&&e!==Cr&&this[Cr])return!1;if(e==="data")return!this[Kn]&&!n?!1:this[jo]?(eg(()=>this[vx](n)),!0):this[vx](n);if(e==="end")return this[Q6]();if(e==="close"){if(this[vw]=!0,!this[Xc]&&!this[Cr])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Qm]=n,super.emit(Ex,n);let s=!this[Zm]||this.listeners("error").length?super.emit("error",n):!1;return this[za](),s}else if(e==="resume"){let s=super.emit("resume");return this[za](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...t);return this[za](),i}[vx](e){for(let n of this[pi])n.dest.write(e)===!1&&this.pause();let t=this[Yi]?!1:super.emit("data",e);return this[za](),t}[Q6](){return this[Xc]?!1:(this[Xc]=!0,this.readable=!1,this[jo]?(eg(()=>this[Tx]()),!0):this[Tx]())}[Tx](){if(this[zd]){let t=this[zd].end();if(t){for(let n of this[pi])n.dest.write(t);this[Yi]||super.emit("data",t)}}for(let t of this[pi])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Kn]||(e.dataLength=0);let t=this.promise();return this.on("data",n=>{e.push(n),this[Kn]||(e.dataLength+=n.length)}),await t,e}async concat(){if(this[Kn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[zs]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(Cr,()=>t(new Error("stream destroyed"))),this.on("error",n=>t(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Yi]=!1;let e=!1,t=a(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:a(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[Wa])return t();let s,o,c=a(d=>{this.off("data",l),this.off("end",u),this.off(Cr,f),t(),o(d)},"onerr"),l=a(d=>{this.off("error",c),this.off("end",u),this.off(Cr,f),this.pause(),s({value:d,done:!!this[Wa]})},"ondata"),u=a(()=>{this.off("error",c),this.off("data",l),this.off(Cr,f),t(),s({done:!0,value:void 0})},"onend"),f=a(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((d,p)=>{o=p,s=d,this.once(Cr,f),this.once("error",c),this.once("end",u),this.once("data",l)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[Yi]=!1;let e=!1,t=a(()=>(this.pause(),this.off(Ex,t),this.off(Cr,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),n=a(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(Ex,t),this.once(Cr,t),{next:n,throw:t,return:t,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[Cr])return e?this.emit("error",e):this.emit(Cr),this;this[Cr]=!0,this[Yi]=!0,this[ln].length=0,this[un]=0;let t=this;return typeof t.close=="function"&&!this[vw]&&t.close(),e?this.emit("error",e):this.emit(Cr),this}static get isStream(){return u0e}}});var Hd,n8,Uo,_0e,Jc,S0e,rg,i8,s8,w0e,E0e,ps,o8,a8,Bo,c8,l8,Eu,u8,ds,tg,Ox,Z6,ng,Ks,Ow,Pw,e8,v0e,xx,t8,ig,r8,xw,Fw,Px,f8,Hn,Dw,Lw,Nw,Yd,Xd,sg,kMe,d8,p8=$e(()=>{K6();Hd=require("node:path"),n8=require("node:url"),Uo=require("fs"),_0e=Q(require("node:fs"),1),Jc=require("node:fs/promises");Cx();S0e=Uo.realpathSync.native,rg={lstatSync:Uo.lstatSync,readdir:Uo.readdir,readdirSync:Uo.readdirSync,readlinkSync:Uo.readlinkSync,realpathSync:S0e,promises:{lstat:Jc.lstat,readdir:Jc.readdir,readlink:Jc.readlink,realpath:Jc.realpath}},i8=a(r=>!r||r===rg||r===_0e?rg:{...rg,...r,promises:{...rg.promises,...r.promises||{}}},"fsFromOption"),s8=/^\\\\\?\\([a-z]:)\\?$/i,w0e=a(r=>r.replace(/\//g,"\\").replace(s8,"$1\\"),"uncToDrive"),E0e=/[\\\/]/,ps=0,o8=1,a8=2,Bo=4,c8=6,l8=8,Eu=10,u8=12,ds=15,tg=~ds,Ox=16,Z6=32,ng=64,Ks=128,Ow=256,Pw=512,e8=ng|Ks|Pw,v0e=1023,xx=a(r=>r.isFile()?l8:r.isDirectory()?Bo:r.isSymbolicLink()?Eu:r.isCharacterDevice()?a8:r.isBlockDevice()?c8:r.isSocket()?u8:r.isFIFO()?o8:ps,"entToType"),t8=new Xm({max:2**12}),ig=a(r=>{let e=t8.get(r);if(e)return e;let t=r.normalize("NFKD");return t8.set(r,t),t},"normalize"),r8=new Xm({max:2**12}),xw=a(r=>{let e=r8.get(r);if(e)return e;let t=ig(r.toLowerCase());return r8.set(r,t),t},"normalizeNocase"),Fw=class extends Xm{static{a(this,"ResolveCache")}constructor(){super({max:256})}},Px=class extends Xm{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(t=>t.length+1,"sizeCalculation")})}},f8=Symbol("PathScurry setAsCwd"),Hn=class{static{a(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#t;#r;get dev(){return this.#r}#n;get mode(){return this.#n}#e;get nlink(){return this.#e}#i;get uid(){return this.#i}#a;get gid(){return this.#a}#p;get rdev(){return this.#p}#u;get blksize(){return this.#u}#c;get ino(){return this.#c}#f;get size(){return this.#f}#l;get blocks(){return this.#l}#d;get atimeMs(){return this.#d}#o;get mtimeMs(){return this.#o}#g;get ctimeMs(){return this.#g}#E;get birthtimeMs(){return this.#E}#_;get atime(){return this.#_}#S;get mtime(){return this.#S}#A;get ctime(){return this.#A}#y;get birthtime(){return this.#y}#v;#T;#m;#b;#w;#R;#s;#O;#x;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=ps,n,i,s,o,c){this.name=e,this.#v=s?xw(e):ig(e),this.#s=t&v0e,this.nocase=s,this.roots=i,this.root=n||this,this.#O=o,this.#m=c.fullpath,this.#w=c.relative,this.#R=c.relativePosix,this.parent=c.parent,this.parent?this.#t=this.parent.#t:this.#t=i8(c.fs)}depth(){return this.#T!==void 0?this.#T:this.parent?this.#T=this.parent.depth()+1:this.#T=0}childrenCache(){return this.#O}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#D(i):this.#D(i)}#D(e){let t=this;for(let n of e)t=t.child(n);return t}children(){let e=this.#O.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#O.set(this,t),this.#s&=~Ox,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?xw(e):ig(e);for(let l of n)if(l.#v===i)return l;let s=this.parent?this.sep:"",o=this.#m?this.#m+s+e:void 0,c=this.newChild(e,ps,{...t,parent:this,fullpath:o});return this.canReaddir()||(c.#s|=Ks),n.push(c),c}relative(){if(this.isCWD)return"";if(this.#w!==void 0)return this.#w;let e=this.name,t=this.parent;if(!t)return this.#w=this.name;let n=t.relative();return n+(!n||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,t=this.parent;if(!t)return this.#R=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?"":"/")+e}fullpath(){if(this.#m!==void 0)return this.#m;let e=this.name,t=this.parent;if(!t)return this.#m=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#m=i}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep==="/")return this.#b=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#b=`//?/${i}`:this.#b=i}let e=this.parent,t=e.fullpathPosix(),n=t+(!t||!e.parent?"":"/")+this.name;return this.#b=n}isUnknown(){return(this.#s&ds)===ps}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#s&ds)===l8}isDirectory(){return(this.#s&ds)===Bo}isCharacterDevice(){return(this.#s&ds)===a8}isBlockDevice(){return(this.#s&ds)===c8}isFIFO(){return(this.#s&ds)===o8}isSocket(){return(this.#s&ds)===u8}isSymbolicLink(){return(this.#s&Eu)===Eu}lstatCached(){return this.#s&Z6?this:void 0}readlinkCached(){return this.#x}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#x)return!0;if(!this.parent)return!1;let e=this.#s&ds;return!(e!==ps&&e!==Eu||this.#s&Ow||this.#s&Ks)}calledReaddir(){return!!(this.#s&Ox)}isENOENT(){return!!(this.#s&Ks)}isNamed(e){return this.nocase?this.#v===xw(e):this.#v===ig(e)}async readlink(){let e=this.#x;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#t.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(t);if(n)return this.#x=n}catch(t){this.#F(t.code);return}}readlinkSync(){let e=this.#x;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#t.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(t);if(n)return this.#x=n}catch(t){this.#F(t.code);return}}#j(e){this.#s|=Ox;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#I()}}#I(){this.#s&Ks||(this.#s=(this.#s|Ks)&tg,this.#q())}#q(){let e=this.children();e.provisional=0;for(let t of e)t.#I()}#N(){this.#s|=Pw,this.#L()}#L(){if(this.#s&ng)return;let e=this.#s;(e&ds)===Bo&&(e&=tg),this.#s=e|ng,this.#q()}#B(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#I():this.children().provisional=0}#P(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#I()}#F(e=""){let t=this.#s;t|=Ow,e==="ENOENT"&&(t|=Ks),(e==="EINVAL"||e==="UNKNOWN")&&(t&=tg),this.#s=t,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#U(e,t){return this.#G(e,t)||this.#k(e,t)}#k(e,t){let n=xx(e),i=this.newChild(e.name,n,{parent:this}),s=i.#s&ds;return s!==Bo&&s!==Eu&&s!==ps&&(i.#s|=ng),t.unshift(i),t.provisional++,i}#G(e,t){for(let n=t.provisional;n<t.length;n++){let i=t[n];if((this.nocase?xw(e.name):ig(e.name))===i.#v)return this.#Y(e,i,n,t)}}#Y(e,t,n,i){let s=t.name;return t.#s=t.#s&tg|xx(e),s!==e.name&&(t.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#s&Ks)===0)try{return this.#W(await this.#t.promises.lstat(this.fullpath())),this}catch(e){this.#P(e.code)}}lstatSync(){if((this.#s&Ks)===0)try{return this.#W(this.#t.lstatSync(this.fullpath())),this}catch(e){this.#P(e.code)}}#W(e){let{atime:t,atimeMs:n,birthtime:i,birthtimeMs:s,blksize:o,blocks:c,ctime:l,ctimeMs:u,dev:f,gid:d,ino:p,mode:h,mtime:g,mtimeMs:m,nlink:b,rdev:S,size:_,uid:A}=e;this.#_=t,this.#d=n,this.#y=i,this.#E=s,this.#u=o,this.#l=c,this.#A=l,this.#g=u,this.#r=f,this.#a=d,this.#c=p,this.#n=h,this.#S=g,this.#o=m,this.#e=b,this.#p=S,this.#f=_,this.#i=A;let E=xx(e);this.#s=this.#s&tg|E|Z6,E!==ps&&E!==Bo&&E!==Eu&&(this.#s|=ng)}#M=[];#h=!1;#z(e){this.#h=!1;let t=this.#M.slice();this.#M.length=0,t.forEach(n=>n(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#M.push(e),this.#h)return;this.#h=!0;let i=this.fullpath();this.#t.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#B(s.code),n.provisional=0;else{for(let c of o)this.#U(c,n);this.#j(n)}this.#z(n.slice(0,n.provisional))})}#V;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#V)await this.#V;else{let n=a(()=>{},"resolve");this.#V=new Promise(i=>n=i);try{for(let i of await this.#t.promises.readdir(t,{withFileTypes:!0}))this.#U(i,e);this.#j(e)}catch(i){this.#B(i.code),e.provisional=0}this.#V=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let n of this.#t.readdirSync(t,{withFileTypes:!0}))this.#U(n,e);this.#j(e)}catch(n){this.#B(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#s&e8)return!1;let e=ds&this.#s;return e===ps||e===Bo||e===Eu}shouldWalk(e,t){return(this.#s&Bo)===Bo&&!(this.#s&e8)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((Pw|Ow|Ks)&this.#s))try{let e=await this.#t.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#N()}}realpathSync(){if(this.#C)return this.#C;if(!((Pw|Ow|Ks)&this.#s))try{let e=this.#t.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#N()}}[f8](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],i=this;for(;i&&i.parent;)t.add(i),i.#w=n.join(this.sep),i.#R=n.join("/"),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#w=void 0,i.#R=void 0,i=i.parent}},Dw=class r extends Hn{static{a(this,"PathWin32")}sep="\\";splitSep=E0e;constructor(e,t=ps,n,i,s,o,c){super(e,t,n,i,s,o,c)}newChild(e,t=ps,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return Hd.win32.parse(e).root}getRoot(e){if(e=w0e(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new Yd(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(s8,"$1\\"),e===t}},Lw=class r extends Hn{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=ps,n,i,s,o,c){super(e,t,n,i,s,o,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=ps,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Nw=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#t;#r;#n;nocase;#e;constructor(e=process.cwd(),t,n,{nocase:i,childrenCacheSize:s=16*1024,fs:o=rg}={}){this.#e=i8(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,n8.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#t=new Fw,this.#r=new Fw,this.#n=new Px(s);let l=c.substring(this.rootPath.length).split(n);if(l.length===1&&!l[0]&&l.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#e),this.roots[this.rootPath]=this.root;let u=this.root,f=l.length-1,d=t.sep,p=this.rootPath,h=!1;for(let g of l){let m=f--;u=u.child(g,{relative:new Array(m).fill("..").join(d),relativePosix:new Array(m).fill("..").join("/"),fullpath:p+=(h?"":d)+g}),h=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#n}resolve(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#t.get(t);if(n!==void 0)return n;let i=this.cwd.resolve(t).fullpath();return this.#t.set(t,i),i}resolvePosix(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#r.get(t);if(n!==void 0)return n;let i=this.cwd.resolve(t).fullpathPosix();return this.#r.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let i=await e.readdir();return n?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(n?e:e.fullpath());let l=new Set,u=a((d,p)=>{l.add(d),d.readdirCB((h,g)=>{if(h)return p(h);let m=g.length;if(!m)return p();let b=a(()=>{--m===0&&p()},"next");for(let S of g)(!s||s(S))&&c.push(n?S:S.fullpath()),i&&S.isSymbolicLink()?S.realpath().then(_=>_?.isUnknown()?_.lstat():_).then(_=>_?.shouldWalk(l,o)?u(_,b):b()):S.shouldWalk(l,o)?u(S,b):b()},!0)},"walk"),f=e;return new Promise((d,p)=>{u(f,h=>{if(h)return p(h);d(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(n?e:e.fullpath());let l=new Set([e]);for(let u of l){let f=u.readdirSync();for(let d of f){(!s||s(d))&&c.push(n?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(i&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(l,o)&&l.add(p)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t;(!s||s(e))&&(yield n?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let f of u){(!s||s(f))&&(yield n?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(c,o)&&c.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new Qc({objectMode:!0});(!s||s(e))&&c.write(n?e:e.fullpath());let l=new Set,u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&c.end();return}f++,l.add(h);let g=a((b,S,_=!1)=>{if(b)return c.emit("error",b);if(i&&!_){let A=[];for(let E of S)E.isSymbolicLink()&&A.push(E.realpath().then(w=>w?.isUnknown()?w.lstat():w));if(A.length){Promise.all(A).then(()=>g(null,S,!0));return}}for(let A of S)A&&(!s||s(A))&&(c.write(n?A:A.fullpath())||(p=!0));f--;for(let A of S){let E=A.realpathCached()||A;E.shouldWalk(l,o)&&u.push(E)}p&&!c.flowing?c.once("drain",d):m||d()},"onReaddir"),m=!0;h.readdirCB(g,!0),m=!1}},"process");return d(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new Qc({objectMode:!0}),l=new Set;(!s||s(e))&&c.write(n?e:e.fullpath());let u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&c.end();return}f++,l.add(h);let g=h.readdirSync();for(let m of g)(!s||s(m))&&(c.write(n?m:m.fullpath())||(p=!0));f--;for(let m of g){let b=m;if(m.isSymbolicLink()){if(!(i&&(b=m.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(l,o)&&u.push(b)}}p&&!c.flowing&&c.once("drain",d)},"process");return d(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[f8](t)}},Yd=class extends Nw{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,Hd.win32,"\\",{...t,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Hd.win32.parse(e).root.toUpperCase()}newRoot(e){return new Dw(this.rootPath,Bo,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Xd=class extends Nw{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,Hd.posix,"/",{...t,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new Lw(this.rootPath,Bo,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},sg=class extends Xd{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}},kMe=process.platform==="win32"?Dw:Lw,d8=process.platform==="win32"?Yd:process.platform==="darwin"?sg:Xd});var T0e,A0e,Qd,Fx=$e(()=>{Hc();T0e=a(r=>r.length>=1,"isPatternList"),A0e=a(r=>r.length>=1,"isGlobList"),Qd=class r{static{a(this,"Pattern")}#t;#r;#n;length;#e;#i;#a;#p;#u;#c;#f=!0;constructor(e,t,n,i){if(!T0e(e))throw new TypeError("empty pattern list");if(!A0e(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#t=e,this.#r=t,this.#n=n,this.#e=i,this.#n===0){if(this.isUNC()){let[s,o,c,l,...u]=this.#t,[f,d,p,h,...g]=this.#r;u[0]===""&&(u.shift(),g.shift());let m=[s,o,c,l,""].join("/"),b=[f,d,p,h,""].join("/");this.#t=[m,...u],this.#r=[b,...g],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#t,[c,...l]=this.#r;o[0]===""&&(o.shift(),l.shift());let u=s+"/",f=c+"/";this.#t=[u,...o],this.#r=[f,...l],this.length=this.#t.length}}}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===Rr}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#a=this.#a||(this.#n===0?this.isAbsolute()?this.#r[0]+this.#r.slice(1).join("/"):this.#r.join("/"):this.#r.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new r(this.#t,this.#r,this.#n+1,this.#e),this.#i.#c=this.#c,this.#i.#u=this.#u,this.#i.#p=this.#p,this.#i):this.#i=null}isUNC(){let e=this.#t;return this.#u!==void 0?this.#u:this.#u=this.#e==="win32"&&this.#n===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#t;return this.#p!==void 0?this.#p:this.#p=this.#e==="win32"&&this.#n===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#t;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#t[0];return typeof e=="string"&&this.isAbsolute()&&this.#n===0?e:""}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#f)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#f?!1:(this.#f=!1,!0)}}});var I0e,Jd,Dx=$e(()=>{Hc();Fx();I0e=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Jd=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:i,noglobstar:s,platform:o=I0e}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new Hi(e,this.mmopts);for(let n=0;n<t.set.length;n++){let i=t.set[n],s=t.globParts[n];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new Qd(i,s,0,this.platform),c=new Hi(o.globString(),this.mmopts),l=s[s.length-1]==="**",u=o.isAbsolute();u?this.absolute.push(c):this.relative.push(c),l&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),n=`${t}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(t)||o.match(n))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}}});var Lx,Nx,kx,og,h8=$e(()=>{Hc();Lx=class r{static{a(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new r(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),i=this.store.get(n);i?i.add(t.globString()):this.store.set(n,new Set([t.globString()]))}},Nx=class{static{a(this,"MatchRecord")}store=new Map;add(e,t,n){let i=(t?2:0)|(n?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},kx=class{static{a(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===t.globString())||n.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},og=class r{static{a(this,"Processor")}hasWalkedCache;matches=new Nx;subwalks=new kx;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new Lx}processPatterns(e,t){this.patterns=t;let n=t.map(i=>[e,i]);for(let[i,s]of n){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),c=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let l,u,f=!1;for(;typeof(l=s.pattern())=="string"&&(u=s.rest());)i=i.resolve(l),s=u,f=!0;if(l=s.pattern(),u=s.rest(),f){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof l=="string"){let d=l===".."||l===""||l===".";this.matches.add(i.resolve(l),c,d);continue}else if(l===Rr){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=u?.pattern(),p=u?.rest();if(!u||(d===""||d===".")&&!p)this.matches.add(i,c,d===""||d===".");else if(d===".."){let h=i.parent||i;p?this.hasWalkedCache.hasWalked(h,p)||this.subwalks.add(h,p):this.matches.add(h,c,!0)}}else l instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(e,t){let n=this.subwalks.get(e),i=this.child();for(let s of t)for(let o of n){let c=o.isAbsolute(),l=o.pattern(),u=o.rest();l===Rr?i.testGlobstar(s,o,u,c):l instanceof RegExp?i.testRegExp(s,l,u,c):i.testString(s,l,u,c)}return i}testGlobstar(e,t,n,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),i)}}testRegExp(e,t,n,i){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,t,n,i){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}}});var R0e,kw,ag,cg,m8=$e(()=>{Cx();Dx();h8();R0e=a((r,e)=>typeof r=="string"?new Jd([r],e):Array.isArray(r)?new Jd(r,e):r,"makeIgnore"),kw=class{static{a(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#r;#n;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#n=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#r=R0e(n.ignore??[],n),!this.includeChildMatches&&typeof this.#r.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#e(e){return this.seen.has(e)||!!this.#r?.ignored?.(e)}#i(e){return!!this.#r?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#t.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#t.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#e(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,t)}matchFinish(e,t){if(this.#e(e))return;if(!this.includeChildMatches&&this.#r?.add){let s=`${e.relativePosix()}/**`;this.#r.add(s)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,t,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,t)}matchSync(e,t,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new og(this.opts),n)}walkCB2(e,t,n,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,i));return}n.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||(s++,this.match(c,l,u).then(()=>o()));for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirCached();c.calledReaddir()?this.walkCB3(c,l,n,o):c.readdirCB((u,f)=>this.walkCB3(c,f,n,o),!0)}o()}walkCB3(e,t,n,i){n=n.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||(s++,this.match(c,l,u).then(()=>o()));for(let[c,l]of n.subwalks.entries())s++,this.walkCB2(c,l,n.child(),o);o()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new og(this.opts),n)}walkCB2Sync(e,t,n,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,i));return}n.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||this.matchSync(c,l,u);for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirSync();this.walkCB3Sync(c,l,n,o)}o()}walkCB3Sync(e,t,n,i){n=n.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||this.matchSync(c,l,u);for(let[c,l]of n.subwalks.entries())s++,this.walkCB2Sync(c,l,n.child(),o);o()}},ag=class extends kw{static{a(this,"GlobWalker")}matches=new Set;constructor(e,t,n){super(e,t,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},cg=class extends kw{static{a(this,"GlobStream")}results;constructor(e,t,n){super(e,t,n),this.results=new Qc({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}});var g8,C0e,Hs,Mx=$e(()=>{Hc();g8=require("node:url");p8();Fx();m8();C0e=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Hs=class{static{a(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,g8.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=e,this.platform=t.platform||C0e,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=t.platform==="win32"?Yd:t.platform==="darwin"?sg:t.platform?Xd:d8;this.scurry=new l(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(l=>new Hi(l,i)),[o,c]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=o.map((l,u)=>{let f=c[u];if(!f)throw new Error("invalid pattern object");return new Qd(l,f,0,this.platform)})}async walk(){return[...await new ag(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new ag(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new cg(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new cg(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}});var $x,jx=$e(()=>{Hc();$x=a((r,e={})=>{Array.isArray(r)||(r=[r]);for(let t of r)if(new Hi(t,e).hasMagic())return!0;return!1},"hasMagic")});function Mw(r,e={}){return new Hs(r,e).streamSync()}function b8(r,e={}){return new Hs(r,e).stream()}function _8(r,e={}){return new Hs(r,e).walkSync()}async function y8(r,e={}){return new Hs(r,e).walk()}function $w(r,e={}){return new Hs(r,e).iterateSync()}function S8(r,e={}){return new Hs(r,e).iterate()}var O0e,x0e,P0e,F0e,D0e,Zd,Bx=$e(()=>{Hc();Mx();jx();Hc();Mx();jx();Dx();a(Mw,"globStreamSync");a(b8,"globStream");a(_8,"globSync");a(y8,"glob_");a($w,"globIterateSync");a(S8,"globIterate");O0e=Mw,x0e=Object.assign(b8,{sync:Mw}),P0e=$w,F0e=Object.assign(S8,{sync:$w}),D0e=Object.assign(_8,{stream:Mw,iterate:$w}),Zd=Object.assign(y8,{glob:y8,globSync:_8,sync:D0e,globStream:b8,stream:x0e,globStreamSync:Mw,streamSync:O0e,globIterate:S8,iterate:F0e,globIterateSync:$w,iterateSync:P0e,Glob:Hs,hasMagic:$x,escape:Wd,unescape:Ws});Zd.glob=Zd});async function E8(r,e,t,n={}){let{excludeRelPath:i}=n,s=vu.default.join(r,"**/*.md"),o=await Zd(s,{nodir:!0,ignore:[vu.default.join(r,".obsidian/**"),vu.default.join(r,".trash/**"),vu.default.join(r,"**/.obsidian/**"),vu.default.join(r,"**/.trash/**")]}),c={filesScanned:0,filesModified:0,replacements:0,modifiedFiles:[]};for(let l of o){let u=vu.default.relative(r,l);if(i&&u===i)continue;c.filesScanned+=1;let f;try{f=await Ux.default.readFile(l,"utf-8")}catch{continue}let{updated:d,replacements:p}=L0e(f,e,t);p>0&&(c.filesModified+=1,c.replacements+=p,c.modifiedFiles.push(u),await Ux.default.writeFile(l,d,"utf-8"))}return c}function L0e(r,e,t){let n=r.split(/(^```[\s\S]*?^```)/m),i=0;for(let s=0;s<n.length;s++){if(s%2===1)continue;let o=n[s],c=N0e(o,e,t);i+=c.replacements,n[s]=c.updated}return{updated:n.join(""),replacements:i}}function N0e(r,e,t){let n=r.split(/(`[^`\n]*`)/),i=0;for(let s=0;s<n.length;s++){if(s%2===1)continue;let o=k0e(n[s],e,t);i+=o.replacements,n[s]=o.updated}return{updated:n.join(""),replacements:i}}function k0e(r,e,t){let n=/(?<!!)\[\[([^\[\]\n|#^]+)((?:[#^][^\[\]\n|]*)?)(?:\|[^\[\]\n]*)?\]\]/g,i=0;return{updated:r.replace(n,(o,c,l)=>c.trim()!==e?o:(i+=1,`[[${t}${l}]]`)),replacements:i}}var Ux,vu,v8=$e(()=>{"use strict";Ux=Q($o()),vu=Q(require("path"));Bx();a(E8,"rewriteInboundWikilinks");a(L0e,"rewriteContent");a(N0e,"rewriteProseSegment");a(k0e,"replaceWikilinks")});var Or,pr,Ys,M0e,Yt,Xs=$e(()=>{"use strict";Or=Q($o()),pr=Q(require("path"));qm();Ys=Q(Pe());v8();M0e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Yt=class{constructor(e){this.rootPath=e;this.uuidIndex=null;this.basenameIndex=null;this.aliasIndex=null}static{a(this,"FileSystemVaultAdapter")}async read(e){let t=this.resolvePath(e.path);if(!await Or.default.pathExists(t))throw new Error(`File not found: ${e.path}`);return Or.default.readFile(t,"utf-8")}async create(e,t){let n=this.resolvePath(e);if(await Or.default.pathExists(n))throw new Error(`File already exists: ${e}`);return await Or.default.ensureDir(pr.default.dirname(n)),await Or.default.writeFile(n,t,"utf-8"),this.createFileObject(e)}async modify(e,t){let n=this.resolvePath(e.path);if(!await Or.default.pathExists(n))throw new Error(`File not found: ${e.path}`);await Or.default.writeFile(n,t,"utf-8")}async delete(e){let t=this.resolvePath(e.path);if(!await Or.default.pathExists(t))throw new Error(`File not found: ${e.path}`);await Or.default.remove(t)}async exists(e){let t=this.resolvePath(e);return Or.default.pathExists(t)}getAbstractFileByPath(e){let t=this.resolvePath(e);try{let n=Or.default.statSync(t);if(n.isFile())return this.createFileObject(e);if(n.isDirectory())return this.createFolderObject(e)}catch{return null}return null}getAllFiles(){let e=[];return this.walkDirectory(this.rootPath,t=>{if(t.endsWith(".md")){let n=pr.default.relative(this.rootPath,t);e.push(this.createFileObject(n))}}),e}getFrontmatter(e){try{let t=Or.default.readFileSync(this.resolvePath(e.path),"utf-8");return this.extractFrontmatter(t)}catch{return null}}getFrontmatterParseFailure(e){let t;try{t=Or.default.readFileSync(this.resolvePath(e.path),"utf-8")}catch{return null}let n=(0,Ys.matchFrontmatterBlock)(t)?.body;if(n===void 0)return null;let i=/^[ \t]*(#.*)?\r?$/;if(!n.split(`
|
|
436
436
|
`).some(o=>!i.test(o))||this.extractFrontmatter(t)!==null)return null;try{return Kc(n,{schema:Gm}),{reason:"frontmatter is not a mapping with string keys"}}catch(o){return{reason:o instanceof Error?o.message.split(`
|
|
437
437
|
`)[0]:String(o)}}}async updateFrontmatter(e,t){let n=await this.read(e),i=this.extractFrontmatter(n),s=(0,Ys.matchFrontmatterBlock)(n)?.body;if(i===null&&s!==void 0&&s.trim()!=="")throw new Error(`updateFrontmatter: frontmatter of ${e.path} is not parseable \u2014 refusing to patch (re-serialising would overwrite the unreadable block)`);let o=i??{},c=t({...o});Ys.FrontmatterService.applyPatch(o,c);let l=this.replaceFrontmatter(n,o);await this.modify(e,l)}async rename(e,t){let n=this.resolvePath(e.path),i=this.resolvePath(t);if(!await Or.default.pathExists(n))throw new Error(`File not found: ${e.path}`);await Or.default.ensureDir(pr.default.dirname(i)),await Or.default.move(n,i)}async createFolder(e){let t=this.resolvePath(e);await Or.default.ensureDir(t)}getFirstLinkpathDest(e,t,n){let i=e.split("|")[0].trim();if(!i)return null;if(M0e.test(i)){this.uuidIndex===null&&this.buildUuidIndex();let u=i.toLowerCase(),f=this.uuidIndex.get(u);return f?this.createFileObject(f):null}let s=pr.default.dirname(this.resolvePath(t)),o;if(pr.default.isAbsolute(i)?o=this.resolvePath(i):o=pr.default.resolve(s,i),i.endsWith(".md")||(o+=".md"),Or.default.existsSync(o)){let u=pr.default.relative(this.rootPath,o);return this.createFileObject(u)}(this.basenameIndex===null||this.aliasIndex===null)&&this.buildLinkpathIndex();let c=i.toLowerCase(),l=this.basenameIndex.get(c);if(l)return this.createFileObject(l);if(n?.allowAliasFallback!==!1){let u=this.aliasIndex.get(c);if(u)return this.createFileObject(u)}return null}buildLinkpathIndex(){this.basenameIndex=new Map,this.aliasIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(!e.endsWith(".md"))return;let t=pr.default.relative(this.rootPath,e),n=pr.default.basename(e,".md").toLowerCase();this.basenameIndex.has(n)||this.basenameIndex.set(n,t);let i;try{i=Or.default.readFileSync(e,"utf-8")}catch{return}let s=this.extractFrontmatter(i);if(!s)return;let o=s.aliases,c=Array.isArray(o)?o:typeof o=="string"?[o]:[];for(let l of c){if(typeof l!="string")continue;let u=l.trim().toLowerCase();u&&(this.aliasIndex.has(u)||this.aliasIndex.set(u,t))}})}buildUuidIndex(){this.uuidIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(e.endsWith(".md")){let n=pr.default.basename(e,".md").match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);if(n){let i=n[1].toLowerCase(),s=pr.default.relative(this.rootPath,e);this.uuidIndex.set(i,s)}}})}async process(e,t){let n=await this.read(e),i=t(n);return await this.modify(e,i),i}getDefaultNewFileParent(){return{path:"",name:""}}async updateLinks(e,t,n){let i=pr.default.basename(t,".md");await E8(this.rootPath,n,i,{excludeRelPath:e})}resolvePath(e){if(pr.default.isAbsolute(e))return e;let t=this.rootPath.replace(/[/\\]+$/,""),n=pr.default.sep+e;return n===t||n.startsWith(t+pr.default.sep)?n:pr.default.join(this.rootPath,e)}createFileObject(e){let t=pr.default.basename(e),n=pr.default.basename(e,pr.default.extname(e)),i=pr.default.dirname(e);return{path:e,basename:n,name:t,parent:i!=="."?this.createFolderObject(i):null}}createFolderObject(e){return{path:e,name:pr.default.basename(e)}}extractFrontmatter(e){let t=(0,Ys.matchFrontmatterBlock)(e);return t?(0,Ys.parseYamlFrontmatterTolerant)(t.body):null}replaceFrontmatter(e,t){let i=`---
|
|
438
438
|
${qd(t,{lineWidth:-1,noRefs:!0,quoteStyle:"double"}).trim()}
|
|
@@ -711,7 +711,7 @@ Next steps:
|
|
|
711
711
|
`).map(n=>n.trim()).filter(n=>n.length>0),t=e[e.length-1];if(t!==void 0)try{return JSON.parse(t)}catch{return}}a(Rve,"parseLastJsonLine");function lq(r,e){return e.filter(t=>{let n=r[t];return typeof n!="string"||n.trim().length===0})}a(lq,"missingStringFields");var lv=class{constructor(e){this.deps=e}static{a(this,"McpServer")}async handle(e){if(typeof e!="object"||e===null||Array.isArray(e))return{jsonrpc:"2.0",id:null,error:{code:cq,message:"Invalid request: expected a JSON-RPC object"}};let t=e.id,n=t===void 0;if(typeof e.method!="string")return n?null:{jsonrpc:"2.0",id:t??null,error:{code:cq,message:"Invalid request: missing method"}};if(n)return null;let i=t??null;switch(e.method){case"initialize":return{jsonrpc:"2.0",id:i,result:{protocolVersion:Ave,capabilities:{tools:{}},serverInfo:{name:"exocortex",version:this.deps.version}}};case"ping":return{jsonrpc:"2.0",id:i,result:{}};case"tools/list":return{jsonrpc:"2.0",id:i,result:{tools:aq}};case"tools/call":return{jsonrpc:"2.0",id:i,result:await this.callTool(e.params??{})};default:return{jsonrpc:"2.0",id:i,error:{code:Ive,message:`Method not found: ${e.method}`}}}}async callTool(e){let t=e.name,n=e.arguments??{},i;if(t==="create_asset"){let c=lq(n,["vault","class","label"]);if(c.length>0)return Rp(`create_asset: missing required argument(s): ${c.join(", ")}`,!0);let l=iq(n);if(l!==null)return Rp(`create_asset: ${l}`,!0);i=sq(n)}else if(t==="create_effort"){let c=lq(n,["vault","command","target"]);if(c.length>0)return Rp(`create_effort: missing required argument(s): ${c.join(", ")}`,!0);i=oq(n)}else return Rp(`Unknown tool: ${String(t)}`,!0);let s=await this.deps.runCli(i);if(s.exitCode!==0){let c=s.stderr.trim()||s.stdout.trim()||"(no diagnostic output)";return Rp(`exocortex-cli exited ${s.exitCode}
|
|
712
712
|
${c}`,!0)}let o=Rve(s.stdout);return Rp(o===void 0?s.stdout.trim():JSON.stringify(o))}};var dq=require("child_process");var Cve=32*1024*1024;function pq(r){return e=>new Promise(t=>{(0,dq.execFile)(process.execPath,[r,...e],{maxBuffer:Cve},(n,i,s)=>{let o=0;if(n){let c=n.code;o=typeof c=="number"?c:1}t({stdout:i,stderr:s,exitCode:o})})})}a(pq,"createSelfCliRunner");async function Ove(r,e,t){let n=(0,hq.createInterface)({input:e,crlfDelay:1/0});for await(let i of n){let s=i.trim();if(s.length===0)continue;let o;try{o=JSON.parse(s)}catch{t(JSON.stringify({jsonrpc:"2.0",id:null,error:{code:uq,message:"Parse error: invalid JSON"}})+`
|
|
713
713
|
`);continue}let c;try{c=await r.handle(o)}catch(l){c={jsonrpc:"2.0",id:typeof o?.id=="string"||typeof o?.id=="number"?o.id:null,error:{code:fq,message:`Internal error: ${l instanceof Error?l.message:String(l)}`}}}c!==null&&t(JSON.stringify(c)+`
|
|
714
|
-
`)}}a(Ove,"runStdioServer");function mq(r){return new de("mcp").description("Run an MCP (Model Context Protocol) stdio server exposing create_asset / create_effort tools backed by this CLI").option("--entry <path>","Path to the CLI entry script the tools invoke (defaults to this process's script)").action(async e=>{let t=e.entry??process.argv[1],n=new lv({runCli:pq(t),version:r??"unknown"});await Ove(n,process.stdin,i=>process.stdout.write(i))})}a(mq,"mcpCommand");function uv(r){let e=new de;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(r??"17.7.
|
|
714
|
+
`)}}a(Ove,"runStdioServer");function mq(r){return new de("mcp").description("Run an MCP (Model Context Protocol) stdio server exposing create_asset / create_effort tools backed by this CLI").option("--entry <path>","Path to the CLI entry script the tools invoke (defaults to this process's script)").action(async e=>{let t=e.entry??process.argv[1],n=new lv({runCli:pq(t),version:r??"unknown"});await Ove(n,process.stdin,i=>process.stdout.write(i))})}a(mq,"mcpCommand");function uv(r){let e=new de;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(r??"17.7.47"),e.addCommand(MV()),e.addCommand(KV()),e.addCommand(_7()),e.addCommand(v7()),e.addCommand(q7()),e.addCommand(T7()),e.addCommand(O7()),e.addCommand(x7()),e.addCommand(J7()),e.addCommand(nV()),e.addCommand(wV()),e.addCommand(IV()),e.addCommand(xV()),e.addCommand(PV()),e.addCommand(FV()),e.addCommand(DV()),e.addCommand(LV()),e.addCommand(yG()),e.addCommand(SG()),e.addCommand(zG()),e.addCommand(HG()),e.addCommand(QG()),e.addCommand(JG()),e.addCommand(tq()),e.addCommand(NG()),e.addCommand(GG()),e.addCommand(rq()),e.addCommand(mq(r??"17.7.47")),e}a(uv,"createProgram");uv().parse();0&&(module.exports={createProgram});
|
|
715
715
|
/*! Bundled license information:
|
|
716
716
|
|
|
717
717
|
reflect-metadata/Reflect.js:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitelev/exocortex-cli",
|
|
3
|
-
"version": "17.7.
|
|
3
|
+
"version": "17.7.47",
|
|
4
4
|
"description": "CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"@types/jest": "^30.0.0",
|
|
68
68
|
"@types/node": "^22.20.1",
|
|
69
69
|
"esbuild": "^0.28.2",
|
|
70
|
-
"jest": "^30.
|
|
70
|
+
"jest": "^30.5.2",
|
|
71
71
|
"reflect-metadata": "^0.2.2",
|
|
72
|
-
"ts-jest": "^29.4.
|
|
72
|
+
"ts-jest": "^29.4.14",
|
|
73
73
|
"tsyringe": "^4.8.0",
|
|
74
74
|
"typescript": "^5.9.3"
|
|
75
75
|
}
|