@negoziator/ai-commit 2.9.2 → 2.13.0
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.
- package/README.md +238 -21
- package/dist/anthropic-DJVOPReW.mjs +5 -0
- package/dist/azure-openai-tXzyzZc3.mjs +3 -0
- package/dist/cli-D2zun-19.mjs +85 -0
- package/dist/cli.mjs +1 -102
- package/dist/custom-ChlxDLUY.mjs +3 -0
- package/dist/index-CQ8E6Ymc.mjs +12 -0
- package/dist/ollama-D2s8lKyO.mjs +5 -0
- package/dist/openai-foHbhRVW.mjs +5 -0
- package/dist/prompt-BMR92Sng.mjs +4 -0
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,103 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var Ht=Object.defineProperty;var o=(u,e)=>Ht(u,"name",{value:e,configurable:!0});var eu;import Ru from"tty";import{Buffer as Yt}from"node:buffer";import V from"node:path";import qe,{ChildProcess as Kt}from"node:child_process";import $,{stdout as We,stdin as Ue}from"node:process";import Vt from"child_process";import W from"path";import _u from"fs";import{fileURLToPath as ze}from"node:url";import Jt,{constants as He}from"node:os";import Ye from"assert";import Ke from"events";import{createWriteStream as Zt,createReadStream as Xt}from"node:fs";import Qt from"buffer";import ku from"stream";import Ve from"util";import{debuglog as ur}from"node:util";import*as lu from"node:readline";import Je from"node:readline";import{Writable as er}from"node:stream";import I from"fs/promises";import Ze from"os";import Dr from"https";import tr from"net";import rr from"tls";import nr,{fileURLToPath as or,pathToFileURL as sr}from"url";const ir="known-flag",ar="unknown-flag",cr="argument",{stringify:tu}=JSON,lr=/\B([A-Z])/g,Fr=o(u=>u.replace(lr,"-$1").toLowerCase(),"v$1"),{hasOwnProperty:Cr}=Object.prototype,ru=o((u,e)=>Cr.call(u,e),"w$3"),fr=o(u=>Array.isArray(u),"L$4"),Xe=o(u=>typeof u=="function"?[u,!1]:fr(u)?[u[0],!0]:Xe(u.type),"b$3"),dr=o((u,e)=>u===Boolean?e!=="false":e,"d$4"),Er=o((u,e)=>typeof e=="boolean"?e:u===Number&&e===""?Number.NaN:u(e),"m$2"),pr=/[\s.:=]/,hr=o(u=>{const e=`Flag name ${tu(u)}`;if(u.length===0)throw new Error(`${e} cannot be empty`);if(u.length===1)throw new Error(`${e} must be longer than a character`);const t=u.match(pr);if(t)throw new Error(`${e} cannot contain ${tu(t?.[0])}`)},"B$1"),mr=o(u=>{const e={},t=o((r,n)=>{if(ru(e,r))throw new Error(`Duplicate flags named ${tu(r)}`);e[r]=n},"r");for(const r in u){if(!ru(u,r))continue;hr(r);const n=u[r],s=[[],...Xe(n),n];t(r,s);const D=Fr(r);if(r!==D&&t(D,s),"alias"in n&&typeof n.alias=="string"){const{alias:a}=n,i=`Flag alias ${tu(a)} for flag ${tu(r)}`;if(a.length===0)throw new Error(`${i} cannot be empty`);if(a.length>1)throw new Error(`${i} must be a single character`);t(a,s)}}return e},"K$2"),gr=o((u,e)=>{const t={};for(const r in u){if(!ru(u,r))continue;const[n,,s,D]=e[r];if(n.length===0&&"default"in D){let{default:a}=D;typeof a=="function"&&(a=a()),t[r]=a}else t[r]=s?n:n.pop()}return t},"_$3"),Fu="--",Br=/[.:=]/,yr=/^-{1,2}\w/,br=o(u=>{if(!yr.test(u))return;const e=!u.startsWith(Fu);let t=u.slice(e?1:2),r;const n=t.match(Br);if(n){const{index:s}=n;r=t.slice(s+1),t=t.slice(0,s)}return[t,r,e]},"N$1"),Ar=o((u,{onFlag:e,onArgument:t})=>{let r;const n=o((s,D)=>{if(typeof r!="function")return!0;r(s,D),r=void 0},"o");for(let s=0;s<u.length;s+=1){const D=u[s];if(D===Fu){n();const i=u.slice(s+1);t?.(i,[s],!0);break}const a=br(D);if(a){if(n(),!e)continue;const[i,l,C]=a;if(C)for(let F=0;F<i.length;F+=1){n();const c=F===i.length-1;r=e(i[F],c?l:void 0,[s,F+1,c])}else r=e(i,l,[s])}else n(D,[s])&&t?.([D],[s])}n()},"$$2"),wr=o((u,e)=>{for(const[t,r,n]of e.reverse()){if(r){const s=u[t];let D=s.slice(0,r);if(n||(D+=s.slice(r+1)),D!=="-"){u[t]=D;continue}}u.splice(t,1)}},"E"),vr=o((u,e=process.argv.slice(2),{ignore:t}={})=>{const r=[],n=mr(u),s={},D=[];return D[Fu]=[],Ar(e,{onFlag(a,i,l){const C=ru(n,a);if(!t?.(C?ir:ar,a,i)){if(C){const[F,c]=n[a],E=dr(c,i),d=o((m,f)=>{r.push(l),f&&r.push(f),F.push(Er(c,m||""))},"p");return E===void 0?d:d(E)}ru(s,a)||(s[a]=[]),s[a].push(i===void 0?!0:i),r.push(l)}},onArgument(a,i,l){t?.(cr,e[i[0]])||(D.push(...a),l?(D[Fu]=a,e.splice(i[0])):r.push(i))}}),wr(e,r),{flags:gr(u,n),unknownFlags:s,_:D}},"U$2");var $r=Object.create,Cu=Object.defineProperty,xr=Object.defineProperties,Sr=Object.getOwnPropertyDescriptor,Or=Object.getOwnPropertyDescriptors,Tr=Object.getOwnPropertyNames,Qe=Object.getOwnPropertySymbols,Ir=Object.getPrototypeOf,uD=Object.prototype.hasOwnProperty,Pr=Object.prototype.propertyIsEnumerable,eD=o((u,e,t)=>e in u?Cu(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t,"W$3"),fu=o((u,e)=>{for(var t in e||(e={}))uD.call(e,t)&&eD(u,t,e[t]);if(Qe)for(var t of Qe(e))Pr.call(e,t)&&eD(u,t,e[t]);return u},"p$1"),Mu=o((u,e)=>xr(u,Or(e)),"c"),Rr=o(u=>Cu(u,"__esModule",{value:!0}),"nD$1"),_r=o((u,e)=>()=>(u&&(e=u(u=0)),e),"rD$1"),kr=o((u,e)=>()=>(e||u((e={exports:{}}).exports,e),e.exports),"iD$1"),Mr=o((u,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Tr(e))!uD.call(u,n)&&n!=="default"&&Cu(u,n,{get:o(()=>e[n],"get"),enumerable:!(r=Sr(e,n))||r.enumerable});return u},"oD$1"),jr=o((u,e)=>Mr(Rr(Cu(u!=null?$r(Ir(u)):{},"default",{value:u,enumerable:!0})),u),"BD$1"),T=_r(()=>{}),Nr=kr((u,e)=>{T(),e.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\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|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\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]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});T(),T(),T();var Lr=o(u=>{var e,t,r;let n=(e=process.stdout.columns)!=null?e:Number.POSITIVE_INFINITY;return typeof u=="function"&&(u=u(n)),u||(u={}),Array.isArray(u)?{columns:u,stdoutColumns:n}:{columns:(t=u.columns)!=null?t:[],stdoutColumns:(r=u.stdoutColumns)!=null?r:n}},"v");T(),T(),T(),T(),T();function Gr({onlyFirst:u=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,u?void 0:"g")}o(Gr,"w$2");function DD(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(Gr(),"")}o(DD,"d$3"),T();function qr(u){return Number.isInteger(u)?u>=4352&&(u<=4447||u===9001||u===9002||11904<=u&&u<=12871&&u!==12351||12880<=u&&u<=19903||19968<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65131||65281<=u&&u<=65376||65504<=u&&u<=65510||110592<=u&&u<=110593||127488<=u&&u<=127569||131072<=u&&u<=262141):!1}o(qr,"y$2");var Wr=jr(Nr());function U(u){if(typeof u!="string"||u.length===0||(u=DD(u),u.length===0))return 0;u=u.replace((0,Wr.default)()," ");let e=0;for(let t=0;t<u.length;t++){let r=u.codePointAt(t);r<=31||r>=127&&r<=159||r>=768&&r<=879||(r>65535&&t++,e+=qr(r)?2:1)}return e}o(U,"g");var tD=o(u=>Math.max(...u.split(`
|
|
3
|
-
`).map(U)),"b$2"),Ur=o(u=>{let e=[];for(let t of u){let{length:r}=t,n=r-e.length;for(let s=0;s<n;s+=1)e.push(0);for(let s=0;s<r;s+=1){let D=tD(t[s]);D>e[s]&&(e[s]=D)}}return e},"k$3");T();var rD=/^\d+%$/,nD={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},zr=o((u,e)=>{var t;let r=[];for(let n=0;n<u.length;n+=1){let s=(t=e[n])!=null?t:"auto";if(typeof s=="number"||s==="auto"||s==="content-width"||typeof s=="string"&&rD.test(s)){r.push(Mu(fu({},nD),{width:s,contentWidth:u[n]}));continue}if(s&&typeof s=="object"){let D=Mu(fu(fu({},nD),s),{contentWidth:u[n]});D.horizontalPadding=D.paddingLeft+D.paddingRight,r.push(D);continue}throw new Error(`Invalid column width: ${JSON.stringify(s)}`)}return r},"sD$1");function Hr(u,e){for(let t of u){let{width:r}=t;if(r==="content-width"&&(t.width=t.contentWidth),r==="auto"){let i=Math.min(20,t.contentWidth);t.width=i,t.autoOverflow=t.contentWidth-i}if(typeof r=="string"&&rD.test(r)){let i=Number.parseFloat(r.slice(0,-1))/100;t.width=Math.floor(e*i)-(t.paddingLeft+t.paddingRight)}let{horizontalPadding:n}=t,s=1,D=s+n;if(D>=e){let i=D-e,l=Math.ceil(t.paddingLeft/n*i),C=i-l;t.paddingLeft-=l,t.paddingRight-=C,t.horizontalPadding=t.paddingLeft+t.paddingRight}t.paddingLeftString=t.paddingLeft?" ".repeat(t.paddingLeft):"",t.paddingRightString=t.paddingRight?" ".repeat(t.paddingRight):"";let a=e-t.horizontalPadding;t.width=Math.max(Math.min(t.width,a),s)}}o(Hr,"aD$1");var oD=o(()=>Object.assign([],{columns:0}),"G$3");function Yr(u,e){let t=[oD()],[r]=t;for(let n of u){let s=n.width+n.horizontalPadding;r.columns+s>e&&(r=oD(),t.push(r)),r.push(n),r.columns+=s}for(let n of t){let s=n.reduce((c,E)=>c+E.width+E.horizontalPadding,0),D=e-s;if(D===0)continue;let a=n.filter(c=>"autoOverflow"in c),i=a.filter(c=>c.autoOverflow>0),l=i.reduce((c,E)=>c+E.autoOverflow,0),C=Math.min(l,D);for(let c of i){let E=Math.floor(c.autoOverflow/l*C);c.width+=E,D-=E}let F=Math.floor(D/a.length);for(let c=0;c<a.length;c+=1){let E=a[c];c===a.length-1?E.width+=D:E.width+=F,D-=F}}return t}o(Yr,"lD$1");function Kr(u,e,t){let r=zr(t,e);return Hr(r,u),Yr(r,u)}o(Kr,"Z$1"),T(),T(),T();var ju=10,sD=o((u=0)=>e=>`\x1B[${e+u}m`,"U$1"),iD=o((u=0)=>e=>`\x1B[${38+u};5;${e}m`,"V$3"),aD=o((u=0)=>(e,t,r)=>`\x1B[${38+u};2;${e};${t};${r}m`,"Y$2");function Vr(){let u=new Map,e={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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,r]of Object.entries(e)){for(let[n,s]of Object.entries(r))e[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[n]=e[n],u.set(s[0],s[1]);Object.defineProperty(e,t,{value:r,enumerable:!1})}return Object.defineProperty(e,"codes",{value:u,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi=sD(),e.color.ansi256=iD(),e.color.ansi16m=aD(),e.bgColor.ansi=sD(ju),e.bgColor.ansi256=iD(ju),e.bgColor.ansi16m=aD(ju),Object.defineProperties(e,{rgbToAnsi256:{value:o((t,r,n)=>t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),"value"),enumerable:!1},hexToRgb:{value:o(t=>{let r=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!r)return[0,0,0];let{colorString:n}=r.groups;n.length===3&&(n=n.split("").map(D=>D+D).join(""));let s=Number.parseInt(n,16);return[s>>16&255,s>>8&255,s&255]},"value"),enumerable:!1},hexToAnsi256:{value:o(t=>e.rgbToAnsi256(...e.hexToRgb(t)),"value"),enumerable:!1},ansi256ToAnsi:{value:o(t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,s;if(t>=232)r=((t-232)*10+8)/255,n=r,s=r;else{t-=16;let i=t%36;r=Math.floor(t/36)/5,n=Math.floor(i/6)/5,s=i%6/5}let D=Math.max(r,n,s)*2;if(D===0)return 30;let a=30+(Math.round(s)<<2|Math.round(n)<<1|Math.round(r));return D===2&&(a+=60),a},"value"),enumerable:!1},rgbToAnsi:{value:o((t,r,n)=>e.ansi256ToAnsi(e.rgbToAnsi256(t,r,n)),"value"),enumerable:!1},hexToAnsi:{value:o(t=>e.ansi256ToAnsi(e.hexToAnsi256(t)),"value"),enumerable:!1}}),e}o(Vr,"AD$1");var Jr=Vr(),Zr=Jr,du=new Set(["\x1B","\x9B"]),Xr=39,Nu="\x07",cD="[",Qr="]",lD="m",Lu=`${Qr}8;;`,FD=o(u=>`${du.values().next().value}${cD}${u}${lD}`,"J$2"),CD=o(u=>`${du.values().next().value}${Lu}${u}${Nu}`,"Q"),un=o(u=>u.split(" ").map(e=>U(e)),"hD$1"),Gu=o((u,e,t)=>{let r=[...e],n=!1,s=!1,D=U(DD(u[u.length-1]));for(let[a,i]of r.entries()){let l=U(i);if(D+l<=t?u[u.length-1]+=i:(u.push(i),D=0),du.has(i)&&(n=!0,s=r.slice(a+1).join("").startsWith(Lu)),n){s?i===Nu&&(n=!1,s=!1):i===lD&&(n=!1);continue}D+=l,D===t&&a<r.length-1&&(u.push(""),D=0)}!D&&u[u.length-1].length>0&&u.length>1&&(u[u.length-2]+=u.pop())},"S$1"),en=o(u=>{let e=u.split(" "),t=e.length;for(;t>0&&!(U(e[t-1])>0);)t--;return t===e.length?u:e.slice(0,t).join(" ")+e.slice(t).join("")},"cD"),Dn=o((u,e,t={})=>{if(t.trim!==!1&&u.trim()==="")return"";let r="",n,s,D=un(u),a=[""];for(let[l,C]of u.split(" ").entries()){t.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let F=U(a[a.length-1]);if(l!==0&&(F>=e&&(t.wordWrap===!1||t.trim===!1)&&(a.push(""),F=0),(F>0||t.trim===!1)&&(a[a.length-1]+=" ",F++)),t.hard&&D[l]>e){let c=e-F,E=1+Math.floor((D[l]-c-1)/e);Math.floor((D[l]-1)/e)<E&&a.push(""),Gu(a,C,e);continue}if(F+D[l]>e&&F>0&&D[l]>0){if(t.wordWrap===!1&&F<e){Gu(a,C,e);continue}a.push("")}if(F+D[l]>e&&t.wordWrap===!1){Gu(a,C,e);continue}a[a.length-1]+=C}t.trim!==!1&&(a=a.map(l=>en(l)));let i=[...a.join(`
|
|
4
|
-
`)];for(let[l,C]of i.entries()){if(r+=C,du.has(C)){let{groups:c}=new RegExp(`(?:\\${cD}(?<code>\\d+)m|\\${Lu}(?<uri>.*)${Nu})`).exec(i.slice(l).join(""))||{groups:{}};if(c.code!==void 0){let E=Number.parseFloat(c.code);n=E===Xr?void 0:E}else c.uri!==void 0&&(s=c.uri.length===0?void 0:c.uri)}let F=Zr.codes.get(Number(n));i[l+1]===`
|
|
5
|
-
`?(s&&(r+=CD("")),n&&F&&(r+=FD(F))):C===`
|
|
6
|
-
`&&(n&&F&&(r+=FD(n)),s&&(r+=CD(s)))}return r},"dD$1");function tn(u,e,t){return String(u).normalize().replace(/\r\n/g,`
|
|
7
|
-
`).split(`
|
|
8
|
-
`).map(r=>Dn(r,e,t)).join(`
|
|
9
|
-
`)}o(tn,"T$1");var fD=o(u=>Array.from({length:u}).fill(""),"X");function rn(u,e){let t=[],r=0;for(let n of u){let s=0,D=n.map(i=>{var l;let C=(l=e[r])!=null?l:"";r+=1,i.preprocess&&(C=i.preprocess(C)),tD(C)>i.width&&(C=tn(C,i.width,{hard:!0}));let F=C.split(`
|
|
10
|
-
`);if(i.postprocess){let{postprocess:c}=i;F=F.map((E,d)=>c.call(i,E,d))}return i.paddingTop&&F.unshift(...fD(i.paddingTop)),i.paddingBottom&&F.push(...fD(i.paddingBottom)),F.length>s&&(s=F.length),Mu(fu({},i),{lines:F})}),a=[];for(let i=0;i<s;i+=1){let l=D.map(C=>{var F;let c=(F=C.lines[i])!=null?F:"",E=Number.isFinite(C.width)?" ".repeat(C.width-U(c)):"",d=C.paddingLeftString;return C.align==="right"&&(d+=E),d+=c,C.align==="left"&&(d+=E),d+C.paddingRightString}).join("");a.push(l)}t.push(a.join(`
|
|
11
|
-
`))}return t.join(`
|
|
12
|
-
`)}o(rn,"P$3");function nn(u,e){if(!u||u.length===0)return"";let t=Ur(u),r=t.length;if(r===0)return"";let{stdoutColumns:n,columns:s}=Lr(e);if(s.length>r)throw new Error(`${s.length} columns defined, but only ${r} columns found`);let D=Kr(n,s,t);return u.map(a=>rn(D,a)).join(`
|
|
13
|
-
`)}o(nn,"mD"),T();var on=["<",">","=",">=","<="];function sn(u){if(!on.includes(u))throw new TypeError(`Invalid breakpoint operator: ${u}`)}o(sn,"xD$1");function an(u){let e=Object.keys(u).map(t=>{let[r,n]=t.split(" ");sn(r);let s=Number.parseInt(n,10);if(Number.isNaN(s))throw new TypeError(`Invalid breakpoint value: ${n}`);let D=u[t];return{operator:r,breakpoint:s,value:D}}).sort((t,r)=>r.breakpoint-t.breakpoint);return t=>{var r;return(r=e.find(({operator:n,breakpoint:s})=>n==="="&&t===s||n===">"&&t>s||n==="<"&&t<s||n===">="&&t>=s||n==="<="&&t<=s))==null?void 0:r.value}}o(an,"wD");const cn=o(u=>u.replace(/[\W_]([a-z\d])?/gi,(e,t)=>t?t.toUpperCase():""),"P$2"),ln=o(u=>u.replace(/\B([A-Z])/g,"-$1").toLowerCase(),"q"),Fn={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:o(u=>u.trim(),"preprocess")},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function Cn(u){let e=!1;return{type:"table",data:{tableData:Object.keys(u).sort((t,r)=>t.localeCompare(r)).map(t=>{const r=u[t],n="alias"in r;return n&&(e=!0),{name:t,flag:r,flagFormatted:`--${ln(t)}`,aliasesEnabled:e,aliasFormatted:n?`-${r.alias}`:void 0}}).map(t=>(t.aliasesEnabled=e,[{type:"flagName",data:t},{type:"flagDescription",data:t}])),tableBreakpoints:Fn}}}o(Cn,"D");const dD=o(u=>!u||(u.version??(u.help?u.help.version:void 0)),"A"),ED=o(u=>{const e="parent"in u&&u.parent?.name;return(e?`${e} `:"")+u.name},"C$1");function fn(u){const e=[];u.name&&e.push(ED(u));const t=dD(u)??("parent"in u&&dD(u.parent));if(t&&e.push(`v${t}`),e.length!==0)return{id:"name",type:"text",data:`${e.join(" ")}
|
|
14
|
-
`}}o(fn,"R$1");function dn(u){const{help:e}=u;if(!(!e||!e.description))return{id:"description",type:"text",data:`${e.description}
|
|
15
|
-
`}}o(dn,"L$2");function En(u){const e=u.help||{};if("usage"in e)return e.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(e.usage)?e.usage.join(`
|
|
16
|
-
`):e.usage}}:void 0;if(u.name){const t=[],r=[ED(u)];if(u.flags&&Object.keys(u.flags).length>0&&r.push("[flags...]"),u.parameters&&u.parameters.length>0){const{parameters:n}=u,s=n.indexOf("--"),D=s>-1&&n.slice(s+1).some(a=>a.startsWith("<"));r.push(n.map(a=>a!=="--"?a:D?"--":"[--]").join(" "))}if(r.length>1&&t.push(r.join(" ")),"commands"in u&&u.commands?.length&&t.push(`${u.name} <command>`),t.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:t.join(`
|
|
17
|
-
`)}}}}o(En,"T");function pn(u){return!("commands"in u)||!u.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:u.commands.map(e=>[e.options.name,e.options.help?e.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}o(pn,"_$1");function hn(u){if(!(!u.flags||Object.keys(u.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:Cn(u.flags),indentBody:0}}}o(hn,"k$2");function mn(u){const{help:e}=u;if(!e||!e.examples||e.examples.length===0)return;let{examples:t}=e;if(Array.isArray(t)&&(t=t.join(`
|
|
18
|
-
`)),t)return{id:"examples",type:"section",data:{title:"Examples:",body:t}}}o(mn,"F");function gn(u){if(!("alias"in u)||!u.alias)return;const{alias:e}=u;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(e)?e.join(", "):e}}}o(gn,"H");const Bn=o(u=>[fn,dn,En,pn,hn,mn,gn].map(e=>e(u)).filter(Boolean),"U"),yn=Ru.WriteStream.prototype.hasColors();let bn=(eu=class{text(e){return e}bold(e){return yn?`\x1B[1m${e}\x1B[22m`:e.toLocaleUpperCase()}indentText({text:e,spaces:t}){return e.replace(/^/gm," ".repeat(t))}heading(e){return this.bold(e)}section({title:e,body:t,indentBody:r=2}){return`${(e?`${this.heading(e)}
|
|
19
|
-
`:"")+(t?this.indentText({text:this.render(t),spaces:r}):"")}
|
|
20
|
-
`}table({tableData:e,tableOptions:t,tableBreakpoints:r}){return nn(e.map(n=>n.map(s=>this.render(s))),r?an(r):t)}flagParameter(e){return e===Boolean?"":e===String?"<string>":e===Number?"<number>":Array.isArray(e)?this.flagParameter(e[0]):"<value>"}flagOperator(e){return" "}flagName(e){const{flag:t,flagFormatted:r,aliasesEnabled:n,aliasFormatted:s}=e;let D="";if(s?D+=`${s}, `:n&&(D+=" "),D+=r,"placeholder"in t&&typeof t.placeholder=="string")D+=`${this.flagOperator(e)}${t.placeholder}`;else{const a=this.flagParameter("type"in t?t.type:t);a&&(D+=`${this.flagOperator(e)}${a}`)}return D}flagDefault(e){return JSON.stringify(e)}flagDescription({flag:e}){let t="description"in e?e.description??"":"";if("default"in e){let{default:r}=e;typeof r=="function"&&(r=r()),r&&(t+=` (default: ${this.flagDefault(r)})`)}return t}render(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(t=>this.render(t)).join(`
|
|
21
|
-
`);if("type"in e&&this[e.type]){const t=this[e.type];if(typeof t=="function")return t.call(this,e.data)}throw new Error(`Invalid node type: ${JSON.stringify(e)}`)}},o(eu,"J"),eu);const qu=o(u=>u.length>0&&!u.includes(" "),"y$1"),{stringify:M}=JSON,An=/[|\\{}()[\]^$+*?.]/;function Wu(u){const e=[];let t,r;for(const n of u){if(r)throw new Error(`Invalid parameter: Spread parameter ${M(r)} must be last`);const s=n[0],D=n[n.length-1];let a;if(s==="<"&&D===">"&&(a=!0,t))throw new Error(`Invalid parameter: Required parameter ${M(n)} cannot come after optional parameter ${M(t)}`);if(s==="["&&D==="]"&&(a=!1,t=n),a===void 0)throw new Error(`Invalid parameter: ${M(n)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let i=n.slice(1,-1);const l=i.slice(-3)==="...";l&&(r=n,i=i.slice(0,-3));const C=i.match(An);if(C)throw new Error(`Invalid parameter: ${M(n)}. Invalid character found ${M(C[0])}`);e.push({name:i,required:a,spread:l})}return e}o(Wu,"w$1");function Uu(u,e,t,r){for(let n=0;n<e.length;n+=1){const{name:s,required:D,spread:a}=e[n],i=cn(s);if(i in u)throw new Error(`Invalid parameter: ${M(s)} is used more than once.`);const l=a?t.slice(n):t[n];if(a&&(n=e.length),D&&(!l||a&&l.length===0))return console.error(`Error: Missing required parameter ${M(s)}
|
|
22
|
-
`),r(),process.exit(1);u[i]=l}}o(Uu,"b$1");function wn(u){return u===void 0||u!==!1}o(wn,"W$2");function pD(u,e,t,r){const n={...e.flags},s=e.version;s&&(n.version={type:Boolean,description:"Show version"});const{help:D}=e,a=wn(D);a&&!("help"in n)&&(n.help={type:Boolean,alias:"h",description:"Show help"});const i=vr(n,r,{ignore:e.ignoreArgv}),l=o(()=>{console.log(e.version)},"f");if(s&&i.flags.version===!0)return l(),process.exit(0);const C=new bn,F=a&&D?.render?D.render:d=>C.render(d),c=o(d=>{const m=Bn({...e,...d?{help:d}:{},flags:n});console.log(F(m,C))},"u");if(a&&i.flags.help===!0)return c(),process.exit(0);if(e.parameters){let{parameters:d}=e,m=i._;const f=d.indexOf("--"),p=d.slice(f+1),h=Object.create(null);if(f>-1&&p.length>0){d=d.slice(0,f);const g=i._["--"];m=m.slice(0,-g.length||void 0),Uu(h,Wu(d),m,c),Uu(h,Wu(p),g,c)}else Uu(h,Wu(d),m,c);Object.assign(i._,h)}const E={...i,showVersion:l,showHelp:c};return typeof t=="function"&&t(E),{command:u,...E}}o(pD,"x$1");function vn(u,e){const t=new Map;for(const r of e){const n=[r.options.name],{alias:s}=r.options;s&&(Array.isArray(s)?n.push(...s):n.push(s));for(const D of n){if(t.has(D))throw new Error(`Duplicate command name found: ${M(D)}`);t.set(D,r)}}return t.get(u)}o(vn,"z$1");function $n(u,e,t=process.argv.slice(2)){if(!u)throw new Error("Options is required");if("name"in u&&(!u.name||!qu(u.name)))throw new Error(`Invalid script name: ${M(u.name)}`);const r=t[0];if(u.commands&&r&&qu(r)){const n=vn(r,u.commands);if(n)return pD(n.options.name,{...n.options,parent:u},n.callback,t.slice(1))}return pD(void 0,u,e,t)}o($n,"Z");function hD(u,e){if(!u)throw new Error("Command options are required");const{name:t}=u;if(t===void 0)throw new Error("Command name is required");if(!qu(t))throw new Error(`Invalid command name ${JSON.stringify(t)}. Command names must be one word.`);return{options:u,callback:e}}o(hD,"G$2");var xn="2.9.2",Sn="Writes your git commit messages for you with AI",zu={version:xn,description:Sn},G=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function J(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}o(J,"getDefaultExportFromCjs");var z={exports:{}},Hu,mD;function On(){if(mD)return Hu;mD=1,Hu=r,r.sync=n;var u=_u;function e(s,D){var a=D.pathExt!==void 0?D.pathExt:process.env.PATHEXT;if(!a||(a=a.split(";"),a.indexOf("")!==-1))return!0;for(var i=0;i<a.length;i++){var l=a[i].toLowerCase();if(l&&s.substr(-l.length).toLowerCase()===l)return!0}return!1}o(e,"checkPathExt");function t(s,D,a){return!s.isSymbolicLink()&&!s.isFile()?!1:e(D,a)}o(t,"checkStat");function r(s,D,a){u.stat(s,function(i,l){a(i,i?!1:t(l,s,D))})}o(r,"isexe");function n(s,D){return t(u.statSync(s),s,D)}return o(n,"sync"),Hu}o(On,"requireWindows");var Yu,gD;function Tn(){if(gD)return Yu;gD=1,Yu=e,e.sync=t;var u=_u;function e(s,D,a){u.stat(s,function(i,l){a(i,i?!1:r(l,D))})}o(e,"isexe");function t(s,D){return r(u.statSync(s),D)}o(t,"sync");function r(s,D){return s.isFile()&&n(s,D)}o(r,"checkStat");function n(s,D){var a=s.mode,i=s.uid,l=s.gid,C=D.uid!==void 0?D.uid:process.getuid&&process.getuid(),F=D.gid!==void 0?D.gid:process.getgid&&process.getgid(),c=parseInt("100",8),E=parseInt("010",8),d=parseInt("001",8),m=c|E,f=a&d||a&E&&l===F||a&c&&i===C||a&m&&C===0;return f}return o(n,"checkMode"),Yu}o(Tn,"requireMode");var Ku,BD;function In(){if(BD)return Ku;BD=1;var u;process.platform==="win32"||G.TESTING_WINDOWS?u=On():u=Tn(),Ku=e,e.sync=t;function e(r,n,s){if(typeof n=="function"&&(s=n,n={}),!s){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(D,a){e(r,n||{},function(i,l){i?a(i):D(l)})})}u(r,n||{},function(D,a){D&&(D.code==="EACCES"||n&&n.ignoreErrors)&&(D=null,a=!1),s(D,a)})}o(e,"isexe");function t(r,n){try{return u.sync(r,n||{})}catch(s){if(n&&n.ignoreErrors||s.code==="EACCES")return!1;throw s}}return o(t,"sync"),Ku}o(In,"requireIsexe");var Vu,yD;function Pn(){if(yD)return Vu;yD=1;const u=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",e=W,t=u?";":":",r=In(),n=o(i=>Object.assign(new Error(`not found: ${i}`),{code:"ENOENT"}),"getNotFoundError"),s=o((i,l)=>{const C=l.colon||t,F=i.match(/\//)||u&&i.match(/\\/)?[""]:[...u?[process.cwd()]:[],...(l.path||process.env.PATH||"").split(C)],c=u?l.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",E=u?c.split(C):[""];return u&&i.indexOf(".")!==-1&&E[0]!==""&&E.unshift(""),{pathEnv:F,pathExt:E,pathExtExe:c}},"getPathInfo"),D=o((i,l,C)=>{typeof l=="function"&&(C=l,l={}),l||(l={});const{pathEnv:F,pathExt:c,pathExtExe:E}=s(i,l),d=[],m=o(p=>new Promise((h,g)=>{if(p===F.length)return l.all&&d.length?h(d):g(n(i));const B=F[p],b=/^".*"$/.test(B)?B.slice(1,-1):B,y=e.join(b,i),v=!b&&/^\.[\\\/]/.test(i)?i.slice(0,2)+y:y;h(f(v,p,0))}),"step"),f=o((p,h,g)=>new Promise((B,b)=>{if(g===c.length)return B(m(h+1));const y=c[g];r(p+y,{pathExt:E},(v,k)=>{if(!v&&k)if(l.all)d.push(p+y);else return B(p+y);return B(f(p,h,g+1))})}),"subStep");return C?m(0).then(p=>C(null,p),C):m(0)},"which"),a=o((i,l)=>{l=l||{};const{pathEnv:C,pathExt:F,pathExtExe:c}=s(i,l),E=[];for(let d=0;d<C.length;d++){const m=C[d],f=/^".*"$/.test(m)?m.slice(1,-1):m,p=e.join(f,i),h=!f&&/^\.[\\\/]/.test(i)?i.slice(0,2)+p:p;for(let g=0;g<F.length;g++){const B=h+F[g];try{if(r.sync(B,{pathExt:c}))if(l.all)E.push(B);else return B}catch{}}}if(l.all&&E.length)return E;if(l.nothrow)return null;throw n(i)},"whichSync");return Vu=D,D.sync=a,Vu}o(Pn,"requireWhich");var Eu={exports:{}},bD;function Rn(){if(bD)return Eu.exports;bD=1;const u=o((e={})=>{const t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey");return Eu.exports=u,Eu.exports.default=u,Eu.exports}o(Rn,"requirePathKey");var Ju,AD;function _n(){if(AD)return Ju;AD=1;const u=W,e=Pn(),t=Rn();function r(s,D){const a=s.options.env||process.env,i=process.cwd(),l=s.options.cwd!=null,C=l&&process.chdir!==void 0&&!process.chdir.disabled;if(C)try{process.chdir(s.options.cwd)}catch{}let F;try{F=e.sync(s.command,{path:a[t({env:a})],pathExt:D?u.delimiter:void 0})}catch{}finally{C&&process.chdir(i)}return F&&(F=u.resolve(l?s.options.cwd:"",F)),F}o(r,"resolveCommandAttempt");function n(s){return r(s)||r(s,!0)}return o(n,"resolveCommand"),Ju=n,Ju}o(_n,"requireResolveCommand");var pu={},wD;function kn(){if(wD)return pu;wD=1;const u=/([()\][%!^"`<>&|;, *?])/g;function e(r){return r=r.replace(u,"^$1"),r}o(e,"escapeCommand");function t(r,n){return r=`${r}`,r=r.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),r=r.replace(/(?=(\\+?)?)\1$/,"$1$1"),r=`"${r}"`,r=r.replace(u,"^$1"),n&&(r=r.replace(u,"^$1")),r}return o(t,"escapeArgument"),pu.command=e,pu.argument=t,pu}o(kn,"require_escape");var Zu,vD;function Mn(){return vD||(vD=1,Zu=/^#!(.*)/),Zu}o(Mn,"requireShebangRegex");var Xu,$D;function jn(){if($D)return Xu;$D=1;const u=Mn();return Xu=o((e="")=>{const t=e.match(u);if(!t)return null;const[r,n]=t[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return s==="env"?n:n?`${s} ${n}`:s},"shebangCommand"),Xu}o(jn,"requireShebangCommand");var Qu,xD;function Nn(){if(xD)return Qu;xD=1;const u=_u,e=jn();function t(r){const s=Buffer.alloc(150);let D;try{D=u.openSync(r,"r"),u.readSync(D,s,0,150,0),u.closeSync(D)}catch{}return e(s.toString())}return o(t,"readShebang"),Qu=t,Qu}o(Nn,"requireReadShebang");var ue,SD;function Ln(){if(SD)return ue;SD=1;const u=W,e=_n(),t=kn(),r=Nn(),n=process.platform==="win32",s=/\.(?:com|exe)$/i,D=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function a(C){C.file=e(C);const F=C.file&&r(C.file);return F?(C.args.unshift(C.file),C.command=F,e(C)):C.file}o(a,"detectShebang");function i(C){if(!n)return C;const F=a(C),c=!s.test(F);if(C.options.forceShell||c){const E=D.test(F);C.command=u.normalize(C.command),C.command=t.command(C.command),C.args=C.args.map(m=>t.argument(m,E));const d=[C.command].concat(C.args).join(" ");C.args=["/d","/s","/c",`"${d}"`],C.command=process.env.comspec||"cmd.exe",C.options.windowsVerbatimArguments=!0}return C}o(i,"parseNonShell");function l(C,F,c){F&&!Array.isArray(F)&&(c=F,F=null),F=F?F.slice(0):[],c=Object.assign({},c);const E={command:C,args:F,options:c,file:void 0,original:{command:C,args:F}};return c.shell?E:i(E)}return o(l,"parse"),ue=l,ue}o(Ln,"requireParse");var ee,OD;function Gn(){if(OD)return ee;OD=1;const u=process.platform==="win32";function e(s,D){return Object.assign(new Error(`${D} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${D} ${s.command}`,path:s.command,spawnargs:s.args})}o(e,"notFoundError");function t(s,D){if(!u)return;const a=s.emit;s.emit=function(i,l){if(i==="exit"){const C=r(l,D);if(C)return a.call(s,"error",C)}return a.apply(s,arguments)}}o(t,"hookChildProcess");function r(s,D){return u&&s===1&&!D.file?e(D.original,"spawn"):null}o(r,"verifyENOENT");function n(s,D){return u&&s===1&&!D.file?e(D.original,"spawnSync"):null}return o(n,"verifyENOENTSync"),ee={hookChildProcess:t,verifyENOENT:r,verifyENOENTSync:n,notFoundError:e},ee}o(Gn,"requireEnoent");var TD;function qn(){if(TD)return z.exports;TD=1;const u=Vt,e=Ln(),t=Gn();function r(s,D,a){const i=e(s,D,a),l=u.spawn(i.command,i.args,i.options);return t.hookChildProcess(l,i),l}o(r,"spawn");function n(s,D,a){const i=e(s,D,a),l=u.spawnSync(i.command,i.args,i.options);return l.error=l.error||t.verifyENOENTSync(l.status,i),l}return o(n,"spawnSync"),z.exports=r,z.exports.spawn=r,z.exports.sync=n,z.exports._parse=e,z.exports._enoent=t,z.exports}o(qn,"requireCrossSpawn");var Wn=qn(),Un=J(Wn);function zn(u){const e=typeof u=="string"?`
|
|
23
|
-
`:10,t=typeof u=="string"?"\r":13;return u[u.length-1]===e&&(u=u.slice(0,-1)),u[u.length-1]===t&&(u=u.slice(0,-1)),u}o(zn,"stripFinalNewline");function ID(u={}){const{env:e=process.env,platform:t=process.platform}=u;return t!=="win32"?"PATH":Object.keys(e).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}o(ID,"pathKey");const Hn=o(({cwd:u=$.cwd(),path:e=$.env[ID()],preferLocal:t=!0,execPath:r=$.execPath,addExecPath:n=!0}={})=>{const s=u instanceof URL?ze(u):u,D=V.resolve(s),a=[];return t&&Yn(a,D),n&&Kn(a,r,D),[...a,e].join(V.delimiter)},"npmRunPath"),Yn=o((u,e)=>{let t;for(;t!==e;)u.push(V.join(e,"node_modules/.bin")),t=e,e=V.resolve(e,"..")},"applyPreferLocal"),Kn=o((u,e,t)=>{const r=e instanceof URL?ze(e):e;u.push(V.resolve(t,r,".."))},"applyExecPath"),Vn=o(({env:u=$.env,...e}={})=>{u={...u};const t=ID({env:u});return e.path=u[t],u[t]=Hn(e),u},"npmRunPathEnv"),Jn=o((u,e,t,r)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;const n=Object.getOwnPropertyDescriptor(u,t),s=Object.getOwnPropertyDescriptor(e,t);!Zn(n,s)&&r||Object.defineProperty(u,t,s)},"copyProperty"),Zn=o(function(u,e){return u===void 0||u.configurable||u.writable===e.writable&&u.enumerable===e.enumerable&&u.configurable===e.configurable&&(u.writable||u.value===e.value)},"canCopyProperty"),Xn=o((u,e)=>{const t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(u)&&Object.setPrototypeOf(u,t)},"changePrototype"),Qn=o((u,e)=>`/* Wrapped ${u}*/
|
|
24
|
-
${e}`,"wrappedToString"),uo=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),eo=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Do=o((u,e,t)=>{const r=t===""?"":`with ${t.trim()}() `,n=Qn.bind(null,r,e.toString());Object.defineProperty(n,"name",eo),Object.defineProperty(u,"toString",{...uo,value:n})},"changeToString");function to(u,e,{ignoreNonConfigurable:t=!1}={}){const{name:r}=u;for(const n of Reflect.ownKeys(e))Jn(u,e,n,t);return Xn(u,e),Do(u,e,r),u}o(to,"mimicFunction");const hu=new WeakMap,PD=o((u,e={})=>{if(typeof u!="function")throw new TypeError("Expected a function");let t,r=0;const n=u.displayName||u.name||"<anonymous>",s=o(function(...D){if(hu.set(s,++r),r===1)t=u.apply(this,D),u=null;else if(e.throw===!0)throw new Error(`Function \`${n}\` can only be called once`);return t},"onetime2");return to(s,u),hu.set(s,r),s},"onetime");PD.callCount=u=>{if(!hu.has(u))throw new Error(`The given function \`${u.name}\` is not wrapped by the \`onetime\` package`);return hu.get(u)};const ro=o(()=>{const u=_D-RD+1;return Array.from({length:u},no)},"getRealtimeSignals"),no=o((u,e)=>({name:`SIGRT${e+1}`,number:RD+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),"getRealtimeSignal"),RD=34,_D=64,oo=[{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"}],kD=o(()=>{const u=ro();return[...oo,...u].map(so)},"getSignals"),so=o(({name:u,number:e,description:t,action:r,forced:n=!1,standard:s})=>{const{signals:{[u]:D}}=He,a=D!==void 0;return{name:u,number:a?D:e,description:t,supported:a,action:r,forced:n,standard:s}},"normalizeSignal"),io=o(()=>{const u=kD();return Object.fromEntries(u.map(ao))},"getSignalsByName"),ao=o(({name:u,number:e,description:t,supported:r,action:n,forced:s,standard:D})=>[u,{name:u,number:e,description:t,supported:r,action:n,forced:s,standard:D}],"getSignalByName"),co=io(),lo=o(()=>{const u=kD(),e=_D+1,t=Array.from({length:e},(r,n)=>Fo(n,u));return Object.assign({},...t)},"getSignalsByNumber"),Fo=o((u,e)=>{const t=Co(u,e);if(t===void 0)return{};const{name:r,description:n,supported:s,action:D,forced:a,standard:i}=t;return{[u]:{name:r,number:u,description:n,supported:s,action:D,forced:a,standard:i}}},"getSignalByNumber"),Co=o((u,e)=>{const t=e.find(({name:r})=>He.signals[r]===u);return t!==void 0?t:e.find(r=>r.number===u)},"findSignalByNumber");lo();const fo=o(({timedOut:u,timeout:e,errorCode:t,signal:r,signalDescription:n,exitCode:s,isCanceled:D})=>u?`timed out after ${e} milliseconds`:D?"was canceled":t!==void 0?`failed with ${t}`:r!==void 0?`was killed with ${r} (${n})`:s!==void 0?`failed with exit code ${s}`:"failed","getErrorPrefix"),MD=o(({stdout:u,stderr:e,all:t,error:r,signal:n,exitCode:s,command:D,escapedCommand:a,timedOut:i,isCanceled:l,killed:C,parsed:{options:{timeout:F,cwd:c=$.cwd()}}})=>{s=s===null?void 0:s,n=n===null?void 0:n;const E=n===void 0?void 0:co[n].description,d=r&&r.code,f=`Command ${fo({timedOut:i,timeout:F,errorCode:d,signal:n,signalDescription:E,exitCode:s,isCanceled:l})}: ${D}`,p=Object.prototype.toString.call(r)==="[object Error]",h=p?`${f}
|
|
25
|
-
${r.message}`:f,g=[h,e,u].filter(Boolean).join(`
|
|
26
|
-
`);return p?(r.originalMessage=r.message,r.message=g):r=new Error(g),r.shortMessage=h,r.command=D,r.escapedCommand=a,r.exitCode=s,r.signal=n,r.signalDescription=E,r.stdout=u,r.stderr=e,r.cwd=c,t!==void 0&&(r.all=t),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!i,r.isCanceled=l,r.killed=C&&!i,r},"makeError"),mu=["stdin","stdout","stderr"],Eo=o(u=>mu.some(e=>u[e]!==void 0),"hasAlias"),po=o(u=>{if(!u)return;const{stdio:e}=u;if(e===void 0)return mu.map(r=>u[r]);if(Eo(u))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${mu.map(r=>`\`${r}\``).join(", ")}`);if(typeof e=="string")return e;if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);const t=Math.max(e.length,mu.length);return Array.from({length:t},(r,n)=>e[n])},"normalizeStdio");var H={exports:{}},De={exports:{}},jD;function ho(){return jD||(jD=1,(function(u){u.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&u.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&u.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")})(De)),De.exports}o(ho,"requireSignals");var ND;function mo(){if(ND)return H.exports;ND=1;var u=G.process;const e=o(function(f){return f&&typeof f=="object"&&typeof f.removeListener=="function"&&typeof f.emit=="function"&&typeof f.reallyExit=="function"&&typeof f.listeners=="function"&&typeof f.kill=="function"&&typeof f.pid=="number"&&typeof f.on=="function"},"processOk");if(!e(u))H.exports=function(){return function(){}};else{var t=Ye,r=ho(),n=/^win/i.test(u.platform),s=Ke;typeof s!="function"&&(s=s.EventEmitter);var D;u.__signal_exit_emitter__?D=u.__signal_exit_emitter__:(D=u.__signal_exit_emitter__=new s,D.count=0,D.emitted={}),D.infinite||(D.setMaxListeners(1/0),D.infinite=!0),H.exports=function(f,p){if(!e(G.process))return function(){};t.equal(typeof f,"function","a callback must be provided for exit handler"),C===!1&&F();var h="exit";p&&p.alwaysLast&&(h="afterexit");var g=o(function(){D.removeListener(h,f),D.listeners("exit").length===0&&D.listeners("afterexit").length===0&&a()},"remove");return D.on(h,f),g};var a=o(function(){!C||!e(G.process)||(C=!1,r.forEach(function(p){try{u.removeListener(p,l[p])}catch{}}),u.emit=d,u.reallyExit=c,D.count-=1)},"unload2");H.exports.unload=a;var i=o(function(p,h,g){D.emitted[p]||(D.emitted[p]=!0,D.emit(p,h,g))},"emit2"),l={};r.forEach(function(f){l[f]=o(function(){if(e(G.process)){var h=u.listeners(f);h.length===D.count&&(a(),i("exit",null,f),i("afterexit",null,f),n&&f==="SIGHUP"&&(f="SIGINT"),u.kill(u.pid,f))}},"listener")}),H.exports.signals=function(){return r};var C=!1,F=o(function(){C||!e(G.process)||(C=!0,D.count+=1,r=r.filter(function(p){try{return u.on(p,l[p]),!0}catch{return!1}}),u.emit=m,u.reallyExit=E)},"load2");H.exports.load=F;var c=u.reallyExit,E=o(function(p){e(G.process)&&(u.exitCode=p||0,i("exit",u.exitCode,null),i("afterexit",u.exitCode,null),c.call(u,u.exitCode))},"processReallyExit2"),d=u.emit,m=o(function(p,h){if(p==="exit"&&e(G.process)){h!==void 0&&(u.exitCode=h);var g=d.apply(this,arguments);return i("exit",u.exitCode,null),i("afterexit",u.exitCode,null),g}else return d.apply(this,arguments)},"processEmit2")}return H.exports}o(mo,"requireSignalExit");var go=mo(),Bo=J(go);const yo=1e3*5,bo=o((u,e="SIGTERM",t={})=>{const r=u(e);return Ao(u,e,t,r),r},"spawnedKill"),Ao=o((u,e,t,r)=>{if(!wo(e,t,r))return;const n=$o(t),s=setTimeout(()=>{u("SIGKILL")},n);s.unref&&s.unref()},"setKillTimeout"),wo=o((u,{forceKillAfterTimeout:e},t)=>vo(u)&&e!==!1&&t,"shouldForceKill"),vo=o(u=>u===Jt.constants.signals.SIGTERM||typeof u=="string"&&u.toUpperCase()==="SIGTERM","isSigterm"),$o=o(({forceKillAfterTimeout:u=!0})=>{if(u===!0)return yo;if(!Number.isFinite(u)||u<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${u}\` (${typeof u})`);return u},"getForceKillAfterTimeout"),xo=o((u,e)=>{u.kill()&&(e.isCanceled=!0)},"spawnedCancel"),So=o((u,e,t)=>{u.kill(e),t(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))},"timeoutKill"),Oo=o((u,{timeout:e,killSignal:t="SIGTERM"},r)=>{if(e===0||e===void 0)return r;let n;const s=new Promise((a,i)=>{n=setTimeout(()=>{So(u,t,i)},e)}),D=r.finally(()=>{clearTimeout(n)});return Promise.race([s,D])},"setupTimeout"),To=o(({timeout:u})=>{if(u!==void 0&&(!Number.isFinite(u)||u<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${u}\` (${typeof u})`)},"validateTimeout"),Io=o(async(u,{cleanup:e,detached:t},r)=>{if(!e||t)return r;const n=Bo(()=>{u.kill()});return r.finally(()=>{n()})},"setExitHandler");function LD(u){return u!==null&&typeof u=="object"&&typeof u.pipe=="function"}o(LD,"isStream");function GD(u){return LD(u)&&u.writable!==!1&&typeof u._write=="function"&&typeof u._writableState=="object"}o(GD,"isWritableStream");const Po=o(u=>u instanceof Kt&&typeof u.then=="function","isExecaChildProcess"),te=o((u,e,t)=>{if(typeof t=="string")return u[e].pipe(Zt(t)),u;if(GD(t))return u[e].pipe(t),u;if(!Po(t))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!GD(t.stdin))throw new TypeError("The target child process's stdin must be available.");return u[e].pipe(t.stdin),t},"pipeToTarget"),Ro=o(u=>{u.stdout!==null&&(u.pipeStdout=te.bind(void 0,u,"stdout")),u.stderr!==null&&(u.pipeStderr=te.bind(void 0,u,"stderr")),u.all!==void 0&&(u.pipeAll=te.bind(void 0,u,"all"))},"addPipeMethods");var Z={exports:{}},re,qD;function _o(){if(qD)return re;qD=1;const{PassThrough:u}=ku;return re=o(e=>{e={...e};const{array:t}=e;let{encoding:r}=e;const n=r==="buffer";let s=!1;t?s=!(r||n):r=r||"utf8",n&&(r=null);const D=new u({objectMode:s});r&&D.setEncoding(r);let a=0;const i=[];return D.on("data",l=>{i.push(l),s?a=i.length:a+=l.length}),D.getBufferedValue=()=>t?i:n?Buffer.concat(i,a):i.join(""),D.getBufferedLength=()=>a,D},"bufferStream"),re}o(_o,"requireBufferStream");var WD;function ko(){if(WD)return Z.exports;WD=1;const{constants:u}=Qt,e=ku,{promisify:t}=Ve,r=_o(),n=t(e.pipeline),a=class a extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};o(a,"MaxBufferError");let s=a;async function D(i,l){if(!i)throw new Error("Expected a stream");l={maxBuffer:1/0,...l};const{maxBuffer:C}=l,F=r(l);return await new Promise((c,E)=>{const d=o(m=>{m&&F.getBufferedLength()<=u.MAX_LENGTH&&(m.bufferedData=F.getBufferedValue()),E(m)},"rejectPromise");(async()=>{try{await n(i,F),c()}catch(m){d(m)}})(),F.on("data",()=>{F.getBufferedLength()>C&&d(new s)})}),F.getBufferedValue()}return o(D,"getStream"),Z.exports=D,Z.exports.buffer=(i,l)=>D(i,{...l,encoding:"buffer"}),Z.exports.array=(i,l)=>D(i,{...l,array:!0}),Z.exports.MaxBufferError=s,Z.exports}o(ko,"requireGetStream");var Mo=ko(),UD=J(Mo),ne,zD;function jo(){if(zD)return ne;zD=1;const{PassThrough:u}=ku;return ne=o(function(){var e=[],t=new u({objectMode:!0});return t.setMaxListeners(0),t.add=r,t.isEmpty=n,t.on("unpipe",s),Array.prototype.slice.call(arguments).forEach(r),t;function r(D){return Array.isArray(D)?(D.forEach(r),this):(e.push(D),D.once("end",s.bind(null,D)),D.once("error",t.emit.bind(t,"error")),D.pipe(t,{end:!1}),this)}o(r,"add");function n(){return e.length==0}o(n,"isEmpty");function s(D){e=e.filter(function(a){return a!==D}),!e.length&&t.readable&&t.end()}o(s,"remove")},"mergeStream$1"),ne}o(jo,"requireMergeStream");var No=jo(),Lo=J(No);const Go=o(u=>{if(u!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},"validateInputOptions"),qo=o(({input:u,inputFile:e})=>typeof e!="string"?u:(Go(u),Xt(e)),"getInput"),Wo=o((u,e)=>{const t=qo(e);t!==void 0&&(LD(t)?t.pipe(u.stdin):u.stdin.end(t))},"handleInput"),Uo=o((u,{all:e})=>{if(!e||!u.stdout&&!u.stderr)return;const t=Lo();return u.stdout&&t.add(u.stdout),u.stderr&&t.add(u.stderr),t},"makeAllStream"),oe=o(async(u,e)=>{if(!(!u||e===void 0)){u.destroy();try{return await e}catch(t){return t.bufferedData}}},"getBufferedData"),se=o((u,{encoding:e,buffer:t,maxBuffer:r})=>{if(!(!u||!t))return e?UD(u,{encoding:e,maxBuffer:r}):UD.buffer(u,{maxBuffer:r})},"getStreamPromise"),zo=o(async({stdout:u,stderr:e,all:t},{encoding:r,buffer:n,maxBuffer:s},D)=>{const a=se(u,{encoding:r,buffer:n,maxBuffer:s}),i=se(e,{encoding:r,buffer:n,maxBuffer:s}),l=se(t,{encoding:r,buffer:n,maxBuffer:s*2});try{return await Promise.all([D,a,i,l])}catch(C){return Promise.all([{error:C,signal:C.signal,timedOut:C.timedOut},oe(u,a),oe(e,i),oe(t,l)])}},"getSpawnedResult"),Ho=(async()=>{})().constructor.prototype,Yo=["then","catch","finally"].map(u=>[u,Reflect.getOwnPropertyDescriptor(Ho,u)]),HD=o((u,e)=>{for(const[t,r]of Yo){const n=typeof e=="function"?(...s)=>Reflect.apply(r.value,e(),s):r.value.bind(e);Reflect.defineProperty(u,t,{...r,value:n})}},"mergePromise"),Ko=o(u=>new Promise((e,t)=>{u.on("exit",(r,n)=>{e({exitCode:r,signal:n})}),u.on("error",r=>{t(r)}),u.stdin&&u.stdin.on("error",r=>{t(r)})}),"getSpawnedPromise"),YD=o((u,e=[])=>Array.isArray(e)?[u,...e]:[u],"normalizeArgs"),Vo=/^[\w.-]+$/,Jo=/"/g,Zo=o(u=>typeof u!="string"||Vo.test(u)?u:`"${u.replace(Jo,'\\"')}"`,"escapeArg"),Xo=o((u,e)=>YD(u,e).join(" "),"joinCommand"),Qo=o((u,e)=>YD(u,e).map(t=>Zo(t)).join(" "),"getEscapedCommand"),us=ur("execa").enabled,gu=o((u,e)=>String(u).padStart(e,"0"),"padField"),es=o(()=>{const u=new Date;return`${gu(u.getHours(),2)}:${gu(u.getMinutes(),2)}:${gu(u.getSeconds(),2)}.${gu(u.getMilliseconds(),3)}`},"getTimestamp"),Ds=o((u,{verbose:e})=>{e&&$.stderr.write(`[${es()}] ${u}
|
|
27
|
-
`)},"logCommand"),ts=1e3*1e3*100,rs=o(({env:u,extendEnv:e,preferLocal:t,localDir:r,execPath:n})=>{const s=e?{...$.env,...u}:u;return t?Vn({env:s,cwd:r,execPath:n}):s},"getEnv"),ns=o((u,e,t={})=>{const r=Un._parse(u,e,t);return u=r.command,e=r.args,t=r.options,t={maxBuffer:ts,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:t.cwd||$.cwd(),execPath:$.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:us,...t},t.env=rs(t),t.stdio=po(t),$.platform==="win32"&&V.basename(u,".exe")==="cmd"&&e.unshift("/q"),{file:u,args:e,options:t,parsed:r}},"handleArguments"),ie=o((u,e,t)=>typeof e!="string"&&!Yt.isBuffer(e)?t===void 0?void 0:"":u.stripFinalNewline?zn(e):e,"handleOutput");function X(u,e,t){const r=ns(u,e,t),n=Xo(u,e),s=Qo(u,e);Ds(s,r.options),To(r.options);let D;try{D=qe.spawn(r.file,r.args,r.options)}catch(E){const d=new qe.ChildProcess,m=Promise.reject(MD({error:E,stdout:"",stderr:"",all:"",command:n,escapedCommand:s,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return HD(d,m),d}const a=Ko(D),i=Oo(D,r.options,a),l=Io(D,r.options,i),C={isCanceled:!1};D.kill=bo.bind(null,D.kill.bind(D)),D.cancel=xo.bind(null,D,C);const c=PD(o(async()=>{const[{error:E,exitCode:d,signal:m,timedOut:f},p,h,g]=await zo(D,r.options,l),B=ie(r.options,p),b=ie(r.options,h),y=ie(r.options,g);if(E||d!==0||m!==null){const v=MD({error:E,exitCode:d,signal:m,stdout:B,stderr:b,all:y,command:n,escapedCommand:s,parsed:r,timedOut:f,isCanceled:C.isCanceled||(r.options.signal?r.options.signal.aborted:!1),killed:D.killed});if(!r.options.reject)return v;throw v}return{command:n,escapedCommand:s,exitCode:0,stdout:B,stderr:b,all:y,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}},"handlePromise"));return Wo(D,r.options),D.all=Uo(D,r.options),Ro(D),HD(D,c),D}o(X,"execa");let Y=!0;const Q=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let nu=0;if(Q.process&&Q.process.env&&Q.process.stdout){const{FORCE_COLOR:u,NODE_DISABLE_COLORS:e,NO_COLOR:t,TERM:r,COLORTERM:n}=Q.process.env;e||t||u==="0"?Y=!1:u==="1"||u==="2"||u==="3"?Y=!0:r==="dumb"?Y=!1:"CI"in Q.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in Q.process.env)?Y=!0:Y=process.stdout.isTTY,Y&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?nu=3:r&&(r.endsWith("-256color")||r.endsWith("256"))?nu=2:nu=1)}let KD={enabled:Y,supportLevel:nu};function ou(u,e,t=1){const r=`\x1B[${u}m`,n=`\x1B[${e}m`,s=new RegExp(`\\x1b\\[${e}m`,"g");return D=>KD.enabled&&KD.supportLevel>=t?r+(""+D).replace(s,r)+n:""+D}o(ou,"kolorist");const ae=ou(2,22),VD=ou(30,39),Bu=ou(31,39),su=ou(32,39),JD=ou(46,49);var ce,ZD;function os(){if(ZD)return ce;ZD=1;const u="\x1B",e=`${u}[`,t="\x07",r={to(D,a){return a?`${e}${a+1};${D+1}H`:`${e}${D+1}G`},move(D,a){let i="";return D<0?i+=`${e}${-D}D`:D>0&&(i+=`${e}${D}C`),a<0?i+=`${e}${-a}A`:a>0&&(i+=`${e}${a}B`),i},up:o((D=1)=>`${e}${D}A`,"up"),down:o((D=1)=>`${e}${D}B`,"down"),forward:o((D=1)=>`${e}${D}C`,"forward"),backward:o((D=1)=>`${e}${D}D`,"backward"),nextLine:o((D=1)=>`${e}E`.repeat(D),"nextLine"),prevLine:o((D=1)=>`${e}F`.repeat(D),"prevLine"),left:`${e}G`,hide:`${e}?25l`,show:`${e}?25h`,save:`${u}7`,restore:`${u}8`},n={up:o((D=1)=>`${e}S`.repeat(D),"up"),down:o((D=1)=>`${e}T`.repeat(D),"down")},s={screen:`${e}2J`,up:o((D=1)=>`${e}1J`.repeat(D),"up"),down:o((D=1)=>`${e}J`.repeat(D),"down"),line:`${e}2K`,lineEnd:`${e}K`,lineStart:`${e}1K`,lines(D){let a="";for(let i=0;i<D;i++)a+=this.line+(i<D-1?r.up():"");return D&&(a+=r.left),a}};return ce={cursor:r,scroll:n,erase:s,beep:t},ce}o(os,"requireSrc$2");var O=os(),yu={exports:{}},XD;function ss(){if(XD)return yu.exports;XD=1;let u=process||{},e=u.argv||[],t=u.env||{},r=!(t.NO_COLOR||e.includes("--no-color"))&&(!!t.FORCE_COLOR||e.includes("--color")||u.platform==="win32"||(u.stdout||{}).isTTY&&t.TERM!=="dumb"||!!t.CI),n=o((a,i,l=a)=>C=>{let F=""+C,c=F.indexOf(i,a.length);return~c?a+s(F,i,l,c)+i:a+F+i},"formatter"),s=o((a,i,l,C)=>{let F="",c=0;do F+=a.substring(c,C)+l,c=C+i.length,C=a.indexOf(i,c);while(~C);return F+a.substring(c)},"replaceClose"),D=o((a=r)=>{let i=a?n:()=>String;return{isColorSupported:a,reset:i("\x1B[0m","\x1B[0m"),bold:i("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:i("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:i("\x1B[3m","\x1B[23m"),underline:i("\x1B[4m","\x1B[24m"),inverse:i("\x1B[7m","\x1B[27m"),hidden:i("\x1B[8m","\x1B[28m"),strikethrough:i("\x1B[9m","\x1B[29m"),black:i("\x1B[30m","\x1B[39m"),red:i("\x1B[31m","\x1B[39m"),green:i("\x1B[32m","\x1B[39m"),yellow:i("\x1B[33m","\x1B[39m"),blue:i("\x1B[34m","\x1B[39m"),magenta:i("\x1B[35m","\x1B[39m"),cyan:i("\x1B[36m","\x1B[39m"),white:i("\x1B[37m","\x1B[39m"),gray:i("\x1B[90m","\x1B[39m"),bgBlack:i("\x1B[40m","\x1B[49m"),bgRed:i("\x1B[41m","\x1B[49m"),bgGreen:i("\x1B[42m","\x1B[49m"),bgYellow:i("\x1B[43m","\x1B[49m"),bgBlue:i("\x1B[44m","\x1B[49m"),bgMagenta:i("\x1B[45m","\x1B[49m"),bgCyan:i("\x1B[46m","\x1B[49m"),bgWhite:i("\x1B[47m","\x1B[49m"),blackBright:i("\x1B[90m","\x1B[39m"),redBright:i("\x1B[91m","\x1B[39m"),greenBright:i("\x1B[92m","\x1B[39m"),yellowBright:i("\x1B[93m","\x1B[39m"),blueBright:i("\x1B[94m","\x1B[39m"),magentaBright:i("\x1B[95m","\x1B[39m"),cyanBright:i("\x1B[96m","\x1B[39m"),whiteBright:i("\x1B[97m","\x1B[39m"),bgBlackBright:i("\x1B[100m","\x1B[49m"),bgRedBright:i("\x1B[101m","\x1B[49m"),bgGreenBright:i("\x1B[102m","\x1B[49m"),bgYellowBright:i("\x1B[103m","\x1B[49m"),bgBlueBright:i("\x1B[104m","\x1B[49m"),bgMagentaBright:i("\x1B[105m","\x1B[49m"),bgCyanBright:i("\x1B[106m","\x1B[49m"),bgWhiteBright:i("\x1B[107m","\x1B[49m")}},"createColors");return yu.exports=D(),yu.exports.createColors=D,yu.exports}o(ss,"requirePicocolors");var is=ss(),A=J(is);function as({onlyFirst:u=!1}={}){const e=["[\\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(e,u?void 0:"g")}o(as,"DD");const cs=as();function QD(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(cs,"")}o(QD,"P$1");function ut(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}o(ut,"L$1");var et={exports:{}};(function(u){var e={};u.exports=e,e.eastAsianWidth=function(r){var n=r.charCodeAt(0),s=r.length==2?r.charCodeAt(1):0,D=n;return 55296<=n&&n<=56319&&56320<=s&&s<=57343&&(n&=1023,s&=1023,D=n<<10|s,D+=65536),D==12288||65281<=D&&D<=65376||65504<=D&&D<=65510?"F":D==8361||65377<=D&&D<=65470||65474<=D&&D<=65479||65482<=D&&D<=65487||65490<=D&&D<=65495||65498<=D&&D<=65500||65512<=D&&D<=65518?"H":4352<=D&&D<=4447||4515<=D&&D<=4519||4602<=D&&D<=4607||9001<=D&&D<=9002||11904<=D&&D<=11929||11931<=D&&D<=12019||12032<=D&&D<=12245||12272<=D&&D<=12283||12289<=D&&D<=12350||12353<=D&&D<=12438||12441<=D&&D<=12543||12549<=D&&D<=12589||12593<=D&&D<=12686||12688<=D&&D<=12730||12736<=D&&D<=12771||12784<=D&&D<=12830||12832<=D&&D<=12871||12880<=D&&D<=13054||13056<=D&&D<=19903||19968<=D&&D<=42124||42128<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||55216<=D&&D<=55238||55243<=D&&D<=55291||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65106||65108<=D&&D<=65126||65128<=D&&D<=65131||110592<=D&&D<=110593||127488<=D&&D<=127490||127504<=D&&D<=127546||127552<=D&&D<=127560||127568<=D&&D<=127569||131072<=D&&D<=194367||177984<=D&&D<=196605||196608<=D&&D<=262141?"W":32<=D&&D<=126||162<=D&&D<=163||165<=D&&D<=166||D==172||D==175||10214<=D&&D<=10221||10629<=D&&D<=10630?"Na":D==161||D==164||167<=D&&D<=168||D==170||173<=D&&D<=174||176<=D&&D<=180||182<=D&&D<=186||188<=D&&D<=191||D==198||D==208||215<=D&&D<=216||222<=D&&D<=225||D==230||232<=D&&D<=234||236<=D&&D<=237||D==240||242<=D&&D<=243||247<=D&&D<=250||D==252||D==254||D==257||D==273||D==275||D==283||294<=D&&D<=295||D==299||305<=D&&D<=307||D==312||319<=D&&D<=322||D==324||328<=D&&D<=331||D==333||338<=D&&D<=339||358<=D&&D<=359||D==363||D==462||D==464||D==466||D==468||D==470||D==472||D==474||D==476||D==593||D==609||D==708||D==711||713<=D&&D<=715||D==717||D==720||728<=D&&D<=731||D==733||D==735||768<=D&&D<=879||913<=D&&D<=929||931<=D&&D<=937||945<=D&&D<=961||963<=D&&D<=969||D==1025||1040<=D&&D<=1103||D==1105||D==8208||8211<=D&&D<=8214||8216<=D&&D<=8217||8220<=D&&D<=8221||8224<=D&&D<=8226||8228<=D&&D<=8231||D==8240||8242<=D&&D<=8243||D==8245||D==8251||D==8254||D==8308||D==8319||8321<=D&&D<=8324||D==8364||D==8451||D==8453||D==8457||D==8467||D==8470||8481<=D&&D<=8482||D==8486||D==8491||8531<=D&&D<=8532||8539<=D&&D<=8542||8544<=D&&D<=8555||8560<=D&&D<=8569||D==8585||8592<=D&&D<=8601||8632<=D&&D<=8633||D==8658||D==8660||D==8679||D==8704||8706<=D&&D<=8707||8711<=D&&D<=8712||D==8715||D==8719||D==8721||D==8725||D==8730||8733<=D&&D<=8736||D==8739||D==8741||8743<=D&&D<=8748||D==8750||8756<=D&&D<=8759||8764<=D&&D<=8765||D==8776||D==8780||D==8786||8800<=D&&D<=8801||8804<=D&&D<=8807||8810<=D&&D<=8811||8814<=D&&D<=8815||8834<=D&&D<=8835||8838<=D&&D<=8839||D==8853||D==8857||D==8869||D==8895||D==8978||9312<=D&&D<=9449||9451<=D&&D<=9547||9552<=D&&D<=9587||9600<=D&&D<=9615||9618<=D&&D<=9621||9632<=D&&D<=9633||9635<=D&&D<=9641||9650<=D&&D<=9651||9654<=D&&D<=9655||9660<=D&&D<=9661||9664<=D&&D<=9665||9670<=D&&D<=9672||D==9675||9678<=D&&D<=9681||9698<=D&&D<=9701||D==9711||9733<=D&&D<=9734||D==9737||9742<=D&&D<=9743||9748<=D&&D<=9749||D==9756||D==9758||D==9792||D==9794||9824<=D&&D<=9825||9827<=D&&D<=9829||9831<=D&&D<=9834||9836<=D&&D<=9837||D==9839||9886<=D&&D<=9887||9918<=D&&D<=9919||9924<=D&&D<=9933||9935<=D&&D<=9953||D==9955||9960<=D&&D<=9983||D==10045||D==10071||10102<=D&&D<=10111||11093<=D&&D<=11097||12872<=D&&D<=12879||57344<=D&&D<=63743||65024<=D&&D<=65039||D==65533||127232<=D&&D<=127242||127248<=D&&D<=127277||127280<=D&&D<=127337||127344<=D&&D<=127386||917760<=D&&D<=917999||983040<=D&&D<=1048573||1048576<=D&&D<=1114109?"A":"N"},e.characterLength=function(r){var n=this.eastAsianWidth(r);return n=="F"||n=="W"||n=="A"?2:1};function t(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}o(t,"t"),e.length=function(r){for(var n=t(r),s=0,D=0;D<n.length;D++)s=s+this.characterLength(n[D]);return s},e.slice=function(r,n,s){textLen=e.length(r),n=n||0,s=s||1,n<0&&(n=textLen+n),s<0&&(s=textLen+s);for(var D="",a=0,i=t(r),l=0;l<i.length;l++){var C=i[l],F=e.length(C);if(a>=n-(F==2?1:0))if(a+F<=s)D+=C;else break;a+=F}return D}})(et);var ls=et.exports;const Fs=ut(ls);var Cs=o(function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\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|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\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]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},"FD");const fs=ut(Cs);function iu(u,e={}){if(typeof u!="string"||u.length===0||(e={ambiguousIsNarrow:!0,...e},u=QD(u),u.length===0))return 0;u=u.replace(fs()," ");const t=e.ambiguousIsNarrow?1:2;let r=0;for(const n of u){const s=n.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(Fs.eastAsianWidth(n)){case"F":case"W":r+=2;break;case"A":r+=t;break;default:r+=1}}return r}o(iu,"p");const le=10,Dt=o((u=0)=>e=>`\x1B[${e+u}m`,"N"),tt=o((u=0)=>e=>`\x1B[${38+u};5;${e}m`,"I"),rt=o((u=0)=>(e,t,r)=>`\x1B[${38+u};2;${e};${t};${r}m`,"R"),w={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(w.modifier);const ds=Object.keys(w.color),Es=Object.keys(w.bgColor);[...ds,...Es];function ps(){const u=new Map;for(const[e,t]of Object.entries(w)){for(const[r,n]of Object.entries(t))w[r]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},t[r]=w[r],u.set(n[0],n[1]);Object.defineProperty(w,e,{value:t,enumerable:!1})}return Object.defineProperty(w,"codes",{value:u,enumerable:!1}),w.color.close="\x1B[39m",w.bgColor.close="\x1B[49m",w.color.ansi=Dt(),w.color.ansi256=tt(),w.color.ansi16m=rt(),w.bgColor.ansi=Dt(le),w.bgColor.ansi256=tt(le),w.bgColor.ansi16m=rt(le),Object.defineProperties(w,{rgbToAnsi256:{value:o((e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),"value"),enumerable:!1},hexToRgb:{value:o(e=>{const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(s=>s+s).join(""));const n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},"value"),enumerable:!1},hexToAnsi256:{value:o(e=>w.rgbToAnsi256(...w.hexToRgb(e)),"value"),enumerable:!1},ansi256ToAnsi:{value:o(e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,r,n;if(e>=232)t=((e-232)*10+8)/255,r=t,n=t;else{e-=16;const a=e%36;t=Math.floor(e/36)/5,r=Math.floor(a/6)/5,n=a%6/5}const s=Math.max(t,r,n)*2;if(s===0)return 30;let D=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return s===2&&(D+=60),D},"value"),enumerable:!1},rgbToAnsi:{value:o((e,t,r)=>w.ansi256ToAnsi(w.rgbToAnsi256(e,t,r)),"value"),enumerable:!1},hexToAnsi:{value:o(e=>w.ansi256ToAnsi(w.hexToAnsi256(e)),"value"),enumerable:!1}}),w}o(ps,"rD");const hs=ps(),bu=new Set(["\x1B","\x9B"]),ms=39,Fe="\x07",nt="[",gs="]",ot="m",Ce=`${gs}8;;`,st=o(u=>`${bu.values().next().value}${nt}${u}${ot}`,"z"),it=o(u=>`${bu.values().next().value}${Ce}${u}${Fe}`,"K"),Bs=o(u=>u.split(" ").map(e=>iu(e)),"aD"),fe=o((u,e,t)=>{const r=[...e];let n=!1,s=!1,D=iu(QD(u[u.length-1]));for(const[a,i]of r.entries()){const l=iu(i);if(D+l<=t?u[u.length-1]+=i:(u.push(i),D=0),bu.has(i)&&(n=!0,s=r.slice(a+1).join("").startsWith(Ce)),n){s?i===Fe&&(n=!1,s=!1):i===ot&&(n=!1);continue}D+=l,D===t&&a<r.length-1&&(u.push(""),D=0)}!D&&u[u.length-1].length>0&&u.length>1&&(u[u.length-2]+=u.pop())},"k$1"),ys=o(u=>{const e=u.split(" ");let t=e.length;for(;t>0&&!(iu(e[t-1])>0);)t--;return t===e.length?u:e.slice(0,t).join(" ")+e.slice(t).join("")},"hD"),bs=o((u,e,t={})=>{if(t.trim!==!1&&u.trim()==="")return"";let r="",n,s;const D=Bs(u);let a=[""];for(const[l,C]of u.split(" ").entries()){t.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let F=iu(a[a.length-1]);if(l!==0&&(F>=e&&(t.wordWrap===!1||t.trim===!1)&&(a.push(""),F=0),(F>0||t.trim===!1)&&(a[a.length-1]+=" ",F++)),t.hard&&D[l]>e){const c=e-F,E=1+Math.floor((D[l]-c-1)/e);Math.floor((D[l]-1)/e)<E&&a.push(""),fe(a,C,e);continue}if(F+D[l]>e&&F>0&&D[l]>0){if(t.wordWrap===!1&&F<e){fe(a,C,e);continue}a.push("")}if(F+D[l]>e&&t.wordWrap===!1){fe(a,C,e);continue}a[a.length-1]+=C}t.trim!==!1&&(a=a.map(l=>ys(l)));const i=[...a.join(`
|
|
28
|
-
`)];for(const[l,C]of i.entries()){if(r+=C,bu.has(C)){const{groups:c}=new RegExp(`(?:\\${nt}(?<code>\\d+)m|\\${Ce}(?<uri>.*)${Fe})`).exec(i.slice(l).join(""))||{groups:{}};if(c.code!==void 0){const E=Number.parseFloat(c.code);n=E===ms?void 0:E}else c.uri!==void 0&&(s=c.uri.length===0?void 0:c.uri)}const F=hs.codes.get(Number(n));i[l+1]===`
|
|
29
|
-
`?(s&&(r+=it("")),n&&F&&(r+=st(F))):C===`
|
|
30
|
-
`&&(n&&F&&(r+=st(n)),s&&(r+=it(s)))}return r},"lD");function at(u,e,t){return String(u).normalize().replace(/\r\n/g,`
|
|
31
|
-
`).split(`
|
|
32
|
-
`).map(r=>bs(r,e,t)).join(`
|
|
33
|
-
`)}o(at,"Y$1");const As=["up","down","left","right","space","enter","cancel"],Au={actions:new Set(As),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function de(u,e){if(typeof u=="string")return Au.aliases.get(u)===e;for(const t of u)if(t!==void 0&&de(t,e))return!0;return!1}o(de,"$");function ws(u,e){if(u===e)return;const t=u.split(`
|
|
34
|
-
`),r=e.split(`
|
|
35
|
-
`),n=[];for(let s=0;s<Math.max(t.length,r.length);s++)t[s]!==r[s]&&n.push(s);return n}o(ws,"BD");const vs=globalThis.process.platform.startsWith("win"),Ee=Symbol("clack:cancel");function ct(u){return u===Ee}o(ct,"pD");function wu(u,e){const t=u;t.isTTY&&t.setRawMode(e)}o(wu,"m");function $s({input:u=Ue,output:e=We,overwrite:t=!0,hideCursor:r=!0}={}){const n=lu.createInterface({input:u,output:e,prompt:"",tabSize:1});lu.emitKeypressEvents(u,n),u.isTTY&&u.setRawMode(!0);const s=o((D,{name:a,sequence:i})=>{const l=String(D);if(de([l,a,i],"cancel")){r&&e.write(O.cursor.show),process.exit(0);return}if(!t)return;const C=a==="return"?0:-1,F=a==="return"?-1:0;lu.moveCursor(e,C,F,()=>{lu.clearLine(e,1,()=>{u.once("keypress",s)})})},"i");return r&&e.write(O.cursor.hide),u.once("keypress",s),()=>{u.off("keypress",s),r&&e.write(O.cursor.show),u.isTTY&&!vs&&u.setRawMode(!1),n.terminal=!1,n.close()}}o($s,"fD");var xs=Object.defineProperty,Ss=o((u,e,t)=>e in u?xs(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t,"vD"),R=o((u,e,t)=>(Ss(u,typeof e!="symbol"?e+"":e,t),t),"h");const Me=class Me{constructor(e,t=!0){R(this,"input"),R(this,"output"),R(this,"_abortSignal"),R(this,"rl"),R(this,"opts"),R(this,"_render"),R(this,"_track",!1),R(this,"_prevFrame",""),R(this,"_subscribers",new Map),R(this,"_cursor",0),R(this,"state","initial"),R(this,"error",""),R(this,"value");const{input:r=Ue,output:n=We,render:s,signal:D,...a}=e;this.opts=a,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=t,this._abortSignal=D,this.input=r,this.output=n}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){const r=this._subscribers.get(e)??[];r.push(t),this._subscribers.set(e,r)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){const r=this._subscribers.get(e)??[],n=[];for(const s of r)s.cb(...t),s.once&&n.push(()=>r.splice(r.indexOf(s),1));for(const s of n)s()}prompt(){return new Promise((e,t)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(Ee);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}const r=new er;r._write=(n,s,D)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),D()},this.input.pipe(r),this.rl=Je.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),Je.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),wu(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(O.cursor.show),this.output.off("resize",this.render),wu(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(O.cursor.show),this.output.off("resize",this.render),wu(this.input,!1),e(Ee)})})}onKeypress(e,t){if(this.state==="error"&&(this.state="active"),t?.name&&(!this._track&&Au.aliases.has(t.name)&&this.emit("cursor",Au.aliases.get(t.name)),Au.actions.has(t.name)&&this.emit("cursor",t.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),t?.name==="return"){if(this.opts.validate){const r=this.opts.validate(this.value);r&&(this.error=r instanceof Error?r.message:r,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}de([e,t?.name,t?.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(`
|
|
36
|
-
`),wu(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const e=at(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
37
|
-
`).length-1;this.output.write(O.cursor.move(-999,e*-1))}render(){const e=at(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(O.cursor.hide);else{const t=ws(this._prevFrame,e);if(this.restoreCursor(),t&&t?.length===1){const r=t[0];this.output.write(O.cursor.move(0,r)),this.output.write(O.erase.lines(1));const n=e.split(`
|
|
38
|
-
`);this.output.write(n[r]),this._prevFrame=e,this.output.write(O.cursor.move(0,n.length-r-1));return}if(t&&t?.length>1){const r=t[0];this.output.write(O.cursor.move(0,r)),this.output.write(O.erase.down());const n=e.split(`
|
|
39
|
-
`).slice(r);this.output.write(n.join(`
|
|
40
|
-
`)),this._prevFrame=e;return}this.output.write(O.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};o(Me,"x");let vu=Me;const je=class je extends vu{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",t=>{this.output.write(O.cursor.move(0,-1)),this.value=t,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};o(je,"dD");let pe=je;var Os=Object.defineProperty,Ts=o((u,e,t)=>e in u?Os(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t,"PD"),lt=o((u,e,t)=>(Ts(u,typeof e!="symbol"?e+"":e,t),t),"J");const Ne=class Ne extends vu{constructor(e){super(e,!1),lt(this,"options"),lt(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",t=>{switch(t){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};o(Ne,"LD");let he=Ne;function Is(){return $.platform!=="win32"?$.env.TERM!=="linux":!!$.env.CI||!!$.env.WT_SESSION||!!$.env.TERMINUS_SUBLIME||$.env.ConEmuTask==="{cmd::Cmder}"||$.env.TERM_PROGRAM==="Terminus-Sublime"||$.env.TERM_PROGRAM==="vscode"||$.env.TERM==="xterm-256color"||$.env.TERM==="alacritty"||$.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}o(Is,"ce");const me=Is(),N=o((u,e)=>me?u:e,"u"),Ps=N("\u25C6","*"),Ft=N("\u25A0","x"),Ct=N("\u25B2","x"),ft=N("\u25C7","o"),Rs=N("\u250C","T"),P=N("\u2502","|"),ge=N("\u2514","\u2014"),Be=N("\u25CF",">"),ye=N("\u25CB"," "),dt=o(u=>{switch(u){case"initial":case"active":return A.cyan(Ps);case"cancel":return A.red(Ft);case"error":return A.yellow(Ct);case"submit":return A.green(ft)}},"b"),_s=o(u=>{const{cursor:e,options:t,style:r}=u,n=u.maxItems??Number.POSITIVE_INFINITY,s=Math.max(process.stdout.rows-4,0),D=Math.min(s,Math.max(n,5));let a=0;e>=a+D-3?a=Math.max(Math.min(e-D+3,t.length-D),0):e<a+2&&(a=Math.max(e-2,0));const i=D<t.length&&a>0,l=D<t.length&&a+D<t.length;return t.slice(a,a+D).map((C,F,c)=>{const E=F===0&&i,d=F===c.length-1&&l;return E||d?A.dim("..."):r(C,F+a===e)})},"G"),ks=o(u=>{const e=u.active??"Yes",t=u.inactive??"No";return new pe({active:e,inactive:t,initialValue:u.initialValue??!0,render(){const r=`${A.gray(P)}
|
|
41
|
-
${dt(this.state)} ${u.message}
|
|
42
|
-
`,n=this.value?e:t;switch(this.state){case"submit":return`${r}${A.gray(P)} ${A.dim(n)}`;case"cancel":return`${r}${A.gray(P)} ${A.strikethrough(A.dim(n))}
|
|
43
|
-
${A.gray(P)}`;default:return`${r}${A.cyan(P)} ${this.value?`${A.green(Be)} ${e}`:`${A.dim(ye)} ${A.dim(e)}`} ${A.dim("/")} ${this.value?`${A.dim(ye)} ${A.dim(t)}`:`${A.green(Be)} ${t}`}
|
|
44
|
-
${A.cyan(ge)}
|
|
45
|
-
`}}}).prompt()},"ye"),Ms=o(u=>{const e=o((t,r)=>{const n=t.label??String(t.value);switch(r){case"selected":return`${A.dim(n)}`;case"active":return`${A.green(Be)} ${n} ${t.hint?A.dim(`(${t.hint})`):""}`;case"cancelled":return`${A.strikethrough(A.dim(n))}`;default:return`${A.dim(ye)} ${A.dim(n)}`}},"n");return new he({options:u.options,initialValue:u.initialValue,render(){const t=`${A.gray(P)}
|
|
46
|
-
${dt(this.state)} ${u.message}
|
|
47
|
-
`;switch(this.state){case"submit":return`${t}${A.gray(P)} ${e(this.options[this.cursor],"selected")}`;case"cancel":return`${t}${A.gray(P)} ${e(this.options[this.cursor],"cancelled")}
|
|
48
|
-
${A.gray(P)}`;default:return`${t}${A.cyan(P)} ${_s({cursor:this.cursor,options:this.options,maxItems:u.maxItems,style:o((r,n)=>e(r,n?"active":"inactive"),"style")}).join(`
|
|
49
|
-
${A.cyan(P)} `)}
|
|
50
|
-
${A.cyan(ge)}
|
|
51
|
-
`}}}).prompt()},"ve"),Et=o((u="")=>{process.stdout.write(`${A.gray(Rs)} ${u}
|
|
52
|
-
`)},"Ie"),K=o((u="")=>{process.stdout.write(`${A.gray(P)}
|
|
53
|
-
${A.gray(ge)} ${u}
|
|
54
|
-
|
|
55
|
-
`)},"Se");`${A.gray(P)}`;const be=o(({indicator:u="dots"}={})=>{const e=me?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],t=me?80:120,r=process.env.CI==="true";let n,s,D=!1,a="",i,l=performance.now();const C=o(B=>{const b=B>1?"Something went wrong":"Canceled";D&&g(b,B)},"p"),F=o(()=>C(2),"v"),c=o(()=>C(1),"f"),E=o(()=>{process.on("uncaughtExceptionMonitor",F),process.on("unhandledRejection",F),process.on("SIGINT",c),process.on("SIGTERM",c),process.on("exit",C)},"j"),d=o(()=>{process.removeListener("uncaughtExceptionMonitor",F),process.removeListener("unhandledRejection",F),process.removeListener("SIGINT",c),process.removeListener("SIGTERM",c),process.removeListener("exit",C)},"E"),m=o(()=>{if(i===void 0)return;r&&process.stdout.write(`
|
|
56
|
-
`);const B=i.split(`
|
|
57
|
-
`);process.stdout.write(O.cursor.move(-999,B.length-1)),process.stdout.write(O.erase.down(B.length))},"B"),f=o(B=>B.replace(/\.+$/,""),"R"),p=o(B=>{const b=(performance.now()-B)/1e3,y=Math.floor(b/60),v=Math.floor(b%60);return y>0?`[${y}m ${v}s]`:`[${v}s]`},"O"),h=o((B="")=>{D=!0,n=$s(),a=f(B),l=performance.now(),process.stdout.write(`${A.gray(P)}
|
|
58
|
-
`);let b=0,y=0;E(),s=setInterval(()=>{if(r&&a===i)return;m(),i=a;const v=A.magenta(e[b]);if(r)process.stdout.write(`${v} ${a}...`);else if(u==="timer")process.stdout.write(`${v} ${a} ${p(l)}`);else{const k=".".repeat(Math.floor(y)).slice(0,3);process.stdout.write(`${v} ${a}${k}`)}b=b+1<e.length?b+1:0,y=y<e.length?y+.125:0},t)},"H"),g=o((B="",b=0)=>{D=!1,clearInterval(s),m();const y=b===0?A.green(ft):b===1?A.red(Ft):A.red(Ct);a=f(B??a),u==="timer"?process.stdout.write(`${y} ${a} ${p(l)}
|
|
59
|
-
`):process.stdout.write(`${y} ${a}
|
|
60
|
-
`),d(),n()},"N");return{start:h,stop:g,message:o((B="")=>{a=f(B??a)},"message")}},"Y"),Le=class Le extends Error{};o(Le,"KnownError");let S=Le;const Ae=" ",$u=o(u=>{u instanceof Error&&!(u instanceof S)&&(u.stack&&console.error(ae(u.stack.split(`
|
|
61
|
-
`).slice(1).join(`
|
|
62
|
-
`))),console.error(`
|
|
63
|
-
${Ae}${ae(`aicommit v${zu.version}`)}`),console.error(`
|
|
64
|
-
${Ae}Please open a Bug report with the information above:`),console.error(`${Ae}https://github.com/NegoZiatoR/ai-commit/issues/new/choose`))},"handleCliError"),we=o(async()=>{const{stdout:u,failed:e}=await X("git",["rev-parse","--show-toplevel"],{reject:!1});if(e)throw new S("The current directory must be a Git repository!");return u},"assertGitRepo"),ve=o(u=>`:(exclude)${u}`,"excludeFromDiff"),pt=["package-lock.json","*.lock"].map(ve),ht=o(async u=>{const e=["diff","--cached","--diff-algorithm=minimal"],{stdout:t}=await X("git",[...e,"--name-only",...pt,...u?u.map(ve):[]]);if(!t)return;const{stdout:r}=await X("git",[...e,...pt,...u?u.map(ve):[]]);return{files:t.split(`
|
|
65
|
-
`),diff:r}},"getStagedDiff"),js=o(u=>`Detected ${u.length.toLocaleString()} staged file${u.length>1?"s":""}`,"getDetectedMessage");var $e,mt;function Ns(){if(mt)return $e;mt=1;const{hasOwnProperty:u}=Object.prototype,e=o((a,i={})=>{typeof i=="string"&&(i={section:i}),i.align=i.align===!0,i.newline=i.newline===!0,i.sort=i.sort===!0,i.whitespace=i.whitespace===!0||i.align===!0,i.platform=i.platform||typeof process<"u"&&process.platform,i.bracketedArray=i.bracketedArray!==!1;const l=i.platform==="win32"?`\r
|
|
66
|
-
`:`
|
|
67
|
-
`,C=i.whitespace?" = ":"=",F=[],c=i.sort?Object.keys(a).sort():Object.keys(a);let E=0;i.align&&(E=s(c.filter(f=>a[f]===null||Array.isArray(a[f])||typeof a[f]!="object").map(f=>Array.isArray(a[f])?`${f}[]`:f).concat([""]).reduce((f,p)=>s(f).length>=s(p).length?f:p)).length);let d="";const m=i.bracketedArray?"[]":"";for(const f of c){const p=a[f];if(p&&Array.isArray(p))for(const h of p)d+=s(`${f}${m}`).padEnd(E," ")+C+s(h)+l;else p&&typeof p=="object"?F.push(f):d+=s(f).padEnd(E," ")+C+s(p)+l}i.section&&d.length&&(d="["+s(i.section)+"]"+(i.newline?l+l:l)+d);for(const f of F){const p=t(f,".").join("\\."),h=(i.section?i.section+".":"")+p,g=e(a[f],{...i,section:h});d.length&&g.length&&(d+=l),d+=g}return d},"encode");function t(a,i){var l=0,C=0,F=0,c=[];do if(F=a.indexOf(i,l),F!==-1){if(l=F+i.length,F>0&&a[F-1]==="\\")continue;c.push(a.slice(C,F)),C=F+i.length}while(F!==-1);return c.push(a.slice(C)),c}o(t,"splitSections");const r=o((a,i={})=>{i.bracketedArray=i.bracketedArray!==!1;const l=Object.create(null);let C=l,F=null;const c=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,E=a.split(/[\r\n]+/g),d={};for(const f of E){if(!f||f.match(/^\s*[;#]/)||f.match(/^\s*$/))continue;const p=f.match(c);if(!p)continue;if(p[1]!==void 0){if(F=D(p[1]),F==="__proto__"){C=Object.create(null);continue}C=l[F]=l[F]||Object.create(null);continue}const h=D(p[2]);let g;i.bracketedArray?g=h.length>2&&h.slice(-2)==="[]":(d[h]=(d?.[h]||0)+1,g=d[h]>1);const B=g&&h.endsWith("[]")?h.slice(0,-2):h;if(B==="__proto__")continue;const b=p[3]?D(p[4]):!0,y=b==="true"||b==="false"||b==="null"?JSON.parse(b):b;g&&(u.call(C,B)?Array.isArray(C[B])||(C[B]=[C[B]]):C[B]=[]),Array.isArray(C[B])?C[B].push(y):C[B]=y}const m=[];for(const f of Object.keys(l)){if(!u.call(l,f)||typeof l[f]!="object"||Array.isArray(l[f]))continue;const p=t(f,".");C=l;const h=p.pop(),g=h.replace(/\\\./g,".");for(const B of p)B!=="__proto__"&&((!u.call(C,B)||typeof C[B]!="object")&&(C[B]=Object.create(null)),C=C[B]);C===l&&g===h||(C[g]=l[f],m.push(f))}for(const f of m)delete l[f];return l},"decode"),n=o(a=>a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"),"isQuoted"),s=o(a=>typeof a!="string"||a.match(/[=\r\n]/)||a.match(/^\[/)||a.length>1&&n(a)||a!==a.trim()?JSON.stringify(a):a.split(";").join("\\;").split("#").join("\\#"),"safe"),D=o(a=>{if(a=(a||"").trim(),n(a)){a.charAt(0)==="'"&&(a=a.slice(1,-1));try{a=JSON.parse(a)}catch{}}else{let i=!1,l="";for(let C=0,F=a.length;C<F;C++){const c=a.charAt(C);if(i)"\\;#".indexOf(c)!==-1?l+=c:l+="\\"+c,i=!1;else{if(";#".indexOf(c)!==-1)break;c==="\\"?i=!0:l+=c}}return i&&(l+="\\"),l.trim()}return a},"unsafe");return $e={parse:r,decode:r,stringify:e,encode:e,safe:s,unsafe:D},$e}o(Ns,"requireIni");var Ls=Ns(),gt=J(Ls);const xe=o(u=>I.lstat(u).then(()=>!0,()=>!1),"fileExists"),Bt=o(async u=>{try{let e;try{e=u||await we()}catch(D){if(D instanceof S&&D.message.includes("Git repository"))return;throw D}const t=W.join(e,".ai-commit.json");if(!await xe(t))return;const n=await I.readFile(t,"utf8");return JSON.parse(n)}catch(e){if(e instanceof S)throw e;return}},"getProjectConfig"),Gs=["","conventional"],{hasOwnProperty:qs}=Object.prototype,yt=o((u,e)=>qs.call(u,e),"hasOwn"),x=o((u,e,t)=>{if(!e)throw new S(`Invalid config property ${u}: ${t}`)},"parseAssert"),xu={OPENAI_KEY(u){if(!u)throw new S("Please set your OpenAI API key via `aicommit config set OPENAI_KEY=<your token>`");return x("OPENAI_KEY",u.startsWith("sk-"),'Must start with "sk-"'),u},locale(u){return u?(x("locale",u,"Cannot be empty"),x("locale",/^[a-z-]+$/i.test(u),"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"),u):"en"},generate(u){if(!u)return 1;x("generate",/^\d+$/.test(u),"Must be an integer");const e=Number(u);return x("generate",e>0,"Must be greater than 0"),x("generate",e<=5,"Must be less or equal to 5"),e},type(u){return u?(x("type",Gs.includes(u),"Invalid commit type"),u):""},proxy(u){if(!(!u||u.length===0))return x("proxy",/^https?:\/\//.test(u),"Must be a valid URL"),u},model(u){return!u||u.length===0?"gpt-4o-mini":u},timeout(u){if(!u)return 1e4;x("timeout",/^\d+$/.test(u),"Must be an integer");const e=Number(u);return x("timeout",e>=500,"Must be greater than 500ms"),e},temperature(u){if(!u)return .2;x("temperature",/^(2|\d)(\.\d{1,2})?$/.test(u),"Must be decimal between 0 and 2");const e=Number(u);return x("temperature",e>0,"Must be greater than 0"),x("temperature",e<=2,"Must be less than or equal to 2"),e},"max-length"(u){if(!u)return 50;x("max-length",/^\d+$/.test(u),"Must be an integer");const e=Number(u);return x("max-length",e>=20,"Must be greater than 20 characters"),e},"max-completion-tokens"(u){if(!u)return 1e4;x("max-completion-tokens",/^\d+$/.test(u),"Must be an integer");const e=Number(u);return x("max-completion-tokens",e>0,"Must be greater than 0"),e},"auto-confirm"(u){return u?typeof u=="boolean"?u:(x("auto-confirm",/^(?:true|false)$/.test(u),"Must be a boolean"),u==="true"):!1},"prepend-reference"(u){return u?typeof u=="boolean"?u:(x("prepend-reference",/^(?:true|false)$/.test(u),"Must be a boolean"),u==="true"):!1}},Se=W.join(Ze.homedir(),".aicommit"),bt=o(async()=>{if(!await xe(Se))return Object.create(null);const e=await I.readFile(Se,"utf8");return gt.parse(e)},"readConfigFile"),Oe=o(async(u,e)=>{const t=await bt(),r=await Bt(),n={};for(const s of Object.keys(xu)){const D=xu[s];let a=r?.[s]??u?.[s]??t[s];if(typeof a=="boolean"&&(a=a.toString()),e)try{n[s]=D(a)}catch{}else n[s]=D(a)}return n},"getConfig"),Ws=o(async u=>{const e=await bt();for(const[t,r]of u){if(!yt(xu,t))throw new S(`Invalid config property: ${t}`);const n=xu[t](r);e[t]=n}await I.writeFile(Se,gt.stringify(e),"utf8")},"setConfigs");var q={},Su={exports:{}},Ou={exports:{}},Te,At;function Us(){if(At)return Te;At=1;var u=1e3,e=u*60,t=e*60,r=t*24,n=r*7,s=r*365.25;Te=o(function(C,F){F=F||{};var c=typeof C;if(c==="string"&&C.length>0)return D(C);if(c==="number"&&isFinite(C))return F.long?i(C):a(C);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(C))},"ms");function D(C){if(C=String(C),!(C.length>100)){var F=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(C);if(F){var c=parseFloat(F[1]),E=(F[2]||"ms").toLowerCase();switch(E){case"years":case"year":case"yrs":case"yr":case"y":return c*s;case"weeks":case"week":case"w":return c*n;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*t;case"minutes":case"minute":case"mins":case"min":case"m":return c*e;case"seconds":case"second":case"secs":case"sec":case"s":return c*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}}}o(D,"parse");function a(C){var F=Math.abs(C);return F>=r?Math.round(C/r)+"d":F>=t?Math.round(C/t)+"h":F>=e?Math.round(C/e)+"m":F>=u?Math.round(C/u)+"s":C+"ms"}o(a,"fmtShort");function i(C){var F=Math.abs(C);return F>=r?l(C,F,r,"day"):F>=t?l(C,F,t,"hour"):F>=e?l(C,F,e,"minute"):F>=u?l(C,F,u,"second"):C+" ms"}o(i,"fmtLong");function l(C,F,c,E){var d=F>=c*1.5;return Math.round(C/c)+" "+E+(d?"s":"")}return o(l,"plural"),Te}o(Us,"requireMs");var Ie,wt;function vt(){if(wt)return Ie;wt=1;function u(e){r.debug=r,r.default=r,r.coerce=l,r.disable=a,r.enable=s,r.enabled=i,r.humanize=Us(),r.destroy=C,Object.keys(e).forEach(F=>{r[F]=e[F]}),r.names=[],r.skips=[],r.formatters={};function t(F){let c=0;for(let E=0;E<F.length;E++)c=(c<<5)-c+F.charCodeAt(E),c|=0;return r.colors[Math.abs(c)%r.colors.length]}o(t,"selectColor"),r.selectColor=t;function r(F){let c,E=null,d,m;function f(...p){if(!f.enabled)return;const h=f,g=Number(new Date),B=g-(c||g);h.diff=B,h.prev=c,h.curr=g,c=g,p[0]=r.coerce(p[0]),typeof p[0]!="string"&&p.unshift("%O");let b=0;p[0]=p[0].replace(/%([a-zA-Z%])/g,(v,k)=>{if(v==="%%")return"%";b++;const j=r.formatters[k];if(typeof j=="function"){const _=p[b];v=j.call(h,_),p.splice(b,1),b--}return v}),r.formatArgs.call(h,p),(h.log||r.log).apply(h,p)}return o(f,"debug"),f.namespace=F,f.useColors=r.useColors(),f.color=r.selectColor(F),f.extend=n,f.destroy=r.destroy,Object.defineProperty(f,"enabled",{enumerable:!0,configurable:!1,get:o(()=>E!==null?E:(d!==r.namespaces&&(d=r.namespaces,m=r.enabled(F)),m),"get"),set:o(p=>{E=p},"set")}),typeof r.init=="function"&&r.init(f),f}o(r,"createDebug");function n(F,c){const E=r(this.namespace+(typeof c>"u"?":":c)+F);return E.log=this.log,E}o(n,"extend");function s(F){r.save(F),r.namespaces=F,r.names=[],r.skips=[];const c=(typeof F=="string"?F:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const E of c)E[0]==="-"?r.skips.push(E.slice(1)):r.names.push(E)}o(s,"enable");function D(F,c){let E=0,d=0,m=-1,f=0;for(;E<F.length;)if(d<c.length&&(c[d]===F[E]||c[d]==="*"))c[d]==="*"?(m=d,f=E,d++):(E++,d++);else if(m!==-1)d=m+1,f++,E=f;else return!1;for(;d<c.length&&c[d]==="*";)d++;return d===c.length}o(D,"matchesTemplate");function a(){const F=[...r.names,...r.skips.map(c=>"-"+c)].join(",");return r.enable(""),F}o(a,"disable");function i(F){for(const c of r.skips)if(D(F,c))return!1;for(const c of r.names)if(D(F,c))return!0;return!1}o(i,"enabled");function l(F){return F instanceof Error?F.stack||F.message:F}o(l,"coerce");function C(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o(C,"destroy"),r.enable(r.load()),r}return o(u,"setup"),Ie=u,Ie}o(vt,"requireCommon");var $t;function zs(){return $t||($t=1,(function(u,e){e.formatArgs=r,e.save=n,e.load=s,e.useColors=t,e.storage=D(),e.destroy=(()=>{let i=!1;return()=>{i||(i=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let i;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(i=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(i[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}o(t,"useColors");function r(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+u.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;i.splice(1,0,l,"color: inherit");let C=0,F=0;i[0].replace(/%[a-zA-Z%]/g,c=>{c!=="%%"&&(C++,c==="%c"&&(F=C))}),i.splice(F,0,l)}o(r,"formatArgs"),e.log=console.debug||console.log||(()=>{});function n(i){try{i?e.storage.setItem("debug",i):e.storage.removeItem("debug")}catch{}}o(n,"save");function s(){let i;try{i=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}o(s,"load");function D(){try{return localStorage}catch{}}o(D,"localstorage"),u.exports=vt()(e);const{formatters:a}=u.exports;a.j=function(i){try{return JSON.stringify(i)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(Ou,Ou.exports)),Ou.exports}o(zs,"requireBrowser");var Tu={exports:{}},Pe,xt;function Hs(){return xt||(xt=1,Pe=o((u,e=process.argv)=>{const t=u.startsWith("-")?"":u.length===1?"-":"--",r=e.indexOf(t+u),n=e.indexOf("--");return r!==-1&&(n===-1||r<n)},"hasFlag")),Pe}o(Hs,"requireHasFlag");var Re,St;function Ys(){if(St)return Re;St=1;const u=Ze,e=Ru,t=Hs(),{env:r}=process;let n;t("no-color")||t("no-colors")||t("color=false")||t("color=never")?n=0:(t("color")||t("colors")||t("color=true")||t("color=always"))&&(n=1),"FORCE_COLOR"in r&&(r.FORCE_COLOR==="true"?n=1:r.FORCE_COLOR==="false"?n=0:n=r.FORCE_COLOR.length===0?1:Math.min(parseInt(r.FORCE_COLOR,10),3));function s(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}o(s,"translateLevel");function D(i,l){if(n===0)return 0;if(t("color=16m")||t("color=full")||t("color=truecolor"))return 3;if(t("color=256"))return 2;if(i&&!l&&n===void 0)return 0;const C=n||0;if(r.TERM==="dumb")return C;if(process.platform==="win32"){const F=u.release().split(".");return Number(F[0])>=10&&Number(F[2])>=10586?Number(F[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(F=>F in r)||r.CI_NAME==="codeship"?1:C;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if(r.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in r){const F=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return F>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:C}o(D,"supportsColor");function a(i){const l=D(i,i&&i.isTTY);return s(l)}return o(a,"getSupportLevel"),Re={supportsColor:a,stdout:s(D(!0,e.isatty(1))),stderr:s(D(!0,e.isatty(2)))},Re}o(Ys,"requireSupportsColor");var Ot;function Ks(){return Ot||(Ot=1,(function(u,e){const t=Ru,r=Ve;e.init=C,e.log=a,e.formatArgs=s,e.save=i,e.load=l,e.useColors=n,e.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{const c=Ys();c&&(c.stderr||c).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}e.inspectOpts=Object.keys(process.env).filter(c=>/^debug_/i.test(c)).reduce((c,E)=>{const d=E.substring(6).toLowerCase().replace(/_([a-z])/g,(f,p)=>p.toUpperCase());let m=process.env[E];return/^(yes|on|true|enabled)$/i.test(m)?m=!0:/^(no|off|false|disabled)$/i.test(m)?m=!1:m==="null"?m=null:m=Number(m),c[d]=m,c},{});function n(){return"colors"in e.inspectOpts?!!e.inspectOpts.colors:t.isatty(process.stderr.fd)}o(n,"useColors");function s(c){const{namespace:E,useColors:d}=this;if(d){const m=this.color,f="\x1B[3"+(m<8?m:"8;5;"+m),p=` ${f};1m${E} \x1B[0m`;c[0]=p+c[0].split(`
|
|
68
|
-
`).join(`
|
|
69
|
-
`+p),c.push(f+"m+"+u.exports.humanize(this.diff)+"\x1B[0m")}else c[0]=D()+E+" "+c[0]}o(s,"formatArgs");function D(){return e.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(D,"getDate");function a(...c){return process.stderr.write(r.formatWithOptions(e.inspectOpts,...c)+`
|
|
70
|
-
`)}o(a,"log");function i(c){c?process.env.DEBUG=c:delete process.env.DEBUG}o(i,"save");function l(){return process.env.DEBUG}o(l,"load");function C(c){c.inspectOpts={};const E=Object.keys(e.inspectOpts);for(let d=0;d<E.length;d++)c.inspectOpts[E[d]]=e.inspectOpts[E[d]]}o(C,"init"),u.exports=vt()(e);const{formatters:F}=u.exports;F.o=function(c){return this.inspectOpts.colors=this.useColors,r.inspect(c,this.inspectOpts).split(`
|
|
71
|
-
`).map(E=>E.trim()).join(" ")},F.O=function(c){return this.inspectOpts.colors=this.useColors,r.inspect(c,this.inspectOpts)}})(Tu,Tu.exports)),Tu.exports}o(Ks,"requireNode");var Tt;function _e(){return Tt||(Tt=1,typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Su.exports=zs():Su.exports=Ks()),Su.exports}o(_e,"requireSrc$1");var Iu={},It;function Vs(){if(It)return Iu;It=1,Object.defineProperty(Iu,"__esModule",{value:!0});function u(e){return function(t,r){return new Promise((n,s)=>{e.call(this,t,r,(D,a)=>{D?s(D):n(a)})})}}return o(u,"promisify$1"),Iu.default=u,Iu}o(Vs,"requirePromisify");var au,Pt;function Js(){if(Pt)return au;Pt=1;var u=au&&au.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};const e=Ke,t=u(_e()),r=u(Vs()),n=t.default("agent-base");function s(i){return!!i&&typeof i.addRequest=="function"}o(s,"isAgent");function D(){const{stack:i}=new Error;return typeof i!="string"?!1:i.split(`
|
|
72
|
-
`).some(l=>l.indexOf("(https.js:")!==-1||l.indexOf("node:https:")!==-1)}o(D,"isSecureEndpoint");function a(i,l){return new a.Agent(i,l)}return o(a,"createAgent"),(function(i){const C=class C extends e.EventEmitter{constructor(c,E){super();let d=E;typeof c=="function"?this.callback=c:c&&(d=c),this.timeout=null,d&&typeof d.timeout=="number"&&(this.timeout=d.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:D()?443:80}set defaultPort(c){this.explicitDefaultPort=c}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:D()?"https:":"http:"}set protocol(c){this.explicitProtocol=c}callback(c,E,d){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(c,E){const d=Object.assign({},E);typeof d.secureEndpoint!="boolean"&&(d.secureEndpoint=D()),d.host==null&&(d.host="localhost"),d.port==null&&(d.port=d.secureEndpoint?443:80),d.protocol==null&&(d.protocol=d.secureEndpoint?"https:":"http:"),d.host&&d.path&&delete d.path,delete d.agent,delete d.hostname,delete d._defaultAgent,delete d.defaultPort,delete d.createConnection,c._last=!0,c.shouldKeepAlive=!1;let m=!1,f=null;const p=d.timeout||this.timeout,h=o(y=>{c._hadError||(c.emit("error",y),c._hadError=!0)},"onerror"),g=o(()=>{f=null,m=!0;const y=new Error(`A "socket" was not created for HTTP request before ${p}ms`);y.code="ETIMEOUT",h(y)},"ontimeout"),B=o(y=>{m||(f!==null&&(clearTimeout(f),f=null),h(y))},"callbackError"),b=o(y=>{if(m)return;if(f!=null&&(clearTimeout(f),f=null),s(y)){n("Callback returned another Agent instance %o",y.constructor.name),y.addRequest(c,d);return}if(y){y.once("free",()=>{this.freeSocket(y,d)}),c.onSocket(y);return}const v=new Error(`no Duplex stream was returned to agent-base for \`${c.method} ${c.path}\``);h(v)},"onsocket");if(typeof this.callback!="function"){h(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(n("Converting legacy callback function to promise"),this.promisifiedCallback=r.default(this.callback)):this.promisifiedCallback=this.callback),typeof p=="number"&&p>0&&(f=setTimeout(g,p)),"port"in d&&typeof d.port!="number"&&(d.port=Number(d.port));try{n("Resolving socket for %o request: %o",d.protocol,`${c.method} ${c.path}`),Promise.resolve(this.promisifiedCallback(c,d)).then(b,B)}catch(y){Promise.reject(y).catch(B)}}freeSocket(c,E){n("Freeing socket %o %o",c.constructor.name,E),c.destroy()}destroy(){n("Destroying agent %o",this.constructor.name)}};o(C,"Agent");let l=C;i.Agent=l,i.prototype=i.Agent.prototype})(a||(a={})),au=a,au}o(Js,"requireSrc");var uu={},Rt;function Zs(){if(Rt)return uu;Rt=1;var u=uu&&uu.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(uu,"__esModule",{value:!0});const t=u(_e()).default("https-proxy-agent:parse-proxy-response");function r(n){return new Promise((s,D)=>{let a=0;const i=[];function l(){const m=n.read();m?d(m):n.once("readable",l)}o(l,"read");function C(){n.removeListener("end",c),n.removeListener("error",E),n.removeListener("close",F),n.removeListener("readable",l)}o(C,"cleanup");function F(m){t("onclose had error %o",m)}o(F,"onclose");function c(){t("onend")}o(c,"onend");function E(m){C(),t("onerror %o",m),D(m)}o(E,"onerror");function d(m){i.push(m),a+=m.length;const f=Buffer.concat(i,a);if(f.indexOf(`\r
|
|
73
|
-
\r
|
|
74
|
-
`)===-1){t("have not received end of HTTP headers yet..."),l();return}const h=f.toString("ascii",0,f.indexOf(`\r
|
|
75
|
-
`)),g=+h.split(" ")[1];t("got proxy server response: %o",h),s({statusCode:g,buffered:f})}o(d,"ondata"),n.on("error",E),n.on("close",F),n.on("end",c),l()})}return o(r,"parseProxyResponse$1"),uu.default=r,uu}o(Zs,"requireParseProxyResponse");var _t;function Xs(){if(_t)return q;_t=1;var u=q&&q.__awaiter||function(f,p,h,g){function B(b){return b instanceof h?b:new h(function(y){y(b)})}return o(B,"adopt"),new(h||(h=Promise))(function(b,y){function v(_){try{j(g.next(_))}catch(Du){y(Du)}}o(v,"fulfilled");function k(_){try{j(g.throw(_))}catch(Du){y(Du)}}o(k,"rejected");function j(_){_.done?b(_.value):B(_.value).then(v,k)}o(j,"step"),j((g=g.apply(f,p||[])).next())})},e=q&&q.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(q,"__esModule",{value:!0});const t=e(tr),r=e(rr),n=e(nr),s=e(Ye),D=e(_e()),a=Js(),i=e(Zs()),l=D.default("https-proxy-agent:agent"),m=class m extends a.Agent{constructor(p){let h;if(typeof p=="string"?h=n.default.parse(p):h=p,!h)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");l("creating new HttpsProxyAgent instance: %o",h),super(h);const g=Object.assign({},h);this.secureProxy=h.secureProxy||E(g.protocol),g.host=g.hostname||g.host,typeof g.port=="string"&&(g.port=parseInt(g.port,10)),!g.port&&g.host&&(g.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in g)&&(g.ALPNProtocols=["http 1.1"]),g.host&&g.path&&(delete g.path,delete g.pathname),this.proxy=g}callback(p,h){return u(this,void 0,void 0,function*(){const{proxy:g,secureProxy:B}=this;let b;B?(l("Creating `tls.Socket`: %o",g),b=r.default.connect(g)):(l("Creating `net.Socket`: %o",g),b=t.default.connect(g));const y=Object.assign({},g.headers);let k=`CONNECT ${`${h.host}:${h.port}`} HTTP/1.1\r
|
|
76
|
-
`;g.auth&&(y["Proxy-Authorization"]=`Basic ${Buffer.from(g.auth).toString("base64")}`);let{host:j,port:_,secureEndpoint:Du}=h;c(_,Du)||(j+=`:${_}`),y.Host=j,y.Connection="close";for(const L of Object.keys(y))k+=`${L}: ${y[L]}\r
|
|
77
|
-
`;const Wt=i.default(b);b.write(`${k}\r
|
|
78
|
-
`);const{statusCode:Ut,buffered:zt}=yield Wt;if(Ut===200){if(p.once("socket",F),h.secureEndpoint){l("Upgrading socket connection to TLS");const L=h.servername||h.host;return r.default.connect(Object.assign(Object.assign({},d(h,"host","hostname","path","port")),{socket:b,servername:L}))}return b}b.destroy();const Ge=new t.default.Socket({writable:!1});return Ge.readable=!0,p.once("socket",L=>{l("replaying proxy buffer for failed request"),s.default(L.listenerCount("data")>0),L.push(zt),L.push(null)}),Ge})}};o(m,"HttpsProxyAgent");let C=m;q.default=C;function F(f){f.resume()}o(F,"resume");function c(f,p){return!!(!p&&f===80||p&&f===443)}o(c,"isDefaultPort");function E(f){return typeof f=="string"?/^https:?$/i.test(f):!1}o(E,"isHTTPS");function d(f,...p){const h={};let g;for(g in f)p.includes(g)||(h[g]=f[g]);return h}return o(d,"omit"),q}o(Xs,"requireAgent");var cu,kt;function Qs(){if(kt)return cu;kt=1;var u=cu&&cu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};const e=u(Xs());function t(r){return new e.default(r)}return o(t,"createHttpsProxyAgent"),(function(r){r.HttpsProxyAgent=e.default,r.prototype=e.default.prototype})(t||(t={})),cu=t,cu}o(Qs,"requireDist"),Qs();const ui={"":"<commit message>",conventional:"<type>(<optional scope>): <commit message>"},ei=o(u=>`The output response must be in format:
|
|
79
|
-
${ui[u]}`,"specifyCommitFormat"),Di={"":"",conventional:`Choose a type from the type-to-description JSON below that best describes the git diff:
|
|
80
|
-
${JSON.stringify({docs:"Documentation only changes",style:"Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",refactor:"A code change that neither fixes a bug nor adds a feature",perf:"A code change that improves performance",test:"Adding missing tests or correcting existing tests",build:"Changes that affect the build system or external dependencies",ci:"Changes to our CI configuration files and scripts",chore:"Other changes that don't modify src or test files",revert:"Reverts a previous commit",feat:"A new feature",fix:"A bug fix",data:"Data only changes"},null,2)}`},ti=o((u,e,t,r)=>["Generate a concise git commit message written in present tense for the following code diff with the given specifications below:",`Message language: ${u}`,`Commit message must be a maximum of ${e} characters.`,"Exclude anything unnecessary such as translation. Your entire response will be passed directly into git commit.","Try to focus on why the code changes was made and not only summarize the changes.",r?.projectPrompt?`Project context: ${r.projectPrompt}`:null,Di[t],ei(t)].filter(Boolean).join(`
|
|
81
|
-
`),"generatePrompt"),ri=o(async(u,e,t,r,n,s)=>new Promise((D,a)=>{const i=JSON.stringify(r),l=Dr.request({hostname:u,path:e,method:"POST",headers:{...t,"Content-Type":"application/json","Content-Length":Buffer.byteLength(i)},timeout:n,agent:void 0},C=>{const F=[];C.on("data",c=>F.push(c)),C.on("end",()=>{D({request:l,response:C,data:Buffer.concat(F).toString()})})});l.on("error",a),l.on("timeout",()=>{l.destroy(),a(new S(`Time out error: request took over ${n}ms. Try increasing the \`timeout\` config, or checking the OpenAI API status https://status.openai.com`))}),l.write(i),l.end()}),"httpsPost"),ni=o(async(u,e,t,r)=>{const{response:n,data:s}=await ri("api.openai.com","/v1/chat/completions",{Authorization:`Bearer ${u}`},e,t);if(!n.statusCode||n.statusCode<200||n.statusCode>299){let D=`OpenAI API Error: ${n.statusCode} - ${n.statusMessage}`;throw s&&(D+=`
|
|
82
|
-
|
|
83
|
-
${s}`),n.statusCode===500&&(D+=`
|
|
84
|
-
|
|
85
|
-
Check the API status: https://status.openai.com`),new S(D)}return JSON.parse(s)},"createChatCompletion"),oi=o(u=>u.trim().replace(/[\n\r]/g,"").replace(/(\w)\.$/,"$1"),"sanitizeMessage"),si=o(u=>Array.from(new Set(u)),"deduplicateMessages"),Mt=o(async(u,e,t,r,n,s,D,a,i,l)=>{try{const C=await Bt(),F=await ni(u,{model:e,messages:[{role:"system",content:ti(t,s,D,C)},{role:"user",content:r}],temperature:i,top_p:1,frequency_penalty:0,presence_penalty:0,max_completion_tokens:l,stream:!1,n},a);return si(F.choices.filter(c=>c.message?.content).map(c=>oi(c.message.content)))}catch(C){const F=C;throw F.code==="ENOTFOUND"?new S(`Error connecting to ${F.hostname} (${F.syscall}). Are you connected to the internet?`):F}},"generateCommitMessage");var ii=o(async(u,e,t,r,n)=>(async()=>{Et(JD(VD(" aicommit "))),await we();const s=be();t&&await X("git",["add","--update"]),s.start("Detecting staged files");const D=await ht(e);if(!D)throw s.stop("Detecting staged files"),new S("No staged changes found. Stage your changes manually, or automatically stage all changes with the `--all` flag.");s.stop(`${js(D.files)}:
|
|
86
|
-
${D.files.map(c=>` ${c}`).join(`
|
|
87
|
-
`)}`);const{env:a}=process,i=await Oe({OPENAI_KEY:a.OPENAI_KEY||a.OPENAI_API_KEY,proxy:a.https_proxy||a.HTTPS_PROXY||a.http_proxy||a.HTTP_PROXY,generate:u?.toString(),type:r?.toString()}),l=be();l.start("The AI is analyzing your changes");let C;try{C=await Mt(i.OPENAI_KEY,i.model,i.locale,D.diff,i.generate,i["max-length"],i.type,i.timeout,i.temperature,i["max-completion-tokens"])}finally{l.stop("Changes analyzed")}if(C.length===0)throw new S("No commit messages were generated. Try again.");let F;if(C.length===1){[F]=C;let c;if(i["auto-confirm"]?(c=!0,K(`${su("\u2714")} Auto confirmed commit message.
|
|
88
|
-
|
|
89
|
-
${F}
|
|
90
|
-
`)):c=await ks({message:`Use this commit message?
|
|
91
|
-
|
|
92
|
-
${F}
|
|
93
|
-
`}),!c||ct(c)){K("Commit cancelled");return}}else{const c=await Ms({message:`Pick a commit message to use: ${ae("(Ctrl+c to exit)")}`,options:C.map(E=>({label:E,value:E}))});if(ct(c)){K("Commit cancelled");return}F=c}if(i["prepend-reference"]){const{stdout:c}=await X("git",["branch","--show-current"]),E=c.match(/([a-zA-Z])+-([0-9]+)/)?.[0];E?.length&&(F=`${E?.toUpperCase()}: ${F}`)}await X("git",["commit","-m",F,...n]),K(`${su("\u2714")} Successfully committed!`)})().catch(s=>{K(`${Bu("\u2716")} ${s.message}`),$u(s),process.exit(1)}),"aicommit");const[ke,ai]=process.argv.slice(2);var ci=o(()=>(async()=>{if(!ke)throw new S('Commit message file path is missing. This file should be called from the "prepare-commit-msg" git hook');if(ai)return;const u=await ht();if(!u)return;Et(JD(VD(" aicommit ")));const{env:e}=process,t=await Oe({proxy:e.https_proxy||e.HTTPS_PROXY||e.http_proxy||e.HTTP_PROXY}),r=be();r.start("The AI is analyzing your changes");let n;try{n=await Mt(t.OPENAI_KEY,t.model,t.locale,u.diff,t.generate,t["max-length"],t.type,t.timeout,t.temperature,t["max-completion-tokens"])}finally{r.stop("Changes analyzed")}const D=await I.readFile(ke,"utf8")!=="",a=n.length>1;let i="";D&&(i=`# \u{1F916} AI generated commit${a?"s":""}
|
|
94
|
-
`),a?(D&&(i+=`# Select one of the following messages by uncommeting:
|
|
95
|
-
`),i+=`
|
|
96
|
-
${n.map(l=>`# ${l}`).join(`
|
|
97
|
-
`)}`):(D&&(i+=`# Edit the message below and commit:
|
|
98
|
-
`),i+=`
|
|
99
|
-
${n[0]}
|
|
100
|
-
`),await I.appendFile(ke,i),K(`${su("\u2714")} Saved commit message!`)})().catch(u=>{K(`${Bu("\u2716")} ${u.message}`),$u(u),process.exit(1)}),"prepareCommitMessageHook"),li=hD({name:"config",parameters:["<mode>","<key=value...>"]},u=>{(async()=>{const{mode:e,keyValue:t}=u._;if(e==="get"){const r=await Oe({},!0);for(const n of t)yt(r,n)&&console.log(`${n}=${r[n]}`);return}if(e==="set"){await Ws(t.map(r=>r.split("=")));return}throw new S(`Invalid mode: ${e}`)})().catch(e=>{console.error(`${Bu("\u2716")} ${e.message}`),$u(e),process.exit(1)})});const jt="prepare-commit-msg",Nt=`.git/hooks/${jt}`,Pu=or(new URL("cli.mjs",import.meta.url)),Fi=process.argv[1].replace(/\\/g,"/").endsWith(`/${Nt}`),Lt=process.platform==="win32",Gt=`
|
|
101
|
-
#!/usr/bin/env node
|
|
102
|
-
import(${JSON.stringify(sr(Pu))})
|
|
103
|
-
`.trim();var Ci=hD({name:"hook",parameters:["<install/uninstall>"]},u=>{(async()=>{const e=await we(),{installUninstall:t}=u._,r=W.join(e,Nt),n=await xe(r);if(t==="install"){if(n){if(await I.realpath(r).catch(()=>{})===Pu){console.warn("The hook is already installed");return}throw new S(`A different ${jt} hook seems to be installed. Please remove it before installing aicommit.`)}await I.mkdir(W.dirname(r),{recursive:!0}),Lt?await I.writeFile(r,Gt):(await I.symlink(Pu,r,"file"),await I.chmod(r,493)),console.log(`${su("\u2714")} Hook installed`);return}if(t==="uninstall"){if(!n){console.warn("Hook is not installed");return}if(Lt){if(await I.readFile(r,"utf8")!==Gt){console.warn("Hook is not installed");return}}else if(await I.realpath(r)!==Pu){console.warn("Hook is not installed");return}await I.rm(r),console.log(`${su("\u2714")} Hook uninstalled`);return}throw new S(`Invalid mode: ${t}`)})().catch(e=>{console.error(`${Bu("\u2716")} ${e.message}`),$u(e),process.exit(1)})});const qt=process.argv.slice(2);$n({name:"aicommit",version:zu.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:[li,Ci],help:{description:zu.description},ignoreArgv:o(u=>u==="unknown-flag"||u==="argument","ignoreArgv")},u=>{Fi?ci():ii(u.flags.generate,u.flags.exclude,u.flags.all,u.flags.type,qt)},qt);
|
|
2
|
+
import"./cli-D2zun-19.mjs";import"tty";import"node:buffer";import"node:path";import"node:child_process";import"node:process";import"child_process";import"path";import"fs";import"node:url";import"node:os";import"assert";import"events";import"node:fs";import"buffer";import"stream";import"util";import"node:util";import"node:readline";import"node:stream";import"fs/promises";import"os";import"url";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var M=Object.defineProperty;var d=(l,t)=>M(l,"name",{value:t,configurable:!0});import T from"http";import N from"https";import{L as O,g as P}from"./prompt-BMR92Sng.mjs";import{K as m}from"./cli-D2zun-19.mjs";import"tty";import"node:buffer";import"node:path";import"node:child_process";import"node:process";import"child_process";import"path";import"fs";import"node:url";import"node:os";import"assert";import"events";import"node:fs";import"buffer";import"stream";import"util";import"node:util";import"node:readline";import"node:stream";import"fs/promises";import"os";import"url";const g=class g extends O{get name(){return"custom"}validateConfig(){const{endpoint:t}=this.config;if(!t)throw new m("Please set your custom endpoint via `aicommit config set CUSTOM_ENDPOINT=<your endpoint>`")}async generateCommitMessage(t){try{const o=[{role:"system",content:P(this.config.locale,this.config.maxLength,this.config.type,t.projectConfig)},{role:"user",content:t.diff}],s=[];for(let i=0;i<t.completions;i++){const e=await this.createChatCompletion(o);let n;e.choices&&e.choices[0]?.message?.content?n=e.choices[0].message.content:e.message?.content?n=e.message.content:e.content?n=e.content:typeof e=="string"&&(n=e),n&&s.push(this.sanitizeMessage(n))}return{messages:this.deduplicateMessages(s)}}catch(r){const o=r;throw o.code==="ECONNREFUSED"?new m(`Cannot connect to custom endpoint at ${this.config.endpoint}. Make sure your endpoint is running and accessible.`):o.code==="ENOTFOUND"?new m(`Error connecting to ${o.hostname} (${o.syscall}). Check your CUSTOM_ENDPOINT configuration.`):o}}async createChatCompletion(t){const r={model:this.config.model,messages:t,temperature:this.config.temperature,max_tokens:this.config.maxCompletionTokens},o={...this.config.headers||{}};this.config.apiKey&&(o.Authorization=`Bearer ${this.config.apiKey}`);const{response:s,data:a}=await this.httpPost(this.config.endpoint,"",o,r);if(!s.statusCode||s.statusCode<200||s.statusCode>299){let i=`Custom API Error: ${s.statusCode} - ${s.statusMessage}`;throw a&&(i+=`
|
|
2
|
+
|
|
3
|
+
${a}`),new m(i)}return JSON.parse(a)}async httpPost(t,r,o,s){return new Promise((a,i)=>{const e=new URL(t),n=e.protocol==="https:",y=n?N:T,C=e.pathname+(r||""),f=JSON.stringify(s),c=y.request({hostname:e.hostname,port:e.port||(n?443:80),path:C,method:"POST",headers:{...o,"Content-Type":"application/json","Content-Length":Buffer.byteLength(f)},timeout:this.config.timeout},p=>{const u=[];p.on("data",w=>u.push(w)),p.on("end",()=>{a({request:c,response:p,data:Buffer.concat(u).toString()})})});c.on("error",i),c.on("timeout",()=>{c.destroy(),i(new m(`Time out error: request took over ${this.config.timeout}ms. Try increasing the \`timeout\` config.`))}),c.write(f),c.end()})}sanitizeMessage(t){return t.trim().replace(/[\n\r]/g,"").replace(/(\w)\.$/,"$1")}deduplicateMessages(t){return Array.from(new Set(t))}};d(g,"CustomProvider");let h=g;export{h as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var ue=Object.defineProperty;var r=(g,o)=>ue(g,"name",{value:o,configurable:!0});import{g as ce}from"./cli-D2zun-19.mjs";import ae from"net";import le from"tls";import fe from"url";import de from"assert";import G from"tty";import pe from"util";import he from"os";import Ce from"events";var P={},M={exports:{}},D={exports:{}},j,z;function me(){if(z)return j;z=1;var g=1e3,o=g*60,l=o*60,t=l*24,f=t*7,w=t*365.25;j=r(function(c,n){n=n||{};var e=typeof c;if(e==="string"&&c.length>0)return b(c);if(e==="number"&&isFinite(c))return n.long?i(c):v(c);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))},"ms");function b(c){if(c=String(c),!(c.length>100)){var n=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(n){var e=parseFloat(n[1]),a=(n[2]||"ms").toLowerCase();switch(a){case"years":case"year":case"yrs":case"yr":case"y":return e*w;case"weeks":case"week":case"w":return e*f;case"days":case"day":case"d":return e*t;case"hours":case"hour":case"hrs":case"hr":case"h":return e*l;case"minutes":case"minute":case"mins":case"min":case"m":return e*o;case"seconds":case"second":case"secs":case"sec":case"s":return e*g;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return e;default:return}}}}r(b,"parse");function v(c){var n=Math.abs(c);return n>=t?Math.round(c/t)+"d":n>=l?Math.round(c/l)+"h":n>=o?Math.round(c/o)+"m":n>=g?Math.round(c/g)+"s":c+"ms"}r(v,"fmtShort");function i(c){var n=Math.abs(c);return n>=t?p(c,n,t,"day"):n>=l?p(c,n,l,"hour"):n>=o?p(c,n,o,"minute"):n>=g?p(c,n,g,"second"):c+" ms"}r(i,"fmtLong");function p(c,n,e,a){var s=n>=e*1.5;return Math.round(c/e)+" "+a+(s?"s":"")}return r(p,"plural"),j}r(me,"requireMs");var B,V;function Y(){if(V)return B;V=1;function g(o){t.debug=t,t.default=t,t.coerce=p,t.disable=v,t.enable=w,t.enabled=i,t.humanize=me(),t.destroy=c,Object.keys(o).forEach(n=>{t[n]=o[n]}),t.names=[],t.skips=[],t.formatters={};function l(n){let e=0;for(let a=0;a<n.length;a++)e=(e<<5)-e+n.charCodeAt(a),e|=0;return t.colors[Math.abs(e)%t.colors.length]}r(l,"selectColor"),t.selectColor=l;function t(n){let e,a=null,s,h;function u(...m){if(!u.enabled)return;const C=u,d=Number(new Date),x=d-(e||d);C.diff=x,C.prev=e,C.curr=d,e=d,m[0]=t.coerce(m[0]),typeof m[0]!="string"&&m.unshift("%O");let F=0;m[0]=m[0].replace(/%([a-zA-Z%])/g,(E,T)=>{if(E==="%%")return"%";F++;const O=t.formatters[T];if(typeof O=="function"){const _=m[F];E=O.call(C,_),m.splice(F,1),F--}return E}),t.formatArgs.call(C,m),(C.log||t.log).apply(C,m)}return r(u,"debug"),u.namespace=n,u.useColors=t.useColors(),u.color=t.selectColor(n),u.extend=f,u.destroy=t.destroy,Object.defineProperty(u,"enabled",{enumerable:!0,configurable:!1,get:r(()=>a!==null?a:(s!==t.namespaces&&(s=t.namespaces,h=t.enabled(n)),h),"get"),set:r(m=>{a=m},"set")}),typeof t.init=="function"&&t.init(u),u}r(t,"createDebug");function f(n,e){const a=t(this.namespace+(typeof e>"u"?":":e)+n);return a.log=this.log,a}r(f,"extend");function w(n){t.save(n),t.namespaces=n,t.names=[],t.skips=[];const e=(typeof n=="string"?n:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const a of e)a[0]==="-"?t.skips.push(a.slice(1)):t.names.push(a)}r(w,"enable");function b(n,e){let a=0,s=0,h=-1,u=0;for(;a<n.length;)if(s<e.length&&(e[s]===n[a]||e[s]==="*"))e[s]==="*"?(h=s,u=a,s++):(a++,s++);else if(h!==-1)s=h+1,u++,a=u;else return!1;for(;s<e.length&&e[s]==="*";)s++;return s===e.length}r(b,"matchesTemplate");function v(){const n=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),n}r(v,"disable");function i(n){for(const e of t.skips)if(b(n,e))return!1;for(const e of t.names)if(b(n,e))return!0;return!1}r(i,"enabled");function p(n){return n instanceof Error?n.stack||n.message:n}r(p,"coerce");function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r(c,"destroy"),t.enable(t.load()),t}return r(g,"setup"),B=g,B}r(Y,"requireCommon");var J;function ge(){return J||(J=1,(function(g,o){o.formatArgs=t,o.save=f,o.load=w,o.useColors=l,o.storage=b(),o.destroy=(()=>{let i=!1;return()=>{i||(i=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),o.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function l(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let i;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(i=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(i[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}r(l,"useColors");function t(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+g.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;i.splice(1,0,p,"color: inherit");let c=0,n=0;i[0].replace(/%[a-zA-Z%]/g,e=>{e!=="%%"&&(c++,e==="%c"&&(n=c))}),i.splice(n,0,p)}r(t,"formatArgs"),o.log=console.debug||console.log||(()=>{});function f(i){try{i?o.storage.setItem("debug",i):o.storage.removeItem("debug")}catch{}}r(f,"save");function w(){let i;try{i=o.storage.getItem("debug")||o.storage.getItem("DEBUG")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}r(w,"load");function b(){try{return localStorage}catch{}}r(b,"localstorage"),g.exports=Y()(o);const{formatters:v}=g.exports;v.j=function(i){try{return JSON.stringify(i)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(D,D.exports)),D.exports}r(ge,"requireBrowser");var L={exports:{}},N,W;function ye(){return W||(W=1,N=r((g,o=process.argv)=>{const l=g.startsWith("-")?"":g.length===1?"-":"--",t=o.indexOf(l+g),f=o.indexOf("--");return t!==-1&&(f===-1||t<f)},"hasFlag")),N}r(ye,"requireHasFlag");var $,K;function be(){if(K)return $;K=1;const g=he,o=G,l=ye(),{env:t}=process;let f;l("no-color")||l("no-colors")||l("color=false")||l("color=never")?f=0:(l("color")||l("colors")||l("color=true")||l("color=always"))&&(f=1),"FORCE_COLOR"in t&&(t.FORCE_COLOR==="true"?f=1:t.FORCE_COLOR==="false"?f=0:f=t.FORCE_COLOR.length===0?1:Math.min(parseInt(t.FORCE_COLOR,10),3));function w(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}r(w,"translateLevel");function b(i,p){if(f===0)return 0;if(l("color=16m")||l("color=full")||l("color=truecolor"))return 3;if(l("color=256"))return 2;if(i&&!p&&f===void 0)return 0;const c=f||0;if(t.TERM==="dumb")return c;if(process.platform==="win32"){const n=g.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in t)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in t)||t.CI_NAME==="codeship"?1:c;if("TEAMCITY_VERSION"in t)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(t.TEAMCITY_VERSION)?1:0;if(t.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in t){const n=parseInt((t.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(t.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(t.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(t.TERM)||"COLORTERM"in t?1:c}r(b,"supportsColor");function v(i){const p=b(i,i&&i.isTTY);return w(p)}return r(v,"getSupportLevel"),$={supportsColor:v,stdout:w(b(!0,o.isatty(1))),stderr:w(b(!0,o.isatty(2)))},$}r(be,"requireSupportsColor");var Z;function ve(){return Z||(Z=1,(function(g,o){const l=G,t=pe;o.init=c,o.log=v,o.formatArgs=w,o.save=i,o.load=p,o.useColors=f,o.destroy=t.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),o.colors=[6,2,3,4,5,1];try{const e=be();e&&(e.stderr||e).level>=2&&(o.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}o.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,a)=>{const s=a.substring(6).toLowerCase().replace(/_([a-z])/g,(u,m)=>m.toUpperCase());let h=process.env[a];return/^(yes|on|true|enabled)$/i.test(h)?h=!0:/^(no|off|false|disabled)$/i.test(h)?h=!1:h==="null"?h=null:h=Number(h),e[s]=h,e},{});function f(){return"colors"in o.inspectOpts?!!o.inspectOpts.colors:l.isatty(process.stderr.fd)}r(f,"useColors");function w(e){const{namespace:a,useColors:s}=this;if(s){const h=this.color,u="\x1B[3"+(h<8?h:"8;5;"+h),m=` ${u};1m${a} \x1B[0m`;e[0]=m+e[0].split(`
|
|
2
|
+
`).join(`
|
|
3
|
+
`+m),e.push(u+"m+"+g.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=b()+a+" "+e[0]}r(w,"formatArgs");function b(){return o.inspectOpts.hideDate?"":new Date().toISOString()+" "}r(b,"getDate");function v(...e){return process.stderr.write(t.formatWithOptions(o.inspectOpts,...e)+`
|
|
4
|
+
`)}r(v,"log");function i(e){e?process.env.DEBUG=e:delete process.env.DEBUG}r(i,"save");function p(){return process.env.DEBUG}r(p,"load");function c(e){e.inspectOpts={};const a=Object.keys(o.inspectOpts);for(let s=0;s<a.length;s++)e.inspectOpts[a[s]]=o.inspectOpts[a[s]]}r(c,"init"),g.exports=Y()(o);const{formatters:n}=g.exports;n.o=function(e){return this.inspectOpts.colors=this.useColors,t.inspect(e,this.inspectOpts).split(`
|
|
5
|
+
`).map(a=>a.trim()).join(" ")},n.O=function(e){return this.inspectOpts.colors=this.useColors,t.inspect(e,this.inspectOpts)}})(L,L.exports)),L.exports}r(ve,"requireNode");var Q;function H(){return Q||(Q=1,typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?M.exports=ge():M.exports=ve()),M.exports}r(H,"requireSrc$1");var q={},X;function Fe(){if(X)return q;X=1,Object.defineProperty(q,"__esModule",{value:!0});function g(o){return function(l,t){return new Promise((f,w)=>{o.call(this,l,t,(b,v)=>{b?w(b):f(v)})})}}return r(g,"promisify$1"),q.default=g,q}r(Fe,"requirePromisify");var S,ee;function we(){if(ee)return S;ee=1;var g=S&&S.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};const o=Ce,l=g(H()),t=g(Fe()),f=l.default("agent-base");function w(i){return!!i&&typeof i.addRequest=="function"}r(w,"isAgent");function b(){const{stack:i}=new Error;return typeof i!="string"?!1:i.split(`
|
|
6
|
+
`).some(p=>p.indexOf("(https.js:")!==-1||p.indexOf("node:https:")!==-1)}r(b,"isSecureEndpoint");function v(i,p){return new v.Agent(i,p)}return r(v,"createAgent"),(function(i){const c=class c extends o.EventEmitter{constructor(e,a){super();let s=a;typeof e=="function"?this.callback=e:e&&(s=e),this.timeout=null,s&&typeof s.timeout=="number"&&(this.timeout=s.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:b()?443:80}set defaultPort(e){this.explicitDefaultPort=e}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:b()?"https:":"http:"}set protocol(e){this.explicitProtocol=e}callback(e,a,s){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(e,a){const s=Object.assign({},a);typeof s.secureEndpoint!="boolean"&&(s.secureEndpoint=b()),s.host==null&&(s.host="localhost"),s.port==null&&(s.port=s.secureEndpoint?443:80),s.protocol==null&&(s.protocol=s.secureEndpoint?"https:":"http:"),s.host&&s.path&&delete s.path,delete s.agent,delete s.hostname,delete s._defaultAgent,delete s.defaultPort,delete s.createConnection,e._last=!0,e.shouldKeepAlive=!1;let h=!1,u=null;const m=s.timeout||this.timeout,C=r(y=>{e._hadError||(e.emit("error",y),e._hadError=!0)},"onerror"),d=r(()=>{u=null,h=!0;const y=new Error(`A "socket" was not created for HTTP request before ${m}ms`);y.code="ETIMEOUT",C(y)},"ontimeout"),x=r(y=>{h||(u!==null&&(clearTimeout(u),u=null),C(y))},"callbackError"),F=r(y=>{if(h)return;if(u!=null&&(clearTimeout(u),u=null),w(y)){f("Callback returned another Agent instance %o",y.constructor.name),y.addRequest(e,s);return}if(y){y.once("free",()=>{this.freeSocket(y,s)}),e.onSocket(y);return}const E=new Error(`no Duplex stream was returned to agent-base for \`${e.method} ${e.path}\``);C(E)},"onsocket");if(typeof this.callback!="function"){C(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(f("Converting legacy callback function to promise"),this.promisifiedCallback=t.default(this.callback)):this.promisifiedCallback=this.callback),typeof m=="number"&&m>0&&(u=setTimeout(d,m)),"port"in s&&typeof s.port!="number"&&(s.port=Number(s.port));try{f("Resolving socket for %o request: %o",s.protocol,`${e.method} ${e.path}`),Promise.resolve(this.promisifiedCallback(e,s)).then(F,x)}catch(y){Promise.reject(y).catch(x)}}freeSocket(e,a){f("Freeing socket %o %o",e.constructor.name,a),e.destroy()}destroy(){f("Destroying agent %o",this.constructor.name)}};r(c,"Agent");let p=c;i.Agent=p,i.prototype=i.Agent.prototype})(v||(v={})),S=v,S}r(we,"requireSrc");var A={},te;function _e(){if(te)return A;te=1;var g=A&&A.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(A,"__esModule",{value:!0});const l=g(H()).default("https-proxy-agent:parse-proxy-response");function t(f){return new Promise((w,b)=>{let v=0;const i=[];function p(){const h=f.read();h?s(h):f.once("readable",p)}r(p,"read");function c(){f.removeListener("end",e),f.removeListener("error",a),f.removeListener("close",n),f.removeListener("readable",p)}r(c,"cleanup");function n(h){l("onclose had error %o",h)}r(n,"onclose");function e(){l("onend")}r(e,"onend");function a(h){c(),l("onerror %o",h),b(h)}r(a,"onerror");function s(h){i.push(h),v+=h.length;const u=Buffer.concat(i,v);if(u.indexOf(`\r
|
|
7
|
+
\r
|
|
8
|
+
`)===-1){l("have not received end of HTTP headers yet..."),p();return}const C=u.toString("ascii",0,u.indexOf(`\r
|
|
9
|
+
`)),d=+C.split(" ")[1];l("got proxy server response: %o",C),w({statusCode:d,buffered:u})}r(s,"ondata"),f.on("error",a),f.on("close",n),f.on("end",e),p()})}return r(t,"parseProxyResponse$1"),A.default=t,A}r(_e,"requireParseProxyResponse");var re;function Oe(){if(re)return P;re=1;var g=P&&P.__awaiter||function(u,m,C,d){function x(F){return F instanceof C?F:new C(function(y){y(F)})}return r(x,"adopt"),new(C||(C=Promise))(function(F,y){function E(_){try{O(d.next(_))}catch(I){y(I)}}r(E,"fulfilled");function T(_){try{O(d.throw(_))}catch(I){y(I)}}r(T,"rejected");function O(_){_.done?F(_.value):x(_.value).then(E,T)}r(O,"step"),O((d=d.apply(u,m||[])).next())})},o=P&&P.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(P,"__esModule",{value:!0});const l=o(ae),t=o(le),f=o(fe),w=o(de),b=o(H()),v=we(),i=o(_e()),p=b.default("https-proxy-agent:agent"),h=class h extends v.Agent{constructor(m){let C;if(typeof m=="string"?C=f.default.parse(m):C=m,!C)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");p("creating new HttpsProxyAgent instance: %o",C),super(C);const d=Object.assign({},C);this.secureProxy=C.secureProxy||a(d.protocol),d.host=d.hostname||d.host,typeof d.port=="string"&&(d.port=parseInt(d.port,10)),!d.port&&d.host&&(d.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in d)&&(d.ALPNProtocols=["http 1.1"]),d.host&&d.path&&(delete d.path,delete d.pathname),this.proxy=d}callback(m,C){return g(this,void 0,void 0,function*(){const{proxy:d,secureProxy:x}=this;let F;x?(p("Creating `tls.Socket`: %o",d),F=t.default.connect(d)):(p("Creating `net.Socket`: %o",d),F=l.default.connect(d));const y=Object.assign({},d.headers);let T=`CONNECT ${`${C.host}:${C.port}`} HTTP/1.1\r
|
|
10
|
+
`;d.auth&&(y["Proxy-Authorization"]=`Basic ${Buffer.from(d.auth).toString("base64")}`);let{host:O,port:_,secureEndpoint:I}=C;e(_,I)||(O+=`:${_}`),y.Host=O,y.Connection="close";for(const R of Object.keys(y))T+=`${R}: ${y[R]}\r
|
|
11
|
+
`;const oe=i.default(F);F.write(`${T}\r
|
|
12
|
+
`);const{statusCode:se,buffered:ie}=yield oe;if(se===200){if(m.once("socket",n),C.secureEndpoint){p("Upgrading socket connection to TLS");const R=C.servername||C.host;return t.default.connect(Object.assign(Object.assign({},s(C,"host","hostname","path","port")),{socket:F,servername:R}))}return F}F.destroy();const U=new l.default.Socket({writable:!1});return U.readable=!0,m.once("socket",R=>{p("replaying proxy buffer for failed request"),w.default(R.listenerCount("data")>0),R.push(ie),R.push(null)}),U})}};r(h,"HttpsProxyAgent");let c=h;P.default=c;function n(u){u.resume()}r(n,"resume");function e(u,m){return!!(!m&&u===80||m&&u===443)}r(e,"isDefaultPort");function a(u){return typeof u=="string"?/^https:?$/i.test(u):!1}r(a,"isHTTPS");function s(u,...m){const C={};let d;for(d in u)m.includes(d)||(C[d]=u[d]);return C}return r(s,"omit"),P}r(Oe,"requireAgent");var k,ne;function xe(){if(ne)return k;ne=1;var g=k&&k.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const o=g(Oe());function l(t){return new o.default(t)}return r(l,"createHttpsProxyAgent"),(function(t){t.HttpsProxyAgent=o.default,t.prototype=o.default.prototype})(l||(l={})),k=l,k}r(xe,"requireDist");var Ee=xe(),Re=ce(Ee);export{Re as c};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var C=Object.defineProperty;var f=(d,t)=>C(d,"name",{value:t,configurable:!0});import M from"http";import O from"https";import{L as $,g as L}from"./prompt-BMR92Sng.mjs";import{K as m}from"./cli-D2zun-19.mjs";import"tty";import"node:buffer";import"node:path";import"node:child_process";import"node:process";import"child_process";import"path";import"fs";import"node:url";import"node:os";import"assert";import"events";import"node:fs";import"buffer";import"stream";import"util";import"node:util";import"node:readline";import"node:stream";import"fs/promises";import"os";import"url";const g=class g extends ${get name(){return"ollama"}validateConfig(){const{endpoint:t}=this.config;if(!t)throw new m("Ollama endpoint is not configured. Using default: http://localhost:11434")}async generateCommitMessage(t){try{const e=[{role:"system",content:L(this.config.locale,this.config.maxLength,this.config.type,t.projectConfig)},{role:"user",content:t.diff}],o=[];for(let s=0;s<t.completions;s++){const a=(await this.createChatCompletion(e)).message.content;a&&o.push(this.sanitizeMessage(a))}return{messages:this.deduplicateMessages(o)}}catch(r){const e=r;throw e.code==="ECONNREFUSED"?new m(`Cannot connect to Ollama at ${this.config.endpoint}. Make sure Ollama is running. Install from: https://ollama.com`):e.code==="ENOTFOUND"?new m(`Error connecting to ${e.hostname} (${e.syscall}). Check your OLLAMA_ENDPOINT configuration.`):e}}async createChatCompletion(t){const r={model:this.config.model,messages:t,stream:!1,options:{temperature:this.config.temperature,num_predict:this.config.maxCompletionTokens}},{response:e,data:o}=await this.httpPost(this.config.endpoint,"/api/chat",{},r);if(!e.statusCode||e.statusCode<200||e.statusCode>299){let n=`Ollama API Error: ${e.statusCode} - ${e.statusMessage}`;if(o)try{const s=JSON.parse(o);s.error&&(n+=`
|
|
2
|
+
|
|
3
|
+
${s.error}`)}catch{n+=`
|
|
4
|
+
|
|
5
|
+
${o}`}throw new m(n)}return JSON.parse(o)}async httpPost(t,r,e,o){return new Promise((n,s)=>{const c=new URL(t),a=c.protocol==="https:",y=a?O:M,l=JSON.stringify(o),i=y.request({hostname:c.hostname,port:c.port||(a?443:80),path:r,method:"POST",headers:{...e,"Content-Type":"application/json","Content-Length":Buffer.byteLength(l)},timeout:this.config.timeout},p=>{const u=[];p.on("data",w=>u.push(w)),p.on("end",()=>{n({request:i,response:p,data:Buffer.concat(u).toString()})})});i.on("error",s),i.on("timeout",()=>{i.destroy(),s(new m(`Time out error: request took over ${this.config.timeout}ms. Try increasing the \`timeout\` config or check if Ollama is running.`))}),i.write(l),i.end()})}sanitizeMessage(t){return t.trim().replace(/[\n\r]/g,"").replace(/(\w)\.$/,"$1")}deduplicateMessages(t){return Array.from(new Set(t))}};f(g,"OllamaProvider");let h=g;export{h as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var y=Object.defineProperty;var g=(u,t)=>y(u,"name",{value:t,configurable:!0});import d from"https";import{c as w}from"./index-CQ8E6Ymc.mjs";import{L as C,g as A}from"./prompt-BMR92Sng.mjs";import{K as i}from"./cli-D2zun-19.mjs";import"net";import"tls";import"url";import"assert";import"tty";import"util";import"os";import"events";import"node:buffer";import"node:path";import"node:child_process";import"node:process";import"child_process";import"path";import"fs";import"node:url";import"node:os";import"node:fs";import"buffer";import"stream";import"node:util";import"node:readline";import"node:stream";import"fs/promises";const m=class m extends C{get name(){return"openai"}validateConfig(){const{apiKey:t}=this.config;if(!t)throw new i("Please set your OpenAI API key via `aicommit config set OPENAI_KEY=<your token>`");if(!t.startsWith("sk-"))throw new i('Invalid OpenAI API key: Must start with "sk-"')}async generateCommitMessage(t){try{const e=await this.createChatCompletion({model:this.config.model,messages:[{role:"system",content:A(this.config.locale,this.config.maxLength,this.config.type,t.projectConfig)},{role:"user",content:t.diff}],temperature:this.config.temperature,top_p:1,frequency_penalty:0,presence_penalty:0,max_completion_tokens:this.config.maxCompletionTokens,stream:!1,n:t.completions});return{messages:this.deduplicateMessages(e.choices.filter(s=>s.message?.content).map(s=>this.sanitizeMessage(s.message.content)))}}catch(e){const o=e;throw o.code==="ENOTFOUND"?new i(`Error connecting to ${o.hostname} (${o.syscall}). Are you connected to the internet?`):o}}async createChatCompletion(t){const{response:e,data:o}=await this.httpsPost("api.openai.com","/v1/chat/completions",{Authorization:`Bearer ${this.config.apiKey}`},t);if(!e.statusCode||e.statusCode<200||e.statusCode>299){let s=`OpenAI API Error: ${e.statusCode} - ${e.statusMessage}`;throw o&&(s+=`
|
|
2
|
+
|
|
3
|
+
${o}`),e.statusCode===500&&(s+=`
|
|
4
|
+
|
|
5
|
+
Check the API status: https://status.openai.com`),new i(s)}return JSON.parse(o)}async httpsPost(t,e,o,s){return new Promise((f,p)=>{const c=JSON.stringify(s),r=d.request({hostname:t,path:e,method:"POST",headers:{...o,"Content-Type":"application/json","Content-Length":Buffer.byteLength(c)},timeout:this.config.timeout,agent:this.config.proxy?w(this.config.proxy):void 0},n=>{const h=[];n.on("data",l=>h.push(l)),n.on("end",()=>{f({request:r,response:n,data:Buffer.concat(h).toString()})})});r.on("error",p),r.on("timeout",()=>{r.destroy(),p(new i(`Time out error: request took over ${this.config.timeout}ms. Try increasing the \`timeout\` config, or checking the OpenAI API status https://status.openai.com`))}),r.write(c),r.end()})}sanitizeMessage(t){return t.trim().replace(/[\n\r]/g,"").replace(/(\w)\.$/,"$1")}deduplicateMessages(t){return Array.from(new Set(t))}};g(m,"OpenAIProvider");let a=m;export{a as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var c=Object.defineProperty;var s=(t,e)=>c(t,"name",{value:e,configurable:!0});var r=Object.defineProperty,m=s((t,e,o)=>e in t?r(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,"__defNormalProp"),g=s((t,e,o)=>m(t,e+"",o),"__publicField");const i=class i{constructor(e){g(this,"config"),this.config=e,this.validateConfig()}getConfig(){return this.config}updateConfig(e){this.config={...this.config,...e},this.validateConfig()}};s(i,"LLMProvider");let n=i;const f={"":"<commit message>",conventional:"<type>(<optional scope>): <commit message>"},h=s(t=>`The output response must be in format:
|
|
2
|
+
${f[t]}`,"specifyCommitFormat"),l={"":"",conventional:`Choose a type from the type-to-description JSON below that best describes the git diff:
|
|
3
|
+
${JSON.stringify({docs:"Documentation only changes",style:"Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",refactor:"A code change that neither fixes a bug nor adds a feature",perf:"A code change that improves performance",test:"Adding missing tests or correcting existing tests",build:"Changes that affect the build system or external dependencies",ci:"Changes to our CI configuration files and scripts",chore:"Other changes that don't modify src or test files",revert:"Reverts a previous commit",feat:"A new feature",fix:"A bug fix",data:"Data only changes"},null,2)}`},d=s((t,e,o,a)=>["Generate a concise git commit message written in present tense for the following code diff with the given specifications below:",`Message language: ${t}`,`Commit message must be a maximum of ${e} characters.`,"Exclude anything unnecessary such as translation. Your entire response will be passed directly into git commit.","Try to focus on why the code changes was made and not only summarize the changes.",a?.projectPrompt?`Project context: ${a.projectPrompt}`:null,l[o],h(o)].filter(Boolean).join(`
|
|
4
|
+
`),"generatePrompt");export{n as L,d as g};
|