@visulima/email 3.0.20 → 3.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
## @visulima/email [3.0.22](https://github.com/visulima/visulima/compare/@visulima/email@3.0.21...@visulima/email@3.0.22) (2026-10-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Dependencies
|
|
5
|
+
|
|
6
|
+
* **@visulima/fs:** upgraded to 6.0.24
|
|
7
|
+
|
|
8
|
+
## @visulima/email [3.0.21](https://github.com/visulima/visulima/compare/@visulima/email@3.0.20...@visulima/email@3.0.21) (2026-10-03)
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* unbreak main ci (email lint, fs windows ino) ([#888](https://github.com/visulima/visulima/issues/888)) ([47611c1](https://github.com/visulima/visulima/commit/47611c172537d020d1f5bc55f7ad8777c40dd72e))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Dependencies
|
|
16
|
+
|
|
17
|
+
* **@visulima/fs:** upgraded to 6.0.23
|
|
18
|
+
|
|
1
19
|
## @visulima/email [3.0.20](https://github.com/visulima/visulima/compare/@visulima/email@3.0.19...@visulima/email@3.0.20) (2026-10-03)
|
|
2
20
|
|
|
3
21
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{createRequire as wn}from"node:module";let Sn;const xn=t=>(Sn??=wn(import.meta.url))(t),Ct=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,En=t=>{if(typeof Ct<"u"&&Ct.versions&&Ct.versions.node){const[e,s]=Ct.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Ct.getBuiltinModule(t)}return xn(t)},{createRequire:H}=En("node:module"),xe=0,Os=4,ba=2,va=1,Ns=Symbol("findUpStop"),An=/^[A-Z]:\//i,Et=(t="")=>t&&t.replaceAll("\\","/").replace(An,e=>e.toUpperCase()),_n=/^[/\\]{2}/,Tn=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,We=/^[A-Z]:$/i,Rn=/[^/](\.[^./]+)$/,kn=/^[/\\]|^[a-z]:[/\\]/i,Cn=/\/$/,On=()=>{if(typeof process.cwd=="function")try{const t=process.cwd();if(typeof t=="string")return Et(t)}catch{}return"/"},Ls=(t,e)=>{let s="",n=0,o=-1,r=0,i;for(let c=0;c<=t.length;++c){if(c<t.length)i=t[c];else{if(i==="/")break;i="/"}if(i==="/"){if(!(o===c-1||r===1))if(r===2){if(s.length<2||n!==2||!s.endsWith(".")||s.at(-2)!=="."){if(s.length>2){const u=s.lastIndexOf("/");u===-1?(s="",n=0):(s=s.slice(0,u),n=s.length-1-s.lastIndexOf("/")),o=c,r=0;continue}else if(s.length>0){s="",n=0,o=c,r=0;continue}}e&&(s+=s.length>0?"/..":"..",n=2)}else s.length>0?s+=`/${t.slice(o+1,c)}`:s=t.slice(o+1,c),n=c-o-1;o=c,r=0}else i==="."&&r!==-1?++r:r=-1}return s},St=t=>Tn.test(t),Tt=function(t){if(t.length===0)return".";t=Et(t);const e=_n.exec(t),s=St(t),n=t.at(-1)==="/";return t=Ls(t,!s),t.length===0?s?"/":n?"./":".":(n&&(t+="/"),We.test(t)&&(t+="/"),e?s?`//${t}`:`//./${t}`:s&&!St(t)?`/${t}`:t)},Ee=(...t)=>{let e="";for(const s of t)if(s)if(e.length>0){const n=e.at(-1)==="/",o=s[0]==="/";n&&o?e+=s.slice(1):e+=n||o?s:`/${s}`}else e+=s;return Tt(e)},tt=function(...t){t=t.map(n=>Et(n));let e="",s=!1;for(let n=t.length-1;n>=-1&&!s;n--){const o=n>=0?t[n]:On();!o||o.length===0||(e=`${o}/${e}`,s=St(o))}return e=Ls(e,!s),We.test(e)?`${e}/`:s&&!St(e)?`/${e}`:e.length>0?e:"."},ht=function(t){return Et(t)},Nn=function(t){return Rn.exec(Et(t))?.[1]??""},V=t=>{const e=Et(t).replace(Cn,""),s=e.lastIndexOf("/");if(s===-1)return St(t)?"/":".";const n=e.slice(0,s);return We.test(n)?`${n}/`:n||(St(t)?"/":".")},pe=(t,e)=>{const s=Et(t),n=s.slice(s.lastIndexOf("/")+1);if(e&&n.endsWith(e)){if(e===s)return"";const o=n.slice(0,-e.length);if(o.length>0)return o}return n},Ds=function(t){const e=kn.exec(t)?.[0]?.replaceAll("\\","/")??"",s=pe(t),n=Nn(s);return{base:s,dir:V(t),ext:n,name:s.slice(0,s.length-n.length),root:e}};let Ln;const Dn=t=>(Ln??=H(import.meta.url))(t),Ot=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fn=t=>{if(typeof Ot<"u"&&Ot.versions&&Ot.versions.node){const[e,s]=Ot.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Ot.getBuiltinModule(t)}return Dn(t)},{fileURLToPath:Hn}=Fn("node:url");function In(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ye,Ze;function Bn(){return Ze||(Ze=1,Ye=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Ye}var Mn=Bn();const Pn=In(Mn);new Set(Pn);const F=t=>Et(t instanceof URL?Hn(t):t);let xt=class extends Error{constructor(e){super(`EEXIST: ${e}`)}get code(){return"EEXIST"}set code(e){throw new Error("Cannot overwrite code EEXIST")}get name(){return"AlreadyExistsError"}set name(e){throw new Error("Cannot overwrite name of AlreadyExistsError")}};const P=t=>{if(!t||!(t instanceof URL)&&typeof t!="string")throw new TypeError("Path must be a non-empty string or URL.")};let jn;const Gn=t=>(jn??=H(import.meta.url))(t),Nt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Un=t=>{if(typeof Nt<"u"&&Nt.versions&&Nt.versions.node){const[e,s]=Nt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Nt.getBuiltinModule(t)}return Gn(t)},{cp:qn}=Un("node:fs/promises"),Sa=async(t,e,s={})=>{P(t),P(e);const{dereference:n=!1,errorOnExist:o=!0,filter:r,overwrite:i=!0,preserveTimestamps:c=!1,recursive:u=!0,verbatimSymlinks:y=!1}=s,l=F(t),h=F(e);try{await qn(l,h,{dereference:n,errorOnExist:o,filter:r,force:i,preserveTimestamps:c,recursive:u,verbatimSymlinks:y})}catch($){throw $?.code==="ERR_FS_CP_EEXIST"?new xt(`destination already exists, copy '${h}'`):$}};let zn;const Wn=t=>(zn??=H(import.meta.url))(t),Lt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Xn=t=>{if(typeof Lt<"u"&&Lt.versions&&Lt.versions.node){const[e,s]=Lt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Lt.getBuiltinModule(t)}return Wn(t)},{cpSync:Kn}=Xn("node:fs"),xa=(t,e,s={})=>{P(t),P(e);const{dereference:n=!1,errorOnExist:o=!0,filter:r,overwrite:i=!0,preserveTimestamps:c=!1,recursive:u=!0,verbatimSymlinks:y=!1}=s,l=F(t),h=F(e);try{Kn(l,h,{dereference:n,errorOnExist:o,filter:r,force:i,preserveTimestamps:c,recursive:u,verbatimSymlinks:y})}catch($){throw $?.code==="ERR_FS_CP_EEXIST"?new xt(`destination already exists, copy '${h}'`):$}},dt=t=>{if(t.isFile())return"file";if(t.isDirectory())return"dir";if(t.isSymbolicLink())return"symlink"};let Qn;const Vn=t=>(Qn??=H(import.meta.url))(t),Dt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Yn=t=>{if(typeof Dt<"u"&&Dt.versions&&Dt.versions.node){const[e,s]=Dt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Dt.getBuiltinModule(t)}return Vn(t)},{lstat:Je,mkdir:Zn}=Yn("node:fs/promises"),Xe=async t=>{P(t);try{const e=await Je(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(dt(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await Zn(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const s=await Je(t);if(!s.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(dt(s))}'`,{cause:e})}};let Jn;const tr=t=>(Jn??=H(import.meta.url))(t),Ft=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,er=t=>{if(typeof Ft<"u"&&Ft.versions&&Ft.versions.node){const[e,s]=Ft.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Ft.getBuiltinModule(t)}return tr(t)},{lstatSync:ts,mkdirSync:sr}=er("node:fs"),Ke=t=>{P(t);try{const e=ts(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(dt(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{sr(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const s=ts(t);if(!s.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(dt(s))}'`,{cause:e})}};let nr;const rr=t=>(nr??=H(import.meta.url))(t),Ht=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,or=t=>{if(typeof Ht<"u"&&Ht.versions&&Ht.versions.node){const[e,s]=Ht.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Ht.getBuiltinModule(t)}return rr(t)},{lstat:ir,writeFile:cr}=or("node:fs/promises"),Ea=async t=>{P(t);try{const e=await ir(t);if(!e.isFile())throw new Error(`Ensure path exists, expected 'file', got '${String(dt(e))}'`)}catch(e){if(e.code==="ENOENT"){await Xe(V(F(t))),await cr(t,new Uint8Array);return}throw e}};let ur;const ar=t=>(ur??=H(import.meta.url))(t),It=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,lr=t=>{if(typeof It<"u"&&It.versions&&It.versions.node){const[e,s]=It.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return It.getBuiltinModule(t)}return ar(t)},{lstatSync:pr,writeFileSync:fr}=lr("node:fs"),Aa=t=>{P(t);try{const e=pr(t);if(!e.isFile())throw new Error(`Ensure path exists, expected 'file', got '${String(dt(e))}'`)}catch(e){if(e.code==="ENOENT"){Ke(V(F(t))),fr(t,new Uint8Array);return}throw e}},ae=(t,e)=>!!e.ino&&!!e.dev&&e.ino===t.ino&&e.dev===t.dev;let hr;const dr=t=>(hr??=H(import.meta.url))(t),Bt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gr=t=>{if(typeof Bt<"u"&&Bt.versions&&Bt.versions.node){const[e,s]=Bt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Bt.getBuiltinModule(t)}return dr(t)},{lstat:es,link:yr}=gr("node:fs/promises"),_a=async(t,e)=>{P(t),P(e),t=ht(F(t)),e=ht(F(e));let s;try{s=await es(e)}catch{}let n;try{n=await es(t)}catch(o){const r=o;throw r.message=r.message.replace("lstat","ensureLink"),r}s&&ae(n,s)||(await Xe(V(e)),await yr(t,e))};let mr;const $r=t=>(mr??=H(import.meta.url))(t),Mt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,br=t=>{if(typeof Mt<"u"&&Mt.versions&&Mt.versions.node){const[e,s]=Mt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Mt.getBuiltinModule(t)}return $r(t)},{lstatSync:ss,linkSync:vr}=br("node:fs"),Ta=(t,e)=>{P(t),P(e),t=ht(F(t)),e=ht(F(e));let s;try{s=ss(e)}catch{}let n;try{n=ss(t)}catch(o){const r=o;throw r.message=r.message.replace("lstat","ensureLink"),r}s&&ae(n,s)||(Ke(V(e)),vr(t,e))},Fs=(t,e)=>typeof t!="string"?t:t.startsWith("./")?tt(t):typeof e=="string"?tt(V(e),t):new URL(t,e);let wr;const Sr=t=>(wr??=H(import.meta.url))(t),Pt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xr=t=>{if(typeof Pt<"u"&&Pt.versions&&Pt.versions.node){const[e,s]=Pt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Pt.getBuiltinModule(t)}return Sr(t)},{lstat:Ce,stat:ns,symlink:Er,readlink:Ar}=xr("node:fs/promises"),_r=process.platform==="win32"||/^(?:msys|cygwin)$/.test(process.env.OSTYPE),Ra=async(t,e,s)=>{P(t),P(e);const n=Fs(t,e);e=ht(F(e));try{if((await Ce(e)).isSymbolicLink()){const[c,u]=await Promise.all([ns(n),ns(e)]);if(ae(c,u))return}}catch{}const o=await Ce(n),r=dt(o);await Xe(V(e));let i=s??"file";s||(_r?i="junction":i=r==="dir"?"dir":"file");try{await Er(ht(F(n)),e,i)}catch(c){if(c.code!=="EEXIST")throw c;const u=await Ce(e);if(!u.isSymbolicLink())throw new xt(`A ${String(dt(u))} already exists at the path: ${e}`);const y=await Ar(e),l=ht(tt(y));if(l!==n)throw new xt(`A symlink targeting to an undesired path already exists: ${e} -> ${l}`)}};let Tr;const Rr=t=>(Tr??=H(import.meta.url))(t),jt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,kr=t=>{if(typeof jt<"u"&&jt.versions&&jt.versions.node){const[e,s]=jt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return jt.getBuiltinModule(t)}return Rr(t)},{lstatSync:Oe,statSync:$e,symlinkSync:Cr,readlinkSync:Or}=kr("node:fs"),Nr=process.platform==="win32"||/^(?:msys|cygwin)$/.test(process.env.OSTYPE),ka=(t,e,s)=>{P(t),P(e);const n=Fs(t,e);e=ht(F(e));try{if(Oe(e).isSymbolicLink()&&ae($e(n),$e(e))){const c=$e(n),u=$e(e);if(ae(c,u))return}}catch{}const o=Oe(n),r=dt(o);Ke(V(e));let i=s??"file";s||(Nr?i="junction":i=r==="dir"?"dir":"file");try{Cr(ht(F(n)),e,i)}catch(c){if(c.code!=="EEXIST")throw c;const u=Oe(e);if(!u.isSymbolicLink())throw new xt(`A ${String(dt(u))} already exists at the path: ${e}`);const y=Or(e),l=ht(tt(y));if(l!==n)throw new xt(`A symlink targeting to an undesired path already exists: ${e} -> ${l}`)}},Lr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{platform:Dr}=Lr,Hs=/\r?\n/g,Is=`
|
|
2
|
-
`,
|
|
3
|
-
`,Ca=Dr==="win32"?Ue:Is,Oa=t=>{const e=t.match(Hs);if(!e||e.length===0)return null;const s=e.filter(o=>o===Ue).length,n=e.length-s;return s>n?Ue:Is},Na=(t,e)=>t.replaceAll(Hs,e);let be=class extends Error{root;constructor(e,s){super(`${e instanceof Error?e.message:String(e)} for path "${s}"`),this.cause=e,this.root=s}get name(){return"WalkError"}set name(e){throw new Error("Cannot overwrite name of WalkError")}};const Fr=t=>{const e=[],s=new Set;let n=0;for(const c of t){if(c==="{")e.push(n);else if(c==="}"){const u=e.pop();u!==void 0&&(s.add(u),s.add(n))}n+=1}let o=0,r=0,i="";for(const c of t)c==="{"?s.has(r)?(i+="(",o+=1):i+=String.raw`\{`:c==="}"?s.has(r)?(i+=")",o-=1):i+=String.raw`\}`:c===","&&o>0?i+="|":i+=c,r+=1;return i},ve=t=>{const e=t.replace(/[$()+\\^]/g,String.raw`\$&`).replace(/\.\*/g,".([^/]*)").replace(/\*\*/g,"(.*)").replace(/(?<!\.)\*(?!\*)/g,"([^/]*)").replace(/\?/g,"[^/]").replace(/\.(?!\*)/g,String.raw`\.`),s=Fr(e).replace(/\[!(.*?)\]/g,"[^$1]");try{return new RegExp(`^${s}$`)}catch(n){throw new Error(`Invalid glob pattern: ${t}`,{cause:n})}};let Hr=class{name;path;#t;constructor(e,s,n){this.#t=e,this.name=s,this.path=n}isDirectory(){return this.#t.isDirectory()}isFile(){return this.#t.isFile()}isSymbolicLink(){return this.#t.isSymbolicLink()}};const kt=(t,e,s)=>new Hr(t,e,s),wt=(t,e,s,n)=>{if(Array.isArray(e)&&e.length>0&&!e.some(r=>t.endsWith(r)))return!1;const o=t.includes("\\")?t.replaceAll("\\","/"):t;return s&&!s.some(r=>r.test(o))?!1:!n?.some(r=>r.test(o))};let Ir;const Br=t=>(Ir??=H(import.meta.url))(t),Gt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Mr=t=>{if(typeof Gt<"u"&&Gt.versions&&Gt.versions.node){const[e,s]=Gt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Gt.getBuiltinModule(t)}return Br(t)},{readdir:Pr,realpath:jr,stat:Bs}=Mr("node:fs/promises"),Gr=async t=>{const e=Tt(t),s=pe(e),n=await Bs(e);return kt(n,s,e)};async function*Ms(t,e={}){const{extensions:s,followSymlinks:n=!1,includeDirs:o=!0,includeFiles:r=!0,includeSymlinks:i=!0,match:c,maxDepth:u=Number.POSITIVE_INFINITY,skip:y}=e;if(P(t),u<0)return;const l=e.visited??new Set,h=c?c.map(g=>typeof g=="string"?ve(g):g):void 0,$=y?y.map(g=>typeof g=="string"?ve(g):g):void 0;if(t=tt(F(t)),o&&wt(t,s,h,$)&&(yield await Gr(t)),!(u<1||!wt(t,void 0,void 0,$)))try{const g=await Pr(t,{withFileTypes:!0});for(const b of g){let E=Ee(t,b.name),R=b,{name:C}=b,D=b.isDirectory(),m=b.isFile();if(b.isSymbolicLink())if(n){const v=Tt(await jr(E));if(l.has(v))continue;E=v;const a=await Bs(v);D=a.isDirectory(),m=a.isFile(),R=a,C=pe(v)}else if(i&&wt(E,s,h,$)){yield kt(b,b.name,E);continue}else continue;D?(n&&l.add(E),yield*Ms(E,{extensions:s,followSymlinks:n,includeDirs:o,includeFiles:r,includeSymlinks:i,match:h,maxDepth:u-1,skip:$,visited:l})):m&&r&&wt(E,s,h,$)&&(yield kt(R,C,E))}}catch(g){throw g instanceof be?g:new be(g,t)}}const Fa=async(t,e={})=>{Array.isArray(e.extensions)||(e.extensions=["js","mjs","cjs","ts"]);const s=[];for await(const n of Ms(t,e))s.push(n.path);return s};let Ur;const qr=t=>(Ur??=H(import.meta.url))(t),Ut=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,zr=t=>{if(typeof Ut<"u"&&Ut.versions&&Ut.versions.node){const[e,s]=Ut.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Ut.getBuiltinModule(t)}return qr(t)},{readdirSync:Wr,realpathSync:Xr,statSync:Ps}=zr("node:fs"),Kr=t=>{const e=Tt(t),s=Ps(e);return kt(s,pe(e),e)};function*js(t,e={}){const{extensions:s,followSymlinks:n=!1,includeDirs:o=!0,includeFiles:r=!0,includeSymlinks:i=!0,match:c,maxDepth:u=Number.POSITIVE_INFINITY,skip:y}=e;if(P(t),u<0)return;const l=e.visited??new Set,h=c?c.map(g=>typeof g=="string"?ve(g):g):void 0,$=y?y.map(g=>typeof g=="string"?ve(g):g):void 0;if(t=tt(F(t)),o&&wt(t,s,h,$)&&(yield Kr(t)),!(u<1||!wt(t,void 0,void 0,$)))try{const g=Wr(t,{withFileTypes:!0});for(const b of g){let E=Ee(t,b.name),R=b,{name:C}=b,D=b.isDirectory(),m=b.isFile();if(b.isSymbolicLink())if(n){const v=Tt(Xr(E));if(l.has(v))continue;E=v;const a=Ps(v);D=a.isDirectory(),m=a.isFile(),R=a,C=pe(v)}else if(i&&wt(E,s,h,$)){yield kt(b,b.name,Tt(E));continue}else continue;D?(n&&l.add(E),yield*js(E,{extensions:s,followSymlinks:n,includeDirs:o,includeFiles:r,includeSymlinks:i,match:h,maxDepth:u-1,skip:$,visited:l})):m&&r&&wt(E,s,h,$)&&(yield kt(R,C,Tt(E)))}}catch(g){throw g instanceof be?g:new be(g,t)}}const Ha=(t,e={})=>{Array.isArray(e.extensions)||(e.extensions=["js","mjs","cjs","ts"]);const s=[];for(const n of js(t,e))s.push(n.path);return s};let Qr;const Vr=t=>(Qr??=H(import.meta.url))(t),qt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Yr=t=>{if(typeof qt<"u"&&qt.versions&&qt.versions.node){const[e,s]=qt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return qt.getBuiltinModule(t)}return Vr(t)},{stat:Zr,lstat:Jr}=Yr("node:fs/promises"),Ia=async(t,e={})=>{if(typeof t!="string"&&!Array.isArray(t)&&typeof t!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const s=e.cwd?F(e.cwd):process.cwd();let n=tt(s);const{root:o}=Ds(n),r=F(e.stopAt??o),i=tt(n,r),c=e.type??"file",u=async function(l){return typeof t=="function"?[await t(l)]:typeof t=="string"?[t]:Array.isArray(t)?t:[t]};e.allowSymlinks??=!0;const y=e.allowSymlinks?Zr:Jr;for(;n;){const l=await u(n);for(let h of l){if(h===Ns)return;if(h===void 0)continue;Buffer.isBuffer(h)?h=h.toString():h instanceof URL&&(h=F(h));const $=St(h)?h:tt(n,h);try{const g=await y($);if(c==="file"&&g.isFile()||c==="directory"&&g.isDirectory())return $}catch{}}if(n===i||n===o)break;n=V(n)}};let to;const eo=t=>(to??=H(import.meta.url))(t),zt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,so=t=>{if(typeof zt<"u"&&zt.versions&&zt.versions.node){const[e,s]=zt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return zt.getBuiltinModule(t)}return eo(t)},{statSync:no,lstatSync:ro}=so("node:fs"),Ba=(t,e={})=>{if(typeof t!="string"&&!Array.isArray(t)&&typeof t!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const s=e.cwd?F(e.cwd):process.cwd();let n=tt(s);const{root:o}=Ds(n),r=F(e.stopAt??o),i=tt(n,r),c=e.type??"file",u=function(l){return typeof t=="function"?[t(l)]:typeof t=="string"?[t]:Array.isArray(t)?t:[t]};e.allowSymlinks??=!0;const y=e.allowSymlinks?no:ro;for(;n;){for(let l of u(n)){if(l===Ns)return;if(l===void 0)continue;Buffer.isBuffer(l)?l=l.toString():l instanceof URL&&(l=F(l));const h=St(l)?l:tt(n,l);try{const $=y(h);if(c==="file"&&$.isFile()||c==="directory"&&$.isDirectory())return h}catch{}}if(n===i||n===o)break;n=V(n)}};function Qe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var rs={},Ne,os;function Ae(){if(os)return Ne;os=1;const t="\\\\/",e=`[^${t}]`,s=0,n=Symbol("unignore"),o="\\.",r="\\+",i="\\?",c="\\/",u="(?=.)",y="[^/]",l=`(?:${c}|$)`,h=`(?:^|${c})`,$=`${o}{1,2}${l}`,g=`(?!${o})`,b=`(?!${h}${$})`,E=`(?!${o}{0,1}${l})`,R=`(?!${$})`,C=`[^.${c}]`,D=`${y}*?`,m={DOT_LITERAL:o,PLUS_LITERAL:r,QMARK_LITERAL:i,SLASH_LITERAL:c,ONE_CHAR:u,QMARK:y,END_ANCHOR:l,DOTS_SLASH:$,NO_DOT:g,NO_DOTS:b,NO_DOT_SLASH:E,NO_DOTS_SLASH:R,QMARK_NO_DOT:C,STAR:D,START_ANCHOR:h,SEP:"/"},v={...m,SLASH_LITERAL:`[${t}]`,QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${o}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${o})`,NO_DOTS:`(?!(?:^|[${t}])${o}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${o}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${o}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"},a={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return Ne={DEFAULT_MAX_EXTGLOB_RECURSION:s,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:a,UNIGNORE:n,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(A){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${A.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(A){return A===!0?v:m}},Ne}var is;function _e(){return is||(is=1,(function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:o}=Ae();t.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),t.hasRegexChars=r=>n.test(r),t.isRegexChar=r=>r.length===1&&t.hasRegexChars(r),t.escapeRegex=r=>r.replace(o,"\\$1"),t.toPosixSlashes=r=>r.replace(e,"/"),t.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const r=navigator.platform.toLowerCase();return r==="win32"||r==="windows"}return process.platform?process.platform==="win32":!1},t.removeBackslashes=r=>r.replace(s,i=>i==="\\"?"":i),t.escapeLast=(r,i,c)=>{const u=r.lastIndexOf(i,c);return u===-1?r:r[u-1]==="\\"?t.escapeLast(r,i,u-1):`${r.slice(0,u)}\\${r.slice(u)}`},t.removePrefix=(r,i={})=>{let c=r;return c.startsWith("./")&&(c=c.slice(2),i.prefix="./"),c},t.wrapOutput=(r,i={},c={})=>{const u=c.contains?"":"^",y=c.contains?"":"$";let l=`${u}(?:${r})${y}`;return i.negated===!0&&(l=`(?:^(?!${l}).*$)`),l},t.basename=(r,{windows:i}={})=>{const c=r.split(i?/[\\/]/:"/"),u=c[c.length-1];return u===""?c[c.length-2]:u}})(rs)),rs}var Le,cs;function oo(){if(cs)return Le;cs=1;const t=_e(),{CHAR_ASTERISK:e,CHAR_AT:s,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:o,CHAR_DOT:r,CHAR_EXCLAMATION_MARK:i,CHAR_FORWARD_SLASH:c,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:y,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:h,CHAR_QUESTION_MARK:$,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:b,CHAR_RIGHT_SQUARE_BRACKET:E}=Ae(),R=D=>D===c||D===n,C=D=>{D.isPrefix!==!0&&(D.depth=D.isGlobstar?1/0:1)};return Le=(D,m)=>{const v=m||{},a=D.length-1,A=v.parts===!0||v.scanToEnd===!0,O=[],_=[],T=[];let x=D,B=-1,U=0,nt=0,gt=!1,rt=!1,K=!1,ot=!1,mt=!1,ut=!1,it=!1,W=!1,at=!1,Z=!1,$t=0,J,k,M={value:"",depth:0,isGlob:!1};const Y=()=>B>=a,d=()=>x.charCodeAt(B+1),q=()=>(J=k,x.charCodeAt(++B));for(;B<a;){k=q();let et;if(k===n){it=M.backslashes=!0,k=q(),k===u&&(ut=!0);continue}if(ut===!0||k===u){for($t++;Y()!==!0&&(k=q());){if(k===n){it=M.backslashes=!0,q();continue}if(k===u){$t++;continue}if(ut!==!0&&k===r&&(k=q())===r){if(gt=M.isBrace=!0,K=M.isGlob=!0,Z=!0,A===!0)continue;break}if(ut!==!0&&k===o){if(gt=M.isBrace=!0,K=M.isGlob=!0,Z=!0,A===!0)continue;break}if(k===g&&($t--,$t===0)){ut=!1,gt=M.isBrace=!0,Z=!0;break}}if(A===!0)continue;break}if(k===c){if(O.push(B),_.push(M),M={value:"",depth:0,isGlob:!1},Z===!0)continue;if(J===r&&B===U+1){U+=2;continue}nt=B+1;continue}if(v.noext!==!0&&(k===h||k===s||k===e||k===$||k===i)&&d()===y){if(K=M.isGlob=!0,ot=M.isExtglob=!0,Z=!0,k===i&&B===U&&(at=!0),A===!0){for(;Y()!==!0&&(k=q());){if(k===n){it=M.backslashes=!0,k=q();continue}if(k===b){K=M.isGlob=!0,Z=!0;break}}continue}break}if(k===e){if(J===e&&(mt=M.isGlobstar=!0),K=M.isGlob=!0,Z=!0,A===!0)continue;break}if(k===$){if(K=M.isGlob=!0,Z=!0,A===!0)continue;break}if(k===l){for(;Y()!==!0&&(et=q());){if(et===n){it=M.backslashes=!0,q();continue}if(et===E){rt=M.isBracket=!0,K=M.isGlob=!0,Z=!0;break}}if(A===!0)continue;break}if(v.nonegate!==!0&&k===i&&B===U){W=M.negated=!0,U++;continue}if(v.noparen!==!0&&k===y){if(K=M.isGlob=!0,A===!0){for(;Y()!==!0&&(k=q());){if(k===y){it=M.backslashes=!0,k=q();continue}if(k===b){Z=!0;break}}continue}break}if(K===!0){if(Z=!0,A===!0)continue;break}}v.noext===!0&&(ot=!1,K=!1);let G=x,bt="",p="";U>0&&(bt=x.slice(0,U),x=x.slice(U),nt-=U),G&&K===!0&&nt>0?(G=x.slice(0,nt),p=x.slice(nt)):K===!0?(G="",p=x):G=x,G&&G!==""&&G!=="/"&&G!==x&&R(G.charCodeAt(G.length-1))&&(G=G.slice(0,-1)),v.unescape===!0&&(p&&(p=t.removeBackslashes(p)),G&&it===!0&&(G=t.removeBackslashes(G)));const f={prefix:bt,input:D,start:U,base:G,glob:p,isBrace:gt,isBracket:rt,isGlob:K,isExtglob:ot,isGlobstar:mt,negated:W,negatedExtglob:at};if(v.tokens===!0&&(f.maxDepth=0,R(k)||_.push(M),f.tokens=_),v.parts===!0||v.tokens===!0){let et;for(let I=0;I<O.length;I++){const ct=et?et+1:U,lt=O[I],st=D.slice(ct,lt);v.tokens&&(I===0&&U!==0?(_[I].isPrefix=!0,_[I].value=bt):_[I].value=st,C(_[I]),f.maxDepth+=_[I].depth),(I!==0||st!=="")&&T.push(st),et=lt}if(et&&et+1<D.length){const I=D.slice(et+1);T.push(I),v.tokens&&(_[_.length-1].value=I,C(_[_.length-1]),f.maxDepth+=_[_.length-1].depth)}f.slashes=O,f.parts=T}return f},Le}var De,us;function io(){if(us)return De;us=1;const t=Ae(),e=_e(),{MAX_LENGTH:s,POSIX_REGEX_SOURCE:n,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:r,REPLACEMENTS:i}=t,c=(m,v)=>{if(typeof v.expandRange=="function")return v.expandRange(...m,v);m.sort();const a=`[${m.join("-")}]`;try{new RegExp(a)}catch{return m.map(A=>e.escapeRegex(A)).join("..")}return a},u=(m,v)=>`Missing ${m}: "${v}" - use "\\\\${v}" to match literal characters`,y=m=>{const v=[];let a=0,A=0,O=0,_="",T=!1;for(const x of m){if(T===!0){_+=x,T=!1;continue}if(x==="\\"){_+=x,T=!0;continue}if(x==='"'){O=O===1?0:1,_+=x;continue}if(O===0){if(x==="[")a++;else if(x==="]"&&a>0)a--;else if(a===0){if(x==="(")A++;else if(x===")"&&A>0)A--;else if(x==="|"&&A===0){v.push(_),_="";continue}}}_+=x}return v.push(_),v},l=m=>{let v=!1;for(const a of m){if(v===!0){v=!1;continue}if(a==="\\"){v=!0;continue}if(/[?*+@!()[\]{}]/.test(a))return!1}return!0},h=m=>{let v=m.trim(),a=!0;for(;a===!0;)a=!1,/^@\([^\\()[\]{}|]+\)$/.test(v)&&(v=v.slice(2,-1),a=!0);if(l(v))return v.replace(/\\(.)/g,"$1")},$=m=>{const v=m.map(h).filter(Boolean);for(let a=0;a<v.length;a++)for(let A=a+1;A<v.length;A++){const O=v[a],_=v[A],T=O[0];if(!(!T||O!==T.repeat(O.length)||_!==T.repeat(_.length))&&(O===_||O.startsWith(_)||_.startsWith(O)))return!0}return!1},g=(m,v=!0)=>{if(m[0]!=="+"&&m[0]!=="*"||m[1]!=="(")return;let a=0,A=0,O=0,_=!1;for(let T=1;T<m.length;T++){const x=m[T];if(_===!0){_=!1;continue}if(x==="\\"){_=!0;continue}if(x==='"'){O=O===1?0:1;continue}if(O!==1){if(x==="["){a++;continue}if(x==="]"&&a>0){a--;continue}if(!(a>0)){if(x==="("){A++;continue}if(x===")"&&(A--,A===0))return v===!0&&T!==m.length-1?void 0:{type:m[0],body:m.slice(2,T),end:T}}}}},b=m=>`${m.length===1?e.escapeRegex(m[0]):`[${m.map(v=>e.escapeRegex(v)).join("")}]`}*`,E=m=>{let v=0;const a=[];for(;v<m.length;){const A=g(m.slice(v),!1);if(!A||A.type!=="*")return;const O=y(A.body).map(T=>T.trim());if(O.length!==1)return;const _=h(O[0]);if(!_||_.length!==1)return;a.push(_),v+=A.end+1}if(!(a.length<1))return a},R=m=>{let v=0,a=m.trim(),A=g(a);for(;A;)v++,a=A.body.trim(),A=g(a);return v},C=(m,v)=>{if(v.maxExtglobRecursion===!1)return{risky:!1};const a=typeof v.maxExtglobRecursion=="number"?v.maxExtglobRecursion:t.DEFAULT_MAX_EXTGLOB_RECURSION,A=y(m).map(x=>x.trim());if(A.length>1&&(A.some(x=>x==="")||A.some(x=>/^[*?]+$/.test(x))||$(A)))return{risky:!0};const O=[];let _=!1,T=!0;for(const x of A){const B=E(x);if(B){_=!0,O.push(...B);continue}const U=h(x);if(U&&U.length===1){O.push(U);continue}if(T=!1,R(x)>a)return{risky:!0}}return _?T?{risky:!0,safeOutput:b([...new Set(O)])}:{risky:!0}:{risky:!1}},D=(m,v)=>{if(typeof m!="string")throw new TypeError("Expected a string");m=i[m]||m;const a={...v},A=typeof a.maxLength=="number"?Math.min(s,a.maxLength):s;let O=m.length;if(O>A)throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${A}`);const _={type:"bos",value:"",output:a.prepend||""},T=[_],x=a.capture?"":"?:",B=t.globChars(a.windows),U=t.extglobChars(B),{DOT_LITERAL:nt,PLUS_LITERAL:gt,SLASH_LITERAL:rt,ONE_CHAR:K,DOTS_SLASH:ot,NO_DOT:mt,NO_DOT_SLASH:ut,NO_DOTS_SLASH:it,QMARK:W,QMARK_NO_DOT:at,STAR:Z,START_ANCHOR:$t}=B,J=S=>`(${x}(?:(?!${$t}${S.dot?ot:nt}).)*?)`,k=a.dot?"":mt,M=a.dot?W:at;let Y=a.bash===!0?J(a):Z;a.capture&&(Y=`(${Y})`),typeof a.noext=="boolean"&&(a.noextglob=a.noext);const d={input:m,index:-1,start:0,dot:a.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:T};m=e.removePrefix(m,d),O=m.length;const q=[],G=[],bt=[];let p=_,f;const et=()=>d.index===O-1,I=d.peek=(S=1)=>m[d.index+S],ct=d.advance=()=>m[++d.index]||"",lt=()=>m.slice(d.index+1),st=(S="",z=0)=>{d.consumed+=S,d.index+=z},ge=S=>{d.output+=S.output!=null?S.output:S.value,st(S.value)},bn=()=>{let S=1;for(;I()==="!"&&(I(2)!=="("||I(3)==="?");)ct(),d.start++,S++;return S%2===0?!1:(d.negated=!0,d.start++,!0)},ye=S=>{d[S]++,bt.push(S)},vt=S=>{d[S]--,bt.pop()},N=S=>{if(p.type==="globstar"){const z=d.braces>0&&(S.type==="comma"||S.type==="brace"),w=S.extglob===!0||q.length&&(S.type==="pipe"||S.type==="paren");S.type!=="slash"&&S.type!=="paren"&&!z&&!w&&(d.output=d.output.slice(0,-p.output.length),p.type="star",p.value="*",p.output=Y,d.output+=p.output)}if(q.length&&S.type!=="paren"&&(q[q.length-1].inner+=S.value),(S.value||S.output)&&ge(S),p&&p.type==="text"&&S.type==="text"){p.output=(p.output||p.value)+S.value,p.value+=S.value;return}S.prev=p,T.push(S),p=S},me=(S,z)=>{const w={...U[z],conditions:1,inner:""};w.prev=p,w.parens=d.parens,w.output=d.output,w.startIndex=d.index,w.tokensIndex=T.length;const L=(a.capture?"(":"")+w.open;ye("parens"),N({type:S,value:z,output:d.output?"":K}),N({type:"paren",extglob:!0,value:ct(),output:L}),q.push(w)},vn=S=>{const z=m.slice(S.startIndex,d.index+1),w=m.slice(S.startIndex+2,d.index),L=C(w,a);if((S.type==="plus"||S.type==="star")&&L.risky){const j=L.safeOutput?(S.output?"":K)+(a.capture?`(${L.safeOutput})`:L.safeOutput):void 0,pt=T[S.tokensIndex];pt.type="text",pt.value=z,pt.output=j||e.escapeRegex(z);for(let ft=S.tokensIndex+1;ft<T.length;ft++)T[ft].value="",T[ft].output="",delete T[ft].suffix;d.output=S.output+pt.output,d.backtrack=!0,N({type:"paren",extglob:!0,value:f,output:""}),vt("parens");return}let X=S.close+(a.capture?")":""),Q;if(S.type==="negate"){let j=Y;if(S.inner&&S.inner.length>1&&S.inner.includes("/")&&(j=J(a)),(j!==Y||et()||/^\)+$/.test(lt()))&&(X=S.close=`)$))${j}`),S.inner.includes("*")&&(Q=lt())&&/^\.[^\\/.]+$/.test(Q)){const pt=D(Q,{...v,fastpaths:!1}).output;X=S.close=`)${pt})${j})`}S.prev.type==="bos"&&(d.negatedExtglob=!0)}N({type:"paren",extglob:!0,value:f,output:X}),vt("parens")};if(a.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(m)){let S=!1,z=m.replace(r,(w,L,X,Q,j,pt)=>Q==="\\"?(S=!0,w):Q==="?"?L?L+Q+(j?W.repeat(j.length):""):pt===0?M+(j?W.repeat(j.length):""):W.repeat(X.length):Q==="."?nt.repeat(X.length):Q==="*"?L?L+Q+(j?Y:""):Y:L?w:`\\${w}`);return S===!0&&(a.unescape===!0?z=z.replace(/\\/g,""):z=z.replace(/\\+/g,w=>w.length%2===0?"\\\\":w?"\\":"")),z===m&&a.contains===!0?(d.output=m,d):(d.output=e.wrapOutput(z,d,v),d)}for(;!et();){if(f=ct(),f==="\0")continue;if(f==="\\"){const w=I();if(w==="/"&&a.bash!==!0||w==="."||w===";")continue;if(!w){f+="\\",N({type:"text",value:f});continue}const L=/^\\+/.exec(lt());let X=0;if(L&&L[0].length>2&&(X=L[0].length,d.index+=X,X%2!==0&&(f+="\\")),a.unescape===!0?f=ct():f+=ct(),d.brackets===0){N({type:"text",value:f});continue}}if(d.brackets>0&&(f!=="]"||p.value==="["||p.value==="[^")){if(a.posix!==!1&&f===":"){const w=p.value.slice(1);if(w.includes("[")&&(p.posix=!0,w.includes(":"))){const L=p.value.lastIndexOf("["),X=p.value.slice(0,L),Q=p.value.slice(L+2),j=n[Q];if(j){p.value=X+j,d.backtrack=!0,ct(),!_.output&&T.indexOf(p)===1&&(_.output=K);continue}}}(f==="["&&I()!==":"||f==="-"&&I()==="]")&&(f=`\\${f}`),f==="]"&&(p.value==="["||p.value==="[^")&&(f=`\\${f}`),a.posix===!0&&f==="!"&&p.value==="["&&(f="^"),p.value+=f,ge({value:f});continue}if(d.quotes===1&&f!=='"'){f=e.escapeRegex(f),p.value+=f,ge({value:f});continue}if(f==='"'){d.quotes=d.quotes===1?0:1,a.keepQuotes===!0&&N({type:"text",value:f});continue}if(f==="("){ye("parens"),N({type:"paren",value:f});continue}if(f===")"){if(d.parens===0&&a.strictBrackets===!0)throw new SyntaxError(u("opening","("));const w=q[q.length-1];if(w&&d.parens===w.parens+1){vn(q.pop());continue}N({type:"paren",value:f,output:d.parens?")":"\\)"}),vt("parens");continue}if(f==="["){if(a.nobracket===!0||!lt().includes("]")){if(a.nobracket!==!0&&a.strictBrackets===!0)throw new SyntaxError(u("closing","]"));f=`\\${f}`}else ye("brackets");N({type:"bracket",value:f});continue}if(f==="]"){if(a.nobracket===!0||p&&p.type==="bracket"&&p.value.length===1){N({type:"text",value:f,output:`\\${f}`});continue}if(d.brackets===0){if(a.strictBrackets===!0)throw new SyntaxError(u("opening","["));N({type:"text",value:f,output:`\\${f}`});continue}vt("brackets");const w=p.value.slice(1);if(p.posix!==!0&&w[0]==="^"&&!w.includes("/")&&(f=`/${f}`),p.value+=f,ge({value:f}),a.literalBrackets===!1||e.hasRegexChars(w))continue;const L=e.escapeRegex(p.value);if(d.output=d.output.slice(0,-p.value.length),a.literalBrackets===!0){d.output+=L,p.value=L;continue}p.value=`(${x}${L}|${p.value})`,d.output+=p.value;continue}if(f==="{"&&a.nobrace!==!0){ye("braces");const w={type:"brace",value:f,output:"(",outputIndex:d.output.length,tokensIndex:d.tokens.length};G.push(w),N(w);continue}if(f==="}"){const w=G[G.length-1];if(a.nobrace===!0||!w){N({type:"text",value:f,output:f});continue}let L=")";if(w.dots===!0){const X=T.slice(),Q=[];for(let j=X.length-1;j>=0&&(T.pop(),X[j].type!=="brace");j--)X[j].type!=="dots"&&Q.unshift(X[j].value);L=c(Q,a),d.backtrack=!0}if(w.comma!==!0&&w.dots!==!0){const X=d.output.slice(0,w.outputIndex),Q=d.tokens.slice(w.tokensIndex);w.value=w.output="\\{",f=L="\\}",d.output=X;for(const j of Q)d.output+=j.output||j.value}N({type:"brace",value:f,output:L}),vt("braces"),G.pop();continue}if(f==="|"){q.length>0&&q[q.length-1].conditions++,N({type:"text",value:f});continue}if(f===","){let w=f;const L=G[G.length-1];L&&bt[bt.length-1]==="braces"&&(L.comma=!0,w="|"),N({type:"comma",value:f,output:w});continue}if(f==="/"){if(p.type==="dot"&&d.index===d.start+1){d.start=d.index+1,d.consumed="",d.output="",T.pop(),p=_;continue}N({type:"slash",value:f,output:rt});continue}if(f==="."){if(d.braces>0&&p.type==="dot"){p.value==="."&&(p.output=nt);const w=G[G.length-1];p.type="dots",p.output+=f,p.value+=f,w.dots=!0;continue}if(d.braces+d.parens===0&&p.type!=="bos"&&p.type!=="slash"){N({type:"text",value:f,output:nt});continue}N({type:"dot",value:f,output:nt});continue}if(f==="?"){if(!(p&&p.value==="(")&&a.noextglob!==!0&&I()==="("&&I(2)!=="?"){me("qmark",f);continue}if(p&&p.type==="paren"){const w=I();let L=f;(p.value==="("&&!/[!=<:]/.test(w)||w==="<"&&!/<([!=]|\w+>)/.test(lt()))&&(L=`\\${f}`),N({type:"text",value:f,output:L});continue}if(a.dot!==!0&&(p.type==="slash"||p.type==="bos")){N({type:"qmark",value:f,output:at});continue}N({type:"qmark",value:f,output:W});continue}if(f==="!"){if(a.noextglob!==!0&&I()==="("&&(I(2)!=="?"||!/[!=<:]/.test(I(3)))){me("negate",f);continue}if(a.nonegate!==!0&&d.index===0){bn();continue}}if(f==="+"){if(a.noextglob!==!0&&I()==="("&&I(2)!=="?"){me("plus",f);continue}if(p&&p.value==="("||a.regex===!1){N({type:"plus",value:f,output:gt});continue}if(p&&(p.type==="bracket"||p.type==="paren"||p.type==="brace")||d.parens>0){N({type:"plus",value:f});continue}N({type:"plus",value:gt});continue}if(f==="@"){if(a.noextglob!==!0&&I()==="("&&I(2)!=="?"){N({type:"at",extglob:!0,value:f,output:""});continue}N({type:"text",value:f});continue}if(f!=="*"){(f==="$"||f==="^")&&(f=`\\${f}`);const w=o.exec(lt());w&&(f+=w[0],d.index+=w[0].length),N({type:"text",value:f});continue}if(p&&(p.type==="globstar"||p.star===!0)){p.type="star",p.star=!0,p.value+=f,p.output=Y,d.backtrack=!0,d.globstar=!0,st(f);continue}let S=lt();if(a.noextglob!==!0&&/^\([^?]/.test(S)){me("star",f);continue}if(p.type==="star"){if(a.noglobstar===!0){st(f);continue}const w=p.prev,L=w.prev,X=w.type==="slash"||w.type==="bos",Q=L&&(L.type==="star"||L.type==="globstar");if(a.bash===!0&&(!X||S[0]&&S[0]!=="/")){N({type:"star",value:f,output:""});continue}const j=d.braces>0&&(w.type==="comma"||w.type==="brace"),pt=q.length&&(w.type==="pipe"||w.type==="paren");if(!X&&w.type!=="paren"&&!j&&!pt){N({type:"star",value:f,output:""});continue}for(;S.slice(0,3)==="/**";){const ft=m[d.index+4];if(ft&&ft!=="/")break;S=S.slice(3),st("/**",3)}if(w.type==="bos"&&et()){p.type="globstar",p.value+=f,p.output=J(a),d.output=p.output,d.globstar=!0,st(f);continue}if(w.type==="slash"&&w.prev.type!=="bos"&&!Q&&et()){d.output=d.output.slice(0,-(w.output+p.output).length),w.output=`(?:${w.output}`,p.type="globstar",p.output=J(a)+(a.strictSlashes?")":"|$)"),p.value+=f,d.globstar=!0,d.output+=w.output+p.output,st(f);continue}if(w.type==="slash"&&w.prev.type!=="bos"&&S[0]==="/"){const ft=S[1]!==void 0?"|$":"";d.output=d.output.slice(0,-(w.output+p.output).length),w.output=`(?:${w.output}`,p.type="globstar",p.output=`${J(a)}${rt}|${rt}${ft})`,p.value+=f,d.output+=w.output+p.output,d.globstar=!0,st(f+ct()),N({type:"slash",value:"/",output:""});continue}if(w.type==="bos"&&S[0]==="/"){p.type="globstar",p.value+=f,p.output=`(?:^|${rt}|${J(a)}${rt})`,d.output=p.output,d.globstar=!0,st(f+ct()),N({type:"slash",value:"/",output:""});continue}if(j&&S[0]==="/"){p.type="globstar",p.value+=f,p.output=`(?:^|${rt}|${J(a)}${rt})`,d.output+=p.output,d.globstar=!0,st(f+ct()),N({type:"slash",value:"/",output:""});continue}d.output=d.output.slice(0,-p.output.length),p.type="globstar",p.output=J(a),p.value+=f,d.output+=p.output,d.globstar=!0,st(f);continue}const z={type:"star",value:f,output:Y};if(a.bash===!0){z.output=".*?",(p.type==="bos"||p.type==="slash")&&(z.output=k+z.output),N(z);continue}if(p&&(p.type==="bracket"||p.type==="paren")&&a.regex===!0){z.output=f,N(z);continue}(d.index===d.start||p.type==="slash"||p.type==="dot")&&(p.type==="dot"?(d.output+=ut,p.output+=ut):a.dot===!0?(d.output+=it,p.output+=it):(d.output+=k,p.output+=k),I()!=="*"&&(d.output+=K,p.output+=K)),N(z)}for(;d.brackets>0;){if(a.strictBrackets===!0)throw new SyntaxError(u("closing","]"));d.output=e.escapeLast(d.output,"["),vt("brackets")}for(;d.parens>0;){if(a.strictBrackets===!0)throw new SyntaxError(u("closing",")"));d.output=e.escapeLast(d.output,"("),vt("parens")}for(;d.braces>0;){if(a.strictBrackets===!0)throw new SyntaxError(u("closing","}"));d.output=e.escapeLast(d.output,"{"),vt("braces")}if(a.strictSlashes!==!0&&(p.type==="star"||p.type==="bracket")&&N({type:"maybe_slash",value:"",output:`${rt}?`}),d.backtrack===!0){d.output="";for(const S of d.tokens)d.output+=S.output!=null?S.output:S.value,S.suffix&&(d.output+=S.suffix)}return d};return D.fastpaths=(m,v)=>{const a={...v},A=typeof a.maxLength=="number"?Math.min(s,a.maxLength):s,O=m.length;if(O>A)throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${A}`);m=i[m]||m;const{DOT_LITERAL:_,SLASH_LITERAL:T,ONE_CHAR:x,DOTS_SLASH:B,NO_DOT:U,NO_DOTS:nt,NO_DOTS_SLASH:gt,STAR:rt,START_ANCHOR:K}=t.globChars(a.windows),ot=a.dot?nt:U,mt=a.dot?gt:U,ut=a.capture?"":"?:",it={negated:!1,prefix:""};let W=a.bash===!0?".*?":rt;a.capture&&(W=`(${W})`);const at=k=>k.noglobstar===!0?W:`(${ut}(?:(?!${K}${k.dot?B:_}).)*?)`,Z=k=>{switch(k){case"*":return`${ot}${x}${W}`;case".*":return`${_}${x}${W}`;case"*.*":return`${ot}${W}${_}${x}${W}`;case"*/*":return`${ot}${W}${T}${x}${mt}${W}`;case"**":return ot+at(a);case"**/*":return`(?:${ot}${at(a)}${T})?${mt}${x}${W}`;case"**/*.*":return`(?:${ot}${at(a)}${T})?${mt}${W}${_}${x}${W}`;case"**/.*":return`(?:${ot}${at(a)}${T})?${_}${x}${W}`;default:{const M=/^(.*?)\.(\w+)$/.exec(k);if(!M)return;const Y=Z(M[1]);return Y?Y+_+M[2]:void 0}}},$t=e.removePrefix(m,it);let J=Z($t);return J&&a.strictSlashes!==!0&&(J+=`${T}?`),J},De=D,De}var Fe,as;function co(){if(as)return Fe;as=1;const t=oo(),e=io(),s=_e(),n=Ae(),o=i=>i&&typeof i=="object"&&!Array.isArray(i),r=(i,c,u=!1)=>{if(Array.isArray(i)){const R=i.map(C=>r(C,c,u));return C=>{for(const D of R){const m=D(C);if(m)return m}return!1}}const y=o(i)&&i.tokens&&i.input;if(i===""||typeof i!="string"&&!y)throw new TypeError("Expected pattern to be a non-empty string");const l=c||{},h=l.windows,$=y?r.compileRe(i,c):r.makeRe(i,c,!1,!0),g=$.state;delete $.state;let b=()=>!1;if(l.ignore){const R={...c,ignore:null,onMatch:null,onResult:null};b=r(l.ignore,R,u)}const E=(R,C=!1)=>{const{isMatch:D,match:m,output:v}=r.test(R,$,c,{glob:i,posix:h}),a={glob:i,state:g,regex:$,posix:h,input:R,output:v,match:m,isMatch:D};if(typeof l.onResult=="function"&&l.onResult(a),D===!1)return a.isMatch=!1,C?a:!1;t:if(b(R)){if(typeof l.onIgnore=="function"&&l.onIgnore(a)===n.UNIGNORE){a.isMatch=!0;break t}return a.isMatch=!1,C?a:!1}return typeof l.onMatch=="function"&&l.onMatch(a),C?a:!0};return u&&(E.state=g),E};return r.test=(i,c,u,{glob:y,posix:l}={})=>{if(typeof i!="string")throw new TypeError("Expected input to be a string");if(i==="")return{isMatch:!1,output:""};const h=u||{},$=h.format||(l?s.toPosixSlashes:null);let g=i===y,b=g&&$?$(i):i;return g===!1&&(b=$?$(i):i,g=b===y),(g===!1||h.capture===!0)&&(h.matchBase===!0||h.basename===!0?g=r.matchBase(i,c,u,l):g=c.exec(b)),{isMatch:!!g,match:g,output:b}},r.matchBase=(i,c,u,y=u&&u.windows)=>(c instanceof RegExp?c:r.makeRe(c,u)).test(s.basename(i,{windows:y})),r.isMatch=(i,c,u)=>r(c,u)(i),r.parse=(i,c)=>Array.isArray(i)?i.map(u=>r.parse(u,c)):e(i,{...c,fastpaths:!1}),r.scan=(i,c)=>t(i,c),r.compileRe=(i,c,u=!1,y=!1)=>{if(u===!0)return i.output;const l=c||{},h=l.contains?"":"^",$=l.contains?"":"$";let g=`${h}(?:${i.output})${$}`;i&&i.negated===!0&&(g=`^(?!${g}).*$`);const b=r.toRegex(g,c);return y===!0&&(b.state=i),b},r.makeRe=(i,c={},u=!1,y=!1)=>{if(!i||typeof i!="string")throw new TypeError("Expected a non-empty string");let l={negated:!1,fastpaths:!0};return c.fastpaths!==!1&&(i[0]==="."||i[0]==="*")&&(l.output=e.fastpaths(i,c)),l.output||(l=e(i,c)),r.compileRe(l,c,u,y)},r.toRegex=(i,c)=>{try{const u=c||{};return new RegExp(i,u.flags||(u.nocase?"i":""))}catch(u){if(c&&c.debug===!0)throw u;return/$^/}},r.constants=n,Fe=r,Fe}var He,ls;function uo(){if(ls)return He;ls=1;const t=co(),e=_e();function s(n,o,r=!1){return o&&(o.windows===null||o.windows===void 0)&&(o={...o,windows:e.isWindows()}),t(n,o,r)}return Object.assign(s,t),He=s,He}var ao=uo();const yt=Qe(ao);let lo;const po=t=>(lo??=H(import.meta.url))(t),Wt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,fe=t=>{if(typeof Wt<"u"&&Wt.versions&&Wt.versions.node){const[e,s]=Wt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Wt.getBuiltinModule(t)}return po(t)},ps=fe("fs"),fo={...ps,default:ps},{statSync:ho,stat:go,realpathSync:yo,realpath:mo,readdirSync:$o,readdir:bo}=fe("fs"),{sep:Gs,basename:vo,dirname:qe,resolve:Us,normalize:wo,relative:So,posix:_t,isAbsolute:xo}=fe("path"),{fileURLToPath:Eo}=fe("url"),{createRequire:Ao}=fe("module");var fs=Ao(import.meta.url);function _o(t){let e=wo(t);return e.length>1&&e[e.length-1]===Gs&&(e=e.substring(0,e.length-1)),e}const To=/[\\/]/g;function qs(t,e){return t.replace(To,e)}const Ro=/^[a-z]:[\\/]$/i;function ko(t){return t==="/"||Ro.test(t)}function Ie(t,e){const{resolvePaths:s,normalizePath:n,pathSeparator:o}=e,r=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(s&&(t=Us(t)),(n||r)&&(t=_o(t)),t===".")return"";const i=t[t.length-1]!==o;return qs(i?t+o:t,o)}function zs(t,e){return e+t}function Co(t,e){return function(s,n){return n.startsWith(t)?n.slice(t.length)+s:qs(So(t,n),e.pathSeparator)+e.pathSeparator+s}}function Oo(t){return t}function No(t,e,s){return e+t+s}function Lo(t,e){const{relativePaths:s,includeBasePath:n}=e;return s&&t?Co(t,e):n?zs:Oo}function Do(t){return function(e,s){s.push(e.substring(t.length)||".")}}function Fo(t){return function(e,s,n){const o=e.substring(t.length)||".";n.every(r=>r(o,!0))&&s.push(o)}}const Ho=(t,e)=>{e.push(t||".")},Io=(t,e,s)=>{const n=t||".";s.every(o=>o(n,!0))&&e.push(n)},Bo=()=>{};function Mo(t,e){const{includeDirs:s,filters:n,relativePaths:o}=e;return s?o?n&&n.length?Fo(t):Do(t):n&&n.length?Io:Ho:Bo}const Po=(t,e,s,n)=>{n.every(o=>o(t,!1))&&s.files++},jo=(t,e,s,n)=>{n.every(o=>o(t,!1))&&e.push(t)},Go=(t,e,s,n)=>{s.files++},Uo=(t,e)=>{e.push(t)},qo=()=>{};function zo(t){const{excludeFiles:e,filters:s,onlyCounts:n}=t;return e?qo:s&&s.length?n?Po:jo:n?Go:Uo}const Wo=t=>t,Xo=()=>[""].slice(0,0);function Ko(t){return t.group?Xo:Wo}const Qo=(t,e,s)=>{t.push({directory:e,files:s,dir:e})},Vo=()=>{};function Yo(t){return t.group?Qo:Vo}const Zo=function(t,e,s){const{queue:n,fs:o,options:{suppressErrors:r}}=e;n.enqueue(),o.realpath(t,(i,c)=>{if(i)return n.dequeue(r?null:i,e);o.stat(c,(u,y)=>{if(u)return n.dequeue(r?null:u,e);if(y.isDirectory()&&Ws(t,c,e))return n.dequeue(null,e);s(y,c),n.dequeue(null,e)})})},Jo=function(t,e,s){const{queue:n,fs:o,options:{suppressErrors:r}}=e;n.enqueue();try{const i=o.realpathSync(t),c=o.statSync(i);if(c.isDirectory()&&Ws(t,i,e))return;s(c,i)}catch(i){if(!r)throw i}};function ti(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?Jo:Zo}function Ws(t,e,s){if(s.options.useRealPaths)return ei(e,s);let n=qe(t),o=1;for(;n!==s.root&&o<2;){const r=s.symlinks.get(n);r&&(r===e||r.startsWith(e)||e.startsWith(r))?o++:n=qe(n)}return s.symlinks.set(t,e),o>1}function ei(t,e){return e.visited.includes(t+e.options.pathSeparator)}const si=t=>t.counts,ni=t=>t.groups,ri=t=>t.paths,oi=t=>t.paths.slice(0,t.options.maxFiles),ii=(t,e,s)=>(Te(e,s,t.counts,t.options.suppressErrors),null),ci=(t,e,s)=>(Te(e,s,t.paths,t.options.suppressErrors),null),ui=(t,e,s)=>(Te(e,s,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),ai=(t,e,s)=>(Te(e,s,t.groups,t.options.suppressErrors),null);function Te(t,e,s,n){e(t&&!n?t:null,s)}function li(t,e){const{onlyCounts:s,group:n,maxFiles:o}=t;return s?e?si:ii:n?e?ni:ai:o?e?oi:ui:e?ri:ci}const Xs={withFileTypes:!0},pi=(t,e,s,n,o)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);const{fs:r}=t;t.visited.push(e),t.counts.directories++,r.readdir(e||".",Xs,(i,c=[])=>{o(c,s,n),t.queue.dequeue(t.options.suppressErrors?null:i,t)})},fi=(t,e,s,n,o)=>{const{fs:r}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let i=[];try{i=r.readdirSync(e||".",Xs)}catch(c){if(!t.options.suppressErrors)throw c}o(i,s,n)};function hi(t){return t?fi:pi}var di=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},gi=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},yi=class{aborted=!1;abort(){this.aborted=!0}},Ks=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,s,n){this.isSynchronous=!n,this.callbackInvoker=li(s,this.isSynchronous),this.root=Ie(e,s),this.state={root:ko(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new gi,options:s,queue:new di((o,r)=>this.callbackInvoker(r,o,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new yi,fs:s.fs||fo},this.joinPath=Lo(this.root,s),this.pushDirectory=Mo(this.root,s),this.pushFile=zo(s),this.getArray=Ko(s),this.groupFiles=Yo(s),this.resolveSymlink=ti(s,this.isSynchronous),this.walkDirectory=hi(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(e,s,n)=>{const{paths:o,options:{filters:r,resolveSymlinks:i,excludeSymlinks:c,exclude:u,maxFiles:y,signal:l,useRealPaths:h,pathSeparator:$},controller:g}=this.state;if(g.aborted||l&&l.aborted||y&&o.length>y)return;const b=this.getArray(this.state.paths);for(let E=0;E<e.length;++E){const R=e[E];if(R.isFile()||R.isSymbolicLink()&&!i&&!c){const C=this.joinPath(R.name,s);this.pushFile(C,b,this.state.counts,r)}else if(R.isDirectory()){let C=No(R.name,s,this.state.options.pathSeparator);if(u&&u(R.name,C))continue;this.pushDirectory(C,o,r),this.walkDirectory(this.state,C,C,n-1,this.walk)}else if(this.resolveSymlink&&R.isSymbolicLink()){let C=zs(R.name,s);this.resolveSymlink(C,this.state,(D,m)=>{if(D.isDirectory()){if(m=Ie(m,this.state.options),u&&u(R.name,h?m:C+$))return;this.walkDirectory(this.state,m,h?m:C+$,n-1,this.walk)}else{m=h?m:C;const v=vo(m),a=Ie(qe(m),this.state.options);m=this.joinPath(v,a),this.pushFile(m,b,this.state.counts,r)}})}}this.groupFiles(this.state.groups,s,b)}};function mi(t,e){return new Promise((s,n)=>{Qs(t,e,(o,r)=>{if(o)return n(o);s(r)})})}function Qs(t,e,s){new Ks(t,e,s).start()}function $i(t,e){return new Ks(t,e).start()}var hs=class{constructor(e,s){this.root=e,this.options=s}withPromise(){return mi(this.root,this.options)}withCallback(e){Qs(this.root,this.options,e)}sync(){return $i(this.root,this.options)}};let Vs=null;try{fs.resolve("picomatch"),Vs=fs("picomatch")}catch{}var bi=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:Gs,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new hs(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new hs(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){const s=this.globFunction||Vs;if(!s)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=s(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(o=>n(o)),this}};const vi=Array.isArray,Ys=/\\/g,wi=/^[A-Za-z]:$/,Zs=process.platform==="win32",Si=/^(\/?\.\.)+$/;function ds(t,e={}){const s=t.length,n=Array(s),o=Array(s);let r,i;for(r=0;r<s;r++){const c=Js(t[r]);n[r]=c;const u=c.length,y=Array(u);for(i=0;i<u;i++)y[i]=yt(c[i],e);o[r]=y}return c=>{const u=c.split("/");if(u[0]===".."&&Si.test(c))return!0;for(r=0;r<s;r++){const y=n[r],l=o[r],h=u.length,$=Math.min(h,y.length);for(i=0;i<$;){const g=y[i];if(g.includes("/"))return!0;if(!l[i](u[i]))break;if(!e.noglobstar&&g==="**")return!0;i++}if(i===h)return!0}return!1}}const xi=/^[A-Z]:\/$/i,Ei=Zs?t=>xi.test(t):t=>t==="/";function gs(t,e,s){if(t===e||e.startsWith(`${t}/`)){if(s){const o=t.length+ +!Ei(t);return(r,i)=>r.slice(o,i?-1:void 0)||"."}const n=e.slice(t.length+1);return n?(o,r)=>{if(o===".")return n;const i=`${n}/${o}`;return r?i.slice(0,-1):i}:(o,r)=>r&&o!=="."?o.slice(0,-1):o}return s?n=>_t.relative(t,n)||".":n=>_t.relative(t,`${e}/${n}`)||"."}function Ai(t,e){if(e.startsWith(`${t}/`)){const s=e.slice(t.length+1);return n=>`${s}/${n}`}return s=>{const n=_t.relative(t,`${e}/${s}`);return s[s.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function ys(t){return t.replace(wi,e=>`${e}/`)}const _i={parts:!0};function Js(t){var e;const s=yt.scan(t,_i);return!((e=s.parts)===null||e===void 0)&&e.length?s.parts:[t]}const Ti=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Ri=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,ki=t=>t.replace(Ti,"\\$&"),Ci=t=>t.replace(Ri,"\\$&"),Oi=Zs?Ci:ki;function Ni(t,e){const s=yt.scan(t);return s.isGlob||s.negated}function ue(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function tn(t){return typeof t=="string"?[t]:t??[]}const Li=/^(\/?\.\.)+/,Di=/\\(?=[()[\]{}!*+?@|])/g;function Be(t,e,s,n){var o;const r=e.cwd;let i=t;t[t.length-1]==="/"&&(i=t.slice(0,-1));const c=i.lastIndexOf("/"),u=(c===-1?i:i.slice(c+1)).startsWith("!(");i[i.length-1]!=="*"&&!u&&e.expandDirectories&&(i+="/**");const y=Oi(r);i=xo(i.replace(Di,""))?_t.relative(y,i):_t.normalize(i);const l=(o=Li.exec(i))===null||o===void 0?void 0:o[0],h=Js(i);if(l){const g=(l.length+1)/3;let b=0;const E=y.split("/");for(;b<g&&h[b+g]===E[E.length+b-g];)i=i.slice(0,(g-b-1)*3)+i.slice((g-b)*3+h[b+g].length+1)||".",b++;const R=_t.join(r,l.slice(b*3));R[0]!=="."&&s.root.length>R.length&&(s.root=ys(R),s.depthOffset=-g+b)}if(!n&&s.depthOffset>=0){var $;($=s.commonPath)!==null&&$!==void 0||(s.commonPath=h);const g=[],b=Math.min(s.commonPath.length,h.length);for(let E=0;E<b;E++){const R=h[E];if(R==="**"&&!h[E+1]){g.pop();break}if(E===h.length-1||R!==s.commonPath[E]||Ni(R))break;g.push(R)}s.depthOffset=g.length,s.commonPath=g,s.root=ys(g.length>0?_t.join(r,...g):r)}return i}function Fi(t,e,s){const n=[],o=[],r=[];for(const i of t.ignore)i&&(i[0]!=="!"||i[1]==="("?o.push(Be(i,t,s,!0)):r.push(i.slice(1)));for(const i of e)i&&(i[0]!=="!"||i[1]==="("?n.push(Be(i,t,s,!1)):(i[1]!=="!"||i[2]==="(")&&o.push(Be(i.slice(1),t,s,!0)));return{match:n,ignore:o,unignore:r}}function Hi(t,e){const s=t.cwd,n={root:s,depthOffset:0},o=Fi(t,e,n);t.debug&&ue("internal processing patterns:",o);const{absolute:r,caseSensitiveMatch:i,debug:c,dot:u,followSymbolicLinks:y,onlyDirectories:l}=t,h=n.root.replace(Ys,""),$={dot:u,nobrace:t.braceExpansion===!1,nocase:!i,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},g=o.unignore.length>0,b=g?yt(o.unignore,$):void 0,E=g?ds(o.unignore,$):void 0,R=yt(o.match,{...$,ignore:o.ignore,onIgnore:b?T=>b(T.output)&&yt.constants.UNIGNORE:void 0}),C=yt(o.ignore,$),D=ds(o.match,$),m=gs(s,h,r),v=r?m:gs(s,h,!0),a=o.match.length>0&&o.match.every(T=>T==="**"||T==="**/*"),A=o.ignore.length>0||g||!a?(T,x)=>{const B=v(x,!0);return B==="."||E&&E(B)?!1:!D(B)||C(B)}:void 0;let O;t.deep!==void 0&&(O=Math.round(t.deep-n.depthOffset));const _=new bi({filters:[c?(T,x)=>{const B=m(T,x),U=R(B);return U&&ue(`matched ${B}`),U}:(T,x)=>{const B=m(T,x);return R(B)}],exclude:c&&A?(T,x)=>{const B=A(T,x);return ue(`${B?"skipped":"crawling"} ${x}`),B}:A,fs:t.fs,pathSeparator:"/",relativePaths:!r,resolvePaths:r,includeBasePath:r,resolveSymlinks:y,excludeSymlinks:!y,excludeFiles:l,includeDirs:l||!t.onlyFiles,maxDepth:O,signal:t.signal}).crawl(h);return t.debug&&ue("internal properties:",{...n,root:h}),[_,s!==h&&!r&&Ai(s,h)]}function en(t,e){if(e)for(let s=t.length-1;s>=0;s--)t[s]=e(t[s]);return t}const ms={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Ii(t){const e=Object.assign({},t);for(const s in ms)e[s]===void 0&&Object.assign(e,{[s]:ms[s]});return e.cwd=(e.cwd instanceof URL?Eo(e.cwd):Us(e.cwd||process.cwd())).replace(Ys,"/"),e.ignore=tn(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||bo,readdirSync:e.fs.readdirSync||$o,realpath:e.fs.realpath||mo,realpathSync:e.fs.realpathSync||yo,stat:e.fs.stat||go,statSync:e.fs.statSync||ho}),e.debug&&ue("globbing with options:",e),e}function sn(t,e={}){var s;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const n=vi(t)||typeof t=="string",o=tn((s=n?t:t.patterns)!==null&&s!==void 0?s:"**/*"),r=Ii(n?e:t);return o.length>0?Hi(r,o):[]}async function Bi(t,e){const[s,n]=sn(t,e);return s?en(await s.withPromise(),n):[]}function Mi(t,e){const[s,n]=sn(t,e);return s?en(s.sync(),n):[]}const ja=async(t,e)=>await Bi(t,e),Ga=(t,e)=>Mi(t,e);var Me,$s;function Pi(){if($s)return Me;$s=1;/*!
|
|
1
|
+
import{createRequire as wn}from"node:module";let Sn;const xn=t=>(Sn??=wn(import.meta.url))(t),Ct=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,En=t=>{if(typeof Ct<"u"&&Ct.versions&&Ct.versions.node){const[e,s]=Ct.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Ct.getBuiltinModule(t)}return xn(t)},{createRequire:H}=En("node:module"),we=0,Os=4,ba=2,va=1,Ns=Symbol("findUpStop"),An=/^[A-Z]:\//i,Et=(t="")=>t&&t.replaceAll("\\","/").replace(An,e=>e.toUpperCase()),_n=/^[/\\]{2}/,Tn=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,ze=/^[A-Z]:$/i,Rn=/[^/](\.[^./]+)$/,kn=/^[/\\]|^[a-z]:[/\\]/i,Cn=/\/$/,On=()=>{if(typeof process.cwd=="function")try{const t=process.cwd();if(typeof t=="string")return Et(t)}catch{}return"/"},Ls=(t,e)=>{let s="",n=0,o=-1,r=0,i;for(let c=0;c<=t.length;++c){if(c<t.length)i=t[c];else{if(i==="/")break;i="/"}if(i==="/"){if(!(o===c-1||r===1))if(r===2){if(s.length<2||n!==2||!s.endsWith(".")||s.at(-2)!=="."){if(s.length>2){const u=s.lastIndexOf("/");u===-1?(s="",n=0):(s=s.slice(0,u),n=s.length-1-s.lastIndexOf("/")),o=c,r=0;continue}else if(s.length>0){s="",n=0,o=c,r=0;continue}}e&&(s+=s.length>0?"/..":"..",n=2)}else s.length>0?s+=`/${t.slice(o+1,c)}`:s=t.slice(o+1,c),n=c-o-1;o=c,r=0}else i==="."&&r!==-1?++r:r=-1}return s},St=t=>Tn.test(t),Tt=function(t){if(t.length===0)return".";t=Et(t);const e=_n.exec(t),s=St(t),n=t.at(-1)==="/";return t=Ls(t,!s),t.length===0?s?"/":n?"./":".":(n&&(t+="/"),ze.test(t)&&(t+="/"),e?s?`//${t}`:`//./${t}`:s&&!St(t)?`/${t}`:t)},Se=(...t)=>{let e="";for(const s of t)if(s)if(e.length>0){const n=e.at(-1)==="/",o=s[0]==="/";n&&o?e+=s.slice(1):e+=n||o?s:`/${s}`}else e+=s;return Tt(e)},tt=function(...t){t=t.map(n=>Et(n));let e="",s=!1;for(let n=t.length-1;n>=-1&&!s;n--){const o=n>=0?t[n]:On();!o||o.length===0||(e=`${o}/${e}`,s=St(o))}return e=Ls(e,!s),ze.test(e)?`${e}/`:s&&!St(e)?`/${e}`:e.length>0?e:"."},ht=function(t){return Et(t)},Nn=function(t){return Rn.exec(Et(t))?.[1]??""},V=t=>{const e=Et(t).replace(Cn,""),s=e.lastIndexOf("/");if(s===-1)return St(t)?"/":".";const n=e.slice(0,s);return ze.test(n)?`${n}/`:n||(St(t)?"/":".")},le=(t,e)=>{const s=Et(t),n=s.slice(s.lastIndexOf("/")+1);if(e&&n.endsWith(e)){if(e===s)return"";const o=n.slice(0,-e.length);if(o.length>0)return o}return n},Ds=function(t){const e=kn.exec(t)?.[0]?.replaceAll("\\","/")??"",s=le(t),n=Nn(s);return{base:s,dir:V(t),ext:n,name:s.slice(0,s.length-n.length),root:e}};let Ln;const Dn=t=>(Ln??=H(import.meta.url))(t),Ot=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fn=t=>{if(typeof Ot<"u"&&Ot.versions&&Ot.versions.node){const[e,s]=Ot.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Ot.getBuiltinModule(t)}return Dn(t)},{fileURLToPath:Hn}=Fn("node:url");function In(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ve,Ye;function Bn(){return Ye||(Ye=1,Ve=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Ve}var Mn=Bn();const Pn=In(Mn);new Set(Pn);const F=t=>Et(t instanceof URL?Hn(t):t);let xt=class extends Error{constructor(e){super(`EEXIST: ${e}`)}get code(){return"EEXIST"}set code(e){throw new Error("Cannot overwrite code EEXIST")}get name(){return"AlreadyExistsError"}set name(e){throw new Error("Cannot overwrite name of AlreadyExistsError")}};const P=t=>{if(!t||!(t instanceof URL)&&typeof t!="string")throw new TypeError("Path must be a non-empty string or URL.")};let jn;const Gn=t=>(jn??=H(import.meta.url))(t),Nt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Un=t=>{if(typeof Nt<"u"&&Nt.versions&&Nt.versions.node){const[e,s]=Nt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Nt.getBuiltinModule(t)}return Gn(t)},{cp:qn}=Un("node:fs/promises"),Sa=async(t,e,s={})=>{P(t),P(e);const{dereference:n=!1,errorOnExist:o=!0,filter:r,overwrite:i=!0,preserveTimestamps:c=!1,recursive:u=!0,verbatimSymlinks:y=!1}=s,l=F(t),h=F(e);try{await qn(l,h,{dereference:n,errorOnExist:o,filter:r,force:i,preserveTimestamps:c,recursive:u,verbatimSymlinks:y})}catch($){throw $?.code==="ERR_FS_CP_EEXIST"?new xt(`destination already exists, copy '${h}'`):$}};let zn;const Wn=t=>(zn??=H(import.meta.url))(t),Lt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Xn=t=>{if(typeof Lt<"u"&&Lt.versions&&Lt.versions.node){const[e,s]=Lt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Lt.getBuiltinModule(t)}return Wn(t)},{cpSync:Kn}=Xn("node:fs"),xa=(t,e,s={})=>{P(t),P(e);const{dereference:n=!1,errorOnExist:o=!0,filter:r,overwrite:i=!0,preserveTimestamps:c=!1,recursive:u=!0,verbatimSymlinks:y=!1}=s,l=F(t),h=F(e);try{Kn(l,h,{dereference:n,errorOnExist:o,filter:r,force:i,preserveTimestamps:c,recursive:u,verbatimSymlinks:y})}catch($){throw $?.code==="ERR_FS_CP_EEXIST"?new xt(`destination already exists, copy '${h}'`):$}},dt=t=>{if(t.isFile())return"file";if(t.isDirectory())return"dir";if(t.isSymbolicLink())return"symlink"};let Qn;const Vn=t=>(Qn??=H(import.meta.url))(t),Dt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Yn=t=>{if(typeof Dt<"u"&&Dt.versions&&Dt.versions.node){const[e,s]=Dt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Dt.getBuiltinModule(t)}return Vn(t)},{lstat:Ze,mkdir:Zn}=Yn("node:fs/promises"),We=async t=>{P(t);try{const e=await Ze(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(dt(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await Zn(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const s=await Ze(t);if(!s.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(dt(s))}'`,{cause:e})}};let Jn;const tr=t=>(Jn??=H(import.meta.url))(t),Ft=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,er=t=>{if(typeof Ft<"u"&&Ft.versions&&Ft.versions.node){const[e,s]=Ft.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Ft.getBuiltinModule(t)}return tr(t)},{lstatSync:Je,mkdirSync:sr}=er("node:fs"),Xe=t=>{P(t);try{const e=Je(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(dt(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{sr(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const s=Je(t);if(!s.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(dt(s))}'`,{cause:e})}};let nr;const rr=t=>(nr??=H(import.meta.url))(t),Ht=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,or=t=>{if(typeof Ht<"u"&&Ht.versions&&Ht.versions.node){const[e,s]=Ht.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Ht.getBuiltinModule(t)}return rr(t)},{lstat:ir,writeFile:cr}=or("node:fs/promises"),Ea=async t=>{P(t);try{const e=await ir(t);if(!e.isFile())throw new Error(`Ensure path exists, expected 'file', got '${String(dt(e))}'`)}catch(e){if(e.code==="ENOENT"){await We(V(F(t))),await cr(t,new Uint8Array);return}throw e}};let ur;const ar=t=>(ur??=H(import.meta.url))(t),It=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,lr=t=>{if(typeof It<"u"&&It.versions&&It.versions.node){const[e,s]=It.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return It.getBuiltinModule(t)}return ar(t)},{lstatSync:pr,writeFileSync:fr}=lr("node:fs"),Aa=t=>{P(t);try{const e=pr(t);if(!e.isFile())throw new Error(`Ensure path exists, expected 'file', got '${String(dt(e))}'`)}catch(e){if(e.code==="ENOENT"){Xe(V(F(t))),fr(t,new Uint8Array);return}throw e}},xe=(t,e)=>e.ino!==0n&&e.dev!==0n&&e.ino===t.ino&&e.dev===t.dev;let hr;const dr=t=>(hr??=H(import.meta.url))(t),Bt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gr=t=>{if(typeof Bt<"u"&&Bt.versions&&Bt.versions.node){const[e,s]=Bt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Bt.getBuiltinModule(t)}return dr(t)},{lstat:ts,link:yr}=gr("node:fs/promises"),_a=async(t,e)=>{P(t),P(e),t=ht(F(t)),e=ht(F(e));let s;try{s=await ts(e,{bigint:!0})}catch{}let n;try{n=await ts(t,{bigint:!0})}catch(o){const r=o;throw r.message=r.message.replace("lstat","ensureLink"),r}s&&xe(n,s)||(await We(V(e)),await yr(t,e))};let mr;const $r=t=>(mr??=H(import.meta.url))(t),Mt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,br=t=>{if(typeof Mt<"u"&&Mt.versions&&Mt.versions.node){const[e,s]=Mt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Mt.getBuiltinModule(t)}return $r(t)},{lstatSync:es,linkSync:vr}=br("node:fs"),Ta=(t,e)=>{P(t),P(e),t=ht(F(t)),e=ht(F(e));let s;try{s=es(e,{bigint:!0})}catch{}let n;try{n=es(t,{bigint:!0})}catch(o){const r=o;throw r.message=r.message.replace("lstat","ensureLink"),r}s&&xe(n,s)||(Xe(V(e)),vr(t,e))},Fs=(t,e)=>typeof t!="string"?t:t.startsWith("./")?tt(t):typeof e=="string"?tt(V(e),t):new URL(t,e);let wr;const Sr=t=>(wr??=H(import.meta.url))(t),Pt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xr=t=>{if(typeof Pt<"u"&&Pt.versions&&Pt.versions.node){const[e,s]=Pt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Pt.getBuiltinModule(t)}return Sr(t)},{lstat:ke,stat:ss,symlink:Er,readlink:Ar}=xr("node:fs/promises"),_r=process.platform==="win32"||/^(?:msys|cygwin)$/.test(process.env.OSTYPE),Ra=async(t,e,s)=>{P(t),P(e);const n=Fs(t,e);e=ht(F(e));try{if((await ke(e)).isSymbolicLink()){const[c,u]=await Promise.all([ss(n,{bigint:!0}),ss(e,{bigint:!0})]);if(xe(c,u))return}}catch{}const o=await ke(n),r=dt(o);await We(V(e));let i=s??"file";s||(_r?i="junction":i=r==="dir"?"dir":"file");try{await Er(ht(F(n)),e,i)}catch(c){if(c.code!=="EEXIST")throw c;const u=await ke(e);if(!u.isSymbolicLink())throw new xt(`A ${String(dt(u))} already exists at the path: ${e}`);const y=await Ar(e),l=ht(tt(y));if(l!==n)throw new xt(`A symlink targeting to an undesired path already exists: ${e} -> ${l}`)}};let Tr;const Rr=t=>(Tr??=H(import.meta.url))(t),jt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,kr=t=>{if(typeof jt<"u"&&jt.versions&&jt.versions.node){const[e,s]=jt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return jt.getBuiltinModule(t)}return Rr(t)},{lstatSync:Ce,statSync:ns,symlinkSync:Cr,readlinkSync:Or}=kr("node:fs"),Nr=process.platform==="win32"||/^(?:msys|cygwin)$/.test(process.env.OSTYPE),ka=(t,e,s)=>{P(t),P(e);const n=Fs(t,e);e=ht(F(e));try{if(Ce(e).isSymbolicLink()&&xe(ns(n,{bigint:!0}),ns(e,{bigint:!0})))return}catch{}const o=Ce(n),r=dt(o);Xe(V(e));let i=s??"file";s||(Nr?i="junction":i=r==="dir"?"dir":"file");try{Cr(ht(F(n)),e,i)}catch(c){if(c.code!=="EEXIST")throw c;const u=Ce(e);if(!u.isSymbolicLink())throw new xt(`A ${String(dt(u))} already exists at the path: ${e}`);const y=Or(e),l=ht(tt(y));if(l!==n)throw new xt(`A symlink targeting to an undesired path already exists: ${e} -> ${l}`)}},Lr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{platform:Dr}=Lr,Hs=/\r?\n/g,Is=`
|
|
2
|
+
`,Ge=`\r
|
|
3
|
+
`,Ca=Dr==="win32"?Ge:Is,Oa=t=>{const e=t.match(Hs);if(!e||e.length===0)return null;const s=e.filter(o=>o===Ge).length,n=e.length-s;return s>n?Ge:Is},Na=(t,e)=>t.replaceAll(Hs,e);let me=class extends Error{root;constructor(e,s){super(`${e instanceof Error?e.message:String(e)} for path "${s}"`),this.cause=e,this.root=s}get name(){return"WalkError"}set name(e){throw new Error("Cannot overwrite name of WalkError")}};const Fr=t=>{const e=[],s=new Set;let n=0;for(const c of t){if(c==="{")e.push(n);else if(c==="}"){const u=e.pop();u!==void 0&&(s.add(u),s.add(n))}n+=1}let o=0,r=0,i="";for(const c of t)c==="{"?s.has(r)?(i+="(",o+=1):i+=String.raw`\{`:c==="}"?s.has(r)?(i+=")",o-=1):i+=String.raw`\}`:c===","&&o>0?i+="|":i+=c,r+=1;return i},$e=t=>{const e=t.replace(/[$()+\\^]/g,String.raw`\$&`).replace(/\.\*/g,".([^/]*)").replace(/\*\*/g,"(.*)").replace(/(?<!\.)\*(?!\*)/g,"([^/]*)").replace(/\?/g,"[^/]").replace(/\.(?!\*)/g,String.raw`\.`),s=Fr(e).replace(/\[!(.*?)\]/g,"[^$1]");try{return new RegExp(`^${s}$`)}catch(n){throw new Error(`Invalid glob pattern: ${t}`,{cause:n})}};let Hr=class{name;path;#t;constructor(e,s,n){this.#t=e,this.name=s,this.path=n}isDirectory(){return this.#t.isDirectory()}isFile(){return this.#t.isFile()}isSymbolicLink(){return this.#t.isSymbolicLink()}};const kt=(t,e,s)=>new Hr(t,e,s),wt=(t,e,s,n)=>{if(Array.isArray(e)&&e.length>0&&!e.some(r=>t.endsWith(r)))return!1;const o=t.includes("\\")?t.replaceAll("\\","/"):t;return s&&!s.some(r=>r.test(o))?!1:!n?.some(r=>r.test(o))};let Ir;const Br=t=>(Ir??=H(import.meta.url))(t),Gt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Mr=t=>{if(typeof Gt<"u"&&Gt.versions&&Gt.versions.node){const[e,s]=Gt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Gt.getBuiltinModule(t)}return Br(t)},{readdir:Pr,realpath:jr,stat:Bs}=Mr("node:fs/promises"),Gr=async t=>{const e=Tt(t),s=le(e),n=await Bs(e);return kt(n,s,e)};async function*Ms(t,e={}){const{extensions:s,followSymlinks:n=!1,includeDirs:o=!0,includeFiles:r=!0,includeSymlinks:i=!0,match:c,maxDepth:u=Number.POSITIVE_INFINITY,skip:y}=e;if(P(t),u<0)return;const l=e.visited??new Set,h=c?c.map(g=>typeof g=="string"?$e(g):g):void 0,$=y?y.map(g=>typeof g=="string"?$e(g):g):void 0;if(t=tt(F(t)),o&&wt(t,s,h,$)&&(yield await Gr(t)),!(u<1||!wt(t,void 0,void 0,$)))try{const g=await Pr(t,{withFileTypes:!0});for(const b of g){let E=Se(t,b.name),R=b,{name:C}=b,D=b.isDirectory(),m=b.isFile();if(b.isSymbolicLink())if(n){const v=Tt(await jr(E));if(l.has(v))continue;E=v;const a=await Bs(v);D=a.isDirectory(),m=a.isFile(),R=a,C=le(v)}else if(i&&wt(E,s,h,$)){yield kt(b,b.name,E);continue}else continue;D?(n&&l.add(E),yield*Ms(E,{extensions:s,followSymlinks:n,includeDirs:o,includeFiles:r,includeSymlinks:i,match:h,maxDepth:u-1,skip:$,visited:l})):m&&r&&wt(E,s,h,$)&&(yield kt(R,C,E))}}catch(g){throw g instanceof me?g:new me(g,t)}}const Fa=async(t,e={})=>{Array.isArray(e.extensions)||(e.extensions=["js","mjs","cjs","ts"]);const s=[];for await(const n of Ms(t,e))s.push(n.path);return s};let Ur;const qr=t=>(Ur??=H(import.meta.url))(t),Ut=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,zr=t=>{if(typeof Ut<"u"&&Ut.versions&&Ut.versions.node){const[e,s]=Ut.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Ut.getBuiltinModule(t)}return qr(t)},{readdirSync:Wr,realpathSync:Xr,statSync:Ps}=zr("node:fs"),Kr=t=>{const e=Tt(t),s=Ps(e);return kt(s,le(e),e)};function*js(t,e={}){const{extensions:s,followSymlinks:n=!1,includeDirs:o=!0,includeFiles:r=!0,includeSymlinks:i=!0,match:c,maxDepth:u=Number.POSITIVE_INFINITY,skip:y}=e;if(P(t),u<0)return;const l=e.visited??new Set,h=c?c.map(g=>typeof g=="string"?$e(g):g):void 0,$=y?y.map(g=>typeof g=="string"?$e(g):g):void 0;if(t=tt(F(t)),o&&wt(t,s,h,$)&&(yield Kr(t)),!(u<1||!wt(t,void 0,void 0,$)))try{const g=Wr(t,{withFileTypes:!0});for(const b of g){let E=Se(t,b.name),R=b,{name:C}=b,D=b.isDirectory(),m=b.isFile();if(b.isSymbolicLink())if(n){const v=Tt(Xr(E));if(l.has(v))continue;E=v;const a=Ps(v);D=a.isDirectory(),m=a.isFile(),R=a,C=le(v)}else if(i&&wt(E,s,h,$)){yield kt(b,b.name,Tt(E));continue}else continue;D?(n&&l.add(E),yield*js(E,{extensions:s,followSymlinks:n,includeDirs:o,includeFiles:r,includeSymlinks:i,match:h,maxDepth:u-1,skip:$,visited:l})):m&&r&&wt(E,s,h,$)&&(yield kt(R,C,Tt(E)))}}catch(g){throw g instanceof me?g:new me(g,t)}}const Ha=(t,e={})=>{Array.isArray(e.extensions)||(e.extensions=["js","mjs","cjs","ts"]);const s=[];for(const n of js(t,e))s.push(n.path);return s};let Qr;const Vr=t=>(Qr??=H(import.meta.url))(t),qt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Yr=t=>{if(typeof qt<"u"&&qt.versions&&qt.versions.node){const[e,s]=qt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return qt.getBuiltinModule(t)}return Vr(t)},{stat:Zr,lstat:Jr}=Yr("node:fs/promises"),Ia=async(t,e={})=>{if(typeof t!="string"&&!Array.isArray(t)&&typeof t!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const s=e.cwd?F(e.cwd):process.cwd();let n=tt(s);const{root:o}=Ds(n),r=F(e.stopAt??o),i=tt(n,r),c=e.type??"file",u=async function(l){return typeof t=="function"?[await t(l)]:typeof t=="string"?[t]:Array.isArray(t)?t:[t]};e.allowSymlinks??=!0;const y=e.allowSymlinks?Zr:Jr;for(;n;){const l=await u(n);for(let h of l){if(h===Ns)return;if(h===void 0)continue;Buffer.isBuffer(h)?h=h.toString():h instanceof URL&&(h=F(h));const $=St(h)?h:tt(n,h);try{const g=await y($);if(c==="file"&&g.isFile()||c==="directory"&&g.isDirectory())return $}catch{}}if(n===i||n===o)break;n=V(n)}};let to;const eo=t=>(to??=H(import.meta.url))(t),zt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,so=t=>{if(typeof zt<"u"&&zt.versions&&zt.versions.node){const[e,s]=zt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return zt.getBuiltinModule(t)}return eo(t)},{statSync:no,lstatSync:ro}=so("node:fs"),Ba=(t,e={})=>{if(typeof t!="string"&&!Array.isArray(t)&&typeof t!="function")throw new TypeError("The `name` argument must be of type `string` or `string[]`");const s=e.cwd?F(e.cwd):process.cwd();let n=tt(s);const{root:o}=Ds(n),r=F(e.stopAt??o),i=tt(n,r),c=e.type??"file",u=function(l){return typeof t=="function"?[t(l)]:typeof t=="string"?[t]:Array.isArray(t)?t:[t]};e.allowSymlinks??=!0;const y=e.allowSymlinks?no:ro;for(;n;){for(let l of u(n)){if(l===Ns)return;if(l===void 0)continue;Buffer.isBuffer(l)?l=l.toString():l instanceof URL&&(l=F(l));const h=St(l)?l:tt(n,l);try{const $=y(h);if(c==="file"&&$.isFile()||c==="directory"&&$.isDirectory())return h}catch{}}if(n===i||n===o)break;n=V(n)}};function Ke(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var rs={},Oe,os;function Ee(){if(os)return Oe;os=1;const t="\\\\/",e=`[^${t}]`,s=0,n=Symbol("unignore"),o="\\.",r="\\+",i="\\?",c="\\/",u="(?=.)",y="[^/]",l=`(?:${c}|$)`,h=`(?:^|${c})`,$=`${o}{1,2}${l}`,g=`(?!${o})`,b=`(?!${h}${$})`,E=`(?!${o}{0,1}${l})`,R=`(?!${$})`,C=`[^.${c}]`,D=`${y}*?`,m={DOT_LITERAL:o,PLUS_LITERAL:r,QMARK_LITERAL:i,SLASH_LITERAL:c,ONE_CHAR:u,QMARK:y,END_ANCHOR:l,DOTS_SLASH:$,NO_DOT:g,NO_DOTS:b,NO_DOT_SLASH:E,NO_DOTS_SLASH:R,QMARK_NO_DOT:C,STAR:D,START_ANCHOR:h,SEP:"/"},v={...m,SLASH_LITERAL:`[${t}]`,QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${o}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${o})`,NO_DOTS:`(?!(?:^|[${t}])${o}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${o}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${o}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"},a={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return Oe={DEFAULT_MAX_EXTGLOB_RECURSION:s,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:a,UNIGNORE:n,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(A){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${A.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(A){return A===!0?v:m}},Oe}var is;function Ae(){return is||(is=1,(function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:o}=Ee();t.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),t.hasRegexChars=r=>n.test(r),t.isRegexChar=r=>r.length===1&&t.hasRegexChars(r),t.escapeRegex=r=>r.replace(o,"\\$1"),t.toPosixSlashes=r=>r.replace(e,"/"),t.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const r=navigator.platform.toLowerCase();return r==="win32"||r==="windows"}return process.platform?process.platform==="win32":!1},t.removeBackslashes=r=>r.replace(s,i=>i==="\\"?"":i),t.escapeLast=(r,i,c)=>{const u=r.lastIndexOf(i,c);return u===-1?r:r[u-1]==="\\"?t.escapeLast(r,i,u-1):`${r.slice(0,u)}\\${r.slice(u)}`},t.removePrefix=(r,i={})=>{let c=r;return c.startsWith("./")&&(c=c.slice(2),i.prefix="./"),c},t.wrapOutput=(r,i={},c={})=>{const u=c.contains?"":"^",y=c.contains?"":"$";let l=`${u}(?:${r})${y}`;return i.negated===!0&&(l=`(?:^(?!${l}).*$)`),l},t.basename=(r,{windows:i}={})=>{const c=r.split(i?/[\\/]/:"/"),u=c[c.length-1];return u===""?c[c.length-2]:u}})(rs)),rs}var Ne,cs;function oo(){if(cs)return Ne;cs=1;const t=Ae(),{CHAR_ASTERISK:e,CHAR_AT:s,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:o,CHAR_DOT:r,CHAR_EXCLAMATION_MARK:i,CHAR_FORWARD_SLASH:c,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:y,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:h,CHAR_QUESTION_MARK:$,CHAR_RIGHT_CURLY_BRACE:g,CHAR_RIGHT_PARENTHESES:b,CHAR_RIGHT_SQUARE_BRACKET:E}=Ee(),R=D=>D===c||D===n,C=D=>{D.isPrefix!==!0&&(D.depth=D.isGlobstar?1/0:1)};return Ne=(D,m)=>{const v=m||{},a=D.length-1,A=v.parts===!0||v.scanToEnd===!0,O=[],_=[],T=[];let x=D,B=-1,U=0,nt=0,gt=!1,rt=!1,K=!1,ot=!1,mt=!1,ut=!1,it=!1,W=!1,at=!1,Z=!1,$t=0,J,k,M={value:"",depth:0,isGlob:!1};const Y=()=>B>=a,d=()=>x.charCodeAt(B+1),q=()=>(J=k,x.charCodeAt(++B));for(;B<a;){k=q();let et;if(k===n){it=M.backslashes=!0,k=q(),k===u&&(ut=!0);continue}if(ut===!0||k===u){for($t++;Y()!==!0&&(k=q());){if(k===n){it=M.backslashes=!0,q();continue}if(k===u){$t++;continue}if(ut!==!0&&k===r&&(k=q())===r){if(gt=M.isBrace=!0,K=M.isGlob=!0,Z=!0,A===!0)continue;break}if(ut!==!0&&k===o){if(gt=M.isBrace=!0,K=M.isGlob=!0,Z=!0,A===!0)continue;break}if(k===g&&($t--,$t===0)){ut=!1,gt=M.isBrace=!0,Z=!0;break}}if(A===!0)continue;break}if(k===c){if(O.push(B),_.push(M),M={value:"",depth:0,isGlob:!1},Z===!0)continue;if(J===r&&B===U+1){U+=2;continue}nt=B+1;continue}if(v.noext!==!0&&(k===h||k===s||k===e||k===$||k===i)&&d()===y){if(K=M.isGlob=!0,ot=M.isExtglob=!0,Z=!0,k===i&&B===U&&(at=!0),A===!0){for(;Y()!==!0&&(k=q());){if(k===n){it=M.backslashes=!0,k=q();continue}if(k===b){K=M.isGlob=!0,Z=!0;break}}continue}break}if(k===e){if(J===e&&(mt=M.isGlobstar=!0),K=M.isGlob=!0,Z=!0,A===!0)continue;break}if(k===$){if(K=M.isGlob=!0,Z=!0,A===!0)continue;break}if(k===l){for(;Y()!==!0&&(et=q());){if(et===n){it=M.backslashes=!0,q();continue}if(et===E){rt=M.isBracket=!0,K=M.isGlob=!0,Z=!0;break}}if(A===!0)continue;break}if(v.nonegate!==!0&&k===i&&B===U){W=M.negated=!0,U++;continue}if(v.noparen!==!0&&k===y){if(K=M.isGlob=!0,A===!0){for(;Y()!==!0&&(k=q());){if(k===y){it=M.backslashes=!0,k=q();continue}if(k===b){Z=!0;break}}continue}break}if(K===!0){if(Z=!0,A===!0)continue;break}}v.noext===!0&&(ot=!1,K=!1);let G=x,bt="",p="";U>0&&(bt=x.slice(0,U),x=x.slice(U),nt-=U),G&&K===!0&&nt>0?(G=x.slice(0,nt),p=x.slice(nt)):K===!0?(G="",p=x):G=x,G&&G!==""&&G!=="/"&&G!==x&&R(G.charCodeAt(G.length-1))&&(G=G.slice(0,-1)),v.unescape===!0&&(p&&(p=t.removeBackslashes(p)),G&&it===!0&&(G=t.removeBackslashes(G)));const f={prefix:bt,input:D,start:U,base:G,glob:p,isBrace:gt,isBracket:rt,isGlob:K,isExtglob:ot,isGlobstar:mt,negated:W,negatedExtglob:at};if(v.tokens===!0&&(f.maxDepth=0,R(k)||_.push(M),f.tokens=_),v.parts===!0||v.tokens===!0){let et;for(let I=0;I<O.length;I++){const ct=et?et+1:U,lt=O[I],st=D.slice(ct,lt);v.tokens&&(I===0&&U!==0?(_[I].isPrefix=!0,_[I].value=bt):_[I].value=st,C(_[I]),f.maxDepth+=_[I].depth),(I!==0||st!=="")&&T.push(st),et=lt}if(et&&et+1<D.length){const I=D.slice(et+1);T.push(I),v.tokens&&(_[_.length-1].value=I,C(_[_.length-1]),f.maxDepth+=_[_.length-1].depth)}f.slashes=O,f.parts=T}return f},Ne}var Le,us;function io(){if(us)return Le;us=1;const t=Ee(),e=Ae(),{MAX_LENGTH:s,POSIX_REGEX_SOURCE:n,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:r,REPLACEMENTS:i}=t,c=(m,v)=>{if(typeof v.expandRange=="function")return v.expandRange(...m,v);m.sort();const a=`[${m.join("-")}]`;try{new RegExp(a)}catch{return m.map(A=>e.escapeRegex(A)).join("..")}return a},u=(m,v)=>`Missing ${m}: "${v}" - use "\\\\${v}" to match literal characters`,y=m=>{const v=[];let a=0,A=0,O=0,_="",T=!1;for(const x of m){if(T===!0){_+=x,T=!1;continue}if(x==="\\"){_+=x,T=!0;continue}if(x==='"'){O=O===1?0:1,_+=x;continue}if(O===0){if(x==="[")a++;else if(x==="]"&&a>0)a--;else if(a===0){if(x==="(")A++;else if(x===")"&&A>0)A--;else if(x==="|"&&A===0){v.push(_),_="";continue}}}_+=x}return v.push(_),v},l=m=>{let v=!1;for(const a of m){if(v===!0){v=!1;continue}if(a==="\\"){v=!0;continue}if(/[?*+@!()[\]{}]/.test(a))return!1}return!0},h=m=>{let v=m.trim(),a=!0;for(;a===!0;)a=!1,/^@\([^\\()[\]{}|]+\)$/.test(v)&&(v=v.slice(2,-1),a=!0);if(l(v))return v.replace(/\\(.)/g,"$1")},$=m=>{const v=m.map(h).filter(Boolean);for(let a=0;a<v.length;a++)for(let A=a+1;A<v.length;A++){const O=v[a],_=v[A],T=O[0];if(!(!T||O!==T.repeat(O.length)||_!==T.repeat(_.length))&&(O===_||O.startsWith(_)||_.startsWith(O)))return!0}return!1},g=(m,v=!0)=>{if(m[0]!=="+"&&m[0]!=="*"||m[1]!=="(")return;let a=0,A=0,O=0,_=!1;for(let T=1;T<m.length;T++){const x=m[T];if(_===!0){_=!1;continue}if(x==="\\"){_=!0;continue}if(x==='"'){O=O===1?0:1;continue}if(O!==1){if(x==="["){a++;continue}if(x==="]"&&a>0){a--;continue}if(!(a>0)){if(x==="("){A++;continue}if(x===")"&&(A--,A===0))return v===!0&&T!==m.length-1?void 0:{type:m[0],body:m.slice(2,T),end:T}}}}},b=m=>`${m.length===1?e.escapeRegex(m[0]):`[${m.map(v=>e.escapeRegex(v)).join("")}]`}*`,E=m=>{let v=0;const a=[];for(;v<m.length;){const A=g(m.slice(v),!1);if(!A||A.type!=="*")return;const O=y(A.body).map(T=>T.trim());if(O.length!==1)return;const _=h(O[0]);if(!_||_.length!==1)return;a.push(_),v+=A.end+1}if(!(a.length<1))return a},R=m=>{let v=0,a=m.trim(),A=g(a);for(;A;)v++,a=A.body.trim(),A=g(a);return v},C=(m,v)=>{if(v.maxExtglobRecursion===!1)return{risky:!1};const a=typeof v.maxExtglobRecursion=="number"?v.maxExtglobRecursion:t.DEFAULT_MAX_EXTGLOB_RECURSION,A=y(m).map(x=>x.trim());if(A.length>1&&(A.some(x=>x==="")||A.some(x=>/^[*?]+$/.test(x))||$(A)))return{risky:!0};const O=[];let _=!1,T=!0;for(const x of A){const B=E(x);if(B){_=!0,O.push(...B);continue}const U=h(x);if(U&&U.length===1){O.push(U);continue}if(T=!1,R(x)>a)return{risky:!0}}return _?T?{risky:!0,safeOutput:b([...new Set(O)])}:{risky:!0}:{risky:!1}},D=(m,v)=>{if(typeof m!="string")throw new TypeError("Expected a string");m=i[m]||m;const a={...v},A=typeof a.maxLength=="number"?Math.min(s,a.maxLength):s;let O=m.length;if(O>A)throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${A}`);const _={type:"bos",value:"",output:a.prepend||""},T=[_],x=a.capture?"":"?:",B=t.globChars(a.windows),U=t.extglobChars(B),{DOT_LITERAL:nt,PLUS_LITERAL:gt,SLASH_LITERAL:rt,ONE_CHAR:K,DOTS_SLASH:ot,NO_DOT:mt,NO_DOT_SLASH:ut,NO_DOTS_SLASH:it,QMARK:W,QMARK_NO_DOT:at,STAR:Z,START_ANCHOR:$t}=B,J=S=>`(${x}(?:(?!${$t}${S.dot?ot:nt}).)*?)`,k=a.dot?"":mt,M=a.dot?W:at;let Y=a.bash===!0?J(a):Z;a.capture&&(Y=`(${Y})`),typeof a.noext=="boolean"&&(a.noextglob=a.noext);const d={input:m,index:-1,start:0,dot:a.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:T};m=e.removePrefix(m,d),O=m.length;const q=[],G=[],bt=[];let p=_,f;const et=()=>d.index===O-1,I=d.peek=(S=1)=>m[d.index+S],ct=d.advance=()=>m[++d.index]||"",lt=()=>m.slice(d.index+1),st=(S="",z=0)=>{d.consumed+=S,d.index+=z},de=S=>{d.output+=S.output!=null?S.output:S.value,st(S.value)},bn=()=>{let S=1;for(;I()==="!"&&(I(2)!=="("||I(3)==="?");)ct(),d.start++,S++;return S%2===0?!1:(d.negated=!0,d.start++,!0)},ge=S=>{d[S]++,bt.push(S)},vt=S=>{d[S]--,bt.pop()},N=S=>{if(p.type==="globstar"){const z=d.braces>0&&(S.type==="comma"||S.type==="brace"),w=S.extglob===!0||q.length&&(S.type==="pipe"||S.type==="paren");S.type!=="slash"&&S.type!=="paren"&&!z&&!w&&(d.output=d.output.slice(0,-p.output.length),p.type="star",p.value="*",p.output=Y,d.output+=p.output)}if(q.length&&S.type!=="paren"&&(q[q.length-1].inner+=S.value),(S.value||S.output)&&de(S),p&&p.type==="text"&&S.type==="text"){p.output=(p.output||p.value)+S.value,p.value+=S.value;return}S.prev=p,T.push(S),p=S},ye=(S,z)=>{const w={...U[z],conditions:1,inner:""};w.prev=p,w.parens=d.parens,w.output=d.output,w.startIndex=d.index,w.tokensIndex=T.length;const L=(a.capture?"(":"")+w.open;ge("parens"),N({type:S,value:z,output:d.output?"":K}),N({type:"paren",extglob:!0,value:ct(),output:L}),q.push(w)},vn=S=>{const z=m.slice(S.startIndex,d.index+1),w=m.slice(S.startIndex+2,d.index),L=C(w,a);if((S.type==="plus"||S.type==="star")&&L.risky){const j=L.safeOutput?(S.output?"":K)+(a.capture?`(${L.safeOutput})`:L.safeOutput):void 0,pt=T[S.tokensIndex];pt.type="text",pt.value=z,pt.output=j||e.escapeRegex(z);for(let ft=S.tokensIndex+1;ft<T.length;ft++)T[ft].value="",T[ft].output="",delete T[ft].suffix;d.output=S.output+pt.output,d.backtrack=!0,N({type:"paren",extglob:!0,value:f,output:""}),vt("parens");return}let X=S.close+(a.capture?")":""),Q;if(S.type==="negate"){let j=Y;if(S.inner&&S.inner.length>1&&S.inner.includes("/")&&(j=J(a)),(j!==Y||et()||/^\)+$/.test(lt()))&&(X=S.close=`)$))${j}`),S.inner.includes("*")&&(Q=lt())&&/^\.[^\\/.]+$/.test(Q)){const pt=D(Q,{...v,fastpaths:!1}).output;X=S.close=`)${pt})${j})`}S.prev.type==="bos"&&(d.negatedExtglob=!0)}N({type:"paren",extglob:!0,value:f,output:X}),vt("parens")};if(a.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(m)){let S=!1,z=m.replace(r,(w,L,X,Q,j,pt)=>Q==="\\"?(S=!0,w):Q==="?"?L?L+Q+(j?W.repeat(j.length):""):pt===0?M+(j?W.repeat(j.length):""):W.repeat(X.length):Q==="."?nt.repeat(X.length):Q==="*"?L?L+Q+(j?Y:""):Y:L?w:`\\${w}`);return S===!0&&(a.unescape===!0?z=z.replace(/\\/g,""):z=z.replace(/\\+/g,w=>w.length%2===0?"\\\\":w?"\\":"")),z===m&&a.contains===!0?(d.output=m,d):(d.output=e.wrapOutput(z,d,v),d)}for(;!et();){if(f=ct(),f==="\0")continue;if(f==="\\"){const w=I();if(w==="/"&&a.bash!==!0||w==="."||w===";")continue;if(!w){f+="\\",N({type:"text",value:f});continue}const L=/^\\+/.exec(lt());let X=0;if(L&&L[0].length>2&&(X=L[0].length,d.index+=X,X%2!==0&&(f+="\\")),a.unescape===!0?f=ct():f+=ct(),d.brackets===0){N({type:"text",value:f});continue}}if(d.brackets>0&&(f!=="]"||p.value==="["||p.value==="[^")){if(a.posix!==!1&&f===":"){const w=p.value.slice(1);if(w.includes("[")&&(p.posix=!0,w.includes(":"))){const L=p.value.lastIndexOf("["),X=p.value.slice(0,L),Q=p.value.slice(L+2),j=n[Q];if(j){p.value=X+j,d.backtrack=!0,ct(),!_.output&&T.indexOf(p)===1&&(_.output=K);continue}}}(f==="["&&I()!==":"||f==="-"&&I()==="]")&&(f=`\\${f}`),f==="]"&&(p.value==="["||p.value==="[^")&&(f=`\\${f}`),a.posix===!0&&f==="!"&&p.value==="["&&(f="^"),p.value+=f,de({value:f});continue}if(d.quotes===1&&f!=='"'){f=e.escapeRegex(f),p.value+=f,de({value:f});continue}if(f==='"'){d.quotes=d.quotes===1?0:1,a.keepQuotes===!0&&N({type:"text",value:f});continue}if(f==="("){ge("parens"),N({type:"paren",value:f});continue}if(f===")"){if(d.parens===0&&a.strictBrackets===!0)throw new SyntaxError(u("opening","("));const w=q[q.length-1];if(w&&d.parens===w.parens+1){vn(q.pop());continue}N({type:"paren",value:f,output:d.parens?")":"\\)"}),vt("parens");continue}if(f==="["){if(a.nobracket===!0||!lt().includes("]")){if(a.nobracket!==!0&&a.strictBrackets===!0)throw new SyntaxError(u("closing","]"));f=`\\${f}`}else ge("brackets");N({type:"bracket",value:f});continue}if(f==="]"){if(a.nobracket===!0||p&&p.type==="bracket"&&p.value.length===1){N({type:"text",value:f,output:`\\${f}`});continue}if(d.brackets===0){if(a.strictBrackets===!0)throw new SyntaxError(u("opening","["));N({type:"text",value:f,output:`\\${f}`});continue}vt("brackets");const w=p.value.slice(1);if(p.posix!==!0&&w[0]==="^"&&!w.includes("/")&&(f=`/${f}`),p.value+=f,de({value:f}),a.literalBrackets===!1||e.hasRegexChars(w))continue;const L=e.escapeRegex(p.value);if(d.output=d.output.slice(0,-p.value.length),a.literalBrackets===!0){d.output+=L,p.value=L;continue}p.value=`(${x}${L}|${p.value})`,d.output+=p.value;continue}if(f==="{"&&a.nobrace!==!0){ge("braces");const w={type:"brace",value:f,output:"(",outputIndex:d.output.length,tokensIndex:d.tokens.length};G.push(w),N(w);continue}if(f==="}"){const w=G[G.length-1];if(a.nobrace===!0||!w){N({type:"text",value:f,output:f});continue}let L=")";if(w.dots===!0){const X=T.slice(),Q=[];for(let j=X.length-1;j>=0&&(T.pop(),X[j].type!=="brace");j--)X[j].type!=="dots"&&Q.unshift(X[j].value);L=c(Q,a),d.backtrack=!0}if(w.comma!==!0&&w.dots!==!0){const X=d.output.slice(0,w.outputIndex),Q=d.tokens.slice(w.tokensIndex);w.value=w.output="\\{",f=L="\\}",d.output=X;for(const j of Q)d.output+=j.output||j.value}N({type:"brace",value:f,output:L}),vt("braces"),G.pop();continue}if(f==="|"){q.length>0&&q[q.length-1].conditions++,N({type:"text",value:f});continue}if(f===","){let w=f;const L=G[G.length-1];L&&bt[bt.length-1]==="braces"&&(L.comma=!0,w="|"),N({type:"comma",value:f,output:w});continue}if(f==="/"){if(p.type==="dot"&&d.index===d.start+1){d.start=d.index+1,d.consumed="",d.output="",T.pop(),p=_;continue}N({type:"slash",value:f,output:rt});continue}if(f==="."){if(d.braces>0&&p.type==="dot"){p.value==="."&&(p.output=nt);const w=G[G.length-1];p.type="dots",p.output+=f,p.value+=f,w.dots=!0;continue}if(d.braces+d.parens===0&&p.type!=="bos"&&p.type!=="slash"){N({type:"text",value:f,output:nt});continue}N({type:"dot",value:f,output:nt});continue}if(f==="?"){if(!(p&&p.value==="(")&&a.noextglob!==!0&&I()==="("&&I(2)!=="?"){ye("qmark",f);continue}if(p&&p.type==="paren"){const w=I();let L=f;(p.value==="("&&!/[!=<:]/.test(w)||w==="<"&&!/<([!=]|\w+>)/.test(lt()))&&(L=`\\${f}`),N({type:"text",value:f,output:L});continue}if(a.dot!==!0&&(p.type==="slash"||p.type==="bos")){N({type:"qmark",value:f,output:at});continue}N({type:"qmark",value:f,output:W});continue}if(f==="!"){if(a.noextglob!==!0&&I()==="("&&(I(2)!=="?"||!/[!=<:]/.test(I(3)))){ye("negate",f);continue}if(a.nonegate!==!0&&d.index===0){bn();continue}}if(f==="+"){if(a.noextglob!==!0&&I()==="("&&I(2)!=="?"){ye("plus",f);continue}if(p&&p.value==="("||a.regex===!1){N({type:"plus",value:f,output:gt});continue}if(p&&(p.type==="bracket"||p.type==="paren"||p.type==="brace")||d.parens>0){N({type:"plus",value:f});continue}N({type:"plus",value:gt});continue}if(f==="@"){if(a.noextglob!==!0&&I()==="("&&I(2)!=="?"){N({type:"at",extglob:!0,value:f,output:""});continue}N({type:"text",value:f});continue}if(f!=="*"){(f==="$"||f==="^")&&(f=`\\${f}`);const w=o.exec(lt());w&&(f+=w[0],d.index+=w[0].length),N({type:"text",value:f});continue}if(p&&(p.type==="globstar"||p.star===!0)){p.type="star",p.star=!0,p.value+=f,p.output=Y,d.backtrack=!0,d.globstar=!0,st(f);continue}let S=lt();if(a.noextglob!==!0&&/^\([^?]/.test(S)){ye("star",f);continue}if(p.type==="star"){if(a.noglobstar===!0){st(f);continue}const w=p.prev,L=w.prev,X=w.type==="slash"||w.type==="bos",Q=L&&(L.type==="star"||L.type==="globstar");if(a.bash===!0&&(!X||S[0]&&S[0]!=="/")){N({type:"star",value:f,output:""});continue}const j=d.braces>0&&(w.type==="comma"||w.type==="brace"),pt=q.length&&(w.type==="pipe"||w.type==="paren");if(!X&&w.type!=="paren"&&!j&&!pt){N({type:"star",value:f,output:""});continue}for(;S.slice(0,3)==="/**";){const ft=m[d.index+4];if(ft&&ft!=="/")break;S=S.slice(3),st("/**",3)}if(w.type==="bos"&&et()){p.type="globstar",p.value+=f,p.output=J(a),d.output=p.output,d.globstar=!0,st(f);continue}if(w.type==="slash"&&w.prev.type!=="bos"&&!Q&&et()){d.output=d.output.slice(0,-(w.output+p.output).length),w.output=`(?:${w.output}`,p.type="globstar",p.output=J(a)+(a.strictSlashes?")":"|$)"),p.value+=f,d.globstar=!0,d.output+=w.output+p.output,st(f);continue}if(w.type==="slash"&&w.prev.type!=="bos"&&S[0]==="/"){const ft=S[1]!==void 0?"|$":"";d.output=d.output.slice(0,-(w.output+p.output).length),w.output=`(?:${w.output}`,p.type="globstar",p.output=`${J(a)}${rt}|${rt}${ft})`,p.value+=f,d.output+=w.output+p.output,d.globstar=!0,st(f+ct()),N({type:"slash",value:"/",output:""});continue}if(w.type==="bos"&&S[0]==="/"){p.type="globstar",p.value+=f,p.output=`(?:^|${rt}|${J(a)}${rt})`,d.output=p.output,d.globstar=!0,st(f+ct()),N({type:"slash",value:"/",output:""});continue}if(j&&S[0]==="/"){p.type="globstar",p.value+=f,p.output=`(?:^|${rt}|${J(a)}${rt})`,d.output+=p.output,d.globstar=!0,st(f+ct()),N({type:"slash",value:"/",output:""});continue}d.output=d.output.slice(0,-p.output.length),p.type="globstar",p.output=J(a),p.value+=f,d.output+=p.output,d.globstar=!0,st(f);continue}const z={type:"star",value:f,output:Y};if(a.bash===!0){z.output=".*?",(p.type==="bos"||p.type==="slash")&&(z.output=k+z.output),N(z);continue}if(p&&(p.type==="bracket"||p.type==="paren")&&a.regex===!0){z.output=f,N(z);continue}(d.index===d.start||p.type==="slash"||p.type==="dot")&&(p.type==="dot"?(d.output+=ut,p.output+=ut):a.dot===!0?(d.output+=it,p.output+=it):(d.output+=k,p.output+=k),I()!=="*"&&(d.output+=K,p.output+=K)),N(z)}for(;d.brackets>0;){if(a.strictBrackets===!0)throw new SyntaxError(u("closing","]"));d.output=e.escapeLast(d.output,"["),vt("brackets")}for(;d.parens>0;){if(a.strictBrackets===!0)throw new SyntaxError(u("closing",")"));d.output=e.escapeLast(d.output,"("),vt("parens")}for(;d.braces>0;){if(a.strictBrackets===!0)throw new SyntaxError(u("closing","}"));d.output=e.escapeLast(d.output,"{"),vt("braces")}if(a.strictSlashes!==!0&&(p.type==="star"||p.type==="bracket")&&N({type:"maybe_slash",value:"",output:`${rt}?`}),d.backtrack===!0){d.output="";for(const S of d.tokens)d.output+=S.output!=null?S.output:S.value,S.suffix&&(d.output+=S.suffix)}return d};return D.fastpaths=(m,v)=>{const a={...v},A=typeof a.maxLength=="number"?Math.min(s,a.maxLength):s,O=m.length;if(O>A)throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${A}`);m=i[m]||m;const{DOT_LITERAL:_,SLASH_LITERAL:T,ONE_CHAR:x,DOTS_SLASH:B,NO_DOT:U,NO_DOTS:nt,NO_DOTS_SLASH:gt,STAR:rt,START_ANCHOR:K}=t.globChars(a.windows),ot=a.dot?nt:U,mt=a.dot?gt:U,ut=a.capture?"":"?:",it={negated:!1,prefix:""};let W=a.bash===!0?".*?":rt;a.capture&&(W=`(${W})`);const at=k=>k.noglobstar===!0?W:`(${ut}(?:(?!${K}${k.dot?B:_}).)*?)`,Z=k=>{switch(k){case"*":return`${ot}${x}${W}`;case".*":return`${_}${x}${W}`;case"*.*":return`${ot}${W}${_}${x}${W}`;case"*/*":return`${ot}${W}${T}${x}${mt}${W}`;case"**":return ot+at(a);case"**/*":return`(?:${ot}${at(a)}${T})?${mt}${x}${W}`;case"**/*.*":return`(?:${ot}${at(a)}${T})?${mt}${W}${_}${x}${W}`;case"**/.*":return`(?:${ot}${at(a)}${T})?${_}${x}${W}`;default:{const M=/^(.*?)\.(\w+)$/.exec(k);if(!M)return;const Y=Z(M[1]);return Y?Y+_+M[2]:void 0}}},$t=e.removePrefix(m,it);let J=Z($t);return J&&a.strictSlashes!==!0&&(J+=`${T}?`),J},Le=D,Le}var De,as;function co(){if(as)return De;as=1;const t=oo(),e=io(),s=Ae(),n=Ee(),o=i=>i&&typeof i=="object"&&!Array.isArray(i),r=(i,c,u=!1)=>{if(Array.isArray(i)){const R=i.map(C=>r(C,c,u));return C=>{for(const D of R){const m=D(C);if(m)return m}return!1}}const y=o(i)&&i.tokens&&i.input;if(i===""||typeof i!="string"&&!y)throw new TypeError("Expected pattern to be a non-empty string");const l=c||{},h=l.windows,$=y?r.compileRe(i,c):r.makeRe(i,c,!1,!0),g=$.state;delete $.state;let b=()=>!1;if(l.ignore){const R={...c,ignore:null,onMatch:null,onResult:null};b=r(l.ignore,R,u)}const E=(R,C=!1)=>{const{isMatch:D,match:m,output:v}=r.test(R,$,c,{glob:i,posix:h}),a={glob:i,state:g,regex:$,posix:h,input:R,output:v,match:m,isMatch:D};if(typeof l.onResult=="function"&&l.onResult(a),D===!1)return a.isMatch=!1,C?a:!1;t:if(b(R)){if(typeof l.onIgnore=="function"&&l.onIgnore(a)===n.UNIGNORE){a.isMatch=!0;break t}return a.isMatch=!1,C?a:!1}return typeof l.onMatch=="function"&&l.onMatch(a),C?a:!0};return u&&(E.state=g),E};return r.test=(i,c,u,{glob:y,posix:l}={})=>{if(typeof i!="string")throw new TypeError("Expected input to be a string");if(i==="")return{isMatch:!1,output:""};const h=u||{},$=h.format||(l?s.toPosixSlashes:null);let g=i===y,b=g&&$?$(i):i;return g===!1&&(b=$?$(i):i,g=b===y),(g===!1||h.capture===!0)&&(h.matchBase===!0||h.basename===!0?g=r.matchBase(i,c,u,l):g=c.exec(b)),{isMatch:!!g,match:g,output:b}},r.matchBase=(i,c,u,y=u&&u.windows)=>(c instanceof RegExp?c:r.makeRe(c,u)).test(s.basename(i,{windows:y})),r.isMatch=(i,c,u)=>r(c,u)(i),r.parse=(i,c)=>Array.isArray(i)?i.map(u=>r.parse(u,c)):e(i,{...c,fastpaths:!1}),r.scan=(i,c)=>t(i,c),r.compileRe=(i,c,u=!1,y=!1)=>{if(u===!0)return i.output;const l=c||{},h=l.contains?"":"^",$=l.contains?"":"$";let g=`${h}(?:${i.output})${$}`;i&&i.negated===!0&&(g=`^(?!${g}).*$`);const b=r.toRegex(g,c);return y===!0&&(b.state=i),b},r.makeRe=(i,c={},u=!1,y=!1)=>{if(!i||typeof i!="string")throw new TypeError("Expected a non-empty string");let l={negated:!1,fastpaths:!0};return c.fastpaths!==!1&&(i[0]==="."||i[0]==="*")&&(l.output=e.fastpaths(i,c)),l.output||(l=e(i,c)),r.compileRe(l,c,u,y)},r.toRegex=(i,c)=>{try{const u=c||{};return new RegExp(i,u.flags||(u.nocase?"i":""))}catch(u){if(c&&c.debug===!0)throw u;return/$^/}},r.constants=n,De=r,De}var Fe,ls;function uo(){if(ls)return Fe;ls=1;const t=co(),e=Ae();function s(n,o,r=!1){return o&&(o.windows===null||o.windows===void 0)&&(o={...o,windows:e.isWindows()}),t(n,o,r)}return Object.assign(s,t),Fe=s,Fe}var ao=uo();const yt=Ke(ao);let lo;const po=t=>(lo??=H(import.meta.url))(t),Wt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,pe=t=>{if(typeof Wt<"u"&&Wt.versions&&Wt.versions.node){const[e,s]=Wt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Wt.getBuiltinModule(t)}return po(t)},ps=pe("fs"),fo={...ps,default:ps},{statSync:ho,stat:go,realpathSync:yo,realpath:mo,readdirSync:$o,readdir:bo}=pe("fs"),{sep:Gs,basename:vo,dirname:Ue,resolve:Us,normalize:wo,relative:So,posix:_t,isAbsolute:xo}=pe("path"),{fileURLToPath:Eo}=pe("url"),{createRequire:Ao}=pe("module");var fs=Ao(import.meta.url);function _o(t){let e=wo(t);return e.length>1&&e[e.length-1]===Gs&&(e=e.substring(0,e.length-1)),e}const To=/[\\/]/g;function qs(t,e){return t.replace(To,e)}const Ro=/^[a-z]:[\\/]$/i;function ko(t){return t==="/"||Ro.test(t)}function He(t,e){const{resolvePaths:s,normalizePath:n,pathSeparator:o}=e,r=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(s&&(t=Us(t)),(n||r)&&(t=_o(t)),t===".")return"";const i=t[t.length-1]!==o;return qs(i?t+o:t,o)}function zs(t,e){return e+t}function Co(t,e){return function(s,n){return n.startsWith(t)?n.slice(t.length)+s:qs(So(t,n),e.pathSeparator)+e.pathSeparator+s}}function Oo(t){return t}function No(t,e,s){return e+t+s}function Lo(t,e){const{relativePaths:s,includeBasePath:n}=e;return s&&t?Co(t,e):n?zs:Oo}function Do(t){return function(e,s){s.push(e.substring(t.length)||".")}}function Fo(t){return function(e,s,n){const o=e.substring(t.length)||".";n.every(r=>r(o,!0))&&s.push(o)}}const Ho=(t,e)=>{e.push(t||".")},Io=(t,e,s)=>{const n=t||".";s.every(o=>o(n,!0))&&e.push(n)},Bo=()=>{};function Mo(t,e){const{includeDirs:s,filters:n,relativePaths:o}=e;return s?o?n&&n.length?Fo(t):Do(t):n&&n.length?Io:Ho:Bo}const Po=(t,e,s,n)=>{n.every(o=>o(t,!1))&&s.files++},jo=(t,e,s,n)=>{n.every(o=>o(t,!1))&&e.push(t)},Go=(t,e,s,n)=>{s.files++},Uo=(t,e)=>{e.push(t)},qo=()=>{};function zo(t){const{excludeFiles:e,filters:s,onlyCounts:n}=t;return e?qo:s&&s.length?n?Po:jo:n?Go:Uo}const Wo=t=>t,Xo=()=>[""].slice(0,0);function Ko(t){return t.group?Xo:Wo}const Qo=(t,e,s)=>{t.push({directory:e,files:s,dir:e})},Vo=()=>{};function Yo(t){return t.group?Qo:Vo}const Zo=function(t,e,s){const{queue:n,fs:o,options:{suppressErrors:r}}=e;n.enqueue(),o.realpath(t,(i,c)=>{if(i)return n.dequeue(r?null:i,e);o.stat(c,(u,y)=>{if(u)return n.dequeue(r?null:u,e);if(y.isDirectory()&&Ws(t,c,e))return n.dequeue(null,e);s(y,c),n.dequeue(null,e)})})},Jo=function(t,e,s){const{queue:n,fs:o,options:{suppressErrors:r}}=e;n.enqueue();try{const i=o.realpathSync(t),c=o.statSync(i);if(c.isDirectory()&&Ws(t,i,e))return;s(c,i)}catch(i){if(!r)throw i}};function ti(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?Jo:Zo}function Ws(t,e,s){if(s.options.useRealPaths)return ei(e,s);let n=Ue(t),o=1;for(;n!==s.root&&o<2;){const r=s.symlinks.get(n);r&&(r===e||r.startsWith(e)||e.startsWith(r))?o++:n=Ue(n)}return s.symlinks.set(t,e),o>1}function ei(t,e){return e.visited.includes(t+e.options.pathSeparator)}const si=t=>t.counts,ni=t=>t.groups,ri=t=>t.paths,oi=t=>t.paths.slice(0,t.options.maxFiles),ii=(t,e,s)=>(_e(e,s,t.counts,t.options.suppressErrors),null),ci=(t,e,s)=>(_e(e,s,t.paths,t.options.suppressErrors),null),ui=(t,e,s)=>(_e(e,s,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),ai=(t,e,s)=>(_e(e,s,t.groups,t.options.suppressErrors),null);function _e(t,e,s,n){e(t&&!n?t:null,s)}function li(t,e){const{onlyCounts:s,group:n,maxFiles:o}=t;return s?e?si:ii:n?e?ni:ai:o?e?oi:ui:e?ri:ci}const Xs={withFileTypes:!0},pi=(t,e,s,n,o)=>{if(t.queue.enqueue(),n<0)return t.queue.dequeue(null,t);const{fs:r}=t;t.visited.push(e),t.counts.directories++,r.readdir(e||".",Xs,(i,c=[])=>{o(c,s,n),t.queue.dequeue(t.options.suppressErrors?null:i,t)})},fi=(t,e,s,n,o)=>{const{fs:r}=t;if(n<0)return;t.visited.push(e),t.counts.directories++;let i=[];try{i=r.readdirSync(e||".",Xs)}catch(c){if(!t.options.suppressErrors)throw c}o(i,s,n)};function hi(t){return t?fi:pi}var di=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},gi=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},yi=class{aborted=!1;abort(){this.aborted=!0}},Ks=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,s,n){this.isSynchronous=!n,this.callbackInvoker=li(s,this.isSynchronous),this.root=He(e,s),this.state={root:ko(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new gi,options:s,queue:new di((o,r)=>this.callbackInvoker(r,o,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new yi,fs:s.fs||fo},this.joinPath=Lo(this.root,s),this.pushDirectory=Mo(this.root,s),this.pushFile=zo(s),this.getArray=Ko(s),this.groupFiles=Yo(s),this.resolveSymlink=ti(s,this.isSynchronous),this.walkDirectory=hi(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(e,s,n)=>{const{paths:o,options:{filters:r,resolveSymlinks:i,excludeSymlinks:c,exclude:u,maxFiles:y,signal:l,useRealPaths:h,pathSeparator:$},controller:g}=this.state;if(g.aborted||l&&l.aborted||y&&o.length>y)return;const b=this.getArray(this.state.paths);for(let E=0;E<e.length;++E){const R=e[E];if(R.isFile()||R.isSymbolicLink()&&!i&&!c){const C=this.joinPath(R.name,s);this.pushFile(C,b,this.state.counts,r)}else if(R.isDirectory()){let C=No(R.name,s,this.state.options.pathSeparator);if(u&&u(R.name,C))continue;this.pushDirectory(C,o,r),this.walkDirectory(this.state,C,C,n-1,this.walk)}else if(this.resolveSymlink&&R.isSymbolicLink()){let C=zs(R.name,s);this.resolveSymlink(C,this.state,(D,m)=>{if(D.isDirectory()){if(m=He(m,this.state.options),u&&u(R.name,h?m:C+$))return;this.walkDirectory(this.state,m,h?m:C+$,n-1,this.walk)}else{m=h?m:C;const v=vo(m),a=He(Ue(m),this.state.options);m=this.joinPath(v,a),this.pushFile(m,b,this.state.counts,r)}})}}this.groupFiles(this.state.groups,s,b)}};function mi(t,e){return new Promise((s,n)=>{Qs(t,e,(o,r)=>{if(o)return n(o);s(r)})})}function Qs(t,e,s){new Ks(t,e,s).start()}function $i(t,e){return new Ks(t,e).start()}var hs=class{constructor(e,s){this.root=e,this.options=s}withPromise(){return mi(this.root,this.options)}withCallback(e){Qs(this.root,this.options,e)}sync(){return $i(this.root,this.options)}};let Vs=null;try{fs.resolve("picomatch"),Vs=fs("picomatch")}catch{}var bi=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:Gs,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new hs(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new hs(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){const s=this.globFunction||Vs;if(!s)throw new Error("Please specify a glob function to use glob matching.");var n=this.globCache[t.join("\0")];return n||(n=s(t,...e),this.globCache[t.join("\0")]=n),this.options.filters.push(o=>n(o)),this}};const vi=Array.isArray,Ys=/\\/g,wi=/^[A-Za-z]:$/,Zs=process.platform==="win32",Si=/^(\/?\.\.)+$/;function ds(t,e={}){const s=t.length,n=Array(s),o=Array(s);let r,i;for(r=0;r<s;r++){const c=Js(t[r]);n[r]=c;const u=c.length,y=Array(u);for(i=0;i<u;i++)y[i]=yt(c[i],e);o[r]=y}return c=>{const u=c.split("/");if(u[0]===".."&&Si.test(c))return!0;for(r=0;r<s;r++){const y=n[r],l=o[r],h=u.length,$=Math.min(h,y.length);for(i=0;i<$;){const g=y[i];if(g.includes("/"))return!0;if(!l[i](u[i]))break;if(!e.noglobstar&&g==="**")return!0;i++}if(i===h)return!0}return!1}}const xi=/^[A-Z]:\/$/i,Ei=Zs?t=>xi.test(t):t=>t==="/";function gs(t,e,s){if(t===e||e.startsWith(`${t}/`)){if(s){const o=t.length+ +!Ei(t);return(r,i)=>r.slice(o,i?-1:void 0)||"."}const n=e.slice(t.length+1);return n?(o,r)=>{if(o===".")return n;const i=`${n}/${o}`;return r?i.slice(0,-1):i}:(o,r)=>r&&o!=="."?o.slice(0,-1):o}return s?n=>_t.relative(t,n)||".":n=>_t.relative(t,`${e}/${n}`)||"."}function Ai(t,e){if(e.startsWith(`${t}/`)){const s=e.slice(t.length+1);return n=>`${s}/${n}`}return s=>{const n=_t.relative(t,`${e}/${s}`);return s[s.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function ys(t){return t.replace(wi,e=>`${e}/`)}const _i={parts:!0};function Js(t){var e;const s=yt.scan(t,_i);return!((e=s.parts)===null||e===void 0)&&e.length?s.parts:[t]}const Ti=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Ri=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,ki=t=>t.replace(Ti,"\\$&"),Ci=t=>t.replace(Ri,"\\$&"),Oi=Zs?Ci:ki;function Ni(t,e){const s=yt.scan(t);return s.isGlob||s.negated}function ue(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function tn(t){return typeof t=="string"?[t]:t??[]}const Li=/^(\/?\.\.)+/,Di=/\\(?=[()[\]{}!*+?@|])/g;function Ie(t,e,s,n){var o;const r=e.cwd;let i=t;t[t.length-1]==="/"&&(i=t.slice(0,-1));const c=i.lastIndexOf("/"),u=(c===-1?i:i.slice(c+1)).startsWith("!(");i[i.length-1]!=="*"&&!u&&e.expandDirectories&&(i+="/**");const y=Oi(r);i=xo(i.replace(Di,""))?_t.relative(y,i):_t.normalize(i);const l=(o=Li.exec(i))===null||o===void 0?void 0:o[0],h=Js(i);if(l){const g=(l.length+1)/3;let b=0;const E=y.split("/");for(;b<g&&h[b+g]===E[E.length+b-g];)i=i.slice(0,(g-b-1)*3)+i.slice((g-b)*3+h[b+g].length+1)||".",b++;const R=_t.join(r,l.slice(b*3));R[0]!=="."&&s.root.length>R.length&&(s.root=ys(R),s.depthOffset=-g+b)}if(!n&&s.depthOffset>=0){var $;($=s.commonPath)!==null&&$!==void 0||(s.commonPath=h);const g=[],b=Math.min(s.commonPath.length,h.length);for(let E=0;E<b;E++){const R=h[E];if(R==="**"&&!h[E+1]){g.pop();break}if(E===h.length-1||R!==s.commonPath[E]||Ni(R))break;g.push(R)}s.depthOffset=g.length,s.commonPath=g,s.root=ys(g.length>0?_t.join(r,...g):r)}return i}function Fi(t,e,s){const n=[],o=[],r=[];for(const i of t.ignore)i&&(i[0]!=="!"||i[1]==="("?o.push(Ie(i,t,s,!0)):r.push(i.slice(1)));for(const i of e)i&&(i[0]!=="!"||i[1]==="("?n.push(Ie(i,t,s,!1)):(i[1]!=="!"||i[2]==="(")&&o.push(Ie(i.slice(1),t,s,!0)));return{match:n,ignore:o,unignore:r}}function Hi(t,e){const s=t.cwd,n={root:s,depthOffset:0},o=Fi(t,e,n);t.debug&&ue("internal processing patterns:",o);const{absolute:r,caseSensitiveMatch:i,debug:c,dot:u,followSymbolicLinks:y,onlyDirectories:l}=t,h=n.root.replace(Ys,""),$={dot:u,nobrace:t.braceExpansion===!1,nocase:!i,noextglob:t.extglob===!1,noglobstar:t.globstar===!1,posix:!0},g=o.unignore.length>0,b=g?yt(o.unignore,$):void 0,E=g?ds(o.unignore,$):void 0,R=yt(o.match,{...$,ignore:o.ignore,onIgnore:b?T=>b(T.output)&&yt.constants.UNIGNORE:void 0}),C=yt(o.ignore,$),D=ds(o.match,$),m=gs(s,h,r),v=r?m:gs(s,h,!0),a=o.match.length>0&&o.match.every(T=>T==="**"||T==="**/*"),A=o.ignore.length>0||g||!a?(T,x)=>{const B=v(x,!0);return B==="."||E&&E(B)?!1:!D(B)||C(B)}:void 0;let O;t.deep!==void 0&&(O=Math.round(t.deep-n.depthOffset));const _=new bi({filters:[c?(T,x)=>{const B=m(T,x),U=R(B);return U&&ue(`matched ${B}`),U}:(T,x)=>{const B=m(T,x);return R(B)}],exclude:c&&A?(T,x)=>{const B=A(T,x);return ue(`${B?"skipped":"crawling"} ${x}`),B}:A,fs:t.fs,pathSeparator:"/",relativePaths:!r,resolvePaths:r,includeBasePath:r,resolveSymlinks:y,excludeSymlinks:!y,excludeFiles:l,includeDirs:l||!t.onlyFiles,maxDepth:O,signal:t.signal}).crawl(h);return t.debug&&ue("internal properties:",{...n,root:h}),[_,s!==h&&!r&&Ai(s,h)]}function en(t,e){if(e)for(let s=t.length-1;s>=0;s--)t[s]=e(t[s]);return t}const ms={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Ii(t){const e=Object.assign({},t);for(const s in ms)e[s]===void 0&&Object.assign(e,{[s]:ms[s]});return e.cwd=(e.cwd instanceof URL?Eo(e.cwd):Us(e.cwd||process.cwd())).replace(Ys,"/"),e.ignore=tn(e.ignore),e.fs&&(e.fs={readdir:e.fs.readdir||bo,readdirSync:e.fs.readdirSync||$o,realpath:e.fs.realpath||mo,realpathSync:e.fs.realpathSync||yo,stat:e.fs.stat||go,statSync:e.fs.statSync||ho}),e.debug&&ue("globbing with options:",e),e}function sn(t,e={}){var s;if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");const n=vi(t)||typeof t=="string",o=tn((s=n?t:t.patterns)!==null&&s!==void 0?s:"**/*"),r=Ii(n?e:t);return o.length>0?Hi(r,o):[]}async function Bi(t,e){const[s,n]=sn(t,e);return s?en(await s.withPromise(),n):[]}function Mi(t,e){const[s,n]=sn(t,e);return s?en(s.sync(),n):[]}const ja=async(t,e)=>await Bi(t,e),Ga=(t,e)=>Mi(t,e);var Be,$s;function Pi(){if($s)return Be;$s=1;/*!
|
|
4
4
|
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
7
7
|
* Licensed under the MIT License.
|
|
8
|
-
*/return
|
|
8
|
+
*/return Be=function(t){if(typeof t!="string"||t==="")return!1;for(var e;e=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(e[2])return!0;t=t.slice(e.index+e[0].length)}return!1},Be}var Me,bs;function nn(){if(bs)return Me;bs=1;/*!
|
|
9
9
|
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
10
10
|
*
|
|
11
11
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
12
12
|
* Released under the MIT License.
|
|
13
|
-
*/var t=Pi(),e={"{":"}","(":")","[":"]"},s=function(o){if(o[0]==="!")return!0;for(var r=0,i=-2,c=-2,u=-2,y=-2,l=-2;r<o.length;){if(o[r]==="*"||o[r+1]==="?"&&/[\].+)]/.test(o[r])||c!==-1&&o[r]==="["&&o[r+1]!=="]"&&(c<r&&(c=o.indexOf("]",r)),c>r&&(l===-1||l>c||(l=o.indexOf("\\",r),l===-1||l>c)))||u!==-1&&o[r]==="{"&&o[r+1]!=="}"&&(u=o.indexOf("}",r),u>r&&(l=o.indexOf("\\",r),l===-1||l>u))||y!==-1&&o[r]==="("&&o[r+1]==="?"&&/[:!=]/.test(o[r+2])&&o[r+3]!==")"&&(y=o.indexOf(")",r),y>r&&(l=o.indexOf("\\",r),l===-1||l>y))||i!==-1&&o[r]==="("&&o[r+1]!=="|"&&(i<r&&(i=o.indexOf("|",r)),i!==-1&&o[i+1]!==")"&&(y=o.indexOf(")",i),y>i&&(l=o.indexOf("\\",i),l===-1||l>y))))return!0;if(o[r]==="\\"){var h=o[r+1];r+=2;var $=e[h];if($){var g=o.indexOf($,r);g!==-1&&(r=g+1)}if(o[r]==="!")return!0}else r++}return!1},n=function(o){if(o[0]==="!")return!0;for(var r=0;r<o.length;){if(/[*?{}()[\]]/.test(o[r]))return!0;if(o[r]==="\\"){var i=o[r+1];r+=2;var c=e[i];if(c){var u=o.indexOf(c,r);u!==-1&&(r=u+1)}if(o[r]==="!")return!0}else r++}return!1};return
|
|
13
|
+
*/var t=Pi(),e={"{":"}","(":")","[":"]"},s=function(o){if(o[0]==="!")return!0;for(var r=0,i=-2,c=-2,u=-2,y=-2,l=-2;r<o.length;){if(o[r]==="*"||o[r+1]==="?"&&/[\].+)]/.test(o[r])||c!==-1&&o[r]==="["&&o[r+1]!=="]"&&(c<r&&(c=o.indexOf("]",r)),c>r&&(l===-1||l>c||(l=o.indexOf("\\",r),l===-1||l>c)))||u!==-1&&o[r]==="{"&&o[r+1]!=="}"&&(u=o.indexOf("}",r),u>r&&(l=o.indexOf("\\",r),l===-1||l>u))||y!==-1&&o[r]==="("&&o[r+1]==="?"&&/[:!=]/.test(o[r+2])&&o[r+3]!==")"&&(y=o.indexOf(")",r),y>r&&(l=o.indexOf("\\",r),l===-1||l>y))||i!==-1&&o[r]==="("&&o[r+1]!=="|"&&(i<r&&(i=o.indexOf("|",r)),i!==-1&&o[i+1]!==")"&&(y=o.indexOf(")",i),y>i&&(l=o.indexOf("\\",i),l===-1||l>y))))return!0;if(o[r]==="\\"){var h=o[r+1];r+=2;var $=e[h];if($){var g=o.indexOf($,r);g!==-1&&(r=g+1)}if(o[r]==="!")return!0}else r++}return!1},n=function(o){if(o[0]==="!")return!0;for(var r=0;r<o.length;){if(/[*?{}()[\]]/.test(o[r]))return!0;if(o[r]==="\\"){var i=o[r+1];r+=2;var c=e[i];if(c){var u=o.indexOf(c,r);u!==-1&&(r=u+1)}if(o[r]==="!")return!0}else r++}return!1};return Me=function(o,r){if(typeof o!="string"||o==="")return!1;if(t(o))return!0;var i=s;return r&&r.strict===!1&&(i=n),i(o)},Me}let ji;const Gi=t=>(ji??=H(import.meta.url))(t),Xt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,rn=t=>{if(typeof Xt<"u"&&Xt.versions&&Xt.versions.node){const[e,s]=Xt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Xt.getBuiltinModule(t)}return Gi(t)},Ui=rn("path"),qi=rn("os");var Pe,vs;function zi(){if(vs)return Pe;vs=1;var t=nn(),e=Ui.posix.dirname,s=qi.platform()==="win32",n="/",o=/\\/g,r=/\\([!*?|[\](){}])/g;Pe=function(u,y){var l=Object.assign({flipBackslashes:!0},y);l.flipBackslashes&&s&&u.indexOf(n)<0&&(u=u.replace(o,n)),i(u)&&(u+=n),u+="a";do u=e(u);while(c(u));return u.replace(r,"$1")};function i(u){var y=u.slice(-1),l;switch(y){case"}":l="{";break;case"]":l="[";break;default:return!1}var h=u.indexOf(l);return h<0?!1:u.slice(h+1,-1).includes(n)}function c(u){return/\([^()]+$/.test(u)||u[0]==="{"||u[0]==="["||/[^\\][{[]/.test(u)?!0:t(u)}return Pe}var Wi=zi();const Xi=Ke(Wi),Ua=(t,e)=>Xi(t,e);let Ki;const Qi=t=>(Ki??=H(import.meta.url))(t),Kt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Vi=t=>{if(typeof Kt<"u"&&Kt.versions&&Kt.versions.node){const[e,s]=Kt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Kt.getBuiltinModule(t)}return Qi(t)},{access:Yi}=Vi("node:fs/promises");async function be(t,e=we){P(t),t=F(t);try{return await Yi(t,e),!0}catch{return!1}}let Zi;const Ji=t=>(Zi??=H(import.meta.url))(t),Qt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,tc=t=>{if(typeof Qt<"u"&&Qt.versions&&Qt.versions.node){const[e,s]=Qt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Qt.getBuiltinModule(t)}return Ji(t)},{accessSync:ec}=tc("node:fs");function ve(t,e=we){P(t),t=F(t);try{return ec(t,e),!0}catch{return!1}}var sc=nn();const nc=Ke(sc),qa=(t,e)=>nc(t,e),za=(t,e,s)=>{const n=yt(e,s);return Array.isArray(t)?t.some(o=>n(o)):n(t)},Wa=(t,e)=>{const s=yt(t,e);return n=>s(n)};let rc;const oc=t=>(rc??=H(import.meta.url))(t),Rt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,on=t=>{if(typeof Rt<"u"&&Rt.versions&&Rt.versions.node){const[e,s]=Rt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Rt.getBuiltinModule(t)}return oc(t)},{cwd:Te}=Rt,{mkdir:ic,rename:cc,copyFile:uc,unlink:ac}=on("node:fs/promises"),{mkdirSync:lc,renameSync:pc,copyFileSync:fc,unlinkSync:hc}=on("node:fs");let dc=class extends Error{constructor(e,s){super(`Source directory "${V(e)}" does not match destination directory "${V(s)}"`),this.name="SameDirectoryError"}};const cn=(t,e)=>{if(!t||!e)throw new Error("Source and destination paths must not be empty");if(V(t)!==V(e))throw new dc(t,e)},un=async(t,e,{cwd:s,directoryMode:n,overwrite:o,validateDirectory:r})=>{if(s&&(t=tt(s,t),e=tt(s,e)),r&&cn(t,e),!o&&await be(e))throw new Error(`The destination file exists: ${e}`);await ic(V(e),{mode:n,recursive:!0});try{await cc(t,e)}catch(i){if(i.code==="EXDEV")await uc(t,e),await ac(t);else throw i}},an=(t,e,{cwd:s,directoryMode:n,overwrite:o,validateDirectory:r})=>{if(s&&(t=tt(s,t),e=tt(s,e)),r&&cn(t,e),!o&&ve(e))throw new Error(`The destination file exists: ${e}`);lc(V(e),{mode:n,recursive:!0});try{pc(t,e)}catch(i){if(i.code==="EXDEV")fc(t,e),hc(t);else throw i}},Ka=async(t,e,s={})=>{const n={overwrite:!0,validateDirectory:!1,...s,cwd:s.cwd?F(s.cwd):Te()};await un(t,e,n)},Qa=(t,e,s)=>{const n={overwrite:!0,validateDirectory:!1,...s};n.cwd=n.cwd?F(n.cwd):Te(),an(t,e,n)},Va=async(t,e,s)=>{const n={overwrite:!0,...s,validateDirectory:!0};n.cwd=n.cwd?F(n.cwd):Te(),await un(t,e,n)},Ya=(t,e,s)=>{const n={overwrite:!0,...s,validateDirectory:!0};n.cwd=n.cwd?F(n.cwd):Te(),an(t,e,n)};let gc=class extends Error{constructor(e){super(`ENOENT: ${e}`)}get code(){return"ENOENT"}set code(e){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(e){throw new Error("Cannot overwrite name of NotFoundError")}},yc=class extends Error{constructor(e){super(`EPERM: Operation not permitted, ${e}`)}get code(){return"EPERM"}set code(e){throw new Error("Cannot overwrite code EPERM")}get name(){return"PermissionError"}set name(e){throw new Error("Cannot overwrite name of PermissionError")}};const ln=(t,e)=>{const s=t?.code;return s==="ENOENT"?new gc(`no such file or directory, open '${e}'`):s==="EACCES"||s==="EPERM"?new yc(`unable to read the non-readable file: ${e}`):t};let mc;const $c=t=>(mc??=H(import.meta.url))(t),Vt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,pn=t=>{if(typeof Vt<"u"&&Vt.versions&&Vt.versions.node){const[e,s]=Vt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Vt.getBuiltinModule(t)}return $c(t)},{readFile:bc}=pn("node:fs/promises"),{unzip:vc,brotliDecompress:wc}=pn("node:zlib"),Sc={brotli:wc,gzip:vc,none:(t,e)=>{e(null,t)}},xc=async(t,e)=>{P(t),t=F(t);const{buffer:s,compression:n,encoding:o,flag:r}=e??{};let i;try{i=await bc(t,r?{flag:r}:{})}catch(c){throw ln(c,t)}return await new Promise((c,u)=>{Sc[n??"none"](i,(y,l)=>{y?u(y):c(s?l:l.toString(o??"utf8"))})})};let Ec;const Ac=t=>(Ec??=H(import.meta.url))(t),Yt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,fn=t=>{if(typeof Yt<"u"&&Yt.versions&&Yt.versions.node){const[e,s]=Yt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Yt.getBuiltinModule(t)}return Ac(t)},{readFileSync:_c}=fn("node:fs"),{unzipSync:Tc,brotliDecompressSync:Rc}=fn("node:zlib"),kc={brotli:Rc,gzip:Tc,none:t=>t},Cc=(t,e)=>{P(t),t=F(t);const{buffer:s,compression:n,encoding:o,flag:r}=e??{};let i;try{i=_c(t,r?{flag:r}:{})}catch(y){throw ln(y,t)}const c=kc[n??"none"],u=c(i);return s?u:u.toString(o??"utf8")},Oc=globalThis.process??Object.create(null),ws={versions:{}},Ss=new Proxy(Oc,{get(t,e){if(e in t)return t[e];if(e in ws)return ws[e]}}),Nc=t=>t.replaceAll(/\r\n|\r(?!\n)|\n/gu,`
|
|
14
14
|
`),Lc=(t,e,s,n)=>{const o={column:0,line:-1,...t.start},r={...o,...t.end},i=o.line,c=o.column,u=r.line,y=r.column;let l=Math.max(i-(s+1),0),h=Math.min(e.length,u+n);i===-1&&(l=0),u===-1&&(h=e.length);const $=u-i,g={};if($)for(let b=0;b<=$;b++){const E=b+i;if(!c)g[E]=!0;else if(b===0){const R=e[E-1]?.length;g[E]=[c,(R??0)-c+1]}else if(b===$)g[E]=[0,y];else{const R=e[E-b]?.length;g[E]=[0,R]}}else c===y?g[i]=c?[c,0]:!0:g[i]=[c,(y??0)-(c??0)];return{end:h,markerLines:g,start:l}},Dc=Ss.platform==="win32"&&!Ss.env?.WT_SESSION?">":"❯",Fc=(t,e,s)=>{const n={linesAbove:2,linesBelow:3,prefix:"",showGutter:!0,tabWidth:4,...s,color:{gutter:b=>b,marker:b=>b,message:b=>b,...s?.color}},o=typeof e.start.column=="number";let r=(t.includes("\r")?Nc(t):t).split(`
|
|
15
15
|
`);typeof n.tabWidth=="number"&&t.includes(" ")&&(r=r.map(b=>b.replaceAll(" "," ".repeat(n.tabWidth))));const{end:i,markerLines:c,start:u}=Lc(e,r,n.linesAbove,n.linesBelow),y=String(i).length,{gutter:l,marker:h,message:$}=n.color;let g=r.slice(u,i).map((b,E)=>{const R=u+1+E,C=c[R],D=String(R).padStart(y),m=!c[R+1],v=` ${D}${n.showGutter?" |":""}`;if(C){let a="";if(Array.isArray(C)){const A=b.replaceAll(/[^\t]/g," ").slice(0,Math.max(C[0]-1,0)),O=C[1]||1;a=[`
|
|
16
16
|
`,n.prefix+l(v.replaceAll(/\d/g," "))," ",A,h("^").repeat(O)].join(""),m&&n.message&&(a+=` ${$(n.message)}`)}return[n.prefix+h(Dc),l(v),b.length>0?` ${b}`:"",a].join("")}return`${n.prefix} ${l(v)}${b.length>0?` ${b}`:""}`}).join(`
|
|
@@ -18,10 +18,10 @@ import{createRequire as wn}from"node:module";let Sn;const xn=t=>(Sn??=wn(import.
|
|
|
18
18
|
${g}`),g},xs=(t,e)=>{let s=0,n=e.length-2;for(;s<n;){const o=s+(n-s>>1);if(t<e[o])n=o-1;else if(t>=e[o+1])s=o+1;else{s=o;break}}return s},Hc=/\n|\r(?!\n)/,Ic=t=>t.split(Hc).reduce((e,s)=>(e.push(e.at(-1)+s.length+1),e),[0]),Bc=(t,e,s)=>{if(!Array.isArray(t)&&typeof t!="string"||(typeof t=="string"||Array.isArray(t))&&t.length===0)return{column:0,line:0};if(typeof e!="number"||typeof t=="string"&&e>=t.length||Array.isArray(t)&&e+1>=t.at(-1))return{column:0,line:0};if(typeof t=="string"){const o=Ic(t),r=xs(e,o);return{column:e-o[r]+1,line:r+1}}const n=xs(e,t);return{column:e-t[n]+1,line:n+1}};class Mc extends Error{fileName;codeFrame;name="JSONError";#t;constructor(e){super(),this.#t=e}get message(){return`${this.#t}${this.fileName?` in ${this.fileName}`:""}${this.codeFrame?`
|
|
19
19
|
|
|
20
20
|
${this.codeFrame}
|
|
21
|
-
`:""}`}set message(e){this.#t=e}}const Pc=t=>String.raw`\u{${t.codePointAt(0).toString(16)}}`,jc=(t,e,s)=>Fc(t,{start:e},{tabWidth:!1,...s}),Gc=/in JSON at position (\d+)(?: \(line (\d+) column (\d+)\))?$/,Uc=(t,e)=>{const s=Gc.exec(e);if(!s)return;const[,n,o,r]=s;if(o&&r)return{column:Number(r),line:Number(o)};let i=Number(n);return i===t.length&&(i=t.length-1),Bc(t,i)},qc=/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,zc=t=>t.replace(qc,(e,s,n)=>`"${n}"(${Pc(n)})`);function hn(t,e,s,n){typeof e=="string"&&(typeof s=="object"&&(n=s),s=e,e=void 0);let o;try{return JSON.parse(t,e)}catch(c){o=c.message}let r;t?(r=Uc(t,o),o=zc(o)):o+=" while parsing empty string";const i=new Mc(o);throw i.fileName=s,r&&(i.codeFrame=jc(t,r,n)),i}async function tl(t,e,s){typeof e=="object"&&(s=e,e=void 0);const n=await xc(t,{buffer:!0,encoding:void 0});let o=new TextDecoder().decode(n);const{beforeParse:r,color:i}=s??{};return typeof r=="function"&&(o=r(o)),hn(o,e,F(t),{color:i})}function el(t,e,s){typeof e=="object"&&(s=e,e=void 0);const n=Cc(t,{buffer:!0,encoding:void 0});let o=new TextDecoder().decode(n);const{beforeParse:r,color:i}=s??{};return typeof r=="function"&&(o=r(o)),hn(o,e,F(t),{color:i})}const ke=t=>{const e={force:!0,recursive:!0};return t?.maxRetries!==void 0&&(e.maxRetries=t.maxRetries),t?.retryDelay!==void 0&&(e.retryDelay=t.retryDelay),e};let Wc;const Xc=t=>(Wc??=H(import.meta.url))(t),Zt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,dn=t=>{if(typeof Zt<"u"&&Zt.versions&&Zt.versions.node){const[e,s]=Zt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Zt.getBuiltinModule(t)}return Xc(t)},{existsSync:Kc}=dn("node:fs"),{mkdir:Qc,readdir:Vc,rm:Yc}=dn("node:fs/promises"),sl=async(t,e)=>{if(P(t),!Kc(t)){await Qc(t,{recursive:!0});return}const s=await Vc(t),n=ke(e);for(const o of s)await Yc(Ee(F(t),o),n)};let Zc;const Jc=t=>(Zc??=H(import.meta.url))(t),Jt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,tu=t=>{if(typeof Jt<"u"&&Jt.versions&&Jt.versions.node){const[e,s]=Jt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Jt.getBuiltinModule(t)}return Jc(t)},{existsSync:eu,mkdirSync:su,readdirSync:nu,rmSync:ru}=tu("node:fs"),nl=(t,e)=>{if(P(t),!eu(t)){su(t,{recursive:!0});return}const s=ke(e);for(const n of nu(t))ru(Ee(F(t),n),s)};let ou;const iu=t=>(ou??=H(import.meta.url))(t),te=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,cu=t=>{if(typeof te<"u"&&te.versions&&te.versions.node){const[e,s]=te.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return te.getBuiltinModule(t)}return iu(t)},{rm:uu}=cu("node:fs/promises"),rl=async(t,e={})=>{P(t),await uu(t,ke(e))};let au;const lu=t=>(au??=H(import.meta.url))(t),ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,pu=t=>{if(typeof ee<"u"&&ee.versions&&ee.versions.node){const[e,s]=ee.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return ee.getBuiltinModule(t)}return lu(t)},{rmSync:fu}=pu("node:fs"),ol=(t,e={})=>{P(t),fu(t,ke(e))},hu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{platform:du}=hu,At="unnamed",gu=128,Es={'"':"ˮ","*":"⁎","/":"⁄",":":"꞉","<":"‹",">":"›","?":"ʔ","\\":"∖","|":"ǀ"},yu=/[\u0000-\u001F\u0080-\u009F]/g,mu=/^(?:\.+[/\\]+)+|^\.+$/g,ze=/^(?:con|prn|aux|nul|com\d|lpt\d)$/i,$u=/[<>:"/\\|?*]/g,bu=/\//g,le=new Set([" "," ","."]),he=(t,e)=>e>0&&e<t.length-1,vu=(t,e)=>{const s=t.lastIndexOf(".");if(!he(t,s))return t.slice(0,e);const n=t.slice(0,s),o=t.slice(s),r=e-o.length;return r>0?`${n.slice(0,r)}${o}`:t.slice(0,e)},As=t=>{let e=0,s=t.length;for(;e<s;){const n=t[e];if(n===void 0||!le.has(n))break;e+=1}for(;s>e;){const n=t[s-1];if(n===void 0||!le.has(n))break;s-=1}return t.slice(e,s)},wu=t=>{const e=t.lastIndexOf(".");if(he(t,e)){const n=t.slice(0,e),o=t.slice(e);let r=n;for(;r.length>0;){const i=r.at(-1);if(i===void 0||!le.has(i))break;r=r.slice(0,-1)}return r.length===0?o.slice(1):`${r}${o}`}let s=t;for(;s.length>0;){const n=s.at(-1);if(n===void 0||!le.has(n))break;s=s.slice(0,-1)}return s},Su=t=>{const e=t.lastIndexOf(".");if(he(t,e))return!1;if(ze.test(t))return!0;let s=t;for(;s.length>0;){const n=s.at(-1);if(n===void 0||!le.has(n))break;s=s.slice(0,-1)}return!!(s.length>0&&ze.test(s))},xu=t=>{const e=t.lastIndexOf(".");if(he(t,e)){const o=t.slice(0,e),r=t.slice(e),i=As(o);return i.length===0?void 0:`${i}${r}`}const s=t.trim();if(s.length>0&&s[0]==="."&&s.length<=5&&s.indexOf(".",1)===-1)return;const n=As(t);if(n.length!==0)return n},Eu=t=>{const e=t?.filesystem??"auto";return e==="auto"?du==="win32"?"win32":"unix":e==="darwin"?"unix":e},il=(t,e)=>{if(typeof t!="string"||t.length===0)return At;const s=Eu(e);let n=t;if(n=n.replace(yu,""),n.length===0||(n=n.replace(mu,""),n.length===0))return At;if(s==="win32"||s==="fat32"){const r=n.lastIndexOf(".");if(!he(n,r)&&ze.test(n))return At}if(n=s==="win32"||s==="fat32"?n.replaceAll($u,r=>Es[r]??""):n.replaceAll(bu,Es["/"]),n=n.trim(),(s==="win32"||s==="fat32")&&(Su(n)||s==="win32"&&(n=wu(n),n.length===0)))return At;if(s==="fat32"){const r=xu(n);if(r===void 0)return At;n=r}if(n.length===0)return At;const o=e?.maxLength??gu;return n.length>o&&(n=vu(n,o),n.length===0)?At:n},gn=t=>{if(typeof t!="string"&&!(t instanceof ArrayBuffer)&&!ArrayBuffer.isView(t))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")};let Au;const _u=t=>(Au??=H(import.meta.url))(t),se=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Tu=t=>{if(typeof se<"u"&&se.versions&&se.versions.node){const[e,s]=se.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return se.getBuiltinModule(t)}return _u(t)},{randomBytes:Ru}=Tu("node:crypto"),yn=t=>`${t}.${process.pid.toString(36)}.${Ru(6).toString("hex")}.tmp`,ku=new TextEncoder,mn=t=>{if(t instanceof Uint8Array)return t;if(typeof t=="string")return ku.encode(t);if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t)){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new Uint8Array(e)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")};let Cu;const Ou=t=>(Cu??=H(import.meta.url))(t),ne=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Nu=t=>{if(typeof ne<"u"&&ne.versions&&ne.versions.node){const[e,s]=ne.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return ne.getBuiltinModule(t)}return Ou(t)},{mkdir:Lu,readFile:Du,writeFile:Fu,stat:Hu,rename:_s,chown:Iu,chmod:Bu,unlink:Mu}=Nu("node:fs/promises"),Pu=async(t,e,s)=>{s={backup:!1,encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...s},P(t),gn(e),t=F(t);const n=await we(t,xe),o=s.flag??"w",r=o.includes("a"),i=o.includes("x");if(n&&(!s.overwrite||i))throw new xt(`file already exists, open '${t}'`);const c=yn(t);try{!n&&s.recursive&&await Lu(V(t),{recursive:!0});let u,y=typeof e=="string"?Buffer.from(e,s.encoding??"utf8"):mn(e);if(r&&n&&(y=Buffer.concat([await Du(t),y])),await Fu(c,y,{flag:"wx"}),n&&s.backup&&(u=await Hu(t),s.chown??={gid:u.gid,uid:u.uid},await _s(t,`${t}.bak`)),s.chown)try{await Iu(c,s.chown.uid,s.chown.gid)}catch{}const l=u&&s.mode===void 0?u.mode:s.mode;l!==void 0&&await Bu(c,l),await _s(c,t)}catch(u){throw new Error(`Failed to write file at: ${t} - ${u.message}`,{cause:u})}finally{await we(c)&&await Mu(c)}};let ju;const Gu=t=>(ju??=H(import.meta.url))(t),re=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Uu=t=>{if(typeof re<"u"&&re.versions&&re.versions.node){const[e,s]=re.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return re.getBuiltinModule(t)}return Gu(t)},{mkdirSync:qu,readFileSync:zu,writeFileSync:Wu,statSync:Xu,renameSync:Ts,chownSync:Ku,chmodSync:Qu,unlinkSync:Vu}=Uu("node:fs"),Yu=(t,e,s)=>{s={backup:!1,encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...s},P(t),gn(e),t=F(t);const n=Se(t,xe),o=s.flag??"w",r=o.includes("a"),i=o.includes("x");if(n&&(!s.overwrite||i))throw new xt(`file already exists, open '${t}'`);const c=yn(t);try{!n&&s.recursive&&qu(V(t),{recursive:!0});let u,y=typeof e=="string"?Buffer.from(e,s.encoding??"utf8"):mn(e);if(r&&n&&(y=Buffer.concat([zu(t),y])),Wu(c,y,{flag:"wx"}),n&&s.backup&&(u=Xu(t),s.chown??={gid:u.gid,uid:u.uid},Ts(t,`${t}.bak`)),s.chown)try{Ku(c,s.chown.uid,s.chown.gid)}catch{}const l=u&&s.mode===void 0?u.mode:s.mode;l!==void 0&&Qu(c,l),Ts(c,t)}catch(u){throw new Error(`Failed to write file at: ${t} - ${u.message}`,{cause:u})}finally{Se(c)&&Vu(c)}},Zu=/^(?:( )+|\t+)/,de="space";function Rs(t,e,s){return t&&e===de&&s===1}function ks(t,e){const s=new Map;let n=0,o,r;for(const i of t.split(/\n/g)){if(!i)continue;const c=i.match(Zu);if(c===null)n=0,o="";else{const u=c[0].length,y=c[1]?de:"tab";if(Rs(e,y,u))continue;y!==o&&(n=0),o=y;let l=1,h=0;const $=u-n;if(n=u,$===0)l=0,h=1;else{const b=Math.abs($);if(Rs(e,y,b))continue;r=Ju(y,b)}const g=s.get(r);s.set(r,g===void 0?[1,0]:[g[0]+l,g[1]+h])}}return s}function Ju(t,e){return(t===de?"s":"t")+String(e)}function ta(t){const e=t[0]==="s"?de:"tab",s=Number(t.slice(1));return{type:e,amount:s}}function ea(t){let e,s=0,n=0;for(const[o,[r,i]]of t)(r>s||r===s&&i>n)&&(s=r,n=i,e=o);return e}function sa(t,e){return(t===de?" ":" ").repeat(e)}function $n(t){if(typeof t!="string")throw new TypeError("Expected a string");let e=ks(t,!0);e.size===0&&(e=ks(t,!1));const s=ea(e);let n,o=0,r="";return s!==void 0&&({type:n,amount:o}=ta(s),r=sa(n,o)),{amount:o,type:n,indent:r}}let na;const ra=t=>(na??=H(import.meta.url))(t),oe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,oa=t=>{if(typeof oe<"u"&&oe.versions&&oe.versions.node){const[e,s]=oe.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return oe.getBuiltinModule(t)}return ra(t)},{readFile:ia}=oa("node:fs/promises"),cl=async(t,e,s={})=>{const{detectIndent:n,indent:o,replacer:r,stringify:i=JSON.stringify,...c}={indent:" ",...s};let u=o,y=`
|
|
22
|
-
`;if(await
|
|
21
|
+
`:""}`}set message(e){this.#t=e}}const Pc=t=>String.raw`\u{${t.codePointAt(0).toString(16)}}`,jc=(t,e,s)=>Fc(t,{start:e},{tabWidth:!1,...s}),Gc=/in JSON at position (\d+)(?: \(line (\d+) column (\d+)\))?$/,Uc=(t,e)=>{const s=Gc.exec(e);if(!s)return;const[,n,o,r]=s;if(o&&r)return{column:Number(r),line:Number(o)};let i=Number(n);return i===t.length&&(i=t.length-1),Bc(t,i)},qc=/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,zc=t=>t.replace(qc,(e,s,n)=>`"${n}"(${Pc(n)})`);function hn(t,e,s,n){typeof e=="string"&&(typeof s=="object"&&(n=s),s=e,e=void 0);let o;try{return JSON.parse(t,e)}catch(c){o=c.message}let r;t?(r=Uc(t,o),o=zc(o)):o+=" while parsing empty string";const i=new Mc(o);throw i.fileName=s,r&&(i.codeFrame=jc(t,r,n)),i}async function tl(t,e,s){typeof e=="object"&&(s=e,e=void 0);const n=await xc(t,{buffer:!0,encoding:void 0});let o=new TextDecoder().decode(n);const{beforeParse:r,color:i}=s??{};return typeof r=="function"&&(o=r(o)),hn(o,e,F(t),{color:i})}function el(t,e,s){typeof e=="object"&&(s=e,e=void 0);const n=Cc(t,{buffer:!0,encoding:void 0});let o=new TextDecoder().decode(n);const{beforeParse:r,color:i}=s??{};return typeof r=="function"&&(o=r(o)),hn(o,e,F(t),{color:i})}const Re=t=>{const e={force:!0,recursive:!0};return t?.maxRetries!==void 0&&(e.maxRetries=t.maxRetries),t?.retryDelay!==void 0&&(e.retryDelay=t.retryDelay),e};let Wc;const Xc=t=>(Wc??=H(import.meta.url))(t),Zt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,dn=t=>{if(typeof Zt<"u"&&Zt.versions&&Zt.versions.node){const[e,s]=Zt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Zt.getBuiltinModule(t)}return Xc(t)},{existsSync:Kc}=dn("node:fs"),{mkdir:Qc,readdir:Vc,rm:Yc}=dn("node:fs/promises"),sl=async(t,e)=>{if(P(t),!Kc(t)){await Qc(t,{recursive:!0});return}const s=await Vc(t),n=Re(e);for(const o of s)await Yc(Se(F(t),o),n)};let Zc;const Jc=t=>(Zc??=H(import.meta.url))(t),Jt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,tu=t=>{if(typeof Jt<"u"&&Jt.versions&&Jt.versions.node){const[e,s]=Jt.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return Jt.getBuiltinModule(t)}return Jc(t)},{existsSync:eu,mkdirSync:su,readdirSync:nu,rmSync:ru}=tu("node:fs"),nl=(t,e)=>{if(P(t),!eu(t)){su(t,{recursive:!0});return}const s=Re(e);for(const n of nu(t))ru(Se(F(t),n),s)};let ou;const iu=t=>(ou??=H(import.meta.url))(t),te=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,cu=t=>{if(typeof te<"u"&&te.versions&&te.versions.node){const[e,s]=te.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return te.getBuiltinModule(t)}return iu(t)},{rm:uu}=cu("node:fs/promises"),rl=async(t,e={})=>{P(t),await uu(t,Re(e))};let au;const lu=t=>(au??=H(import.meta.url))(t),ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,pu=t=>{if(typeof ee<"u"&&ee.versions&&ee.versions.node){const[e,s]=ee.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return ee.getBuiltinModule(t)}return lu(t)},{rmSync:fu}=pu("node:fs"),ol=(t,e={})=>{P(t),fu(t,Re(e))},hu=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,{platform:du}=hu,At="unnamed",gu=128,Es={'"':"ˮ","*":"⁎","/":"⁄",":":"꞉","<":"‹",">":"›","?":"ʔ","\\":"∖","|":"ǀ"},yu=/[\u0000-\u001F\u0080-\u009F]/g,mu=/^(?:\.+[/\\]+)+|^\.+$/g,qe=/^(?:con|prn|aux|nul|com\d|lpt\d)$/i,$u=/[<>:"/\\|?*]/g,bu=/\//g,ae=new Set([" "," ","."]),fe=(t,e)=>e>0&&e<t.length-1,vu=(t,e)=>{const s=t.lastIndexOf(".");if(!fe(t,s))return t.slice(0,e);const n=t.slice(0,s),o=t.slice(s),r=e-o.length;return r>0?`${n.slice(0,r)}${o}`:t.slice(0,e)},As=t=>{let e=0,s=t.length;for(;e<s;){const n=t[e];if(n===void 0||!ae.has(n))break;e+=1}for(;s>e;){const n=t[s-1];if(n===void 0||!ae.has(n))break;s-=1}return t.slice(e,s)},wu=t=>{const e=t.lastIndexOf(".");if(fe(t,e)){const n=t.slice(0,e),o=t.slice(e);let r=n;for(;r.length>0;){const i=r.at(-1);if(i===void 0||!ae.has(i))break;r=r.slice(0,-1)}return r.length===0?o.slice(1):`${r}${o}`}let s=t;for(;s.length>0;){const n=s.at(-1);if(n===void 0||!ae.has(n))break;s=s.slice(0,-1)}return s},Su=t=>{const e=t.lastIndexOf(".");if(fe(t,e))return!1;if(qe.test(t))return!0;let s=t;for(;s.length>0;){const n=s.at(-1);if(n===void 0||!ae.has(n))break;s=s.slice(0,-1)}return!!(s.length>0&&qe.test(s))},xu=t=>{const e=t.lastIndexOf(".");if(fe(t,e)){const o=t.slice(0,e),r=t.slice(e),i=As(o);return i.length===0?void 0:`${i}${r}`}const s=t.trim();if(s.length>0&&s[0]==="."&&s.length<=5&&s.indexOf(".",1)===-1)return;const n=As(t);if(n.length!==0)return n},Eu=t=>{const e=t?.filesystem??"auto";return e==="auto"?du==="win32"?"win32":"unix":e==="darwin"?"unix":e},il=(t,e)=>{if(typeof t!="string"||t.length===0)return At;const s=Eu(e);let n=t;if(n=n.replace(yu,""),n.length===0||(n=n.replace(mu,""),n.length===0))return At;if(s==="win32"||s==="fat32"){const r=n.lastIndexOf(".");if(!fe(n,r)&&qe.test(n))return At}if(n=s==="win32"||s==="fat32"?n.replaceAll($u,r=>Es[r]??""):n.replaceAll(bu,Es["/"]),n=n.trim(),(s==="win32"||s==="fat32")&&(Su(n)||s==="win32"&&(n=wu(n),n.length===0)))return At;if(s==="fat32"){const r=xu(n);if(r===void 0)return At;n=r}if(n.length===0)return At;const o=e?.maxLength??gu;return n.length>o&&(n=vu(n,o),n.length===0)?At:n},gn=t=>{if(typeof t!="string"&&!(t instanceof ArrayBuffer)&&!ArrayBuffer.isView(t))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")};let Au;const _u=t=>(Au??=H(import.meta.url))(t),se=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Tu=t=>{if(typeof se<"u"&&se.versions&&se.versions.node){const[e,s]=se.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return se.getBuiltinModule(t)}return _u(t)},{randomBytes:Ru}=Tu("node:crypto"),yn=t=>`${t}.${process.pid.toString(36)}.${Ru(6).toString("hex")}.tmp`,ku=new TextEncoder,mn=t=>{if(t instanceof Uint8Array)return t;if(typeof t=="string")return ku.encode(t);if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t)){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new Uint8Array(e)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")};let Cu;const Ou=t=>(Cu??=H(import.meta.url))(t),ne=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Nu=t=>{if(typeof ne<"u"&&ne.versions&&ne.versions.node){const[e,s]=ne.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return ne.getBuiltinModule(t)}return Ou(t)},{mkdir:Lu,readFile:Du,writeFile:Fu,stat:Hu,rename:_s,chown:Iu,chmod:Bu,unlink:Mu}=Nu("node:fs/promises"),Pu=async(t,e,s)=>{s={backup:!1,encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...s},P(t),gn(e),t=F(t);const n=await be(t,we),o=s.flag??"w",r=o.includes("a"),i=o.includes("x");if(n&&(!s.overwrite||i))throw new xt(`file already exists, open '${t}'`);const c=yn(t);try{!n&&s.recursive&&await Lu(V(t),{recursive:!0});let u,y=typeof e=="string"?Buffer.from(e,s.encoding??"utf8"):mn(e);if(r&&n&&(y=Buffer.concat([await Du(t),y])),await Fu(c,y,{flag:"wx"}),n&&s.backup&&(u=await Hu(t),s.chown??={gid:u.gid,uid:u.uid},await _s(t,`${t}.bak`)),s.chown)try{await Iu(c,s.chown.uid,s.chown.gid)}catch{}const l=u&&s.mode===void 0?u.mode:s.mode;l!==void 0&&await Bu(c,l),await _s(c,t)}catch(u){throw new Error(`Failed to write file at: ${t} - ${u.message}`,{cause:u})}finally{await be(c)&&await Mu(c)}};let ju;const Gu=t=>(ju??=H(import.meta.url))(t),re=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Uu=t=>{if(typeof re<"u"&&re.versions&&re.versions.node){const[e,s]=re.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return re.getBuiltinModule(t)}return Gu(t)},{mkdirSync:qu,readFileSync:zu,writeFileSync:Wu,statSync:Xu,renameSync:Ts,chownSync:Ku,chmodSync:Qu,unlinkSync:Vu}=Uu("node:fs"),Yu=(t,e,s)=>{s={backup:!1,encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...s},P(t),gn(e),t=F(t);const n=ve(t,we),o=s.flag??"w",r=o.includes("a"),i=o.includes("x");if(n&&(!s.overwrite||i))throw new xt(`file already exists, open '${t}'`);const c=yn(t);try{!n&&s.recursive&&qu(V(t),{recursive:!0});let u,y=typeof e=="string"?Buffer.from(e,s.encoding??"utf8"):mn(e);if(r&&n&&(y=Buffer.concat([zu(t),y])),Wu(c,y,{flag:"wx"}),n&&s.backup&&(u=Xu(t),s.chown??={gid:u.gid,uid:u.uid},Ts(t,`${t}.bak`)),s.chown)try{Ku(c,s.chown.uid,s.chown.gid)}catch{}const l=u&&s.mode===void 0?u.mode:s.mode;l!==void 0&&Qu(c,l),Ts(c,t)}catch(u){throw new Error(`Failed to write file at: ${t} - ${u.message}`,{cause:u})}finally{ve(c)&&Vu(c)}},Zu=/^(?:( )+|\t+)/,he="space";function Rs(t,e,s){return t&&e===he&&s===1}function ks(t,e){const s=new Map;let n=0,o,r;for(const i of t.split(/\n/g)){if(!i)continue;const c=i.match(Zu);if(c===null)n=0,o="";else{const u=c[0].length,y=c[1]?he:"tab";if(Rs(e,y,u))continue;y!==o&&(n=0),o=y;let l=1,h=0;const $=u-n;if(n=u,$===0)l=0,h=1;else{const b=Math.abs($);if(Rs(e,y,b))continue;r=Ju(y,b)}const g=s.get(r);s.set(r,g===void 0?[1,0]:[g[0]+l,g[1]+h])}}return s}function Ju(t,e){return(t===he?"s":"t")+String(e)}function ta(t){const e=t[0]==="s"?he:"tab",s=Number(t.slice(1));return{type:e,amount:s}}function ea(t){let e,s=0,n=0;for(const[o,[r,i]]of t)(r>s||r===s&&i>n)&&(s=r,n=i,e=o);return e}function sa(t,e){return(t===he?" ":" ").repeat(e)}function $n(t){if(typeof t!="string")throw new TypeError("Expected a string");let e=ks(t,!0);e.size===0&&(e=ks(t,!1));const s=ea(e);let n,o=0,r="";return s!==void 0&&({type:n,amount:o}=ta(s),r=sa(n,o)),{amount:o,type:n,indent:r}}let na;const ra=t=>(na??=H(import.meta.url))(t),oe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,oa=t=>{if(typeof oe<"u"&&oe.versions&&oe.versions.node){const[e,s]=oe.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return oe.getBuiltinModule(t)}return ra(t)},{readFile:ia}=oa("node:fs/promises"),cl=async(t,e,s={})=>{const{detectIndent:n,indent:o,replacer:r,stringify:i=JSON.stringify,...c}={indent:" ",...s};let u=o,y=`
|
|
22
|
+
`;if(await be(t,Os))try{const h=await ia(t,"utf8");if(n){const{indent:$}=$n(h);u=$}y=h.endsWith(`
|
|
23
23
|
`)?`
|
|
24
24
|
`:""}catch(h){if(h.code!=="ENOENT")throw h}const l=i(e,r,u);await Pu(t,`${l}${y}`,c)};let ca;const ua=t=>(ca??=H(import.meta.url))(t),ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,aa=t=>{if(typeof ie<"u"&&ie.versions&&ie.versions.node){const[e,s]=ie.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return ie.getBuiltinModule(t)}return ua(t)},{readFileSync:la}=aa("node:fs"),ul=(t,e,s={})=>{const{detectIndent:n,indent:o,replacer:r,stringify:i=JSON.stringify,...c}={indent:" ",...s};let u=o,y=`
|
|
25
|
-
`;if(
|
|
25
|
+
`;if(ve(t,Os))try{const h=la(t,"utf8");if(n){const{indent:$}=$n(h);u=$}y=h.endsWith(`
|
|
26
26
|
`)?`
|
|
27
|
-
`:""}catch(h){if(h.code!=="ENOENT")throw h}const l=i(e,r,u);Yu(t,`${l}${y}`,c)};let pa;const fa=t=>(pa??=H(import.meta.url))(t),ce=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,
|
|
27
|
+
`:""}catch(h){if(h.code!=="ENOENT")throw h}const l=i(e,r,u);Yu(t,`${l}${y}`,c)};let pa;const fa=t=>(pa??=H(import.meta.url))(t),ce=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Qe=t=>{if(typeof ce<"u"&&ce.versions&&ce.versions.node){const[e,s]=ce.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return ce.getBuiltinModule(t)}return fa(t)},ha=Qe("fs"),da=Qe("os"),ga=Qe("path");var je={},Cs;function ya(){if(Cs)return je;Cs=1;var t=Object.defineProperty,e=(l,h)=>t(l,"name",{value:h,configurable:!0}),s=ha,n=da,o=ga;const r=e(l=>{let h="";for(let $=0;$<l.length;$+=1){const g=l[$],b=g.toUpperCase();h+=g===b?g.toLowerCase():b}return h},"invertCase"),i=new Map,c=e((l,h)=>{const $=o.join(l,`.is-fs-case-sensitive-test-${process.pid}`);try{return h.writeFileSync($,""),!h.existsSync(r($))}finally{try{h.unlinkSync($)}catch{}}},"checkDirectoryCaseWithWrite"),u=e((l,h,$)=>{try{return c(l,$)}catch(g){if(h===void 0)return c(n.tmpdir(),$);throw g}},"checkDirectoryCaseWithFallback"),y=e((l,h=s,$=!0)=>{const g=l??process.cwd();if($&&i.has(g))return i.get(g);let b;const E=r(g);return E!==g&&h.existsSync(g)?b=!h.existsSync(E):b=u(g,l,h),$&&i.set(g,b),b},"isFsCaseSensitive");return je.isFsCaseSensitive=y,je}var ma=ya();const al=ma.isFsCaseSensitive;export{Ge as CRLF,Ca as EOL,Ns as FIND_UP_STOP,we as F_OK,Is as LF,Os as R_OK,ba as W_OK,va as X_OK,Fa as collect,Ha as collectSync,Sa as copy,xa as copySync,Oa as detect,sl as emptyDir,nl as emptyDirSync,We as ensureDir,Xe as ensureDirSync,Ea as ensureFile,Aa as ensureFileSync,_a as ensureLink,Ta as ensureLinkSync,Ra as ensureSymlink,ka as ensureSymlinkSync,Ia as findUp,Ba as findUpSync,Na as format,ja as glob,Ua as globParent,Ga as globSync,be as isAccessible,ve as isAccessibleSync,al as isFsCaseSensitive,qa as isGlob,za as match,Wa as matcher,Ka as move,Qa as moveSync,xc as readFile,Cc as readFileSync,tl as readJson,el as readJsonSync,rl as remove,ol as removeSync,Va as rename,Ya as renameSync,il as sanitize,Ms as walk,js as walkSync,Pu as writeFile,Yu as writeFileSync,cl as writeJson,ul as writeJsonSync};
|
package/dist/packem_shared/{nodemailerProvider-CJ4zkTPF.js → nodemailerProvider-xg9Sh948.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import p from"nodemailer";import l from"./EmailError-BIaHK1Uw.js";import w from"./RequiredOptionError-ctDEEB1s.js";import{g as v}from"./generate-message-id-B2n2yqR6.js";import{h as g}from"./headers-to-record-ZOZ7Dubo.js";import{v as h}from"./validate-email-options-DxdAVLlu.js";import{defineProvider as T}from"./defineProvider-C9q-7iwt.js";const s="nodemailer",x=T((c={})=>{if(!c.transport)throw new w(s,"transport");let o;const f=r=>{const a=r??c.transport;return p.createTransport(a)};let d=!1;const y=async()=>{if(!d)try{o=f(),await o.verify(),d=!0}catch(r){throw new l(s,`Failed to initialize nodemailer transport: ${r instanceof Error?r.message:String(r)}`,{cause:r instanceof Error?r:new Error(String(r))})}},m=r=>{const a=e=>e.name?`${e.name} <${e.email}>`:e.email,t=e=>e.name?`${e.name} <${e.email}>`:e.email,u=c.defaultFrom??r.from,n={from:a(u),subject:r.subject,to:Array.isArray(r.to)?r.to.map(e=>t(e)):t(r.to)};return r.text&&(n.text=r.text),r.html&&(n.html=r.html),r.cc&&(n.cc=Array.isArray(r.cc)?r.cc.map(e=>t(e)):t(r.cc)),r.bcc&&(n.bcc=Array.isArray(r.bcc)?r.bcc.map(e=>t(e)):t(r.bcc)),r.replyTo&&(n.replyTo=r.replyTo.name?`${r.replyTo.name} <${r.replyTo.email}>`:r.replyTo.email),r.headers&&(n.headers=g(r.headers)),r.attachments&&r.attachments.length>0&&(n.attachments=r.attachments.map(e=>{const i={filename:e.filename};return e.raw!==void 0?i.content=e.raw:e.content!==void 0?i.content=e.content:e.path&&(i.path=e.path),e.contentType&&(i.contentType=e.contentType),e.contentDisposition&&(i.contentDisposition=e.contentDisposition),e.cid&&(i.cid=e.cid),e.encoding&&(i.encoding=e.encoding),e.headers&&(i.headers=e.headers),e.href&&(i.href=e.href),e.httpHeaders&&(i.httpHeaders=e.httpHeaders),i})),n};return{features:{attachments:!0,customHeaders:!0,html:!0,replyTo:!0},initialize:y,isAvailable:async()=>{try{return o??=f(),await o.verify(),!0}catch{return!1}},name:s,options:c,sendEmail:async r=>{const a=h(r);if(a.length>0)return{error:new l(s,`Validation failed: ${a.join(", ")}`),success:!1};try{if(d||await y(),!o)throw new l(s,"Transporter not initialized. Call initialize() first.");const t=r.transportOverride?f(r.transportOverride):o,u=m(r),n=await t.sendMail(u);return{data:{messageId:n.messageId
|
|
1
|
+
import p from"nodemailer";import l from"./EmailError-BIaHK1Uw.js";import w from"./RequiredOptionError-ctDEEB1s.js";import{g as v}from"./generate-message-id-B2n2yqR6.js";import{h as g}from"./headers-to-record-ZOZ7Dubo.js";import{v as h}from"./validate-email-options-DxdAVLlu.js";import{defineProvider as T}from"./defineProvider-C9q-7iwt.js";const s="nodemailer",x=T((c={})=>{if(!c.transport)throw new w(s,"transport");let o;const f=r=>{const a=r??c.transport;return p.createTransport(a)};let d=!1;const y=async()=>{if(!d)try{o=f(),await o.verify(),d=!0}catch(r){throw new l(s,`Failed to initialize nodemailer transport: ${r instanceof Error?r.message:String(r)}`,{cause:r instanceof Error?r:new Error(String(r))})}},m=r=>{const a=e=>e.name?`${e.name} <${e.email}>`:e.email,t=e=>e.name?`${e.name} <${e.email}>`:e.email,u=c.defaultFrom??r.from,n={from:a(u),subject:r.subject,to:Array.isArray(r.to)?r.to.map(e=>t(e)):t(r.to)};return r.text&&(n.text=r.text),r.html&&(n.html=r.html),r.cc&&(n.cc=Array.isArray(r.cc)?r.cc.map(e=>t(e)):t(r.cc)),r.bcc&&(n.bcc=Array.isArray(r.bcc)?r.bcc.map(e=>t(e)):t(r.bcc)),r.replyTo&&(n.replyTo=r.replyTo.name?`${r.replyTo.name} <${r.replyTo.email}>`:r.replyTo.email),r.headers&&(n.headers=g(r.headers)),r.attachments&&r.attachments.length>0&&(n.attachments=r.attachments.map(e=>{const i={filename:e.filename};return e.raw!==void 0?i.content=e.raw:e.content!==void 0?i.content=e.content:e.path&&(i.path=e.path),e.contentType&&(i.contentType=e.contentType),e.contentDisposition&&(i.contentDisposition=e.contentDisposition),e.cid&&(i.cid=e.cid),e.encoding&&(i.encoding=e.encoding),e.headers&&(i.headers=e.headers),e.href&&(i.href=e.href),e.httpHeaders&&(i.httpHeaders=e.httpHeaders),i})),n};return{features:{attachments:!0,customHeaders:!0,html:!0,replyTo:!0},initialize:y,isAvailable:async()=>{try{return o??=f(),await o.verify(),!0}catch{return!1}},name:s,options:c,sendEmail:async r=>{const a=h(r);if(a.length>0)return{error:new l(s,`Validation failed: ${a.join(", ")}`),success:!1};try{if(d||await y(),!o)throw new l(s,"Transporter not initialized. Call initialize() first.");const t=r.transportOverride?f(r.transportOverride):o,u=m(r),n=await t.sendMail(u);return{data:{messageId:n.messageId??v(),provider:s,response:n,sent:!0,timestamp:new Date},success:!0}}catch(t){return{error:new l(s,`Failed to send email: ${t instanceof Error?t.message:String(t)}`,{cause:t instanceof Error?t:new Error(String(t))}),success:!1}}},shutdown:async()=>{o&&typeof o.close=="function"&&o.close(),o=void 0,d=!1},validateCredentials:async()=>{try{return o??=f(),await o.verify(),!0}catch{return!1}}}});export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as o}from"../../packem_shared/nodemailerProvider-
|
|
1
|
+
import{default as o}from"../../packem_shared/nodemailerProvider-xg9Sh948.js";export{o as nodemailerProvider};
|