n e==null?(o,a=!1)=>Bn(D,i,o,typeof a=="boolean"?a:!1):Bn(D,i,e,r)};Gt.default=Gt,Wt.exports=Gt;var OD=Wt.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,Sn={"{":"}","(":")","[":"]"},PD=function(t){if(t[0]==="!")return!0;for(var e=0,u=-2,n=-2,r=-2,s=-2,i=-2;ee&&(i===-1||i>n||(i=t.indexOf("\\",e),i===-1||i>n)))||r!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(r=t.indexOf("}",e),r>e&&(i=t.indexOf("\\",e),i===-1||i>r))||s!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(s=t.indexOf(")",e),s>e&&(i=t.indexOf("\\",e),i===-1||i>s))||u!==-1&&t[e]==="("&&t[e+1]!=="|"&&(uu&&(i=t.indexOf("\\",u),i===-1||i>s))))return!0;if(t[e]==="\\"){var D=t[e+1];e+=2;var o=Sn[D];if(o){var a=t.indexOf(o,e);a!==-1&&(e=a+1)}if(t[e]==="!")return!0}else e++}return!1},LD=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(n=>n.type===u),t.exceedsLimit=(e,u,n=1,r)=>r===!1||!t.isInteger(e)||!t.isInteger(u)?!1:(Number(u)-Number(e))/Number(n)>=r,t.escapeNode=(e,u=0,n)=>{let r=e.nodes[u];r&&(n&&r.type===n||r.type==="open"||r.type==="close")&&r.escaped!==!0&&(r.value="\\"+r.value,r.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,n)=>(n.type==="text"&&u.push(n.value),n.type==="range"&&(n.type="text"),u),[]),t.flatten=(...e)=>{const u=[],n=r=>{for(let s=0;s{let u=(n,r={})=>{let s=e.escapeInvalid&&Tn.isInvalidBrace(r),i=n.invalid===!0&&e.escapeInvalid===!0,D="";if(n.value)return(s||i)&&Tn.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let o of n.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 xn=VD,ae=(t,e,u)=>{if(xn(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(xn(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...u};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let r=String(n.relaxZeros),s=String(n.shorthand),i=String(n.capture),D=String(n.wrap),o=t+":"+e+"="+r+s+i+D;if(ae.cache.hasOwnProperty(o))return ae.cache[o].result;let a=Math.min(t,e),c=Math.max(t,e);if(Math.abs(a-c)===1){let F=t+"|"+e;return n.capture?`(${F})`:n.wrap===!1?F:`(?:${F})`}let f=In(t)||In(e),l={min:t,max:e,a,b:c},p=[],C=[];if(f&&(l.isPadded=f,l.maxLen=String(l.max).length),a<0){let F=c<0?Math.abs(c):1;C=On(F,Math.abs(a),l,n),a=l.a=0}return c>=0&&(p=On(a,c,l,n)),l.negatives=C,l.positives=p,l.result=zD(C,p),n.capture===!0?l.result=`(${l.result})`:n.wrap!==!1&&p.length+C.length>1&&(l.result=`(?:${l.result})`),ae.cache[o]=l,l.result};function zD(t,e,u){let n=Kt(t,e,"-",!1)||[],r=Kt(e,t,"",!1)||[],s=Kt(t,e,"-?",!0)||[];return n.concat(s).concat(r).join("|")}function YD(t,e){let u=1,n=1,r=Hn(t,u),s=new Set([e]);for(;t<=r&&r<=e;)s.add(r),u+=1,r=Hn(t,u);for(r=Pn(e+1,n)-1;t1&&D.count.pop(),D.count.push(c.count[0]),D.string=D.pattern+Ln(D.count),i=a+1;continue}u.isPadded&&(f=JD(a,u,n)),c.string=f+c.pattern+Ln(c.count),s.push(c),i=a+1,D=c}return s}function Kt(t,e,u,n,r){let s=[];for(let i of t){let{string:D}=i;!n&&!Nn(e,"string",D)&&s.push(u+D),n&&Nn(e,"string",D)&&s.push(u+D)}return s}function XD(t,e){let u=[];for(let n=0;ne?1:e>t?-1:0}function Nn(t,e,u){return t.some(n=>n[e]===u)}function Hn(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function Pn(t,e){return t-t%Math.pow(10,e)}function Ln(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 In(t){return/^-?(0+)\d/.test(t)}function JD(t,e,u){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),r=u.relaxZeros!==!1;switch(n){case 0:return"";case 1:return r?"0?":"0";case 2:return r?"0{0,2}":"00";default:return r?`0{0,${n}}`:`0{${n}}`}}ae.cache={},ae.clearCache=()=>ae.cache={};var eo=ae;/*! * fill-range * * Copyright (c) 2014-present, Jon Schlinkert. * Licensed under the MIT License. */const to=me.default,kn=eo,Mn=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),uo=t=>e=>t===!0?Number(e):String(e),Vt=t=>typeof t=="number"||typeof t=="string"&&t!=="",ve=t=>Number.isInteger(+t),zt=t=>{let e=`${t}`,u=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++u]==="0";);return u>0},no=(t,e,u)=>typeof t=="string"||typeof e=="string"?!0:u.stringify===!0,ro=(t,e,u)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0")}return u===!1?String(t):t},Wn=(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?"":"?:",n="",r="",s;return t.positives.length&&(n=t.positives.join("|")),t.negatives.length&&(r=`-(${u}${t.negatives.join("|")})`),n&&r?s=`${n}|${r}`:s=n||r,e.wrap?`(${u}${s})`:s},Gn=(t,e,u,n)=>{if(u)return kn(t,e,{wrap:!1,...n});let r=String.fromCharCode(t);if(t===e)return r;let s=String.fromCharCode(e);return`[${r}-${s}]`},jn=(t,e,u)=>{if(Array.isArray(t)){let n=u.wrap===!0,r=u.capture?"":"?:";return n?`(${r}${t.join("|")})`:t.join("|")}return kn(t,e,u)},Un=(...t)=>new RangeError("Invalid range arguments: "+to.inspect(...t)),Kn=(t,e,u)=>{if(u.strictRanges===!0)throw Un([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,n={})=>{let r=Number(t),s=Number(e);if(!Number.isInteger(r)||!Number.isInteger(s)){if(n.strictRanges===!0)throw Un([t,e]);return[]}r===0&&(r=0),s===0&&(s=0);let i=r>s,D=String(t),o=String(e),a=String(u);u=Math.max(Math.abs(u),1);let c=zt(D)||zt(o)||zt(a),f=c?Math.max(D.length,o.length,a.length):0,l=c===!1&&no(t,e,n)===!1,p=n.transform||uo(l);if(n.toRegex&&u===1)return Gn(Wn(t,f),Wn(e,f),!0,n);let C={negatives:[],positives:[]},F=H=>C[H<0?"negatives":"positives"].push(Math.abs(H)),A=[],B=0;for(;i?r>=s:r<=s;)n.toRegex===!0&&u>1?F(r):A.push(ro(p(r,B),f,l)),r=i?r-u:r+u,B++;return n.toRegex===!0?u>1?so(C,n):jn(A,null,{wrap:!1,...n}):A},oo=(t,e,u=1,n={})=>{if(!ve(t)&&t.length>1||!ve(e)&&e.length>1)return Kn(t,e,n);let r=n.transform||(l=>String.fromCharCode(l)),s=`${t}`.charCodeAt(0),i=`${e}`.charCodeAt(0),D=s>i,o=Math.min(s,i),a=Math.max(s,i);if(n.toRegex&&u===1)return Gn(o,a,!1,n);let c=[],f=0;for(;D?s>=i:s<=i;)c.push(r(s,f)),s=D?s-u:s+u,f++;return n.toRegex===!0?jn(c,null,{wrap:!1,options:n}):c},Je=(t,e,u,n={})=>{if(e==null&&Vt(t))return[t];if(!Vt(t)||!Vt(e))return Kn(t,e,n);if(typeof u=="function")return Je(t,e,1,{transform:u});if(Mn(u))return Je(t,e,0,u);let r={...n};return r.capture===!0&&(r.wrap=!0),u=u||r.step||1,ve(u)?ve(t)&&ve(e)?Do(t,e,u,r):oo(t,e,Math.max(Math.abs(u),1),r):u!=null&&!Mn(u)?io(u,r):Je(t,e,1,u)};var Vn=Je;const ao=Vn,zn=Ze,lo=(t,e={})=>{let u=(n,r={})=>{let s=zn.isInvalidBrace(r),i=n.invalid===!0&&e.escapeInvalid===!0,D=s===!0||i===!0,o=e.escapeInvalid===!0?"\\":"",a="";if(n.isOpen===!0||n.isClose===!0)return o+n.value;if(n.type==="open")return D?o+n.value:"(";if(n.type==="close")return D?o+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":D?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let c=zn.reduce(n.nodes),f=ao(...c,{...e,wrap:!1,toRegex:!0});if(f.length!==0)return c.length>1&&f.length>1?`(${f})`:f}if(n.nodes)for(let c of n.nodes)a+=u(c,n);return a};return u(t)};var co=lo;const fo=Vn,Yn=Ut,Ce=Ze,le=(t="",e="",u=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return u?Ce.flatten(e).map(r=>`{${r}}`):e;for(let r of t)if(Array.isArray(r))for(let s of r)n.push(le(s,e,u));else for(let s of e)u===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?le(r,s,u):r+s);return Ce.flatten(n)},ho=(t,e={})=>{let u=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(r,s={})=>{r.queue=[];let i=s,D=s.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,D=i.queue;if(r.invalid||r.dollar){D.push(le(D.pop(),Yn(r,e)));return}if(r.type==="brace"&&r.invalid!==!0&&r.nodes.length===2){D.push(le(D.pop(),["{}"]));return}if(r.nodes&&r.ranges>0){let f=Ce.reduce(r.nodes);if(Ce.exceedsLimit(...f,e.step,u))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let l=fo(...f,e);l.length===0&&(l=Yn(r,e)),D.push(le(D.pop(),l)),r.nodes=[];return}let o=Ce.encloseBrace(r),a=r.queue,c=r;for(;c.type!=="brace"&&c.type!=="root"&&c.parent;)c=c.parent,a=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=Ut,{MAX_LENGTH:qn,CHAR_BACKSLASH:Yt,CHAR_BACKTICK:Fo,CHAR_COMMA:go,CHAR_DOT:_o,CHAR_LEFT_PARENTHESES:mo,CHAR_RIGHT_PARENTHESES:Ao,CHAR_LEFT_CURLY_BRACE:yo,CHAR_RIGHT_CURLY_BRACE:wo,CHAR_LEFT_SQUARE_BRACKET:Xn,CHAR_RIGHT_SQUARE_BRACKET:Qn,CHAR_DOUBLE_QUOTE:Ro,CHAR_SINGLE_QUOTE:bo,CHAR_NO_BREAK_SPACE:vo,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Bo}=po,So=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let u=e||{},n=typeof u.maxLength=="number"?Math.min(qn,u.maxLength):qn;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let r={type:"root",input:t,nodes:[]},s=[r],i=r,D=r,o=0,a=t.length,c=0,f=0,l;const p=()=>t[c++],C=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(C({type:"bos"});c0){if(i.ranges>0){i.ranges=0;let F=i.nodes.shift();i.nodes=[F,{type:"text",value:Co(i)}]}C({type:"comma",value:l}),i.commas++;continue}if(l===_o&&f>0&&i.commas===0){let F=i.nodes;if(f===0||F.length===0){C({type:"text",value:l});continue}if(D.type==="dot"){if(i.range=[],D.value+=l,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+l,D=A,i.ranges--;continue}C({type:"dot",value:l});continue}C({type:"text",value:l})}do if(i=s.pop(),i.type!=="root"){i.nodes.forEach(B=>{B.nodes||(B.type==="open"&&(B.isOpen=!0),B.type==="close"&&(B.isClose=!0),B.nodes||(B.type="text"),B.invalid=!0)});let F=s[s.length-1],A=F.nodes.indexOf(i);F.nodes.splice(A,1,...i.nodes)}while(s.length>0);return C({type:"eos"}),r};var $o=So;const Zn=Ut,To=co,xo=Eo,Oo=$o,Y=(t,e={})=>{let u=[];if(Array.isArray(t))for(let n of t){let r=Y.create(n,e);Array.isArray(r)?u.push(...r):u.push(r)}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={})=>Zn(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","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"],Po=Ho;const Lo=K.default,Io=Po,ko=new Set(Io);var Mo=t=>ko.has(Lo.extname(t).slice(1).toLowerCase()),et={};(function(t){const{sep:e}=K.default,{platform:u}=process,n=Au.default;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_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=r=>r,t.isWindows=u==="win32",t.isMacos=u==="darwin",t.isLinux=u==="linux",t.isIBMi=n.type()==="OS400"})(et);const ue=De.default,L=K.default,{promisify:Be}=me.default,Wo=Mo,{isWindows:Go,isLinux:jo,EMPTY_FN:Uo,EMPTY_STR:Ko,KEY_LISTENERS:Fe,KEY_ERR:qt,KEY_RAW:Se,HANDLER_KEYS:Vo,EV_CHANGE:tt,EV_ADD:ut,EV_ADD_DIR:zo,EV_ERROR:Jn,STR_DATA:Yo,STR_END:qo,BRACE_START:Xo,STAR:Qo}=et,Zo="watch",Jo=Be(ue.open),er=Be(ue.stat),ea=Be(ue.lstat),ta=Be(ue.close),Xt=Be(ue.realpath),ua={lstat:ea,stat:er},Qt=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},$e=(t,e,u)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(u)},na=t=>e=>{const u=t[e];u instanceof Set?u.clear():delete t[e]},Te=(t,e,u)=>{const n=t[e];n instanceof Set?n.delete(u):n===u&&delete t[e]},tr=t=>t instanceof Set?t.size===0:!t,nt=new Map;function ur(t,e,u,n,r){const s=(i,D)=>{u(t),r(i,D,{watchedPath:t}),D&&t!==D&&rt(L.resolve(t,D),Fe,L.join(t,D))};try{return ue.watch(t,e,s)}catch(i){n(i)}}const rt=(t,e,u,n,r)=>{const s=nt.get(t);s&&Qt(s[e],i=>{i(u,n,r)})},ra=(t,e,u,n)=>{const{listener:r,errHandler:s,rawEmitter:i}=n;let D=nt.get(e),o;if(!u.persistent)return o=ur(t,u,r,s,i),o.close.bind(o);if(D)$e(D,Fe,r),$e(D,qt,s),$e(D,Se,i);else{if(o=ur(t,u,rt.bind(null,e,Fe),s,rt.bind(null,e,Se)),!o)return;o.on(Jn,async a=>{const c=rt.bind(null,e,qt);if(D.watcherUnusable=!0,Go&&a.code==="EPERM")try{const f=await Jo(t,"r");await ta(f),c(a)}catch{}else c(a)}),D={listeners:r,errHandlers:s,rawEmitters:i,watcher:o},nt.set(e,D)}return()=>{Te(D,Fe,r),Te(D,qt,s),Te(D,Se,i),tr(D.listeners)&&(D.watcher.close(),nt.delete(e),Vo.forEach(na(D)),D.watcher=void 0,Object.freeze(D))}},Zt=new Map,sa=(t,e,u,n)=>{const{listener:r,rawEmitter:s}=n;let i=Zt.get(e);const D=i&&i.options;return D&&(D.persistentu.interval)&&(i.listeners,i.rawEmitters,ue.unwatchFile(e),i=void 0),i?($e(i,Fe,r),$e(i,Se,s)):(i={listeners:r,rawEmitters:s,options:u,watcher:ue.watchFile(e,u,(o,a)=>{Qt(i.rawEmitters,f=>{f(tt,e,{curr:o,prev:a})});const c=o.mtimeMs;(o.size!==a.size||c>a.mtimeMs||c===0)&&Qt(i.listeners,f=>f(t,o))})},Zt.set(e,i)),()=>{Te(i,Fe,r),Te(i,Se,s),tr(i.listeners)&&(Zt.delete(e),ue.unwatchFile(e),i.options=i.watcher=void 0,Object.freeze(i))}};class ia{constructor(e){this.fsw=e,this._boundHandleError=u=>e._handleError(u)}_watchWithNodeFs(e,u){const n=this.fsw.options,r=L.dirname(e),s=L.basename(e);this.fsw._getWatchedDir(r).add(s);const D=L.resolve(e),o={persistent:n.persistent};u||(u=Uo);let a;return n.usePolling?(o.interval=n.enableBinaryInterval&&Wo(s)?n.binaryInterval:n.interval,a=sa(e,D,o,{listener:u,rawEmitter:this.fsw._emitRaw})):a=ra(e,D,o,{listener:u,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),a}_handleFile(e,u,n){if(this.fsw.closed)return;const r=L.dirname(e),s=L.basename(e),i=this.fsw._getWatchedDir(r);let D=u;if(i.has(s))return;const o=async(c,f)=>{if(this.fsw._throttle(Zo,e,5)){if(!f||f.mtimeMs===0)try{const l=await er(e);if(this.fsw.closed)return;const p=l.atimeMs,C=l.mtimeMs;(!p||p<=C||C!==D.mtimeMs)&&this.fsw._emit(tt,e,l),jo&&D.ino!==l.ino?(this.fsw._closeFile(c),D=l,this.fsw._addPathCloser(c,this._watchWithNodeFs(e,o))):D=l}catch{this.fsw._remove(r,s)}else if(i.has(s)){const l=f.atimeMs,p=f.mtimeMs;(!l||l<=p||p!==D.mtimeMs)&&this.fsw._emit(tt,e,f),D=f}}},a=this._watchWithNodeFs(e,o);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(ut,e,0))return;this.fsw._emit(ut,e,u)}return a}async _handleSymlink(e,u,n,r){if(this.fsw.closed)return;const s=e.fullPath,i=this.fsw._getWatchedDir(u);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let D;try{D=await Xt(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(i.has(r)?this.fsw._symlinkPaths.get(s)!==D&&(this.fsw._symlinkPaths.set(s,D),this.fsw._emit(tt,n,e.stats)):(i.add(r),this.fsw._symlinkPaths.set(s,D),this.fsw._emit(ut,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(s))return!0;this.fsw._symlinkPaths.set(s,!0)}_handleRead(e,u,n,r,s,i,D){if(e=L.join(e,Ko),!n.hasGlob&&(D=this.fsw._throttle("readdir",e,1e3),!D))return;const o=this.fsw._getWatchedDir(n.path),a=new Set;let c=this.fsw._readdirp(e,{fileFilter:f=>n.filterPath(f),directoryFilter:f=>n.filterDir(f),depth:0}).on(Yo,async f=>{if(this.fsw.closed){c=void 0;return}const l=f.path;let p=L.join(e,l);if(a.add(l),!(f.stats.isSymbolicLink()&&await this._handleSymlink(f,e,p,l))){if(this.fsw.closed){c=void 0;return}(l===r||!r&&!o.has(l))&&(this.fsw._incrReadyCount(),p=L.join(s,L.relative(s,p)),this._addToNodeFs(p,u,n,i+1))}}).on(Jn,this._boundHandleError);return new Promise(f=>c.once(qo,()=>{if(this.fsw.closed){c=void 0;return}const l=D?D.clear():!1;f(),o.getChildren().filter(p=>p!==e&&!a.has(p)&&(!n.hasGlob||n.filterPath({fullPath:L.resolve(e,p)}))).forEach(p=>{this.fsw._remove(e,p)}),c=void 0,l&&this._handleRead(e,!1,n,r,s,i,D)}))}async _handleDir(e,u,n,r,s,i,D){const o=this.fsw._getWatchedDir(L.dirname(e)),a=o.has(L.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!s&&!a&&(!i.hasGlob||i.globFilter(e))&&this.fsw._emit(zo,e,u),o.add(L.basename(e)),this.fsw._getWatchedDir(e);let c,f;const l=this.fsw.options.depth;if((l==null||r<=l)&&!this.fsw._symlinkPaths.has(D)){if(!s&&(await this._handleRead(e,n,i,s,e,r,c),this.fsw.closed))return;f=this._watchWithNodeFs(e,(p,C)=>{C&&C.mtimeMs===0||this._handleRead(p,!1,i,s,e,r,c)})}return f}async _addToNodeFs(e,u,n,r,s){const i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;const D=this.fsw._getWatchHelpers(e,r);!D.hasGlob&&n&&(D.hasGlob=n.hasGlob,D.globFilter=n.globFilter,D.filterPath=o=>n.filterPath(o),D.filterDir=o=>n.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 a=this.fsw.options.followSymlinks&&!e.includes(Qo)&&!e.includes(Xo);let c;if(o.isDirectory()){const f=L.resolve(e),l=a?await Xt(e):e;if(this.fsw.closed||(c=await this._handleDir(D.watchPath,o,u,r,s,D,l),this.fsw.closed))return;f!==l&&l!==void 0&&this.fsw._symlinkPaths.set(f,l)}else if(o.isSymbolicLink()){const f=a?await Xt(e):e;if(this.fsw.closed)return;const l=L.dirname(D.watchPath);if(this.fsw._getWatchedDir(l).add(D.watchPath),this.fsw._emit(ut,D.watchPath,o),c=await this._handleDir(l,o,u,r,e,D,f),this.fsw.closed)return;f!==void 0&&this.fsw._symlinkPaths.set(L.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,Jt={exports:{}};const eu=De.default,I=K.default,{promisify:tu}=me.default;let ge;try{ge=at.require("fsevents")}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t)}if(ge){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&&(ge=void 0)}}const{EV_ADD:uu,EV_CHANGE:oa,EV_ADD_DIR:nr,EV_UNLINK:st,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_TYPE_FILE:Ca,FSEVENT_TYPE_DIRECTORY:xe,FSEVENT_TYPE_SYMLINK:rr,ROOT_GLOBSTAR:sr,DIR_SUFFIX:Fa,DOT_SLASH:ir,FUNCTION_TYPE:nu,EMPTY_FN:ga,IDENTITY_FN:_a}=et,ma=t=>isNaN(t)?{}:{depth:t},ru=tu(eu.stat),Aa=tu(eu.lstat),Dr=tu(eu.realpath),ya={stat:ru,lstat:Aa},ce=new Map,wa=10,Ra=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),ba=(t,e)=>({stop:ge.watch(t,e)});function va(t,e,u,n){let r=I.extname(e)?I.dirname(e):e;const s=I.dirname(r);let i=ce.get(r);Ba(s)&&(r=s);const D=I.resolve(t),o=D!==e,a=(f,l,p)=>{o&&(f=f.replace(e,D)),(f===D||!f.indexOf(D+I.sep))&&u(f,l,p)};let c=!1;for(const f of ce.keys())if(e.indexOf(I.resolve(f)+I.sep)===0){r=f,i=ce.get(r),c=!0;break}return i||c?i.listeners.add(a):(i={listeners:new Set([a]),rawEmitter:n,watcher:ba(r,(f,l)=>{if(!i.listeners.size)return;const p=ge.getInfo(f,l);i.listeners.forEach(C=>{C(f,l,p)}),i.rawEmitter(p.event,f,p)})},ce.set(r,i)),()=>{const f=i.listeners;if(f.delete(a),!f.size&&(ce.delete(r),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 ce.keys())if(u.indexOf(t)===0&&(e++,e>=wa))return!0;return!1},Sa=()=>ge&&ce.size<128,su=(t,e)=>{let u=0;for(;!t.indexOf(e)&&(t=I.dirname(t))!==e;)u++;return u},or=(t,e)=>t.type===xe&&e.isDirectory()||t.type===rr&&e.isSymbolicLink()||t.type===Ca&&e.isFile();class $a{constructor(e){this.fsw=e}checkIgnored(e,u){const n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,u))return n.add(e),u&&u.isDirectory()&&n.add(e+sr),!0;n.delete(e),n.delete(e+sr)}addOrChange(e,u,n,r,s,i,D,o){const a=s.has(i)?oa:uu;this.handleEvent(a,e,u,n,r,s,i,D,o)}async checkExists(e,u,n,r,s,i,D,o){try{const a=await ru(e);if(this.fsw.closed)return;or(D,a)?this.addOrChange(e,u,n,r,s,i,D,o):this.handleEvent(st,e,u,n,r,s,i,D,o)}catch(a){a.code==="EACCES"?this.addOrChange(e,u,n,r,s,i,D,o):this.handleEvent(st,e,u,n,r,s,i,D,o)}}handleEvent(e,u,n,r,s,i,D,o,a){if(!(this.fsw.closed||this.checkIgnored(u)))if(e===st){const c=o.type===xe;(c||i.has(D))&&this.fsw._remove(s,D,c)}else{if(e===uu){if(o.type===xe&&this.fsw._getWatchedDir(u),o.type===rr&&a.followSymlinks){const f=a.depth===void 0?void 0:su(n,r)+1;return this._addToFsEvents(u,!1,!0,f)}this.fsw._getWatchedDir(s).add(D)}const c=o.type===xe?e+Fa:e;this.fsw._emit(c,u),c===nr&&this._addToFsEvents(u,!1,!0)}}_watchWithFsEvents(e,u,n,r){if(this.fsw.closed||this.fsw._isIgnored(e))return;const s=this.fsw.options,D=va(e,u,async(o,a,c)=>{if(this.fsw.closed||s.depth!==void 0&&su(o,u)>s.depth)return;const f=n(I.join(e,I.relative(e,o)));if(r&&!r(f))return;const l=I.dirname(f),p=I.basename(f),C=this.fsw._getWatchedDir(c.type===xe?f:l);if(Ra.has(a)||c.event===pa)if(typeof s.ignored===nu){let F;try{F=await ru(f)}catch{}if(this.fsw.closed||this.checkIgnored(f,F))return;or(c,F)?this.addOrChange(f,o,u,l,C,p,c,s):this.handleEvent(st,f,o,u,l,C,p,c,s)}else this.checkExists(f,o,u,l,C,p,c,s);else switch(c.event){case fa:case ha:return this.addOrChange(f,o,u,l,C,p,c,s);case da:case Ea:return this.checkExists(f,o,u,l,C,p,c,s)}},this.fsw._emitRaw);return this.fsw._emitReady(),D}async _handleFsEventsSymlink(e,u,n,r){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(u))){this.fsw._symlinkPaths.set(u,!0),this.fsw._incrReadyCount();try{const s=await Dr(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(s))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(s||e,i=>{let D=e;return s&&s!==ir?D=i.replace(s,e):i!==ir&&(D=I.join(e,i)),n(D)},!1,r)}catch(s){if(this.fsw._handleError(s))return this.fsw._emitReady()}}}emitAdd(e,u,n,r,s){const i=n(e),D=u.isDirectory(),o=this.fsw._getWatchedDir(I.dirname(i)),a=I.basename(i);D&&this.fsw._getWatchedDir(i),!o.has(a)&&(o.add(a),(!r.ignoreInitial||s===!0)&&this.fsw._emit(D?nr:uu,i,u))}initWatch(e,u,n,r){if(this.fsw.closed)return;const s=this._watchWithFsEvents(n.watchPath,I.resolve(e||n.watchPath),r,n.globFilter);this.fsw._addPathCloser(u,s)}async _addToFsEvents(e,u,n,r){if(this.fsw.closed)return;const s=this.fsw.options,i=typeof u===nu?u:_a,D=this.fsw._getWatchHelpers(e);try{const o=await ya[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,s,n),r&&r>s.depth)return;this.fsw._readdirp(D.watchPath,{fileFilter:a=>D.filterPath(a),directoryFilter:a=>D.filterDir(a),...ma(s.depth-(r||0))}).on(la,a=>{if(this.fsw.closed||a.stats.isDirectory()&&!D.filterPath(a))return;const c=I.join(D.watchPath,a.path),{fullPath:f}=a;if(D.followSymlinks&&a.stats.isSymbolicLink()){const l=s.depth===void 0?void 0:su(c,I.resolve(D.watchPath))+1;this._handleFsEventsSymlink(c,f,i,l)}else this.emitAdd(c,a.stats,i,s,n)}).on(aa,ga).on(ca,()=>{this.fsw._emitReady()})}else this.emitAdd(D.watchPath,o,i,s,n),this.fsw._emitReady()}catch(o){(!o||this.fsw._handleError(o))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(s.persistent&&n!==!0)if(typeof u===nu)this.initWatch(void 0,e,D,i);else{let o;try{o=await Dr(D.watchPath)}catch{}this.initWatch(o,e,D,i)}}}Jt.exports=$a,Jt.exports.canUse=Sa;var Ta=Jt.exports;const{EventEmitter:xa}=Lr.default,iu=De.default,v=K.default,{promisify:ar}=me.default,Oa=vD,Du=OD.default,Na=KD,ou=$n,Ha=No,Pa=Rn,La=Da,lr=Ta,{EV_ALL:au,EV_READY:Ia,EV_ADD:it,EV_CHANGE:Oe,EV_UNLINK:cr,EV_ADD_DIR:ka,EV_UNLINK_DIR:Ma,EV_RAW:Wa,EV_ERROR:lu,STR_CLOSE:Ga,STR_END:ja,BACK_SLASH_RE:Ua,DOUBLE_SLASH_RE:fr,SLASH_OR_BACK_SLASH_RE:Ka,DOT_RE:Va,REPLACER_RE:za,SLASH:cu,SLASH_SLASH:Ya,BRACE_START:qa,BANG:fu,ONE_DOT:hr,TWO_DOTS:Xa,GLOBSTAR:Qa,SLASH_GLOBSTAR:hu,ANYMATCH_OPTS:du,STRING_TYPE:Eu,FUNCTION_TYPE:Za,EMPTY_STR:pu,EMPTY_FN:Ja,isWindows:el,isMacos:tl,isIBMi:ul}=et,nl=ar(iu.stat),rl=ar(iu.readdir),Cu=(t=[])=>Array.isArray(t)?t:[t],dr=(t,e=[])=>(t.forEach(u=>{Array.isArray(u)?dr(u,e):e.push(u)}),e),Er=t=>{const e=dr(Cu(t));if(!e.every(u=>typeof u===Eu))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Cr)},pr=t=>{let e=t.replace(Ua,cu),u=!1;for(e.startsWith(Ya)&&(u=!0);e.match(fr);)e=e.replace(fr,cu);return u&&(e=cu+e),e},Cr=t=>pr(v.normalize(pr(t))),Fr=(t=pu)=>e=>typeof e!==Eu?e:Cr(v.isAbsolute(e)?e:v.join(t,e)),sl=(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 il{constructor(e,u){this.path=e,this._removeWatcher=u,this.items=new Set}add(e){const{items:u}=this;u&&e!==hr&&e!==Xa&&u.add(e)}async remove(e){const{items:u}=this;if(!u||(u.delete(e),u.size>0))return;const n=this.path;try{await rl(n)}catch{this._removeWatcher&&this._removeWatcher(v.dirname(n),v.basename(n))}}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 Dl="stat",ol="lstat";class al{constructor(e,u,n,r){this.fsw=r,this.path=e=e.replace(za,pu),this.watchPath=u,this.fullWatchPath=v.resolve(u),this.hasGlob=u!==e,e===pu&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?Du(e,void 0,du):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(s=>{s.length>1&&s.pop()}),this.followSymlinks=n,this.statMethod=n?Dl:ol}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 n=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===Za?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,u)&&this.fsw._hasReadPermissions(u)}getDirParts(e){if(!this.hasGlob)return[];const u=[];return(e.includes(qa)?Ha.expand(e):[e]).forEach(r=>{u.push(v.relative(this.watchPath,r).split(Ka))}),u}filterDir(e){if(this.hasGlob){const u=this.getDirParts(this.checkGlobSymlink(e));let n=!1;this.unmatchedGlob=!this.dirParts.some(r=>r.every((s,i)=>(s===Qa&&(n=!0),n||!u[0][i]||Du(s,u[0][i],du))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class ll extends xa{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),lr.canUse()||(u.useFsEvents=!1),q(u,"usePolling")&&!u.useFsEvents&&(u.usePolling=tl),ul&&(u.usePolling=!0);const r=process.env.CHOKIDAR_USEPOLLING;if(r!==void 0){const o=r.toLowerCase();o==="false"||o==="0"?u.usePolling=!1:o==="true"||o==="1"?u.usePolling=!0:u.usePolling=!!o}const s=process.env.CHOKIDAR_INTERVAL;s&&(u.interval=Number.parseInt(s,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=Cu(u.ignored));let D=0;this._emitReady=()=>{D++,D>=this._readyCount&&(this._emitReady=Ja,this._readyEmitted=!0,process.nextTick(()=>this.emit(Ia)))},this._emitRaw=(...o)=>this.emit(Wa,...o),this._readyEmitted=!1,this.options=u,u.useFsEvents?this._fsEventsHandler=new lr(this):this._nodeFsHandler=new La(this),Object.freeze(u)}add(e,u,n){const{cwd:r,disableGlobbing:s}=this.options;this.closed=!1;let i=Er(e);return r&&(i=i.map(D=>{const o=sl(D,r);return s||!ou(D)?o:Pa(o)})),i=i.filter(D=>D.startsWith(fu)?(this._ignoredPaths.add(D.slice(1)),!1):(this._ignoredPaths.delete(D),this._ignoredPaths.delete(D+hu),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=i.length),this.options.persistent&&(this._readyCount*=2),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,!n,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=Er(e),{cwd:n}=this.options;return u.forEach(r=>{!v.isAbsolute(r)&&!this._closers.has(r)&&(n&&(r=v.join(n,r)),r=v.resolve(r)),this._closePath(r),this._ignoredPaths.add(r),this._watched.has(r)&&this._ignoredPaths.add(r+hu),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(n=>{const r=n();r instanceof Promise&&e.push(r)})),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,n)=>{const r=this.options.cwd?v.relative(this.options.cwd,n):n;e[r||hr]=u.getChildren().sort()}),e}emitWithAll(e,u){this.emit(...u),e!==lu&&this.emit(au,...u)}async _emit(e,u,n,r,s){if(this.closed)return;const i=this.options;el&&(u=v.normalize(u)),i.cwd&&(u=v.relative(i.cwd,u));const D=[e,u];s!==void 0?D.push(n,r,s):r!==void 0?D.push(n,r):n!==void 0&&D.push(n);const o=i.awaitWriteFinish;let a;if(o&&(a=this._pendingWrites.get(u)))return a.lastChange=new Date,this;if(i.atomic){if(e===cr)return this._pendingUnlinks.set(u,D),setTimeout(()=>{this._pendingUnlinks.forEach((c,f)=>{this.emit(...c),this.emit(au,...c),this._pendingUnlinks.delete(f)})},typeof i.atomic=="number"?i.atomic:100),this;e===it&&this._pendingUnlinks.has(u)&&(e=D[0]=Oe,this._pendingUnlinks.delete(u))}if(o&&(e===it||e===Oe)&&this._readyEmitted){const c=(f,l)=>{f?(e=D[0]=lu,D[1]=f,this.emitWithAll(e,D)):l&&(D.length>2?D[2]=l:D.push(l),this.emitWithAll(e,D))};return this._awaitWriteFinish(u,o.stabilityThreshold,e,c),this}if(e===Oe&&!this._throttle(Oe,u,50))return this;if(i.alwaysStat&&n===void 0&&(e===it||e===ka||e===Oe)){const c=i.cwd?v.join(i.cwd,u):u;let f;try{f=await nl(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(lu,e),e||this.closed}_throttle(e,u,n){this._throttled.has(e)||this._throttled.set(e,new Map);const r=this._throttled.get(e),s=r.get(u);if(s)return s.count++,!1;let i;const D=()=>{const a=r.get(u),c=a?a.count:0;return r.delete(u),clearTimeout(i),a&&clearTimeout(a.timeoutObject),c};i=setTimeout(D,n);const o={timeoutObject:i,clear:D,count:0};return r.set(u,o),o}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,u,n,r){let s,i=e;this.options.cwd&&!v.isAbsolute(e)&&(i=v.join(this.options.cwd,e));const D=new Date,o=a=>{iu.stat(i,(c,f)=>{if(c||!this._pendingWrites.has(e)){c&&c.code!=="ENOENT"&&r(c);return}const l=Number(new Date);a&&f.size!==a.size&&(this._pendingWrites.get(e).lastChange=l);const p=this._pendingWrites.get(e);l-p.lastChange>=u?(this._pendingWrites.delete(e),r(void 0,f)):s=setTimeout(o,this.options.awaitWriteFinish.pollInterval,f)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:D,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(s),n)}),s=setTimeout(o,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,u){if(this.options.atomic&&Va.test(e))return!0;if(!this._userIgnored){const{cwd:n}=this.options,r=this.options.ignored,s=r&&r.map(Fr(n)),i=Cu(s).filter(o=>typeof o===Eu&&!ou(o)).map(o=>o+hu),D=this._getGlobIgnored().map(Fr(n)).concat(s,i);this._userIgnored=Du(D,void 0,du)}return this._userIgnored([e,u])}_isntIgnored(e,u){return!this._isIgnored(e,u)}_getWatchHelpers(e,u){const n=u||this.options.disableGlobbing||!ou(e)?e:Na(e),r=this.options.followSymlinks;return new al(e,n,r,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 il(u,this._boundRemove)),this._watched.get(u)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;const n=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(n.toString(8)[0],10))}_remove(e,u,n){const r=v.join(e,u),s=v.resolve(r);if(n=n!=null?n:this._watched.has(r)||this._watched.has(s),!this._throttle("remove",r,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,u,!0),this._getWatchedDir(r).getChildren().forEach(l=>this._remove(r,l));const o=this._getWatchedDir(e),a=o.has(u);o.remove(u),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let c=r;if(this.options.cwd&&(c=v.relative(this.options.cwd,r)),this.options.awaitWriteFinish&&this._pendingWrites.has(c)&&this._pendingWrites.get(c).cancelWait()===it)return;this._watched.delete(r),this._watched.delete(s);const f=n?Ma:cr;a&&!this._isIgnored(r)&&this._emit(f,r),this.options.useFsEvents||this._closePath(r)}_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(n=>n()),this._closers.delete(e))}_addPathCloser(e,u){if(!u)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(u)}_readdirp(e,u){if(this.closed)return;const n={type:au,alwaysStat:!0,lstat:!0,...u};let r=Oa(e,n);return this._streams.add(r),r.once(Ga,()=>{r=void 0}),r.once(ja,()=>{r&&(this._streams.delete(r),r=void 0)}),r}}const cl=(t,e)=>{const u=new ll(e);return u.add(t),u};var fl=cl;const Fu=(t=!0)=>{let e=!1;return u=>{if(e||u==="unknown-flag")return!0;if(u==="argument")return e=!0,t}};function gr(t,e=process.argv.slice(2)){return wu(t,e,{ignore:Fu()}),e}let fe=!0;const _e=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let Ne=0;if(_e.process&&_e.process.env&&_e.process.stdout){const{FORCE_COLOR:t,NODE_DISABLE_COLORS:e,NO_COLOR:u,TERM:n,COLORTERM:r}=_e.process.env;e||u||t==="0"?fe=!1:t==="1"||t==="2"||t==="3"?fe=!0:n==="dumb"?fe=!1:"CI"in _e.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in _e.process.env)?fe=!0:fe=process.stdout.isTTY,fe&&(process.platform==="win32"||r&&(r==="truecolor"||r==="24bit")?Ne=3:n&&(n.endsWith("-256color")||n.endsWith("256"))?Ne=2:Ne=1)}let _r={enabled:fe,supportLevel:Ne};function mr(t,e,u=1){const n=`\x1B[${t}m`,r=`\x1B[${e}m`,s=new RegExp(`\\x1b\\[${e}m`,"g");return i=>_r.enabled&&_r.supportLevel>=u?n+(""+i).replace(s,n)+r:""+i}const hl=mr(90,39),dl=mr(96,39),El=()=>new Date().toLocaleTimeString(),gu=(...t)=>console.log(hl(El()),dl("[tsx]"),...t),pl="\x1Bc";function Cl(t,e){let u;return()=>{u&&clearTimeout(u),u=setTimeout(()=>t(),e)}}const Fl=async t=>{const e=new Promise(u=>{t.on("exit",u)});t.kill(),await e},Ar={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"}},gl=ni({name:"watch",parameters:["