@negoziator/ai-commit
Version:
Writes your git commit messages for you with AI
27 lines • 211 kB
JavaScript
var vc=Object.defineProperty;var o=(e,t)=>vc(e,"name",{value:t,configurable:!0});var Ve,He,Ke;import Ac from"tty";import{fileURLToPath as bo}from"node:url";import{ChildProcess as Co,execFile as $c,spawnSync as Bc,spawn as Tc}from"node:child_process";import{StringDecoder as So}from"node:string_decoder";import{debuglog as Ic,stripVTControlCharacters as Oc,inspect as vo,promisify as Ao,callbackify as Re,aborted as Rc,styleText as C}from"node:util";import O,{platform as xc,hrtime as $o,execPath as Mc,execArgv as _c,stdout as sn,stdin as Bo}from"node:process";import To,{ReadStream as Io}from"node:tty";import K from"node:path";import Pc from"child_process";import ce from"path";import an from"fs";import{setTimeout as Oo,scheduler as Ro,setImmediate as Lc}from"node:timers/promises";import{constants as me}from"node:os";import{once as z,addAbortListener as xo,EventEmitter as Nc,on as mt,setMaxListeners as kc}from"node:events";import{serialize as Uc}from"node:v8";import{statSync as jc,readFileSync as un,appendFileSync as Wc,writeFileSync as Gc,createWriteStream as Mo,createReadStream as _o}from"node:fs";import{Transform as zc,getDefaultHighWaterMark as gt,Duplex as cn,Writable as ln,Readable as ge,PassThrough as Po}from"node:stream";import{Buffer as dn}from"node:buffer";import{finished as le}from"node:stream/promises";import*as Ft from"node:readline";import Vc from"node:readline";import W from"fs/promises";import Hc from"os";import{fileURLToPath as Kc,pathToFileURL as qc}from"url";var Yc=Object.defineProperty,L=o((e,t)=>Yc(e,"name",{value:t,configurable:!0}),"a$1");const Zc="known-flag",Jc="unknown-flag",Xc="argument",Qc=/\B([A-Z])/g,el=L(e=>e.replaceAll(Qc,"-$1").toLowerCase(),"camelToKebab"),{hasOwnProperty:tl}=Object.prototype,xe=L((e,t)=>tl.call(e,t),"hasOwn"),fn=L(e=>typeof e=="function"?[e,!1]:Array.isArray(e)?[e[0],!0]:fn(e.type),"parseFlagType"),Lo=L((e,t)=>e===Boolean?t!=="false":t,"normalizeBoolean"),No=L((e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),"applyParser"),nl=/[\s.:=]/,rl=L(e=>{const t=`Flag name "${e}"`;if(e.length===0)throw new Error(`${t} cannot be empty`);const n=e.match(nl);if(n)throw new Error(`${t} cannot contain "${n?.[0]}"`)},"validateFlagName"),hn=L((e,t,n)=>{if(xe(e,t))throw new Error(`Duplicate flags named "${t}"`);e[t]=n},"setFlag"),ol=L(e=>{const t={};for(const n in e){if(!xe(e,n))continue;rl(n);const r=e[n],i=[[],...fn(r),r];hn(t,n,i);const s=el(n);if(n!==s&&hn(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`);hn(t,a,i)}}return t},"createRegistry"),il=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"),wt="--",sl=3,al=/^-{1,2}\w/,ko=L(e=>{if(!al.test(e))return;const t=!e.startsWith(wt);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"),Uo=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===wt){i();const c=e.slice(s+1);n?.(c,[s],!0);break}const u=ko(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"),jo=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"),Dn=L((e,t)=>Object.assign(e,{[wt]:t}),"createPositionalArgumentsFromParts");L(e=>{const t=e.indexOf(wt);if(t===-1)return Dn([...e],[]);const n=e.slice(0,t),r=e.slice(t+1);return Dn([...n,...r],r)},"createPositionalArguments");const ul=L((e,t=process.argv.slice(2),{ignore:n,booleanNegation:r}={})=>{const i=[],s=ol(e),a={},u=[];let c=[];return Uo(t,{onFlag(d,l,f){const h=f.length===sl,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?Zc:Jc,d,l)){if(D){const[m,g]=s[d],F=Lo(g,l),w=L((E,y)=>{i.push(f),y&&i.push(y),m.push(No(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?.(Xc,t[l[0]])||(u.push(...d),f?(c=d,t.splice(l[0])):i.push(l))},"onArgument")}),jo(t,i),{flags:il(e,s),unknownFlags:a,_:Dn(u,c)}},"typeFlag");L((e,t,n=process.argv.slice(2))=>{const r=new Set(e.split(",").map(c=>ko(c)?.[0])),[i,s]=fn(t),a=[],u=[];return Uo(n,{onFlag:L((c,d,l)=>{if(!r.has(c)||!s&&a.length>0)return;const f=Lo(i,d),h=L((D,p)=>{u.push(l),p&&u.push(p),a.push(No(i,D||""))},"getFollowingValue");return f===void 0?h:h(f)},"onFlag")}),jo(n,u),s?a:a[0]},"getFlag");var cl=Object.defineProperty,v=o((e,t)=>cl(e,"name",{value:t,configurable:!0}),"n$1");const ll=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 Wo({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(Wo,"j"),v(Wo,"ansiRegex");const dl=Wo();function pn(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(dl,"")}o(pn,"w$2"),v(pn,"stripAnsi");function Go(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(Go,"P$2"),v(Go,"isAmbiguous");function zo(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}o(zo,"z$3"),v(zo,"isFullWidth");function Vo(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(Vo,"G$2"),v(Vo,"isWide");function Ho(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}o(Ho,"Z$1"),v(Ho,"validate");function Ko(e,{ambiguousAsWide:t=!1}={}){return Ho(e),zo(e)||Vo(e)||t&&Go(e)?2:1}o(Ko,"V$1"),v(Ko,"eastAsianWidth");var fl=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 hl=new Intl.Segmenter,Dl=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=pn(e)),e.length===0)return 0;let i=0;const s={ambiguousAsWide:!n};for(const{segment:a}of hl.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)&&!Dl.test(a)){if(fl().test(a)){i+=2;continue}i+=Ko(u,s)}}return i}o(de,"d"),v(de,"stringWidth");const qo=v(e=>Math.max(...e.split(`
`).map(t=>de(t))),"getLongestLineWidth"),pl=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=qo(n[s]);a>t[s]&&(t[s]=a)}}return t},"getColumnContentWidths"),Yo=/^\d+%$/,Zo={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},ml=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"&&Yo.test(i)){n.push({...Zo,width:i,contentWidth:e[r]});continue}if(i&&typeof i=="object"){const s={...Zo,...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"),gl=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"&&Yo.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"),Jo=v(()=>Object.assign([],{columns:0}),"makeRow"),Fl=v((e,t)=>{const n=[Jo()];let[r]=n;for(const i of e){const s=i.width+i.horizontalPadding;r.columns+s>t&&(r=Jo(),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"),wl=v((e,t,n)=>{const r=ml(n,t);return gl(r,e),Fl(r,e)},"computeColumnWidths"),mn=10,Xo=v((e=0)=>t=>`\x1B[${t+e}m`,"wrapAnsi16"),Qo=v((e=0)=>t=>`\x1B[${38+e};5;${t}m`,"wrapAnsi256"),ei=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 yl=Object.keys(M.color),El=Object.keys(M.bgColor);[...yl,...El];function ti(){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=Xo(),M.color.ansi256=Qo(),M.color.ansi16m=ei(),M.bgColor.ansi=Xo(mn),M.bgColor.ansi256=Qo(mn),M.bgColor.ansi16m=ei(mn),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(ti,"FD"),v(ti,"assembleStyles");const bl=ti(),yt=new Set(["\x1B","\x9B"]),Cl=39,gn="\x07",ni="[",Sl="]",ri="m",Et=`${Sl}8;;`,oi=v(e=>`${yt.values().next().value}${ni}${e}${ri}`,"wrapAnsiCode"),ii=v(e=>`${yt.values().next().value}${Et}${e}${gn}`,"wrapAnsiHyperlink"),vl=v(e=>e.split(" ").map(t=>de(t)),"wordLengths"),Fn=v((e,t,n)=>{const r=[...t];let i=!1,s=!1,a=de(pn(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),yt.has(c)&&(i=!0,s=r.slice(u+1,u+1+Et.length).join("")===Et),i){s?c===gn&&(i=!1,s=!1):c===ri&&(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"),Al=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"),$l=v((e,t,n={})=>{if(n.trim!==!1&&e.trim()==="")return"";let r="",i,s;const a=vl(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(""),Fn(u,h,t);continue}if(D+a[f]>t&&D>0&&a[f]>0){if(n.wordWrap===!1&&D<t){Fn(u,h,t);continue}u.push("")}if(D+a[f]>t&&n.wordWrap===!1){Fn(u,h,t);continue}u[u.length-1]+=h}n.trim!==!1&&(u=u.map(f=>Al(f)));const c=u.join(`
`),d=[...c];let l=0;for(const[f,h]of d.entries()){if(r+=h,yt.has(h)){const{groups:p}=new RegExp(`(?:\\${ni}(?<code>\\d+)m|\\${Et}(?<uri>.*)${gn})`).exec(c.slice(l))||{groups:{}};if(p.code!==void 0){const m=Number.parseFloat(p.code);i=m===Cl?void 0:m}else p.uri!==void 0&&(s=p.uri.length===0?void 0:p.uri)}const D=bl.codes.get(Number(i));d[f+1]===`
`?(s&&(r+=ii("")),i&&D&&(r+=oi(D))):h===`
`&&(i&&D&&(r+=oi(i)),s&&(r+=ii(s))),l+=h.length}return r},"exec");function si(e,t,n){return String(e).normalize().replaceAll(`\r
`,`
`).split(`
`).map(r=>$l(r,t,n)).join(`
`)}o(si,"BD"),v(si,"wrapAnsi");const ai=v(e=>Array.from({length:e}).fill(""),"emptyLines"),Bl=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)),qo(d)>c.width&&(d=si(d,c.width,{hard:!0}));let l=d.split(`
`);if(c.postprocess){const{postprocess:f}=c;l=l.map((h,D)=>f.call(c,h,D))}return c.paddingTop&&l.unshift(...ai(c.paddingTop)),c.paddingBottom&&l.push(...ai(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(`
`))}return n.join(`
`)},"renderRow"),Tl=v((e,t)=>{if(!e||e.length===0)return"";const n=pl(e),r=n.length;if(r===0)return"";const{stdoutColumns:i,columns:s}=ll(t);if(s.length>r)throw new Error(`${s.length} columns defined, but only ${r} columns found`);const a=wl(i,s,n);return e.map(u=>Bl(a,u)).join(`
`)},"terminalColumns"),Il=["<",">","=",">=","<="],Ol=v(e=>{if(!Il.includes(e))throw new TypeError(`Invalid breakpoint operator: ${e}`)},"assertOperator"),Rl=v(e=>{const t=Object.keys(e).map(n=>{const[r,i]=n.split(" ");Ol(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 xl=Object.defineProperty,B=o((e,t)=>xl(e,"name",{value:t,configurable:!0}),"o$1");const ie=new Uint32Array(65536),Ml=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"),_l=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"),ui=B((e,t)=>{if(e.length<t.length){const n=t;t=e,e=n}return t.length===0?e.length:e.length<=32?Ml(e,t):_l(e,t)},"distance"),Pl=B((e,t)=>{let n=1/0,r=0;for(let i=0;i<t.length;i++){const s=ui(e,t[i]);s<n&&(n=s,r=i)}return t[r]},"closest"),Ll=B(e=>e.replaceAll(/[\W_]([a-z\d])?/gi,(t,n)=>n?n.toUpperCase():""),"camelCase"),Nl=B(e=>e.replaceAll(/\B([A-Z])/g,"-$1").toLowerCase(),"kebabCase"),kl={"> 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 ci(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:`--${Nl(n)}`,aliasesEnabled:t,aliasFormatted:i?`-${r.alias}`:void 0}}).map(n=>(n.aliasesEnabled=t,[{type:"flagName",data:n},{type:"flagDescription",data:n}])),tableBreakpoints:kl}}}o(ci,"z$2"),B(ci,"renderFlags");const li=B(e=>!e||(e.version??(e.help?e.help.version:void 0)),"getVersion"),di=B(e=>{const t="parent"in e&&e.parent?.name;return(t?`${t} `:"")+e.name},"getName");function fi(e){const t=[];e.name&&t.push(di(e));const n=li(e)??("parent"in e&&li(e.parent));if(n&&t.push(`v${n}`),t.length!==0)return{id:"name",type:"text",data:`${t.join(" ")}
`}}o(fi,"K"),B(fi,"getNameAndVersion");function hi(e){const{help:t}=e;if(!(!t||!t.description))return{id:"description",type:"text",data:`${t.description}
`}}o(hi,"Z"),B(hi,"getDescription");function Di(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(`
`):t.usage}}:void 0;if(e.name){const n=[],r=[di(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(`
`)}}}}o(Di,"G$1"),B(Di,"getUsage");function pi(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(pi,"Q"),B(pi,"getCommands");function mi(e){if(!(!e.flags||Object.keys(e.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:ci(e.flags),indentBody:0}}}o(mi,"X$1"),B(mi,"getFlags");function gi(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(`
`)),n)return{id:"examples",type:"section",data:{title:"Examples:",body:n}}}o(gi,"Y$1"),B(gi,"getExamples");function Fi(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(Fi,"ee$1"),B(Fi,"getAliases");const Ul=B(e=>[fi,hi,Di,pi,mi,gi,Fi].map(t=>t(e)).filter(Boolean),"generateHelp"),jl=Ac.WriteStream.prototype.hasColors(),wi=(Ve=class{text(t){return t}bold(t){return jl?`\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)}
`:"")+(n?this.indentText({text:this.render(n),spaces:r}):"")}
`}table({tableData:t,tableOptions:n,tableBreakpoints:r}){return Tl(t.map(i=>i.map(s=>this.render(s))),r?Rl(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(`
`);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(wi,"Renderers");let Wl=wi;const yi=B(e=>e.length>0&&!e.includes(" "),"isValidScriptName"),{stringify:Q}=JSON,Gl=/[|\\{}()[\]^$+*?.]/;function wn(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(Gl);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(wn,"P$1"),B(wn,"parseParameters");function yn(e,t,n,r){for(let i=0;i<t.length;i+=1){const{name:s,required:a,spread:u}=t[i],c=Ll(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)}
`),r(),process.exit(1);e[c]=d}}o(yn,"S"),B(yn,"mapParametersToArguments");function Ei(e){return e!==!1}o(Ei,"se"),B(Ei,"helpEnabled");const zl=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"),Vl=B((e,t)=>{if(e.length<3||t.length===0)return;const n=Pl(e,t);return ui(e,n)<=2?n:void 0},"findClosestFlag"),Hl=B((e,t)=>{const n=Object.keys(e);if(n.length!==0){for(const r of n){const i=Vl(r,t),s=i?` (Did you mean --${i}?)`:"";console.error(`Error: Unknown flag: --${r}.${s}`)}process.exit(1)}},"handleUnknownFlags");function En(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=Ei(a);u&&!("help"in i)&&(i.help={type:Boolean,alias:"h",description:"Show help"});const c=ul(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 Wl,f=u&&a?.render?a.render:m=>l.render(m),h=B(m=>{const g=Ul({...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)&&Hl(c.unknownFlags,zl(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)),yn(E,wn(m),g,h),F>-1&&w.length>0&&yn(E,wn(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(En,"I"),B(En,"cliBase");function bi(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(bi,"ce"),B(bi,"getCommand");function Ci(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&&yi(r)){const i=bi(r,e.commands);if(i)return En(i.options.name,{...i.options,parent:e},i.callback,n.slice(1))}return En(void 0,e,t,n)}o(Ci,"fe"),B(Ci,"cli");function bn(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(!yi(n))throw new Error(`Invalid command name ${JSON.stringify(n)}. Command names must be one word.`);return{options:e,callback:t}}o(bn,"de"),B(bn,"command");var Kl="2.72.0",ql="Writes your git commit messages for you with AI",Cn={version:Kl,description:ql};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 Sn=o((e,t)=>{const n=vi(Yl(e));if(typeof n!="string")throw new TypeError(`${t} must be a string or a file URL: ${n}.`);return n},"safeNormalizeFileUrl"),Yl=o(e=>Si(e)?e.toString():e,"normalizeDenoExecPath"),Si=o(e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,"isDenoExecPath"),vi=o(e=>e instanceof URL?bo(e):e,"normalizeFileUrl"),Ai=o((e,t=[],n={})=>{const r=Sn(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:$i}=Object.prototype,Zl=o(e=>$i.call(e)==="[object ArrayBuffer]","isArrayBuffer"),J=o(e=>$i.call(e)==="[object Uint8Array]","isUint8Array"),Ye=o(e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),"bufferToUint8Array"),Jl=new TextEncoder,Bi=o(e=>Jl.encode(e),"stringToUint8Array"),Xl=new TextDecoder,Ti=o(e=>Xl.decode(e),"uint8ArrayToString"),Ql=o((e,t)=>ed(e,t).join(""),"joinToString"),ed=o((e,t)=>{if(t==="utf8"&&e.every(s=>typeof s=="string"))return e;const n=new So(t),r=e.map(s=>typeof s=="string"?Bi(s):s).map(s=>n.write(s)),i=n.end();return i===""?r:[...r,i]},"uint8ArraysToStrings"),vn=o(e=>e.length===1&&J(e[0])?e[0]:Ii(td(e)),"joinToUint8Array"),td=o(e=>e.map(t=>typeof t=="string"?Bi(t):t),"stringsToUint8Arrays"),Ii=o(e=>{const t=new Uint8Array(nd(e));let n=0;for(const r of e)t.set(r,n),n+=r.length;return t},"concatUint8Arrays"),nd=o(e=>{let t=0;for(const n of e)t+=n.length;return t},"getJoinLength"),rd=o(e=>Array.isArray(e)&&Array.isArray(e.raw),"isTemplateString"),od=o((e,t)=>{let n=[];for(const[s,a]of e.entries())n=id({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"),id=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}=sd(i,e.raw[r]),c=Ri(n,s,a);if(r===t.length)return c;const d=t[r],l=Array.isArray(d)?d.map(f=>xi(f)):[xi(d)];return Ri(c,l,u)},"parseTemplate"),sd=o((e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const n=[];let r=0;const i=Oi.has(t[0]);for(let a=0,u=0;a<e.length;a+=1,u+=1){const c=t[u];if(Oi.has(c))r!==a&&n.push(e.slice(r,a)),r=a+1;else if(c==="\\"){const d=t[u+1];d===`
`?(a-=1,u+=1):d==="u"&&t[u+2]==="{"?u=t.indexOf("}",u+3):u+=ad[d]??1}}const s=r===e.length;return s||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:s}},"splitByWhitespaces"),Oi=new Set([" "," ","\r",`
`]),ad={x:3,u:5},Ri=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"),xi=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 ud(e);throw e instanceof Co||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"),ud=o(({stdout:e})=>{if(typeof e=="string")return e;if(J(e))return Ti(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=>An.includes(e),"isStandardStream"),An=[O.stdin,O.stdout,O.stderr],ee=["stdin","stdout","stderr"],Mi=o(e=>ee[e]??`stdio[${e}]`,"getStreamName"),cd=o(e=>{const t={...e};for(const n of Ni)t[n]=_i(e,n);return t},"normalizeFdSpecificOptions"),_i=o((e,t)=>{const n=Array.from({length:ld(e)+1}),r=dd(e[t],n,t);return md(r,t)},"normalizeFdSpecificOption"),ld=o(({stdio:e})=>Array.isArray(e)?Math.max(e.length,ee.length):ee.length,"getStdioLength"),dd=o((e,t,n)=>Y(e)?fd(e,t,n):t.fill(e),"normalizeFdSpecificValue"),fd=o((e,t,n)=>{for(const r of Object.keys(e).sort(hd))for(const i of Dd(r,n,t))t[i]=e[r];return t},"normalizeOptionObject"),hd=o((e,t)=>Pi(e)<Pi(t)?1:-1,"compareFdName"),Pi=o(e=>e==="stdout"||e==="stderr"?0:e==="all"?2:1,"getFdNameOrder"),Dd=o((e,t,n)=>{if(e==="ipc")return[n.length-1];const r=Li(e);if(r===void 0||r===0)throw new TypeError(`"${t}.${e}" is invalid.
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.
Please set the "stdio" option to ensure that file descriptor exists.`);return r==="all"?[1,2]:[r]},"parseFdName"),Li=o(e=>{if(e==="all")return e;if(ee.includes(e))return ee.indexOf(e);const t=pd.exec(e);if(t!==null)return Number(t[1])},"parseFd"),pd=/^fd(\d+)$/,md=o((e,t)=>e.map(n=>n===void 0?Fd[t]:n),"addDefaultValue$1"),gd=Ic("execa").enabled?"full":"none",Fd={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:gd,stripFinalNewline:!0},Ni=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Ze=o((e,t)=>t==="ipc"?e.at(-1):e[t],"getFdSpecificValue"),$n=o(({verbose:e},t)=>Tn(e,t)!=="none","isVerbose"),Bn=o(({verbose:e},t)=>!["none","short"].includes(Tn(e,t)),"isFullVerbose"),wd=o(({verbose:e},t)=>{const n=Tn(e,t);return In(n)?n:void 0},"getVerboseFunction"),Tn=o((e,t)=>t===void 0?yd(e):Ze(e,t),"getFdVerbose"),yd=o(e=>e.find(t=>In(t))??On.findLast(t=>e.includes(t)),"getFdGenericVerbose"),In=o(e=>typeof e=="function","isVerboseFunction"),On=["none","short","full"],Ed=o((e,t)=>{const n=[e,...t],r=n.join(" "),i=n.map(s=>$d(ki(s))).join(" ");return{command:r,escapedCommand:i}},"joinCommand"),Rn=o(e=>Oc(e).split(`
`).map(t=>ki(t)).join(`