@negoziator/ai-commit 2.73.2 → 2.74.1

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,130 @@
1
+ var Ac=Object.defineProperty;var o=(e,t)=>Ac(e,"name",{value:t,configurable:!0});var Ve;import $c from"tty";import{fileURLToPath as So}from"node:url";import{ChildProcess as vo,execFile as Bc,spawnSync as Tc,spawn as Ic}from"node:child_process";import{StringDecoder as Ao}from"node:string_decoder";import{debuglog as Oc,stripVTControlCharacters as Rc,inspect as $o,promisify as Bo,callbackify as Re,aborted as xc,styleText as C}from"node:util";import O,{platform as Mc,hrtime as To,execPath as _c,execArgv as Pc,stdout as on,stdin as Io}from"node:process";import Oo,{ReadStream as Ro}from"node:tty";import K from"node:path";import Lc from"child_process";import ce from"path";import sn from"fs";import{setTimeout as xo,scheduler as Mo,setImmediate as Nc}from"node:timers/promises";import{constants as me}from"node:os";import{once as z,addAbortListener as _o,EventEmitter as kc,on as Dt,setMaxListeners as Uc}from"node:events";import{serialize as jc}from"node:v8";import{statSync as Wc,readFileSync as an,appendFileSync as Gc,writeFileSync as zc,createWriteStream as Po,createReadStream as Lo}from"node:fs";import{Transform as Vc,getDefaultHighWaterMark as pt,Duplex as un,Writable as cn,Readable as ge,PassThrough as No}from"node:stream";import{Buffer as ln}from"node:buffer";import{finished as le}from"node:stream/promises";import*as mt from"node:readline";import Hc from"node:readline";import W from"fs/promises";import Kc from"os";import{fileURLToPath as qc,pathToFileURL as Yc}from"url";var Zc=Object.defineProperty,L=o((e,t)=>Zc(e,"name",{value:t,configurable:!0}),"a$1");const Jc="known-flag",Xc="unknown-flag",Qc="argument",el=/\B([A-Z])/g,tl=L(e=>e.replaceAll(el,"-$1").toLowerCase(),"camelToKebab"),{hasOwnProperty:nl}=Object.prototype,xe=L((e,t)=>nl.call(e,t),"hasOwn"),dn=L(e=>typeof e=="function"?[e,!1]:Array.isArray(e)?[e[0],!0]:dn(e.type),"parseFlagType"),ko=L((e,t)=>e===Boolean?t!=="false":t,"normalizeBoolean"),Uo=L((e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),"applyParser"),rl=/[\s.:=]/,ol=L(e=>{const t=`Flag name "${e}"`;if(e.length===0)throw new Error(`${t} cannot be empty`);const n=e.match(rl);if(n)throw new Error(`${t} cannot contain "${n?.[0]}"`)},"validateFlagName"),fn=L((e,t,n)=>{if(xe(e,t))throw new Error(`Duplicate flags named "${t}"`);e[t]=n},"setFlag"),il=L(e=>{const t={};for(const n in e){if(!xe(e,n))continue;ol(n);const r=e[n],i=[[],...dn(r),r];fn(t,n,i);const s=tl(n);if(n!==s&&fn(t,s,i),"alias"in r&&typeof r.alias=="string"){const{alias:a}=r,u=`Flag alias "${a}" for flag "${n}"`;if(n.length===1)throw new Error(`${u} cannot be defined for a single-character flag`);if(a.length===0)throw new Error(`${u} cannot be empty`);if(a.length>1)throw new Error(`${u} must be a single character`);fn(t,a,i)}}return t},"createRegistry"),sl=L((e,t)=>{const n={};for(const r in e){if(!xe(e,r))continue;const[i,,s,a]=t[r];if(i.length===0&&"default"in a){let{default:u}=a;typeof u=="function"&&(u=u()),n[r]=u}else n[r]=s?i:i.pop()}return n},"finalizeFlags"),gt="--",al=3,ul=/^-{1,2}\w/,jo=L(e=>{if(!ul.test(e))return;const t=!e.startsWith(gt);let n=e.slice(t?1:2),r,i=-1;for(const s of["=",":","."]){const a=n.indexOf(s);a!==-1&&(i===-1||a<i)&&(i=a)}return i!==-1&&(r=n.slice(i+1),n=n.slice(0,i)),[n,r,t]},"parseFlagArgv"),Wo=L((e,{onFlag:t,onArgument:n})=>{let r;const i=L((s,a)=>{if(typeof r!="function")return!0;r(s,a),r=void 0},"triggerValueCallback");for(let s=0;s<e.length;s+=1){const a=e[s];if(a===gt){i();const c=e.slice(s+1);n?.(c,[s],!0);break}const u=jo(a);if(u){if(i(),!t)continue;const[c,d,l]=u;if(l)for(let f=0;f<c.length;f+=1){i();const h=f===c.length-1;r=t(c[f],h?d:void 0,[s,f+1,h])}else r=t(c,d,[s])}else i(a,[s])&&n?.([a],[s])}i()},"argvIterator"),Go=L((e,t)=>{for(let n=t.length-1;n>=0;n-=1){const[r,i,s]=t[n];if(i){const a=e[r];let u=a.slice(0,i);if(s||(u+=a.slice(i+1)),u!=="-"){e[r]=u;continue}}e.splice(r,1)}},"spliceFromArgv"),hn=L((e,t)=>Object.assign(e,{[gt]:t}),"createPositionalArgumentsFromParts");L(e=>{const t=e.indexOf(gt);if(t===-1)return hn([...e],[]);const n=e.slice(0,t),r=e.slice(t+1);return hn([...n,...r],r)},"createPositionalArguments");const cl=L((e,t=process.argv.slice(2),{ignore:n,booleanNegation:r}={})=>{const i=[],s=il(e),a={},u=[];let c=[];return Wo(t,{onFlag(d,l,f){const h=f.length===al,D=(h||d.length>1)&&xe(s,d);let p;if(!D&&r&&!h&&d.length>3&&d.startsWith("no-")){const m=d.slice(3);xe(s,m)&&s[m][1]===Boolean&&(p=m)}if(!n?.(D||p?Jc:Xc,d,l)){if(D){const[m,g]=s[d],F=ko(g,l),w=L((E,y)=>{i.push(f),y&&i.push(y),m.push(Uo(g,E||""))},"getFollowingValue");return F===void 0?w:w(F)}if(p){s[p][0].push(!1),i.push(f);return}xe(a,d)||(a[d]=[]),a[d].push(l===void 0?!0:l),i.push(f)}},onArgument:L((d,l,f)=>{n?.(Qc,t[l[0]])||(u.push(...d),f?(c=d,t.splice(l[0])):i.push(l))},"onArgument")}),Go(t,i),{flags:sl(e,s),unknownFlags:a,_:hn(u,c)}},"typeFlag");L((e,t,n=process.argv.slice(2))=>{const r=new Set(e.split(",").map(c=>jo(c)?.[0])),[i,s]=dn(t),a=[],u=[];return Wo(n,{onFlag:L((c,d,l)=>{if(!r.has(c)||!s&&a.length>0)return;const f=ko(i,d),h=L((D,p)=>{u.push(l),p&&u.push(p),a.push(Uo(i,D||""))},"getFollowingValue");return f===void 0?h:h(f)},"onFlag")}),Go(n,u),s?a:a[0]},"getFlag");var ll=Object.defineProperty,v=o((e,t)=>ll(e,"name",{value:t,configurable:!0}),"n$1");const dl=v(e=>{const t=process.stdout.columns??Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(t)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:t}:{columns:e.columns??[],stdoutColumns:e.stdoutColumns??t}},"getOptions");function zo({onlyFirst:e=!1}={}){const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}o(zo,"j"),v(zo,"ansiRegex");const fl=zo();function Dn(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(fl,"")}o(Dn,"w$2"),v(Dn,"stripAnsi");function Vo(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}o(Vo,"P$3"),v(Vo,"isAmbiguous");function Ho(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}o(Ho,"z$2"),v(Ho,"isFullWidth");function Ko(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}o(Ko,"G$1"),v(Ko,"isWide");function qo(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}o(qo,"Z$2"),v(qo,"validate");function Yo(e,{ambiguousAsWide:t=!1}={}){return qo(e),Ho(e)||Ko(e)||t&&Vo(e)?2:1}o(Yo,"V$1"),v(Yo,"eastAsianWidth");var hl=v(()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,"emojiRegex");const Dl=new Intl.Segmenter,pl=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function de(e,t={}){if(typeof e!="string"||e.length===0)return 0;const{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=Dn(e)),e.length===0)return 0;let i=0;const s={ambiguousAsWide:!n};for(const{segment:a}of Dl.segment(e)){const u=a.codePointAt(0);if(!(u<=31||u>=127&&u<=159)&&!(u>=8203&&u<=8207||u===65279)&&!(u>=768&&u<=879||u>=6832&&u<=6911||u>=7616&&u<=7679||u>=8400&&u<=8447||u>=65056&&u<=65071)&&!(u>=55296&&u<=57343)&&!(u>=65024&&u<=65039)&&!pl.test(a)){if(hl().test(a)){i+=2;continue}i+=Yo(u,s)}}return i}o(de,"d"),v(de,"stringWidth");const Zo=v(e=>Math.max(...e.split(`
2
+ `).map(t=>de(t))),"getLongestLineWidth"),ml=v(e=>{const t=[];for(const n of e){const{length:r}=n,i=r-t.length;for(let s=0;s<i;s+=1)t.push(0);for(let s=0;s<r;s+=1){const a=Zo(n[s]);a>t[s]&&(t[s]=a)}}return t},"getColumnContentWidths"),Jo=/^\d+%$/,Xo={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},gl=v((e,t)=>{const n=[];for(let r=0;r<e.length;r+=1){const i=t[r]??"auto";if(typeof i=="number"||i==="auto"||i==="content-width"||typeof i=="string"&&Jo.test(i)){n.push({...Xo,width:i,contentWidth:e[r]});continue}if(i&&typeof i=="object"){const s={...Xo,...i,contentWidth:e[r]};s.horizontalPadding=s.paddingLeft+s.paddingRight,n.push(s);continue}throw new Error(`Invalid column width: ${JSON.stringify(i)}`)}return n},"initColumns"),Fl=v((e,t)=>{for(const n of e){const{width:r}=n;if(r==="content-width"&&(n.width=n.contentWidth),r==="auto"){const c=Math.min(20,n.contentWidth);n.width=c,n.autoOverflow=n.contentWidth-c}if(typeof r=="string"&&Jo.test(r)){const c=Number.parseFloat(r.slice(0,-1))/100;n.width=Math.floor(t*c)-(n.paddingLeft+n.paddingRight)}const{horizontalPadding:i}=n,s=1,a=s+i;if(a>=t){const c=a-t,d=Math.ceil(n.paddingLeft/i*c),l=c-d;n.paddingLeft-=d,n.paddingRight-=l,n.horizontalPadding=n.paddingLeft+n.paddingRight}n.paddingLeftString=n.paddingLeft?" ".repeat(n.paddingLeft):"",n.paddingRightString=n.paddingRight?" ".repeat(n.paddingRight):"";const u=t-n.horizontalPadding;n.width=Math.max(Math.min(n.width,u),s)}},"resolveColumnWidths"),Qo=v(()=>Object.assign([],{columns:0}),"makeRow"),wl=v((e,t)=>{const n=[Qo()];let[r]=n;for(const i of e){const s=i.width+i.horizontalPadding;r.columns+s>t&&(r=Qo(),n.push(r)),r.push(i),r.columns+=s}for(const i of n){const s=i.reduce((h,D)=>h+D.width+D.horizontalPadding,0);let a=t-s;if(a===0)continue;const u=i.filter(h=>"autoOverflow"in h),c=u.filter(h=>h.autoOverflow>0),d=c.reduce((h,D)=>h+D.autoOverflow,0),l=Math.min(d,a);for(const h of c){const D=Math.floor(h.autoOverflow/d*l);h.width+=D,a-=D}const f=Math.floor(a/u.length);for(let h=0;h<u.length;h+=1){const D=u[h];h===u.length-1?D.width+=a:D.width+=f,a-=f}}return n},"balanceAuto"),yl=v((e,t,n)=>{const r=gl(n,t);return Fl(r,e),wl(r,e)},"computeColumnWidths"),pn=10,ei=v((e=0)=>t=>`\x1B[${t+e}m`,"wrapAnsi16"),ti=v((e=0)=>t=>`\x1B[${38+e};5;${t}m`,"wrapAnsi256"),ni=v((e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,"wrapAnsi16m"),M={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(M.modifier);const El=Object.keys(M.color),bl=Object.keys(M.bgColor);[...El,...bl];function ri(){const e=new Map;for(const[t,n]of Object.entries(M)){for(const[r,i]of Object.entries(n))M[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},n[r]=M[r],e.set(i[0],i[1]);Object.defineProperty(M,t,{value:n,enumerable:!1})}return Object.defineProperty(M,"codes",{value:e,enumerable:!1}),M.color.close="\x1B[39m",M.bgColor.close="\x1B[49m",M.color.ansi=ei(),M.color.ansi256=ti(),M.color.ansi16m=ni(),M.bgColor.ansi=ei(pn),M.bgColor.ansi256=ti(pn),M.bgColor.ansi16m=ni(pn),Object.defineProperties(M,{rgbToAnsi256:{value:v((t,n,r)=>t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5),"value"),enumerable:!1},hexToRgb:{value:v(t=>{const n=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!n)return[0,0,0];let[r]=n;r.length===3&&(r=[...r].map(s=>s+s).join(""));const i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},"value"),enumerable:!1},hexToAnsi256:{value:v(t=>M.rgbToAnsi256(...M.hexToRgb(t)),"value"),enumerable:!1},ansi256ToAnsi:{value:v(t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let n,r,i;if(t>=232)n=((t-232)*10+8)/255,r=n,i=n;else{t-=16;const u=t%36;n=Math.floor(t/36)/5,r=Math.floor(u/6)/5,i=u%6/5}const s=Math.max(n,r,i)*2;if(s===0)return 30;let a=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(n));return s===2&&(a+=60),a},"value"),enumerable:!1},rgbToAnsi:{value:v((t,n,r)=>M.ansi256ToAnsi(M.rgbToAnsi256(t,n,r)),"value"),enumerable:!1},hexToAnsi:{value:v(t=>M.ansi256ToAnsi(M.hexToAnsi256(t)),"value"),enumerable:!1}}),M}o(ri,"FD"),v(ri,"assembleStyles");const Cl=ri(),Ft=new Set(["\x1B","\x9B"]),Sl=39,mn="\x07",oi="[",vl="]",ii="m",wt=`${vl}8;;`,si=v(e=>`${Ft.values().next().value}${oi}${e}${ii}`,"wrapAnsiCode"),ai=v(e=>`${Ft.values().next().value}${wt}${e}${mn}`,"wrapAnsiHyperlink"),Al=v(e=>e.split(" ").map(t=>de(t)),"wordLengths"),gn=v((e,t,n)=>{const r=[...t];let i=!1,s=!1,a=de(Dn(e.at(-1)));for(const[u,c]of r.entries()){const d=de(c);if(a+d<=n?e[e.length-1]+=c:(e.push(c),a=0),Ft.has(c)&&(i=!0,s=r.slice(u+1,u+1+wt.length).join("")===wt),i){s?c===mn&&(i=!1,s=!1):c===ii&&(i=!1);continue}a+=d,a===n&&u<r.length-1&&(e.push(""),a=0)}!a&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},"wrapWord"),$l=v(e=>{const t=e.split(" ");let n=t.length;for(;n>0&&!(de(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},"stringVisibleTrimSpacesRight"),Bl=v((e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let r="",i,s;const a=Al(e);let u=[""];for(const[f,h]of e.split(" ").entries()){n.trim!==!1&&(u[u.length-1]=u.at(-1).trimStart());let D=de(u.at(-1));if(f!==0&&(D>=t&&(n.wordWrap===!1||n.trim===!1)&&(u.push(""),D=0),(D>0||n.trim===!1)&&(u[u.length-1]+=" ",D++)),n.hard&&a[f]>t){const p=t-D,m=1+Math.floor((a[f]-p-1)/t);Math.floor((a[f]-1)/t)<m&&u.push(""),gn(u,h,t);continue}if(D+a[f]>t&&D>0&&a[f]>0){if(n.wordWrap===!1&&D<t){gn(u,h,t);continue}u.push("")}if(D+a[f]>t&&n.wordWrap===!1){gn(u,h,t);continue}u[u.length-1]+=h}n.trim!==!1&&(u=u.map(f=>$l(f)));const c=u.join(`
3
+ `),d=[...c];let l=0;for(const[f,h]of d.entries()){if(r+=h,Ft.has(h)){const{groups:p}=new RegExp(`(?:\\${oi}(?<code>\\d+)m|\\${wt}(?<uri>.*)${mn})`).exec(c.slice(l))||{groups:{}};if(p.code!==void 0){const m=Number.parseFloat(p.code);i=m===Sl?void 0:m}else p.uri!==void 0&&(s=p.uri.length===0?void 0:p.uri)}const D=Cl.codes.get(Number(i));d[f+1]===`
4
+ `?(s&&(r+=ai("")),i&&D&&(r+=si(D))):h===`
5
+ `&&(i&&D&&(r+=si(i)),s&&(r+=ai(s))),l+=h.length}return r},"exec");function ui(e,t,n){return String(e).normalize().replaceAll(`\r
6
+ `,`
7
+ `).split(`
8
+ `).map(r=>Bl(r,t,n)).join(`
9
+ `)}o(ui,"BD"),v(ui,"wrapAnsi");const ci=v(e=>Array.from({length:e}).fill(""),"emptyLines"),Tl=v((e,t)=>{const n=[];let r=0;for(const i of e){let s=0;const a=i.map(c=>{let d=t[r]??"";r+=1,c.preprocess&&(d=c.preprocess(d)),Zo(d)>c.width&&(d=ui(d,c.width,{hard:!0}));let l=d.split(`
10
+ `);if(c.postprocess){const{postprocess:f}=c;l=l.map((h,D)=>f.call(c,h,D))}return c.paddingTop&&l.unshift(...ci(c.paddingTop)),c.paddingBottom&&l.push(...ci(c.paddingBottom)),l.length>s&&(s=l.length),{...c,lines:l}}),u=[];for(let c=0;c<s;c+=1){const d=a.map(l=>{const f=l.lines[c]??"",h=Number.isFinite(l.width)?" ".repeat(l.width-de(f)):"";let D=l.paddingLeftString;return l.align==="right"&&(D+=h),D+=f,l.align==="left"&&(D+=h),D+l.paddingRightString}).join("");u.push(d)}n.push(u.join(`
11
+ `))}return n.join(`
12
+ `)},"renderRow"),Il=v((e,t)=>{if(!e||e.length===0)return"";const n=ml(e),r=n.length;if(r===0)return"";const{stdoutColumns:i,columns:s}=dl(t);if(s.length>r)throw new Error(`${s.length} columns defined, but only ${r} columns found`);const a=yl(i,s,n);return e.map(u=>Tl(a,u)).join(`
13
+ `)},"terminalColumns"),Ol=["<",">","=",">=","<="],Rl=v(e=>{if(!Ol.includes(e))throw new TypeError(`Invalid breakpoint operator: ${e}`)},"assertOperator"),xl=v(e=>{const t=Object.keys(e).map(n=>{const[r,i]=n.split(" ");Rl(r);const s=Number.parseInt(i,10);if(Number.isNaN(s))throw new TypeError(`Invalid breakpoint value: ${i}`);const a=e[n];return{operator:r,breakpoint:s,value:a}}).sort((n,r)=>r.breakpoint-n.breakpoint);return n=>t.find(({operator:r,breakpoint:i})=>r==="="&&n===i||r===">"&&n>i||r==="<"&&n<i||r===">="&&n>=i||r==="<="&&n<=i)?.value},"breakpoints");var Ml=Object.defineProperty,B=o((e,t)=>Ml(e,"name",{value:t,configurable:!0}),"o$1");const ie=new Uint32Array(65536),_l=B((e,t)=>{const n=e.length,r=t.length,i=1<<n-1;let s=-1,a=0,u=n,c=n;for(;c--;)ie[e.charCodeAt(c)]|=1<<c;for(c=0;c<r;c++){let d=ie[t.charCodeAt(c)];const l=d|a;d|=(d&s)+s^s,a|=~(d|s),s&=d,a&i&&u++,s&i&&u--,a=a<<1|1,s=s<<1|~(l|a),a&=l}for(c=n;c--;)ie[e.charCodeAt(c)]=0;return u},"myers_32"),Pl=B((e,t)=>{const n=t.length,r=e.length,i=[],s=[],a=Math.ceil(n/32),u=Math.ceil(r/32);for(let p=0;p<a;p++)s[p]=-1,i[p]=0;let c=0;for(;c<u-1;c++){let p=0,m=-1;const g=c*32,F=Math.min(32,r)+g;for(let w=g;w<F;w++)ie[e.charCodeAt(w)]|=1<<w;for(let w=0;w<n;w++){const E=ie[t.charCodeAt(w)],y=s[w/32|0]>>>w&1,b=i[w/32|0]>>>w&1,S=E|p,$=((E|b)&m)+m^m|E|b;let T=p|~($|m),I=m&$;T>>>31^y&&(s[w/32|0]^=1<<w),I>>>31^b&&(i[w/32|0]^=1<<w),T=T<<1|y,I=I<<1|b,m=I|~(S|T),p=T&S}for(let w=g;w<F;w++)ie[e.charCodeAt(w)]=0}let d=0,l=-1;const f=c*32,h=Math.min(32,r-f)+f;for(let p=f;p<h;p++)ie[e.charCodeAt(p)]|=1<<p;let D=r;for(let p=0;p<n;p++){const m=ie[t.charCodeAt(p)],g=s[p/32|0]>>>p&1,F=i[p/32|0]>>>p&1,w=m|d,E=((m|F)&l)+l^l|m|F;let y=d|~(E|l),b=l&E;D+=y>>>r-1&1,D-=b>>>r-1&1,y>>>31^g&&(s[p/32|0]^=1<<p),b>>>31^F&&(i[p/32|0]^=1<<p),y=y<<1|g,b=b<<1|F,l=b|~(w|y),d=y&w}for(let p=f;p<h;p++)ie[e.charCodeAt(p)]=0;return D},"myers_x"),li=B((e,t)=>{if(e.length<t.length){const n=t;t=e,e=n}return t.length===0?e.length:e.length<=32?_l(e,t):Pl(e,t)},"distance"),Ll=B((e,t)=>{let n=1/0,r=0;for(let i=0;i<t.length;i++){const s=li(e,t[i]);s<n&&(n=s,r=i)}return t[r]},"closest"),Nl=B(e=>e.replaceAll(/[\W_]([a-z\d])?/gi,(t,n)=>n?n.toUpperCase():""),"camelCase"),kl=B(e=>e.replaceAll(/\B([A-Z])/g,"-$1").toLowerCase(),"kebabCase"),Ul={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:B(e=>e.trim(),"preprocess")},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function di(e){let t=!1;return{type:"table",data:{tableData:Object.keys(e).sort((n,r)=>n.localeCompare(r)).map(n=>{const r=e[n],i="alias"in r;return i&&(t=!0),{name:n,flag:r,flagFormatted:`--${kl(n)}`,aliasesEnabled:t,aliasFormatted:i?`-${r.alias}`:void 0}}).map(n=>(n.aliasesEnabled=t,[{type:"flagName",data:n},{type:"flagDescription",data:n}])),tableBreakpoints:Ul}}}o(di,"z$1"),B(di,"renderFlags");const fi=B(e=>!e||(e.version??(e.help?e.help.version:void 0)),"getVersion"),hi=B(e=>{const t="parent"in e&&e.parent?.name;return(t?`${t} `:"")+e.name},"getName");function Di(e){const t=[];e.name&&t.push(hi(e));const n=fi(e)??("parent"in e&&fi(e.parent));if(n&&t.push(`v${n}`),t.length!==0)return{id:"name",type:"text",data:`${t.join(" ")}
14
+ `}}o(Di,"K$1"),B(Di,"getNameAndVersion");function pi(e){const{help:t}=e;if(!(!t||!t.description))return{id:"description",type:"text",data:`${t.description}
15
+ `}}o(pi,"Z$1"),B(pi,"getDescription");function mi(e){const t=e.help||{};if("usage"in t)return t.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(t.usage)?t.usage.join(`
16
+ `):t.usage}}:void 0;if(e.name){const n=[],r=[hi(e)];if(e.flags&&Object.keys(e.flags).length>0&&r.push("[flags...]"),e.parameters&&e.parameters.length>0){const{parameters:i}=e,s=i.indexOf("--"),a=s!==-1&&i.slice(s+1).some(u=>u.startsWith("<"));r.push(i.map(u=>u!=="--"?u:a?"--":"[--]").join(" "))}if(r.length>1&&n.push(r.join(" ")),"commands"in e&&e.commands?.length&&n.push(`${e.name} <command>`),n.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:n.join(`
17
+ `)}}}}o(mi,"G"),B(mi,"getUsage");function gi(e){return!("commands"in e)||!e.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:e.commands.map(t=>{const{help:n}=t.options;return[t.options.name,typeof n=="object"&&n.description||""]}),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}o(gi,"Q"),B(gi,"getCommands");function Fi(e){if(!(!e.flags||Object.keys(e.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:di(e.flags),indentBody:0}}}o(Fi,"X"),B(Fi,"getFlags");function wi(e){const{help:t}=e;if(!t||!t.examples||t.examples.length===0)return;let{examples:n}=t;if(Array.isArray(n)&&(n=n.join(`
18
+ `)),n)return{id:"examples",type:"section",data:{title:"Examples:",body:n}}}o(wi,"Y$1"),B(wi,"getExamples");function yi(e){if(!("alias"in e)||!e.alias)return;const{alias:t}=e;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(t)?t.join(", "):t}}}o(yi,"ee"),B(yi,"getAliases");const jl=B(e=>[Di,pi,mi,gi,Fi,wi,yi].map(t=>t(e)).filter(Boolean),"generateHelp"),Wl=$c.WriteStream.prototype.hasColors(),Ei=(Ve=class{text(t){return t}bold(t){return Wl?`\x1B[1m${t}\x1B[22m`:t.toLocaleUpperCase()}indentText({text:t,spaces:n}){return t.replaceAll(/^/gm," ".repeat(n))}heading(t){return this.bold(t)}section({title:t,body:n,indentBody:r=2}){return`${(t?`${this.heading(t)}
19
+ `:"")+(n?this.indentText({text:this.render(n),spaces:r}):"")}
20
+ `}table({tableData:t,tableOptions:n,tableBreakpoints:r}){return Il(t.map(i=>i.map(s=>this.render(s))),r?xl(r):n)}flagParameter(t){return t===Boolean?"":t===String?"<string>":t===Number?"<number>":Array.isArray(t)?this.flagParameter(t[0]):"<value>"}flagOperator(t){return" "}flagName(t){const{flag:n,flagFormatted:r,aliasesEnabled:i,aliasFormatted:s}=t;let a="";if(s?a+=`${s}, `:i&&(a+=" "),a+=r,"placeholder"in n&&typeof n.placeholder=="string")a+=`${this.flagOperator(t)}${n.placeholder}`;else{const u=this.flagParameter("type"in n?n.type:n);u&&(a+=`${this.flagOperator(t)}${u}`)}return a}flagDefault(t){return JSON.stringify(t)}flagDescription({flag:t}){let n="description"in t?t.description??"":"";if("default"in t){let{default:r}=t;typeof r=="function"&&(r=r()),r&&(n+=` (default: ${this.flagDefault(r)})`)}return n}render(t){if(typeof t=="string")return t;if(Array.isArray(t))return t.map(n=>this.render(n)).join(`
21
+ `);if("type"in t&&this[t.type]){const n=this[t.type];if(typeof n=="function")return n.call(this,t.data)}throw new Error(`Invalid node type: ${JSON.stringify(t)}`)}},o(Ve,"_ne"),Ve);B(Ei,"Renderers");let Gl=Ei;const bi=B(e=>e.length>0&&!e.includes(" "),"isValidScriptName"),{stringify:Q}=JSON,zl=/[|\\{}()[\]^$+*?.]/;function Fn(e){const t=[];let n,r;for(const i of e){if(r)throw new Error(`Invalid parameter: Spread parameter ${Q(r)} must be last`);const s=i[0],a=i.at(-1);let u;if(s==="<"&&a===">"&&(u=!0,n))throw new Error(`Invalid parameter: Required parameter ${Q(i)} cannot come after optional parameter ${Q(n)}`);if(s==="["&&a==="]"&&(u=!1,n=i),u===void 0)throw new Error(`Invalid parameter: ${Q(i)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let c=i.slice(1,-1);const d=c.slice(-3)==="...";d&&(r=i,c=c.slice(0,-3));const l=c.match(zl);if(l)throw new Error(`Invalid parameter: ${Q(i)}. Invalid character found ${Q(l[0])}`);t.push({name:c,required:u,spread:d})}return t}o(Fn,"P$2"),B(Fn,"parseParameters");function wn(e,t,n,r){for(let i=0;i<t.length;i+=1){const{name:s,required:a,spread:u}=t[i],c=Nl(s);if(c in e)throw new Error(`Invalid parameter: ${Q(s)} is used more than once.`);const d=u?n.slice(i):n[i];if(u&&(i=t.length),a&&(!d||u&&d.length===0))return console.error(`Error: Missing required parameter ${Q(s)}
22
+ `),r(),process.exit(1);e[c]=d}}o(wn,"S"),B(wn,"mapParametersToArguments");function Ci(e){return e!==!1}o(Ci,"se$1"),B(Ci,"helpEnabled");const Vl=B(e=>{const t=[];for(const[n,r]of Object.entries(e))if(t.push(n),r&&typeof r=="object"&&"alias"in r){const{alias:i}=r;typeof i=="string"&&i?t.push(i):Array.isArray(i)&&t.push(...i.filter(Boolean))}return t},"getKnownFlagNames"),Hl=B((e,t)=>{if(e.length<3||t.length===0)return;const n=Ll(e,t);return li(e,n)<=2?n:void 0},"findClosestFlag"),Kl=B((e,t)=>{const n=Object.keys(e);if(n.length!==0){for(const r of n){const i=Hl(r,t),s=i?` (Did you mean --${i}?)`:"";console.error(`Error: Unknown flag: --${r}.${s}`)}process.exit(1)}},"handleUnknownFlags");function yn(e,t,n,r){const i={...t.flags},s=t.version&&!("version"in i);s&&(i.version={type:Boolean,description:"Show version"});const{help:a}=t,u=Ci(a);u&&!("help"in i)&&(i.help={type:Boolean,alias:"h",description:"Show help"});const c=cl(i,r,{ignore:t.ignoreArgv,booleanNegation:t.booleanFlagNegation??t.parent?.booleanFlagNegation}),d=B(()=>{console.log(t.version)},"showVersion");if(s&&c.flags.version===!0)return d(),process.exit(0);const l=new Gl,f=u&&a?.render?a.render:m=>l.render(m),h=B(m=>{const g=jl({...t,...m?{help:m}:{},flags:i});console.log(f(g,l))},"showHelp");if(u&&c.flags.help===!0)return h(),process.exit(0);if((t.strictFlags??t.parent?.strictFlags)&&Kl(c.unknownFlags,Vl(i)),t.parameters){let{parameters:m}=t,g=c._;const F=m.indexOf("--"),w=m.slice(F+1),E=Object.create(null);let y=[];F>-1&&w.length>0&&(m=m.slice(0,F),y=c._["--"],g=g.slice(0,-y.length||void 0)),wn(E,Fn(m),g,h),F>-1&&w.length>0&&wn(E,Fn(w),y,h),Object.assign(c._,E)}const D={...c,showVersion:d,showHelp:h},p={command:e,...D};if(typeof n=="function"){const m=n(D);if(m&&"then"in m)return Object.assign(Promise.resolve(m),p)}return p}o(yn,"I"),B(yn,"cliBase");function Si(e,t){const n=new Map;for(const r of t){const i=[r.options.name],{alias:s}=r.options;s&&(Array.isArray(s)?i.push(...s):i.push(s));for(const a of i){if(n.has(a))throw new Error(`Duplicate command name found: ${Q(a)}`);n.set(a,r)}}return n.get(e)}o(Si,"ce"),B(Si,"getCommand");function vi(e,t,n=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||e.name!==e.name.trim()))throw new Error(`Invalid script name: ${Q(e.name)}`);const r=n[0];if(e.commands&&r&&bi(r)){const i=Si(r,e.commands);if(i)return yn(i.options.name,{...i.options,parent:e},i.callback,n.slice(1))}return yn(void 0,e,t,n)}o(vi,"fe$1"),B(vi,"cli");function En(e,t){if(!e)throw new Error("Command options are required");const{name:n}=e;if(n===void 0)throw new Error("Command name is required");if(!bi(n))throw new Error(`Invalid command name ${JSON.stringify(n)}. Command names must be one word.`);return{options:e,callback:t}}o(En,"de"),B(En,"command");var ql="2.74.1",Yl="Writes your git commit messages for you with AI",bn={version:ql,description:Yl};function Y(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}o(Y,"isPlainObject");const Cn=o((e,t)=>{const n=$i(Zl(e));if(typeof n!="string")throw new TypeError(`${t} must be a string or a file URL: ${n}.`);return n},"safeNormalizeFileUrl"),Zl=o(e=>Ai(e)?e.toString():e,"normalizeDenoExecPath"),Ai=o(e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,"isDenoExecPath"),$i=o(e=>e instanceof URL?So(e):e,"normalizeFileUrl"),Bi=o((e,t=[],n={})=>{const r=Cn(e,"First argument"),[i,s]=Y(t)?[[],t]:[t,n];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);const a=i.map(String),u=a.find(c=>c.includes("\0"));if(u!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${u}`);if(!Y(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[r,a,s]},"normalizeParameters"),{toString:Ti}=Object.prototype,Jl=o(e=>Ti.call(e)==="[object ArrayBuffer]","isArrayBuffer"),J=o(e=>Ti.call(e)==="[object Uint8Array]","isUint8Array"),Ke=o(e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),"bufferToUint8Array"),Xl=new TextEncoder,Ii=o(e=>Xl.encode(e),"stringToUint8Array"),Ql=new TextDecoder,Oi=o(e=>Ql.decode(e),"uint8ArrayToString"),ed=o((e,t)=>td(e,t).join(""),"joinToString"),td=o((e,t)=>{if(t==="utf8"&&e.every(s=>typeof s=="string"))return e;const n=new Ao(t),r=e.map(s=>typeof s=="string"?Ii(s):s).map(s=>n.write(s)),i=n.end();return i===""?r:[...r,i]},"uint8ArraysToStrings"),Sn=o(e=>e.length===1&&J(e[0])?e[0]:Ri(nd(e)),"joinToUint8Array"),nd=o(e=>e.map(t=>typeof t=="string"?Ii(t):t),"stringsToUint8Arrays"),Ri=o(e=>{const t=new Uint8Array(rd(e));let n=0;for(const r of e)t.set(r,n),n+=r.length;return t},"concatUint8Arrays"),rd=o(e=>{let t=0;for(const n of e)t+=n.length;return t},"getJoinLength"),od=o(e=>Array.isArray(e)&&Array.isArray(e.raw),"isTemplateString"),id=o((e,t)=>{let n=[];for(const[s,a]of e.entries())n=sd({templates:e,expressions:t,tokens:n,index:s,template:a});if(n.length===0)throw new TypeError("Template script must not be empty");const[r,...i]=n;return[r,i,{}]},"parseTemplates"),sd=o(({templates:e,expressions:t,tokens:n,index:r,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${e.raw[r]}`);const{nextTokens:s,leadingWhitespaces:a,trailingWhitespaces:u}=ad(i,e.raw[r]),c=Mi(n,s,a);if(r===t.length)return c;const d=t[r],l=Array.isArray(d)?d.map(f=>_i(f)):[_i(d)];return Mi(c,l,u)},"parseTemplate"),ad=o((e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const n=[];let r=0;const i=xi.has(t[0]);for(let a=0,u=0;a<e.length;a+=1,u+=1){const c=t[u];if(xi.has(c))r!==a&&n.push(e.slice(r,a)),r=a+1;else if(c==="\\"){const d=t[u+1];d===`
23
+ `?(a-=1,u+=1):d==="u"&&t[u+2]==="{"?u=t.indexOf("}",u+3):u+=ud[d]??1}}const s=r===e.length;return s||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:s}},"splitByWhitespaces"),xi=new Set([" "," ","\r",`
24
+ `]),ud={x:3,u:5},Mi=o((e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],"concatTokens"),_i=o(e=>{const t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(Y(e)&&("stdout"in e||"isMaxBuffer"in e))return cd(e);throw e instanceof vo||Object.prototype.toString.call(e)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${t}" in template expression`)},"parseExpression"),cd=o(({stdout:e})=>{if(typeof e=="string")return e;if(J(e))return Oi(e);throw e===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof e}" stdout in template expression`)},"getSubprocessResult"),Fe=o(e=>vn.includes(e),"isStandardStream"),vn=[O.stdin,O.stdout,O.stderr],ee=["stdin","stdout","stderr"],Pi=o(e=>ee[e]??`stdio[${e}]`,"getStreamName"),ld=o(e=>{const t={...e};for(const n of Ui)t[n]=Li(e,n);return t},"normalizeFdSpecificOptions"),Li=o((e,t)=>{const n=Array.from({length:dd(e)+1}),r=fd(e[t],n,t);return gd(r,t)},"normalizeFdSpecificOption"),dd=o(({stdio:e})=>Array.isArray(e)?Math.max(e.length,ee.length):ee.length,"getStdioLength"),fd=o((e,t,n)=>Y(e)?hd(e,t,n):t.fill(e),"normalizeFdSpecificValue"),hd=o((e,t,n)=>{for(const r of Object.keys(e).sort(Dd))for(const i of pd(r,n,t))t[i]=e[r];return t},"normalizeOptionObject"),Dd=o((e,t)=>Ni(e)<Ni(t)?1:-1,"compareFdName"),Ni=o(e=>e==="stdout"||e==="stderr"?0:e==="all"?2:1,"getFdNameOrder"),pd=o((e,t,n)=>{if(e==="ipc")return[n.length-1];const r=ki(e);if(r===void 0||r===0)throw new TypeError(`"${t}.${e}" is invalid.
25
+ It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(r>=n.length)throw new TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
26
+ Please set the "stdio" option to ensure that file descriptor exists.`);return r==="all"?[1,2]:[r]},"parseFdName"),ki=o(e=>{if(e==="all")return e;if(ee.includes(e))return ee.indexOf(e);const t=md.exec(e);if(t!==null)return Number(t[1])},"parseFd"),md=/^fd(\d+)$/,gd=o((e,t)=>e.map(n=>n===void 0?wd[t]:n),"addDefaultValue$1"),Fd=Oc("execa").enabled?"full":"none",wd={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:Fd,stripFinalNewline:!0},Ui=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],qe=o((e,t)=>t==="ipc"?e.at(-1):e[t],"getFdSpecificValue"),An=o(({verbose:e},t)=>Bn(e,t)!=="none","isVerbose"),$n=o(({verbose:e},t)=>!["none","short"].includes(Bn(e,t)),"isFullVerbose"),yd=o(({verbose:e},t)=>{const n=Bn(e,t);return Tn(n)?n:void 0},"getVerboseFunction"),Bn=o((e,t)=>t===void 0?Ed(e):qe(e,t),"getFdVerbose"),Ed=o(e=>e.find(t=>Tn(t))??In.findLast(t=>e.includes(t)),"getFdGenericVerbose"),Tn=o(e=>typeof e=="function","isVerboseFunction"),In=["none","short","full"],bd=o((e,t)=>{const n=[e,...t],r=n.join(" "),i=n.map(s=>Bd(ji(s))).join(" ");return{command:r,escapedCommand:i}},"joinCommand"),On=o(e=>Rc(e).split(`
27
+ `).map(t=>ji(t)).join(`
28
+ `),"escapeLines"),ji=o(e=>e.replaceAll(vd,t=>Cd(t)),"escapeControlCharacters"),Cd=o(e=>{const t=Ad[e];if(t!==void 0)return t;const n=e.codePointAt(0),r=n.toString(16);return n<=$d?`\\u${r.padStart(4,"0")}`:`\\U${r}`},"escapeControlCharacter"),Sd=o(()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},"getSpecialCharRegExp"),vd=Sd(),Ad={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},$d=65535,Bd=o(e=>Td.test(e)?e:Mc==="win32"?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`,"quoteString"),Td=/^[\w./-]+$/;function Id(){const{env:e}=O,{TERM:t,TERM_PROGRAM:n}=e;return O.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||n==="Terminus-Sublime"||n==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}o(Id,"isUnicodeSupported");const Wi={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Od={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Rd={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},xd={...Wi,...Od},Md={...Wi,...Rd},_d=Id(),Rn=_d?xd:Md,Pd=Oo?.WriteStream?.prototype?.hasColors?.()??!1,yt=o((e,t)=>{if(!Pd)return i=>i;const n=`\x1B[${e}m`,r=`\x1B[${t}m`;return i=>{const s=i+"";let a=s.indexOf(r);if(a===-1)return n+s+r;let u=n,c=0;const l=(t===22?r:"")+n;for(;a!==-1;)u+=s.slice(c,a)+l,c=a+r.length,a=s.indexOf(r,c);return u+=s.slice(c)+r,u}},"format"),Ld=yt(1,22),xn=yt(90,39),Nd=yt(91,39),kd=yt(93,39),Ud=o(({type:e,message:t,timestamp:n,piped:r,commandId:i,result:{failed:s=!1}={},options:{reject:a=!0}})=>{const u=jd(n),c=Wd[e]({failed:s,reject:a,piped:r}),d=Gd[e]({reject:a});return`${xn(`[${u}]`)} ${xn(`[${i}]`)} ${d(c)} ${d(t)}`},"defaultVerboseFunction"),jd=o(e=>`${Et(e.getHours(),2)}:${Et(e.getMinutes(),2)}:${Et(e.getSeconds(),2)}.${Et(e.getMilliseconds(),3)}`,"serializeTimestamp"),Et=o((e,t)=>String(e).padStart(t,"0"),"padField"),Gi=o(({failed:e,reject:t})=>e?t?Rn.cross:Rn.warning:Rn.tick,"getFinalIcon"),Wd={command:o(({piped:e})=>e?"|":"$","command"),output:o(()=>" ","output"),ipc:o(()=>"*","ipc"),error:Gi,duration:Gi},zi=o(e=>e,"identity$1"),Gd={command:o(()=>Ld,"command"),output:o(()=>zi,"output"),ipc:o(()=>zi,"ipc"),error:o(({reject:e})=>e?Nd:kd,"error"),duration:o(()=>xn,"duration")},zd=o((e,t,n)=>{const r=yd(t,n);return e.map(({verboseLine:i,verboseObject:s})=>Vd(i,s,r)).filter(i=>i!==void 0).map(i=>Hd(i)).join("")},"applyVerboseOnLines"),Vd=o((e,t,n)=>{if(n===void 0)return e;const r=n(e,t);if(typeof r=="string")return r},"applyVerboseFunction"),Hd=o(e=>e.endsWith(`
29
+ `)?e:`${e}
30
+ `,"appendNewline"),Ye=o(({type:e,verboseMessage:t,fdNumber:n,verboseInfo:r,result:i})=>{const s=Kd({type:e,result:i,verboseInfo:r}),a=qd(t,s),u=zd(a,r,n);u!==""&&console.warn(u.slice(0,-1))},"verboseLog"),Kd=o(({type:e,result:t,verboseInfo:{escapedCommand:n,commandId:r,rawOptions:{piped:i=!1,...s}}})=>({type:e,escapedCommand:n,commandId:`${r}`,timestamp:new Date,piped:i,result:t,options:s}),"getVerboseObject"),qd=o((e,t)=>e.split(`
31
+ `).map(n=>Yd({...t,message:n})),"getPrintedLines"),Yd=o(e=>({verboseLine:Ud(e),verboseObject:e}),"getPrintedLine"),Vi=o(e=>{const t=typeof e=="string"?e:$o(e);return On(t).replaceAll(" "," ".repeat(Zd))},"serializeVerboseMessage"),Zd=2,Jd=o((e,t)=>{An(t)&&Ye({type:"command",verboseMessage:e,verboseInfo:t})},"logCommand"),Xd=o((e,t,n)=>{tf(e);const r=Qd(e);return{verbose:e,escapedCommand:t,commandId:r,rawOptions:n}},"getVerboseInfo"),Qd=o(e=>An({verbose:e})?ef++:void 0,"getCommandId");let ef=0n;const tf=o(e=>{for(const t of e){if(t===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!In.includes(t)&&!Tn(t)){const n=In.map(r=>`'${r}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${n} or a function.`)}}},"validateVerbose"),Hi=o(()=>To.bigint(),"getStartTime"),Ki=o(e=>Number(To.bigint()-e)/1e6,"getDurationMs"),qi=o((e,t,n)=>{const r=Hi(),{command:i,escapedCommand:s}=bd(e,t),a=Li(n,"verbose"),u=Xd(a,s,{...n});return Jd(s,u),{command:i,escapedCommand:s,startTime:r,verboseInfo:u}},"handleCommand");var nf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}o(Yi,"getDefaultExportFromCjs");var we={exports:{}},Mn,Zi;function rf(){if(Zi)return Mn;Zi=1,Mn=r,r.sync=i;var e=sn;function t(s,a){var u=a.pathExt!==void 0?a.pathExt:process.env.PATHEXT;if(!u||(u=u.split(";"),u.indexOf("")!==-1))return!0;for(var c=0;c<u.length;c++){var d=u[c].toLowerCase();if(d&&s.substr(-d.length).toLowerCase()===d)return!0}return!1}o(t,"checkPathExt");function n(s,a,u){return!s.isSymbolicLink()&&!s.isFile()?!1:t(a,u)}o(n,"checkStat");function r(s,a,u){e.stat(s,function(c,d){u(c,c?!1:n(d,s,a))})}o(r,"isexe");function i(s,a){return n(e.statSync(s),s,a)}return o(i,"sync"),Mn}o(rf,"requireWindows");var _n,Ji;function of(){if(Ji)return _n;Ji=1,_n=t,t.sync=n;var e=sn;function t(s,a,u){e.stat(s,function(c,d){u(c,c?!1:r(d,a))})}o(t,"isexe");function n(s,a){return r(e.statSync(s),a)}o(n,"sync");function r(s,a){return s.isFile()&&i(s,a)}o(r,"checkStat");function i(s,a){var u=s.mode,c=s.uid,d=s.gid,l=a.uid!==void 0?a.uid:process.getuid&&process.getuid(),f=a.gid!==void 0?a.gid:process.getgid&&process.getgid(),h=parseInt("100",8),D=parseInt("010",8),p=parseInt("001",8),m=h|D,g=u&p||u&D&&d===f||u&h&&c===l||u&m&&l===0;return g}return o(i,"checkMode"),_n}o(of,"requireMode");var Pn,Xi;function sf(){if(Xi)return Pn;Xi=1;var e;process.platform==="win32"||nf.TESTING_WINDOWS?e=rf():e=of(),Pn=t,t.sync=n;function t(r,i,s){if(typeof i=="function"&&(s=i,i={}),!s){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(a,u){t(r,i||{},function(c,d){c?u(c):a(d)})})}e(r,i||{},function(a,u){a&&(a.code==="EACCES"||i&&i.ignoreErrors)&&(a=null,u=!1),s(a,u)})}o(t,"isexe");function n(r,i){try{return e.sync(r,i||{})}catch(s){if(i&&i.ignoreErrors||s.code==="EACCES")return!1;throw s}}return o(n,"sync"),Pn}o(sf,"requireIsexe");var Ln,Qi;function af(){if(Qi)return Ln;Qi=1;const e=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",t=ce,n=e?";":":",r=sf(),i=o(c=>Object.assign(new Error(`not found: ${c}`),{code:"ENOENT"}),"getNotFoundError"),s=o((c,d)=>{const l=d.colon||n,f=c.match(/\//)||e&&c.match(/\\/)?[""]:[...e?[process.cwd()]:[],...(d.path||process.env.PATH||"").split(l)],h=e?d.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",D=e?h.split(l):[""];return e&&c.indexOf(".")!==-1&&D[0]!==""&&D.unshift(""),{pathEnv:f,pathExt:D,pathExtExe:h}},"getPathInfo"),a=o((c,d,l)=>{typeof d=="function"&&(l=d,d={}),d||(d={});const{pathEnv:f,pathExt:h,pathExtExe:D}=s(c,d),p=[],m=o(F=>new Promise((w,E)=>{if(F===f.length)return d.all&&p.length?w(p):E(i(c));const y=f[F],b=/^".*"$/.test(y)?y.slice(1,-1):y,S=t.join(b,c),$=!b&&/^\.[\\\/]/.test(c)?c.slice(0,2)+S:S;w(g($,F,0))}),"step"),g=o((F,w,E)=>new Promise((y,b)=>{if(E===h.length)return y(m(w+1));const S=h[E];r(F+S,{pathExt:D},($,T)=>{if(!$&&T)if(d.all)p.push(F+S);else return y(F+S);return y(g(F,w,E+1))})}),"subStep");return l?m(0).then(F=>l(null,F),l):m(0)},"which"),u=o((c,d)=>{d=d||{};const{pathEnv:l,pathExt:f,pathExtExe:h}=s(c,d),D=[];for(let p=0;p<l.length;p++){const m=l[p],g=/^".*"$/.test(m)?m.slice(1,-1):m,F=t.join(g,c),w=!g&&/^\.[\\\/]/.test(c)?c.slice(0,2)+F:F;for(let E=0;E<f.length;E++){const y=w+f[E];try{if(r.sync(y,{pathExt:h}))if(d.all)D.push(y);else return y}catch{}}}if(d.all&&D.length)return D;if(d.nothrow)return null;throw i(c)},"whichSync");return Ln=a,a.sync=u,Ln}o(af,"requireWhich");var bt={exports:{}},es;function uf(){if(es)return bt.exports;es=1;const e=o((t={})=>{const n=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(n).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"},"pathKey");return bt.exports=e,bt.exports.default=e,bt.exports}o(uf,"requirePathKey");var Nn,ts;function cf(){if(ts)return Nn;ts=1;const e=ce,t=af(),n=uf();function r(s,a){const u=s.options.env||process.env,c=process.cwd(),d=s.options.cwd!=null,l=d&&process.chdir!==void 0&&!process.chdir.disabled;if(l)try{process.chdir(s.options.cwd)}catch{}let f;try{f=t.sync(s.command,{path:u[n({env:u})],pathExt:a?e.delimiter:void 0})}catch{}finally{l&&process.chdir(c)}return f&&(f=e.resolve(d?s.options.cwd:"",f)),f}o(r,"resolveCommandAttempt");function i(s){return r(s)||r(s,!0)}return o(i,"resolveCommand"),Nn=i,Nn}o(cf,"requireResolveCommand");var Ct={},ns;function lf(){if(ns)return Ct;ns=1;const e=/([()\][%!^"`<>&|;, *?])/g;function t(r){return r=r.replace(e,"^$1"),r}o(t,"escapeCommand");function n(r,i){return r=`${r}`,r=r.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),r=r.replace(/(?=(\\+?)?)\1$/,"$1$1"),r=`"${r}"`,r=r.replace(e,"^$1"),i&&(r=r.replace(e,"^$1")),r}return o(n,"escapeArgument"),Ct.command=t,Ct.argument=n,Ct}o(lf,"require_escape");var kn,rs;function df(){return rs||(rs=1,kn=/^#!(.*)/),kn}o(df,"requireShebangRegex");var Un,os;function ff(){if(os)return Un;os=1;const e=df();return Un=o((t="")=>{const n=t.match(e);if(!n)return null;const[r,i]=n[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return s==="env"?i:i?`${s} ${i}`:s},"shebangCommand"),Un}o(ff,"requireShebangCommand");var jn,is;function hf(){if(is)return jn;is=1;const e=sn,t=ff();function n(r){const s=Buffer.alloc(150);let a;try{a=e.openSync(r,"r"),e.readSync(a,s,0,150,0),e.closeSync(a)}catch{}return t(s.toString())}return o(n,"readShebang"),jn=n,jn}o(hf,"requireReadShebang");var Wn,ss;function Df(){if(ss)return Wn;ss=1;const e=ce,t=cf(),n=lf(),r=hf(),i=process.platform==="win32",s=/\.(?:com|exe)$/i,a=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function u(l){l.file=t(l);const f=l.file&&r(l.file);return f?(l.args.unshift(l.file),l.command=f,t(l)):l.file}o(u,"detectShebang");function c(l){if(!i)return l;const f=u(l),h=!s.test(f);if(l.options.forceShell||h){const D=a.test(f);l.command=e.normalize(l.command),l.command=n.command(l.command),l.args=l.args.map(m=>n.argument(m,D));const p=[l.command].concat(l.args).join(" ");l.args=["/d","/s","/c",`"${p}"`],l.command=process.env.comspec||"cmd.exe",l.options.windowsVerbatimArguments=!0}return l}o(c,"parseNonShell");function d(l,f,h){f&&!Array.isArray(f)&&(h=f,f=null),f=f?f.slice(0):[],h=Object.assign({},h);const D={command:l,args:f,options:h,file:void 0,original:{command:l,args:f}};return h.shell?D:c(D)}return o(d,"parse"),Wn=d,Wn}o(Df,"requireParse");var Gn,as;function pf(){if(as)return Gn;as=1;const e=process.platform==="win32";function t(s,a){return Object.assign(new Error(`${a} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${a} ${s.command}`,path:s.command,spawnargs:s.args})}o(t,"notFoundError");function n(s,a){if(!e)return;const u=s.emit;s.emit=function(c,d){if(c==="exit"){const l=r(d,a);if(l)return u.call(s,"error",l)}return u.apply(s,arguments)}}o(n,"hookChildProcess");function r(s,a){return e&&s===1&&!a.file?t(a.original,"spawn"):null}o(r,"verifyENOENT");function i(s,a){return e&&s===1&&!a.file?t(a.original,"spawnSync"):null}return o(i,"verifyENOENTSync"),Gn={hookChildProcess:n,verifyENOENT:r,verifyENOENTSync:i,notFoundError:t},Gn}o(pf,"requireEnoent");var us;function mf(){if(us)return we.exports;us=1;const e=Lc,t=Df(),n=pf();function r(s,a,u){const c=t(s,a,u),d=e.spawn(c.command,c.args,c.options);return n.hookChildProcess(d,c),d}o(r,"spawn");function i(s,a,u){const c=t(s,a,u),d=e.spawnSync(c.command,c.args,c.options);return d.error=d.error||n.verifyENOENTSync(d.status,c),d}return o(i,"spawnSync"),we.exports=r,we.exports.spawn=r,we.exports.sync=i,we.exports._parse=t,we.exports._enoent=n,we.exports}o(mf,"requireCrossSpawn");var gf=mf(),Ff=Yi(gf);function cs(e={}){const{env:t=process.env,platform:n=process.platform}=e;return n!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}o(cs,"pathKey"),Bo(Bc);function zn(e){return e instanceof URL?So(e):e}o(zn,"toPath");function wf(e){return{*[Symbol.iterator](){let t=K.resolve(zn(e)),n;for(;n!==t;)yield t,n=t,t=K.resolve(t,"..")}}}o(wf,"traversePathUp");const yf=o(({cwd:e=O.cwd(),path:t=O.env[cs()],preferLocal:n=!0,execPath:r=O.execPath,addExecPath:i=!0}={})=>{const s=K.resolve(zn(e)),a=[],u=t.split(K.delimiter);return n&&Ef(a,u,s),i&&bf(a,u,r,s),t===""||t===K.delimiter?`${a.join(K.delimiter)}${t}`:[...a,t].join(K.delimiter)},"npmRunPath"),Ef=o((e,t,n)=>{for(const r of wf(n)){const i=K.join(r,"node_modules/.bin");t.includes(i)||e.push(i)}},"applyPreferLocal"),bf=o((e,t,n,r)=>{const i=K.resolve(r,zn(n),"..");t.includes(i)||e.push(i)},"applyExecPath"),Cf=o(({env:e=O.env,...t}={})=>{e={...e};const n=cs({env:e});return t.path=e[n],e[n]=yf(t),e},"npmRunPathEnv"),Sf=o((e,t,n)=>{const r=n?Je:Ze,i=e instanceof ye?{}:{cause:e};return new r(t,i)},"getFinalError"),co=class co extends Error{};o(co,"DiscardedError");let ye=co;const ls=o((e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,ds,{value:!0,writable:!1,enumerable:!1,configurable:!1})},"setErrorName"),vf=o(e=>Vn(e)&&ds in e,"isExecaError"),ds=Symbol("isExecaError"),Vn=o(e=>Object.prototype.toString.call(e)==="[object Error]","isErrorInstance"),lo=class lo extends Error{};o(lo,"ExecaError");let Ze=lo;ls(Ze,Ze.name);const fo=class fo extends Error{};o(fo,"ExecaSyncError");let Je=fo;ls(Je,Je.name);const Af=o(()=>{const e=hs-fs+1;return Array.from({length:e},$f)},"getRealtimeSignals"),$f=o((e,t)=>({name:`SIGRT${t+1}`,number:fs+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),"getRealtimeSignal"),fs=34,hs=64,Bf=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],Ds=o(()=>{const e=Af();return[...Bf,...e].map(Tf)},"getSignals"),Tf=o(({name:e,number:t,description:n,action:r,forced:i=!1,standard:s})=>{const{signals:{[e]:a}}=me,u=a!==void 0;return{name:e,number:u?a:t,description:n,supported:u,action:r,forced:i,standard:s}},"normalizeSignal$1"),If=o(()=>{const e=Ds();return Object.fromEntries(e.map(Of))},"getSignalsByName"),Of=o(({name:e,number:t,description:n,supported:r,action:i,forced:s,standard:a})=>[e,{name:e,number:t,description:n,supported:r,action:i,forced:s,standard:a}],"getSignalByName"),Rf=If(),xf=o(()=>{const e=Ds(),t=hs+1,n=Array.from({length:t},(r,i)=>Mf(i,e));return Object.assign({},...n)},"getSignalsByNumber"),Mf=o((e,t)=>{const n=_f(e,t);if(n===void 0)return{};const{name:r,description:i,supported:s,action:a,forced:u,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:s,action:a,forced:u,standard:c}}},"getSignalByNumber"),_f=o((e,t)=>{const n=t.find(({name:r})=>me.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},"findSignalByNumber");xf();const Pf=o(e=>{const t="option `killSignal`";if(e===0)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return ps(e,t)},"normalizeKillSignal"),Lf=o(e=>e===0?e:ps(e,"`subprocess.kill()`'s argument"),"normalizeSignalArgument"),ps=o((e,t)=>{if(Number.isInteger(e))return Nf(e,t);if(typeof e=="string")return Uf(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
32
+ ${Hn()}`)},"normalizeSignal"),Nf=o((e,t)=>{if(ms.has(e))return ms.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.
33
+ ${Hn()}`)},"normalizeSignalInteger"),kf=o(()=>new Map(Object.entries(me.signals).reverse().map(([e,t])=>[t,e])),"getSignalsIntegerToName"),ms=kf(),Uf=o((e,t)=>{if(e in me.signals)return e;throw e.toUpperCase()in me.signals?new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):new TypeError(`Invalid ${t} '${e}': this signal name does not exist.
34
+ ${Hn()}`)},"normalizeSignalName"),Hn=o(()=>`Available signal names: ${jf()}.
35
+ Available signal numbers: ${Wf()}.`,"getAvailableSignals"),jf=o(()=>Object.keys(me.signals).sort().map(e=>`'${e}'`).join(", "),"getAvailableSignalNames"),Wf=o(()=>[...new Set(Object.values(me.signals).sort((e,t)=>e-t))].join(", "),"getAvailableSignalIntegers"),gs=o(e=>Rf[e].description,"getSignalDescription"),Gf=o(e=>{if(e===!1)return e;if(e===!0)return zf;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},"normalizeForceKillAfterDelay"),zf=1e3*5,Vf=o(({kill:e,options:{forceKillAfterDelay:t,killSignal:n},onInternalError:r,context:i,controller:s},a,u)=>{const{signal:c,error:d}=Hf(a,u,n);Kf(d,r);const l=e(c);return qf({kill:e,signal:c,forceKillAfterDelay:t,killSignal:n,killResult:l,context:i,controller:s}),l},"subprocessKill"),Hf=o((e,t,n)=>{const[r=n,i]=Vn(e)?[void 0,e]:[e,t];if(typeof r!="string"&&!Number.isInteger(r))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(r)}`);if(i!==void 0&&!Vn(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:Lf(r),error:i}},"parseKillArguments"),Kf=o((e,t)=>{e!==void 0&&t.reject(e)},"emitKillError"),qf=o(async({kill:e,signal:t,forceKillAfterDelay:n,killSignal:r,killResult:i,context:s,controller:a})=>{t===r&&i&&Fs({kill:e,forceKillAfterDelay:n,context:s,controllerSignal:a.signal})},"setKillTimeout"),Fs=o(async({kill:e,forceKillAfterDelay:t,context:n,controllerSignal:r})=>{if(t!==!1)try{await xo(t,void 0,{signal:r}),e("SIGKILL")&&(n.isForcefullyTerminated??(n.isForcefullyTerminated=!0))}catch{}},"killOnTimeout"),ws=o(async(e,t)=>{e.aborted||await z(e,"abort",{signal:t})},"onAbortedSignal"),Yf=o(({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},"validateCancelSignal"),Zf=o(({subprocess:e,cancelSignal:t,gracefulCancel:n,context:r,controller:i})=>t===void 0||n?[]:[Jf(e,t,r,i)],"throwOnCancel"),Jf=o(async(e,t,n,{signal:r})=>{throw await ws(t,r),n.terminationReason??(n.terminationReason="cancel"),e.kill(),t.reason},"terminateOnCancel"),Kn=o(({methodName:e,isSubprocess:t,ipc:n,isConnected:r})=>{Xf(e,t,n),ys(e,t,r)},"validateIpcMethod"),Xf=o((e,t,n)=>{if(!n)throw new Error(`${X(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},"validateIpcOption"),ys=o((e,t,n)=>{if(!n)throw new Error(`${X(e,t)} cannot be used: the ${fe(t)} has already exited or disconnected.`)},"validateConnection"),Qf=o(e=>{throw new Error(`${X("getOneMessage",e)} could not complete: the ${fe(e)} exited or disconnected.`)},"throwOnEarlyDisconnect"),eh=o(e=>{throw new Error(`${X("sendMessage",e)} failed: the ${fe(e)} is sending a message too, instead of listening to incoming messages.
36
+ This can be fixed by both sending a message and listening to incoming messages at the same time:
37
+
38
+ const [receivedMessage] = await Promise.all([
39
+ ${X("getOneMessage",e)},
40
+ ${X("sendMessage",e,"message, {strict: true}")},
41
+ ]);`)},"throwOnStrictDeadlockError"),Es=o((e,t)=>new Error(`${X("sendMessage",t)} failed when sending an acknowledgment response to the ${fe(t)}.`,{cause:e}),"getStrictResponseError"),th=o(e=>{throw new Error(`${X("sendMessage",e)} failed: the ${fe(e)} is not listening to incoming messages.`)},"throwOnMissingStrict"),nh=o(e=>{throw new Error(`${X("sendMessage",e)} failed: the ${fe(e)} exited without listening to incoming messages.`)},"throwOnStrictDisconnect"),rh=o(()=>new Error(`\`cancelSignal\` aborted: the ${fe(!0)} disconnected.`),"getAbortDisconnectError"),oh=o(()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},"throwOnMissingParent"),ih=o(({error:e,methodName:t,isSubprocess:n})=>{if(e.code==="EPIPE")throw new Error(`${X(t,n)} cannot be used: the ${fe(n)} is disconnecting.`,{cause:e})},"handleEpipeError"),sh=o(({error:e,methodName:t,isSubprocess:n,message:r})=>{if(ah(e))throw new Error(`${X(t,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:e})},"handleSerializationError"),ah=o(({code:e,message:t})=>uh.has(e)||ch.some(n=>t.includes(n)),"isSerializationError"),uh=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),ch=["could not be cloned","circular structure","call stack size exceeded"],X=o((e,t,n="")=>e==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${lh(t)}${e}(${n})`,"getMethodName"),lh=o(e=>e?"":"subprocess.","getNamespaceName"),fe=o(e=>e?"parent process":"subprocess","getOtherProcessName"),qn=o(e=>{e.connected&&e.disconnect()},"disconnect"),Xe=o(()=>{const e={},t=new Promise((n,r)=>{Object.assign(e,{resolve:n,reject:r})});return Object.assign(t,e)},"createDeferred"),bs=o((e,t="stdin")=>{const{options:r,fileDescriptors:i}=Ee.get(e),s=Cs(i,t,!0),a=e.stdio[s];if(a===null)throw new TypeError(Ss(s,t,r,!0));return a},"getToStream"),Yn=o((e,t="stdout")=>{const{options:r,fileDescriptors:i}=Ee.get(e),s=Cs(i,t,!1),a=s==="all"?e.all:e.stdio[s];if(a==null)throw new TypeError(Ss(s,t,r,!1));return a},"getFromStream"),Ee=new WeakMap,Cs=o((e,t,n)=>{const r=dh(t,n);return fh(r,t,n,e),r},"getFdNumber"),dh=o((e,t)=>{const n=ki(e);if(n!==void 0)return n;const{validOptions:r,defaultValue:i}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Qe(t)}" must not be "${e}".
42
+ It must be ${r} or "fd3", "fd4" (and so on).
43
+ It is optional and defaults to "${i}".`)},"parseFdNumber"),fh=o((e,t,n,r)=>{const i=r[vs(e)];if(i===void 0)throw new TypeError(`"${Qe(n)}" must not be ${t}. That file descriptor does not exist.
44
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!n)throw new TypeError(`"${Qe(n)}" must not be ${t}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&n)throw new TypeError(`"${Qe(n)}" must not be ${t}. It must be a writable stream, not readable.`)},"validateFdNumber"),Ss=o((e,t,n,r)=>{if(e==="all"&&!n.all)return`The "all" option must be true to use "from: 'all'".`;const{optionName:i,optionValue:s}=hh(e,n);return`The "${i}: ${Zn(s)}" option is incompatible with using "${Qe(r)}: ${Zn(t)}".
45
+ Please set this option with "pipe" instead.`},"getInvalidStdioOptionMessage"),hh=o((e,{stdin:t,stdout:n,stderr:r,stdio:i})=>{const s=vs(e);return s===0&&t!==void 0?{optionName:"stdin",optionValue:t}:s===1&&n!==void 0?{optionName:"stdout",optionValue:n}:s===2&&r!==void 0?{optionName:"stderr",optionValue:r}:{optionName:`stdio[${s}]`,optionValue:i[s]}},"getInvalidStdioOption"),vs=o(e=>e==="all"?1:e,"getUsedDescriptor"),Qe=o(e=>e?"to":"from","getOptionName"),Zn=o(e=>typeof e=="string"?`'${e}'`:typeof e=="number"?`${e}`:"Stream","serializeOptionValue"),St=o((e,t,n)=>{const r=e.getMaxListeners();r===0||r===Number.POSITIVE_INFINITY||(e.setMaxListeners(r+t),_o(n,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))},"incrementMaxListeners"),As=o((e,t)=>{t&&Jn(e)},"addReference"),Jn=o(e=>{e.refCounted()},"addReferenceCount"),$s=o((e,t)=>{t&&Xn(e)},"removeReference"),Xn=o(e=>{e.unrefCounted()},"removeReferenceCount"),Dh=o((e,t)=>{t&&(Xn(e),Xn(e))},"undoAddedReferences"),ph=o((e,t)=>{t&&(Jn(e),Jn(e))},"redoAddedReferences"),mh=o(async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r},i)=>{if(Ch(i)||_h(i))return;vt.has(e)||vt.set(e,[]);const s=vt.get(e);if(s.push(i),!(s.length>1))for(;s.length>0;){await Bh(e,r,i),await Mo.yield();const a=await bh({wrappedMessage:s[0],anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r});s.shift(),r.emit("message",a),r.emit("message:done")}},"onMessage"),gh=o(async({anyProcess:e,channel:t,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{Ms();const s=vt.get(e);for(;s?.length>0;)await z(r,"message:done");e.removeListener("message",i),ph(t,n),r.connected=!1,r.emit("disconnect")},"onDisconnect"),vt=new WeakMap,At=o((e,t,n)=>{if($t.has(e))return $t.get(e);const r=new kc;return r.connected=!0,$t.set(e,r),Fh({ipcEmitter:r,anyProcess:e,channel:t,isSubprocess:n}),r},"getIpcEmitter"),$t=new WeakMap,Fh=o(({ipcEmitter:e,anyProcess:t,channel:n,isSubprocess:r})=>{const i=mh.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e});t.on("message",i),t.once("disconnect",gh.bind(void 0,{anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:e,boundOnMessage:i})),Dh(n,r)},"forwardEvents"),Bs=o(e=>{const t=$t.get(e);return t===void 0?e.channel!==null:t.connected},"isConnected"),wh=o(({anyProcess:e,channel:t,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;const s=At(e,t,n),a=Qn(e,s);return{id:yh++,type:Tt,message:r,hasListeners:a}},"handleSendStrict");let yh=0n;const Eh=o((e,t)=>{if(!(t?.type!==Tt||t.hasListeners))for(const{id:n}of e)n!==void 0&&Bt[n].resolve({isDeadlock:!0,hasListeners:!1})},"validateStrictDeadlock"),bh=o(async({wrappedMessage:e,anyProcess:t,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(e?.type!==Tt||!t.connected)return e;const{id:s,message:a}=e,u={id:s,type:Ts,message:Qn(t,i)};try{await Is({anyProcess:t,channel:n,isSubprocess:r,ipc:!0},u)}catch(c){i.emit("strict:error",c)}return a},"handleStrictRequest"),Ch=o(e=>{if(e?.type!==Ts)return!1;const{id:t,message:n}=e;return Bt[t]?.resolve({isDeadlock:!1,hasListeners:n}),!0},"handleStrictResponse"),Sh=o(async(e,t,n)=>{if(e?.type!==Tt)return;const r=Xe();Bt[e.id]=r;const i=new AbortController;try{const{isDeadlock:s,hasListeners:a}=await Promise.race([r,vh(t,n,i)]);s&&eh(n),a||th(n)}finally{i.abort(),delete Bt[e.id]}},"waitForStrictResponse"),Bt={},vh=o(async(e,t,{signal:n})=>{St(e,1,n),await z(e,"disconnect",{signal:n}),nh(t)},"throwOnDisconnect$1"),Tt="execa:ipc:request",Ts="execa:ipc:response",Ah=o((e,t,n)=>{et.has(e)||et.set(e,new Set);const r=et.get(e),i=Xe(),s=n?t.id:void 0,a={onMessageSent:i,id:s};return r.add(a),{outgoingMessages:r,outgoingMessage:a}},"startSendMessage"),$h=o(({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},"endSendMessage"),Bh=o(async(e,t,n)=>{for(;!Qn(e,t)&&et.get(e)?.size>0;){const r=[...et.get(e)];Eh(r,n),await Promise.all(r.map(({onMessageSent:i})=>i))}},"waitForOutgoingMessages"),et=new WeakMap,Qn=o((e,t)=>t.listenerCount("message")>Th(e),"hasMessageListeners"),Th=o(e=>Ee.has(e)&&!qe(Ee.get(e).options.buffer,"ipc")?1:0,"getMinListenerCount"),Is=o(({anyProcess:e,channel:t,isSubprocess:n,ipc:r},i,{strict:s=!1}={})=>{const a="sendMessage";return Kn({methodName:a,isSubprocess:n,ipc:r,isConnected:e.connected}),Ih({anyProcess:e,channel:t,methodName:a,isSubprocess:n,message:i,strict:s})},"sendMessage"),Ih=o(async({anyProcess:e,channel:t,methodName:n,isSubprocess:r,message:i,strict:s})=>{const a=wh({anyProcess:e,channel:t,isSubprocess:r,message:i,strict:s}),u=Ah(e,a,s);try{await Os({anyProcess:e,methodName:n,isSubprocess:r,wrappedMessage:a,message:i})}catch(c){throw qn(e),c}finally{$h(u)}},"sendMessageAsync"),Os=o(async({anyProcess:e,methodName:t,isSubprocess:n,wrappedMessage:r,message:i})=>{const s=Oh(e);try{await Promise.all([Sh(r,e,n),s(r)])}catch(a){throw ih({error:a,methodName:t,isSubprocess:n}),sh({error:a,methodName:t,isSubprocess:n,message:i}),a}},"sendOneMessage"),Oh=o(e=>{if(er.has(e))return er.get(e);const t=Bo(e.send.bind(e));return er.set(e,t),t},"getSendMethod"),er=new WeakMap,Rh=o((e,t)=>{const n="cancelSignal";return ys(n,!1,e.connected),Os({anyProcess:e,methodName:n,isSubprocess:!1,wrappedMessage:{type:xs,message:t},message:t})},"sendAbort"),xh=o(async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>(await Mh({anyProcess:e,channel:t,isSubprocess:n,ipc:r}),tr.signal),"getCancelSignal"),Mh=o(async({anyProcess:e,channel:t,isSubprocess:n,ipc:r})=>{if(!Rs){if(Rs=!0,!r){oh();return}if(t===null){Ms();return}At(e,t,n),await Mo.yield()}},"startIpc");let Rs=!1;const _h=o(e=>e?.type!==xs?!1:(tr.abort(e.message),!0),"handleAbort"),xs="execa:ipc:cancel",Ms=o(()=>{tr.abort(rh())},"abortOnDisconnect"),tr=new AbortController,Ph=o(({gracefulCancel:e,cancelSignal:t,ipc:n,serialization:r})=>{if(e){if(t===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(r==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},"validateGracefulCancel"),Lh=o(({subprocess:e,cancelSignal:t,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:s})=>n?[Nh({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:i,controller:s})]:[],"throwOnGracefulCancel"),Nh=o(async({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{await ws(t,i);const s=kh(t);throw await Rh(e,s),Fs({kill:e.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??(r.terminationReason="gracefulCancel"),t.reason},"sendOnAbort"),kh=o(({reason:e})=>{if(!(e instanceof DOMException))return e;const t=new Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t},"getReason"),Uh=o(({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},"validateTimeout"),jh=o((e,t,n,r)=>t===0||t===void 0?[]:[Wh(e,t,n,r)],"throwOnTimeout"),Wh=o(async(e,t,n,{signal:r})=>{throw await xo(t,void 0,{signal:r}),n.terminationReason??(n.terminationReason="timeout"),e.kill(),new ye},"killAfterTimeout"),Gh=o(({options:e})=>{if(e.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},"mapNode"),zh=o((e,t,{node:n=!1,nodePath:r=_c,nodeOptions:i=Pc.filter(c=>!c.startsWith("--inspect")),cwd:s,execPath:a,...u})=>{if(a!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');const c=Cn(r,'The "nodePath" option'),d=K.resolve(s,c),l={...u,nodePath:d,node:n,cwd:s};if(!n)return[e,t,l];if(K.basename(e,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[d,[...i,e,...t],{ipc:!0,...l,shell:!1}]},"handleNodeOption"),Vh=o(({ipcInput:e,ipc:t,serialization:n})=>{if(e!==void 0){if(!t)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");qh[n](e)}},"validateIpcInputOption"),Hh=o(e=>{try{jc(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:t})}},"validateAdvancedInput"),Kh=o(e=>{try{JSON.stringify(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:t})}},"validateJsonInput"),qh={advanced:Hh,json:Kh},Yh=o(async(e,t)=>{t!==void 0&&await e.sendMessage(t)},"sendIpcInput"),Zh=o(({encoding:e})=>{if(nr.has(e))return;const t=Xh(e);if(t!==void 0)throw new TypeError(`Invalid option \`encoding: ${It(e)}\`.
46
+ Please rename it to ${It(t)}.`);const n=[...nr].map(r=>It(r)).join(", ");throw new TypeError(`Invalid option \`encoding: ${It(e)}\`.
47
+ Please rename it to one of: ${n}.`)},"validateEncoding"),Jh=new Set(["utf8","utf16le"]),be=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),nr=new Set([...Jh,...be]),Xh=o(e=>{if(e===null)return"buffer";if(typeof e!="string")return;const t=e.toLowerCase();if(t in _s)return _s[t];if(nr.has(t))return t},"getCorrectEncoding"),_s={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},It=o(e=>typeof e=="string"?`"${e}"`:String(e),"serializeEncoding"),Qh=o((e=Ps())=>{const t=Cn(e,'The "cwd" option');return K.resolve(t)},"normalizeCwd"),Ps=o(()=>{try{return O.cwd()}catch(e){throw e.message=`The current directory does not exist.
48
+ ${e.message}`,e}},"getDefaultCwd"),eD=o((e,t)=>{if(t===Ps())return e;let n;try{n=Wc(t)}catch(r){return`The "cwd" option is invalid: ${t}.
49
+ ${r.message}
50
+ ${e}`}return n.isDirectory()?e:`The "cwd" option is not a directory: ${t}.
51
+ ${e}`},"fixCwdError"),Ls=o((e,t,n)=>{n.cwd=Qh(n.cwd);const[r,i,s]=zh(e,t,n),{command:a,args:u,options:c}=Ff._parse(r,i,s),d=ld(c),l=tD(d);return Uh(l),Zh(l),Vh(l),Yf(l),Ph(l),l.shell=$i(l.shell),l.env=nD(l),l.killSignal=Pf(l.killSignal),l.forceKillAfterDelay=Gf(l.forceKillAfterDelay),l.lines=l.lines.map((f,h)=>f&&!be.has(l.encoding)&&l.buffer[h]),O.platform==="win32"&&K.basename(a,".exe")==="cmd"&&u.unshift("/q"),{file:a,commandArguments:u,options:l}},"normalizeOptions"),tD=o(({extendEnv:e=!0,preferLocal:t=!1,cwd:n,localDir:r=n,encoding:i="utf8",reject:s=!0,cleanup:a=!0,all:u=!1,windowsHide:c=!0,killSignal:d="SIGTERM",forceKillAfterDelay:l=!0,gracefulCancel:f=!1,ipcInput:h,ipc:D=h!==void 0||f,serialization:p="advanced",...m})=>({...m,extendEnv:e,preferLocal:t,cwd:n,localDirectory:r,encoding:i,reject:s,cleanup:a,all:u,windowsHide:c,killSignal:d,forceKillAfterDelay:l,gracefulCancel:f,ipcInput:h,ipc:D,serialization:p}),"addDefaultOptions"),nD=o(({env:e,extendEnv:t,preferLocal:n,node:r,localDirectory:i,nodePath:s})=>{const a=t?{...O.env,...e}:e;return n||r?Cf({env:a,cwd:i,execPath:s,preferLocal:n,addExecPath:r}):a},"getEnv"),Ns=o((e,t,n)=>n.shell&&t.length>0?[[e,...t].join(" "),[],n]:[e,t,n],"concatenateShell");function rr(e){if(typeof e=="string")return rD(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return oD(e)}o(rr,"stripFinalNewline");const rD=o(e=>e.at(-1)===ks?e.slice(0,e.at(-2)===Us?-2:-1):e,"stripFinalNewlineString"),oD=o(e=>e.at(-1)===iD?e.subarray(0,e.at(-2)===sD?-2:-1):e,"stripFinalNewlineBinary"),ks=`
52
+ `,iD=ks.codePointAt(0),Us="\r",sD=Us.codePointAt(0);function Ce(e,{checkOpen:t=!0}={}){return e!==null&&typeof e=="object"&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe=="function"}o(Ce,"isStream");function js(e,{checkOpen:t=!0}={}){return Ce(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write=="function"&&typeof e.end=="function"&&typeof e.writable=="boolean"&&typeof e.writableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}o(js,"isWritableStream$1");function Ot(e,{checkOpen:t=!0}={}){return Ce(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read=="function"&&typeof e.readable=="boolean"&&typeof e.readableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}o(Ot,"isReadableStream$1");function Ws(e,t){return js(e,t)&&Ot(e,t)}o(Ws,"isDuplexStream");var Gs=o(e=>{throw TypeError(e)},"__typeError$2"),or=o((e,t,n)=>t.has(e)||Gs("Cannot "+n),"__accessCheck$2"),V=o((e,t,n)=>(or(e,t,"read from private field"),n?n.call(e):t.get(e)),"__privateGet$2"),tt=o((e,t,n)=>t.has(e)?Gs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),"__privateAdd$2"),he=o((e,t,n,r)=>(or(e,t,"write to private field"),t.set(e,n),n),"__privateSet$2"),zs=o((e,t,n)=>(or(e,t,"access private method"),n),"__privateMethod$1"),se,Rt,Se,te,xt,Vs,Hs;const aD=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),ho=class ho{constructor(t,n){tt(this,xt),tt(this,se),tt(this,Rt),tt(this,Se,!1),tt(this,te),he(this,se,t),he(this,Rt,n)}next(){const t=o(()=>zs(this,xt,Vs).call(this),"e");return he(this,te,V(this,te)?V(this,te).then(t,t):t()),V(this,te)}return(t){const n=o(()=>zs(this,xt,Hs).call(this,t),"t");return V(this,te)?V(this,te).then(n,n):n()}};o(ho,"c");let ir=ho;se=new WeakMap,Rt=new WeakMap,Se=new WeakMap,te=new WeakMap,xt=new WeakSet,Vs=o(async function(){if(V(this,Se))return{done:!0,value:void 0};let e;try{e=await V(this,se).read()}catch(t){throw he(this,te,void 0),he(this,Se,!0),V(this,se).releaseLock(),t}return e.done&&(he(this,te,void 0),he(this,Se,!0),V(this,se).releaseLock()),e},"s_fn"),Hs=o(async function(e){if(V(this,Se))return{done:!0,value:e};if(he(this,Se,!0),!V(this,Rt)){const t=V(this,se).cancel(e);return V(this,se).releaseLock(),await t,{done:!0,value:e}}return V(this,se).releaseLock(),{done:!0,value:e}},"i_fn");const sr=Symbol();function Ks(){return this[sr].next()}o(Ks,"i"),Object.defineProperty(Ks,"name",{value:"next"});function qs(e){return this[sr].return(e)}o(qs,"o"),Object.defineProperty(qs,"name",{value:"return"});const uD=Object.create(aD,{next:{enumerable:!0,configurable:!0,writable:!0,value:Ks},return:{enumerable:!0,configurable:!0,writable:!0,value:qs}});function cD({preventCancel:e=!1}={}){const t=this.getReader(),n=new ir(t,e),r=Object.create(uD);return r[sr]=n,r}o(cD,"h$1");const lD=o(e=>{if(Ot(e,{checkOpen:!1})&&ar.on!==void 0)return fD(e);if(typeof e?.[Symbol.asyncIterator]=="function")return e;if(dD.call(e)==="[object ReadableStream]")return cD.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},"getAsyncIterable"),{toString:dD}=Object.prototype,fD=o(async function*(e){const t=new AbortController,n={};hD(e,t,n);try{for await(const[r]of ar.on(e,"data",{signal:t.signal}))yield r}catch(r){if(n.error!==void 0)throw n.error;if(!t.signal.aborted)throw r}finally{e.destroy()}},"getStreamIterable"),hD=o(async(e,t,n)=>{try{await ar.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(r){n.error=r}finally{t.abort()}},"handleStreamEnd"),ar={};var DD=Object.defineProperty,pD=o((e,t,n)=>t in e?DD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp$2"),mD=o((e,t,n)=>pD(e,t+"",n),"__publicField$2");const ur=o(async(e,{init:t,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:a,finalize:u},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{const d=lD(e),l=t();l.length=0;try{for await(const f of d){const h=FD(f),D=n[h](f,l);Ys({convertedChunk:D,state:l,getSize:r,truncateChunk:i,addChunk:s,maxBuffer:c})}return gD({state:l,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:a,maxBuffer:c}),u(l)}catch(f){const h=typeof f=="object"&&f!==null?f:new Error(f);throw h.bufferedData=u(l),h}},"getStreamContents$1"),gD=o(({state:e,getSize:t,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:s})=>{const a=i(e);a!==void 0&&Ys({convertedChunk:a,state:e,getSize:t,truncateChunk:n,addChunk:r,maxBuffer:s})},"appendFinalChunk"),Ys=o(({convertedChunk:e,state:t,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:s})=>{const a=n(e),u=t.length+a;if(u<=s){Zs(e,t,i,u);return}const c=r(e,s-t.length);throw c!==void 0&&Zs(c,t,i,s),new Me},"appendChunk"),Zs=o((e,t,n,r)=>{t.contents=n(e,t,r),t.length=r},"addNewChunk"),FD=o(e=>{const t=typeof e;if(t==="string")return"string";if(t!=="object"||e===null)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";const n=Js.call(e);return n==="[object ArrayBuffer]"?"arrayBuffer":n==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Js.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},"getChunkType"),{toString:Js}=Object.prototype,Do=class Do extends Error{constructor(){super("maxBuffer exceeded"),mD(this,"name","MaxBufferError")}};o(Do,"MaxBufferError");let Me=Do;const ve=o(e=>e,"identity"),cr=o(()=>{},"noop$1"),Xs=o(({contents:e})=>e,"getContentsProperty"),Qs=o(e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},"throwObjectStream"),ea=o(e=>e.length,"getLengthProperty");async function wD(e,t){return ur(e,CD,t)}o(wD,"getStreamAsArray");const yD=o(()=>({contents:[]}),"initArray"),ED=o(()=>1,"increment"),bD=o((e,{contents:t})=>(t.push(e),t),"addArrayChunk"),CD={init:yD,convertChunk:{string:ve,buffer:ve,arrayBuffer:ve,dataView:ve,typedArray:ve,others:ve},getSize:ED,truncateChunk:cr,addChunk:bD,getFinalChunk:cr,finalize:Xs};async function SD(e,t){return ur(e,xD,t)}o(SD,"getStreamAsArrayBuffer");const vD=o(()=>({contents:new ArrayBuffer(0)}),"initArrayBuffer"),AD=o(e=>$D.encode(e),"useTextEncoder"),$D=new TextEncoder,ta=o(e=>new Uint8Array(e),"useUint8Array"),na=o(e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),"useUint8ArrayWithOffset"),BD=o((e,t)=>e.slice(0,t),"truncateArrayBufferChunk"),TD=o((e,{contents:t,length:n},r)=>{const i=ia()?OD(t,r):ID(t,r);return new Uint8Array(i).set(e,n),i},"addArrayBufferChunk"),ID=o((e,t)=>{if(t<=e.byteLength)return e;const n=new ArrayBuffer(ra(t));return new Uint8Array(n).set(new Uint8Array(e),0),n},"resizeArrayBufferSlow"),OD=o((e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;const n=new ArrayBuffer(t,{maxByteLength:ra(t)});return new Uint8Array(n).set(new Uint8Array(e),0),n},"resizeArrayBuffer"),ra=o(e=>oa**Math.ceil(Math.log(e)/Math.log(oa)),"getNewContentsLength"),oa=2,RD=o(({contents:e,length:t})=>ia()?e:e.slice(0,t),"finalizeArrayBuffer"),ia=o(()=>"resize"in ArrayBuffer.prototype,"hasArrayBufferResize"),xD={init:vD,convertChunk:{string:AD,buffer:ta,arrayBuffer:ta,dataView:na,typedArray:na,others:Qs},getSize:ea,truncateChunk:BD,addChunk:TD,getFinalChunk:cr,finalize:RD};async function MD(e,t){return ur(e,kD,t)}o(MD,"getStreamAsString");const _D=o(()=>({contents:"",textDecoder:new TextDecoder}),"initString"),Mt=o((e,{textDecoder:t})=>t.decode(e,{stream:!0}),"useTextDecoder"),PD=o((e,{contents:t})=>t+e,"addStringChunk"),LD=o((e,t)=>e.slice(0,t),"truncateStringChunk"),ND=o(({textDecoder:e})=>{const t=e.decode();return t===""?void 0:t},"getFinalStringChunk"),kD={init:_D,convertChunk:{string:ve,buffer:Mt,arrayBuffer:Mt,dataView:Mt,typedArray:Mt,others:Qs},getSize:ea,truncateChunk:LD,addChunk:PD,getFinalChunk:ND,finalize:Xs},UD=o(({error:e,stream:t,readableObjectMode:n,lines:r,encoding:i,fdNumber:s})=>{if(!(e instanceof Me))throw e;if(s==="all")return e;const a=jD(n,r,i);throw e.maxBufferInfo={fdNumber:s,unit:a},t.destroy(),e},"handleMaxBuffer"),jD=o((e,t,n)=>e?"objects":t?"lines":n==="buffer"?"bytes":"characters","getMaxBufferUnit"),WD=o((e,t,n)=>{if(t.length!==n)return;const r=new Me;throw r.maxBufferInfo={fdNumber:"ipc"},r},"checkIpcMaxBuffer"),GD=o((e,t)=>{const{streamName:n,threshold:r,unit:i}=zD(e,t);return`Command's ${n} was larger than ${r} ${i}`},"getMaxBufferMessage"),zD=o((e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:"output",threshold:t[1],unit:"bytes"};const{maxBufferInfo:{fdNumber:n,unit:r}}=e;delete e.maxBufferInfo;const i=qe(t,n);return n==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:Pi(n),threshold:i,unit:r}},"getMaxBufferInfo"),VD=o((e,t,n)=>e?.code==="ENOBUFS"&&t!==null&&t.some(r=>r!==null&&r.length>lr(n)),"isMaxBufferSync"),HD=o((e,t,n)=>{if(!t)return e;const r=lr(n);return e.length>r?e.slice(0,r):e},"truncateMaxBufferSync"),lr=o(([,e])=>e,"getMaxBufferSync"),KD=o(({stdio:e,all:t,ipcOutput:n,originalError:r,signal:i,signalDescription:s,exitCode:a,escapedCommand:u,timedOut:c,isCanceled:d,isGracefullyCanceled:l,isMaxBuffer:f,isForcefullyTerminated:h,forceKillAfterDelay:D,killSignal:p,maxBuffer:m,timeout:g,cwd:F})=>{const w=r?.code,E=qD({originalError:r,timedOut:c,timeout:g,isMaxBuffer:f,maxBuffer:m,errorCode:w,signal:i,signalDescription:s,exitCode:a,isCanceled:d,isGracefullyCanceled:l,isForcefullyTerminated:h,forceKillAfterDelay:D,killSignal:p}),y=ZD(r,F),b=y===void 0?"":`
53
+ ${y}`,S=`${E}: ${u}${b}`,$=t===void 0?[e[2],e[1]]:[t],T=[S,...$,...e.slice(3),n.map(I=>JD(I)).join(`
54
+ `)].map(I=>On(rr(XD(I)))).filter(Boolean).join(`
55
+
56
+ `);return{originalMessage:y,shortMessage:S,message:T}},"createMessages"),qD=o(({originalError:e,timedOut:t,timeout:n,isMaxBuffer:r,maxBuffer:i,errorCode:s,signal:a,signalDescription:u,exitCode:c,isCanceled:d,isGracefullyCanceled:l,isForcefullyTerminated:f,forceKillAfterDelay:h,killSignal:D})=>{const p=YD(f,h);return t?`Command timed out after ${n} milliseconds${p}`:l?a===void 0?`Command was gracefully canceled with exit code ${c}`:f?`Command was gracefully canceled${p}`:`Command was gracefully canceled with ${a} (${u})`:d?`Command was canceled${p}`:r?`${GD(e,i)}${p}`:s!==void 0?`Command failed with ${s}${p}`:f?`Command was killed with ${D} (${gs(D)})${p}`:a!==void 0?`Command was killed with ${a} (${u})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},"getErrorPrefix"),YD=o((e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"","getForcefulSuffix"),ZD=o((e,t)=>{if(e instanceof ye)return;const n=vf(e)?e.originalMessage:String(e?.message??e),r=On(eD(n,t));return r===""?void 0:r},"getOriginalMessage"),JD=o(e=>typeof e=="string"?e:$o(e),"serializeIpcMessage"),XD=o(e=>Array.isArray(e)?e.map(t=>rr(sa(t))).filter(Boolean).join(`
57
+ `):sa(e),"serializeMessagePart"),sa=o(e=>typeof e=="string"?e:J(e)?Oi(e):"","serializeMessageItem"),aa=o(({command:e,escapedCommand:t,stdio:n,all:r,ipcOutput:i,options:{cwd:s},startTime:a})=>ua({command:e,escapedCommand:t,cwd:s,durationMs:Ki(a),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:n[1],stderr:n[2],all:r,stdio:n,ipcOutput:i,pipedFrom:[]}),"makeSuccessResult"),dr=o(({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:a})=>fr({error:e,command:t,escapedCommand:n,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:i,isSync:a}),"makeEarlyError"),fr=o(({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:u,isForcefullyTerminated:c,exitCode:d,signal:l,stdio:f,all:h,ipcOutput:D,options:{timeoutDuration:p,timeout:m=p,forceKillAfterDelay:g,killSignal:F,cwd:w,maxBuffer:E},isSync:y})=>{const{exitCode:b,signal:S,signalDescription:$}=ep(d,l),{originalMessage:T,shortMessage:I,message:G}=KD({stdio:f,all:h,ipcOutput:D,originalError:e,signal:S,signalDescription:$,exitCode:b,escapedCommand:n,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:u,isForcefullyTerminated:c,forceKillAfterDelay:g,killSignal:F,maxBuffer:E,timeout:m,cwd:w}),P=Sf(e,G,y);return Object.assign(P,QD({error:P,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:u,isForcefullyTerminated:c,exitCode:b,signal:S,signalDescription:$,stdio:f,all:h,ipcOutput:D,cwd:w,originalMessage:T,shortMessage:I})),P},"makeError"),QD=o(({error:e,command:t,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:u,isForcefullyTerminated:c,exitCode:d,signal:l,signalDescription:f,stdio:h,all:D,ipcOutput:p,cwd:m,originalMessage:g,shortMessage:F})=>ua({shortMessage:F,originalMessage:g,command:t,escapedCommand:n,cwd:m,durationMs:Ki(r),failed:!0,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isTerminated:l!==void 0,isMaxBuffer:u,isForcefullyTerminated:c,exitCode:d,signal:l,signalDescription:f,code:e.cause?.code,stdout:h[1],stderr:h[2],all:D,stdio:h,ipcOutput:p,pipedFrom:[]}),"getErrorProperties"),ua=o(e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),"omitUndefinedProperties"),ep=o((e,t)=>{const n=e===null?void 0:e,r=t===null?void 0:t,i=r===void 0?void 0:gs(t);return{exitCode:n,signal:r,signalDescription:i}},"normalizeExitPayload"),ca=o(e=>Number.isFinite(e)?e:0,"toZeroIfInfinity");function tp(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(ca(e*1e3)%1e3),nanoseconds:Math.trunc(ca(e*1e6)%1e3)}}o(tp,"parseNumber");function np(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}o(np,"parseBigint");function rp(e){switch(typeof e){case"number":{if(Number.isFinite(e))return tp(e);break}case"bigint":return np(e)}throw new TypeError("Expected a finite number or bigint")}o(rp,"parseMilliseconds");const op=o(e=>e===0||e===0n,"isZero"),ip=o((e,t)=>t===1||t===1n?e:`${e}s`,"pluralize"),sp=1e-7,ap=24n*60n*60n*1000n;function up(e,t){const n=typeof e=="bigint";if(!n&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");t={...t};const r=e<0?"-":"";e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let i=[];const s=o((l,f)=>{const h=Math.floor(l*10**f+sp);return(Math.round(h)/10**f).toFixed(f)},"floorDecimals"),a=o((l,f,h,D)=>{if(!((i.length===0||!t.colonNotation)&&op(l)&&!(t.colonNotation&&h==="m"))){if(D??(D=String(l)),t.colonNotation){const p=D.includes(".")?D.split(".")[0].length:D.length,m=i.length>0?2:1;D="0".repeat(Math.max(0,m-p))+D}else D+=t.verbose?" "+ip(f,l):h;i.push(D)}},"add"),u=rp(e),c=BigInt(u.days);if(t.hideYearAndDays?a(BigInt(c)*24n+BigInt(u.hours),"hour","h"):(t.hideYear?a(c,"day","d"):(a(c/365n,"year","y"),a(c%365n,"day","d")),a(Number(u.hours),"hour","h")),a(Number(u.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){const l=Number(u.seconds),f=Number(u.milliseconds),h=Number(u.microseconds),D=Number(u.nanoseconds);if(a(l,"second","s"),t.formatSubMilliseconds)a(f,"millisecond","ms"),a(h,"microsecond","\xB5s"),a(D,"nanosecond","ns");else{const p=f+h/1e3+D/1e6,m=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,g=p>=1?Math.round(p):Math.ceil(p),F=m?p.toFixed(m):g;a(Number.parseFloat(F),"millisecond","ms",F)}}else{const l=(n?Number(e%ap):e)/1e3%60,f=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,h=s(l,f),D=t.keepDecimalsOnWholeSeconds?h:h.replace(/\.0+$/,"");a(Number.parseFloat(D),"second","s",D)}if(i.length===0)return r+"0"+(t.verbose?" milliseconds":"ms");const d=t.colonNotation?":":" ";return typeof t.unitCount=="number"&&(i=i.slice(0,Math.max(t.unitCount,1))),r+i.join(d)}o(up,"prettyMilliseconds");const cp=o((e,t)=>{e.failed&&Ye({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})},"logError"),lp=o((e,t)=>{An(t)&&(cp(e,t),dp(e,t))},"logResult"),dp=o((e,t)=>{const n=`(done in ${up(e.durationMs)})`;Ye({type:"duration",verboseMessage:n,verboseInfo:t,result:e})},"logDuration"),hr=o((e,t,{reject:n})=>{if(lp(e,t),e.failed&&n)throw e;return e},"handleResult"),fp=o((e,t)=>_e(e)?"asyncGenerator":Da(e)?"generator":pr(e)?"fileUrl":Fp(e)?"filePath":bp(e)?"webStream":Ce(e,{checkOpen:!1})?"native":J(e)?"uint8Array":Cp(e)?"asyncIterable":Sp(e)?"iterable":gr(e)?la({},t):mp(e)?hp(e,t):"native","getStdioItemType"),hp=o((e,t)=>Ws(e.transform,{checkOpen:!1})?Dp(e,t):gr(e.transform)?la(e,t):pp(e,t),"getTransformObjectType"),Dp=o((e,t)=>(da(e,t,"Duplex stream"),"duplex"),"getDuplexType"),la=o((e,t)=>(da(e,t,"web TransformStream"),"webTransform"),"getTransformStreamType"),da=o(({final:e,binary:t,objectMode:n},r,i)=>{fa(e,`${r}.final`,i),fa(t,`${r}.binary`,i),Dr(n,`${r}.objectMode`)},"validateNonGeneratorType"),fa=o((e,t,n)=>{if(e!==void 0)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${n}.`)},"checkUndefinedOption"),pp=o(({transform:e,final:t,binary:n,objectMode:r},i)=>{if(e!==void 0&&!ha(e))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Ws(t,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(gr(t))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!ha(t))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return Dr(n,`${i}.binary`),Dr(r,`${i}.objectMode`),_e(e)||_e(t)?"asyncGenerator":"generator"},"getGeneratorObjectType"),Dr=o((e,t)=>{if(e!==void 0&&typeof e!="boolean")throw new TypeError(`The \`${t}\` option must use a boolean.`)},"checkBooleanOption"),ha=o(e=>_e(e)||Da(e),"isGenerator"),_e=o(e=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]","isAsyncGenerator"),Da=o(e=>Object.prototype.toString.call(e)==="[object GeneratorFunction]","isSyncGenerator"),mp=o(e=>Y(e)&&(e.transform!==void 0||e.final!==void 0),"isTransformOptions"),pr=o(e=>Object.prototype.toString.call(e)==="[object URL]","isUrl"),gp=o(e=>pr(e)&&e.protocol!=="file:","isRegularUrl"),Fp=o(e=>Y(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>wp.has(t))&&pa(e.file),"isFilePathObject"),wp=new Set(["file","append"]),pa=o(e=>typeof e=="string","isFilePathString"),yp=o((e,t)=>e==="native"&&typeof t=="string"&&!Ep.has(t),"isUnknownStdioString"),Ep=new Set(["ipc","ignore","inherit","overlapped","pipe"]),ma=o(e=>Object.prototype.toString.call(e)==="[object ReadableStream]","isReadableStream"),mr=o(e=>Object.prototype.toString.call(e)==="[object WritableStream]","isWritableStream"),bp=o(e=>ma(e)||mr(e),"isWebStream"),gr=o(e=>ma(e?.readable)&&mr(e?.writable),"isTransformStream"),Cp=o(e=>ga(e)&&typeof e[Symbol.asyncIterator]=="function","isAsyncIterableObject"),Sp=o(e=>ga(e)&&typeof e[Symbol.iterator]=="function","isIterableObject"),ga=o(e=>typeof e=="object"&&e!==null,"isObject"),Ae=new Set(["generator","asyncGenerator","duplex","webTransform"]),Fa=new Set(["fileUrl","filePath","fileNumber"]),wa=new Set(["fileUrl","filePath"]),vp=new Set([...wa,"webStream","nodeStream"]),Ap=new Set(["webTransform","duplex"]),_t={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"},ya=o((e,t,n,r)=>r==="output"?$p(e,t,n):Bp(e,t,n),"getTransformObjectModes"),$p=o((e,t,n)=>{const r=t!==0&&n[t-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:e??r}},"getOutputObjectModes"),Bp=o((e,t,n)=>{const r=t===0?e===!0:n[t-1].value.readableObjectMode,i=t!==n.length-1&&(e??r);return{writableObjectMode:r,readableObjectMode:i}},"getInputObjectModes"),Tp=o((e,t)=>{const n=e.findLast(({type:r})=>Ae.has(r));return n===void 0?!1:t==="input"?n.value.writableObjectMode:n.value.readableObjectMode},"getFdObjectMode"),Ip=o((e,t,n,r)=>[...e.filter(({type:i})=>!Ae.has(i)),...Op(e,t,n,r)],"normalizeTransforms"),Op=o((e,t,n,{encoding:r})=>{const i=e.filter(({type:a})=>Ae.has(a)),s=Array.from({length:i.length});for(const[a,u]of Object.entries(i))s[a]=Rp({stdioItem:u,index:Number(a),newTransforms:s,optionName:t,direction:n,encoding:r});return Pp(s,n)},"getTransforms"),Rp=o(({stdioItem:e,stdioItem:{type:t},index:n,newTransforms:r,optionName:i,direction:s,encoding:a})=>t==="duplex"?xp({stdioItem:e,optionName:i}):t==="webTransform"?Mp({stdioItem:e,index:n,newTransforms:r,direction:s}):_p({stdioItem:e,index:n,newTransforms:r,direction:s,encoding:a}),"normalizeTransform"),xp=o(({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:n,readableObjectMode:r},objectMode:i=r}},optionName:s})=>{if(i&&!r)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&r)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:n,readableObjectMode:r}}},"normalizeDuplex"),Mp=o(({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i})=>{const{transform:s,objectMode:a}=Y(t)?t:{transform:t},{writableObjectMode:u,readableObjectMode:c}=ya(a,n,r,i);return{...e,value:{transform:s,writableObjectMode:u,readableObjectMode:c}}},"normalizeTransformStream"),_p=o(({stdioItem:e,stdioItem:{value:t},index:n,newTransforms:r,direction:i,encoding:s})=>{const{transform:a,final:u,binary:c=!1,preserveNewlines:d=!1,objectMode:l}=Y(t)?t:{transform:t},f=c||be.has(s),{writableObjectMode:h,readableObjectMode:D}=ya(l,n,r,i);return{...e,value:{transform:a,final:u,binary:f,preserveNewlines:d,writableObjectMode:h,readableObjectMode:D}}},"normalizeGenerator"),Pp=o((e,t)=>t==="input"?e.reverse():e,"sortTransforms"),Lp=o((e,t,n)=>{const r=e.map(i=>Np(i,t));if(r.includes("input")&&r.includes("output"))throw new TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??jp},"getStreamDirection"),Np=o(({type:e,value:t},n)=>kp[n]??Ea[e](t),"getStdioItemDirection"),kp=["input","output","output"],Pe=o(()=>{},"anyDirection"),Fr=o(()=>"input","alwaysInput"),Ea={generator:Pe,asyncGenerator:Pe,fileUrl:Pe,filePath:Pe,iterable:Fr,asyncIterable:Fr,uint8Array:Fr,webStream:o(e=>mr(e)?"output":"input","webStream"),nodeStream(e){return Ot(e,{checkOpen:!1})?js(e,{checkOpen:!1})?void 0:"input":"output"},webTransform:Pe,duplex:Pe,native(e){const t=Up(e);if(t!==void 0)return t;if(Ce(e,{checkOpen:!1}))return Ea.nodeStream(e)}},Up=o(e=>{if([0,O.stdin].includes(e))return"input";if([1,2,O.stdout,O.stderr].includes(e))return"output"},"getStandardStreamDirection"),jp="output",Wp=o((e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e,"normalizeIpcStdioArray"),Gp=o(({stdio:e,ipc:t,buffer:n,...r},i,s)=>{const a=zp(e,r).map((u,c)=>ba(u,c));return s?Hp(a,n,i):Wp(a,t)},"normalizeStdioOption"),zp=o((e,t)=>{if(e===void 0)return ee.map(r=>t[r]);if(Vp(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${ee.map(r=>`\`${r}\``).join(", ")}`);if(typeof e=="string")return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);const n=Math.max(e.length,ee.length);return Array.from({length:n},(r,i)=>e[i])},"getStdioArray"),Vp=o(e=>ee.some(t=>e[t]!==void 0),"hasAlias"),ba=o((e,t)=>Array.isArray(e)?e.map(n=>ba(n,t)):e??(t>=ee.length?"ignore":"pipe"),"addDefaultValue"),Hp=o((e,t,n)=>e.map((r,i)=>!t[i]&&i!==0&&!$n(n,i)&&Kp(r)?"ignore":r),"normalizeStdioSync"),Kp=o(e=>e==="pipe"||Array.isArray(e)&&e.every(t=>t==="pipe"),"isOutputPipeOnly"),qp=o(({stdioItem:e,stdioItem:{type:t},isStdioArray:n,fdNumber:r,direction:i,isSync:s})=>!n||t!=="native"?e:s?Yp({stdioItem:e,fdNumber:r,direction:i}):Xp({stdioItem:e,fdNumber:r}),"handleNativeStream"),Yp=o(({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r,direction:i})=>{const s=Zp({value:t,optionName:n,fdNumber:r,direction:i});if(s!==void 0)return s;if(Ce(t,{checkOpen:!1}))throw new TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},"handleNativeStreamSync"),Zp=o(({value:e,optionName:t,fdNumber:n,direction:r})=>{const i=Jp(e,n);if(i!==void 0){if(r==="output")return{type:"fileNumber",value:i,optionName:t};if(Oo.isatty(i))throw new TypeError(`The \`${t}: ${Zn(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Ke(an(i)),optionName:t}}},"getTargetFd"),Jp=o((e,t)=>{if(e==="inherit")return t;if(typeof e=="number")return e;const n=vn.indexOf(e);if(n!==-1)return n},"getTargetFdNumber"),Xp=o(({stdioItem:e,stdioItem:{value:t,optionName:n},fdNumber:r})=>t==="inherit"?{type:"nodeStream",value:Ca(r,t,n),optionName:n}:typeof t=="number"?{type:"nodeStream",value:Ca(t,t,n),optionName:n}:Ce(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:n}:e,"handleNativeStreamAsync"),Ca=o((e,t,n)=>{const r=vn[e];if(r===void 0)throw new TypeError(`The \`${n}: ${t}\` option is invalid: no such standard stream.`);return r},"getStandardStream"),Qp=o(({input:e,inputFile:t},n)=>n===0?[...em(e),...nm(t)]:[],"handleInputOptions"),em=o(e=>e===void 0?[]:[{type:tm(e),value:e,optionName:"input"}],"handleInputOption"),tm=o(e=>{if(Ot(e,{checkOpen:!1}))return"nodeStream";if(typeof e=="string")return"string";if(J(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},"getInputType"),nm=o(e=>e===void 0?[]:[{...rm(e),optionName:"inputFile"}],"handleInputFileOption"),rm=o(e=>{if(pr(e))return{type:"fileUrl",value:e};if(pa(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},"getInputFileType"),om=o(e=>e.filter((t,n)=>e.every((r,i)=>t.value!==r.value||n>=i||t.type==="generator"||t.type==="asyncGenerator")),"filterDuplicates"),im=o(({stdioItem:{type:e,value:t,optionName:n},direction:r,fileDescriptors:i,isSync:s})=>{const a=sm(i,e);if(a.length!==0){if(s){am({otherStdioItems:a,type:e,value:t,optionName:n,direction:r});return}if(vp.has(e))return Sa({otherStdioItems:a,type:e,value:t,optionName:n,direction:r});Ap.has(e)&&cm({otherStdioItems:a,type:e,value:t,optionName:n})}},"getDuplicateStream"),sm=o((e,t)=>e.flatMap(({direction:n,stdioItems:r})=>r.filter(i=>i.type===t).map((i=>({...i,direction:n})))),"getOtherStdioItems"),am=o(({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{wa.has(t)&&Sa({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})},"validateDuplicateStreamSync"),Sa=o(({otherStdioItems:e,type:t,value:n,optionName:r,direction:i})=>{const s=e.filter(u=>um(u,n));if(s.length===0)return;const a=s.find(u=>u.direction!==i);return va(a,r,t),i==="output"?s[0].stream:void 0},"getDuplicateStreamInstance"),um=o(({type:e,value:t},n)=>e==="filePath"?t.file===n.file:e==="fileUrl"?t.href===n.href:t===n,"hasSameValue"),cm=o(({otherStdioItems:e,type:t,value:n,optionName:r})=>{const i=e.find(({value:{transform:s}})=>s===n.transform);va(i,r,t)},"validateDuplicateTransform"),va=o((e,t,n)=>{if(e!==void 0)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${_t[n]} that is the same.`)},"throwOnDuplicateStream"),Aa=o((e,t,n,r)=>{const s=Gp(t,n,r).map((u,c)=>lm({stdioOption:u,fdNumber:c,options:t,isSync:r})),a=Fm({initialFileDescriptors:s,addProperties:e,options:t,isSync:r});return t.stdio=a.map(({stdioItems:u})=>Em(u)),a},"handleStdio"),lm=o(({stdioOption:e,fdNumber:t,options:n,isSync:r})=>{const i=Pi(t),{stdioItems:s,isStdioArray:a}=dm({stdioOption:e,fdNumber:t,options:n,optionName:i}),u=Lp(s,t,i),c=s.map(f=>qp({stdioItem:f,isStdioArray:a,fdNumber:t,direction:u,isSync:r})),d=Ip(c,i,u,n),l=Tp(d,u);return gm(d,l),{direction:u,objectMode:l,stdioItems:d}},"getFileDescriptor"),dm=o(({stdioOption:e,fdNumber:t,options:n,optionName:r})=>{const s=[...(Array.isArray(e)?e:[e]).map(c=>fm(c,r)),...Qp(n,t)],a=om(s),u=a.length>1;return hm(a,u,r),pm(a),{stdioItems:a,isStdioArray:u}},"initializeStdioItems"),fm=o((e,t)=>({type:fp(e,t),value:e,optionName:t}),"initializeStdioItem"),hm=o((e,t,n)=>{if(e.length===0)throw new TypeError(`The \`${n}\` option must not be an empty array.`);if(t){for(const{value:r,optionName:i}of e)if(Dm.has(r))throw new Error(`The \`${i}\` option must not include \`${r}\`.`)}},"validateStdioArray"),Dm=new Set(["ignore","ipc"]),pm=o(e=>{for(const t of e)mm(t)},"validateStreams"),mm=o(({type:e,value:t,optionName:n})=>{if(gp(t))throw new TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
58
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(yp(e,t))throw new TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},"validateFileStdio"),gm=o((e,t)=>{if(!t)return;const n=e.find(({type:r})=>Fa.has(r));if(n!==void 0)throw new TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},"validateFileObjectMode"),Fm=o(({initialFileDescriptors:e,addProperties:t,options:n,isSync:r})=>{const i=[];try{for(const s of e)i.push(wm({fileDescriptor:s,fileDescriptors:i,addProperties:t,options:n,isSync:r}));return i}catch(s){throw $a(i),s}},"getFinalFileDescriptors"),wm=o(({fileDescriptor:{direction:e,objectMode:t,stdioItems:n},fileDescriptors:r,addProperties:i,options:s,isSync:a})=>{const u=n.map(c=>ym({stdioItem:c,addProperties:i,direction:e,options:s,fileDescriptors:r,isSync:a}));return{direction:e,objectMode:t,stdioItems:u}},"getFinalFileDescriptor"),ym=o(({stdioItem:e,addProperties:t,direction:n,options:r,fileDescriptors:i,isSync:s})=>{const a=im({stdioItem:e,direction:n,fileDescriptors:i,isSync:s});return a!==void 0?{...e,stream:a}:{...e,...t[n][e.type](e,r)}},"addStreamProperties"),$a=o(e=>{for(const{stdioItems:t}of e)for(const{stream:n}of t)n!==void 0&&!Fe(n)&&n.destroy()},"cleanupCustomStreams"),Em=o(e=>{if(e.length>1)return e.some(({value:r})=>r==="overlapped")?"overlapped":"pipe";const[{type:t,value:n}]=e;return t==="native"?n:"pipe"},"forwardStdio"),bm=o((e,t)=>Aa(Sm,e,t,!0),"handleStdioSync"),ne=o(({type:e,optionName:t})=>{Ba(t,_t[e])},"forbiddenIfSync"),Cm=o(({optionName:e,value:t})=>((t==="ipc"||t==="overlapped")&&Ba(e,`"${t}"`),{}),"forbiddenNativeIfSync"),Ba=o((e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},"throwInvalidSyncValue"),Ta={generator(){},asyncGenerator:ne,webStream:ne,nodeStream:ne,webTransform:ne,duplex:ne,asyncIterable:ne,native:Cm},Sm={input:{...Ta,fileUrl:o(({value:e})=>({contents:[Ke(an(e))]}),"fileUrl"),filePath:o(({value:{file:e}})=>({contents:[Ke(an(e))]}),"filePath"),fileNumber:ne,iterable:o(({value:e})=>({contents:[...e]}),"iterable"),string:o(({value:e})=>({contents:[e]}),"string"),uint8Array:o(({value:e})=>({contents:[e]}),"uint8Array")},output:{...Ta,fileUrl:o(({value:e})=>({path:e}),"fileUrl"),filePath:o(({value:{file:e,append:t}})=>({path:e,append:t}),"filePath"),fileNumber:o(({value:e})=>({path:e}),"fileNumber"),iterable:ne,string:ne,uint8Array:ne}},Le=o((e,{stripFinalNewline:t},n)=>Ia(t,n)&&e!==void 0&&!Array.isArray(e)?rr(e):e,"stripNewline"),Ia=o((e,t)=>t==="all"?e[1]||e[2]:e[t],"getStripFinalNewline"),Oa=o((e,t,n,r)=>e||n?void 0:Ma(t,r),"getSplitLinesGenerator"),Ra=o((e,t,n)=>n?e.flatMap(r=>xa(r,t)):xa(e,t),"splitLinesSync"),xa=o((e,t)=>{const{transform:n,final:r}=Ma(t,{});return[...n(e),...r()]},"splitLinesItemSync"),Ma=o((e,t)=>(t.previousChunks="",{transform:vm.bind(void 0,t,e),final:$m.bind(void 0,t)}),"initializeSplitLines"),vm=o(function*(e,t,n){if(typeof n!="string"){yield n;return}let{previousChunks:r}=e,i=-1;for(let s=0;s<n.length;s+=1)if(n[s]===`
59
+ `){const a=Am(n,s,t,e);let u=n.slice(i+1,s+1-a);r.length>0&&(u=wr(r,u),r=""),yield u,i=s}i!==n.length-1&&(r=wr(r,n.slice(i+1))),e.previousChunks=r},"splitGenerator"),Am=o((e,t,n,r)=>n?0:(r.isWindowsNewline=t!==0&&e[t-1]==="\r",r.isWindowsNewline?2:1),"getNewlineLength"),$m=o(function*({previousChunks:e}){e.length>0&&(yield e)},"linesFinal"),Bm=o(({binary:e,preserveNewlines:t,readableObjectMode:n,state:r})=>e||t||n?void 0:{transform:Tm.bind(void 0,r)},"getAppendNewlineGenerator"),Tm=o(function*({isWindowsNewline:e=!1},t){const{unixNewline:n,windowsNewline:r,LF:i,concatBytes:s}=typeof t=="string"?Im:Rm;if(t.at(-1)===i){yield t;return}yield s(t,e?r:n)},"appendNewlineGenerator"),wr=o((e,t)=>`${e}${t}`,"concatString"),Im={windowsNewline:`\r
60
+ `,unixNewline:`
61
+ `,LF:`
62
+ `,concatBytes:wr},Om=o((e,t)=>{const n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n},"concatUint8Array"),Rm={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Om},xm=o((e,t)=>e?void 0:Mm.bind(void 0,t),"getValidateTransformInput"),Mm=o(function*(e,t){if(typeof t!="string"&&!J(t)&&!ln.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},"validateStringTransformInput"),_m=o((e,t)=>e?Pm.bind(void 0,t):Lm.bind(void 0,t),"getValidateTransformReturn"),Pm=o(function*(e,t){_a(e,t),yield t},"validateObjectTransformReturn"),Lm=o(function*(e,t){if(_a(e,t),typeof t!="string"&&!J(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},"validateStringTransformReturn"),_a=o((e,t)=>{if(t==null)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
63
+ Instead, \`yield\` should either be called with a value, or not be called at all. For example:
64
+ if (condition) { yield value; }`)},"validateEmptyReturn"),Pa=o((e,t,n)=>{if(n)return;if(e)return{transform:Nm.bind(void 0,new TextEncoder)};const r=new Ao(t);return{transform:km.bind(void 0,r),final:Um.bind(void 0,r)}},"getEncodingTransformGenerator"),Nm=o(function*(e,t){ln.isBuffer(t)?yield Ke(t):typeof t=="string"?yield e.encode(t):yield t},"encodingUint8ArrayGenerator"),km=o(function*(e,t){yield J(t)?e.write(t):t},"encodingStringGenerator"),Um=o(function*(e){const t=e.end();t!==""&&(yield t)},"encodingStringFinal"),La=Re(async(e,t,n,r)=>{t.currentIterable=e(...n);try{for await(const i of t.currentIterable)r.push(i)}finally{delete t.currentIterable}}),yr=o(async function*(e,t,n){if(n===t.length){yield e;return}const{transform:r=zm}=t[n];for await(const i of r(e))yield*yr(i,t,n+1)},"transformChunk"),jm=o(async function*(e){for(const[t,{final:n}]of Object.entries(e))yield*Wm(n,Number(t),e)},"finalChunks"),Wm=o(async function*(e,t,n){if(e!==void 0)for await(const r of e())yield*yr(r,n,t+1)},"generatorFinalChunks"),Gm=Re(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),zm=o(function*(e){yield e},"identityGenerator$1"),Na=o((e,t,n,r)=>{try{for(const i of e(...t))n.push(i);r()}catch(i){r(i)}},"pushChunksSync"),Vm=o((e,t)=>[...t.flatMap(n=>[...nt(n,e,0)]),...Er(e)],"runTransformSync"),nt=o(function*(e,t,n){if(n===t.length){yield e;return}const{transform:r=Km}=t[n];for(const i of r(e))yield*nt(i,t,n+1)},"transformChunkSync"),Er=o(function*(e){for(const[t,{final:n}]of Object.entries(e))yield*Hm(n,Number(t),e)},"finalChunksSync"),Hm=o(function*(e,t,n){if(e!==void 0)for(const r of e())yield*nt(r,n,t+1)},"generatorFinalChunksSync"),Km=o(function*(e){yield e},"identityGenerator"),ka=o(({value:e,value:{transform:t,final:n,writableObjectMode:r,readableObjectMode:i},optionName:s},{encoding:a})=>{const u={},c=ja(e,a,s),d=_e(t),l=_e(n),f=d?La.bind(void 0,yr,u):Na.bind(void 0,nt),h=d||l?La.bind(void 0,jm,u):Na.bind(void 0,Er),D=d||l?Gm.bind(void 0,u):void 0;return{stream:new Vc({writableObjectMode:r,writableHighWaterMark:pt(r),readableObjectMode:i,readableHighWaterMark:pt(i),transform(m,g,F){f([m,c,0],this,F)},flush(m){h([c],this,m)},destroy:D})}},"generatorToStream"),Ua=o((e,t,n,r)=>{const i=t.filter(({type:a})=>a==="generator"),s=r?i.reverse():i;for(const{value:a,optionName:u}of s){const c=ja(a,n,u);e=Vm(c,e)}return e},"runGeneratorsSync"),ja=o(({transform:e,final:t,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:s},a,u)=>{const c={};return[{transform:xm(r,u)},Pa(n,a,r),Oa(n,s,r,c),{transform:e,final:t},{transform:_m(i,u)},Bm({binary:n,preserveNewlines:s,readableObjectMode:i,state:c})].filter(Boolean)},"addInternalGenerators"),qm=o((e,t)=>{for(const n of Ym(e))Zm(e,n,t)},"addInputOptionsSync"),Ym=o(e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),"getInputFdNumbers"),Zm=o((e,t,n)=>{const{stdioItems:r}=e[t],i=r.filter(({contents:u})=>u!==void 0);if(i.length===0)return;if(t!==0){const[{type:u,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${_t[u]} with synchronous methods.`)}const a=i.map(({contents:u})=>u).map(u=>Jm(u,r));n.input=Sn(a)},"addInputOptionSync"),Jm=o((e,t)=>{const n=Ua(e,t,"utf8",!0);return Xm(n),Sn(n)},"applySingleInputGeneratorsSync"),Xm=o(e=>{const t=e.find(n=>typeof n!="string"&&!J(n));if(t!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)},"validateSerializable"),Wa=o(({stdioItems:e,encoding:t,verboseInfo:n,fdNumber:r})=>r!=="all"&&$n(n,r)&&!be.has(t)&&Qm(r)&&(e.some(({type:i,value:s})=>i==="native"&&eg.has(s))||e.every(({type:i})=>Ae.has(i))),"shouldLogOutput"),Qm=o(e=>e===1||e===2,"fdUsesVerbose"),eg=new Set(["pipe","overlapped"]),tg=o(async(e,t,n,r)=>{for await(const i of e)rg(t)||Ga(i,n,r)},"logLines"),ng=o((e,t,n)=>{for(const r of e)Ga(r,t,n)},"logLinesSync"),rg=o(e=>e._readableState.pipes.length>0,"isPipingStream"),Ga=o((e,t,n)=>{const r=Vi(e);Ye({type:"output",verboseMessage:r,fdNumber:t,verboseInfo:n})},"logLine"),og=o(({fileDescriptors:e,syncResult:{output:t},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(t===null)return{output:Array.from({length:3})};const s={},a=new Set([]);return{output:t.map((c,d)=>ig({result:c,fileDescriptors:e,fdNumber:d,state:s,outputFiles:a,isMaxBuffer:r,verboseInfo:i},n)),...s}},"transformOutputSync"),ig=o(({result:e,fileDescriptors:t,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:s,verboseInfo:a},{buffer:u,encoding:c,lines:d,stripFinalNewline:l,maxBuffer:f})=>{if(e===null)return;const h=HD(e,s,f),D=Ke(h),{stdioItems:p,objectMode:m}=t[n],g=sg([D],p,c,r),{serializedResult:F,finalResult:w=F}=ag({chunks:g,objectMode:m,encoding:c,lines:d,stripFinalNewline:l,fdNumber:n});ug({serializedResult:F,fdNumber:n,state:r,verboseInfo:a,encoding:c,stdioItems:p,objectMode:m});const E=u[n]?w:void 0;try{return r.error===void 0&&cg(F,p,i),E}catch(y){return r.error=y,E}},"transformOutputResultSync"),sg=o((e,t,n,r)=>{try{return Ua(e,t,n,!1)}catch(i){return r.error=i,e}},"runOutputGeneratorsSync"),ag=o(({chunks:e,objectMode:t,encoding:n,lines:r,stripFinalNewline:i,fdNumber:s})=>{if(t)return{serializedResult:e};if(n==="buffer")return{serializedResult:Sn(e)};const a=ed(e,n);return r[s]?{serializedResult:a,finalResult:Ra(a,!i[s],t)}:{serializedResult:a}},"serializeChunks"),ug=o(({serializedResult:e,fdNumber:t,state:n,verboseInfo:r,encoding:i,stdioItems:s,objectMode:a})=>{if(!Wa({stdioItems:s,encoding:i,verboseInfo:r,fdNumber:t}))return;const u=Ra(e,!1,a);try{ng(u,t,r)}catch(c){n.error??(n.error=c)}},"logOutputSync"),cg=o((e,t,n)=>{for(const{path:r,append:i}of t.filter(({type:s})=>Fa.has(s))){const s=typeof r=="string"?r:r.toString();i||n.has(s)?Gc(r,e):(n.add(s),zc(r,e))}},"writeToFiles"),lg=o(([,e,t],n)=>{if(n.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,Le(t,n,"all")]:Array.isArray(t)?[Le(e,n,"all"),...t]:J(e)&&J(t)?Ri([e,t]):`${e}${t}`},"getAllSync"),dg=o(async(e,t)=>{const[n,r]=await fg(e);return t.isForcefullyTerminated??(t.isForcefullyTerminated=!1),[n,r]},"waitForExit"),fg=o(async e=>{const[t,n]=await Promise.allSettled([z(e,"spawn"),z(e,"exit")]);return t.status==="rejected"?[]:n.status==="rejected"?za(e):n.value},"waitForExitOrError"),za=o(async e=>{try{return await z(e,"exit")}catch{return za(e)}},"waitForSubprocessExit"),hg=o(async e=>{const[t,n]=await e;if(!Dg(t,n)&&Va(t,n))throw new ye;return[t,n]},"waitForSuccessfulExit"),Dg=o((e,t)=>e===void 0&&t===void 0,"isSubprocessErrorExit"),Va=o((e,t)=>e!==0||t!==null,"isFailedExit"),pg=o(({error:e,status:t,signal:n,output:r},{maxBuffer:i})=>{const s=mg(e,t,n),a=s?.code==="ETIMEDOUT",u=VD(s,r,i);return{resultError:s,exitCode:t,signal:n,timedOut:a,isMaxBuffer:u}},"getExitResultSync"),mg=o((e,t,n)=>e!==void 0?e:Va(t,n)?new ye:void 0,"getResultError"),gg=o((e,t,n)=>{const{file:r,commandArguments:i,command:s,escapedCommand:a,startTime:u,verboseInfo:c,options:d,fileDescriptors:l}=Fg(e,t,n),f=Eg({file:r,commandArguments:i,options:d,command:s,escapedCommand:a,verboseInfo:c,fileDescriptors:l,startTime:u});return hr(f,c,d)},"execaCoreSync"),Fg=o((e,t,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:a}=qi(e,t,n),u=wg(n),{file:c,commandArguments:d,options:l}=Ls(e,t,u);yg(l);const f=bm(l,a);return{file:c,commandArguments:d,command:r,escapedCommand:i,startTime:s,verboseInfo:a,options:l,fileDescriptors:f}},"handleSyncArguments"),wg=o(e=>e.node&&!e.ipc?{...e,ipc:!1}:e,"normalizeSyncOptions"),yg=o(({ipc:e,ipcInput:t,detached:n,cancelSignal:r})=>{t&&Pt("ipcInput"),e&&Pt("ipc: true"),n&&Pt("detached: true"),r&&Pt("cancelSignal")},"validateSyncOptions"),Pt=o(e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},"throwInvalidSyncOption"),Eg=o(({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,verboseInfo:s,fileDescriptors:a,startTime:u})=>{const c=bg({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:u});if(c.failed)return c;const{resultError:d,exitCode:l,signal:f,timedOut:h,isMaxBuffer:D}=pg(c,n),{output:p,error:m=d}=og({fileDescriptors:a,syncResult:c,options:n,isMaxBuffer:D,verboseInfo:s}),g=p.map((w,E)=>Le(w,n,E)),F=Le(lg(p,n),n,"all");return Sg({error:m,exitCode:l,signal:f,timedOut:h,isMaxBuffer:D,stdio:g,all:F,options:n,command:r,escapedCommand:i,startTime:u})},"spawnSubprocessSync"),bg=o(({file:e,commandArguments:t,options:n,command:r,escapedCommand:i,fileDescriptors:s,startTime:a})=>{try{qm(s,n);const u=Cg(n);return Tc(...Ns(e,t,u))}catch(u){return dr({error:u,command:r,escapedCommand:i,fileDescriptors:s,options:n,startTime:a,isSync:!0})}},"runSubprocessSync"),Cg=o(({encoding:e,maxBuffer:t,...n})=>({...n,encoding:"buffer",maxBuffer:lr(t)}),"normalizeSpawnSyncOptions"),Sg=o(({error:e,exitCode:t,signal:n,timedOut:r,isMaxBuffer:i,stdio:s,all:a,options:u,command:c,escapedCommand:d,startTime:l})=>e===void 0?aa({command:c,escapedCommand:d,stdio:s,all:a,ipcOutput:[],options:u,startTime:l}):fr({error:e,command:c,escapedCommand:d,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:t,signal:n,stdio:s,all:a,ipcOutput:[],options:u,startTime:l,isSync:!0}),"getSyncResult"),vg=o(({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0,filter:s}={})=>(Kn({methodName:"getOneMessage",isSubprocess:n,ipc:r,isConnected:Bs(e)}),Ag({anyProcess:e,channel:t,isSubprocess:n,filter:s,reference:i})),"getOneMessage"),Ag=o(async({anyProcess:e,channel:t,isSubprocess:n,filter:r,reference:i})=>{As(t,i);const s=At(e,t,n),a=new AbortController;try{return await Promise.race([$g(s,r,a),Bg(s,n,a),Tg(s,n,a)])}catch(u){throw qn(e),u}finally{a.abort(),$s(t,i)}},"getOneMessageAsync"),$g=o(async(e,t,{signal:n})=>{if(t===void 0){const[r]=await z(e,"message",{signal:n});return r}for await(const[r]of Dt(e,"message",{signal:n}))if(t(r))return r},"getMessage"),Bg=o(async(e,t,{signal:n})=>{await z(e,"disconnect",{signal:n}),Qf(t)},"throwOnDisconnect"),Tg=o(async(e,t,{signal:n})=>{const[r]=await z(e,"strict:error",{signal:n});throw Es(r,t)},"throwOnStrictError"),Ig=o(({anyProcess:e,channel:t,isSubprocess:n,ipc:r},{reference:i=!0}={})=>Ha({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),"getEachMessage"),Ha=o(({anyProcess:e,channel:t,isSubprocess:n,ipc:r,shouldAwait:i,reference:s})=>{Kn({methodName:"getEachMessage",isSubprocess:n,ipc:r,isConnected:Bs(e)}),As(t,s);const a=At(e,t,n),u=new AbortController,c={};return Og(e,a,u),Rg({ipcEmitter:a,isSubprocess:n,controller:u,state:c}),xg({anyProcess:e,channel:t,ipcEmitter:a,isSubprocess:n,shouldAwait:i,controller:u,state:c,reference:s})},"loopOnMessages"),Og=o(async(e,t,n)=>{try{await z(t,"disconnect",{signal:n.signal}),n.abort()}catch{}},"stopOnDisconnect"),Rg=o(async({ipcEmitter:e,isSubprocess:t,controller:n,state:r})=>{try{const[i]=await z(e,"strict:error",{signal:n.signal});r.error=Es(i,t),n.abort()}catch{}},"abortOnStrictError"),xg=o(async function*({anyProcess:e,channel:t,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:s,state:a,reference:u}){try{for await(const[c]of Dt(n,"message",{signal:s.signal}))Ka(a),yield c}catch{Ka(a)}finally{s.abort(),$s(t,u),r||qn(e),i&&await e}},"iterateOnMessages"),Ka=o(({error:e})=>{if(e)throw e},"throwIfStrictError"),Mg=o((e,{ipc:t})=>{Object.assign(e,qa(e,!1,t))},"addIpcMethods"),_g=o(()=>{const e=O,t=!0,n=O.channel!==void 0;return{...qa(e,t,n),getCancelSignal:xh.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}},"getIpcExport"),qa=o((e,t,n)=>({sendMessage:Is.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getOneMessage:vg.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n}),getEachMessage:Ig.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:n})}),"getIpcMethods"),Pg=o(({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,verboseInfo:a})=>{$a(r);const u=new vo;Lg(u,r),Object.assign(u,{readable:Ng,writable:kg,duplex:Ug});const c=dr({error:e,command:t,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:!1}),d=jg(c,a,i);return{subprocess:u,promise:d}},"handleEarlyError"),Lg=o((e,t)=>{const n=rt(),r=rt(),i=rt(),s=Array.from({length:t.length-3},rt),a=rt(),u=[n,r,i,...s];Object.assign(e,{stdin:n,stdout:r,stderr:i,all:a,stdio:u})},"createDummyStreams"),rt=o(()=>{const e=new No;return e.end(),e},"createDummyStream"),Ng=o(()=>new ge({read(){}}),"readable"),kg=o(()=>new cn({write(){}}),"writable"),Ug=o(()=>new un({read(){},write(){}}),"duplex"),jg=o(async(e,t,n)=>hr(e,t,n),"handleDummyPromise"),Wg=o((e,t)=>Aa(Gg,e,t,!1),"handleStdioAsync"),ot=o(({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${_t[e]}.`)},"forbiddenIfAsync"),Ya={fileNumber:ot,generator:ka,asyncGenerator:ka,nodeStream:o(({value:e})=>({stream:e}),"nodeStream"),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:n}}){const r=t||n;return{stream:un.fromWeb(e,{objectMode:r})}},duplex:o(({value:{transform:e}})=>({stream:e}),"duplex"),native(){}},Gg={input:{...Ya,fileUrl:o(({value:e})=>({stream:Lo(e)}),"fileUrl"),filePath:o(({value:{file:e}})=>({stream:Lo(e)}),"filePath"),webStream:o(({value:e})=>({stream:ge.fromWeb(e)}),"webStream"),iterable:o(({value:e})=>({stream:ge.from(e)}),"iterable"),asyncIterable:o(({value:e})=>({stream:ge.from(e)}),"asyncIterable"),string:o(({value:e})=>({stream:ge.from(e)}),"string"),uint8Array:o(({value:e})=>({stream:ge.from(ln.from(e))}),"uint8Array")},output:{...Ya,fileUrl:o(({value:e})=>({stream:Po(e)}),"fileUrl"),filePath:o(({value:{file:e,append:t}})=>({stream:Po(e,t?{flags:"a"}:{})}),"filePath"),webStream:o(({value:e})=>({stream:cn.fromWeb(e)}),"webStream"),iterable:ot,asyncIterable:ot,string:ot,uint8Array:ot}};var Za=o(e=>{throw TypeError(e)},"__typeError$1"),Ja=o((e,t,n)=>t.has(e)||Za("Cannot "+n),"__accessCheck$1"),H=o((e,t,n)=>(Ja(e,t,"read from private field"),n?n.call(e):t.get(e)),"__privateGet$1"),Ne=o((e,t,n)=>t.has(e)?Za("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),"__privateAdd$1"),zg=o((e,t,n,r)=>(Ja(e,t,"write to private field"),t.set(e,n),n),"__privateSet$1"),$e,br,Cr,it,Lt,st;function Sr(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(const i of e)Ar(i);const t=e.some(({readableObjectMode:i})=>i),n=Vg(e,t),r=new vr({objectMode:t,writableHighWaterMark:n,readableHighWaterMark:n});for(const i of e)r.add(i);return r}o(Sr,"mergeStreams");const Vg=o((e,t)=>{if(e.length===0)return pt(t);const n=e.filter(({readableObjectMode:r})=>r===t).map(({readableHighWaterMark:r})=>r);return Math.max(...n)},"getHighWaterMark"),po=class po extends No{constructor(){super(...arguments),Ne(this,$e,new Set([])),Ne(this,br,new Set([])),Ne(this,Cr,new Set([])),Ne(this,it),Ne(this,Lt,Symbol("unpipe")),Ne(this,st,new WeakMap)}add(t){if(Ar(t),H(this,$e).has(t))return;H(this,$e).add(t),H(this,it)??zg(this,it,Hg(this,H(this,$e),H(this,Lt)));const n=Yg({passThroughStream:this,stream:t,streams:H(this,$e),ended:H(this,br),aborted:H(this,Cr),onFinished:H(this,it),unpipeEvent:H(this,Lt)});H(this,st).set(t,n),t.pipe(this,{end:!1})}async remove(t){if(Ar(t),!H(this,$e).has(t))return!1;const n=H(this,st).get(t);return n===void 0?!1:(H(this,st).delete(t),t.unpipe(this),await n,!0)}};o(po,"MergedStream");let vr=po;$e=new WeakMap,br=new WeakMap,Cr=new WeakMap,it=new WeakMap,Lt=new WeakMap,st=new WeakMap;const Hg=o(async(e,t,n)=>{Nt(e,tu);const r=new AbortController;try{await Promise.race([Kg(e,r),qg(e,t,n,r)])}finally{r.abort(),Nt(e,-tu)}},"onMergedStreamFinished"),Kg=o(async(e,{signal:t})=>{try{await le(e,{signal:t,cleanup:!0})}catch(n){throw Xa(e,n),n}},"onMergedStreamEnd"),qg=o(async(e,t,n,{signal:r})=>{for await(const[i]of Dt(e,"unpipe",{signal:r}))t.has(i)&&i.emit(n)},"onInputStreamsUnpipe"),Ar=o(e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},"validateStream"),Yg=o(async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,onFinished:s,unpipeEvent:a})=>{Nt(e,nu);const u=new AbortController;try{await Promise.race([Zg(s,t,u),Jg({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:u}),Xg({stream:t,streams:n,ended:r,aborted:i,unpipeEvent:a,controller:u})])}finally{u.abort(),Nt(e,-nu)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?$r(e):Qg(e))},"endWhenStreamsDone"),Zg=o(async(e,t,{signal:n})=>{try{await e,n.aborted||$r(t)}catch(r){n.aborted||Xa(t,r)}},"afterMergedStreamFinished"),Jg=o(async({passThroughStream:e,stream:t,streams:n,ended:r,aborted:i,controller:{signal:s}})=>{try{await le(t,{signal:s,cleanup:!0,readable:!0,writable:!1}),n.has(t)&&r.add(t)}catch(a){if(s.aborted||!n.has(t))return;Qa(a)?i.add(t):eu(e,a)}},"onInputStreamEnd"),Xg=o(async({stream:e,streams:t,ended:n,aborted:r,unpipeEvent:i,controller:{signal:s}})=>{if(await z(e,i,{signal:s}),!e.readable)return z(s,"abort",{signal:s});t.delete(e),n.delete(e),r.delete(e)},"onInputStreamUnpipe"),Qg=o(e=>{e.writable&&e.end()},"endStream"),Xa=o((e,t)=>{Qa(t)?$r(e):eu(e,t)},"errorOrAbortStream"),Qa=o(e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE","isAbortError"),$r=o(e=>{(e.readable||e.writable)&&e.destroy()},"abortStream"),eu=o((e,t)=>{e.destroyed||(e.once("error",e0),e.destroy(t))},"errorStream"),e0=o(()=>{},"noop"),Nt=o((e,t)=>{const n=e.getMaxListeners();n!==0&&n!==Number.POSITIVE_INFINITY&&e.setMaxListeners(n+t)},"updateMaxListeners"),tu=2,nu=1,kt=o((e,t)=>{e.pipe(t),t0(e,t),n0(e,t)},"pipeStreams"),t0=o(async(e,t)=>{if(!(Fe(e)||Fe(t))){try{await le(e,{cleanup:!0,readable:!0,writable:!1})}catch{}ru(t)}},"onSourceFinish"),ru=o(e=>{e.writable&&e.end()},"endDestinationStream"),n0=o(async(e,t)=>{if(!(Fe(e)||Fe(t))){try{await le(t,{cleanup:!0,readable:!1,writable:!0})}catch{}ou(e)}},"onDestinationFinish"),ou=o(e=>{e.readable&&e.destroy()},"abortSourceStream"),r0=o((e,t,n)=>{const r=new Map;for(const[i,{stdioItems:s,direction:a}]of Object.entries(t)){for(const{stream:u}of s.filter(({type:c})=>Ae.has(c)))o0(e,u,a,i);for(const{stream:u}of s.filter(({type:c})=>!Ae.has(c)))s0({subprocess:e,stream:u,direction:a,fdNumber:i,pipeGroups:r,controller:n})}for(const[i,s]of r.entries()){const a=s.length===1?s[0]:Sr(s);kt(a,i)}},"pipeOutputAsync"),o0=o((e,t,n,r)=>{n==="output"?kt(e.stdio[r],t):kt(t,e.stdio[r]);const i=i0[r];i!==void 0&&(e[i]=t),e.stdio[r]=t},"pipeTransform"),i0=["stdin","stdout","stderr"],s0=o(({subprocess:e,stream:t,direction:n,fdNumber:r,pipeGroups:i,controller:s})=>{if(t===void 0)return;a0(t,s);const[a,u]=n==="output"?[t,e.stdio[r]]:[e.stdio[r],t],c=i.get(a)??[];i.set(a,[...c,u])},"pipeStdioItem"),a0=o((e,{signal:t})=>{Fe(e)&&St(e,u0,t)},"setStandardStreamMaxListeners"),u0=2,ke=[];ke.push("SIGHUP","SIGINT","SIGTERM"),process.platform!=="win32"&&ke.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&ke.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var c0=Object.defineProperty,iu=o(e=>{throw TypeError(e)},"__typeError"),l0=o((e,t,n)=>t in e?c0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp$1"),Ut=o((e,t,n)=>l0(e,typeof t!="symbol"?t+"":t,n),"__publicField$1"),Br=o((e,t,n)=>t.has(e)||iu("Cannot "+n),"__accessCheck"),A=o((e,t,n)=>(Br(e,t,"read from private field"),n?n.call(e):t.get(e)),"__privateGet"),De=o((e,t,n)=>t.has(e)?iu("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),"__privateAdd"),Ue=o((e,t,n,r)=>(Br(e,t,"write to private field"),t.set(e,n),n),"__privateSet"),su=o((e,t,n)=>(Br(e,t,"access private method"),n),"__privateMethod"),Tr,Z,N,at,ut,je,Be,jt,au,uu;const Wt=o(e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function","processOk"),Ir=Symbol.for("signal-exit emitter"),Or=globalThis,d0=Object.defineProperty.bind(Object),mo=class mo{constructor(){if(Ut(this,"emitted",{afterExit:!1,exit:!1}),Ut(this,"listeners",{afterExit:[],exit:[]}),Ut(this,"count",0),Ut(this,"id",Math.random()),Or[Ir])return Or[Ir];d0(Or,Ir,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,n){this.listeners[t].push(n)}removeListener(t,n){const r=this.listeners[t],i=r.indexOf(n);i!==-1&&(i===0&&r.length===1?r.length=0:r.splice(i,1))}emit(t,n,r){if(this.emitted[t])return!1;this.emitted[t]=!0;let i=!1;for(const s of this.listeners[t])i=s(n,r)===!0||i;return t==="exit"&&(i=this.emit("afterExit",n,r)||i),i}};o(mo,"Emitter");let Rr=mo;const go=class go{};o(go,"SignalExitBase");let Gt=go;const f0=o(e=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}}),"signalExitWrap"),Fo=class Fo extends Gt{onExit(){return()=>{}}load(){}unload(){}};o(Fo,"SignalExitFallback");let xr=Fo;const wo=class wo extends Gt{constructor(t){super(),De(this,jt),De(this,Tr,_r.platform==="win32"?"SIGINT":"SIGHUP"),De(this,Z,new Rr),De(this,N),De(this,at),De(this,ut),De(this,je,{}),De(this,Be,!1),Ue(this,N,t),Ue(this,je,{});for(const n of ke)A(this,je)[n]=()=>{const r=A(this,N).listeners(n);let{count:i}=A(this,Z);const s=t;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),r.length===i){this.unload();const a=A(this,Z).emit("exit",null,n),u=n==="SIGHUP"?A(this,Tr):n;a||t.kill(t.pid,u)}};Ue(this,ut,t.reallyExit),Ue(this,at,t.emit)}onExit(t,n){if(!Wt(A(this,N)))return()=>{};A(this,Be)===!1&&this.load();const r=n?.alwaysLast?"afterExit":"exit";return A(this,Z).on(r,t),()=>{A(this,Z).removeListener(r,t),A(this,Z).listeners.exit.length===0&&A(this,Z).listeners.afterExit.length===0&&this.unload()}}load(){if(!A(this,Be)){Ue(this,Be,!0),A(this,Z).count+=1;for(const t of ke)try{const n=A(this,je)[t];n&&A(this,N).on(t,n)}catch{}A(this,N).emit=(t,...n)=>su(this,jt,uu).call(this,t,...n),A(this,N).reallyExit=t=>su(this,jt,au).call(this,t)}}unload(){A(this,Be)&&(Ue(this,Be,!1),ke.forEach(t=>{const n=A(this,je)[t];if(!n)throw new Error("Listener not defined for signal: "+t);try{A(this,N).removeListener(t,n)}catch{}}),A(this,N).emit=A(this,at),A(this,N).reallyExit=A(this,ut),A(this,Z).count-=1)}};o(wo,"SignalExit");let Mr=wo;Tr=new WeakMap,Z=new WeakMap,N=new WeakMap,at=new WeakMap,ut=new WeakMap,je=new WeakMap,Be=new WeakMap,jt=new WeakSet,au=o(function(e){return Wt(A(this,N))?(A(this,N).exitCode=e||0,A(this,Z).emit("exit",A(this,N).exitCode,null),A(this,ut).call(A(this,N),A(this,N).exitCode)):0},"processReallyExit_fn"),uu=o(function(e,...t){const n=A(this,at);if(e==="exit"&&Wt(A(this,N))){typeof t[0]=="number"&&(A(this,N).exitCode=t[0]);const r=n.call(A(this,N),e,...t);return A(this,Z).emit("exit",A(this,N).exitCode,null),r}else return n.call(A(this,N),e,...t)},"processEmit_fn");const _r=globalThis.process,{onExit:h0}=f0(Wt(_r)?new Mr(_r):new xr),D0=o((e,{cleanup:t,detached:n},{signal:r})=>{if(!t||n)return;const i=h0(()=>{e.kill()});_o(r,()=>{i()})},"cleanupOnExit"),p0=o(({source:e,sourcePromise:t,boundOptions:n,createNested:r},...i)=>{const s=Hi(),{destination:a,destinationStream:u,destinationError:c,from:d,unpipeSignal:l}=m0(n,r,i),{sourceStream:f,sourceError:h}=F0(e,d),{options:D,fileDescriptors:p}=Ee.get(e);return{sourcePromise:t,sourceStream:f,sourceOptions:D,sourceError:h,destination:a,destinationStream:u,destinationError:c,unpipeSignal:l,fileDescriptors:p,startTime:s}},"normalizePipeArguments"),m0=o((e,t,n)=>{try{const{destination:r,pipeOptions:{from:i,to:s,unpipeSignal:a}={}}=g0(e,t,...n),u=bs(r,s);return{destination:r,destinationStream:u,from:i,unpipeSignal:a}}catch(r){return{destinationError:r}}},"getDestinationStream"),g0=o((e,t,n,...r)=>{if(Array.isArray(n))return{destination:t(cu,e)(n,...r),pipeOptions:e};if(typeof n=="string"||n instanceof URL||Ai(n)){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');const[i,s,a]=Bi(n,...r);return{destination:t(cu)(i,s,a),pipeOptions:a}}if(Ee.has(n)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},"getDestination"),cu=o(({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),"mapDestinationArguments"),F0=o((e,t)=>{try{return{sourceStream:Yn(e,t)}}catch(n){return{sourceError:n}}},"getSourceStream"),w0=o(({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:s,startTime:a})=>{const u=y0({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r});if(u!==void 0)throw lu({error:u,fileDescriptors:i,sourceOptions:s,startTime:a})},"handlePipeArgumentsError"),y0=o(({sourceStream:e,sourceError:t,destinationStream:n,destinationError:r})=>{if(t!==void 0&&r!==void 0)return r;if(r!==void 0)return ou(e),r;if(t!==void 0)return ru(n),t},"getPipeArgumentsError"),lu=o(({error:e,fileDescriptors:t,sourceOptions:n,startTime:r})=>dr({error:e,command:du,escapedCommand:du,fileDescriptors:t,options:n,startTime:r,isSync:!1}),"createNonCommandError"),du="source.pipe(destination)",E0=o(async e=>{const[{status:t,reason:n,value:r=n},{status:i,reason:s,value:a=s}]=await e;if(a.pipedFrom.includes(r)||a.pipedFrom.push(r),i==="rejected")throw a;if(t==="rejected")throw r;return a},"waitForBothSubprocesses"),b0=o((e,t,n)=>{const r=zt.has(t)?S0(e,t):C0(e,t);return St(e,A0,n.signal),St(t,$0,n.signal),v0(t),r},"pipeSubprocessStream"),C0=o((e,t)=>{const n=Sr([e]);return kt(n,t),zt.set(t,n),n},"pipeFirstSubprocessStream"),S0=o((e,t)=>{const n=zt.get(t);return n.add(e),n},"pipeMoreSubprocessStream"),v0=o(async e=>{try{await le(e,{cleanup:!0,readable:!1,writable:!0})}catch{}zt.delete(e)},"cleanupMergedStreamsMap"),zt=new WeakMap,A0=2,$0=1,B0=o((e,t)=>e===void 0?[]:[T0(e,t)],"unpipeOnAbort"),T0=o(async(e,{sourceStream:t,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:s})=>{await xc(e,t),await n.remove(t);const a=new Error("Pipe canceled by `unpipeSignal` option.");throw lu({error:a,fileDescriptors:r,sourceOptions:i,startTime:s})},"unpipeOnSignalAbort"),Pr=o((e,...t)=>{if(Y(t[0]))return Pr.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});const{destination:n,...r}=p0(e,...t),i=I0({...r,destination:n});return i.pipe=Pr.bind(void 0,{...e,source:n,sourcePromise:i,boundOptions:{}}),i},"pipeToSubprocess"),I0=o(async({sourcePromise:e,sourceStream:t,sourceOptions:n,sourceError:r,destination:i,destinationStream:s,destinationError:a,unpipeSignal:u,fileDescriptors:c,startTime:d})=>{const l=O0(e,i);w0({sourceStream:t,sourceError:r,destinationStream:s,destinationError:a,fileDescriptors:c,sourceOptions:n,startTime:d});const f=new AbortController;try{const h=b0(t,s,f);return await Promise.race([E0(l),...B0(u,{sourceStream:t,mergedStream:h,sourceOptions:n,fileDescriptors:c,startTime:d})])}finally{f.abort()}},"handlePipePromise"),O0=o((e,t)=>Promise.allSettled([e,t]),"getSubprocessPromises"),fu=o(({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:r,encoding:i,preserveNewlines:s})=>{const a=new AbortController;return R0(t,a),Du({stream:e,controller:a,binary:n,shouldEncode:!e.readableObjectMode&&r,encoding:i,shouldSplit:!e.readableObjectMode,preserveNewlines:s})},"iterateOnSubprocessStream"),R0=o(async(e,t)=>{try{await e}catch{}finally{t.abort()}},"stopReadingOnExit"),hu=o(({stream:e,onStreamEnd:t,lines:n,encoding:r,stripFinalNewline:i,allMixed:s})=>{const a=new AbortController;x0(t,a,e);const u=e.readableObjectMode&&!s;return Du({stream:e,controller:a,binary:r==="buffer",shouldEncode:!u,encoding:r,shouldSplit:!u&&n,preserveNewlines:!i})},"iterateForResult"),x0=o(async(e,t,n)=>{try{await e}catch{n.destroy()}finally{t.abort()}},"stopReadingOnStreamEnd"),Du=o(({stream:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a})=>{const u=Dt(e,"data",{signal:t.signal,highWaterMark:mu,highWatermark:mu});return M0({onStdoutChunk:u,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a})},"iterateOnStream"),pu=pt(!0),mu=pu,M0=o(async function*({onStdoutChunk:e,controller:t,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a}){const u=_0({binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a});try{for await(const[c]of e)yield*nt(c,u,0)}catch(c){if(!t.signal.aborted)throw c}finally{yield*Er(u)}},"iterateOnData"),_0=o(({binary:e,shouldEncode:t,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Pa(e,n,!t),Oa(e,i,!r,{})].filter(Boolean),"getGenerators"),P0=o(async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,buffer:i,maxBuffer:s,lines:a,allMixed:u,stripFinalNewline:c,verboseInfo:d,streamInfo:l})=>{const f=L0({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:u,verboseInfo:d,streamInfo:l});if(!i){await Promise.all([N0(e),f]);return}const h=Ia(c,n),D=hu({stream:e,onStreamEnd:t,lines:a,encoding:r,stripFinalNewline:h,allMixed:u}),[p]=await Promise.all([k0({stream:e,iterable:D,fdNumber:n,encoding:r,maxBuffer:s,lines:a}),f]);return p},"getStreamOutput"),L0=o(async({stream:e,onStreamEnd:t,fdNumber:n,encoding:r,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:a}})=>{if(!Wa({stdioItems:a[n]?.stdioItems,encoding:r,verboseInfo:s,fdNumber:n}))return;const u=hu({stream:e,onStreamEnd:t,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await tg(u,e,n,s)},"logOutputAsync"),N0=o(async e=>{await Nc(),e.readableFlowing===null&&e.resume()},"resumeStream"),k0=o(async({stream:e,stream:{readableObjectMode:t},iterable:n,fdNumber:r,encoding:i,maxBuffer:s,lines:a})=>{try{return t||a?await wD(n,{maxBuffer:s}):i==="buffer"?new Uint8Array(await SD(n,{maxBuffer:s})):await MD(n,{maxBuffer:s})}catch(u){return Fu(UD({error:u,stream:e,readableObjectMode:t,lines:a,encoding:i,fdNumber:r}))}},"getStreamContents"),gu=o(async e=>{try{return await e}catch(t){return Fu(t)}},"getBufferedData"),Fu=o(({bufferedData:e})=>Jl(e)?new Uint8Array(e):e,"handleBufferedData"),Lr=o(async(e,t,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{const s=U0(e,n),a=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],le(e,{cleanup:!0,signal:a.signal})])}catch(u){s.stdinCleanedUp||G0(u,t,n,r)}finally{a.abort()}},"waitForStream"),U0=o((e,{originalStreams:[t],subprocess:n})=>{const r={stdinCleanedUp:!1};return e===t&&j0(e,n,r),r},"handleStdinDestroy"),j0=o((e,t,n)=>{const{_destroy:r}=e;e._destroy=(...i)=>{W0(t,n),r.call(e,...i)}},"spyOnStdinDestroy"),W0=o(({exitCode:e,signalCode:t},n)=>{(e!==null||t!==null)&&(n.stdinCleanedUp=!0)},"setStdinCleanedUp"),G0=o((e,t,n,r)=>{if(!z0(e,t,n,r))throw e},"handleStreamError"),z0=o((e,t,n,r=!0)=>n.propagating?yu(e)||Nr(e):(n.propagating=!0,wu(n,t)===r?yu(e):Nr(e)),"shouldIgnoreStreamError"),wu=o(({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input","isInputFileDescriptor"),Nr=o(e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE","isStreamAbort"),yu=o(e=>e?.code==="EPIPE","isStreamEpipe"),V0=o(({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:a,streamInfo:u})=>e.stdio.map((c,d)=>Eu({stream:c,fdNumber:d,encoding:t,buffer:n[d],maxBuffer:r[d],lines:i[d],allMixed:!1,stripFinalNewline:s,verboseInfo:a,streamInfo:u})),"waitForStdioStreams"),Eu=o(async({stream:e,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:d})=>{if(!e)return;const l=Lr(e,t,d);if(wu(d,t)){await l;return}const[f]=await Promise.all([P0({stream:e,onStreamEnd:l,fdNumber:t,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:d}),l]);return f},"waitForSubprocessStream"),H0=o(({stdout:e,stderr:t},{all:n})=>n&&(e||t)?Sr([e,t].filter(Boolean)):void 0,"makeAllStream"),K0=o(({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:a,streamInfo:u})=>Eu({...q0(e,n),fdNumber:"all",encoding:t,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:Y0(e),stripFinalNewline:s,verboseInfo:a,streamInfo:u}),"waitForAllStream"),q0=o(({stdout:e,stderr:t,all:n},[,r,i])=>{const s=r||i;return s?r?i?{stream:n,buffer:s}:{stream:e,buffer:s}:{stream:t,buffer:s}:{stream:n,buffer:s}},"getAllStream"),Y0=o(({all:e,stdout:t,stderr:n})=>e&&t&&n&&t.readableObjectMode!==n.readableObjectMode,"getAllMixed"),Z0=o(e=>$n(e,"ipc"),"shouldLogIpc"),J0=o((e,t)=>{const n=Vi(e);Ye({type:"ipc",verboseMessage:n,fdNumber:"ipc",verboseInfo:t})},"logIpcOutput"),X0=o(async({subprocess:e,buffer:t,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:s})=>{if(!r)return i;const a=Z0(s),u=qe(t,"ipc"),c=qe(n,"ipc");for await(const d of Ha({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))u&&(WD(e,i,c),i.push(d)),a&&J0(d,s);return i},"waitForIpcOutput"),Q0=o(async(e,t)=>(await Promise.allSettled([e]),t),"getBufferedIpcOutput"),e2=o(async({subprocess:e,options:{encoding:t,buffer:n,maxBuffer:r,lines:i,timeoutDuration:s,cancelSignal:a,gracefulCancel:u,forceKillAfterDelay:c,stripFinalNewline:d,ipc:l,ipcInput:f},context:h,verboseInfo:D,fileDescriptors:p,originalStreams:m,onInternalError:g,controller:F})=>{const w=dg(e,h),E={originalStreams:m,fileDescriptors:p,subprocess:e,exitPromise:w,propagating:!1},y=V0({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:d,verboseInfo:D,streamInfo:E}),b=K0({subprocess:e,encoding:t,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:d,verboseInfo:D,streamInfo:E}),S=[],$=X0({subprocess:e,buffer:n,maxBuffer:r,ipc:l,ipcOutput:S,verboseInfo:D}),T=t2(m,e,E),I=n2(p,E);try{return await Promise.race([Promise.all([{},hg(w),Promise.all(y),b,$,Yh(e,f),...T,...I]),g,r2(e,F),...jh(e,s,h,F),...Zf({subprocess:e,cancelSignal:a,gracefulCancel:u,context:h,controller:F}),...Lh({subprocess:e,cancelSignal:a,gracefulCancel:u,forceKillAfterDelay:c,context:h,controller:F})])}catch(G){return h.terminationReason??(h.terminationReason="other"),Promise.all([{error:G},w,Promise.all(y.map(P=>gu(P))),gu(b),Q0($,S),Promise.allSettled(T),Promise.allSettled(I)])}},"waitForSubprocessResult"),t2=o((e,t,n)=>e.map((r,i)=>r===t.stdio[i]?void 0:Lr(r,i,n)),"waitForOriginalStreams"),n2=o((e,t)=>e.flatMap(({stdioItems:n},r)=>n.filter(({value:i,stream:s=i})=>Ce(s,{checkOpen:!1})&&!Fe(s)).map(({type:i,value:s,stream:a=s})=>Lr(a,r,t,{isSameDirection:Ae.has(i),stopOnExit:i==="native"}))),"waitForCustomStreamsEnd"),r2=o(async(e,{signal:t})=>{const[n]=await z(e,"error",{signal:t});throw n},"throwOnSubprocessError"),o2=o(()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),"initializeConcurrentStreams"),kr=o((e,t,n)=>{const r=e[n];r.has(t)||r.set(t,[]);const i=r.get(t),s=Xe();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},"addConcurrentStream"),Vt=o(async({resolve:e,promises:t},n)=>{e();const[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...t])]);return!r},"waitForConcurrentStreams"),bu=o(async e=>{if(e!==void 0)try{await Cu(e)}catch{}},"safeWaitForSubprocessStdin"),i2=o(async e=>{if(e!==void 0)try{await Su(e)}catch{}},"safeWaitForSubprocessStdout"),Cu=o(async e=>{await le(e,{cleanup:!0,readable:!1,writable:!0})},"waitForSubprocessStdin"),Su=o(async e=>{await le(e,{cleanup:!0,readable:!0,writable:!1})},"waitForSubprocessStdout"),vu=o(async(e,t)=>{if(await e,t)throw t},"waitForSubprocess"),Au=o((e,t,n)=>{n&&!Nr(n)?e.destroy(n):t&&e.destroy()},"destroyOtherStream"),s2=o(({subprocess:e,concurrentStreams:t,encoding:n},{from:r,binary:i=!0,preserveNewlines:s=!0}={})=>{const a=i||be.has(n),{subprocessStdout:u,waitReadableDestroy:c}=$u(e,r,t),{readableEncoding:d,readableObjectMode:l,readableHighWaterMark:f}=Bu(u,a),{read:h,onStdoutDataDone:D}=Tu({subprocessStdout:u,subprocess:e,binary:a,encoding:n,preserveNewlines:s}),p=new ge({read:h,destroy:Re(Ou.bind(void 0,{subprocessStdout:u,subprocess:e,waitReadableDestroy:c})),highWaterMark:f,objectMode:l,encoding:d});return Iu({subprocessStdout:u,onStdoutDataDone:D,readable:p,subprocess:e}),p},"createReadable"),$u=o((e,t,n)=>{const r=Yn(e,t),i=kr(n,r,"readableDestroy");return{subprocessStdout:r,waitReadableDestroy:i}},"getSubprocessStdout"),Bu=o(({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n},r)=>r?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:n}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:pu},"getReadableOptions"),Tu=o(({subprocessStdout:e,subprocess:t,binary:n,encoding:r,preserveNewlines:i})=>{const s=Xe(),a=fu({subprocessStdout:e,subprocess:t,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){a2(this,a,s)},onStdoutDataDone:s}},"getReadableMethods"),a2=o(async(e,t,n)=>{try{const{value:r,done:i}=await t.next();i?n.resolve():e.push(r)}catch{}},"onRead"),Iu=o(async({subprocessStdout:e,onStdoutDataDone:t,readable:n,subprocess:r,subprocessStdin:i})=>{try{await Su(e),await r,await bu(i),await t,n.readable&&n.push(null)}catch(s){await bu(i),Ru(n,s)}},"onStdoutFinished"),Ou=o(async({subprocessStdout:e,subprocess:t,waitReadableDestroy:n},r)=>{await Vt(n,t)&&(Ru(e,r),await vu(t,r))},"onReadableDestroy"),Ru=o((e,t)=>{Au(e,e.readable,t)},"destroyOtherReadable"),u2=o(({subprocess:e,concurrentStreams:t},{to:n}={})=>{const{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}=xu(e,n,t),a=new cn({...Mu(r,e,i),destroy:Re(Pu.bind(void 0,{subprocessStdin:r,subprocess:e,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return _u(r,a),a},"createWritable"),xu=o((e,t,n)=>{const r=bs(e,t),i=kr(n,r,"writableFinal"),s=kr(n,r,"writableDestroy");return{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}},"getSubprocessStdin"),Mu=o((e,t,n)=>({write:c2.bind(void 0,e),final:Re(l2.bind(void 0,e,t,n))}),"getWritableMethods"),c2=o((e,t,n,r)=>{e.write(t,n)?r():e.once("drain",r)},"onWrite"),l2=o(async(e,t,n)=>{await Vt(n,t)&&(e.writable&&e.end(),await t)},"onWritableFinal"),_u=o(async(e,t,n)=>{try{await Cu(e),t.writable&&t.end()}catch(r){await i2(n),Lu(t,r)}},"onStdinFinished"),Pu=o(async({subprocessStdin:e,subprocess:t,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await Vt(n,t),await Vt(r,t)&&(Lu(e,i),await vu(t,i))},"onWritableDestroy"),Lu=o((e,t)=>{Au(e,e.writable,t)},"destroyOtherWritable"),d2=o(({subprocess:e,concurrentStreams:t,encoding:n},{from:r,to:i,binary:s=!0,preserveNewlines:a=!0}={})=>{const u=s||be.has(n),{subprocessStdout:c,waitReadableDestroy:d}=$u(e,r,t),{subprocessStdin:l,waitWritableFinal:f,waitWritableDestroy:h}=xu(e,i,t),{readableEncoding:D,readableObjectMode:p,readableHighWaterMark:m}=Bu(c,u),{read:g,onStdoutDataDone:F}=Tu({subprocessStdout:c,subprocess:e,binary:u,encoding:n,preserveNewlines:a}),w=new un({read:g,...Mu(l,e,f),destroy:Re(f2.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:e,waitReadableDestroy:d,waitWritableFinal:f,waitWritableDestroy:h})),readableHighWaterMark:m,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:p,writableObjectMode:l.writableObjectMode,encoding:D});return Iu({subprocessStdout:c,onStdoutDataDone:F,readable:w,subprocess:e,subprocessStdin:l}),_u(l,w,c),w},"createDuplex"),f2=o(async({subprocessStdout:e,subprocessStdin:t,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:s},a)=>{await Promise.all([Ou({subprocessStdout:e,subprocess:n,waitReadableDestroy:r},a),Pu({subprocessStdin:t,subprocess:n,waitWritableFinal:i,waitWritableDestroy:s},a)])},"onDuplexDestroy"),Nu=o((e,t,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{const s=r||be.has(t),a=Yn(e,n),u=fu({subprocessStdout:a,subprocess:e,binary:s,shouldEncode:!0,encoding:t,preserveNewlines:i});return h2(u,a,e)},"createIterable"),h2=o(async function*(e,t,n){try{yield*e}finally{t.readable&&t.destroy(),await n}},"iterateOnStdoutData"),D2=o((e,{encoding:t})=>{const n=o2();e.readable=s2.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.writable=u2.bind(void 0,{subprocess:e,concurrentStreams:n}),e.duplex=d2.bind(void 0,{subprocess:e,concurrentStreams:n,encoding:t}),e.iterable=Nu.bind(void 0,e,t),e[Symbol.asyncIterator]=Nu.bind(void 0,e,t,{})},"addConvertedStreams"),p2=o((e,t)=>{for(const[n,r]of g2){const i=r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}},"mergePromise"),m2=(async()=>{})().constructor.prototype,g2=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(m2,e)]),F2=o((e,t,n,r)=>{const{file:i,commandArguments:s,command:a,escapedCommand:u,startTime:c,verboseInfo:d,options:l,fileDescriptors:f}=w2(e,t,n),{subprocess:h,promise:D}=E2({file:i,commandArguments:s,options:l,startTime:c,verboseInfo:d,command:a,escapedCommand:u,fileDescriptors:f});return h.pipe=Pr.bind(void 0,{source:h,sourcePromise:D,boundOptions:{},createNested:r}),p2(h,D),Ee.set(h,{options:l,fileDescriptors:f}),h},"execaCoreAsync"),w2=o((e,t,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:a}=qi(e,t,n),{file:u,commandArguments:c,options:d}=Ls(e,t,n),l=y2(d),f=Wg(l,a);return{file:u,commandArguments:c,command:r,escapedCommand:i,startTime:s,verboseInfo:a,options:l,fileDescriptors:f}},"handleAsyncArguments"),y2=o(({timeout:e,signal:t,...n})=>{if(t!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...n,timeoutDuration:e}},"handleAsyncOptions"),E2=o(({file:e,commandArguments:t,options:n,startTime:r,verboseInfo:i,command:s,escapedCommand:a,fileDescriptors:u})=>{let c;try{c=Ic(...Ns(e,t,n))}catch(p){return Pg({error:p,command:s,escapedCommand:a,fileDescriptors:u,options:n,startTime:r,verboseInfo:i})}const d=new AbortController;Uc(Number.POSITIVE_INFINITY,d.signal);const l=[...c.stdio];r0(c,u,d),D0(c,n,d);const f={},h=Xe();c.kill=Vf.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:h,context:f,controller:d}),c.all=H0(c,n),D2(c,n),Mg(c,n);const D=b2({subprocess:c,options:n,startTime:r,verboseInfo:i,fileDescriptors:u,originalStreams:l,command:s,escapedCommand:a,context:f,onInternalError:h,controller:d});return{subprocess:c,promise:D}},"spawnSubprocessAsync"),b2=o(async({subprocess:e,options:t,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:s,command:a,escapedCommand:u,context:c,onInternalError:d,controller:l})=>{const[f,[h,D],p,m,g]=await e2({subprocess:e,options:t,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:s,onInternalError:d,controller:l});l.abort(),d.resolve();const F=p.map((y,b)=>Le(y,t,b)),w=Le(m,t,"all"),E=C2({errorInfo:f,exitCode:h,signal:D,stdio:F,all:w,ipcOutput:g,context:c,options:t,command:a,escapedCommand:u,startTime:n});return hr(E,r,t)},"handlePromise"),C2=o(({errorInfo:e,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:s,context:a,options:u,command:c,escapedCommand:d,startTime:l})=>"error"in e?fr({error:e.error,command:c,escapedCommand:d,timedOut:a.terminationReason==="timeout",isCanceled:a.terminationReason==="cancel"||a.terminationReason==="gracefulCancel",isGracefullyCanceled:a.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof Me,isForcefullyTerminated:a.isForcefullyTerminated,exitCode:t,signal:n,stdio:r,all:i,ipcOutput:s,options:u,startTime:l,isSync:!1}):aa({command:c,escapedCommand:d,stdio:r,all:i,ipcOutput:s,options:u,startTime:l}),"getAsyncResult"),Ur=o((e,t)=>{const n=Object.fromEntries(Object.entries(t).map(([r,i])=>[r,S2(r,e[r],i)]));return{...e,...n}},"mergeOptions"),S2=o((e,t,n)=>v2.has(e)&&Y(t)&&Y(n)?{...t,...n}:n,"mergeOption"),v2=new Set(["env",...Ui]),Te=o((e,t,n,r)=>{const i=o((a,u,c)=>Te(a,u,n,c),"createNested"),s=o((...a)=>A2({mapArguments:e,deepOptions:n,boundOptions:t,setBoundExeca:r,createNested:i},...a),"boundExeca");return r!==void 0&&r(s,i,t),s},"createExeca"),A2=o(({mapArguments:e,deepOptions:t={},boundOptions:n={},setBoundExeca:r,createNested:i},s,...a)=>{if(Y(s))return i(e,Ur(n,s),r);const{file:u,commandArguments:c,options:d,isSync:l}=$2({mapArguments:e,firstArgument:s,nextArguments:a,deepOptions:t,boundOptions:n});return l?gg(u,c,d):F2(u,c,d,i)},"callBoundExeca"),$2=o(({mapArguments:e,firstArgument:t,nextArguments:n,deepOptions:r,boundOptions:i})=>{const s=od(t)?id(t,n):[t,...n],[a,u,c]=Bi(...s),d=Ur(Ur(r,i),c),{file:l=a,commandArguments:f=u,options:h=d,isSync:D=!1}=e({file:a,commandArguments:u,options:d});return{file:l,commandArguments:f,options:h,isSync:D}},"parseArguments"),B2=o(({file:e,commandArguments:t})=>ku(e,t),"mapCommandAsync"),T2=o(({file:e,commandArguments:t})=>({...ku(e,t),isSync:!0}),"mapCommandSync"),ku=o((e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);const[n,...r]=I2(e);return{file:n,commandArguments:r}},"parseCommand"),I2=o(e=>{if(typeof e!="string")throw new TypeError(`The command must be a string: ${String(e)}.`);const t=e.trim();if(t==="")return[];const n=[];for(const r of t.split(O2)){const i=n.at(-1);i&&i.endsWith("\\")?n[n.length-1]=`${i.slice(0,-1)} ${r}`:n.push(r)}return n},"parseCommandString"),O2=/ +/g,R2=o((e,t,n)=>{e.sync=t(M2,n),e.s=e.sync},"setScriptSync"),x2=o(({options:e})=>Uu(e),"mapScriptAsync"),M2=o(({options:e})=>({...Uu(e),isSync:!0}),"mapScriptSync"),Uu=o(e=>({options:{..._2(e),...e}}),"getScriptOptions"),_2=o(({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:"inherit"}:{},"getScriptStdinOption"),P2={preferLocal:!0},We=Te(()=>({}));Te(()=>({isSync:!0})),Te(B2),Te(T2),Te(Gh),Te(x2,{},P2,R2),_g();let Ie=!0;const Ge=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let ct=0;if(Ge.process&&Ge.process.env&&Ge.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,NO_COLOR:n,TERM:r,COLORTERM:i}=Ge.process.env;t||n||e==="0"?Ie=!1:e==="1"||e==="2"||e==="3"?Ie=!0:r==="dumb"?Ie=!1:"CI"in Ge.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in Ge.process.env)?Ie=!0:Ie=process.stdout.isTTY,Ie&&(process.platform==="win32"||i&&(i==="truecolor"||i==="24bit")?ct=3:r&&(r.endsWith("-256color")||r.endsWith("256"))?ct=2:ct=1)}let ju={enabled:Ie,supportLevel:ct};function lt(e,t,n=1){const r=`\x1B[${e}m`,i=`\x1B[${t}m`,s=new RegExp(`\\x1b\\[${t}m`,"g");return a=>ju.enabled&&ju.supportLevel>=n?r+(""+a).replace(s,r)+i:""+a}o(lt,"kolorist");const jr=lt(2,22),Wu=lt(30,39),Ht=lt(31,39),dt=lt(32,39),Gu=lt(46,49),L2=(()=>{const e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),N2=o(e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,"isFullWidth"),k2=o(e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,"isWideNotCJKTNotEmoji"),U2=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,j2=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,zu=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,W2=/\t{1,1000}/y,Vu=new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*","yu"),G2=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,z2=new RegExp("\\p{M}+","gu"),V2={limit:1/0,ellipsis:""},Hu=o((e,t={},n={})=>{const r=t.limit??1/0,i=t.ellipsis??"",s=t?.ellipsisWidth??(i?Hu(i,V2,n).width:0),a=0,u=n.controlWidth??0,c=n.tabWidth??8,d=n.emojiWidth??2,l=2,f=n.regularWidth??1,h=n.wideWidth??l,D=[[G2,f],[U2,a],[j2,u],[W2,c],[Vu,d],[zu,h]];let p=0,m=0,g=e.length,F=0,w=!1,E=g,y=Math.max(0,r-s),b=0,S=0,$=0,T=0;e:for(;;){if(S>b||m>=g&&m>p){const I=e.slice(b,S)||e.slice(p,m);F=0;for(const G of I.replaceAll(z2,"")){const P=G.codePointAt(0)||0;if(N2(P)?T=l:k2(P)?T=h:T=f,$+T>y&&(E=Math.min(E,Math.max(b,p)+F)),$+T>r){w=!0;break e}F+=G.length,$+=T}b=S=0}if(m>=g)break e;for(let I=0,G=D.length;I<G;I++){const[P,ft]=D[I];if(P.lastIndex=m,P.test(e)){if(F=P===zu?L2(e.slice(m,P.lastIndex)):P===Vu?1:P.lastIndex-m,T=F*ft,$+T>y&&(E=Math.min(E,m+Math.floor((y-$)/ft))),$+T>r){w=!0;break e}$+=T,b=p,S=m,m=p=P.lastIndex;continue e}}m+=1}return{width:w?y:$,index:w?E:g,truncated:w,ellipsed:w&&r>=s}},"getStringTruncatedWidth"),H2={limit:1/0,ellipsis:"",ellipsisWidth:0},pe=o((e,t={})=>Hu(e,H2,t).width,"fastStringWidth"),Kt="\x1B",Ku="\x9B",K2=39,Wr="\x07",qu="[",q2="]",Yu="m",Gr=`${q2}8;;`,Zu=new RegExp(`(?:\\${qu}(?<code>\\d+)m|\\${Gr}(?<uri>.*)${Wr})`,"y"),Ju=o(e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},"getClosingCode"),Xu=o(e=>`${Kt}${qu}${e}${Yu}`,"wrapAnsiCode"),Qu=o(e=>`${Kt}${Gr}${e}${Wr}`,"wrapAnsiHyperlink"),zr=o((e,t,n)=>{const r=t[Symbol.iterator]();let i=!1,s=!1,a=e.at(-1),u=a===void 0?0:pe(a),c=r.next(),d=r.next(),l=0;for(;!c.done;){const f=c.value,h=pe(f);u+h<=n?e[e.length-1]+=f:(e.push(f),u=0),(f===Kt||f===Ku)&&(i=!0,s=t.startsWith(Gr,l+1)),i?s?f===Wr&&(i=!1,s=!1):f===Yu&&(i=!1):(u+=h,u===n&&!d.done&&(e.push(""),u=0)),c=d,d=r.next(),l+=f.length}a=e.at(-1),!u&&a!==void 0&&a.length&&e.length>1&&(e[e.length-2]+=e.pop())},"wrapWord"),Y2=o(e=>{const t=e.split(" ");let n=t.length;for(;n&&!pe(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(" ")+t.slice(n).join("")},"stringVisibleTrimSpacesRight"),Z2=o((e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let r="",i,s;const a=e.split(" ");let u=[""],c=0;for(let f=0;f<a.length;f++){const h=a[f];if(n.trim!==!1){const p=u.at(-1)??"",m=p.trimStart();p.length!==m.length&&(u[u.length-1]=m,c=pe(m))}f!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(u.push(""),c=0),(c||n.trim===!1)&&(u[u.length-1]+=" ",c++));const D=pe(h);if(n.hard&&D>t){const p=t-c,m=1+Math.floor((D-p-1)/t);Math.floor((D-1)/t)<m&&u.push(""),zr(u,h,t),c=pe(u.at(-1)??"");continue}if(c+D>t&&c&&D){if(n.wordWrap===!1&&c<t){zr(u,h,t),c=pe(u.at(-1)??"");continue}u.push(""),c=0}if(c+D>t&&n.wordWrap===!1){zr(u,h,t),c=pe(u.at(-1)??"");continue}u[u.length-1]+=h,c+=D}n.trim!==!1&&(u=u.map(f=>Y2(f)));const d=u.join(`
65
+ `);let l=!1;for(let f=0;f<d.length;f++){const h=d[f];if(r+=h,l)l=!1;else if(l=h>="\uD800"&&h<="\uDBFF",l)continue;if(h===Kt||h===Ku){Zu.lastIndex=f+1;const p=Zu.exec(d)?.groups;if(p?.code!==void 0){const m=Number.parseFloat(p.code);i=m===K2?void 0:m}else p?.uri!==void 0&&(s=p.uri.length===0?void 0:p.uri)}if(d[f+1]===`
66
+ `){s&&(r+=Qu(""));const D=i?Ju(i):void 0;i&&D&&(r+=Xu(D))}else h===`
67
+ `&&(i&&Ju(i)&&(r+=Xu(i)),s&&(r+=Qu(s)))}return r},"exec"),J2=/\r?\n/;function ze(e,t,n){return String(e).normalize().split(J2).map(r=>Z2(r,t,n)).join(`
68
+ `)}o(ze,"wrapAnsi");var Vr,ec;function X2(){if(ec)return Vr;ec=1;const e="\x1B",t=`${e}[`,n="\x07",r={to(a,u){return u?`${t}${u+1};${a+1}H`:`${t}${a+1}G`},move(a,u){let c="";return a<0?c+=`${t}${-a}D`:a>0&&(c+=`${t}${a}C`),u<0?c+=`${t}${-u}A`:u>0&&(c+=`${t}${u}B`),c},up:o((a=1)=>`${t}${a}A`,"up"),down:o((a=1)=>`${t}${a}B`,"down"),forward:o((a=1)=>`${t}${a}C`,"forward"),backward:o((a=1)=>`${t}${a}D`,"backward"),nextLine:o((a=1)=>`${t}E`.repeat(a),"nextLine"),prevLine:o((a=1)=>`${t}F`.repeat(a),"prevLine"),left:`${t}G`,hide:`${t}?25l`,show:`${t}?25h`,save:`${e}7`,restore:`${e}8`},i={up:o((a=1)=>`${t}S`.repeat(a),"up"),down:o((a=1)=>`${t}T`.repeat(a),"down")},s={screen:`${t}2J`,up:o((a=1)=>`${t}1J`.repeat(a),"up"),down:o((a=1)=>`${t}J`.repeat(a),"down"),line:`${t}2K`,lineEnd:`${t}K`,lineStart:`${t}1K`,lines(a){let u="";for(let c=0;c<a;c++)u+=this.line+(c<a-1?r.up():"");return a&&(u+=r.left),u}};return Vr={cursor:r,scroll:i,erase:s,beep:n},Vr}o(X2,"requireSrc");var U=X2(),Q2=Object.defineProperty,eF=o((e,t,n)=>t in e?Q2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,"__defNormalProp"),j=o((e,t,n)=>eF(e,typeof t!="symbol"?t+"":t,n),"__publicField");function qt(e,t,n){if(!n.some(a=>!a.disabled))return e;const r=e+t,i=Math.max(n.length-1,0),s=r<0?i:r>i?0:r;return n[s].disabled?qt(s,t<0?-1:1,n):s}o(qt,"f");const tF=["up","down","left","right","space","enter","cancel"],ae={actions:new Set(tF),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0};function Hr(e,t){if(typeof e=="string")return ae.aliases.get(e)===t;for(const n of e)if(n!==void 0&&Hr(n,t))return!0;return!1}o(Hr,"C");function nF(e,t){if(e===t)return;const n=e.split(`
69
+ `),r=t.split(`
70
+ `),i=Math.max(n.length,r.length),s=[];for(let a=0;a<i;a++)n[a]!==r[a]&&s.push(a);return{lines:s,numLinesBefore:n.length,numLinesAfter:r.length,numLines:i}}o(nF,"Y");const rF=globalThis.process.platform.startsWith("win"),Kr=Symbol("clack:cancel");function tc(e){return e===Kr}o(tc,"R");function Yt(e,t){const n=e;n.isTTY&&n.setRawMode(t)}o(Yt,"w$1");function oF({input:e=Io,output:t=on,overwrite:n=!0,hideCursor:r=!0}={}){const i=mt.createInterface({input:e,output:t,prompt:"",tabSize:1});mt.emitKeypressEvents(e,i),e instanceof Ro&&e.isTTY&&e.setRawMode(!0);const s=o((a,{name:u,sequence:c})=>{const d=String(a);if(Hr([d,u,c],"cancel")){r&&t.write(U.cursor.show),process.exit(0);return}if(!n)return;const l=u==="return"?0:-1,f=u==="return"?-1:0;mt.moveCursor(t,l,f,()=>{mt.clearLine(t,1,()=>{e.once("keypress",s)})})},"n");return r&&t.write(U.cursor.hide),e.once("keypress",s),()=>{e.off("keypress",s),r&&t.write(U.cursor.show),e instanceof Ro&&e.isTTY&&!rF&&e.setRawMode(!1),i.terminal=!1,i.close()}}o(oF,"W");const qr=o(e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,"A"),nc=o(e=>"rows"in e&&typeof e.rows=="number"?e.rows:20,"L");function Zt(e,t,n,r=n,i=n,s){const a=qr(e??on);return ze(t,a-n.length,{hard:!0,trim:!1}).split(`
71
+ `).map((u,c,d)=>{const l=u;return c===0?`${r}${l}`:c===d.length-1?`${i}${l}`:`${n}${l}`}).join(`
72
+ `)}o(Zt,"B");function iF(e,t){if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");return n.issues?.at(0)?.message}return e(t)}o(iF,"P$1");const yo=class yo{constructor(t,n=!0){j(this,"input"),j(this,"output"),j(this,"_abortSignal"),j(this,"rl"),j(this,"opts"),j(this,"_render"),j(this,"_track",!1),j(this,"_prevFrame",""),j(this,"_subscribers",new Map),j(this,"_cursor",0),j(this,"state","initial"),j(this,"error",""),j(this,"value"),j(this,"userInput","");const{input:r=Io,output:i=on,render:s,signal:a,...u}=t;this.opts=u,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=s.bind(this),this._track=n,this._abortSignal=a,this.input=r,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(t,n){const r=this._subscribers.get(t)??[];r.push(n),this._subscribers.set(t,r)}on(t,n){this.setSubscriber(t,{cb:n})}once(t,n){this.setSubscriber(t,{cb:n,once:!0})}emit(t,...n){const r=this._subscribers.get(t)??[],i=[];for(const s of r)s.cb(...n),s.once&&i.push(()=>r.splice(r.indexOf(s),1));for(const s of i)s()}prompt(){return new Promise(t=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(Kr);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=Hc.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),Yt(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(U.cursor.show),this.output.off("resize",this.render),Yt(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(U.cursor.show),this.output.off("resize",this.render),Yt(this.input,!1),t(Kr)})})}_isActionKey(t,n){return t===" "}_shouldSubmit(t,n){return!0}_setValue(t){this.value=t,this.emit("value",this.value)}_setUserInput(t,n){this.userInput=t??"",this.emit("userInput",this.userInput),n&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(t,n){if(this._track&&n.name!=="return"&&(n.name&&this._isActionKey(t,n)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),n?.name&&(!this._track&&ae.aliases.has(n.name)&&this.emit("cursor",ae.aliases.get(n.name)),ae.actions.has(n.name)&&this.emit("cursor",n.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),this.emit("key",t,n),n?.name==="return"&&this._shouldSubmit(t,n)){if(this.opts.validate){const r=iF(this.opts.validate,this.value);r&&(this.error=r instanceof Error?r.message:r,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}Hr([t,n?.name,n?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
73
+ `),Yt(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const t=ze(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
74
+ `).length-1;this.output.write(U.cursor.move(-999,t*-1))}render(){const t=ze(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(U.cursor.hide);else{const n=nF(this._prevFrame,t),r=nc(this.output);if(this.restoreCursor(),n){const i=Math.max(0,n.numLinesAfter-r),s=Math.max(0,n.numLinesBefore-r);let a=n.lines.find(u=>u>=i);if(a===void 0){this._prevFrame=t;return}if(n.lines.length===1){this.output.write(U.cursor.move(0,a-s)),this.output.write(U.erase.lines(1));const u=t.split(`
75
+ `);this.output.write(u[a]),this._prevFrame=t,this.output.write(U.cursor.move(0,u.length-a-1));return}else if(n.lines.length>1){if(i<s)a=i;else{const c=a-s;c>0&&this.output.write(U.cursor.move(0,c))}this.output.write(U.erase.down());const u=t.split(`
76
+ `).slice(a);this.output.write(u.join(`
77
+ `)),this._prevFrame=t;return}}this.output.write(U.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}};o(yo,"m");let Jt=yo;const Eo=class Eo extends Jt{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",n=>{this.output.write(U.cursor.move(0,-1)),this.value=n,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};o(Eo,"Z");let Yr=Eo;const bo=class bo extends Jt{constructor(t){super(t,!1),j(this,"options"),j(this,"cursor",0),this.options=t.options;const n=this.options.findIndex(({value:i})=>i===t.initialValue),r=n===-1?0:n;this.cursor=this.options[r].disabled?qt(r,1,this.options):r,this.changeValue(),this.on("cursor",i=>{switch(i){case"left":case"up":this.cursor=qt(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=qt(this.cursor,1,this.options);break}this.changeValue()})}get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}};o(bo,"ht");let Zr=bo;function sF(){return O.platform!=="win32"?O.env.TERM!=="linux":!!O.env.CI||!!O.env.WT_SESSION||!!O.env.TERMINUS_SUBLIME||O.env.ConEmuTask==="{cmd::Cmder}"||O.env.TERM_PROGRAM==="Terminus-Sublime"||O.env.TERM_PROGRAM==="vscode"||O.env.TERM==="xterm-256color"||O.env.TERM==="alacritty"||O.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}o(sF,"se");const Jr=sF(),aF=o(()=>process.env.CI==="true","at"),ue=o((e,t)=>Jr?e:t,"w"),uF=ue("\u25C6","*"),rc=ue("\u25A0","x"),oc=ue("\u25B2","x"),ic=ue("\u25C7","o"),cF=ue("\u250C","T"),k=ue("\u2502","|"),Xr=ue("\u2514","\u2014"),Qr=ue("\u25CF",">"),Xt=ue("\u25CB"," "),sc=o(e=>{switch(e){case"initial":case"active":return C("cyan",uF);case"cancel":return C("red",rc);case"error":return C("yellow",oc);case"submit":return C("green",ic)}},"P"),lF=o(e=>{switch(e){case"initial":case"active":return C("cyan",k);case"cancel":return C("red",k);case"error":return C("yellow",k);case"submit":return C("green",k)}},"ft"),ac=o((e,t,n,r,i,s=!1)=>{let a=t,u=0;if(s)for(let c=r-1;c>=n&&(a-=e[c].length,u++,!(a<=i));c--);else for(let c=n;c<r&&(a-=e[c].length,u++,!(a<=i));c++);return{lineCount:a,removals:u}},"Pt"),dF=o(({cursor:e,options:t,style:n,output:r=process.stdout,maxItems:i=Number.POSITIVE_INFINITY,columnPadding:s=0,rowPadding:a=4})=>{const u=qr(r)-s,c=nc(r),d=C("dim","..."),l=Math.max(c-a,0),f=Math.max(Math.min(i,l),5);let h=0;e>=f-3&&(h=Math.max(Math.min(e-f+3,t.length-f),0));let D=f<t.length&&h>0,p=f<t.length&&h+f<t.length;const m=Math.min(h+f,t.length),g=[];let F=0;D&&F++,p&&F++;const w=h+(D?1:0),E=m-(p?1:0);for(let b=w;b<E;b++){const S=ze(n(t[b],b===e),u,{hard:!0,trim:!1}).split(`
78
+ `);g.push(S),F+=S.length}if(F>l){let b=0,S=0,$=F;const T=e-w;let I=l;const G=o(()=>ac(g,$,0,T,I),"j"),P=o(()=>ac(g,$,T+1,g.length,I,!0),"k");D?({lineCount:$,removals:b}=G(),$>I&&(p||(I-=1),{lineCount:$,removals:S}=P())):(p||(I-=1),{lineCount:$,removals:S}=P(),$>I&&(I-=1,{lineCount:$,removals:b}=G())),b>0&&(D=!0,g.splice(0,b)),S>0&&(p=!0,g.splice(g.length-S,S))}const y=[];D&&y.push(d);for(const b of g)for(const S of b)y.push(S);return p&&y.push(d),y},"F"),fF=o(e=>{const t=e.active??"Yes",n=e.inactive??"No";return new Yr({active:t,inactive:n,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){const r=e.withGuide??ae.withGuide,i=`${sc(this.state)} `,s=r?`${C("gray",k)} `:"",a=Zt(e.output,e.message,s,i),u=`${r?`${C("gray",k)}
79
+ `:""}${a}
80
+ `,c=this.value?t:n;switch(this.state){case"submit":{const d=r?`${C("gray",k)} `:"";return`${u}${d}${C("dim",c)}`}case"cancel":{const d=r?`${C("gray",k)} `:"";return`${u}${d}${C(["strikethrough","dim"],c)}${r?`
81
+ ${C("gray",k)}`:""}`}default:{const d=r?`${C("cyan",k)} `:"",l=r?C("cyan",Xr):"";return`${u}${d}${this.value?`${C("green",Qr)} ${t}`:`${C("dim",Xt)} ${C("dim",t)}`}${e.vertical?r?`
82
+ ${C("cyan",k)} `:`
83
+ `:` ${C("dim","/")} `}${this.value?`${C("dim",Xt)} ${C("dim",n)}`:`${C("green",Qr)} ${n}`}
84
+ ${l}
85
+ `}}}}).prompt()},"le"),uc=o((e="",t)=>{const n=process.stdout,r=`${C("gray",cF)} `;n.write(`${r}${e}
86
+ `)},"ye"),Oe=o((e="",t)=>{const n=process.stdout,r=`${C("gray",k)}
87
+ ${C("gray",Xr)} `;n.write(`${r}${e}
88
+
89
+ `)},"fe"),hF=o(e=>C("magenta",e),"_e"),eo=o(({indicator:e="dots",onCancel:t,output:n=process.stdout,cancelMessage:r,errorMessage:i,frames:s=Jr?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:a=Jr?80:120,signal:u,...c}={})=>{const d=aF();let l,f,h=!1,D=!1,p="",m,g=performance.now();const F=qr(n),w=c?.styleFrame??hF,E=o(_=>{const q=_>1?i??ae.messages.error:r??ae.messages.cancel;D=_===1,h&&(He(q,_),D&&typeof t=="function"&&t())},"C"),y=o(()=>E(2),"S"),b=o(()=>E(1),"b"),S=o(()=>{process.on("uncaughtExceptionMonitor",y),process.on("unhandledRejection",y),process.on("SIGINT",b),process.on("SIGTERM",b),process.on("exit",E),u&&u.addEventListener("abort",b)},"G"),$=o(()=>{process.removeListener("uncaughtExceptionMonitor",y),process.removeListener("unhandledRejection",y),process.removeListener("SIGINT",b),process.removeListener("SIGTERM",b),process.removeListener("exit",E),u&&u.removeEventListener("abort",b)},"M"),T=o(()=>{if(m===void 0)return;d&&n.write(`
90
+ `);const _=ze(m,F,{hard:!0,trim:!1}).split(`
91
+ `);_.length>1&&n.write(U.cursor.up(_.length-1)),n.write(U.cursor.to(0)),n.write(U.erase.down())},"N"),I=o(_=>_.replace(/\.+$/,""),"O"),G=o(_=>{const q=(performance.now()-_)/1e3,re=Math.floor(q/60),oe=Math.floor(q%60);return re>0?`[${re}m ${oe}s]`:`[${oe}s]`},"j"),P=c.withGuide??ae.withGuide,ft=o((_="")=>{h=!0,l=oF({output:n}),p=I(_),g=performance.now(),P&&n.write(`${C("gray",k)}
92
+ `);let q=0,re=0;S(),f=setInterval(()=>{if(d&&p===m)return;T(),m=p;const oe=w(s[q]);let ht;if(d)ht=`${oe} ${p}...`;else if(e==="timer")ht=`${oe} ${p} ${G(g)}`;else{const vc=".".repeat(Math.floor(re)).slice(0,3);ht=`${oe} ${p}${vc}`}const Sc=ze(ht,F,{hard:!0,trim:!1});n.write(Sc),q=q+1<s.length?q+1:0,re=re<4?re+.125:0},a)},"rt"),He=o((_="",q=0,re=!1)=>{if(!h)return;h=!1,clearInterval(f),T();const oe=q===0?C("green",ic):q===1?C("red",rc):C("red",oc);p=_??p,re||(e==="timer"?n.write(`${oe} ${p} ${G(g)}
93
+ `):n.write(`${oe} ${p}
94
+ `)),$(),l()},"W$1");return{start:ft,stop:o((_="")=>He(_,0),"stop"),message:o((_="")=>{p=I(_??p)},"message"),cancel:o((_="")=>He(_,1),"cancel"),error:o((_="")=>He(_,2),"error"),clear:o(()=>He("",0,!0),"clear"),get isCancelled(){return D}}},"vt"),Qt=o((e,t)=>e.includes(`
95
+ `)?e.split(`
96
+ `).map(n=>t(n)).join(`
97
+ `):t(e),"it"),DF=o(e=>{const t=o((n,r)=>{const i=n.label??String(n.value);switch(r){case"disabled":return`${C("gray",Xt)} ${Qt(i,s=>C("gray",s))}${n.hint?` ${C("dim",`(${n.hint??"disabled"})`)}`:""}`;case"selected":return`${Qt(i,s=>C("dim",s))}`;case"active":return`${C("green",Qr)} ${i}${n.hint?` ${C("dim",`(${n.hint})`)}`:""}`;case"cancelled":return`${Qt(i,s=>C(["strikethrough","dim"],s))}`;default:return`${C("dim",Xt)} ${Qt(i,s=>C("dim",s))}`}},"i");return new Zr({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){const n=e.withGuide??ae.withGuide,r=`${sc(this.state)} `,i=`${lF(this.state)} `,s=Zt(e.output,e.message,i,r),a=`${n?`${C("gray",k)}
98
+ `:""}${s}
99
+ `;switch(this.state){case"submit":{const u=n?`${C("gray",k)} `:"",c=Zt(e.output,t(this.options[this.cursor],"selected"),u);return`${a}${c}`}case"cancel":{const u=n?`${C("gray",k)} `:"",c=Zt(e.output,t(this.options[this.cursor],"cancelled"),u);return`${a}${c}${n?`
100
+ ${C("gray",k)}`:""}`}default:{const u=n?`${C("cyan",k)} `:"",c=n?C("cyan",Xr):"",d=a.split(`
101
+ `).length,l=n?2:1;return`${a}${u}${dF({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:u.length,rowPadding:d+l,style:o((f,h)=>t(f,f.disabled?"disabled":h?"active":"inactive"),"style")}).join(`
102
+ ${u}`)}
103
+ ${c}
104
+ `}}}}).prompt()},"Ee");`${C("gray",k)}`;const Co=class Co extends Error{};o(Co,"KnownError");let R=Co;const to=" ",en=o(e=>{e instanceof Error&&!(e instanceof R)&&(e.stack&&console.error(jr(e.stack.split(`
105
+ `).slice(1).join(`
106
+ `))),console.error(`
107
+ ${to}${jr(`aicommit v${bn.version}`)}`),console.error(`
108
+ ${to}Please open a Bug report with the information above:`),console.error(`${to}https://github.com/NegoZiatoR/ai-commit/issues/new/choose`))},"handleCliError"),no=o(async()=>{const{stdout:e,failed:t}=await We("git",["rev-parse","--show-toplevel"],{reject:!1});if(t)throw new R("The current directory must be a Git repository!");return e},"assertGitRepo"),ro=o(e=>`:(exclude)${e}`,"excludeFromDiff"),cc=["package-lock.json","*.lock"].map(ro),lc=o(async e=>{const t=["diff","--cached","--diff-algorithm=minimal"],{stdout:n}=await We("git",[...t,"--name-only",...cc,...e?e.map(ro):[]]);if(!n)return;const{stdout:r}=await We("git",[...t,...cc,...e?e.map(ro):[]]);return{files:n.split(`
109
+ `),diff:r}},"getStagedDiff"),pF=o(e=>`Detected ${e.length.toLocaleString()} staged file${e.length>1?"s":""}`,"getDetectedMessage");var oo,dc;function mF(){if(dc)return oo;dc=1;const{hasOwnProperty:e}=Object.prototype,t=o((u,c={})=>{typeof c=="string"&&(c={section:c}),c.align=c.align===!0,c.newline=c.newline===!0,c.sort=c.sort===!0,c.whitespace=c.whitespace===!0||c.align===!0,c.platform=c.platform||typeof process<"u"&&process.platform,c.bracketedArray=c.bracketedArray!==!1;const d=c.platform==="win32"?`\r
110
+ `:`
111
+ `,l=c.whitespace?" = ":"=",f=[],h=c.sort?Object.keys(u).sort():Object.keys(u);let D=0;c.align&&(D=s(h.filter(g=>u[g]===null||Array.isArray(u[g])||typeof u[g]!="object").map(g=>Array.isArray(u[g])?`${g}[]`:g).concat([""]).reduce((g,F)=>s(g).length>=s(F).length?g:F)).length);let p="";const m=c.bracketedArray?"[]":"";for(const g of h){const F=u[g];if(F&&Array.isArray(F))for(const w of F)p+=s(`${g}${m}`).padEnd(D," ")+l+s(w)+d;else F&&typeof F=="object"?f.push(g):p+=s(g).padEnd(D," ")+l+s(F)+d}c.section&&p.length&&(p="["+s(c.section)+"]"+(c.newline?d+d:d)+p);for(const g of f){const F=n(g,".").join("\\."),w=(c.section?c.section+".":"")+F,E=t(u[g],{...c,section:w});p.length&&E.length&&(p+=d),p+=E}return p},"encode");function n(u,c){var d=0,l=0,f=0,h=[];do if(f=u.indexOf(c,d),f!==-1){if(d=f+c.length,f>0&&u[f-1]==="\\")continue;h.push(u.slice(l,f)),l=f+c.length}while(f!==-1);return h.push(u.slice(l)),h}o(n,"splitSections");const r=o((u,c={})=>{c.bracketedArray=c.bracketedArray!==!1;const d=Object.create(null);let l=d,f=null;const h=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,D=u.split(/[\r\n]+/g),p={};for(const g of D){if(!g||g.match(/^\s*[;#]/)||g.match(/^\s*$/))continue;const F=g.match(h);if(!F)continue;if(F[1]!==void 0){if(f=a(F[1]),f==="__proto__"){l=Object.create(null);continue}l=d[f]=d[f]||Object.create(null);continue}const w=a(F[2]);let E;c.bracketedArray?E=w.length>2&&w.slice(-2)==="[]":(p[w]=(p?.[w]||0)+1,E=p[w]>1);const y=E&&w.endsWith("[]")?w.slice(0,-2):w;if(y==="__proto__")continue;const b=F[3]?a(F[4]):!0,S=b==="true"||b==="false"||b==="null"?JSON.parse(b):b;E&&(e.call(l,y)?Array.isArray(l[y])||(l[y]=[l[y]]):l[y]=[]),Array.isArray(l[y])?l[y].push(S):l[y]=S}const m=[];for(const g of Object.keys(d)){if(!e.call(d,g)||typeof d[g]!="object"||Array.isArray(d[g]))continue;const F=n(g,".");l=d;const w=F.pop(),E=w.replace(/\\\./g,".");for(const y of F)y!=="__proto__"&&((!e.call(l,y)||typeof l[y]!="object")&&(l[y]=Object.create(null)),l=l[y]);l===d&&E===w||(l[E]=d[g],m.push(g))}for(const g of m)delete d[g];return d},"decode"),i=o(u=>u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'"),"isQuoted"),s=o(u=>typeof u!="string"||u.match(/[=\r\n]/)||u.match(/^\[/)||u.length>1&&i(u)||u!==u.trim()?JSON.stringify(u):u.split(";").join("\\;").split("#").join("\\#"),"safe"),a=o(u=>{if(u=(u||"").trim(),i(u)){u.charAt(0)==="'"&&(u=u.slice(1,-1));try{u=JSON.parse(u)}catch{}}else{let c=!1,d="";for(let l=0,f=u.length;l<f;l++){const h=u.charAt(l);if(c)"\\;#".indexOf(h)!==-1?d+=h:d+="\\"+h,c=!1;else{if(";#".indexOf(h)!==-1)break;h==="\\"?c=!0:d+=h}}return c&&(d+="\\"),d.trim()}return u},"unsafe");return oo={parse:r,decode:r,stringify:t,encode:t,safe:s,unsafe:a},oo}o(mF,"requireIni");var gF=mF(),fc=Yi(gF);const tn=o(e=>W.lstat(e).then(()=>!0,()=>!1),"fileExists"),io=o(async e=>{try{let t;try{t=e||await no()}catch(a){if(a instanceof R&&a.message.includes("Git repository"))return;throw a}const n=ce.join(t,".ai-commit.json");if(!await tn(n))return;const i=await W.readFile(n,"utf8");return JSON.parse(i)}catch(t){if(t instanceof R)throw t;return}},"getProjectConfig");function FF(e){const t={},n=e.split(`
112
+ `);for(const r of n){const i=r.trim();if(!i||i.startsWith("#"))continue;const s=i.match(/^([A-Z_][A-Z0-9_]*)\s*=\s*(.*)$/i);if(!s)continue;const[,a,u]=s;let c=u.trim();(c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))&&(c=c.slice(1,-1)),t[a]=c}return t}o(FF,"parseEnvContent");async function hc(e){const{filename:t=".env",directory:n=process.cwd(),override:r=!1}=e||{},i=ce.join(n,t);if(!await tn(i))return{};try{const a=await W.readFile(i,"utf8"),u=FF(a);for(const[c,d]of Object.entries(u))(r||process.env[c]===void 0)&&(process.env[c]=d);return u}catch{return{}}}o(hc,"loadEnvFile");async function wF(){process.env.NODE_ENV==="test"?await hc({filename:".env.local"}):await hc({filename:".env"})}o(wF,"loadEnvironment");const Dc=["openai","anthropic","azure-openai","ollama","custom"],yF=["","conventional"],{hasOwnProperty:EF}=Object.prototype,pc=o((e,t)=>EF.call(e,t),"hasOwn"),x=o((e,t,n)=>{if(!t)throw new R(`Invalid config property ${e}: ${n}`)},"parseAssert"),nn={provider(e){return e?(x("provider",Dc.includes(e),`Must be one of: ${Dc.join(", ")}`),e):"openai"},OPENAI_KEY(e){if(e)return x("OPENAI_KEY",e.startsWith("sk-"),'Must start with "sk-"'),e},ANTHROPIC_KEY(e){if(e)return x("ANTHROPIC_KEY",e.startsWith("sk-ant-"),'Must start with "sk-ant-"'),e},AZURE_OPENAI_KEY(e){return e},AZURE_ENDPOINT(e){if(e)return x("AZURE_ENDPOINT",/^https?:\/\//.test(e),"Must be a valid URL"),e},OLLAMA_ENDPOINT(e){return e?(x("OLLAMA_ENDPOINT",/^https?:\/\//.test(e),"Must be a valid URL"),e):"http://localhost:11434"},CUSTOM_ENDPOINT(e){if(e)return x("CUSTOM_ENDPOINT",/^https?:\/\//.test(e),"Must be a valid URL"),e},CUSTOM_KEY(e){return e},locale(e){return e?(x("locale",e,"Cannot be empty"),x("locale",/^[a-z-]+$/i.test(e),"Must be a valid locale (letters and dashes/underscores). You can consult the list of codes in: https://wikipedia.org/wiki/List_of_ISO_639-1_codes"),e):"en"},generate(e){if(!e)return 1;x("generate",/^\d+$/.test(e),"Must be an integer");const t=Number(e);return x("generate",t>0,"Must be greater than 0"),x("generate",t<=5,"Must be less or equal to 5"),t},type(e){return e?(x("type",yF.includes(e),"Invalid commit type"),e):""},proxy(e){if(!(!e||e.length===0))return x("proxy",/^https?:\/\//.test(e),"Must be a valid URL"),e},model(e){return!e||e.length===0?"gpt-4o-mini":e},timeout(e){if(!e)return 1e4;x("timeout",/^\d+$/.test(e),"Must be an integer");const t=Number(e);return x("timeout",t>=500,"Must be greater than 500ms"),t},temperature(e){if(!e)return .2;x("temperature",/^(2|\d)(\.\d{1,2})?$/.test(e),"Must be decimal between 0 and 2");const t=Number(e);return x("temperature",t>0,"Must be greater than 0"),x("temperature",t<=2,"Must be less than or equal to 2"),t},"max-length"(e){if(!e)return 50;x("max-length",/^\d+$/.test(e),"Must be an integer");const t=Number(e);return x("max-length",t>=20,"Must be greater than 20 characters"),t},"max-completion-tokens"(e){if(!e)return 1e4;x("max-completion-tokens",/^\d+$/.test(e),"Must be an integer");const t=Number(e);return x("max-completion-tokens",t>0,"Must be greater than 0"),t},"auto-confirm"(e){return e?typeof e=="boolean"?e:(x("auto-confirm",/^(?:true|false)$/.test(e),"Must be a boolean"),e==="true"):!1},"prepend-reference"(e){return e?typeof e=="boolean"?e:(x("prepend-reference",/^(?:true|false)$/.test(e),"Must be a boolean"),e==="true"):!1},signoff(e){return e?typeof e=="boolean"?e:(x("signoff",/^(?:true|false)$/.test(e),"Must be a boolean"),e==="true"):!1}},so=ce.join(Kc.homedir(),".aicommit"),mc=o(async()=>{if(!await tn(so))return Object.create(null);const t=await W.readFile(so,"utf8");return fc.parse(t)},"readConfigFile"),bF=o(e=>{const t=e.provider;switch(t){case"openai":if(!e.OPENAI_KEY)throw new R("Please set your OpenAI API key via `aicommit config set OPENAI_KEY=<your token>`");break;case"anthropic":if(!e.ANTHROPIC_KEY)throw new R("Please set your Anthropic API key via `aicommit config set ANTHROPIC_KEY=<your token>`\nGet your API key from: https://console.anthropic.com/");break;case"azure-openai":if(!e.AZURE_OPENAI_KEY)throw new R("Please set your Azure OpenAI API key via `aicommit config set AZURE_OPENAI_KEY=<your token>`");if(!e.AZURE_ENDPOINT)throw new R("Please set your Azure OpenAI endpoint via `aicommit config set AZURE_ENDPOINT=<your endpoint>`");break;case"ollama":break;case"custom":if(!e.CUSTOM_ENDPOINT)throw new R("Please set your custom endpoint via `aicommit config set CUSTOM_ENDPOINT=<your endpoint>`");break;default:throw new R(`Unknown provider: ${t}`)}},"validateProviderConfig"),ao=o(async(e,t)=>{await wF();const n=await mc(),r=await io(),i={};for(const a of Object.keys(nn)){const u=nn[a];let c=r?.[a]??e?.[a]??process.env[a]??n[a];if(typeof c=="boolean"&&(c=c.toString()),t)try{i[a]=u(c)}catch{}else i[a]=u(c)}const s=i;return t||bF(s),s},"getConfig"),CF=o(async e=>{const t=await mc();for(const[n,r]of e){if(!pc(nn,n))throw new R(`Invalid config property: ${n}`);const i=nn[n](r);t[n]=i}await W.writeFile(so,fc.stringify(t),"utf8")},"setConfigs"),gc={openai:o(()=>import("./openai-DUJuFNjR.mjs"),"openai"),anthropic:o(()=>import("./anthropic-DraLRrxH.mjs"),"anthropic"),"azure-openai":o(()=>import("./azure-openai-BSw0I4Mq.mjs"),"azure-openai"),ollama:o(()=>import("./ollama-Dmh92NI3.mjs"),"ollama"),custom:o(()=>import("./custom-CX8D3lva.mjs"),"custom")};async function Fc(e,t){const n=gc[e];if(!n)throw new R(`Unknown provider type: ${e}. Supported providers: ${Object.keys(gc).join(", ")}`);try{const i=(await n()).default;return new i(t)}catch(r){throw r instanceof R?r:r.code==="ERR_MODULE_NOT_FOUND"?new R(`Provider "${e}" is not yet implemented. Currently supported: openai`):new R(`Failed to initialize provider "${e}": ${r.message}`)}}o(Fc,"createProvider");var SF=o(async(e,t,n,r,i)=>(async()=>{uc(Gu(Wu(" aicommit "))),await no();const s=eo();n&&await We("git",["add","--update"]),s.start("Detecting staged files");const a=await lc(t);if(!a)throw s.stop("Detecting staged files"),new R("No staged changes found. Stage your changes manually, or automatically stage all changes with the `--all` flag.");s.stop(`${pF(a.files)}:
113
+ ${a.files.map(D=>` ${D}`).join(`
114
+ `)}`);const{env:u}=process,c=await ao({OPENAI_KEY:u.OPENAI_KEY||u.OPENAI_API_KEY,proxy:u.https_proxy||u.HTTPS_PROXY||u.http_proxy||u.HTTP_PROXY,generate:e?.toString(),type:r?.toString()}),d=eo();d.start("The AI is analyzing your changes");let l;try{const D={model:c.model,locale:c.locale,maxLength:c["max-length"],type:c.type,timeout:c.timeout,temperature:c.temperature,maxCompletionTokens:c["max-completion-tokens"],proxy:c.proxy};let p;switch(c.provider){case"openai":p={...D,apiKey:c.OPENAI_KEY};break;case"anthropic":p={...D,apiKey:c.ANTHROPIC_KEY};break;case"azure-openai":p={...D,apiKey:c.AZURE_OPENAI_KEY,endpoint:c.AZURE_ENDPOINT};break;case"ollama":p={...D,endpoint:c.OLLAMA_ENDPOINT};break;case"custom":p={...D,endpoint:c.CUSTOM_ENDPOINT,apiKey:c.CUSTOM_KEY};break;default:p={...D,apiKey:c.OPENAI_KEY}}const m=await Fc(c.provider,p),g=await io();l=(await m.generateCommitMessage({diff:a.diff,completions:c.generate,projectConfig:g})).messages}finally{d.stop("Changes analyzed")}if(l.length===0)throw new R("No commit messages were generated. Try again.");let f;if(l.length===1){[f]=l;let D;if(c["auto-confirm"]?(D=!0,Oe(`${dt("\u2714")} Auto confirmed commit message.
115
+
116
+ ${f}
117
+ `)):D=await fF({message:`Use this commit message?
118
+
119
+ ${f}
120
+ `}),!D||tc(D)){Oe("Commit cancelled");return}}else{const D=await DF({message:`Pick a commit message to use: ${jr("(Ctrl+c to exit)")}`,options:l.map(p=>({label:p,value:p}))});if(tc(D)){Oe("Commit cancelled");return}f=D}if(c["prepend-reference"]){const{stdout:D}=await We("git",["branch","--show-current"]),p=D.match(/([a-zA-Z])+-([0-9]+)/)?.[0];p?.length&&(f=`${p?.toUpperCase()}: ${f}`)}const h=["commit","-m",f,...i];c.signoff&&h.push("--signoff"),await We("git",h),Oe(`${dt("\u2714")} Successfully committed!`)})().catch(s=>{Oe(`${Ht("\u2716")} ${s.message}`),en(s),process.exit(1)}),"aicommit");const[uo,vF]=process.argv.slice(2);var AF=o(()=>(async()=>{if(!uo)throw new R('Commit message file path is missing. This file should be called from the "prepare-commit-msg" git hook');if(vF)return;const e=await lc();if(!e)return;uc(Gu(Wu(" aicommit ")));const{env:t}=process,n=await ao({proxy:t.https_proxy||t.HTTPS_PROXY||t.http_proxy||t.HTTP_PROXY}),r=eo();r.start("The AI is analyzing your changes");let i;try{const d={model:n.model,locale:n.locale,maxLength:n["max-length"],type:n.type,timeout:n.timeout,temperature:n.temperature,maxCompletionTokens:n["max-completion-tokens"],proxy:n.proxy};let l;switch(n.provider){case"openai":l={...d,apiKey:n.OPENAI_KEY};break;case"anthropic":l={...d,apiKey:n.ANTHROPIC_KEY};break;case"azure-openai":l={...d,apiKey:n.AZURE_OPENAI_KEY,endpoint:n.AZURE_ENDPOINT};break;case"ollama":l={...d,endpoint:n.OLLAMA_ENDPOINT};break;case"custom":l={...d,endpoint:n.CUSTOM_ENDPOINT,apiKey:n.CUSTOM_KEY};break;default:l={...d,apiKey:n.OPENAI_KEY}}const f=await Fc(n.provider,l),h=await io();i=(await f.generateCommitMessage({diff:e.diff,completions:n.generate,projectConfig:h})).messages}finally{r.stop("Changes analyzed")}const a=await W.readFile(uo,"utf8")!=="",u=i.length>1;let c="";a&&(c=`# \u{1F916} AI generated commit${u?"s":""}
121
+ `),u?(a&&(c+=`# Select one of the following messages by uncommeting:
122
+ `),c+=`
123
+ ${i.map(d=>`# ${d}`).join(`
124
+ `)}`):(a&&(c+=`# Edit the message below and commit:
125
+ `),c+=`
126
+ ${i[0]}
127
+ `),await W.appendFile(uo,c),Oe(`${dt("\u2714")} Saved commit message!`)})().catch(e=>{Oe(`${Ht("\u2716")} ${e.message}`),en(e),process.exit(1)}),"prepareCommitMessageHook"),$F=En({name:"config",parameters:["<mode>","<key=value...>"]},e=>{(async()=>{const{mode:t,keyValue:n}=e._;if(t==="get"){const r=await ao({},!0);for(const i of n)pc(r,i)&&console.log(`${i}=${r[i]}`);return}if(t==="set"){await CF(n.map(r=>r.split("=")));return}throw new R(`Invalid mode: ${t}`)})().catch(t=>{console.error(`${Ht("\u2716")} ${t.message}`),en(t),process.exit(1)})});const wc="prepare-commit-msg",yc=`.git/hooks/${wc}`,rn=qc(new URL("cli.mjs",import.meta.url)),BF=process.argv[1].replace(/\\/g,"/").endsWith(`/${yc}`),Ec=process.platform==="win32",bc=`
128
+ #!/usr/bin/env node
129
+ import(${JSON.stringify(Yc(rn))})
130
+ `.trim();var TF=En({name:"hook",parameters:["<install/uninstall>"]},e=>{(async()=>{const t=await no(),{installUninstall:n}=e._,r=ce.join(t,yc),i=await tn(r);if(n==="install"){if(i){if(await W.realpath(r).catch(()=>{})===rn){console.warn("The hook is already installed");return}throw new R(`A different ${wc} hook seems to be installed. Please remove it before installing aicommit.`)}await W.mkdir(ce.dirname(r),{recursive:!0}),Ec?await W.writeFile(r,bc):(await W.symlink(rn,r,"file"),await W.chmod(r,493)),console.log(`${dt("\u2714")} Hook installed`);return}if(n==="uninstall"){if(!i){console.warn("Hook is not installed");return}if(Ec){if(await W.readFile(r,"utf8")!==bc){console.warn("Hook is not installed");return}}else if(await W.realpath(r)!==rn){console.warn("Hook is not installed");return}await W.rm(r),console.log(`${dt("\u2714")} Hook uninstalled`);return}throw new R(`Invalid mode: ${n}`)})().catch(t=>{console.error(`${Ht("\u2716")} ${t.message}`),en(t),process.exit(1)})});const Cc=process.argv.slice(2);vi({name:"aicommit",version:bn.version,flags:{generate:{type:Number,description:"Number of messages to generate (Warning: generating multiple costs more) (default: 1)",alias:"g"},exclude:{type:[String],description:"Files to exclude from AI analysis",alias:"x"},all:{type:Boolean,description:"Automatically stage changes in tracked files for the commit",alias:"a",default:!1},type:{type:String,description:"Type of commit message to generate",alias:"t"}},commands:[$F,TF],help:{description:bn.description},ignoreArgv:o(e=>e==="unknown-flag"||e==="argument","ignoreArgv")},e=>{BF?AF():SF(e.flags.generate,e.flags.exclude,e.flags.all,e.flags.type,Cc)},Cc);export{R as K};