"use strict";var ht=require("node:os"),$s=require("tty"),Ts=require("esbuild"),xs=require("./package-Mf9hIyh6.cjs"),dt=require("./pkgroll_create-require-B-Pljx_-.cjs"),wu=require("node:url"),Os=require("child_process"),V=require("path"),ie=require("fs"),Ge=require("./node-features-CKvB621_.cjs"),Ns=require("node:path"),Hs=require("events"),me=require("util"),Ls=require("stream"),Ru=require("os"),Is=require("node:net"),Et=require("node:fs"),Ps=require("./temporary-directory-B83uKxJF.cjs"),bu=require("./get-pipe-path-b8D5AZgV.cjs");require("module");const ks="known-flag",Ms="unknown-flag",Gs="argument",{stringify:_e}=JSON,Ws=/\B([A-Z])/g,js=t=>t.replace(Ws,"-$1").toLowerCase(),{hasOwnProperty:Us}=Object.prototype,Ae=(t,e)=>Us.call(t,e),Ks=t=>Array.isArray(t),vu=t=>typeof t=="function"?[t,!1]:Ks(t)?[t[0],!0]:vu(t.type),Vs=(t,e)=>t===Boolean?e!=="false":e,zs=(t,e)=>typeof e=="boolean"?e:t===Number&&e===""?Number.NaN:t(e),Ys=/[\s.:=]/,qs=t=>{const e=`Flag name ${_e(t)}`;if(t.length===0)throw new Error(`${e} cannot be empty`);if(t.length===1)throw new Error(`${e} must be longer than a character`);const u=t.match(Ys);if(u)throw new Error(`${e} cannot contain ${_e(u?.[0])}`)},Xs=t=>{const e={},u=(r,s)=>{if(Ae(e,r))throw new Error(`Duplicate flags named ${_e(r)}`);e[r]=s};for(const r in t){if(!Ae(t,r))continue;qs(r);const s=t[r],n=[[],...vu(s),s];u(r,n);const i=js(r);if(r!==i&&u(i,n),"alias"in s&&typeof s.alias=="string"){const{alias:D}=s,o=`Flag alias ${_e(D)} for flag ${_e(r)}`;if(D.length===0)throw new Error(`${o} cannot be empty`);if(D.length>1)throw new Error(`${o} must be a single character`);u(D,n)}}return e},Qs=(t,e)=>{const u={};for(const r in t){if(!Ae(t,r))continue;const[s,,n,i]=e[r];if(s.length===0&&"default"in i){let{default:D}=i;typeof D=="function"&&(D=D()),u[r]=D}else u[r]=n?s:s.pop()}return u},We="--",Zs=/[.:=]/,Js=/^-{1,2}\w/,en=t=>{if(!Js.test(t))return;const e=!t.startsWith(We);let u=t.slice(e?1:2),r;const s=u.match(Zs);if(s){const{index:n}=s;r=u.slice(n+1),u=u.slice(0,n)}return[u,r,e]},tn=(t,{onFlag:e,onArgument:u})=>{let r;const s=(n,i)=>{if(typeof r!="function")return!0;r(n,i),r=void 0};for(let n=0;n{for(const[u,r,s]of e.reverse()){if(r){const n=t[u];let i=n.slice(0,r);if(s||(i+=n.slice(r+1)),i!=="-"){t[u]=i;continue}}t.splice(u,1)}},Su=(t,e=process.argv.slice(2),{ignore:u}={})=>{const r=[],s=Xs(t),n={},i=[];return i[We]=[],tn(e,{onFlag(D,o,l){const c=Ae(s,D);if(!u?.(c?ks:Ms,D,o)){if(c){const[f,a]=s[D],E=Vs(a,o),p=(F,A)=>{r.push(l),A&&r.push(A),f.push(zs(a,F||""))};return E===void 0?p:p(E)}Ae(n,D)||(n[D]=[]),n[D].push(o===void 0?!0:o),r.push(l)}},onArgument(D,o,l){u?.(Gs,e[o[0]])||(i.push(...D),l?(i[We]=D,e.splice(o[0])):r.push(o))}}),un(e,r),{flags:Qs(t,s),unknownFlags:n,_:i}};var rn=Object.create,je=Object.defineProperty,sn=Object.defineProperties,nn=Object.getOwnPropertyDescriptor,Dn=Object.getOwnPropertyDescriptors,on=Object.getOwnPropertyNames,Bu=Object.getOwnPropertySymbols,an=Object.getPrototypeOf,$u=Object.prototype.hasOwnProperty,ln=Object.prototype.propertyIsEnumerable,Tu=(t,e,u)=>e in t?je(t,e,{enumerable:!0,configurable:!0,writable:!0,value:u}):t[e]=u,Ue=(t,e)=>{for(var u in e||(e={}))$u.call(e,u)&&Tu(t,u,e[u]);if(Bu)for(var u of Bu(e))ln.call(e,u)&&Tu(t,u,e[u]);return t},pt=(t,e)=>sn(t,Dn(e)),cn=t=>je(t,"__esModule",{value:!0}),fn=(t,e)=>()=>(t&&(e=t(t=0)),e),hn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),dn=(t,e,u,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of on(e))!$u.call(t,s)&&s!=="default"&&je(t,s,{get:()=>e[s],enumerable:!(r=nn(e,s))||r.enumerable});return t},En=(t,e)=>dn(cn(je(t!=null?rn(an(t)):{},"default",{value:t,enumerable:!0})),t),U=fn(()=>{}),pn=hn((t,e)=>{U(),e.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});U(),U(),U();var Cn=t=>{var e,u,r;let s=(e=process.stdout.columns)!=null?e:Number.POSITIVE_INFINITY;return typeof t=="function"&&(t=t(s)),t||(t={}),Array.isArray(t)?{columns:t,stdoutColumns:s}:{columns:(u=t.columns)!=null?u:[],stdoutColumns:(r=t.stdoutColumns)!=null?r:s}};U(),U(),U(),U(),U();function Fn({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}function xu(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Fn(),"")}U();function gn(t){return Number.isInteger(t)?t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141):!1}var mn=En(pn());function De(t){if(typeof t!="string"||t.length===0||(t=xu(t),t.length===0))return 0;t=t.replace((0,mn.default)()," ");let e=0;for(let u=0;u=127&&r<=159||r>=768&&r<=879||(r>65535&&u++,e+=gn(r)?2:1)}return e}var Ou=t=>Math.max(...t.split(` `).map(De)),_n=t=>{let e=[];for(let u of t){let{length:r}=u,s=r-e.length;for(let n=0;ne[n]&&(e[n]=i)}}return e};U();var Nu=/^\d+%$/,Hu={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},An=(t,e)=>{var u;let r=[];for(let s=0;s=e){let o=i-e,l=Math.ceil(u.paddingLeft/s*o),c=o-l;u.paddingLeft-=l,u.paddingRight-=c,u.horizontalPadding=u.paddingLeft+u.paddingRight}u.paddingLeftString=u.paddingLeft?" ".repeat(u.paddingLeft):"",u.paddingRightString=u.paddingRight?" ".repeat(u.paddingRight):"";let D=e-u.horizontalPadding;u.width=Math.max(Math.min(u.width,D),n)}}var Lu=()=>Object.assign([],{columns:0});function wn(t,e){let u=[Lu()],[r]=u;for(let s of t){let n=s.width+s.horizontalPadding;r.columns+n>e&&(r=Lu(),u.push(r)),r.push(s),r.columns+=n}for(let s of u){let n=s.reduce((a,E)=>a+E.width+E.horizontalPadding,0),i=e-n;if(i===0)continue;let D=s.filter(a=>"autoOverflow"in a),o=D.filter(a=>a.autoOverflow>0),l=o.reduce((a,E)=>a+E.autoOverflow,0),c=Math.min(l,i);for(let a of o){let E=Math.floor(a.autoOverflow/l*c);a.width+=E,i-=E}let f=Math.floor(i/D.length);for(let a=0;ae=>`\x1B[${e+t}m`,Pu=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,ku=(t=0)=>(e,u,r)=>`\x1B[${38+t};2;${e};${u};${r}m`;function bn(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[u,r]of Object.entries(e)){for(let[s,n]of Object.entries(r))e[s]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},r[s]=e[s],t.set(n[0],n[1]);Object.defineProperty(e,u,{value:r,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi=Iu(),e.color.ansi256=Pu(),e.color.ansi16m=ku(),e.bgColor.ansi=Iu(Ct),e.bgColor.ansi256=Pu(Ct),e.bgColor.ansi16m=ku(Ct),Object.defineProperties(e,{rgbToAnsi256:{value:(u,r,s)=>u===r&&r===s?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(r/255*5)+Math.round(s/255*5),enumerable:!1},hexToRgb:{value:u=>{let r=/(?[a-f\d]{6}|[a-f\d]{3})/i.exec(u.toString(16));if(!r)return[0,0,0];let{colorString:s}=r.groups;s.length===3&&(s=s.split("").map(i=>i+i).join(""));let n=Number.parseInt(s,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:u=>e.rgbToAnsi256(...e.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let r,s,n;if(u>=232)r=((u-232)*10+8)/255,s=r,n=r;else{u-=16;let o=u%36;r=Math.floor(u/36)/5,s=Math.floor(o/6)/5,n=o%6/5}let i=Math.max(r,s,n)*2;if(i===0)return 30;let D=30+(Math.round(n)<<2|Math.round(s)<<1|Math.round(r));return i===2&&(D+=60),D},enumerable:!1},rgbToAnsi:{value:(u,r,s)=>e.ansi256ToAnsi(e.rgbToAnsi256(u,r,s)),enumerable:!1},hexToAnsi:{value:u=>e.ansi256ToAnsi(e.hexToAnsi256(u)),enumerable:!1}}),e}var vn=bn(),Sn=vn,Ke=new Set(["\x1B","\x9B"]),Bn=39,Ft="\x07",Mu="[",$n="]",Gu="m",gt=`${$n}8;;`,Wu=t=>`${Ke.values().next().value}${Mu}${t}${Gu}`,ju=t=>`${Ke.values().next().value}${gt}${t}${Ft}`,Tn=t=>t.split(" ").map(e=>De(e)),mt=(t,e,u)=>{let r=[...e],s=!1,n=!1,i=De(xu(t[t.length-1]));for(let[D,o]of r.entries()){let l=De(o);if(i+l<=u?t[t.length-1]+=o:(t.push(o),i=0),Ke.has(o)&&(s=!0,n=r.slice(D+1).join("").startsWith(gt)),s){n?o===Ft&&(s=!1,n=!1):o===Gu&&(s=!1);continue}i+=l,i===u&&D0&&t.length>1&&(t[t.length-2]+=t.pop())},xn=t=>{let e=t.split(" "),u=e.length;for(;u>0&&!(De(e[u-1])>0);)u--;return u===e.length?t:e.slice(0,u).join(" ")+e.slice(u).join("")},On=(t,e,u={})=>{if(u.trim!==!1&&t.trim()==="")return"";let r="",s,n,i=Tn(t),D=[""];for(let[l,c]of t.split(" ").entries()){u.trim!==!1&&(D[D.length-1]=D[D.length-1].trimStart());let f=De(D[D.length-1]);if(l!==0&&(f>=e&&(u.wordWrap===!1||u.trim===!1)&&(D.push(""),f=0),(f>0||u.trim===!1)&&(D[D.length-1]+=" ",f++)),u.hard&&i[l]>e){let a=e-f,E=1+Math.floor((i[l]-a-1)/e);Math.floor((i[l]-1)/e)e&&f>0&&i[l]>0){if(u.wordWrap===!1&&fe&&u.wordWrap===!1){mt(D,c,e);continue}D[D.length-1]+=c}u.trim!==!1&&(D=D.map(l=>xn(l)));let o=[...D.join(` `)];for(let[l,c]of o.entries()){if(r+=c,Ke.has(c)){let{groups:a}=new RegExp(`(?:\\${Mu}(?\\d+)m|\\${gt}(?.*)${Ft})`).exec(o.slice(l).join(""))||{groups:{}};if(a.code!==void 0){let E=Number.parseFloat(a.code);s=E===Bn?void 0:E}else a.uri!==void 0&&(n=a.uri.length===0?void 0:a.uri)}let f=Sn.codes.get(Number(s));o[l+1]===` `?(n&&(r+=ju("")),s&&f&&(r+=Wu(f))):c===` `&&(s&&f&&(r+=Wu(s)),n&&(r+=ju(n)))}return r};function Nn(t,e,u){return String(t).normalize().replace(/\r\n/g,` `).split(` `).map(r=>On(r,e,u)).join(` `)}var Uu=t=>Array.from({length:t}).fill("");function Hn(t,e){let u=[],r=0;for(let s of t){let n=0,i=s.map(o=>{var l;let c=(l=e[r])!=null?l:"";r+=1,o.preprocess&&(c=o.preprocess(c)),Ou(c)>o.width&&(c=Nn(c,o.width,{hard:!0}));let f=c.split(` `);if(o.postprocess){let{postprocess:a}=o;f=f.map((E,p)=>a.call(o,E,p))}return o.paddingTop&&f.unshift(...Uu(o.paddingTop)),o.paddingBottom&&f.push(...Uu(o.paddingBottom)),f.length>n&&(n=f.length),pt(Ue({},o),{lines:f})}),D=[];for(let o=0;o{var f;let a=(f=c.lines[o])!=null?f:"",E=Number.isFinite(c.width)?" ".repeat(c.width-De(a)):"",p=c.paddingLeftString;return c.align==="right"&&(p+=E),p+=a,c.align==="left"&&(p+=E),p+c.paddingRightString}).join("");D.push(l)}u.push(D.join(` `))}return u.join(` `)}function Ln(t,e){if(!t||t.length===0)return"";let u=_n(t),r=u.length;if(r===0)return"";let{stdoutColumns:s,columns:n}=Cn(e);if(n.length>r)throw new Error(`${n.length} columns defined, but only ${r} columns found`);let i=Rn(s,n,u);return t.map(D=>Hn(i,D)).join(` `)}U();var In=["<",">","=",">=","<="];function Pn(t){if(!In.includes(t))throw new TypeError(`Invalid breakpoint operator: ${t}`)}function kn(t){let e=Object.keys(t).map(u=>{let[r,s]=u.split(" ");Pn(r);let n=Number.parseInt(s,10);if(Number.isNaN(n))throw new TypeError(`Invalid breakpoint value: ${s}`);let i=t[u];return{operator:r,breakpoint:n,value:i}}).sort((u,r)=>r.breakpoint-u.breakpoint);return u=>{var r;return(r=e.find(({operator:s,breakpoint:n})=>s==="="&&u===n||s===">"&&u>n||s==="<"&&u="&&u>=n||s==="<="&&u<=n))==null?void 0:r.value}}const Mn=t=>t.replace(/[\W_]([a-z\d])?/gi,(e,u)=>u?u.toUpperCase():""),Gn=t=>t.replace(/\B([A-Z])/g,"-$1").toLowerCase(),Wn={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:t=>t.trim()},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function jn(t){let e=!1;return{type:"table",data:{tableData:Object.keys(t).sort((u,r)=>u.localeCompare(r)).map(u=>{const r=t[u],s="alias"in r;return s&&(e=!0),{name:u,flag:r,flagFormatted:`--${Gn(u)}`,aliasesEnabled:e,aliasFormatted:s?`-${r.alias}`:void 0}}).map(u=>(u.aliasesEnabled=e,[{type:"flagName",data:u},{type:"flagDescription",data:u}])),tableBreakpoints:Wn}}}const Ku=t=>!t||(t.version??(t.help?t.help.version:void 0)),Vu=t=>{const e="parent"in t&&t.parent?.name;return(e?`${e} `:"")+t.name};function Un(t){const e=[];t.name&&e.push(Vu(t));const u=Ku(t)??("parent"in t&&Ku(t.parent));if(u&&e.push(`v${u}`),e.length!==0)return{id:"name",type:"text",data:`${e.join(" ")} `}}function Kn(t){const{help:e}=t;if(!(!e||!e.description))return{id:"description",type:"text",data:`${e.description} `}}function Vn(t){const e=t.help||{};if("usage"in e)return e.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(e.usage)?e.usage.join(` `):e.usage}}:void 0;if(t.name){const u=[],r=[Vu(t)];if(t.flags&&Object.keys(t.flags).length>0&&r.push("[flags...]"),t.parameters&&t.parameters.length>0){const{parameters:s}=t,n=s.indexOf("--"),i=n>-1&&s.slice(n+1).some(D=>D.startsWith("<"));r.push(s.map(D=>D!=="--"?D:i?"--":"[--]").join(" "))}if(r.length>1&&u.push(r.join(" ")),"commands"in t&&t.commands?.length&&u.push(`${t.name} `),u.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:u.join(` `)}}}}function zn(t){return!("commands"in t)||!t.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:t.commands.map(e=>[e.options.name,e.options.help?e.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}function Yn(t){if(!(!t.flags||Object.keys(t.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:jn(t.flags),indentBody:0}}}function qn(t){const{help:e}=t;if(!e||!e.examples||e.examples.length===0)return;let{examples:u}=e;if(Array.isArray(u)&&(u=u.join(` `)),u)return{id:"examples",type:"section",data:{title:"Examples:",body:u}}}function Xn(t){if(!("alias"in t)||!t.alias)return;const{alias:e}=t;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(e)?e.join(", "):e}}}const Qn=t=>[Un,Kn,Vn,zn,Yn,qn,Xn].map(e=>e(t)).filter(Boolean),Zn=$s.WriteStream.prototype.hasColors();class Jn{text(e){return e}bold(e){return Zn?`\x1B[1m${e}\x1B[22m`:e.toLocaleUpperCase()}indentText({text:e,spaces:u}){return e.replace(/^/gm," ".repeat(u))}heading(e){return this.bold(e)}section({title:e,body:u,indentBody:r=2}){return`${(e?`${this.heading(e)} `:"")+(u?this.indentText({text:this.render(u),spaces:r}):"")} `}table({tableData:e,tableOptions:u,tableBreakpoints:r}){return Ln(e.map(s=>s.map(n=>this.render(n))),r?kn(r):u)}flagParameter(e){return e===Boolean?"":e===String?"":e===Number?"":Array.isArray(e)?this.flagParameter(e[0]):""}flagOperator(e){return" "}flagName(e){const{flag:u,flagFormatted:r,aliasesEnabled:s,aliasFormatted:n}=e;let i="";if(n?i+=`${n}, `:s&&(i+=" "),i+=r,"placeholder"in u&&typeof u.placeholder=="string")i+=`${this.flagOperator(e)}${u.placeholder}`;else{const D=this.flagParameter("type"in u?u.type:u);D&&(i+=`${this.flagOperator(e)}${D}`)}return i}flagDefault(e){return JSON.stringify(e)}flagDescription({flag:e}){let u="description"in e?e.description??"":"";if("default"in e){let{default:r}=e;typeof r=="function"&&(r=r()),r&&(u+=` (default: ${this.flagDefault(r)})`)}return u}render(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(u=>this.render(u)).join(` `);if("type"in e&&this[e.type]){const u=this[e.type];if(typeof u=="function")return u.call(this,e.data)}throw new Error(`Invalid node type: ${JSON.stringify(e)}`)}}const _t=/^[\w.-]+$/,{stringify:J}=JSON,ei=/[|\\{}()[\]^$+*?.]/;function At(t){const e=[];let u,r;for(const s of t){if(r)throw new Error(`Invalid parameter: Spread parameter ${J(r)} must be last`);const n=s[0],i=s[s.length-1];let D;if(n==="<"&&i===">"&&(D=!0,u))throw new Error(`Invalid parameter: Required parameter ${J(s)} cannot come after optional parameter ${J(u)}`);if(n==="["&&i==="]"&&(D=!1,u=s),D===void 0)throw new Error(`Invalid parameter: ${J(s)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let o=s.slice(1,-1);const l=o.slice(-3)==="...";l&&(r=s,o=o.slice(0,-3));const c=o.match(ei);if(c)throw new Error(`Invalid parameter: ${J(s)}. Invalid character found ${J(c[0])}`);e.push({name:o,required:D,spread:l})}return e}function yt(t,e,u,r){for(let s=0;s{console.log(e.version)};if(n&&o.flags.version===!0)return l(),process.exit(0);const c=new Jn,f=D&&i?.render?i.render:p=>c.render(p),a=p=>{const F=Qn({...e,...p?{help:p}:{},flags:s});console.log(f(F,c))};if(D&&o.flags.help===!0)return a(),process.exit(0);if(e.parameters){let{parameters:p}=e,F=o._;const A=p.indexOf("--"),S=p.slice(A+1),N=Object.create(null);if(A>-1&&S.length>0){p=p.slice(0,A);const B=o._["--"];F=F.slice(0,-B.length||void 0),yt(N,At(p),F,a),yt(N,At(S),B,a)}else yt(N,At(p),F,a);Object.assign(o._,N)}const E={...o,showVersion:l,showHelp:a};return typeof u=="function"&&u(E),{command:t,...E}}function ui(t,e){const u=new Map;for(const r of e){const s=[r.options.name],{alias:n}=r.options;n&&(Array.isArray(n)?s.push(...n):s.push(n));for(const i of s){if(u.has(i))throw new Error(`Duplicate command name found: ${J(i)}`);u.set(i,r)}}return u.get(t)}function Yu(t,e,u=process.argv.slice(2)){if(!t)throw new Error("Options is required");if("name"in t&&(!t.name||!_t.test(t.name)))throw new Error(`Invalid script name: ${J(t.name)}`);const r=u[0];if(t.commands&&_t.test(r)){const s=ui(r,t.commands);if(s)return zu(s.options.name,{...s.options,parent:t},s.callback,u.slice(1))}return zu(void 0,t,e,u)}function ri(t,e){if(!t)throw new Error("Command options are required");const{name:u}=t;if(t.name===void 0)throw new Error("Command name is required");if(!_t.test(u))throw new Error(`Invalid command name ${JSON.stringify(u)}. Command names must be one word.`);return{options:t,callback:e}}var si=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ni(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var fe={exports:{}},wt,qu;function ii(){if(qu)return wt;qu=1,wt=r,r.sync=s;var t=ie;function e(n,i){var D=i.pathExt!==void 0?i.pathExt:process.env.PATHEXT;if(!D||(D=D.split(";"),D.indexOf("")!==-1))return!0;for(var o=0;oObject.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),er=(t,e)=>{const u=e.colon||li,r=t.match(/\//)||he&&t.match(/\\/)?[""]:[...he?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(u)],s=he?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",n=he?s.split(u):[""];return he&&t.indexOf(".")!==-1&&n[0]!==""&&n.unshift(""),{pathEnv:r,pathExt:n,pathExtExe:s}},tr=(t,e,u)=>{typeof e=="function"&&(u=e,e={}),e||(e={});const{pathEnv:r,pathExt:s,pathExtExe:n}=er(t,e),i=[],D=l=>new Promise((c,f)=>{if(l===r.length)return e.all&&i.length?c(i):f(Ju(t));const a=r[l],E=/^".*"$/.test(a)?a.slice(1,-1):a,p=Qu.join(E,t),F=!E&&/^\.[\\\/]/.test(t)?t.slice(0,2)+p:p;c(o(F,l,0))}),o=(l,c,f)=>new Promise((a,E)=>{if(f===s.length)return a(D(c+1));const p=s[f];Zu(l+p,{pathExt:n},(F,A)=>{if(!F&&A)if(e.all)i.push(l+p);else return a(l+p);return a(o(l,c,f+1))})});return u?D(0).then(l=>u(null,l),u):D(0)},ci=(t,e)=>{e=e||{};const{pathEnv:u,pathExt:r,pathExtExe:s}=er(t,e),n=[];for(let i=0;i{const e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};vt.exports=ur,vt.exports.default=ur;var hi=vt.exports;const rr=V,di=fi,Ei=hi;function sr(t,e){const u=t.options.env||process.env,r=process.cwd(),s=t.options.cwd!=null,n=s&&process.chdir!==void 0&&!process.chdir.disabled;if(n)try{process.chdir(t.options.cwd)}catch{}let i;try{i=di.sync(t.command,{path:u[Ei({env:u})],pathExt:e?rr.delimiter:void 0})}catch{}finally{n&&process.chdir(r)}return i&&(i=rr.resolve(s?t.options.cwd:"",i)),i}function pi(t){return sr(t)||sr(t,!0)}var Ci=pi,St={};const Bt=/([()\][%!^"`<>&|;, *?])/g;function Fi(t){return t=t.replace(Bt,"^$1"),t}function gi(t,e){return t=`${t}`,t=t.replace(/(\\*)"/g,'$1$1\\"'),t=t.replace(/(\\*)$/,"$1$1"),t=`"${t}"`,t=t.replace(Bt,"^$1"),e&&(t=t.replace(Bt,"^$1")),t}St.command=Fi,St.argument=gi;var mi=/^#!(.*)/;const _i=mi;var Ai=(t="")=>{const e=t.match(_i);if(!e)return null;const[u,r]=e[0].replace(/#! ?/,"").split(" "),s=u.split("/").pop();return s==="env"?r:r?`${s} ${r}`:s};const $t=ie,yi=Ai;function wi(t){const u=Buffer.alloc(150);let r;try{r=$t.openSync(t,"r"),$t.readSync(r,u,0,150,0),$t.closeSync(r)}catch{}return yi(u.toString())}var Ri=wi;const bi=V,nr=Ci,ir=St,vi=Ri,Si=process.platform==="win32",Bi=/\.(?:com|exe)$/i,$i=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Ti(t){t.file=nr(t);const e=t.file&&vi(t.file);return e?(t.args.unshift(t.file),t.command=e,nr(t)):t.file}function xi(t){if(!Si)return t;const e=Ti(t),u=!Bi.test(e);if(t.options.forceShell||u){const r=$i.test(e);t.command=bi.normalize(t.command),t.command=ir.command(t.command),t.args=t.args.map(n=>ir.argument(n,r));const s=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${s}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function Oi(t,e,u){e&&!Array.isArray(e)&&(u=e,e=null),e=e?e.slice(0):[],u=Object.assign({},u);const r={command:t,args:e,options:u,file:void 0,original:{command:t,args:e}};return u.shell?r:xi(r)}var Ni=Oi;const Tt=process.platform==="win32";function xt(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function Hi(t,e){if(!Tt)return;const u=t.emit;t.emit=function(r,s){if(r==="exit"){const n=Dr(s,e);if(n)return u.call(t,"error",n)}return u.apply(t,arguments)}}function Dr(t,e){return Tt&&t===1&&!e.file?xt(e.original,"spawn"):null}function Li(t,e){return Tt&&t===1&&!e.file?xt(e.original,"spawnSync"):null}var Ii={hookChildProcess:Hi,verifyENOENT:Dr,verifyENOENTSync:Li,notFoundError:xt};const or=Os,Ot=Ni,Nt=Ii;function ar(t,e,u){const r=Ot(t,e,u),s=or.spawn(r.command,r.args,r.options);return Nt.hookChildProcess(s,r),s}function Pi(t,e,u){const r=Ot(t,e,u),s=or.spawnSync(r.command,r.args,r.options);return s.error=s.error||Nt.verifyENOENTSync(s.status,r),s}fe.exports=ar,fe.exports.spawn=ar,fe.exports.sync=Pi,fe.exports._parse=Ot,fe.exports._enoent=Nt;var ki=fe.exports,Mi=ni(ki);const lr=(t,e)=>{const u={...process.env},r=["inherit","inherit","inherit"];return process.send&&r.push("ipc"),e&&(e.noCache&&(u.TSX_DISABLE_CACHE="1"),e.tsconfigPath&&(u.TSX_TSCONFIG_PATH=e.tsconfigPath)),Mi(process.execPath,["--require",dt.require.resolve("./preflight.cjs"),Ge.isFeatureSupported(Ge.moduleRegister)?"--import":"--loader",wu.pathToFileURL(dt.require.resolve("./loader.mjs")).toString(),...t],{stdio:r,env:u})};var ze={};const Gi=V,ee="\\\\/",cr=`[^${ee}]`,te="\\.",Wi="\\+",ji="\\?",Ye="\\/",Ui="(?=.)",fr="[^/]",Ht=`(?:${Ye}|$)`,hr=`(?:^|${Ye})`,Lt=`${te}{1,2}${Ht}`,Ki=`(?!${te})`,Vi=`(?!${hr}${Lt})`,zi=`(?!${te}{0,1}${Ht})`,Yi=`(?!${Lt})`,qi=`[^.${Ye}]`,Xi=`${fr}*?`,dr={DOT_LITERAL:te,PLUS_LITERAL:Wi,QMARK_LITERAL:ji,SLASH_LITERAL:Ye,ONE_CHAR:Ui,QMARK:fr,END_ANCHOR:Ht,DOTS_SLASH:Lt,NO_DOT:Ki,NO_DOTS:Vi,NO_DOT_SLASH:zi,NO_DOTS_SLASH:Yi,QMARK_NO_DOT:qi,STAR:Xi,START_ANCHOR:hr},Qi={...dr,SLASH_LITERAL:`[${ee}]`,QMARK:cr,STAR:`${cr}*?`,DOTS_SLASH:`${te}{1,2}(?:[${ee}]|$)`,NO_DOT:`(?!${te})`,NO_DOTS:`(?!(?:^|[${ee}])${te}{1,2}(?:[${ee}]|$))`,NO_DOT_SLASH:`(?!${te}{0,1}(?:[${ee}]|$))`,NO_DOTS_SLASH:`(?!${te}{1,2}(?:[${ee}]|$))`,QMARK_NO_DOT:`[^.${ee}]`,START_ANCHOR:`(?:^|[${ee}])`,END_ANCHOR:`(?:[${ee}]|$)`},Zi={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"};var qe={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Zi,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:{"***":"*","**/**":"**","**/**/**":"**"},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,SEP:Gi.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Qi:dr}};(function(t){const e=V,u=process.platform==="win32",{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:n,REGEX_SPECIAL_CHARS_GLOBAL:i}=qe;t.isObject=D=>D!==null&&typeof D=="object"&&!Array.isArray(D),t.hasRegexChars=D=>n.test(D),t.isRegexChar=D=>D.length===1&&t.hasRegexChars(D),t.escapeRegex=D=>D.replace(i,"\\$1"),t.toPosixSlashes=D=>D.replace(r,"/"),t.removeBackslashes=D=>D.replace(s,o=>o==="\\"?"":o),t.supportsLookbehinds=()=>{const D=process.version.slice(1).split(".").map(Number);return D.length===3&&D[0]>=9||D[0]===8&&D[1]>=10},t.isWindows=D=>D&&typeof D.windows=="boolean"?D.windows:u===!0||e.sep==="\\",t.escapeLast=(D,o,l)=>{const c=D.lastIndexOf(o,l);return c===-1?D:D[c-1]==="\\"?t.escapeLast(D,o,c-1):`${D.slice(0,c)}\\${D.slice(c)}`},t.removePrefix=(D,o={})=>{let l=D;return l.startsWith("./")&&(l=l.slice(2),o.prefix="./"),l},t.wrapOutput=(D,o={},l={})=>{const c=l.contains?"":"^",f=l.contains?"":"$";let a=`${c}(?:${D})${f}`;return o.negated===!0&&(a=`(?:^(?!${a}).*$)`),a}})(ze);const Er=ze,{CHAR_ASTERISK:It,CHAR_AT:Ji,CHAR_BACKWARD_SLASH:ye,CHAR_COMMA:eD,CHAR_DOT:Pt,CHAR_EXCLAMATION_MARK:kt,CHAR_FORWARD_SLASH:pr,CHAR_LEFT_CURLY_BRACE:Mt,CHAR_LEFT_PARENTHESES:Gt,CHAR_LEFT_SQUARE_BRACKET:tD,CHAR_PLUS:uD,CHAR_QUESTION_MARK:Cr,CHAR_RIGHT_CURLY_BRACE:rD,CHAR_RIGHT_PARENTHESES:Fr,CHAR_RIGHT_SQUARE_BRACKET:sD}=qe,gr=t=>t===pr||t===ye,mr=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},nD=(t,e)=>{const u=e||{},r=t.length-1,s=u.parts===!0||u.scanToEnd===!0,n=[],i=[],D=[];let o=t,l=-1,c=0,f=0,a=!1,E=!1,p=!1,F=!1,A=!1,S=!1,N=!1,B=!1,X=!1,M=!1,re=0,G,_,b={value:"",depth:0,isGlob:!1};const k=()=>l>=r,C=()=>o.charCodeAt(l+1),x=()=>(G=_,o.charCodeAt(++l));for(;l0&&(se=o.slice(0,c),o=o.slice(c),f-=c),$&&p===!0&&f>0?($=o.slice(0,f),h=o.slice(f)):p===!0?($="",h=o):$=o,$&&$!==""&&$!=="/"&&$!==o&&gr($.charCodeAt($.length-1))&&($=$.slice(0,-1)),u.unescape===!0&&(h&&(h=Er.removeBackslashes(h)),$&&N===!0&&($=Er.removeBackslashes($)));const d={prefix:se,input:t,start:c,base:$,glob:h,isBrace:a,isBracket:E,isGlob:p,isExtglob:F,isGlobstar:A,negated:B,negatedExtglob:X};if(u.tokens===!0&&(d.maxDepth=0,gr(_)||i.push(b),d.tokens=i),u.parts===!0||u.tokens===!0){let W;for(let R=0;R{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();const u=`[${t.join("-")}]`;try{new RegExp(u)}catch{return t.map(s=>z.escapeRegex(s)).join("..")}return u},de=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Wt=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=_r[t]||t;const u={...e},r=typeof u.maxLength=="number"?Math.min(Qe,u.maxLength):Qe;let s=t.length;if(s>r)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${r}`);const n={type:"bos",value:"",output:u.prepend||""},i=[n],D=u.capture?"":"?:",o=z.isWindows(e),l=Xe.globChars(o),c=Xe.extglobChars(l),{DOT_LITERAL:f,PLUS_LITERAL:a,SLASH_LITERAL:E,ONE_CHAR:p,DOTS_SLASH:F,NO_DOT:A,NO_DOT_SLASH:S,NO_DOTS_SLASH:N,QMARK:B,QMARK_NO_DOT:X,STAR:M,START_ANCHOR:re}=l,G=m=>`(${D}(?:(?!${re}${m.dot?F:f}).)*?)`,_=u.dot?"":A,b=u.dot?B:X;let k=u.bash===!0?G(u):M;u.capture&&(k=`(${k})`),typeof u.noext=="boolean"&&(u.noextglob=u.noext);const C={input:t,index:-1,start:0,dot:u.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};t=z.removePrefix(t,C),s=t.length;const x=[],$=[],se=[];let h=n,d;const W=()=>C.index===s-1,R=C.peek=(m=1)=>t[C.index+m],Q=C.advance=()=>t[++C.index]||"",Z=()=>t.slice(C.index+1),K=(m="",T=0)=>{C.consumed+=m,C.index+=T},Ie=m=>{C.output+=m.output!=null?m.output:m.value,K(m.value)},Ss=()=>{let m=1;for(;R()==="!"&&(R(2)!=="("||R(3)==="?");)Q(),C.start++,m++;return m%2===0?!1:(C.negated=!0,C.start++,!0)},Pe=m=>{C[m]++,se.push(m)},ne=m=>{C[m]--,se.pop()},w=m=>{if(h.type==="globstar"){const T=C.braces>0&&(m.type==="comma"||m.type==="brace"),g=m.extglob===!0||x.length&&(m.type==="pipe"||m.type==="paren");m.type!=="slash"&&m.type!=="paren"&&!T&&!g&&(C.output=C.output.slice(0,-h.output.length),h.type="star",h.value="*",h.output=k,C.output+=h.output)}if(x.length&&m.type!=="paren"&&(x[x.length-1].inner+=m.value),(m.value||m.output)&&Ie(m),h&&h.type==="text"&&m.type==="text"){h.value+=m.value,h.output=(h.output||"")+m.value;return}m.prev=h,i.push(m),h=m},ke=(m,T)=>{const g={...c[T],conditions:1,inner:""};g.prev=h,g.parens=C.parens,g.output=C.output;const y=(u.capture?"(":"")+g.open;Pe("parens"),w({type:m,value:T,output:C.output?"":p}),w({type:"paren",extglob:!0,value:Q(),output:y}),x.push(g)},Bs=m=>{let T=m.close+(u.capture?")":""),g;if(m.type==="negate"){let y=k;if(m.inner&&m.inner.length>1&&m.inner.includes("/")&&(y=G(u)),(y!==k||W()||/^\)+$/.test(Z()))&&(T=m.close=`)$))${y}`),m.inner.includes("*")&&(g=Z())&&/^\.[^\\/.]+$/.test(g)){const O=Wt(g,{...e,fastpaths:!1}).output;T=m.close=`)${O})${y})`}m.prev.type==="bos"&&(C.negatedExtglob=!0)}w({type:"paren",extglob:!0,value:d,output:T}),ne("parens")};if(u.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let m=!1,T=t.replace(aD,(g,y,O,j,L,ft)=>j==="\\"?(m=!0,g):j==="?"?y?y+j+(L?B.repeat(L.length):""):ft===0?b+(L?B.repeat(L.length):""):B.repeat(O.length):j==="."?f.repeat(O.length):j==="*"?y?y+j+(L?k:""):k:y?g:`\\${g}`);return m===!0&&(u.unescape===!0?T=T.replace(/\\/g,""):T=T.replace(/\\+/g,g=>g.length%2===0?"\\\\":g?"\\":"")),T===t&&u.contains===!0?(C.output=t,C):(C.output=z.wrapOutput(T,C,e),C)}for(;!W();){if(d=Q(),d==="\0")continue;if(d==="\\"){const g=R();if(g==="/"&&u.bash!==!0||g==="."||g===";")continue;if(!g){d+="\\",w({type:"text",value:d});continue}const y=/^\\+/.exec(Z());let O=0;if(y&&y[0].length>2&&(O=y[0].length,C.index+=O,O%2!==0&&(d+="\\")),u.unescape===!0?d=Q():d+=Q(),C.brackets===0){w({type:"text",value:d});continue}}if(C.brackets>0&&(d!=="]"||h.value==="["||h.value==="[^")){if(u.posix!==!1&&d===":"){const g=h.value.slice(1);if(g.includes("[")&&(h.posix=!0,g.includes(":"))){const y=h.value.lastIndexOf("["),O=h.value.slice(0,y),j=h.value.slice(y+2),L=DD[j];if(L){h.value=O+L,C.backtrack=!0,Q(),!n.output&&i.indexOf(h)===1&&(n.output=p);continue}}}(d==="["&&R()!==":"||d==="-"&&R()==="]")&&(d=`\\${d}`),d==="]"&&(h.value==="["||h.value==="[^")&&(d=`\\${d}`),u.posix===!0&&d==="!"&&h.value==="["&&(d="^"),h.value+=d,Ie({value:d});continue}if(C.quotes===1&&d!=='"'){d=z.escapeRegex(d),h.value+=d,Ie({value:d});continue}if(d==='"'){C.quotes=C.quotes===1?0:1,u.keepQuotes===!0&&w({type:"text",value:d});continue}if(d==="("){Pe("parens"),w({type:"paren",value:d});continue}if(d===")"){if(C.parens===0&&u.strictBrackets===!0)throw new SyntaxError(de("opening","("));const g=x[x.length-1];if(g&&C.parens===g.parens+1){Bs(x.pop());continue}w({type:"paren",value:d,output:C.parens?")":"\\)"}),ne("parens");continue}if(d==="["){if(u.nobracket===!0||!Z().includes("]")){if(u.nobracket!==!0&&u.strictBrackets===!0)throw new SyntaxError(de("closing","]"));d=`\\${d}`}else Pe("brackets");w({type:"bracket",value:d});continue}if(d==="]"){if(u.nobracket===!0||h&&h.type==="bracket"&&h.value.length===1){w({type:"text",value:d,output:`\\${d}`});continue}if(C.brackets===0){if(u.strictBrackets===!0)throw new SyntaxError(de("opening","["));w({type:"text",value:d,output:`\\${d}`});continue}ne("brackets");const g=h.value.slice(1);if(h.posix!==!0&&g[0]==="^"&&!g.includes("/")&&(d=`/${d}`),h.value+=d,Ie({value:d}),u.literalBrackets===!1||z.hasRegexChars(g))continue;const y=z.escapeRegex(h.value);if(C.output=C.output.slice(0,-h.value.length),u.literalBrackets===!0){C.output+=y,h.value=y;continue}h.value=`(${D}${y}|${h.value})`,C.output+=h.value;continue}if(d==="{"&&u.nobrace!==!0){Pe("braces");const g={type:"brace",value:d,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};$.push(g),w(g);continue}if(d==="}"){const g=$[$.length-1];if(u.nobrace===!0||!g){w({type:"text",value:d,output:d});continue}let y=")";if(g.dots===!0){const O=i.slice(),j=[];for(let L=O.length-1;L>=0&&(i.pop(),O[L].type!=="brace");L--)O[L].type!=="dots"&&j.unshift(O[L].value);y=lD(j,u),C.backtrack=!0}if(g.comma!==!0&&g.dots!==!0){const O=C.output.slice(0,g.outputIndex),j=C.tokens.slice(g.tokensIndex);g.value=g.output="\\{",d=y="\\}",C.output=O;for(const L of j)C.output+=L.output||L.value}w({type:"brace",value:d,output:y}),ne("braces"),$.pop();continue}if(d==="|"){x.length>0&&x[x.length-1].conditions++,w({type:"text",value:d});continue}if(d===","){let g=d;const y=$[$.length-1];y&&se[se.length-1]==="braces"&&(y.comma=!0,g="|"),w({type:"comma",value:d,output:g});continue}if(d==="/"){if(h.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output="",i.pop(),h=n;continue}w({type:"slash",value:d,output:E});continue}if(d==="."){if(C.braces>0&&h.type==="dot"){h.value==="."&&(h.output=f);const g=$[$.length-1];h.type="dots",h.output+=d,h.value+=d,g.dots=!0;continue}if(C.braces+C.parens===0&&h.type!=="bos"&&h.type!=="slash"){w({type:"text",value:d,output:f});continue}w({type:"dot",value:d,output:f});continue}if(d==="?"){if(!(h&&h.value==="(")&&u.noextglob!==!0&&R()==="("&&R(2)!=="?"){ke("qmark",d);continue}if(h&&h.type==="paren"){const y=R();let O=d;if(y==="<"&&!z.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(h.value==="("&&!/[!=<:]/.test(y)||y==="<"&&!/<([!=]|\w+>)/.test(Z()))&&(O=`\\${d}`),w({type:"text",value:d,output:O});continue}if(u.dot!==!0&&(h.type==="slash"||h.type==="bos")){w({type:"qmark",value:d,output:X});continue}w({type:"qmark",value:d,output:B});continue}if(d==="!"){if(u.noextglob!==!0&&R()==="("&&(R(2)!=="?"||!/[!=<:]/.test(R(3)))){ke("negate",d);continue}if(u.nonegate!==!0&&C.index===0){Ss();continue}}if(d==="+"){if(u.noextglob!==!0&&R()==="("&&R(2)!=="?"){ke("plus",d);continue}if(h&&h.value==="("||u.regex===!1){w({type:"plus",value:d,output:a});continue}if(h&&(h.type==="bracket"||h.type==="paren"||h.type==="brace")||C.parens>0){w({type:"plus",value:d});continue}w({type:"plus",value:a});continue}if(d==="@"){if(u.noextglob!==!0&&R()==="("&&R(2)!=="?"){w({type:"at",extglob:!0,value:d,output:""});continue}w({type:"text",value:d});continue}if(d!=="*"){(d==="$"||d==="^")&&(d=`\\${d}`);const g=oD.exec(Z());g&&(d+=g[0],C.index+=g[0].length),w({type:"text",value:d});continue}if(h&&(h.type==="globstar"||h.star===!0)){h.type="star",h.star=!0,h.value+=d,h.output=k,C.backtrack=!0,C.globstar=!0,K(d);continue}let m=Z();if(u.noextglob!==!0&&/^\([^?]/.test(m)){ke("star",d);continue}if(h.type==="star"){if(u.noglobstar===!0){K(d);continue}const g=h.prev,y=g.prev,O=g.type==="slash"||g.type==="bos",j=y&&(y.type==="star"||y.type==="globstar");if(u.bash===!0&&(!O||m[0]&&m[0]!=="/")){w({type:"star",value:d,output:""});continue}const L=C.braces>0&&(g.type==="comma"||g.type==="brace"),ft=x.length&&(g.type==="pipe"||g.type==="paren");if(!O&&g.type!=="paren"&&!L&&!ft){w({type:"star",value:d,output:""});continue}for(;m.slice(0,3)==="/**";){const Me=t[C.index+4];if(Me&&Me!=="/")break;m=m.slice(3),K("/**",3)}if(g.type==="bos"&&W()){h.type="globstar",h.value+=d,h.output=G(u),C.output=h.output,C.globstar=!0,K(d);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&!j&&W()){C.output=C.output.slice(0,-(g.output+h.output).length),g.output=`(?:${g.output}`,h.type="globstar",h.output=G(u)+(u.strictSlashes?")":"|$)"),h.value+=d,C.globstar=!0,C.output+=g.output+h.output,K(d);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&m[0]==="/"){const Me=m[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(g.output+h.output).length),g.output=`(?:${g.output}`,h.type="globstar",h.output=`${G(u)}${E}|${E}${Me})`,h.value+=d,C.output+=g.output+h.output,C.globstar=!0,K(d+Q()),w({type:"slash",value:"/",output:""});continue}if(g.type==="bos"&&m[0]==="/"){h.type="globstar",h.value+=d,h.output=`(?:^|${E}|${G(u)}${E})`,C.output=h.output,C.globstar=!0,K(d+Q()),w({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-h.output.length),h.type="globstar",h.output=G(u),h.value+=d,C.output+=h.output,C.globstar=!0,K(d);continue}const T={type:"star",value:d,output:k};if(u.bash===!0){T.output=".*?",(h.type==="bos"||h.type==="slash")&&(T.output=_+T.output),w(T);continue}if(h&&(h.type==="bracket"||h.type==="paren")&&u.regex===!0){T.output=d,w(T);continue}(C.index===C.start||h.type==="slash"||h.type==="dot")&&(h.type==="dot"?(C.output+=S,h.output+=S):u.dot===!0?(C.output+=N,h.output+=N):(C.output+=_,h.output+=_),R()!=="*"&&(C.output+=p,h.output+=p)),w(T)}for(;C.brackets>0;){if(u.strictBrackets===!0)throw new SyntaxError(de("closing","]"));C.output=z.escapeLast(C.output,"["),ne("brackets")}for(;C.parens>0;){if(u.strictBrackets===!0)throw new SyntaxError(de("closing",")"));C.output=z.escapeLast(C.output,"("),ne("parens")}for(;C.braces>0;){if(u.strictBrackets===!0)throw new SyntaxError(de("closing","}"));C.output=z.escapeLast(C.output,"{"),ne("braces")}if(u.strictSlashes!==!0&&(h.type==="star"||h.type==="bracket")&&w({type:"maybe_slash",value:"",output:`${E}?`}),C.backtrack===!0){C.output="";for(const m of C.tokens)C.output+=m.output!=null?m.output:m.value,m.suffix&&(C.output+=m.suffix)}return C};Wt.fastpaths=(t,e)=>{const u={...e},r=typeof u.maxLength=="number"?Math.min(Qe,u.maxLength):Qe,s=t.length;if(s>r)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${r}`);t=_r[t]||t;const n=z.isWindows(e),{DOT_LITERAL:i,SLASH_LITERAL:D,ONE_CHAR:o,DOTS_SLASH:l,NO_DOT:c,NO_DOTS:f,NO_DOTS_SLASH:a,STAR:E,START_ANCHOR:p}=Xe.globChars(n),F=u.dot?f:c,A=u.dot?a:c,S=u.capture?"":"?:",N={negated:!1,prefix:""};let B=u.bash===!0?".*?":E;u.capture&&(B=`(${B})`);const X=_=>_.noglobstar===!0?B:`(${S}(?:(?!${p}${_.dot?l:i}).)*?)`,M=_=>{switch(_){case"*":return`${F}${o}${B}`;case".*":return`${i}${o}${B}`;case"*.*":return`${F}${B}${i}${o}${B}`;case"*/*":return`${F}${B}${D}${o}${A}${B}`;case"**":return F+X(u);case"**/*":return`(?:${F}${X(u)}${D})?${A}${o}${B}`;case"**/*.*":return`(?:${F}${X(u)}${D})?${A}${B}${i}${o}${B}`;case"**/.*":return`(?:${F}${X(u)}${D})?${i}${o}${B}`;default:{const b=/^(.*?)\.(\w+)$/.exec(_);if(!b)return;const k=M(b[1]);return k?k+i+b[2]:void 0}}},re=z.removePrefix(t,N);let G=M(re);return G&&u.strictSlashes!==!0&&(G+=`${D}?`),G};var cD=Wt;const fD=V,hD=iD,jt=cD,Ut=ze,dD=qe,ED=t=>t&&typeof t=="object"&&!Array.isArray(t),H=(t,e,u=!1)=>{if(Array.isArray(t)){const c=t.map(a=>H(a,e,u));return a=>{for(const E of c){const p=E(a);if(p)return p}return!1}}const r=ED(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");const s=e||{},n=Ut.isWindows(e),i=r?H.compileRe(t,e):H.makeRe(t,e,!1,!0),D=i.state;delete i.state;let o=()=>!1;if(s.ignore){const c={...e,ignore:null,onMatch:null,onResult:null};o=H(s.ignore,c,u)}const l=(c,f=!1)=>{const{isMatch:a,match:E,output:p}=H.test(c,i,e,{glob:t,posix:n}),F={glob:t,state:D,regex:i,posix:n,input:c,output:p,match:E,isMatch:a};return typeof s.onResult=="function"&&s.onResult(F),a===!1?(F.isMatch=!1,f?F:!1):o(c)?(typeof s.onIgnore=="function"&&s.onIgnore(F),F.isMatch=!1,f?F:!1):(typeof s.onMatch=="function"&&s.onMatch(F),f?F:!0)};return u&&(l.state=D),l};H.test=(t,e,u,{glob:r,posix:s}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};const n=u||{},i=n.format||(s?Ut.toPosixSlashes:null);let D=t===r,o=D&&i?i(t):t;return D===!1&&(o=i?i(t):t,D=o===r),(D===!1||n.capture===!0)&&(n.matchBase===!0||n.basename===!0?D=H.matchBase(t,e,u,s):D=e.exec(o)),{isMatch:!!D,match:D,output:o}},H.matchBase=(t,e,u,r=Ut.isWindows(u))=>(e instanceof RegExp?e:H.makeRe(e,u)).test(fD.basename(t)),H.isMatch=(t,e,u)=>H(e,u)(t),H.parse=(t,e)=>Array.isArray(t)?t.map(u=>H.parse(u,e)):jt(t,{...e,fastpaths:!1}),H.scan=(t,e)=>hD(t,e),H.compileRe=(t,e,u=!1,r=!1)=>{if(u===!0)return t.output;const s=e||{},n=s.contains?"":"^",i=s.contains?"":"$";let D=`${n}(?:${t.output})${i}`;t&&t.negated===!0&&(D=`^(?!${D}).*$`);const o=H.toRegex(D,e);return r===!0&&(o.state=t),o},H.makeRe=(t,e={},u=!1,r=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(s.output=jt.fastpaths(t,e)),s.output||(s=jt(t,e)),H.compileRe(s,e,u,r)},H.toRegex=(t,e)=>{try{const u=e||{};return new RegExp(t,u.flags||(u.nocase?"i":""))}catch(u){if(e&&e.debug===!0)throw u;return/$^/}},H.constants=dD;var pD=H,Ar=pD;const we=ie,{Readable:CD}=Ls,Re=V,{promisify:Ze}=me,Kt=Ar,FD=Ze(we.readdir),gD=Ze(we.stat),yr=Ze(we.lstat),mD=Ze(we.realpath),_D="!",wr="READDIRP_RECURSIVE_ERROR",AD=new Set(["ENOENT","EPERM","EACCES","ELOOP",wr]),Vt="files",Rr="directories",Je="files_directories",et="all",br=[Vt,Rr,Je,et],yD=t=>AD.has(t.code),[vr,wD]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),RD=process.platform==="win32"&&(vr>10||vr===10&&wD>=5),Sr=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){const e=Kt(t.trim());return u=>e(u.basename)}if(Array.isArray(t)){const e=[],u=[];for(const r of t){const s=r.trim();s.charAt(0)===_D?u.push(Kt(s.slice(1))):e.push(Kt(s))}return u.length>0?e.length>0?r=>e.some(s=>s(r.basename))&&!u.some(s=>s(r.basename)):r=>!u.some(s=>s(r.basename)):r=>e.some(s=>s(r.basename))}}};class ct extends CD{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Vt,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});const u={...ct.defaultOptions,...e},{root:r,type:s}=u;this._fileFilter=Sr(u.fileFilter),this._directoryFilter=Sr(u.directoryFilter);const n=u.lstat?yr:gD;RD?this._stat=i=>n(i,{bigint:!0}):this._stat=n,this._maxDepth=u.depth,this._wantsDir=[Rr,Je,et].includes(s),this._wantsFile=[Vt,Je,et].includes(s),this._wantsEverything=s===et,this._root=Re.resolve(r),this._isDirent="Dirent"in we&&!u.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(r,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){const{path:u,depth:r,files:s=[]}=this.parent||{};if(s.length>0){const n=s.splice(0,e).map(i=>this._formatEntry(i,u));for(const i of await Promise.all(n)){if(this.destroyed)return;const D=await this._getEntryType(i);D==="directory"&&this._directoryFilter(i)?(r<=this._maxDepth&&this.parents.push(this._exploreDir(i.fullPath,r+1)),this._wantsDir&&(this.push(i),e--)):(D==="file"||this._includeAsFile(i))&&this._fileFilter(i)&&this._wantsFile&&(this.push(i),e--)}}else{const n=this.parents.pop();if(!n){this.push(null);break}if(this.parent=await n,this.destroyed)return}}}catch(u){this.destroy(u)}finally{this.reading=!1}}}async _exploreDir(e,u){let r;try{r=await FD(e,this._rdOptions)}catch(s){this._onError(s)}return{files:r,depth:u,path:e}}async _formatEntry(e,u){let r;try{const s=this._isDirent?e.name:e,n=Re.resolve(Re.join(u,s));r={path:Re.relative(this._root,n),fullPath:n,basename:s},r[this._statsProp]=this._isDirent?e:await this._stat(n)}catch(s){this._onError(s)}return r}_onError(e){yD(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){const u=e&&e[this._statsProp];if(u){if(u.isFile())return"file";if(u.isDirectory())return"directory";if(u&&u.isSymbolicLink()){const r=e.fullPath;try{const s=await mD(r),n=await yr(s);if(n.isFile())return"file";if(n.isDirectory()){const i=s.length;if(r.startsWith(s)&&r.substr(i,1)===Re.sep){const D=new Error(`Circular symlink detected: "${r}" points to "${s}"`);return D.code=wr,this._onError(D)}return"directory"}}catch(s){this._onError(s)}}}}_includeAsFile(e){const u=e&&e[this._statsProp];return u&&this._wantsEverything&&!u.isDirectory()}}const Ee=(t,e={})=>{let u=e.entryType||e.type;if(u==="both"&&(u=Je),u&&(e.type=u),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(u&&!br.includes(u))throw new Error(`readdirp: Invalid type passed. Use one of ${br.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new ct(e)},bD=(t,e={})=>new Promise((u,r)=>{const s=[];Ee(t,e).on("data",n=>s.push(n)).on("end",()=>u(s)).on("error",n=>r(n))});Ee.promise=bD,Ee.ReaddirpStream=ct,Ee.default=Ee;var vD=Ee,zt={exports:{}};/*! * normalize-path * * Copyright (c) 2014-2018, Jon Schlinkert. * Released under the MIT License. */var Br=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return"/";var u=t.length;if(u<=1)return t;var r="";if(u>4&&t[3]==="\\"){var s=t[2];(s==="?"||s===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),r="//")}var n=t.split(/[/\\]+/);return e!==!1&&n[n.length-1]===""&&n.pop(),r+n.join("/")},SD=zt.exports;Object.defineProperty(SD,"__esModule",{value:!0});const $r=Ar,BD=Br,Tr="!",$D={returnIndex:!1},TD=t=>Array.isArray(t)?t:[t],xD=(t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){const u=$r(t,e);return r=>t===r||u(r)}return t instanceof RegExp?u=>t.test(u):u=>!1},xr=(t,e,u,r)=>{const s=Array.isArray(u),n=s?u[0]:u;if(!s&&typeof n!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(n));const i=BD(n,!1);for(let o=0;o{if(t==null)throw new TypeError("anymatch: specify first argument");const r=typeof u=="boolean"?{returnIndex:u}:u,s=r.returnIndex||!1,n=TD(t),i=n.filter(o=>typeof o=="string"&&o.charAt(0)===Tr).map(o=>o.slice(1)).map(o=>$r(o,r)),D=n.filter(o=>typeof o!="string"||typeof o=="string"&&o.charAt(0)!==Tr).map(o=>xD(o,r));return e==null?(o,l=!1)=>xr(D,i,o,typeof l=="boolean"?l:!1):xr(D,i,e,s)};Yt.default=Yt,zt.exports=Yt;var OD=zt.exports;/*! * is-extglob * * Copyright (c) 2014-2016, Jon Schlinkert. * Licensed under the MIT License. */var ND=function(e){if(typeof e!="string"||e==="")return!1;for(var u;u=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(u[2])return!0;e=e.slice(u.index+u[0].length)}return!1};/*! * is-glob * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */var HD=ND,Or={"{":"}","(":")","[":"]"},LD=function(t){if(t[0]==="!")return!0;for(var e=0,u=-2,r=-2,s=-2,n=-2,i=-2;ee&&(i===-1||i>r||(i=t.indexOf("\\",e),i===-1||i>r)))||s!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(s=t.indexOf("}",e),s>e&&(i=t.indexOf("\\",e),i===-1||i>s))||n!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(n=t.indexOf(")",e),n>e&&(i=t.indexOf("\\",e),i===-1||i>n))||u!==-1&&t[e]==="("&&t[e+1]!=="|"&&(uu&&(i=t.indexOf("\\",u),i===-1||i>n))))return!0;if(t[e]==="\\"){var D=t[e+1];e+=2;var o=Or[D];if(o){var l=t.indexOf(o,e);l!==-1&&(e=l+1)}if(t[e]==="!")return!0}else e++}return!1},ID=function(t){if(t[0]==="!")return!0;for(var e=0;etypeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1,t.find=(e,u)=>e.nodes.find(r=>r.type===u),t.exceedsLimit=(e,u,r=1,s)=>s===!1||!t.isInteger(e)||!t.isInteger(u)?!1:(Number(u)-Number(e))/Number(r)>=s,t.escapeNode=(e,u=0,r)=>{let s=e.nodes[u];s&&(r&&s.type===r||s.type==="open"||s.type==="close")&&s.escaped!==!0&&(s.value="\\"+s.value,s.escaped=!0)},t.encloseBrace=e=>e.type!=="brace"||e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0),t.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1,t.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0,t.reduce=e=>e.reduce((u,r)=>(r.type==="text"&&u.push(r.value),r.type==="range"&&(r.type="text"),u),[]),t.flatten=(...e)=>{const u=[],r=s=>{for(let n=0;n{let u=(r,s={})=>{let n=e.escapeInvalid&&Hr.isInvalidBrace(s),i=r.invalid===!0&&e.escapeInvalid===!0,D="";if(r.value)return(n||i)&&Hr.isOpenOrClose(r)?"\\"+r.value:r.value;if(r.value)return r.value;if(r.nodes)for(let o of r.nodes)D+=u(o);return D};return u(t)};/*! * is-number * * Copyright (c) 2014-present, Jon Schlinkert. * Released under the MIT License. */var VD=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1};/*! * to-regex-range * * Copyright (c) 2015-present, Jon Schlinkert. * Released under the MIT License. */const Lr=VD,oe=(t,e,u)=>{if(Lr(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(Lr(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...u};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let s=String(r.relaxZeros),n=String(r.shorthand),i=String(r.capture),D=String(r.wrap),o=t+":"+e+"="+s+n+i+D;if(oe.cache.hasOwnProperty(o))return oe.cache[o].result;let l=Math.min(t,e),c=Math.max(t,e);if(Math.abs(l-c)===1){let F=t+"|"+e;return r.capture?`(${F})`:r.wrap===!1?F:`(?:${F})`}let f=Wr(t)||Wr(e),a={min:t,max:e,a:l,b:c},E=[],p=[];if(f&&(a.isPadded=f,a.maxLen=String(a.max).length),l<0){let F=c<0?Math.abs(c):1;p=Ir(F,Math.abs(l),a,r),l=a.a=0}return c>=0&&(E=Ir(l,c,a,r)),a.negatives=p,a.positives=E,a.result=zD(p,E),r.capture===!0?a.result=`(${a.result})`:r.wrap!==!1&&E.length+p.length>1&&(a.result=`(?:${a.result})`),oe.cache[o]=a,a.result};function zD(t,e,u){let r=Qt(t,e,"-",!1)||[],s=Qt(e,t,"",!1)||[],n=Qt(t,e,"-?",!0)||[];return r.concat(n).concat(s).join("|")}function YD(t,e){let u=1,r=1,s=kr(t,u),n=new Set([e]);for(;t<=s&&s<=e;)n.add(s),u+=1,s=kr(t,u);for(s=Mr(e+1,r)-1;t1&&D.count.pop(),D.count.push(c.count[0]),D.string=D.pattern+Gr(D.count),i=l+1;continue}u.isPadded&&(f=JD(l,u,r)),c.string=f+c.pattern+Gr(c.count),n.push(c),i=l+1,D=c}return n}function Qt(t,e,u,r,s){let n=[];for(let i of t){let{string:D}=i;!r&&!Pr(e,"string",D)&&n.push(u+D),r&&Pr(e,"string",D)&&n.push(u+D)}return n}function XD(t,e){let u=[];for(let r=0;re?1:e>t?-1:0}function Pr(t,e,u){return t.some(r=>r[e]===u)}function kr(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function Mr(t,e){return t-t%Math.pow(10,e)}function Gr(t){let[e=0,u=""]=t;return u||e>1?`{${e+(u?","+u:"")}}`:""}function ZD(t,e,u){return`[${t}${e-t===1?"":"-"}${e}]`}function Wr(t){return/^-?(0+)\d/.test(t)}function JD(t,e,u){if(!e.isPadded)return t;let r=Math.abs(e.maxLen-String(t).length),s=u.relaxZeros!==!1;switch(r){case 0:return"";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${r}}`:`0{${r}}`}}oe.cache={},oe.clearCache=()=>oe.cache={};var eo=oe;/*! * fill-range * * Copyright (c) 2014-present, Jon Schlinkert. * Licensed under the MIT License. */const to=me,jr=eo,Ur=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),uo=t=>e=>t===!0?Number(e):String(e),Zt=t=>typeof t=="number"||typeof t=="string"&&t!=="",be=t=>Number.isInteger(+t),Jt=t=>{let e=`${t}`,u=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++u]==="0";);return u>0},ro=(t,e,u)=>typeof t=="string"||typeof e=="string"?!0:u.stringify===!0,so=(t,e,u)=>{if(e>0){let r=t[0]==="-"?"-":"";r&&(t=t.slice(1)),t=r+t.padStart(r?e-1:e,"0")}return u===!1?String(t):t},Kr=(t,e)=>{let u=t[0]==="-"?"-":"";for(u&&(t=t.slice(1),e--);t.length{t.negatives.sort((i,D)=>iD?1:0),t.positives.sort((i,D)=>iD?1:0);let u=e.capture?"":"?:",r="",s="",n;return t.positives.length&&(r=t.positives.join("|")),t.negatives.length&&(s=`-(${u}${t.negatives.join("|")})`),r&&s?n=`${r}|${s}`:n=r||s,e.wrap?`(${u}${n})`:n},Vr=(t,e,u,r)=>{if(u)return jr(t,e,{wrap:!1,...r});let s=String.fromCharCode(t);if(t===e)return s;let n=String.fromCharCode(e);return`[${s}-${n}]`},zr=(t,e,u)=>{if(Array.isArray(t)){let r=u.wrap===!0,s=u.capture?"":"?:";return r?`(${s}${t.join("|")})`:t.join("|")}return jr(t,e,u)},Yr=(...t)=>new RangeError("Invalid range arguments: "+to.inspect(...t)),qr=(t,e,u)=>{if(u.strictRanges===!0)throw Yr([t,e]);return[]},io=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},Do=(t,e,u=1,r={})=>{let s=Number(t),n=Number(e);if(!Number.isInteger(s)||!Number.isInteger(n)){if(r.strictRanges===!0)throw Yr([t,e]);return[]}s===0&&(s=0),n===0&&(n=0);let i=s>n,D=String(t),o=String(e),l=String(u);u=Math.max(Math.abs(u),1);let c=Jt(D)||Jt(o)||Jt(l),f=c?Math.max(D.length,o.length,l.length):0,a=c===!1&&ro(t,e,r)===!1,E=r.transform||uo(a);if(r.toRegex&&u===1)return Vr(Kr(t,f),Kr(e,f),!0,r);let p={negatives:[],positives:[]},F=N=>p[N<0?"negatives":"positives"].push(Math.abs(N)),A=[],S=0;for(;i?s>=n:s<=n;)r.toRegex===!0&&u>1?F(s):A.push(so(E(s,S),f,a)),s=i?s-u:s+u,S++;return r.toRegex===!0?u>1?no(p,r):zr(A,null,{wrap:!1,...r}):A},oo=(t,e,u=1,r={})=>{if(!be(t)&&t.length>1||!be(e)&&e.length>1)return qr(t,e,r);let s=r.transform||(a=>String.fromCharCode(a)),n=`${t}`.charCodeAt(0),i=`${e}`.charCodeAt(0),D=n>i,o=Math.min(n,i),l=Math.max(n,i);if(r.toRegex&&u===1)return Vr(o,l,!1,r);let c=[],f=0;for(;D?n>=i:n<=i;)c.push(s(n,f)),n=D?n-u:n+u,f++;return r.toRegex===!0?zr(c,null,{wrap:!1,options:r}):c},ut=(t,e,u,r={})=>{if(e==null&&Zt(t))return[t];if(!Zt(t)||!Zt(e))return qr(t,e,r);if(typeof u=="function")return ut(t,e,1,{transform:u});if(Ur(u))return ut(t,e,0,u);let s={...r};return s.capture===!0&&(s.wrap=!0),u=u||s.step||1,be(u)?be(t)&&be(e)?Do(t,e,u,s):oo(t,e,Math.max(Math.abs(u),1),s):u!=null&&!Ur(u)?io(u,s):ut(t,e,1,u)};var Xr=ut;const ao=Xr,Qr=tt,lo=(t,e={})=>{let u=(r,s={})=>{let n=Qr.isInvalidBrace(s),i=r.invalid===!0&&e.escapeInvalid===!0,D=n===!0||i===!0,o=e.escapeInvalid===!0?"\\":"",l="";if(r.isOpen===!0||r.isClose===!0)return o+r.value;if(r.type==="open")return D?o+r.value:"(";if(r.type==="close")return D?o+r.value:")";if(r.type==="comma")return r.prev.type==="comma"?"":D?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){let c=Qr.reduce(r.nodes),f=ao(...c,{...e,wrap:!1,toRegex:!0});if(f.length!==0)return c.length>1&&f.length>1?`(${f})`:f}if(r.nodes)for(let c of r.nodes)l+=u(c,r);return l};return u(t)};var co=lo;const fo=Xr,Zr=Xt,pe=tt,ae=(t="",e="",u=!1)=>{let r=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return u?pe.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let n of s)r.push(ae(n,e,u));else for(let n of e)u===!0&&typeof n=="string"&&(n=`{${n}}`),r.push(Array.isArray(n)?ae(s,n,u):s+n);return pe.flatten(r)},ho=(t,e={})=>{let u=e.rangeLimit===void 0?1e3:e.rangeLimit,r=(s,n={})=>{s.queue=[];let i=n,D=n.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,D=i.queue;if(s.invalid||s.dollar){D.push(ae(D.pop(),Zr(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){D.push(ae(D.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let f=pe.reduce(s.nodes);if(pe.exceedsLimit(...f,e.step,u))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let a=fo(...f,e);a.length===0&&(a=Zr(s,e)),D.push(ae(D.pop(),a)),s.nodes=[];return}let o=pe.encloseBrace(s),l=s.queue,c=s;for(;c.type!=="brace"&&c.type!=="root"&&c.parent;)c=c.parent,l=c.queue;for(let f=0;f",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};const Co=Xt,{MAX_LENGTH:Jr,CHAR_BACKSLASH:eu,CHAR_BACKTICK:Fo,CHAR_COMMA:go,CHAR_DOT:mo,CHAR_LEFT_PARENTHESES:_o,CHAR_RIGHT_PARENTHESES:Ao,CHAR_LEFT_CURLY_BRACE:yo,CHAR_RIGHT_CURLY_BRACE:wo,CHAR_LEFT_SQUARE_BRACKET:es,CHAR_RIGHT_SQUARE_BRACKET:ts,CHAR_DOUBLE_QUOTE:Ro,CHAR_SINGLE_QUOTE:bo,CHAR_NO_BREAK_SPACE:vo,CHAR_ZERO_WIDTH_NOBREAK_SPACE:So}=po,Bo=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let u=e||{},r=typeof u.maxLength=="number"?Math.min(Jr,u.maxLength):Jr;if(t.length>r)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${r})`);let s={type:"root",input:t,nodes:[]},n=[s],i=s,D=s,o=0,l=t.length,c=0,f=0,a;const E=()=>t[c++],p=F=>{if(F.type==="text"&&D.type==="dot"&&(D.type="text"),D&&D.type==="text"&&F.type==="text"){D.value+=F.value;return}return i.nodes.push(F),F.parent=i,F.prev=D,D=F,F};for(p({type:"bos"});c0){if(i.ranges>0){i.ranges=0;let F=i.nodes.shift();i.nodes=[F,{type:"text",value:Co(i)}]}p({type:"comma",value:a}),i.commas++;continue}if(a===mo&&f>0&&i.commas===0){let F=i.nodes;if(f===0||F.length===0){p({type:"text",value:a});continue}if(D.type==="dot"){if(i.range=[],D.value+=a,D.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,D.type="text";continue}i.ranges++,i.args=[];continue}if(D.type==="range"){F.pop();let A=F[F.length-1];A.value+=D.value+a,D=A,i.ranges--;continue}p({type:"dot",value:a});continue}p({type:"text",value:a})}do if(i=n.pop(),i.type!=="root"){i.nodes.forEach(S=>{S.nodes||(S.type==="open"&&(S.isOpen=!0),S.type==="close"&&(S.isClose=!0),S.nodes||(S.type="text"),S.invalid=!0)});let F=n[n.length-1],A=F.nodes.indexOf(i);F.nodes.splice(A,1,...i.nodes)}while(n.length>0);return p({type:"eos"}),s};var $o=Bo;const us=Xt,To=co,xo=Eo,Oo=$o,Y=(t,e={})=>{let u=[];if(Array.isArray(t))for(let r of t){let s=Y.create(r,e);Array.isArray(s)?u.push(...s):u.push(s)}else u=[].concat(Y.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(u=[...new Set(u)]),u};Y.parse=(t,e={})=>Oo(t,e),Y.stringify=(t,e={})=>us(typeof t=="string"?Y.parse(t,e):t,e),Y.compile=(t,e={})=>(typeof t=="string"&&(t=Y.parse(t,e)),To(t,e)),Y.expand=(t,e={})=>{typeof t=="string"&&(t=Y.parse(t,e));let u=xo(t,e);return e.noempty===!0&&(u=u.filter(Boolean)),e.nodupes===!0&&(u=[...new Set(u)]),u},Y.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Y.compile(t,e):Y.expand(t,e);var No=Y,Ho=["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","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"],Lo=Ho;const Io=V,Po=Lo,ko=new Set(Po);var Mo=t=>ko.has(Io.extname(t).slice(1).toLowerCase()),rt={};(function(t){const{sep:e}=V,{platform:u}=process,r=Ru;t.EV_ALL="all",t.EV_READY="ready",t.EV_ADD="add",t.EV_CHANGE="change",t.EV_ADD_DIR="addDir",t.EV_UNLINK="unlink",t.EV_UNLINK_DIR="unlinkDir",t.EV_RAW="raw",t.EV_ERROR="error",t.STR_DATA="data",t.STR_END="end",t.STR_CLOSE="close",t.FSEVENT_CREATED="created",t.FSEVENT_MODIFIED="modified",t.FSEVENT_DELETED="deleted",t.FSEVENT_MOVED="moved",t.FSEVENT_CLONED="cloned",t.FSEVENT_UNKNOWN="unknown",t.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1,t.FSEVENT_TYPE_FILE="file",t.FSEVENT_TYPE_DIRECTORY="directory",t.FSEVENT_TYPE_SYMLINK="symlink",t.KEY_LISTENERS="listeners",t.KEY_ERR="errHandlers",t.KEY_RAW="rawEmitters",t.HANDLER_KEYS=[t.KEY_LISTENERS,t.KEY_ERR,t.KEY_RAW],t.DOT_SLASH=`.${e}`,t.BACK_SLASH_RE=/\\/g,t.DOUBLE_SLASH_RE=/\/\//,t.SLASH_OR_BACK_SLASH_RE=/[/\\]/,t.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,t.REPLACER_RE=/^\.[/\\]/,t.SLASH="/",t.SLASH_SLASH="//",t.BRACE_START="{",t.BANG="!",t.ONE_DOT=".",t.TWO_DOTS="..",t.STAR="*",t.GLOBSTAR="**",t.ROOT_GLOBSTAR="/**/*",t.SLASH_GLOBSTAR="/**",t.DIR_SUFFIX="Dir",t.ANYMATCH_OPTS={dot:!0},t.STRING_TYPE="string",t.FUNCTION_TYPE="function",t.EMPTY_STR="",t.EMPTY_FN=()=>{},t.IDENTITY_FN=s=>s,t.isWindows=u==="win32",t.isMacos=u==="darwin",t.isLinux=u==="linux",t.isIBMi=r.type()==="OS400"})(rt);const ue=ie,I=V,{promisify:ve}=me,Go=Mo,{isWindows:Wo,isLinux:jo,EMPTY_FN:Uo,EMPTY_STR:Ko,KEY_LISTENERS:Ce,KEY_ERR:tu,KEY_RAW:Se,HANDLER_KEYS:Vo,EV_CHANGE:st,EV_ADD:nt,EV_ADD_DIR:zo,EV_ERROR:rs,STR_DATA:Yo,STR_END:qo,BRACE_START:Xo,STAR:Qo}=rt,Zo="watch",Jo=ve(ue.open),ss=ve(ue.stat),ea=ve(ue.lstat),ta=ve(ue.close),uu=ve(ue.realpath),ua={lstat:ea,stat:ss},ru=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},Be=(t,e,u)=>{let r=t[e];r instanceof Set||(t[e]=r=new Set([r])),r.add(u)},ra=t=>e=>{const u=t[e];u instanceof Set?u.clear():delete t[e]},$e=(t,e,u)=>{const r=t[e];r instanceof Set?r.delete(u):r===u&&delete t[e]},ns=t=>t instanceof Set?t.size===0:!t,it=new Map;function is(t,e,u,r,s){const n=(i,D)=>{u(t),s(i,D,{watchedPath:t}),D&&t!==D&&Dt(I.resolve(t,D),Ce,I.join(t,D))};try{return ue.watch(t,e,n)}catch(i){r(i)}}const Dt=(t,e,u,r,s)=>{const n=it.get(t);n&&ru(n[e],i=>{i(u,r,s)})},sa=(t,e,u,r)=>{const{listener:s,errHandler:n,rawEmitter:i}=r;let D=it.get(e),o;if(!u.persistent)return o=is(t,u,s,n,i),o.close.bind(o);if(D)Be(D,Ce,s),Be(D,tu,n),Be(D,Se,i);else{if(o=is(t,u,Dt.bind(null,e,Ce),n,Dt.bind(null,e,Se)),!o)return;o.on(rs,async l=>{const c=Dt.bind(null,e,tu);if(D.watcherUnusable=!0,Wo&&l.code==="EPERM")try{const f=await Jo(t,"r");await ta(f),c(l)}catch{}else c(l)}),D={listeners:s,errHandlers:n,rawEmitters:i,watcher:o},it.set(e,D)}return()=>{$e(D,Ce,s),$e(D,tu,n),$e(D,Se,i),ns(D.listeners)&&(D.watcher.close(),it.delete(e),Vo.forEach(ra(D)),D.watcher=void 0,Object.freeze(D))}},su=new Map,na=(t,e,u,r)=>{const{listener:s,rawEmitter:n}=r;let i=su.get(e);const D=i&&i.options;return D&&(D.persistentu.interval)&&(i.listeners,i.rawEmitters,ue.unwatchFile(e),i=void 0),i?(Be(i,Ce,s),Be(i,Se,n)):(i={listeners:s,rawEmitters:n,options:u,watcher:ue.watchFile(e,u,(o,l)=>{ru(i.rawEmitters,f=>{f(st,e,{curr:o,prev:l})});const c=o.mtimeMs;(o.size!==l.size||c>l.mtimeMs||c===0)&&ru(i.listeners,f=>f(t,o))})},su.set(e,i)),()=>{$e(i,Ce,s),$e(i,Se,n),ns(i.listeners)&&(su.delete(e),ue.unwatchFile(e),i.options=i.watcher=void 0,Object.freeze(i))}};let ia=class{constructor(e){this.fsw=e,this._boundHandleError=u=>e._handleError(u)}_watchWithNodeFs(e,u){const r=this.fsw.options,s=I.dirname(e),n=I.basename(e);this.fsw._getWatchedDir(s).add(n);const D=I.resolve(e),o={persistent:r.persistent};u||(u=Uo);let l;return r.usePolling?(o.interval=r.enableBinaryInterval&&Go(n)?r.binaryInterval:r.interval,l=na(e,D,o,{listener:u,rawEmitter:this.fsw._emitRaw})):l=sa(e,D,o,{listener:u,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),l}_handleFile(e,u,r){if(this.fsw.closed)return;const s=I.dirname(e),n=I.basename(e),i=this.fsw._getWatchedDir(s);let D=u;if(i.has(n))return;const o=async(c,f)=>{if(this.fsw._throttle(Zo,e,5)){if(!f||f.mtimeMs===0)try{const a=await ss(e);if(this.fsw.closed)return;const E=a.atimeMs,p=a.mtimeMs;(!E||E<=p||p!==D.mtimeMs)&&this.fsw._emit(st,e,a),jo&&D.ino!==a.ino?(this.fsw._closeFile(c),D=a,this.fsw._addPathCloser(c,this._watchWithNodeFs(e,o))):D=a}catch{this.fsw._remove(s,n)}else if(i.has(n)){const a=f.atimeMs,E=f.mtimeMs;(!a||a<=E||E!==D.mtimeMs)&&this.fsw._emit(st,e,f),D=f}}},l=this._watchWithNodeFs(e,o);if(!(r&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(nt,e,0))return;this.fsw._emit(nt,e,u)}return l}async _handleSymlink(e,u,r,s){if(this.fsw.closed)return;const n=e.fullPath,i=this.fsw._getWatchedDir(u);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let D;try{D=await uu(r)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(i.has(s)?this.fsw._symlinkPaths.get(n)!==D&&(this.fsw._symlinkPaths.set(n,D),this.fsw._emit(st,r,e.stats)):(i.add(s),this.fsw._symlinkPaths.set(n,D),this.fsw._emit(nt,r,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(n))return!0;this.fsw._symlinkPaths.set(n,!0)}_handleRead(e,u,r,s,n,i,D){if(e=I.join(e,Ko),!r.hasGlob&&(D=this.fsw._throttle("readdir",e,1e3),!D))return;const o=this.fsw._getWatchedDir(r.path),l=new Set;let c=this.fsw._readdirp(e,{fileFilter:f=>r.filterPath(f),directoryFilter:f=>r.filterDir(f),depth:0}).on(Yo,async f=>{if(this.fsw.closed){c=void 0;return}const a=f.path;let E=I.join(e,a);if(l.add(a),!(f.stats.isSymbolicLink()&&await this._handleSymlink(f,e,E,a))){if(this.fsw.closed){c=void 0;return}(a===s||!s&&!o.has(a))&&(this.fsw._incrReadyCount(),E=I.join(n,I.relative(n,E)),this._addToNodeFs(E,u,r,i+1))}}).on(rs,this._boundHandleError);return new Promise(f=>c.once(qo,()=>{if(this.fsw.closed){c=void 0;return}const a=D?D.clear():!1;f(),o.getChildren().filter(E=>E!==e&&!l.has(E)&&(!r.hasGlob||r.filterPath({fullPath:I.resolve(e,E)}))).forEach(E=>{this.fsw._remove(e,E)}),c=void 0,a&&this._handleRead(e,!1,r,s,n,i,D)}))}async _handleDir(e,u,r,s,n,i,D){const o=this.fsw._getWatchedDir(I.dirname(e)),l=o.has(I.basename(e));!(r&&this.fsw.options.ignoreInitial)&&!n&&!l&&(!i.hasGlob||i.globFilter(e))&&this.fsw._emit(zo,e,u),o.add(I.basename(e)),this.fsw._getWatchedDir(e);let c,f;const a=this.fsw.options.depth;if((a==null||s<=a)&&!this.fsw._symlinkPaths.has(D)){if(!n&&(await this._handleRead(e,r,i,n,e,s,c),this.fsw.closed))return;f=this._watchWithNodeFs(e,(E,p)=>{p&&p.mtimeMs===0||this._handleRead(E,!1,i,n,e,s,c)})}return f}async _addToNodeFs(e,u,r,s,n){const i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;const D=this.fsw._getWatchHelpers(e,s);!D.hasGlob&&r&&(D.hasGlob=r.hasGlob,D.globFilter=r.globFilter,D.filterPath=o=>r.filterPath(o),D.filterDir=o=>r.filterDir(o));try{const o=await ua[D.statMethod](D.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(D.watchPath,o))return i(),!1;const l=this.fsw.options.followSymlinks&&!e.includes(Qo)&&!e.includes(Xo);let c;if(o.isDirectory()){const f=I.resolve(e),a=l?await uu(e):e;if(this.fsw.closed||(c=await this._handleDir(D.watchPath,o,u,s,n,D,a),this.fsw.closed))return;f!==a&&a!==void 0&&this.fsw._symlinkPaths.set(f,a)}else if(o.isSymbolicLink()){const f=l?await uu(e):e;if(this.fsw.closed)return;const a=I.dirname(D.watchPath);if(this.fsw._getWatchedDir(a).add(D.watchPath),this.fsw._emit(nt,D.watchPath,o),c=await this._handleDir(a,o,u,s,e,D,f),this.fsw.closed)return;f!==void 0&&this.fsw._symlinkPaths.set(I.resolve(e),f)}else c=this._handleFile(D.watchPath,o,u);return i(),this.fsw._addPathCloser(e,c),!1}catch(o){if(this.fsw._handleError(o))return i(),e}}};var Da=ia,nu={exports:{}};const iu=ie,P=V,{promisify:Du}=me;let Fe;try{Fe=dt.require("fsevents")}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t)}if(Fe){const t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){const e=Number.parseInt(t[1],10),u=Number.parseInt(t[2],10);e===8&&u<16&&(Fe=void 0)}}const{EV_ADD:ou,EV_CHANGE:oa,EV_ADD_DIR:Ds,EV_UNLINK:ot,EV_ERROR:aa,STR_DATA:la,STR_END:ca,FSEVENT_CREATED:fa,FSEVENT_MODIFIED:ha,FSEVENT_DELETED:da,FSEVENT_MOVED:Ea,FSEVENT_UNKNOWN:pa,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:Ca,FSEVENT_TYPE_FILE:Fa,FSEVENT_TYPE_DIRECTORY:Te,FSEVENT_TYPE_SYMLINK:os,ROOT_GLOBSTAR:as,DIR_SUFFIX:ga,DOT_SLASH:ls,FUNCTION_TYPE:au,EMPTY_FN:ma,IDENTITY_FN:_a}=rt,Aa=t=>isNaN(t)?{}:{depth:t},lu=Du(iu.stat),ya=Du(iu.lstat),cs=Du(iu.realpath),wa={stat:lu,lstat:ya},le=new Map,Ra=10,ba=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),va=(t,e)=>({stop:Fe.watch(t,e)});function Sa(t,e,u,r){let s=P.extname(e)?P.dirname(e):e;const n=P.dirname(s);let i=le.get(s);Ba(n)&&(s=n);const D=P.resolve(t),o=D!==e,l=(f,a,E)=>{o&&(f=f.replace(e,D)),(f===D||!f.indexOf(D+P.sep))&&u(f,a,E)};let c=!1;for(const f of le.keys())if(e.indexOf(P.resolve(f)+P.sep)===0){s=f,i=le.get(s),c=!0;break}return i||c?i.listeners.add(l):(i={listeners:new Set([l]),rawEmitter:r,watcher:va(s,(f,a)=>{if(!i.listeners.size||a&Ca)return;const E=Fe.getInfo(f,a);i.listeners.forEach(p=>{p(f,a,E)}),i.rawEmitter(E.event,f,E)})},le.set(s,i)),()=>{const f=i.listeners;if(f.delete(l),!f.size&&(le.delete(s),i.watcher))return i.watcher.stop().then(()=>{i.rawEmitter=i.watcher=void 0,Object.freeze(i)})}}const Ba=t=>{let e=0;for(const u of le.keys())if(u.indexOf(t)===0&&(e++,e>=Ra))return!0;return!1},$a=()=>Fe&&le.size<128,cu=(t,e)=>{let u=0;for(;!t.indexOf(e)&&(t=P.dirname(t))!==e;)u++;return u},fs=(t,e)=>t.type===Te&&e.isDirectory()||t.type===os&&e.isSymbolicLink()||t.type===Fa&&e.isFile();let Ta=class{constructor(e){this.fsw=e}checkIgnored(e,u){const r=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,u))return r.add(e),u&&u.isDirectory()&&r.add(e+as),!0;r.delete(e),r.delete(e+as)}addOrChange(e,u,r,s,n,i,D,o){const l=n.has(i)?oa:ou;this.handleEvent(l,e,u,r,s,n,i,D,o)}async checkExists(e,u,r,s,n,i,D,o){try{const l=await lu(e);if(this.fsw.closed)return;fs(D,l)?this.addOrChange(e,u,r,s,n,i,D,o):this.handleEvent(ot,e,u,r,s,n,i,D,o)}catch(l){l.code==="EACCES"?this.addOrChange(e,u,r,s,n,i,D,o):this.handleEvent(ot,e,u,r,s,n,i,D,o)}}handleEvent(e,u,r,s,n,i,D,o,l){if(!(this.fsw.closed||this.checkIgnored(u)))if(e===ot){const c=o.type===Te;(c||i.has(D))&&this.fsw._remove(n,D,c)}else{if(e===ou){if(o.type===Te&&this.fsw._getWatchedDir(u),o.type===os&&l.followSymlinks){const f=l.depth===void 0?void 0:cu(r,s)+1;return this._addToFsEvents(u,!1,!0,f)}this.fsw._getWatchedDir(n).add(D)}const c=o.type===Te?e+ga:e;this.fsw._emit(c,u),c===Ds&&this._addToFsEvents(u,!1,!0)}}_watchWithFsEvents(e,u,r,s){if(this.fsw.closed||this.fsw._isIgnored(e))return;const n=this.fsw.options,D=Sa(e,u,async(o,l,c)=>{if(this.fsw.closed||n.depth!==void 0&&cu(o,u)>n.depth)return;const f=r(P.join(e,P.relative(e,o)));if(s&&!s(f))return;const a=P.dirname(f),E=P.basename(f),p=this.fsw._getWatchedDir(c.type===Te?f:a);if(ba.has(l)||c.event===pa)if(typeof n.ignored===au){let F;try{F=await lu(f)}catch{}if(this.fsw.closed||this.checkIgnored(f,F))return;fs(c,F)?this.addOrChange(f,o,u,a,p,E,c,n):this.handleEvent(ot,f,o,u,a,p,E,c,n)}else this.checkExists(f,o,u,a,p,E,c,n);else switch(c.event){case fa:case ha:return this.addOrChange(f,o,u,a,p,E,c,n);case da:case Ea:return this.checkExists(f,o,u,a,p,E,c,n)}},this.fsw._emitRaw);return this.fsw._emitReady(),D}async _handleFsEventsSymlink(e,u,r,s){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(u))){this.fsw._symlinkPaths.set(u,!0),this.fsw._incrReadyCount();try{const n=await cs(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(n))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(n||e,i=>{let D=e;return n&&n!==ls?D=i.replace(n,e):i!==ls&&(D=P.join(e,i)),r(D)},!1,s)}catch(n){if(this.fsw._handleError(n))return this.fsw._emitReady()}}}emitAdd(e,u,r,s,n){const i=r(e),D=u.isDirectory(),o=this.fsw._getWatchedDir(P.dirname(i)),l=P.basename(i);D&&this.fsw._getWatchedDir(i),!o.has(l)&&(o.add(l),(!s.ignoreInitial||n===!0)&&this.fsw._emit(D?Ds:ou,i,u))}initWatch(e,u,r,s){if(this.fsw.closed)return;const n=this._watchWithFsEvents(r.watchPath,P.resolve(e||r.watchPath),s,r.globFilter);this.fsw._addPathCloser(u,n)}async _addToFsEvents(e,u,r,s){if(this.fsw.closed)return;const n=this.fsw.options,i=typeof u===au?u:_a,D=this.fsw._getWatchHelpers(e);try{const o=await wa[D.statMethod](D.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(D.watchPath,o))throw null;if(o.isDirectory()){if(D.globFilter||this.emitAdd(i(e),o,i,n,r),s&&s>n.depth)return;this.fsw._readdirp(D.watchPath,{fileFilter:l=>D.filterPath(l),directoryFilter:l=>D.filterDir(l),...Aa(n.depth-(s||0))}).on(la,l=>{if(this.fsw.closed||l.stats.isDirectory()&&!D.filterPath(l))return;const c=P.join(D.watchPath,l.path),{fullPath:f}=l;if(D.followSymlinks&&l.stats.isSymbolicLink()){const a=n.depth===void 0?void 0:cu(c,P.resolve(D.watchPath))+1;this._handleFsEventsSymlink(c,f,i,a)}else this.emitAdd(c,l.stats,i,n,r)}).on(aa,ma).on(ca,()=>{this.fsw._emitReady()})}else this.emitAdd(D.watchPath,o,i,n,r),this.fsw._emitReady()}catch(o){(!o||this.fsw._handleError(o))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(n.persistent&&r!==!0)if(typeof u===au)this.initWatch(void 0,e,D,i);else{let o;try{o=await cs(D.watchPath)}catch{}this.initWatch(o,e,D,i)}}};nu.exports=Ta,nu.exports.canUse=$a;var xa=nu.exports;const{EventEmitter:Oa}=Hs,fu=ie,v=V,{promisify:hs}=me,Na=vD,hu=OD.default,Ha=KD,du=Nr,La=No,Ia=Br,Pa=Da,ds=xa,{EV_ALL:Eu,EV_READY:ka,EV_ADD:at,EV_CHANGE:xe,EV_UNLINK:Es,EV_ADD_DIR:Ma,EV_UNLINK_DIR:Ga,EV_RAW:Wa,EV_ERROR:pu,STR_CLOSE:ja,STR_END:Ua,BACK_SLASH_RE:Ka,DOUBLE_SLASH_RE:ps,SLASH_OR_BACK_SLASH_RE:Va,DOT_RE:za,REPLACER_RE:Ya,SLASH:Cu,SLASH_SLASH:qa,BRACE_START:Xa,BANG:Fu,ONE_DOT:Cs,TWO_DOTS:Qa,GLOBSTAR:Za,SLASH_GLOBSTAR:gu,ANYMATCH_OPTS:mu,STRING_TYPE:_u,FUNCTION_TYPE:Ja,EMPTY_STR:Au,EMPTY_FN:el,isWindows:tl,isMacos:ul,isIBMi:rl}=rt,sl=hs(fu.stat),nl=hs(fu.readdir),yu=(t=[])=>Array.isArray(t)?t:[t],Fs=(t,e=[])=>(t.forEach(u=>{Array.isArray(u)?Fs(u,e):e.push(u)}),e),gs=t=>{const e=Fs(yu(t));if(!e.every(u=>typeof u===_u))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(_s)},ms=t=>{let e=t.replace(Ka,Cu),u=!1;for(e.startsWith(qa)&&(u=!0);e.match(ps);)e=e.replace(ps,Cu);return u&&(e=Cu+e),e},_s=t=>ms(v.normalize(ms(t))),As=(t=Au)=>e=>typeof e!==_u?e:_s(v.isAbsolute(e)?e:v.join(t,e)),il=(t,e)=>v.isAbsolute(t)?t:t.startsWith(Fu)?Fu+v.join(e,t.slice(1)):v.join(e,t),q=(t,e)=>t[e]===void 0;class Dl{constructor(e,u){this.path=e,this._removeWatcher=u,this.items=new Set}add(e){const{items:u}=this;u&&e!==Cs&&e!==Qa&&u.add(e)}async remove(e){const{items:u}=this;if(!u||(u.delete(e),u.size>0))return;const r=this.path;try{await nl(r)}catch{this._removeWatcher&&this._removeWatcher(v.dirname(r),v.basename(r))}}has(e){const{items:u}=this;if(u)return u.has(e)}getChildren(){const{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}}const ol="stat",al="lstat";class ll{constructor(e,u,r,s){this.fsw=s,this.path=e=e.replace(Ya,Au),this.watchPath=u,this.fullWatchPath=v.resolve(u),this.hasGlob=u!==e,e===Au&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&r?void 0:!1,this.globFilter=this.hasGlob?hu(e,void 0,mu):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(n=>{n.length>1&&n.pop()}),this.followSymlinks=r,this.statMethod=r?ol:al}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return v.join(this.watchPath,v.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){const{stats:u}=e;if(u&&u.isSymbolicLink())return this.filterDir(e);const r=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===Ja?this.globFilter(r):!0)&&this.fsw._isntIgnored(r,u)&&this.fsw._hasReadPermissions(u)}getDirParts(e){if(!this.hasGlob)return[];const u=[];return(e.includes(Xa)?La.expand(e):[e]).forEach(s=>{u.push(v.relative(this.watchPath,s).split(Va))}),u}filterDir(e){if(this.hasGlob){const u=this.getDirParts(this.checkGlobSymlink(e));let r=!1;this.unmatchedGlob=!this.dirParts.some(s=>s.every((n,i)=>(n===Za&&(r=!0),r||!u[0][i]||hu(n,u[0][i],mu))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class cl extends Oa{constructor(e){super();const u={};e&&Object.assign(u,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,q(u,"persistent")&&(u.persistent=!0),q(u,"ignoreInitial")&&(u.ignoreInitial=!1),q(u,"ignorePermissionErrors")&&(u.ignorePermissionErrors=!1),q(u,"interval")&&(u.interval=100),q(u,"binaryInterval")&&(u.binaryInterval=300),q(u,"disableGlobbing")&&(u.disableGlobbing=!1),u.enableBinaryInterval=u.binaryInterval!==u.interval,q(u,"useFsEvents")&&(u.useFsEvents=!u.usePolling),ds.canUse()||(u.useFsEvents=!1),q(u,"usePolling")&&!u.useFsEvents&&(u.usePolling=ul),rl&&(u.usePolling=!0);const s=process.env.CHOKIDAR_USEPOLLING;if(s!==void 0){const o=s.toLowerCase();o==="false"||o==="0"?u.usePolling=!1:o==="true"||o==="1"?u.usePolling=!0:u.usePolling=!!o}const n=process.env.CHOKIDAR_INTERVAL;n&&(u.interval=Number.parseInt(n,10)),q(u,"atomic")&&(u.atomic=!u.usePolling&&!u.useFsEvents),u.atomic&&(this._pendingUnlinks=new Map),q(u,"followSymlinks")&&(u.followSymlinks=!0),q(u,"awaitWriteFinish")&&(u.awaitWriteFinish=!1),u.awaitWriteFinish===!0&&(u.awaitWriteFinish={});const i=u.awaitWriteFinish;i&&(i.stabilityThreshold||(i.stabilityThreshold=2e3),i.pollInterval||(i.pollInterval=100),this._pendingWrites=new Map),u.ignored&&(u.ignored=yu(u.ignored));let D=0;this._emitReady=()=>{D++,D>=this._readyCount&&(this._emitReady=el,this._readyEmitted=!0,process.nextTick(()=>this.emit(ka)))},this._emitRaw=(...o)=>this.emit(Wa,...o),this._readyEmitted=!1,this.options=u,u.useFsEvents?this._fsEventsHandler=new ds(this):this._nodeFsHandler=new Pa(this),Object.freeze(u)}add(e,u,r){const{cwd:s,disableGlobbing:n}=this.options;this.closed=!1;let i=gs(e);return s&&(i=i.map(D=>{const o=il(D,s);return n||!du(D)?o:Ia(o)})),i=i.filter(D=>D.startsWith(Fu)?(this._ignoredPaths.add(D.slice(1)),!1):(this._ignoredPaths.delete(D),this._ignoredPaths.delete(D+gu),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=i.length),this.options.persistent&&(this._readyCount+=i.length),i.forEach(D=>this._fsEventsHandler._addToFsEvents(D))):(this._readyCount||(this._readyCount=0),this._readyCount+=i.length,Promise.all(i.map(async D=>{const o=await this._nodeFsHandler._addToNodeFs(D,!r,0,0,u);return o&&this._emitReady(),o})).then(D=>{this.closed||D.filter(o=>o).forEach(o=>{this.add(v.dirname(o),v.basename(u||o))})})),this}unwatch(e){if(this.closed)return this;const u=gs(e),{cwd:r}=this.options;return u.forEach(s=>{!v.isAbsolute(s)&&!this._closers.has(s)&&(r&&(s=v.join(r,s)),s=v.resolve(s)),this._closePath(s),this._ignoredPaths.add(s),this._watched.has(s)&&this._ignoredPaths.add(s+gu),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();const e=[];return this._closers.forEach(u=>u.forEach(r=>{const s=r();s instanceof Promise&&e.push(s)})),this._streams.forEach(u=>u.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(u=>u.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(u=>{this[`_${u}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){const e={};return this._watched.forEach((u,r)=>{const s=this.options.cwd?v.relative(this.options.cwd,r):r;e[s||Cs]=u.getChildren().sort()}),e}emitWithAll(e,u){this.emit(...u),e!==pu&&this.emit(Eu,...u)}async _emit(e,u,r,s,n){if(this.closed)return;const i=this.options;tl&&(u=v.normalize(u)),i.cwd&&(u=v.relative(i.cwd,u));const D=[e,u];n!==void 0?D.push(r,s,n):s!==void 0?D.push(r,s):r!==void 0&&D.push(r);const o=i.awaitWriteFinish;let l;if(o&&(l=this._pendingWrites.get(u)))return l.lastChange=new Date,this;if(i.atomic){if(e===Es)return this._pendingUnlinks.set(u,D),setTimeout(()=>{this._pendingUnlinks.forEach((c,f)=>{this.emit(...c),this.emit(Eu,...c),this._pendingUnlinks.delete(f)})},typeof i.atomic=="number"?i.atomic:100),this;e===at&&this._pendingUnlinks.has(u)&&(e=D[0]=xe,this._pendingUnlinks.delete(u))}if(o&&(e===at||e===xe)&&this._readyEmitted){const c=(f,a)=>{f?(e=D[0]=pu,D[1]=f,this.emitWithAll(e,D)):a&&(D.length>2?D[2]=a:D.push(a),this.emitWithAll(e,D))};return this._awaitWriteFinish(u,o.stabilityThreshold,e,c),this}if(e===xe&&!this._throttle(xe,u,50))return this;if(i.alwaysStat&&r===void 0&&(e===at||e===Ma||e===xe)){const c=i.cwd?v.join(i.cwd,u):u;let f;try{f=await sl(c)}catch{}if(!f||this.closed)return;D.push(f)}return this.emitWithAll(e,D),this}_handleError(e){const u=e&&e.code;return e&&u!=="ENOENT"&&u!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||u!=="EPERM"&&u!=="EACCES")&&this.emit(pu,e),e||this.closed}_throttle(e,u,r){this._throttled.has(e)||this._throttled.set(e,new Map);const s=this._throttled.get(e),n=s.get(u);if(n)return n.count++,!1;let i;const D=()=>{const l=s.get(u),c=l?l.count:0;return s.delete(u),clearTimeout(i),l&&clearTimeout(l.timeoutObject),c};i=setTimeout(D,r);const o={timeoutObject:i,clear:D,count:0};return s.set(u,o),o}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,u,r,s){let n,i=e;this.options.cwd&&!v.isAbsolute(e)&&(i=v.join(this.options.cwd,e));const D=new Date,o=l=>{fu.stat(i,(c,f)=>{if(c||!this._pendingWrites.has(e)){c&&c.code!=="ENOENT"&&s(c);return}const a=Number(new Date);l&&f.size!==l.size&&(this._pendingWrites.get(e).lastChange=a);const E=this._pendingWrites.get(e);a-E.lastChange>=u?(this._pendingWrites.delete(e),s(void 0,f)):n=setTimeout(o,this.options.awaitWriteFinish.pollInterval,f)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:D,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(n),r)}),n=setTimeout(o,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,u){if(this.options.atomic&&za.test(e))return!0;if(!this._userIgnored){const{cwd:r}=this.options,s=this.options.ignored,n=s&&s.map(As(r)),i=yu(n).filter(o=>typeof o===_u&&!du(o)).map(o=>o+gu),D=this._getGlobIgnored().map(As(r)).concat(n,i);this._userIgnored=hu(D,void 0,mu)}return this._userIgnored([e,u])}_isntIgnored(e,u){return!this._isIgnored(e,u)}_getWatchHelpers(e,u){const r=u||this.options.disableGlobbing||!du(e)?e:Ha(e),s=this.options.followSymlinks;return new ll(e,r,s,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));const u=v.resolve(e);return this._watched.has(u)||this._watched.set(u,new Dl(u,this._boundRemove)),this._watched.get(u)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;const r=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(r.toString(8)[0],10))}_remove(e,u,r){const s=v.join(e,u),n=v.resolve(s);if(r=r??(this._watched.has(s)||this._watched.has(n)),!this._throttle("remove",s,100))return;!r&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,u,!0),this._getWatchedDir(s).getChildren().forEach(a=>this._remove(s,a));const o=this._getWatchedDir(e),l=o.has(u);o.remove(u),this._symlinkPaths.has(n)&&this._symlinkPaths.delete(n);let c=s;if(this.options.cwd&&(c=v.relative(this.options.cwd,s)),this.options.awaitWriteFinish&&this._pendingWrites.has(c)&&this._pendingWrites.get(c).cancelWait()===at)return;this._watched.delete(s),this._watched.delete(n);const f=r?Ga:Es;l&&!this._isIgnored(s)&&this._emit(f,s),this.options.useFsEvents||this._closePath(s)}_closePath(e){this._closeFile(e);const u=v.dirname(e);this._getWatchedDir(u).remove(v.basename(e))}_closeFile(e){const u=this._closers.get(e);u&&(u.forEach(r=>r()),this._closers.delete(e))}_addPathCloser(e,u){if(!u)return;let r=this._closers.get(e);r||(r=[],this._closers.set(e,r)),r.push(u)}_readdirp(e,u){if(this.closed)return;const r={type:Eu,alwaysStat:!0,lstat:!0,...u};let s=Na(e,r);return this._streams.add(s),s.once(ja,()=>{s=void 0}),s.once(Ua,()=>{s&&(this._streams.delete(s),s=void 0)}),s}}const fl=(t,e)=>{const u=new cl(e);return u.add(t),u};var hl=fl;let ce=!0;const ge=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let Oe=0;if(ge.process&&ge.process.env&&ge.process.stdout){const{FORCE_COLOR:t,NODE_DISABLE_COLORS:e,NO_COLOR:u,TERM:r,COLORTERM:s}=ge.process.env;e||u||t==="0"?ce=!1:t==="1"||t==="2"||t==="3"?ce=!0:r==="dumb"?ce=!1:"CI"in ge.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(n=>n in ge.process.env)?ce=!0:ce=process.stdout.isTTY,ce&&(process.platform==="win32"||s&&(s==="truecolor"||s==="24bit")?Oe=3:r&&(r.endsWith("-256color")||r.endsWith("256"))?Oe=2:Oe=1)}let ys={enabled:ce,supportLevel:Oe};function Ne(t,e,u=1){const r=`\x1B[${t}m`,s=`\x1B[${e}m`,n=new RegExp(`\\x1b\\[${e}m`,"g");return i=>ys.enabled&&ys.supportLevel>=u?r+(""+i).replace(n,r)+s:""+i}const He=Ne(33,39),dl=Ne(90,39),El=Ne(92,39),pl=Ne(95,39),Cl=Ne(96,39),lt=(t=!0)=>{let e=!1;return u=>{if(e||u==="unknown-flag")return!0;if(u==="argument")return e=!0,t}},ws=(t,e=process.argv.slice(2))=>(Su(t,e,{ignore:lt()}),e),Fl=t=>{let e=Buffer.alloc(0);return u=>{for(e=Buffer.concat([e,u]);e.length>4;){const r=e.readInt32BE(0);if(e.length>=4+r){const s=e.slice(4,4+r);t(s),e=e.slice(4+r)}else break}}},Rs=async()=>{const t=Is.createServer(u=>{u.on("data",Fl(r=>{const s=JSON.parse(r.toString());t.emit("data",s)}))}),e=bu.getPipePath(process.pid);return await Et.promises.mkdir(Ps.tmpdir,{recursive:!0}),await Et.promises.rm(e,{force:!0}),await new Promise((u,r)=>{t.listen(e,u),t.on("error",r)}),t.unref(),process.on("exit",()=>{if(t.close(),!bu.isWindows)try{Et.rmSync(e)}catch{}}),t},gl=()=>new Date().toLocaleTimeString(),Le=(...t)=>console.log(dl(gl()),Cl("[tsx]"),...t),ml="\x1Bc",_l=(t,e)=>{let u;return function(){u&&clearTimeout(u),u=setTimeout(()=>Reflect.apply(t,this,arguments),e)}},bs={noCache:{type:Boolean,description:"Disable caching",default:!1},tsconfig:{type:String,description:"Custom tsconfig.json path"},clearScreen:{type:Boolean,description:"Clearing the screen on rerun",default:!0},ignore:{type:[String],description:"Paths & globs to exclude from being watched"}},Al=ri({name:"watch",parameters:["