dts-linter 0.3.11-beta1 → 0.3.11-beta2
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.
|
@@ -11,7 +11,7 @@ License: MIT
|
|
|
11
11
|
|
|
12
12
|
----------------------------------------------------------------------
|
|
13
13
|
|
|
14
|
-
devicetree-language-server@0.8.0-
|
|
14
|
+
devicetree-language-server@0.8.0-beta3
|
|
15
15
|
License: Apache-2.0
|
|
16
16
|
Repository: https://github.com/kylebonnici/dts-lsp
|
|
17
17
|
|
|
@@ -23,7 +23,7 @@ Repository: https://github.com/kpdecker/jsdiff
|
|
|
23
23
|
|
|
24
24
|
----------------------------------------------------------------------
|
|
25
25
|
|
|
26
|
-
dts-linter@0.3.11-
|
|
26
|
+
dts-linter@0.3.11-beta2
|
|
27
27
|
License: Apache-2.0
|
|
28
28
|
Repository: https://github.com/kylebonnici/dts-linter
|
|
29
29
|
|
package/dist/dts-linter.js
CHANGED
|
@@ -49,7 +49,7 @@ ${JSON.stringify(h,null,4)}`);let v=h;if(X.string(v.id)||X.number(v.id)){let C=v
|
|
|
49
49
|
`).map(n=>n+`
|
|
50
50
|
`);return e?t.pop():t.push(t.pop().slice(0,-1)),t}var Nr=(i,e,t)=>{let n=i instanceof RegExp?Ca(i,t):i,s=e instanceof RegExp?Ca(e,t):e,r=n!==null&&s!=null&&Hh(n,s,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+n.length,r[1]),post:t.slice(r[1]+s.length)}},Ca=(i,e)=>{let t=e.match(i);return t?t[0]:null},Hh=(i,e,t)=>{let n,s,r,o,a,c=t.indexOf(i),l=t.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(i===e)return[c,l];for(n=[],r=t.length;u>=0&&!a;){if(u===c)n.push(u),c=t.indexOf(i,u+1);else if(n.length===1){let d=n.pop();d!==void 0&&(a=[d,l])}else s=n.pop(),s!==void 0&&s<r&&(r=s,o=l),l=t.indexOf(e,u+1);u=c<l&&c>=0?c:l}n.length&&o!==void 0&&(a=[r,o])}return a};var Ta="\0SLASH"+Math.random()+"\0",Ra="\0OPEN"+Math.random()+"\0",jr="\0CLOSE"+Math.random()+"\0",Oa="\0COMMA"+Math.random()+"\0",Aa="\0PERIOD"+Math.random()+"\0",Jh=new RegExp(Ta,"g"),Xh=new RegExp(Ra,"g"),Yh=new RegExp(jr,"g"),Qh=new RegExp(Oa,"g"),Kh=new RegExp(Aa,"g"),ed=/\\\\/g,td=/\\{/g,nd=/\\}/g,id=/\\,/g,sd=/\\./g;function Pr(i){return isNaN(i)?i.charCodeAt(0):parseInt(i,10)}function rd(i){return i.replace(ed,Ta).replace(td,Ra).replace(nd,jr).replace(id,Oa).replace(sd,Aa)}function od(i){return i.replace(Jh,"\\").replace(Xh,"{").replace(Yh,"}").replace(Qh,",").replace(Kh,".")}function Na(i){if(!i)return[""];let e=[],t=Nr("{","}",i);if(!t)return i.split(",");let{pre:n,body:s,post:r}=t,o=n.split(",");o[o.length-1]+="{"+s+"}";let a=Na(r);return r.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function Pa(i){return i?(i.slice(0,2)==="{}"&&(i="\\{\\}"+i.slice(2)),qn(rd(i),!0).map(od)):[]}function ad(i){return"{"+i+"}"}function cd(i){return/^-?0\d/.test(i)}function ld(i,e){return i<=e}function ud(i,e){return i>=e}function qn(i,e){let t=[],n=Nr("{","}",i);if(!n)return[i];let s=n.pre,r=n.post.length?qn(n.post,!1):[""];if(/\$$/.test(n.pre))for(let o=0;o<r.length;o++){let a=s+"{"+n.body+"}"+r[o];t.push(a)}else{let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),c=o||a,l=n.body.indexOf(",")>=0;if(!c&&!l)return n.post.match(/,(?!,).*\}/)?(i=n.pre+"{"+n.body+jr+n.post,qn(i)):[i];let u;if(c)u=n.body.split(/\.\./);else if(u=Na(n.body),u.length===1&&u[0]!==void 0&&(u=qn(u[0],!1).map(ad),u.length===1))return r.map(p=>n.pre+u[0]+p);let d;if(c&&u[0]!==void 0&&u[1]!==void 0){let p=Pr(u[0]),f=Pr(u[1]),w=Math.max(u[0].length,u[1].length),g=u.length===3&&u[2]!==void 0?Math.abs(Pr(u[2])):1,k=ld;f<p&&(g*=-1,k=ud);let x=u.some(cd);d=[];for(let b=p;k(b,f);b+=g){let S;if(a)S=String.fromCharCode(b),S==="\\"&&(S="");else if(S=String(b),x){let O=w-S.length;if(O>0){let B=new Array(O+1).join("0");b<0?S="-"+B+S.slice(1):S=B+S}}d.push(S)}}else{d=[];for(let p=0;p<u.length;p++)d.push.apply(d,qn(u[p],!1))}for(let p=0;p<d.length;p++)for(let f=0;f<r.length;f++){let w=s+d[p]+r[f];(!e||c||w)&&t.push(w)}}return t}var Bn=i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>65536)throw new TypeError("pattern is too long")};var hd={"[: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]},Un=i=>i.replace(/[[\]\\-]/g,"\\$&"),dd=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ja=i=>i.join(""),Ma=(i,e)=>{let t=e;if(i.charAt(t)!=="[")throw new Error("not in a brace expression");let n=[],s=[],r=t+1,o=!1,a=!1,c=!1,l=!1,u=t,d="";e:for(;r<i.length;){let g=i.charAt(r);if((g==="!"||g==="^")&&r===t+1){l=!0,r++;continue}if(g==="]"&&o&&!c){u=r+1;break}if(o=!0,g==="\\"&&!c){c=!0,r++;continue}if(g==="["&&!c){for(let[k,[E,x,b]]of Object.entries(hd))if(i.startsWith(k,r)){if(d)return["$.",!1,i.length-t,!0];r+=k.length,b?s.push(E):n.push(E),a=a||x;continue e}}if(c=!1,d){g>d?n.push(Un(d)+"-"+Un(g)):g===d&&n.push(Un(g)),d="",r++;continue}if(i.startsWith("-]",r+1)){n.push(Un(g+"-")),r+=2;continue}if(i.startsWith("-",r+1)){d=g,r+=2;continue}n.push(Un(g)),r++}if(u<r)return["",!1,0,!1];if(!n.length&&!s.length)return["$.",!1,i.length-t,!0];if(s.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!l){let g=n[0].length===2?n[0].slice(-1):n[0];return[dd(g),!1,u-t,!1]}let p="["+(l?"^":"")+ja(n)+"]",f="["+(l?"":"^")+ja(s)+"]";return[n.length&&s.length?"("+p+"|"+f+")":n.length?p:f,a,u-t,!0]};var ze=(i,{windowsPathsNoEscape:e=!1,magicalBraces:t=!0}={})=>t?e?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):e?i.replace(/\[([^\/\\{}])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");var fd=new Set(["!","?","+","*","@"]),La=i=>fd.has(i),pd="(?!(?:^|/)\\.\\.?(?:$|/))",Mi="(?!\\.)",md=new Set(["[","."]),gd=new Set(["..","."]),yd=new Set("().*{}+?[]^$\\!"),wd=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Mr="[^/]",Ia=Mr+"*?",Da=Mr+"+?",gn=class i{type;#e;#n;#r=!1;#s=[];#o;#b;#y;#u=!1;#a;#d;#h=!1;constructor(e,t,n={}){this.type=e,e&&(this.#n=!0),this.#o=t,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?n:this.#e.#a,this.#y=this.#e===this?[]:this.#e.#y,e==="!"&&!this.#e.#u&&this.#y.push(this),this.#b=this.#o?this.#o.#s.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let e of this.#s)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#d!==void 0?this.#d:this.type?this.#d=this.type+"("+this.#s.map(e=>String(e)).join("|")+")":this.#d=this.#s.map(e=>String(e)).join("")}#c(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#y.pop();){if(e.type!=="!")continue;let t=e,n=t.#o;for(;n;){for(let s=t.#b+1;!n.type&&s<n.#s.length;s++)for(let r of e.#s){if(typeof r=="string")throw new Error("string part in extglob AST??");r.copyIn(n.#s[s])}t=n,n=t.#o}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof i&&t.#o===this))throw new Error("invalid part: "+t);this.#s.push(t)}}toJSON(){let e=this.type===null?this.#s.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#s.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#b===0)return!0;let e=this.#o;for(let t=0;t<this.#b;t++){let n=e.#s[t];if(!(n instanceof i&&n.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#s.length:0;return this.#b===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new i(this.type,e);for(let n of this.#s)t.copyIn(n);return t}static#i(e,t,n,s){let r=!1,o=!1,a=-1,c=!1;if(t.type===null){let f=n,w="";for(;f<e.length;){let g=e.charAt(f++);if(r||g==="\\"){r=!r,w+=g;continue}if(o){f===a+1?(g==="^"||g==="!")&&(c=!0):g==="]"&&!(f===a+2&&c)&&(o=!1),w+=g;continue}else if(g==="["){o=!0,a=f,c=!1,w+=g;continue}if(!s.noext&&La(g)&&e.charAt(f)==="("){t.push(w),w="";let k=new i(g,t);f=i.#i(e,k,f,s),t.push(k);continue}w+=g}return t.push(w),f}let l=n+1,u=new i(null,t),d=[],p="";for(;l<e.length;){let f=e.charAt(l++);if(r||f==="\\"){r=!r,p+=f;continue}if(o){l===a+1?(f==="^"||f==="!")&&(c=!0):f==="]"&&!(l===a+2&&c)&&(o=!1),p+=f;continue}else if(f==="["){o=!0,a=l,c=!1,p+=f;continue}if(La(f)&&e.charAt(l)==="("){u.push(p),p="";let w=new i(f,u);u.push(w),l=i.#i(e,w,l,s);continue}if(f==="|"){u.push(p),p="",d.push(u),u=new i(null,t);continue}if(f===")")return p===""&&t.#s.length===0&&(t.#h=!0),u.push(p),p="",t.push(...d,u),l;p+=f}return t.type=null,t.#n=void 0,t.#s=[e.substring(n-1)],l}static fromGlob(e,t={}){let n=new i(null,void 0,t);return i.#i(e,n,0,t),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,s,r]=this.toRegExpSource();if(!(s||this.#n||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#a.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#a}toRegExpSource(e){let t=e??!!this.#a.dot;if(this.#e===this&&this.#c(),!this.type){let c=this.isStart()&&this.isEnd()&&!this.#s.some(f=>typeof f!="string"),l=this.#s.map(f=>{let[w,g,k,E]=typeof f=="string"?i.#_(f,this.#n,c):f.toRegExpSource(e);return this.#n=this.#n||k,this.#r=this.#r||E,w}).join(""),u="";if(this.isStart()&&typeof this.#s[0]=="string"&&!(this.#s.length===1&&gd.has(this.#s[0]))){let w=md,g=t&&w.has(l.charAt(0))||l.startsWith("\\.")&&w.has(l.charAt(2))||l.startsWith("\\.\\.")&&w.has(l.charAt(4)),k=!t&&!e&&w.has(l.charAt(0));u=g?pd:k?Mi:""}let d="";return this.isEnd()&&this.#e.#u&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[u+l+d,ze(l),this.#n=!!this.#n,this.#r]}let n=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",r=this.#f(t);if(this.isStart()&&this.isEnd()&&!r&&this.type!=="!"){let c=this.toString();return this.#s=[c],this.type=null,this.#n=void 0,[c,ze(this.toString()),!1,!1]}let o=!n||e||t||!Mi?"":this.#f(!0);o===r&&(o=""),o&&(r=`(?:${r})(?:${o})*?`);let a="";if(this.type==="!"&&this.#h)a=(this.isStart()&&!t?Mi:"")+Da;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Mi:"")+Ia+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=s+r+c}return[a,ze(r),this.#n=!!this.#n,this.#r]}#f(e){return this.#s.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[n,s,r,o]=t.toRegExpSource(e);return this.#r=this.#r||o,n}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#_(e,t,n=!1){let s=!1,r="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(s){s=!1,r+=(yd.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?r+="\\\\":s=!0;continue}if(c==="["){let[l,u,d,p]=Ma(e,a);if(d){r+=l,o=o||u,a+=d-1,t=t||p;continue}}if(c==="*"){r+=n&&e==="*"?Da:Ia,t=!0;continue}if(c==="?"){r+=Mr,t=!0;continue}r+=wd(c)}return[r,ze(e),!!t,o]}};var yn=(i,{windowsPathsNoEscape:e=!1,magicalBraces:t=!1}={})=>t?e?i.replace(/[?*()[\]{}]/g,"[$&]"):i.replace(/[?*()[\]\\{}]/g,"\\$&"):e?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&");var _e=(i,e,t={})=>(Bn(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Ae(e,t).match(i)),vd=/^\*+([^+@!?\*\[\(]*)$/,bd=i=>e=>!e.startsWith(".")&&e.endsWith(i),_d=i=>e=>e.endsWith(i),xd=i=>(i=i.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(i)),Sd=i=>(i=i.toLowerCase(),e=>e.toLowerCase().endsWith(i)),kd=/^\*+\.\*+$/,Ed=i=>!i.startsWith(".")&&i.includes("."),Cd=i=>i!=="."&&i!==".."&&i.includes("."),Td=/^\.\*+$/,Rd=i=>i!=="."&&i!==".."&&i.startsWith("."),Od=/^\*+$/,Ad=i=>i.length!==0&&!i.startsWith("."),Nd=i=>i.length!==0&&i!=="."&&i!=="..",Pd=/^\?+([^+@!?\*\[\(]*)?$/,jd=([i,e=""])=>{let t=Wa([i]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},Md=([i,e=""])=>{let t=za([i]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},Ld=([i,e=""])=>{let t=za([i]);return e?n=>t(n)&&n.endsWith(e):t},Id=([i,e=""])=>{let t=Wa([i]);return e?n=>t(n)&&n.endsWith(e):t},Wa=([i])=>{let e=i.length;return t=>t.length===e&&!t.startsWith(".")},za=([i])=>{let e=i.length;return t=>t.length===e&&t!=="."&&t!==".."},qa=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",$a={win32:{sep:"\\"},posix:{sep:"/"}},Dd=qa==="win32"?$a.win32.sep:$a.posix.sep;_e.sep=Dd;var de=Symbol("globstar **");_e.GLOBSTAR=de;var $d="[^/]",Fd=$d+"*?",Wd="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",zd="(?:(?!(?:\\/|^)\\.).)*?",qd=(i,e={})=>t=>_e(t,i,e);_e.filter=qd;var Ie=(i,e={})=>Object.assign({},i,e),Bd=i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return _e;let e=_e;return Object.assign((n,s,r={})=>e(n,s,Ie(i,r)),{Minimatch:class extends e.Minimatch{constructor(s,r={}){super(s,Ie(i,r))}static defaults(s){return e.defaults(Ie(i,s)).Minimatch}},AST:class extends e.AST{constructor(s,r,o={}){super(s,r,Ie(i,o))}static fromGlob(s,r={}){return e.AST.fromGlob(s,Ie(i,r))}},unescape:(n,s={})=>e.unescape(n,Ie(i,s)),escape:(n,s={})=>e.escape(n,Ie(i,s)),filter:(n,s={})=>e.filter(n,Ie(i,s)),defaults:n=>e.defaults(Ie(i,n)),makeRe:(n,s={})=>e.makeRe(n,Ie(i,s)),braceExpand:(n,s={})=>e.braceExpand(n,Ie(i,s)),match:(n,s,r={})=>e.match(n,s,Ie(i,r)),sep:e.sep,GLOBSTAR:de})};_e.defaults=Bd;var Ba=(i,e={})=>(Bn(i),e.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:Pa(i));_e.braceExpand=Ba;var Ud=(i,e={})=>new Ae(i,e).makeRe();_e.makeRe=Ud;var Vd=(i,e,t={})=>{let n=new Ae(e,t);return i=i.filter(s=>n.match(s)),n.options.nonull&&!i.length&&i.push(e),i};_e.match=Vd;var Fa=/[?*]|[+@!]\(.*?\)|\[|\]/,Zd=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ae=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){Bn(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||qa,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!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=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let s=this.globParts.map((r,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=r[0]===""&&r[1]===""&&(r[2]==="?"||!Fa.test(r[2]))&&!Fa.test(r[3]),l=/^[a-z]:/i.test(r[0]);if(c)return[...r.slice(0,4),...r.slice(4).map(u=>this.parse(u))];if(l)return[r[0],...r.slice(1).map(u=>this.parse(u))]}return r.map(c=>this.parse(c))});if(this.debug(this.pattern,s),this.set=s.filter(r=>r.indexOf(!1)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){let o=this.set[r];o[0]===""&&o[1]===""&&this.globParts[r][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=0;n<e.length;n++)for(let s=0;s<e[n].length;s++)e[n][s]==="**"&&(e[n][s]="*");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 s=n;for(;t[s+1]==="**";)s++;s!==n&&t.splice(n,s-n)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((n,s)=>{let r=n[n.length-1];return s==="**"&&r==="**"?n:s===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(n.pop(),n):(n.push(s),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 s=1;s<e.length-1;s++){let r=e[s];s===1&&r===""&&e[0]===""||(r==="."||r==="")&&(t=!0,e.splice(s,1),s--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let s=e[n-1];s&&s!=="."&&s!==".."&&s!=="**"&&(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 s=-1;for(;(s=n.indexOf("**",s+1))!==-1;){let o=s;for(;n[o+1]==="**";)o++;o>s&&n.splice(s+1,o-s);let a=n[s+1],c=n[s+2],l=n[s+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;t=!0,n.splice(s,1);let u=n.slice(0);u[s]="**",e.push(u),s--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(t=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(t=!0,n.pop())}let r=0;for(;(r=n.indexOf("..",r+1))!==-1;){let o=n[r-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let c=r===1&&n[r+1]==="**"?["."]:[];n.splice(r-1,2,...c),n.length===0&&n.push(""),r-=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 s=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(s){e[t]=[],e[n]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,n=!1){let s=0,r=0,o=[],a="";for(;s<e.length&&r<t.length;)if(e[s]===t[r])o.push(a==="b"?t[r]:e[s]),s++,r++;else if(n&&e[s]==="**"&&t[r]===e[s+1])o.push(e[s]),s++;else if(n&&t[r]==="**"&&e[s]===t[r+1])o.push(t[r]),r++;else if(e[s]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(a==="b")return!1;a="a",o.push(e[s]),s++,r++}else if(t[r]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(a==="a")return!1;a="b",o.push(t[r]),s++,r++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let s=this.options;if(this.isWindows){let g=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),k=!g&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),E=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),x=!E&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),b=k?3:g?0:void 0,S=x?3:E?0:void 0;if(typeof b=="number"&&typeof S=="number"){let[O,B]=[e[b],t[S]];O.toLowerCase()===B.toLowerCase()&&(t[S]=O,S>b?t=t.slice(S):b>S&&(e=e.slice(b)))}}let{optimizationLevel:r=1}=this.options;r>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,c=e.length,l=t.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=t[a],d=e[o];if(this.debug(t,u,d),u===!1)return!1;if(u===de){this.debug("GLOBSTAR",[t,u,d]);var p=o,f=a+1;if(f===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!s.dot&&e[o].charAt(0)===".")return!1;return!0}for(;p<c;){var w=e[p];if(this.debug(`
|
|
51
51
|
globstar while`,e,p,t,f,w),this.matchOne(e.slice(p),t.slice(f),n))return this.debug("globstar found match!",p,c,w),!0;if(w==="."||w===".."||!s.dot&&w.charAt(0)==="."){this.debug("dot detected!",e,p,t,f);break}this.debug("globstar swallow a segment, and continue"),p++}return!!(n&&(this.debug(`
|
|
52
|
-
>>> no match, partial?`,e,p,t,f),p===c))}let g;if(typeof u=="string"?(g=d===u,this.debug("string match",u,d,g)):(g=u.test(d),this.debug("pattern match",u,d,g)),!g)return!1}if(o===c&&a===l)return!0;if(o===c)return n;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return Ba(this.pattern,this.options)}parse(e){Bn(e);let t=this.options;if(e==="**")return de;if(e==="")return"";let n,s=null;(n=e.match(Od))?s=t.dot?Nd:Ad:(n=e.match(vd))?s=(t.nocase?t.dot?Sd:xd:t.dot?_d:bd)(n[1]):(n=e.match(Pd))?s=(t.nocase?t.dot?Md:jd:t.dot?Ld:Id)(n):(n=e.match(kd))?s=t.dot?Cd:Ed:(n=e.match(Td))&&(s=Rd);let r=gn.fromGlob(e,this.options).toMMPattern();return s&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:s}),r}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?Fd:t.dot?Wd:zd,s=new Set(t.nocase?["i"]:[]),r=e.map(c=>{let l=c.map(d=>{if(d instanceof RegExp)for(let p of d.flags.split(""))s.add(p);return typeof d=="string"?Zd(d):d===de?de:d._src});l.forEach((d,p)=>{let f=l[p+1],w=l[p-1];d!==de||w===de||(w===void 0?f!==void 0&&f!==de?l[p+1]="(?:\\/|"+n+"\\/)?"+f:l[p]=n:f===void 0?l[p-1]=w+"(?:\\/|\\/"+n+")?":f!==de&&(l[p-1]=w+"(?:\\/|\\/"+n+"\\/)"+f,l[p+1]=de))});let u=l.filter(d=>d!==de);if(this.partial&&u.length>=1){let d=[];for(let p=1;p<=u.length;p++)d.push(u.slice(0,p).join("/"));return"(?:"+d.join("|")+")"}return u.join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];r="^"+o+r+a+"$",this.partial&&(r="^(?:\\/|"+o+r.slice(1,-1)+a+")$"),this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,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 s=this.slashSplit(e);this.debug(this.pattern,"split",s);let r=this.set;this.debug(this.pattern,"set",r);let o=s[s.length-1];if(!o)for(let a=s.length-2;!o&&a>=0;a--)o=s[a];for(let a=0;a<r.length;a++){let c=r[a],l=s;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 _e.defaults(e).Minimatch}};_e.AST=gn;_e.Minimatch=Ae;_e.escape=yn;_e.unescape=ze;var fc=require("node:url");var Gd=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Va=new Set,Lr=typeof process=="object"&&process?process:{},Za=(i,e,t,n)=>{typeof Lr.emitWarning=="function"?Lr.emitWarning(i,e,t,n):console.error(`[${t}] ${e}: ${i}`)},Li=globalThis.AbortController,Ua=globalThis.AbortSignal;if(typeof Li>"u"){Ua=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,s){this._onabort.push(s)}},Li=class{constructor(){e()}signal=new Ua;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let s of this.signal._onabort)s(n);this.signal.onabort?.(n)}}};let i=Lr.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{i&&(i=!1,Za("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var Hd=i=>!Va.has(i),bm=Symbol("type"),bt=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),Ga=i=>bt(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?wn:null:null,wn=class extends Array{constructor(e){super(e),this.fill(0)}},Ir=class i{heap;length;static#e=!1;static create(e){let t=Ga(e);if(!t)return[];i.#e=!0;let n=new i(e,t);return i.#e=!1,n}constructor(e,t){if(!i.#e)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]}},Zt=class i{#e;#n;#r;#s;#o;#b;#y;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#d;#h;#c;#i;#f;#_;#v;#p;#R;#m;#k;#E;#g;#w;#x;#C;#t;#M;static unsafeExposeInternals(e){return{starts:e.#E,ttls:e.#g,autopurgeTimers:e.#w,sizes:e.#k,keyMap:e.#h,keyList:e.#c,valList:e.#i,next:e.#f,prev:e.#_,get head(){return e.#v},get tail(){return e.#p},free:e.#R,isBackgroundFetch:t=>e.#l(t),backgroundFetch:(t,n,s,r)=>e.#q(t,n,s,r),moveToTail:t=>e.#I(t),indexes:t=>e.#A(t),rindexes:t=>e.#N(t),isStale:t=>e.#S(t)}}get max(){return this.#e}get maxSize(){return this.#n}get calculatedSize(){return this.#d}get size(){return this.#a}get fetchMethod(){return this.#b}get memoMethod(){return this.#y}get dispose(){return this.#r}get onInsert(){return this.#s}get disposeAfter(){return this.#o}constructor(e){let{max:t=0,ttl:n,ttlResolution:s=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,onInsert:u,disposeAfter:d,noDisposeOnSet:p,noUpdateTTL:f,maxSize:w=0,maxEntrySize:g=0,sizeCalculation:k,fetchMethod:E,memoMethod:x,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:B,ignoreFetchAbort:K,perf:pe}=e;if(pe!==void 0&&typeof pe?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=pe??Gd,t!==0&&!bt(t))throw new TypeError("max option must be a nonnegative integer");let Te=t?Ga(t):Array;if(!Te)throw new Error("invalid max value: "+t);if(this.#e=t,this.#n=w,this.maxEntrySize=g||this.#n,this.sizeCalculation=k,this.sizeCalculation){if(!this.#n&&!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(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#y=x,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#b=E,this.#C=!!E,this.#h=new Map,this.#c=new Array(t).fill(void 0),this.#i=new Array(t).fill(void 0),this.#f=new Te(t),this.#_=new Te(t),this.#v=0,this.#p=0,this.#R=Ir.create(t),this.#a=0,this.#d=0,typeof l=="function"&&(this.#r=l),typeof u=="function"&&(this.#s=u),typeof d=="function"?(this.#o=d,this.#m=[]):(this.#o=void 0,this.#m=void 0),this.#x=!!this.#r,this.#M=!!this.#s,this.#t=!!this.#o,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!B,this.ignoreFetchAbort=!!K,this.maxEntrySize!==0){if(this.#n!==0&&!bt(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!bt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#U()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=bt(s)||s===0?s:1,this.ttlAutopurge=!!r,this.ttl=n||0,this.ttl){if(!bt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#e===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#n){let et="LRU_CACHE_UNBOUNDED";Hd(et)&&(Va.add(et),Za("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",et,i))}}getRemainingTTL(e){return this.#h.has(e)?1/0:0}#P(){let e=new wn(this.#e),t=new wn(this.#e);this.#g=e,this.#E=t;let n=this.ttlAutopurge?new Array(this.#e):void 0;this.#w=n,this.#$=(o,a,c=this.#u.now())=>{if(t[o]=a!==0?c:0,e[o]=a,n?.[o]&&(clearTimeout(n[o]),n[o]=void 0),a!==0&&n){let l=setTimeout(()=>{this.#S(o)&&this.#O(this.#c[o],"expire")},a+1);l.unref&&l.unref(),n[o]=l}},this.#T=o=>{t[o]=e[o]!==0?this.#u.now():0},this.#j=(o,a)=>{if(e[a]){let c=e[a],l=t[a];if(!c||!l)return;o.ttl=c,o.start=l,o.now=s||r();let u=o.now-l;o.remainingTTL=c-u}};let s=0,r=()=>{let o=this.#u.now();if(this.ttlResolution>0){s=o;let a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref()}return o};this.getRemainingTTL=o=>{let a=this.#h.get(o);if(a===void 0)return 0;let c=e[a],l=t[a];if(!c||!l)return 1/0;let u=(s||r())-l;return c-u},this.#S=o=>{let a=t[o],c=e[o];return!!c&&!!a&&(s||r())-a>c}}#T=()=>{};#j=()=>{};#$=()=>{};#S=()=>!1;#U(){let e=new wn(this.#e);this.#d=0,this.#k=e,this.#D=t=>{this.#d-=e[t],e[t]=0},this.#F=(t,n,s,r)=>{if(this.#l(n))return 0;if(!bt(s))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(s=r(n,t),!bt(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#L=(t,n,s)=>{if(e[t]=n,this.#n){let r=this.#n-e[t];for(;this.#d>r;)this.#z(!0)}this.#d+=e[t],s&&(s.entrySize=n,s.totalCalculatedSize=this.#d)}}#D=e=>{};#L=(e,t,n)=>{};#F=(e,t,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#p;!(!this.#W(t)||((e||!this.#S(t))&&(yield t),t===this.#v));)t=this.#_[t]}*#N({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#v;!(!this.#W(t)||((e||!this.#S(t))&&(yield t),t===this.#p));)t=this.#f[t]}#W(e){return e!==void 0&&this.#h.get(this.#c[e])===e}*entries(){for(let e of this.#A())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*rentries(){for(let e of this.#N())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*keys(){for(let e of this.#A()){let t=this.#c[e];t!==void 0&&!this.#l(this.#i[e])&&(yield t)}}*rkeys(){for(let e of this.#N()){let t=this.#c[e];t!==void 0&&!this.#l(this.#i[e])&&(yield t)}}*values(){for(let e of this.#A())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#N())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let n of this.#A()){let s=this.#i[n],r=this.#l(s)?s.__staleWhileFetching:s;if(r!==void 0&&e(r,this.#c[n],this))return this.get(this.#c[n],t)}}forEach(e,t=this){for(let n of this.#A()){let s=this.#i[n],r=this.#l(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#c[n],this)}}rforEach(e,t=this){for(let n of this.#N()){let s=this.#i[n],r=this.#l(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#c[n],this)}}purgeStale(){let e=!1;for(let t of this.#N({allowStale:!0}))this.#S(t)&&(this.#O(this.#c[t],"expire"),e=!0);return e}info(e){let t=this.#h.get(e);if(t===void 0)return;let n=this.#i[t],s=this.#l(n)?n.__staleWhileFetching:n;if(s===void 0)return;let r={value:s};if(this.#g&&this.#E){let o=this.#g[t],a=this.#E[t];if(o&&a){let c=o-(this.#u.now()-a);r.ttl=c,r.start=Date.now()}}return this.#k&&(r.size=this.#k[t]),r}dump(){let e=[];for(let t of this.#A({allowStale:!0})){let n=this.#c[t],s=this.#i[t],r=this.#l(s)?s.__staleWhileFetching:s;if(r===void 0||n===void 0)continue;let o={value:r};if(this.#g&&this.#E){o.ttl=this.#g[t];let a=this.#u.now()-this.#E[t];o.start=Math.floor(Date.now()-a)}this.#k&&(o.size=this.#k[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let s=Date.now()-n.start;n.start=this.#u.now()-s}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,u=this.#F(e,t,n.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#O(e,"set"),this;let d=this.#a===0?void 0:this.#h.get(e);if(d===void 0)d=this.#a===0?this.#p:this.#R.length!==0?this.#R.pop():this.#a===this.#e?this.#z(!1):this.#a,this.#c[d]=e,this.#i[d]=t,this.#h.set(e,d),this.#f[this.#p]=d,this.#_[d]=this.#p,this.#p=d,this.#a++,this.#L(d,u,c),c&&(c.set="add"),l=!1,this.#M&&this.#s?.(t,e,"add");else{this.#I(d);let p=this.#i[d];if(t!==p){if(this.#C&&this.#l(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=p;f!==void 0&&!o&&(this.#x&&this.#r?.(f,e,"set"),this.#t&&this.#m?.push([f,e,"set"]))}else o||(this.#x&&this.#r?.(p,e,"set"),this.#t&&this.#m?.push([p,e,"set"]));if(this.#D(d),this.#L(d,u,c),this.#i[d]=t,c){c.set="replace";let f=p&&this.#l(p)?p.__staleWhileFetching:p;f!==void 0&&(c.oldValue=f)}}else c&&(c.set="update");this.#M&&this.onInsert?.(t,e,t===p?"update":"replace")}if(s!==0&&!this.#g&&this.#P(),this.#g&&(l||this.#$(d,s,r),c&&this.#j(c,d)),!o&&this.#t&&this.#m){let p=this.#m,f;for(;f=p?.shift();)this.#o?.(...f)}return this}pop(){try{for(;this.#a;){let e=this.#i[this.#v];if(this.#z(!0),this.#l(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#t&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#o?.(...t)}}}#z(e){let t=this.#v,n=this.#c[t],s=this.#i[t];return this.#C&&this.#l(s)?s.__abortController.abort(new Error("evicted")):(this.#x||this.#t)&&(this.#x&&this.#r?.(s,n,"evict"),this.#t&&this.#m?.push([s,n,"evict"])),this.#D(t),this.#w?.[t]&&(clearTimeout(this.#w[t]),this.#w[t]=void 0),e&&(this.#c[t]=void 0,this.#i[t]=void 0,this.#R.push(t)),this.#a===1?(this.#v=this.#p=0,this.#R.length=0):this.#v=this.#f[t],this.#h.delete(n),this.#a--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=t,r=this.#h.get(e);if(r!==void 0){let o=this.#i[r];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#S(r))s&&(s.has="stale",this.#j(s,r));else return n&&this.#T(r),s&&(s.has="hit",this.#j(s,r)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,s=this.#h.get(e);if(s===void 0||!n&&this.#S(s))return;let r=this.#i[s];return this.#l(r)?r.__staleWhileFetching:r}#q(e,t,n,s){let r=t===void 0?void 0:this.#i[t];if(this.#l(r))return r;let o=new Li,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:s},l=(g,k=!1)=>{let{aborted:E}=o.signal,x=n.ignoreFetchAbort&&g!==void 0;if(n.status&&(E&&!k?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,x&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),E&&!x&&!k)return d(o.signal.reason);let b=f,S=this.#i[t];return(S===f||x&&k&&S===void 0)&&(g===void 0?b.__staleWhileFetching!==void 0?this.#i[t]=b.__staleWhileFetching:this.#O(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,g,c.options))),g},u=g=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=g),d(g)),d=g=>{let{aborted:k}=o.signal,E=k&&n.allowStaleOnFetchAbort,x=E||n.allowStaleOnFetchRejection,b=x||n.noDeleteOnFetchRejection,S=f;if(this.#i[t]===f&&(!b||S.__staleWhileFetching===void 0?this.#O(e,"fetch"):E||(this.#i[t]=S.__staleWhileFetching)),x)return n.status&&S.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),S.__staleWhileFetching;if(S.__returned===S)throw g},p=(g,k)=>{let E=this.#b?.(e,r,c);E&&E instanceof Promise&&E.then(x=>g(x===void 0?void 0:x),k),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(g(void 0),n.allowStaleOnFetchAbort&&(g=x=>l(x,!0)))})};n.status&&(n.status.fetchDispatched=!0);let f=new Promise(p).then(l,u),w=Object.assign(f,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return t===void 0?(this.set(e,w,{...c.options,status:void 0}),t=this.#h.get(e)):this.#i[t]=w,w}#l(e){if(!this.#C)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Li}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:w=this.allowStaleOnFetchAbort,context:g,forceRefresh:k=!1,status:E,signal:x}=t;if(!this.#C)return E&&(E.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:r,status:E});let b={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:w,ignoreFetchAbort:f,status:E,signal:x},S=this.#h.get(e);if(S===void 0){E&&(E.fetch="miss");let O=this.#q(e,S,b,g);return O.__returned=O}else{let O=this.#i[S];if(this.#l(O)){let et=n&&O.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",et&&(E.returnedStale=!0)),et?O.__staleWhileFetching:O.__returned=O}let B=this.#S(S);if(!k&&!B)return E&&(E.fetch="hit"),this.#I(S),s&&this.#T(S),E&&this.#j(E,S),O;let K=this.#q(e,S,b,g),Te=K.__staleWhileFetching!==void 0&&n;return E&&(E.fetch=B?"stale":"refresh",Te&&B&&(E.returnedStale=!0)),Te?K.__staleWhileFetching:K.__returned=K}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let n=this.#y;if(!n)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:r,...o}=t,a=this.get(e,o);if(!r&&a!==void 0)return a;let c=n(e,a,{options:o,context:s});return this.set(e,c,o),c}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=t,a=this.#h.get(e);if(a!==void 0){let c=this.#i[a],l=this.#l(c);return o&&this.#j(o,a),this.#S(a)?(o&&(o.get="stale"),l?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(r||this.#O(e,"expire"),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#I(a),s&&this.#T(a),c))}else o&&(o.get="miss")}#B(e,t){this.#_[t]=e,this.#f[e]=t}#I(e){e!==this.#p&&(e===this.#v?this.#v=this.#f[e]:this.#B(this.#_[e],this.#f[e]),this.#B(this.#p,e),this.#p=e)}delete(e){return this.#O(e,"delete")}#O(e,t){let n=!1;if(this.#a!==0){let s=this.#h.get(e);if(s!==void 0)if(this.#w?.[s]&&(clearTimeout(this.#w?.[s]),this.#w[s]=void 0),n=!0,this.#a===1)this.#V(t);else{this.#D(s);let r=this.#i[s];if(this.#l(r)?r.__abortController.abort(new Error("deleted")):(this.#x||this.#t)&&(this.#x&&this.#r?.(r,e,t),this.#t&&this.#m?.push([r,e,t])),this.#h.delete(e),this.#c[s]=void 0,this.#i[s]=void 0,s===this.#p)this.#p=this.#_[s];else if(s===this.#v)this.#v=this.#f[s];else{let o=this.#_[s];this.#f[o]=this.#f[s];let a=this.#f[s];this.#_[a]=this.#_[s]}this.#a--,this.#R.push(s)}}if(this.#t&&this.#m?.length){let s=this.#m,r;for(;r=s?.shift();)this.#o?.(...r)}return n}clear(){return this.#V("delete")}#V(e){for(let t of this.#N({allowStale:!0})){let n=this.#i[t];if(this.#l(n))n.__abortController.abort(new Error("deleted"));else{let s=this.#c[t];this.#x&&this.#r?.(n,s,e),this.#t&&this.#m?.push([n,s,e])}}if(this.#h.clear(),this.#i.fill(void 0),this.#c.fill(void 0),this.#g&&this.#E){this.#g.fill(0),this.#E.fill(0);for(let t of this.#w??[])t!==void 0&&clearTimeout(t);this.#w?.fill(void 0)}if(this.#k&&this.#k.fill(0),this.#v=0,this.#p=0,this.#R.length=0,this.#d=0,this.#a=0,this.#t&&this.#m){let t=this.#m,n;for(;n=t?.shift();)this.#o?.(...n)}}};var _n=require("node:path"),ic=require("node:url"),Ke=require("fs"),rf=ht(require("node:fs"),1),St=require("node:fs/promises");var qi=require("node:events"),Br=ht(require("node:stream"),1),Qa=require("node:string_decoder"),Ha=typeof process=="object"&&process?process:{stdout:null,stderr:null},Jd=i=>!!i&&typeof i=="object"&&(i instanceof xt||i instanceof Br.default||Xd(i)||Yd(i)),Xd=i=>!!i&&typeof i=="object"&&i instanceof qi.EventEmitter&&typeof i.pipe=="function"&&i.pipe!==Br.default.Writable.prototype.pipe,Yd=i=>!!i&&typeof i=="object"&&i instanceof qi.EventEmitter&&typeof i.write=="function"&&typeof i.end=="function",ot=Symbol("EOF"),at=Symbol("maybeEmitEnd"),_t=Symbol("emittedEnd"),Ii=Symbol("emittingEnd"),Vn=Symbol("emittedError"),Di=Symbol("closed"),Ja=Symbol("read"),$i=Symbol("flush"),Xa=Symbol("flushChunk"),qe=Symbol("encoding"),vn=Symbol("decoder"),oe=Symbol("flowing"),Zn=Symbol("paused"),bn=Symbol("resume"),ae=Symbol("buffer"),xe=Symbol("pipes"),ce=Symbol("bufferLength"),Dr=Symbol("bufferPush"),Fi=Symbol("bufferShift"),we=Symbol("objectMode"),te=Symbol("destroyed"),$r=Symbol("error"),Fr=Symbol("emitData"),Ya=Symbol("emitEnd"),Wr=Symbol("emitEnd2"),Ye=Symbol("async"),zr=Symbol("abort"),Wi=Symbol("aborted"),Gn=Symbol("signal"),Gt=Symbol("dataListeners"),Ne=Symbol("discarded"),Hn=i=>Promise.resolve().then(i),Qd=i=>i(),Kd=i=>i==="end"||i==="finish"||i==="prefinish",ef=i=>i instanceof ArrayBuffer||!!i&&typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,tf=i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),zi=class{src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[bn](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},qr=class extends zi{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}},nf=i=>!!i.objectMode,sf=i=>!i.objectMode&&!!i.encoding&&i.encoding!=="buffer",xt=class extends qi.EventEmitter{[oe]=!1;[Zn]=!1;[xe]=[];[ae]=[];[we];[qe];[Ye];[vn];[ot]=!1;[_t]=!1;[Ii]=!1;[Di]=!1;[Vn]=null;[ce]=0;[te]=!1;[Gn];[Wi]=!1;[Gt]=0;[Ne]=!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");nf(t)?(this[we]=!0,this[qe]=null):sf(t)?(this[qe]=t.encoding,this[we]=!1):(this[we]=!1,this[qe]=null),this[Ye]=!!t.async,this[vn]=this[qe]?new Qa.StringDecoder(this[qe]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[ae]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[xe]});let{signal:n}=t;n&&(this[Gn]=n,n.aborted?this[zr]():n.addEventListener("abort",()=>this[zr]()))}get bufferLength(){return this[ce]}get encoding(){return this[qe]}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[we]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Ye]}set async(e){this[Ye]=this[Ye]||!!e}[zr](){this[Wi]=!0,this.emit("abort",this[Gn]?.reason),this.destroy(this[Gn]?.reason)}get aborted(){return this[Wi]}set aborted(e){}write(e,t,n){if(this[Wi])return!1;if(this[ot])throw new Error("write after end");if(this[te])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 s=this[Ye]?Hn:Qd;if(!this[we]&&!Buffer.isBuffer(e)){if(tf(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(ef(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[we]?(this[oe]&&this[ce]!==0&&this[$i](!0),this[oe]?this.emit("data",e):this[Dr](e),this[ce]!==0&&this.emit("readable"),n&&s(n),this[oe]):e.length?(typeof e=="string"&&!(t===this[qe]&&!this[vn]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[qe]&&(e=this[vn].write(e)),this[oe]&&this[ce]!==0&&this[$i](!0),this[oe]?this.emit("data",e):this[Dr](e),this[ce]!==0&&this.emit("readable"),n&&s(n),this[oe]):(this[ce]!==0&&this.emit("readable"),n&&s(n),this[oe])}read(e){if(this[te])return null;if(this[Ne]=!1,this[ce]===0||e===0||e&&e>this[ce])return this[at](),null;this[we]&&(e=null),this[ae].length>1&&!this[we]&&(this[ae]=[this[qe]?this[ae].join(""):Buffer.concat(this[ae],this[ce])]);let t=this[Ja](e||null,this[ae][0]);return this[at](),t}[Ja](e,t){if(this[we])this[Fi]();else{let n=t;e===n.length||e===null?this[Fi]():typeof n=="string"?(this[ae][0]=n.slice(e),t=n.slice(0,e),this[ce]-=e):(this[ae][0]=n.subarray(e),t=n.subarray(0,e),this[ce]-=e)}return this.emit("data",t),!this[ae].length&&!this[ot]&&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[ot]=!0,this.writable=!1,(this[oe]||!this[Zn])&&this[at](),this}[bn](){this[te]||(!this[Gt]&&!this[xe].length&&(this[Ne]=!0),this[Zn]=!1,this[oe]=!0,this.emit("resume"),this[ae].length?this[$i]():this[ot]?this[at]():this.emit("drain"))}resume(){return this[bn]()}pause(){this[oe]=!1,this[Zn]=!0,this[Ne]=!1}get destroyed(){return this[te]}get flowing(){return this[oe]}get paused(){return this[Zn]}[Dr](e){this[we]?this[ce]+=1:this[ce]+=e.length,this[ae].push(e)}[Fi](){return this[we]?this[ce]-=1:this[ce]-=this[ae][0].length,this[ae].shift()}[$i](e=!1){do;while(this[Xa](this[Fi]())&&this[ae].length);!e&&!this[ae].length&&!this[ot]&&this.emit("drain")}[Xa](e){return this.emit("data",e),this[oe]}pipe(e,t){if(this[te])return e;this[Ne]=!1;let n=this[_t];return t=t||{},e===Ha.stdout||e===Ha.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,n?t.end&&e.end():(this[xe].push(t.proxyErrors?new qr(this,e,t):new zi(this,e,t)),this[Ye]?Hn(()=>this[bn]()):this[bn]()),e}unpipe(e){let t=this[xe].find(n=>n.dest===e);t&&(this[xe].length===1?(this[oe]&&this[Gt]===0&&(this[oe]=!1),this[xe]=[]):this[xe].splice(this[xe].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[Ne]=!1,this[Gt]++,!this[xe].length&&!this[oe]&&this[bn]();else if(e==="readable"&&this[ce]!==0)super.emit("readable");else if(Kd(e)&&this[_t])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Vn]){let s=t;this[Ye]?Hn(()=>s.call(this,this[Vn])):s.call(this,this[Vn])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e==="data"&&(this[Gt]=this.listeners("data").length,this[Gt]===0&&!this[Ne]&&!this[xe].length&&(this[oe]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Gt]=0,!this[Ne]&&!this[xe].length&&(this[oe]=!1)),t}get emittedEnd(){return this[_t]}[at](){!this[Ii]&&!this[_t]&&!this[te]&&this[ae].length===0&&this[ot]&&(this[Ii]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Di]&&this.emit("close"),this[Ii]=!1)}emit(e,...t){let n=t[0];if(e!=="error"&&e!=="close"&&e!==te&&this[te])return!1;if(e==="data")return!this[we]&&!n?!1:this[Ye]?(Hn(()=>this[Fr](n)),!0):this[Fr](n);if(e==="end")return this[Ya]();if(e==="close"){if(this[Di]=!0,!this[_t]&&!this[te])return!1;let r=super.emit("close");return this.removeAllListeners("close"),r}else if(e==="error"){this[Vn]=n,super.emit($r,n);let r=!this[Gn]||this.listeners("error").length?super.emit("error",n):!1;return this[at](),r}else if(e==="resume"){let r=super.emit("resume");return this[at](),r}else if(e==="finish"||e==="prefinish"){let r=super.emit(e);return this.removeAllListeners(e),r}let s=super.emit(e,...t);return this[at](),s}[Fr](e){for(let n of this[xe])n.dest.write(e)===!1&&this.pause();let t=this[Ne]?!1:super.emit("data",e);return this[at](),t}[Ya](){return this[_t]?!1:(this[_t]=!0,this.readable=!1,this[Ye]?(Hn(()=>this[Wr]()),!0):this[Wr]())}[Wr](){if(this[vn]){let t=this[vn].end();if(t){for(let n of this[xe])n.dest.write(t);this[Ne]||super.emit("data",t)}}for(let t of this[xe])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[we]||(e.dataLength=0);let t=this.promise();return this.on("data",n=>{e.push(n),this[we]||(e.dataLength+=n.length)}),await t,e}async concat(){if(this[we])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[qe]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(te,()=>t(new Error("stream destroyed"))),this.on("error",n=>t(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Ne]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[ot])return t();let r,o,a=d=>{this.off("data",c),this.off("end",l),this.off(te,u),t(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(te,u),this.pause(),r({value:d,done:!!this[ot]})},l=()=>{this.off("error",a),this.off("data",c),this.off(te,u),t(),r({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,p)=>{o=p,r=d,this.once(te,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Ne]=!1;let e=!1,t=()=>(this.pause(),this.off($r,t),this.off(te,t),this.off("end",t),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return t();let s=this.read();return s===null?t():{done:!1,value:s}};return this.once("end",t),this.once($r,t),this.once(te,t),{next:n,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[te])return e?this.emit("error",e):this.emit(te),this;this[te]=!0,this[Ne]=!0,this[ae].length=0,this[ce]=0;let t=this;return typeof t.close=="function"&&!this[Di]&&t.close(),e?this.emit("error",e):this.emit(te),this}static get isStream(){return Jd}};var of=Ke.realpathSync.native,Xn={lstatSync:Ke.lstatSync,readdir:Ke.readdir,readdirSync:Ke.readdirSync,readlinkSync:Ke.readlinkSync,realpathSync:of,promises:{lstat:St.lstat,readdir:St.readdir,readlink:St.readlink,realpath:St.realpath}},sc=i=>!i||i===Xn||i===rf?Xn:{...Xn,...i,promises:{...Xn.promises,...i.promises||{}}},rc=/^\\\\\?\\([a-z]:)\\?$/i,af=i=>i.replace(/\//g,"\\").replace(rc,"$1\\"),cf=/[\\\/]/,$e=0,oc=1,ac=2,Qe=4,cc=6,lc=8,Ht=10,uc=12,De=15,Jn=~De,Ur=16,Ka=32,Yn=64,Be=128,Bi=256,Vi=512,ec=Yn|Be|Vi,lf=1023,Vr=i=>i.isFile()?lc:i.isDirectory()?Qe:i.isSymbolicLink()?Ht:i.isCharacterDevice()?ac:i.isBlockDevice()?cc:i.isSocket()?uc:i.isFIFO()?oc:$e,tc=new Zt({max:2**12}),Qn=i=>{let e=tc.get(i);if(e)return e;let t=i.normalize("NFKD");return tc.set(i,t),t},nc=new Zt({max:2**12}),Ui=i=>{let e=nc.get(i);if(e)return e;let t=Qn(i.toLowerCase());return nc.set(i,t),t},Zi=class extends Zt{constructor(){super({max:256})}},Zr=class extends Zt{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},hc=Symbol("PathScurry setAsCwd"),ve=class{name;root;roots;parent;nocase;isCWD=!1;#e;#n;get dev(){return this.#n}#r;get mode(){return this.#r}#s;get nlink(){return this.#s}#o;get uid(){return this.#o}#b;get gid(){return this.#b}#y;get rdev(){return this.#y}#u;get blksize(){return this.#u}#a;get ino(){return this.#a}#d;get size(){return this.#d}#h;get blocks(){return this.#h}#c;get atimeMs(){return this.#c}#i;get mtimeMs(){return this.#i}#f;get ctimeMs(){return this.#f}#_;get birthtimeMs(){return this.#_}#v;get atime(){return this.#v}#p;get mtime(){return this.#p}#R;get ctime(){return this.#R}#m;get birthtime(){return this.#m}#k;#E;#g;#w;#x;#C;#t;#M;#P;#T;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=$e,n,s,r,o,a){this.name=e,this.#k=r?Ui(e):Qn(e),this.#t=t&lf,this.nocase=r,this.roots=s,this.root=n||this,this.#M=o,this.#g=a.fullpath,this.#x=a.relative,this.#C=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=sc(a.fs)}depth(){return this.#E!==void 0?this.#E:this.parent?this.#E=this.parent.depth()+1:this.#E=0}childrenCache(){return this.#M}resolve(e){if(!e)return this;let t=this.getRootString(e),s=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#j(s):this.#j(s)}#j(e){let t=this;for(let n of e)t=t.child(n);return t}children(){let e=this.#M.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#M.set(this,t),this.#t&=~Ur,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),s=this.nocase?Ui(e):Qn(e);for(let c of n)if(c.#k===s)return c;let r=this.parent?this.sep:"",o=this.#g?this.#g+r+e:void 0,a=this.newChild(e,$e,{...t,parent:this,fullpath:o});return this.canReaddir()||(a.#t|=Be),n.push(a),a}relative(){if(this.isCWD)return"";if(this.#x!==void 0)return this.#x;let e=this.name,t=this.parent;if(!t)return this.#x=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.#C!==void 0)return this.#C;let e=this.name,t=this.parent;if(!t)return this.#C=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?"":"/")+e}fullpath(){if(this.#g!==void 0)return this.#g;let e=this.name,t=this.parent;if(!t)return this.#g=this.name;let s=t.fullpath()+(t.parent?this.sep:"")+e;return this.#g=s}fullpathPosix(){if(this.#w!==void 0)return this.#w;if(this.sep==="/")return this.#w=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#w=`//?/${s}`:this.#w=s}let e=this.parent,t=e.fullpathPosix(),n=t+(!t||!e.parent?"":"/")+this.name;return this.#w=n}isUnknown(){return(this.#t&De)===$e}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.#t&De)===lc}isDirectory(){return(this.#t&De)===Qe}isCharacterDevice(){return(this.#t&De)===ac}isBlockDevice(){return(this.#t&De)===cc}isFIFO(){return(this.#t&De)===oc}isSocket(){return(this.#t&De)===uc}isSymbolicLink(){return(this.#t&Ht)===Ht}lstatCached(){return this.#t&Ka?this:void 0}readlinkCached(){return this.#P}realpathCached(){return this.#T}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#P)return!0;if(!this.parent)return!1;let e=this.#t&De;return!(e!==$e&&e!==Ht||this.#t&Bi||this.#t&Be)}calledReaddir(){return!!(this.#t&Ur)}isENOENT(){return!!(this.#t&Be)}isNamed(e){return this.nocase?this.#k===Ui(e):this.#k===Qn(e)}async readlink(){let e=this.#P;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(t);if(n)return this.#P=n}catch(t){this.#N(t.code);return}}readlinkSync(){let e=this.#P;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(t);if(n)return this.#P=n}catch(t){this.#N(t.code);return}}#$(e){this.#t|=Ur;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#S()}}#S(){this.#t&Be||(this.#t=(this.#t|Be)&Jn,this.#U())}#U(){let e=this.children();e.provisional=0;for(let t of e)t.#S()}#D(){this.#t|=Vi,this.#L()}#L(){if(this.#t&Yn)return;let e=this.#t;(e&De)===Qe&&(e&=Jn),this.#t=e|Yn,this.#U()}#F(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#S():this.children().provisional=0}#A(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#S()}#N(e=""){let t=this.#t;t|=Bi,e==="ENOENT"&&(t|=Be),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Jn),this.#t=t,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#W(e,t){return this.#q(e,t)||this.#z(e,t)}#z(e,t){let n=Vr(e),s=this.newChild(e.name,n,{parent:this}),r=s.#t&De;return r!==Qe&&r!==Ht&&r!==$e&&(s.#t|=Yn),t.unshift(s),t.provisional++,s}#q(e,t){for(let n=t.provisional;n<t.length;n++){let s=t[n];if((this.nocase?Ui(e.name):Qn(e.name))===s.#k)return this.#l(e,s,n,t)}}#l(e,t,n,s){let r=t.name;return t.#t=t.#t&Jn|Vr(e),r!==e.name&&(t.name=e.name),n!==s.provisional&&(n===s.length-1?s.pop():s.splice(n,1),s.unshift(t)),s.provisional++,t}async lstat(){if((this.#t&Be)===0)try{return this.#B(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#A(e.code)}}lstatSync(){if((this.#t&Be)===0)try{return this.#B(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#A(e.code)}}#B(e){let{atime:t,atimeMs:n,birthtime:s,birthtimeMs:r,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:p,mode:f,mtime:w,mtimeMs:g,nlink:k,rdev:E,size:x,uid:b}=e;this.#v=t,this.#c=n,this.#m=s,this.#_=r,this.#u=o,this.#h=a,this.#R=c,this.#f=l,this.#n=u,this.#b=d,this.#a=p,this.#r=f,this.#p=w,this.#i=g,this.#s=k,this.#y=E,this.#d=x,this.#o=b;let S=Vr(e);this.#t=this.#t&Jn|S|Ka,S!==$e&&S!==Qe&&S!==Ht&&(this.#t|=Yn)}#I=[];#O=!1;#V(e){this.#O=!1;let t=this.#I.slice();this.#I.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 r=n.slice(0,n.provisional);t?e(null,r):queueMicrotask(()=>e(null,r));return}if(this.#I.push(e),this.#O)return;this.#O=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(r,o)=>{if(r)this.#F(r.code),n.provisional=0;else{for(let a of o)this.#W(a,n);this.#$(n)}this.#V(n.slice(0,n.provisional))})}#Z;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.#Z)await this.#Z;else{let n=()=>{};this.#Z=new Promise(s=>n=s);try{for(let s of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#W(s,e);this.#$(e)}catch(s){this.#F(s.code),e.provisional=0}this.#Z=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.#e.readdirSync(t,{withFileTypes:!0}))this.#W(n,e);this.#$(e)}catch(n){this.#F(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#t&ec)return!1;let e=De&this.#t;return e===$e||e===Qe||e===Ht}shouldWalk(e,t){return(this.#t&Qe)===Qe&&!(this.#t&ec)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#T)return this.#T;if(!((Vi|Bi|Be)&this.#t))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#T=this.resolve(e)}catch{this.#D()}}realpathSync(){if(this.#T)return this.#T;if(!((Vi|Bi|Be)&this.#t))try{let e=this.#e.realpathSync(this.fullpath());return this.#T=this.resolve(e)}catch{this.#D()}}[hc](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],s=this;for(;s&&s.parent;)t.add(s),s.#x=n.join(this.sep),s.#C=n.join("/"),s=s.parent,n.push("..");for(s=e;s&&s.parent&&!t.has(s);)s.#x=void 0,s.#C=void 0,s=s.parent}},Gi=class i extends ve{sep="\\";splitSep=cf;constructor(e,t=$e,n,s,r,o,a){super(e,t,n,s,r,o,a)}newChild(e,t=$e,n={}){return new i(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return _n.win32.parse(e).root}getRoot(e){if(e=af(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 xn(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(rc,"$1\\"),e===t}},Hi=class i extends ve{splitSep="/";sep="/";constructor(e,t=$e,n,s,r,o,a){super(e,t,n,s,r,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=$e,n={}){return new i(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Ji=class{root;rootPath;roots;cwd;#e;#n;#r;nocase;#s;constructor(e=process.cwd(),t,n,{nocase:s,childrenCacheSize:r=16*1024,fs:o=Xn}={}){this.#s=sc(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,ic.fileURLToPath)(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new Zi,this.#n=new Zi,this.#r=new Zr(r);let c=a.substring(this.rootPath.length).split(n);if(c.length===1&&!c[0]&&c.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#s),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,p=this.rootPath,f=!1;for(let w of c){let g=u--;l=l.child(w,{relative:new Array(g).fill("..").join(d),relativePosix:new Array(g).fill("..").join("/"),fullpath:p+=(f?"":d)+w}),f=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let t="";for(let r=e.length-1;r>=0;r--){let o=e[r];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#e.get(t);if(n!==void 0)return n;let s=this.cwd.resolve(t).fullpath();return this.#e.set(t,s),s}resolvePosix(...e){let t="";for(let r=e.length-1;r>=0;r--){let o=e[r];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#n.get(t);if(n!==void 0)return n;let s=this.cwd.resolve(t).fullpathPosix();return this.#n.set(t,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let s=await e.readdir();return n?s:s.map(r=>r.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(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 ve||(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 ve||(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 ve||(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 ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t,a=[];(!r||r(e))&&a.push(n?e:e.fullpath());let c=new Set,l=(d,p)=>{c.add(d),d.readdirCB((f,w)=>{if(f)return p(f);let g=w.length;if(!g)return p();let k=()=>{--g===0&&p()};for(let E of w)(!r||r(E))&&a.push(n?E:E.fullpath()),s&&E.isSymbolicLink()?E.realpath().then(x=>x?.isUnknown()?x.lstat():x).then(x=>x?.shouldWalk(c,o)?l(x,k):k()):E.shouldWalk(c,o)?l(E,k):k()},!0)},u=e;return new Promise((d,p)=>{l(u,f=>{if(f)return p(f);d(a)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t,a=[];(!r||r(e))&&a.push(n?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!r||r(d))&&a.push(n?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(s&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(c,o)&&c.add(p)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(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 ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t;(!r||r(e))&&(yield n?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!r||r(u))&&(yield n?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(s&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t,a=new xt({objectMode:!0});(!r||r(e))&&a.write(n?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let p=!1;for(;!p;){let f=l.shift();if(!f){u===0&&a.end();return}u++,c.add(f);let w=(k,E,x=!1)=>{if(k)return a.emit("error",k);if(s&&!x){let b=[];for(let S of E)S.isSymbolicLink()&&b.push(S.realpath().then(O=>O?.isUnknown()?O.lstat():O));if(b.length){Promise.all(b).then(()=>w(null,E,!0));return}}for(let b of E)b&&(!r||r(b))&&(a.write(n?b:b.fullpath())||(p=!0));u--;for(let b of E){let S=b.realpathCached()||b;S.shouldWalk(c,o)&&l.push(S)}p&&!a.flowing?a.once("drain",d):g||d()},g=!0;f.readdirCB(w,!0),g=!1}};return d(),a}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t,a=new xt({objectMode:!0}),c=new Set;(!r||r(e))&&a.write(n?e:e.fullpath());let l=[e],u=0,d=()=>{let p=!1;for(;!p;){let f=l.shift();if(!f){u===0&&a.end();return}u++,c.add(f);let w=f.readdirSync();for(let g of w)(!r||r(g))&&(a.write(n?g:g.fullpath())||(p=!0));u--;for(let g of w){let k=g;if(g.isSymbolicLink()){if(!(s&&(k=g.realpathSync())))continue;k.isUnknown()&&k.lstatSync()}k.shouldWalk(c,o)&&l.push(k)}}p&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[hc](t)}},xn=class extends Ji{sep="\\";constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,_n.win32,"\\",{...t,nocase:n}),this.nocase=n;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return _n.win32.parse(e).root.toUpperCase()}newRoot(e){return new Gi(this.rootPath,Qe,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Sn=class extends Ji{sep="/";constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,_n.posix,"/",{...t,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new Hi(this.rootPath,Qe,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Kn=class extends Sn{constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}},Em=process.platform==="win32"?Gi:Hi,dc=process.platform==="win32"?xn:process.platform==="darwin"?Kn:Sn;var uf=i=>i.length>=1,hf=i=>i.length>=1,kn=class i{#e;#n;#r;length;#s;#o;#b;#y;#u;#a;#d=!0;constructor(e,t,n,s){if(!uf(e))throw new TypeError("empty pattern list");if(!hf(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.#e=e,this.#n=t,this.#r=n,this.#s=s,this.#r===0){if(this.isUNC()){let[r,o,a,c,...l]=this.#e,[u,d,p,f,...w]=this.#n;l[0]===""&&(l.shift(),w.shift());let g=[r,o,a,c,""].join("/"),k=[u,d,p,f,""].join("/");this.#e=[g,...l],this.#n=[k,...w],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[r,...o]=this.#e,[a,...c]=this.#n;o[0]===""&&(o.shift(),c.shift());let l=r+"/",u=a+"/";this.#e=[l,...o],this.#n=[u,...c],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===de}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#b=this.#b||(this.#r===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new i(this.#e,this.#n,this.#r+1,this.#s),this.#o.#a=this.#a,this.#o.#u=this.#u,this.#o.#y=this.#y,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#u!==void 0?this.#u:this.#u=this.#s==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#y!==void 0?this.#y:this.#y=this.#s==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#d)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#d?!1:(this.#d=!1,!0)}};var df=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",En=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:s,noglobstar:r,platform:o=df}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,noext:s,noglobstar:r,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let t=new Ae(e,this.mmopts);for(let n=0;n<t.set.length;n++){let s=t.set[n],r=t.globParts[n];if(!s||!r)throw new Error("invalid pattern object");for(;s[0]==="."&&r[0]===".";)s.shift(),r.shift();let o=new kn(s,r,0,this.platform),a=new Ae(o.globString(),this.mmopts),c=r[r.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),c&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let t=e.fullpath(),n=`${t}/`,s=e.relative()||".",r=`${s}/`;for(let o of this.relative)if(o.match(s)||o.match(r))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 s of this.relativeChildren)if(s.match(n))return!0;for(let s of this.absoluteChildren)if(s.match(t))return!0;return!1}};var Gr=class i{store;constructor(e=new Map){this.store=e}copy(){return new i(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),s=this.store.get(n);s?s.add(t.globString()):this.store.set(n,new Set([t.globString()]))}},Hr=class{store=new Map;add(e,t,n){let s=(t?2:0)|(n?1:0),r=this.store.get(e);this.store.set(e,r===void 0?s:s&r)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},Jr=class{store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(s=>s.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())}},ei=class i{hasWalkedCache;matches=new Hr;subwalks=new Jr;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new Gr}processPatterns(e,t){this.patterns=t;let n=t.map(s=>[e,s]);for(let[s,r]of n){this.hasWalkedCache.storeWalked(s,r);let o=r.root(),a=r.isAbsolute()&&this.opts.absolute!==!1;if(o){s=s.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=r.rest();if(d)r=d;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let c,l,u=!1;for(;typeof(c=r.pattern())=="string"&&(l=r.rest());)s=s.resolve(c),r=l,u=!0;if(c=r.pattern(),l=r.rest(),u){if(this.hasWalkedCache.hasWalked(s,r))continue;this.hasWalkedCache.storeWalked(s,r)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(s.resolve(c),a,d);continue}else if(c===de){(!s.isSymbolicLink()||this.follow||r.checkFollowGlobstar())&&this.subwalks.add(s,r);let d=l?.pattern(),p=l?.rest();if(!l||(d===""||d===".")&&!p)this.matches.add(s,a,d===""||d===".");else if(d===".."){let f=s.parent||s;p?this.hasWalkedCache.hasWalked(f,p)||this.subwalks.add(f,p):this.matches.add(f,a,!0)}}else c instanceof RegExp&&this.subwalks.add(s,r)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new i(this.opts,this.hasWalkedCache)}filterEntries(e,t){let n=this.subwalks.get(e),s=this.child();for(let r of t)for(let o of n){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===de?s.testGlobstar(r,o,l,a):c instanceof RegExp?s.testRegExp(r,c,l,a):s.testString(r,c,l,a)}return s}testGlobstar(e,t,n,s){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,s,!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 r=n.pattern();if(typeof r=="string"&&r!==".."&&r!==""&&r!==".")this.testString(e,r,n.rest(),s);else if(r===".."){let o=e.parent||e;this.subwalks.add(o,n)}else r instanceof RegExp&&this.testRegExp(e,r,n.rest(),s)}}testRegExp(e,t,n,s){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,s,!1))}testString(e,t,n,s){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,s,!1))}};var ff=(i,e)=>typeof i=="string"?new En([i],e):Array.isArray(i)?new En(i,e):i,Xi=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#n;#r;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#r=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#n=ff(n.ignore??[],n),!this.includeChildMatches&&typeof this.#n.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#s(e){return this.seen.has(e)||!!this.#n?.ignored?.(e)}#o(e){return!!this.#n?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.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 r=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=await r.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(r,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.#s(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 r=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=r.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(r,t)}matchFinish(e,t){if(this.#s(e))return;if(!this.includeChildMatches&&this.#n?.add){let r=`${e.relativePosix()}/**`;this.#n.add(r)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let r=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(r+s)}else{let r=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!r.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(r?o+r+s:"."+s)}}async match(e,t,n){let s=await this.matchCheck(e,n);s&&this.matchFinish(s,t)}matchSync(e,t,n){let s=this.matchCheckSync(e,n);s&&this.matchFinish(s,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new ei(this.opts),n)}walkCB2(e,t,n,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,s));return}n.processPatterns(e,t);let r=1,o=()=>{--r===0&&s()};for(let[a,c,l]of n.matches.entries())this.#s(a)||(r++,this.match(a,c,l).then(()=>o()));for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,n,o):a.readdirCB((l,u)=>this.walkCB3(a,u,n,o),!0)}o()}walkCB3(e,t,n,s){n=n.filterEntries(e,t);let r=1,o=()=>{--r===0&&s()};for(let[a,c,l]of n.matches.entries())this.#s(a)||(r++,this.match(a,c,l).then(()=>o()));for(let[a,c]of n.subwalks.entries())r++,this.walkCB2(a,c,n.child(),o);o()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new ei(this.opts),n)}walkCB2Sync(e,t,n,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,s));return}n.processPatterns(e,t);let r=1,o=()=>{--r===0&&s()};for(let[a,c,l]of n.matches.entries())this.#s(a)||this.matchSync(a,c,l);for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let c=a.readdirSync();this.walkCB3Sync(a,c,n,o)}o()}walkCB3Sync(e,t,n,s){n=n.filterEntries(e,t);let r=1,o=()=>{--r===0&&s()};for(let[a,c,l]of n.matches.entries())this.#s(a)||this.matchSync(a,c,l);for(let[a,c]of n.subwalks.entries())r++,this.walkCB2Sync(a,c,n.child(),o);o()}},ti=class extends Xi{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}},ni=class extends Xi{results;constructor(e,t,n){super(e,t,n),this.results=new xt({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 pf=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ue=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,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,fc.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(c=>c.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=t.platform||pf,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 c=t.platform==="win32"?xn:t.platform==="darwin"?Kn:t.platform?Sn:dc;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",s={...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},r=this.pattern.map(c=>new Ae(c,s)),[o,a]=r.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=o.map((c,l)=>{let u=a[l];if(!u)throw new Error("invalid pattern object");return new kn(c,u,0,this.platform)})}async walk(){return[...await new ti(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 ti(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 ni(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 ni(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 Xr=(i,e={})=>{Array.isArray(i)||(i=[i]);for(let t of i)if(new Ae(t,e).hasMagic())return!0;return!1};function Yi(i,e={}){return new Ue(i,e).streamSync()}function gc(i,e={}){return new Ue(i,e).stream()}function Qi(i,e={}){return new Ue(i,e).walkSync()}async function pc(i,e={}){return new Ue(i,e).walk()}function Ki(i,e={}){return new Ue(i,e).iterateSync()}function yc(i,e={}){return new Ue(i,e).iterate()}var mf=Yi,gf=Object.assign(gc,{sync:Yi}),yf=Ki,wf=Object.assign(yc,{sync:Ki}),vf=Object.assign(Qi,{stream:Yi,iterate:Ki}),mc=Object.assign(pc,{glob:pc,globSync:Qi,sync:vf,globStream:gc,stream:gf,globStreamSync:Yi,streamSync:mf,globIterate:yc,iterate:wf,globIterateSync:Ki,iterateSync:yf,Glob:Ue,hasMagic:Xr,escape:yn,unescape:ze});mc.glob=mc;var Yr={name:"dts-linter",version:"0.3.11-beta1",main:"index.js",repository:{type:"git",url:"https://github.com/kylebonnici/dts-linter"},scripts:{compile:"node ./esbuild.js","compile:prod":"node ./esbuild.js --production"},bin:"./dist/dts-linter.js",files:["dist/dts-linter.js","THIRD_PARTY_LICENSES.txt"],keywords:["dts","linter","devicetree","formatting"],author:"Kyle Micallef Bonnici",license:"Apache-2.0",description:"",dependencies:{"devicetree-language-server":"^0.8.0-beta2"},devDependencies:{"@types/node":"^24.0.3","devicetree-language-server-types":"^0.0.2-alpha.8",diff:"^8.0.2",esbuild:"^0.25.5",glob:"^13.0.0","license-checker":"^25.0.1","ts-node":"^10.9.2",typescript:"^5.8.3","vscode-jsonrpc":"^8.2.1","vscode-languageserver-types":"^3.17.5",zod:"^3.25.67"}};var wc;(function(i){function e(t){return typeof t=="string"}i.is=e})(wc||(wc={}));var Qr;(function(i){function e(t){return typeof t=="string"}i.is=e})(Qr||(Qr={}));var vc;(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&i.MIN_VALUE<=t&&t<=i.MAX_VALUE}i.is=e})(vc||(vc={}));var es;(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&i.MIN_VALUE<=t&&t<=i.MAX_VALUE}i.is=e})(es||(es={}));var Ve;(function(i){function e(n,s){return n===Number.MAX_VALUE&&(n=es.MAX_VALUE),s===Number.MAX_VALUE&&(s=es.MAX_VALUE),{line:n,character:s}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.uinteger(s.line)&&m.uinteger(s.character)}i.is=t})(Ve||(Ve={}));var ne;(function(i){function e(n,s,r,o){if(m.uinteger(n)&&m.uinteger(s)&&m.uinteger(r)&&m.uinteger(o))return{start:Ve.create(n,s),end:Ve.create(r,o)};if(Ve.is(n)&&Ve.is(s))return{start:n,end:s};throw new Error(`Range#create called with invalid arguments[${n}, ${s}, ${r}, ${o}]`)}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&Ve.is(s.start)&&Ve.is(s.end)}i.is=t})(ne||(ne={}));var ts;(function(i){function e(n,s){return{uri:n,range:s}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&ne.is(s.range)&&(m.string(s.uri)||m.undefined(s.uri))}i.is=t})(ts||(ts={}));var bc;(function(i){function e(n,s,r,o){return{targetUri:n,targetRange:s,targetSelectionRange:r,originSelectionRange:o}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&ne.is(s.targetRange)&&m.string(s.targetUri)&&ne.is(s.targetSelectionRange)&&(ne.is(s.originSelectionRange)||m.undefined(s.originSelectionRange))}i.is=t})(bc||(bc={}));var Kr;(function(i){function e(n,s,r,o){return{red:n,green:s,blue:r,alpha:o}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.numberRange(s.red,0,1)&&m.numberRange(s.green,0,1)&&m.numberRange(s.blue,0,1)&&m.numberRange(s.alpha,0,1)}i.is=t})(Kr||(Kr={}));var _c;(function(i){function e(n,s){return{range:n,color:s}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&ne.is(s.range)&&Kr.is(s.color)}i.is=t})(_c||(_c={}));var xc;(function(i){function e(n,s,r){return{label:n,textEdit:s,additionalTextEdits:r}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.string(s.label)&&(m.undefined(s.textEdit)||Tn.is(s))&&(m.undefined(s.additionalTextEdits)||m.typedArray(s.additionalTextEdits,Tn.is))}i.is=t})(xc||(xc={}));var Sc;(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(Sc||(Sc={}));var kc;(function(i){function e(n,s,r,o,a,c){let l={startLine:n,endLine:s};return m.defined(r)&&(l.startCharacter=r),m.defined(o)&&(l.endCharacter=o),m.defined(a)&&(l.kind=a),m.defined(c)&&(l.collapsedText=c),l}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.uinteger(s.startLine)&&m.uinteger(s.startLine)&&(m.undefined(s.startCharacter)||m.uinteger(s.startCharacter))&&(m.undefined(s.endCharacter)||m.uinteger(s.endCharacter))&&(m.undefined(s.kind)||m.string(s.kind))}i.is=t})(kc||(kc={}));var eo;(function(i){function e(n,s){return{location:n,message:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&ts.is(s.location)&&m.string(s.message)}i.is=t})(eo||(eo={}));var fe;(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(fe||(fe={}));var Ec;(function(i){i.Unnecessary=1,i.Deprecated=2})(Ec||(Ec={}));var Cc;(function(i){function e(t){let n=t;return m.objectLiteral(n)&&m.string(n.href)}i.is=e})(Cc||(Cc={}));var ns;(function(i){function e(n,s,r,o,a,c){let l={range:n,message:s};return m.defined(r)&&(l.severity=r),m.defined(o)&&(l.code=o),m.defined(a)&&(l.source=a),m.defined(c)&&(l.relatedInformation=c),l}i.create=e;function t(n){var s;let r=n;return m.defined(r)&&ne.is(r.range)&&m.string(r.message)&&(m.number(r.severity)||m.undefined(r.severity))&&(m.integer(r.code)||m.string(r.code)||m.undefined(r.code))&&(m.undefined(r.codeDescription)||m.string((s=r.codeDescription)===null||s===void 0?void 0:s.href))&&(m.string(r.source)||m.undefined(r.source))&&(m.undefined(r.relatedInformation)||m.typedArray(r.relatedInformation,eo.is))}i.is=t})(ns||(ns={}));var Cn;(function(i){function e(n,s,...r){let o={title:n,command:s};return m.defined(r)&&r.length>0&&(o.arguments=r),o}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.title)&&m.string(s.command)}i.is=t})(Cn||(Cn={}));var Tn;(function(i){function e(r,o){return{range:r,newText:o}}i.replace=e;function t(r,o){return{range:{start:r,end:r},newText:o}}i.insert=t;function n(r){return{range:r,newText:""}}i.del=n;function s(r){let o=r;return m.objectLiteral(o)&&m.string(o.newText)&&ne.is(o.range)}i.is=s})(Tn||(Tn={}));var to;(function(i){function e(n,s,r){let o={label:n};return s!==void 0&&(o.needsConfirmation=s),r!==void 0&&(o.description=r),o}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.string(s.label)&&(m.boolean(s.needsConfirmation)||s.needsConfirmation===void 0)&&(m.string(s.description)||s.description===void 0)}i.is=t})(to||(to={}));var Rn;(function(i){function e(t){let n=t;return m.string(n)}i.is=e})(Rn||(Rn={}));var Tc;(function(i){function e(r,o,a){return{range:r,newText:o,annotationId:a}}i.replace=e;function t(r,o,a){return{range:{start:r,end:r},newText:o,annotationId:a}}i.insert=t;function n(r,o){return{range:r,newText:"",annotationId:o}}i.del=n;function s(r){let o=r;return Tn.is(o)&&(to.is(o.annotationId)||Rn.is(o.annotationId))}i.is=s})(Tc||(Tc={}));var no;(function(i){function e(n,s){return{textDocument:n,edits:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&ao.is(s.textDocument)&&Array.isArray(s.edits)}i.is=t})(no||(no={}));var io;(function(i){function e(n,s,r){let o={kind:"create",uri:n};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(o.options=s),r!==void 0&&(o.annotationId=r),o}i.create=e;function t(n){let s=n;return s&&s.kind==="create"&&m.string(s.uri)&&(s.options===void 0||(s.options.overwrite===void 0||m.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||m.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Rn.is(s.annotationId))}i.is=t})(io||(io={}));var so;(function(i){function e(n,s,r,o){let a={kind:"rename",oldUri:n,newUri:s};return r!==void 0&&(r.overwrite!==void 0||r.ignoreIfExists!==void 0)&&(a.options=r),o!==void 0&&(a.annotationId=o),a}i.create=e;function t(n){let s=n;return s&&s.kind==="rename"&&m.string(s.oldUri)&&m.string(s.newUri)&&(s.options===void 0||(s.options.overwrite===void 0||m.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||m.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Rn.is(s.annotationId))}i.is=t})(so||(so={}));var ro;(function(i){function e(n,s,r){let o={kind:"delete",uri:n};return s!==void 0&&(s.recursive!==void 0||s.ignoreIfNotExists!==void 0)&&(o.options=s),r!==void 0&&(o.annotationId=r),o}i.create=e;function t(n){let s=n;return s&&s.kind==="delete"&&m.string(s.uri)&&(s.options===void 0||(s.options.recursive===void 0||m.boolean(s.options.recursive))&&(s.options.ignoreIfNotExists===void 0||m.boolean(s.options.ignoreIfNotExists)))&&(s.annotationId===void 0||Rn.is(s.annotationId))}i.is=t})(ro||(ro={}));var oo;(function(i){function e(t){let n=t;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(s=>m.string(s.kind)?io.is(s)||so.is(s)||ro.is(s):no.is(s)))}i.is=e})(oo||(oo={}));var Rc;(function(i){function e(n){return{uri:n}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.uri)}i.is=t})(Rc||(Rc={}));var Oc;(function(i){function e(n,s){return{uri:n,version:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.uri)&&m.integer(s.version)}i.is=t})(Oc||(Oc={}));var ao;(function(i){function e(n,s){return{uri:n,version:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.uri)&&(s.version===null||m.integer(s.version))}i.is=t})(ao||(ao={}));var Ac;(function(i){function e(n,s,r,o){return{uri:n,languageId:s,version:r,text:o}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.uri)&&m.string(s.languageId)&&m.integer(s.version)&&m.string(s.text)}i.is=t})(Ac||(Ac={}));var co;(function(i){i.PlainText="plaintext",i.Markdown="markdown";function e(t){let n=t;return n===i.PlainText||n===i.Markdown}i.is=e})(co||(co={}));var ii;(function(i){function e(t){let n=t;return m.objectLiteral(t)&&co.is(n.kind)&&m.string(n.value)}i.is=e})(ii||(ii={}));var Nc;(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(Nc||(Nc={}));var Pc;(function(i){i.PlainText=1,i.Snippet=2})(Pc||(Pc={}));var jc;(function(i){i.Deprecated=1})(jc||(jc={}));var Mc;(function(i){function e(n,s,r){return{newText:n,insert:s,replace:r}}i.create=e;function t(n){let s=n;return s&&m.string(s.newText)&&ne.is(s.insert)&&ne.is(s.replace)}i.is=t})(Mc||(Mc={}));var Lc;(function(i){i.asIs=1,i.adjustIndentation=2})(Lc||(Lc={}));var Ic;(function(i){function e(t){let n=t;return n&&(m.string(n.detail)||n.detail===void 0)&&(m.string(n.description)||n.description===void 0)}i.is=e})(Ic||(Ic={}));var Dc;(function(i){function e(t){return{label:t}}i.create=e})(Dc||(Dc={}));var $c;(function(i){function e(t,n){return{items:t||[],isIncomplete:!!n}}i.create=e})($c||($c={}));var is;(function(i){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i.fromPlainText=e;function t(n){let s=n;return m.string(s)||m.objectLiteral(s)&&m.string(s.language)&&m.string(s.value)}i.is=t})(is||(is={}));var Fc;(function(i){function e(t){let n=t;return!!n&&m.objectLiteral(n)&&(ii.is(n.contents)||is.is(n.contents)||m.typedArray(n.contents,is.is))&&(t.range===void 0||ne.is(t.range))}i.is=e})(Fc||(Fc={}));var Wc;(function(i){function e(t,n){return n?{label:t,documentation:n}:{label:t}}i.create=e})(Wc||(Wc={}));var zc;(function(i){function e(t,n,...s){let r={label:t};return m.defined(n)&&(r.documentation=n),m.defined(s)?r.parameters=s:r.parameters=[],r}i.create=e})(zc||(zc={}));var qc;(function(i){i.Text=1,i.Read=2,i.Write=3})(qc||(qc={}));var Bc;(function(i){function e(t,n){let s={range:t};return m.number(n)&&(s.kind=n),s}i.create=e})(Bc||(Bc={}));var Uc;(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(Uc||(Uc={}));var Vc;(function(i){i.Deprecated=1})(Vc||(Vc={}));var Zc;(function(i){function e(t,n,s,r,o){let a={name:t,kind:n,location:{uri:r,range:s}};return o&&(a.containerName=o),a}i.create=e})(Zc||(Zc={}));var Gc;(function(i){function e(t,n,s,r){return r!==void 0?{name:t,kind:n,location:{uri:s,range:r}}:{name:t,kind:n,location:{uri:s}}}i.create=e})(Gc||(Gc={}));var Hc;(function(i){function e(n,s,r,o,a,c){let l={name:n,detail:s,kind:r,range:o,selectionRange:a};return c!==void 0&&(l.children=c),l}i.create=e;function t(n){let s=n;return s&&m.string(s.name)&&m.number(s.kind)&&ne.is(s.range)&&ne.is(s.selectionRange)&&(s.detail===void 0||m.string(s.detail))&&(s.deprecated===void 0||m.boolean(s.deprecated))&&(s.children===void 0||Array.isArray(s.children))&&(s.tags===void 0||Array.isArray(s.tags))}i.is=t})(Hc||(Hc={}));var Jc;(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(Jc||(Jc={}));var ss;(function(i){i.Invoked=1,i.Automatic=2})(ss||(ss={}));var Xc;(function(i){function e(n,s,r){let o={diagnostics:n};return s!=null&&(o.only=s),r!=null&&(o.triggerKind=r),o}i.create=e;function t(n){let s=n;return m.defined(s)&&m.typedArray(s.diagnostics,ns.is)&&(s.only===void 0||m.typedArray(s.only,m.string))&&(s.triggerKind===void 0||s.triggerKind===ss.Invoked||s.triggerKind===ss.Automatic)}i.is=t})(Xc||(Xc={}));var Yc;(function(i){function e(n,s,r){let o={title:n},a=!0;return typeof s=="string"?(a=!1,o.kind=s):Cn.is(s)?o.command=s:o.edit=s,a&&r!==void 0&&(o.kind=r),o}i.create=e;function t(n){let s=n;return s&&m.string(s.title)&&(s.diagnostics===void 0||m.typedArray(s.diagnostics,ns.is))&&(s.kind===void 0||m.string(s.kind))&&(s.edit!==void 0||s.command!==void 0)&&(s.command===void 0||Cn.is(s.command))&&(s.isPreferred===void 0||m.boolean(s.isPreferred))&&(s.edit===void 0||oo.is(s.edit))}i.is=t})(Yc||(Yc={}));var Qc;(function(i){function e(n,s){let r={range:n};return m.defined(s)&&(r.data=s),r}i.create=e;function t(n){let s=n;return m.defined(s)&&ne.is(s.range)&&(m.undefined(s.command)||Cn.is(s.command))}i.is=t})(Qc||(Qc={}));var Kc;(function(i){function e(n,s){return{tabSize:n,insertSpaces:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.uinteger(s.tabSize)&&m.boolean(s.insertSpaces)}i.is=t})(Kc||(Kc={}));var el;(function(i){function e(n,s,r){return{range:n,target:s,data:r}}i.create=e;function t(n){let s=n;return m.defined(s)&&ne.is(s.range)&&(m.undefined(s.target)||m.string(s.target))}i.is=t})(el||(el={}));var tl;(function(i){function e(n,s){return{range:n,parent:s}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&ne.is(s.range)&&(s.parent===void 0||i.is(s.parent))}i.is=t})(tl||(tl={}));var nl;(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(nl||(nl={}));var il;(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})(il||(il={}));var sl;(function(i){function e(t){let n=t;return m.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i.is=e})(sl||(sl={}));var rl;(function(i){function e(n,s){return{range:n,text:s}}i.create=e;function t(n){let s=n;return s!=null&&ne.is(s.range)&&m.string(s.text)}i.is=t})(rl||(rl={}));var ol;(function(i){function e(n,s,r){return{range:n,variableName:s,caseSensitiveLookup:r}}i.create=e;function t(n){let s=n;return s!=null&&ne.is(s.range)&&m.boolean(s.caseSensitiveLookup)&&(m.string(s.variableName)||s.variableName===void 0)}i.is=t})(ol||(ol={}));var al;(function(i){function e(n,s){return{range:n,expression:s}}i.create=e;function t(n){let s=n;return s!=null&&ne.is(s.range)&&(m.string(s.expression)||s.expression===void 0)}i.is=t})(al||(al={}));var cl;(function(i){function e(n,s){return{frameId:n,stoppedLocation:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&ne.is(n.stoppedLocation)}i.is=t})(cl||(cl={}));var lo;(function(i){i.Type=1,i.Parameter=2;function e(t){return t===1||t===2}i.is=e})(lo||(lo={}));var uo;(function(i){function e(n){return{value:n}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&(s.tooltip===void 0||m.string(s.tooltip)||ii.is(s.tooltip))&&(s.location===void 0||ts.is(s.location))&&(s.command===void 0||Cn.is(s.command))}i.is=t})(uo||(uo={}));var ll;(function(i){function e(n,s,r){let o={position:n,label:s};return r!==void 0&&(o.kind=r),o}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&Ve.is(s.position)&&(m.string(s.label)||m.typedArray(s.label,uo.is))&&(s.kind===void 0||lo.is(s.kind))&&s.textEdits===void 0||m.typedArray(s.textEdits,Tn.is)&&(s.tooltip===void 0||m.string(s.tooltip)||ii.is(s.tooltip))&&(s.paddingLeft===void 0||m.boolean(s.paddingLeft))&&(s.paddingRight===void 0||m.boolean(s.paddingRight))}i.is=t})(ll||(ll={}));var ul;(function(i){function e(t){return{kind:"snippet",value:t}}i.createSnippet=e})(ul||(ul={}));var hl;(function(i){function e(t,n,s,r){return{insertText:t,filterText:n,range:s,command:r}}i.create=e})(hl||(hl={}));var dl;(function(i){function e(t){return{items:t}}i.create=e})(dl||(dl={}));var fl;(function(i){i.Invoked=0,i.Automatic=1})(fl||(fl={}));var pl;(function(i){function e(t,n){return{range:t,text:n}}i.create=e})(pl||(pl={}));var ml;(function(i){function e(t,n){return{triggerKind:t,selectedCompletionInfo:n}}i.create=e})(ml||(ml={}));var gl;(function(i){function e(t){let n=t;return m.objectLiteral(n)&&Qr.is(n.uri)&&m.string(n.name)}i.is=e})(gl||(gl={}));var yl;(function(i){function e(r,o,a,c){return new ho(r,o,a,c)}i.create=e;function t(r){let o=r;return!!(m.defined(o)&&m.string(o.uri)&&(m.undefined(o.languageId)||m.string(o.languageId))&&m.uinteger(o.lineCount)&&m.func(o.getText)&&m.func(o.positionAt)&&m.func(o.offsetAt))}i.is=t;function n(r,o){let a=r.getText(),c=s(o,(u,d)=>{let p=u.range.start.line-d.range.start.line;return p===0?u.range.start.character-d.range.start.character:p}),l=a.length;for(let u=c.length-1;u>=0;u--){let d=c[u],p=r.offsetAt(d.range.start),f=r.offsetAt(d.range.end);if(f<=l)a=a.substring(0,p)+d.newText+a.substring(f,a.length);else throw new Error("Overlapping edit");l=p}return a}i.applyEdits=n;function s(r,o){if(r.length<=1)return r;let a=r.length/2|0,c=r.slice(0,a),l=r.slice(a);s(c,o),s(l,o);let u=0,d=0,p=0;for(;u<c.length&&d<l.length;)o(c[u],l[d])<=0?r[p++]=c[u++]:r[p++]=l[d++];for(;u<c.length;)r[p++]=c[u++];for(;d<l.length;)r[p++]=l[d++];return r}})(yl||(yl={}));var ho=class{constructor(e,t,n,s){this._uri=e,this._languageId=t,this._version=n,this._content=s,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,n=!0;for(let s=0;s<t.length;s++){n&&(e.push(s),n=!1);let r=t.charAt(s);n=r==="\r"||r===`
|
|
52
|
+
>>> no match, partial?`,e,p,t,f),p===c))}let g;if(typeof u=="string"?(g=d===u,this.debug("string match",u,d,g)):(g=u.test(d),this.debug("pattern match",u,d,g)),!g)return!1}if(o===c&&a===l)return!0;if(o===c)return n;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return Ba(this.pattern,this.options)}parse(e){Bn(e);let t=this.options;if(e==="**")return de;if(e==="")return"";let n,s=null;(n=e.match(Od))?s=t.dot?Nd:Ad:(n=e.match(vd))?s=(t.nocase?t.dot?Sd:xd:t.dot?_d:bd)(n[1]):(n=e.match(Pd))?s=(t.nocase?t.dot?Md:jd:t.dot?Ld:Id)(n):(n=e.match(kd))?s=t.dot?Cd:Ed:(n=e.match(Td))&&(s=Rd);let r=gn.fromGlob(e,this.options).toMMPattern();return s&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:s}),r}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?Fd:t.dot?Wd:zd,s=new Set(t.nocase?["i"]:[]),r=e.map(c=>{let l=c.map(d=>{if(d instanceof RegExp)for(let p of d.flags.split(""))s.add(p);return typeof d=="string"?Zd(d):d===de?de:d._src});l.forEach((d,p)=>{let f=l[p+1],w=l[p-1];d!==de||w===de||(w===void 0?f!==void 0&&f!==de?l[p+1]="(?:\\/|"+n+"\\/)?"+f:l[p]=n:f===void 0?l[p-1]=w+"(?:\\/|\\/"+n+")?":f!==de&&(l[p-1]=w+"(?:\\/|\\/"+n+"\\/)"+f,l[p+1]=de))});let u=l.filter(d=>d!==de);if(this.partial&&u.length>=1){let d=[];for(let p=1;p<=u.length;p++)d.push(u.slice(0,p).join("/"));return"(?:"+d.join("|")+")"}return u.join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];r="^"+o+r+a+"$",this.partial&&(r="^(?:\\/|"+o+r.slice(1,-1)+a+")$"),this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,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 s=this.slashSplit(e);this.debug(this.pattern,"split",s);let r=this.set;this.debug(this.pattern,"set",r);let o=s[s.length-1];if(!o)for(let a=s.length-2;!o&&a>=0;a--)o=s[a];for(let a=0;a<r.length;a++){let c=r[a],l=s;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 _e.defaults(e).Minimatch}};_e.AST=gn;_e.Minimatch=Ae;_e.escape=yn;_e.unescape=ze;var fc=require("node:url");var Gd=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Va=new Set,Lr=typeof process=="object"&&process?process:{},Za=(i,e,t,n)=>{typeof Lr.emitWarning=="function"?Lr.emitWarning(i,e,t,n):console.error(`[${t}] ${e}: ${i}`)},Li=globalThis.AbortController,Ua=globalThis.AbortSignal;if(typeof Li>"u"){Ua=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,s){this._onabort.push(s)}},Li=class{constructor(){e()}signal=new Ua;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let s of this.signal._onabort)s(n);this.signal.onabort?.(n)}}};let i=Lr.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{i&&(i=!1,Za("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var Hd=i=>!Va.has(i),bm=Symbol("type"),bt=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),Ga=i=>bt(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?wn:null:null,wn=class extends Array{constructor(e){super(e),this.fill(0)}},Ir=class i{heap;length;static#e=!1;static create(e){let t=Ga(e);if(!t)return[];i.#e=!0;let n=new i(e,t);return i.#e=!1,n}constructor(e,t){if(!i.#e)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]}},Zt=class i{#e;#n;#r;#s;#o;#b;#y;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#d;#h;#c;#i;#f;#_;#v;#p;#R;#m;#k;#E;#g;#w;#x;#C;#t;#M;static unsafeExposeInternals(e){return{starts:e.#E,ttls:e.#g,autopurgeTimers:e.#w,sizes:e.#k,keyMap:e.#h,keyList:e.#c,valList:e.#i,next:e.#f,prev:e.#_,get head(){return e.#v},get tail(){return e.#p},free:e.#R,isBackgroundFetch:t=>e.#l(t),backgroundFetch:(t,n,s,r)=>e.#q(t,n,s,r),moveToTail:t=>e.#I(t),indexes:t=>e.#A(t),rindexes:t=>e.#N(t),isStale:t=>e.#S(t)}}get max(){return this.#e}get maxSize(){return this.#n}get calculatedSize(){return this.#d}get size(){return this.#a}get fetchMethod(){return this.#b}get memoMethod(){return this.#y}get dispose(){return this.#r}get onInsert(){return this.#s}get disposeAfter(){return this.#o}constructor(e){let{max:t=0,ttl:n,ttlResolution:s=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,onInsert:u,disposeAfter:d,noDisposeOnSet:p,noUpdateTTL:f,maxSize:w=0,maxEntrySize:g=0,sizeCalculation:k,fetchMethod:E,memoMethod:x,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:B,ignoreFetchAbort:K,perf:pe}=e;if(pe!==void 0&&typeof pe?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=pe??Gd,t!==0&&!bt(t))throw new TypeError("max option must be a nonnegative integer");let Te=t?Ga(t):Array;if(!Te)throw new Error("invalid max value: "+t);if(this.#e=t,this.#n=w,this.maxEntrySize=g||this.#n,this.sizeCalculation=k,this.sizeCalculation){if(!this.#n&&!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(x!==void 0&&typeof x!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#y=x,E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#b=E,this.#C=!!E,this.#h=new Map,this.#c=new Array(t).fill(void 0),this.#i=new Array(t).fill(void 0),this.#f=new Te(t),this.#_=new Te(t),this.#v=0,this.#p=0,this.#R=Ir.create(t),this.#a=0,this.#d=0,typeof l=="function"&&(this.#r=l),typeof u=="function"&&(this.#s=u),typeof d=="function"?(this.#o=d,this.#m=[]):(this.#o=void 0,this.#m=void 0),this.#x=!!this.#r,this.#M=!!this.#s,this.#t=!!this.#o,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!B,this.ignoreFetchAbort=!!K,this.maxEntrySize!==0){if(this.#n!==0&&!bt(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!bt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#U()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=bt(s)||s===0?s:1,this.ttlAutopurge=!!r,this.ttl=n||0,this.ttl){if(!bt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(this.#e===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#n){let et="LRU_CACHE_UNBOUNDED";Hd(et)&&(Va.add(et),Za("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",et,i))}}getRemainingTTL(e){return this.#h.has(e)?1/0:0}#P(){let e=new wn(this.#e),t=new wn(this.#e);this.#g=e,this.#E=t;let n=this.ttlAutopurge?new Array(this.#e):void 0;this.#w=n,this.#$=(o,a,c=this.#u.now())=>{if(t[o]=a!==0?c:0,e[o]=a,n?.[o]&&(clearTimeout(n[o]),n[o]=void 0),a!==0&&n){let l=setTimeout(()=>{this.#S(o)&&this.#O(this.#c[o],"expire")},a+1);l.unref&&l.unref(),n[o]=l}},this.#T=o=>{t[o]=e[o]!==0?this.#u.now():0},this.#j=(o,a)=>{if(e[a]){let c=e[a],l=t[a];if(!c||!l)return;o.ttl=c,o.start=l,o.now=s||r();let u=o.now-l;o.remainingTTL=c-u}};let s=0,r=()=>{let o=this.#u.now();if(this.ttlResolution>0){s=o;let a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref()}return o};this.getRemainingTTL=o=>{let a=this.#h.get(o);if(a===void 0)return 0;let c=e[a],l=t[a];if(!c||!l)return 1/0;let u=(s||r())-l;return c-u},this.#S=o=>{let a=t[o],c=e[o];return!!c&&!!a&&(s||r())-a>c}}#T=()=>{};#j=()=>{};#$=()=>{};#S=()=>!1;#U(){let e=new wn(this.#e);this.#d=0,this.#k=e,this.#D=t=>{this.#d-=e[t],e[t]=0},this.#F=(t,n,s,r)=>{if(this.#l(n))return 0;if(!bt(s))if(r){if(typeof r!="function")throw new TypeError("sizeCalculation must be a function");if(s=r(n,t),!bt(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#L=(t,n,s)=>{if(e[t]=n,this.#n){let r=this.#n-e[t];for(;this.#d>r;)this.#z(!0)}this.#d+=e[t],s&&(s.entrySize=n,s.totalCalculatedSize=this.#d)}}#D=e=>{};#L=(e,t,n)=>{};#F=(e,t,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#p;!(!this.#W(t)||((e||!this.#S(t))&&(yield t),t===this.#v));)t=this.#_[t]}*#N({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#v;!(!this.#W(t)||((e||!this.#S(t))&&(yield t),t===this.#p));)t=this.#f[t]}#W(e){return e!==void 0&&this.#h.get(this.#c[e])===e}*entries(){for(let e of this.#A())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*rentries(){for(let e of this.#N())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*keys(){for(let e of this.#A()){let t=this.#c[e];t!==void 0&&!this.#l(this.#i[e])&&(yield t)}}*rkeys(){for(let e of this.#N()){let t=this.#c[e];t!==void 0&&!this.#l(this.#i[e])&&(yield t)}}*values(){for(let e of this.#A())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#N())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let n of this.#A()){let s=this.#i[n],r=this.#l(s)?s.__staleWhileFetching:s;if(r!==void 0&&e(r,this.#c[n],this))return this.get(this.#c[n],t)}}forEach(e,t=this){for(let n of this.#A()){let s=this.#i[n],r=this.#l(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#c[n],this)}}rforEach(e,t=this){for(let n of this.#N()){let s=this.#i[n],r=this.#l(s)?s.__staleWhileFetching:s;r!==void 0&&e.call(t,r,this.#c[n],this)}}purgeStale(){let e=!1;for(let t of this.#N({allowStale:!0}))this.#S(t)&&(this.#O(this.#c[t],"expire"),e=!0);return e}info(e){let t=this.#h.get(e);if(t===void 0)return;let n=this.#i[t],s=this.#l(n)?n.__staleWhileFetching:n;if(s===void 0)return;let r={value:s};if(this.#g&&this.#E){let o=this.#g[t],a=this.#E[t];if(o&&a){let c=o-(this.#u.now()-a);r.ttl=c,r.start=Date.now()}}return this.#k&&(r.size=this.#k[t]),r}dump(){let e=[];for(let t of this.#A({allowStale:!0})){let n=this.#c[t],s=this.#i[t],r=this.#l(s)?s.__staleWhileFetching:s;if(r===void 0||n===void 0)continue;let o={value:r};if(this.#g&&this.#E){o.ttl=this.#g[t];let a=this.#u.now()-this.#E[t];o.start=Math.floor(Date.now()-a)}this.#k&&(o.size=this.#k[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let s=Date.now()-n.start;n.start=this.#u.now()-s}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:r,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=n,{noUpdateTTL:l=this.noUpdateTTL}=n,u=this.#F(e,t,n.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#O(e,"set"),this;let d=this.#a===0?void 0:this.#h.get(e);if(d===void 0)d=this.#a===0?this.#p:this.#R.length!==0?this.#R.pop():this.#a===this.#e?this.#z(!1):this.#a,this.#c[d]=e,this.#i[d]=t,this.#h.set(e,d),this.#f[this.#p]=d,this.#_[d]=this.#p,this.#p=d,this.#a++,this.#L(d,u,c),c&&(c.set="add"),l=!1,this.#M&&this.#s?.(t,e,"add");else{this.#I(d);let p=this.#i[d];if(t!==p){if(this.#C&&this.#l(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=p;f!==void 0&&!o&&(this.#x&&this.#r?.(f,e,"set"),this.#t&&this.#m?.push([f,e,"set"]))}else o||(this.#x&&this.#r?.(p,e,"set"),this.#t&&this.#m?.push([p,e,"set"]));if(this.#D(d),this.#L(d,u,c),this.#i[d]=t,c){c.set="replace";let f=p&&this.#l(p)?p.__staleWhileFetching:p;f!==void 0&&(c.oldValue=f)}}else c&&(c.set="update");this.#M&&this.onInsert?.(t,e,t===p?"update":"replace")}if(s!==0&&!this.#g&&this.#P(),this.#g&&(l||this.#$(d,s,r),c&&this.#j(c,d)),!o&&this.#t&&this.#m){let p=this.#m,f;for(;f=p?.shift();)this.#o?.(...f)}return this}pop(){try{for(;this.#a;){let e=this.#i[this.#v];if(this.#z(!0),this.#l(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#t&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#o?.(...t)}}}#z(e){let t=this.#v,n=this.#c[t],s=this.#i[t];return this.#C&&this.#l(s)?s.__abortController.abort(new Error("evicted")):(this.#x||this.#t)&&(this.#x&&this.#r?.(s,n,"evict"),this.#t&&this.#m?.push([s,n,"evict"])),this.#D(t),this.#w?.[t]&&(clearTimeout(this.#w[t]),this.#w[t]=void 0),e&&(this.#c[t]=void 0,this.#i[t]=void 0,this.#R.push(t)),this.#a===1?(this.#v=this.#p=0,this.#R.length=0):this.#v=this.#f[t],this.#h.delete(n),this.#a--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=t,r=this.#h.get(e);if(r!==void 0){let o=this.#i[r];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#S(r))s&&(s.has="stale",this.#j(s,r));else return n&&this.#T(r),s&&(s.has="hit",this.#j(s,r)),!0}else s&&(s.has="miss");return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,s=this.#h.get(e);if(s===void 0||!n&&this.#S(s))return;let r=this.#i[s];return this.#l(r)?r.__staleWhileFetching:r}#q(e,t,n,s){let r=t===void 0?void 0:this.#i[t];if(this.#l(r))return r;let o=new Li,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:s},l=(g,k=!1)=>{let{aborted:E}=o.signal,x=n.ignoreFetchAbort&&g!==void 0;if(n.status&&(E&&!k?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,x&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),E&&!x&&!k)return d(o.signal.reason);let b=f,S=this.#i[t];return(S===f||x&&k&&S===void 0)&&(g===void 0?b.__staleWhileFetching!==void 0?this.#i[t]=b.__staleWhileFetching:this.#O(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,g,c.options))),g},u=g=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=g),d(g)),d=g=>{let{aborted:k}=o.signal,E=k&&n.allowStaleOnFetchAbort,x=E||n.allowStaleOnFetchRejection,b=x||n.noDeleteOnFetchRejection,S=f;if(this.#i[t]===f&&(!b||S.__staleWhileFetching===void 0?this.#O(e,"fetch"):E||(this.#i[t]=S.__staleWhileFetching)),x)return n.status&&S.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),S.__staleWhileFetching;if(S.__returned===S)throw g},p=(g,k)=>{let E=this.#b?.(e,r,c);E&&E instanceof Promise&&E.then(x=>g(x===void 0?void 0:x),k),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(g(void 0),n.allowStaleOnFetchAbort&&(g=x=>l(x,!0)))})};n.status&&(n.status.fetchDispatched=!0);let f=new Promise(p).then(l,u),w=Object.assign(f,{__abortController:o,__staleWhileFetching:r,__returned:void 0});return t===void 0?(this.set(e,w,{...c.options,status:void 0}),t=this.#h.get(e)):this.#i[t]=w,w}#l(e){if(!this.#C)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Li}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:w=this.allowStaleOnFetchAbort,context:g,forceRefresh:k=!1,status:E,signal:x}=t;if(!this.#C)return E&&(E.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:r,status:E});let b={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:r,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:w,ignoreFetchAbort:f,status:E,signal:x},S=this.#h.get(e);if(S===void 0){E&&(E.fetch="miss");let O=this.#q(e,S,b,g);return O.__returned=O}else{let O=this.#i[S];if(this.#l(O)){let et=n&&O.__staleWhileFetching!==void 0;return E&&(E.fetch="inflight",et&&(E.returnedStale=!0)),et?O.__staleWhileFetching:O.__returned=O}let B=this.#S(S);if(!k&&!B)return E&&(E.fetch="hit"),this.#I(S),s&&this.#T(S),E&&this.#j(E,S),O;let K=this.#q(e,S,b,g),Te=K.__staleWhileFetching!==void 0&&n;return E&&(E.fetch=B?"stale":"refresh",Te&&B&&(E.returnedStale=!0)),Te?K.__staleWhileFetching:K.__returned=K}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let n=this.#y;if(!n)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:r,...o}=t,a=this.get(e,o);if(!r&&a!==void 0)return a;let c=n(e,a,{options:o,context:s});return this.set(e,c,o),c}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:o}=t,a=this.#h.get(e);if(a!==void 0){let c=this.#i[a],l=this.#l(c);return o&&this.#j(o,a),this.#S(a)?(o&&(o.get="stale"),l?(o&&n&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?c.__staleWhileFetching:void 0):(r||this.#O(e,"expire"),o&&n&&(o.returnedStale=!0),n?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#I(a),s&&this.#T(a),c))}else o&&(o.get="miss")}#B(e,t){this.#_[t]=e,this.#f[e]=t}#I(e){e!==this.#p&&(e===this.#v?this.#v=this.#f[e]:this.#B(this.#_[e],this.#f[e]),this.#B(this.#p,e),this.#p=e)}delete(e){return this.#O(e,"delete")}#O(e,t){let n=!1;if(this.#a!==0){let s=this.#h.get(e);if(s!==void 0)if(this.#w?.[s]&&(clearTimeout(this.#w?.[s]),this.#w[s]=void 0),n=!0,this.#a===1)this.#V(t);else{this.#D(s);let r=this.#i[s];if(this.#l(r)?r.__abortController.abort(new Error("deleted")):(this.#x||this.#t)&&(this.#x&&this.#r?.(r,e,t),this.#t&&this.#m?.push([r,e,t])),this.#h.delete(e),this.#c[s]=void 0,this.#i[s]=void 0,s===this.#p)this.#p=this.#_[s];else if(s===this.#v)this.#v=this.#f[s];else{let o=this.#_[s];this.#f[o]=this.#f[s];let a=this.#f[s];this.#_[a]=this.#_[s]}this.#a--,this.#R.push(s)}}if(this.#t&&this.#m?.length){let s=this.#m,r;for(;r=s?.shift();)this.#o?.(...r)}return n}clear(){return this.#V("delete")}#V(e){for(let t of this.#N({allowStale:!0})){let n=this.#i[t];if(this.#l(n))n.__abortController.abort(new Error("deleted"));else{let s=this.#c[t];this.#x&&this.#r?.(n,s,e),this.#t&&this.#m?.push([n,s,e])}}if(this.#h.clear(),this.#i.fill(void 0),this.#c.fill(void 0),this.#g&&this.#E){this.#g.fill(0),this.#E.fill(0);for(let t of this.#w??[])t!==void 0&&clearTimeout(t);this.#w?.fill(void 0)}if(this.#k&&this.#k.fill(0),this.#v=0,this.#p=0,this.#R.length=0,this.#d=0,this.#a=0,this.#t&&this.#m){let t=this.#m,n;for(;n=t?.shift();)this.#o?.(...n)}}};var _n=require("node:path"),ic=require("node:url"),Ke=require("fs"),rf=ht(require("node:fs"),1),St=require("node:fs/promises");var qi=require("node:events"),Br=ht(require("node:stream"),1),Qa=require("node:string_decoder"),Ha=typeof process=="object"&&process?process:{stdout:null,stderr:null},Jd=i=>!!i&&typeof i=="object"&&(i instanceof xt||i instanceof Br.default||Xd(i)||Yd(i)),Xd=i=>!!i&&typeof i=="object"&&i instanceof qi.EventEmitter&&typeof i.pipe=="function"&&i.pipe!==Br.default.Writable.prototype.pipe,Yd=i=>!!i&&typeof i=="object"&&i instanceof qi.EventEmitter&&typeof i.write=="function"&&typeof i.end=="function",ot=Symbol("EOF"),at=Symbol("maybeEmitEnd"),_t=Symbol("emittedEnd"),Ii=Symbol("emittingEnd"),Vn=Symbol("emittedError"),Di=Symbol("closed"),Ja=Symbol("read"),$i=Symbol("flush"),Xa=Symbol("flushChunk"),qe=Symbol("encoding"),vn=Symbol("decoder"),oe=Symbol("flowing"),Zn=Symbol("paused"),bn=Symbol("resume"),ae=Symbol("buffer"),xe=Symbol("pipes"),ce=Symbol("bufferLength"),Dr=Symbol("bufferPush"),Fi=Symbol("bufferShift"),we=Symbol("objectMode"),te=Symbol("destroyed"),$r=Symbol("error"),Fr=Symbol("emitData"),Ya=Symbol("emitEnd"),Wr=Symbol("emitEnd2"),Ye=Symbol("async"),zr=Symbol("abort"),Wi=Symbol("aborted"),Gn=Symbol("signal"),Gt=Symbol("dataListeners"),Ne=Symbol("discarded"),Hn=i=>Promise.resolve().then(i),Qd=i=>i(),Kd=i=>i==="end"||i==="finish"||i==="prefinish",ef=i=>i instanceof ArrayBuffer||!!i&&typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,tf=i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),zi=class{src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[bn](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},qr=class extends zi{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=s=>t.emit("error",s),e.on("error",this.proxyErrors)}},nf=i=>!!i.objectMode,sf=i=>!i.objectMode&&!!i.encoding&&i.encoding!=="buffer",xt=class extends qi.EventEmitter{[oe]=!1;[Zn]=!1;[xe]=[];[ae]=[];[we];[qe];[Ye];[vn];[ot]=!1;[_t]=!1;[Ii]=!1;[Di]=!1;[Vn]=null;[ce]=0;[te]=!1;[Gn];[Wi]=!1;[Gt]=0;[Ne]=!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");nf(t)?(this[we]=!0,this[qe]=null):sf(t)?(this[qe]=t.encoding,this[we]=!1):(this[we]=!1,this[qe]=null),this[Ye]=!!t.async,this[vn]=this[qe]?new Qa.StringDecoder(this[qe]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[ae]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[xe]});let{signal:n}=t;n&&(this[Gn]=n,n.aborted?this[zr]():n.addEventListener("abort",()=>this[zr]()))}get bufferLength(){return this[ce]}get encoding(){return this[qe]}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[we]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Ye]}set async(e){this[Ye]=this[Ye]||!!e}[zr](){this[Wi]=!0,this.emit("abort",this[Gn]?.reason),this.destroy(this[Gn]?.reason)}get aborted(){return this[Wi]}set aborted(e){}write(e,t,n){if(this[Wi])return!1;if(this[ot])throw new Error("write after end");if(this[te])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 s=this[Ye]?Hn:Qd;if(!this[we]&&!Buffer.isBuffer(e)){if(tf(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(ef(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[we]?(this[oe]&&this[ce]!==0&&this[$i](!0),this[oe]?this.emit("data",e):this[Dr](e),this[ce]!==0&&this.emit("readable"),n&&s(n),this[oe]):e.length?(typeof e=="string"&&!(t===this[qe]&&!this[vn]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[qe]&&(e=this[vn].write(e)),this[oe]&&this[ce]!==0&&this[$i](!0),this[oe]?this.emit("data",e):this[Dr](e),this[ce]!==0&&this.emit("readable"),n&&s(n),this[oe]):(this[ce]!==0&&this.emit("readable"),n&&s(n),this[oe])}read(e){if(this[te])return null;if(this[Ne]=!1,this[ce]===0||e===0||e&&e>this[ce])return this[at](),null;this[we]&&(e=null),this[ae].length>1&&!this[we]&&(this[ae]=[this[qe]?this[ae].join(""):Buffer.concat(this[ae],this[ce])]);let t=this[Ja](e||null,this[ae][0]);return this[at](),t}[Ja](e,t){if(this[we])this[Fi]();else{let n=t;e===n.length||e===null?this[Fi]():typeof n=="string"?(this[ae][0]=n.slice(e),t=n.slice(0,e),this[ce]-=e):(this[ae][0]=n.subarray(e),t=n.subarray(0,e),this[ce]-=e)}return this.emit("data",t),!this[ae].length&&!this[ot]&&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[ot]=!0,this.writable=!1,(this[oe]||!this[Zn])&&this[at](),this}[bn](){this[te]||(!this[Gt]&&!this[xe].length&&(this[Ne]=!0),this[Zn]=!1,this[oe]=!0,this.emit("resume"),this[ae].length?this[$i]():this[ot]?this[at]():this.emit("drain"))}resume(){return this[bn]()}pause(){this[oe]=!1,this[Zn]=!0,this[Ne]=!1}get destroyed(){return this[te]}get flowing(){return this[oe]}get paused(){return this[Zn]}[Dr](e){this[we]?this[ce]+=1:this[ce]+=e.length,this[ae].push(e)}[Fi](){return this[we]?this[ce]-=1:this[ce]-=this[ae][0].length,this[ae].shift()}[$i](e=!1){do;while(this[Xa](this[Fi]())&&this[ae].length);!e&&!this[ae].length&&!this[ot]&&this.emit("drain")}[Xa](e){return this.emit("data",e),this[oe]}pipe(e,t){if(this[te])return e;this[Ne]=!1;let n=this[_t];return t=t||{},e===Ha.stdout||e===Ha.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,n?t.end&&e.end():(this[xe].push(t.proxyErrors?new qr(this,e,t):new zi(this,e,t)),this[Ye]?Hn(()=>this[bn]()):this[bn]()),e}unpipe(e){let t=this[xe].find(n=>n.dest===e);t&&(this[xe].length===1?(this[oe]&&this[Gt]===0&&(this[oe]=!1),this[xe]=[]):this[xe].splice(this[xe].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[Ne]=!1,this[Gt]++,!this[xe].length&&!this[oe]&&this[bn]();else if(e==="readable"&&this[ce]!==0)super.emit("readable");else if(Kd(e)&&this[_t])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Vn]){let s=t;this[Ye]?Hn(()=>s.call(this,this[Vn])):s.call(this,this[Vn])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e==="data"&&(this[Gt]=this.listeners("data").length,this[Gt]===0&&!this[Ne]&&!this[xe].length&&(this[oe]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Gt]=0,!this[Ne]&&!this[xe].length&&(this[oe]=!1)),t}get emittedEnd(){return this[_t]}[at](){!this[Ii]&&!this[_t]&&!this[te]&&this[ae].length===0&&this[ot]&&(this[Ii]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Di]&&this.emit("close"),this[Ii]=!1)}emit(e,...t){let n=t[0];if(e!=="error"&&e!=="close"&&e!==te&&this[te])return!1;if(e==="data")return!this[we]&&!n?!1:this[Ye]?(Hn(()=>this[Fr](n)),!0):this[Fr](n);if(e==="end")return this[Ya]();if(e==="close"){if(this[Di]=!0,!this[_t]&&!this[te])return!1;let r=super.emit("close");return this.removeAllListeners("close"),r}else if(e==="error"){this[Vn]=n,super.emit($r,n);let r=!this[Gn]||this.listeners("error").length?super.emit("error",n):!1;return this[at](),r}else if(e==="resume"){let r=super.emit("resume");return this[at](),r}else if(e==="finish"||e==="prefinish"){let r=super.emit(e);return this.removeAllListeners(e),r}let s=super.emit(e,...t);return this[at](),s}[Fr](e){for(let n of this[xe])n.dest.write(e)===!1&&this.pause();let t=this[Ne]?!1:super.emit("data",e);return this[at](),t}[Ya](){return this[_t]?!1:(this[_t]=!0,this.readable=!1,this[Ye]?(Hn(()=>this[Wr]()),!0):this[Wr]())}[Wr](){if(this[vn]){let t=this[vn].end();if(t){for(let n of this[xe])n.dest.write(t);this[Ne]||super.emit("data",t)}}for(let t of this[xe])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[we]||(e.dataLength=0);let t=this.promise();return this.on("data",n=>{e.push(n),this[we]||(e.dataLength+=n.length)}),await t,e}async concat(){if(this[we])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[qe]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(te,()=>t(new Error("stream destroyed"))),this.on("error",n=>t(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Ne]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[ot])return t();let r,o,a=d=>{this.off("data",c),this.off("end",l),this.off(te,u),t(),o(d)},c=d=>{this.off("error",a),this.off("end",l),this.off(te,u),this.pause(),r({value:d,done:!!this[ot]})},l=()=>{this.off("error",a),this.off("data",c),this.off(te,u),t(),r({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((d,p)=>{o=p,r=d,this.once(te,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Ne]=!1;let e=!1,t=()=>(this.pause(),this.off($r,t),this.off(te,t),this.off("end",t),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return t();let s=this.read();return s===null?t():{done:!1,value:s}};return this.once("end",t),this.once($r,t),this.once(te,t),{next:n,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[te])return e?this.emit("error",e):this.emit(te),this;this[te]=!0,this[Ne]=!0,this[ae].length=0,this[ce]=0;let t=this;return typeof t.close=="function"&&!this[Di]&&t.close(),e?this.emit("error",e):this.emit(te),this}static get isStream(){return Jd}};var of=Ke.realpathSync.native,Xn={lstatSync:Ke.lstatSync,readdir:Ke.readdir,readdirSync:Ke.readdirSync,readlinkSync:Ke.readlinkSync,realpathSync:of,promises:{lstat:St.lstat,readdir:St.readdir,readlink:St.readlink,realpath:St.realpath}},sc=i=>!i||i===Xn||i===rf?Xn:{...Xn,...i,promises:{...Xn.promises,...i.promises||{}}},rc=/^\\\\\?\\([a-z]:)\\?$/i,af=i=>i.replace(/\//g,"\\").replace(rc,"$1\\"),cf=/[\\\/]/,$e=0,oc=1,ac=2,Qe=4,cc=6,lc=8,Ht=10,uc=12,De=15,Jn=~De,Ur=16,Ka=32,Yn=64,Be=128,Bi=256,Vi=512,ec=Yn|Be|Vi,lf=1023,Vr=i=>i.isFile()?lc:i.isDirectory()?Qe:i.isSymbolicLink()?Ht:i.isCharacterDevice()?ac:i.isBlockDevice()?cc:i.isSocket()?uc:i.isFIFO()?oc:$e,tc=new Zt({max:2**12}),Qn=i=>{let e=tc.get(i);if(e)return e;let t=i.normalize("NFKD");return tc.set(i,t),t},nc=new Zt({max:2**12}),Ui=i=>{let e=nc.get(i);if(e)return e;let t=Qn(i.toLowerCase());return nc.set(i,t),t},Zi=class extends Zt{constructor(){super({max:256})}},Zr=class extends Zt{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},hc=Symbol("PathScurry setAsCwd"),ve=class{name;root;roots;parent;nocase;isCWD=!1;#e;#n;get dev(){return this.#n}#r;get mode(){return this.#r}#s;get nlink(){return this.#s}#o;get uid(){return this.#o}#b;get gid(){return this.#b}#y;get rdev(){return this.#y}#u;get blksize(){return this.#u}#a;get ino(){return this.#a}#d;get size(){return this.#d}#h;get blocks(){return this.#h}#c;get atimeMs(){return this.#c}#i;get mtimeMs(){return this.#i}#f;get ctimeMs(){return this.#f}#_;get birthtimeMs(){return this.#_}#v;get atime(){return this.#v}#p;get mtime(){return this.#p}#R;get ctime(){return this.#R}#m;get birthtime(){return this.#m}#k;#E;#g;#w;#x;#C;#t;#M;#P;#T;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=$e,n,s,r,o,a){this.name=e,this.#k=r?Ui(e):Qn(e),this.#t=t&lf,this.nocase=r,this.roots=s,this.root=n||this,this.#M=o,this.#g=a.fullpath,this.#x=a.relative,this.#C=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=sc(a.fs)}depth(){return this.#E!==void 0?this.#E:this.parent?this.#E=this.parent.depth()+1:this.#E=0}childrenCache(){return this.#M}resolve(e){if(!e)return this;let t=this.getRootString(e),s=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#j(s):this.#j(s)}#j(e){let t=this;for(let n of e)t=t.child(n);return t}children(){let e=this.#M.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#M.set(this,t),this.#t&=~Ur,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),s=this.nocase?Ui(e):Qn(e);for(let c of n)if(c.#k===s)return c;let r=this.parent?this.sep:"",o=this.#g?this.#g+r+e:void 0,a=this.newChild(e,$e,{...t,parent:this,fullpath:o});return this.canReaddir()||(a.#t|=Be),n.push(a),a}relative(){if(this.isCWD)return"";if(this.#x!==void 0)return this.#x;let e=this.name,t=this.parent;if(!t)return this.#x=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.#C!==void 0)return this.#C;let e=this.name,t=this.parent;if(!t)return this.#C=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?"":"/")+e}fullpath(){if(this.#g!==void 0)return this.#g;let e=this.name,t=this.parent;if(!t)return this.#g=this.name;let s=t.fullpath()+(t.parent?this.sep:"")+e;return this.#g=s}fullpathPosix(){if(this.#w!==void 0)return this.#w;if(this.sep==="/")return this.#w=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#w=`//?/${s}`:this.#w=s}let e=this.parent,t=e.fullpathPosix(),n=t+(!t||!e.parent?"":"/")+this.name;return this.#w=n}isUnknown(){return(this.#t&De)===$e}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.#t&De)===lc}isDirectory(){return(this.#t&De)===Qe}isCharacterDevice(){return(this.#t&De)===ac}isBlockDevice(){return(this.#t&De)===cc}isFIFO(){return(this.#t&De)===oc}isSocket(){return(this.#t&De)===uc}isSymbolicLink(){return(this.#t&Ht)===Ht}lstatCached(){return this.#t&Ka?this:void 0}readlinkCached(){return this.#P}realpathCached(){return this.#T}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#P)return!0;if(!this.parent)return!1;let e=this.#t&De;return!(e!==$e&&e!==Ht||this.#t&Bi||this.#t&Be)}calledReaddir(){return!!(this.#t&Ur)}isENOENT(){return!!(this.#t&Be)}isNamed(e){return this.nocase?this.#k===Ui(e):this.#k===Qn(e)}async readlink(){let e=this.#P;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(t);if(n)return this.#P=n}catch(t){this.#N(t.code);return}}readlinkSync(){let e=this.#P;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(t);if(n)return this.#P=n}catch(t){this.#N(t.code);return}}#$(e){this.#t|=Ur;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#S()}}#S(){this.#t&Be||(this.#t=(this.#t|Be)&Jn,this.#U())}#U(){let e=this.children();e.provisional=0;for(let t of e)t.#S()}#D(){this.#t|=Vi,this.#L()}#L(){if(this.#t&Yn)return;let e=this.#t;(e&De)===Qe&&(e&=Jn),this.#t=e|Yn,this.#U()}#F(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#S():this.children().provisional=0}#A(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#S()}#N(e=""){let t=this.#t;t|=Bi,e==="ENOENT"&&(t|=Be),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Jn),this.#t=t,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#W(e,t){return this.#q(e,t)||this.#z(e,t)}#z(e,t){let n=Vr(e),s=this.newChild(e.name,n,{parent:this}),r=s.#t&De;return r!==Qe&&r!==Ht&&r!==$e&&(s.#t|=Yn),t.unshift(s),t.provisional++,s}#q(e,t){for(let n=t.provisional;n<t.length;n++){let s=t[n];if((this.nocase?Ui(e.name):Qn(e.name))===s.#k)return this.#l(e,s,n,t)}}#l(e,t,n,s){let r=t.name;return t.#t=t.#t&Jn|Vr(e),r!==e.name&&(t.name=e.name),n!==s.provisional&&(n===s.length-1?s.pop():s.splice(n,1),s.unshift(t)),s.provisional++,t}async lstat(){if((this.#t&Be)===0)try{return this.#B(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#A(e.code)}}lstatSync(){if((this.#t&Be)===0)try{return this.#B(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#A(e.code)}}#B(e){let{atime:t,atimeMs:n,birthtime:s,birthtimeMs:r,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:d,ino:p,mode:f,mtime:w,mtimeMs:g,nlink:k,rdev:E,size:x,uid:b}=e;this.#v=t,this.#c=n,this.#m=s,this.#_=r,this.#u=o,this.#h=a,this.#R=c,this.#f=l,this.#n=u,this.#b=d,this.#a=p,this.#r=f,this.#p=w,this.#i=g,this.#s=k,this.#y=E,this.#d=x,this.#o=b;let S=Vr(e);this.#t=this.#t&Jn|S|Ka,S!==$e&&S!==Qe&&S!==Ht&&(this.#t|=Yn)}#I=[];#O=!1;#V(e){this.#O=!1;let t=this.#I.slice();this.#I.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 r=n.slice(0,n.provisional);t?e(null,r):queueMicrotask(()=>e(null,r));return}if(this.#I.push(e),this.#O)return;this.#O=!0;let s=this.fullpath();this.#e.readdir(s,{withFileTypes:!0},(r,o)=>{if(r)this.#F(r.code),n.provisional=0;else{for(let a of o)this.#W(a,n);this.#$(n)}this.#V(n.slice(0,n.provisional))})}#Z;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.#Z)await this.#Z;else{let n=()=>{};this.#Z=new Promise(s=>n=s);try{for(let s of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#W(s,e);this.#$(e)}catch(s){this.#F(s.code),e.provisional=0}this.#Z=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.#e.readdirSync(t,{withFileTypes:!0}))this.#W(n,e);this.#$(e)}catch(n){this.#F(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#t&ec)return!1;let e=De&this.#t;return e===$e||e===Qe||e===Ht}shouldWalk(e,t){return(this.#t&Qe)===Qe&&!(this.#t&ec)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#T)return this.#T;if(!((Vi|Bi|Be)&this.#t))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#T=this.resolve(e)}catch{this.#D()}}realpathSync(){if(this.#T)return this.#T;if(!((Vi|Bi|Be)&this.#t))try{let e=this.#e.realpathSync(this.fullpath());return this.#T=this.resolve(e)}catch{this.#D()}}[hc](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],s=this;for(;s&&s.parent;)t.add(s),s.#x=n.join(this.sep),s.#C=n.join("/"),s=s.parent,n.push("..");for(s=e;s&&s.parent&&!t.has(s);)s.#x=void 0,s.#C=void 0,s=s.parent}},Gi=class i extends ve{sep="\\";splitSep=cf;constructor(e,t=$e,n,s,r,o,a){super(e,t,n,s,r,o,a)}newChild(e,t=$e,n={}){return new i(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return _n.win32.parse(e).root}getRoot(e){if(e=af(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 xn(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(rc,"$1\\"),e===t}},Hi=class i extends ve{splitSep="/";sep="/";constructor(e,t=$e,n,s,r,o,a){super(e,t,n,s,r,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=$e,n={}){return new i(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Ji=class{root;rootPath;roots;cwd;#e;#n;#r;nocase;#s;constructor(e=process.cwd(),t,n,{nocase:s,childrenCacheSize:r=16*1024,fs:o=Xn}={}){this.#s=sc(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,ic.fileURLToPath)(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new Zi,this.#n=new Zi,this.#r=new Zr(r);let c=a.substring(this.rootPath.length).split(n);if(c.length===1&&!c[0]&&c.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#s),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,d=t.sep,p=this.rootPath,f=!1;for(let w of c){let g=u--;l=l.child(w,{relative:new Array(g).fill("..").join(d),relativePosix:new Array(g).fill("..").join("/"),fullpath:p+=(f?"":d)+w}),f=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let t="";for(let r=e.length-1;r>=0;r--){let o=e[r];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#e.get(t);if(n!==void 0)return n;let s=this.cwd.resolve(t).fullpath();return this.#e.set(t,s),s}resolvePosix(...e){let t="";for(let r=e.length-1;r>=0;r--){let o=e[r];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#n.get(t);if(n!==void 0)return n;let s=this.cwd.resolve(t).fullpathPosix();return this.#n.set(t,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let s=await e.readdir();return n?s:s.map(r=>r.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(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 ve||(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 ve||(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 ve||(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 ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t,a=[];(!r||r(e))&&a.push(n?e:e.fullpath());let c=new Set,l=(d,p)=>{c.add(d),d.readdirCB((f,w)=>{if(f)return p(f);let g=w.length;if(!g)return p();let k=()=>{--g===0&&p()};for(let E of w)(!r||r(E))&&a.push(n?E:E.fullpath()),s&&E.isSymbolicLink()?E.realpath().then(x=>x?.isUnknown()?x.lstat():x).then(x=>x?.shouldWalk(c,o)?l(x,k):k()):E.shouldWalk(c,o)?l(E,k):k()},!0)},u=e;return new Promise((d,p)=>{l(u,f=>{if(f)return p(f);d(a)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t,a=[];(!r||r(e))&&a.push(n?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let d of u){(!r||r(d))&&a.push(n?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(s&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(c,o)&&c.add(p)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(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 ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t;(!r||r(e))&&(yield n?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!r||r(u))&&(yield n?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(s&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(a,o)&&a.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t,a=new xt({objectMode:!0});(!r||r(e))&&a.write(n?e:e.fullpath());let c=new Set,l=[e],u=0,d=()=>{let p=!1;for(;!p;){let f=l.shift();if(!f){u===0&&a.end();return}u++,c.add(f);let w=(k,E,x=!1)=>{if(k)return a.emit("error",k);if(s&&!x){let b=[];for(let S of E)S.isSymbolicLink()&&b.push(S.realpath().then(O=>O?.isUnknown()?O.lstat():O));if(b.length){Promise.all(b).then(()=>w(null,E,!0));return}}for(let b of E)b&&(!r||r(b))&&(a.write(n?b:b.fullpath())||(p=!0));u--;for(let b of E){let S=b.realpathCached()||b;S.shouldWalk(c,o)&&l.push(S)}p&&!a.flowing?a.once("drain",d):g||d()},g=!0;f.readdirCB(w,!0),g=!1}};return d(),a}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ve||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:r,walkFilter:o}=t,a=new xt({objectMode:!0}),c=new Set;(!r||r(e))&&a.write(n?e:e.fullpath());let l=[e],u=0,d=()=>{let p=!1;for(;!p;){let f=l.shift();if(!f){u===0&&a.end();return}u++,c.add(f);let w=f.readdirSync();for(let g of w)(!r||r(g))&&(a.write(n?g:g.fullpath())||(p=!0));u--;for(let g of w){let k=g;if(g.isSymbolicLink()){if(!(s&&(k=g.realpathSync())))continue;k.isUnknown()&&k.lstatSync()}k.shouldWalk(c,o)&&l.push(k)}}p&&!a.flowing&&a.once("drain",d)};return d(),a}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[hc](t)}},xn=class extends Ji{sep="\\";constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,_n.win32,"\\",{...t,nocase:n}),this.nocase=n;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(e){return _n.win32.parse(e).root.toUpperCase()}newRoot(e){return new Gi(this.rootPath,Qe,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Sn=class extends Ji{sep="/";constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,_n.posix,"/",{...t,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new Hi(this.rootPath,Qe,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Kn=class extends Sn{constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}},Em=process.platform==="win32"?Gi:Hi,dc=process.platform==="win32"?xn:process.platform==="darwin"?Kn:Sn;var uf=i=>i.length>=1,hf=i=>i.length>=1,kn=class i{#e;#n;#r;length;#s;#o;#b;#y;#u;#a;#d=!0;constructor(e,t,n,s){if(!uf(e))throw new TypeError("empty pattern list");if(!hf(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.#e=e,this.#n=t,this.#r=n,this.#s=s,this.#r===0){if(this.isUNC()){let[r,o,a,c,...l]=this.#e,[u,d,p,f,...w]=this.#n;l[0]===""&&(l.shift(),w.shift());let g=[r,o,a,c,""].join("/"),k=[u,d,p,f,""].join("/");this.#e=[g,...l],this.#n=[k,...w],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[r,...o]=this.#e,[a,...c]=this.#n;o[0]===""&&(o.shift(),c.shift());let l=r+"/",u=a+"/";this.#e=[l,...o],this.#n=[u,...c],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===de}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#b=this.#b||(this.#r===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new i(this.#e,this.#n,this.#r+1,this.#s),this.#o.#a=this.#a,this.#o.#u=this.#u,this.#o.#y=this.#y,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#u!==void 0?this.#u:this.#u=this.#s==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#y!==void 0?this.#y:this.#y=this.#s==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#d)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#d?!1:(this.#d=!1,!0)}};var df=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",En=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:s,noglobstar:r,platform:o=df}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,noext:s,noglobstar:r,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let t=new Ae(e,this.mmopts);for(let n=0;n<t.set.length;n++){let s=t.set[n],r=t.globParts[n];if(!s||!r)throw new Error("invalid pattern object");for(;s[0]==="."&&r[0]===".";)s.shift(),r.shift();let o=new kn(s,r,0,this.platform),a=new Ae(o.globString(),this.mmopts),c=r[r.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),c&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let t=e.fullpath(),n=`${t}/`,s=e.relative()||".",r=`${s}/`;for(let o of this.relative)if(o.match(s)||o.match(r))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 s of this.relativeChildren)if(s.match(n))return!0;for(let s of this.absoluteChildren)if(s.match(t))return!0;return!1}};var Gr=class i{store;constructor(e=new Map){this.store=e}copy(){return new i(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),s=this.store.get(n);s?s.add(t.globString()):this.store.set(n,new Set([t.globString()]))}},Hr=class{store=new Map;add(e,t,n){let s=(t?2:0)|(n?1:0),r=this.store.get(e);this.store.set(e,r===void 0?s:s&r)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},Jr=class{store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(s=>s.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())}},ei=class i{hasWalkedCache;matches=new Hr;subwalks=new Jr;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new Gr}processPatterns(e,t){this.patterns=t;let n=t.map(s=>[e,s]);for(let[s,r]of n){this.hasWalkedCache.storeWalked(s,r);let o=r.root(),a=r.isAbsolute()&&this.opts.absolute!==!1;if(o){s=s.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=r.rest();if(d)r=d;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let c,l,u=!1;for(;typeof(c=r.pattern())=="string"&&(l=r.rest());)s=s.resolve(c),r=l,u=!0;if(c=r.pattern(),l=r.rest(),u){if(this.hasWalkedCache.hasWalked(s,r))continue;this.hasWalkedCache.storeWalked(s,r)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(s.resolve(c),a,d);continue}else if(c===de){(!s.isSymbolicLink()||this.follow||r.checkFollowGlobstar())&&this.subwalks.add(s,r);let d=l?.pattern(),p=l?.rest();if(!l||(d===""||d===".")&&!p)this.matches.add(s,a,d===""||d===".");else if(d===".."){let f=s.parent||s;p?this.hasWalkedCache.hasWalked(f,p)||this.subwalks.add(f,p):this.matches.add(f,a,!0)}}else c instanceof RegExp&&this.subwalks.add(s,r)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new i(this.opts,this.hasWalkedCache)}filterEntries(e,t){let n=this.subwalks.get(e),s=this.child();for(let r of t)for(let o of n){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===de?s.testGlobstar(r,o,l,a):c instanceof RegExp?s.testRegExp(r,c,l,a):s.testString(r,c,l,a)}return s}testGlobstar(e,t,n,s){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,s,!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 r=n.pattern();if(typeof r=="string"&&r!==".."&&r!==""&&r!==".")this.testString(e,r,n.rest(),s);else if(r===".."){let o=e.parent||e;this.subwalks.add(o,n)}else r instanceof RegExp&&this.testRegExp(e,r,n.rest(),s)}}testRegExp(e,t,n,s){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,s,!1))}testString(e,t,n,s){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,s,!1))}};var ff=(i,e)=>typeof i=="string"?new En([i],e):Array.isArray(i)?new En(i,e):i,Xi=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#n;#r;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#r=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#n=ff(n.ignore??[],n),!this.includeChildMatches&&typeof this.#n.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#s(e){return this.seen.has(e)||!!this.#n?.ignored?.(e)}#o(e){return!!this.#n?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.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 r=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=await r.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(r,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.#s(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 r=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let o=r.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(r,t)}matchFinish(e,t){if(this.#s(e))return;if(!this.includeChildMatches&&this.#n?.add){let r=`${e.relativePosix()}/**`;this.#n.add(r)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let r=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(r+s)}else{let r=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!r.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(r?o+r+s:"."+s)}}async match(e,t,n){let s=await this.matchCheck(e,n);s&&this.matchFinish(s,t)}matchSync(e,t,n){let s=this.matchCheckSync(e,n);s&&this.matchFinish(s,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new ei(this.opts),n)}walkCB2(e,t,n,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,s));return}n.processPatterns(e,t);let r=1,o=()=>{--r===0&&s()};for(let[a,c,l]of n.matches.entries())this.#s(a)||(r++,this.match(a,c,l).then(()=>o()));for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,n,o):a.readdirCB((l,u)=>this.walkCB3(a,u,n,o),!0)}o()}walkCB3(e,t,n,s){n=n.filterEntries(e,t);let r=1,o=()=>{--r===0&&s()};for(let[a,c,l]of n.matches.entries())this.#s(a)||(r++,this.match(a,c,l).then(()=>o()));for(let[a,c]of n.subwalks.entries())r++,this.walkCB2(a,c,n.child(),o);o()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new ei(this.opts),n)}walkCB2Sync(e,t,n,s){if(this.#o(e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,s));return}n.processPatterns(e,t);let r=1,o=()=>{--r===0&&s()};for(let[a,c,l]of n.matches.entries())this.#s(a)||this.matchSync(a,c,l);for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;r++;let c=a.readdirSync();this.walkCB3Sync(a,c,n,o)}o()}walkCB3Sync(e,t,n,s){n=n.filterEntries(e,t);let r=1,o=()=>{--r===0&&s()};for(let[a,c,l]of n.matches.entries())this.#s(a)||this.matchSync(a,c,l);for(let[a,c]of n.subwalks.entries())r++,this.walkCB2Sync(a,c,n.child(),o);o()}},ti=class extends Xi{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}},ni=class extends Xi{results;constructor(e,t,n){super(e,t,n),this.results=new xt({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 pf=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ue=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,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,fc.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(c=>c.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=t.platform||pf,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 c=t.platform==="win32"?xn:t.platform==="darwin"?Kn:t.platform?Sn:dc;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",s={...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},r=this.pattern.map(c=>new Ae(c,s)),[o,a]=r.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=o.map((c,l)=>{let u=a[l];if(!u)throw new Error("invalid pattern object");return new kn(c,u,0,this.platform)})}async walk(){return[...await new ti(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 ti(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 ni(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 ni(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 Xr=(i,e={})=>{Array.isArray(i)||(i=[i]);for(let t of i)if(new Ae(t,e).hasMagic())return!0;return!1};function Yi(i,e={}){return new Ue(i,e).streamSync()}function gc(i,e={}){return new Ue(i,e).stream()}function Qi(i,e={}){return new Ue(i,e).walkSync()}async function pc(i,e={}){return new Ue(i,e).walk()}function Ki(i,e={}){return new Ue(i,e).iterateSync()}function yc(i,e={}){return new Ue(i,e).iterate()}var mf=Yi,gf=Object.assign(gc,{sync:Yi}),yf=Ki,wf=Object.assign(yc,{sync:Ki}),vf=Object.assign(Qi,{stream:Yi,iterate:Ki}),mc=Object.assign(pc,{glob:pc,globSync:Qi,sync:vf,globStream:gc,stream:gf,globStreamSync:Yi,streamSync:mf,globIterate:yc,iterate:wf,globIterateSync:Ki,iterateSync:yf,Glob:Ue,hasMagic:Xr,escape:yn,unescape:ze});mc.glob=mc;var Yr={name:"dts-linter",version:"0.3.11-beta2",main:"index.js",repository:{type:"git",url:"https://github.com/kylebonnici/dts-linter"},scripts:{compile:"node ./esbuild.js","compile:prod":"node ./esbuild.js --production"},bin:"./dist/dts-linter.js",files:["dist/dts-linter.js","THIRD_PARTY_LICENSES.txt"],keywords:["dts","linter","devicetree","formatting"],author:"Kyle Micallef Bonnici",license:"Apache-2.0",description:"",dependencies:{"devicetree-language-server":"^0.8.0-beta3"},devDependencies:{"@types/node":"^24.0.3","devicetree-language-server-types":"^0.0.2-alpha.8",diff:"^8.0.2",esbuild:"^0.25.5",glob:"^13.0.0","license-checker":"^25.0.1","ts-node":"^10.9.2",typescript:"^5.8.3","vscode-jsonrpc":"^8.2.1","vscode-languageserver-types":"^3.17.5",zod:"^3.25.67"}};var wc;(function(i){function e(t){return typeof t=="string"}i.is=e})(wc||(wc={}));var Qr;(function(i){function e(t){return typeof t=="string"}i.is=e})(Qr||(Qr={}));var vc;(function(i){i.MIN_VALUE=-2147483648,i.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&i.MIN_VALUE<=t&&t<=i.MAX_VALUE}i.is=e})(vc||(vc={}));var es;(function(i){i.MIN_VALUE=0,i.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&i.MIN_VALUE<=t&&t<=i.MAX_VALUE}i.is=e})(es||(es={}));var Ve;(function(i){function e(n,s){return n===Number.MAX_VALUE&&(n=es.MAX_VALUE),s===Number.MAX_VALUE&&(s=es.MAX_VALUE),{line:n,character:s}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.uinteger(s.line)&&m.uinteger(s.character)}i.is=t})(Ve||(Ve={}));var ne;(function(i){function e(n,s,r,o){if(m.uinteger(n)&&m.uinteger(s)&&m.uinteger(r)&&m.uinteger(o))return{start:Ve.create(n,s),end:Ve.create(r,o)};if(Ve.is(n)&&Ve.is(s))return{start:n,end:s};throw new Error(`Range#create called with invalid arguments[${n}, ${s}, ${r}, ${o}]`)}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&Ve.is(s.start)&&Ve.is(s.end)}i.is=t})(ne||(ne={}));var ts;(function(i){function e(n,s){return{uri:n,range:s}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&ne.is(s.range)&&(m.string(s.uri)||m.undefined(s.uri))}i.is=t})(ts||(ts={}));var bc;(function(i){function e(n,s,r,o){return{targetUri:n,targetRange:s,targetSelectionRange:r,originSelectionRange:o}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&ne.is(s.targetRange)&&m.string(s.targetUri)&&ne.is(s.targetSelectionRange)&&(ne.is(s.originSelectionRange)||m.undefined(s.originSelectionRange))}i.is=t})(bc||(bc={}));var Kr;(function(i){function e(n,s,r,o){return{red:n,green:s,blue:r,alpha:o}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.numberRange(s.red,0,1)&&m.numberRange(s.green,0,1)&&m.numberRange(s.blue,0,1)&&m.numberRange(s.alpha,0,1)}i.is=t})(Kr||(Kr={}));var _c;(function(i){function e(n,s){return{range:n,color:s}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&ne.is(s.range)&&Kr.is(s.color)}i.is=t})(_c||(_c={}));var xc;(function(i){function e(n,s,r){return{label:n,textEdit:s,additionalTextEdits:r}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.string(s.label)&&(m.undefined(s.textEdit)||Tn.is(s))&&(m.undefined(s.additionalTextEdits)||m.typedArray(s.additionalTextEdits,Tn.is))}i.is=t})(xc||(xc={}));var Sc;(function(i){i.Comment="comment",i.Imports="imports",i.Region="region"})(Sc||(Sc={}));var kc;(function(i){function e(n,s,r,o,a,c){let l={startLine:n,endLine:s};return m.defined(r)&&(l.startCharacter=r),m.defined(o)&&(l.endCharacter=o),m.defined(a)&&(l.kind=a),m.defined(c)&&(l.collapsedText=c),l}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.uinteger(s.startLine)&&m.uinteger(s.startLine)&&(m.undefined(s.startCharacter)||m.uinteger(s.startCharacter))&&(m.undefined(s.endCharacter)||m.uinteger(s.endCharacter))&&(m.undefined(s.kind)||m.string(s.kind))}i.is=t})(kc||(kc={}));var eo;(function(i){function e(n,s){return{location:n,message:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&ts.is(s.location)&&m.string(s.message)}i.is=t})(eo||(eo={}));var fe;(function(i){i.Error=1,i.Warning=2,i.Information=3,i.Hint=4})(fe||(fe={}));var Ec;(function(i){i.Unnecessary=1,i.Deprecated=2})(Ec||(Ec={}));var Cc;(function(i){function e(t){let n=t;return m.objectLiteral(n)&&m.string(n.href)}i.is=e})(Cc||(Cc={}));var ns;(function(i){function e(n,s,r,o,a,c){let l={range:n,message:s};return m.defined(r)&&(l.severity=r),m.defined(o)&&(l.code=o),m.defined(a)&&(l.source=a),m.defined(c)&&(l.relatedInformation=c),l}i.create=e;function t(n){var s;let r=n;return m.defined(r)&&ne.is(r.range)&&m.string(r.message)&&(m.number(r.severity)||m.undefined(r.severity))&&(m.integer(r.code)||m.string(r.code)||m.undefined(r.code))&&(m.undefined(r.codeDescription)||m.string((s=r.codeDescription)===null||s===void 0?void 0:s.href))&&(m.string(r.source)||m.undefined(r.source))&&(m.undefined(r.relatedInformation)||m.typedArray(r.relatedInformation,eo.is))}i.is=t})(ns||(ns={}));var Cn;(function(i){function e(n,s,...r){let o={title:n,command:s};return m.defined(r)&&r.length>0&&(o.arguments=r),o}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.title)&&m.string(s.command)}i.is=t})(Cn||(Cn={}));var Tn;(function(i){function e(r,o){return{range:r,newText:o}}i.replace=e;function t(r,o){return{range:{start:r,end:r},newText:o}}i.insert=t;function n(r){return{range:r,newText:""}}i.del=n;function s(r){let o=r;return m.objectLiteral(o)&&m.string(o.newText)&&ne.is(o.range)}i.is=s})(Tn||(Tn={}));var to;(function(i){function e(n,s,r){let o={label:n};return s!==void 0&&(o.needsConfirmation=s),r!==void 0&&(o.description=r),o}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&m.string(s.label)&&(m.boolean(s.needsConfirmation)||s.needsConfirmation===void 0)&&(m.string(s.description)||s.description===void 0)}i.is=t})(to||(to={}));var Rn;(function(i){function e(t){let n=t;return m.string(n)}i.is=e})(Rn||(Rn={}));var Tc;(function(i){function e(r,o,a){return{range:r,newText:o,annotationId:a}}i.replace=e;function t(r,o,a){return{range:{start:r,end:r},newText:o,annotationId:a}}i.insert=t;function n(r,o){return{range:r,newText:"",annotationId:o}}i.del=n;function s(r){let o=r;return Tn.is(o)&&(to.is(o.annotationId)||Rn.is(o.annotationId))}i.is=s})(Tc||(Tc={}));var no;(function(i){function e(n,s){return{textDocument:n,edits:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&ao.is(s.textDocument)&&Array.isArray(s.edits)}i.is=t})(no||(no={}));var io;(function(i){function e(n,s,r){let o={kind:"create",uri:n};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(o.options=s),r!==void 0&&(o.annotationId=r),o}i.create=e;function t(n){let s=n;return s&&s.kind==="create"&&m.string(s.uri)&&(s.options===void 0||(s.options.overwrite===void 0||m.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||m.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Rn.is(s.annotationId))}i.is=t})(io||(io={}));var so;(function(i){function e(n,s,r,o){let a={kind:"rename",oldUri:n,newUri:s};return r!==void 0&&(r.overwrite!==void 0||r.ignoreIfExists!==void 0)&&(a.options=r),o!==void 0&&(a.annotationId=o),a}i.create=e;function t(n){let s=n;return s&&s.kind==="rename"&&m.string(s.oldUri)&&m.string(s.newUri)&&(s.options===void 0||(s.options.overwrite===void 0||m.boolean(s.options.overwrite))&&(s.options.ignoreIfExists===void 0||m.boolean(s.options.ignoreIfExists)))&&(s.annotationId===void 0||Rn.is(s.annotationId))}i.is=t})(so||(so={}));var ro;(function(i){function e(n,s,r){let o={kind:"delete",uri:n};return s!==void 0&&(s.recursive!==void 0||s.ignoreIfNotExists!==void 0)&&(o.options=s),r!==void 0&&(o.annotationId=r),o}i.create=e;function t(n){let s=n;return s&&s.kind==="delete"&&m.string(s.uri)&&(s.options===void 0||(s.options.recursive===void 0||m.boolean(s.options.recursive))&&(s.options.ignoreIfNotExists===void 0||m.boolean(s.options.ignoreIfNotExists)))&&(s.annotationId===void 0||Rn.is(s.annotationId))}i.is=t})(ro||(ro={}));var oo;(function(i){function e(t){let n=t;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(s=>m.string(s.kind)?io.is(s)||so.is(s)||ro.is(s):no.is(s)))}i.is=e})(oo||(oo={}));var Rc;(function(i){function e(n){return{uri:n}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.uri)}i.is=t})(Rc||(Rc={}));var Oc;(function(i){function e(n,s){return{uri:n,version:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.uri)&&m.integer(s.version)}i.is=t})(Oc||(Oc={}));var ao;(function(i){function e(n,s){return{uri:n,version:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.uri)&&(s.version===null||m.integer(s.version))}i.is=t})(ao||(ao={}));var Ac;(function(i){function e(n,s,r,o){return{uri:n,languageId:s,version:r,text:o}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.string(s.uri)&&m.string(s.languageId)&&m.integer(s.version)&&m.string(s.text)}i.is=t})(Ac||(Ac={}));var co;(function(i){i.PlainText="plaintext",i.Markdown="markdown";function e(t){let n=t;return n===i.PlainText||n===i.Markdown}i.is=e})(co||(co={}));var ii;(function(i){function e(t){let n=t;return m.objectLiteral(t)&&co.is(n.kind)&&m.string(n.value)}i.is=e})(ii||(ii={}));var Nc;(function(i){i.Text=1,i.Method=2,i.Function=3,i.Constructor=4,i.Field=5,i.Variable=6,i.Class=7,i.Interface=8,i.Module=9,i.Property=10,i.Unit=11,i.Value=12,i.Enum=13,i.Keyword=14,i.Snippet=15,i.Color=16,i.File=17,i.Reference=18,i.Folder=19,i.EnumMember=20,i.Constant=21,i.Struct=22,i.Event=23,i.Operator=24,i.TypeParameter=25})(Nc||(Nc={}));var Pc;(function(i){i.PlainText=1,i.Snippet=2})(Pc||(Pc={}));var jc;(function(i){i.Deprecated=1})(jc||(jc={}));var Mc;(function(i){function e(n,s,r){return{newText:n,insert:s,replace:r}}i.create=e;function t(n){let s=n;return s&&m.string(s.newText)&&ne.is(s.insert)&&ne.is(s.replace)}i.is=t})(Mc||(Mc={}));var Lc;(function(i){i.asIs=1,i.adjustIndentation=2})(Lc||(Lc={}));var Ic;(function(i){function e(t){let n=t;return n&&(m.string(n.detail)||n.detail===void 0)&&(m.string(n.description)||n.description===void 0)}i.is=e})(Ic||(Ic={}));var Dc;(function(i){function e(t){return{label:t}}i.create=e})(Dc||(Dc={}));var $c;(function(i){function e(t,n){return{items:t||[],isIncomplete:!!n}}i.create=e})($c||($c={}));var is;(function(i){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}i.fromPlainText=e;function t(n){let s=n;return m.string(s)||m.objectLiteral(s)&&m.string(s.language)&&m.string(s.value)}i.is=t})(is||(is={}));var Fc;(function(i){function e(t){let n=t;return!!n&&m.objectLiteral(n)&&(ii.is(n.contents)||is.is(n.contents)||m.typedArray(n.contents,is.is))&&(t.range===void 0||ne.is(t.range))}i.is=e})(Fc||(Fc={}));var Wc;(function(i){function e(t,n){return n?{label:t,documentation:n}:{label:t}}i.create=e})(Wc||(Wc={}));var zc;(function(i){function e(t,n,...s){let r={label:t};return m.defined(n)&&(r.documentation=n),m.defined(s)?r.parameters=s:r.parameters=[],r}i.create=e})(zc||(zc={}));var qc;(function(i){i.Text=1,i.Read=2,i.Write=3})(qc||(qc={}));var Bc;(function(i){function e(t,n){let s={range:t};return m.number(n)&&(s.kind=n),s}i.create=e})(Bc||(Bc={}));var Uc;(function(i){i.File=1,i.Module=2,i.Namespace=3,i.Package=4,i.Class=5,i.Method=6,i.Property=7,i.Field=8,i.Constructor=9,i.Enum=10,i.Interface=11,i.Function=12,i.Variable=13,i.Constant=14,i.String=15,i.Number=16,i.Boolean=17,i.Array=18,i.Object=19,i.Key=20,i.Null=21,i.EnumMember=22,i.Struct=23,i.Event=24,i.Operator=25,i.TypeParameter=26})(Uc||(Uc={}));var Vc;(function(i){i.Deprecated=1})(Vc||(Vc={}));var Zc;(function(i){function e(t,n,s,r,o){let a={name:t,kind:n,location:{uri:r,range:s}};return o&&(a.containerName=o),a}i.create=e})(Zc||(Zc={}));var Gc;(function(i){function e(t,n,s,r){return r!==void 0?{name:t,kind:n,location:{uri:s,range:r}}:{name:t,kind:n,location:{uri:s}}}i.create=e})(Gc||(Gc={}));var Hc;(function(i){function e(n,s,r,o,a,c){let l={name:n,detail:s,kind:r,range:o,selectionRange:a};return c!==void 0&&(l.children=c),l}i.create=e;function t(n){let s=n;return s&&m.string(s.name)&&m.number(s.kind)&&ne.is(s.range)&&ne.is(s.selectionRange)&&(s.detail===void 0||m.string(s.detail))&&(s.deprecated===void 0||m.boolean(s.deprecated))&&(s.children===void 0||Array.isArray(s.children))&&(s.tags===void 0||Array.isArray(s.tags))}i.is=t})(Hc||(Hc={}));var Jc;(function(i){i.Empty="",i.QuickFix="quickfix",i.Refactor="refactor",i.RefactorExtract="refactor.extract",i.RefactorInline="refactor.inline",i.RefactorRewrite="refactor.rewrite",i.Source="source",i.SourceOrganizeImports="source.organizeImports",i.SourceFixAll="source.fixAll"})(Jc||(Jc={}));var ss;(function(i){i.Invoked=1,i.Automatic=2})(ss||(ss={}));var Xc;(function(i){function e(n,s,r){let o={diagnostics:n};return s!=null&&(o.only=s),r!=null&&(o.triggerKind=r),o}i.create=e;function t(n){let s=n;return m.defined(s)&&m.typedArray(s.diagnostics,ns.is)&&(s.only===void 0||m.typedArray(s.only,m.string))&&(s.triggerKind===void 0||s.triggerKind===ss.Invoked||s.triggerKind===ss.Automatic)}i.is=t})(Xc||(Xc={}));var Yc;(function(i){function e(n,s,r){let o={title:n},a=!0;return typeof s=="string"?(a=!1,o.kind=s):Cn.is(s)?o.command=s:o.edit=s,a&&r!==void 0&&(o.kind=r),o}i.create=e;function t(n){let s=n;return s&&m.string(s.title)&&(s.diagnostics===void 0||m.typedArray(s.diagnostics,ns.is))&&(s.kind===void 0||m.string(s.kind))&&(s.edit!==void 0||s.command!==void 0)&&(s.command===void 0||Cn.is(s.command))&&(s.isPreferred===void 0||m.boolean(s.isPreferred))&&(s.edit===void 0||oo.is(s.edit))}i.is=t})(Yc||(Yc={}));var Qc;(function(i){function e(n,s){let r={range:n};return m.defined(s)&&(r.data=s),r}i.create=e;function t(n){let s=n;return m.defined(s)&&ne.is(s.range)&&(m.undefined(s.command)||Cn.is(s.command))}i.is=t})(Qc||(Qc={}));var Kc;(function(i){function e(n,s){return{tabSize:n,insertSpaces:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&m.uinteger(s.tabSize)&&m.boolean(s.insertSpaces)}i.is=t})(Kc||(Kc={}));var el;(function(i){function e(n,s,r){return{range:n,target:s,data:r}}i.create=e;function t(n){let s=n;return m.defined(s)&&ne.is(s.range)&&(m.undefined(s.target)||m.string(s.target))}i.is=t})(el||(el={}));var tl;(function(i){function e(n,s){return{range:n,parent:s}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&ne.is(s.range)&&(s.parent===void 0||i.is(s.parent))}i.is=t})(tl||(tl={}));var nl;(function(i){i.namespace="namespace",i.type="type",i.class="class",i.enum="enum",i.interface="interface",i.struct="struct",i.typeParameter="typeParameter",i.parameter="parameter",i.variable="variable",i.property="property",i.enumMember="enumMember",i.event="event",i.function="function",i.method="method",i.macro="macro",i.keyword="keyword",i.modifier="modifier",i.comment="comment",i.string="string",i.number="number",i.regexp="regexp",i.operator="operator",i.decorator="decorator"})(nl||(nl={}));var il;(function(i){i.declaration="declaration",i.definition="definition",i.readonly="readonly",i.static="static",i.deprecated="deprecated",i.abstract="abstract",i.async="async",i.modification="modification",i.documentation="documentation",i.defaultLibrary="defaultLibrary"})(il||(il={}));var sl;(function(i){function e(t){let n=t;return m.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}i.is=e})(sl||(sl={}));var rl;(function(i){function e(n,s){return{range:n,text:s}}i.create=e;function t(n){let s=n;return s!=null&&ne.is(s.range)&&m.string(s.text)}i.is=t})(rl||(rl={}));var ol;(function(i){function e(n,s,r){return{range:n,variableName:s,caseSensitiveLookup:r}}i.create=e;function t(n){let s=n;return s!=null&&ne.is(s.range)&&m.boolean(s.caseSensitiveLookup)&&(m.string(s.variableName)||s.variableName===void 0)}i.is=t})(ol||(ol={}));var al;(function(i){function e(n,s){return{range:n,expression:s}}i.create=e;function t(n){let s=n;return s!=null&&ne.is(s.range)&&(m.string(s.expression)||s.expression===void 0)}i.is=t})(al||(al={}));var cl;(function(i){function e(n,s){return{frameId:n,stoppedLocation:s}}i.create=e;function t(n){let s=n;return m.defined(s)&&ne.is(n.stoppedLocation)}i.is=t})(cl||(cl={}));var lo;(function(i){i.Type=1,i.Parameter=2;function e(t){return t===1||t===2}i.is=e})(lo||(lo={}));var uo;(function(i){function e(n){return{value:n}}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&(s.tooltip===void 0||m.string(s.tooltip)||ii.is(s.tooltip))&&(s.location===void 0||ts.is(s.location))&&(s.command===void 0||Cn.is(s.command))}i.is=t})(uo||(uo={}));var ll;(function(i){function e(n,s,r){let o={position:n,label:s};return r!==void 0&&(o.kind=r),o}i.create=e;function t(n){let s=n;return m.objectLiteral(s)&&Ve.is(s.position)&&(m.string(s.label)||m.typedArray(s.label,uo.is))&&(s.kind===void 0||lo.is(s.kind))&&s.textEdits===void 0||m.typedArray(s.textEdits,Tn.is)&&(s.tooltip===void 0||m.string(s.tooltip)||ii.is(s.tooltip))&&(s.paddingLeft===void 0||m.boolean(s.paddingLeft))&&(s.paddingRight===void 0||m.boolean(s.paddingRight))}i.is=t})(ll||(ll={}));var ul;(function(i){function e(t){return{kind:"snippet",value:t}}i.createSnippet=e})(ul||(ul={}));var hl;(function(i){function e(t,n,s,r){return{insertText:t,filterText:n,range:s,command:r}}i.create=e})(hl||(hl={}));var dl;(function(i){function e(t){return{items:t}}i.create=e})(dl||(dl={}));var fl;(function(i){i.Invoked=0,i.Automatic=1})(fl||(fl={}));var pl;(function(i){function e(t,n){return{range:t,text:n}}i.create=e})(pl||(pl={}));var ml;(function(i){function e(t,n){return{triggerKind:t,selectedCompletionInfo:n}}i.create=e})(ml||(ml={}));var gl;(function(i){function e(t){let n=t;return m.objectLiteral(n)&&Qr.is(n.uri)&&m.string(n.name)}i.is=e})(gl||(gl={}));var yl;(function(i){function e(r,o,a,c){return new ho(r,o,a,c)}i.create=e;function t(r){let o=r;return!!(m.defined(o)&&m.string(o.uri)&&(m.undefined(o.languageId)||m.string(o.languageId))&&m.uinteger(o.lineCount)&&m.func(o.getText)&&m.func(o.positionAt)&&m.func(o.offsetAt))}i.is=t;function n(r,o){let a=r.getText(),c=s(o,(u,d)=>{let p=u.range.start.line-d.range.start.line;return p===0?u.range.start.character-d.range.start.character:p}),l=a.length;for(let u=c.length-1;u>=0;u--){let d=c[u],p=r.offsetAt(d.range.start),f=r.offsetAt(d.range.end);if(f<=l)a=a.substring(0,p)+d.newText+a.substring(f,a.length);else throw new Error("Overlapping edit");l=p}return a}i.applyEdits=n;function s(r,o){if(r.length<=1)return r;let a=r.length/2|0,c=r.slice(0,a),l=r.slice(a);s(c,o),s(l,o);let u=0,d=0,p=0;for(;u<c.length&&d<l.length;)o(c[u],l[d])<=0?r[p++]=c[u++]:r[p++]=l[d++];for(;u<c.length;)r[p++]=c[u++];for(;d<l.length;)r[p++]=l[d++];return r}})(yl||(yl={}));var ho=class{constructor(e,t,n,s){this._uri=e,this._languageId=t,this._version=n,this._content=s,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,n=!0;for(let s=0;s<t.length;s++){n&&(e.push(s),n=!1);let r=t.charAt(s);n=r==="\r"||r===`
|
|
53
53
|
`,r==="\r"&&s+1<t.length&&t.charAt(s+1)===`
|
|
54
54
|
`&&s++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,s=t.length;if(s===0)return Ve.create(0,e);for(;n<s;){let o=Math.floor((n+s)/2);t[o]>e?s=o:n=o+1}let r=n-1;return Ve.create(r,e-t[r])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],s=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,s),n)}get lineCount(){return this.getLineOffsets().length}},m;(function(i){let e=Object.prototype.toString;function t(f){return typeof f<"u"}i.defined=t;function n(f){return typeof f>"u"}i.undefined=n;function s(f){return f===!0||f===!1}i.boolean=s;function r(f){return e.call(f)==="[object String]"}i.string=r;function o(f){return e.call(f)==="[object Number]"}i.number=o;function a(f,w,g){return e.call(f)==="[object Number]"&&w<=f&&f<=g}i.numberRange=a;function c(f){return e.call(f)==="[object Number]"&&-2147483648<=f&&f<=2147483647}i.integer=c;function l(f){return e.call(f)==="[object Number]"&&0<=f&&f<=2147483647}i.uinteger=l;function u(f){return e.call(f)==="[object Function]"}i.func=u;function d(f){return f!==null&&typeof f=="object"}i.objectLiteral=d;function p(f,w){return Array.isArray(f)&&f.every(w)}i.typedArray=p})(m||(m={}));var _f=require.resolve("devicetree-language-server/dist/server.js"),mo=class{constructor(e,t,n,s,r){this.poolSize=e;this.cwd=t;this.includesPaths=n;this.bindings=s;this.logLevel=r;this.workers=[];this.queue=[]}async initialize(){let e=[];for(let t=0;t<this.poolSize;t++)e.push(this.createWorker(t));await Promise.all(e)}async createWorker(e){let t=bl.default.spawn(process.execPath,[_f,"--stdio"],{stdio:["pipe","pipe","pipe"]});t.stderr.on("data",o=>{this.logLevel==="verbose"&&console.error(`LSP Worker ${e} stderr:`,o.toString())});let n=(0,xl.createMessageConnection)(new rs.StreamMessageReader(t.stdout),new rs.StreamMessageWriter(t.stdin));this.logLevel==="verbose"&&n.onNotification("window/logMessage",o=>{let c={1:"ERROR",2:"WARN",3:"INFO",4:"LOG"}[o.type]||"LOG";ie("info",`[LSP Worker ${e} ${c}] ${o.message}`)}),n.onRequest("workspace/workspaceFolders",()=>[{uri:`file://${this.cwd}`,name:"root"}]),n.listen(),n.sendNotification("workspace/didChangeConfiguration",{settings:{devicetree:{defaultIncludePaths:this.includesPaths,defaultBindingType:"Zephyr",defaultZephyrBindings:this.bindings,cwd:this.cwd,autoChangeContext:!0,allowAdhocContexts:!0,defaultLockRenameEdits:[],disableFileWatchers:!0}}});let s=[{uri:go(this.cwd),name:"root"}];await n.sendRequest("initialize",{processId:process.pid,rootUri:go(this.cwd),capabilities:{},workspaceFolders:s}),await n.sendNotification("initialized");let r={id:e,process:t,connection:n,busy:!1};this.workers.push(r)}async getAvailableWorker(){return new Promise(e=>{let t=this.workers.find(n=>!n.busy);t?(t.busy=!0,e(t)):this.queue.push(()=>{let n=this.workers.find(s=>!s.busy);n&&(n.busy=!0,e(n))})})}releaseWorker(e){e.busy=!1;let t=this.queue.shift();t&&t()}async dispose(){for(let e of this.workers)e.connection.dispose(),e.process.kill();this.workers=[]}};function go(i){let e=_l.default.resolve(i);return e=e.replace(/\\/g,"/"),e.startsWith("/")||(e="/"+e),`file://${e}`}function xf(){let i=process.env;return!!(i.CI&&(i.GITHUB_ACTIONS||i.GITLAB_CI||i.BITBUCKET_BUILD_NUMBER||i.CIRCLECI||i.TRAVIS))}var Sf=Y.object({file:Y.array(Y.string().optional()).optional(),cwd:Y.string().optional(),include:Y.array(Y.string()).optional().default([]),binding:Y.array(Y.string()).optional().default([]),logLevel:Y.enum(["none","verbose"]).optional().default("none"),format:Y.boolean().optional().default(!1),formatFixAll:Y.boolean().optional().default(!1),processIncludes:Y.boolean().optional().default(!1),diagnostics:Y.boolean().optional().default(!1),diagnosticsFull:Y.boolean().optional().default(!1),showInfoDiagnostics:Y.boolean().optional().default(!1),patchFile:Y.string().optional(),outputFormat:Y.enum(["auto","pretty","annotations","json"]).optional().default("auto"),threads:Y.number().int().min(1).optional().default(1),version:Y.boolean().optional().default(!1),help:Y.boolean().optional().default(!1)}),yo=`Usage: dts-linter [options]
|
|
55
55
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dts-linter",
|
|
3
|
-
"version": "0.3.11-
|
|
3
|
+
"version": "0.3.11-beta2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"description": "",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"devicetree-language-server": "^0.8.0-
|
|
28
|
+
"devicetree-language-server": "^0.8.0-beta3"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/node": "^24.0.3",
|