/**
 * Bundled from which
 * This is a zero-dependency bundle created by esbuild.
 */
var B=Object.defineProperty;var c=(e,t)=>B(e,"name",{value:t,configurable:!0});var d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var y=d(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});l.sync=l.isexe=void 0;var H=require("fs"),N=require("fs/promises"),D=c(async(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return g(await(0,N.stat)(e),t)}catch(s){let n=s;if(r||n.code==="EACCES")return!1;throw n}},"isexe");l.isexe=D;var G=c((e,t={})=>{let{ignoreErrors:r=!1}=t;try{return g((0,H.statSync)(e),t)}catch(s){let n=s;if(r||n.code==="EACCES")return!1;throw n}},"sync");l.sync=G;var g=c((e,t)=>e.isFile()&&U(e,t),"checkStat"),U=c((e,t)=>{let r=t.uid??process.getuid?.(),s=t.groups??process.getgroups?.()??[],n=t.gid??process.getgid?.()??s[0];if(r===void 0||n===void 0)throw new Error("cannot get uid or gid");let i=new Set([n,...s]),u=e.mode,f=e.uid,p=e.gid,a=parseInt("100",8),E=parseInt("010",8),R=parseInt("001",8),X=a|E;return!!(u&R||u&E&&i.has(p)||u&a&&f===r||u&X&&r===0)},"checkMode")});var x=d(h=>{"use strict";Object.defineProperty(h,"__esModule",{value:!0});h.sync=h.isexe=void 0;var W=require("fs"),z=require("fs/promises"),J=c(async(e,t={})=>{let{ignoreErrors:r=!1}=t;try{return _(await(0,z.stat)(e),e,t)}catch(s){let n=s;if(r||n.code==="EACCES")return!1;throw n}},"isexe");h.isexe=J;var K=c((e,t={})=>{let{ignoreErrors:r=!1}=t;try{return _((0,W.statSync)(e),e,t)}catch(s){let n=s;if(r||n.code==="EACCES")return!1;throw n}},"sync");h.sync=K;var Q=c((e,t)=>{let{pathExt:r=process.env.PATHEXT||""}=t,s=r.split(";");if(s.indexOf("")!==-1)return!0;for(let n=0;n<s.length;n++){let i=s[n].toLowerCase(),u=e.substring(e.length-i.length).toLowerCase();if(i&&u===i)return!0}return!1},"checkPathExt"),_=c((e,t,r)=>e.isFile()&&Q(t,r),"checkStat")});var v=d(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0})});var C=d(o=>{"use strict";var P=o&&o.__createBinding||(Object.create?(function(e,t,r,s){s===void 0&&(s=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:c(function(){return t[r]},"get")}),Object.defineProperty(e,s,n)}):(function(e,t,r,s){s===void 0&&(s=r),e[s]=t[r]})),V=o&&o.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),O=o&&o.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&P(t,e,r);return V(t,e),t},Y=o&&o.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&P(t,e,r)};Object.defineProperty(o,"__esModule",{value:!0});o.sync=o.isexe=o.posix=o.win32=void 0;var S=O(y());o.posix=S;var b=O(x());o.win32=b;Y(v(),o);var Z=process.env._ISEXE_TEST_PLATFORM_||process.platform,j=Z==="win32"?b:S;o.isexe=j.isexe;o.sync=j.sync});var{isexe:m,sync:k}=C(),{join:ee,delimiter:te,sep:M,posix:T}=require("path"),q=process.platform==="win32",A=new RegExp(`[${T.sep}${M===T.sep?"":M}]`.replace(/(\\)/g,"\\$1")),re=new RegExp(`^\\.${A.source}`),$=c(e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),"getNotFoundError"),I=c((e,{path:t=process.env.PATH,pathExt:r=process.env.PATHEXT,delimiter:s=te})=>{let n=e.match(A)?[""]:[...q?[process.cwd()]:[],...(t||"").split(s)];if(q){let i=r||[".EXE",".CMD",".BAT",".COM"].join(s),u=i.split(s).flatMap(f=>[f,f.toLowerCase()]);return e.includes(".")&&u[0]!==""&&u.unshift(""),{pathEnv:n,pathExt:u,pathExtExe:i}}return{pathEnv:n,pathExt:[""]}},"getPathInfo"),F=c((e,t)=>{let r=/^".*"$/.test(e)?e.slice(1,-1):e;return(!r&&re.test(t)?t.slice(0,2):"")+ee(r,t)},"getPathPart"),L=c(async(e,t={})=>{let{pathEnv:r,pathExt:s,pathExtExe:n}=I(e,t),i=[];for(let u of r){let f=F(u,e);for(let p of s){let a=f+p;if(await m(a,{pathExt:n,ignoreErrors:!0})){if(!t.all)return a;i.push(a)}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw $(e)},"which"),ne=c((e,t={})=>{let{pathEnv:r,pathExt:s,pathExtExe:n}=I(e,t),i=[];for(let u of r){let f=F(u,e);for(let p of s){let a=f+p;if(k(a,{pathExt:n,ignoreErrors:!0})){if(!t.all)return a;i.push(a)}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw $(e)},"whichSync");module.exports=L;L.sync=ne;
