@negoziator/ai-commit 2.10.0 → 2.14.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/dist/anthropic-HKPfQ--D.mjs +5 -0
- package/dist/azure-openai-DTeRXuhJ.mjs +3 -0
- package/dist/cli-BE4adnRQ.mjs +85 -0
- package/dist/cli.mjs +1 -103
- package/dist/custom-BB1a-6TW.mjs +3 -0
- package/dist/index-ChJ2uh-n.mjs +12 -0
- package/dist/ollama-DJdDoRzJ.mjs +5 -0
- package/dist/openai-nLtDgw6D.mjs +5 -0
- package/dist/prompt-BMR92Sng.mjs +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var y=Object.defineProperty;var u=(f,t)=>y(f,"name",{value:t,configurable:!0});import l from"https";import{c as w}from"./index-ChJ2uh-n.mjs";import{L as A,g as C}from"./prompt-BMR92Sng.mjs";import{K as a}from"./cli-BE4adnRQ.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 h=class h extends A{get name(){return"anthropic"}validateConfig(){const{apiKey:t}=this.config;if(!t)throw new a("Please set your Anthropic API key via `aicommit config set ANTHROPIC_KEY=<your token>`\nGet your API key from: https://console.anthropic.com/");if(!t.startsWith("sk-ant-"))throw new a('Invalid Anthropic API key: Must start with "sk-ant-"')}async generateCommitMessage(t){try{const i=C(this.config.locale,this.config.maxLength,this.config.type,t.projectConfig),o=[{role:"user",content:t.diff}],e=[];for(let s=0;s<t.completions;s++){const r=(await this.createMessage(i,o)).content[0]?.text;r&&e.push(this.sanitizeMessage(r))}return{messages:this.deduplicateMessages(e)}}catch(i){const o=i;throw o.code==="ENOTFOUND"?new a(`Error connecting to ${o.hostname} (${o.syscall}). Are you connected to the internet?`):o}}async createMessage(t,i){const o={model:this.config.model,max_tokens:this.config.maxCompletionTokens,temperature:this.config.temperature,system:t,messages:i},{response:e,data:n}=await this.httpsPost("api.anthropic.com","/v1/messages",{"x-api-key":this.config.apiKey,"anthropic-version":"2023-06-01"},o);if(!e.statusCode||e.statusCode<200||e.statusCode>299){let s=`Anthropic API Error: ${e.statusCode} - ${e.statusMessage}`;throw n&&(s+=`
|
|
2
|
+
|
|
3
|
+
${n}`),e.statusCode===500&&(s+=`
|
|
4
|
+
|
|
5
|
+
Check the API status: https://status.anthropic.com`),new a(s)}return JSON.parse(n)}async httpsPost(t,i,o,e){return new Promise((n,s)=>{const c=JSON.stringify(e),r=l.request({hostname:t,path:i,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},m=>{const g=[];m.on("data",d=>g.push(d)),m.on("end",()=>{n({request:r,response:m,data:Buffer.concat(g).toString()})})});r.on("error",s),r.on("timeout",()=>{r.destroy(),s(new a(`Time out error: request took over ${this.config.timeout}ms. Try increasing the \`timeout\` config, or checking the Anthropic API status https://status.anthropic.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))}};u(h,"AnthropicProvider");let p=h;export{p as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var d=Object.defineProperty;var f=(u,t)=>d(u,"name",{value:t,configurable:!0});import y from"https";import{c as w}from"./index-ChJ2uh-n.mjs";import{L as C,g as A}from"./prompt-BMR92Sng.mjs";import{K as a}from"./cli-BE4adnRQ.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 g=class g extends C{get name(){return"azure-openai"}validateConfig(){const{apiKey:t,endpoint:n}=this.config;if(!t)throw new a("Please set your Azure OpenAI API key via `aicommit config set AZURE_OPENAI_KEY=<your token>`");if(!n)throw new a("Please set your Azure OpenAI endpoint via `aicommit config set AZURE_ENDPOINT=<your endpoint>`")}async generateCommitMessage(t){try{const n=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_tokens:this.config.maxCompletionTokens,n:t.completions});return{messages:this.deduplicateMessages(n.choices.filter(r=>r.message?.content).map(r=>this.sanitizeMessage(r.message.content)))}}catch(n){const e=n;throw e.code==="ENOTFOUND"?new a(`Error connecting to ${e.hostname} (${e.syscall}). Are you connected to the internet?`):e}}async createChatCompletion(t){const e=new URL(this.config.endpoint).hostname,m=`/openai/deployments/${this.config.deploymentName||this.config.model}/chat/completions?api-version=2024-02-01`,{response:i,data:s}=await this.httpsPost(e,m,{"api-key":this.config.apiKey},t);if(!i.statusCode||i.statusCode<200||i.statusCode>299){let o=`Azure OpenAI API Error: ${i.statusCode} - ${i.statusMessage}`;throw s&&(o+=`
|
|
2
|
+
|
|
3
|
+
${s}`),new a(o)}return JSON.parse(s)}async httpsPost(t,n,e,r){return new Promise((m,i)=>{const s=JSON.stringify(r),o=y.request({hostname:t,path:n,method:"POST",headers:{...e,"Content-Type":"application/json","Content-Length":Buffer.byteLength(s)},timeout:this.config.timeout,agent:this.config.proxy?w(this.config.proxy):void 0},p=>{const h=[];p.on("data",l=>h.push(l)),p.on("end",()=>{m({request:o,response:p,data:Buffer.concat(h).toString()})})});o.on("error",i),o.on("timeout",()=>{o.destroy(),i(new a(`Time out error: request took over ${this.config.timeout}ms. Try increasing the \`timeout\` config`))}),o.write(s),o.end()})}sanitizeMessage(t){return t.trim().replace(/[\n\r]/g,"").replace(/(\w)\.$/,"$1")}deduplicateMessages(t){return Array.from(new Set(t))}};f(g,"AzureOpenAIProvider");let c=g;export{c as default};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var ct=Object.defineProperty;var s=(u,D)=>ct(u,"name",{value:D,configurable:!0});var V;import lt from"tty";import{Buffer as Ft}from"node:buffer";import K from"node:path";import yD,{ChildProcess as Ct}from"node:child_process";import x,{stdout as wD,stdin as vD}from"node:process";import Et from"child_process";import N from"path";import bu from"fs";import{fileURLToPath as $D}from"node:url";import ft,{constants as xD}from"node:os";import dt from"assert";import pt from"events";import{createWriteStream as mt,createReadStream as ht}from"node:fs";import gt from"buffer";import yu from"stream";import Bt from"util";import{debuglog as At}from"node:util";import*as eu from"node:readline";import SD from"node:readline";import{Writable as bt}from"node:stream";import O from"fs/promises";import yt from"os";import{fileURLToPath as wt,pathToFileURL as vt}from"url";const $t="known-flag",xt="unknown-flag",St="argument",{stringify:Z}=JSON,Ot=/\B([A-Z])/g,It=s(u=>u.replace(Ot,"-$1").toLowerCase(),"v$1"),{hasOwnProperty:Tt}=Object.prototype,J=s((u,D)=>Tt.call(u,D),"w$3"),Pt=s(u=>Array.isArray(u),"L$4"),OD=s(u=>typeof u=="function"?[u,!1]:Pt(u)?[u[0],!0]:OD(u.type),"b$3"),Rt=s((u,D)=>u===Boolean?D!=="false":D,"d$4"),kt=s((u,D)=>typeof D=="boolean"?D:u===Number&&D===""?Number.NaN:u(D),"m$2"),_t=/[\s.:=]/,Nt=s(u=>{const D=`Flag name ${Z(u)}`;if(u.length===0)throw new Error(`${D} cannot be empty`);if(u.length===1)throw new Error(`${D} must be longer than a character`);const t=u.match(_t);if(t)throw new Error(`${D} cannot contain ${Z(t?.[0])}`)},"B$1"),Mt=s(u=>{const D={},t=s((r,n)=>{if(J(D,r))throw new Error(`Duplicate flags named ${Z(r)}`);D[r]=n},"r");for(const r in u){if(!J(u,r))continue;Nt(r);const n=u[r],i=[[],...OD(n),n];t(r,i);const e=It(r);if(r!==e&&t(e,i),"alias"in n&&typeof n.alias=="string"){const{alias:a}=n,o=`Flag alias ${Z(a)} for flag ${Z(r)}`;if(a.length===0)throw new Error(`${o} cannot be empty`);if(a.length>1)throw new Error(`${o} must be a single character`);t(a,i)}}return D},"K$2"),jt=s((u,D)=>{const t={};for(const r in u){if(!J(u,r))continue;const[n,,i,e]=D[r];if(n.length===0&&"default"in e){let{default:a}=e;typeof a=="function"&&(a=a()),t[r]=a}else t[r]=i?n:n.pop()}return t},"_$3"),tu="--",Lt=/[.:=]/,Gt=/^-{1,2}\w/,Ut=s(u=>{if(!Gt.test(u))return;const D=!u.startsWith(tu);let t=u.slice(D?1:2),r;const n=t.match(Lt);if(n){const{index:i}=n;r=t.slice(i+1),t=t.slice(0,i)}return[t,r,D]},"N$1"),Wt=s((u,{onFlag:D,onArgument:t})=>{let r;const n=s((i,e)=>{if(typeof r!="function")return!0;r(i,e),r=void 0},"o");for(let i=0;i<u.length;i+=1){const e=u[i];if(e===tu){n();const o=u.slice(i+1);t?.(o,[i],!0);break}const a=Ut(e);if(a){if(n(),!D)continue;const[o,c,l]=a;if(l)for(let F=0;F<o.length;F+=1){n();const C=F===o.length-1;r=D(o[F],C?c:void 0,[i,F+1,C])}else r=D(o,c,[i])}else n(e,[i])&&t?.([e],[i])}n()},"$$2"),qt=s((u,D)=>{for(const[t,r,n]of D.reverse()){if(r){const i=u[t];let e=i.slice(0,r);if(n||(e+=i.slice(r+1)),e!=="-"){u[t]=e;continue}}u.splice(t,1)}},"E"),Kt=s((u,D=process.argv.slice(2),{ignore:t}={})=>{const r=[],n=Mt(u),i={},e=[];return e[tu]=[],Wt(D,{onFlag(a,o,c){const l=J(n,a);if(!t?.(l?$t:xt,a,o)){if(l){const[F,C]=n[a],E=Rt(C,o),d=s((g,f)=>{r.push(c),f&&r.push(f),F.push(kt(C,g||""))},"p");return E===void 0?d:d(E)}J(i,a)||(i[a]=[]),i[a].push(o===void 0?!0:o),r.push(c)}},onArgument(a,o,c){t?.(St,D[o[0]])||(e.push(...a),c?(e[tu]=a,D.splice(o[0])):r.push(o))}}),qt(D,r),{flags:jt(u,n),unknownFlags:i,_:e}},"U$2");var Yt=Object.create,ru=Object.defineProperty,zt=Object.defineProperties,Ht=Object.getOwnPropertyDescriptor,Vt=Object.getOwnPropertyDescriptors,Zt=Object.getOwnPropertyNames,ID=Object.getOwnPropertySymbols,Jt=Object.getPrototypeOf,TD=Object.prototype.hasOwnProperty,Xt=Object.prototype.propertyIsEnumerable,PD=s((u,D,t)=>D in u?ru(u,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[D]=t,"W$3"),nu=s((u,D)=>{for(var t in D||(D={}))TD.call(D,t)&&PD(u,t,D[t]);if(ID)for(var t of ID(D))Xt.call(D,t)&&PD(u,t,D[t]);return u},"p$1"),wu=s((u,D)=>zt(u,Vt(D)),"c"),Qt=s(u=>ru(u,"__esModule",{value:!0}),"nD$1"),ur=s((u,D)=>()=>(u&&(D=u(u=0)),D),"rD$1"),Dr=s((u,D)=>()=>(D||u((D={exports:{}}).exports,D),D.exports),"iD$1"),er=s((u,D,t,r)=>{if(D&&typeof D=="object"||typeof D=="function")for(let n of Zt(D))!TD.call(u,n)&&n!=="default"&&ru(u,n,{get:s(()=>D[n],"get"),enumerable:!(r=Ht(D,n))||r.enumerable});return u},"oD$1"),tr=s((u,D)=>er(Qt(ru(u!=null?Yt(Jt(u)):{},"default",{value:u,enumerable:!0})),u),"BD$1"),I=ur(()=>{}),rr=Dr((u,D)=>{I(),D.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}});I(),I(),I();var nr=s(u=>{var D,t,r;let n=(D=process.stdout.columns)!=null?D: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");I(),I(),I(),I(),I();function ir({onlyFirst:u=!1}={}){let D=["[\\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(D,u?void 0:"g")}s(ir,"w$2");function RD(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(ir(),"")}s(RD,"d$3"),I();function or(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}s(or,"y$2");var sr=tr(rr());function j(u){if(typeof u!="string"||u.length===0||(u=RD(u),u.length===0))return 0;u=u.replace((0,sr.default)()," ");let D=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++,D+=or(r)?2:1)}return D}s(j,"g");var kD=s(u=>Math.max(...u.split(`
|
|
2
|
+
`).map(j)),"b$2"),ar=s(u=>{let D=[];for(let t of u){let{length:r}=t,n=r-D.length;for(let i=0;i<n;i+=1)D.push(0);for(let i=0;i<r;i+=1){let e=kD(t[i]);e>D[i]&&(D[i]=e)}}return D},"k$3");I();var _D=/^\d+%$/,ND={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},cr=s((u,D)=>{var t;let r=[];for(let n=0;n<u.length;n+=1){let i=(t=D[n])!=null?t:"auto";if(typeof i=="number"||i==="auto"||i==="content-width"||typeof i=="string"&&_D.test(i)){r.push(wu(nu({},ND),{width:i,contentWidth:u[n]}));continue}if(i&&typeof i=="object"){let e=wu(nu(nu({},ND),i),{contentWidth:u[n]});e.horizontalPadding=e.paddingLeft+e.paddingRight,r.push(e);continue}throw new Error(`Invalid column width: ${JSON.stringify(i)}`)}return r},"sD$1");function lr(u,D){for(let t of u){let{width:r}=t;if(r==="content-width"&&(t.width=t.contentWidth),r==="auto"){let o=Math.min(20,t.contentWidth);t.width=o,t.autoOverflow=t.contentWidth-o}if(typeof r=="string"&&_D.test(r)){let o=Number.parseFloat(r.slice(0,-1))/100;t.width=Math.floor(D*o)-(t.paddingLeft+t.paddingRight)}let{horizontalPadding:n}=t,i=1,e=i+n;if(e>=D){let o=e-D,c=Math.ceil(t.paddingLeft/n*o),l=o-c;t.paddingLeft-=c,t.paddingRight-=l,t.horizontalPadding=t.paddingLeft+t.paddingRight}t.paddingLeftString=t.paddingLeft?" ".repeat(t.paddingLeft):"",t.paddingRightString=t.paddingRight?" ".repeat(t.paddingRight):"";let a=D-t.horizontalPadding;t.width=Math.max(Math.min(t.width,a),i)}}s(lr,"aD$1");var MD=s(()=>Object.assign([],{columns:0}),"G$3");function Fr(u,D){let t=[MD()],[r]=t;for(let n of u){let i=n.width+n.horizontalPadding;r.columns+i>D&&(r=MD(),t.push(r)),r.push(n),r.columns+=i}for(let n of t){let i=n.reduce((C,E)=>C+E.width+E.horizontalPadding,0),e=D-i;if(e===0)continue;let a=n.filter(C=>"autoOverflow"in C),o=a.filter(C=>C.autoOverflow>0),c=o.reduce((C,E)=>C+E.autoOverflow,0),l=Math.min(c,e);for(let C of o){let E=Math.floor(C.autoOverflow/c*l);C.width+=E,e-=E}let F=Math.floor(e/a.length);for(let C=0;C<a.length;C+=1){let E=a[C];C===a.length-1?E.width+=e:E.width+=F,e-=F}}return t}s(Fr,"lD$1");function Cr(u,D,t){let r=cr(t,D);return lr(r,u),Fr(r,u)}s(Cr,"Z$1"),I(),I(),I();var vu=10,jD=s((u=0)=>D=>`\x1B[${D+u}m`,"U$1"),LD=s((u=0)=>D=>`\x1B[${38+u};5;${D}m`,"V$3"),GD=s((u=0)=>(D,t,r)=>`\x1B[${38+u};2;${D};${t};${r}m`,"Y$2");function Er(){let u=new Map,D={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]}};D.color.gray=D.color.blackBright,D.bgColor.bgGray=D.bgColor.bgBlackBright,D.color.grey=D.color.blackBright,D.bgColor.bgGrey=D.bgColor.bgBlackBright;for(let[t,r]of Object.entries(D)){for(let[n,i]of Object.entries(r))D[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=D[n],u.set(i[0],i[1]);Object.defineProperty(D,t,{value:r,enumerable:!1})}return Object.defineProperty(D,"codes",{value:u,enumerable:!1}),D.color.close="\x1B[39m",D.bgColor.close="\x1B[49m",D.color.ansi=jD(),D.color.ansi256=LD(),D.color.ansi16m=GD(),D.bgColor.ansi=jD(vu),D.bgColor.ansi256=LD(vu),D.bgColor.ansi16m=GD(vu),Object.defineProperties(D,{rgbToAnsi256:{value:s((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:s(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(e=>e+e).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},"value"),enumerable:!1},hexToAnsi256:{value:s(t=>D.rgbToAnsi256(...D.hexToRgb(t)),"value"),enumerable:!1},ansi256ToAnsi:{value:s(t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,i;if(t>=232)r=((t-232)*10+8)/255,n=r,i=r;else{t-=16;let o=t%36;r=Math.floor(t/36)/5,n=Math.floor(o/6)/5,i=o%6/5}let e=Math.max(r,n,i)*2;if(e===0)return 30;let a=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return e===2&&(a+=60),a},"value"),enumerable:!1},rgbToAnsi:{value:s((t,r,n)=>D.ansi256ToAnsi(D.rgbToAnsi256(t,r,n)),"value"),enumerable:!1},hexToAnsi:{value:s(t=>D.ansi256ToAnsi(D.hexToAnsi256(t)),"value"),enumerable:!1}}),D}s(Er,"AD$1");var fr=Er(),dr=fr,iu=new Set(["\x1B","\x9B"]),pr=39,$u="\x07",UD="[",mr="]",WD="m",xu=`${mr}8;;`,qD=s(u=>`${iu.values().next().value}${UD}${u}${WD}`,"J$2"),KD=s(u=>`${iu.values().next().value}${xu}${u}${$u}`,"Q"),hr=s(u=>u.split(" ").map(D=>j(D)),"hD$1"),Su=s((u,D,t)=>{let r=[...D],n=!1,i=!1,e=j(RD(u[u.length-1]));for(let[a,o]of r.entries()){let c=j(o);if(e+c<=t?u[u.length-1]+=o:(u.push(o),e=0),iu.has(o)&&(n=!0,i=r.slice(a+1).join("").startsWith(xu)),n){i?o===$u&&(n=!1,i=!1):o===WD&&(n=!1);continue}e+=c,e===t&&a<r.length-1&&(u.push(""),e=0)}!e&&u[u.length-1].length>0&&u.length>1&&(u[u.length-2]+=u.pop())},"S$1"),gr=s(u=>{let D=u.split(" "),t=D.length;for(;t>0&&!(j(D[t-1])>0);)t--;return t===D.length?u:D.slice(0,t).join(" ")+D.slice(t).join("")},"cD"),Br=s((u,D,t={})=>{if(t.trim!==!1&&u.trim()==="")return"";let r="",n,i,e=hr(u),a=[""];for(let[c,l]of u.split(" ").entries()){t.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let F=j(a[a.length-1]);if(c!==0&&(F>=D&&(t.wordWrap===!1||t.trim===!1)&&(a.push(""),F=0),(F>0||t.trim===!1)&&(a[a.length-1]+=" ",F++)),t.hard&&e[c]>D){let C=D-F,E=1+Math.floor((e[c]-C-1)/D);Math.floor((e[c]-1)/D)<E&&a.push(""),Su(a,l,D);continue}if(F+e[c]>D&&F>0&&e[c]>0){if(t.wordWrap===!1&&F<D){Su(a,l,D);continue}a.push("")}if(F+e[c]>D&&t.wordWrap===!1){Su(a,l,D);continue}a[a.length-1]+=l}t.trim!==!1&&(a=a.map(c=>gr(c)));let o=[...a.join(`
|
|
3
|
+
`)];for(let[c,l]of o.entries()){if(r+=l,iu.has(l)){let{groups:C}=new RegExp(`(?:\\${UD}(?<code>\\d+)m|\\${xu}(?<uri>.*)${$u})`).exec(o.slice(c).join(""))||{groups:{}};if(C.code!==void 0){let E=Number.parseFloat(C.code);n=E===pr?void 0:E}else C.uri!==void 0&&(i=C.uri.length===0?void 0:C.uri)}let F=dr.codes.get(Number(n));o[c+1]===`
|
|
4
|
+
`?(i&&(r+=KD("")),n&&F&&(r+=qD(F))):l===`
|
|
5
|
+
`&&(n&&F&&(r+=qD(n)),i&&(r+=KD(i)))}return r},"dD$1");function Ar(u,D,t){return String(u).normalize().replace(/\r\n/g,`
|
|
6
|
+
`).split(`
|
|
7
|
+
`).map(r=>Br(r,D,t)).join(`
|
|
8
|
+
`)}s(Ar,"T$1");var YD=s(u=>Array.from({length:u}).fill(""),"X");function br(u,D){let t=[],r=0;for(let n of u){let i=0,e=n.map(o=>{var c;let l=(c=D[r])!=null?c:"";r+=1,o.preprocess&&(l=o.preprocess(l)),kD(l)>o.width&&(l=Ar(l,o.width,{hard:!0}));let F=l.split(`
|
|
9
|
+
`);if(o.postprocess){let{postprocess:C}=o;F=F.map((E,d)=>C.call(o,E,d))}return o.paddingTop&&F.unshift(...YD(o.paddingTop)),o.paddingBottom&&F.push(...YD(o.paddingBottom)),F.length>i&&(i=F.length),wu(nu({},o),{lines:F})}),a=[];for(let o=0;o<i;o+=1){let c=e.map(l=>{var F;let C=(F=l.lines[o])!=null?F:"",E=Number.isFinite(l.width)?" ".repeat(l.width-j(C)):"",d=l.paddingLeftString;return l.align==="right"&&(d+=E),d+=C,l.align==="left"&&(d+=E),d+l.paddingRightString}).join("");a.push(c)}t.push(a.join(`
|
|
10
|
+
`))}return t.join(`
|
|
11
|
+
`)}s(br,"P$3");function yr(u,D){if(!u||u.length===0)return"";let t=ar(u),r=t.length;if(r===0)return"";let{stdoutColumns:n,columns:i}=nr(D);if(i.length>r)throw new Error(`${i.length} columns defined, but only ${r} columns found`);let e=Cr(n,i,t);return u.map(a=>br(e,a)).join(`
|
|
12
|
+
`)}s(yr,"mD"),I();var wr=["<",">","=",">=","<="];function vr(u){if(!wr.includes(u))throw new TypeError(`Invalid breakpoint operator: ${u}`)}s(vr,"xD$1");function $r(u){let D=Object.keys(u).map(t=>{let[r,n]=t.split(" ");vr(r);let i=Number.parseInt(n,10);if(Number.isNaN(i))throw new TypeError(`Invalid breakpoint value: ${n}`);let e=u[t];return{operator:r,breakpoint:i,value:e}}).sort((t,r)=>r.breakpoint-t.breakpoint);return t=>{var r;return(r=D.find(({operator:n,breakpoint:i})=>n==="="&&t===i||n===">"&&t>i||n==="<"&&t<i||n===">="&&t>=i||n==="<="&&t<=i))==null?void 0:r.value}}s($r,"wD");const xr=s(u=>u.replace(/[\W_]([a-z\d])?/gi,(D,t)=>t?t.toUpperCase():""),"P$2"),Sr=s(u=>u.replace(/\B([A-Z])/g,"-$1").toLowerCase(),"q"),Or={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:s(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 Ir(u){let D=!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&&(D=!0),{name:t,flag:r,flagFormatted:`--${Sr(t)}`,aliasesEnabled:D,aliasFormatted:n?`-${r.alias}`:void 0}}).map(t=>(t.aliasesEnabled=D,[{type:"flagName",data:t},{type:"flagDescription",data:t}])),tableBreakpoints:Or}}}s(Ir,"D");const zD=s(u=>!u||(u.version??(u.help?u.help.version:void 0)),"A"),HD=s(u=>{const D="parent"in u&&u.parent?.name;return(D?`${D} `:"")+u.name},"C$1");function Tr(u){const D=[];u.name&&D.push(HD(u));const t=zD(u)??("parent"in u&&zD(u.parent));if(t&&D.push(`v${t}`),D.length!==0)return{id:"name",type:"text",data:`${D.join(" ")}
|
|
13
|
+
`}}s(Tr,"R$1");function Pr(u){const{help:D}=u;if(!(!D||!D.description))return{id:"description",type:"text",data:`${D.description}
|
|
14
|
+
`}}s(Pr,"L$2");function Rr(u){const D=u.help||{};if("usage"in D)return D.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(D.usage)?D.usage.join(`
|
|
15
|
+
`):D.usage}}:void 0;if(u.name){const t=[],r=[HD(u)];if(u.flags&&Object.keys(u.flags).length>0&&r.push("[flags...]"),u.parameters&&u.parameters.length>0){const{parameters:n}=u,i=n.indexOf("--"),e=i>-1&&n.slice(i+1).some(a=>a.startsWith("<"));r.push(n.map(a=>a!=="--"?a:e?"--":"[--]").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(`
|
|
16
|
+
`)}}}}s(Rr,"T");function kr(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(D=>[D.options.name,D.options.help?D.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}s(kr,"_$1");function _r(u){if(!(!u.flags||Object.keys(u.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:Ir(u.flags),indentBody:0}}}s(_r,"k$2");function Nr(u){const{help:D}=u;if(!D||!D.examples||D.examples.length===0)return;let{examples:t}=D;if(Array.isArray(t)&&(t=t.join(`
|
|
17
|
+
`)),t)return{id:"examples",type:"section",data:{title:"Examples:",body:t}}}s(Nr,"F");function Mr(u){if(!("alias"in u)||!u.alias)return;const{alias:D}=u;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(D)?D.join(", "):D}}}s(Mr,"H");const jr=s(u=>[Tr,Pr,Rr,kr,_r,Nr,Mr].map(D=>D(u)).filter(Boolean),"U"),Lr=lt.WriteStream.prototype.hasColors();let Gr=(V=class{text(D){return D}bold(D){return Lr?`\x1B[1m${D}\x1B[22m`:D.toLocaleUpperCase()}indentText({text:D,spaces:t}){return D.replace(/^/gm," ".repeat(t))}heading(D){return this.bold(D)}section({title:D,body:t,indentBody:r=2}){return`${(D?`${this.heading(D)}
|
|
18
|
+
`:"")+(t?this.indentText({text:this.render(t),spaces:r}):"")}
|
|
19
|
+
`}table({tableData:D,tableOptions:t,tableBreakpoints:r}){return yr(D.map(n=>n.map(i=>this.render(i))),r?$r(r):t)}flagParameter(D){return D===Boolean?"":D===String?"<string>":D===Number?"<number>":Array.isArray(D)?this.flagParameter(D[0]):"<value>"}flagOperator(D){return" "}flagName(D){const{flag:t,flagFormatted:r,aliasesEnabled:n,aliasFormatted:i}=D;let e="";if(i?e+=`${i}, `:n&&(e+=" "),e+=r,"placeholder"in t&&typeof t.placeholder=="string")e+=`${this.flagOperator(D)}${t.placeholder}`;else{const a=this.flagParameter("type"in t?t.type:t);a&&(e+=`${this.flagOperator(D)}${a}`)}return e}flagDefault(D){return JSON.stringify(D)}flagDescription({flag:D}){let t="description"in D?D.description??"":"";if("default"in D){let{default:r}=D;typeof r=="function"&&(r=r()),r&&(t+=` (default: ${this.flagDefault(r)})`)}return t}render(D){if(typeof D=="string")return D;if(Array.isArray(D))return D.map(t=>this.render(t)).join(`
|
|
20
|
+
`);if("type"in D&&this[D.type]){const t=this[D.type];if(typeof t=="function")return t.call(this,D.data)}throw new Error(`Invalid node type: ${JSON.stringify(D)}`)}},s(V,"J"),V);const Ou=s(u=>u.length>0&&!u.includes(" "),"y$1"),{stringify:k}=JSON,Ur=/[|\\{}()[\]^$+*?.]/;function Iu(u){const D=[];let t,r;for(const n of u){if(r)throw new Error(`Invalid parameter: Spread parameter ${k(r)} must be last`);const i=n[0],e=n[n.length-1];let a;if(i==="<"&&e===">"&&(a=!0,t))throw new Error(`Invalid parameter: Required parameter ${k(n)} cannot come after optional parameter ${k(t)}`);if(i==="["&&e==="]"&&(a=!1,t=n),a===void 0)throw new Error(`Invalid parameter: ${k(n)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let o=n.slice(1,-1);const c=o.slice(-3)==="...";c&&(r=n,o=o.slice(0,-3));const l=o.match(Ur);if(l)throw new Error(`Invalid parameter: ${k(n)}. Invalid character found ${k(l[0])}`);D.push({name:o,required:a,spread:c})}return D}s(Iu,"w$1");function Tu(u,D,t,r){for(let n=0;n<D.length;n+=1){const{name:i,required:e,spread:a}=D[n],o=xr(i);if(o in u)throw new Error(`Invalid parameter: ${k(i)} is used more than once.`);const c=a?t.slice(n):t[n];if(a&&(n=D.length),e&&(!c||a&&c.length===0))return console.error(`Error: Missing required parameter ${k(i)}
|
|
21
|
+
`),r(),process.exit(1);u[o]=c}}s(Tu,"b$1");function Wr(u){return u===void 0||u!==!1}s(Wr,"W$2");function VD(u,D,t,r){const n={...D.flags},i=D.version;i&&(n.version={type:Boolean,description:"Show version"});const{help:e}=D,a=Wr(e);a&&!("help"in n)&&(n.help={type:Boolean,alias:"h",description:"Show help"});const o=Kt(n,r,{ignore:D.ignoreArgv}),c=s(()=>{console.log(D.version)},"f");if(i&&o.flags.version===!0)return c(),process.exit(0);const l=new Gr,F=a&&e?.render?e.render:d=>l.render(d),C=s(d=>{const g=jr({...D,...d?{help:d}:{},flags:n});console.log(F(g,l))},"u");if(a&&o.flags.help===!0)return C(),process.exit(0);if(D.parameters){let{parameters:d}=D,g=o._;const f=d.indexOf("--"),p=d.slice(f+1),m=Object.create(null);if(f>-1&&p.length>0){d=d.slice(0,f);const A=o._["--"];g=g.slice(0,-A.length||void 0),Tu(m,Iu(d),g,C),Tu(m,Iu(p),A,C)}else Tu(m,Iu(d),g,C);Object.assign(o._,m)}const E={...o,showVersion:c,showHelp:C};return typeof t=="function"&&t(E),{command:u,...E}}s(VD,"x$1");function qr(u,D){const t=new Map;for(const r of D){const n=[r.options.name],{alias:i}=r.options;i&&(Array.isArray(i)?n.push(...i):n.push(i));for(const e of n){if(t.has(e))throw new Error(`Duplicate command name found: ${k(e)}`);t.set(e,r)}}return t.get(u)}s(qr,"z$1");function Kr(u,D,t=process.argv.slice(2)){if(!u)throw new Error("Options is required");if("name"in u&&(!u.name||!Ou(u.name)))throw new Error(`Invalid script name: ${k(u.name)}`);const r=t[0];if(u.commands&&r&&Ou(r)){const n=qr(r,u.commands);if(n)return VD(n.options.name,{...n.options,parent:u},n.callback,t.slice(1))}return VD(void 0,u,D,t)}s(Kr,"Z");function ZD(u,D){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(!Ou(t))throw new Error(`Invalid command name ${JSON.stringify(t)}. Command names must be one word.`);return{options:u,callback:D}}s(ZD,"G$2");var Yr="2.14.0",zr="Writes your git commit messages for you with AI",Pu={version:Yr,description:zr},M=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function L(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}s(L,"getDefaultExportFromCjs");var G={exports:{}},Ru,JD;function Hr(){if(JD)return Ru;JD=1,Ru=r,r.sync=n;var u=bu;function D(i,e){var a=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!a||(a=a.split(";"),a.indexOf("")!==-1))return!0;for(var o=0;o<a.length;o++){var c=a[o].toLowerCase();if(c&&i.substr(-c.length).toLowerCase()===c)return!0}return!1}s(D,"checkPathExt");function t(i,e,a){return!i.isSymbolicLink()&&!i.isFile()?!1:D(e,a)}s(t,"checkStat");function r(i,e,a){u.stat(i,function(o,c){a(o,o?!1:t(c,i,e))})}s(r,"isexe");function n(i,e){return t(u.statSync(i),i,e)}return s(n,"sync"),Ru}s(Hr,"requireWindows");var ku,XD;function Vr(){if(XD)return ku;XD=1,ku=D,D.sync=t;var u=bu;function D(i,e,a){u.stat(i,function(o,c){a(o,o?!1:r(c,e))})}s(D,"isexe");function t(i,e){return r(u.statSync(i),e)}s(t,"sync");function r(i,e){return i.isFile()&&n(i,e)}s(r,"checkStat");function n(i,e){var a=i.mode,o=i.uid,c=i.gid,l=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),F=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),C=parseInt("100",8),E=parseInt("010",8),d=parseInt("001",8),g=C|E,f=a&d||a&E&&c===F||a&C&&o===l||a&g&&l===0;return f}return s(n,"checkMode"),ku}s(Vr,"requireMode");var _u,QD;function Zr(){if(QD)return _u;QD=1;var u;process.platform==="win32"||M.TESTING_WINDOWS?u=Hr():u=Vr(),_u=D,D.sync=t;function D(r,n,i){if(typeof n=="function"&&(i=n,n={}),!i){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(e,a){D(r,n||{},function(o,c){o?a(o):e(c)})})}u(r,n||{},function(e,a){e&&(e.code==="EACCES"||n&&n.ignoreErrors)&&(e=null,a=!1),i(e,a)})}s(D,"isexe");function t(r,n){try{return u.sync(r,n||{})}catch(i){if(n&&n.ignoreErrors||i.code==="EACCES")return!1;throw i}}return s(t,"sync"),_u}s(Zr,"requireIsexe");var Nu,ue;function Jr(){if(ue)return Nu;ue=1;const u=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",D=N,t=u?";":":",r=Zr(),n=s(o=>Object.assign(new Error(`not found: ${o}`),{code:"ENOENT"}),"getNotFoundError"),i=s((o,c)=>{const l=c.colon||t,F=o.match(/\//)||u&&o.match(/\\/)?[""]:[...u?[process.cwd()]:[],...(c.path||process.env.PATH||"").split(l)],C=u?c.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",E=u?C.split(l):[""];return u&&o.indexOf(".")!==-1&&E[0]!==""&&E.unshift(""),{pathEnv:F,pathExt:E,pathExtExe:C}},"getPathInfo"),e=s((o,c,l)=>{typeof c=="function"&&(l=c,c={}),c||(c={});const{pathEnv:F,pathExt:C,pathExtExe:E}=i(o,c),d=[],g=s(p=>new Promise((m,A)=>{if(p===F.length)return c.all&&d.length?m(d):A(n(o));const h=F[p],b=/^".*"$/.test(h)?h.slice(1,-1):h,$=D.join(b,o),P=!b&&/^\.[\\\/]/.test(o)?o.slice(0,2)+$:$;m(f(P,p,0))}),"step"),f=s((p,m,A)=>new Promise((h,b)=>{if(A===C.length)return h(g(m+1));const $=C[A];r(p+$,{pathExt:E},(P,Au)=>{if(!P&&Au)if(c.all)d.push(p+$);else return h(p+$);return h(f(p,m,A+1))})}),"subStep");return l?g(0).then(p=>l(null,p),l):g(0)},"which"),a=s((o,c)=>{c=c||{};const{pathEnv:l,pathExt:F,pathExtExe:C}=i(o,c),E=[];for(let d=0;d<l.length;d++){const g=l[d],f=/^".*"$/.test(g)?g.slice(1,-1):g,p=D.join(f,o),m=!f&&/^\.[\\\/]/.test(o)?o.slice(0,2)+p:p;for(let A=0;A<F.length;A++){const h=m+F[A];try{if(r.sync(h,{pathExt:C}))if(c.all)E.push(h);else return h}catch{}}}if(c.all&&E.length)return E;if(c.nothrow)return null;throw n(o)},"whichSync");return Nu=e,e.sync=a,Nu}s(Jr,"requireWhich");var ou={exports:{}},De;function Xr(){if(De)return ou.exports;De=1;const u=s((D={})=>{const t=D.env||process.env;return(D.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey");return ou.exports=u,ou.exports.default=u,ou.exports}s(Xr,"requirePathKey");var Mu,ee;function Qr(){if(ee)return Mu;ee=1;const u=N,D=Jr(),t=Xr();function r(i,e){const a=i.options.env||process.env,o=process.cwd(),c=i.options.cwd!=null,l=c&&process.chdir!==void 0&&!process.chdir.disabled;if(l)try{process.chdir(i.options.cwd)}catch{}let F;try{F=D.sync(i.command,{path:a[t({env:a})],pathExt:e?u.delimiter:void 0})}catch{}finally{l&&process.chdir(o)}return F&&(F=u.resolve(c?i.options.cwd:"",F)),F}s(r,"resolveCommandAttempt");function n(i){return r(i)||r(i,!0)}return s(n,"resolveCommand"),Mu=n,Mu}s(Qr,"requireResolveCommand");var su={},te;function un(){if(te)return su;te=1;const u=/([()\][%!^"`<>&|;, *?])/g;function D(r){return r=r.replace(u,"^$1"),r}s(D,"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 s(t,"escapeArgument"),su.command=D,su.argument=t,su}s(un,"require_escape");var ju,re;function Dn(){return re||(re=1,ju=/^#!(.*)/),ju}s(Dn,"requireShebangRegex");var Lu,ne;function en(){if(ne)return Lu;ne=1;const u=Dn();return Lu=s((D="")=>{const t=D.match(u);if(!t)return null;const[r,n]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i},"shebangCommand"),Lu}s(en,"requireShebangCommand");var Gu,ie;function tn(){if(ie)return Gu;ie=1;const u=bu,D=en();function t(r){const i=Buffer.alloc(150);let e;try{e=u.openSync(r,"r"),u.readSync(e,i,0,150,0),u.closeSync(e)}catch{}return D(i.toString())}return s(t,"readShebang"),Gu=t,Gu}s(tn,"requireReadShebang");var Uu,oe;function rn(){if(oe)return Uu;oe=1;const u=N,D=Qr(),t=un(),r=tn(),n=process.platform==="win32",i=/\.(?:com|exe)$/i,e=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function a(l){l.file=D(l);const F=l.file&&r(l.file);return F?(l.args.unshift(l.file),l.command=F,D(l)):l.file}s(a,"detectShebang");function o(l){if(!n)return l;const F=a(l),C=!i.test(F);if(l.options.forceShell||C){const E=e.test(F);l.command=u.normalize(l.command),l.command=t.command(l.command),l.args=l.args.map(g=>t.argument(g,E));const d=[l.command].concat(l.args).join(" ");l.args=["/d","/s","/c",`"${d}"`],l.command=process.env.comspec||"cmd.exe",l.options.windowsVerbatimArguments=!0}return l}s(o,"parseNonShell");function c(l,F,C){F&&!Array.isArray(F)&&(C=F,F=null),F=F?F.slice(0):[],C=Object.assign({},C);const E={command:l,args:F,options:C,file:void 0,original:{command:l,args:F}};return C.shell?E:o(E)}return s(c,"parse"),Uu=c,Uu}s(rn,"requireParse");var Wu,se;function nn(){if(se)return Wu;se=1;const u=process.platform==="win32";function D(i,e){return Object.assign(new Error(`${e} ${i.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${i.command}`,path:i.command,spawnargs:i.args})}s(D,"notFoundError");function t(i,e){if(!u)return;const a=i.emit;i.emit=function(o,c){if(o==="exit"){const l=r(c,e);if(l)return a.call(i,"error",l)}return a.apply(i,arguments)}}s(t,"hookChildProcess");function r(i,e){return u&&i===1&&!e.file?D(e.original,"spawn"):null}s(r,"verifyENOENT");function n(i,e){return u&&i===1&&!e.file?D(e.original,"spawnSync"):null}return s(n,"verifyENOENTSync"),Wu={hookChildProcess:t,verifyENOENT:r,verifyENOENTSync:n,notFoundError:D},Wu}s(nn,"requireEnoent");var ae;function on(){if(ae)return G.exports;ae=1;const u=Et,D=rn(),t=nn();function r(i,e,a){const o=D(i,e,a),c=u.spawn(o.command,o.args,o.options);return t.hookChildProcess(c,o),c}s(r,"spawn");function n(i,e,a){const o=D(i,e,a),c=u.spawnSync(o.command,o.args,o.options);return c.error=c.error||t.verifyENOENTSync(c.status,o),c}return s(n,"spawnSync"),G.exports=r,G.exports.spawn=r,G.exports.sync=n,G.exports._parse=D,G.exports._enoent=t,G.exports}s(on,"requireCrossSpawn");var sn=on(),an=L(sn);function cn(u){const D=typeof u=="string"?`
|
|
22
|
+
`:10,t=typeof u=="string"?"\r":13;return u[u.length-1]===D&&(u=u.slice(0,-1)),u[u.length-1]===t&&(u=u.slice(0,-1)),u}s(cn,"stripFinalNewline");function ce(u={}){const{env:D=process.env,platform:t=process.platform}=u;return t!=="win32"?"PATH":Object.keys(D).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}s(ce,"pathKey");const ln=s(({cwd:u=x.cwd(),path:D=x.env[ce()],preferLocal:t=!0,execPath:r=x.execPath,addExecPath:n=!0}={})=>{const i=u instanceof URL?$D(u):u,e=K.resolve(i),a=[];return t&&Fn(a,e),n&&Cn(a,r,e),[...a,D].join(K.delimiter)},"npmRunPath"),Fn=s((u,D)=>{let t;for(;t!==D;)u.push(K.join(D,"node_modules/.bin")),t=D,D=K.resolve(D,"..")},"applyPreferLocal"),Cn=s((u,D,t)=>{const r=D instanceof URL?$D(D):D;u.push(K.resolve(t,r,".."))},"applyExecPath"),En=s(({env:u=x.env,...D}={})=>{u={...u};const t=ce({env:u});return D.path=u[t],u[t]=ln(D),u},"npmRunPathEnv"),fn=s((u,D,t,r)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;const n=Object.getOwnPropertyDescriptor(u,t),i=Object.getOwnPropertyDescriptor(D,t);!dn(n,i)&&r||Object.defineProperty(u,t,i)},"copyProperty"),dn=s(function(u,D){return u===void 0||u.configurable||u.writable===D.writable&&u.enumerable===D.enumerable&&u.configurable===D.configurable&&(u.writable||u.value===D.value)},"canCopyProperty"),pn=s((u,D)=>{const t=Object.getPrototypeOf(D);t!==Object.getPrototypeOf(u)&&Object.setPrototypeOf(u,t)},"changePrototype"),mn=s((u,D)=>`/* Wrapped ${u}*/
|
|
23
|
+
${D}`,"wrappedToString"),hn=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),gn=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Bn=s((u,D,t)=>{const r=t===""?"":`with ${t.trim()}() `,n=mn.bind(null,r,D.toString());Object.defineProperty(n,"name",gn),Object.defineProperty(u,"toString",{...hn,value:n})},"changeToString");function An(u,D,{ignoreNonConfigurable:t=!1}={}){const{name:r}=u;for(const n of Reflect.ownKeys(D))fn(u,D,n,t);return pn(u,D),Bn(u,D,r),u}s(An,"mimicFunction");const au=new WeakMap,le=s((u,D={})=>{if(typeof u!="function")throw new TypeError("Expected a function");let t,r=0;const n=u.displayName||u.name||"<anonymous>",i=s(function(...e){if(au.set(i,++r),r===1)t=u.apply(this,e),u=null;else if(D.throw===!0)throw new Error(`Function \`${n}\` can only be called once`);return t},"onetime2");return An(i,u),au.set(i,r),i},"onetime");le.callCount=u=>{if(!au.has(u))throw new Error(`The given function \`${u.name}\` is not wrapped by the \`onetime\` package`);return au.get(u)};const bn=s(()=>{const u=Ce-Fe+1;return Array.from({length:u},yn)},"getRealtimeSignals"),yn=s((u,D)=>({name:`SIGRT${D+1}`,number:Fe+D,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),"getRealtimeSignal"),Fe=34,Ce=64,wn=[{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"}],Ee=s(()=>{const u=bn();return[...wn,...u].map(vn)},"getSignals"),vn=s(({name:u,number:D,description:t,action:r,forced:n=!1,standard:i})=>{const{signals:{[u]:e}}=xD,a=e!==void 0;return{name:u,number:a?e:D,description:t,supported:a,action:r,forced:n,standard:i}},"normalizeSignal"),$n=s(()=>{const u=Ee();return Object.fromEntries(u.map(xn))},"getSignalsByName"),xn=s(({name:u,number:D,description:t,supported:r,action:n,forced:i,standard:e})=>[u,{name:u,number:D,description:t,supported:r,action:n,forced:i,standard:e}],"getSignalByName"),Sn=$n(),On=s(()=>{const u=Ee(),D=Ce+1,t=Array.from({length:D},(r,n)=>In(n,u));return Object.assign({},...t)},"getSignalsByNumber"),In=s((u,D)=>{const t=Tn(u,D);if(t===void 0)return{};const{name:r,description:n,supported:i,action:e,forced:a,standard:o}=t;return{[u]:{name:r,number:u,description:n,supported:i,action:e,forced:a,standard:o}}},"getSignalByNumber"),Tn=s((u,D)=>{const t=D.find(({name:r})=>xD.signals[r]===u);return t!==void 0?t:D.find(r=>r.number===u)},"findSignalByNumber");On();const Pn=s(({timedOut:u,timeout:D,errorCode:t,signal:r,signalDescription:n,exitCode:i,isCanceled:e})=>u?`timed out after ${D} milliseconds`:e?"was canceled":t!==void 0?`failed with ${t}`:r!==void 0?`was killed with ${r} (${n})`:i!==void 0?`failed with exit code ${i}`:"failed","getErrorPrefix"),fe=s(({stdout:u,stderr:D,all:t,error:r,signal:n,exitCode:i,command:e,escapedCommand:a,timedOut:o,isCanceled:c,killed:l,parsed:{options:{timeout:F,cwd:C=x.cwd()}}})=>{i=i===null?void 0:i,n=n===null?void 0:n;const E=n===void 0?void 0:Sn[n].description,d=r&&r.code,f=`Command ${Pn({timedOut:o,timeout:F,errorCode:d,signal:n,signalDescription:E,exitCode:i,isCanceled:c})}: ${e}`,p=Object.prototype.toString.call(r)==="[object Error]",m=p?`${f}
|
|
24
|
+
${r.message}`:f,A=[m,D,u].filter(Boolean).join(`
|
|
25
|
+
`);return p?(r.originalMessage=r.message,r.message=A):r=new Error(A),r.shortMessage=m,r.command=e,r.escapedCommand=a,r.exitCode=i,r.signal=n,r.signalDescription=E,r.stdout=u,r.stderr=D,r.cwd=C,t!==void 0&&(r.all=t),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!o,r.isCanceled=c,r.killed=l&&!o,r},"makeError"),cu=["stdin","stdout","stderr"],Rn=s(u=>cu.some(D=>u[D]!==void 0),"hasAlias"),kn=s(u=>{if(!u)return;const{stdio:D}=u;if(D===void 0)return cu.map(r=>u[r]);if(Rn(u))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${cu.map(r=>`\`${r}\``).join(", ")}`);if(typeof D=="string")return D;if(!Array.isArray(D))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof D}\``);const t=Math.max(D.length,cu.length);return Array.from({length:t},(r,n)=>D[n])},"normalizeStdio");var U={exports:{}},qu={exports:{}},de;function _n(){return de||(de=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")})(qu)),qu.exports}s(_n,"requireSignals");var pe;function Nn(){if(pe)return U.exports;pe=1;var u=M.process;const D=s(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(!D(u))U.exports=function(){return function(){}};else{var t=dt,r=_n(),n=/^win/i.test(u.platform),i=pt;typeof i!="function"&&(i=i.EventEmitter);var e;u.__signal_exit_emitter__?e=u.__signal_exit_emitter__:(e=u.__signal_exit_emitter__=new i,e.count=0,e.emitted={}),e.infinite||(e.setMaxListeners(1/0),e.infinite=!0),U.exports=function(f,p){if(!D(M.process))return function(){};t.equal(typeof f,"function","a callback must be provided for exit handler"),l===!1&&F();var m="exit";p&&p.alwaysLast&&(m="afterexit");var A=s(function(){e.removeListener(m,f),e.listeners("exit").length===0&&e.listeners("afterexit").length===0&&a()},"remove");return e.on(m,f),A};var a=s(function(){!l||!D(M.process)||(l=!1,r.forEach(function(p){try{u.removeListener(p,c[p])}catch{}}),u.emit=d,u.reallyExit=C,e.count-=1)},"unload2");U.exports.unload=a;var o=s(function(p,m,A){e.emitted[p]||(e.emitted[p]=!0,e.emit(p,m,A))},"emit2"),c={};r.forEach(function(f){c[f]=s(function(){if(D(M.process)){var m=u.listeners(f);m.length===e.count&&(a(),o("exit",null,f),o("afterexit",null,f),n&&f==="SIGHUP"&&(f="SIGINT"),u.kill(u.pid,f))}},"listener")}),U.exports.signals=function(){return r};var l=!1,F=s(function(){l||!D(M.process)||(l=!0,e.count+=1,r=r.filter(function(p){try{return u.on(p,c[p]),!0}catch{return!1}}),u.emit=g,u.reallyExit=E)},"load2");U.exports.load=F;var C=u.reallyExit,E=s(function(p){D(M.process)&&(u.exitCode=p||0,o("exit",u.exitCode,null),o("afterexit",u.exitCode,null),C.call(u,u.exitCode))},"processReallyExit2"),d=u.emit,g=s(function(p,m){if(p==="exit"&&D(M.process)){m!==void 0&&(u.exitCode=m);var A=d.apply(this,arguments);return o("exit",u.exitCode,null),o("afterexit",u.exitCode,null),A}else return d.apply(this,arguments)},"processEmit2")}return U.exports}s(Nn,"requireSignalExit");var Mn=Nn(),jn=L(Mn);const Ln=1e3*5,Gn=s((u,D="SIGTERM",t={})=>{const r=u(D);return Un(u,D,t,r),r},"spawnedKill"),Un=s((u,D,t,r)=>{if(!Wn(D,t,r))return;const n=Kn(t),i=setTimeout(()=>{u("SIGKILL")},n);i.unref&&i.unref()},"setKillTimeout"),Wn=s((u,{forceKillAfterTimeout:D},t)=>qn(u)&&D!==!1&&t,"shouldForceKill"),qn=s(u=>u===ft.constants.signals.SIGTERM||typeof u=="string"&&u.toUpperCase()==="SIGTERM","isSigterm"),Kn=s(({forceKillAfterTimeout:u=!0})=>{if(u===!0)return Ln;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"),Yn=s((u,D)=>{u.kill()&&(D.isCanceled=!0)},"spawnedCancel"),zn=s((u,D,t)=>{u.kill(D),t(Object.assign(new Error("Timed out"),{timedOut:!0,signal:D}))},"timeoutKill"),Hn=s((u,{timeout:D,killSignal:t="SIGTERM"},r)=>{if(D===0||D===void 0)return r;let n;const i=new Promise((a,o)=>{n=setTimeout(()=>{zn(u,t,o)},D)}),e=r.finally(()=>{clearTimeout(n)});return Promise.race([i,e])},"setupTimeout"),Vn=s(({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"),Zn=s(async(u,{cleanup:D,detached:t},r)=>{if(!D||t)return r;const n=jn(()=>{u.kill()});return r.finally(()=>{n()})},"setExitHandler");function me(u){return u!==null&&typeof u=="object"&&typeof u.pipe=="function"}s(me,"isStream");function he(u){return me(u)&&u.writable!==!1&&typeof u._write=="function"&&typeof u._writableState=="object"}s(he,"isWritableStream");const Jn=s(u=>u instanceof Ct&&typeof u.then=="function","isExecaChildProcess"),Ku=s((u,D,t)=>{if(typeof t=="string")return u[D].pipe(mt(t)),u;if(he(t))return u[D].pipe(t),u;if(!Jn(t))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!he(t.stdin))throw new TypeError("The target child process's stdin must be available.");return u[D].pipe(t.stdin),t},"pipeToTarget"),Xn=s(u=>{u.stdout!==null&&(u.pipeStdout=Ku.bind(void 0,u,"stdout")),u.stderr!==null&&(u.pipeStderr=Ku.bind(void 0,u,"stderr")),u.all!==void 0&&(u.pipeAll=Ku.bind(void 0,u,"all"))},"addPipeMethods");var Y={exports:{}},Yu,ge;function Qn(){if(ge)return Yu;ge=1;const{PassThrough:u}=yu;return Yu=s(D=>{D={...D};const{array:t}=D;let{encoding:r}=D;const n=r==="buffer";let i=!1;t?i=!(r||n):r=r||"utf8",n&&(r=null);const e=new u({objectMode:i});r&&e.setEncoding(r);let a=0;const o=[];return e.on("data",c=>{o.push(c),i?a=o.length:a+=c.length}),e.getBufferedValue=()=>t?o:n?Buffer.concat(o,a):o.join(""),e.getBufferedLength=()=>a,e},"bufferStream"),Yu}s(Qn,"requireBufferStream");var Be;function ui(){if(Be)return Y.exports;Be=1;const{constants:u}=gt,D=yu,{promisify:t}=Bt,r=Qn(),n=t(D.pipeline),a=class a extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};s(a,"MaxBufferError");let i=a;async function e(o,c){if(!o)throw new Error("Expected a stream");c={maxBuffer:1/0,...c};const{maxBuffer:l}=c,F=r(c);return await new Promise((C,E)=>{const d=s(g=>{g&&F.getBufferedLength()<=u.MAX_LENGTH&&(g.bufferedData=F.getBufferedValue()),E(g)},"rejectPromise");(async()=>{try{await n(o,F),C()}catch(g){d(g)}})(),F.on("data",()=>{F.getBufferedLength()>l&&d(new i)})}),F.getBufferedValue()}return s(e,"getStream"),Y.exports=e,Y.exports.buffer=(o,c)=>e(o,{...c,encoding:"buffer"}),Y.exports.array=(o,c)=>e(o,{...c,array:!0}),Y.exports.MaxBufferError=i,Y.exports}s(ui,"requireGetStream");var Di=ui(),Ae=L(Di),zu,be;function ei(){if(be)return zu;be=1;const{PassThrough:u}=yu;return zu=s(function(){var D=[],t=new u({objectMode:!0});return t.setMaxListeners(0),t.add=r,t.isEmpty=n,t.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(r),t;function r(e){return Array.isArray(e)?(e.forEach(r),this):(D.push(e),e.once("end",i.bind(null,e)),e.once("error",t.emit.bind(t,"error")),e.pipe(t,{end:!1}),this)}s(r,"add");function n(){return D.length==0}s(n,"isEmpty");function i(e){D=D.filter(function(a){return a!==e}),!D.length&&t.readable&&t.end()}s(i,"remove")},"mergeStream$1"),zu}s(ei,"requireMergeStream");var ti=ei(),ri=L(ti);const ni=s(u=>{if(u!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},"validateInputOptions"),ii=s(({input:u,inputFile:D})=>typeof D!="string"?u:(ni(u),ht(D)),"getInput"),oi=s((u,D)=>{const t=ii(D);t!==void 0&&(me(t)?t.pipe(u.stdin):u.stdin.end(t))},"handleInput"),si=s((u,{all:D})=>{if(!D||!u.stdout&&!u.stderr)return;const t=ri();return u.stdout&&t.add(u.stdout),u.stderr&&t.add(u.stderr),t},"makeAllStream"),Hu=s(async(u,D)=>{if(!(!u||D===void 0)){u.destroy();try{return await D}catch(t){return t.bufferedData}}},"getBufferedData"),Vu=s((u,{encoding:D,buffer:t,maxBuffer:r})=>{if(!(!u||!t))return D?Ae(u,{encoding:D,maxBuffer:r}):Ae.buffer(u,{maxBuffer:r})},"getStreamPromise"),ai=s(async({stdout:u,stderr:D,all:t},{encoding:r,buffer:n,maxBuffer:i},e)=>{const a=Vu(u,{encoding:r,buffer:n,maxBuffer:i}),o=Vu(D,{encoding:r,buffer:n,maxBuffer:i}),c=Vu(t,{encoding:r,buffer:n,maxBuffer:i*2});try{return await Promise.all([e,a,o,c])}catch(l){return Promise.all([{error:l,signal:l.signal,timedOut:l.timedOut},Hu(u,a),Hu(D,o),Hu(t,c)])}},"getSpawnedResult"),ci=(async()=>{})().constructor.prototype,li=["then","catch","finally"].map(u=>[u,Reflect.getOwnPropertyDescriptor(ci,u)]),ye=s((u,D)=>{for(const[t,r]of li){const n=typeof D=="function"?(...i)=>Reflect.apply(r.value,D(),i):r.value.bind(D);Reflect.defineProperty(u,t,{...r,value:n})}},"mergePromise"),Fi=s(u=>new Promise((D,t)=>{u.on("exit",(r,n)=>{D({exitCode:r,signal:n})}),u.on("error",r=>{t(r)}),u.stdin&&u.stdin.on("error",r=>{t(r)})}),"getSpawnedPromise"),we=s((u,D=[])=>Array.isArray(D)?[u,...D]:[u],"normalizeArgs"),Ci=/^[\w.-]+$/,Ei=/"/g,fi=s(u=>typeof u!="string"||Ci.test(u)?u:`"${u.replace(Ei,'\\"')}"`,"escapeArg"),di=s((u,D)=>we(u,D).join(" "),"joinCommand"),pi=s((u,D)=>we(u,D).map(t=>fi(t)).join(" "),"getEscapedCommand"),mi=At("execa").enabled,lu=s((u,D)=>String(u).padStart(D,"0"),"padField"),hi=s(()=>{const u=new Date;return`${lu(u.getHours(),2)}:${lu(u.getMinutes(),2)}:${lu(u.getSeconds(),2)}.${lu(u.getMilliseconds(),3)}`},"getTimestamp"),gi=s((u,{verbose:D})=>{D&&x.stderr.write(`[${hi()}] ${u}
|
|
26
|
+
`)},"logCommand"),Bi=1e3*1e3*100,Ai=s(({env:u,extendEnv:D,preferLocal:t,localDir:r,execPath:n})=>{const i=D?{...x.env,...u}:u;return t?En({env:i,cwd:r,execPath:n}):i},"getEnv"),bi=s((u,D,t={})=>{const r=an._parse(u,D,t);return u=r.command,D=r.args,t=r.options,t={maxBuffer:Bi,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:t.cwd||x.cwd(),execPath:x.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:mi,...t},t.env=Ai(t),t.stdio=kn(t),x.platform==="win32"&&K.basename(u,".exe")==="cmd"&&D.unshift("/q"),{file:u,args:D,options:t,parsed:r}},"handleArguments"),Zu=s((u,D,t)=>typeof D!="string"&&!Ft.isBuffer(D)?t===void 0?void 0:"":u.stripFinalNewline?cn(D):D,"handleOutput");function z(u,D,t){const r=bi(u,D,t),n=di(u,D),i=pi(u,D);gi(i,r.options),Vn(r.options);let e;try{e=yD.spawn(r.file,r.args,r.options)}catch(E){const d=new yD.ChildProcess,g=Promise.reject(fe({error:E,stdout:"",stderr:"",all:"",command:n,escapedCommand:i,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return ye(d,g),d}const a=Fi(e),o=Hn(e,r.options,a),c=Zn(e,r.options,o),l={isCanceled:!1};e.kill=Gn.bind(null,e.kill.bind(e)),e.cancel=Yn.bind(null,e,l);const C=le(s(async()=>{const[{error:E,exitCode:d,signal:g,timedOut:f},p,m,A]=await ai(e,r.options,c),h=Zu(r.options,p),b=Zu(r.options,m),$=Zu(r.options,A);if(E||d!==0||g!==null){const P=fe({error:E,exitCode:d,signal:g,stdout:h,stderr:b,all:$,command:n,escapedCommand:i,parsed:r,timedOut:f,isCanceled:l.isCanceled||(r.options.signal?r.options.signal.aborted:!1),killed:e.killed});if(!r.options.reject)return P;throw P}return{command:n,escapedCommand:i,exitCode:0,stdout:h,stderr:b,all:$,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}},"handlePromise"));return oi(e,r.options),e.all=si(e,r.options),Xn(e),ye(e,C),e}s(z,"execa");let W=!0;const H=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let X=0;if(H.process&&H.process.env&&H.process.stdout){const{FORCE_COLOR:u,NODE_DISABLE_COLORS:D,NO_COLOR:t,TERM:r,COLORTERM:n}=H.process.env;D||t||u==="0"?W=!1:u==="1"||u==="2"||u==="3"?W=!0:r==="dumb"?W=!1:"CI"in H.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(i=>i in H.process.env)?W=!0:W=process.stdout.isTTY,W&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?X=3:r&&(r.endsWith("-256color")||r.endsWith("256"))?X=2:X=1)}let ve={enabled:W,supportLevel:X};function Q(u,D,t=1){const r=`\x1B[${u}m`,n=`\x1B[${D}m`,i=new RegExp(`\\x1b\\[${D}m`,"g");return e=>ve.enabled&&ve.supportLevel>=t?r+(""+e).replace(i,r)+n:""+e}s(Q,"kolorist");const Ju=Q(2,22),$e=Q(30,39),Fu=Q(31,39),uu=Q(32,39),xe=Q(46,49);var Xu,Se;function yi(){if(Se)return Xu;Se=1;const u="\x1B",D=`${u}[`,t="\x07",r={to(e,a){return a?`${D}${a+1};${e+1}H`:`${D}${e+1}G`},move(e,a){let o="";return e<0?o+=`${D}${-e}D`:e>0&&(o+=`${D}${e}C`),a<0?o+=`${D}${-a}A`:a>0&&(o+=`${D}${a}B`),o},up:s((e=1)=>`${D}${e}A`,"up"),down:s((e=1)=>`${D}${e}B`,"down"),forward:s((e=1)=>`${D}${e}C`,"forward"),backward:s((e=1)=>`${D}${e}D`,"backward"),nextLine:s((e=1)=>`${D}E`.repeat(e),"nextLine"),prevLine:s((e=1)=>`${D}F`.repeat(e),"prevLine"),left:`${D}G`,hide:`${D}?25l`,show:`${D}?25h`,save:`${u}7`,restore:`${u}8`},n={up:s((e=1)=>`${D}S`.repeat(e),"up"),down:s((e=1)=>`${D}T`.repeat(e),"down")},i={screen:`${D}2J`,up:s((e=1)=>`${D}1J`.repeat(e),"up"),down:s((e=1)=>`${D}J`.repeat(e),"down"),line:`${D}2K`,lineEnd:`${D}K`,lineStart:`${D}1K`,lines(e){let a="";for(let o=0;o<e;o++)a+=this.line+(o<e-1?r.up():"");return e&&(a+=r.left),a}};return Xu={cursor:r,scroll:n,erase:i,beep:t},Xu}s(yi,"requireSrc");var S=yi(),Cu={exports:{}},Oe;function wi(){if(Oe)return Cu.exports;Oe=1;let u=process||{},D=u.argv||[],t=u.env||{},r=!(t.NO_COLOR||D.includes("--no-color"))&&(!!t.FORCE_COLOR||D.includes("--color")||u.platform==="win32"||(u.stdout||{}).isTTY&&t.TERM!=="dumb"||!!t.CI),n=s((a,o,c=a)=>l=>{let F=""+l,C=F.indexOf(o,a.length);return~C?a+i(F,o,c,C)+o:a+F+o},"formatter"),i=s((a,o,c,l)=>{let F="",C=0;do F+=a.substring(C,l)+c,C=l+o.length,l=a.indexOf(o,C);while(~l);return F+a.substring(C)},"replaceClose"),e=s((a=r)=>{let o=a?n:()=>String;return{isColorSupported:a,reset:o("\x1B[0m","\x1B[0m"),bold:o("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:o("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:o("\x1B[3m","\x1B[23m"),underline:o("\x1B[4m","\x1B[24m"),inverse:o("\x1B[7m","\x1B[27m"),hidden:o("\x1B[8m","\x1B[28m"),strikethrough:o("\x1B[9m","\x1B[29m"),black:o("\x1B[30m","\x1B[39m"),red:o("\x1B[31m","\x1B[39m"),green:o("\x1B[32m","\x1B[39m"),yellow:o("\x1B[33m","\x1B[39m"),blue:o("\x1B[34m","\x1B[39m"),magenta:o("\x1B[35m","\x1B[39m"),cyan:o("\x1B[36m","\x1B[39m"),white:o("\x1B[37m","\x1B[39m"),gray:o("\x1B[90m","\x1B[39m"),bgBlack:o("\x1B[40m","\x1B[49m"),bgRed:o("\x1B[41m","\x1B[49m"),bgGreen:o("\x1B[42m","\x1B[49m"),bgYellow:o("\x1B[43m","\x1B[49m"),bgBlue:o("\x1B[44m","\x1B[49m"),bgMagenta:o("\x1B[45m","\x1B[49m"),bgCyan:o("\x1B[46m","\x1B[49m"),bgWhite:o("\x1B[47m","\x1B[49m"),blackBright:o("\x1B[90m","\x1B[39m"),redBright:o("\x1B[91m","\x1B[39m"),greenBright:o("\x1B[92m","\x1B[39m"),yellowBright:o("\x1B[93m","\x1B[39m"),blueBright:o("\x1B[94m","\x1B[39m"),magentaBright:o("\x1B[95m","\x1B[39m"),cyanBright:o("\x1B[96m","\x1B[39m"),whiteBright:o("\x1B[97m","\x1B[39m"),bgBlackBright:o("\x1B[100m","\x1B[49m"),bgRedBright:o("\x1B[101m","\x1B[49m"),bgGreenBright:o("\x1B[102m","\x1B[49m"),bgYellowBright:o("\x1B[103m","\x1B[49m"),bgBlueBright:o("\x1B[104m","\x1B[49m"),bgMagentaBright:o("\x1B[105m","\x1B[49m"),bgCyanBright:o("\x1B[106m","\x1B[49m"),bgWhiteBright:o("\x1B[107m","\x1B[49m")}},"createColors");return Cu.exports=e(),Cu.exports.createColors=e,Cu.exports}s(wi,"requirePicocolors");var vi=wi(),B=L(vi);function $i({onlyFirst:u=!1}={}){const D=["[\\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(D,u?void 0:"g")}s($i,"DD");const xi=$i();function Ie(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(xi,"")}s(Ie,"P$1");function Te(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}s(Te,"L$1");var Pe={exports:{}};(function(u){var D={};u.exports=D,D.eastAsianWidth=function(r){var n=r.charCodeAt(0),i=r.length==2?r.charCodeAt(1):0,e=n;return 55296<=n&&n<=56319&&56320<=i&&i<=57343&&(n&=1023,i&=1023,e=n<<10|i,e+=65536),e==12288||65281<=e&&e<=65376||65504<=e&&e<=65510?"F":e==8361||65377<=e&&e<=65470||65474<=e&&e<=65479||65482<=e&&e<=65487||65490<=e&&e<=65495||65498<=e&&e<=65500||65512<=e&&e<=65518?"H":4352<=e&&e<=4447||4515<=e&&e<=4519||4602<=e&&e<=4607||9001<=e&&e<=9002||11904<=e&&e<=11929||11931<=e&&e<=12019||12032<=e&&e<=12245||12272<=e&&e<=12283||12289<=e&&e<=12350||12353<=e&&e<=12438||12441<=e&&e<=12543||12549<=e&&e<=12589||12593<=e&&e<=12686||12688<=e&&e<=12730||12736<=e&&e<=12771||12784<=e&&e<=12830||12832<=e&&e<=12871||12880<=e&&e<=13054||13056<=e&&e<=19903||19968<=e&&e<=42124||42128<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||55216<=e&&e<=55238||55243<=e&&e<=55291||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65106||65108<=e&&e<=65126||65128<=e&&e<=65131||110592<=e&&e<=110593||127488<=e&&e<=127490||127504<=e&&e<=127546||127552<=e&&e<=127560||127568<=e&&e<=127569||131072<=e&&e<=194367||177984<=e&&e<=196605||196608<=e&&e<=262141?"W":32<=e&&e<=126||162<=e&&e<=163||165<=e&&e<=166||e==172||e==175||10214<=e&&e<=10221||10629<=e&&e<=10630?"Na":e==161||e==164||167<=e&&e<=168||e==170||173<=e&&e<=174||176<=e&&e<=180||182<=e&&e<=186||188<=e&&e<=191||e==198||e==208||215<=e&&e<=216||222<=e&&e<=225||e==230||232<=e&&e<=234||236<=e&&e<=237||e==240||242<=e&&e<=243||247<=e&&e<=250||e==252||e==254||e==257||e==273||e==275||e==283||294<=e&&e<=295||e==299||305<=e&&e<=307||e==312||319<=e&&e<=322||e==324||328<=e&&e<=331||e==333||338<=e&&e<=339||358<=e&&e<=359||e==363||e==462||e==464||e==466||e==468||e==470||e==472||e==474||e==476||e==593||e==609||e==708||e==711||713<=e&&e<=715||e==717||e==720||728<=e&&e<=731||e==733||e==735||768<=e&&e<=879||913<=e&&e<=929||931<=e&&e<=937||945<=e&&e<=961||963<=e&&e<=969||e==1025||1040<=e&&e<=1103||e==1105||e==8208||8211<=e&&e<=8214||8216<=e&&e<=8217||8220<=e&&e<=8221||8224<=e&&e<=8226||8228<=e&&e<=8231||e==8240||8242<=e&&e<=8243||e==8245||e==8251||e==8254||e==8308||e==8319||8321<=e&&e<=8324||e==8364||e==8451||e==8453||e==8457||e==8467||e==8470||8481<=e&&e<=8482||e==8486||e==8491||8531<=e&&e<=8532||8539<=e&&e<=8542||8544<=e&&e<=8555||8560<=e&&e<=8569||e==8585||8592<=e&&e<=8601||8632<=e&&e<=8633||e==8658||e==8660||e==8679||e==8704||8706<=e&&e<=8707||8711<=e&&e<=8712||e==8715||e==8719||e==8721||e==8725||e==8730||8733<=e&&e<=8736||e==8739||e==8741||8743<=e&&e<=8748||e==8750||8756<=e&&e<=8759||8764<=e&&e<=8765||e==8776||e==8780||e==8786||8800<=e&&e<=8801||8804<=e&&e<=8807||8810<=e&&e<=8811||8814<=e&&e<=8815||8834<=e&&e<=8835||8838<=e&&e<=8839||e==8853||e==8857||e==8869||e==8895||e==8978||9312<=e&&e<=9449||9451<=e&&e<=9547||9552<=e&&e<=9587||9600<=e&&e<=9615||9618<=e&&e<=9621||9632<=e&&e<=9633||9635<=e&&e<=9641||9650<=e&&e<=9651||9654<=e&&e<=9655||9660<=e&&e<=9661||9664<=e&&e<=9665||9670<=e&&e<=9672||e==9675||9678<=e&&e<=9681||9698<=e&&e<=9701||e==9711||9733<=e&&e<=9734||e==9737||9742<=e&&e<=9743||9748<=e&&e<=9749||e==9756||e==9758||e==9792||e==9794||9824<=e&&e<=9825||9827<=e&&e<=9829||9831<=e&&e<=9834||9836<=e&&e<=9837||e==9839||9886<=e&&e<=9887||9918<=e&&e<=9919||9924<=e&&e<=9933||9935<=e&&e<=9953||e==9955||9960<=e&&e<=9983||e==10045||e==10071||10102<=e&&e<=10111||11093<=e&&e<=11097||12872<=e&&e<=12879||57344<=e&&e<=63743||65024<=e&&e<=65039||e==65533||127232<=e&&e<=127242||127248<=e&&e<=127277||127280<=e&&e<=127337||127344<=e&&e<=127386||917760<=e&&e<=917999||983040<=e&&e<=1048573||1048576<=e&&e<=1114109?"A":"N"},D.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)||[]}s(t,"t"),D.length=function(r){for(var n=t(r),i=0,e=0;e<n.length;e++)i=i+this.characterLength(n[e]);return i},D.slice=function(r,n,i){textLen=D.length(r),n=n||0,i=i||1,n<0&&(n=textLen+n),i<0&&(i=textLen+i);for(var e="",a=0,o=t(r),c=0;c<o.length;c++){var l=o[c],F=D.length(l);if(a>=n-(F==2?1:0))if(a+F<=i)e+=l;else break;a+=F}return e}})(Pe);var Si=Pe.exports;const Oi=Te(Si);var Ii=s(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 Ti=Te(Ii);function Du(u,D={}){if(typeof u!="string"||u.length===0||(D={ambiguousIsNarrow:!0,...D},u=Ie(u),u.length===0))return 0;u=u.replace(Ti()," ");const t=D.ambiguousIsNarrow?1:2;let r=0;for(const n of u){const i=n.codePointAt(0);if(!(i<=31||i>=127&&i<=159||i>=768&&i<=879))switch(Oi.eastAsianWidth(n)){case"F":case"W":r+=2;break;case"A":r+=t;break;default:r+=1}}return r}s(Du,"p");const Qu=10,Re=s((u=0)=>D=>`\x1B[${D+u}m`,"N"),ke=s((u=0)=>D=>`\x1B[${38+u};5;${D}m`,"I"),_e=s((u=0)=>(D,t,r)=>`\x1B[${38+u};2;${D};${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 Pi=Object.keys(w.color),Ri=Object.keys(w.bgColor);[...Pi,...Ri];function ki(){const u=new Map;for(const[D,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,D,{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=Re(),w.color.ansi256=ke(),w.color.ansi16m=_e(),w.bgColor.ansi=Re(Qu),w.bgColor.ansi256=ke(Qu),w.bgColor.ansi16m=_e(Qu),Object.defineProperties(w,{rgbToAnsi256:{value:s((D,t,r)=>D===t&&t===r?D<8?16:D>248?231:Math.round((D-8)/247*24)+232:16+36*Math.round(D/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),"value"),enumerable:!1},hexToRgb:{value:s(D=>{const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(D.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(i=>i+i).join(""));const n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},"value"),enumerable:!1},hexToAnsi256:{value:s(D=>w.rgbToAnsi256(...w.hexToRgb(D)),"value"),enumerable:!1},ansi256ToAnsi:{value:s(D=>{if(D<8)return 30+D;if(D<16)return 90+(D-8);let t,r,n;if(D>=232)t=((D-232)*10+8)/255,r=t,n=t;else{D-=16;const a=D%36;t=Math.floor(D/36)/5,r=Math.floor(a/6)/5,n=a%6/5}const i=Math.max(t,r,n)*2;if(i===0)return 30;let e=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return i===2&&(e+=60),e},"value"),enumerable:!1},rgbToAnsi:{value:s((D,t,r)=>w.ansi256ToAnsi(w.rgbToAnsi256(D,t,r)),"value"),enumerable:!1},hexToAnsi:{value:s(D=>w.ansi256ToAnsi(w.hexToAnsi256(D)),"value"),enumerable:!1}}),w}s(ki,"rD");const _i=ki(),Eu=new Set(["\x1B","\x9B"]),Ni=39,uD="\x07",Ne="[",Mi="]",Me="m",DD=`${Mi}8;;`,je=s(u=>`${Eu.values().next().value}${Ne}${u}${Me}`,"z"),Le=s(u=>`${Eu.values().next().value}${DD}${u}${uD}`,"K"),ji=s(u=>u.split(" ").map(D=>Du(D)),"aD"),eD=s((u,D,t)=>{const r=[...D];let n=!1,i=!1,e=Du(Ie(u[u.length-1]));for(const[a,o]of r.entries()){const c=Du(o);if(e+c<=t?u[u.length-1]+=o:(u.push(o),e=0),Eu.has(o)&&(n=!0,i=r.slice(a+1).join("").startsWith(DD)),n){i?o===uD&&(n=!1,i=!1):o===Me&&(n=!1);continue}e+=c,e===t&&a<r.length-1&&(u.push(""),e=0)}!e&&u[u.length-1].length>0&&u.length>1&&(u[u.length-2]+=u.pop())},"k$1"),Li=s(u=>{const D=u.split(" ");let t=D.length;for(;t>0&&!(Du(D[t-1])>0);)t--;return t===D.length?u:D.slice(0,t).join(" ")+D.slice(t).join("")},"hD"),Gi=s((u,D,t={})=>{if(t.trim!==!1&&u.trim()==="")return"";let r="",n,i;const e=ji(u);let a=[""];for(const[c,l]of u.split(" ").entries()){t.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let F=Du(a[a.length-1]);if(c!==0&&(F>=D&&(t.wordWrap===!1||t.trim===!1)&&(a.push(""),F=0),(F>0||t.trim===!1)&&(a[a.length-1]+=" ",F++)),t.hard&&e[c]>D){const C=D-F,E=1+Math.floor((e[c]-C-1)/D);Math.floor((e[c]-1)/D)<E&&a.push(""),eD(a,l,D);continue}if(F+e[c]>D&&F>0&&e[c]>0){if(t.wordWrap===!1&&F<D){eD(a,l,D);continue}a.push("")}if(F+e[c]>D&&t.wordWrap===!1){eD(a,l,D);continue}a[a.length-1]+=l}t.trim!==!1&&(a=a.map(c=>Li(c)));const o=[...a.join(`
|
|
27
|
+
`)];for(const[c,l]of o.entries()){if(r+=l,Eu.has(l)){const{groups:C}=new RegExp(`(?:\\${Ne}(?<code>\\d+)m|\\${DD}(?<uri>.*)${uD})`).exec(o.slice(c).join(""))||{groups:{}};if(C.code!==void 0){const E=Number.parseFloat(C.code);n=E===Ni?void 0:E}else C.uri!==void 0&&(i=C.uri.length===0?void 0:C.uri)}const F=_i.codes.get(Number(n));o[c+1]===`
|
|
28
|
+
`?(i&&(r+=Le("")),n&&F&&(r+=je(F))):l===`
|
|
29
|
+
`&&(n&&F&&(r+=je(n)),i&&(r+=Le(i)))}return r},"lD");function Ge(u,D,t){return String(u).normalize().replace(/\r\n/g,`
|
|
30
|
+
`).split(`
|
|
31
|
+
`).map(r=>Gi(r,D,t)).join(`
|
|
32
|
+
`)}s(Ge,"Y$1");const Ui=["up","down","left","right","space","enter","cancel"],fu={actions:new Set(Ui),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function tD(u,D){if(typeof u=="string")return fu.aliases.get(u)===D;for(const t of u)if(t!==void 0&&tD(t,D))return!0;return!1}s(tD,"$");function Wi(u,D){if(u===D)return;const t=u.split(`
|
|
33
|
+
`),r=D.split(`
|
|
34
|
+
`),n=[];for(let i=0;i<Math.max(t.length,r.length);i++)t[i]!==r[i]&&n.push(i);return n}s(Wi,"BD");const qi=globalThis.process.platform.startsWith("win"),rD=Symbol("clack:cancel");function Ue(u){return u===rD}s(Ue,"pD");function du(u,D){const t=u;t.isTTY&&t.setRawMode(D)}s(du,"m");function Ki({input:u=vD,output:D=wD,overwrite:t=!0,hideCursor:r=!0}={}){const n=eu.createInterface({input:u,output:D,prompt:"",tabSize:1});eu.emitKeypressEvents(u,n),u.isTTY&&u.setRawMode(!0);const i=s((e,{name:a,sequence:o})=>{const c=String(e);if(tD([c,a,o],"cancel")){r&&D.write(S.cursor.show),process.exit(0);return}if(!t)return;const l=a==="return"?0:-1,F=a==="return"?-1:0;eu.moveCursor(D,l,F,()=>{eu.clearLine(D,1,()=>{u.once("keypress",i)})})},"i");return r&&D.write(S.cursor.hide),u.once("keypress",i),()=>{u.off("keypress",i),r&&D.write(S.cursor.show),u.isTTY&&!qi&&u.setRawMode(!1),n.terminal=!1,n.close()}}s(Ki,"fD");var Yi=Object.defineProperty,zi=s((u,D,t)=>D in u?Yi(u,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[D]=t,"vD"),R=s((u,D,t)=>(zi(u,typeof D!="symbol"?D+"":D,t),t),"h");const gD=class gD{constructor(D,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=vD,output:n=wD,render:i,signal:e,...a}=D;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=t,this._abortSignal=e,this.input=r,this.output=n}unsubscribe(){this._subscribers.clear()}setSubscriber(D,t){const r=this._subscribers.get(D)??[];r.push(t),this._subscribers.set(D,r)}on(D,t){this.setSubscriber(D,{cb:t})}once(D,t){this.setSubscriber(D,{cb:t,once:!0})}emit(D,...t){const r=this._subscribers.get(D)??[],n=[];for(const i of r)i.cb(...t),i.once&&n.push(()=>r.splice(r.indexOf(i),1));for(const i of n)i()}prompt(){return new Promise((D,t)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),D(rD);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}const r=new bt;r._write=(n,i,e)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),e()},this.input.pipe(r),this.rl=SD.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),SD.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),du(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(S.cursor.show),this.output.off("resize",this.render),du(this.input,!1),D(this.value)}),this.once("cancel",()=>{this.output.write(S.cursor.show),this.output.off("resize",this.render),du(this.input,!1),D(rD)})})}onKeypress(D,t){if(this.state==="error"&&(this.state="active"),t?.name&&(!this._track&&fu.aliases.has(t.name)&&this.emit("cursor",fu.aliases.get(t.name)),fu.actions.has(t.name)&&this.emit("cursor",t.name)),D&&(D.toLowerCase()==="y"||D.toLowerCase()==="n")&&this.emit("confirm",D.toLowerCase()==="y"),D===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),D&&this.emit("key",D.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")}tD([D,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(`
|
|
35
|
+
`),du(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const D=Ge(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
36
|
+
`).length-1;this.output.write(S.cursor.move(-999,D*-1))}render(){const D=Ge(this._render(this)??"",process.stdout.columns,{hard:!0});if(D!==this._prevFrame){if(this.state==="initial")this.output.write(S.cursor.hide);else{const t=Wi(this._prevFrame,D);if(this.restoreCursor(),t&&t?.length===1){const r=t[0];this.output.write(S.cursor.move(0,r)),this.output.write(S.erase.lines(1));const n=D.split(`
|
|
37
|
+
`);this.output.write(n[r]),this._prevFrame=D,this.output.write(S.cursor.move(0,n.length-r-1));return}if(t&&t?.length>1){const r=t[0];this.output.write(S.cursor.move(0,r)),this.output.write(S.erase.down());const n=D.split(`
|
|
38
|
+
`).slice(r);this.output.write(n.join(`
|
|
39
|
+
`)),this._prevFrame=D;return}this.output.write(S.erase.down())}this.output.write(D),this.state==="initial"&&(this.state="active"),this._prevFrame=D}}};s(gD,"x");let pu=gD;const BD=class BD extends pu{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(D){super(D,!1),this.value=!!D.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",t=>{this.output.write(S.cursor.move(0,-1)),this.value=t,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};s(BD,"dD");let nD=BD;var Hi=Object.defineProperty,Vi=s((u,D,t)=>D in u?Hi(u,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[D]=t,"PD"),We=s((u,D,t)=>(Vi(u,typeof D!="symbol"?D+"":D,t),t),"J");const AD=class AD extends pu{constructor(D){super(D,!1),We(this,"options"),We(this,"cursor",0),this.options=D.options,this.cursor=this.options.findIndex(({value:t})=>t===D.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}};s(AD,"LD");let iD=AD;function Zi(){return x.platform!=="win32"?x.env.TERM!=="linux":!!x.env.CI||!!x.env.WT_SESSION||!!x.env.TERMINUS_SUBLIME||x.env.ConEmuTask==="{cmd::Cmder}"||x.env.TERM_PROGRAM==="Terminus-Sublime"||x.env.TERM_PROGRAM==="vscode"||x.env.TERM==="xterm-256color"||x.env.TERM==="alacritty"||x.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}s(Zi,"ce");const oD=Zi(),_=s((u,D)=>oD?u:D,"u"),Ji=_("\u25C6","*"),qe=_("\u25A0","x"),Ke=_("\u25B2","x"),Ye=_("\u25C7","o"),Xi=_("\u250C","T"),T=_("\u2502","|"),sD=_("\u2514","\u2014"),aD=_("\u25CF",">"),cD=_("\u25CB"," "),ze=s(u=>{switch(u){case"initial":case"active":return B.cyan(Ji);case"cancel":return B.red(qe);case"error":return B.yellow(Ke);case"submit":return B.green(Ye)}},"b"),Qi=s(u=>{const{cursor:D,options:t,style:r}=u,n=u.maxItems??Number.POSITIVE_INFINITY,i=Math.max(process.stdout.rows-4,0),e=Math.min(i,Math.max(n,5));let a=0;D>=a+e-3?a=Math.max(Math.min(D-e+3,t.length-e),0):D<a+2&&(a=Math.max(D-2,0));const o=e<t.length&&a>0,c=e<t.length&&a+e<t.length;return t.slice(a,a+e).map((l,F,C)=>{const E=F===0&&o,d=F===C.length-1&&c;return E||d?B.dim("..."):r(l,F+a===D)})},"G"),uo=s(u=>{const D=u.active??"Yes",t=u.inactive??"No";return new nD({active:D,inactive:t,initialValue:u.initialValue??!0,render(){const r=`${B.gray(T)}
|
|
40
|
+
${ze(this.state)} ${u.message}
|
|
41
|
+
`,n=this.value?D:t;switch(this.state){case"submit":return`${r}${B.gray(T)} ${B.dim(n)}`;case"cancel":return`${r}${B.gray(T)} ${B.strikethrough(B.dim(n))}
|
|
42
|
+
${B.gray(T)}`;default:return`${r}${B.cyan(T)} ${this.value?`${B.green(aD)} ${D}`:`${B.dim(cD)} ${B.dim(D)}`} ${B.dim("/")} ${this.value?`${B.dim(cD)} ${B.dim(t)}`:`${B.green(aD)} ${t}`}
|
|
43
|
+
${B.cyan(sD)}
|
|
44
|
+
`}}}).prompt()},"ye"),Do=s(u=>{const D=s((t,r)=>{const n=t.label??String(t.value);switch(r){case"selected":return`${B.dim(n)}`;case"active":return`${B.green(aD)} ${n} ${t.hint?B.dim(`(${t.hint})`):""}`;case"cancelled":return`${B.strikethrough(B.dim(n))}`;default:return`${B.dim(cD)} ${B.dim(n)}`}},"n");return new iD({options:u.options,initialValue:u.initialValue,render(){const t=`${B.gray(T)}
|
|
45
|
+
${ze(this.state)} ${u.message}
|
|
46
|
+
`;switch(this.state){case"submit":return`${t}${B.gray(T)} ${D(this.options[this.cursor],"selected")}`;case"cancel":return`${t}${B.gray(T)} ${D(this.options[this.cursor],"cancelled")}
|
|
47
|
+
${B.gray(T)}`;default:return`${t}${B.cyan(T)} ${Qi({cursor:this.cursor,options:this.options,maxItems:u.maxItems,style:s((r,n)=>D(r,n?"active":"inactive"),"style")}).join(`
|
|
48
|
+
${B.cyan(T)} `)}
|
|
49
|
+
${B.cyan(sD)}
|
|
50
|
+
`}}}).prompt()},"ve"),He=s((u="")=>{process.stdout.write(`${B.gray(Xi)} ${u}
|
|
51
|
+
`)},"Ie"),q=s((u="")=>{process.stdout.write(`${B.gray(T)}
|
|
52
|
+
${B.gray(sD)} ${u}
|
|
53
|
+
|
|
54
|
+
`)},"Se");`${B.gray(T)}`;const lD=s(({indicator:u="dots"}={})=>{const D=oD?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],t=oD?80:120,r=process.env.CI==="true";let n,i,e=!1,a="",o,c=performance.now();const l=s(h=>{const b=h>1?"Something went wrong":"Canceled";e&&A(b,h)},"p"),F=s(()=>l(2),"v"),C=s(()=>l(1),"f"),E=s(()=>{process.on("uncaughtExceptionMonitor",F),process.on("unhandledRejection",F),process.on("SIGINT",C),process.on("SIGTERM",C),process.on("exit",l)},"j"),d=s(()=>{process.removeListener("uncaughtExceptionMonitor",F),process.removeListener("unhandledRejection",F),process.removeListener("SIGINT",C),process.removeListener("SIGTERM",C),process.removeListener("exit",l)},"E"),g=s(()=>{if(o===void 0)return;r&&process.stdout.write(`
|
|
55
|
+
`);const h=o.split(`
|
|
56
|
+
`);process.stdout.write(S.cursor.move(-999,h.length-1)),process.stdout.write(S.erase.down(h.length))},"B"),f=s(h=>h.replace(/\.+$/,""),"R"),p=s(h=>{const b=(performance.now()-h)/1e3,$=Math.floor(b/60),P=Math.floor(b%60);return $>0?`[${$}m ${P}s]`:`[${P}s]`},"O"),m=s((h="")=>{e=!0,n=Ki(),a=f(h),c=performance.now(),process.stdout.write(`${B.gray(T)}
|
|
57
|
+
`);let b=0,$=0;E(),i=setInterval(()=>{if(r&&a===o)return;g(),o=a;const P=B.magenta(D[b]);if(r)process.stdout.write(`${P} ${a}...`);else if(u==="timer")process.stdout.write(`${P} ${a} ${p(c)}`);else{const Au=".".repeat(Math.floor($)).slice(0,3);process.stdout.write(`${P} ${a}${Au}`)}b=b+1<D.length?b+1:0,$=$<D.length?$+.125:0},t)},"H"),A=s((h="",b=0)=>{e=!1,clearInterval(i),g();const $=b===0?B.green(Ye):b===1?B.red(qe):B.red(Ke);a=f(h??a),u==="timer"?process.stdout.write(`${$} ${a} ${p(c)}
|
|
58
|
+
`):process.stdout.write(`${$} ${a}
|
|
59
|
+
`),d(),n()},"N");return{start:m,stop:A,message:s((h="")=>{a=f(h??a)},"message")}},"Y"),bD=class bD extends Error{};s(bD,"KnownError");let y=bD;const FD=" ",mu=s(u=>{u instanceof Error&&!(u instanceof y)&&(u.stack&&console.error(Ju(u.stack.split(`
|
|
60
|
+
`).slice(1).join(`
|
|
61
|
+
`))),console.error(`
|
|
62
|
+
${FD}${Ju(`aicommit v${Pu.version}`)}`),console.error(`
|
|
63
|
+
${FD}Please open a Bug report with the information above:`),console.error(`${FD}https://github.com/NegoZiatoR/ai-commit/issues/new/choose`))},"handleCliError"),CD=s(async()=>{const{stdout:u,failed:D}=await z("git",["rev-parse","--show-toplevel"],{reject:!1});if(D)throw new y("The current directory must be a Git repository!");return u},"assertGitRepo"),ED=s(u=>`:(exclude)${u}`,"excludeFromDiff"),Ve=["package-lock.json","*.lock"].map(ED),Ze=s(async u=>{const D=["diff","--cached","--diff-algorithm=minimal"],{stdout:t}=await z("git",[...D,"--name-only",...Ve,...u?u.map(ED):[]]);if(!t)return;const{stdout:r}=await z("git",[...D,...Ve,...u?u.map(ED):[]]);return{files:t.split(`
|
|
64
|
+
`),diff:r}},"getStagedDiff"),eo=s(u=>`Detected ${u.length.toLocaleString()} staged file${u.length>1?"s":""}`,"getDetectedMessage");var fD,Je;function to(){if(Je)return fD;Je=1;const{hasOwnProperty:u}=Object.prototype,D=s((a,o={})=>{typeof o=="string"&&(o={section:o}),o.align=o.align===!0,o.newline=o.newline===!0,o.sort=o.sort===!0,o.whitespace=o.whitespace===!0||o.align===!0,o.platform=o.platform||typeof process<"u"&&process.platform,o.bracketedArray=o.bracketedArray!==!1;const c=o.platform==="win32"?`\r
|
|
65
|
+
`:`
|
|
66
|
+
`,l=o.whitespace?" = ":"=",F=[],C=o.sort?Object.keys(a).sort():Object.keys(a);let E=0;o.align&&(E=i(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)=>i(f).length>=i(p).length?f:p)).length);let d="";const g=o.bracketedArray?"[]":"";for(const f of C){const p=a[f];if(p&&Array.isArray(p))for(const m of p)d+=i(`${f}${g}`).padEnd(E," ")+l+i(m)+c;else p&&typeof p=="object"?F.push(f):d+=i(f).padEnd(E," ")+l+i(p)+c}o.section&&d.length&&(d="["+i(o.section)+"]"+(o.newline?c+c:c)+d);for(const f of F){const p=t(f,".").join("\\."),m=(o.section?o.section+".":"")+p,A=D(a[f],{...o,section:m});d.length&&A.length&&(d+=c),d+=A}return d},"encode");function t(a,o){var c=0,l=0,F=0,C=[];do if(F=a.indexOf(o,c),F!==-1){if(c=F+o.length,F>0&&a[F-1]==="\\")continue;C.push(a.slice(l,F)),l=F+o.length}while(F!==-1);return C.push(a.slice(l)),C}s(t,"splitSections");const r=s((a,o={})=>{o.bracketedArray=o.bracketedArray!==!1;const c=Object.create(null);let l=c,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=e(p[1]),F==="__proto__"){l=Object.create(null);continue}l=c[F]=c[F]||Object.create(null);continue}const m=e(p[2]);let A;o.bracketedArray?A=m.length>2&&m.slice(-2)==="[]":(d[m]=(d?.[m]||0)+1,A=d[m]>1);const h=A&&m.endsWith("[]")?m.slice(0,-2):m;if(h==="__proto__")continue;const b=p[3]?e(p[4]):!0,$=b==="true"||b==="false"||b==="null"?JSON.parse(b):b;A&&(u.call(l,h)?Array.isArray(l[h])||(l[h]=[l[h]]):l[h]=[]),Array.isArray(l[h])?l[h].push($):l[h]=$}const g=[];for(const f of Object.keys(c)){if(!u.call(c,f)||typeof c[f]!="object"||Array.isArray(c[f]))continue;const p=t(f,".");l=c;const m=p.pop(),A=m.replace(/\\\./g,".");for(const h of p)h!=="__proto__"&&((!u.call(l,h)||typeof l[h]!="object")&&(l[h]=Object.create(null)),l=l[h]);l===c&&A===m||(l[A]=c[f],g.push(f))}for(const f of g)delete c[f];return c},"decode"),n=s(a=>a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"),"isQuoted"),i=s(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"),e=s(a=>{if(a=(a||"").trim(),n(a)){a.charAt(0)==="'"&&(a=a.slice(1,-1));try{a=JSON.parse(a)}catch{}}else{let o=!1,c="";for(let l=0,F=a.length;l<F;l++){const C=a.charAt(l);if(o)"\\;#".indexOf(C)!==-1?c+=C:c+="\\"+C,o=!1;else{if(";#".indexOf(C)!==-1)break;C==="\\"?o=!0:c+=C}}return o&&(c+="\\"),c.trim()}return a},"unsafe");return fD={parse:r,decode:r,stringify:D,encode:D,safe:i,unsafe:e},fD}s(to,"requireIni");var ro=to(),Xe=L(ro);const hu=s(u=>O.lstat(u).then(()=>!0,()=>!1),"fileExists"),dD=s(async u=>{try{let D;try{D=u||await CD()}catch(e){if(e instanceof y&&e.message.includes("Git repository"))return;throw e}const t=N.join(D,".ai-commit.json");if(!await hu(t))return;const n=await O.readFile(t,"utf8");return JSON.parse(n)}catch(D){if(D instanceof y)throw D;return}},"getProjectConfig");function no(u){const D={},t=u.split(`
|
|
67
|
+
`);for(const r of t){const n=r.trim();if(!n||n.startsWith("#"))continue;const i=n.match(/^([A-Z_][A-Z0-9_]*)\s*=\s*(.*)$/i);if(!i)continue;const[,e,a]=i;let o=a.trim();(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'"))&&(o=o.slice(1,-1)),D[e]=o}return D}s(no,"parseEnvContent");async function Qe(u){const{filename:D=".env",directory:t=process.cwd(),override:r=!1}=u||{},n=N.join(t,D);if(!await hu(n))return{};try{const e=await O.readFile(n,"utf8"),a=no(e);for(const[o,c]of Object.entries(a))(r||process.env[o]===void 0)&&(process.env[o]=c);return a}catch{return{}}}s(Qe,"loadEnvFile");async function io(){process.env.NODE_ENV==="test"?await Qe({filename:".env.local"}):await Qe({filename:".env"})}s(io,"loadEnvironment");const ut=["openai","anthropic","azure-openai","ollama","custom"],oo=["","conventional"],{hasOwnProperty:so}=Object.prototype,Dt=s((u,D)=>so.call(u,D),"hasOwn"),v=s((u,D,t)=>{if(!D)throw new y(`Invalid config property ${u}: ${t}`)},"parseAssert"),gu={provider(u){return u?(v("provider",ut.includes(u),`Must be one of: ${ut.join(", ")}`),u):"openai"},OPENAI_KEY(u){if(u)return v("OPENAI_KEY",u.startsWith("sk-"),'Must start with "sk-"'),u},ANTHROPIC_KEY(u){if(u)return v("ANTHROPIC_KEY",u.startsWith("sk-ant-"),'Must start with "sk-ant-"'),u},AZURE_OPENAI_KEY(u){return u},AZURE_ENDPOINT(u){if(u)return v("AZURE_ENDPOINT",/^https?:\/\//.test(u),"Must be a valid URL"),u},OLLAMA_ENDPOINT(u){return u?(v("OLLAMA_ENDPOINT",/^https?:\/\//.test(u),"Must be a valid URL"),u):"http://localhost:11434"},CUSTOM_ENDPOINT(u){if(u)return v("CUSTOM_ENDPOINT",/^https?:\/\//.test(u),"Must be a valid URL"),u},CUSTOM_KEY(u){return u},locale(u){return u?(v("locale",u,"Cannot be empty"),v("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;v("generate",/^\d+$/.test(u),"Must be an integer");const D=Number(u);return v("generate",D>0,"Must be greater than 0"),v("generate",D<=5,"Must be less or equal to 5"),D},type(u){return u?(v("type",oo.includes(u),"Invalid commit type"),u):""},proxy(u){if(!(!u||u.length===0))return v("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;v("timeout",/^\d+$/.test(u),"Must be an integer");const D=Number(u);return v("timeout",D>=500,"Must be greater than 500ms"),D},temperature(u){if(!u)return .2;v("temperature",/^(2|\d)(\.\d{1,2})?$/.test(u),"Must be decimal between 0 and 2");const D=Number(u);return v("temperature",D>0,"Must be greater than 0"),v("temperature",D<=2,"Must be less than or equal to 2"),D},"max-length"(u){if(!u)return 50;v("max-length",/^\d+$/.test(u),"Must be an integer");const D=Number(u);return v("max-length",D>=20,"Must be greater than 20 characters"),D},"max-completion-tokens"(u){if(!u)return 1e4;v("max-completion-tokens",/^\d+$/.test(u),"Must be an integer");const D=Number(u);return v("max-completion-tokens",D>0,"Must be greater than 0"),D},"auto-confirm"(u){return u?typeof u=="boolean"?u:(v("auto-confirm",/^(?:true|false)$/.test(u),"Must be a boolean"),u==="true"):!1},"prepend-reference"(u){return u?typeof u=="boolean"?u:(v("prepend-reference",/^(?:true|false)$/.test(u),"Must be a boolean"),u==="true"):!1}},pD=N.join(yt.homedir(),".aicommit"),et=s(async()=>{if(!await hu(pD))return Object.create(null);const D=await O.readFile(pD,"utf8");return Xe.parse(D)},"readConfigFile"),ao=s(u=>{const D=u.provider;switch(D){case"openai":if(!u.OPENAI_KEY)throw new y("Please set your OpenAI API key via `aicommit config set OPENAI_KEY=<your token>`");break;case"anthropic":if(!u.ANTHROPIC_KEY)throw new y("Please set your Anthropic API key via `aicommit config set ANTHROPIC_KEY=<your token>`\nGet your API key from: https://console.anthropic.com/");break;case"azure-openai":if(!u.AZURE_OPENAI_KEY)throw new y("Please set your Azure OpenAI API key via `aicommit config set AZURE_OPENAI_KEY=<your token>`");if(!u.AZURE_ENDPOINT)throw new y("Please set your Azure OpenAI endpoint via `aicommit config set AZURE_ENDPOINT=<your endpoint>`");break;case"ollama":break;case"custom":if(!u.CUSTOM_ENDPOINT)throw new y("Please set your custom endpoint via `aicommit config set CUSTOM_ENDPOINT=<your endpoint>`");break;default:throw new y(`Unknown provider: ${D}`)}},"validateProviderConfig"),mD=s(async(u,D)=>{await io();const t=await et(),r=await dD(),n={};for(const e of Object.keys(gu)){const a=gu[e];let o=r?.[e]??u?.[e]??process.env[e]??t[e];if(typeof o=="boolean"&&(o=o.toString()),D)try{n[e]=a(o)}catch{}else n[e]=a(o)}const i=n;return D||ao(i),i},"getConfig"),co=s(async u=>{const D=await et();for(const[t,r]of u){if(!Dt(gu,t))throw new y(`Invalid config property: ${t}`);const n=gu[t](r);D[t]=n}await O.writeFile(pD,Xe.stringify(D),"utf8")},"setConfigs"),tt={openai:s(()=>import("./openai-nLtDgw6D.mjs"),"openai"),anthropic:s(()=>import("./anthropic-HKPfQ--D.mjs"),"anthropic"),"azure-openai":s(()=>import("./azure-openai-DTeRXuhJ.mjs"),"azure-openai"),ollama:s(()=>import("./ollama-DJdDoRzJ.mjs"),"ollama"),custom:s(()=>import("./custom-BB1a-6TW.mjs"),"custom")};async function rt(u,D){const t=tt[u];if(!t)throw new y(`Unknown provider type: ${u}. Supported providers: ${Object.keys(tt).join(", ")}`);try{const n=(await t()).default;return new n(D)}catch(r){throw r instanceof y?r:r.code==="ERR_MODULE_NOT_FOUND"?new y(`Provider "${u}" is not yet implemented. Currently supported: openai`):new y(`Failed to initialize provider "${u}": ${r.message}`)}}s(rt,"createProvider");var lo=s(async(u,D,t,r,n)=>(async()=>{He(xe($e(" aicommit "))),await CD();const i=lD();t&&await z("git",["add","--update"]),i.start("Detecting staged files");const e=await Ze(D);if(!e)throw i.stop("Detecting staged files"),new y("No staged changes found. Stage your changes manually, or automatically stage all changes with the `--all` flag.");i.stop(`${eo(e.files)}:
|
|
68
|
+
${e.files.map(C=>` ${C}`).join(`
|
|
69
|
+
`)}`);const{env:a}=process,o=await mD({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()}),c=lD();c.start("The AI is analyzing your changes");let l;try{const C={model:o.model,locale:o.locale,maxLength:o["max-length"],type:o.type,timeout:o.timeout,temperature:o.temperature,maxCompletionTokens:o["max-completion-tokens"],proxy:o.proxy};let E;switch(o.provider){case"openai":E={...C,apiKey:o.OPENAI_KEY};break;case"anthropic":E={...C,apiKey:o.ANTHROPIC_KEY};break;case"azure-openai":E={...C,apiKey:o.AZURE_OPENAI_KEY,endpoint:o.AZURE_ENDPOINT};break;case"ollama":E={...C,endpoint:o.OLLAMA_ENDPOINT};break;case"custom":E={...C,endpoint:o.CUSTOM_ENDPOINT,apiKey:o.CUSTOM_KEY};break;default:E={...C,apiKey:o.OPENAI_KEY}}const d=await rt(o.provider,E),g=await dD();l=(await d.generateCommitMessage({diff:e.diff,completions:o.generate,projectConfig:g})).messages}finally{c.stop("Changes analyzed")}if(l.length===0)throw new y("No commit messages were generated. Try again.");let F;if(l.length===1){[F]=l;let C;if(o["auto-confirm"]?(C=!0,q(`${uu("\u2714")} Auto confirmed commit message.
|
|
70
|
+
|
|
71
|
+
${F}
|
|
72
|
+
`)):C=await uo({message:`Use this commit message?
|
|
73
|
+
|
|
74
|
+
${F}
|
|
75
|
+
`}),!C||Ue(C)){q("Commit cancelled");return}}else{const C=await Do({message:`Pick a commit message to use: ${Ju("(Ctrl+c to exit)")}`,options:l.map(E=>({label:E,value:E}))});if(Ue(C)){q("Commit cancelled");return}F=C}if(o["prepend-reference"]){const{stdout:C}=await z("git",["branch","--show-current"]),E=C.match(/([a-zA-Z])+-([0-9]+)/)?.[0];E?.length&&(F=`${E?.toUpperCase()}: ${F}`)}await z("git",["commit","-m",F,...n]),q(`${uu("\u2714")} Successfully committed!`)})().catch(i=>{q(`${Fu("\u2716")} ${i.message}`),mu(i),process.exit(1)}),"aicommit");const[hD,Fo]=process.argv.slice(2);var Co=s(()=>(async()=>{if(!hD)throw new y('Commit message file path is missing. This file should be called from the "prepare-commit-msg" git hook');if(Fo)return;const u=await Ze();if(!u)return;He(xe($e(" aicommit ")));const{env:D}=process,t=await mD({proxy:D.https_proxy||D.HTTPS_PROXY||D.http_proxy||D.HTTP_PROXY}),r=lD();r.start("The AI is analyzing your changes");let n;try{const c={model:t.model,locale:t.locale,maxLength:t["max-length"],type:t.type,timeout:t.timeout,temperature:t.temperature,maxCompletionTokens:t["max-completion-tokens"],proxy:t.proxy};let l;switch(t.provider){case"openai":l={...c,apiKey:t.OPENAI_KEY};break;case"anthropic":l={...c,apiKey:t.ANTHROPIC_KEY};break;case"azure-openai":l={...c,apiKey:t.AZURE_OPENAI_KEY,endpoint:t.AZURE_ENDPOINT};break;case"ollama":l={...c,endpoint:t.OLLAMA_ENDPOINT};break;case"custom":l={...c,endpoint:t.CUSTOM_ENDPOINT,apiKey:t.CUSTOM_KEY};break;default:l={...c,apiKey:t.OPENAI_KEY}}const F=await rt(t.provider,l),C=await dD();n=(await F.generateCommitMessage({diff:u.diff,completions:t.generate,projectConfig:C})).messages}finally{r.stop("Changes analyzed")}const e=await O.readFile(hD,"utf8")!=="",a=n.length>1;let o="";e&&(o=`# \u{1F916} AI generated commit${a?"s":""}
|
|
76
|
+
`),a?(e&&(o+=`# Select one of the following messages by uncommeting:
|
|
77
|
+
`),o+=`
|
|
78
|
+
${n.map(c=>`# ${c}`).join(`
|
|
79
|
+
`)}`):(e&&(o+=`# Edit the message below and commit:
|
|
80
|
+
`),o+=`
|
|
81
|
+
${n[0]}
|
|
82
|
+
`),await O.appendFile(hD,o),q(`${uu("\u2714")} Saved commit message!`)})().catch(u=>{q(`${Fu("\u2716")} ${u.message}`),mu(u),process.exit(1)}),"prepareCommitMessageHook"),Eo=ZD({name:"config",parameters:["<mode>","<key=value...>"]},u=>{(async()=>{const{mode:D,keyValue:t}=u._;if(D==="get"){const r=await mD({},!0);for(const n of t)Dt(r,n)&&console.log(`${n}=${r[n]}`);return}if(D==="set"){await co(t.map(r=>r.split("=")));return}throw new y(`Invalid mode: ${D}`)})().catch(D=>{console.error(`${Fu("\u2716")} ${D.message}`),mu(D),process.exit(1)})});const nt="prepare-commit-msg",it=`.git/hooks/${nt}`,Bu=wt(new URL("cli.mjs",import.meta.url)),fo=process.argv[1].replace(/\\/g,"/").endsWith(`/${it}`),ot=process.platform==="win32",st=`
|
|
83
|
+
#!/usr/bin/env node
|
|
84
|
+
import(${JSON.stringify(vt(Bu))})
|
|
85
|
+
`.trim();var po=ZD({name:"hook",parameters:["<install/uninstall>"]},u=>{(async()=>{const D=await CD(),{installUninstall:t}=u._,r=N.join(D,it),n=await hu(r);if(t==="install"){if(n){if(await O.realpath(r).catch(()=>{})===Bu){console.warn("The hook is already installed");return}throw new y(`A different ${nt} hook seems to be installed. Please remove it before installing aicommit.`)}await O.mkdir(N.dirname(r),{recursive:!0}),ot?await O.writeFile(r,st):(await O.symlink(Bu,r,"file"),await O.chmod(r,493)),console.log(`${uu("\u2714")} Hook installed`);return}if(t==="uninstall"){if(!n){console.warn("Hook is not installed");return}if(ot){if(await O.readFile(r,"utf8")!==st){console.warn("Hook is not installed");return}}else if(await O.realpath(r)!==Bu){console.warn("Hook is not installed");return}await O.rm(r),console.log(`${uu("\u2714")} Hook uninstalled`);return}throw new y(`Invalid mode: ${t}`)})().catch(D=>{console.error(`${Fu("\u2716")} ${D.message}`),mu(D),process.exit(1)})});const at=process.argv.slice(2);Kr({name:"aicommit",version:Pu.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:[Eo,po],help:{description:Pu.description},ignoreArgv:s(u=>u==="unknown-flag"||u==="argument","ignoreArgv")},u=>{fo?Co():lo(u.flags.generate,u.flags.exclude,u.flags.all,u.flags.type,at)},at);export{y as K,L as g};
|
package/dist/cli.mjs
CHANGED
|
@@ -1,104 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var Xt=Object.defineProperty;var o=(u,e)=>Xt(u,"name",{value:e,configurable:!0});var eu;import Ru from"tty";import{Buffer as Qt}from"node:buffer";import Z from"node:path";import He,{ChildProcess as ur}from"node:child_process";import S,{stdout as Ye,stdin as Ke}from"node:process";import er from"child_process";import G from"path";import ku from"fs";import{fileURLToPath as Ve}from"node:url";import Dr,{constants as Ze}from"node:os";import Je from"assert";import Xe from"events";import{createWriteStream as tr,createReadStream as rr}from"node:fs";import nr from"buffer";import Mu from"stream";import Qe from"util";import{debuglog as or}from"node:util";import*as lu from"node:readline";import uD from"node:readline";import{Writable as sr}from"node:stream";import I from"fs/promises";import eD from"os";import ir from"https";import ar from"net";import cr from"tls";import lr,{fileURLToPath as Fr,pathToFileURL as Cr}from"url";const fr="known-flag",dr="unknown-flag",Er="argument",{stringify:tu}=JSON,pr=/\B([A-Z])/g,hr=o(u=>u.replace(pr,"-$1").toLowerCase(),"v$1"),{hasOwnProperty:mr}=Object.prototype,ru=o((u,e)=>mr.call(u,e),"w$3"),gr=o(u=>Array.isArray(u),"L$4"),DD=o(u=>typeof u=="function"?[u,!1]:gr(u)?[u[0],!0]:DD(u.type),"b$3"),Br=o((u,e)=>u===Boolean?e!=="false":e,"d$4"),yr=o((u,e)=>typeof e=="boolean"?e:u===Number&&e===""?Number.NaN:u(e),"m$2"),br=/[\s.:=]/,Ar=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(br);if(t)throw new Error(`${e} cannot contain ${tu(t?.[0])}`)},"B$1"),vr=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;Ar(r);const n=u[r],i=[[],...DD(n),n];t(r,i);const D=hr(r);if(r!==D&&t(D,i),"alias"in n&&typeof n.alias=="string"){const{alias:a}=n,s=`Flag alias ${tu(a)} for flag ${tu(r)}`;if(a.length===0)throw new Error(`${s} cannot be empty`);if(a.length>1)throw new Error(`${s} must be a single character`);t(a,i)}}return e},"K$2"),wr=o((u,e)=>{const t={};for(const r in u){if(!ru(u,r))continue;const[n,,i,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]=i?n:n.pop()}return t},"_$3"),Fu="--",$r=/[.:=]/,xr=/^-{1,2}\w/,Sr=o(u=>{if(!xr.test(u))return;const e=!u.startsWith(Fu);let t=u.slice(e?1:2),r;const n=t.match($r);if(n){const{index:i}=n;r=t.slice(i+1),t=t.slice(0,i)}return[t,r,e]},"N$1"),Or=o((u,{onFlag:e,onArgument:t})=>{let r;const n=o((i,D)=>{if(typeof r!="function")return!0;r(i,D),r=void 0},"o");for(let i=0;i<u.length;i+=1){const D=u[i];if(D===Fu){n();const s=u.slice(i+1);t?.(s,[i],!0);break}const a=Sr(D);if(a){if(n(),!e)continue;const[s,c,F]=a;if(F)for(let C=0;C<s.length;C+=1){n();const l=C===s.length-1;r=e(s[C],l?c:void 0,[i,C+1,l])}else r=e(s,c,[i])}else n(D,[i])&&t?.([D],[i])}n()},"$$2"),Ir=o((u,e)=>{for(const[t,r,n]of e.reverse()){if(r){const i=u[t];let D=i.slice(0,r);if(n||(D+=i.slice(r+1)),D!=="-"){u[t]=D;continue}}u.splice(t,1)}},"E"),Pr=o((u,e=process.argv.slice(2),{ignore:t}={})=>{const r=[],n=vr(u),i={},D=[];return D[Fu]=[],Or(e,{onFlag(a,s,c){const F=ru(n,a);if(!t?.(F?fr:dr,a,s)){if(F){const[C,l]=n[a],E=Br(l,s),d=o((m,f)=>{r.push(c),f&&r.push(f),C.push(yr(l,m||""))},"p");return E===void 0?d:d(E)}ru(i,a)||(i[a]=[]),i[a].push(s===void 0?!0:s),r.push(c)}},onArgument(a,s,c){t?.(Er,e[s[0]])||(D.push(...a),c?(D[Fu]=a,e.splice(s[0])):r.push(s))}}),Ir(e,r),{flags:wr(u,n),unknownFlags:i,_:D}},"U$2");var Tr=Object.create,Cu=Object.defineProperty,_r=Object.defineProperties,Rr=Object.getOwnPropertyDescriptor,kr=Object.getOwnPropertyDescriptors,Mr=Object.getOwnPropertyNames,tD=Object.getOwnPropertySymbols,Nr=Object.getPrototypeOf,rD=Object.prototype.hasOwnProperty,jr=Object.prototype.propertyIsEnumerable,nD=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={}))rD.call(e,t)&&nD(u,t,e[t]);if(tD)for(var t of tD(e))jr.call(e,t)&&nD(u,t,e[t]);return u},"p$1"),Nu=o((u,e)=>_r(u,kr(e)),"c"),Lr=o(u=>Cu(u,"__esModule",{value:!0}),"nD$1"),Gr=o((u,e)=>()=>(u&&(e=u(u=0)),e),"rD$1"),qr=o((u,e)=>()=>(e||u((e={exports:{}}).exports,e),e.exports),"iD$1"),Ur=o((u,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Mr(e))!rD.call(u,n)&&n!=="default"&&Cu(u,n,{get:o(()=>e[n],"get"),enumerable:!(r=Rr(e,n))||r.enumerable});return u},"oD$1"),Wr=o((u,e)=>Ur(Lr(Cu(u!=null?Tr(Nr(u)):{},"default",{value:u,enumerable:!0})),u),"BD$1"),P=Gr(()=>{}),zr=qr((u,e)=>{P(),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}});P(),P(),P();var Hr=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");P(),P(),P(),P(),P();function Yr({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(Yr,"w$2");function oD(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(Yr(),"")}o(oD,"d$3"),P();function Kr(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(Kr,"y$2");var Vr=Wr(zr());function W(u){if(typeof u!="string"||u.length===0||(u=oD(u),u.length===0))return 0;u=u.replace((0,Vr.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+=Kr(r)?2:1)}return e}o(W,"g");var sD=o(u=>Math.max(...u.split(`
|
|
3
|
-
`).map(W)),"b$2"),Zr=o(u=>{let e=[];for(let t of u){let{length:r}=t,n=r-e.length;for(let i=0;i<n;i+=1)e.push(0);for(let i=0;i<r;i+=1){let D=sD(t[i]);D>e[i]&&(e[i]=D)}}return e},"k$3");P();var iD=/^\d+%$/,aD={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},Jr=o((u,e)=>{var t;let r=[];for(let n=0;n<u.length;n+=1){let i=(t=e[n])!=null?t:"auto";if(typeof i=="number"||i==="auto"||i==="content-width"||typeof i=="string"&&iD.test(i)){r.push(Nu(fu({},aD),{width:i,contentWidth:u[n]}));continue}if(i&&typeof i=="object"){let D=Nu(fu(fu({},aD),i),{contentWidth:u[n]});D.horizontalPadding=D.paddingLeft+D.paddingRight,r.push(D);continue}throw new Error(`Invalid column width: ${JSON.stringify(i)}`)}return r},"sD$1");function Xr(u,e){for(let t of u){let{width:r}=t;if(r==="content-width"&&(t.width=t.contentWidth),r==="auto"){let s=Math.min(20,t.contentWidth);t.width=s,t.autoOverflow=t.contentWidth-s}if(typeof r=="string"&&iD.test(r)){let s=Number.parseFloat(r.slice(0,-1))/100;t.width=Math.floor(e*s)-(t.paddingLeft+t.paddingRight)}let{horizontalPadding:n}=t,i=1,D=i+n;if(D>=e){let s=D-e,c=Math.ceil(t.paddingLeft/n*s),F=s-c;t.paddingLeft-=c,t.paddingRight-=F,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),i)}}o(Xr,"aD$1");var cD=o(()=>Object.assign([],{columns:0}),"G$3");function Qr(u,e){let t=[cD()],[r]=t;for(let n of u){let i=n.width+n.horizontalPadding;r.columns+i>e&&(r=cD(),t.push(r)),r.push(n),r.columns+=i}for(let n of t){let i=n.reduce((l,E)=>l+E.width+E.horizontalPadding,0),D=e-i;if(D===0)continue;let a=n.filter(l=>"autoOverflow"in l),s=a.filter(l=>l.autoOverflow>0),c=s.reduce((l,E)=>l+E.autoOverflow,0),F=Math.min(c,D);for(let l of s){let E=Math.floor(l.autoOverflow/c*F);l.width+=E,D-=E}let C=Math.floor(D/a.length);for(let l=0;l<a.length;l+=1){let E=a[l];l===a.length-1?E.width+=D:E.width+=C,D-=C}}return t}o(Qr,"lD$1");function un(u,e,t){let r=Jr(t,e);return Xr(r,u),Qr(r,u)}o(un,"Z$1"),P(),P(),P();var ju=10,lD=o((u=0)=>e=>`\x1B[${e+u}m`,"U$1"),FD=o((u=0)=>e=>`\x1B[${38+u};5;${e}m`,"V$3"),CD=o((u=0)=>(e,t,r)=>`\x1B[${38+u};2;${e};${t};${r}m`,"Y$2");function en(){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,i]of Object.entries(r))e[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=e[n],u.set(i[0],i[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=lD(),e.color.ansi256=FD(),e.color.ansi16m=CD(),e.bgColor.ansi=lD(ju),e.bgColor.ansi256=FD(ju),e.bgColor.ansi16m=CD(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 i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&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,i;if(t>=232)r=((t-232)*10+8)/255,n=r,i=r;else{t-=16;let s=t%36;r=Math.floor(t/36)/5,n=Math.floor(s/6)/5,i=s%6/5}let D=Math.max(r,n,i)*2;if(D===0)return 30;let a=30+(Math.round(i)<<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(en,"AD$1");var Dn=en(),tn=Dn,du=new Set(["\x1B","\x9B"]),rn=39,Lu="\x07",fD="[",nn="]",dD="m",Gu=`${nn}8;;`,ED=o(u=>`${du.values().next().value}${fD}${u}${dD}`,"J$2"),pD=o(u=>`${du.values().next().value}${Gu}${u}${Lu}`,"Q"),on=o(u=>u.split(" ").map(e=>W(e)),"hD$1"),qu=o((u,e,t)=>{let r=[...e],n=!1,i=!1,D=W(oD(u[u.length-1]));for(let[a,s]of r.entries()){let c=W(s);if(D+c<=t?u[u.length-1]+=s:(u.push(s),D=0),du.has(s)&&(n=!0,i=r.slice(a+1).join("").startsWith(Gu)),n){i?s===Lu&&(n=!1,i=!1):s===dD&&(n=!1);continue}D+=c,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"),sn=o(u=>{let e=u.split(" "),t=e.length;for(;t>0&&!(W(e[t-1])>0);)t--;return t===e.length?u:e.slice(0,t).join(" ")+e.slice(t).join("")},"cD"),an=o((u,e,t={})=>{if(t.trim!==!1&&u.trim()==="")return"";let r="",n,i,D=on(u),a=[""];for(let[c,F]of u.split(" ").entries()){t.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let C=W(a[a.length-1]);if(c!==0&&(C>=e&&(t.wordWrap===!1||t.trim===!1)&&(a.push(""),C=0),(C>0||t.trim===!1)&&(a[a.length-1]+=" ",C++)),t.hard&&D[c]>e){let l=e-C,E=1+Math.floor((D[c]-l-1)/e);Math.floor((D[c]-1)/e)<E&&a.push(""),qu(a,F,e);continue}if(C+D[c]>e&&C>0&&D[c]>0){if(t.wordWrap===!1&&C<e){qu(a,F,e);continue}a.push("")}if(C+D[c]>e&&t.wordWrap===!1){qu(a,F,e);continue}a[a.length-1]+=F}t.trim!==!1&&(a=a.map(c=>sn(c)));let s=[...a.join(`
|
|
4
|
-
`)];for(let[c,F]of s.entries()){if(r+=F,du.has(F)){let{groups:l}=new RegExp(`(?:\\${fD}(?<code>\\d+)m|\\${Gu}(?<uri>.*)${Lu})`).exec(s.slice(c).join(""))||{groups:{}};if(l.code!==void 0){let E=Number.parseFloat(l.code);n=E===rn?void 0:E}else l.uri!==void 0&&(i=l.uri.length===0?void 0:l.uri)}let C=tn.codes.get(Number(n));s[c+1]===`
|
|
5
|
-
`?(i&&(r+=pD("")),n&&C&&(r+=ED(C))):F===`
|
|
6
|
-
`&&(n&&C&&(r+=ED(n)),i&&(r+=pD(i)))}return r},"dD$1");function cn(u,e,t){return String(u).normalize().replace(/\r\n/g,`
|
|
7
|
-
`).split(`
|
|
8
|
-
`).map(r=>an(r,e,t)).join(`
|
|
9
|
-
`)}o(cn,"T$1");var hD=o(u=>Array.from({length:u}).fill(""),"X");function ln(u,e){let t=[],r=0;for(let n of u){let i=0,D=n.map(s=>{var c;let F=(c=e[r])!=null?c:"";r+=1,s.preprocess&&(F=s.preprocess(F)),sD(F)>s.width&&(F=cn(F,s.width,{hard:!0}));let C=F.split(`
|
|
10
|
-
`);if(s.postprocess){let{postprocess:l}=s;C=C.map((E,d)=>l.call(s,E,d))}return s.paddingTop&&C.unshift(...hD(s.paddingTop)),s.paddingBottom&&C.push(...hD(s.paddingBottom)),C.length>i&&(i=C.length),Nu(fu({},s),{lines:C})}),a=[];for(let s=0;s<i;s+=1){let c=D.map(F=>{var C;let l=(C=F.lines[s])!=null?C:"",E=Number.isFinite(F.width)?" ".repeat(F.width-W(l)):"",d=F.paddingLeftString;return F.align==="right"&&(d+=E),d+=l,F.align==="left"&&(d+=E),d+F.paddingRightString}).join("");a.push(c)}t.push(a.join(`
|
|
11
|
-
`))}return t.join(`
|
|
12
|
-
`)}o(ln,"P$3");function Fn(u,e){if(!u||u.length===0)return"";let t=Zr(u),r=t.length;if(r===0)return"";let{stdoutColumns:n,columns:i}=Hr(e);if(i.length>r)throw new Error(`${i.length} columns defined, but only ${r} columns found`);let D=un(n,i,t);return u.map(a=>ln(D,a)).join(`
|
|
13
|
-
`)}o(Fn,"mD"),P();var Cn=["<",">","=",">=","<="];function fn(u){if(!Cn.includes(u))throw new TypeError(`Invalid breakpoint operator: ${u}`)}o(fn,"xD$1");function dn(u){let e=Object.keys(u).map(t=>{let[r,n]=t.split(" ");fn(r);let i=Number.parseInt(n,10);if(Number.isNaN(i))throw new TypeError(`Invalid breakpoint value: ${n}`);let D=u[t];return{operator:r,breakpoint:i,value:D}}).sort((t,r)=>r.breakpoint-t.breakpoint);return t=>{var r;return(r=e.find(({operator:n,breakpoint:i})=>n==="="&&t===i||n===">"&&t>i||n==="<"&&t<i||n===">="&&t>=i||n==="<="&&t<=i))==null?void 0:r.value}}o(dn,"wD");const En=o(u=>u.replace(/[\W_]([a-z\d])?/gi,(e,t)=>t?t.toUpperCase():""),"P$2"),pn=o(u=>u.replace(/\B([A-Z])/g,"-$1").toLowerCase(),"q"),hn={"> 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 mn(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:`--${pn(t)}`,aliasesEnabled:e,aliasFormatted:n?`-${r.alias}`:void 0}}).map(t=>(t.aliasesEnabled=e,[{type:"flagName",data:t},{type:"flagDescription",data:t}])),tableBreakpoints:hn}}}o(mn,"D");const mD=o(u=>!u||(u.version??(u.help?u.help.version:void 0)),"A"),gD=o(u=>{const e="parent"in u&&u.parent?.name;return(e?`${e} `:"")+u.name},"C$1");function gn(u){const e=[];u.name&&e.push(gD(u));const t=mD(u)??("parent"in u&&mD(u.parent));if(t&&e.push(`v${t}`),e.length!==0)return{id:"name",type:"text",data:`${e.join(" ")}
|
|
14
|
-
`}}o(gn,"R$1");function Bn(u){const{help:e}=u;if(!(!e||!e.description))return{id:"description",type:"text",data:`${e.description}
|
|
15
|
-
`}}o(Bn,"L$2");function yn(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=[gD(u)];if(u.flags&&Object.keys(u.flags).length>0&&r.push("[flags...]"),u.parameters&&u.parameters.length>0){const{parameters:n}=u,i=n.indexOf("--"),D=i>-1&&n.slice(i+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(yn,"T");function bn(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(bn,"_$1");function An(u){if(!(!u.flags||Object.keys(u.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:mn(u.flags),indentBody:0}}}o(An,"k$2");function vn(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(vn,"F");function wn(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(wn,"H");const $n=o(u=>[gn,Bn,yn,bn,An,vn,wn].map(e=>e(u)).filter(Boolean),"U"),xn=Ru.WriteStream.prototype.hasColors();let Sn=(eu=class{text(e){return e}bold(e){return xn?`\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 Fn(e.map(n=>n.map(i=>this.render(i))),r?dn(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:i}=e;let D="";if(i?D+=`${i}, `: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 Uu=o(u=>u.length>0&&!u.includes(" "),"y$1"),{stringify:M}=JSON,On=/[|\\{}()[\]^$+*?.]/;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 i=n[0],D=n[n.length-1];let a;if(i==="<"&&D===">"&&(a=!0,t))throw new Error(`Invalid parameter: Required parameter ${M(n)} cannot come after optional parameter ${M(t)}`);if(i==="["&&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 s=n.slice(1,-1);const c=s.slice(-3)==="...";c&&(r=n,s=s.slice(0,-3));const F=s.match(On);if(F)throw new Error(`Invalid parameter: ${M(n)}. Invalid character found ${M(F[0])}`);e.push({name:s,required:a,spread:c})}return e}o(Wu,"w$1");function zu(u,e,t,r){for(let n=0;n<e.length;n+=1){const{name:i,required:D,spread:a}=e[n],s=En(i);if(s in u)throw new Error(`Invalid parameter: ${M(i)} is used more than once.`);const c=a?t.slice(n):t[n];if(a&&(n=e.length),D&&(!c||a&&c.length===0))return console.error(`Error: Missing required parameter ${M(i)}
|
|
22
|
-
`),r(),process.exit(1);u[s]=c}}o(zu,"b$1");function In(u){return u===void 0||u!==!1}o(In,"W$2");function BD(u,e,t,r){const n={...e.flags},i=e.version;i&&(n.version={type:Boolean,description:"Show version"});const{help:D}=e,a=In(D);a&&!("help"in n)&&(n.help={type:Boolean,alias:"h",description:"Show help"});const s=Pr(n,r,{ignore:e.ignoreArgv}),c=o(()=>{console.log(e.version)},"f");if(i&&s.flags.version===!0)return c(),process.exit(0);const F=new Sn,C=a&&D?.render?D.render:d=>F.render(d),l=o(d=>{const m=$n({...e,...d?{help:d}:{},flags:n});console.log(C(m,F))},"u");if(a&&s.flags.help===!0)return l(),process.exit(0);if(e.parameters){let{parameters:d}=e,m=s._;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=s._["--"];m=m.slice(0,-g.length||void 0),zu(h,Wu(d),m,l),zu(h,Wu(p),g,l)}else zu(h,Wu(d),m,l);Object.assign(s._,h)}const E={...s,showVersion:c,showHelp:l};return typeof t=="function"&&t(E),{command:u,...E}}o(BD,"x$1");function Pn(u,e){const t=new Map;for(const r of e){const n=[r.options.name],{alias:i}=r.options;i&&(Array.isArray(i)?n.push(...i):n.push(i));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(Pn,"z$1");function Tn(u,e,t=process.argv.slice(2)){if(!u)throw new Error("Options is required");if("name"in u&&(!u.name||!Uu(u.name)))throw new Error(`Invalid script name: ${M(u.name)}`);const r=t[0];if(u.commands&&r&&Uu(r)){const n=Pn(r,u.commands);if(n)return BD(n.options.name,{...n.options,parent:u},n.callback,t.slice(1))}return BD(void 0,u,e,t)}o(Tn,"Z");function yD(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(!Uu(t))throw new Error(`Invalid command name ${JSON.stringify(t)}. Command names must be one word.`);return{options:u,callback:e}}o(yD,"G$2");var _n="2.10.0",Rn="Writes your git commit messages for you with AI",Hu={version:_n,description:Rn},q=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function z(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}o(z,"getDefaultExportFromCjs");var H={exports:{}},Yu,bD;function kn(){if(bD)return Yu;bD=1,Yu=r,r.sync=n;var u=ku;function e(i,D){var a=D.pathExt!==void 0?D.pathExt:process.env.PATHEXT;if(!a||(a=a.split(";"),a.indexOf("")!==-1))return!0;for(var s=0;s<a.length;s++){var c=a[s].toLowerCase();if(c&&i.substr(-c.length).toLowerCase()===c)return!0}return!1}o(e,"checkPathExt");function t(i,D,a){return!i.isSymbolicLink()&&!i.isFile()?!1:e(D,a)}o(t,"checkStat");function r(i,D,a){u.stat(i,function(s,c){a(s,s?!1:t(c,i,D))})}o(r,"isexe");function n(i,D){return t(u.statSync(i),i,D)}return o(n,"sync"),Yu}o(kn,"requireWindows");var Ku,AD;function Mn(){if(AD)return Ku;AD=1,Ku=e,e.sync=t;var u=ku;function e(i,D,a){u.stat(i,function(s,c){a(s,s?!1:r(c,D))})}o(e,"isexe");function t(i,D){return r(u.statSync(i),D)}o(t,"sync");function r(i,D){return i.isFile()&&n(i,D)}o(r,"checkStat");function n(i,D){var a=i.mode,s=i.uid,c=i.gid,F=D.uid!==void 0?D.uid:process.getuid&&process.getuid(),C=D.gid!==void 0?D.gid:process.getgid&&process.getgid(),l=parseInt("100",8),E=parseInt("010",8),d=parseInt("001",8),m=l|E,f=a&d||a&E&&c===C||a&l&&s===F||a&m&&F===0;return f}return o(n,"checkMode"),Ku}o(Mn,"requireMode");var Vu,vD;function Nn(){if(vD)return Vu;vD=1;var u;process.platform==="win32"||q.TESTING_WINDOWS?u=kn():u=Mn(),Vu=e,e.sync=t;function e(r,n,i){if(typeof n=="function"&&(i=n,n={}),!i){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(D,a){e(r,n||{},function(s,c){s?a(s):D(c)})})}u(r,n||{},function(D,a){D&&(D.code==="EACCES"||n&&n.ignoreErrors)&&(D=null,a=!1),i(D,a)})}o(e,"isexe");function t(r,n){try{return u.sync(r,n||{})}catch(i){if(n&&n.ignoreErrors||i.code==="EACCES")return!1;throw i}}return o(t,"sync"),Vu}o(Nn,"requireIsexe");var Zu,wD;function jn(){if(wD)return Zu;wD=1;const u=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",e=G,t=u?";":":",r=Nn(),n=o(s=>Object.assign(new Error(`not found: ${s}`),{code:"ENOENT"}),"getNotFoundError"),i=o((s,c)=>{const F=c.colon||t,C=s.match(/\//)||u&&s.match(/\\/)?[""]:[...u?[process.cwd()]:[],...(c.path||process.env.PATH||"").split(F)],l=u?c.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",E=u?l.split(F):[""];return u&&s.indexOf(".")!==-1&&E[0]!==""&&E.unshift(""),{pathEnv:C,pathExt:E,pathExtExe:l}},"getPathInfo"),D=o((s,c,F)=>{typeof c=="function"&&(F=c,c={}),c||(c={});const{pathEnv:C,pathExt:l,pathExtExe:E}=i(s,c),d=[],m=o(p=>new Promise((h,g)=>{if(p===C.length)return c.all&&d.length?h(d):g(n(s));const B=C[p],b=/^".*"$/.test(B)?B.slice(1,-1):B,y=e.join(b,s),x=!b&&/^\.[\\\/]/.test(s)?s.slice(0,2)+y:y;h(f(x,p,0))}),"step"),f=o((p,h,g)=>new Promise((B,b)=>{if(g===l.length)return B(m(h+1));const y=l[g];r(p+y,{pathExt:E},(x,k)=>{if(!x&&k)if(c.all)d.push(p+y);else return B(p+y);return B(f(p,h,g+1))})}),"subStep");return F?m(0).then(p=>F(null,p),F):m(0)},"which"),a=o((s,c)=>{c=c||{};const{pathEnv:F,pathExt:C,pathExtExe:l}=i(s,c),E=[];for(let d=0;d<F.length;d++){const m=F[d],f=/^".*"$/.test(m)?m.slice(1,-1):m,p=e.join(f,s),h=!f&&/^\.[\\\/]/.test(s)?s.slice(0,2)+p:p;for(let g=0;g<C.length;g++){const B=h+C[g];try{if(r.sync(B,{pathExt:l}))if(c.all)E.push(B);else return B}catch{}}}if(c.all&&E.length)return E;if(c.nothrow)return null;throw n(s)},"whichSync");return Zu=D,D.sync=a,Zu}o(jn,"requireWhich");var Eu={exports:{}},$D;function Ln(){if($D)return Eu.exports;$D=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(Ln,"requirePathKey");var Ju,xD;function Gn(){if(xD)return Ju;xD=1;const u=G,e=jn(),t=Ln();function r(i,D){const a=i.options.env||process.env,s=process.cwd(),c=i.options.cwd!=null,F=c&&process.chdir!==void 0&&!process.chdir.disabled;if(F)try{process.chdir(i.options.cwd)}catch{}let C;try{C=e.sync(i.command,{path:a[t({env:a})],pathExt:D?u.delimiter:void 0})}catch{}finally{F&&process.chdir(s)}return C&&(C=u.resolve(c?i.options.cwd:"",C)),C}o(r,"resolveCommandAttempt");function n(i){return r(i)||r(i,!0)}return o(n,"resolveCommand"),Ju=n,Ju}o(Gn,"requireResolveCommand");var pu={},SD;function qn(){if(SD)return pu;SD=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(qn,"require_escape");var Xu,OD;function Un(){return OD||(OD=1,Xu=/^#!(.*)/),Xu}o(Un,"requireShebangRegex");var Qu,ID;function Wn(){if(ID)return Qu;ID=1;const u=Un();return Qu=o((e="")=>{const t=e.match(u);if(!t)return null;const[r,n]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i},"shebangCommand"),Qu}o(Wn,"requireShebangCommand");var ue,PD;function zn(){if(PD)return ue;PD=1;const u=ku,e=Wn();function t(r){const i=Buffer.alloc(150);let D;try{D=u.openSync(r,"r"),u.readSync(D,i,0,150,0),u.closeSync(D)}catch{}return e(i.toString())}return o(t,"readShebang"),ue=t,ue}o(zn,"requireReadShebang");var ee,TD;function Hn(){if(TD)return ee;TD=1;const u=G,e=Gn(),t=qn(),r=zn(),n=process.platform==="win32",i=/\.(?:com|exe)$/i,D=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function a(F){F.file=e(F);const C=F.file&&r(F.file);return C?(F.args.unshift(F.file),F.command=C,e(F)):F.file}o(a,"detectShebang");function s(F){if(!n)return F;const C=a(F),l=!i.test(C);if(F.options.forceShell||l){const E=D.test(C);F.command=u.normalize(F.command),F.command=t.command(F.command),F.args=F.args.map(m=>t.argument(m,E));const d=[F.command].concat(F.args).join(" ");F.args=["/d","/s","/c",`"${d}"`],F.command=process.env.comspec||"cmd.exe",F.options.windowsVerbatimArguments=!0}return F}o(s,"parseNonShell");function c(F,C,l){C&&!Array.isArray(C)&&(l=C,C=null),C=C?C.slice(0):[],l=Object.assign({},l);const E={command:F,args:C,options:l,file:void 0,original:{command:F,args:C}};return l.shell?E:s(E)}return o(c,"parse"),ee=c,ee}o(Hn,"requireParse");var De,_D;function Yn(){if(_D)return De;_D=1;const u=process.platform==="win32";function e(i,D){return Object.assign(new Error(`${D} ${i.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${D} ${i.command}`,path:i.command,spawnargs:i.args})}o(e,"notFoundError");function t(i,D){if(!u)return;const a=i.emit;i.emit=function(s,c){if(s==="exit"){const F=r(c,D);if(F)return a.call(i,"error",F)}return a.apply(i,arguments)}}o(t,"hookChildProcess");function r(i,D){return u&&i===1&&!D.file?e(D.original,"spawn"):null}o(r,"verifyENOENT");function n(i,D){return u&&i===1&&!D.file?e(D.original,"spawnSync"):null}return o(n,"verifyENOENTSync"),De={hookChildProcess:t,verifyENOENT:r,verifyENOENTSync:n,notFoundError:e},De}o(Yn,"requireEnoent");var RD;function Kn(){if(RD)return H.exports;RD=1;const u=er,e=Hn(),t=Yn();function r(i,D,a){const s=e(i,D,a),c=u.spawn(s.command,s.args,s.options);return t.hookChildProcess(c,s),c}o(r,"spawn");function n(i,D,a){const s=e(i,D,a),c=u.spawnSync(s.command,s.args,s.options);return c.error=c.error||t.verifyENOENTSync(c.status,s),c}return o(n,"spawnSync"),H.exports=r,H.exports.spawn=r,H.exports.sync=n,H.exports._parse=e,H.exports._enoent=t,H.exports}o(Kn,"requireCrossSpawn");var Vn=Kn(),Zn=z(Vn);function Jn(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(Jn,"stripFinalNewline");function kD(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(kD,"pathKey");const Xn=o(({cwd:u=S.cwd(),path:e=S.env[kD()],preferLocal:t=!0,execPath:r=S.execPath,addExecPath:n=!0}={})=>{const i=u instanceof URL?Ve(u):u,D=Z.resolve(i),a=[];return t&&Qn(a,D),n&&uo(a,r,D),[...a,e].join(Z.delimiter)},"npmRunPath"),Qn=o((u,e)=>{let t;for(;t!==e;)u.push(Z.join(e,"node_modules/.bin")),t=e,e=Z.resolve(e,"..")},"applyPreferLocal"),uo=o((u,e,t)=>{const r=e instanceof URL?Ve(e):e;u.push(Z.resolve(t,r,".."))},"applyExecPath"),eo=o(({env:u=S.env,...e}={})=>{u={...u};const t=kD({env:u});return e.path=u[t],u[t]=Xn(e),u},"npmRunPathEnv"),Do=o((u,e,t,r)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;const n=Object.getOwnPropertyDescriptor(u,t),i=Object.getOwnPropertyDescriptor(e,t);!to(n,i)&&r||Object.defineProperty(u,t,i)},"copyProperty"),to=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"),ro=o((u,e)=>{const t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(u)&&Object.setPrototypeOf(u,t)},"changePrototype"),no=o((u,e)=>`/* Wrapped ${u}*/
|
|
24
|
-
${e}`,"wrappedToString"),oo=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),so=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),io=o((u,e,t)=>{const r=t===""?"":`with ${t.trim()}() `,n=no.bind(null,r,e.toString());Object.defineProperty(n,"name",so),Object.defineProperty(u,"toString",{...oo,value:n})},"changeToString");function ao(u,e,{ignoreNonConfigurable:t=!1}={}){const{name:r}=u;for(const n of Reflect.ownKeys(e))Do(u,e,n,t);return ro(u,e),io(u,e,r),u}o(ao,"mimicFunction");const hu=new WeakMap,MD=o((u,e={})=>{if(typeof u!="function")throw new TypeError("Expected a function");let t,r=0;const n=u.displayName||u.name||"<anonymous>",i=o(function(...D){if(hu.set(i,++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 ao(i,u),hu.set(i,r),i},"onetime");MD.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 co=o(()=>{const u=jD-ND+1;return Array.from({length:u},lo)},"getRealtimeSignals"),lo=o((u,e)=>({name:`SIGRT${e+1}`,number:ND+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),"getRealtimeSignal"),ND=34,jD=64,Fo=[{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"}],LD=o(()=>{const u=co();return[...Fo,...u].map(Co)},"getSignals"),Co=o(({name:u,number:e,description:t,action:r,forced:n=!1,standard:i})=>{const{signals:{[u]:D}}=Ze,a=D!==void 0;return{name:u,number:a?D:e,description:t,supported:a,action:r,forced:n,standard:i}},"normalizeSignal"),fo=o(()=>{const u=LD();return Object.fromEntries(u.map(Eo))},"getSignalsByName"),Eo=o(({name:u,number:e,description:t,supported:r,action:n,forced:i,standard:D})=>[u,{name:u,number:e,description:t,supported:r,action:n,forced:i,standard:D}],"getSignalByName"),po=fo(),ho=o(()=>{const u=LD(),e=jD+1,t=Array.from({length:e},(r,n)=>mo(n,u));return Object.assign({},...t)},"getSignalsByNumber"),mo=o((u,e)=>{const t=go(u,e);if(t===void 0)return{};const{name:r,description:n,supported:i,action:D,forced:a,standard:s}=t;return{[u]:{name:r,number:u,description:n,supported:i,action:D,forced:a,standard:s}}},"getSignalByNumber"),go=o((u,e)=>{const t=e.find(({name:r})=>Ze.signals[r]===u);return t!==void 0?t:e.find(r=>r.number===u)},"findSignalByNumber");ho();const Bo=o(({timedOut:u,timeout:e,errorCode:t,signal:r,signalDescription:n,exitCode:i,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})`:i!==void 0?`failed with exit code ${i}`:"failed","getErrorPrefix"),GD=o(({stdout:u,stderr:e,all:t,error:r,signal:n,exitCode:i,command:D,escapedCommand:a,timedOut:s,isCanceled:c,killed:F,parsed:{options:{timeout:C,cwd:l=S.cwd()}}})=>{i=i===null?void 0:i,n=n===null?void 0:n;const E=n===void 0?void 0:po[n].description,d=r&&r.code,f=`Command ${Bo({timedOut:s,timeout:C,errorCode:d,signal:n,signalDescription:E,exitCode:i,isCanceled:c})}: ${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=i,r.signal=n,r.signalDescription=E,r.stdout=u,r.stderr=e,r.cwd=l,t!==void 0&&(r.all=t),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!s,r.isCanceled=c,r.killed=F&&!s,r},"makeError"),mu=["stdin","stdout","stderr"],yo=o(u=>mu.some(e=>u[e]!==void 0),"hasAlias"),bo=o(u=>{if(!u)return;const{stdio:e}=u;if(e===void 0)return mu.map(r=>u[r]);if(yo(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 Y={exports:{}},te={exports:{}},qD;function Ao(){return qD||(qD=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")})(te)),te.exports}o(Ao,"requireSignals");var UD;function vo(){if(UD)return Y.exports;UD=1;var u=q.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))Y.exports=function(){return function(){}};else{var t=Je,r=Ao(),n=/^win/i.test(u.platform),i=Xe;typeof i!="function"&&(i=i.EventEmitter);var D;u.__signal_exit_emitter__?D=u.__signal_exit_emitter__:(D=u.__signal_exit_emitter__=new i,D.count=0,D.emitted={}),D.infinite||(D.setMaxListeners(1/0),D.infinite=!0),Y.exports=function(f,p){if(!e(q.process))return function(){};t.equal(typeof f,"function","a callback must be provided for exit handler"),F===!1&&C();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(){!F||!e(q.process)||(F=!1,r.forEach(function(p){try{u.removeListener(p,c[p])}catch{}}),u.emit=d,u.reallyExit=l,D.count-=1)},"unload2");Y.exports.unload=a;var s=o(function(p,h,g){D.emitted[p]||(D.emitted[p]=!0,D.emit(p,h,g))},"emit2"),c={};r.forEach(function(f){c[f]=o(function(){if(e(q.process)){var h=u.listeners(f);h.length===D.count&&(a(),s("exit",null,f),s("afterexit",null,f),n&&f==="SIGHUP"&&(f="SIGINT"),u.kill(u.pid,f))}},"listener")}),Y.exports.signals=function(){return r};var F=!1,C=o(function(){F||!e(q.process)||(F=!0,D.count+=1,r=r.filter(function(p){try{return u.on(p,c[p]),!0}catch{return!1}}),u.emit=m,u.reallyExit=E)},"load2");Y.exports.load=C;var l=u.reallyExit,E=o(function(p){e(q.process)&&(u.exitCode=p||0,s("exit",u.exitCode,null),s("afterexit",u.exitCode,null),l.call(u,u.exitCode))},"processReallyExit2"),d=u.emit,m=o(function(p,h){if(p==="exit"&&e(q.process)){h!==void 0&&(u.exitCode=h);var g=d.apply(this,arguments);return s("exit",u.exitCode,null),s("afterexit",u.exitCode,null),g}else return d.apply(this,arguments)},"processEmit2")}return Y.exports}o(vo,"requireSignalExit");var wo=vo(),$o=z(wo);const xo=1e3*5,So=o((u,e="SIGTERM",t={})=>{const r=u(e);return Oo(u,e,t,r),r},"spawnedKill"),Oo=o((u,e,t,r)=>{if(!Io(e,t,r))return;const n=To(t),i=setTimeout(()=>{u("SIGKILL")},n);i.unref&&i.unref()},"setKillTimeout"),Io=o((u,{forceKillAfterTimeout:e},t)=>Po(u)&&e!==!1&&t,"shouldForceKill"),Po=o(u=>u===Dr.constants.signals.SIGTERM||typeof u=="string"&&u.toUpperCase()==="SIGTERM","isSigterm"),To=o(({forceKillAfterTimeout:u=!0})=>{if(u===!0)return xo;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"),_o=o((u,e)=>{u.kill()&&(e.isCanceled=!0)},"spawnedCancel"),Ro=o((u,e,t)=>{u.kill(e),t(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))},"timeoutKill"),ko=o((u,{timeout:e,killSignal:t="SIGTERM"},r)=>{if(e===0||e===void 0)return r;let n;const i=new Promise((a,s)=>{n=setTimeout(()=>{Ro(u,t,s)},e)}),D=r.finally(()=>{clearTimeout(n)});return Promise.race([i,D])},"setupTimeout"),Mo=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"),No=o(async(u,{cleanup:e,detached:t},r)=>{if(!e||t)return r;const n=$o(()=>{u.kill()});return r.finally(()=>{n()})},"setExitHandler");function WD(u){return u!==null&&typeof u=="object"&&typeof u.pipe=="function"}o(WD,"isStream");function zD(u){return WD(u)&&u.writable!==!1&&typeof u._write=="function"&&typeof u._writableState=="object"}o(zD,"isWritableStream");const jo=o(u=>u instanceof ur&&typeof u.then=="function","isExecaChildProcess"),re=o((u,e,t)=>{if(typeof t=="string")return u[e].pipe(tr(t)),u;if(zD(t))return u[e].pipe(t),u;if(!jo(t))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!zD(t.stdin))throw new TypeError("The target child process's stdin must be available.");return u[e].pipe(t.stdin),t},"pipeToTarget"),Lo=o(u=>{u.stdout!==null&&(u.pipeStdout=re.bind(void 0,u,"stdout")),u.stderr!==null&&(u.pipeStderr=re.bind(void 0,u,"stderr")),u.all!==void 0&&(u.pipeAll=re.bind(void 0,u,"all"))},"addPipeMethods");var J={exports:{}},ne,HD;function Go(){if(HD)return ne;HD=1;const{PassThrough:u}=Mu;return ne=o(e=>{e={...e};const{array:t}=e;let{encoding:r}=e;const n=r==="buffer";let i=!1;t?i=!(r||n):r=r||"utf8",n&&(r=null);const D=new u({objectMode:i});r&&D.setEncoding(r);let a=0;const s=[];return D.on("data",c=>{s.push(c),i?a=s.length:a+=c.length}),D.getBufferedValue=()=>t?s:n?Buffer.concat(s,a):s.join(""),D.getBufferedLength=()=>a,D},"bufferStream"),ne}o(Go,"requireBufferStream");var YD;function qo(){if(YD)return J.exports;YD=1;const{constants:u}=nr,e=Mu,{promisify:t}=Qe,r=Go(),n=t(e.pipeline),a=class a extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};o(a,"MaxBufferError");let i=a;async function D(s,c){if(!s)throw new Error("Expected a stream");c={maxBuffer:1/0,...c};const{maxBuffer:F}=c,C=r(c);return await new Promise((l,E)=>{const d=o(m=>{m&&C.getBufferedLength()<=u.MAX_LENGTH&&(m.bufferedData=C.getBufferedValue()),E(m)},"rejectPromise");(async()=>{try{await n(s,C),l()}catch(m){d(m)}})(),C.on("data",()=>{C.getBufferedLength()>F&&d(new i)})}),C.getBufferedValue()}return o(D,"getStream"),J.exports=D,J.exports.buffer=(s,c)=>D(s,{...c,encoding:"buffer"}),J.exports.array=(s,c)=>D(s,{...c,array:!0}),J.exports.MaxBufferError=i,J.exports}o(qo,"requireGetStream");var Uo=qo(),KD=z(Uo),oe,VD;function Wo(){if(VD)return oe;VD=1;const{PassThrough:u}=Mu;return oe=o(function(){var e=[],t=new u({objectMode:!0});return t.setMaxListeners(0),t.add=r,t.isEmpty=n,t.on("unpipe",i),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",i.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 i(D){e=e.filter(function(a){return a!==D}),!e.length&&t.readable&&t.end()}o(i,"remove")},"mergeStream$1"),oe}o(Wo,"requireMergeStream");var zo=Wo(),Ho=z(zo);const Yo=o(u=>{if(u!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},"validateInputOptions"),Ko=o(({input:u,inputFile:e})=>typeof e!="string"?u:(Yo(u),rr(e)),"getInput"),Vo=o((u,e)=>{const t=Ko(e);t!==void 0&&(WD(t)?t.pipe(u.stdin):u.stdin.end(t))},"handleInput"),Zo=o((u,{all:e})=>{if(!e||!u.stdout&&!u.stderr)return;const t=Ho();return u.stdout&&t.add(u.stdout),u.stderr&&t.add(u.stderr),t},"makeAllStream"),se=o(async(u,e)=>{if(!(!u||e===void 0)){u.destroy();try{return await e}catch(t){return t.bufferedData}}},"getBufferedData"),ie=o((u,{encoding:e,buffer:t,maxBuffer:r})=>{if(!(!u||!t))return e?KD(u,{encoding:e,maxBuffer:r}):KD.buffer(u,{maxBuffer:r})},"getStreamPromise"),Jo=o(async({stdout:u,stderr:e,all:t},{encoding:r,buffer:n,maxBuffer:i},D)=>{const a=ie(u,{encoding:r,buffer:n,maxBuffer:i}),s=ie(e,{encoding:r,buffer:n,maxBuffer:i}),c=ie(t,{encoding:r,buffer:n,maxBuffer:i*2});try{return await Promise.all([D,a,s,c])}catch(F){return Promise.all([{error:F,signal:F.signal,timedOut:F.timedOut},se(u,a),se(e,s),se(t,c)])}},"getSpawnedResult"),Xo=(async()=>{})().constructor.prototype,Qo=["then","catch","finally"].map(u=>[u,Reflect.getOwnPropertyDescriptor(Xo,u)]),ZD=o((u,e)=>{for(const[t,r]of Qo){const n=typeof e=="function"?(...i)=>Reflect.apply(r.value,e(),i):r.value.bind(e);Reflect.defineProperty(u,t,{...r,value:n})}},"mergePromise"),us=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"),JD=o((u,e=[])=>Array.isArray(e)?[u,...e]:[u],"normalizeArgs"),es=/^[\w.-]+$/,Ds=/"/g,ts=o(u=>typeof u!="string"||es.test(u)?u:`"${u.replace(Ds,'\\"')}"`,"escapeArg"),rs=o((u,e)=>JD(u,e).join(" "),"joinCommand"),ns=o((u,e)=>JD(u,e).map(t=>ts(t)).join(" "),"getEscapedCommand"),os=or("execa").enabled,gu=o((u,e)=>String(u).padStart(e,"0"),"padField"),ss=o(()=>{const u=new Date;return`${gu(u.getHours(),2)}:${gu(u.getMinutes(),2)}:${gu(u.getSeconds(),2)}.${gu(u.getMilliseconds(),3)}`},"getTimestamp"),is=o((u,{verbose:e})=>{e&&S.stderr.write(`[${ss()}] ${u}
|
|
27
|
-
`)},"logCommand"),as=1e3*1e3*100,cs=o(({env:u,extendEnv:e,preferLocal:t,localDir:r,execPath:n})=>{const i=e?{...S.env,...u}:u;return t?eo({env:i,cwd:r,execPath:n}):i},"getEnv"),ls=o((u,e,t={})=>{const r=Zn._parse(u,e,t);return u=r.command,e=r.args,t=r.options,t={maxBuffer:as,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:t.cwd||S.cwd(),execPath:S.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:os,...t},t.env=cs(t),t.stdio=bo(t),S.platform==="win32"&&Z.basename(u,".exe")==="cmd"&&e.unshift("/q"),{file:u,args:e,options:t,parsed:r}},"handleArguments"),ae=o((u,e,t)=>typeof e!="string"&&!Qt.isBuffer(e)?t===void 0?void 0:"":u.stripFinalNewline?Jn(e):e,"handleOutput");function X(u,e,t){const r=ls(u,e,t),n=rs(u,e),i=ns(u,e);is(i,r.options),Mo(r.options);let D;try{D=He.spawn(r.file,r.args,r.options)}catch(E){const d=new He.ChildProcess,m=Promise.reject(GD({error:E,stdout:"",stderr:"",all:"",command:n,escapedCommand:i,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return ZD(d,m),d}const a=us(D),s=ko(D,r.options,a),c=No(D,r.options,s),F={isCanceled:!1};D.kill=So.bind(null,D.kill.bind(D)),D.cancel=_o.bind(null,D,F);const l=MD(o(async()=>{const[{error:E,exitCode:d,signal:m,timedOut:f},p,h,g]=await Jo(D,r.options,c),B=ae(r.options,p),b=ae(r.options,h),y=ae(r.options,g);if(E||d!==0||m!==null){const x=GD({error:E,exitCode:d,signal:m,stdout:B,stderr:b,all:y,command:n,escapedCommand:i,parsed:r,timedOut:f,isCanceled:F.isCanceled||(r.options.signal?r.options.signal.aborted:!1),killed:D.killed});if(!r.options.reject)return x;throw x}return{command:n,escapedCommand:i,exitCode:0,stdout:B,stderr:b,all:y,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}},"handlePromise"));return Vo(D,r.options),D.all=Zo(D,r.options),Lo(D),ZD(D,l),D}o(X,"execa");let K=!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"?K=!1:u==="1"||u==="2"||u==="3"?K=!0:r==="dumb"?K=!1:"CI"in Q.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(i=>i in Q.process.env)?K=!0:K=process.stdout.isTTY,K&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?nu=3:r&&(r.endsWith("-256color")||r.endsWith("256"))?nu=2:nu=1)}let XD={enabled:K,supportLevel:nu};function ou(u,e,t=1){const r=`\x1B[${u}m`,n=`\x1B[${e}m`,i=new RegExp(`\\x1b\\[${e}m`,"g");return D=>XD.enabled&&XD.supportLevel>=t?r+(""+D).replace(i,r)+n:""+D}o(ou,"kolorist");const ce=ou(2,22),QD=ou(30,39),Bu=ou(31,39),su=ou(32,39),ut=ou(46,49);var le,et;function Fs(){if(et)return le;et=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 s="";return D<0?s+=`${e}${-D}D`:D>0&&(s+=`${e}${D}C`),a<0?s+=`${e}${-a}A`:a>0&&(s+=`${e}${a}B`),s},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")},i={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 s=0;s<D;s++)a+=this.line+(s<D-1?r.up():"");return D&&(a+=r.left),a}};return le={cursor:r,scroll:n,erase:i,beep:t},le}o(Fs,"requireSrc$2");var O=Fs(),yu={exports:{}},Dt;function Cs(){if(Dt)return yu.exports;Dt=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,s,c=a)=>F=>{let C=""+F,l=C.indexOf(s,a.length);return~l?a+i(C,s,c,l)+s:a+C+s},"formatter"),i=o((a,s,c,F)=>{let C="",l=0;do C+=a.substring(l,F)+c,l=F+s.length,F=a.indexOf(s,l);while(~F);return C+a.substring(l)},"replaceClose"),D=o((a=r)=>{let s=a?n:()=>String;return{isColorSupported:a,reset:s("\x1B[0m","\x1B[0m"),bold:s("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:s("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:s("\x1B[3m","\x1B[23m"),underline:s("\x1B[4m","\x1B[24m"),inverse:s("\x1B[7m","\x1B[27m"),hidden:s("\x1B[8m","\x1B[28m"),strikethrough:s("\x1B[9m","\x1B[29m"),black:s("\x1B[30m","\x1B[39m"),red:s("\x1B[31m","\x1B[39m"),green:s("\x1B[32m","\x1B[39m"),yellow:s("\x1B[33m","\x1B[39m"),blue:s("\x1B[34m","\x1B[39m"),magenta:s("\x1B[35m","\x1B[39m"),cyan:s("\x1B[36m","\x1B[39m"),white:s("\x1B[37m","\x1B[39m"),gray:s("\x1B[90m","\x1B[39m"),bgBlack:s("\x1B[40m","\x1B[49m"),bgRed:s("\x1B[41m","\x1B[49m"),bgGreen:s("\x1B[42m","\x1B[49m"),bgYellow:s("\x1B[43m","\x1B[49m"),bgBlue:s("\x1B[44m","\x1B[49m"),bgMagenta:s("\x1B[45m","\x1B[49m"),bgCyan:s("\x1B[46m","\x1B[49m"),bgWhite:s("\x1B[47m","\x1B[49m"),blackBright:s("\x1B[90m","\x1B[39m"),redBright:s("\x1B[91m","\x1B[39m"),greenBright:s("\x1B[92m","\x1B[39m"),yellowBright:s("\x1B[93m","\x1B[39m"),blueBright:s("\x1B[94m","\x1B[39m"),magentaBright:s("\x1B[95m","\x1B[39m"),cyanBright:s("\x1B[96m","\x1B[39m"),whiteBright:s("\x1B[97m","\x1B[39m"),bgBlackBright:s("\x1B[100m","\x1B[49m"),bgRedBright:s("\x1B[101m","\x1B[49m"),bgGreenBright:s("\x1B[102m","\x1B[49m"),bgYellowBright:s("\x1B[103m","\x1B[49m"),bgBlueBright:s("\x1B[104m","\x1B[49m"),bgMagentaBright:s("\x1B[105m","\x1B[49m"),bgCyanBright:s("\x1B[106m","\x1B[49m"),bgWhiteBright:s("\x1B[107m","\x1B[49m")}},"createColors");return yu.exports=D(),yu.exports.createColors=D,yu.exports}o(Cs,"requirePicocolors");var fs=Cs(),A=z(fs);function ds({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(ds,"DD");const Es=ds();function tt(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(Es,"")}o(tt,"P$1");function rt(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}o(rt,"L$1");var nt={exports:{}};(function(u){var e={};u.exports=e,e.eastAsianWidth=function(r){var n=r.charCodeAt(0),i=r.length==2?r.charCodeAt(1):0,D=n;return 55296<=n&&n<=56319&&56320<=i&&i<=57343&&(n&=1023,i&=1023,D=n<<10|i,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),i=0,D=0;D<n.length;D++)i=i+this.characterLength(n[D]);return i},e.slice=function(r,n,i){textLen=e.length(r),n=n||0,i=i||1,n<0&&(n=textLen+n),i<0&&(i=textLen+i);for(var D="",a=0,s=t(r),c=0;c<s.length;c++){var F=s[c],C=e.length(F);if(a>=n-(C==2?1:0))if(a+C<=i)D+=F;else break;a+=C}return D}})(nt);var ps=nt.exports;const hs=rt(ps);var ms=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 gs=rt(ms);function iu(u,e={}){if(typeof u!="string"||u.length===0||(e={ambiguousIsNarrow:!0,...e},u=tt(u),u.length===0))return 0;u=u.replace(gs()," ");const t=e.ambiguousIsNarrow?1:2;let r=0;for(const n of u){const i=n.codePointAt(0);if(!(i<=31||i>=127&&i<=159||i>=768&&i<=879))switch(hs.eastAsianWidth(n)){case"F":case"W":r+=2;break;case"A":r+=t;break;default:r+=1}}return r}o(iu,"p");const Fe=10,ot=o((u=0)=>e=>`\x1B[${e+u}m`,"N"),st=o((u=0)=>e=>`\x1B[${38+u};5;${e}m`,"I"),it=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 Bs=Object.keys(w.color),ys=Object.keys(w.bgColor);[...Bs,...ys];function bs(){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=ot(),w.color.ansi256=st(),w.color.ansi16m=it(),w.bgColor.ansi=ot(Fe),w.bgColor.ansi256=st(Fe),w.bgColor.ansi16m=it(Fe),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(i=>i+i).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 i=Math.max(t,r,n)*2;if(i===0)return 30;let D=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return i===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(bs,"rD");const As=bs(),bu=new Set(["\x1B","\x9B"]),vs=39,Ce="\x07",at="[",ws="]",ct="m",fe=`${ws}8;;`,lt=o(u=>`${bu.values().next().value}${at}${u}${ct}`,"z"),Ft=o(u=>`${bu.values().next().value}${fe}${u}${Ce}`,"K"),$s=o(u=>u.split(" ").map(e=>iu(e)),"aD"),de=o((u,e,t)=>{const r=[...e];let n=!1,i=!1,D=iu(tt(u[u.length-1]));for(const[a,s]of r.entries()){const c=iu(s);if(D+c<=t?u[u.length-1]+=s:(u.push(s),D=0),bu.has(s)&&(n=!0,i=r.slice(a+1).join("").startsWith(fe)),n){i?s===Ce&&(n=!1,i=!1):s===ct&&(n=!1);continue}D+=c,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"),xs=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"),Ss=o((u,e,t={})=>{if(t.trim!==!1&&u.trim()==="")return"";let r="",n,i;const D=$s(u);let a=[""];for(const[c,F]of u.split(" ").entries()){t.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let C=iu(a[a.length-1]);if(c!==0&&(C>=e&&(t.wordWrap===!1||t.trim===!1)&&(a.push(""),C=0),(C>0||t.trim===!1)&&(a[a.length-1]+=" ",C++)),t.hard&&D[c]>e){const l=e-C,E=1+Math.floor((D[c]-l-1)/e);Math.floor((D[c]-1)/e)<E&&a.push(""),de(a,F,e);continue}if(C+D[c]>e&&C>0&&D[c]>0){if(t.wordWrap===!1&&C<e){de(a,F,e);continue}a.push("")}if(C+D[c]>e&&t.wordWrap===!1){de(a,F,e);continue}a[a.length-1]+=F}t.trim!==!1&&(a=a.map(c=>xs(c)));const s=[...a.join(`
|
|
28
|
-
`)];for(const[c,F]of s.entries()){if(r+=F,bu.has(F)){const{groups:l}=new RegExp(`(?:\\${at}(?<code>\\d+)m|\\${fe}(?<uri>.*)${Ce})`).exec(s.slice(c).join(""))||{groups:{}};if(l.code!==void 0){const E=Number.parseFloat(l.code);n=E===vs?void 0:E}else l.uri!==void 0&&(i=l.uri.length===0?void 0:l.uri)}const C=As.codes.get(Number(n));s[c+1]===`
|
|
29
|
-
`?(i&&(r+=Ft("")),n&&C&&(r+=lt(C))):F===`
|
|
30
|
-
`&&(n&&C&&(r+=lt(n)),i&&(r+=Ft(i)))}return r},"lD");function Ct(u,e,t){return String(u).normalize().replace(/\r\n/g,`
|
|
31
|
-
`).split(`
|
|
32
|
-
`).map(r=>Ss(r,e,t)).join(`
|
|
33
|
-
`)}o(Ct,"Y$1");const Os=["up","down","left","right","space","enter","cancel"],Au={actions:new Set(Os),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function Ee(u,e){if(typeof u=="string")return Au.aliases.get(u)===e;for(const t of u)if(t!==void 0&&Ee(t,e))return!0;return!1}o(Ee,"$");function Is(u,e){if(u===e)return;const t=u.split(`
|
|
34
|
-
`),r=e.split(`
|
|
35
|
-
`),n=[];for(let i=0;i<Math.max(t.length,r.length);i++)t[i]!==r[i]&&n.push(i);return n}o(Is,"BD");const Ps=globalThis.process.platform.startsWith("win"),pe=Symbol("clack:cancel");function ft(u){return u===pe}o(ft,"pD");function vu(u,e){const t=u;t.isTTY&&t.setRawMode(e)}o(vu,"m");function Ts({input:u=Ke,output:e=Ye,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 i=o((D,{name:a,sequence:s})=>{const c=String(D);if(Ee([c,a,s],"cancel")){r&&e.write(O.cursor.show),process.exit(0);return}if(!t)return;const F=a==="return"?0:-1,C=a==="return"?-1:0;lu.moveCursor(e,F,C,()=>{lu.clearLine(e,1,()=>{u.once("keypress",i)})})},"i");return r&&e.write(O.cursor.hide),u.once("keypress",i),()=>{u.off("keypress",i),r&&e.write(O.cursor.show),u.isTTY&&!Ps&&u.setRawMode(!1),n.terminal=!1,n.close()}}o(Ts,"fD");var _s=Object.defineProperty,Rs=o((u,e,t)=>e in u?_s(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t,"vD"),_=o((u,e,t)=>(Rs(u,typeof e!="symbol"?e+"":e,t),t),"h");const je=class je{constructor(e,t=!0){_(this,"input"),_(this,"output"),_(this,"_abortSignal"),_(this,"rl"),_(this,"opts"),_(this,"_render"),_(this,"_track",!1),_(this,"_prevFrame",""),_(this,"_subscribers",new Map),_(this,"_cursor",0),_(this,"state","initial"),_(this,"error",""),_(this,"value");const{input:r=Ke,output:n=Ye,render:i,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=i.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 i of r)i.cb(...t),i.once&&n.push(()=>r.splice(r.indexOf(i),1));for(const i of n)i()}prompt(){return new Promise((e,t)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(pe);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}const r=new sr;r._write=(n,i,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=uD.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),uD.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),vu(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),vu(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(O.cursor.show),this.output.off("resize",this.render),vu(this.input,!1),e(pe)})})}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")}Ee([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
|
-
`),vu(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const e=Ct(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
37
|
-
`).length-1;this.output.write(O.cursor.move(-999,e*-1))}render(){const e=Ct(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=Is(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(je,"x");let wu=je;const Le=class Le extends wu{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(Le,"dD");let he=Le;var ks=Object.defineProperty,Ms=o((u,e,t)=>e in u?ks(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t,"PD"),dt=o((u,e,t)=>(Ms(u,typeof e!="symbol"?e+"":e,t),t),"J");const Ge=class Ge extends wu{constructor(e){super(e,!1),dt(this,"options"),dt(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(Ge,"LD");let me=Ge;function Ns(){return S.platform!=="win32"?S.env.TERM!=="linux":!!S.env.CI||!!S.env.WT_SESSION||!!S.env.TERMINUS_SUBLIME||S.env.ConEmuTask==="{cmd::Cmder}"||S.env.TERM_PROGRAM==="Terminus-Sublime"||S.env.TERM_PROGRAM==="vscode"||S.env.TERM==="xterm-256color"||S.env.TERM==="alacritty"||S.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}o(Ns,"ce");const ge=Ns(),j=o((u,e)=>ge?u:e,"u"),js=j("\u25C6","*"),Et=j("\u25A0","x"),pt=j("\u25B2","x"),ht=j("\u25C7","o"),Ls=j("\u250C","T"),T=j("\u2502","|"),Be=j("\u2514","\u2014"),ye=j("\u25CF",">"),be=j("\u25CB"," "),mt=o(u=>{switch(u){case"initial":case"active":return A.cyan(js);case"cancel":return A.red(Et);case"error":return A.yellow(pt);case"submit":return A.green(ht)}},"b"),Gs=o(u=>{const{cursor:e,options:t,style:r}=u,n=u.maxItems??Number.POSITIVE_INFINITY,i=Math.max(process.stdout.rows-4,0),D=Math.min(i,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 s=D<t.length&&a>0,c=D<t.length&&a+D<t.length;return t.slice(a,a+D).map((F,C,l)=>{const E=C===0&&s,d=C===l.length-1&&c;return E||d?A.dim("..."):r(F,C+a===e)})},"G"),qs=o(u=>{const e=u.active??"Yes",t=u.inactive??"No";return new he({active:e,inactive:t,initialValue:u.initialValue??!0,render(){const r=`${A.gray(T)}
|
|
41
|
-
${mt(this.state)} ${u.message}
|
|
42
|
-
`,n=this.value?e:t;switch(this.state){case"submit":return`${r}${A.gray(T)} ${A.dim(n)}`;case"cancel":return`${r}${A.gray(T)} ${A.strikethrough(A.dim(n))}
|
|
43
|
-
${A.gray(T)}`;default:return`${r}${A.cyan(T)} ${this.value?`${A.green(ye)} ${e}`:`${A.dim(be)} ${A.dim(e)}`} ${A.dim("/")} ${this.value?`${A.dim(be)} ${A.dim(t)}`:`${A.green(ye)} ${t}`}
|
|
44
|
-
${A.cyan(Be)}
|
|
45
|
-
`}}}).prompt()},"ye"),Us=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(ye)} ${n} ${t.hint?A.dim(`(${t.hint})`):""}`;case"cancelled":return`${A.strikethrough(A.dim(n))}`;default:return`${A.dim(be)} ${A.dim(n)}`}},"n");return new me({options:u.options,initialValue:u.initialValue,render(){const t=`${A.gray(T)}
|
|
46
|
-
${mt(this.state)} ${u.message}
|
|
47
|
-
`;switch(this.state){case"submit":return`${t}${A.gray(T)} ${e(this.options[this.cursor],"selected")}`;case"cancel":return`${t}${A.gray(T)} ${e(this.options[this.cursor],"cancelled")}
|
|
48
|
-
${A.gray(T)}`;default:return`${t}${A.cyan(T)} ${Gs({cursor:this.cursor,options:this.options,maxItems:u.maxItems,style:o((r,n)=>e(r,n?"active":"inactive"),"style")}).join(`
|
|
49
|
-
${A.cyan(T)} `)}
|
|
50
|
-
${A.cyan(Be)}
|
|
51
|
-
`}}}).prompt()},"ve"),gt=o((u="")=>{process.stdout.write(`${A.gray(Ls)} ${u}
|
|
52
|
-
`)},"Ie"),V=o((u="")=>{process.stdout.write(`${A.gray(T)}
|
|
53
|
-
${A.gray(Be)} ${u}
|
|
54
|
-
|
|
55
|
-
`)},"Se");`${A.gray(T)}`;const Ae=o(({indicator:u="dots"}={})=>{const e=ge?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],t=ge?80:120,r=process.env.CI==="true";let n,i,D=!1,a="",s,c=performance.now();const F=o(B=>{const b=B>1?"Something went wrong":"Canceled";D&&g(b,B)},"p"),C=o(()=>F(2),"v"),l=o(()=>F(1),"f"),E=o(()=>{process.on("uncaughtExceptionMonitor",C),process.on("unhandledRejection",C),process.on("SIGINT",l),process.on("SIGTERM",l),process.on("exit",F)},"j"),d=o(()=>{process.removeListener("uncaughtExceptionMonitor",C),process.removeListener("unhandledRejection",C),process.removeListener("SIGINT",l),process.removeListener("SIGTERM",l),process.removeListener("exit",F)},"E"),m=o(()=>{if(s===void 0)return;r&&process.stdout.write(`
|
|
56
|
-
`);const B=s.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),x=Math.floor(b%60);return y>0?`[${y}m ${x}s]`:`[${x}s]`},"O"),h=o((B="")=>{D=!0,n=Ts(),a=f(B),c=performance.now(),process.stdout.write(`${A.gray(T)}
|
|
58
|
-
`);let b=0,y=0;E(),i=setInterval(()=>{if(r&&a===s)return;m(),s=a;const x=A.magenta(e[b]);if(r)process.stdout.write(`${x} ${a}...`);else if(u==="timer")process.stdout.write(`${x} ${a} ${p(c)}`);else{const k=".".repeat(Math.floor(y)).slice(0,3);process.stdout.write(`${x} ${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(i),m();const y=b===0?A.green(ht):b===1?A.red(Et):A.red(pt);a=f(B??a),u==="timer"?process.stdout.write(`${y} ${a} ${p(c)}
|
|
59
|
-
`):process.stdout.write(`${y} ${a}
|
|
60
|
-
`),d(),n()},"N");return{start:h,stop:g,message:o((B="")=>{a=f(B??a)},"message")}},"Y"),qe=class qe extends Error{};o(qe,"KnownError");let v=qe;const ve=" ",$u=o(u=>{u instanceof Error&&!(u instanceof v)&&(u.stack&&console.error(ce(u.stack.split(`
|
|
61
|
-
`).slice(1).join(`
|
|
62
|
-
`))),console.error(`
|
|
63
|
-
${ve}${ce(`aicommit v${Hu.version}`)}`),console.error(`
|
|
64
|
-
${ve}Please open a Bug report with the information above:`),console.error(`${ve}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 v("The current directory must be a Git repository!");return u},"assertGitRepo"),$e=o(u=>`:(exclude)${u}`,"excludeFromDiff"),Bt=["package-lock.json","*.lock"].map($e),yt=o(async u=>{const e=["diff","--cached","--diff-algorithm=minimal"],{stdout:t}=await X("git",[...e,"--name-only",...Bt,...u?u.map($e):[]]);if(!t)return;const{stdout:r}=await X("git",[...e,...Bt,...u?u.map($e):[]]);return{files:t.split(`
|
|
65
|
-
`),diff:r}},"getStagedDiff"),Ws=o(u=>`Detected ${u.length.toLocaleString()} staged file${u.length>1?"s":""}`,"getDetectedMessage");var xe,bt;function zs(){if(bt)return xe;bt=1;const{hasOwnProperty:u}=Object.prototype,e=o((a,s={})=>{typeof s=="string"&&(s={section:s}),s.align=s.align===!0,s.newline=s.newline===!0,s.sort=s.sort===!0,s.whitespace=s.whitespace===!0||s.align===!0,s.platform=s.platform||typeof process<"u"&&process.platform,s.bracketedArray=s.bracketedArray!==!1;const c=s.platform==="win32"?`\r
|
|
66
|
-
`:`
|
|
67
|
-
`,F=s.whitespace?" = ":"=",C=[],l=s.sort?Object.keys(a).sort():Object.keys(a);let E=0;s.align&&(E=i(l.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)=>i(f).length>=i(p).length?f:p)).length);let d="";const m=s.bracketedArray?"[]":"";for(const f of l){const p=a[f];if(p&&Array.isArray(p))for(const h of p)d+=i(`${f}${m}`).padEnd(E," ")+F+i(h)+c;else p&&typeof p=="object"?C.push(f):d+=i(f).padEnd(E," ")+F+i(p)+c}s.section&&d.length&&(d="["+i(s.section)+"]"+(s.newline?c+c:c)+d);for(const f of C){const p=t(f,".").join("\\."),h=(s.section?s.section+".":"")+p,g=e(a[f],{...s,section:h});d.length&&g.length&&(d+=c),d+=g}return d},"encode");function t(a,s){var c=0,F=0,C=0,l=[];do if(C=a.indexOf(s,c),C!==-1){if(c=C+s.length,C>0&&a[C-1]==="\\")continue;l.push(a.slice(F,C)),F=C+s.length}while(C!==-1);return l.push(a.slice(F)),l}o(t,"splitSections");const r=o((a,s={})=>{s.bracketedArray=s.bracketedArray!==!1;const c=Object.create(null);let F=c,C=null;const l=/^\[([^\]]*)\]\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(l);if(!p)continue;if(p[1]!==void 0){if(C=D(p[1]),C==="__proto__"){F=Object.create(null);continue}F=c[C]=c[C]||Object.create(null);continue}const h=D(p[2]);let g;s.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(F,B)?Array.isArray(F[B])||(F[B]=[F[B]]):F[B]=[]),Array.isArray(F[B])?F[B].push(y):F[B]=y}const m=[];for(const f of Object.keys(c)){if(!u.call(c,f)||typeof c[f]!="object"||Array.isArray(c[f]))continue;const p=t(f,".");F=c;const h=p.pop(),g=h.replace(/\\\./g,".");for(const B of p)B!=="__proto__"&&((!u.call(F,B)||typeof F[B]!="object")&&(F[B]=Object.create(null)),F=F[B]);F===c&&g===h||(F[g]=c[f],m.push(f))}for(const f of m)delete c[f];return c},"decode"),n=o(a=>a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"),"isQuoted"),i=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 s=!1,c="";for(let F=0,C=a.length;F<C;F++){const l=a.charAt(F);if(s)"\\;#".indexOf(l)!==-1?c+=l:c+="\\"+l,s=!1;else{if(";#".indexOf(l)!==-1)break;l==="\\"?s=!0:c+=l}}return s&&(c+="\\"),c.trim()}return a},"unsafe");return xe={parse:r,decode:r,stringify:e,encode:e,safe:i,unsafe:D},xe}o(zs,"requireIni");var Hs=zs(),At=z(Hs);const xu=o(u=>I.lstat(u).then(()=>!0,()=>!1),"fileExists"),vt=o(async u=>{try{let e;try{e=u||await we()}catch(D){if(D instanceof v&&D.message.includes("Git repository"))return;throw D}const t=G.join(e,".ai-commit.json");if(!await xu(t))return;const n=await I.readFile(t,"utf8");return JSON.parse(n)}catch(e){if(e instanceof v)throw e;return}},"getProjectConfig");function Ys(u){const e={},t=u.split(`
|
|
68
|
-
`);for(const r of t){const n=r.trim();if(!n||n.startsWith("#"))continue;const i=n.match(/^([A-Z_][A-Z0-9_]*)\s*=\s*(.*)$/i);if(!i)continue;const[,D,a]=i;let s=a.trim();(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))&&(s=s.slice(1,-1)),e[D]=s}return e}o(Ys,"parseEnvContent");async function wt(u){const{filename:e=".env",directory:t=process.cwd(),override:r=!1}=u||{},n=G.join(t,e);if(!await xu(n))return{};try{const D=await I.readFile(n,"utf8"),a=Ys(D);for(const[s,c]of Object.entries(a))(r||process.env[s]===void 0)&&(process.env[s]=c);return a}catch{return{}}}o(wt,"loadEnvFile");async function Ks(){process.env.NODE_ENV==="test"?await wt({filename:".env.local"}):await wt({filename:".env"})}o(Ks,"loadEnvironment");const $t=["openai","anthropic","azure-openai","ollama","custom"],Vs=["","conventional"],{hasOwnProperty:Zs}=Object.prototype,xt=o((u,e)=>Zs.call(u,e),"hasOwn"),$=o((u,e,t)=>{if(!e)throw new v(`Invalid config property ${u}: ${t}`)},"parseAssert"),Su={provider(u){return u?($("provider",$t.includes(u),`Must be one of: ${$t.join(", ")}`),u):"openai"},OPENAI_KEY(u){if(u)return $("OPENAI_KEY",u.startsWith("sk-"),'Must start with "sk-"'),u},ANTHROPIC_KEY(u){if(u)return $("ANTHROPIC_KEY",u.startsWith("sk-ant-"),'Must start with "sk-ant-"'),u},AZURE_OPENAI_KEY(u){return u},AZURE_ENDPOINT(u){if(u)return $("AZURE_ENDPOINT",/^https?:\/\//.test(u),"Must be a valid URL"),u},OLLAMA_ENDPOINT(u){return u?($("OLLAMA_ENDPOINT",/^https?:\/\//.test(u),"Must be a valid URL"),u):"http://localhost:11434"},CUSTOM_ENDPOINT(u){if(u)return $("CUSTOM_ENDPOINT",/^https?:\/\//.test(u),"Must be a valid URL"),u},CUSTOM_KEY(u){return u},locale(u){return u?($("locale",u,"Cannot be empty"),$("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;$("generate",/^\d+$/.test(u),"Must be an integer");const e=Number(u);return $("generate",e>0,"Must be greater than 0"),$("generate",e<=5,"Must be less or equal to 5"),e},type(u){return u?($("type",Vs.includes(u),"Invalid commit type"),u):""},proxy(u){if(!(!u||u.length===0))return $("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;$("timeout",/^\d+$/.test(u),"Must be an integer");const e=Number(u);return $("timeout",e>=500,"Must be greater than 500ms"),e},temperature(u){if(!u)return .2;$("temperature",/^(2|\d)(\.\d{1,2})?$/.test(u),"Must be decimal between 0 and 2");const e=Number(u);return $("temperature",e>0,"Must be greater than 0"),$("temperature",e<=2,"Must be less than or equal to 2"),e},"max-length"(u){if(!u)return 50;$("max-length",/^\d+$/.test(u),"Must be an integer");const e=Number(u);return $("max-length",e>=20,"Must be greater than 20 characters"),e},"max-completion-tokens"(u){if(!u)return 1e4;$("max-completion-tokens",/^\d+$/.test(u),"Must be an integer");const e=Number(u);return $("max-completion-tokens",e>0,"Must be greater than 0"),e},"auto-confirm"(u){return u?typeof u=="boolean"?u:($("auto-confirm",/^(?:true|false)$/.test(u),"Must be a boolean"),u==="true"):!1},"prepend-reference"(u){return u?typeof u=="boolean"?u:($("prepend-reference",/^(?:true|false)$/.test(u),"Must be a boolean"),u==="true"):!1}},Se=G.join(eD.homedir(),".aicommit"),St=o(async()=>{if(!await xu(Se))return Object.create(null);const e=await I.readFile(Se,"utf8");return At.parse(e)},"readConfigFile"),Js=o(u=>{const e=u.provider;switch(e){case"openai":if(!u.OPENAI_KEY)throw new v("Please set your OpenAI API key via `aicommit config set OPENAI_KEY=<your token>`");break;case"anthropic":if(!u.ANTHROPIC_KEY)throw new v("Please set your Anthropic API key via `aicommit config set ANTHROPIC_KEY=<your token>`\nGet your API key from: https://console.anthropic.com/");break;case"azure-openai":if(!u.AZURE_OPENAI_KEY)throw new v("Please set your Azure OpenAI API key via `aicommit config set AZURE_OPENAI_KEY=<your token>`");if(!u.AZURE_ENDPOINT)throw new v("Please set your Azure OpenAI endpoint via `aicommit config set AZURE_ENDPOINT=<your endpoint>`");break;case"ollama":break;case"custom":if(!u.CUSTOM_ENDPOINT)throw new v("Please set your custom endpoint via `aicommit config set CUSTOM_ENDPOINT=<your endpoint>`");break;default:throw new v(`Unknown provider: ${e}`)}},"validateProviderConfig"),Oe=o(async(u,e)=>{await Ks();const t=await St(),r=await vt(),n={};for(const D of Object.keys(Su)){const a=Su[D];let s=r?.[D]??u?.[D]??process.env[D]??t[D];if(typeof s=="boolean"&&(s=s.toString()),e)try{n[D]=a(s)}catch{}else n[D]=a(s)}const i=n;return e||Js(i),i},"getConfig"),Xs=o(async u=>{const e=await St();for(const[t,r]of u){if(!xt(Su,t))throw new v(`Invalid config property: ${t}`);const n=Su[t](r);e[t]=n}await I.writeFile(Se,At.stringify(e),"utf8")},"setConfigs");var U={},Ou={exports:{}},Iu={exports:{}},Ie,Ot;function Qs(){if(Ot)return Ie;Ot=1;var u=1e3,e=u*60,t=e*60,r=t*24,n=r*7,i=r*365.25;Ie=o(function(F,C){C=C||{};var l=typeof F;if(l==="string"&&F.length>0)return D(F);if(l==="number"&&isFinite(F))return C.long?s(F):a(F);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(F))},"ms");function D(F){if(F=String(F),!(F.length>100)){var C=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(F);if(C){var l=parseFloat(C[1]),E=(C[2]||"ms").toLowerCase();switch(E){case"years":case"year":case"yrs":case"yr":case"y":return l*i;case"weeks":case"week":case"w":return l*n;case"days":case"day":case"d":return l*r;case"hours":case"hour":case"hrs":case"hr":case"h":return l*t;case"minutes":case"minute":case"mins":case"min":case"m":return l*e;case"seconds":case"second":case"secs":case"sec":case"s":return l*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}}}o(D,"parse");function a(F){var C=Math.abs(F);return C>=r?Math.round(F/r)+"d":C>=t?Math.round(F/t)+"h":C>=e?Math.round(F/e)+"m":C>=u?Math.round(F/u)+"s":F+"ms"}o(a,"fmtShort");function s(F){var C=Math.abs(F);return C>=r?c(F,C,r,"day"):C>=t?c(F,C,t,"hour"):C>=e?c(F,C,e,"minute"):C>=u?c(F,C,u,"second"):F+" ms"}o(s,"fmtLong");function c(F,C,l,E){var d=C>=l*1.5;return Math.round(F/l)+" "+E+(d?"s":"")}return o(c,"plural"),Ie}o(Qs,"requireMs");var Pe,It;function Pt(){if(It)return Pe;It=1;function u(e){r.debug=r,r.default=r,r.coerce=c,r.disable=a,r.enable=i,r.enabled=s,r.humanize=Qs(),r.destroy=F,Object.keys(e).forEach(C=>{r[C]=e[C]}),r.names=[],r.skips=[],r.formatters={};function t(C){let l=0;for(let E=0;E<C.length;E++)l=(l<<5)-l+C.charCodeAt(E),l|=0;return r.colors[Math.abs(l)%r.colors.length]}o(t,"selectColor"),r.selectColor=t;function r(C){let l,E=null,d,m;function f(...p){if(!f.enabled)return;const h=f,g=Number(new Date),B=g-(l||g);h.diff=B,h.prev=l,h.curr=g,l=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,(x,k)=>{if(x==="%%")return"%";b++;const N=r.formatters[k];if(typeof N=="function"){const R=p[b];x=N.call(h,R),p.splice(b,1),b--}return x}),r.formatArgs.call(h,p),(h.log||r.log).apply(h,p)}return o(f,"debug"),f.namespace=C,f.useColors=r.useColors(),f.color=r.selectColor(C),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(C)),m),"get"),set:o(p=>{E=p},"set")}),typeof r.init=="function"&&r.init(f),f}o(r,"createDebug");function n(C,l){const E=r(this.namespace+(typeof l>"u"?":":l)+C);return E.log=this.log,E}o(n,"extend");function i(C){r.save(C),r.namespaces=C,r.names=[],r.skips=[];const l=(typeof C=="string"?C:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const E of l)E[0]==="-"?r.skips.push(E.slice(1)):r.names.push(E)}o(i,"enable");function D(C,l){let E=0,d=0,m=-1,f=0;for(;E<C.length;)if(d<l.length&&(l[d]===C[E]||l[d]==="*"))l[d]==="*"?(m=d,f=E,d++):(E++,d++);else if(m!==-1)d=m+1,f++,E=f;else return!1;for(;d<l.length&&l[d]==="*";)d++;return d===l.length}o(D,"matchesTemplate");function a(){const C=[...r.names,...r.skips.map(l=>"-"+l)].join(",");return r.enable(""),C}o(a,"disable");function s(C){for(const l of r.skips)if(D(C,l))return!1;for(const l of r.names)if(D(C,l))return!0;return!1}o(s,"enabled");function c(C){return C instanceof Error?C.stack||C.message:C}o(c,"coerce");function F(){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(F,"destroy"),r.enable(r.load()),r}return o(u,"setup"),Pe=u,Pe}o(Pt,"requireCommon");var Tt;function ui(){return Tt||(Tt=1,(function(u,e){e.formatArgs=r,e.save=n,e.load=i,e.useColors=t,e.storage=D(),e.destroy=(()=>{let s=!1;return()=>{s||(s=!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 s;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&&(s=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(s[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}o(t,"useColors");function r(s){if(s[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+s[0]+(this.useColors?"%c ":" ")+"+"+u.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;s.splice(1,0,c,"color: inherit");let F=0,C=0;s[0].replace(/%[a-zA-Z%]/g,l=>{l!=="%%"&&(F++,l==="%c"&&(C=F))}),s.splice(C,0,c)}o(r,"formatArgs"),e.log=console.debug||console.log||(()=>{});function n(s){try{s?e.storage.setItem("debug",s):e.storage.removeItem("debug")}catch{}}o(n,"save");function i(){let s;try{s=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!s&&typeof process<"u"&&"env"in process&&(s=process.env.DEBUG),s}o(i,"load");function D(){try{return localStorage}catch{}}o(D,"localstorage"),u.exports=Pt()(e);const{formatters:a}=u.exports;a.j=function(s){try{return JSON.stringify(s)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}})(Iu,Iu.exports)),Iu.exports}o(ui,"requireBrowser");var Pu={exports:{}},Te,_t;function ei(){return _t||(_t=1,Te=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")),Te}o(ei,"requireHasFlag");var _e,Rt;function Di(){if(Rt)return _e;Rt=1;const u=eD,e=Ru,t=ei(),{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 i(s){return s===0?!1:{level:s,hasBasic:!0,has256:s>=2,has16m:s>=3}}o(i,"translateLevel");function D(s,c){if(n===0)return 0;if(t("color=16m")||t("color=full")||t("color=truecolor"))return 3;if(t("color=256"))return 2;if(s&&!c&&n===void 0)return 0;const F=n||0;if(r.TERM==="dumb")return F;if(process.platform==="win32"){const C=u.release().split(".");return Number(C[0])>=10&&Number(C[2])>=10586?Number(C[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(C=>C in r)||r.CI_NAME==="codeship"?1:F;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 C=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return C>=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:F}o(D,"supportsColor");function a(s){const c=D(s,s&&s.isTTY);return i(c)}return o(a,"getSupportLevel"),_e={supportsColor:a,stdout:i(D(!0,e.isatty(1))),stderr:i(D(!0,e.isatty(2)))},_e}o(Di,"requireSupportsColor");var kt;function ti(){return kt||(kt=1,(function(u,e){const t=Ru,r=Qe;e.init=F,e.log=a,e.formatArgs=i,e.save=s,e.load=c,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 l=Di();l&&(l.stderr||l).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(l=>/^debug_/i.test(l)).reduce((l,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),l[d]=m,l},{});function n(){return"colors"in e.inspectOpts?!!e.inspectOpts.colors:t.isatty(process.stderr.fd)}o(n,"useColors");function i(l){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`;l[0]=p+l[0].split(`
|
|
69
|
-
`).join(`
|
|
70
|
-
`+p),l.push(f+"m+"+u.exports.humanize(this.diff)+"\x1B[0m")}else l[0]=D()+E+" "+l[0]}o(i,"formatArgs");function D(){return e.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(D,"getDate");function a(...l){return process.stderr.write(r.formatWithOptions(e.inspectOpts,...l)+`
|
|
71
|
-
`)}o(a,"log");function s(l){l?process.env.DEBUG=l:delete process.env.DEBUG}o(s,"save");function c(){return process.env.DEBUG}o(c,"load");function F(l){l.inspectOpts={};const E=Object.keys(e.inspectOpts);for(let d=0;d<E.length;d++)l.inspectOpts[E[d]]=e.inspectOpts[E[d]]}o(F,"init"),u.exports=Pt()(e);const{formatters:C}=u.exports;C.o=function(l){return this.inspectOpts.colors=this.useColors,r.inspect(l,this.inspectOpts).split(`
|
|
72
|
-
`).map(E=>E.trim()).join(" ")},C.O=function(l){return this.inspectOpts.colors=this.useColors,r.inspect(l,this.inspectOpts)}})(Pu,Pu.exports)),Pu.exports}o(ti,"requireNode");var Mt;function Re(){return Mt||(Mt=1,typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Ou.exports=ui():Ou.exports=ti()),Ou.exports}o(Re,"requireSrc$1");var Tu={},Nt;function ri(){if(Nt)return Tu;Nt=1,Object.defineProperty(Tu,"__esModule",{value:!0});function u(e){return function(t,r){return new Promise((n,i)=>{e.call(this,t,r,(D,a)=>{D?i(D):n(a)})})}}return o(u,"promisify$1"),Tu.default=u,Tu}o(ri,"requirePromisify");var au,jt;function ni(){if(jt)return au;jt=1;var u=au&&au.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};const e=Xe,t=u(Re()),r=u(ri()),n=t.default("agent-base");function i(s){return!!s&&typeof s.addRequest=="function"}o(i,"isAgent");function D(){const{stack:s}=new Error;return typeof s!="string"?!1:s.split(`
|
|
73
|
-
`).some(c=>c.indexOf("(https.js:")!==-1||c.indexOf("node:https:")!==-1)}o(D,"isSecureEndpoint");function a(s,c){return new a.Agent(s,c)}return o(a,"createAgent"),(function(s){const F=class F extends e.EventEmitter{constructor(l,E){super();let d=E;typeof l=="function"?this.callback=l:l&&(d=l),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(l){this.explicitDefaultPort=l}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:D()?"https:":"http:"}set protocol(l){this.explicitProtocol=l}callback(l,E,d){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(l,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,l._last=!0,l.shouldKeepAlive=!1;let m=!1,f=null;const p=d.timeout||this.timeout,h=o(y=>{l._hadError||(l.emit("error",y),l._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),i(y)){n("Callback returned another Agent instance %o",y.constructor.name),y.addRequest(l,d);return}if(y){y.once("free",()=>{this.freeSocket(y,d)}),l.onSocket(y);return}const x=new Error(`no Duplex stream was returned to agent-base for \`${l.method} ${l.path}\``);h(x)},"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,`${l.method} ${l.path}`),Promise.resolve(this.promisifiedCallback(l,d)).then(b,B)}catch(y){Promise.reject(y).catch(B)}}freeSocket(l,E){n("Freeing socket %o %o",l.constructor.name,E),l.destroy()}destroy(){n("Destroying agent %o",this.constructor.name)}};o(F,"Agent");let c=F;s.Agent=c,s.prototype=s.Agent.prototype})(a||(a={})),au=a,au}o(ni,"requireSrc");var uu={},Lt;function oi(){if(Lt)return uu;Lt=1;var u=uu&&uu.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(uu,"__esModule",{value:!0});const t=u(Re()).default("https-proxy-agent:parse-proxy-response");function r(n){return new Promise((i,D)=>{let a=0;const s=[];function c(){const m=n.read();m?d(m):n.once("readable",c)}o(c,"read");function F(){n.removeListener("end",l),n.removeListener("error",E),n.removeListener("close",C),n.removeListener("readable",c)}o(F,"cleanup");function C(m){t("onclose had error %o",m)}o(C,"onclose");function l(){t("onend")}o(l,"onend");function E(m){F(),t("onerror %o",m),D(m)}o(E,"onerror");function d(m){s.push(m),a+=m.length;const f=Buffer.concat(s,a);if(f.indexOf(`\r
|
|
74
|
-
\r
|
|
75
|
-
`)===-1){t("have not received end of HTTP headers yet..."),c();return}const h=f.toString("ascii",0,f.indexOf(`\r
|
|
76
|
-
`)),g=+h.split(" ")[1];t("got proxy server response: %o",h),i({statusCode:g,buffered:f})}o(d,"ondata"),n.on("error",E),n.on("close",C),n.on("end",l),c()})}return o(r,"parseProxyResponse$1"),uu.default=r,uu}o(oi,"requireParseProxyResponse");var Gt;function si(){if(Gt)return U;Gt=1;var u=U&&U.__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 x(R){try{N(g.next(R))}catch(Du){y(Du)}}o(x,"fulfilled");function k(R){try{N(g.throw(R))}catch(Du){y(Du)}}o(k,"rejected");function N(R){R.done?b(R.value):B(R.value).then(x,k)}o(N,"step"),N((g=g.apply(f,p||[])).next())})},e=U&&U.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(U,"__esModule",{value:!0});const t=e(ar),r=e(cr),n=e(lr),i=e(Je),D=e(Re()),a=ni(),s=e(oi()),c=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!");c("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?(c("Creating `tls.Socket`: %o",g),b=r.default.connect(g)):(c("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
|
|
77
|
-
`;g.auth&&(y["Proxy-Authorization"]=`Basic ${Buffer.from(g.auth).toString("base64")}`);let{host:N,port:R,secureEndpoint:Du}=h;l(R,Du)||(N+=`:${R}`),y.Host=N,y.Connection="close";for(const L of Object.keys(y))k+=`${L}: ${y[L]}\r
|
|
78
|
-
`;const Vt=s.default(b);b.write(`${k}\r
|
|
79
|
-
`);const{statusCode:Zt,buffered:Jt}=yield Vt;if(Zt===200){if(p.once("socket",C),h.secureEndpoint){c("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 ze=new t.default.Socket({writable:!1});return ze.readable=!0,p.once("socket",L=>{c("replaying proxy buffer for failed request"),i.default(L.listenerCount("data")>0),L.push(Jt),L.push(null)}),ze})}};o(m,"HttpsProxyAgent");let F=m;U.default=F;function C(f){f.resume()}o(C,"resume");function l(f,p){return!!(!p&&f===80||p&&f===443)}o(l,"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"),U}o(si,"requireAgent");var cu,qt;function ii(){if(qt)return cu;qt=1;var u=cu&&cu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};const e=u(si());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(ii,"requireDist");var ai=ii(),ci=z(ai),li=Object.defineProperty,Fi=o((u,e,t)=>e in u?li(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t,"__defNormalProp"),Ci=o((u,e,t)=>Fi(u,e+"",t),"__publicField");const Ue=class Ue{constructor(e){Ci(this,"config"),this.config=e,this.validateConfig()}getConfig(){return this.config}updateConfig(e){this.config={...this.config,...e},this.validateConfig()}};o(Ue,"LLMProvider");let ke=Ue;const fi={"":"<commit message>",conventional:"<type>(<optional scope>): <commit message>"},di=o(u=>`The output response must be in format:
|
|
80
|
-
${fi[u]}`,"specifyCommitFormat"),Ei={"":"",conventional:`Choose a type from the type-to-description JSON below that best describes the git diff:
|
|
81
|
-
${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)}`},pi=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,Ei[t],di(t)].filter(Boolean).join(`
|
|
82
|
-
`),"generatePrompt"),We=class We extends ke{get name(){return"openai"}validateConfig(){const{apiKey:e}=this.config;if(!e)throw new v("Please set your OpenAI API key via `aicommit config set OPENAI_KEY=<your token>`");if(!e.startsWith("sk-"))throw new v('Invalid OpenAI API key: Must start with "sk-"')}async generateCommitMessage(e){try{const t=await this.createChatCompletion({model:this.config.model,messages:[{role:"system",content:pi(this.config.locale,this.config.maxLength,this.config.type,e.projectConfig)},{role:"user",content:e.diff}],temperature:this.config.temperature,top_p:1,frequency_penalty:0,presence_penalty:0,max_completion_tokens:this.config.maxCompletionTokens,stream:!1,n:e.completions});return{messages:this.deduplicateMessages(t.choices.filter(n=>n.message?.content).map(n=>this.sanitizeMessage(n.message.content)))}}catch(t){const r=t;throw r.code==="ENOTFOUND"?new v(`Error connecting to ${r.hostname} (${r.syscall}). Are you connected to the internet?`):r}}async createChatCompletion(e){const{response:t,data:r}=await this.httpsPost("api.openai.com","/v1/chat/completions",{Authorization:`Bearer ${this.config.apiKey}`},e);if(!t.statusCode||t.statusCode<200||t.statusCode>299){let n=`OpenAI API Error: ${t.statusCode} - ${t.statusMessage}`;throw r&&(n+=`
|
|
83
|
-
|
|
84
|
-
${r}`),t.statusCode===500&&(n+=`
|
|
85
|
-
|
|
86
|
-
Check the API status: https://status.openai.com`),new v(n)}return JSON.parse(r)}async httpsPost(e,t,r,n){return new Promise((i,D)=>{const a=JSON.stringify(n),s=ir.request({hostname:e,path:t,method:"POST",headers:{...r,"Content-Type":"application/json","Content-Length":Buffer.byteLength(a)},timeout:this.config.timeout,agent:this.config.proxy?ci(this.config.proxy):void 0},c=>{const F=[];c.on("data",C=>F.push(C)),c.on("end",()=>{i({request:s,response:c,data:Buffer.concat(F).toString()})})});s.on("error",D),s.on("timeout",()=>{s.destroy(),D(new v(`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`))}),s.write(a),s.end()})}sanitizeMessage(e){return e.trim().replace(/[\n\r]/g,"").replace(/(\w)\.$/,"$1")}deduplicateMessages(e){return Array.from(new Set(e))}};o(We,"OpenAIProvider");let Me=We;const Ut=o(async(u,e,t,r,n,i,D,a,s,c,F)=>{if(!u)throw new v("OpenAI API key is required. Please set it via `aicommit config set OPENAI_KEY=<your token>`");const C=await vt();return(await new Me({apiKey:u,model:e,locale:t,maxLength:i,type:D,timeout:a,temperature:s,maxCompletionTokens:c,proxy:F}).generateCommitMessage({diff:r,completions:n,projectConfig:C})).messages},"generateCommitMessage");var hi=o(async(u,e,t,r,n)=>(async()=>{gt(ut(QD(" aicommit "))),await we();const i=Ae();t&&await X("git",["add","--update"]),i.start("Detecting staged files");const D=await yt(e);if(!D)throw i.stop("Detecting staged files"),new v("No staged changes found. Stage your changes manually, or automatically stage all changes with the `--all` flag.");i.stop(`${Ws(D.files)}:
|
|
87
|
-
${D.files.map(l=>` ${l}`).join(`
|
|
88
|
-
`)}`);const{env:a}=process,s=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()}),c=Ae();c.start("The AI is analyzing your changes");let F;try{F=await Ut(s.OPENAI_KEY,s.model,s.locale,D.diff,s.generate,s["max-length"],s.type,s.timeout,s.temperature,s["max-completion-tokens"],s.proxy)}finally{c.stop("Changes analyzed")}if(F.length===0)throw new v("No commit messages were generated. Try again.");let C;if(F.length===1){[C]=F;let l;if(s["auto-confirm"]?(l=!0,V(`${su("\u2714")} Auto confirmed commit message.
|
|
89
|
-
|
|
90
|
-
${C}
|
|
91
|
-
`)):l=await qs({message:`Use this commit message?
|
|
92
|
-
|
|
93
|
-
${C}
|
|
94
|
-
`}),!l||ft(l)){V("Commit cancelled");return}}else{const l=await Us({message:`Pick a commit message to use: ${ce("(Ctrl+c to exit)")}`,options:F.map(E=>({label:E,value:E}))});if(ft(l)){V("Commit cancelled");return}C=l}if(s["prepend-reference"]){const{stdout:l}=await X("git",["branch","--show-current"]),E=l.match(/([a-zA-Z])+-([0-9]+)/)?.[0];E?.length&&(C=`${E?.toUpperCase()}: ${C}`)}await X("git",["commit","-m",C,...n]),V(`${su("\u2714")} Successfully committed!`)})().catch(i=>{V(`${Bu("\u2716")} ${i.message}`),$u(i),process.exit(1)}),"aicommit");const[Ne,mi]=process.argv.slice(2);var gi=o(()=>(async()=>{if(!Ne)throw new v('Commit message file path is missing. This file should be called from the "prepare-commit-msg" git hook');if(mi)return;const u=await yt();if(!u)return;gt(ut(QD(" aicommit ")));const{env:e}=process,t=await Oe({proxy:e.https_proxy||e.HTTPS_PROXY||e.http_proxy||e.HTTP_PROXY}),r=Ae();r.start("The AI is analyzing your changes");let n;try{n=await Ut(t.OPENAI_KEY,t.model,t.locale,u.diff,t.generate,t["max-length"],t.type,t.timeout,t.temperature,t["max-completion-tokens"],t.proxy)}finally{r.stop("Changes analyzed")}const D=await I.readFile(Ne,"utf8")!=="",a=n.length>1;let s="";D&&(s=`# \u{1F916} AI generated commit${a?"s":""}
|
|
95
|
-
`),a?(D&&(s+=`# Select one of the following messages by uncommeting:
|
|
96
|
-
`),s+=`
|
|
97
|
-
${n.map(c=>`# ${c}`).join(`
|
|
98
|
-
`)}`):(D&&(s+=`# Edit the message below and commit:
|
|
99
|
-
`),s+=`
|
|
100
|
-
${n[0]}
|
|
101
|
-
`),await I.appendFile(Ne,s),V(`${su("\u2714")} Saved commit message!`)})().catch(u=>{V(`${Bu("\u2716")} ${u.message}`),$u(u),process.exit(1)}),"prepareCommitMessageHook"),Bi=yD({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)xt(r,n)&&console.log(`${n}=${r[n]}`);return}if(e==="set"){await Xs(t.map(r=>r.split("=")));return}throw new v(`Invalid mode: ${e}`)})().catch(e=>{console.error(`${Bu("\u2716")} ${e.message}`),$u(e),process.exit(1)})});const Wt="prepare-commit-msg",zt=`.git/hooks/${Wt}`,_u=Fr(new URL("cli.mjs",import.meta.url)),yi=process.argv[1].replace(/\\/g,"/").endsWith(`/${zt}`),Ht=process.platform==="win32",Yt=`
|
|
102
|
-
#!/usr/bin/env node
|
|
103
|
-
import(${JSON.stringify(Cr(_u))})
|
|
104
|
-
`.trim();var bi=yD({name:"hook",parameters:["<install/uninstall>"]},u=>{(async()=>{const e=await we(),{installUninstall:t}=u._,r=G.join(e,zt),n=await xu(r);if(t==="install"){if(n){if(await I.realpath(r).catch(()=>{})===_u){console.warn("The hook is already installed");return}throw new v(`A different ${Wt} hook seems to be installed. Please remove it before installing aicommit.`)}await I.mkdir(G.dirname(r),{recursive:!0}),Ht?await I.writeFile(r,Yt):(await I.symlink(_u,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(Ht){if(await I.readFile(r,"utf8")!==Yt){console.warn("Hook is not installed");return}}else if(await I.realpath(r)!==_u){console.warn("Hook is not installed");return}await I.rm(r),console.log(`${su("\u2714")} Hook uninstalled`);return}throw new v(`Invalid mode: ${t}`)})().catch(e=>{console.error(`${Bu("\u2716")} ${e.message}`),$u(e),process.exit(1)})});const Kt=process.argv.slice(2);Tn({name:"aicommit",version:Hu.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:[Bi,bi],help:{description:Hu.description},ignoreArgv:o(u=>u==="unknown-flag"||u==="argument","ignoreArgv")},u=>{yi?gi():hi(u.flags.generate,u.flags.exclude,u.flags.all,u.flags.type,Kt)},Kt);
|
|
2
|
+
import"./cli-BE4adnRQ.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-BE4adnRQ.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-BE4adnRQ.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-BE4adnRQ.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-ChJ2uh-n.mjs";import{L as C,g as A}from"./prompt-BMR92Sng.mjs";import{K as i}from"./cli-BE4adnRQ.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};
|