@easbot/utils 0.1.7 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ 'use strict';var chunkPQC2BFS2_cjs=require('./chunk-PQC2BFS2.cjs'),Es=require('path'),xs=require('fs/promises'),Rn=require('fs'),lo=require('zod'),url=require('url'),events=require('events'),Pr=require('stream'),string_decoder=require('string_decoder');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var Es__default=/*#__PURE__*/_interopDefault(Es);var xs__default=/*#__PURE__*/_interopDefault(xs);var Rn__namespace=/*#__PURE__*/_interopNamespace(Rn);var lo__default=/*#__PURE__*/_interopDefault(lo);var Pr__default=/*#__PURE__*/_interopDefault(Pr);chunkPQC2BFS2_cjs.j();chunkPQC2BFS2_cjs.j();var wr=(e,t,i)=>{let s=e instanceof RegExp?Rs(e,i):e,h=t instanceof RegExp?Rs(t,i):t,n=s!==null&&h!=null&&uh(s,h,i);return n&&{start:n[0],end:n[1],pre:i.slice(0,n[0]),body:i.slice(n[0]+s.length,n[1]),post:i.slice(n[1]+h.length)}},Rs=(e,t)=>{let i=t.match(e);return i?i[0]:null},uh=(e,t,i)=>{let s,h,n,o,a,l=i.indexOf(e),u=i.indexOf(t,l+1),d=l;if(l>=0&&u>0){if(e===t)return [l,u];for(s=[],n=i.length;d>=0&&!a;){if(d===l)s.push(d),l=i.indexOf(e,d+1);else if(s.length===1){let f=s.pop();f!==void 0&&(a=[f,u]);}else h=s.pop(),h!==void 0&&h<n&&(n=h,o=u),u=i.indexOf(t,d+1);d=l<u&&l>=0?l:u;}s.length&&o!==void 0&&(a=[n,o]);}return a},yr="\0SLASH"+Math.random()+"\0",br="\0OPEN"+Math.random()+"\0",ws="\0CLOSE"+Math.random()+"\0",Sr="\0COMMA"+Math.random()+"\0",vr="\0PERIOD"+Math.random()+"\0",ph=new RegExp(yr,"g"),fh=new RegExp(br,"g"),dh=new RegExp(ws,"g"),gh=new RegExp(Sr,"g"),mh=new RegExp(vr,"g"),wh=/\\\\/g,yh=/\\{/g,bh=/\\}/g,Sh=/\\,/g,vh=/\\./g,Eh=1e5;function Vi(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function xh(e){return e.replace(wh,yr).replace(yh,br).replace(bh,ws).replace(Sh,Sr).replace(vh,vr)}function kh(e){return e.replace(ph,"\\").replace(fh,"{").replace(dh,"}").replace(gh,",").replace(mh,".")}function Er(e){if(!e)return [""];let t=[],i=wr("{","}",e);if(!i)return e.split(",");let{pre:s,body:h,post:n}=i,o=s.split(",");o[o.length-1]+="{"+h+"}";let a=Er(n);return n.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}function Rh(e,t={}){if(!e)return [];let{max:i=Eh}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),He(xh(e),i,true).map(kh)}function Ch(e){return "{"+e+"}"}function Oh(e){return /^-?0\d/.test(e)}function Ah(e,t){return e<=t}function Fh(e,t){return e>=t}function He(e,t,i){let s=[],h=wr("{","}",e);if(!h)return [e];let n=h.pre,o=h.post.length?He(h.post,t,false):[""];if(/\$$/.test(h.pre))for(let a=0;a<o.length&&a<t;a++){let l=n+"{"+h.body+"}"+o[a];s.push(l);}else {let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(h.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(h.body),u=a||l,d=h.body.indexOf(",")>=0;if(!u&&!d)return h.post.match(/,(?!,).*\}/)?(e=h.pre+"{"+h.body+ws+h.post,He(e,t,true)):[e];let f;if(u)f=h.body.split(/\.\./);else if(f=Er(h.body),f.length===1&&f[0]!==void 0&&(f=He(f[0],t,false).map(Ch),f.length===1))return o.map(S=>h.pre+f[0]+S);let w;if(u&&f[0]!==void 0&&f[1]!==void 0){let S=Vi(f[0]),E=Vi(f[1]),b=Math.max(f[0].length,f[1].length),x=f.length===3&&f[2]!==void 0?Math.abs(Vi(f[2])):1,v=Ah;E<S&&(x*=-1,v=Fh);let C=f.some(Oh);w=[];for(let F=S;v(F,E);F+=x){let T;if(l)T=String.fromCharCode(F),T==="\\"&&(T="");else if(T=String(F),C){let k=b-T.length;if(k>0){let M=new Array(k+1).join("0");F<0?T="-"+M+T.slice(1):T=M+T;}}w.push(T);}}else {w=[];for(let S=0;S<f.length;S++)w.push.apply(w,He(f[S],t,false));}for(let S=0;S<w.length;S++)for(let E=0;E<o.length&&s.length<t;E++){let b=n+w[S]+o[E];(!i||u||b)&&s.push(b);}}return s}var $i=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},Th={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",true],"[:alpha:]":["\\p{L}\\p{Nl}",true],"[:ascii:]":["\\x00-\\x7f",false],"[:blank:]":["\\p{Zs}\\t",true],"[:cntrl:]":["\\p{Cc}",true],"[:digit:]":["\\p{Nd}",true],"[:graph:]":["\\p{Z}\\p{C}",true,true],"[:lower:]":["\\p{Ll}",true],"[:print:]":["\\p{C}",true],"[:punct:]":["\\p{P}",true],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",true],"[:upper:]":["\\p{Lu}",true],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",true],"[:xdigit:]":["A-Fa-f0-9",false]},_e=e=>e.replace(/[[\]\\-]/g,"\\$&"),Mh=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Cs=e=>e.join(""),Lh=(e,t)=>{let i=t;if(e.charAt(i)!=="[")throw new Error("not in a brace expression");let s=[],h=[],n=i+1,o=false,a=false,l=false,u=false,d=i,f="";t:for(;n<e.length;){let E=e.charAt(n);if((E==="!"||E==="^")&&n===i+1){u=true,n++;continue}if(E==="]"&&o&&!l){d=n+1;break}if(o=true,E==="\\"&&!l){l=true,n++;continue}if(E==="["&&!l){for(let[b,[x,v,C]]of Object.entries(Th))if(e.startsWith(b,n)){if(f)return ["$.",false,e.length-i,true];n+=b.length,C?h.push(x):s.push(x),a=a||v;continue t}}if(l=false,f){E>f?s.push(_e(f)+"-"+_e(E)):E===f&&s.push(_e(E)),f="",n++;continue}if(e.startsWith("-]",n+1)){s.push(_e(E+"-")),n+=2;continue}if(e.startsWith("-",n+1)){f=E,n+=2;continue}s.push(_e(E)),n++;}if(d<n)return ["",false,0,false];if(!s.length&&!h.length)return ["$.",false,e.length-i,true];if(h.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!u){let E=s[0].length===2?s[0].slice(-1):s[0];return [Mh(E),false,d-i,false]}let w="["+(u?"^":"")+Cs(s)+"]",S="["+(u?"":"^")+Cs(h)+"]";return [s.length&&h.length?"("+w+"|"+S+")":s.length?w:S,a,d-i,true]},Re=(e,{windowsPathsNoEscape:t=false,magicalBraces:i=true}={})=>i?t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):t?e.replace(/\[([^\/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1"),Wh=new Set(["!","?","+","*","@"]),Os=e=>Wh.has(e),Dh="(?!(?:^|/)\\.\\.?(?:$|/))",ki="(?!\\.)",Ph=new Set(["[","."]),jh=new Set(["..","."]),zh=new Set("().*{}+?[]^$\\!"),Nh=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ys="[^/]",As=ys+"*?",Fs=ys+"+?",B,V,$t,W,_,Qt,ue,te,Dt,pe,Xe,ve,kr,ne,X,Li,ss,Rr,xr=(X=class{constructor(t,i,s={}){chunkPQC2BFS2_cjs.f(this,ve);chunkPQC2BFS2_cjs.d(this,"type");chunkPQC2BFS2_cjs.f(this,B);chunkPQC2BFS2_cjs.f(this,V);chunkPQC2BFS2_cjs.f(this,$t,false);chunkPQC2BFS2_cjs.f(this,W,[]);chunkPQC2BFS2_cjs.f(this,_);chunkPQC2BFS2_cjs.f(this,Qt);chunkPQC2BFS2_cjs.f(this,ue);chunkPQC2BFS2_cjs.f(this,te,false);chunkPQC2BFS2_cjs.f(this,Dt);chunkPQC2BFS2_cjs.f(this,pe);chunkPQC2BFS2_cjs.f(this,Xe,false);this.type=t,t&&chunkPQC2BFS2_cjs.g(this,V,true),chunkPQC2BFS2_cjs.g(this,_,i),chunkPQC2BFS2_cjs.g(this,B,chunkPQC2BFS2_cjs.e(this,_)?chunkPQC2BFS2_cjs.e(chunkPQC2BFS2_cjs.e(this,_),B):this),chunkPQC2BFS2_cjs.g(this,Dt,chunkPQC2BFS2_cjs.e(this,B)===this?s:chunkPQC2BFS2_cjs.e(chunkPQC2BFS2_cjs.e(this,B),Dt)),chunkPQC2BFS2_cjs.g(this,ue,chunkPQC2BFS2_cjs.e(this,B)===this?[]:chunkPQC2BFS2_cjs.e(chunkPQC2BFS2_cjs.e(this,B),ue)),t==="!"&&!chunkPQC2BFS2_cjs.e(chunkPQC2BFS2_cjs.e(this,B),te)&&chunkPQC2BFS2_cjs.e(this,ue).push(this),chunkPQC2BFS2_cjs.g(this,Qt,chunkPQC2BFS2_cjs.e(this,_)?chunkPQC2BFS2_cjs.e(chunkPQC2BFS2_cjs.e(this,_),W).length:0);}get hasMagic(){if(chunkPQC2BFS2_cjs.e(this,V)!==void 0)return chunkPQC2BFS2_cjs.e(this,V);for(let t of chunkPQC2BFS2_cjs.e(this,W))if(typeof t!="string"&&(t.type||t.hasMagic))return chunkPQC2BFS2_cjs.g(this,V,true);return chunkPQC2BFS2_cjs.e(this,V)}toString(){return chunkPQC2BFS2_cjs.e(this,pe)!==void 0?chunkPQC2BFS2_cjs.e(this,pe):this.type?chunkPQC2BFS2_cjs.g(this,pe,this.type+"("+chunkPQC2BFS2_cjs.e(this,W).map(t=>String(t)).join("|")+")"):chunkPQC2BFS2_cjs.g(this,pe,chunkPQC2BFS2_cjs.e(this,W).map(t=>String(t)).join(""))}push(...t){for(let i of t)if(i!==""){if(typeof i!="string"&&!(i instanceof X&&chunkPQC2BFS2_cjs.e(i,_)===this))throw new Error("invalid part: "+i);chunkPQC2BFS2_cjs.e(this,W).push(i);}}toJSON(){let t=this.type===null?chunkPQC2BFS2_cjs.e(this,W).slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...chunkPQC2BFS2_cjs.e(this,W).map(i=>i.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===chunkPQC2BFS2_cjs.e(this,B)||chunkPQC2BFS2_cjs.e(chunkPQC2BFS2_cjs.e(this,B),te)&&chunkPQC2BFS2_cjs.e(this,_)?.type==="!")&&t.push({}),t}isStart(){if(chunkPQC2BFS2_cjs.e(this,B)===this)return true;if(!chunkPQC2BFS2_cjs.e(this,_)?.isStart())return false;if(chunkPQC2BFS2_cjs.e(this,Qt)===0)return true;let t=chunkPQC2BFS2_cjs.e(this,_);for(let i=0;i<chunkPQC2BFS2_cjs.e(this,Qt);i++){let s=chunkPQC2BFS2_cjs.e(t,W)[i];if(!(s instanceof X&&s.type==="!"))return false}return true}isEnd(){if(chunkPQC2BFS2_cjs.e(this,B)===this||chunkPQC2BFS2_cjs.e(this,_)?.type==="!")return true;if(!chunkPQC2BFS2_cjs.e(this,_)?.isEnd())return false;if(!this.type)return chunkPQC2BFS2_cjs.e(this,_)?.isEnd();let t=chunkPQC2BFS2_cjs.e(this,_)?chunkPQC2BFS2_cjs.e(chunkPQC2BFS2_cjs.e(this,_),W).length:0;return chunkPQC2BFS2_cjs.e(this,Qt)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this));}clone(t){let i=new X(this.type,t);for(let s of chunkPQC2BFS2_cjs.e(this,W))i.copyIn(s);return i}static fromGlob(t,i={}){var h;let s=new X(null,void 0,i);return chunkPQC2BFS2_cjs.h(h=X,ne,Li).call(h,t,s,0,i),s}toMMPattern(){if(this!==chunkPQC2BFS2_cjs.e(this,B))return chunkPQC2BFS2_cjs.e(this,B).toMMPattern();let t=this.toString(),[i,s,h,n]=this.toRegExpSource();if(!(h||chunkPQC2BFS2_cjs.e(this,V)||chunkPQC2BFS2_cjs.e(this,Dt).nocase&&!chunkPQC2BFS2_cjs.e(this,Dt).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let o=(chunkPQC2BFS2_cjs.e(this,Dt).nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${i}$`,o),{_src:i,_glob:t})}get options(){return chunkPQC2BFS2_cjs.e(this,Dt)}toRegExpSource(t){let i=t??!!chunkPQC2BFS2_cjs.e(this,Dt).dot;if(chunkPQC2BFS2_cjs.e(this,B)===this&&chunkPQC2BFS2_cjs.h(this,ve,kr).call(this),!this.type){let l=this.isStart()&&this.isEnd()&&!chunkPQC2BFS2_cjs.e(this,W).some(w=>typeof w!="string"),u=chunkPQC2BFS2_cjs.e(this,W).map(w=>{var v;let[S,E,b,x]=typeof w=="string"?chunkPQC2BFS2_cjs.h(v=X,ne,Rr).call(v,w,chunkPQC2BFS2_cjs.e(this,V),l):w.toRegExpSource(t);return chunkPQC2BFS2_cjs.g(this,V,chunkPQC2BFS2_cjs.e(this,V)||b),chunkPQC2BFS2_cjs.g(this,$t,chunkPQC2BFS2_cjs.e(this,$t)||x),S}).join(""),d="";if(this.isStart()&&typeof chunkPQC2BFS2_cjs.e(this,W)[0]=="string"&&!(chunkPQC2BFS2_cjs.e(this,W).length===1&&jh.has(chunkPQC2BFS2_cjs.e(this,W)[0]))){let w=Ph,S=i&&w.has(u.charAt(0))||u.startsWith("\\.")&&w.has(u.charAt(2))||u.startsWith("\\.\\.")&&w.has(u.charAt(4)),E=!i&&!t&&w.has(u.charAt(0));d=S?Dh:E?ki:"";}let f="";return this.isEnd()&&chunkPQC2BFS2_cjs.e(chunkPQC2BFS2_cjs.e(this,B),te)&&chunkPQC2BFS2_cjs.e(this,_)?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,Re(u),chunkPQC2BFS2_cjs.g(this,V,!!chunkPQC2BFS2_cjs.e(this,V)),chunkPQC2BFS2_cjs.e(this,$t)]}let s=this.type==="*"||this.type==="+",h=this.type==="!"?"(?:(?!(?:":"(?:",n=chunkPQC2BFS2_cjs.h(this,ve,ss).call(this,i);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let l=this.toString();return chunkPQC2BFS2_cjs.g(this,W,[l]),this.type=null,chunkPQC2BFS2_cjs.g(this,V,void 0),[l,Re(this.toString()),false,false]}let o=!s||t||i||!ki?"":chunkPQC2BFS2_cjs.h(this,ve,ss).call(this,true);o===n&&(o=""),o&&(n=`(?:${n})(?:${o})*?`);let a="";if(this.type==="!"&&chunkPQC2BFS2_cjs.e(this,Xe))a=(this.isStart()&&!i?ki:"")+Fs;else {let l=this.type==="!"?"))"+(this.isStart()&&!i&&!t?ki:"")+As+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=h+n+l;}return [a,Re(n),chunkPQC2BFS2_cjs.g(this,V,!!chunkPQC2BFS2_cjs.e(this,V)),chunkPQC2BFS2_cjs.e(this,$t)]}},B=new WeakMap,V=new WeakMap,$t=new WeakMap,W=new WeakMap,_=new WeakMap,Qt=new WeakMap,ue=new WeakMap,te=new WeakMap,Dt=new WeakMap,pe=new WeakMap,Xe=new WeakMap,ve=new WeakSet,kr=function(){if(this!==chunkPQC2BFS2_cjs.e(this,B))throw new Error("should only call on root");if(chunkPQC2BFS2_cjs.e(this,te))return this;this.toString(),chunkPQC2BFS2_cjs.g(this,te,true);let t;for(;t=chunkPQC2BFS2_cjs.e(this,ue).pop();){if(t.type!=="!")continue;let i=t,s=chunkPQC2BFS2_cjs.e(i,_);for(;s;){for(let h=chunkPQC2BFS2_cjs.e(i,Qt)+1;!s.type&&h<chunkPQC2BFS2_cjs.e(s,W).length;h++)for(let n of chunkPQC2BFS2_cjs.e(t,W)){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(chunkPQC2BFS2_cjs.e(s,W)[h]);}i=s,s=chunkPQC2BFS2_cjs.e(i,_);}}return this},ne=new WeakSet,Li=function(t,i,s,h){var S,E;let n=false,o=false,a=-1,l=false;if(i.type===null){let b=s,x="";for(;b<t.length;){let v=t.charAt(b++);if(n||v==="\\"){n=!n,x+=v;continue}if(o){b===a+1?(v==="^"||v==="!")&&(l=true):v==="]"&&!(b===a+2&&l)&&(o=false),x+=v;continue}else if(v==="["){o=true,a=b,l=false,x+=v;continue}if(!h.noext&&Os(v)&&t.charAt(b)==="("){i.push(x),x="";let C=new X(v,i);b=chunkPQC2BFS2_cjs.h(S=X,ne,Li).call(S,t,C,b,h),i.push(C);continue}x+=v;}return i.push(x),b}let u=s+1,d=new X(null,i),f=[],w="";for(;u<t.length;){let b=t.charAt(u++);if(n||b==="\\"){n=!n,w+=b;continue}if(o){u===a+1?(b==="^"||b==="!")&&(l=true):b==="]"&&!(u===a+2&&l)&&(o=false),w+=b;continue}else if(b==="["){o=true,a=u,l=false,w+=b;continue}if(Os(b)&&t.charAt(u)==="("){d.push(w),w="";let x=new X(b,d);d.push(x),u=chunkPQC2BFS2_cjs.h(E=X,ne,Li).call(E,t,x,u,h);continue}if(b==="|"){d.push(w),w="",f.push(d),d=new X(null,i);continue}if(b===")")return w===""&&chunkPQC2BFS2_cjs.e(i,W).length===0&&chunkPQC2BFS2_cjs.g(i,Xe,true),d.push(w),w="",i.push(...f,d),u;w+=b;}return i.type=null,chunkPQC2BFS2_cjs.g(i,V,void 0),chunkPQC2BFS2_cjs.g(i,W,[t.substring(s-1)]),u},ss=function(t){return chunkPQC2BFS2_cjs.e(this,W).map(i=>{if(typeof i=="string")throw new Error("string type in extglob ast??");let[s,h,n,o]=i.toRegExpSource(t);return chunkPQC2BFS2_cjs.g(this,$t,chunkPQC2BFS2_cjs.e(this,$t)||o),s}).filter(i=>!(this.isStart()&&this.isEnd())||!!i).join("|")},Rr=function(t,i,s=false){let h=false,n="",o=false,a=false;for(let l=0;l<t.length;l++){let u=t.charAt(l);if(h){h=false,n+=(zh.has(u)?"\\":"")+u;continue}if(u==="*"){if(a)continue;a=true,n+=s&&/^[*]+$/.test(t)?Fs:As,i=true;continue}else a=false;if(u==="\\"){l===t.length-1?n+="\\\\":h=true;continue}if(u==="["){let[d,f,w,S]=Lh(t,l);if(w){n+=d,o=o||f,l+=w-1,i=i||S;continue}}if(u==="?"){n+=ys,i=true;continue}n+=Nh(u);}return [n,Re(t),!!i,o]},chunkPQC2BFS2_cjs.f(X,ne),X),Cr=(e,{windowsPathsNoEscape:t=false,magicalBraces:i=false}={})=>i?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),nt=(e,t,i={})=>($i(t),!i.nocomment&&t.charAt(0)==="#"?false:new oe(t,i).match(e)),_h=/^\*+([^+@!?\*\[\(]*)$/,$h=e=>t=>!t.startsWith(".")&&t.endsWith(e),Bh=e=>t=>t.endsWith(e),Uh=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),Gh=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Ih=/^\*+\.\*+$/,Hh=e=>!e.startsWith(".")&&e.includes("."),qh=e=>e!=="."&&e!==".."&&e.includes("."),Zh=/^\.\*+$/,Jh=e=>e!=="."&&e!==".."&&e.startsWith("."),Vh=/^\*+$/,Yh=e=>e.length!==0&&!e.startsWith("."),Kh=e=>e.length!==0&&e!=="."&&e!=="..",Xh=/^\?+([^+@!?\*\[\(]*)?$/,Qh=([e,t=""])=>{let i=Or([e]);return t?(t=t.toLowerCase(),s=>i(s)&&s.toLowerCase().endsWith(t)):i},tn=([e,t=""])=>{let i=Ar([e]);return t?(t=t.toLowerCase(),s=>i(s)&&s.toLowerCase().endsWith(t)):i},en=([e,t=""])=>{let i=Ar([e]);return t?s=>i(s)&&s.endsWith(t):i},sn=([e,t=""])=>{let i=Or([e]);return t?s=>i(s)&&s.endsWith(t):i},Or=([e])=>{let t=e.length;return i=>i.length===t&&!i.startsWith(".")},Ar=([e])=>{let t=e.length;return i=>i.length===t&&i!=="."&&i!==".."},Fr=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ts={win32:{sep:"\\"},posix:{sep:"/"}},rn=Fr==="win32"?Ts.win32.sep:Ts.posix.sep;nt.sep=rn;var ht=Symbol("globstar **");nt.GLOBSTAR=ht;var hn="[^/]",nn=hn+"*?",on="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",an="(?:(?!(?:\\/|^)\\.).)*?",ln=(e,t={})=>i=>nt(i,e,t);nt.filter=ln;var gt=(e,t={})=>Object.assign({},e,t),cn=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return nt;let t=nt;return Object.assign((i,s,h={})=>t(i,s,gt(e,h)),{Minimatch:class extends t.Minimatch{constructor(i,s={}){super(i,gt(e,s));}static defaults(i){return t.defaults(gt(e,i)).Minimatch}},AST:class extends t.AST{constructor(i,s,h={}){super(i,s,gt(e,h));}static fromGlob(i,s={}){return t.AST.fromGlob(i,gt(e,s))}},unescape:(i,s={})=>t.unescape(i,gt(e,s)),escape:(i,s={})=>t.escape(i,gt(e,s)),filter:(i,s={})=>t.filter(i,gt(e,s)),defaults:i=>t.defaults(gt(e,i)),makeRe:(i,s={})=>t.makeRe(i,gt(e,s)),braceExpand:(i,s={})=>t.braceExpand(i,gt(e,s)),match:(i,s,h={})=>t.match(i,s,gt(e,h)),sep:t.sep,GLOBSTAR:ht})};nt.defaults=cn;var Tr=(e,t={})=>($i(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Rh(e,{max:t.braceExpandMax}));nt.braceExpand=Tr;var un=(e,t={})=>new oe(e,t).makeRe();nt.makeRe=un;var pn=(e,t,i={})=>{let s=new oe(t,i);return e=e.filter(h=>s.match(h)),s.options.nonull&&!e.length&&e.push(t),e};nt.match=pn;var Ms=/[?*]|[+@!]\(.*?\)|\[|\]/,fn=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),oe=class{constructor(e,t={}){chunkPQC2BFS2_cjs.d(this,"options");chunkPQC2BFS2_cjs.d(this,"set");chunkPQC2BFS2_cjs.d(this,"pattern");chunkPQC2BFS2_cjs.d(this,"windowsPathsNoEscape");chunkPQC2BFS2_cjs.d(this,"nonegate");chunkPQC2BFS2_cjs.d(this,"negate");chunkPQC2BFS2_cjs.d(this,"comment");chunkPQC2BFS2_cjs.d(this,"empty");chunkPQC2BFS2_cjs.d(this,"preserveMultipleSlashes");chunkPQC2BFS2_cjs.d(this,"partial");chunkPQC2BFS2_cjs.d(this,"globSet");chunkPQC2BFS2_cjs.d(this,"globParts");chunkPQC2BFS2_cjs.d(this,"nocase");chunkPQC2BFS2_cjs.d(this,"isWindows");chunkPQC2BFS2_cjs.d(this,"platform");chunkPQC2BFS2_cjs.d(this,"windowsNoMagicRoot");chunkPQC2BFS2_cjs.d(this,"regexp");$i(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||Fr,this.isWindows=this.platform==="win32";let i="allowWindowsEscape";this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t[i]===false,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=false,this.nonegate=!!t.nonegate,this.comment=false,this.empty=false,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make();}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return true;for(let e of this.set)for(let t of e)if(typeof t!="string")return true;return false}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=true;return}if(!e){this.empty=true;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...h)=>console.error(...h)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(h=>this.slashSplit(h));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let s=this.globParts.map((h,n,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=h[0]===""&&h[1]===""&&(h[2]==="?"||!Ms.test(h[2]))&&!Ms.test(h[3]),l=/^[a-z]:/i.test(h[0]);if(a)return [...h.slice(0,4),...h.slice(4).map(u=>this.parse(u))];if(l)return [h[0],...h.slice(1).map(u=>this.parse(u))]}return h.map(a=>this.parse(a))});if(this.debug(this.pattern,s),this.set=s.filter(h=>h.indexOf(false)===-1),this.isWindows)for(let h=0;h<this.set.length;h++){let n=this.set[h];n[0]===""&&n[1]===""&&this.globParts[h][2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])&&(n[2]="?");}this.debug(this.pattern,this.set);}preprocess(e){if(this.options.noglobstar)for(let i=0;i<e.length;i++)for(let s=0;s<e[i].length;s++)e[i][s]==="**"&&(e[i][s]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let i=-1;for(;(i=t.indexOf("**",i+1))!==-1;){let s=i;for(;t[s+1]==="**";)s++;s!==i&&t.splice(i,s-i);}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((i,s)=>{let h=i[i.length-1];return s==="**"&&h==="**"?i:s===".."&&h&&h!==".."&&h!=="."&&h!=="**"?(i.pop(),i):(i.push(s),i)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=false;do{if(t=false,!this.preserveMultipleSlashes){for(let s=1;s<e.length-1;s++){let h=e[s];s===1&&h===""&&e[0]===""||(h==="."||h==="")&&(t=true,e.splice(s,1),s--);}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=true,e.pop());}let i=0;for(;(i=e.indexOf("..",i+1))!==-1;){let s=e[i-1];s&&s!=="."&&s!==".."&&s!=="**"&&(t=true,e.splice(i-1,2),i-=2);}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=false;do{t=false;for(let i of e){let s=-1;for(;(s=i.indexOf("**",s+1))!==-1;){let n=s;for(;i[n+1]==="**";)n++;n>s&&i.splice(s+1,n-s);let o=i[s+1],a=i[s+2],l=i[s+3];if(o!==".."||!a||a==="."||a===".."||!l||l==="."||l==="..")continue;t=true,i.splice(s,1);let u=i.slice(0);u[s]="**",e.push(u),s--;}if(!this.preserveMultipleSlashes){for(let n=1;n<i.length-1;n++){let o=i[n];n===1&&o===""&&i[0]===""||(o==="."||o==="")&&(t=true,i.splice(n,1),n--);}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(t=true,i.pop());}let h=0;for(;(h=i.indexOf("..",h+1))!==-1;){let n=i[h-1];if(n&&n!=="."&&n!==".."&&n!=="**"){t=true;let o=h===1&&i[h+1]==="**"?["."]:[];i.splice(h-1,2,...o),i.length===0&&i.push(""),h-=2;}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let i=t+1;i<e.length;i++){let s=this.partsMatch(e[t],e[i],!this.preserveMultipleSlashes);if(s){e[t]=[],e[i]=s;break}}return e.filter(t=>t.length)}partsMatch(e,t,i=false){let s=0,h=0,n=[],o="";for(;s<e.length&&h<t.length;)if(e[s]===t[h])n.push(o==="b"?t[h]:e[s]),s++,h++;else if(i&&e[s]==="**"&&t[h]===e[s+1])n.push(e[s]),s++;else if(i&&t[h]==="**"&&e[s]===t[h+1])n.push(t[h]),h++;else if(e[s]==="*"&&t[h]&&(this.options.dot||!t[h].startsWith("."))&&t[h]!=="**"){if(o==="b")return false;o="a",n.push(e[s]),s++,h++;}else if(t[h]==="*"&&e[s]&&(this.options.dot||!e[s].startsWith("."))&&e[s]!=="**"){if(o==="a")return false;o="b",n.push(t[h]),s++,h++;}else return false;return e.length===t.length&&n}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=false,i=0;for(let s=0;s<e.length&&e.charAt(s)==="!";s++)t=!t,i++;i&&(this.pattern=e.slice(i)),this.negate=t;}matchOne(e,t,i=false){let s=this.options;if(this.isWindows){let E=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),b=!E&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),x=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),v=!x&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),C=b?3:E?0:void 0,F=v?3:x?0:void 0;if(typeof C=="number"&&typeof F=="number"){let[T,k]=[e[C],t[F]];T.toLowerCase()===k.toLowerCase()&&(t[F]=T,F>C?t=t.slice(F):C>F&&(e=e.slice(C)));}}let{optimizationLevel:h=1}=this.options;h>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var n=0,o=0,a=e.length,l=t.length;n<a&&o<l;n++,o++){this.debug("matchOne loop");var u=t[o],d=e[n];if(this.debug(t,u,d),u===false)return false;if(u===ht){this.debug("GLOBSTAR",[t,u,d]);var f=n,w=o+1;if(w===l){for(this.debug("** at the end");n<a;n++)if(e[n]==="."||e[n]===".."||!s.dot&&e[n].charAt(0)===".")return false;return true}for(;f<a;){var S=e[f];if(this.debug(`
2
+ globstar while`,e,f,t,w,S),this.matchOne(e.slice(f),t.slice(w),i))return this.debug("globstar found match!",f,a,S),true;if(S==="."||S===".."||!s.dot&&S.charAt(0)==="."){this.debug("dot detected!",e,f,t,w);break}this.debug("globstar swallow a segment, and continue"),f++;}return !!(i&&(this.debug(`
3
+ >>> no match, partial?`,e,f,t,w),f===a))}let E;if(typeof u=="string"?(E=d===u,this.debug("string match",u,d,E)):(E=u.test(d),this.debug("pattern match",u,d,E)),!E)return false}if(n===a&&o===l)return true;if(n===a)return i;if(o===l)return n===a-1&&e[n]==="";throw new Error("wtf?")}braceExpand(){return Tr(this.pattern,this.options)}parse(e){$i(e);let t=this.options;if(e==="**")return ht;if(e==="")return "";let i,s=null;(i=e.match(Vh))?s=t.dot?Kh:Yh:(i=e.match(_h))?s=(t.nocase?t.dot?Gh:Uh:t.dot?Bh:$h)(i[1]):(i=e.match(Xh))?s=(t.nocase?t.dot?tn:Qh:t.dot?en:sn)(i):(i=e.match(Ih))?s=t.dot?qh:Hh:(i=e.match(Zh))&&(s=Jh);let h=xr.fromGlob(e,this.options).toMMPattern();return s&&typeof h=="object"&&Reflect.defineProperty(h,"test",{value:s}),h}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;let e=this.set;if(!e.length)return this.regexp=false,this.regexp;let t=this.options,i=t.noglobstar?nn:t.dot?on:an,s=new Set(t.nocase?["i"]:[]),h=e.map(a=>{let l=a.map(d=>{if(d instanceof RegExp)for(let f of d.flags.split(""))s.add(f);return typeof d=="string"?fn(d):d===ht?ht:d._src});l.forEach((d,f)=>{let w=l[f+1],S=l[f-1];d!==ht||S===ht||(S===void 0?w!==void 0&&w!==ht?l[f+1]="(?:\\/|"+i+"\\/)?"+w:l[f]=i:w===void 0?l[f-1]=S+"(?:\\/|\\/"+i+")?":w!==ht&&(l[f-1]=S+"(?:\\/|\\/"+i+"\\/)"+w,l[f+1]=ht));});let u=l.filter(d=>d!==ht);if(this.partial&&u.length>=1){let d=[];for(let f=1;f<=u.length;f++)d.push(u.slice(0,f).join("/"));return "(?:"+d.join("|")+")"}return u.join("/")}).join("|"),[n,o]=e.length>1?["(?:",")"]:["",""];h="^"+n+h+o+"$",this.partial&&(h="^(?:\\/|"+n+h.slice(1,-1)+o+")$"),this.negate&&(h="^(?!"+h+").+$");try{this.regexp=new RegExp(h,[...s].join(""));}catch{this.regexp=false;}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return false;if(this.empty)return e==="";if(e==="/"&&t)return true;let i=this.options;this.isWindows&&(e=e.split("\\").join("/"));let s=this.slashSplit(e);this.debug(this.pattern,"split",s);let h=this.set;this.debug(this.pattern,"set",h);let n=s[s.length-1];if(!n)for(let o=s.length-2;!n&&o>=0;o--)n=s[o];for(let o=0;o<h.length;o++){let a=h[o],l=s;if(i.matchBase&&a.length===1&&(l=[n]),this.matchOne(l,a,t))return i.flipNegate?true:!this.negate}return i.flipNegate?false:this.negate}static defaults(e){return nt.defaults(e).Minimatch}};nt.AST=xr;nt.Minimatch=oe;nt.escape=Cr;nt.unescape=Re;var gn=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Mr=new Set,rs=typeof process=="object"&&process?process:{},Lr=(e,t,i,s)=>{typeof rs.emitWarning=="function"?rs.emitWarning(e,t,i,s):console.error(`[${i}] ${t}: ${e}`);},Bi=globalThis.AbortController,Ls=globalThis.AbortSignal;if(typeof Bi>"u"){Ls=class{constructor(){chunkPQC2BFS2_cjs.d(this,"onabort");chunkPQC2BFS2_cjs.d(this,"_onabort",[]);chunkPQC2BFS2_cjs.d(this,"reason");chunkPQC2BFS2_cjs.d(this,"aborted",false);}addEventListener(i,s){this._onabort.push(s);}},Bi=class{constructor(){chunkPQC2BFS2_cjs.d(this,"signal",new Ls);t();}abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let e=rs.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{e&&(e=false,Lr("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t));};}var mn=e=>!Mr.has(e),Vt=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Wr=e=>Vt(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?Wi:null:null,Wi=class extends Array{constructor(e){super(e),this.fill(0);}},zt,Ce,wn=(zt=class{constructor(t,i){chunkPQC2BFS2_cjs.d(this,"heap");chunkPQC2BFS2_cjs.d(this,"length");if(!chunkPQC2BFS2_cjs.e(zt,Ce))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(t),this.length=0;}static create(t){let i=Wr(t);if(!i)return [];chunkPQC2BFS2_cjs.g(zt,Ce,true);let s=new zt(t,i);return chunkPQC2BFS2_cjs.g(zt,Ce,false),s}push(t){this.heap[this.length++]=t;}pop(){return this.heap[--this.length]}},Ce=new WeakMap,chunkPQC2BFS2_cjs.f(zt,Ce,false),zt),Zs,Js,wt,ct,xt,fe,kt,Oe,Ae,Rt,U,Ct,$,D,A,it,ut,tt,Y,Ot,K,At,Ft,pt,ft,Tt,ee,st,Fe,y,hs,de,Bt,Qe,dt,Dr,ge,Te,ti,Yt,Kt,ns,Di,Pi,L,os,qe,Xt,as,Me,Ii=(Me=class{constructor(t){chunkPQC2BFS2_cjs.f(this,y);chunkPQC2BFS2_cjs.f(this,wt);chunkPQC2BFS2_cjs.f(this,ct);chunkPQC2BFS2_cjs.f(this,xt);chunkPQC2BFS2_cjs.f(this,fe);chunkPQC2BFS2_cjs.f(this,kt);chunkPQC2BFS2_cjs.f(this,Oe);chunkPQC2BFS2_cjs.f(this,Ae);chunkPQC2BFS2_cjs.f(this,Rt);chunkPQC2BFS2_cjs.d(this,"ttl");chunkPQC2BFS2_cjs.d(this,"ttlResolution");chunkPQC2BFS2_cjs.d(this,"ttlAutopurge");chunkPQC2BFS2_cjs.d(this,"updateAgeOnGet");chunkPQC2BFS2_cjs.d(this,"updateAgeOnHas");chunkPQC2BFS2_cjs.d(this,"allowStale");chunkPQC2BFS2_cjs.d(this,"noDisposeOnSet");chunkPQC2BFS2_cjs.d(this,"noUpdateTTL");chunkPQC2BFS2_cjs.d(this,"maxEntrySize");chunkPQC2BFS2_cjs.d(this,"sizeCalculation");chunkPQC2BFS2_cjs.d(this,"noDeleteOnFetchRejection");chunkPQC2BFS2_cjs.d(this,"noDeleteOnStaleGet");chunkPQC2BFS2_cjs.d(this,"allowStaleOnFetchAbort");chunkPQC2BFS2_cjs.d(this,"allowStaleOnFetchRejection");chunkPQC2BFS2_cjs.d(this,"ignoreFetchAbort");chunkPQC2BFS2_cjs.f(this,U);chunkPQC2BFS2_cjs.f(this,Ct);chunkPQC2BFS2_cjs.f(this,$);chunkPQC2BFS2_cjs.f(this,D);chunkPQC2BFS2_cjs.f(this,A);chunkPQC2BFS2_cjs.f(this,it);chunkPQC2BFS2_cjs.f(this,ut);chunkPQC2BFS2_cjs.f(this,tt);chunkPQC2BFS2_cjs.f(this,Y);chunkPQC2BFS2_cjs.f(this,Ot);chunkPQC2BFS2_cjs.f(this,K);chunkPQC2BFS2_cjs.f(this,At);chunkPQC2BFS2_cjs.f(this,Ft);chunkPQC2BFS2_cjs.f(this,pt);chunkPQC2BFS2_cjs.f(this,ft);chunkPQC2BFS2_cjs.f(this,Tt);chunkPQC2BFS2_cjs.f(this,ee);chunkPQC2BFS2_cjs.f(this,st);chunkPQC2BFS2_cjs.f(this,Fe);chunkPQC2BFS2_cjs.f(this,de,()=>{});chunkPQC2BFS2_cjs.f(this,Bt,()=>{});chunkPQC2BFS2_cjs.f(this,Qe,()=>{});chunkPQC2BFS2_cjs.f(this,dt,()=>false);chunkPQC2BFS2_cjs.f(this,ge,t=>{});chunkPQC2BFS2_cjs.f(this,Te,(t,i,s)=>{});chunkPQC2BFS2_cjs.f(this,ti,(t,i,s,h)=>{if(s||h)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});chunkPQC2BFS2_cjs.d(this,Zs,"LRUCache");let{max:i=0,ttl:s,ttlResolution:h=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:l,dispose:u,onInsert:d,disposeAfter:f,noDisposeOnSet:w,noUpdateTTL:S,maxSize:E=0,maxEntrySize:b=0,sizeCalculation:x,fetchMethod:v,memoMethod:C,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:M,ignoreFetchAbort:j,perf:N}=t;if(N!==void 0&&typeof N?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(chunkPQC2BFS2_cjs.g(this,Rt,N??gn),i!==0&&!Vt(i))throw new TypeError("max option must be a nonnegative integer");let P=i?Wr(i):Array;if(!P)throw new Error("invalid max value: "+i);if(chunkPQC2BFS2_cjs.g(this,wt,i),chunkPQC2BFS2_cjs.g(this,ct,E),this.maxEntrySize=b||chunkPQC2BFS2_cjs.e(this,ct),this.sizeCalculation=x,this.sizeCalculation){if(!chunkPQC2BFS2_cjs.e(this,ct)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("memoMethod must be a function if defined");if(chunkPQC2BFS2_cjs.g(this,Ae,C),v!==void 0&&typeof v!="function")throw new TypeError("fetchMethod must be a function if specified");if(chunkPQC2BFS2_cjs.g(this,Oe,v),chunkPQC2BFS2_cjs.g(this,ee,!!v),chunkPQC2BFS2_cjs.g(this,$,new Map),chunkPQC2BFS2_cjs.g(this,D,new Array(i).fill(void 0)),chunkPQC2BFS2_cjs.g(this,A,new Array(i).fill(void 0)),chunkPQC2BFS2_cjs.g(this,it,new P(i)),chunkPQC2BFS2_cjs.g(this,ut,new P(i)),chunkPQC2BFS2_cjs.g(this,tt,0),chunkPQC2BFS2_cjs.g(this,Y,0),chunkPQC2BFS2_cjs.g(this,Ot,wn.create(i)),chunkPQC2BFS2_cjs.g(this,U,0),chunkPQC2BFS2_cjs.g(this,Ct,0),typeof u=="function"&&chunkPQC2BFS2_cjs.g(this,xt,u),typeof d=="function"&&chunkPQC2BFS2_cjs.g(this,fe,d),typeof f=="function"?(chunkPQC2BFS2_cjs.g(this,kt,f),chunkPQC2BFS2_cjs.g(this,K,[])):(chunkPQC2BFS2_cjs.g(this,kt,void 0),chunkPQC2BFS2_cjs.g(this,K,void 0)),chunkPQC2BFS2_cjs.g(this,Tt,!!chunkPQC2BFS2_cjs.e(this,xt)),chunkPQC2BFS2_cjs.g(this,Fe,!!chunkPQC2BFS2_cjs.e(this,fe)),chunkPQC2BFS2_cjs.g(this,st,!!chunkPQC2BFS2_cjs.e(this,kt)),this.noDisposeOnSet=!!w,this.noUpdateTTL=!!S,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!k,this.allowStaleOnFetchAbort=!!M,this.ignoreFetchAbort=!!j,this.maxEntrySize!==0){if(chunkPQC2BFS2_cjs.e(this,ct)!==0&&!Vt(chunkPQC2BFS2_cjs.e(this,ct)))throw new TypeError("maxSize must be a positive integer if specified");if(!Vt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");chunkPQC2BFS2_cjs.h(this,y,Dr).call(this);}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Vt(h)||h===0?h:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!Vt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");chunkPQC2BFS2_cjs.h(this,y,hs).call(this);}if(chunkPQC2BFS2_cjs.e(this,wt)===0&&this.ttl===0&&chunkPQC2BFS2_cjs.e(this,ct)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!chunkPQC2BFS2_cjs.e(this,wt)&&!chunkPQC2BFS2_cjs.e(this,ct)){let H="LRU_CACHE_UNBOUNDED";mn(H)&&(Mr.add(H),Lr("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",H,Me));}}get perf(){return chunkPQC2BFS2_cjs.e(this,Rt)}static unsafeExposeInternals(t){return {starts:chunkPQC2BFS2_cjs.e(t,Ft),ttls:chunkPQC2BFS2_cjs.e(t,pt),autopurgeTimers:chunkPQC2BFS2_cjs.e(t,ft),sizes:chunkPQC2BFS2_cjs.e(t,At),keyMap:chunkPQC2BFS2_cjs.e(t,$),keyList:chunkPQC2BFS2_cjs.e(t,D),valList:chunkPQC2BFS2_cjs.e(t,A),next:chunkPQC2BFS2_cjs.e(t,it),prev:chunkPQC2BFS2_cjs.e(t,ut),get head(){return chunkPQC2BFS2_cjs.e(t,tt)},get tail(){return chunkPQC2BFS2_cjs.e(t,Y)},free:chunkPQC2BFS2_cjs.e(t,Ot),isBackgroundFetch:i=>{var s;return chunkPQC2BFS2_cjs.h(s=t,y,L).call(s,i)},backgroundFetch:(i,s,h,n)=>{var o;return chunkPQC2BFS2_cjs.h(o=t,y,Pi).call(o,i,s,h,n)},moveToTail:i=>{var s;return chunkPQC2BFS2_cjs.h(s=t,y,qe).call(s,i)},indexes:i=>{var s;return chunkPQC2BFS2_cjs.h(s=t,y,Yt).call(s,i)},rindexes:i=>{var s;return chunkPQC2BFS2_cjs.h(s=t,y,Kt).call(s,i)},isStale:i=>{var s;return chunkPQC2BFS2_cjs.e(s=t,dt).call(s,i)}}}get max(){return chunkPQC2BFS2_cjs.e(this,wt)}get maxSize(){return chunkPQC2BFS2_cjs.e(this,ct)}get calculatedSize(){return chunkPQC2BFS2_cjs.e(this,Ct)}get size(){return chunkPQC2BFS2_cjs.e(this,U)}get fetchMethod(){return chunkPQC2BFS2_cjs.e(this,Oe)}get memoMethod(){return chunkPQC2BFS2_cjs.e(this,Ae)}get dispose(){return chunkPQC2BFS2_cjs.e(this,xt)}get onInsert(){return chunkPQC2BFS2_cjs.e(this,fe)}get disposeAfter(){return chunkPQC2BFS2_cjs.e(this,kt)}getRemainingTTL(t){return chunkPQC2BFS2_cjs.e(this,$).has(t)?1/0:0}*entries(){for(let t of chunkPQC2BFS2_cjs.h(this,y,Yt).call(this))chunkPQC2BFS2_cjs.e(this,A)[t]!==void 0&&chunkPQC2BFS2_cjs.e(this,D)[t]!==void 0&&!chunkPQC2BFS2_cjs.h(this,y,L).call(this,chunkPQC2BFS2_cjs.e(this,A)[t])&&(yield [chunkPQC2BFS2_cjs.e(this,D)[t],chunkPQC2BFS2_cjs.e(this,A)[t]]);}*rentries(){for(let t of chunkPQC2BFS2_cjs.h(this,y,Kt).call(this))chunkPQC2BFS2_cjs.e(this,A)[t]!==void 0&&chunkPQC2BFS2_cjs.e(this,D)[t]!==void 0&&!chunkPQC2BFS2_cjs.h(this,y,L).call(this,chunkPQC2BFS2_cjs.e(this,A)[t])&&(yield [chunkPQC2BFS2_cjs.e(this,D)[t],chunkPQC2BFS2_cjs.e(this,A)[t]]);}*keys(){for(let t of chunkPQC2BFS2_cjs.h(this,y,Yt).call(this)){let i=chunkPQC2BFS2_cjs.e(this,D)[t];i!==void 0&&!chunkPQC2BFS2_cjs.h(this,y,L).call(this,chunkPQC2BFS2_cjs.e(this,A)[t])&&(yield i);}}*rkeys(){for(let t of chunkPQC2BFS2_cjs.h(this,y,Kt).call(this)){let i=chunkPQC2BFS2_cjs.e(this,D)[t];i!==void 0&&!chunkPQC2BFS2_cjs.h(this,y,L).call(this,chunkPQC2BFS2_cjs.e(this,A)[t])&&(yield i);}}*values(){for(let t of chunkPQC2BFS2_cjs.h(this,y,Yt).call(this))chunkPQC2BFS2_cjs.e(this,A)[t]!==void 0&&!chunkPQC2BFS2_cjs.h(this,y,L).call(this,chunkPQC2BFS2_cjs.e(this,A)[t])&&(yield chunkPQC2BFS2_cjs.e(this,A)[t]);}*rvalues(){for(let t of chunkPQC2BFS2_cjs.h(this,y,Kt).call(this))chunkPQC2BFS2_cjs.e(this,A)[t]!==void 0&&!chunkPQC2BFS2_cjs.h(this,y,L).call(this,chunkPQC2BFS2_cjs.e(this,A)[t])&&(yield chunkPQC2BFS2_cjs.e(this,A)[t]);}[(Js=Symbol.iterator,Zs=Symbol.toStringTag,Js)](){return this.entries()}find(t,i={}){for(let s of chunkPQC2BFS2_cjs.h(this,y,Yt).call(this)){let h=chunkPQC2BFS2_cjs.e(this,A)[s],n=chunkPQC2BFS2_cjs.h(this,y,L).call(this,h)?h.__staleWhileFetching:h;if(n!==void 0&&t(n,chunkPQC2BFS2_cjs.e(this,D)[s],this))return this.get(chunkPQC2BFS2_cjs.e(this,D)[s],i)}}forEach(t,i=this){for(let s of chunkPQC2BFS2_cjs.h(this,y,Yt).call(this)){let h=chunkPQC2BFS2_cjs.e(this,A)[s],n=chunkPQC2BFS2_cjs.h(this,y,L).call(this,h)?h.__staleWhileFetching:h;n!==void 0&&t.call(i,n,chunkPQC2BFS2_cjs.e(this,D)[s],this);}}rforEach(t,i=this){for(let s of chunkPQC2BFS2_cjs.h(this,y,Kt).call(this)){let h=chunkPQC2BFS2_cjs.e(this,A)[s],n=chunkPQC2BFS2_cjs.h(this,y,L).call(this,h)?h.__staleWhileFetching:h;n!==void 0&&t.call(i,n,chunkPQC2BFS2_cjs.e(this,D)[s],this);}}purgeStale(){let t=false;for(let i of chunkPQC2BFS2_cjs.h(this,y,Kt).call(this,{allowStale:true}))chunkPQC2BFS2_cjs.e(this,dt).call(this,i)&&(chunkPQC2BFS2_cjs.h(this,y,Xt).call(this,chunkPQC2BFS2_cjs.e(this,D)[i],"expire"),t=true);return t}info(t){let i=chunkPQC2BFS2_cjs.e(this,$).get(t);if(i===void 0)return;let s=chunkPQC2BFS2_cjs.e(this,A)[i],h=chunkPQC2BFS2_cjs.h(this,y,L).call(this,s)?s.__staleWhileFetching:s;if(h===void 0)return;let n={value:h};if(chunkPQC2BFS2_cjs.e(this,pt)&&chunkPQC2BFS2_cjs.e(this,Ft)){let o=chunkPQC2BFS2_cjs.e(this,pt)[i],a=chunkPQC2BFS2_cjs.e(this,Ft)[i];if(o&&a){let l=o-(chunkPQC2BFS2_cjs.e(this,Rt).now()-a);n.ttl=l,n.start=Date.now();}}return chunkPQC2BFS2_cjs.e(this,At)&&(n.size=chunkPQC2BFS2_cjs.e(this,At)[i]),n}dump(){let t=[];for(let i of chunkPQC2BFS2_cjs.h(this,y,Yt).call(this,{allowStale:true})){let s=chunkPQC2BFS2_cjs.e(this,D)[i],h=chunkPQC2BFS2_cjs.e(this,A)[i],n=chunkPQC2BFS2_cjs.h(this,y,L).call(this,h)?h.__staleWhileFetching:h;if(n===void 0||s===void 0)continue;let o={value:n};if(chunkPQC2BFS2_cjs.e(this,pt)&&chunkPQC2BFS2_cjs.e(this,Ft)){o.ttl=chunkPQC2BFS2_cjs.e(this,pt)[i];let a=chunkPQC2BFS2_cjs.e(this,Rt).now()-chunkPQC2BFS2_cjs.e(this,Ft)[i];o.start=Math.floor(Date.now()-a);}chunkPQC2BFS2_cjs.e(this,At)&&(o.size=chunkPQC2BFS2_cjs.e(this,At)[i]),t.unshift([s,o]);}return t}load(t){this.clear();for(let[i,s]of t){if(s.start){let h=Date.now()-s.start;s.start=chunkPQC2BFS2_cjs.e(this,Rt).now()-h;}this.set(i,s.value,s);}}set(t,i,s={}){var w,S,E,b;if(i===void 0)return this.delete(t),this;let{ttl:h=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:l}=s,{noUpdateTTL:u=this.noUpdateTTL}=s,d=chunkPQC2BFS2_cjs.e(this,ti).call(this,t,i,s.size||0,a);if(this.maxEntrySize&&d>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=true),chunkPQC2BFS2_cjs.h(this,y,Xt).call(this,t,"set"),this;let f=chunkPQC2BFS2_cjs.e(this,U)===0?void 0:chunkPQC2BFS2_cjs.e(this,$).get(t);if(f===void 0)f=chunkPQC2BFS2_cjs.e(this,U)===0?chunkPQC2BFS2_cjs.e(this,Y):chunkPQC2BFS2_cjs.e(this,Ot).length!==0?chunkPQC2BFS2_cjs.e(this,Ot).pop():chunkPQC2BFS2_cjs.e(this,U)===chunkPQC2BFS2_cjs.e(this,wt)?chunkPQC2BFS2_cjs.h(this,y,Di).call(this,false):chunkPQC2BFS2_cjs.e(this,U),chunkPQC2BFS2_cjs.e(this,D)[f]=t,chunkPQC2BFS2_cjs.e(this,A)[f]=i,chunkPQC2BFS2_cjs.e(this,$).set(t,f),chunkPQC2BFS2_cjs.e(this,it)[chunkPQC2BFS2_cjs.e(this,Y)]=f,chunkPQC2BFS2_cjs.e(this,ut)[f]=chunkPQC2BFS2_cjs.e(this,Y),chunkPQC2BFS2_cjs.g(this,Y,f),chunkPQC2BFS2_cjs.i(this,U)._++,chunkPQC2BFS2_cjs.e(this,Te).call(this,f,d,l),l&&(l.set="add"),u=false,chunkPQC2BFS2_cjs.e(this,Fe)&&((w=chunkPQC2BFS2_cjs.e(this,fe))==null||w.call(this,i,t,"add"));else {chunkPQC2BFS2_cjs.h(this,y,qe).call(this,f);let x=chunkPQC2BFS2_cjs.e(this,A)[f];if(i!==x){if(chunkPQC2BFS2_cjs.e(this,ee)&&chunkPQC2BFS2_cjs.h(this,y,L).call(this,x)){x.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:v}=x;v!==void 0&&!o&&(chunkPQC2BFS2_cjs.e(this,Tt)&&((S=chunkPQC2BFS2_cjs.e(this,xt))==null||S.call(this,v,t,"set")),chunkPQC2BFS2_cjs.e(this,st)&&chunkPQC2BFS2_cjs.e(this,K)?.push([v,t,"set"]));}else o||(chunkPQC2BFS2_cjs.e(this,Tt)&&((E=chunkPQC2BFS2_cjs.e(this,xt))==null||E.call(this,x,t,"set")),chunkPQC2BFS2_cjs.e(this,st)&&chunkPQC2BFS2_cjs.e(this,K)?.push([x,t,"set"]));if(chunkPQC2BFS2_cjs.e(this,ge).call(this,f),chunkPQC2BFS2_cjs.e(this,Te).call(this,f,d,l),chunkPQC2BFS2_cjs.e(this,A)[f]=i,l){l.set="replace";let v=x&&chunkPQC2BFS2_cjs.h(this,y,L).call(this,x)?x.__staleWhileFetching:x;v!==void 0&&(l.oldValue=v);}}else l&&(l.set="update");chunkPQC2BFS2_cjs.e(this,Fe)&&this.onInsert?.(i,t,i===x?"update":"replace");}if(h!==0&&!chunkPQC2BFS2_cjs.e(this,pt)&&chunkPQC2BFS2_cjs.h(this,y,hs).call(this),chunkPQC2BFS2_cjs.e(this,pt)&&(u||chunkPQC2BFS2_cjs.e(this,Qe).call(this,f,h,n),l&&chunkPQC2BFS2_cjs.e(this,Bt).call(this,l,f)),!o&&chunkPQC2BFS2_cjs.e(this,st)&&chunkPQC2BFS2_cjs.e(this,K)){let x=chunkPQC2BFS2_cjs.e(this,K),v;for(;v=x?.shift();)(b=chunkPQC2BFS2_cjs.e(this,kt))==null||b.call(this,...v);}return this}pop(){var t;try{for(;chunkPQC2BFS2_cjs.e(this,U);){let i=chunkPQC2BFS2_cjs.e(this,A)[chunkPQC2BFS2_cjs.e(this,tt)];if(chunkPQC2BFS2_cjs.h(this,y,Di).call(this,!0),chunkPQC2BFS2_cjs.h(this,y,L).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(chunkPQC2BFS2_cjs.e(this,st)&&chunkPQC2BFS2_cjs.e(this,K)){let i=chunkPQC2BFS2_cjs.e(this,K),s;for(;s=i?.shift();)(t=chunkPQC2BFS2_cjs.e(this,kt))==null||t.call(this,...s);}}}has(t,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:h}=i,n=chunkPQC2BFS2_cjs.e(this,$).get(t);if(n!==void 0){let o=chunkPQC2BFS2_cjs.e(this,A)[n];if(chunkPQC2BFS2_cjs.h(this,y,L).call(this,o)&&o.__staleWhileFetching===void 0)return false;if(chunkPQC2BFS2_cjs.e(this,dt).call(this,n))h&&(h.has="stale",chunkPQC2BFS2_cjs.e(this,Bt).call(this,h,n));else return s&&chunkPQC2BFS2_cjs.e(this,de).call(this,n),h&&(h.has="hit",chunkPQC2BFS2_cjs.e(this,Bt).call(this,h,n)),true}else h&&(h.has="miss");return false}peek(t,i={}){let{allowStale:s=this.allowStale}=i,h=chunkPQC2BFS2_cjs.e(this,$).get(t);if(h===void 0||!s&&chunkPQC2BFS2_cjs.e(this,dt).call(this,h))return;let n=chunkPQC2BFS2_cjs.e(this,A)[h];return chunkPQC2BFS2_cjs.h(this,y,L).call(this,n)?n.__staleWhileFetching:n}async fetch(t,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:h=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:w=this.allowStaleOnFetchRejection,ignoreFetchAbort:S=this.ignoreFetchAbort,allowStaleOnFetchAbort:E=this.allowStaleOnFetchAbort,context:b,forceRefresh:x=false,status:v,signal:C}=i;if(!chunkPQC2BFS2_cjs.e(this,ee))return v&&(v.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:h,noDeleteOnStaleGet:n,status:v});let F={allowStale:s,updateAgeOnGet:h,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:l,sizeCalculation:u,noUpdateTTL:d,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:E,ignoreFetchAbort:S,status:v,signal:C},T=chunkPQC2BFS2_cjs.e(this,$).get(t);if(T===void 0){v&&(v.fetch="miss");let k=chunkPQC2BFS2_cjs.h(this,y,Pi).call(this,t,T,F,b);return k.__returned=k}else {let k=chunkPQC2BFS2_cjs.e(this,A)[T];if(chunkPQC2BFS2_cjs.h(this,y,L).call(this,k)){let P=s&&k.__staleWhileFetching!==void 0;return v&&(v.fetch="inflight",P&&(v.returnedStale=true)),P?k.__staleWhileFetching:k.__returned=k}let M=chunkPQC2BFS2_cjs.e(this,dt).call(this,T);if(!x&&!M)return v&&(v.fetch="hit"),chunkPQC2BFS2_cjs.h(this,y,qe).call(this,T),h&&chunkPQC2BFS2_cjs.e(this,de).call(this,T),v&&chunkPQC2BFS2_cjs.e(this,Bt).call(this,v,T),k;let j=chunkPQC2BFS2_cjs.h(this,y,Pi).call(this,t,T,F,b),N=j.__staleWhileFetching!==void 0&&s;return v&&(v.fetch=M?"stale":"refresh",N&&M&&(v.returnedStale=true)),N?j.__staleWhileFetching:j.__returned=j}}async forceFetch(t,i={}){let s=await this.fetch(t,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,i={}){let s=chunkPQC2BFS2_cjs.e(this,Ae);if(!s)throw new Error("no memoMethod provided to constructor");let{context:h,forceRefresh:n,...o}=i,a=this.get(t,o);if(!n&&a!==void 0)return a;let l=s(t,a,{options:o,context:h});return this.set(t,l,o),l}get(t,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:h=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,a=chunkPQC2BFS2_cjs.e(this,$).get(t);if(a!==void 0){let l=chunkPQC2BFS2_cjs.e(this,A)[a],u=chunkPQC2BFS2_cjs.h(this,y,L).call(this,l);return o&&chunkPQC2BFS2_cjs.e(this,Bt).call(this,o,a),chunkPQC2BFS2_cjs.e(this,dt).call(this,a)?(o&&(o.get="stale"),u?(o&&s&&l.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?l.__staleWhileFetching:void 0):(n||chunkPQC2BFS2_cjs.h(this,y,Xt).call(this,t,"expire"),o&&s&&(o.returnedStale=true),s?l:void 0)):(o&&(o.get="hit"),u?l.__staleWhileFetching:(chunkPQC2BFS2_cjs.h(this,y,qe).call(this,a),h&&chunkPQC2BFS2_cjs.e(this,de).call(this,a),l))}else o&&(o.get="miss");}delete(t){return chunkPQC2BFS2_cjs.h(this,y,Xt).call(this,t,"delete")}clear(){return chunkPQC2BFS2_cjs.h(this,y,as).call(this,"delete")}},wt=new WeakMap,ct=new WeakMap,xt=new WeakMap,fe=new WeakMap,kt=new WeakMap,Oe=new WeakMap,Ae=new WeakMap,Rt=new WeakMap,U=new WeakMap,Ct=new WeakMap,$=new WeakMap,D=new WeakMap,A=new WeakMap,it=new WeakMap,ut=new WeakMap,tt=new WeakMap,Y=new WeakMap,Ot=new WeakMap,K=new WeakMap,At=new WeakMap,Ft=new WeakMap,pt=new WeakMap,ft=new WeakMap,Tt=new WeakMap,ee=new WeakMap,st=new WeakMap,Fe=new WeakMap,y=new WeakSet,hs=function(){let t=new Wi(chunkPQC2BFS2_cjs.e(this,wt)),i=new Wi(chunkPQC2BFS2_cjs.e(this,wt));chunkPQC2BFS2_cjs.g(this,pt,t),chunkPQC2BFS2_cjs.g(this,Ft,i);let s=this.ttlAutopurge?new Array(chunkPQC2BFS2_cjs.e(this,wt)):void 0;chunkPQC2BFS2_cjs.g(this,ft,s),chunkPQC2BFS2_cjs.g(this,Qe,(o,a,l=chunkPQC2BFS2_cjs.e(this,Rt).now())=>{if(i[o]=a!==0?l:0,t[o]=a,s?.[o]&&(clearTimeout(s[o]),s[o]=void 0),a!==0&&s){let u=setTimeout(()=>{chunkPQC2BFS2_cjs.e(this,dt).call(this,o)&&chunkPQC2BFS2_cjs.h(this,y,Xt).call(this,chunkPQC2BFS2_cjs.e(this,D)[o],"expire");},a+1);u.unref&&u.unref(),s[o]=u;}}),chunkPQC2BFS2_cjs.g(this,de,o=>{i[o]=t[o]!==0?chunkPQC2BFS2_cjs.e(this,Rt).now():0;}),chunkPQC2BFS2_cjs.g(this,Bt,(o,a)=>{if(t[a]){let l=t[a],u=i[a];if(!l||!u)return;o.ttl=l,o.start=u,o.now=h||n();let d=o.now-u;o.remainingTTL=l-d;}});let h=0,n=()=>{let o=chunkPQC2BFS2_cjs.e(this,Rt).now();if(this.ttlResolution>0){h=o;let a=setTimeout(()=>h=0,this.ttlResolution);a.unref&&a.unref();}return o};this.getRemainingTTL=o=>{let a=chunkPQC2BFS2_cjs.e(this,$).get(o);if(a===void 0)return 0;let l=t[a],u=i[a];if(!l||!u)return 1/0;let d=(h||n())-u;return l-d},chunkPQC2BFS2_cjs.g(this,dt,o=>{let a=i[o],l=t[o];return !!l&&!!a&&(h||n())-a>l});},de=new WeakMap,Bt=new WeakMap,Qe=new WeakMap,dt=new WeakMap,Dr=function(){let t=new Wi(chunkPQC2BFS2_cjs.e(this,wt));chunkPQC2BFS2_cjs.g(this,Ct,0),chunkPQC2BFS2_cjs.g(this,At,t),chunkPQC2BFS2_cjs.g(this,ge,i=>{chunkPQC2BFS2_cjs.g(this,Ct,chunkPQC2BFS2_cjs.e(this,Ct)-t[i]),t[i]=0;}),chunkPQC2BFS2_cjs.g(this,ti,(i,s,h,n)=>{if(chunkPQC2BFS2_cjs.h(this,y,L).call(this,s))return 0;if(!Vt(h))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(h=n(s,i),!Vt(h))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return h}),chunkPQC2BFS2_cjs.g(this,Te,(i,s,h)=>{if(t[i]=s,chunkPQC2BFS2_cjs.e(this,ct)){let n=chunkPQC2BFS2_cjs.e(this,ct)-t[i];for(;chunkPQC2BFS2_cjs.e(this,Ct)>n;)chunkPQC2BFS2_cjs.h(this,y,Di).call(this,true);}chunkPQC2BFS2_cjs.g(this,Ct,chunkPQC2BFS2_cjs.e(this,Ct)+t[i]),h&&(h.entrySize=s,h.totalCalculatedSize=chunkPQC2BFS2_cjs.e(this,Ct));});},ge=new WeakMap,Te=new WeakMap,ti=new WeakMap,Yt=function*({allowStale:t=this.allowStale}={}){if(chunkPQC2BFS2_cjs.e(this,U))for(let i=chunkPQC2BFS2_cjs.e(this,Y);!(!chunkPQC2BFS2_cjs.h(this,y,ns).call(this,i)||((t||!chunkPQC2BFS2_cjs.e(this,dt).call(this,i))&&(yield i),i===chunkPQC2BFS2_cjs.e(this,tt)));)i=chunkPQC2BFS2_cjs.e(this,ut)[i];},Kt=function*({allowStale:t=this.allowStale}={}){if(chunkPQC2BFS2_cjs.e(this,U))for(let i=chunkPQC2BFS2_cjs.e(this,tt);!(!chunkPQC2BFS2_cjs.h(this,y,ns).call(this,i)||((t||!chunkPQC2BFS2_cjs.e(this,dt).call(this,i))&&(yield i),i===chunkPQC2BFS2_cjs.e(this,Y)));)i=chunkPQC2BFS2_cjs.e(this,it)[i];},ns=function(t){return t!==void 0&&chunkPQC2BFS2_cjs.e(this,$).get(chunkPQC2BFS2_cjs.e(this,D)[t])===t},Di=function(t){var n;let i=chunkPQC2BFS2_cjs.e(this,tt),s=chunkPQC2BFS2_cjs.e(this,D)[i],h=chunkPQC2BFS2_cjs.e(this,A)[i];return chunkPQC2BFS2_cjs.e(this,ee)&&chunkPQC2BFS2_cjs.h(this,y,L).call(this,h)?h.__abortController.abort(new Error("evicted")):(chunkPQC2BFS2_cjs.e(this,Tt)||chunkPQC2BFS2_cjs.e(this,st))&&(chunkPQC2BFS2_cjs.e(this,Tt)&&((n=chunkPQC2BFS2_cjs.e(this,xt))==null||n.call(this,h,s,"evict")),chunkPQC2BFS2_cjs.e(this,st)&&chunkPQC2BFS2_cjs.e(this,K)?.push([h,s,"evict"])),chunkPQC2BFS2_cjs.e(this,ge).call(this,i),chunkPQC2BFS2_cjs.e(this,ft)?.[i]&&(clearTimeout(chunkPQC2BFS2_cjs.e(this,ft)[i]),chunkPQC2BFS2_cjs.e(this,ft)[i]=void 0),t&&(chunkPQC2BFS2_cjs.e(this,D)[i]=void 0,chunkPQC2BFS2_cjs.e(this,A)[i]=void 0,chunkPQC2BFS2_cjs.e(this,Ot).push(i)),chunkPQC2BFS2_cjs.e(this,U)===1?(chunkPQC2BFS2_cjs.g(this,tt,chunkPQC2BFS2_cjs.g(this,Y,0)),chunkPQC2BFS2_cjs.e(this,Ot).length=0):chunkPQC2BFS2_cjs.g(this,tt,chunkPQC2BFS2_cjs.e(this,it)[i]),chunkPQC2BFS2_cjs.e(this,$).delete(s),chunkPQC2BFS2_cjs.i(this,U)._--,i},Pi=function(t,i,s,h){let n=i===void 0?void 0:chunkPQC2BFS2_cjs.e(this,A)[i];if(chunkPQC2BFS2_cjs.h(this,y,L).call(this,n))return n;let o=new Bi,{signal:a}=s;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let l={signal:o.signal,options:s,context:h},u=(b,x=false)=>{let{aborted:v}=o.signal,C=s.ignoreFetchAbort&&b!==void 0,F=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&b!==void 0);if(s.status&&(v&&!x?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,C&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),v&&!C&&!x)return f(o.signal.reason,F);let T=S,k=chunkPQC2BFS2_cjs.e(this,A)[i];return (k===S||C&&x&&k===void 0)&&(b===void 0?T.__staleWhileFetching!==void 0?chunkPQC2BFS2_cjs.e(this,A)[i]=T.__staleWhileFetching:chunkPQC2BFS2_cjs.h(this,y,Xt).call(this,t,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(t,b,l.options))),b},d=b=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=b),f(b,false)),f=(b,x)=>{let{aborted:v}=o.signal,C=v&&s.allowStaleOnFetchAbort,F=C||s.allowStaleOnFetchRejection,T=F||s.noDeleteOnFetchRejection,k=S;if(chunkPQC2BFS2_cjs.e(this,A)[i]===S&&(!T||!x&&k.__staleWhileFetching===void 0?chunkPQC2BFS2_cjs.h(this,y,Xt).call(this,t,"fetch"):C||(chunkPQC2BFS2_cjs.e(this,A)[i]=k.__staleWhileFetching)),F)return s.status&&k.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),k.__staleWhileFetching;if(k.__returned===k)throw b},w=(b,x)=>{var C;let v=(C=chunkPQC2BFS2_cjs.e(this,Oe))==null?void 0:C.call(this,t,n,l);v&&v instanceof Promise&&v.then(F=>b(F===void 0?void 0:F),x),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(b(void 0),s.allowStaleOnFetchAbort&&(b=F=>u(F,true)));});};s.status&&(s.status.fetchDispatched=true);let S=new Promise(w).then(u,d),E=Object.assign(S,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(t,E,{...l.options,status:void 0}),i=chunkPQC2BFS2_cjs.e(this,$).get(t)):chunkPQC2BFS2_cjs.e(this,A)[i]=E,E},L=function(t){if(!chunkPQC2BFS2_cjs.e(this,ee))return false;let i=t;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof Bi},os=function(t,i){chunkPQC2BFS2_cjs.e(this,ut)[i]=t,chunkPQC2BFS2_cjs.e(this,it)[t]=i;},qe=function(t){t!==chunkPQC2BFS2_cjs.e(this,Y)&&(t===chunkPQC2BFS2_cjs.e(this,tt)?chunkPQC2BFS2_cjs.g(this,tt,chunkPQC2BFS2_cjs.e(this,it)[t]):chunkPQC2BFS2_cjs.h(this,y,os).call(this,chunkPQC2BFS2_cjs.e(this,ut)[t],chunkPQC2BFS2_cjs.e(this,it)[t]),chunkPQC2BFS2_cjs.h(this,y,os).call(this,chunkPQC2BFS2_cjs.e(this,Y),t),chunkPQC2BFS2_cjs.g(this,Y,t));},Xt=function(t,i){var h,n;let s=false;if(chunkPQC2BFS2_cjs.e(this,U)!==0){let o=chunkPQC2BFS2_cjs.e(this,$).get(t);if(o!==void 0)if(chunkPQC2BFS2_cjs.e(this,ft)?.[o]&&(clearTimeout(chunkPQC2BFS2_cjs.e(this,ft)?.[o]),chunkPQC2BFS2_cjs.e(this,ft)[o]=void 0),s=true,chunkPQC2BFS2_cjs.e(this,U)===1)chunkPQC2BFS2_cjs.h(this,y,as).call(this,i);else {chunkPQC2BFS2_cjs.e(this,ge).call(this,o);let a=chunkPQC2BFS2_cjs.e(this,A)[o];if(chunkPQC2BFS2_cjs.h(this,y,L).call(this,a)?a.__abortController.abort(new Error("deleted")):(chunkPQC2BFS2_cjs.e(this,Tt)||chunkPQC2BFS2_cjs.e(this,st))&&(chunkPQC2BFS2_cjs.e(this,Tt)&&((h=chunkPQC2BFS2_cjs.e(this,xt))==null||h.call(this,a,t,i)),chunkPQC2BFS2_cjs.e(this,st)&&chunkPQC2BFS2_cjs.e(this,K)?.push([a,t,i])),chunkPQC2BFS2_cjs.e(this,$).delete(t),chunkPQC2BFS2_cjs.e(this,D)[o]=void 0,chunkPQC2BFS2_cjs.e(this,A)[o]=void 0,o===chunkPQC2BFS2_cjs.e(this,Y))chunkPQC2BFS2_cjs.g(this,Y,chunkPQC2BFS2_cjs.e(this,ut)[o]);else if(o===chunkPQC2BFS2_cjs.e(this,tt))chunkPQC2BFS2_cjs.g(this,tt,chunkPQC2BFS2_cjs.e(this,it)[o]);else {let l=chunkPQC2BFS2_cjs.e(this,ut)[o];chunkPQC2BFS2_cjs.e(this,it)[l]=chunkPQC2BFS2_cjs.e(this,it)[o];let u=chunkPQC2BFS2_cjs.e(this,it)[o];chunkPQC2BFS2_cjs.e(this,ut)[u]=chunkPQC2BFS2_cjs.e(this,ut)[o];}chunkPQC2BFS2_cjs.i(this,U)._--,chunkPQC2BFS2_cjs.e(this,Ot).push(o);}}if(chunkPQC2BFS2_cjs.e(this,st)&&chunkPQC2BFS2_cjs.e(this,K)?.length){let o=chunkPQC2BFS2_cjs.e(this,K),a;for(;a=o?.shift();)(n=chunkPQC2BFS2_cjs.e(this,kt))==null||n.call(this,...a);}return s},as=function(t){var i,s;for(let h of chunkPQC2BFS2_cjs.h(this,y,Kt).call(this,{allowStale:true})){let n=chunkPQC2BFS2_cjs.e(this,A)[h];if(chunkPQC2BFS2_cjs.h(this,y,L).call(this,n))n.__abortController.abort(new Error("deleted"));else {let o=chunkPQC2BFS2_cjs.e(this,D)[h];chunkPQC2BFS2_cjs.e(this,Tt)&&((i=chunkPQC2BFS2_cjs.e(this,xt))==null||i.call(this,n,o,t)),chunkPQC2BFS2_cjs.e(this,st)&&chunkPQC2BFS2_cjs.e(this,K)?.push([n,o,t]);}}if(chunkPQC2BFS2_cjs.e(this,$).clear(),chunkPQC2BFS2_cjs.e(this,A).fill(void 0),chunkPQC2BFS2_cjs.e(this,D).fill(void 0),chunkPQC2BFS2_cjs.e(this,pt)&&chunkPQC2BFS2_cjs.e(this,Ft)){chunkPQC2BFS2_cjs.e(this,pt).fill(0),chunkPQC2BFS2_cjs.e(this,Ft).fill(0);for(let h of chunkPQC2BFS2_cjs.e(this,ft)??[])h!==void 0&&clearTimeout(h);chunkPQC2BFS2_cjs.e(this,ft)?.fill(void 0);}if(chunkPQC2BFS2_cjs.e(this,At)&&chunkPQC2BFS2_cjs.e(this,At).fill(0),chunkPQC2BFS2_cjs.g(this,tt,0),chunkPQC2BFS2_cjs.g(this,Y,0),chunkPQC2BFS2_cjs.e(this,Ot).length=0,chunkPQC2BFS2_cjs.g(this,Ct,0),chunkPQC2BFS2_cjs.g(this,U,0),chunkPQC2BFS2_cjs.e(this,st)&&chunkPQC2BFS2_cjs.e(this,K)){let h=chunkPQC2BFS2_cjs.e(this,K),n;for(;n=h?.shift();)(s=chunkPQC2BFS2_cjs.e(this,kt))==null||s.call(this,...n);}},Me),Ws=typeof process=="object"&&process?process:{stdout:null,stderr:null},Mn=e=>!!e&&typeof e=="object"&&(e instanceof Ui||e instanceof Pr__default.default||Ln(e)||Wn(e)),Ln=e=>!!e&&typeof e=="object"&&e instanceof events.EventEmitter&&typeof e.pipe=="function"&&e.pipe!==Pr__default.default.Writable.prototype.pipe,Wn=e=>!!e&&typeof e=="object"&&e instanceof events.EventEmitter&&typeof e.write=="function"&&typeof e.end=="function",Nt=Symbol("EOF"),_t=Symbol("maybeEmitEnd"),Jt=Symbol("emittedEnd"),Ri=Symbol("emittingEnd"),$e=Symbol("emittedError"),Ci=Symbol("closed"),Ds=Symbol("read"),Oi=Symbol("flush"),Ps=Symbol("flushChunk"),vt=Symbol("encoding"),xe=Symbol("decoder"),q=Symbol("flowing"),Be=Symbol("paused"),ke=Symbol("resume"),Z=Symbol("buffer"),et=Symbol("pipes"),J=Symbol("bufferLength"),Yi=Symbol("bufferPush"),Ai=Symbol("bufferShift"),Q=Symbol("objectMode"),z=Symbol("destroyed"),Ki=Symbol("error"),Xi=Symbol("emitData"),js=Symbol("emitEnd"),Qi=Symbol("emitEnd2"),Lt=Symbol("async"),ts=Symbol("abort"),Fi=Symbol("aborted"),Ue=Symbol("signal"),ae=Symbol("dataListeners"),lt=Symbol("discarded"),Ge=e=>Promise.resolve().then(e),Dn=e=>e(),Pn=e=>e==="end"||e==="finish"||e==="prefinish",jn=e=>e instanceof ArrayBuffer||!!e&&typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,zn=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),jr=class{constructor(e,t,i){chunkPQC2BFS2_cjs.d(this,"src");chunkPQC2BFS2_cjs.d(this,"dest");chunkPQC2BFS2_cjs.d(this,"opts");chunkPQC2BFS2_cjs.d(this,"ondrain");this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[ke](),this.dest.on("drain",this.ondrain);}unpipe(){this.dest.removeListener("drain",this.ondrain);}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end();}},Nn=class extends jr{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe();}constructor(e,t,i){super(e,t,i),this.proxyErrors=s=>this.dest.emit("error",s),e.on("error",this.proxyErrors);}},_n=e=>!!e.objectMode,$n=e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer",Vs,Ys,Ks,Xs,Qs,tr,er,ir,sr,rr,hr,nr,or,ar,lr,cr,ur,pr,fr,Ui=class extends events.EventEmitter{constructor(...t){let i=t[0]||{};super();chunkPQC2BFS2_cjs.d(this,fr,false);chunkPQC2BFS2_cjs.d(this,pr,false);chunkPQC2BFS2_cjs.d(this,ur,[]);chunkPQC2BFS2_cjs.d(this,cr,[]);chunkPQC2BFS2_cjs.d(this,lr);chunkPQC2BFS2_cjs.d(this,ar);chunkPQC2BFS2_cjs.d(this,or);chunkPQC2BFS2_cjs.d(this,nr);chunkPQC2BFS2_cjs.d(this,hr,false);chunkPQC2BFS2_cjs.d(this,rr,false);chunkPQC2BFS2_cjs.d(this,sr,false);chunkPQC2BFS2_cjs.d(this,ir,false);chunkPQC2BFS2_cjs.d(this,er,null);chunkPQC2BFS2_cjs.d(this,tr,0);chunkPQC2BFS2_cjs.d(this,Qs,false);chunkPQC2BFS2_cjs.d(this,Xs);chunkPQC2BFS2_cjs.d(this,Ks,false);chunkPQC2BFS2_cjs.d(this,Ys,0);chunkPQC2BFS2_cjs.d(this,Vs,false);chunkPQC2BFS2_cjs.d(this,"writable",true);chunkPQC2BFS2_cjs.d(this,"readable",true);if(i.objectMode&&typeof i.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");_n(i)?(this[Q]=true,this[vt]=null):$n(i)?(this[vt]=i.encoding,this[Q]=false):(this[Q]=false,this[vt]=null),this[Lt]=!!i.async,this[xe]=this[vt]?new string_decoder.StringDecoder(this[vt]):null,i&&i.debugExposeBuffer===true&&Object.defineProperty(this,"buffer",{get:()=>this[Z]}),i&&i.debugExposePipes===true&&Object.defineProperty(this,"pipes",{get:()=>this[et]});let{signal:s}=i;s&&(this[Ue]=s,s.aborted?this[ts]():s.addEventListener("abort",()=>this[ts]()));}get bufferLength(){return this[J]}get encoding(){return this[vt]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Q]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Lt]}set async(t){this[Lt]=this[Lt]||!!t;}[(fr=q,pr=Be,ur=et,cr=Z,lr=Q,ar=vt,or=Lt,nr=xe,hr=Nt,rr=Jt,sr=Ri,ir=Ci,er=$e,tr=J,Qs=z,Xs=Ue,Ks=Fi,Ys=ae,Vs=lt,ts)](){this[Fi]=true,this.emit("abort",this[Ue]?.reason),this.destroy(this[Ue]?.reason);}get aborted(){return this[Fi]}set aborted(t){}write(t,i,s){if(this[Fi])return false;if(this[Nt])throw new Error("write after end");if(this[z])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),true;typeof i=="function"&&(s=i,i="utf8"),i||(i="utf8");let h=this[Lt]?Ge:Dn;if(!this[Q]&&!Buffer.isBuffer(t)){if(zn(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(jn(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Q]?(this[q]&&this[J]!==0&&this[Oi](true),this[q]?this.emit("data",t):this[Yi](t),this[J]!==0&&this.emit("readable"),s&&h(s),this[q]):t.length?(typeof t=="string"&&!(i===this[vt]&&!this[xe]?.lastNeed)&&(t=Buffer.from(t,i)),Buffer.isBuffer(t)&&this[vt]&&(t=this[xe].write(t)),this[q]&&this[J]!==0&&this[Oi](true),this[q]?this.emit("data",t):this[Yi](t),this[J]!==0&&this.emit("readable"),s&&h(s),this[q]):(this[J]!==0&&this.emit("readable"),s&&h(s),this[q])}read(t){if(this[z])return null;if(this[lt]=false,this[J]===0||t===0||t&&t>this[J])return this[_t](),null;this[Q]&&(t=null),this[Z].length>1&&!this[Q]&&(this[Z]=[this[vt]?this[Z].join(""):Buffer.concat(this[Z],this[J])]);let i=this[Ds](t||null,this[Z][0]);return this[_t](),i}[Ds](t,i){if(this[Q])this[Ai]();else {let s=i;t===s.length||t===null?this[Ai]():typeof s=="string"?(this[Z][0]=s.slice(t),i=s.slice(0,t),this[J]-=t):(this[Z][0]=s.subarray(t),i=s.subarray(0,t),this[J]-=t);}return this.emit("data",i),!this[Z].length&&!this[Nt]&&this.emit("drain"),i}end(t,i,s){return typeof t=="function"&&(s=t,t=void 0),typeof i=="function"&&(s=i,i="utf8"),t!==void 0&&this.write(t,i),s&&this.once("end",s),this[Nt]=true,this.writable=false,(this[q]||!this[Be])&&this[_t](),this}[ke](){this[z]||(!this[ae]&&!this[et].length&&(this[lt]=true),this[Be]=false,this[q]=true,this.emit("resume"),this[Z].length?this[Oi]():this[Nt]?this[_t]():this.emit("drain"));}resume(){return this[ke]()}pause(){this[q]=false,this[Be]=true,this[lt]=false;}get destroyed(){return this[z]}get flowing(){return this[q]}get paused(){return this[Be]}[Yi](t){this[Q]?this[J]+=1:this[J]+=t.length,this[Z].push(t);}[Ai](){return this[Q]?this[J]-=1:this[J]-=this[Z][0].length,this[Z].shift()}[Oi](t=false){do;while(this[Ps](this[Ai]())&&this[Z].length);!t&&!this[Z].length&&!this[Nt]&&this.emit("drain");}[Ps](t){return this.emit("data",t),this[q]}pipe(t,i){if(this[z])return t;this[lt]=false;let s=this[Jt];return i=i||{},t===Ws.stdout||t===Ws.stderr?i.end=false:i.end=i.end!==false,i.proxyErrors=!!i.proxyErrors,s?i.end&&t.end():(this[et].push(i.proxyErrors?new Nn(this,t,i):new jr(this,t,i)),this[Lt]?Ge(()=>this[ke]()):this[ke]()),t}unpipe(t){let i=this[et].find(s=>s.dest===t);i&&(this[et].length===1?(this[q]&&this[ae]===0&&(this[q]=false),this[et]=[]):this[et].splice(this[et].indexOf(i),1),i.unpipe());}addListener(t,i){return this.on(t,i)}on(t,i){let s=super.on(t,i);if(t==="data")this[lt]=false,this[ae]++,!this[et].length&&!this[q]&&this[ke]();else if(t==="readable"&&this[J]!==0)super.emit("readable");else if(Pn(t)&&this[Jt])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[$e]){let h=i;this[Lt]?Ge(()=>h.call(this,this[$e])):h.call(this,this[$e]);}return s}removeListener(t,i){return this.off(t,i)}off(t,i){let s=super.off(t,i);return t==="data"&&(this[ae]=this.listeners("data").length,this[ae]===0&&!this[lt]&&!this[et].length&&(this[q]=false)),s}removeAllListeners(t){let i=super.removeAllListeners(t);return (t==="data"||t===void 0)&&(this[ae]=0,!this[lt]&&!this[et].length&&(this[q]=false)),i}get emittedEnd(){return this[Jt]}[_t](){!this[Ri]&&!this[Jt]&&!this[z]&&this[Z].length===0&&this[Nt]&&(this[Ri]=true,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Ci]&&this.emit("close"),this[Ri]=false);}emit(t,...i){let s=i[0];if(t!=="error"&&t!=="close"&&t!==z&&this[z])return false;if(t==="data")return !this[Q]&&!s?false:this[Lt]?(Ge(()=>this[Xi](s)),true):this[Xi](s);if(t==="end")return this[js]();if(t==="close"){if(this[Ci]=true,!this[Jt]&&!this[z])return false;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[$e]=s,super.emit(Ki,s);let n=!this[Ue]||this.listeners("error").length?super.emit("error",s):false;return this[_t](),n}else if(t==="resume"){let n=super.emit("resume");return this[_t](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let h=super.emit(t,...i);return this[_t](),h}[Xi](t){for(let s of this[et])s.dest.write(t)===false&&this.pause();let i=this[lt]?false:super.emit("data",t);return this[_t](),i}[js](){return this[Jt]?false:(this[Jt]=true,this.readable=false,this[Lt]?(Ge(()=>this[Qi]()),true):this[Qi]())}[Qi](){if(this[xe]){let i=this[xe].end();if(i){for(let s of this[et])s.dest.write(i);this[lt]||super.emit("data",i);}}for(let i of this[et])i.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[Q]||(t.dataLength=0);let i=this.promise();return this.on("data",s=>{t.push(s),this[Q]||(t.dataLength+=s.length);}),await i,t}async concat(){if(this[Q])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[vt]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,i)=>{this.on(z,()=>i(new Error("stream destroyed"))),this.on("error",s=>i(s)),this.on("end",()=>t());})}[Symbol.asyncIterator](){this[lt]=false;let t=false,i=async()=>(this.pause(),t=true,{value:void 0,done:true});return {next:()=>{if(t)return i();let s=this.read();if(s!==null)return Promise.resolve({done:false,value:s});if(this[Nt])return i();let h,n,o=d=>{this.off("data",a),this.off("end",l),this.off(z,u),i(),n(d);},a=d=>{this.off("error",o),this.off("end",l),this.off(z,u),this.pause(),h({value:d,done:!!this[Nt]});},l=()=>{this.off("error",o),this.off("data",a),this.off(z,u),i(),h({done:true,value:void 0});},u=()=>o(new Error("stream destroyed"));return new Promise((d,f)=>{n=f,h=d,this.once(z,u),this.once("error",o),this.once("end",l),this.once("data",a);})},throw:i,return:i,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[lt]=false;let t=false,i=()=>(this.pause(),this.off(Ki,i),this.off(z,i),this.off("end",i),t=true,{done:true,value:void 0}),s=()=>{if(t)return i();let h=this.read();return h===null?i():{done:false,value:h}};return this.once("end",i),this.once(Ki,i),this.once(z,i),{next:s,throw:i,return:i,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[z])return t?this.emit("error",t):this.emit(z),this;this[z]=true,this[lt]=true,this[Z].length=0,this[J]=0;let i=this;return typeof i.close=="function"&&!this[Ci]&&i.close(),t?this.emit("error",t):this.emit(z),this}static get isStream(){return Mn}},Bn=Rn.realpathSync.native,Ze={lstatSync:Rn.lstatSync,readdir:Rn.readdir,readdirSync:Rn.readdirSync,readlinkSync:Rn.readlinkSync,realpathSync:Bn,promises:{lstat:xs.lstat,readdir:xs.readdir,readlink:xs.readlink,realpath:xs.realpath}},zr=e=>!e||e===Ze||e===Rn__namespace?Ze:{...Ze,...e,promises:{...Ze.promises,...e.promises||{}}},Nr=/^\\\\\?\\([a-z]:)\\?$/i,Un=e=>e.replace(/\//g,"\\").replace(Nr,"$1\\"),Gn=/[\\\/]/,yt=0,_r=1,$r=2,Wt=4,Br=6,Ur=8,le=10,Gr=12,mt=15,Ie=~mt,es=16,zs=32,Je=64,Et=128,Ti=256,ji=512,Ns=Je|Et|ji,In=1023,is=e=>e.isFile()?Ur:e.isDirectory()?Wt:e.isSymbolicLink()?le:e.isCharacterDevice()?$r:e.isBlockDevice()?Br:e.isSocket()?Gr:e.isFIFO()?_r:yt,_s=new Ii({max:2**12}),Ve=e=>{let t=_s.get(e);if(t)return t;let i=e.normalize("NFKD");return _s.set(e,i),i},$s=new Ii({max:2**12}),Mi=e=>{let t=$s.get(e);if(t)return t;let i=Ve(e.toLowerCase());return $s.set(e,i),i},Bs=class extends Ii{constructor(){super({max:256});}},Hn=class extends Ii{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1});}},Ir=Symbol("PathScurry setAsCwd"),rt,ei,ii,si,ri,hi,ni,oi,ai,li,ci,ui,pi,fi,di,gi,mi,wi,yi,ie,me,Pt,Ut,Gt,It,O,we,Ht,jt,R,cs,zi,Ye,us,ps,Ke,Ni,fs,ds,_i,Hr,qr,Zr,gs,Le,We,Jr,ye,dr,ot=(dr=class{constructor(e,t=yt,i,s,h,n,o){chunkPQC2BFS2_cjs.f(this,R);chunkPQC2BFS2_cjs.d(this,"name");chunkPQC2BFS2_cjs.d(this,"root");chunkPQC2BFS2_cjs.d(this,"roots");chunkPQC2BFS2_cjs.d(this,"parent");chunkPQC2BFS2_cjs.d(this,"nocase");chunkPQC2BFS2_cjs.d(this,"isCWD",false);chunkPQC2BFS2_cjs.f(this,rt);chunkPQC2BFS2_cjs.f(this,ei);chunkPQC2BFS2_cjs.f(this,ii);chunkPQC2BFS2_cjs.f(this,si);chunkPQC2BFS2_cjs.f(this,ri);chunkPQC2BFS2_cjs.f(this,hi);chunkPQC2BFS2_cjs.f(this,ni);chunkPQC2BFS2_cjs.f(this,oi);chunkPQC2BFS2_cjs.f(this,ai);chunkPQC2BFS2_cjs.f(this,li);chunkPQC2BFS2_cjs.f(this,ci);chunkPQC2BFS2_cjs.f(this,ui);chunkPQC2BFS2_cjs.f(this,pi);chunkPQC2BFS2_cjs.f(this,fi);chunkPQC2BFS2_cjs.f(this,di);chunkPQC2BFS2_cjs.f(this,gi);chunkPQC2BFS2_cjs.f(this,mi);chunkPQC2BFS2_cjs.f(this,wi);chunkPQC2BFS2_cjs.f(this,yi);chunkPQC2BFS2_cjs.f(this,ie);chunkPQC2BFS2_cjs.f(this,me);chunkPQC2BFS2_cjs.f(this,Pt);chunkPQC2BFS2_cjs.f(this,Ut);chunkPQC2BFS2_cjs.f(this,Gt);chunkPQC2BFS2_cjs.f(this,It);chunkPQC2BFS2_cjs.f(this,O);chunkPQC2BFS2_cjs.f(this,we);chunkPQC2BFS2_cjs.f(this,Ht);chunkPQC2BFS2_cjs.f(this,jt);chunkPQC2BFS2_cjs.f(this,Le,[]);chunkPQC2BFS2_cjs.f(this,We,false);chunkPQC2BFS2_cjs.f(this,ye);this.name=e,chunkPQC2BFS2_cjs.g(this,ie,h?Mi(e):Ve(e)),chunkPQC2BFS2_cjs.g(this,O,t&In),this.nocase=h,this.roots=s,this.root=i||this,chunkPQC2BFS2_cjs.g(this,we,n),chunkPQC2BFS2_cjs.g(this,Pt,o.fullpath),chunkPQC2BFS2_cjs.g(this,Gt,o.relative),chunkPQC2BFS2_cjs.g(this,It,o.relativePosix),this.parent=o.parent,this.parent?chunkPQC2BFS2_cjs.g(this,rt,chunkPQC2BFS2_cjs.e(this.parent,rt)):chunkPQC2BFS2_cjs.g(this,rt,zr(o.fs));}get dev(){return chunkPQC2BFS2_cjs.e(this,ei)}get mode(){return chunkPQC2BFS2_cjs.e(this,ii)}get nlink(){return chunkPQC2BFS2_cjs.e(this,si)}get uid(){return chunkPQC2BFS2_cjs.e(this,ri)}get gid(){return chunkPQC2BFS2_cjs.e(this,hi)}get rdev(){return chunkPQC2BFS2_cjs.e(this,ni)}get blksize(){return chunkPQC2BFS2_cjs.e(this,oi)}get ino(){return chunkPQC2BFS2_cjs.e(this,ai)}get size(){return chunkPQC2BFS2_cjs.e(this,li)}get blocks(){return chunkPQC2BFS2_cjs.e(this,ci)}get atimeMs(){return chunkPQC2BFS2_cjs.e(this,ui)}get mtimeMs(){return chunkPQC2BFS2_cjs.e(this,pi)}get ctimeMs(){return chunkPQC2BFS2_cjs.e(this,fi)}get birthtimeMs(){return chunkPQC2BFS2_cjs.e(this,di)}get atime(){return chunkPQC2BFS2_cjs.e(this,gi)}get mtime(){return chunkPQC2BFS2_cjs.e(this,mi)}get ctime(){return chunkPQC2BFS2_cjs.e(this,wi)}get birthtime(){return chunkPQC2BFS2_cjs.e(this,yi)}get parentPath(){return (this.parent||this).fullpath()}get path(){return this.parentPath}depth(){return chunkPQC2BFS2_cjs.e(this,me)!==void 0?chunkPQC2BFS2_cjs.e(this,me):this.parent?chunkPQC2BFS2_cjs.g(this,me,this.parent.depth()+1):chunkPQC2BFS2_cjs.g(this,me,0)}childrenCache(){return chunkPQC2BFS2_cjs.e(this,we)}resolve(e){var s;if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?chunkPQC2BFS2_cjs.h(s=this.getRoot(t),R,cs).call(s,i):chunkPQC2BFS2_cjs.h(this,R,cs).call(this,i)}children(){let e=chunkPQC2BFS2_cjs.e(this,we).get(this);if(e)return e;let t=Object.assign([],{provisional:0});return chunkPQC2BFS2_cjs.e(this,we).set(this,t),chunkPQC2BFS2_cjs.g(this,O,chunkPQC2BFS2_cjs.e(this,O)&~es),t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let i=this.children(),s=this.nocase?Mi(e):Ve(e);for(let a of i)if(chunkPQC2BFS2_cjs.e(a,ie)===s)return a;let h=this.parent?this.sep:"",n=chunkPQC2BFS2_cjs.e(this,Pt)?chunkPQC2BFS2_cjs.e(this,Pt)+h+e:void 0,o=this.newChild(e,yt,{...t,parent:this,fullpath:n});return this.canReaddir()||chunkPQC2BFS2_cjs.g(o,O,chunkPQC2BFS2_cjs.e(o,O)|Et),i.push(o),o}relative(){if(this.isCWD)return "";if(chunkPQC2BFS2_cjs.e(this,Gt)!==void 0)return chunkPQC2BFS2_cjs.e(this,Gt);let e=this.name,t=this.parent;if(!t)return chunkPQC2BFS2_cjs.g(this,Gt,this.name);let i=t.relative();return i+(!i||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return "";if(chunkPQC2BFS2_cjs.e(this,It)!==void 0)return chunkPQC2BFS2_cjs.e(this,It);let e=this.name,t=this.parent;if(!t)return chunkPQC2BFS2_cjs.g(this,It,this.fullpathPosix());let i=t.relativePosix();return i+(!i||!t.parent?"":"/")+e}fullpath(){if(chunkPQC2BFS2_cjs.e(this,Pt)!==void 0)return chunkPQC2BFS2_cjs.e(this,Pt);let e=this.name,t=this.parent;if(!t)return chunkPQC2BFS2_cjs.g(this,Pt,this.name);let i=t.fullpath()+(t.parent?this.sep:"")+e;return chunkPQC2BFS2_cjs.g(this,Pt,i)}fullpathPosix(){if(chunkPQC2BFS2_cjs.e(this,Ut)!==void 0)return chunkPQC2BFS2_cjs.e(this,Ut);if(this.sep==="/")return chunkPQC2BFS2_cjs.g(this,Ut,this.fullpath());if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return /^[a-z]:\//i.test(s)?chunkPQC2BFS2_cjs.g(this,Ut,`//?/${s}`):chunkPQC2BFS2_cjs.g(this,Ut,s)}let e=this.parent,t=e.fullpathPosix(),i=t+(!t||!e.parent?"":"/")+this.name;return chunkPQC2BFS2_cjs.g(this,Ut,i)}isUnknown(){return (chunkPQC2BFS2_cjs.e(this,O)&mt)===yt}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return (chunkPQC2BFS2_cjs.e(this,O)&mt)===Ur}isDirectory(){return (chunkPQC2BFS2_cjs.e(this,O)&mt)===Wt}isCharacterDevice(){return (chunkPQC2BFS2_cjs.e(this,O)&mt)===$r}isBlockDevice(){return (chunkPQC2BFS2_cjs.e(this,O)&mt)===Br}isFIFO(){return (chunkPQC2BFS2_cjs.e(this,O)&mt)===_r}isSocket(){return (chunkPQC2BFS2_cjs.e(this,O)&mt)===Gr}isSymbolicLink(){return (chunkPQC2BFS2_cjs.e(this,O)&le)===le}lstatCached(){return chunkPQC2BFS2_cjs.e(this,O)&zs?this:void 0}readlinkCached(){return chunkPQC2BFS2_cjs.e(this,Ht)}realpathCached(){return chunkPQC2BFS2_cjs.e(this,jt)}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(chunkPQC2BFS2_cjs.e(this,Ht))return true;if(!this.parent)return false;let e=chunkPQC2BFS2_cjs.e(this,O)&mt;return !(e!==yt&&e!==le||chunkPQC2BFS2_cjs.e(this,O)&Ti||chunkPQC2BFS2_cjs.e(this,O)&Et)}calledReaddir(){return !!(chunkPQC2BFS2_cjs.e(this,O)&es)}isENOENT(){return !!(chunkPQC2BFS2_cjs.e(this,O)&Et)}isNamed(e){return this.nocase?chunkPQC2BFS2_cjs.e(this,ie)===Mi(e):chunkPQC2BFS2_cjs.e(this,ie)===Ve(e)}async readlink(){let e=chunkPQC2BFS2_cjs.e(this,Ht);if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await chunkPQC2BFS2_cjs.e(this,rt).promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(t);if(i)return chunkPQC2BFS2_cjs.g(this,Ht,i)}catch(t){chunkPQC2BFS2_cjs.h(this,R,ds).call(this,t.code);return}}readlinkSync(){let e=chunkPQC2BFS2_cjs.e(this,Ht);if(e)return e;if(this.canReadlink()&&this.parent)try{let t=chunkPQC2BFS2_cjs.e(this,rt).readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(t);if(i)return chunkPQC2BFS2_cjs.g(this,Ht,i)}catch(t){chunkPQC2BFS2_cjs.h(this,R,ds).call(this,t.code);return}}async lstat(){if((chunkPQC2BFS2_cjs.e(this,O)&Et)===0)try{return chunkPQC2BFS2_cjs.h(this,R,gs).call(this,await chunkPQC2BFS2_cjs.e(this,rt).promises.lstat(this.fullpath())),this}catch(e){chunkPQC2BFS2_cjs.h(this,R,fs).call(this,e.code);}}lstatSync(){if((chunkPQC2BFS2_cjs.e(this,O)&Et)===0)try{return chunkPQC2BFS2_cjs.h(this,R,gs).call(this,chunkPQC2BFS2_cjs.e(this,rt).lstatSync(this.fullpath())),this}catch(e){chunkPQC2BFS2_cjs.h(this,R,fs).call(this,e.code);}}readdirCB(e,t=false){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let i=this.children();if(this.calledReaddir()){let h=i.slice(0,i.provisional);t?e(null,h):queueMicrotask(()=>e(null,h));return}if(chunkPQC2BFS2_cjs.e(this,Le).push(e),chunkPQC2BFS2_cjs.e(this,We))return;chunkPQC2BFS2_cjs.g(this,We,true);let s=this.fullpath();chunkPQC2BFS2_cjs.e(this,rt).readdir(s,{withFileTypes:true},(h,n)=>{if(h)chunkPQC2BFS2_cjs.h(this,R,Ni).call(this,h.code),i.provisional=0;else {for(let o of n)chunkPQC2BFS2_cjs.h(this,R,_i).call(this,o,i);chunkPQC2BFS2_cjs.h(this,R,zi).call(this,i);}chunkPQC2BFS2_cjs.h(this,R,Jr).call(this,i.slice(0,i.provisional));});}async readdir(){if(!this.canReaddir())return [];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(chunkPQC2BFS2_cjs.e(this,ye))await chunkPQC2BFS2_cjs.e(this,ye);else {let i=()=>{};chunkPQC2BFS2_cjs.g(this,ye,new Promise(s=>i=s));try{for(let s of await chunkPQC2BFS2_cjs.e(this,rt).promises.readdir(t,{withFileTypes:!0}))chunkPQC2BFS2_cjs.h(this,R,_i).call(this,s,e);chunkPQC2BFS2_cjs.h(this,R,zi).call(this,e);}catch(s){chunkPQC2BFS2_cjs.h(this,R,Ni).call(this,s.code),e.provisional=0;}chunkPQC2BFS2_cjs.g(this,ye,void 0),i();}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return [];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let i of chunkPQC2BFS2_cjs.e(this,rt).readdirSync(t,{withFileTypes:!0}))chunkPQC2BFS2_cjs.h(this,R,_i).call(this,i,e);chunkPQC2BFS2_cjs.h(this,R,zi).call(this,e);}catch(i){chunkPQC2BFS2_cjs.h(this,R,Ni).call(this,i.code),e.provisional=0;}return e.slice(0,e.provisional)}canReaddir(){if(chunkPQC2BFS2_cjs.e(this,O)&Ns)return false;let e=mt&chunkPQC2BFS2_cjs.e(this,O);return e===yt||e===Wt||e===le}shouldWalk(e,t){return (chunkPQC2BFS2_cjs.e(this,O)&Wt)===Wt&&!(chunkPQC2BFS2_cjs.e(this,O)&Ns)&&!e.has(this)&&(!t||t(this))}async realpath(){if(chunkPQC2BFS2_cjs.e(this,jt))return chunkPQC2BFS2_cjs.e(this,jt);if(!((ji|Ti|Et)&chunkPQC2BFS2_cjs.e(this,O)))try{let e=await chunkPQC2BFS2_cjs.e(this,rt).promises.realpath(this.fullpath());return chunkPQC2BFS2_cjs.g(this,jt,this.resolve(e))}catch{chunkPQC2BFS2_cjs.h(this,R,ps).call(this);}}realpathSync(){if(chunkPQC2BFS2_cjs.e(this,jt))return chunkPQC2BFS2_cjs.e(this,jt);if(!((ji|Ti|Et)&chunkPQC2BFS2_cjs.e(this,O)))try{let e=chunkPQC2BFS2_cjs.e(this,rt).realpathSync(this.fullpath());return chunkPQC2BFS2_cjs.g(this,jt,this.resolve(e))}catch{chunkPQC2BFS2_cjs.h(this,R,ps).call(this);}}[Ir](e){if(e===this)return;e.isCWD=false,this.isCWD=true;let t=new Set([]),i=[],s=this;for(;s&&s.parent;)t.add(s),chunkPQC2BFS2_cjs.g(s,Gt,i.join(this.sep)),chunkPQC2BFS2_cjs.g(s,It,i.join("/")),s=s.parent,i.push("..");for(s=e;s&&s.parent&&!t.has(s);)chunkPQC2BFS2_cjs.g(s,Gt,void 0),chunkPQC2BFS2_cjs.g(s,It,void 0),s=s.parent;}},rt=new WeakMap,ei=new WeakMap,ii=new WeakMap,si=new WeakMap,ri=new WeakMap,hi=new WeakMap,ni=new WeakMap,oi=new WeakMap,ai=new WeakMap,li=new WeakMap,ci=new WeakMap,ui=new WeakMap,pi=new WeakMap,fi=new WeakMap,di=new WeakMap,gi=new WeakMap,mi=new WeakMap,wi=new WeakMap,yi=new WeakMap,ie=new WeakMap,me=new WeakMap,Pt=new WeakMap,Ut=new WeakMap,Gt=new WeakMap,It=new WeakMap,O=new WeakMap,we=new WeakMap,Ht=new WeakMap,jt=new WeakMap,R=new WeakSet,cs=function(e){let t=this;for(let i of e)t=t.child(i);return t},zi=function(e){var t;chunkPQC2BFS2_cjs.g(this,O,chunkPQC2BFS2_cjs.e(this,O)|es);for(let i=e.provisional;i<e.length;i++){let s=e[i];s&&chunkPQC2BFS2_cjs.h(t=s,R,Ye).call(t);}},Ye=function(){chunkPQC2BFS2_cjs.e(this,O)&Et||(chunkPQC2BFS2_cjs.g(this,O,(chunkPQC2BFS2_cjs.e(this,O)|Et)&Ie),chunkPQC2BFS2_cjs.h(this,R,us).call(this));},us=function(){var t;let e=this.children();e.provisional=0;for(let i of e)chunkPQC2BFS2_cjs.h(t=i,R,Ye).call(t);},ps=function(){chunkPQC2BFS2_cjs.g(this,O,chunkPQC2BFS2_cjs.e(this,O)|ji),chunkPQC2BFS2_cjs.h(this,R,Ke).call(this);},Ke=function(){if(chunkPQC2BFS2_cjs.e(this,O)&Je)return;let e=chunkPQC2BFS2_cjs.e(this,O);(e&mt)===Wt&&(e&=Ie),chunkPQC2BFS2_cjs.g(this,O,e|Je),chunkPQC2BFS2_cjs.h(this,R,us).call(this);},Ni=function(e=""){e==="ENOTDIR"||e==="EPERM"?chunkPQC2BFS2_cjs.h(this,R,Ke).call(this):e==="ENOENT"?chunkPQC2BFS2_cjs.h(this,R,Ye).call(this):this.children().provisional=0;},fs=function(e=""){var t;e==="ENOTDIR"?chunkPQC2BFS2_cjs.h(t=this.parent,R,Ke).call(t):e==="ENOENT"&&chunkPQC2BFS2_cjs.h(this,R,Ye).call(this);},ds=function(e=""){var i;let t=chunkPQC2BFS2_cjs.e(this,O);t|=Ti,e==="ENOENT"&&(t|=Et),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Ie),chunkPQC2BFS2_cjs.g(this,O,t),e==="ENOTDIR"&&this.parent&&chunkPQC2BFS2_cjs.h(i=this.parent,R,Ke).call(i);},_i=function(e,t){return chunkPQC2BFS2_cjs.h(this,R,qr).call(this,e,t)||chunkPQC2BFS2_cjs.h(this,R,Hr).call(this,e,t)},Hr=function(e,t){let i=is(e),s=this.newChild(e.name,i,{parent:this}),h=chunkPQC2BFS2_cjs.e(s,O)&mt;return h!==Wt&&h!==le&&h!==yt&&chunkPQC2BFS2_cjs.g(s,O,chunkPQC2BFS2_cjs.e(s,O)|Je),t.unshift(s),t.provisional++,s},qr=function(e,t){for(let i=t.provisional;i<t.length;i++){let s=t[i];if((this.nocase?Mi(e.name):Ve(e.name))===chunkPQC2BFS2_cjs.e(s,ie))return chunkPQC2BFS2_cjs.h(this,R,Zr).call(this,e,s,i,t)}},Zr=function(e,t,i,s){let h=t.name;return chunkPQC2BFS2_cjs.g(t,O,chunkPQC2BFS2_cjs.e(t,O)&Ie|is(e)),h!==e.name&&(t.name=e.name),i!==s.provisional&&(i===s.length-1?s.pop():s.splice(i,1),s.unshift(t)),s.provisional++,t},gs=function(e){let{atime:t,atimeMs:i,birthtime:s,birthtimeMs:h,blksize:n,blocks:o,ctime:a,ctimeMs:l,dev:u,gid:d,ino:f,mode:w,mtime:S,mtimeMs:E,nlink:b,rdev:x,size:v,uid:C}=e;chunkPQC2BFS2_cjs.g(this,gi,t),chunkPQC2BFS2_cjs.g(this,ui,i),chunkPQC2BFS2_cjs.g(this,yi,s),chunkPQC2BFS2_cjs.g(this,di,h),chunkPQC2BFS2_cjs.g(this,oi,n),chunkPQC2BFS2_cjs.g(this,ci,o),chunkPQC2BFS2_cjs.g(this,wi,a),chunkPQC2BFS2_cjs.g(this,fi,l),chunkPQC2BFS2_cjs.g(this,ei,u),chunkPQC2BFS2_cjs.g(this,hi,d),chunkPQC2BFS2_cjs.g(this,ai,f),chunkPQC2BFS2_cjs.g(this,ii,w),chunkPQC2BFS2_cjs.g(this,mi,S),chunkPQC2BFS2_cjs.g(this,pi,E),chunkPQC2BFS2_cjs.g(this,si,b),chunkPQC2BFS2_cjs.g(this,ni,x),chunkPQC2BFS2_cjs.g(this,li,v),chunkPQC2BFS2_cjs.g(this,ri,C);let F=is(e);chunkPQC2BFS2_cjs.g(this,O,chunkPQC2BFS2_cjs.e(this,O)&Ie|F|zs),F!==yt&&F!==Wt&&F!==le&&chunkPQC2BFS2_cjs.g(this,O,chunkPQC2BFS2_cjs.e(this,O)|Je);},Le=new WeakMap,We=new WeakMap,Jr=function(e){chunkPQC2BFS2_cjs.g(this,We,false);let t=chunkPQC2BFS2_cjs.e(this,Le).slice();chunkPQC2BFS2_cjs.e(this,Le).length=0,t.forEach(i=>i(null,e));},ye=new WeakMap,dr),Vr=class Yr extends ot{constructor(i,s=yt,h,n,o,a,l){super(i,s,h,n,o,a,l);chunkPQC2BFS2_cjs.d(this,"sep","\\");chunkPQC2BFS2_cjs.d(this,"splitSep",Gn);}newChild(i,s=yt,h={}){return new Yr(i,s,this.root,this.roots,this.nocase,this.childrenCache(),h)}getRootString(i){return Es.win32.parse(i).root}getRoot(i){if(i=Un(i.toUpperCase()),i===this.root.name)return this.root;for(let[s,h]of Object.entries(this.roots))if(this.sameRoot(i,s))return this.roots[i]=h;return this.roots[i]=new Ss(i,this).root}sameRoot(i,s=this.root.name){return i=i.toUpperCase().replace(/\//g,"\\").replace(Nr,"$1\\"),i===s}},Kr=class Xr extends ot{constructor(i,s=yt,h,n,o,a,l){super(i,s,h,n,o,a,l);chunkPQC2BFS2_cjs.d(this,"splitSep","/");chunkPQC2BFS2_cjs.d(this,"sep","/");}getRootString(i){return i.startsWith("/")?"/":""}getRoot(i){return this.root}newChild(i,s=yt,h={}){return new Xr(i,s,this.root,this.roots,this.nocase,this.childrenCache(),h)}},De,Pe,bi,Si,gr,Qr=(gr=class{constructor(e=process.cwd(),t,i,{nocase:s,childrenCacheSize:h=16*1024,fs:n=Ze}={}){chunkPQC2BFS2_cjs.d(this,"root");chunkPQC2BFS2_cjs.d(this,"rootPath");chunkPQC2BFS2_cjs.d(this,"roots");chunkPQC2BFS2_cjs.d(this,"cwd");chunkPQC2BFS2_cjs.f(this,De);chunkPQC2BFS2_cjs.f(this,Pe);chunkPQC2BFS2_cjs.f(this,bi);chunkPQC2BFS2_cjs.d(this,"nocase");chunkPQC2BFS2_cjs.f(this,Si);chunkPQC2BFS2_cjs.g(this,Si,zr(n)),(e instanceof URL||e.startsWith("file://"))&&(e=url.fileURLToPath(e));let o=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),chunkPQC2BFS2_cjs.g(this,De,new Bs),chunkPQC2BFS2_cjs.g(this,Pe,new Bs),chunkPQC2BFS2_cjs.g(this,bi,new Hn(h));let a=o.substring(this.rootPath.length).split(i);if(a.length===1&&!a[0]&&a.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(chunkPQC2BFS2_cjs.e(this,Si)),this.roots[this.rootPath]=this.root;let l=this.root,u=a.length-1,d=t.sep,f=this.rootPath,w=false;for(let S of a){let E=u--;l=l.child(S,{relative:new Array(E).fill("..").join(d),relativePosix:new Array(E).fill("..").join("/"),fullpath:f+=(w?"":d)+S}),w=true;}this.cwd=l;}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return chunkPQC2BFS2_cjs.e(this,bi)}resolve(...e){let t="";for(let h=e.length-1;h>=0;h--){let n=e[h];if(!(!n||n===".")&&(t=t?`${n}/${t}`:n,this.isAbsolute(n)))break}let i=chunkPQC2BFS2_cjs.e(this,De).get(t);if(i!==void 0)return i;let s=this.cwd.resolve(t).fullpath();return chunkPQC2BFS2_cjs.e(this,De).set(t,s),s}resolvePosix(...e){let t="";for(let h=e.length-1;h>=0;h--){let n=e[h];if(!(!n||n===".")&&(t=t?`${n}/${t}`:n,this.isAbsolute(n)))break}let i=chunkPQC2BFS2_cjs.e(this,Pe).get(t);if(i!==void 0)return i;let s=this.cwd.resolve(t).fullpathPosix();return chunkPQC2BFS2_cjs.e(this,Pe).set(t,s),s}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:true}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ot||(t=e,e=this.cwd);let{withFileTypes:i}=t;if(e.canReaddir()){let s=await e.readdir();return i?s:s.map(h=>h.name)}else return []}readdirSync(e=this.cwd,t={withFileTypes:true}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ot||(t=e,e=this.cwd);let{withFileTypes:i=true}=t;return e.canReaddir()?i?e.readdirSync():e.readdirSync().map(s=>s.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ot||(t=e.withFileTypes,e=this.cwd);let i=await e.readlink();return t?i:i?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ot||(t=e.withFileTypes,e=this.cwd);let i=e.readlinkSync();return t?i:i?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ot||(t=e.withFileTypes,e=this.cwd);let i=await e.realpath();return t?i:i?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ot||(t=e.withFileTypes,e=this.cwd);let i=e.realpathSync();return t?i:i?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ot||(t=e,e=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:h,walkFilter:n}=t,o=[];(!h||h(e))&&o.push(i?e:e.fullpath());let a=new Set,l=(d,f)=>{a.add(d),d.readdirCB((w,S)=>{if(w)return f(w);let E=S.length;if(!E)return f();let b=()=>{--E===0&&f();};for(let x of S)(!h||h(x))&&o.push(i?x:x.fullpath()),s&&x.isSymbolicLink()?x.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(a,n)?l(v,b):b()):x.shouldWalk(a,n)?l(x,b):b();},true);},u=e;return new Promise((d,f)=>{l(u,w=>{if(w)return f(w);d(o);});})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ot||(t=e,e=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:h,walkFilter:n}=t,o=[];(!h||h(e))&&o.push(i?e:e.fullpath());let a=new Set([e]);for(let l of a){let u=l.readdirSync();for(let d of u){(!h||h(d))&&o.push(i?d:d.fullpath());let f=d;if(d.isSymbolicLink()){if(!(s&&(f=d.realpathSync())))continue;f.isUnknown()&&f.lstatSync();}f.shouldWalk(a,n)&&a.add(f);}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof ot||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ot||(t=e,e=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:h,walkFilter:n}=t;(!h||h(e))&&(yield i?e:e.fullpath());let o=new Set([e]);for(let a of o){let l=a.readdirSync();for(let u of l){(!h||h(u))&&(yield i?u:u.fullpath());let d=u;if(u.isSymbolicLink()){if(!(s&&(d=u.realpathSync())))continue;d.isUnknown()&&d.lstatSync();}d.shouldWalk(o,n)&&o.add(d);}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ot||(t=e,e=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:h,walkFilter:n}=t,o=new Ui({objectMode:true});(!h||h(e))&&o.write(i?e:e.fullpath());let a=new Set,l=[e],u=0,d=()=>{let f=false;for(;!f;){let w=l.shift();if(!w){u===0&&o.end();return}u++,a.add(w);let S=(b,x,v=false)=>{if(b)return o.emit("error",b);if(s&&!v){let C=[];for(let F of x)F.isSymbolicLink()&&C.push(F.realpath().then(T=>T?.isUnknown()?T.lstat():T));if(C.length){Promise.all(C).then(()=>S(null,x,true));return}}for(let C of x)C&&(!h||h(C))&&(o.write(i?C:C.fullpath())||(f=true));u--;for(let C of x){let F=C.realpathCached()||C;F.shouldWalk(a,n)&&l.push(F);}f&&!o.flowing?o.once("drain",d):E||d();},E=true;w.readdirCB(S,true),E=false;}};return d(),o}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof ot||(t=e,e=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:h,walkFilter:n}=t,o=new Ui({objectMode:true}),a=new Set;(!h||h(e))&&o.write(i?e:e.fullpath());let l=[e],u=0,d=()=>{let f=false;for(;!f;){let w=l.shift();if(!w){u===0&&o.end();return}u++,a.add(w);let S=w.readdirSync();for(let E of S)(!h||h(E))&&(o.write(i?E:E.fullpath())||(f=true));u--;for(let E of S){let b=E;if(E.isSymbolicLink()){if(!(s&&(b=E.realpathSync())))continue;b.isUnknown()&&b.lstatSync();}b.shouldWalk(a,n)&&l.push(b);}}f&&!o.flowing&&o.once("drain",d);};return d(),o}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[Ir](t);}},De=new WeakMap,Pe=new WeakMap,bi=new WeakMap,Si=new WeakMap,gr),Ss=class extends Qr{constructor(t=process.cwd(),i={}){let{nocase:s=true}=i;super(t,Es.win32,"\\",{...i,nocase:s});chunkPQC2BFS2_cjs.d(this,"sep","\\");this.nocase=s;for(let h=this.cwd;h;h=h.parent)h.nocase=this.nocase;}parseRootPath(t){return Es.win32.parse(t).root.toUpperCase()}newRoot(t){return new Vr(this.rootPath,Wt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},vs=class extends Qr{constructor(t=process.cwd(),i={}){let{nocase:s=false}=i;super(t,Es.posix,"/",{...i,nocase:s});chunkPQC2BFS2_cjs.d(this,"sep","/");this.nocase=s;}parseRootPath(t){return "/"}newRoot(t){return new Kr(this.rootPath,Wt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},th=class extends vs{constructor(e=process.cwd(),t={}){let{nocase:i=true}=t;super(e,{...t,nocase:i});}};process.platform==="win32"?Vr:Kr;var qn=process.platform==="win32"?Ss:process.platform==="darwin"?th:vs,Zn=e=>e.length>=1,Jn=e=>e.length>=1,Vn=Symbol.for("nodejs.util.inspect.custom"),G,at,I,be,Mt,vi,se,re,he,je,ze,eh=(ze=class{constructor(t,i,s,h){chunkPQC2BFS2_cjs.f(this,G);chunkPQC2BFS2_cjs.f(this,at);chunkPQC2BFS2_cjs.f(this,I);chunkPQC2BFS2_cjs.d(this,"length");chunkPQC2BFS2_cjs.f(this,be);chunkPQC2BFS2_cjs.f(this,Mt);chunkPQC2BFS2_cjs.f(this,vi);chunkPQC2BFS2_cjs.f(this,se);chunkPQC2BFS2_cjs.f(this,re);chunkPQC2BFS2_cjs.f(this,he);chunkPQC2BFS2_cjs.f(this,je,true);if(!Zn(t))throw new TypeError("empty pattern list");if(!Jn(i))throw new TypeError("empty glob list");if(i.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(chunkPQC2BFS2_cjs.g(this,G,t),chunkPQC2BFS2_cjs.g(this,at,i),chunkPQC2BFS2_cjs.g(this,I,s),chunkPQC2BFS2_cjs.g(this,be,h),chunkPQC2BFS2_cjs.e(this,I)===0){if(this.isUNC()){let[n,o,a,l,...u]=chunkPQC2BFS2_cjs.e(this,G),[d,f,w,S,...E]=chunkPQC2BFS2_cjs.e(this,at);u[0]===""&&(u.shift(),E.shift());let b=[n,o,a,l,""].join("/"),x=[d,f,w,S,""].join("/");chunkPQC2BFS2_cjs.g(this,G,[b,...u]),chunkPQC2BFS2_cjs.g(this,at,[x,...E]),this.length=chunkPQC2BFS2_cjs.e(this,G).length;}else if(this.isDrive()||this.isAbsolute()){let[n,...o]=chunkPQC2BFS2_cjs.e(this,G),[a,...l]=chunkPQC2BFS2_cjs.e(this,at);o[0]===""&&(o.shift(),l.shift());let u=n+"/",d=a+"/";chunkPQC2BFS2_cjs.g(this,G,[u,...o]),chunkPQC2BFS2_cjs.g(this,at,[d,...l]),this.length=chunkPQC2BFS2_cjs.e(this,G).length;}}}[Vn](){return "Pattern <"+chunkPQC2BFS2_cjs.e(this,at).slice(chunkPQC2BFS2_cjs.e(this,I)).join("/")+">"}pattern(){return chunkPQC2BFS2_cjs.e(this,G)[chunkPQC2BFS2_cjs.e(this,I)]}isString(){return typeof chunkPQC2BFS2_cjs.e(this,G)[chunkPQC2BFS2_cjs.e(this,I)]=="string"}isGlobstar(){return chunkPQC2BFS2_cjs.e(this,G)[chunkPQC2BFS2_cjs.e(this,I)]===ht}isRegExp(){return chunkPQC2BFS2_cjs.e(this,G)[chunkPQC2BFS2_cjs.e(this,I)]instanceof RegExp}globString(){return chunkPQC2BFS2_cjs.g(this,vi,chunkPQC2BFS2_cjs.e(this,vi)||(chunkPQC2BFS2_cjs.e(this,I)===0?this.isAbsolute()?chunkPQC2BFS2_cjs.e(this,at)[0]+chunkPQC2BFS2_cjs.e(this,at).slice(1).join("/"):chunkPQC2BFS2_cjs.e(this,at).join("/"):chunkPQC2BFS2_cjs.e(this,at).slice(chunkPQC2BFS2_cjs.e(this,I)).join("/")))}hasMore(){return this.length>chunkPQC2BFS2_cjs.e(this,I)+1}rest(){return chunkPQC2BFS2_cjs.e(this,Mt)!==void 0?chunkPQC2BFS2_cjs.e(this,Mt):this.hasMore()?(chunkPQC2BFS2_cjs.g(this,Mt,new ze(chunkPQC2BFS2_cjs.e(this,G),chunkPQC2BFS2_cjs.e(this,at),chunkPQC2BFS2_cjs.e(this,I)+1,chunkPQC2BFS2_cjs.e(this,be))),chunkPQC2BFS2_cjs.g(chunkPQC2BFS2_cjs.e(this,Mt),he,chunkPQC2BFS2_cjs.e(this,he)),chunkPQC2BFS2_cjs.g(chunkPQC2BFS2_cjs.e(this,Mt),re,chunkPQC2BFS2_cjs.e(this,re)),chunkPQC2BFS2_cjs.g(chunkPQC2BFS2_cjs.e(this,Mt),se,chunkPQC2BFS2_cjs.e(this,se)),chunkPQC2BFS2_cjs.e(this,Mt)):chunkPQC2BFS2_cjs.g(this,Mt,null)}isUNC(){let t=chunkPQC2BFS2_cjs.e(this,G);return chunkPQC2BFS2_cjs.e(this,re)!==void 0?chunkPQC2BFS2_cjs.e(this,re):chunkPQC2BFS2_cjs.g(this,re,chunkPQC2BFS2_cjs.e(this,be)==="win32"&&chunkPQC2BFS2_cjs.e(this,I)===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3])}isDrive(){let t=chunkPQC2BFS2_cjs.e(this,G);return chunkPQC2BFS2_cjs.e(this,se)!==void 0?chunkPQC2BFS2_cjs.e(this,se):chunkPQC2BFS2_cjs.g(this,se,chunkPQC2BFS2_cjs.e(this,be)==="win32"&&chunkPQC2BFS2_cjs.e(this,I)===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]))}isAbsolute(){let t=chunkPQC2BFS2_cjs.e(this,G);return chunkPQC2BFS2_cjs.e(this,he)!==void 0?chunkPQC2BFS2_cjs.e(this,he):chunkPQC2BFS2_cjs.g(this,he,t[0]===""&&t.length>1||this.isDrive()||this.isUNC())}root(){let t=chunkPQC2BFS2_cjs.e(this,G)[0];return typeof t=="string"&&this.isAbsolute()&&chunkPQC2BFS2_cjs.e(this,I)===0?t:""}checkFollowGlobstar(){return !(chunkPQC2BFS2_cjs.e(this,I)===0||!this.isGlobstar()||!chunkPQC2BFS2_cjs.e(this,je))}markFollowGlobstar(){return chunkPQC2BFS2_cjs.e(this,I)===0||!this.isGlobstar()||!chunkPQC2BFS2_cjs.e(this,je)?false:(chunkPQC2BFS2_cjs.g(this,je,false),true)}},G=new WeakMap,at=new WeakMap,I=new WeakMap,be=new WeakMap,Mt=new WeakMap,vi=new WeakMap,se=new WeakMap,re=new WeakMap,he=new WeakMap,je=new WeakMap,ze),Yn=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Us=class{constructor(e,{nobrace:t,nocase:i,noext:s,noglobstar:h,platform:n=Yn}){chunkPQC2BFS2_cjs.d(this,"relative");chunkPQC2BFS2_cjs.d(this,"relativeChildren");chunkPQC2BFS2_cjs.d(this,"absolute");chunkPQC2BFS2_cjs.d(this,"absoluteChildren");chunkPQC2BFS2_cjs.d(this,"platform");chunkPQC2BFS2_cjs.d(this,"mmopts");this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=n,this.mmopts={dot:true,nobrace:t,nocase:i,noext:s,noglobstar:h,optimizationLevel:2,platform:n,nocomment:true,nonegate:true};for(let o of e)this.add(o);}add(e){let t=new oe(e,this.mmopts);for(let i=0;i<t.set.length;i++){let s=t.set[i],h=t.globParts[i];if(!s||!h)throw new Error("invalid pattern object");for(;s[0]==="."&&h[0]===".";)s.shift(),h.shift();let n=new eh(s,h,0,this.platform),o=new oe(n.globString(),this.mmopts),a=h[h.length-1]==="**",l=n.isAbsolute();l?this.absolute.push(o):this.relative.push(o),a&&(l?this.absoluteChildren.push(o):this.relativeChildren.push(o));}}ignored(e){let t=e.fullpath(),i=`${t}/`,s=e.relative()||".",h=`${s}/`;for(let n of this.relative)if(n.match(s)||n.match(h))return true;for(let n of this.absolute)if(n.match(t)||n.match(i))return true;return false}childrenIgnored(e){let t=e.fullpath()+"/",i=(e.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(i))return true;for(let s of this.absoluteChildren)if(s.match(t))return true;return false}},Kn=class ih{constructor(t=new Map){chunkPQC2BFS2_cjs.d(this,"store");this.store=t;}copy(){return new ih(new Map(this.store))}hasWalked(t,i){return this.store.get(t.fullpath())?.has(i.globString())}storeWalked(t,i){let s=t.fullpath(),h=this.store.get(s);h?h.add(i.globString()):this.store.set(s,new Set([i.globString()]));}},Xn=class{constructor(){chunkPQC2BFS2_cjs.d(this,"store",new Map);}add(e,t,i){let s=(t?2:0)|(i?1:0),h=this.store.get(e);this.store.set(e,h===void 0?s:s&h);}entries(){return [...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},Qn=class{constructor(){chunkPQC2BFS2_cjs.d(this,"store",new Map);}add(e,t){if(!e.canReaddir())return;let i=this.store.get(e);i?i.find(s=>s.globString()===t.globString())||i.push(t):this.store.set(e,[t]);}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return [...this.store.keys()].filter(e=>e.canReaddir())}},Gs=class sh{constructor(t,i){chunkPQC2BFS2_cjs.d(this,"hasWalkedCache");chunkPQC2BFS2_cjs.d(this,"matches",new Xn);chunkPQC2BFS2_cjs.d(this,"subwalks",new Qn);chunkPQC2BFS2_cjs.d(this,"patterns");chunkPQC2BFS2_cjs.d(this,"follow");chunkPQC2BFS2_cjs.d(this,"dot");chunkPQC2BFS2_cjs.d(this,"opts");this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=i?i.copy():new Kn;}processPatterns(t,i){this.patterns=i;let s=i.map(h=>[t,h]);for(let[h,n]of s){this.hasWalkedCache.storeWalked(h,n);let o=n.root(),a=n.isAbsolute()&&this.opts.absolute!==false;if(o){h=h.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let f=n.rest();if(f)n=f;else {this.matches.add(h,true,false);continue}}if(h.isENOENT())continue;let l,u,d=false;for(;typeof(l=n.pattern())=="string"&&(u=n.rest());)h=h.resolve(l),n=u,d=true;if(l=n.pattern(),u=n.rest(),d){if(this.hasWalkedCache.hasWalked(h,n))continue;this.hasWalkedCache.storeWalked(h,n);}if(typeof l=="string"){let f=l===".."||l===""||l===".";this.matches.add(h.resolve(l),a,f);continue}else if(l===ht){(!h.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(h,n);let f=u?.pattern(),w=u?.rest();if(!u||(f===""||f===".")&&!w)this.matches.add(h,a,f===""||f===".");else if(f===".."){let S=h.parent||h;w?this.hasWalkedCache.hasWalked(S,w)||this.subwalks.add(S,w):this.matches.add(S,a,true);}}else l instanceof RegExp&&this.subwalks.add(h,n);}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new sh(this.opts,this.hasWalkedCache)}filterEntries(t,i){let s=this.subwalks.get(t),h=this.child();for(let n of i)for(let o of s){let a=o.isAbsolute(),l=o.pattern(),u=o.rest();l===ht?h.testGlobstar(n,o,u,a):l instanceof RegExp?h.testRegExp(n,l,u,a):h.testString(n,l,u,a);}return h}testGlobstar(t,i,s,h){if((this.dot||!t.name.startsWith("."))&&(i.hasMore()||this.matches.add(t,h,false),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,i):t.isSymbolicLink()&&(s&&i.checkFollowGlobstar()?this.subwalks.add(t,s):i.markFollowGlobstar()&&this.subwalks.add(t,i)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(t,n,s.rest(),h);else if(n===".."){let o=t.parent||t;this.subwalks.add(o,s);}else n instanceof RegExp&&this.testRegExp(t,n,s.rest(),h);}}testRegExp(t,i,s,h){i.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,h,false));}testString(t,i,s,h){t.isNamed(i)&&(s?this.subwalks.add(t,s):this.matches.add(t,h,false));}},to=(e,t)=>typeof e=="string"?new Us([e],t):Array.isArray(e)?new Us(e,t):e,Ne,qt,Se,bt,ce,ms,mr,rh=(mr=class{constructor(e,t,i){chunkPQC2BFS2_cjs.f(this,bt);chunkPQC2BFS2_cjs.d(this,"path");chunkPQC2BFS2_cjs.d(this,"patterns");chunkPQC2BFS2_cjs.d(this,"opts");chunkPQC2BFS2_cjs.d(this,"seen",new Set);chunkPQC2BFS2_cjs.d(this,"paused",false);chunkPQC2BFS2_cjs.d(this,"aborted",false);chunkPQC2BFS2_cjs.f(this,Ne,[]);chunkPQC2BFS2_cjs.f(this,qt);chunkPQC2BFS2_cjs.f(this,Se);chunkPQC2BFS2_cjs.d(this,"signal");chunkPQC2BFS2_cjs.d(this,"maxDepth");chunkPQC2BFS2_cjs.d(this,"includeChildMatches");if(this.patterns=e,this.path=t,this.opts=i,chunkPQC2BFS2_cjs.g(this,Se,!i.posix&&i.platform==="win32"?"\\":"/"),this.includeChildMatches=i.includeChildMatches!==false,(i.ignore||!this.includeChildMatches)&&(chunkPQC2BFS2_cjs.g(this,qt,to(i.ignore??[],i)),!this.includeChildMatches&&typeof chunkPQC2BFS2_cjs.e(this,qt).add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{chunkPQC2BFS2_cjs.e(this,Ne).length=0;}));}pause(){this.paused=true;}resume(){if(this.signal?.aborted)return;this.paused=false;let e;for(;!this.paused&&(e=chunkPQC2BFS2_cjs.e(this,Ne).shift());)e();}onResume(e){this.signal?.aborted||(this.paused?chunkPQC2BFS2_cjs.e(this,Ne).push(e):e());}async matchCheck(e,t){if(t&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||await e.realpath(),!i)return;e=i;}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let h=await s.realpath();h&&(h.isUnknown()||this.opts.stat)&&await h.lstat();}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!chunkPQC2BFS2_cjs.h(this,bt,ce).call(this,e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=e.realpathCached()||e.realpathSync(),!i)return;e=i;}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let h=s.realpathSync();h&&(h?.isUnknown()||this.opts.stat)&&h.lstatSync();}return this.matchCheckTest(s,t)}matchFinish(e,t){if(chunkPQC2BFS2_cjs.h(this,bt,ce).call(this,e))return;if(!this.includeChildMatches&&chunkPQC2BFS2_cjs.e(this,qt)?.add){let h=`${e.relativePosix()}/**`;chunkPQC2BFS2_cjs.e(this,qt).add(h);}let i=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let s=this.opts.mark&&e.isDirectory()?chunkPQC2BFS2_cjs.e(this,Se):"";if(this.opts.withFileTypes)this.matchEmit(e);else if(i){let h=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(h+s);}else {let h=this.opts.posix?e.relativePosix():e.relative(),n=this.opts.dotRelative&&!h.startsWith(".."+chunkPQC2BFS2_cjs.e(this,Se))?"."+chunkPQC2BFS2_cjs.e(this,Se):"";this.matchEmit(h?n+h+s:"."+s);}}async match(e,t,i){let s=await this.matchCheck(e,i);s&&this.matchFinish(s,t);}matchSync(e,t,i){let s=this.matchCheckSync(e,i);s&&this.matchFinish(s,t);}walkCB(e,t,i){this.signal?.aborted&&i(),this.walkCB2(e,t,new Gs(this.opts),i);}walkCB2(e,t,i,s){if(chunkPQC2BFS2_cjs.h(this,bt,ms).call(this,e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(e,t,i,s));return}i.processPatterns(e,t);let h=1,n=()=>{--h===0&&s();};for(let[o,a,l]of i.matches.entries())chunkPQC2BFS2_cjs.h(this,bt,ce).call(this,o)||(h++,this.match(o,a,l).then(()=>n()));for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;h++;let a=o.readdirCached();o.calledReaddir()?this.walkCB3(o,a,i,n):o.readdirCB((l,u)=>this.walkCB3(o,u,i,n),true);}n();}walkCB3(e,t,i,s){i=i.filterEntries(e,t);let h=1,n=()=>{--h===0&&s();};for(let[o,a,l]of i.matches.entries())chunkPQC2BFS2_cjs.h(this,bt,ce).call(this,o)||(h++,this.match(o,a,l).then(()=>n()));for(let[o,a]of i.subwalks.entries())h++,this.walkCB2(o,a,i.child(),n);n();}walkCBSync(e,t,i){this.signal?.aborted&&i(),this.walkCB2Sync(e,t,new Gs(this.opts),i);}walkCB2Sync(e,t,i,s){if(chunkPQC2BFS2_cjs.h(this,bt,ms).call(this,e))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,i,s));return}i.processPatterns(e,t);let h=1,n=()=>{--h===0&&s();};for(let[o,a,l]of i.matches.entries())chunkPQC2BFS2_cjs.h(this,bt,ce).call(this,o)||this.matchSync(o,a,l);for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;h++;let a=o.readdirSync();this.walkCB3Sync(o,a,i,n);}n();}walkCB3Sync(e,t,i,s){i=i.filterEntries(e,t);let h=1,n=()=>{--h===0&&s();};for(let[o,a,l]of i.matches.entries())chunkPQC2BFS2_cjs.h(this,bt,ce).call(this,o)||this.matchSync(o,a,l);for(let[o,a]of i.subwalks.entries())h++,this.walkCB2Sync(o,a,i.child(),n);n();}},Ne=new WeakMap,qt=new WeakMap,Se=new WeakMap,bt=new WeakSet,ce=function(e){return this.seen.has(e)||!!chunkPQC2BFS2_cjs.e(this,qt)?.ignored?.(e)},ms=function(e){return !!chunkPQC2BFS2_cjs.e(this,qt)?.childrenIgnored?.(e)},mr),Is=class extends rh{constructor(t,i,s){super(t,i,s);chunkPQC2BFS2_cjs.d(this,"matches",new Set);}matchEmit(t){this.matches.add(t);}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,i)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?i(this.signal.reason):t(this.matches);});}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Hs=class extends rh{constructor(t,i,s){super(t,i,s);chunkPQC2BFS2_cjs.d(this,"results");this.results=new Ui({signal:this.signal,objectMode:true}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume());}matchEmit(t){this.results.write(t),this.results.flowing||this.pause();}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end());}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}},eo=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ee=class{constructor(e,t){chunkPQC2BFS2_cjs.d(this,"absolute");chunkPQC2BFS2_cjs.d(this,"cwd");chunkPQC2BFS2_cjs.d(this,"root");chunkPQC2BFS2_cjs.d(this,"dot");chunkPQC2BFS2_cjs.d(this,"dotRelative");chunkPQC2BFS2_cjs.d(this,"follow");chunkPQC2BFS2_cjs.d(this,"ignore");chunkPQC2BFS2_cjs.d(this,"magicalBraces");chunkPQC2BFS2_cjs.d(this,"mark");chunkPQC2BFS2_cjs.d(this,"matchBase");chunkPQC2BFS2_cjs.d(this,"maxDepth");chunkPQC2BFS2_cjs.d(this,"nobrace");chunkPQC2BFS2_cjs.d(this,"nocase");chunkPQC2BFS2_cjs.d(this,"nodir");chunkPQC2BFS2_cjs.d(this,"noext");chunkPQC2BFS2_cjs.d(this,"noglobstar");chunkPQC2BFS2_cjs.d(this,"pattern");chunkPQC2BFS2_cjs.d(this,"platform");chunkPQC2BFS2_cjs.d(this,"realpath");chunkPQC2BFS2_cjs.d(this,"scurry");chunkPQC2BFS2_cjs.d(this,"stat");chunkPQC2BFS2_cjs.d(this,"signal");chunkPQC2BFS2_cjs.d(this,"windowsPathsNoEscape");chunkPQC2BFS2_cjs.d(this,"withFileTypes");chunkPQC2BFS2_cjs.d(this,"includeChildMatches");chunkPQC2BFS2_cjs.d(this,"opts");chunkPQC2BFS2_cjs.d(this,"patterns");if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=url.fileURLToPath(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==false,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===false,this.windowsPathsNoEscape&&(e=e.map(a=>a.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(a=>a.includes("/")?a:`./**/${a}`);}if(this.pattern=e,this.platform=t.platform||eo,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else {let a=t.platform==="win32"?Ss:t.platform==="darwin"?th:t.platform?vs:qn;this.scurry=new a(this.cwd,{nocase:t.nocase,fs:t.fs});}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",s={braceExpandMax:1e4,...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},h=this.pattern.map(a=>new oe(a,s)),[n,o]=h.reduce((a,l)=>(a[0].push(...l.set),a[1].push(...l.globParts),a),[[],[]]);this.patterns=n.map((a,l)=>{let u=o[l];if(!u)throw new Error("invalid pattern object");return new eh(a,u,0,this.platform)});}async walk(){return [...await new Is(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return [...new Is(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Hs(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Hs(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}},io=(e,t={})=>{Array.isArray(e)||(e=[e]);for(let i of e)if(new oe(i,t).hasMagic())return true;return false};function Hi(e,t={}){return new Ee(e,t).streamSync()}function hh(e,t={}){return new Ee(e,t).stream()}function nh(e,t={}){return new Ee(e,t).walkSync()}async function qs(e,t={}){return new Ee(e,t).walk()}function qi(e,t={}){return new Ee(e,t).iterateSync()}function oh(e,t={}){return new Ee(e,t).iterate()}var so=Hi,ro=Object.assign(hh,{sync:Hi}),ho=qi,no=Object.assign(oh,{sync:qi}),oo=Object.assign(nh,{stream:Hi,iterate:qi}),Gi=Object.assign(qs,{glob:qs,globSync:nh,sync:oo,globStream:hh,stream:ro,globStreamSync:Hi,streamSync:so,globIterate:oh,iterate:no,globIterateSync:qi,iterateSync:ho,Glob:Ee,hasMagic:io,escape:Cr,unescape:Re});Gi.glob=Gi;exports.c=void 0;(T=>{T.Level=lo__default.default.enum(["DEBUG","INFO","WARN","ERROR"]).meta({ref:"LogLevel",description:"Log level"});let t={DEBUG:0,INFO:1,WARN:2,ERROR:3},i="INFO";function s(k){return t[k]>=t[i]}function h(){return i}T.getLevel=h;let n=new Map;T.Default=F({service:"default"});let a="";function l(){return a}T.file=l;let u,d,f=false,w=()=>{},S=false;async function E(k){if(f)return;if(k.print){f=true;return}k.level&&(i=k.level);let M=k.logDir||Es__default.default.join(process.env.EASBOT_LOG_PATH??process.cwd(),"logs");k.logFile?a=Es__default.default.join(M,k.logFile??"utils.log"):a=Es__default.default.join(M,"utils.log");try{await xs__default.default.mkdir(M,{recursive:!0}),u=await xs__default.default.open(a,"a"),d=Rn.createWriteStream("",{fd:u.fd,autoClose:!1}),w=j=>{if(!(S||!d||d.destroyed))try{if(!d.writable)return;d.write(j,N=>{N&&!S&&(S=!0,setTimeout(()=>{S=!1;},1e3));});}catch(N){S||(S=!0,process.stderr.write(`[LOG ERROR] Write failed: ${N}
4
+ `),setTimeout(()=>{S=!1;},1e3));}},f=!0;}catch(j){process.stderr.write(`[LOG ERROR] Failed to init log file: ${j}
5
+ `),w=N=>{try{process.stderr.write(N);}catch{}},f=true;}}T.init=E;async function b(){f&&(d&&!d.destroyed&&(await new Promise((k,M)=>{d.end(j=>{j?M(j):k();});}).catch(k=>{process.stderr.write(`[LOG ERROR] Failed to close log stream: ${k}
6
+ `);}),d=void 0),u&&(await u.close().catch(k=>{process.stderr.write(`[LOG ERROR] Failed to close log file: ${k}
7
+ `);}),u=void 0),w=k=>{try{process.stderr.write(k);}catch{}},f=false);}T.close=b;function v(k,M=0){let j=k.message;return k.cause instanceof Error&&M<10?j+" Caused by: "+v(k.cause,M+1):j}let C=Date.now();function F(k){k=k||{};let M=k.service;if(M&&typeof M=="string"){let P=n.get(M);if(P)return P}function j(P,H){let Zi=Object.entries({...k,...H}).filter(([ks,Zt])=>Zt!=null).map(([ks,Zt])=>{let Ji=`${ks}=`;return Zt instanceof Error?Ji+v(Zt):typeof Zt=="object"?Ji+JSON.stringify(Zt):Ji+Zt}).join(" "),St=new Date,lh=St.getTime()-C;return C=St.getTime(),[St.getFullYear()+"-"+String(St.getMonth()+1).padStart(2,"0")+"-"+String(St.getDate()).padStart(2,"0")+"T"+String(St.getHours()).padStart(2,"0")+":"+String(St.getMinutes()).padStart(2,"0")+":"+String(St.getSeconds()).padStart(2,"0"),"+"+lh+"ms",Zi,P].filter(Boolean).join(" ")+`
8
+ `}let N={debug(P,H){s("DEBUG")&&w("DEBUG "+j(P,H));},info(P,H){s("INFO")&&w("INFO "+j(P,H));},error(P,H){s("ERROR")&&w("ERROR "+j(P,H));},warn(P,H){s("WARN")&&w("WARN "+j(P,H));},tag(P,H){return k&&(k[P]=H),N},clone(){return T.create({...k})},time(P,H){let Zi=Date.now();N.info(P,{status:"started",...H});function St(){N.info(P,{status:"completed",duration:Date.now()-Zi,...H});}return {stop:St,[Symbol.dispose](){St();}}}};return M&&typeof M=="string"&&n.set(M,N),N}T.create=F;})(exports.c||(exports.c={}));exports.a=nh;exports.b=Gi;
@@ -0,0 +1 @@
1
+ 'use strict';var u=Object.create;var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var d=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var p=e=>{throw TypeError(e)};var s=(e,t,r)=>t in e?o(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r;var g=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var U=(e,t)=>()=>(e&&(t=e(e=0)),t);var h=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var l=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of i(t))!f.call(e,c)&&c!==r&&o(e,c,{get:()=>t[c],enumerable:!(n=a(t,c))||n.enumerable});return e};var w=(e,t,r)=>(r=e!=null?u(d(e)):{},l(t||!e||!e.__esModule?o(r,"default",{value:e,enumerable:true}):r,e));var C=(e,t,r)=>s(e,typeof t!="symbol"?t+"":t,r),m=(e,t,r)=>t.has(e)||p("Cannot "+r);var R=(e,t,r)=>(m(e,t,"read from private field"),r?r.call(e):t.get(e)),L=(e,t,r)=>t.has(e)?p("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),S=(e,t,r,n)=>(m(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),M=(e,t,r)=>(m(e,t,"access private method"),r);var _=(e,t,r,n)=>({set _(c){S(e,t,c,r);},get _(){return R(e,t,n)}});var I=U(()=>{});exports.a=g;exports.b=h;exports.c=w;exports.d=C;exports.e=R;exports.f=L;exports.g=S;exports.h=M;exports.i=_;exports.j=I;
@@ -0,0 +1 @@
1
+ export{c as Log}from'./chunk-JRBFY3PQ.mjs';import'./chunk-3QJJWPMF.mjs';
@@ -0,0 +1 @@
1
+ 'use strict';var chunkPQ3EETPA_cjs=require('./chunk-PQ3EETPA.cjs');require('./chunk-PQC2BFS2.cjs');Object.defineProperty(exports,"Log",{enumerable:true,get:function(){return chunkPQ3EETPA_cjs.c}});
@@ -0,0 +1,66 @@
1
+ import {b,l,a,k,j}from'./chunk-3QJJWPMF.mjs';var hr=b((mr,yt)=>{l();var Je=Object.defineProperty,kt=Object.getOwnPropertyDescriptor,$t=Object.getOwnPropertyNames,St=Object.prototype.hasOwnProperty,Et=(e,t)=>{for(var r in t)Je(e,r,{get:t[r],enumerable:true});},At=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $t(t))!St.call(e,o)&&o!==r&&Je(e,o,{get:()=>t[o],enumerable:!(n=kt(t,o))||n.enumerable});return e},Pt=e=>At(Je({},"__esModule",{value:true}),e),Pe={};Et(Pe,{analyzeMetafile:()=>ir,analyzeMetafileSync:()=>sr,build:()=>er,buildSync:()=>lr,context:()=>tr,default:()=>dr,formatMessages:()=>nr,formatMessagesSync:()=>or,initialize:()=>cr,stop:()=>ur,transform:()=>rr,transformSync:()=>ar,version:()=>Zt});yt.exports=Pt(Pe);function He(e){let t=n=>{if(n===null)r.write8(0);else if(typeof n=="boolean")r.write8(1),r.write8(+n);else if(typeof n=="number")r.write8(2),r.write32(n|0);else if(typeof n=="string")r.write8(3),r.write(ie(n));else if(n instanceof Uint8Array)r.write8(4),r.write(n);else if(n instanceof Array){r.write8(5),r.write32(n.length);for(let o of n)t(o);}else {let o=Object.keys(n);r.write8(6),r.write32(o.length);for(let s of o)r.write(ie(s)),t(n[s]);}},r=new it;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),We(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function Ot(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return !!r.read8();case 2:return r.read32();case 3:return we(r.read());case 4:return r.read();case 5:{let a=r.read32(),d=[];for(let i=0;i<a;i++)d.push(t());return d}case 6:{let a=r.read32(),d={};for(let i=0;i<a;i++)d[we(r.read())]=t();return d}default:throw new Error("Invalid packet")}},r=new it(e),n=r.read32(),o=(n&1)===0;n>>>=1;let s=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return {id:n,isRequest:o,value:s}}var it=class{constructor(e=new Uint8Array(1024)){this.buf=e,this.len=0,this.ptr=0;}_write(e){if(this.len+e>this.buf.length){let t=new Uint8Array((this.len+e)*2);t.set(this.buf),this.buf=t;}return this.len+=e,this.len-e}write8(e){let t=this._write(1);this.buf[t]=e;}write32(e){let t=this._write(4);We(this.buf,e,t);}write(e){let t=this._write(4+e.length);We(this.buf,e.length,t),this.buf.set(e,t+4);}_read(e){if(this.ptr+e>this.buf.length)throw new Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return lt(this.buf,this._read(4))}read(){let e=this.read32(),t=new Uint8Array(e),r=this._read(t.length);return t.set(this.buf.subarray(r,r+e)),t}},ie,we,Ue;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let e=new TextEncoder,t=new TextDecoder;ie=r=>e.encode(r),we=r=>t.decode(r),Ue='new TextEncoder().encode("")';}else if(typeof Buffer<"u")ie=e=>Buffer.from(e),we=e=>{let{buffer:t,byteOffset:r,byteLength:n}=e;return Buffer.from(t,r,n).toString()},Ue='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(ie("")instanceof Uint8Array))throw new Error(`Invariant violation: "${Ue} instanceof Uint8Array" is incorrectly false
2
+
3
+ This indicates that your JavaScript environment is broken. You cannot use
4
+ esbuild in this environment because esbuild relies on this invariant. This
5
+ is not a problem with esbuild. You need to fix your environment instead.
6
+ `);function lt(e,t){return (e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0}function We(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24;}var ue=String.fromCharCode;function re(e,t,r){let n=e[t],o=1,s=0;for(let a=0;a<t;a++)e[a]===10?(o++,s=0):s++;throw new SyntaxError(r||(t===e.length?"Unexpected end of input while parsing JSON":n>=32&&n<=126?`Unexpected character ${ue(n)} in JSON at position ${t} (line ${o}, column ${s})`:`Unexpected byte 0x${n.toString(16)} in JSON at position ${t} (line ${o}, column ${s})`))}function jt(e){if(!(e instanceof Uint8Array))throw new Error("JSON input must be a Uint8Array");let t=[],r=[],n=[],o=e.length,s=null,a=0,d,i=0;for(;i<o;){let c=e[i++];if(c<=32)continue;let u;switch(a===2&&s===null&&c!==34&&c!==125&&re(e,--i),c){case 116:{(e[i++]!==114||e[i++]!==117||e[i++]!==101)&&re(e,--i),u=true;break}case 102:{(e[i++]!==97||e[i++]!==108||e[i++]!==115||e[i++]!==101)&&re(e,--i),u=false;break}case 110:{(e[i++]!==117||e[i++]!==108||e[i++]!==108)&&re(e,--i),u=null;break}case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:{let y=i;for(u=ue(c),c=e[i];;){switch(c){case 43:case 45:case 46:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 101:case 69:{u+=ue(c),c=e[++i];continue}}break}u=+u,isNaN(u)&&re(e,--y,"Invalid number");break}case 34:{for(u="";i>=o&&re(e,o),c=e[i++],c!==34;)if(c===92)switch(e[i++]){case 34:u+='"';break;case 47:u+="/";break;case 92:u+="\\";break;case 98:u+="\b";break;case 102:u+="\f";break;case 110:u+=`
7
+ `;break;case 114:u+="\r";break;case 116:u+=" ";break;case 117:{let y=0;for(let N=0;N<4;N++)c=e[i++],y<<=4,c>=48&&c<=57?y|=c-48:c>=97&&c<=102?y|=c+-87:c>=65&&c<=70?y|=c+-55:re(e,--i);u+=ue(y);break}default:re(e,--i);break}else if(c<=127)u+=ue(c);else if((c&224)===192)u+=ue((c&31)<<6|e[i++]&63);else if((c&240)===224)u+=ue((c&15)<<12|(e[i++]&63)<<6|e[i++]&63);else if((c&248)==240){let y=(c&7)<<18|(e[i++]&63)<<12|(e[i++]&63)<<6|e[i++]&63;y>65535&&(y-=65536,u+=ue(y>>10&1023|55296),y=56320|y&1023),u+=ue(y);}u[0];break}case 91:{u=[],t.push(s),r.push(d),n.push(a),s=null,d=u,a=1;continue}case 123:{u={},t.push(s),r.push(d),n.push(a),s=null,d=u,a=2;continue}case 93:{a!==1&&re(e,--i),u=d,s=t.pop(),d=r.pop(),a=n.pop();break}case 125:{a!==2&&re(e,--i),u=d,s=t.pop(),d=r.pop(),a=n.pop();break}default:re(e,--i);}for(c=e[i];c<=32;)c=e[++i];switch(a){case 0:{if(i===o)return u;break}case 1:{if(d.push(u),c===44){i++;continue}if(c===93)continue;break}case 2:{if(s===null){if(s=u,c===58){i++;continue}}else {if(d[s]=u,s=null,c===44){i++;continue}if(c===125)continue}break}}break}re(e,i);}var V=JSON.stringify,Ke="warning",Qe="silent";function xe(e,t){let r=[];for(let n of e){if(G(n,t),n.indexOf(",")>=0)throw new Error(`Invalid ${t}: ${n}`);r.push(n);}return r.join(",")}var De=()=>null,U=e=>typeof e=="boolean"?null:"a boolean",b=e=>typeof e=="string"?null:"a string",Le=e=>e instanceof RegExp?null:"a RegExp object",me=e=>typeof e=="number"&&e===(e|0)?null:"an integer",Ct=e=>typeof e=="number"&&e===(e|0)&&e>=0&&e<=65535?null:"a valid port number",at=e=>typeof e=="function"?null:"a function",ce=e=>Array.isArray(e)?null:"an array",X=e=>Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"an array of strings",Z=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",Mt=e=>typeof e=="object"&&e!==null?null:"an array or an object",Dt=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Ge=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",ot=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",Lt=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",st=e=>typeof e=="string"||Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"a string or an array of strings",ut=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",Tt=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function l$1(e,t,r,n){let o=e[r];if(t[r+""]=true,o===void 0)return;let s=n(o);if(s!==null)throw new Error(`${V(r)} must be ${s}`);return o}function J(e,t,r){for(let n in e)if(!(n in t))throw new Error(`Invalid option ${r}: ${V(n)}`)}function Ft(e){let t=Object.create(null),r=l$1(e,t,"wasmURL",Tt),n=l$1(e,t,"wasmModule",Dt),o=l$1(e,t,"worker",U);return J(e,t,"in initialize() call"),{wasmURL:r,wasmModule:n,worker:o}}function ct(e){let t;if(e!==void 0){t=Object.create(null);for(let r in e){let n=e[r];if(typeof n=="string"||n===false)t[r]=n;else throw new Error(`Expected ${V(r)} in mangle cache to map to either a string or false`)}}return t}function _e(e,t,r,n,o){let s=l$1(t,r,"color",U),a=l$1(t,r,"logLevel",b),d=l$1(t,r,"logLimit",me);s!==void 0?e.push(`--color=${s}`):n&&e.push("--color=true"),e.push(`--log-level=${a||o}`),e.push(`--log-limit=${d||0}`);}function G(e,t,r){if(typeof e!="string")throw new Error(`Expected value for ${t}${r!==void 0?" "+V(r):""} to be a string, got ${typeof e} instead`);return e}function ft(e,t,r){let n=l$1(t,r,"legalComments",b),o=l$1(t,r,"sourceRoot",b),s=l$1(t,r,"sourcesContent",U),a=l$1(t,r,"target",st),d=l$1(t,r,"format",b),i=l$1(t,r,"globalName",b),c=l$1(t,r,"mangleProps",Le),u=l$1(t,r,"reserveProps",Le),y=l$1(t,r,"mangleQuoted",U),N=l$1(t,r,"minify",U),B=l$1(t,r,"minifySyntax",U),_=l$1(t,r,"minifyWhitespace",U),I=l$1(t,r,"minifyIdentifiers",U),L=l$1(t,r,"lineLimit",me),W=l$1(t,r,"drop",X),z=l$1(t,r,"dropLabels",X),k=l$1(t,r,"charset",b),w=l$1(t,r,"treeShaking",U),p=l$1(t,r,"ignoreAnnotations",U),f=l$1(t,r,"jsx",b),$=l$1(t,r,"jsxFactory",b),E=l$1(t,r,"jsxFragment",b),C=l$1(t,r,"jsxImportSource",b),A=l$1(t,r,"jsxDev",U),h=l$1(t,r,"jsxSideEffects",U),m=l$1(t,r,"define",Z),x=l$1(t,r,"logOverride",Z),O=l$1(t,r,"supported",Z),M=l$1(t,r,"pure",X),P=l$1(t,r,"keepNames",U),S=l$1(t,r,"platform",b),j=l$1(t,r,"tsconfigRaw",Lt),R=l$1(t,r,"absPaths",X);if(n&&e.push(`--legal-comments=${n}`),o!==void 0&&e.push(`--source-root=${o}`),s!==void 0&&e.push(`--sources-content=${s}`),a&&e.push(`--target=${xe(Array.isArray(a)?a:[a],"target")}`),d&&e.push(`--format=${d}`),i&&e.push(`--global-name=${i}`),S&&e.push(`--platform=${S}`),j&&e.push(`--tsconfig-raw=${typeof j=="string"?j:JSON.stringify(j)}`),N&&e.push("--minify"),B&&e.push("--minify-syntax"),_&&e.push("--minify-whitespace"),I&&e.push("--minify-identifiers"),L&&e.push(`--line-limit=${L}`),k&&e.push(`--charset=${k}`),w!==void 0&&e.push(`--tree-shaking=${w}`),p&&e.push("--ignore-annotations"),W)for(let g of W)e.push(`--drop:${G(g,"drop")}`);if(z&&e.push(`--drop-labels=${xe(z,"drop label")}`),R&&e.push(`--abs-paths=${xe(R,"abs paths")}`),c&&e.push(`--mangle-props=${Te(c)}`),u&&e.push(`--reserve-props=${Te(u)}`),y!==void 0&&e.push(`--mangle-quoted=${y}`),f&&e.push(`--jsx=${f}`),$&&e.push(`--jsx-factory=${$}`),E&&e.push(`--jsx-fragment=${E}`),C&&e.push(`--jsx-import-source=${C}`),A&&e.push("--jsx-dev"),h&&e.push("--jsx-side-effects"),m)for(let g in m){if(g.indexOf("=")>=0)throw new Error(`Invalid define: ${g}`);e.push(`--define:${g}=${G(m[g],"define",g)}`);}if(x)for(let g in x){if(g.indexOf("=")>=0)throw new Error(`Invalid log override: ${g}`);e.push(`--log-override:${g}=${G(x[g],"log override",g)}`);}if(O)for(let g in O){if(g.indexOf("=")>=0)throw new Error(`Invalid supported: ${g}`);let F=O[g];if(typeof F!="boolean")throw new Error(`Expected value for supported ${V(g)} to be a boolean, got ${typeof F} instead`);e.push(`--supported:${g}=${F}`);}if(M)for(let g of M)e.push(`--pure:${G(g,"pure")}`);P&&e.push("--keep-names");}function Bt(e,t,r,n,o){var s;let a=[],d=[],i=Object.create(null),c=null,u=null;_e(a,t,i,r,n),ft(a,t,i);let y=l$1(t,i,"sourcemap",ot),N=l$1(t,i,"bundle",U),B=l$1(t,i,"splitting",U),_=l$1(t,i,"preserveSymlinks",U),I=l$1(t,i,"metafile",U),L=l$1(t,i,"outfile",b),W=l$1(t,i,"outdir",b),z=l$1(t,i,"outbase",b),k=l$1(t,i,"tsconfig",b),w=l$1(t,i,"resolveExtensions",X),p=l$1(t,i,"nodePaths",X),f=l$1(t,i,"mainFields",X),$=l$1(t,i,"conditions",X),E=l$1(t,i,"external",X),C=l$1(t,i,"packages",b),A=l$1(t,i,"alias",Z),h=l$1(t,i,"loader",Z),m=l$1(t,i,"outExtension",Z),x=l$1(t,i,"publicPath",b),O=l$1(t,i,"entryNames",b),M=l$1(t,i,"chunkNames",b),P=l$1(t,i,"assetNames",b),S=l$1(t,i,"inject",X),j=l$1(t,i,"banner",Z),R=l$1(t,i,"footer",Z),g=l$1(t,i,"entryPoints",Mt),F=l$1(t,i,"absWorkingDir",b),T=l$1(t,i,"stdin",Z),D=(s=l$1(t,i,"write",U))!=null?s:o,Q=l$1(t,i,"allowOverwrite",U),q=l$1(t,i,"mangleCache",Z);if(i.plugins=true,J(t,i,`in ${e}() call`),y&&a.push(`--sourcemap${y===true?"":`=${y}`}`),N&&a.push("--bundle"),Q&&a.push("--allow-overwrite"),B&&a.push("--splitting"),_&&a.push("--preserve-symlinks"),I&&a.push("--metafile"),L&&a.push(`--outfile=${L}`),W&&a.push(`--outdir=${W}`),z&&a.push(`--outbase=${z}`),k&&a.push(`--tsconfig=${k}`),C&&a.push(`--packages=${C}`),w&&a.push(`--resolve-extensions=${xe(w,"resolve extension")}`),x&&a.push(`--public-path=${x}`),O&&a.push(`--entry-names=${O}`),M&&a.push(`--chunk-names=${M}`),P&&a.push(`--asset-names=${P}`),f&&a.push(`--main-fields=${xe(f,"main field")}`),$&&a.push(`--conditions=${xe($,"condition")}`),E)for(let v of E)a.push(`--external:${G(v,"external")}`);if(A)for(let v in A){if(v.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${v}`);a.push(`--alias:${v}=${G(A[v],"alias",v)}`);}if(j)for(let v in j){if(v.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${v}`);a.push(`--banner:${v}=${G(j[v],"banner",v)}`);}if(R)for(let v in R){if(v.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${v}`);a.push(`--footer:${v}=${G(R[v],"footer",v)}`);}if(S)for(let v of S)a.push(`--inject:${G(v,"inject")}`);if(h)for(let v in h){if(v.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${v}`);a.push(`--loader:${v}=${G(h[v],"loader",v)}`);}if(m)for(let v in m){if(v.indexOf("=")>=0)throw new Error(`Invalid out extension: ${v}`);a.push(`--out-extension:${v}=${G(m[v],"out extension",v)}`);}if(g)if(Array.isArray(g))for(let v=0,oe=g.length;v<oe;v++){let ee=g[v];if(typeof ee=="object"&&ee!==null){let le=Object.create(null),se=l$1(ee,le,"in",b),te=l$1(ee,le,"out",b);if(J(ee,le,"in entry point at index "+v),se===void 0)throw new Error('Missing property "in" for entry point at index '+v);if(te===void 0)throw new Error('Missing property "out" for entry point at index '+v);d.push([te,se]);}else d.push(["",G(ee,"entry point at index "+v)]);}else for(let v in g)d.push([v,G(g[v],"entry point",v)]);if(T){let v=Object.create(null),oe=l$1(T,v,"contents",ut),ee=l$1(T,v,"resolveDir",b),le=l$1(T,v,"sourcefile",b),se=l$1(T,v,"loader",b);J(T,v,'in "stdin" object'),le&&a.push(`--sourcefile=${le}`),se&&a.push(`--loader=${se}`),ee&&(u=ee),typeof oe=="string"?c=ie(oe):oe instanceof Uint8Array&&(c=oe);}let ae=[];if(p)for(let v of p)v+="",ae.push(v);return {entries:d,flags:a,write:D,stdinContents:c,stdinResolveDir:u,absWorkingDir:F,nodePaths:ae,mangleCache:ct(q)}}function Nt(e,t,r,n){let o=[],s=Object.create(null);_e(o,t,s,r,n),ft(o,t,s);let a=l$1(t,s,"sourcemap",ot),d=l$1(t,s,"sourcefile",b),i=l$1(t,s,"loader",b),c=l$1(t,s,"banner",b),u=l$1(t,s,"footer",b),y=l$1(t,s,"mangleCache",Z);return J(t,s,`in ${e}() call`),a&&o.push(`--sourcemap=${a===true?"external":a}`),d&&o.push(`--sourcefile=${d}`),i&&o.push(`--loader=${i}`),c&&o.push(`--banner=${c}`),u&&o.push(`--footer=${u}`),{flags:o,mangleCache:ct(y)}}function dt(e){let t={},r={didClose:false,reason:""},n={},o=0,s=0,a=new Uint8Array(16*1024),d=0,i=k=>{let w=d+k.length;if(w>a.length){let f=new Uint8Array(w*2);f.set(a),a=f;}a.set(k,d),d+=k.length;let p=0;for(;p+4<=d;){let f=lt(a,p);if(p+4+f>d)break;p+=4,_(a.subarray(p,p+f)),p+=f;}p>0&&(a.copyWithin(0,p,d),d-=p);},c=k=>{r.didClose=true,k&&(r.reason=": "+(k.message||k));let w="The service was stopped"+r.reason;for(let p in n)n[p](w,null);n={};},u=(k,w,p)=>{if(r.didClose)return p("The service is no longer running"+r.reason,null);let f=o++;n[f]=($,E)=>{try{p($,E);}finally{k&&k.unref();}},k&&k.ref(),e.writeToStdin(He({id:f,isRequest:true,value:w}));},y=(k,w)=>{if(r.didClose)throw new Error("The service is no longer running"+r.reason);e.writeToStdin(He({id:k,isRequest:false,value:w}));},N=async(k,w)=>{try{if(w.command==="ping"){y(k,{});return}if(typeof w.key=="number"){let p=t[w.key];if(!p)return;let f=p[w.command];if(f){await f(k,w);return}}throw new Error("Invalid command: "+w.command)}catch(p){let f=[he(p,e,null,void 0,"")];try{y(k,{errors:f});}catch{}}},B=true,_=k=>{if(B){B=false;let p=String.fromCharCode(...k);if(p!=="0.27.4")throw new Error(`Cannot start service: Host version "0.27.4" does not match binary version ${V(p)}`);return}let w=Ot(k);if(w.isRequest)N(w.id,w.value);else {let p=n[w.id];delete n[w.id],w.value.error?p(w.value.error,{}):p(null,w.value);}};return {readFromStdout:i,afterClose:c,service:{buildOrContext:({callName:k,refs:w,options:p,isTTY:f,defaultWD:$,callback:E})=>{let C=0,A=s++,h={},m={ref(){++C===1&&w&&w.ref();},unref(){--C===0&&(delete t[A],w&&w.unref());}};t[A]=h,m.ref(),_t(k,A,u,y,m,e,h,p,f,$,(x,O)=>{try{E(x,O);}finally{m.unref();}});},transform:({callName:k,refs:w,input:p,options:f,isTTY:$,fs:E,callback:C})=>{let A=ht(),h=m=>{try{if(typeof p!="string"&&!(p instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:x,mangleCache:O}=Nt(k,f,$,Qe),M={command:"transform",flags:x,inputFS:m!==null,input:m!==null?ie(m):typeof p=="string"?ie(p):p};O&&(M.mangleCache=O),u(w,M,(P,S)=>{if(P)return C(new Error(P),null);let j=ke(S.errors,A),R=ke(S.warnings,A),g=1,F=()=>{if(--g===0){let T={warnings:R,code:S.code,map:S.map,mangleCache:void 0,legalComments:void 0};"legalComments"in S&&(T.legalComments=S?.legalComments),S.mangleCache&&(T.mangleCache=S?.mangleCache),C(null,T);}};if(j.length>0)return C(Ee("Transform failed",j,R),null);S.codeFS&&(g++,E.readFile(S.code,(T,D)=>{T!==null?C(T,null):(S.code=D,F());})),S.mapFS&&(g++,E.readFile(S.map,(T,D)=>{T!==null?C(T,null):(S.map=D,F());})),F();});}catch(x){let O=[];try{_e(O,f,{},$,Qe);}catch{}let M=he(x,e,A,void 0,"");u(w,{command:"error",flags:O,error:M},()=>{M.detail=A.load(M.detail),C(Ee("Transform failed",[M],[]),null);});}};if((typeof p=="string"||p instanceof Uint8Array)&&p.length>1024*1024){let m=h;h=()=>E.writeFile(p,m);}h(null);},formatMessages:({callName:k,refs:w,messages:p,options:f,callback:$})=>{if(!f)throw new Error(`Missing second argument in ${k}() call`);let E={},C=l$1(f,E,"kind",b),A=l$1(f,E,"color",U),h=l$1(f,E,"terminalWidth",me);if(J(f,E,`in ${k}() call`),C===void 0)throw new Error(`Missing "kind" in ${k}() call`);if(C!=="error"&&C!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${k}() call`);let m={command:"format-msgs",messages:fe(p,"messages",null,"",h),isWarning:C==="warning"};A!==void 0&&(m.color=A),h!==void 0&&(m.terminalWidth=h),u(w,m,(x,O)=>{if(x)return $(new Error(x),null);$(null,O.messages);});},analyzeMetafile:({callName:k,refs:w,metafile:p,options:f,callback:$})=>{f===void 0&&(f={});let E={},C=l$1(f,E,"color",U),A=l$1(f,E,"verbose",U);J(f,E,`in ${k}() call`);let h={command:"analyze-metafile",metafile:p};C!==void 0&&(h.color=C),A!==void 0&&(h.verbose=A),u(w,h,(m,x)=>{if(m)return $(new Error(m),null);$(null,x.result);});}}}}function _t(e,t,r,n,o,s,a,d,i,c,u){let y=ht(),N=e==="context",B=(L,W)=>{let z=[];try{_e(z,d,{},i,Ke);}catch{}let k=he(L,s,y,void 0,W);r(o,{command:"error",flags:z,error:k},()=>{k.detail=y.load(k.detail),u(Ee(N?"Context failed":"Build failed",[k],[]),null);});},_;if(typeof d=="object"){let L=d.plugins;if(L!==void 0){if(!Array.isArray(L))return B(new Error('"plugins" must be an array'),"");_=L;}}if(_&&_.length>0){if(s.isSync)return B(new Error("Cannot use plugins in synchronous API calls"),"");It(t,r,n,o,s,a,d,_,y).then(L=>{if(!L.ok)return B(L.error,L.pluginName);try{I(L.requestPlugins,L.runOnEndCallbacks,L.scheduleOnDisposeCallbacks);}catch(W){B(W,"");}},L=>B(L,""));return}try{I(null,(L,W)=>W([],[]),()=>{});}catch(L){B(L,"");}function I(L,W,z){let k=s.hasFS,{entries:w,flags:p,write:f,stdinContents:$,stdinResolveDir:E,absWorkingDir:C,nodePaths:A,mangleCache:h}=Bt(e,d,i,Ke,k);if(f&&!s.hasFS)throw new Error('The "write" option is unavailable in this environment');let m={command:"build",key:t,entries:w,flags:p,write:f,stdinContents:$,stdinResolveDir:E,absWorkingDir:C||c,nodePaths:A,context:N};L&&(m.plugins=L),h&&(m.mangleCache=h);let x=(P,S)=>{let j={errors:ke(P.errors,y),warnings:ke(P.warnings,y),outputFiles:void 0,metafile:void 0,mangleCache:void 0},R=j.errors.slice(),g=j.warnings.slice();P.outputFiles&&(j.outputFiles=P.outputFiles.map(Ut)),P.metafile&&(j.metafile=Wt(P.metafile)),P.mangleCache&&(j.mangleCache=P.mangleCache),P.writeToStdout!==void 0&&console.log(we(P.writeToStdout).replace(/\n$/,"")),W(j,(F,T)=>{if(R.length>0||F.length>0){let D=Ee("Build failed",R.concat(F),g.concat(T));return S(D,null,F,T)}S(null,j,F,T);});},O,M;N&&(a["on-end"]=(P,S)=>new Promise(j=>{x(S,(R,g,F,T)=>{let D={errors:F,warnings:T};M&&M(R,g),O=void 0,M=void 0,n(P,D),j();});})),r(o,m,(P,S)=>{if(P)return u(new Error(P),null);if(!N)return x(S,(g,F)=>(z(),u(g,F)));if(S.errors.length>0)return u(Ee("Context failed",S.errors,S.warnings),null);let j=false,R={rebuild:()=>(O||(O=new Promise((g,F)=>{let T;M=(Q,q)=>{T||(T=()=>Q?F(Q):g(q));};let D=()=>{r(o,{command:"rebuild",key:t},(q,ae)=>{q?F(new Error(q)):T?T():D();});};D();})),O),watch:(g={})=>new Promise((F,T)=>{if(!s.hasFS)throw new Error('Cannot use the "watch" API in this environment');let D={},Q=l$1(g,D,"delay",me);J(g,D,"in watch() call");let q={command:"watch",key:t};Q&&(q.delay=Q),r(o,q,ae=>{ae?T(new Error(ae)):F(void 0);});}),serve:(g={})=>new Promise((F,T)=>{if(!s.hasFS)throw new Error('Cannot use the "serve" API in this environment');let D={},Q=l$1(g,D,"port",Ct),q=l$1(g,D,"host",b),ae=l$1(g,D,"servedir",b),v=l$1(g,D,"keyfile",b),oe=l$1(g,D,"certfile",b),ee=l$1(g,D,"fallback",b),le=l$1(g,D,"cors",Z),se=l$1(g,D,"onRequest",at);J(g,D,"in serve() call");let te={command:"serve",key:t,onRequest:!!se};if(Q!==void 0&&(te.port=Q),q!==void 0&&(te.host=q),ae!==void 0&&(te.servedir=ae),v!==void 0&&(te.keyfile=v),oe!==void 0&&(te.certfile=oe),ee!==void 0&&(te.fallback=ee),le){let $e={},be=l$1(le,$e,"origin",st);J(le,$e,'on "cors" object'),Array.isArray(be)?te.corsOrigin=be:be!==void 0&&(te.corsOrigin=[be]);}r(o,te,($e,be)=>{if($e)return T(new Error($e));se&&(a["serve-request"]=(bt,vt)=>{se(vt.args),n(bt,{});}),F(be);});}),cancel:()=>new Promise(g=>{if(j)return g();r(o,{command:"cancel",key:t},()=>{g();});}),dispose:()=>new Promise(g=>{if(j)return g();j=true,r(o,{command:"dispose",key:t},()=>{g(),z(),o.unref();});})};o.ref(),u(null,R);});}}var It=async(e,t,r,n,o,s,a,d,i)=>{let c=[],u=[],y={},N={},B=[],_=0,I=0,L=[],W=false;d=[...d];for(let w of d){let p={};if(typeof w!="object")throw new Error(`Plugin at index ${I} must be an object`);let f=l$1(w,p,"name",b);if(typeof f!="string"||f==="")throw new Error(`Plugin at index ${I} is missing a name`);try{let $=l$1(w,p,"setup",at);if(typeof $!="function")throw new Error("Plugin is missing a setup function");J(w,p,`on plugin ${V(f)}`);let E={name:f,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};I++;let A=$({initialOptions:a,resolve:(h,m={})=>{if(!W)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof h!="string")throw new Error("The path to resolve must be a string");let x=Object.create(null),O=l$1(m,x,"pluginName",b),M=l$1(m,x,"importer",b),P=l$1(m,x,"namespace",b),S=l$1(m,x,"resolveDir",b),j=l$1(m,x,"kind",b),R=l$1(m,x,"pluginData",De),g=l$1(m,x,"with",Z);return J(m,x,"in resolve() call"),new Promise((F,T)=>{let D={command:"resolve",path:h,key:e,pluginName:f};if(O!=null&&(D.pluginName=O),M!=null&&(D.importer=M),P!=null&&(D.namespace=P),S!=null&&(D.resolveDir=S),j!=null)D.kind=j;else throw new Error('Must specify "kind" when calling "resolve"');R!=null&&(D.pluginData=i.store(R)),g!=null&&(D.with=Rt(g,"with")),t(n,D,(Q,q)=>{Q!==null?T(new Error(Q)):F({errors:ke(q.errors,i),warnings:ke(q.warnings,i),path:q.path,external:q.external,sideEffects:q.sideEffects,namespace:q.namespace,suffix:q.suffix,pluginData:i.load(q.pluginData)});});})},onStart(h){let m='This error came from the "onStart" callback registered here:',x=Ce(new Error(m),o,"onStart");c.push({name:f,callback:h,note:x}),E.onStart=!0;},onEnd(h){let m='This error came from the "onEnd" callback registered here:',x=Ce(new Error(m),o,"onEnd");u.push({name:f,callback:h,note:x}),E.onEnd=!0;},onResolve(h,m){let x='This error came from the "onResolve" callback registered here:',O=Ce(new Error(x),o,"onResolve"),M={},P=l$1(h,M,"filter",Le),S=l$1(h,M,"namespace",b);if(J(h,M,`in onResolve() call for plugin ${V(f)}`),P==null)throw new Error("onResolve() call is missing a filter");let j=_++;y[j]={name:f,callback:m,note:O},E.onResolve.push({id:j,filter:Te(P),namespace:S||""});},onLoad(h,m){let x='This error came from the "onLoad" callback registered here:',O=Ce(new Error(x),o,"onLoad"),M={},P=l$1(h,M,"filter",Le),S=l$1(h,M,"namespace",b);if(J(h,M,`in onLoad() call for plugin ${V(f)}`),P==null)throw new Error("onLoad() call is missing a filter");let j=_++;N[j]={name:f,callback:m,note:O},E.onLoad.push({id:j,filter:Te(P),namespace:S||""});},onDispose(h){B.push(h);},esbuild:o.esbuild});A&&await A,L.push(E);}catch($){return {ok:false,error:$,pluginName:f}}}s["on-start"]=async(w,p)=>{i.clear();let f={errors:[],warnings:[]};await Promise.all(c.map(async({name:$,callback:E,note:C})=>{try{let A=await E();if(A!=null){if(typeof A!="object")throw new Error(`Expected onStart() callback in plugin ${V($)} to return an object`);let h={},m=l$1(A,h,"errors",ce),x=l$1(A,h,"warnings",ce);J(A,h,`from onStart() callback in plugin ${V($)}`),m!=null&&f.errors.push(...fe(m,"errors",i,$,void 0)),x!=null&&f.warnings.push(...fe(x,"warnings",i,$,void 0));}}catch(A){f.errors.push(he(A,o,i,C&&C(),$));}})),r(w,f);},s["on-resolve"]=async(w,p)=>{let f={},$="",E,C;for(let A of p.ids)try{({name:$,callback:E,note:C}=y[A]);let h=await E({path:p.path,importer:p.importer,namespace:p.namespace,resolveDir:p.resolveDir,kind:p.kind,pluginData:i.load(p.pluginData),with:p.with});if(h!=null){if(typeof h!="object")throw new Error(`Expected onResolve() callback in plugin ${V($)} to return an object`);let m={},x=l$1(h,m,"pluginName",b),O=l$1(h,m,"path",b),M=l$1(h,m,"namespace",b),P=l$1(h,m,"suffix",b),S=l$1(h,m,"external",U),j=l$1(h,m,"sideEffects",U),R=l$1(h,m,"pluginData",De),g=l$1(h,m,"errors",ce),F=l$1(h,m,"warnings",ce),T=l$1(h,m,"watchFiles",X),D=l$1(h,m,"watchDirs",X);J(h,m,`from onResolve() callback in plugin ${V($)}`),f.id=A,x!=null&&(f.pluginName=x),O!=null&&(f.path=O),M!=null&&(f.namespace=M),P!=null&&(f.suffix=P),S!=null&&(f.external=S),j!=null&&(f.sideEffects=j),R!=null&&(f.pluginData=i.store(R)),g!=null&&(f.errors=fe(g,"errors",i,$,void 0)),F!=null&&(f.warnings=fe(F,"warnings",i,$,void 0)),T!=null&&(f.watchFiles=Me(T,"watchFiles")),D!=null&&(f.watchDirs=Me(D,"watchDirs"));break}}catch(h){f={id:A,errors:[he(h,o,i,C&&C(),$)]};break}r(w,f);},s["on-load"]=async(w,p)=>{let f={},$="",E,C;for(let A of p.ids)try{({name:$,callback:E,note:C}=N[A]);let h=await E({path:p.path,namespace:p.namespace,suffix:p.suffix,pluginData:i.load(p.pluginData),with:p.with});if(h!=null){if(typeof h!="object")throw new Error(`Expected onLoad() callback in plugin ${V($)} to return an object`);let m={},x=l$1(h,m,"pluginName",b),O=l$1(h,m,"contents",ut),M=l$1(h,m,"resolveDir",b),P=l$1(h,m,"pluginData",De),S=l$1(h,m,"loader",b),j=l$1(h,m,"errors",ce),R=l$1(h,m,"warnings",ce),g=l$1(h,m,"watchFiles",X),F=l$1(h,m,"watchDirs",X);J(h,m,`from onLoad() callback in plugin ${V($)}`),f.id=A,x!=null&&(f.pluginName=x),O instanceof Uint8Array?f.contents=O:O!=null&&(f.contents=ie(O)),M!=null&&(f.resolveDir=M),P!=null&&(f.pluginData=i.store(P)),S!=null&&(f.loader=S),j!=null&&(f.errors=fe(j,"errors",i,$,void 0)),R!=null&&(f.warnings=fe(R,"warnings",i,$,void 0)),g!=null&&(f.watchFiles=Me(g,"watchFiles")),F!=null&&(f.watchDirs=Me(F,"watchDirs"));break}}catch(h){f={id:A,errors:[he(h,o,i,C&&C(),$)]};break}r(w,f);};let z=(w,p)=>p([],[]);u.length>0&&(z=(w,p)=>{(async()=>{let f=[],$=[];for(let{name:E,callback:C,note:A}of u){let h,m;try{let x=await C(w);if(x!=null){if(typeof x!="object")throw new Error(`Expected onEnd() callback in plugin ${V(E)} to return an object`);let O={},M=l$1(x,O,"errors",ce),P=l$1(x,O,"warnings",ce);J(x,O,`from onEnd() callback in plugin ${V(E)}`),M!=null&&(h=fe(M,"errors",i,E,void 0)),P!=null&&(m=fe(P,"warnings",i,E,void 0));}}catch(x){h=[he(x,o,i,A&&A(),E)];}if(h){f.push(...h);try{w.errors.push(...h);}catch{}}if(m){$.push(...m);try{w.warnings.push(...m);}catch{}}}p(f,$);})();});let k=()=>{for(let w of B)setTimeout(()=>w(),0);};return W=true,{ok:true,requestPlugins:L,runOnEndCallbacks:z,scheduleOnDisposeCallbacks:k}};function ht(){let e=new Map,t=0;return {clear(){e.clear();},load(r){return e.get(r)},store(r){if(r===void 0)return -1;let n=t++;return e.set(n,r),n}}}function Ce(e,t,r){let n,o=false;return ()=>{if(o)return n;o=true;try{let s=(e.stack+"").split(`
8
+ `);s.splice(1,1);let a=mt(t,s,r);if(a)return n={text:e.message,location:a},n}catch{}}}function he(e,t,r,n,o){let s="Internal error",a=null;try{s=(e&&e.message||e)+"";}catch{}try{a=mt(t,(e.stack+"").split(`
9
+ `),"");}catch{}return {id:"",pluginName:o,text:s,location:a,notes:n?[n]:[],detail:r?r.store(e):-1}}function mt(e,t,r){let n=" at ";if(e.readFileSync&&!t[0].startsWith(n)&&t[1].startsWith(n))for(let o=1;o<t.length;o++){let s=t[o];if(s.startsWith(n))for(s=s.slice(n.length);;){let a=/^(?:new |async )?\S+ \((.*)\)$/.exec(s);if(a){s=a[1];continue}if(a=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(s),a){s=a[1];continue}if(a=/^(\S+):(\d+):(\d+)$/.exec(s),a){let d;try{d=e.readFileSync(a[1],"utf8");}catch{break}let i=d.split(/\r\n|\r|\n|\u2028|\u2029/)[+a[2]-1]||"",c=+a[3]-1,u=i.slice(c,c+r.length)===r?r.length:0;return {file:a[1],namespace:"file",line:+a[2],column:ie(i.slice(0,c)).length,length:ie(i.slice(c,c+u)).length,lineText:i+`
10
+ `+t.slice(1).join(`
11
+ `),suggestion:""}}break}}return null}function Ee(e,t,r){let n=5;e+=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,n+1).map((s,a)=>{if(a===n)return `
12
+ ...`;if(!s.location)return `
13
+ error: ${s.text}`;let{file:d,line:i,column:c}=s.location,u=s.pluginName?`[plugin: ${s.pluginName}] `:"";return `
14
+ ${d}:${i}:${c}: ERROR: ${u}${s.text}`}).join("");let o=new Error(e);for(let[s,a]of [["errors",t],["warnings",r]])Object.defineProperty(o,s,{configurable:true,enumerable:true,get:()=>a,set:d=>Object.defineProperty(o,s,{configurable:true,enumerable:true,value:d})});return o}function ke(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Xe(e,t,r){if(e==null)return null;let n={},o=l$1(e,n,"file",b),s=l$1(e,n,"namespace",b),a=l$1(e,n,"line",me),d=l$1(e,n,"column",me),i=l$1(e,n,"length",me),c=l$1(e,n,"lineText",b),u=l$1(e,n,"suggestion",b);if(J(e,n,t),c){let y=c.slice(0,(d&&d>0?d:0)+(i&&i>0?i:0)+(r&&r>0?r:80));!/[\x7F-\uFFFF]/.test(y)&&!/\n/.test(c)&&(c=y);}return {file:o||"",namespace:s||"",line:a||0,column:d||0,length:i||0,lineText:c||"",suggestion:u||""}}function fe(e,t,r,n,o){let s=[],a=0;for(let d of e){let i={},c=l$1(d,i,"id",b),u=l$1(d,i,"pluginName",b),y=l$1(d,i,"text",b),N=l$1(d,i,"location",Ge),B=l$1(d,i,"notes",ce),_=l$1(d,i,"detail",De),I=`in element ${a} of "${t}"`;J(d,i,I);let L=[];if(B)for(let W of B){let z={},k=l$1(W,z,"text",b),w=l$1(W,z,"location",Ge);J(W,z,I),L.push({text:k||"",location:Xe(w,I,o)});}s.push({id:c||"",pluginName:u||n,text:y||"",location:Xe(N,I,o),notes:L,detail:r?r.store(_):-1}),a++;}return s}function Me(e,t){let r=[];for(let n of e){if(typeof n!="string")throw new Error(`${V(t)} must be an array of strings`);r.push(n);}return r}function Rt(e,t){let r=Object.create(null);for(let n in e){let o=e[n];if(typeof o!="string")throw new Error(`key ${V(n)} in object ${V(t)} must be a string`);r[n]=o;}return r}function Ut({path:e,contents:t,hash:r}){let n=null;return {path:e,contents:t,hash:r,get text(){let o=this.contents;return (n===null||o!==t)&&(t=o,n=we(o)),n}}}function Te(e){let t=e.source;return e.flags&&(t=`(?${e.flags})${t}`),t}function Wt(e){let t;try{t=we(e);}catch{return jt(e)}return JSON.parse(t)}var de=a("fs"),Ze=a("os"),ne=a("path"),ve=process.env.ESBUILD_BINARY_PATH||ve,zt=e=>!!e&&e!=="/usr/bin/esbuild",et="@esbuild/darwin-arm64",tt="@esbuild/darwin-x64",Fe={"win32 arm64 LE":"@esbuild/win32-arm64","win32 ia32 LE":"@esbuild/win32-ia32","win32 x64 LE":"@esbuild/win32-x64"},Be={"aix ppc64 BE":"@esbuild/aix-ppc64","android arm64 LE":"@esbuild/android-arm64","darwin arm64 LE":"@esbuild/darwin-arm64","darwin x64 LE":"@esbuild/darwin-x64","freebsd arm64 LE":"@esbuild/freebsd-arm64","freebsd x64 LE":"@esbuild/freebsd-x64","linux arm LE":"@esbuild/linux-arm","linux arm64 LE":"@esbuild/linux-arm64","linux ia32 LE":"@esbuild/linux-ia32","linux mips64el LE":"@esbuild/linux-mips64el","linux ppc64 LE":"@esbuild/linux-ppc64","linux riscv64 LE":"@esbuild/linux-riscv64","linux s390x BE":"@esbuild/linux-s390x","linux x64 LE":"@esbuild/linux-x64","linux loong64 LE":"@esbuild/linux-loong64","netbsd arm64 LE":"@esbuild/netbsd-arm64","netbsd x64 LE":"@esbuild/netbsd-x64","openbsd arm64 LE":"@esbuild/openbsd-arm64","openbsd x64 LE":"@esbuild/openbsd-x64","sunos x64 LE":"@esbuild/sunos-x64"},rt={"android arm LE":"@esbuild/android-arm","android x64 LE":"@esbuild/android-x64","openharmony arm64 LE":"@esbuild/openharmony-arm64"};function qt(){let e,t,r=false,n=`${process.platform} ${Ze.arch()} ${Ze.endianness()}`;if(n in Fe)e=Fe[n],t="esbuild.exe";else if(n in Be)e=Be[n],t="bin/esbuild";else if(n in rt)e=rt[n],t="bin/esbuild",r=true;else throw new Error(`Unsupported platform: ${n}`);return {pkg:e,subpath:t,isWASM:r}}function Jt(){let e=a.resolve("esbuild"),t=ne.dirname(ne.dirname(ne.dirname(e)));if(ne.basename(t)==="node_modules"){for(let r in Be)try{let n=Be[r];if(de.existsSync(ne.join(t,n)))return n}catch{}for(let r in Fe)try{let n=Fe[r];if(de.existsSync(ne.join(t,n)))return n}catch{}}return null}function Vt(e,t){let r=ne.dirname(a.resolve("esbuild"));return ne.join(r,`downloaded-${e.replace("/","-")}-${ne.basename(t)}`)}function Yt(){if(zt(ve))if(!de.existsSync(ve))console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${ve}`);else return {binPath:ve,isWASM:false};let{pkg:e,subpath:t,isWASM:r}=qt(),n;try{n=a.resolve(`${e}/${t}`);}catch(o){if(n=Vt(e,t),!de.existsSync(n)){try{a.resolve(e);}catch{let s=Jt();if(s){let a=`
15
+ Specifically the "${s}" package is present but this platform
16
+ needs the "${e}" package instead. People often get into this
17
+ situation by installing esbuild on Windows or macOS and copying "node_modules"
18
+ into a Docker image that runs Linux, or by copying "node_modules" between
19
+ Windows and WSL environments.
20
+
21
+ If you are installing with npm, you can try not copying the "node_modules"
22
+ directory when you copy the files over, and running "npm ci" or "npm install"
23
+ on the destination platform after the copy. Or you could consider using yarn
24
+ instead of npm which has built-in support for installing a package on multiple
25
+ platforms simultaneously.
26
+
27
+ If you are installing with yarn, you can try listing both this platform and the
28
+ other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
29
+ feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
30
+ Keep in mind that this means multiple copies of esbuild will be present.
31
+ `;throw (e===tt&&s===et||e===et&&s===tt)&&(a=`
32
+ Specifically the "${s}" package is present but this platform
33
+ needs the "${e}" package instead. People often get into this
34
+ situation by installing esbuild with npm running inside of Rosetta 2 and then
35
+ trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
36
+ 2 is Apple's on-the-fly x86_64-to-arm64 translation service).
37
+
38
+ If you are installing with npm, you can try ensuring that both npm and node are
39
+ not running under Rosetta 2 and then reinstalling esbuild. This likely involves
40
+ changing how you installed npm and/or node. For example, installing node with
41
+ the universal installer here should work: https://nodejs.org/en/download/. Or
42
+ you could consider using yarn instead of npm which has built-in support for
43
+ installing a package on multiple platforms simultaneously.
44
+
45
+ If you are installing with yarn, you can try listing both "arm64" and "x64"
46
+ in your ".yarnrc.yml" file using the "supportedArchitectures" feature:
47
+ https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
48
+ Keep in mind that this means multiple copies of esbuild will be present.
49
+ `),new Error(`
50
+ You installed esbuild for another platform than the one you're currently using.
51
+ This won't work because esbuild is written with native code and needs to
52
+ install a platform-specific binary executable.
53
+ ${a}
54
+ Another alternative is to use the "esbuild-wasm" package instead, which works
55
+ the same way on all platforms. But it comes with a heavy performance cost and
56
+ can sometimes be 10x slower than the "esbuild" package, so you may also not
57
+ want to do that.
58
+ `)}throw new Error(`The package "${e}" could not be found, and is needed by esbuild.
59
+
60
+ If you are installing esbuild with npm, make sure that you don't specify the
61
+ "--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
62
+ of "package.json" is used by esbuild to install the correct binary executable
63
+ for your current platform.`)}throw o}}if(/\.zip\//.test(n)){let o;try{o=a("pnpapi");}catch{}if(o){let s=o.getPackageInformation(o.topLevel).packageLocation,a=ne.join(s,"node_modules",".cache","esbuild",`pnpapi-${e.replace("/","-")}-0.27.4-${ne.basename(t)}`);return de.existsSync(a)||(de.mkdirSync(ne.dirname(a),{recursive:true}),de.copyFileSync(n,a),de.chmodSync(a,493)),{binPath:a,isWASM:r}}}return {binPath:n,isWASM:r}}var pt=a("child_process"),Ht=a("crypto"),ze=a("path"),pe=a("fs"),Kt=a("os"),Qt=a("tty"),H;if(process.env.ESBUILD_WORKER_THREADS!=="0"){try{H=a("worker_threads");}catch{}let[e,t]=process.versions.node.split(".");(+e<12||+e==12&&+t<17||+e==13&&+t<13)&&(H=void 0);}var nt,Oe=((nt=H?.workerData)==null?void 0:nt.esbuildVersion)==="0.27.4",gt=()=>{if(!ve&&(ze.basename(k)!=="main.js"||ze.basename(j)!=="lib"))throw new Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
64
+
65
+ More information: The file containing the code for esbuild's JavaScript API (${k}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`);{let{binPath:e,isWASM:t}=Yt();return t?["node",[e]]:[e,[]]}},Ae=()=>Qt.isatty(2),Gt={readFile(e,t){try{let r=pe.readFileSync(e,"utf8");try{pe.unlinkSync(e);}catch{}t(null,r);}catch(r){t(r,null);}},writeFile(e,t){try{let r=wt();pe.writeFileSync(r,e),t(r);}catch{t(null);}}},Xt={readFile(e,t){try{pe.readFile(e,"utf8",(r,n)=>{try{pe.unlink(e,()=>t(r,n));}catch{t(r,n);}});}catch(r){t(r,null);}},writeFile(e,t){try{let r=wt();pe.writeFile(r,e,n=>t(n!==null?null:r));}catch{t(null);}}},Zt="0.27.4",er=e=>ye().build(e),tr=e=>ye().context(e),rr=(e,t)=>ye().transform(e,t),nr=(e,t)=>ye().formatMessages(e,t),ir=(e,t)=>ye().analyzeMetafile(e,t),lr=e=>{if(H&&!Oe)return K||(K=Re(H)),K.buildSync(e);let t;return Ie(r=>r.buildOrContext({callName:"buildSync",refs:null,options:e,isTTY:Ae(),defaultWD:ge,callback:(n,o)=>{if(n)throw n;t=o;}})),t},ar=(e,t)=>{if(H&&!Oe)return K||(K=Re(H)),K.transformSync(e,t);let r;return Ie(n=>n.transform({callName:"transformSync",refs:null,input:e,options:t||{},isTTY:Ae(),fs:Gt,callback:(o,s)=>{if(o)throw o;r=s;}})),r},or=(e,t)=>{if(H&&!Oe)return K||(K=Re(H)),K.formatMessagesSync(e,t);let r;return Ie(n=>n.formatMessages({callName:"formatMessagesSync",refs:null,messages:e,options:t,callback:(o,s)=>{if(o)throw o;r=s;}})),r},sr=(e,t)=>{if(H&&!Oe)return K||(K=Re(H)),K.analyzeMetafileSync(e,t);let r;return Ie(n=>n.analyzeMetafile({callName:"analyzeMetafileSync",refs:null,metafile:typeof e=="string"?e:JSON.stringify(e),options:t,callback:(o,s)=>{if(o)throw o;r=s;}})),r},ur=()=>(Ne&&Ne(),K&&K.stop(),Promise.resolve()),qe=false,cr=e=>{if(e=Ft(e||{}),e.wasmURL)throw new Error('The "wasmURL" option only works in the browser');if(e.wasmModule)throw new Error('The "wasmModule" option only works in the browser');if(e.worker)throw new Error('The "worker" option only works in the browser');if(qe)throw new Error('Cannot call "initialize" more than once');return ye(),qe=true,Promise.resolve()},ge=process.cwd(),Se,Ne,ye=()=>{if(Se)return Se;let[e,t]=gt(),r=pt.spawn(e,t.concat("--service=0.27.4","--ping"),{windowsHide:true,stdio:["pipe","pipe","inherit"],cwd:ge}),{readFromStdout:n,afterClose:o,service:s}=dt({writeToStdin(u){r.stdin.write(u,y=>{y&&o(y);});},readFileSync:pe.readFileSync,isSync:false,hasFS:true,esbuild:Pe});r.stdin.on("error",o),r.on("error",o);let a=r.stdin,d=r.stdout;d.on("data",n),d.on("end",o),Ne=()=>{a.destroy(),d.destroy(),r.kill(),qe=false,Se=void 0,Ne=void 0;};let i=0;r.unref(),a.unref&&a.unref(),d.unref&&d.unref();let c={ref(){++i===1&&r.ref();},unref(){--i===0&&r.unref();}};return Se={build:u=>new Promise((y,N)=>{s.buildOrContext({callName:"build",refs:c,options:u,isTTY:Ae(),defaultWD:ge,callback:(B,_)=>B?N(B):y(_)});}),context:u=>new Promise((y,N)=>s.buildOrContext({callName:"context",refs:c,options:u,isTTY:Ae(),defaultWD:ge,callback:(B,_)=>B?N(B):y(_)})),transform:(u,y)=>new Promise((N,B)=>s.transform({callName:"transform",refs:c,input:u,options:y||{},isTTY:Ae(),fs:Xt,callback:(_,I)=>_?B(_):N(I)})),formatMessages:(u,y)=>new Promise((N,B)=>s.formatMessages({callName:"formatMessages",refs:c,messages:u,options:y,callback:(_,I)=>_?B(_):N(I)})),analyzeMetafile:(u,y)=>new Promise((N,B)=>s.analyzeMetafile({callName:"analyzeMetafile",refs:c,metafile:typeof u=="string"?u:JSON.stringify(u),options:y,callback:(_,I)=>_?B(_):N(I)}))},Se},Ie=e=>{let[t,r]=gt(),n=new Uint8Array,{readFromStdout:o,afterClose:s,service:a}=dt({writeToStdin(i){if(n.length!==0)throw new Error("Must run at most one command");n=i;},isSync:true,hasFS:true,esbuild:Pe});e(a);let d=pt.execFileSync(t,r.concat("--service=0.27.4"),{cwd:ge,windowsHide:true,input:n,maxBuffer:+process.env.ESBUILD_MAX_BUFFER||16*1024*1024});o(d),s(null);},wt=()=>ze.join(Kt.tmpdir(),`esbuild-${Ht.randomBytes(32).toString("hex")}`),K=null,Re=e=>{let{port1:t,port2:r}=new e.MessageChannel,n=new e.Worker(k,{workerData:{workerPort:r,defaultWD:ge,esbuildVersion:"0.27.4"},transferList:[r],execArgv:[]}),o=0,s=c=>{let u=new Error(`Build failed with 1 error:
66
+ error: ${c}`),y=[{id:"",pluginName:"",text:c,location:null,notes:[],detail:void 0}];return u.errors=y,u.warnings=[],u},a=c=>{if(!c)return;let u=c.plugins;if(u&&u.length>0)throw s("Cannot use plugins in synchronous API calls")},d=(c,u)=>{for(let y in u)c[y]=u[y];},i=(c,u)=>{let y=o++,N=new SharedArrayBuffer(8),B=new Int32Array(N),_={sharedBuffer:N,id:y,command:c,args:u};n.postMessage(_);let I=Atomics.wait(B,0,0);if(I!=="ok"&&I!=="not-equal")throw new Error("Internal error: Atomics.wait() failed: "+I);let{message:{id:L,resolve:W,reject:z,properties:k}}=e.receiveMessageOnPort(t);if(y!==L)throw new Error(`Internal error: Expected id ${y} but got id ${L}`);if(z)throw d(z,k),z;return W};return n.unref(),{buildSync(c){return a(c),i("build",[c])},transformSync(c,u){return i("transform",[c,u])},formatMessagesSync(c,u){return i("formatMessages",[c,u])},analyzeMetafileSync(c,u){return i("analyzeMetafile",[c,u])},stop(){n.terminate(),K=null;}}},fr=()=>{let e=H.workerData.workerPort,t=H.parentPort,r=n=>{let o={};if(n&&typeof n=="object")for(let s in n)o[s]=n[s];return o};try{let n=ye();ge=H.workerData.defaultWD,t.on("message",o=>{(async()=>{let{sharedBuffer:s,id:a,command:d,args:i}=o,c=new Int32Array(s);try{switch(d){case "build":e.postMessage({id:a,resolve:await n.build(i[0])});break;case "transform":e.postMessage({id:a,resolve:await n.transform(i[0],i[1])});break;case "formatMessages":e.postMessage({id:a,resolve:await n.formatMessages(i[0],i[1])});break;case "analyzeMetafile":e.postMessage({id:a,resolve:await n.analyzeMetafile(i[0],i[1])});break;default:throw new Error(`Invalid command: ${d}`)}}catch(u){e.postMessage({id:a,reject:u,properties:r(u)});}Atomics.add(c,0,1),Atomics.notify(c,0,1/0);})();});}catch(n){t.on("message",o=>{let{sharedBuffer:s,id:a}=o,d=new Int32Array(s);e.postMessage({id:a,reject:n,properties:r(n)}),Atomics.add(d,0,1),Atomics.notify(d,0,1/0);});}};Oe&&fr();var dr=Pe;});var main7EGLGBLC = hr();export{main7EGLGBLC as default};