@sugarmo/aicommits 1.13.2 → 1.13.4

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.
Files changed (3) hide show
  1. package/README.md +13 -8
  2. package/dist/cli.mjs +98 -98
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -74,9 +74,17 @@ aicommits --generate <i> # or -g <i>
74
74
 
75
75
  > Warning: this uses more tokens, meaning it costs more.
76
76
 
77
- #### Generate title + details
77
+ #### Non-interactive environments (Git GUI, external clients, CI)
78
78
 
79
- If you want both a commit title and body:
79
+ If your environment does not provide an interactive TTY, skip prompts explicitly:
80
+
81
+ ```sh
82
+ aicommits --confirm # or -y / --yes
83
+ ```
84
+
85
+ #### Generate title + optional details
86
+
87
+ Enable `details` when you want a body only when the title is not clear enough on its own:
80
88
 
81
89
  ```sh
82
90
  aicommits --details
@@ -292,7 +300,7 @@ aicommits config set type=conventional
292
300
 
293
301
  Default: `false`
294
302
 
295
- Set this to `true` to generate title and body:
303
+ Set this to `true` to allow optional body details. If the title already explains the change clearly, it can still return title only:
296
304
 
297
305
  ```sh
298
306
  aicommits config set details=true
@@ -377,12 +385,9 @@ Video coming soon where I rebuild it from scratch to show you how to easily buil
377
385
 
378
386
  ## Maintainers
379
387
 
380
- - **Hassan El Mghari**: [@Nutlope](https://github.com/Nutlope) [<img src="https://img.shields.io/twitter/follow/nutlope?style=flat&label=nutlope&logo=twitter&color=0bf&logoColor=fff" align="center">](https://twitter.com/nutlope)
381
-
382
-
383
- - **Hiroki Osame**: [@privatenumber](https://github.com/privatenumber) [<img src="https://img.shields.io/twitter/follow/privatenumbr?style=flat&label=privatenumbr&logo=twitter&color=0bf&logoColor=fff" align="center">](https://twitter.com/privatenumbr)
388
+ - **Steven Mok**: [@sugarmo](https://github.com/sugarmo)
384
389
 
385
390
 
386
391
  ## Contributing
387
392
 
388
- If you want to help fix a bug or implement a feature in [Issues](https://github.com/Nutlope/aicommits/issues), checkout the [Contribution Guide](CONTRIBUTING.md) to learn how to setup and test the project.
393
+ If you want to help fix a bug or implement a feature in [Issues](https://github.com/sugarmo/aicommits/issues), checkout the [Contribution Guide](CONTRIBUTING.md) to learn how to setup and test the project.
package/dist/cli.mjs CHANGED
@@ -1,126 +1,126 @@
1
1
  #!/usr/bin/env node
2
- import Ue from"tty";import{Buffer as ln}from"node:buffer";import Q from"node:path";import Zu,{ChildProcess as fn}from"node:child_process";import T,{stdin as Fn,stdout as Cn}from"node:process";import dn from"child_process";import U from"path";import qe from"fs";import{fileURLToPath as Xu}from"node:url";import pn,{constants as Qu}from"node:os";import et from"assert";import ut from"events";import{createWriteStream as mn,createReadStream as hn}from"node:fs";import En from"buffer";import He from"stream";import tt from"util";import{debuglog as gn}from"node:util";import Dt from"node:readline";import{WriteStream as yn}from"node:tty";import _ from"fs/promises";import ve from"os";import Bn from"https";import bn from"net";import wn from"tls";import vn,{fileURLToPath as An,pathToFileURL as $n}from"url";const xn="known-flag",Sn="unknown-flag",Tn="argument",{stringify:ie}=JSON,On=/\B([A-Z])/g,Pn=e=>e.replace(On,"-$1").toLowerCase(),{hasOwnProperty:In}=Object.prototype,ae=(e,u)=>In.call(e,u),kn=e=>Array.isArray(e),nt=e=>typeof e=="function"?[e,!1]:kn(e)?[e[0],!0]:nt(e.type),Mn=(e,u)=>e===Boolean?u!=="false":u,Rn=(e,u)=>typeof u=="boolean"?u:e===Number&&u===""?Number.NaN:e(u),jn=/[\s.:=]/,_n=e=>{const u=`Flag name ${ie(e)}`;if(e.length===0)throw new Error(`${u} cannot be empty`);if(e.length===1)throw new Error(`${u} must be longer than a character`);const t=e.match(jn);if(t)throw new Error(`${u} cannot contain ${ie(t?.[0])}`)},Ln=e=>{const u={},t=(D,r)=>{if(ae(u,D))throw new Error(`Duplicate flags named ${ie(D)}`);u[D]=r};for(const D in e){if(!ae(e,D))continue;_n(D);const r=e[D],o=[[],...nt(r),r];t(D,o);const n=Pn(D);if(D!==n&&t(n,o),"alias"in r&&typeof r.alias=="string"){const{alias:s}=r,i=`Flag alias ${ie(s)} for flag ${ie(D)}`;if(s.length===0)throw new Error(`${i} cannot be empty`);if(s.length>1)throw new Error(`${i} must be a single character`);t(s,o)}}return u},Nn=(e,u)=>{const t={};for(const D in e){if(!ae(e,D))continue;const[r,,o,n]=u[D];if(r.length===0&&"default"in n){let{default:s}=n;typeof s=="function"&&(s=s()),t[D]=s}else t[D]=o?r:r.pop()}return t},Ae="--",Gn=/[.:=]/,zn=/^-{1,2}\w/,Wn=e=>{if(!zn.test(e))return;const u=!e.startsWith(Ae);let t=e.slice(u?1:2),D;const r=t.match(Gn);if(r){const{index:o}=r;D=t.slice(o+1),t=t.slice(0,o)}return[t,D,u]},Un=(e,{onFlag:u,onArgument:t})=>{let D;const r=(o,n)=>{if(typeof D!="function")return!0;D(o,n),D=void 0};for(let o=0;o<e.length;o+=1){const n=e[o];if(n===Ae){r();const i=e.slice(o+1);t?.(i,[o],!0);break}const s=Wn(n);if(s){if(r(),!u)continue;const[i,c,f]=s;if(f)for(let a=0;a<i.length;a+=1){r();const l=a===i.length-1;D=u(i[a],l?c:void 0,[o,a+1,l])}else D=u(i,c,[o])}else r(n,[o])&&t?.([n],[o])}r()},qn=(e,u)=>{for(const[t,D,r]of u.reverse()){if(D){const o=e[t];let n=o.slice(0,D);if(r||(n+=o.slice(D+1)),n!=="-"){e[t]=n;continue}}e.splice(t,1)}},Hn=(e,u=process.argv.slice(2),{ignore:t}={})=>{const D=[],r=Ln(e),o={},n=[];return n[Ae]=[],Un(u,{onFlag(s,i,c){const f=ae(r,s);if(!t?.(f?xn:Sn,s,i)){if(f){const[a,l]=r[s],F=Mn(l,i),C=(d,p)=>{D.push(c),p&&D.push(p),a.push(Rn(l,d||""))};return F===void 0?C:C(F)}ae(o,s)||(o[s]=[]),o[s].push(i===void 0?!0:i),D.push(c)}},onArgument(s,i,c){t?.(Tn,u[i[0]])||(n.push(...s),c?(n[Ae]=s,u.splice(i[0])):D.push(i))}}),qn(u,D),{flags:Nn(e,r),unknownFlags:o,_:n}};var Vn=Object.create,$e=Object.defineProperty,Kn=Object.defineProperties,Jn=Object.getOwnPropertyDescriptor,Yn=Object.getOwnPropertyDescriptors,Zn=Object.getOwnPropertyNames,rt=Object.getOwnPropertySymbols,Xn=Object.getPrototypeOf,ot=Object.prototype.hasOwnProperty,Qn=Object.prototype.propertyIsEnumerable,st=(e,u,t)=>u in e?$e(e,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[u]=t,xe=(e,u)=>{for(var t in u||(u={}))ot.call(u,t)&&st(e,t,u[t]);if(rt)for(var t of rt(u))Qn.call(u,t)&&st(e,t,u[t]);return e},Ve=(e,u)=>Kn(e,Yn(u)),er=e=>$e(e,"__esModule",{value:!0}),ur=(e,u)=>()=>(e&&(u=e(e=0)),u),tr=(e,u)=>()=>(u||e((u={exports:{}}).exports,u),u.exports),Dr=(e,u,t,D)=>{if(u&&typeof u=="object"||typeof u=="function")for(let r of Zn(u))!ot.call(e,r)&&(t||r!=="default")&&$e(e,r,{get:()=>u[r],enumerable:!(D=Jn(u,r))||D.enumerable});return e},nr=(e,u)=>Dr(er($e(e!=null?Vn(Xn(e)):{},"default",!u&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),R=ur(()=>{}),rr=tr((e,u)=>{R(),u.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}});R(),R(),R();var or=e=>{var u,t,D;let r=(u=process.stdout.columns)!=null?u:Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(r)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:r}:{columns:(t=e.columns)!=null?t:[],stdoutColumns:(D=e.stdoutColumns)!=null?D:r}};R(),R(),R(),R(),R();function sr({onlyFirst:e=!1}={}){let u=["[\\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(u,e?void 0:"g")}function it(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(sr(),"")}R();function ir(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}var ar=nr(rr(),1);function K(e){if(typeof e!="string"||e.length===0||(e=it(e),e.length===0))return 0;e=e.replace((0,ar.default)()," ");let u=0;for(let t=0;t<e.length;t++){let D=e.codePointAt(t);D<=31||D>=127&&D<=159||D>=768&&D<=879||(D>65535&&t++,u+=ir(D)?2:1)}return u}var at=e=>Math.max(...e.split(`
3
- `).map(K)),cr=e=>{let u=[];for(let t of e){let{length:D}=t,r=D-u.length;for(let o=0;o<r;o+=1)u.push(0);for(let o=0;o<D;o+=1){let n=at(t[o]);n>u[o]&&(u[o]=n)}}return u};R();var ct=/^\d+%$/,lt={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},lr=(e,u)=>{var t;let D=[];for(let r=0;r<e.length;r+=1){let o=(t=u[r])!=null?t:"auto";if(typeof o=="number"||o==="auto"||o==="content-width"||typeof o=="string"&&ct.test(o)){D.push(Ve(xe({},lt),{width:o,contentWidth:e[r]}));continue}if(o&&typeof o=="object"){let n=Ve(xe(xe({},lt),o),{contentWidth:e[r]});n.horizontalPadding=n.paddingLeft+n.paddingRight,D.push(n);continue}throw new Error(`Invalid column width: ${JSON.stringify(o)}`)}return D};function fr(e,u){for(let t of e){let{width:D}=t;if(D==="content-width"&&(t.width=t.contentWidth),D==="auto"){let i=Math.min(20,t.contentWidth);t.width=i,t.autoOverflow=t.contentWidth-i}if(typeof D=="string"&&ct.test(D)){let i=Number.parseFloat(D.slice(0,-1))/100;t.width=Math.floor(u*i)-(t.paddingLeft+t.paddingRight)}let{horizontalPadding:r}=t,o=1,n=o+r;if(n>=u){let i=n-u,c=Math.ceil(t.paddingLeft/r*i),f=i-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 s=u-t.horizontalPadding;t.width=Math.max(Math.min(t.width,s),o)}}var ft=()=>Object.assign([],{columns:0});function Fr(e,u){let t=[ft()],[D]=t;for(let r of e){let o=r.width+r.horizontalPadding;D.columns+o>u&&(D=ft(),t.push(D)),D.push(r),D.columns+=o}for(let r of t){let o=r.reduce((l,F)=>l+F.width+F.horizontalPadding,0),n=u-o;if(n===0)continue;let s=r.filter(l=>"autoOverflow"in l),i=s.filter(l=>l.autoOverflow>0),c=i.reduce((l,F)=>l+F.autoOverflow,0),f=Math.min(c,n);for(let l of i){let F=Math.floor(l.autoOverflow/c*f);l.width+=F,n-=F}let a=Math.floor(n/s.length);for(let l=0;l<s.length;l+=1){let F=s[l];l===s.length-1?F.width+=n:F.width+=a,n-=a}}return t}function Cr(e,u,t){let D=lr(t,u);return fr(D,e),Fr(D,e)}R(),R(),R();var Ke=10,Ft=(e=0)=>u=>`\x1B[${u+e}m`,Ct=(e=0)=>u=>`\x1B[${38+e};5;${u}m`,dt=(e=0)=>(u,t,D)=>`\x1B[${38+e};2;${u};${t};${D}m`;function dr(){let e=new Map,u={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]}};u.color.gray=u.color.blackBright,u.bgColor.bgGray=u.bgColor.bgBlackBright,u.color.grey=u.color.blackBright,u.bgColor.bgGrey=u.bgColor.bgBlackBright;for(let[t,D]of Object.entries(u)){for(let[r,o]of Object.entries(D))u[r]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},D[r]=u[r],e.set(o[0],o[1]);Object.defineProperty(u,t,{value:D,enumerable:!1})}return Object.defineProperty(u,"codes",{value:e,enumerable:!1}),u.color.close="\x1B[39m",u.bgColor.close="\x1B[49m",u.color.ansi=Ft(),u.color.ansi256=Ct(),u.color.ansi16m=dt(),u.bgColor.ansi=Ft(Ke),u.bgColor.ansi256=Ct(Ke),u.bgColor.ansi16m=dt(Ke),Object.defineProperties(u,{rgbToAnsi256:{value:(t,D,r)=>t===D&&D===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(D/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:t=>{let D=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!D)return[0,0,0];let{colorString:r}=D.groups;r.length===3&&(r=r.split("").map(n=>n+n).join(""));let o=Number.parseInt(r,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>u.rgbToAnsi256(...u.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let D,r,o;if(t>=232)D=((t-232)*10+8)/255,r=D,o=D;else{t-=16;let i=t%36;D=Math.floor(t/36)/5,r=Math.floor(i/6)/5,o=i%6/5}let n=Math.max(D,r,o)*2;if(n===0)return 30;let s=30+(Math.round(o)<<2|Math.round(r)<<1|Math.round(D));return n===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,D,r)=>u.ansi256ToAnsi(u.rgbToAnsi256(t,D,r)),enumerable:!1},hexToAnsi:{value:t=>u.ansi256ToAnsi(u.hexToAnsi256(t)),enumerable:!1}}),u}var pr=dr(),mr=pr,Se=new Set(["\x1B","\x9B"]),hr=39,Je="\x07",pt="[",Er="]",mt="m",Ye=`${Er}8;;`,ht=e=>`${Se.values().next().value}${pt}${e}${mt}`,Et=e=>`${Se.values().next().value}${Ye}${e}${Je}`,gr=e=>e.split(" ").map(u=>K(u)),Ze=(e,u,t)=>{let D=[...u],r=!1,o=!1,n=K(it(e[e.length-1]));for(let[s,i]of D.entries()){let c=K(i);if(n+c<=t?e[e.length-1]+=i:(e.push(i),n=0),Se.has(i)&&(r=!0,o=D.slice(s+1).join("").startsWith(Ye)),r){o?i===Je&&(r=!1,o=!1):i===mt&&(r=!1);continue}n+=c,n===t&&s<D.length-1&&(e.push(""),n=0)}!n&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},yr=e=>{let u=e.split(" "),t=u.length;for(;t>0&&!(K(u[t-1])>0);)t--;return t===u.length?e:u.slice(0,t).join(" ")+u.slice(t).join("")},Br=(e,u,t={})=>{if(t.trim!==!1&&e.trim()==="")return"";let D="",r,o,n=gr(e),s=[""];for(let[c,f]of e.split(" ").entries()){t.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let a=K(s[s.length-1]);if(c!==0&&(a>=u&&(t.wordWrap===!1||t.trim===!1)&&(s.push(""),a=0),(a>0||t.trim===!1)&&(s[s.length-1]+=" ",a++)),t.hard&&n[c]>u){let l=u-a,F=1+Math.floor((n[c]-l-1)/u);Math.floor((n[c]-1)/u)<F&&s.push(""),Ze(s,f,u);continue}if(a+n[c]>u&&a>0&&n[c]>0){if(t.wordWrap===!1&&a<u){Ze(s,f,u);continue}s.push("")}if(a+n[c]>u&&t.wordWrap===!1){Ze(s,f,u);continue}s[s.length-1]+=f}t.trim!==!1&&(s=s.map(c=>yr(c)));let i=[...s.join(`
4
- `)];for(let[c,f]of i.entries()){if(D+=f,Se.has(f)){let{groups:l}=new RegExp(`(?:\\${pt}(?<code>\\d+)m|\\${Ye}(?<uri>.*)${Je})`).exec(i.slice(c).join(""))||{groups:{}};if(l.code!==void 0){let F=Number.parseFloat(l.code);r=F===hr?void 0:F}else l.uri!==void 0&&(o=l.uri.length===0?void 0:l.uri)}let a=mr.codes.get(Number(r));i[c+1]===`
5
- `?(o&&(D+=Et("")),r&&a&&(D+=ht(a))):f===`
6
- `&&(r&&a&&(D+=ht(r)),o&&(D+=Et(o)))}return D};function br(e,u,t){return String(e).normalize().replace(/\r\n/g,`
2
+ import qe from"tty";import{Buffer as Fn}from"node:buffer";import ee from"node:path";import Qu,{ChildProcess as Cn}from"node:child_process";import T,{stdin as dn,stdout as pn}from"node:process";import mn from"child_process";import z from"path";import He from"fs";import{fileURLToPath as et}from"node:url";import hn,{constants as ut}from"node:os";import tt from"assert";import Dt from"events";import{createWriteStream as En,createReadStream as gn}from"node:fs";import yn from"buffer";import Ve from"stream";import nt from"util";import{debuglog as Bn}from"node:util";import rt from"node:readline";import{WriteStream as bn}from"node:tty";import _ from"fs/promises";import ve from"os";import wn from"https";import An from"net";import vn from"tls";import $n,{fileURLToPath as xn,pathToFileURL as Sn}from"url";const Tn="known-flag",On="unknown-flag",Pn="argument",{stringify:ae}=JSON,In=/\B([A-Z])/g,kn=e=>e.replace(In,"-$1").toLowerCase(),{hasOwnProperty:Mn}=Object.prototype,ce=(e,u)=>Mn.call(e,u),Rn=e=>Array.isArray(e),ot=e=>typeof e=="function"?[e,!1]:Rn(e)?[e[0],!0]:ot(e.type),jn=(e,u)=>e===Boolean?u!=="false":u,_n=(e,u)=>typeof u=="boolean"?u:e===Number&&u===""?Number.NaN:e(u),Ln=/[\s.:=]/,Nn=e=>{const u=`Flag name ${ae(e)}`;if(e.length===0)throw new Error(`${u} cannot be empty`);if(e.length===1)throw new Error(`${u} must be longer than a character`);const t=e.match(Ln);if(t)throw new Error(`${u} cannot contain ${ae(t?.[0])}`)},Gn=e=>{const u={},t=(D,r)=>{if(ce(u,D))throw new Error(`Duplicate flags named ${ae(D)}`);u[D]=r};for(const D in e){if(!ce(e,D))continue;Nn(D);const r=e[D],o=[[],...ot(r),r];t(D,o);const n=kn(D);if(D!==n&&t(n,o),"alias"in r&&typeof r.alias=="string"){const{alias:i}=r,s=`Flag alias ${ae(i)} for flag ${ae(D)}`;if(i.length===0)throw new Error(`${s} cannot be empty`);if(i.length>1)throw new Error(`${s} must be a single character`);t(i,o)}}return u},zn=(e,u)=>{const t={};for(const D in e){if(!ce(e,D))continue;const[r,,o,n]=u[D];if(r.length===0&&"default"in n){let{default:i}=n;typeof i=="function"&&(i=i()),t[D]=i}else t[D]=o?r:r.pop()}return t},$e="--",Wn=/[.:=]/,Un=/^-{1,2}\w/,qn=e=>{if(!Un.test(e))return;const u=!e.startsWith($e);let t=e.slice(u?1:2),D;const r=t.match(Wn);if(r){const{index:o}=r;D=t.slice(o+1),t=t.slice(0,o)}return[t,D,u]},Hn=(e,{onFlag:u,onArgument:t})=>{let D;const r=(o,n)=>{if(typeof D!="function")return!0;D(o,n),D=void 0};for(let o=0;o<e.length;o+=1){const n=e[o];if(n===$e){r();const s=e.slice(o+1);t?.(s,[o],!0);break}const i=qn(n);if(i){if(r(),!u)continue;const[s,c,f]=i;if(f)for(let a=0;a<s.length;a+=1){r();const l=a===s.length-1;D=u(s[a],l?c:void 0,[o,a+1,l])}else D=u(s,c,[o])}else r(n,[o])&&t?.([n],[o])}r()},Vn=(e,u)=>{for(const[t,D,r]of u.reverse()){if(D){const o=e[t];let n=o.slice(0,D);if(r||(n+=o.slice(D+1)),n!=="-"){e[t]=n;continue}}e.splice(t,1)}},Kn=(e,u=process.argv.slice(2),{ignore:t}={})=>{const D=[],r=Gn(e),o={},n=[];return n[$e]=[],Hn(u,{onFlag(i,s,c){const f=ce(r,i);if(!t?.(f?Tn:On,i,s)){if(f){const[a,l]=r[i],F=jn(l,s),C=(p,d)=>{D.push(c),d&&D.push(d),a.push(_n(l,p||""))};return F===void 0?C:C(F)}ce(o,i)||(o[i]=[]),o[i].push(s===void 0?!0:s),D.push(c)}},onArgument(i,s,c){t?.(Pn,u[s[0]])||(n.push(...i),c?(n[$e]=i,u.splice(s[0])):D.push(s))}}),Vn(u,D),{flags:zn(e,r),unknownFlags:o,_:n}};var Jn=Object.create,xe=Object.defineProperty,Yn=Object.defineProperties,Zn=Object.getOwnPropertyDescriptor,Xn=Object.getOwnPropertyDescriptors,Qn=Object.getOwnPropertyNames,it=Object.getOwnPropertySymbols,er=Object.getPrototypeOf,st=Object.prototype.hasOwnProperty,ur=Object.prototype.propertyIsEnumerable,at=(e,u,t)=>u in e?xe(e,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[u]=t,Se=(e,u)=>{for(var t in u||(u={}))st.call(u,t)&&at(e,t,u[t]);if(it)for(var t of it(u))ur.call(u,t)&&at(e,t,u[t]);return e},Ke=(e,u)=>Yn(e,Xn(u)),tr=e=>xe(e,"__esModule",{value:!0}),Dr=(e,u)=>()=>(e&&(u=e(e=0)),u),nr=(e,u)=>()=>(u||e((u={exports:{}}).exports,u),u.exports),rr=(e,u,t,D)=>{if(u&&typeof u=="object"||typeof u=="function")for(let r of Qn(u))!st.call(e,r)&&(t||r!=="default")&&xe(e,r,{get:()=>u[r],enumerable:!(D=Zn(u,r))||D.enumerable});return e},or=(e,u)=>rr(tr(xe(e!=null?Jn(er(e)):{},"default",!u&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),j=Dr(()=>{}),ir=nr((e,u)=>{j(),u.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}});j(),j(),j();var sr=e=>{var u,t,D;let r=(u=process.stdout.columns)!=null?u:Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(r)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:r}:{columns:(t=e.columns)!=null?t:[],stdoutColumns:(D=e.stdoutColumns)!=null?D:r}};j(),j(),j(),j(),j();function ar({onlyFirst:e=!1}={}){let u=["[\\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(u,e?void 0:"g")}function ct(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(ar(),"")}j();function cr(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}var lr=or(ir(),1);function K(e){if(typeof e!="string"||e.length===0||(e=ct(e),e.length===0))return 0;e=e.replace((0,lr.default)()," ");let u=0;for(let t=0;t<e.length;t++){let D=e.codePointAt(t);D<=31||D>=127&&D<=159||D>=768&&D<=879||(D>65535&&t++,u+=cr(D)?2:1)}return u}var lt=e=>Math.max(...e.split(`
3
+ `).map(K)),fr=e=>{let u=[];for(let t of e){let{length:D}=t,r=D-u.length;for(let o=0;o<r;o+=1)u.push(0);for(let o=0;o<D;o+=1){let n=lt(t[o]);n>u[o]&&(u[o]=n)}}return u};j();var ft=/^\d+%$/,Ft={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},Fr=(e,u)=>{var t;let D=[];for(let r=0;r<e.length;r+=1){let o=(t=u[r])!=null?t:"auto";if(typeof o=="number"||o==="auto"||o==="content-width"||typeof o=="string"&&ft.test(o)){D.push(Ke(Se({},Ft),{width:o,contentWidth:e[r]}));continue}if(o&&typeof o=="object"){let n=Ke(Se(Se({},Ft),o),{contentWidth:e[r]});n.horizontalPadding=n.paddingLeft+n.paddingRight,D.push(n);continue}throw new Error(`Invalid column width: ${JSON.stringify(o)}`)}return D};function Cr(e,u){for(let t of e){let{width:D}=t;if(D==="content-width"&&(t.width=t.contentWidth),D==="auto"){let s=Math.min(20,t.contentWidth);t.width=s,t.autoOverflow=t.contentWidth-s}if(typeof D=="string"&&ft.test(D)){let s=Number.parseFloat(D.slice(0,-1))/100;t.width=Math.floor(u*s)-(t.paddingLeft+t.paddingRight)}let{horizontalPadding:r}=t,o=1,n=o+r;if(n>=u){let s=n-u,c=Math.ceil(t.paddingLeft/r*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 i=u-t.horizontalPadding;t.width=Math.max(Math.min(t.width,i),o)}}var Ct=()=>Object.assign([],{columns:0});function dr(e,u){let t=[Ct()],[D]=t;for(let r of e){let o=r.width+r.horizontalPadding;D.columns+o>u&&(D=Ct(),t.push(D)),D.push(r),D.columns+=o}for(let r of t){let o=r.reduce((l,F)=>l+F.width+F.horizontalPadding,0),n=u-o;if(n===0)continue;let i=r.filter(l=>"autoOverflow"in l),s=i.filter(l=>l.autoOverflow>0),c=s.reduce((l,F)=>l+F.autoOverflow,0),f=Math.min(c,n);for(let l of s){let F=Math.floor(l.autoOverflow/c*f);l.width+=F,n-=F}let a=Math.floor(n/i.length);for(let l=0;l<i.length;l+=1){let F=i[l];l===i.length-1?F.width+=n:F.width+=a,n-=a}}return t}function pr(e,u,t){let D=Fr(t,u);return Cr(D,e),dr(D,e)}j(),j(),j();var Je=10,dt=(e=0)=>u=>`\x1B[${u+e}m`,pt=(e=0)=>u=>`\x1B[${38+e};5;${u}m`,mt=(e=0)=>(u,t,D)=>`\x1B[${38+e};2;${u};${t};${D}m`;function mr(){let e=new Map,u={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]}};u.color.gray=u.color.blackBright,u.bgColor.bgGray=u.bgColor.bgBlackBright,u.color.grey=u.color.blackBright,u.bgColor.bgGrey=u.bgColor.bgBlackBright;for(let[t,D]of Object.entries(u)){for(let[r,o]of Object.entries(D))u[r]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},D[r]=u[r],e.set(o[0],o[1]);Object.defineProperty(u,t,{value:D,enumerable:!1})}return Object.defineProperty(u,"codes",{value:e,enumerable:!1}),u.color.close="\x1B[39m",u.bgColor.close="\x1B[49m",u.color.ansi=dt(),u.color.ansi256=pt(),u.color.ansi16m=mt(),u.bgColor.ansi=dt(Je),u.bgColor.ansi256=pt(Je),u.bgColor.ansi16m=mt(Je),Object.defineProperties(u,{rgbToAnsi256:{value:(t,D,r)=>t===D&&D===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(D/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:t=>{let D=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!D)return[0,0,0];let{colorString:r}=D.groups;r.length===3&&(r=r.split("").map(n=>n+n).join(""));let o=Number.parseInt(r,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>u.rgbToAnsi256(...u.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let D,r,o;if(t>=232)D=((t-232)*10+8)/255,r=D,o=D;else{t-=16;let s=t%36;D=Math.floor(t/36)/5,r=Math.floor(s/6)/5,o=s%6/5}let n=Math.max(D,r,o)*2;if(n===0)return 30;let i=30+(Math.round(o)<<2|Math.round(r)<<1|Math.round(D));return n===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(t,D,r)=>u.ansi256ToAnsi(u.rgbToAnsi256(t,D,r)),enumerable:!1},hexToAnsi:{value:t=>u.ansi256ToAnsi(u.hexToAnsi256(t)),enumerable:!1}}),u}var hr=mr(),Er=hr,Te=new Set(["\x1B","\x9B"]),gr=39,Ye="\x07",ht="[",yr="]",Et="m",Ze=`${yr}8;;`,gt=e=>`${Te.values().next().value}${ht}${e}${Et}`,yt=e=>`${Te.values().next().value}${Ze}${e}${Ye}`,Br=e=>e.split(" ").map(u=>K(u)),Xe=(e,u,t)=>{let D=[...u],r=!1,o=!1,n=K(ct(e[e.length-1]));for(let[i,s]of D.entries()){let c=K(s);if(n+c<=t?e[e.length-1]+=s:(e.push(s),n=0),Te.has(s)&&(r=!0,o=D.slice(i+1).join("").startsWith(Ze)),r){o?s===Ye&&(r=!1,o=!1):s===Et&&(r=!1);continue}n+=c,n===t&&i<D.length-1&&(e.push(""),n=0)}!n&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},br=e=>{let u=e.split(" "),t=u.length;for(;t>0&&!(K(u[t-1])>0);)t--;return t===u.length?e:u.slice(0,t).join(" ")+u.slice(t).join("")},wr=(e,u,t={})=>{if(t.trim!==!1&&e.trim()==="")return"";let D="",r,o,n=Br(e),i=[""];for(let[c,f]of e.split(" ").entries()){t.trim!==!1&&(i[i.length-1]=i[i.length-1].trimStart());let a=K(i[i.length-1]);if(c!==0&&(a>=u&&(t.wordWrap===!1||t.trim===!1)&&(i.push(""),a=0),(a>0||t.trim===!1)&&(i[i.length-1]+=" ",a++)),t.hard&&n[c]>u){let l=u-a,F=1+Math.floor((n[c]-l-1)/u);Math.floor((n[c]-1)/u)<F&&i.push(""),Xe(i,f,u);continue}if(a+n[c]>u&&a>0&&n[c]>0){if(t.wordWrap===!1&&a<u){Xe(i,f,u);continue}i.push("")}if(a+n[c]>u&&t.wordWrap===!1){Xe(i,f,u);continue}i[i.length-1]+=f}t.trim!==!1&&(i=i.map(c=>br(c)));let s=[...i.join(`
4
+ `)];for(let[c,f]of s.entries()){if(D+=f,Te.has(f)){let{groups:l}=new RegExp(`(?:\\${ht}(?<code>\\d+)m|\\${Ze}(?<uri>.*)${Ye})`).exec(s.slice(c).join(""))||{groups:{}};if(l.code!==void 0){let F=Number.parseFloat(l.code);r=F===gr?void 0:F}else l.uri!==void 0&&(o=l.uri.length===0?void 0:l.uri)}let a=Er.codes.get(Number(r));s[c+1]===`
5
+ `?(o&&(D+=yt("")),r&&a&&(D+=gt(a))):f===`
6
+ `&&(r&&a&&(D+=gt(r)),o&&(D+=yt(o)))}return D};function Ar(e,u,t){return String(e).normalize().replace(/\r\n/g,`
7
7
  `).split(`
8
- `).map(D=>Br(D,u,t)).join(`
9
- `)}var gt=e=>Array.from({length:e}).fill("");function wr(e,u){let t=[],D=0;for(let r of e){let o=0,n=r.map(i=>{var c;let f=(c=u[D])!=null?c:"";D+=1,i.preprocess&&(f=i.preprocess(f)),at(f)>i.width&&(f=br(f,i.width,{hard:!0}));let a=f.split(`
10
- `);if(i.postprocess){let{postprocess:l}=i;a=a.map((F,C)=>l.call(i,F,C))}return i.paddingTop&&a.unshift(...gt(i.paddingTop)),i.paddingBottom&&a.push(...gt(i.paddingBottom)),a.length>o&&(o=a.length),Ve(xe({},i),{lines:a})}),s=[];for(let i=0;i<o;i+=1){let c=n.map(f=>{var a;let l=(a=f.lines[i])!=null?a:"",F=Number.isFinite(f.width)?" ".repeat(f.width-K(l)):"",C=f.paddingLeftString;return f.align==="right"&&(C+=F),C+=l,f.align==="left"&&(C+=F),C+f.paddingRightString}).join("");s.push(c)}t.push(s.join(`
8
+ `).map(D=>wr(D,u,t)).join(`
9
+ `)}var Bt=e=>Array.from({length:e}).fill("");function vr(e,u){let t=[],D=0;for(let r of e){let o=0,n=r.map(s=>{var c;let f=(c=u[D])!=null?c:"";D+=1,s.preprocess&&(f=s.preprocess(f)),lt(f)>s.width&&(f=Ar(f,s.width,{hard:!0}));let a=f.split(`
10
+ `);if(s.postprocess){let{postprocess:l}=s;a=a.map((F,C)=>l.call(s,F,C))}return s.paddingTop&&a.unshift(...Bt(s.paddingTop)),s.paddingBottom&&a.push(...Bt(s.paddingBottom)),a.length>o&&(o=a.length),Ke(Se({},s),{lines:a})}),i=[];for(let s=0;s<o;s+=1){let c=n.map(f=>{var a;let l=(a=f.lines[s])!=null?a:"",F=Number.isFinite(f.width)?" ".repeat(f.width-K(l)):"",C=f.paddingLeftString;return f.align==="right"&&(C+=F),C+=l,f.align==="left"&&(C+=F),C+f.paddingRightString}).join("");i.push(c)}t.push(i.join(`
11
11
  `))}return t.join(`
12
- `)}function vr(e,u){if(!e||e.length===0)return"";let t=cr(e),D=t.length;if(D===0)return"";let{stdoutColumns:r,columns:o}=or(u);if(o.length>D)throw new Error(`${o.length} columns defined, but only ${D} columns found`);let n=Cr(r,o,t);return e.map(s=>wr(n,s)).join(`
13
- `)}R();var Ar=["<",">","=",">=","<="];function $r(e){if(!Ar.includes(e))throw new TypeError(`Invalid breakpoint operator: ${e}`)}function xr(e){let u=Object.keys(e).map(t=>{let[D,r]=t.split(" ");$r(D);let o=Number.parseInt(r,10);if(Number.isNaN(o))throw new TypeError(`Invalid breakpoint value: ${r}`);let n=e[t];return{operator:D,breakpoint:o,value:n}}).sort((t,D)=>D.breakpoint-t.breakpoint);return t=>{var D;return(D=u.find(({operator:r,breakpoint:o})=>r==="="&&t===o||r===">"&&t>o||r==="<"&&t<o||r===">="&&t>=o||r==="<="&&t<=o))==null?void 0:D.value}}const Sr=e=>e.replace(/[\W_]([a-z\d])?/gi,(u,t)=>t?t.toUpperCase():""),Tr=e=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase(),Or={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:e=>e.trim()},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function Pr(e){let u=!1;return{type:"table",data:{tableData:Object.keys(e).sort((t,D)=>t.localeCompare(D)).map(t=>{const D=e[t],r="alias"in D;return r&&(u=!0),{name:t,flag:D,flagFormatted:`--${Tr(t)}`,aliasesEnabled:u,aliasFormatted:r?`-${D.alias}`:void 0}}).map(t=>(t.aliasesEnabled=u,[{type:"flagName",data:t},{type:"flagDescription",data:t}])),tableBreakpoints:Or}}}const yt=e=>!e||(e.version??(e.help?e.help.version:void 0)),Bt=e=>{const u="parent"in e&&e.parent?.name;return(u?`${u} `:"")+e.name};function Ir(e){const u=[];e.name&&u.push(Bt(e));const t=yt(e)??("parent"in e&&yt(e.parent));if(t&&u.push(`v${t}`),u.length!==0)return{id:"name",type:"text",data:`${u.join(" ")}
14
- `}}function kr(e){const{help:u}=e;if(!(!u||!u.description))return{id:"description",type:"text",data:`${u.description}
15
- `}}function Mr(e){const u=e.help||{};if("usage"in u)return u.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(u.usage)?u.usage.join(`
16
- `):u.usage}}:void 0;if(e.name){const t=[],D=[Bt(e)];if(e.flags&&Object.keys(e.flags).length>0&&D.push("[flags...]"),e.parameters&&e.parameters.length>0){const{parameters:r}=e,o=r.indexOf("--"),n=o>-1&&r.slice(o+1).some(s=>s.startsWith("<"));D.push(r.map(s=>s!=="--"?s:n?"--":"[--]").join(" "))}if(D.length>1&&t.push(D.join(" ")),"commands"in e&&e.commands?.length&&t.push(`${e.name} <command>`),t.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:t.join(`
17
- `)}}}}function Rr(e){return!("commands"in e)||!e.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:e.commands.map(u=>[u.options.name,u.options.help?u.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}function jr(e){if(!(!e.flags||Object.keys(e.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:Pr(e.flags),indentBody:0}}}function _r(e){const{help:u}=e;if(!u||!u.examples||u.examples.length===0)return;let{examples:t}=u;if(Array.isArray(t)&&(t=t.join(`
18
- `)),t)return{id:"examples",type:"section",data:{title:"Examples:",body:t}}}function Lr(e){if(!("alias"in e)||!e.alias)return;const{alias:u}=e;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(u)?u.join(", "):u}}}const Nr=e=>[Ir,kr,Mr,Rr,jr,_r,Lr].map(u=>u(e)).filter(Boolean),Gr=Ue.WriteStream.prototype.hasColors();class zr{text(u){return u}bold(u){return Gr?`\x1B[1m${u}\x1B[22m`:u.toLocaleUpperCase()}indentText({text:u,spaces:t}){return u.replace(/^/gm," ".repeat(t))}heading(u){return this.bold(u)}section({title:u,body:t,indentBody:D=2}){return`${(u?`${this.heading(u)}
12
+ `)}function $r(e,u){if(!e||e.length===0)return"";let t=fr(e),D=t.length;if(D===0)return"";let{stdoutColumns:r,columns:o}=sr(u);if(o.length>D)throw new Error(`${o.length} columns defined, but only ${D} columns found`);let n=pr(r,o,t);return e.map(i=>vr(n,i)).join(`
13
+ `)}j();var xr=["<",">","=",">=","<="];function Sr(e){if(!xr.includes(e))throw new TypeError(`Invalid breakpoint operator: ${e}`)}function Tr(e){let u=Object.keys(e).map(t=>{let[D,r]=t.split(" ");Sr(D);let o=Number.parseInt(r,10);if(Number.isNaN(o))throw new TypeError(`Invalid breakpoint value: ${r}`);let n=e[t];return{operator:D,breakpoint:o,value:n}}).sort((t,D)=>D.breakpoint-t.breakpoint);return t=>{var D;return(D=u.find(({operator:r,breakpoint:o})=>r==="="&&t===o||r===">"&&t>o||r==="<"&&t<o||r===">="&&t>=o||r==="<="&&t<=o))==null?void 0:D.value}}const Or=e=>e.replace(/[\W_]([a-z\d])?/gi,(u,t)=>t?t.toUpperCase():""),Pr=e=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase(),Ir={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:e=>e.trim()},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function kr(e){let u=!1;return{type:"table",data:{tableData:Object.keys(e).sort((t,D)=>t.localeCompare(D)).map(t=>{const D=e[t],r="alias"in D;return r&&(u=!0),{name:t,flag:D,flagFormatted:`--${Pr(t)}`,aliasesEnabled:u,aliasFormatted:r?`-${D.alias}`:void 0}}).map(t=>(t.aliasesEnabled=u,[{type:"flagName",data:t},{type:"flagDescription",data:t}])),tableBreakpoints:Ir}}}const bt=e=>!e||(e.version??(e.help?e.help.version:void 0)),wt=e=>{const u="parent"in e&&e.parent?.name;return(u?`${u} `:"")+e.name};function Mr(e){const u=[];e.name&&u.push(wt(e));const t=bt(e)??("parent"in e&&bt(e.parent));if(t&&u.push(`v${t}`),u.length!==0)return{id:"name",type:"text",data:`${u.join(" ")}
14
+ `}}function Rr(e){const{help:u}=e;if(!(!u||!u.description))return{id:"description",type:"text",data:`${u.description}
15
+ `}}function jr(e){const u=e.help||{};if("usage"in u)return u.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(u.usage)?u.usage.join(`
16
+ `):u.usage}}:void 0;if(e.name){const t=[],D=[wt(e)];if(e.flags&&Object.keys(e.flags).length>0&&D.push("[flags...]"),e.parameters&&e.parameters.length>0){const{parameters:r}=e,o=r.indexOf("--"),n=o>-1&&r.slice(o+1).some(i=>i.startsWith("<"));D.push(r.map(i=>i!=="--"?i:n?"--":"[--]").join(" "))}if(D.length>1&&t.push(D.join(" ")),"commands"in e&&e.commands?.length&&t.push(`${e.name} <command>`),t.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:t.join(`
17
+ `)}}}}function _r(e){return!("commands"in e)||!e.commands?.length?void 0:{id:"commands",type:"section",data:{title:"Commands:",body:{type:"table",data:{tableData:e.commands.map(u=>[u.options.name,u.options.help?u.options.help.description:""]),tableOptions:[{width:"content-width",paddingLeft:2,paddingRight:8}]}},indentBody:0}}}function Lr(e){if(!(!e.flags||Object.keys(e.flags).length===0))return{id:"flags",type:"section",data:{title:"Flags:",body:kr(e.flags),indentBody:0}}}function Nr(e){const{help:u}=e;if(!u||!u.examples||u.examples.length===0)return;let{examples:t}=u;if(Array.isArray(t)&&(t=t.join(`
18
+ `)),t)return{id:"examples",type:"section",data:{title:"Examples:",body:t}}}function Gr(e){if(!("alias"in e)||!e.alias)return;const{alias:u}=e;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(u)?u.join(", "):u}}}const zr=e=>[Mr,Rr,jr,_r,Lr,Nr,Gr].map(u=>u(e)).filter(Boolean),Wr=qe.WriteStream.prototype.hasColors();class Ur{text(u){return u}bold(u){return Wr?`\x1B[1m${u}\x1B[22m`:u.toLocaleUpperCase()}indentText({text:u,spaces:t}){return u.replace(/^/gm," ".repeat(t))}heading(u){return this.bold(u)}section({title:u,body:t,indentBody:D=2}){return`${(u?`${this.heading(u)}
19
19
  `:"")+(t?this.indentText({text:this.render(t),spaces:D}):"")}
20
- `}table({tableData:u,tableOptions:t,tableBreakpoints:D}){return vr(u.map(r=>r.map(o=>this.render(o))),D?xr(D):t)}flagParameter(u){return u===Boolean?"":u===String?"<string>":u===Number?"<number>":Array.isArray(u)?this.flagParameter(u[0]):"<value>"}flagOperator(u){return" "}flagName(u){const{flag:t,flagFormatted:D,aliasesEnabled:r,aliasFormatted:o}=u;let n="";if(o?n+=`${o}, `:r&&(n+=" "),n+=D,"placeholder"in t&&typeof t.placeholder=="string")n+=`${this.flagOperator(u)}${t.placeholder}`;else{const s=this.flagParameter("type"in t?t.type:t);s&&(n+=`${this.flagOperator(u)}${s}`)}return n}flagDefault(u){return JSON.stringify(u)}flagDescription({flag:u}){let t="description"in u?u.description??"":"";if("default"in u){let{default:D}=u;typeof D=="function"&&(D=D()),D&&(t+=` (default: ${this.flagDefault(D)})`)}return t}render(u){if(typeof u=="string")return u;if(Array.isArray(u))return u.map(t=>this.render(t)).join(`
21
- `);if("type"in u&&this[u.type]){const t=this[u.type];if(typeof t=="function")return t.call(this,u.data)}throw new Error(`Invalid node type: ${JSON.stringify(u)}`)}}const Xe=e=>e.length>0&&!e.includes(" "),{stringify:W}=JSON,Wr=/[|\\{}()[\]^$+*?.]/;function Qe(e){const u=[];let t,D;for(const r of e){if(D)throw new Error(`Invalid parameter: Spread parameter ${W(D)} must be last`);const o=r[0],n=r[r.length-1];let s;if(o==="<"&&n===">"&&(s=!0,t))throw new Error(`Invalid parameter: Required parameter ${W(r)} cannot come after optional parameter ${W(t)}`);if(o==="["&&n==="]"&&(s=!1,t=r),s===void 0)throw new Error(`Invalid parameter: ${W(r)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let i=r.slice(1,-1);const c=i.slice(-3)==="...";c&&(D=r,i=i.slice(0,-3));const f=i.match(Wr);if(f)throw new Error(`Invalid parameter: ${W(r)}. Invalid character found ${W(f[0])}`);u.push({name:i,required:s,spread:c})}return u}function eu(e,u,t,D){for(let r=0;r<u.length;r+=1){const{name:o,required:n,spread:s}=u[r],i=Sr(o);if(i in e)throw new Error(`Invalid parameter: ${W(o)} is used more than once.`);const c=s?t.slice(r):t[r];if(s&&(r=u.length),n&&(!c||s&&c.length===0))return console.error(`Error: Missing required parameter ${W(o)}
22
- `),D(),process.exit(1);e[i]=c}}function Ur(e){return e===void 0||e!==!1}function bt(e,u,t,D){const r={...u.flags},o=u.version;o&&(r.version={type:Boolean,description:"Show version"});const{help:n}=u,s=Ur(n);s&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const i=Hn(r,D,{ignore:u.ignoreArgv}),c=()=>{console.log(u.version)};if(o&&i.flags.version===!0)return c(),process.exit(0);const f=new zr,a=s&&n?.render?n.render:C=>f.render(C),l=C=>{const d=Nr({...u,...C?{help:C}:{},flags:r});console.log(a(d,f))};if(s&&i.flags.help===!0)return l(),process.exit(0);if(u.parameters){let{parameters:C}=u,d=i._;const p=C.indexOf("--"),h=C.slice(p+1),g=Object.create(null);if(p>-1&&h.length>0){C=C.slice(0,p);const m=i._["--"];d=d.slice(0,-m.length||void 0),eu(g,Qe(C),d,l),eu(g,Qe(h),m,l)}else eu(g,Qe(C),d,l);Object.assign(i._,g)}const F={...i,showVersion:c,showHelp:l};return typeof t=="function"&&t(F),{command:e,...F}}function qr(e,u){const t=new Map;for(const D of u){const r=[D.options.name],{alias:o}=D.options;o&&(Array.isArray(o)?r.push(...o):r.push(o));for(const n of r){if(t.has(n))throw new Error(`Duplicate command name found: ${W(n)}`);t.set(n,D)}}return t.get(e)}function Hr(e,u,t=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!Xe(e.name)))throw new Error(`Invalid script name: ${W(e.name)}`);const D=t[0];if(e.commands&&D&&Xe(D)){const r=qr(D,e.commands);if(r)return bt(r.options.name,{...r.options,parent:e},r.callback,t.slice(1))}return bt(void 0,e,u,t)}function wt(e,u){if(!e)throw new Error("Command options are required");const{name:t}=e;if(t===void 0)throw new Error("Command name is required");if(!Xe(t))throw new Error(`Invalid command name ${JSON.stringify(t)}. Command names must be one word.`);return{options:e,callback:u}}var Vr="1.13.2",Kr="Writes your git commit messages for you with AI",I=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ue={exports:{}},uu,vt;function Jr(){if(vt)return uu;vt=1,uu=D,D.sync=r;var e=qe;function u(o,n){var s=n.pathExt!==void 0?n.pathExt:process.env.PATHEXT;if(!s||(s=s.split(";"),s.indexOf("")!==-1))return!0;for(var i=0;i<s.length;i++){var c=s[i].toLowerCase();if(c&&o.substr(-c.length).toLowerCase()===c)return!0}return!1}function t(o,n,s){return!o.isSymbolicLink()&&!o.isFile()?!1:u(n,s)}function D(o,n,s){e.stat(o,function(i,c){s(i,i?!1:t(c,o,n))})}function r(o,n){return t(e.statSync(o),o,n)}return uu}var tu,At;function Yr(){if(At)return tu;At=1,tu=u,u.sync=t;var e=qe;function u(o,n,s){e.stat(o,function(i,c){s(i,i?!1:D(c,n))})}function t(o,n){return D(e.statSync(o),n)}function D(o,n){return o.isFile()&&r(o,n)}function r(o,n){var s=o.mode,i=o.uid,c=o.gid,f=n.uid!==void 0?n.uid:process.getuid&&process.getuid(),a=n.gid!==void 0?n.gid:process.getgid&&process.getgid(),l=parseInt("100",8),F=parseInt("010",8),C=parseInt("001",8),d=l|F,p=s&C||s&F&&c===a||s&l&&i===f||s&d&&f===0;return p}return tu}var Te;process.platform==="win32"||I.TESTING_WINDOWS?Te=Jr():Te=Yr();var Zr=Du;Du.sync=Xr;function Du(e,u,t){if(typeof u=="function"&&(t=u,u={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(D,r){Du(e,u||{},function(o,n){o?r(o):D(n)})})}Te(e,u||{},function(D,r){D&&(D.code==="EACCES"||u&&u.ignoreErrors)&&(D=null,r=!1),t(D,r)})}function Xr(e,u){try{return Te.sync(e,u||{})}catch(t){if(u&&u.ignoreErrors||t.code==="EACCES")return!1;throw t}}const te=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",$t=U,Qr=te?";":":",xt=Zr,St=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Tt=(e,u)=>{const t=u.colon||Qr,D=e.match(/\//)||te&&e.match(/\\/)?[""]:[...te?[process.cwd()]:[],...(u.path||process.env.PATH||"").split(t)],r=te?u.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=te?r.split(t):[""];return te&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:D,pathExt:o,pathExtExe:r}},Ot=(e,u,t)=>{typeof u=="function"&&(t=u,u={}),u||(u={});const{pathEnv:D,pathExt:r,pathExtExe:o}=Tt(e,u),n=[],s=c=>new Promise((f,a)=>{if(c===D.length)return u.all&&n.length?f(n):a(St(e));const l=D[c],F=/^".*"$/.test(l)?l.slice(1,-1):l,C=$t.join(F,e),d=!F&&/^\.[\\\/]/.test(e)?e.slice(0,2)+C:C;f(i(d,c,0))}),i=(c,f,a)=>new Promise((l,F)=>{if(a===r.length)return l(s(f+1));const C=r[a];xt(c+C,{pathExt:o},(d,p)=>{if(!d&&p)if(u.all)n.push(c+C);else return l(c+C);return l(i(c,f,a+1))})});return t?s(0).then(c=>t(null,c),t):s(0)},eo=(e,u)=>{u=u||{};const{pathEnv:t,pathExt:D,pathExtExe:r}=Tt(e,u),o=[];for(let n=0;n<t.length;n++){const s=t[n],i=/^".*"$/.test(s)?s.slice(1,-1):s,c=$t.join(i,e),f=!i&&/^\.[\\\/]/.test(e)?e.slice(0,2)+c:c;for(let a=0;a<D.length;a++){const l=f+D[a];try{if(xt.sync(l,{pathExt:r}))if(u.all)o.push(l);else return l}catch{}}}if(u.all&&o.length)return o;if(u.nothrow)return null;throw St(e)};var uo=Ot;Ot.sync=eo;var nu={exports:{}};const Pt=(e={})=>{const u=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(u).reverse().find(D=>D.toUpperCase()==="PATH")||"Path"};nu.exports=Pt,nu.exports.default=Pt;var to=nu.exports;const It=U,Do=uo,no=to;function kt(e,u){const t=e.options.env||process.env,D=process.cwd(),r=e.options.cwd!=null,o=r&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let n;try{n=Do.sync(e.command,{path:t[no({env:t})],pathExt:u?It.delimiter:void 0})}catch{}finally{o&&process.chdir(D)}return n&&(n=It.resolve(r?e.options.cwd:"",n)),n}function ro(e){return kt(e)||kt(e,!0)}var oo=ro,ru={};const ou=/([()\][%!^"`<>&|;, *?])/g;function so(e){return e=e.replace(ou,"^$1"),e}function io(e,u){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(ou,"^$1"),u&&(e=e.replace(ou,"^$1")),e}ru.command=so,ru.argument=io;var ao=/^#!(.*)/;const co=ao;var lo=(e="")=>{const u=e.match(co);if(!u)return null;const[t,D]=u[0].replace(/#! ?/,"").split(" "),r=t.split("/").pop();return r==="env"?D:D?`${r} ${D}`:r};const su=qe,fo=lo;function Fo(e){const t=Buffer.alloc(150);let D;try{D=su.openSync(e,"r"),su.readSync(D,t,0,150,0),su.closeSync(D)}catch{}return fo(t.toString())}var Co=Fo;const po=U,Mt=oo,Rt=ru,mo=Co,ho=process.platform==="win32",Eo=/\.(?:com|exe)$/i,go=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function yo(e){e.file=Mt(e);const u=e.file&&mo(e.file);return u?(e.args.unshift(e.file),e.command=u,Mt(e)):e.file}function Bo(e){if(!ho)return e;const u=yo(e),t=!Eo.test(u);if(e.options.forceShell||t){const D=go.test(u);e.command=po.normalize(e.command),e.command=Rt.command(e.command),e.args=e.args.map(o=>Rt.argument(o,D));const r=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${r}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function bo(e,u,t){u&&!Array.isArray(u)&&(t=u,u=null),u=u?u.slice(0):[],t=Object.assign({},t);const D={command:e,args:u,options:t,file:void 0,original:{command:e,args:u}};return t.shell?D:Bo(D)}var wo=bo;const iu=process.platform==="win32";function au(e,u){return Object.assign(new Error(`${u} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${u} ${e.command}`,path:e.command,spawnargs:e.args})}function vo(e,u){if(!iu)return;const t=e.emit;e.emit=function(D,r){if(D==="exit"){const o=jt(r,u);if(o)return t.call(e,"error",o)}return t.apply(e,arguments)}}function jt(e,u){return iu&&e===1&&!u.file?au(u.original,"spawn"):null}function Ao(e,u){return iu&&e===1&&!u.file?au(u.original,"spawnSync"):null}var $o={hookChildProcess:vo,verifyENOENT:jt,verifyENOENTSync:Ao,notFoundError:au};const _t=dn,cu=wo,lu=$o;function Lt(e,u,t){const D=cu(e,u,t),r=_t.spawn(D.command,D.args,D.options);return lu.hookChildProcess(r,D),r}function xo(e,u,t){const D=cu(e,u,t),r=_t.spawnSync(D.command,D.args,D.options);return r.error=r.error||lu.verifyENOENTSync(r.status,D),r}ue.exports=Lt,ue.exports.spawn=Lt,ue.exports.sync=xo,ue.exports._parse=cu,ue.exports._enoent=lu;var So=ue.exports,To=ee(So);function Oo(e){const u=typeof e=="string"?`
20
+ `}table({tableData:u,tableOptions:t,tableBreakpoints:D}){return $r(u.map(r=>r.map(o=>this.render(o))),D?Tr(D):t)}flagParameter(u){return u===Boolean?"":u===String?"<string>":u===Number?"<number>":Array.isArray(u)?this.flagParameter(u[0]):"<value>"}flagOperator(u){return" "}flagName(u){const{flag:t,flagFormatted:D,aliasesEnabled:r,aliasFormatted:o}=u;let n="";if(o?n+=`${o}, `:r&&(n+=" "),n+=D,"placeholder"in t&&typeof t.placeholder=="string")n+=`${this.flagOperator(u)}${t.placeholder}`;else{const i=this.flagParameter("type"in t?t.type:t);i&&(n+=`${this.flagOperator(u)}${i}`)}return n}flagDefault(u){return JSON.stringify(u)}flagDescription({flag:u}){let t="description"in u?u.description??"":"";if("default"in u){let{default:D}=u;typeof D=="function"&&(D=D()),D&&(t+=` (default: ${this.flagDefault(D)})`)}return t}render(u){if(typeof u=="string")return u;if(Array.isArray(u))return u.map(t=>this.render(t)).join(`
21
+ `);if("type"in u&&this[u.type]){const t=this[u.type];if(typeof t=="function")return t.call(this,u.data)}throw new Error(`Invalid node type: ${JSON.stringify(u)}`)}}const Qe=e=>e.length>0&&!e.includes(" "),{stringify:q}=JSON,qr=/[|\\{}()[\]^$+*?.]/;function eu(e){const u=[];let t,D;for(const r of e){if(D)throw new Error(`Invalid parameter: Spread parameter ${q(D)} must be last`);const o=r[0],n=r[r.length-1];let i;if(o==="<"&&n===">"&&(i=!0,t))throw new Error(`Invalid parameter: Required parameter ${q(r)} cannot come after optional parameter ${q(t)}`);if(o==="["&&n==="]"&&(i=!1,t=r),i===void 0)throw new Error(`Invalid parameter: ${q(r)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let s=r.slice(1,-1);const c=s.slice(-3)==="...";c&&(D=r,s=s.slice(0,-3));const f=s.match(qr);if(f)throw new Error(`Invalid parameter: ${q(r)}. Invalid character found ${q(f[0])}`);u.push({name:s,required:i,spread:c})}return u}function uu(e,u,t,D){for(let r=0;r<u.length;r+=1){const{name:o,required:n,spread:i}=u[r],s=Or(o);if(s in e)throw new Error(`Invalid parameter: ${q(o)} is used more than once.`);const c=i?t.slice(r):t[r];if(i&&(r=u.length),n&&(!c||i&&c.length===0))return console.error(`Error: Missing required parameter ${q(o)}
22
+ `),D(),process.exit(1);e[s]=c}}function Hr(e){return e===void 0||e!==!1}function At(e,u,t,D){const r={...u.flags},o=u.version;o&&(r.version={type:Boolean,description:"Show version"});const{help:n}=u,i=Hr(n);i&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const s=Kn(r,D,{ignore:u.ignoreArgv}),c=()=>{console.log(u.version)};if(o&&s.flags.version===!0)return c(),process.exit(0);const f=new Ur,a=i&&n?.render?n.render:C=>f.render(C),l=C=>{const p=zr({...u,...C?{help:C}:{},flags:r});console.log(a(p,f))};if(i&&s.flags.help===!0)return l(),process.exit(0);if(u.parameters){let{parameters:C}=u,p=s._;const d=C.indexOf("--"),h=C.slice(d+1),y=Object.create(null);if(d>-1&&h.length>0){C=C.slice(0,d);const m=s._["--"];p=p.slice(0,-m.length||void 0),uu(y,eu(C),p,l),uu(y,eu(h),m,l)}else uu(y,eu(C),p,l);Object.assign(s._,y)}const F={...s,showVersion:c,showHelp:l};return typeof t=="function"&&t(F),{command:e,...F}}function Vr(e,u){const t=new Map;for(const D of u){const r=[D.options.name],{alias:o}=D.options;o&&(Array.isArray(o)?r.push(...o):r.push(o));for(const n of r){if(t.has(n))throw new Error(`Duplicate command name found: ${q(n)}`);t.set(n,D)}}return t.get(e)}function Kr(e,u,t=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!Qe(e.name)))throw new Error(`Invalid script name: ${q(e.name)}`);const D=t[0];if(e.commands&&D&&Qe(D)){const r=Vr(D,e.commands);if(r)return At(r.options.name,{...r.options,parent:e},r.callback,t.slice(1))}return At(void 0,e,u,t)}function vt(e,u){if(!e)throw new Error("Command options are required");const{name:t}=e;if(t===void 0)throw new Error("Command name is required");if(!Qe(t))throw new Error(`Invalid command name ${JSON.stringify(t)}. Command names must be one word.`);return{options:e,callback:u}}var Jr="1.13.4",Yr="Writes your git commit messages for you with AI",Zr="sugarmo/aicommits",I=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ue(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var te={exports:{}},tu,$t;function Xr(){if($t)return tu;$t=1,tu=D,D.sync=r;var e=He;function u(o,n){var i=n.pathExt!==void 0?n.pathExt:process.env.PATHEXT;if(!i||(i=i.split(";"),i.indexOf("")!==-1))return!0;for(var s=0;s<i.length;s++){var c=i[s].toLowerCase();if(c&&o.substr(-c.length).toLowerCase()===c)return!0}return!1}function t(o,n,i){return!o.isSymbolicLink()&&!o.isFile()?!1:u(n,i)}function D(o,n,i){e.stat(o,function(s,c){i(s,s?!1:t(c,o,n))})}function r(o,n){return t(e.statSync(o),o,n)}return tu}var Du,xt;function Qr(){if(xt)return Du;xt=1,Du=u,u.sync=t;var e=He;function u(o,n,i){e.stat(o,function(s,c){i(s,s?!1:D(c,n))})}function t(o,n){return D(e.statSync(o),n)}function D(o,n){return o.isFile()&&r(o,n)}function r(o,n){var i=o.mode,s=o.uid,c=o.gid,f=n.uid!==void 0?n.uid:process.getuid&&process.getuid(),a=n.gid!==void 0?n.gid:process.getgid&&process.getgid(),l=parseInt("100",8),F=parseInt("010",8),C=parseInt("001",8),p=l|F,d=i&C||i&F&&c===a||i&l&&s===f||i&p&&f===0;return d}return Du}var Oe;process.platform==="win32"||I.TESTING_WINDOWS?Oe=Xr():Oe=Qr();var eo=nu;nu.sync=uo;function nu(e,u,t){if(typeof u=="function"&&(t=u,u={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(D,r){nu(e,u||{},function(o,n){o?r(o):D(n)})})}Oe(e,u||{},function(D,r){D&&(D.code==="EACCES"||u&&u.ignoreErrors)&&(D=null,r=!1),t(D,r)})}function uo(e,u){try{return Oe.sync(e,u||{})}catch(t){if(u&&u.ignoreErrors||t.code==="EACCES")return!1;throw t}}const De=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",St=z,to=De?";":":",Tt=eo,Ot=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Pt=(e,u)=>{const t=u.colon||to,D=e.match(/\//)||De&&e.match(/\\/)?[""]:[...De?[process.cwd()]:[],...(u.path||process.env.PATH||"").split(t)],r=De?u.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=De?r.split(t):[""];return De&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:D,pathExt:o,pathExtExe:r}},It=(e,u,t)=>{typeof u=="function"&&(t=u,u={}),u||(u={});const{pathEnv:D,pathExt:r,pathExtExe:o}=Pt(e,u),n=[],i=c=>new Promise((f,a)=>{if(c===D.length)return u.all&&n.length?f(n):a(Ot(e));const l=D[c],F=/^".*"$/.test(l)?l.slice(1,-1):l,C=St.join(F,e),p=!F&&/^\.[\\\/]/.test(e)?e.slice(0,2)+C:C;f(s(p,c,0))}),s=(c,f,a)=>new Promise((l,F)=>{if(a===r.length)return l(i(f+1));const C=r[a];Tt(c+C,{pathExt:o},(p,d)=>{if(!p&&d)if(u.all)n.push(c+C);else return l(c+C);return l(s(c,f,a+1))})});return t?i(0).then(c=>t(null,c),t):i(0)},Do=(e,u)=>{u=u||{};const{pathEnv:t,pathExt:D,pathExtExe:r}=Pt(e,u),o=[];for(let n=0;n<t.length;n++){const i=t[n],s=/^".*"$/.test(i)?i.slice(1,-1):i,c=St.join(s,e),f=!s&&/^\.[\\\/]/.test(e)?e.slice(0,2)+c:c;for(let a=0;a<D.length;a++){const l=f+D[a];try{if(Tt.sync(l,{pathExt:r}))if(u.all)o.push(l);else return l}catch{}}}if(u.all&&o.length)return o;if(u.nothrow)return null;throw Ot(e)};var no=It;It.sync=Do;var ru={exports:{}};const kt=(e={})=>{const u=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(u).reverse().find(D=>D.toUpperCase()==="PATH")||"Path"};ru.exports=kt,ru.exports.default=kt;var ro=ru.exports;const Mt=z,oo=no,io=ro;function Rt(e,u){const t=e.options.env||process.env,D=process.cwd(),r=e.options.cwd!=null,o=r&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let n;try{n=oo.sync(e.command,{path:t[io({env:t})],pathExt:u?Mt.delimiter:void 0})}catch{}finally{o&&process.chdir(D)}return n&&(n=Mt.resolve(r?e.options.cwd:"",n)),n}function so(e){return Rt(e)||Rt(e,!0)}var ao=so,ou={};const iu=/([()\][%!^"`<>&|;, *?])/g;function co(e){return e=e.replace(iu,"^$1"),e}function lo(e,u){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(iu,"^$1"),u&&(e=e.replace(iu,"^$1")),e}ou.command=co,ou.argument=lo;var fo=/^#!(.*)/;const Fo=fo;var Co=(e="")=>{const u=e.match(Fo);if(!u)return null;const[t,D]=u[0].replace(/#! ?/,"").split(" "),r=t.split("/").pop();return r==="env"?D:D?`${r} ${D}`:r};const su=He,po=Co;function mo(e){const t=Buffer.alloc(150);let D;try{D=su.openSync(e,"r"),su.readSync(D,t,0,150,0),su.closeSync(D)}catch{}return po(t.toString())}var ho=mo;const Eo=z,jt=ao,_t=ou,go=ho,yo=process.platform==="win32",Bo=/\.(?:com|exe)$/i,bo=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function wo(e){e.file=jt(e);const u=e.file&&go(e.file);return u?(e.args.unshift(e.file),e.command=u,jt(e)):e.file}function Ao(e){if(!yo)return e;const u=wo(e),t=!Bo.test(u);if(e.options.forceShell||t){const D=bo.test(u);e.command=Eo.normalize(e.command),e.command=_t.command(e.command),e.args=e.args.map(o=>_t.argument(o,D));const r=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${r}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function vo(e,u,t){u&&!Array.isArray(u)&&(t=u,u=null),u=u?u.slice(0):[],t=Object.assign({},t);const D={command:e,args:u,options:t,file:void 0,original:{command:e,args:u}};return t.shell?D:Ao(D)}var $o=vo;const au=process.platform==="win32";function cu(e,u){return Object.assign(new Error(`${u} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${u} ${e.command}`,path:e.command,spawnargs:e.args})}function xo(e,u){if(!au)return;const t=e.emit;e.emit=function(D,r){if(D==="exit"){const o=Lt(r,u);if(o)return t.call(e,"error",o)}return t.apply(e,arguments)}}function Lt(e,u){return au&&e===1&&!u.file?cu(u.original,"spawn"):null}function So(e,u){return au&&e===1&&!u.file?cu(u.original,"spawnSync"):null}var To={hookChildProcess:xo,verifyENOENT:Lt,verifyENOENTSync:So,notFoundError:cu};const Nt=mn,lu=$o,fu=To;function Gt(e,u,t){const D=lu(e,u,t),r=Nt.spawn(D.command,D.args,D.options);return fu.hookChildProcess(r,D),r}function Oo(e,u,t){const D=lu(e,u,t),r=Nt.spawnSync(D.command,D.args,D.options);return r.error=r.error||fu.verifyENOENTSync(r.status,D),r}te.exports=Gt,te.exports.spawn=Gt,te.exports.sync=Oo,te.exports._parse=lu,te.exports._enoent=fu;var Po=te.exports,Io=ue(Po);function ko(e){const u=typeof e=="string"?`
23
23
  `:`
24
- `.charCodeAt(),t=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===u&&(e=e.slice(0,-1)),e[e.length-1]===t&&(e=e.slice(0,-1)),e}function Nt(e={}){const{env:u=process.env,platform:t=process.platform}=e;return t!=="win32"?"PATH":Object.keys(u).reverse().find(D=>D.toUpperCase()==="PATH")||"Path"}const Po=({cwd:e=T.cwd(),path:u=T.env[Nt()],preferLocal:t=!0,execPath:D=T.execPath,addExecPath:r=!0}={})=>{const o=e instanceof URL?Xu(e):e,n=Q.resolve(o),s=[];return t&&Io(s,n),r&&ko(s,D,n),[...s,u].join(Q.delimiter)},Io=(e,u)=>{let t;for(;t!==u;)e.push(Q.join(u,"node_modules/.bin")),t=u,u=Q.resolve(u,"..")},ko=(e,u,t)=>{const D=u instanceof URL?Xu(u):u;e.push(Q.resolve(t,D,".."))},Mo=({env:e=T.env,...u}={})=>{e={...e};const t=Nt({env:e});return u.path=e[t],e[t]=Po(u),e},Ro=(e,u,t,D)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;const r=Object.getOwnPropertyDescriptor(e,t),o=Object.getOwnPropertyDescriptor(u,t);!jo(r,o)&&D||Object.defineProperty(e,t,o)},jo=function(e,u){return e===void 0||e.configurable||e.writable===u.writable&&e.enumerable===u.enumerable&&e.configurable===u.configurable&&(e.writable||e.value===u.value)},_o=(e,u)=>{const t=Object.getPrototypeOf(u);t!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,t)},Lo=(e,u)=>`/* Wrapped ${e}*/
25
- ${u}`,No=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Go=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),zo=(e,u,t)=>{const D=t===""?"":`with ${t.trim()}() `,r=Lo.bind(null,D,u.toString());Object.defineProperty(r,"name",Go),Object.defineProperty(e,"toString",{...No,value:r})};function Wo(e,u,{ignoreNonConfigurable:t=!1}={}){const{name:D}=e;for(const r of Reflect.ownKeys(u))Ro(e,u,r,t);return _o(e,u),zo(e,u,D),e}const Oe=new WeakMap,Gt=(e,u={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let t,D=0;const r=e.displayName||e.name||"<anonymous>",o=function(...n){if(Oe.set(o,++D),D===1)t=e.apply(this,n),e=null;else if(u.throw===!0)throw new Error(`Function \`${r}\` can only be called once`);return t};return Wo(o,e),Oe.set(o,D),o};Gt.callCount=e=>{if(!Oe.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Oe.get(e)};const Uo=()=>{const e=Wt-zt+1;return Array.from({length:e},qo)},qo=(e,u)=>({name:`SIGRT${u+1}`,number:zt+u,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),zt=34,Wt=64,Ho=[{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"}],Ut=()=>{const e=Uo();return[...Ho,...e].map(Vo)},Vo=({name:e,number:u,description:t,action:D,forced:r=!1,standard:o})=>{const{signals:{[e]:n}}=Qu,s=n!==void 0;return{name:e,number:s?n:u,description:t,supported:s,action:D,forced:r,standard:o}},Ko=()=>{const e=Ut();return Object.fromEntries(e.map(Jo))},Jo=({name:e,number:u,description:t,supported:D,action:r,forced:o,standard:n})=>[e,{name:e,number:u,description:t,supported:D,action:r,forced:o,standard:n}],Yo=Ko(),Zo=()=>{const e=Ut(),u=Wt+1,t=Array.from({length:u},(D,r)=>Xo(r,e));return Object.assign({},...t)},Xo=(e,u)=>{const t=Qo(e,u);if(t===void 0)return{};const{name:D,description:r,supported:o,action:n,forced:s,standard:i}=t;return{[e]:{name:D,number:e,description:r,supported:o,action:n,forced:s,standard:i}}},Qo=(e,u)=>{const t=u.find(({name:D})=>Qu.signals[D]===e);return t!==void 0?t:u.find(D=>D.number===e)};Zo();const es=({timedOut:e,timeout:u,errorCode:t,signal:D,signalDescription:r,exitCode:o,isCanceled:n})=>e?`timed out after ${u} milliseconds`:n?"was canceled":t!==void 0?`failed with ${t}`:D!==void 0?`was killed with ${D} (${r})`:o!==void 0?`failed with exit code ${o}`:"failed",qt=({stdout:e,stderr:u,all:t,error:D,signal:r,exitCode:o,command:n,escapedCommand:s,timedOut:i,isCanceled:c,killed:f,parsed:{options:{timeout:a,cwd:l=T.cwd()}}})=>{o=o===null?void 0:o,r=r===null?void 0:r;const F=r===void 0?void 0:Yo[r].description,C=D&&D.code,p=`Command ${es({timedOut:i,timeout:a,errorCode:C,signal:r,signalDescription:F,exitCode:o,isCanceled:c})}: ${n}`,h=Object.prototype.toString.call(D)==="[object Error]",g=h?`${p}
26
- ${D.message}`:p,m=[g,u,e].filter(Boolean).join(`
27
- `);return h?(D.originalMessage=D.message,D.message=m):D=new Error(m),D.shortMessage=g,D.command=n,D.escapedCommand=s,D.exitCode=o,D.signal=r,D.signalDescription=F,D.stdout=e,D.stderr=u,D.cwd=l,t!==void 0&&(D.all=t),"bufferedData"in D&&delete D.bufferedData,D.failed=!0,D.timedOut=!!i,D.isCanceled=c,D.killed=f&&!i,D},Pe=["stdin","stdout","stderr"],us=e=>Pe.some(u=>e[u]!==void 0),ts=e=>{if(!e)return;const{stdio:u}=e;if(u===void 0)return Pe.map(D=>e[D]);if(us(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Pe.map(D=>`\`${D}\``).join(", ")}`);if(typeof u=="string")return u;if(!Array.isArray(u))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof u}\``);const t=Math.max(u.length,Pe.length);return Array.from({length:t},(D,r)=>u[r])};var De={exports:{}},Ie={exports:{}};Ie.exports;var Ht;function Ds(){return Ht||(Ht=1,function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}(Ie)),Ie.exports}var A=I.process;const J=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};if(!J(A))De.exports=function(){return function(){}};else{var ns=et,ce=Ds(),rs=/^win/i.test(A.platform),ke=ut;typeof ke!="function"&&(ke=ke.EventEmitter);var k;A.__signal_exit_emitter__?k=A.__signal_exit_emitter__:(k=A.__signal_exit_emitter__=new ke,k.count=0,k.emitted={}),k.infinite||(k.setMaxListeners(1/0),k.infinite=!0),De.exports=function(e,u){if(!J(I.process))return function(){};ns.equal(typeof e,"function","a callback must be provided for exit handler"),le===!1&&Vt();var t="exit";u&&u.alwaysLast&&(t="afterexit");var D=function(){k.removeListener(t,e),k.listeners("exit").length===0&&k.listeners("afterexit").length===0&&fu()};return k.on(t,e),D};var fu=function(){!le||!J(I.process)||(le=!1,ce.forEach(function(u){try{A.removeListener(u,Fu[u])}catch{}}),A.emit=Cu,A.reallyExit=Kt,k.count-=1)};De.exports.unload=fu;var ne=function(u,t,D){k.emitted[u]||(k.emitted[u]=!0,k.emit(u,t,D))},Fu={};ce.forEach(function(e){Fu[e]=function(){if(J(I.process)){var t=A.listeners(e);t.length===k.count&&(fu(),ne("exit",null,e),ne("afterexit",null,e),rs&&e==="SIGHUP"&&(e="SIGINT"),A.kill(A.pid,e))}}}),De.exports.signals=function(){return ce};var le=!1,Vt=function(){le||!J(I.process)||(le=!0,k.count+=1,ce=ce.filter(function(u){try{return A.on(u,Fu[u]),!0}catch{return!1}}),A.emit=ss,A.reallyExit=os)};De.exports.load=Vt;var Kt=A.reallyExit,os=function(u){J(I.process)&&(A.exitCode=u||0,ne("exit",A.exitCode,null),ne("afterexit",A.exitCode,null),Kt.call(A,A.exitCode))},Cu=A.emit,ss=function(u,t){if(u==="exit"&&J(I.process)){t!==void 0&&(A.exitCode=t);var D=Cu.apply(this,arguments);return ne("exit",A.exitCode,null),ne("afterexit",A.exitCode,null),D}else return Cu.apply(this,arguments)}}var is=De.exports,as=ee(is);const cs=1e3*5,ls=(e,u="SIGTERM",t={})=>{const D=e(u);return fs(e,u,t,D),D},fs=(e,u,t,D)=>{if(!Fs(u,t,D))return;const r=ds(t),o=setTimeout(()=>{e("SIGKILL")},r);o.unref&&o.unref()},Fs=(e,{forceKillAfterTimeout:u},t)=>Cs(e)&&u!==!1&&t,Cs=e=>e===pn.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",ds=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return cs;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},ps=(e,u)=>{e.kill()&&(u.isCanceled=!0)},ms=(e,u,t)=>{e.kill(u),t(Object.assign(new Error("Timed out"),{timedOut:!0,signal:u}))},hs=(e,{timeout:u,killSignal:t="SIGTERM"},D)=>{if(u===0||u===void 0)return D;let r;const o=new Promise((s,i)=>{r=setTimeout(()=>{ms(e,t,i)},u)}),n=D.finally(()=>{clearTimeout(r)});return Promise.race([o,n])},Es=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},gs=async(e,{cleanup:u,detached:t},D)=>{if(!u||t)return D;const r=as(()=>{e.kill()});return D.finally(()=>{r()})};function Jt(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}function Yt(e){return Jt(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"}const ys=e=>e instanceof fn&&typeof e.then=="function",du=(e,u,t)=>{if(typeof t=="string")return e[u].pipe(mn(t)),e;if(Yt(t))return e[u].pipe(t),e;if(!ys(t))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!Yt(t.stdin))throw new TypeError("The target child process's stdin must be available.");return e[u].pipe(t.stdin),t},Bs=e=>{e.stdout!==null&&(e.pipeStdout=du.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=du.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=du.bind(void 0,e,"all"))};var fe={exports:{}};const{PassThrough:bs}=He;var ws=e=>{e={...e};const{array:u}=e;let{encoding:t}=e;const D=t==="buffer";let r=!1;u?r=!(t||D):t=t||"utf8",D&&(t=null);const o=new bs({objectMode:r});t&&o.setEncoding(t);let n=0;const s=[];return o.on("data",i=>{s.push(i),r?n=s.length:n+=i.length}),o.getBufferedValue=()=>u?s:D?Buffer.concat(s,n):s.join(""),o.getBufferedLength=()=>n,o};const{constants:vs}=En,As=He,{promisify:$s}=tt,xs=ws,Ss=$s(As.pipeline);class Zt extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function pu(e,u){if(!e)throw new Error("Expected a stream");u={maxBuffer:1/0,...u};const{maxBuffer:t}=u,D=xs(u);return await new Promise((r,o)=>{const n=s=>{s&&D.getBufferedLength()<=vs.MAX_LENGTH&&(s.bufferedData=D.getBufferedValue()),o(s)};(async()=>{try{await Ss(e,D),r()}catch(s){n(s)}})(),D.on("data",()=>{D.getBufferedLength()>t&&n(new Zt)})}),D.getBufferedValue()}fe.exports=pu,fe.exports.buffer=(e,u)=>pu(e,{...u,encoding:"buffer"}),fe.exports.array=(e,u)=>pu(e,{...u,array:!0}),fe.exports.MaxBufferError=Zt;var Ts=fe.exports,Xt=ee(Ts);const{PassThrough:Os}=He;var Ps=function(){var e=[],u=new Os({objectMode:!0});return u.setMaxListeners(0),u.add=t,u.isEmpty=D,u.on("unpipe",r),Array.prototype.slice.call(arguments).forEach(t),u;function t(o){return Array.isArray(o)?(o.forEach(t),this):(e.push(o),o.once("end",r.bind(null,o)),o.once("error",u.emit.bind(u,"error")),o.pipe(u,{end:!1}),this)}function D(){return e.length==0}function r(o){e=e.filter(function(n){return n!==o}),!e.length&&u.readable&&u.end()}},Is=ee(Ps);const ks=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},Ms=({input:e,inputFile:u})=>typeof u!="string"?e:(ks(e),hn(u)),Rs=(e,u)=>{const t=Ms(u);t!==void 0&&(Jt(t)?t.pipe(e.stdin):e.stdin.end(t))},js=(e,{all:u})=>{if(!u||!e.stdout&&!e.stderr)return;const t=Is();return e.stdout&&t.add(e.stdout),e.stderr&&t.add(e.stderr),t},mu=async(e,u)=>{if(!(!e||u===void 0)){e.destroy();try{return await u}catch(t){return t.bufferedData}}},hu=(e,{encoding:u,buffer:t,maxBuffer:D})=>{if(!(!e||!t))return u?Xt(e,{encoding:u,maxBuffer:D}):Xt.buffer(e,{maxBuffer:D})},_s=async({stdout:e,stderr:u,all:t},{encoding:D,buffer:r,maxBuffer:o},n)=>{const s=hu(e,{encoding:D,buffer:r,maxBuffer:o}),i=hu(u,{encoding:D,buffer:r,maxBuffer:o}),c=hu(t,{encoding:D,buffer:r,maxBuffer:o*2});try{return await Promise.all([n,s,i,c])}catch(f){return Promise.all([{error:f,signal:f.signal,timedOut:f.timedOut},mu(e,s),mu(u,i),mu(t,c)])}},Ls=(async()=>{})().constructor.prototype,Ns=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Ls,e)]),Qt=(e,u)=>{for(const[t,D]of Ns){const r=typeof u=="function"?(...o)=>Reflect.apply(D.value,u(),o):D.value.bind(u);Reflect.defineProperty(e,t,{...D,value:r})}},Gs=e=>new Promise((u,t)=>{e.on("exit",(D,r)=>{u({exitCode:D,signal:r})}),e.on("error",D=>{t(D)}),e.stdin&&e.stdin.on("error",D=>{t(D)})}),eD=(e,u=[])=>Array.isArray(u)?[e,...u]:[e],zs=/^[\w.-]+$/,Ws=/"/g,Us=e=>typeof e!="string"||zs.test(e)?e:`"${e.replace(Ws,'\\"')}"`,qs=(e,u)=>eD(e,u).join(" "),Hs=(e,u)=>eD(e,u).map(t=>Us(t)).join(" "),Vs=gn("execa").enabled,Me=(e,u)=>String(e).padStart(u,"0"),Ks=()=>{const e=new Date;return`${Me(e.getHours(),2)}:${Me(e.getMinutes(),2)}:${Me(e.getSeconds(),2)}.${Me(e.getMilliseconds(),3)}`},Js=(e,{verbose:u})=>{u&&T.stderr.write(`[${Ks()}] ${e}
28
- `)},Ys=1e3*1e3*100,Zs=({env:e,extendEnv:u,preferLocal:t,localDir:D,execPath:r})=>{const o=u?{...T.env,...e}:e;return t?Mo({env:o,cwd:D,execPath:r}):o},Xs=(e,u,t={})=>{const D=To._parse(e,u,t);return e=D.command,u=D.args,t=D.options,t={maxBuffer:Ys,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:t.cwd||T.cwd(),execPath:T.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:Vs,...t},t.env=Zs(t),t.stdio=ts(t),T.platform==="win32"&&Q.basename(e,".exe")==="cmd"&&u.unshift("/q"),{file:e,args:u,options:t,parsed:D}},Eu=(e,u,t)=>typeof u!="string"&&!ln.isBuffer(u)?t===void 0?void 0:"":e.stripFinalNewline?Oo(u):u;function re(e,u,t){const D=Xs(e,u,t),r=qs(e,u),o=Hs(e,u);Js(o,D.options),Es(D.options);let n;try{n=Zu.spawn(D.file,D.args,D.options)}catch(F){const C=new Zu.ChildProcess,d=Promise.reject(qt({error:F,stdout:"",stderr:"",all:"",command:r,escapedCommand:o,parsed:D,timedOut:!1,isCanceled:!1,killed:!1}));return Qt(C,d),C}const s=Gs(n),i=hs(n,D.options,s),c=gs(n,D.options,i),f={isCanceled:!1};n.kill=ls.bind(null,n.kill.bind(n)),n.cancel=ps.bind(null,n,f);const l=Gt(async()=>{const[{error:F,exitCode:C,signal:d,timedOut:p},h,g,m]=await _s(n,D.options,c),b=Eu(D.options,h),y=Eu(D.options,g),O=Eu(D.options,m);if(F||C!==0||d!==null){const v=qt({error:F,exitCode:C,signal:d,stdout:b,stderr:y,all:O,command:r,escapedCommand:o,parsed:D,timedOut:p,isCanceled:f.isCanceled||(D.options.signal?D.options.signal.aborted:!1),killed:n.killed});if(!D.options.reject)return v;throw v}return{command:r,escapedCommand:o,exitCode:0,stdout:b,stderr:y,all:O,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Rs(n,D.options),n.all=js(n,D.options),Bs(n),Qt(n,l),n}let Y=!0;const oe=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let Fe=0;if(oe.process&&oe.process.env&&oe.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:u,NO_COLOR:t,TERM:D,COLORTERM:r}=oe.process.env;u||t||e==="0"?Y=!1:e==="1"||e==="2"||e==="3"?Y=!0:D==="dumb"?Y=!1:"CI"in oe.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(o=>o in oe.process.env)?Y=!0:Y=process.stdout.isTTY,Y&&(process.platform==="win32"||r&&(r==="truecolor"||r==="24bit")?Fe=3:D&&(D.endsWith("-256color")||D.endsWith("256"))?Fe=2:Fe=1)}let uD={enabled:Y,supportLevel:Fe};function Z(e,u,t=1){const D=`\x1B[${e}m`,r=`\x1B[${u}m`,o=new RegExp(`\\x1b\\[${u}m`,"g");return n=>uD.enabled&&uD.supportLevel>=t?D+(""+n).replace(o,D)+r:""+n}const Ce=Z(2,22),Qs=Z(30,39),gu=Z(31,39),Re=Z(32,39),ei=Z(35,39),ui=Z(90,39),ti=Z(46,49),yu="\x1B",x=`${yu}[`,Di="\x07",Bu={to(e,u){return u?`${x}${u+1};${e+1}H`:`${x}${e+1}G`},move(e,u){let t="";return e<0?t+=`${x}${-e}D`:e>0&&(t+=`${x}${e}C`),u<0?t+=`${x}${-u}A`:u>0&&(t+=`${x}${u}B`),t},up:(e=1)=>`${x}${e}A`,down:(e=1)=>`${x}${e}B`,forward:(e=1)=>`${x}${e}C`,backward:(e=1)=>`${x}${e}D`,nextLine:(e=1)=>`${x}E`.repeat(e),prevLine:(e=1)=>`${x}F`.repeat(e),left:`${x}G`,hide:`${x}?25l`,show:`${x}?25h`,save:`${yu}7`,restore:`${yu}8`},ni={up:(e=1)=>`${x}S`.repeat(e),down:(e=1)=>`${x}T`.repeat(e)},ri={screen:`${x}2J`,up:(e=1)=>`${x}1J`.repeat(e),down:(e=1)=>`${x}J`.repeat(e),line:`${x}2K`,lineEnd:`${x}K`,lineStart:`${x}1K`,lines(e){let u="";for(let t=0;t<e;t++)u+=this.line+(t<e-1?Bu.up():"");return e&&(u+=Bu.left),u}};var z={cursor:Bu,scroll:ni,erase:ri,beep:Di},bu={exports:{}};let je=process||{},tD=je.argv||[],_e=je.env||{},oi=!(_e.NO_COLOR||tD.includes("--no-color"))&&(!!_e.FORCE_COLOR||tD.includes("--color")||je.platform==="win32"||(je.stdout||{}).isTTY&&_e.TERM!=="dumb"||!!_e.CI),si=(e,u,t=e)=>D=>{let r=""+D,o=r.indexOf(u,e.length);return~o?e+ii(r,u,t,o)+u:e+r+u},ii=(e,u,t,D)=>{let r="",o=0;do r+=e.substring(o,D)+t,o=D+u.length,D=e.indexOf(u,o);while(~D);return r+e.substring(o)},DD=(e=oi)=>{let u=e?si:()=>String;return{isColorSupported:e,reset:u("\x1B[0m","\x1B[0m"),bold:u("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:u("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:u("\x1B[3m","\x1B[23m"),underline:u("\x1B[4m","\x1B[24m"),inverse:u("\x1B[7m","\x1B[27m"),hidden:u("\x1B[8m","\x1B[28m"),strikethrough:u("\x1B[9m","\x1B[29m"),black:u("\x1B[30m","\x1B[39m"),red:u("\x1B[31m","\x1B[39m"),green:u("\x1B[32m","\x1B[39m"),yellow:u("\x1B[33m","\x1B[39m"),blue:u("\x1B[34m","\x1B[39m"),magenta:u("\x1B[35m","\x1B[39m"),cyan:u("\x1B[36m","\x1B[39m"),white:u("\x1B[37m","\x1B[39m"),gray:u("\x1B[90m","\x1B[39m"),bgBlack:u("\x1B[40m","\x1B[49m"),bgRed:u("\x1B[41m","\x1B[49m"),bgGreen:u("\x1B[42m","\x1B[49m"),bgYellow:u("\x1B[43m","\x1B[49m"),bgBlue:u("\x1B[44m","\x1B[49m"),bgMagenta:u("\x1B[45m","\x1B[49m"),bgCyan:u("\x1B[46m","\x1B[49m"),bgWhite:u("\x1B[47m","\x1B[49m"),blackBright:u("\x1B[90m","\x1B[39m"),redBright:u("\x1B[91m","\x1B[39m"),greenBright:u("\x1B[92m","\x1B[39m"),yellowBright:u("\x1B[93m","\x1B[39m"),blueBright:u("\x1B[94m","\x1B[39m"),magentaBright:u("\x1B[95m","\x1B[39m"),cyanBright:u("\x1B[96m","\x1B[39m"),whiteBright:u("\x1B[97m","\x1B[39m"),bgBlackBright:u("\x1B[100m","\x1B[49m"),bgRedBright:u("\x1B[101m","\x1B[49m"),bgGreenBright:u("\x1B[102m","\x1B[49m"),bgYellowBright:u("\x1B[103m","\x1B[49m"),bgBlueBright:u("\x1B[104m","\x1B[49m"),bgMagentaBright:u("\x1B[105m","\x1B[49m"),bgCyanBright:u("\x1B[106m","\x1B[49m"),bgWhiteBright:u("\x1B[107m","\x1B[49m")}};bu.exports=DD(),bu.exports.createColors=DD;var ai=bu.exports,E=ee(ai);function ci({onlyFirst:e=!1}={}){const u=["[\\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(u,e?void 0:"g")}const li=ci();function nD(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(li,"")}function rD(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oD={exports:{}};(function(e){var u={};e.exports=u,u.eastAsianWidth=function(D){var r=D.charCodeAt(0),o=D.length==2?D.charCodeAt(1):0,n=r;return 55296<=r&&r<=56319&&56320<=o&&o<=57343&&(r&=1023,o&=1023,n=r<<10|o,n+=65536),n==12288||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":n==8361||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||n==172||n==175||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":n==161||n==164||167<=n&&n<=168||n==170||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||n==198||n==208||215<=n&&n<=216||222<=n&&n<=225||n==230||232<=n&&n<=234||236<=n&&n<=237||n==240||242<=n&&n<=243||247<=n&&n<=250||n==252||n==254||n==257||n==273||n==275||n==283||294<=n&&n<=295||n==299||305<=n&&n<=307||n==312||319<=n&&n<=322||n==324||328<=n&&n<=331||n==333||338<=n&&n<=339||358<=n&&n<=359||n==363||n==462||n==464||n==466||n==468||n==470||n==472||n==474||n==476||n==593||n==609||n==708||n==711||713<=n&&n<=715||n==717||n==720||728<=n&&n<=731||n==733||n==735||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||n==1025||1040<=n&&n<=1103||n==1105||n==8208||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||n==8240||8242<=n&&n<=8243||n==8245||n==8251||n==8254||n==8308||n==8319||8321<=n&&n<=8324||n==8364||n==8451||n==8453||n==8457||n==8467||n==8470||8481<=n&&n<=8482||n==8486||n==8491||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||n==8585||8592<=n&&n<=8601||8632<=n&&n<=8633||n==8658||n==8660||n==8679||n==8704||8706<=n&&n<=8707||8711<=n&&n<=8712||n==8715||n==8719||n==8721||n==8725||n==8730||8733<=n&&n<=8736||n==8739||n==8741||8743<=n&&n<=8748||n==8750||8756<=n&&n<=8759||8764<=n&&n<=8765||n==8776||n==8780||n==8786||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||n==8853||n==8857||n==8869||n==8895||n==8978||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||n==9675||9678<=n&&n<=9681||9698<=n&&n<=9701||n==9711||9733<=n&&n<=9734||n==9737||9742<=n&&n<=9743||9748<=n&&n<=9749||n==9756||n==9758||n==9792||n==9794||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||n==9839||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||n==9955||9960<=n&&n<=9983||n==10045||n==10071||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||n==65533||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"},u.characterLength=function(D){var r=this.eastAsianWidth(D);return r=="F"||r=="W"||r=="A"?2:1};function t(D){return D.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.length=function(D){for(var r=t(D),o=0,n=0;n<r.length;n++)o=o+this.characterLength(r[n]);return o},u.slice=function(D,r,o){textLen=u.length(D),r=r||0,o=o||1,r<0&&(r=textLen+r),o<0&&(o=textLen+o);for(var n="",s=0,i=t(D),c=0;c<i.length;c++){var f=i[c],a=u.length(f);if(s>=r-(a==2?1:0))if(s+a<=o)n+=f;else break;s+=a}return n}})(oD);var fi=oD.exports;const Fi=rD(fi);var Ci=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};const di=rD(Ci);function de(e,u={}){if(typeof e!="string"||e.length===0||(u={ambiguousIsNarrow:!0,...u},e=nD(e),e.length===0))return 0;e=e.replace(di()," ");const t=u.ambiguousIsNarrow?1:2;let D=0;for(const r of e){const o=r.codePointAt(0);if(!(o<=31||o>=127&&o<=159||o>=768&&o<=879))switch(Fi.eastAsianWidth(r)){case"F":case"W":D+=2;break;case"A":D+=t;break;default:D+=1}}return D}const wu=10,sD=(e=0)=>u=>`\x1B[${u+e}m`,iD=(e=0)=>u=>`\x1B[${38+e};5;${u}m`,aD=(e=0)=>(u,t,D)=>`\x1B[${38+e};2;${u};${t};${D}m`,$={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys($.modifier);const pi=Object.keys($.color),mi=Object.keys($.bgColor);[...pi,...mi];function hi(){const e=new Map;for(const[u,t]of Object.entries($)){for(const[D,r]of Object.entries(t))$[D]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},t[D]=$[D],e.set(r[0],r[1]);Object.defineProperty($,u,{value:t,enumerable:!1})}return Object.defineProperty($,"codes",{value:e,enumerable:!1}),$.color.close="\x1B[39m",$.bgColor.close="\x1B[49m",$.color.ansi=sD(),$.color.ansi256=iD(),$.color.ansi16m=aD(),$.bgColor.ansi=sD(wu),$.bgColor.ansi256=iD(wu),$.bgColor.ansi16m=aD(wu),Object.defineProperties($,{rgbToAnsi256:{value:(u,t,D)=>u===t&&t===D?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(t/255*5)+Math.round(D/255*5),enumerable:!1},hexToRgb:{value:u=>{const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!t)return[0,0,0];let[D]=t;D.length===3&&(D=[...D].map(o=>o+o).join(""));const r=Number.parseInt(D,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:u=>$.rgbToAnsi256(...$.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let t,D,r;if(u>=232)t=((u-232)*10+8)/255,D=t,r=t;else{u-=16;const s=u%36;t=Math.floor(u/36)/5,D=Math.floor(s/6)/5,r=s%6/5}const o=Math.max(t,D,r)*2;if(o===0)return 30;let n=30+(Math.round(r)<<2|Math.round(D)<<1|Math.round(t));return o===2&&(n+=60),n},enumerable:!1},rgbToAnsi:{value:(u,t,D)=>$.ansi256ToAnsi($.rgbToAnsi256(u,t,D)),enumerable:!1},hexToAnsi:{value:u=>$.ansi256ToAnsi($.hexToAnsi256(u)),enumerable:!1}}),$}const Ei=hi(),Le=new Set(["\x1B","\x9B"]),gi=39,vu="\x07",cD="[",yi="]",lD="m",Au=`${yi}8;;`,fD=e=>`${Le.values().next().value}${cD}${e}${lD}`,FD=e=>`${Le.values().next().value}${Au}${e}${vu}`,Bi=e=>e.split(" ").map(u=>de(u)),$u=(e,u,t)=>{const D=[...u];let r=!1,o=!1,n=de(nD(e[e.length-1]));for(const[s,i]of D.entries()){const c=de(i);if(n+c<=t?e[e.length-1]+=i:(e.push(i),n=0),Le.has(i)&&(r=!0,o=D.slice(s+1).join("").startsWith(Au)),r){o?i===vu&&(r=!1,o=!1):i===lD&&(r=!1);continue}n+=c,n===t&&s<D.length-1&&(e.push(""),n=0)}!n&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},bi=e=>{const u=e.split(" ");let t=u.length;for(;t>0&&!(de(u[t-1])>0);)t--;return t===u.length?e:u.slice(0,t).join(" ")+u.slice(t).join("")},wi=(e,u,t={})=>{if(t.trim!==!1&&e.trim()==="")return"";let D="",r,o;const n=Bi(e);let s=[""];for(const[c,f]of e.split(" ").entries()){t.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let a=de(s[s.length-1]);if(c!==0&&(a>=u&&(t.wordWrap===!1||t.trim===!1)&&(s.push(""),a=0),(a>0||t.trim===!1)&&(s[s.length-1]+=" ",a++)),t.hard&&n[c]>u){const l=u-a,F=1+Math.floor((n[c]-l-1)/u);Math.floor((n[c]-1)/u)<F&&s.push(""),$u(s,f,u);continue}if(a+n[c]>u&&a>0&&n[c]>0){if(t.wordWrap===!1&&a<u){$u(s,f,u);continue}s.push("")}if(a+n[c]>u&&t.wordWrap===!1){$u(s,f,u);continue}s[s.length-1]+=f}t.trim!==!1&&(s=s.map(c=>bi(c)));const i=[...s.join(`
29
- `)];for(const[c,f]of i.entries()){if(D+=f,Le.has(f)){const{groups:l}=new RegExp(`(?:\\${cD}(?<code>\\d+)m|\\${Au}(?<uri>.*)${vu})`).exec(i.slice(c).join(""))||{groups:{}};if(l.code!==void 0){const F=Number.parseFloat(l.code);r=F===gi?void 0:F}else l.uri!==void 0&&(o=l.uri.length===0?void 0:l.uri)}const a=Ei.codes.get(Number(r));i[c+1]===`
30
- `?(o&&(D+=FD("")),r&&a&&(D+=fD(a))):f===`
31
- `&&(r&&a&&(D+=fD(r)),o&&(D+=FD(o)))}return D};function CD(e,u,t){return String(e).normalize().replace(/\r\n/g,`
24
+ `.charCodeAt(),t=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===u&&(e=e.slice(0,-1)),e[e.length-1]===t&&(e=e.slice(0,-1)),e}function zt(e={}){const{env:u=process.env,platform:t=process.platform}=e;return t!=="win32"?"PATH":Object.keys(u).reverse().find(D=>D.toUpperCase()==="PATH")||"Path"}const Mo=({cwd:e=T.cwd(),path:u=T.env[zt()],preferLocal:t=!0,execPath:D=T.execPath,addExecPath:r=!0}={})=>{const o=e instanceof URL?et(e):e,n=ee.resolve(o),i=[];return t&&Ro(i,n),r&&jo(i,D,n),[...i,u].join(ee.delimiter)},Ro=(e,u)=>{let t;for(;t!==u;)e.push(ee.join(u,"node_modules/.bin")),t=u,u=ee.resolve(u,"..")},jo=(e,u,t)=>{const D=u instanceof URL?et(u):u;e.push(ee.resolve(t,D,".."))},_o=({env:e=T.env,...u}={})=>{e={...e};const t=zt({env:e});return u.path=e[t],e[t]=Mo(u),e},Lo=(e,u,t,D)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;const r=Object.getOwnPropertyDescriptor(e,t),o=Object.getOwnPropertyDescriptor(u,t);!No(r,o)&&D||Object.defineProperty(e,t,o)},No=function(e,u){return e===void 0||e.configurable||e.writable===u.writable&&e.enumerable===u.enumerable&&e.configurable===u.configurable&&(e.writable||e.value===u.value)},Go=(e,u)=>{const t=Object.getPrototypeOf(u);t!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,t)},zo=(e,u)=>`/* Wrapped ${e}*/
25
+ ${u}`,Wo=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Uo=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),qo=(e,u,t)=>{const D=t===""?"":`with ${t.trim()}() `,r=zo.bind(null,D,u.toString());Object.defineProperty(r,"name",Uo),Object.defineProperty(e,"toString",{...Wo,value:r})};function Ho(e,u,{ignoreNonConfigurable:t=!1}={}){const{name:D}=e;for(const r of Reflect.ownKeys(u))Lo(e,u,r,t);return Go(e,u),qo(e,u,D),e}const Pe=new WeakMap,Wt=(e,u={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let t,D=0;const r=e.displayName||e.name||"<anonymous>",o=function(...n){if(Pe.set(o,++D),D===1)t=e.apply(this,n),e=null;else if(u.throw===!0)throw new Error(`Function \`${r}\` can only be called once`);return t};return Ho(o,e),Pe.set(o,D),o};Wt.callCount=e=>{if(!Pe.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Pe.get(e)};const Vo=()=>{const e=qt-Ut+1;return Array.from({length:e},Ko)},Ko=(e,u)=>({name:`SIGRT${u+1}`,number:Ut+u,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Ut=34,qt=64,Jo=[{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"}],Ht=()=>{const e=Vo();return[...Jo,...e].map(Yo)},Yo=({name:e,number:u,description:t,action:D,forced:r=!1,standard:o})=>{const{signals:{[e]:n}}=ut,i=n!==void 0;return{name:e,number:i?n:u,description:t,supported:i,action:D,forced:r,standard:o}},Zo=()=>{const e=Ht();return Object.fromEntries(e.map(Xo))},Xo=({name:e,number:u,description:t,supported:D,action:r,forced:o,standard:n})=>[e,{name:e,number:u,description:t,supported:D,action:r,forced:o,standard:n}],Qo=Zo(),ei=()=>{const e=Ht(),u=qt+1,t=Array.from({length:u},(D,r)=>ui(r,e));return Object.assign({},...t)},ui=(e,u)=>{const t=ti(e,u);if(t===void 0)return{};const{name:D,description:r,supported:o,action:n,forced:i,standard:s}=t;return{[e]:{name:D,number:e,description:r,supported:o,action:n,forced:i,standard:s}}},ti=(e,u)=>{const t=u.find(({name:D})=>ut.signals[D]===e);return t!==void 0?t:u.find(D=>D.number===e)};ei();const Di=({timedOut:e,timeout:u,errorCode:t,signal:D,signalDescription:r,exitCode:o,isCanceled:n})=>e?`timed out after ${u} milliseconds`:n?"was canceled":t!==void 0?`failed with ${t}`:D!==void 0?`was killed with ${D} (${r})`:o!==void 0?`failed with exit code ${o}`:"failed",Vt=({stdout:e,stderr:u,all:t,error:D,signal:r,exitCode:o,command:n,escapedCommand:i,timedOut:s,isCanceled:c,killed:f,parsed:{options:{timeout:a,cwd:l=T.cwd()}}})=>{o=o===null?void 0:o,r=r===null?void 0:r;const F=r===void 0?void 0:Qo[r].description,C=D&&D.code,d=`Command ${Di({timedOut:s,timeout:a,errorCode:C,signal:r,signalDescription:F,exitCode:o,isCanceled:c})}: ${n}`,h=Object.prototype.toString.call(D)==="[object Error]",y=h?`${d}
26
+ ${D.message}`:d,m=[y,u,e].filter(Boolean).join(`
27
+ `);return h?(D.originalMessage=D.message,D.message=m):D=new Error(m),D.shortMessage=y,D.command=n,D.escapedCommand=i,D.exitCode=o,D.signal=r,D.signalDescription=F,D.stdout=e,D.stderr=u,D.cwd=l,t!==void 0&&(D.all=t),"bufferedData"in D&&delete D.bufferedData,D.failed=!0,D.timedOut=!!s,D.isCanceled=c,D.killed=f&&!s,D},Ie=["stdin","stdout","stderr"],ni=e=>Ie.some(u=>e[u]!==void 0),ri=e=>{if(!e)return;const{stdio:u}=e;if(u===void 0)return Ie.map(D=>e[D]);if(ni(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Ie.map(D=>`\`${D}\``).join(", ")}`);if(typeof u=="string")return u;if(!Array.isArray(u))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof u}\``);const t=Math.max(u.length,Ie.length);return Array.from({length:t},(D,r)=>u[r])};var ne={exports:{}},ke={exports:{}};ke.exports;var Kt;function oi(){return Kt||(Kt=1,function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}(ke)),ke.exports}var A=I.process;const J=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};if(!J(A))ne.exports=function(){return function(){}};else{var ii=tt,le=oi(),si=/^win/i.test(A.platform),Me=Dt;typeof Me!="function"&&(Me=Me.EventEmitter);var R;A.__signal_exit_emitter__?R=A.__signal_exit_emitter__:(R=A.__signal_exit_emitter__=new Me,R.count=0,R.emitted={}),R.infinite||(R.setMaxListeners(1/0),R.infinite=!0),ne.exports=function(e,u){if(!J(I.process))return function(){};ii.equal(typeof e,"function","a callback must be provided for exit handler"),fe===!1&&Jt();var t="exit";u&&u.alwaysLast&&(t="afterexit");var D=function(){R.removeListener(t,e),R.listeners("exit").length===0&&R.listeners("afterexit").length===0&&Fu()};return R.on(t,e),D};var Fu=function(){!fe||!J(I.process)||(fe=!1,le.forEach(function(u){try{A.removeListener(u,Cu[u])}catch{}}),A.emit=du,A.reallyExit=Yt,R.count-=1)};ne.exports.unload=Fu;var re=function(u,t,D){R.emitted[u]||(R.emitted[u]=!0,R.emit(u,t,D))},Cu={};le.forEach(function(e){Cu[e]=function(){if(J(I.process)){var t=A.listeners(e);t.length===R.count&&(Fu(),re("exit",null,e),re("afterexit",null,e),si&&e==="SIGHUP"&&(e="SIGINT"),A.kill(A.pid,e))}}}),ne.exports.signals=function(){return le};var fe=!1,Jt=function(){fe||!J(I.process)||(fe=!0,R.count+=1,le=le.filter(function(u){try{return A.on(u,Cu[u]),!0}catch{return!1}}),A.emit=ci,A.reallyExit=ai)};ne.exports.load=Jt;var Yt=A.reallyExit,ai=function(u){J(I.process)&&(A.exitCode=u||0,re("exit",A.exitCode,null),re("afterexit",A.exitCode,null),Yt.call(A,A.exitCode))},du=A.emit,ci=function(u,t){if(u==="exit"&&J(I.process)){t!==void 0&&(A.exitCode=t);var D=du.apply(this,arguments);return re("exit",A.exitCode,null),re("afterexit",A.exitCode,null),D}else return du.apply(this,arguments)}}var li=ne.exports,fi=ue(li);const Fi=1e3*5,Ci=(e,u="SIGTERM",t={})=>{const D=e(u);return di(e,u,t,D),D},di=(e,u,t,D)=>{if(!pi(u,t,D))return;const r=hi(t),o=setTimeout(()=>{e("SIGKILL")},r);o.unref&&o.unref()},pi=(e,{forceKillAfterTimeout:u},t)=>mi(e)&&u!==!1&&t,mi=e=>e===hn.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",hi=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Fi;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Ei=(e,u)=>{e.kill()&&(u.isCanceled=!0)},gi=(e,u,t)=>{e.kill(u),t(Object.assign(new Error("Timed out"),{timedOut:!0,signal:u}))},yi=(e,{timeout:u,killSignal:t="SIGTERM"},D)=>{if(u===0||u===void 0)return D;let r;const o=new Promise((i,s)=>{r=setTimeout(()=>{gi(e,t,s)},u)}),n=D.finally(()=>{clearTimeout(r)});return Promise.race([o,n])},Bi=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},bi=async(e,{cleanup:u,detached:t},D)=>{if(!u||t)return D;const r=fi(()=>{e.kill()});return D.finally(()=>{r()})};function Zt(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}function Xt(e){return Zt(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"}const wi=e=>e instanceof Cn&&typeof e.then=="function",pu=(e,u,t)=>{if(typeof t=="string")return e[u].pipe(En(t)),e;if(Xt(t))return e[u].pipe(t),e;if(!wi(t))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!Xt(t.stdin))throw new TypeError("The target child process's stdin must be available.");return e[u].pipe(t.stdin),t},Ai=e=>{e.stdout!==null&&(e.pipeStdout=pu.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=pu.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=pu.bind(void 0,e,"all"))};var Fe={exports:{}};const{PassThrough:vi}=Ve;var $i=e=>{e={...e};const{array:u}=e;let{encoding:t}=e;const D=t==="buffer";let r=!1;u?r=!(t||D):t=t||"utf8",D&&(t=null);const o=new vi({objectMode:r});t&&o.setEncoding(t);let n=0;const i=[];return o.on("data",s=>{i.push(s),r?n=i.length:n+=s.length}),o.getBufferedValue=()=>u?i:D?Buffer.concat(i,n):i.join(""),o.getBufferedLength=()=>n,o};const{constants:xi}=yn,Si=Ve,{promisify:Ti}=nt,Oi=$i,Pi=Ti(Si.pipeline);class Qt extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function mu(e,u){if(!e)throw new Error("Expected a stream");u={maxBuffer:1/0,...u};const{maxBuffer:t}=u,D=Oi(u);return await new Promise((r,o)=>{const n=i=>{i&&D.getBufferedLength()<=xi.MAX_LENGTH&&(i.bufferedData=D.getBufferedValue()),o(i)};(async()=>{try{await Pi(e,D),r()}catch(i){n(i)}})(),D.on("data",()=>{D.getBufferedLength()>t&&n(new Qt)})}),D.getBufferedValue()}Fe.exports=mu,Fe.exports.buffer=(e,u)=>mu(e,{...u,encoding:"buffer"}),Fe.exports.array=(e,u)=>mu(e,{...u,array:!0}),Fe.exports.MaxBufferError=Qt;var Ii=Fe.exports,eD=ue(Ii);const{PassThrough:ki}=Ve;var Mi=function(){var e=[],u=new ki({objectMode:!0});return u.setMaxListeners(0),u.add=t,u.isEmpty=D,u.on("unpipe",r),Array.prototype.slice.call(arguments).forEach(t),u;function t(o){return Array.isArray(o)?(o.forEach(t),this):(e.push(o),o.once("end",r.bind(null,o)),o.once("error",u.emit.bind(u,"error")),o.pipe(u,{end:!1}),this)}function D(){return e.length==0}function r(o){e=e.filter(function(n){return n!==o}),!e.length&&u.readable&&u.end()}},Ri=ue(Mi);const ji=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},_i=({input:e,inputFile:u})=>typeof u!="string"?e:(ji(e),gn(u)),Li=(e,u)=>{const t=_i(u);t!==void 0&&(Zt(t)?t.pipe(e.stdin):e.stdin.end(t))},Ni=(e,{all:u})=>{if(!u||!e.stdout&&!e.stderr)return;const t=Ri();return e.stdout&&t.add(e.stdout),e.stderr&&t.add(e.stderr),t},hu=async(e,u)=>{if(!(!e||u===void 0)){e.destroy();try{return await u}catch(t){return t.bufferedData}}},Eu=(e,{encoding:u,buffer:t,maxBuffer:D})=>{if(!(!e||!t))return u?eD(e,{encoding:u,maxBuffer:D}):eD.buffer(e,{maxBuffer:D})},Gi=async({stdout:e,stderr:u,all:t},{encoding:D,buffer:r,maxBuffer:o},n)=>{const i=Eu(e,{encoding:D,buffer:r,maxBuffer:o}),s=Eu(u,{encoding:D,buffer:r,maxBuffer:o}),c=Eu(t,{encoding:D,buffer:r,maxBuffer:o*2});try{return await Promise.all([n,i,s,c])}catch(f){return Promise.all([{error:f,signal:f.signal,timedOut:f.timedOut},hu(e,i),hu(u,s),hu(t,c)])}},zi=(async()=>{})().constructor.prototype,Wi=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(zi,e)]),uD=(e,u)=>{for(const[t,D]of Wi){const r=typeof u=="function"?(...o)=>Reflect.apply(D.value,u(),o):D.value.bind(u);Reflect.defineProperty(e,t,{...D,value:r})}},Ui=e=>new Promise((u,t)=>{e.on("exit",(D,r)=>{u({exitCode:D,signal:r})}),e.on("error",D=>{t(D)}),e.stdin&&e.stdin.on("error",D=>{t(D)})}),tD=(e,u=[])=>Array.isArray(u)?[e,...u]:[e],qi=/^[\w.-]+$/,Hi=/"/g,Vi=e=>typeof e!="string"||qi.test(e)?e:`"${e.replace(Hi,'\\"')}"`,Ki=(e,u)=>tD(e,u).join(" "),Ji=(e,u)=>tD(e,u).map(t=>Vi(t)).join(" "),Yi=Bn("execa").enabled,Re=(e,u)=>String(e).padStart(u,"0"),Zi=()=>{const e=new Date;return`${Re(e.getHours(),2)}:${Re(e.getMinutes(),2)}:${Re(e.getSeconds(),2)}.${Re(e.getMilliseconds(),3)}`},Xi=(e,{verbose:u})=>{u&&T.stderr.write(`[${Zi()}] ${e}
28
+ `)},Qi=1e3*1e3*100,es=({env:e,extendEnv:u,preferLocal:t,localDir:D,execPath:r})=>{const o=u?{...T.env,...e}:e;return t?_o({env:o,cwd:D,execPath:r}):o},us=(e,u,t={})=>{const D=Io._parse(e,u,t);return e=D.command,u=D.args,t=D.options,t={maxBuffer:Qi,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:t.cwd||T.cwd(),execPath:T.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:Yi,...t},t.env=es(t),t.stdio=ri(t),T.platform==="win32"&&ee.basename(e,".exe")==="cmd"&&u.unshift("/q"),{file:e,args:u,options:t,parsed:D}},gu=(e,u,t)=>typeof u!="string"&&!Fn.isBuffer(u)?t===void 0?void 0:"":e.stripFinalNewline?ko(u):u;function oe(e,u,t){const D=us(e,u,t),r=Ki(e,u),o=Ji(e,u);Xi(o,D.options),Bi(D.options);let n;try{n=Qu.spawn(D.file,D.args,D.options)}catch(F){const C=new Qu.ChildProcess,p=Promise.reject(Vt({error:F,stdout:"",stderr:"",all:"",command:r,escapedCommand:o,parsed:D,timedOut:!1,isCanceled:!1,killed:!1}));return uD(C,p),C}const i=Ui(n),s=yi(n,D.options,i),c=bi(n,D.options,s),f={isCanceled:!1};n.kill=Ci.bind(null,n.kill.bind(n)),n.cancel=Ei.bind(null,n,f);const l=Wt(async()=>{const[{error:F,exitCode:C,signal:p,timedOut:d},h,y,m]=await Gi(n,D.options,c),b=gu(D.options,h),B=gu(D.options,y),O=gu(D.options,m);if(F||C!==0||p!==null){const w=Vt({error:F,exitCode:C,signal:p,stdout:b,stderr:B,all:O,command:r,escapedCommand:o,parsed:D,timedOut:d,isCanceled:f.isCanceled||(D.options.signal?D.options.signal.aborted:!1),killed:n.killed});if(!D.options.reject)return w;throw w}return{command:r,escapedCommand:o,exitCode:0,stdout:b,stderr:B,all:O,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Li(n,D.options),n.all=Ni(n,D.options),Ai(n),uD(n,l),n}let Y=!0;const ie=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let Ce=0;if(ie.process&&ie.process.env&&ie.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:u,NO_COLOR:t,TERM:D,COLORTERM:r}=ie.process.env;u||t||e==="0"?Y=!1:e==="1"||e==="2"||e==="3"?Y=!0:D==="dumb"?Y=!1:"CI"in ie.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(o=>o in ie.process.env)?Y=!0:Y=process.stdout.isTTY,Y&&(process.platform==="win32"||r&&(r==="truecolor"||r==="24bit")?Ce=3:D&&(D.endsWith("-256color")||D.endsWith("256"))?Ce=2:Ce=1)}let DD={enabled:Y,supportLevel:Ce};function Z(e,u,t=1){const D=`\x1B[${e}m`,r=`\x1B[${u}m`,o=new RegExp(`\\x1b\\[${u}m`,"g");return n=>DD.enabled&&DD.supportLevel>=t?D+(""+n).replace(o,D)+r:""+n}const de=Z(2,22),ts=Z(30,39),yu=Z(31,39),je=Z(32,39),Ds=Z(35,39),ns=Z(90,39),rs=Z(46,49),Bu="\x1B",x=`${Bu}[`,os="\x07",bu={to(e,u){return u?`${x}${u+1};${e+1}H`:`${x}${e+1}G`},move(e,u){let t="";return e<0?t+=`${x}${-e}D`:e>0&&(t+=`${x}${e}C`),u<0?t+=`${x}${-u}A`:u>0&&(t+=`${x}${u}B`),t},up:(e=1)=>`${x}${e}A`,down:(e=1)=>`${x}${e}B`,forward:(e=1)=>`${x}${e}C`,backward:(e=1)=>`${x}${e}D`,nextLine:(e=1)=>`${x}E`.repeat(e),prevLine:(e=1)=>`${x}F`.repeat(e),left:`${x}G`,hide:`${x}?25l`,show:`${x}?25h`,save:`${Bu}7`,restore:`${Bu}8`},is={up:(e=1)=>`${x}S`.repeat(e),down:(e=1)=>`${x}T`.repeat(e)},ss={screen:`${x}2J`,up:(e=1)=>`${x}1J`.repeat(e),down:(e=1)=>`${x}J`.repeat(e),line:`${x}2K`,lineEnd:`${x}K`,lineStart:`${x}1K`,lines(e){let u="";for(let t=0;t<e;t++)u+=this.line+(t<e-1?bu.up():"");return e&&(u+=bu.left),u}};var W={cursor:bu,scroll:is,erase:ss,beep:os},wu={exports:{}};let _e=process||{},nD=_e.argv||[],Le=_e.env||{},as=!(Le.NO_COLOR||nD.includes("--no-color"))&&(!!Le.FORCE_COLOR||nD.includes("--color")||_e.platform==="win32"||(_e.stdout||{}).isTTY&&Le.TERM!=="dumb"||!!Le.CI),cs=(e,u,t=e)=>D=>{let r=""+D,o=r.indexOf(u,e.length);return~o?e+ls(r,u,t,o)+u:e+r+u},ls=(e,u,t,D)=>{let r="",o=0;do r+=e.substring(o,D)+t,o=D+u.length,D=e.indexOf(u,o);while(~D);return r+e.substring(o)},rD=(e=as)=>{let u=e?cs:()=>String;return{isColorSupported:e,reset:u("\x1B[0m","\x1B[0m"),bold:u("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:u("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:u("\x1B[3m","\x1B[23m"),underline:u("\x1B[4m","\x1B[24m"),inverse:u("\x1B[7m","\x1B[27m"),hidden:u("\x1B[8m","\x1B[28m"),strikethrough:u("\x1B[9m","\x1B[29m"),black:u("\x1B[30m","\x1B[39m"),red:u("\x1B[31m","\x1B[39m"),green:u("\x1B[32m","\x1B[39m"),yellow:u("\x1B[33m","\x1B[39m"),blue:u("\x1B[34m","\x1B[39m"),magenta:u("\x1B[35m","\x1B[39m"),cyan:u("\x1B[36m","\x1B[39m"),white:u("\x1B[37m","\x1B[39m"),gray:u("\x1B[90m","\x1B[39m"),bgBlack:u("\x1B[40m","\x1B[49m"),bgRed:u("\x1B[41m","\x1B[49m"),bgGreen:u("\x1B[42m","\x1B[49m"),bgYellow:u("\x1B[43m","\x1B[49m"),bgBlue:u("\x1B[44m","\x1B[49m"),bgMagenta:u("\x1B[45m","\x1B[49m"),bgCyan:u("\x1B[46m","\x1B[49m"),bgWhite:u("\x1B[47m","\x1B[49m"),blackBright:u("\x1B[90m","\x1B[39m"),redBright:u("\x1B[91m","\x1B[39m"),greenBright:u("\x1B[92m","\x1B[39m"),yellowBright:u("\x1B[93m","\x1B[39m"),blueBright:u("\x1B[94m","\x1B[39m"),magentaBright:u("\x1B[95m","\x1B[39m"),cyanBright:u("\x1B[96m","\x1B[39m"),whiteBright:u("\x1B[97m","\x1B[39m"),bgBlackBright:u("\x1B[100m","\x1B[49m"),bgRedBright:u("\x1B[101m","\x1B[49m"),bgGreenBright:u("\x1B[102m","\x1B[49m"),bgYellowBright:u("\x1B[103m","\x1B[49m"),bgBlueBright:u("\x1B[104m","\x1B[49m"),bgMagentaBright:u("\x1B[105m","\x1B[49m"),bgCyanBright:u("\x1B[106m","\x1B[49m"),bgWhiteBright:u("\x1B[107m","\x1B[49m")}};wu.exports=rD(),wu.exports.createColors=rD;var fs=wu.exports,E=ue(fs);function Fs({onlyFirst:e=!1}={}){const u=["[\\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(u,e?void 0:"g")}const Cs=Fs();function oD(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Cs,"")}function iD(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var sD={exports:{}};(function(e){var u={};e.exports=u,u.eastAsianWidth=function(D){var r=D.charCodeAt(0),o=D.length==2?D.charCodeAt(1):0,n=r;return 55296<=r&&r<=56319&&56320<=o&&o<=57343&&(r&=1023,o&=1023,n=r<<10|o,n+=65536),n==12288||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":n==8361||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||n==172||n==175||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":n==161||n==164||167<=n&&n<=168||n==170||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||n==198||n==208||215<=n&&n<=216||222<=n&&n<=225||n==230||232<=n&&n<=234||236<=n&&n<=237||n==240||242<=n&&n<=243||247<=n&&n<=250||n==252||n==254||n==257||n==273||n==275||n==283||294<=n&&n<=295||n==299||305<=n&&n<=307||n==312||319<=n&&n<=322||n==324||328<=n&&n<=331||n==333||338<=n&&n<=339||358<=n&&n<=359||n==363||n==462||n==464||n==466||n==468||n==470||n==472||n==474||n==476||n==593||n==609||n==708||n==711||713<=n&&n<=715||n==717||n==720||728<=n&&n<=731||n==733||n==735||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||n==1025||1040<=n&&n<=1103||n==1105||n==8208||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||n==8240||8242<=n&&n<=8243||n==8245||n==8251||n==8254||n==8308||n==8319||8321<=n&&n<=8324||n==8364||n==8451||n==8453||n==8457||n==8467||n==8470||8481<=n&&n<=8482||n==8486||n==8491||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||n==8585||8592<=n&&n<=8601||8632<=n&&n<=8633||n==8658||n==8660||n==8679||n==8704||8706<=n&&n<=8707||8711<=n&&n<=8712||n==8715||n==8719||n==8721||n==8725||n==8730||8733<=n&&n<=8736||n==8739||n==8741||8743<=n&&n<=8748||n==8750||8756<=n&&n<=8759||8764<=n&&n<=8765||n==8776||n==8780||n==8786||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||n==8853||n==8857||n==8869||n==8895||n==8978||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||n==9675||9678<=n&&n<=9681||9698<=n&&n<=9701||n==9711||9733<=n&&n<=9734||n==9737||9742<=n&&n<=9743||9748<=n&&n<=9749||n==9756||n==9758||n==9792||n==9794||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||n==9839||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||n==9955||9960<=n&&n<=9983||n==10045||n==10071||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||n==65533||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"},u.characterLength=function(D){var r=this.eastAsianWidth(D);return r=="F"||r=="W"||r=="A"?2:1};function t(D){return D.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.length=function(D){for(var r=t(D),o=0,n=0;n<r.length;n++)o=o+this.characterLength(r[n]);return o},u.slice=function(D,r,o){textLen=u.length(D),r=r||0,o=o||1,r<0&&(r=textLen+r),o<0&&(o=textLen+o);for(var n="",i=0,s=t(D),c=0;c<s.length;c++){var f=s[c],a=u.length(f);if(i>=r-(a==2?1:0))if(i+a<=o)n+=f;else break;i+=a}return n}})(sD);var ds=sD.exports;const ps=iD(ds);var ms=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};const hs=iD(ms);function pe(e,u={}){if(typeof e!="string"||e.length===0||(u={ambiguousIsNarrow:!0,...u},e=oD(e),e.length===0))return 0;e=e.replace(hs()," ");const t=u.ambiguousIsNarrow?1:2;let D=0;for(const r of e){const o=r.codePointAt(0);if(!(o<=31||o>=127&&o<=159||o>=768&&o<=879))switch(ps.eastAsianWidth(r)){case"F":case"W":D+=2;break;case"A":D+=t;break;default:D+=1}}return D}const Au=10,aD=(e=0)=>u=>`\x1B[${u+e}m`,cD=(e=0)=>u=>`\x1B[${38+e};5;${u}m`,lD=(e=0)=>(u,t,D)=>`\x1B[${38+e};2;${u};${t};${D}m`,v={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(v.modifier);const Es=Object.keys(v.color),gs=Object.keys(v.bgColor);[...Es,...gs];function ys(){const e=new Map;for(const[u,t]of Object.entries(v)){for(const[D,r]of Object.entries(t))v[D]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},t[D]=v[D],e.set(r[0],r[1]);Object.defineProperty(v,u,{value:t,enumerable:!1})}return Object.defineProperty(v,"codes",{value:e,enumerable:!1}),v.color.close="\x1B[39m",v.bgColor.close="\x1B[49m",v.color.ansi=aD(),v.color.ansi256=cD(),v.color.ansi16m=lD(),v.bgColor.ansi=aD(Au),v.bgColor.ansi256=cD(Au),v.bgColor.ansi16m=lD(Au),Object.defineProperties(v,{rgbToAnsi256:{value:(u,t,D)=>u===t&&t===D?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(t/255*5)+Math.round(D/255*5),enumerable:!1},hexToRgb:{value:u=>{const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!t)return[0,0,0];let[D]=t;D.length===3&&(D=[...D].map(o=>o+o).join(""));const r=Number.parseInt(D,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:u=>v.rgbToAnsi256(...v.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:u=>{if(u<8)return 30+u;if(u<16)return 90+(u-8);let t,D,r;if(u>=232)t=((u-232)*10+8)/255,D=t,r=t;else{u-=16;const i=u%36;t=Math.floor(u/36)/5,D=Math.floor(i/6)/5,r=i%6/5}const o=Math.max(t,D,r)*2;if(o===0)return 30;let n=30+(Math.round(r)<<2|Math.round(D)<<1|Math.round(t));return o===2&&(n+=60),n},enumerable:!1},rgbToAnsi:{value:(u,t,D)=>v.ansi256ToAnsi(v.rgbToAnsi256(u,t,D)),enumerable:!1},hexToAnsi:{value:u=>v.ansi256ToAnsi(v.hexToAnsi256(u)),enumerable:!1}}),v}const Bs=ys(),Ne=new Set(["\x1B","\x9B"]),bs=39,vu="\x07",fD="[",ws="]",FD="m",$u=`${ws}8;;`,CD=e=>`${Ne.values().next().value}${fD}${e}${FD}`,dD=e=>`${Ne.values().next().value}${$u}${e}${vu}`,As=e=>e.split(" ").map(u=>pe(u)),xu=(e,u,t)=>{const D=[...u];let r=!1,o=!1,n=pe(oD(e[e.length-1]));for(const[i,s]of D.entries()){const c=pe(s);if(n+c<=t?e[e.length-1]+=s:(e.push(s),n=0),Ne.has(s)&&(r=!0,o=D.slice(i+1).join("").startsWith($u)),r){o?s===vu&&(r=!1,o=!1):s===FD&&(r=!1);continue}n+=c,n===t&&i<D.length-1&&(e.push(""),n=0)}!n&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},vs=e=>{const u=e.split(" ");let t=u.length;for(;t>0&&!(pe(u[t-1])>0);)t--;return t===u.length?e:u.slice(0,t).join(" ")+u.slice(t).join("")},$s=(e,u,t={})=>{if(t.trim!==!1&&e.trim()==="")return"";let D="",r,o;const n=As(e);let i=[""];for(const[c,f]of e.split(" ").entries()){t.trim!==!1&&(i[i.length-1]=i[i.length-1].trimStart());let a=pe(i[i.length-1]);if(c!==0&&(a>=u&&(t.wordWrap===!1||t.trim===!1)&&(i.push(""),a=0),(a>0||t.trim===!1)&&(i[i.length-1]+=" ",a++)),t.hard&&n[c]>u){const l=u-a,F=1+Math.floor((n[c]-l-1)/u);Math.floor((n[c]-1)/u)<F&&i.push(""),xu(i,f,u);continue}if(a+n[c]>u&&a>0&&n[c]>0){if(t.wordWrap===!1&&a<u){xu(i,f,u);continue}i.push("")}if(a+n[c]>u&&t.wordWrap===!1){xu(i,f,u);continue}i[i.length-1]+=f}t.trim!==!1&&(i=i.map(c=>vs(c)));const s=[...i.join(`
29
+ `)];for(const[c,f]of s.entries()){if(D+=f,Ne.has(f)){const{groups:l}=new RegExp(`(?:\\${fD}(?<code>\\d+)m|\\${$u}(?<uri>.*)${vu})`).exec(s.slice(c).join(""))||{groups:{}};if(l.code!==void 0){const F=Number.parseFloat(l.code);r=F===bs?void 0:F}else l.uri!==void 0&&(o=l.uri.length===0?void 0:l.uri)}const a=Bs.codes.get(Number(r));s[c+1]===`
30
+ `?(o&&(D+=dD("")),r&&a&&(D+=CD(a))):f===`
31
+ `&&(r&&a&&(D+=CD(r)),o&&(D+=dD(o)))}return D};function pD(e,u,t){return String(e).normalize().replace(/\r\n/g,`
32
32
  `).split(`
33
- `).map(D=>wi(D,u,t)).join(`
34
- `)}var vi=Object.defineProperty,Ai=(e,u,t)=>u in e?vi(e,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[u]=t,N=(e,u,t)=>(Ai(e,typeof u!="symbol"?u+"":u,t),t);function $i(e,u){if(e===u)return;const t=e.split(`
33
+ `).map(D=>$s(D,u,t)).join(`
34
+ `)}var xs=Object.defineProperty,Ss=(e,u,t)=>u in e?xs(e,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[u]=t,N=(e,u,t)=>(Ss(e,typeof u!="symbol"?u+"":u,t),t);function Ts(e,u){if(e===u)return;const t=e.split(`
35
35
  `),D=u.split(`
36
- `),r=[];for(let o=0;o<Math.max(t.length,D.length);o++)t[o]!==D[o]&&r.push(o);return r}const dD=Symbol("clack:cancel");function pD(e){return e===dD}function Ne(e,u){e.isTTY&&e.setRawMode(u)}const mD=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),xi=new Set(["up","down","left","right","space","enter"]);class hD{constructor({render:u,input:t=Fn,output:D=Cn,...r},o=!0){N(this,"input"),N(this,"output"),N(this,"rl"),N(this,"opts"),N(this,"_track",!1),N(this,"_render"),N(this,"_cursor",0),N(this,"state","initial"),N(this,"value"),N(this,"error",""),N(this,"subscribers",new Map),N(this,"_prevFrame",""),this.opts=r,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=u.bind(this),this._track=o,this.input=t,this.output=D}prompt(){const u=new yn(0);return u._write=(t,D,r)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),r()},this.input.pipe(u),this.rl=Dt.createInterface({input:this.input,output:u,tabSize:2,prompt:"",escapeCodeTimeout:50}),Dt.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),Ne(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((t,D)=>{this.once("submit",()=>{this.output.write(z.cursor.show),this.output.off("resize",this.render),Ne(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(z.cursor.show),this.output.off("resize",this.render),Ne(this.input,!1),t(dD)})})}on(u,t){const D=this.subscribers.get(u)??[];D.push({cb:t}),this.subscribers.set(u,D)}once(u,t){const D=this.subscribers.get(u)??[];D.push({cb:t,once:!0}),this.subscribers.set(u,D)}emit(u,...t){const D=this.subscribers.get(u)??[],r=[];for(const o of D)o.cb(...t),o.once&&r.push(()=>D.splice(D.indexOf(o),1));for(const o of r)o()}unsubscribe(){this.subscribers.clear()}onKeypress(u,t){if(this.state==="error"&&(this.state="active"),t?.name&&!this._track&&mD.has(t.name)&&this.emit("cursor",mD.get(t.name)),t?.name&&xi.has(t.name)&&this.emit("cursor",t.name),u&&(u.toLowerCase()==="y"||u.toLowerCase()==="n")&&this.emit("confirm",u.toLowerCase()==="y"),u===" "&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),u&&this.emit("key",u.toLowerCase()),t?.name==="return"){if(this.opts.validate){const D=this.opts.validate(this.value);D&&(this.error=D,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}u===""&&(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(`
37
- `),Ne(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const u=CD(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
38
- `).length-1;this.output.write(z.cursor.move(-999,u*-1))}render(){const u=CD(this._render(this)??"",process.stdout.columns,{hard:!0});if(u!==this._prevFrame){if(this.state==="initial")this.output.write(z.cursor.hide);else{const t=$i(this._prevFrame,u);if(this.restoreCursor(),t&&t?.length===1){const D=t[0];this.output.write(z.cursor.move(0,D)),this.output.write(z.erase.lines(1));const r=u.split(`
39
- `);this.output.write(r[D]),this._prevFrame=u,this.output.write(z.cursor.move(0,r.length-D-1));return}else if(t&&t?.length>1){const D=t[0];this.output.write(z.cursor.move(0,D)),this.output.write(z.erase.down());const r=u.split(`
36
+ `),r=[];for(let o=0;o<Math.max(t.length,D.length);o++)t[o]!==D[o]&&r.push(o);return r}const mD=Symbol("clack:cancel");function hD(e){return e===mD}function Ge(e,u){e.isTTY&&e.setRawMode(u)}const ED=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),Os=new Set(["up","down","left","right","space","enter"]);class gD{constructor({render:u,input:t=dn,output:D=pn,...r},o=!0){N(this,"input"),N(this,"output"),N(this,"rl"),N(this,"opts"),N(this,"_track",!1),N(this,"_render"),N(this,"_cursor",0),N(this,"state","initial"),N(this,"value"),N(this,"error",""),N(this,"subscribers",new Map),N(this,"_prevFrame",""),this.opts=r,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=u.bind(this),this._track=o,this.input=t,this.output=D}prompt(){const u=new bn(0);return u._write=(t,D,r)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),r()},this.input.pipe(u),this.rl=rt.createInterface({input:this.input,output:u,tabSize:2,prompt:"",escapeCodeTimeout:50}),rt.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),Ge(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((t,D)=>{this.once("submit",()=>{this.output.write(W.cursor.show),this.output.off("resize",this.render),Ge(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(W.cursor.show),this.output.off("resize",this.render),Ge(this.input,!1),t(mD)})})}on(u,t){const D=this.subscribers.get(u)??[];D.push({cb:t}),this.subscribers.set(u,D)}once(u,t){const D=this.subscribers.get(u)??[];D.push({cb:t,once:!0}),this.subscribers.set(u,D)}emit(u,...t){const D=this.subscribers.get(u)??[],r=[];for(const o of D)o.cb(...t),o.once&&r.push(()=>D.splice(D.indexOf(o),1));for(const o of r)o()}unsubscribe(){this.subscribers.clear()}onKeypress(u,t){if(this.state==="error"&&(this.state="active"),t?.name&&!this._track&&ED.has(t.name)&&this.emit("cursor",ED.get(t.name)),t?.name&&Os.has(t.name)&&this.emit("cursor",t.name),u&&(u.toLowerCase()==="y"||u.toLowerCase()==="n")&&this.emit("confirm",u.toLowerCase()==="y"),u===" "&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),u&&this.emit("key",u.toLowerCase()),t?.name==="return"){if(this.opts.validate){const D=this.opts.validate(this.value);D&&(this.error=D,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}u===""&&(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(`
37
+ `),Ge(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const u=pD(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
38
+ `).length-1;this.output.write(W.cursor.move(-999,u*-1))}render(){const u=pD(this._render(this)??"",process.stdout.columns,{hard:!0});if(u!==this._prevFrame){if(this.state==="initial")this.output.write(W.cursor.hide);else{const t=Ts(this._prevFrame,u);if(this.restoreCursor(),t&&t?.length===1){const D=t[0];this.output.write(W.cursor.move(0,D)),this.output.write(W.erase.lines(1));const r=u.split(`
39
+ `);this.output.write(r[D]),this._prevFrame=u,this.output.write(W.cursor.move(0,r.length-D-1));return}else if(t&&t?.length>1){const D=t[0];this.output.write(W.cursor.move(0,D)),this.output.write(W.erase.down());const r=u.split(`
40
40
  `).slice(D);this.output.write(r.join(`
41
- `)),this._prevFrame=u;return}this.output.write(z.erase.down())}this.output.write(u),this.state==="initial"&&(this.state="active"),this._prevFrame=u}}}class Si extends hD{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(u){super(u,!1),this.value=!!u.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",t=>{this.output.write(z.cursor.move(0,-1)),this.value=t,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var Ti=Object.defineProperty,Oi=(e,u,t)=>u in e?Ti(e,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[u]=t,ED=(e,u,t)=>(Oi(e,typeof u!="symbol"?u+"":u,t),t);let Pi=class extends hD{constructor(e){super(e,!1),ED(this,"options"),ED(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:u})=>u===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",u=>{switch(u){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}};globalThis.process.platform.startsWith("win");function Ii(){return T.platform!=="win32"?T.env.TERM!=="linux":!!T.env.CI||!!T.env.WT_SESSION||!!T.env.TERMINUS_SUBLIME||T.env.ConEmuTask==="{cmd::Cmder}"||T.env.TERM_PROGRAM==="Terminus-Sublime"||T.env.TERM_PROGRAM==="vscode"||T.env.TERM==="xterm-256color"||T.env.TERM==="alacritty"||T.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const ki=Ii(),q=(e,u)=>ki?e:u,Mi=q("\u25C6","*"),Ri=q("\u25A0","x"),ji=q("\u25B2","x"),_i=q("\u25C7","o"),Li=q("\u250C","T"),G=q("\u2502","|"),xu=q("\u2514","\u2014"),Su=q("\u25CF",">"),Tu=q("\u25CB"," "),gD=e=>{switch(e){case"initial":case"active":return E.cyan(Mi);case"cancel":return E.red(Ri);case"error":return E.yellow(ji);case"submit":return E.green(_i)}},Ni=e=>{const u=e.active??"Yes",t=e.inactive??"No";return new Si({active:u,inactive:t,initialValue:e.initialValue??!0,render(){const D=`${E.gray(G)}
42
- ${gD(this.state)} ${e.message}
41
+ `)),this._prevFrame=u;return}this.output.write(W.erase.down())}this.output.write(u),this.state==="initial"&&(this.state="active"),this._prevFrame=u}}}class Ps extends gD{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(u){super(u,!1),this.value=!!u.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",t=>{this.output.write(W.cursor.move(0,-1)),this.value=t,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var Is=Object.defineProperty,ks=(e,u,t)=>u in e?Is(e,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[u]=t,yD=(e,u,t)=>(ks(e,typeof u!="symbol"?u+"":u,t),t);let Ms=class extends gD{constructor(e){super(e,!1),yD(this,"options"),yD(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:u})=>u===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",u=>{switch(u){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}};globalThis.process.platform.startsWith("win");function Rs(){return T.platform!=="win32"?T.env.TERM!=="linux":!!T.env.CI||!!T.env.WT_SESSION||!!T.env.TERMINUS_SUBLIME||T.env.ConEmuTask==="{cmd::Cmder}"||T.env.TERM_PROGRAM==="Terminus-Sublime"||T.env.TERM_PROGRAM==="vscode"||T.env.TERM==="xterm-256color"||T.env.TERM==="alacritty"||T.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const js=Rs(),H=(e,u)=>js?e:u,_s=H("\u25C6","*"),Ls=H("\u25A0","x"),Ns=H("\u25B2","x"),Gs=H("\u25C7","o"),zs=H("\u250C","T"),G=H("\u2502","|"),Su=H("\u2514","\u2014"),Tu=H("\u25CF",">"),Ou=H("\u25CB"," "),BD=e=>{switch(e){case"initial":case"active":return E.cyan(_s);case"cancel":return E.red(Ls);case"error":return E.yellow(Ns);case"submit":return E.green(Gs)}},Ws=e=>{const u=e.active??"Yes",t=e.inactive??"No";return new Ps({active:u,inactive:t,initialValue:e.initialValue??!0,render(){const D=`${E.gray(G)}
42
+ ${BD(this.state)} ${e.message}
43
43
  `,r=this.value?u:t;switch(this.state){case"submit":return`${D}${E.gray(G)} ${E.dim(r)}`;case"cancel":return`${D}${E.gray(G)} ${E.strikethrough(E.dim(r))}
44
- ${E.gray(G)}`;default:return`${D}${E.cyan(G)} ${this.value?`${E.green(Su)} ${u}`:`${E.dim(Tu)} ${E.dim(u)}`} ${E.dim("/")} ${this.value?`${E.dim(Tu)} ${E.dim(t)}`:`${E.green(Su)} ${t}`}
45
- ${E.cyan(xu)}
46
- `}}}).prompt()},Gi=e=>{const u=(t,D)=>{const r=t.label??String(t.value);return D==="active"?`${E.green(Su)} ${r} ${t.hint?E.dim(`(${t.hint})`):""}`:D==="selected"?`${E.dim(r)}`:D==="cancelled"?`${E.strikethrough(E.dim(r))}`:`${E.dim(Tu)} ${E.dim(r)}`};return new Pi({options:e.options,initialValue:e.initialValue,render(){const t=`${E.gray(G)}
47
- ${gD(this.state)} ${e.message}
44
+ ${E.gray(G)}`;default:return`${D}${E.cyan(G)} ${this.value?`${E.green(Tu)} ${u}`:`${E.dim(Ou)} ${E.dim(u)}`} ${E.dim("/")} ${this.value?`${E.dim(Ou)} ${E.dim(t)}`:`${E.green(Tu)} ${t}`}
45
+ ${E.cyan(Su)}
46
+ `}}}).prompt()},Us=e=>{const u=(t,D)=>{const r=t.label??String(t.value);return D==="active"?`${E.green(Tu)} ${r} ${t.hint?E.dim(`(${t.hint})`):""}`:D==="selected"?`${E.dim(r)}`:D==="cancelled"?`${E.strikethrough(E.dim(r))}`:`${E.dim(Ou)} ${E.dim(r)}`};return new Ms({options:e.options,initialValue:e.initialValue,render(){const t=`${E.gray(G)}
47
+ ${BD(this.state)} ${e.message}
48
48
  `;switch(this.state){case"submit":return`${t}${E.gray(G)} ${u(this.options[this.cursor],"selected")}`;case"cancel":return`${t}${E.gray(G)} ${u(this.options[this.cursor],"cancelled")}
49
49
  ${E.gray(G)}`;default:return`${t}${E.cyan(G)} ${this.options.map((D,r)=>u(D,r===this.cursor?"active":"inactive")).join(`
50
50
  ${E.cyan(G)} `)}
51
- ${E.cyan(xu)}
52
- `}}}).prompt()},zi=(e="")=>{process.stdout.write(`${E.gray(Li)} ${e}
53
- `)},Ge=(e="")=>{process.stdout.write(`${E.gray(G)}
54
- ${E.gray(xu)} ${e}
51
+ ${E.cyan(Su)}
52
+ `}}}).prompt()},qs=(e="")=>{process.stdout.write(`${E.gray(zs)} ${e}
53
+ `)},ze=(e="")=>{process.stdout.write(`${E.gray(G)}
54
+ ${E.gray(Su)} ${e}
55
55
 
56
- `)},yD=e=>Vr,Wi=yD();class B extends Error{}const Ou=" ",Pu=e=>{e instanceof Error&&!(e instanceof B)&&(e.stack&&console.error(Ce(e.stack.split(`
56
+ `)},bD=e=>Jr,Hs=bD();class g extends Error{}const Pu=" ",Vs="https://github.com/sugarmo/aicommits/issues/new/choose",Ks=e=>e.trim().replace(/^github:/,"").replace(/^git\+/,"").replace(/\.git$/,""),wD=e=>{if(typeof e=="string"){const u=Ks(e);if(/^[^/\s]+\/[^/\s]+$/.test(u))return u;const t=u.match(/^git@github\.com:([^/\s]+\/[^/\s]+)$/);if(t?.[1])return t[1];const D=u.match(/^https?:\/\/github\.com\/([^/\s]+\/[^/\s]+)$/);if(D?.[1])return D[1]}if(e&&typeof e=="object"&&"url"in e)return wD(e.url)},Js=(()=>{const e=wD(Zr);return e?`https://github.com/${e}/issues/new/choose`:Vs})(),Iu=e=>{e instanceof Error&&!(e instanceof g)&&(e.stack&&console.error(de(e.stack.split(`
57
57
  `).slice(1).join(`
58
58
  `))),console.error(`
59
- ${Ou}${Ce(`aicommits v${Wi}`)}`),console.error(`
60
- ${Ou}Please open a Bug report with the information above:`),console.error(`${Ou}https://github.com/Nutlope/aicommits/issues/new/choose`))},BD=async()=>{const{stdout:e,failed:u}=await re("git",["rev-parse","--show-toplevel"],{reject:!1});if(u)throw new B("The current directory must be a Git repository!");return e},Iu=e=>`:(exclude)${e}`,bD=["package-lock.json","pnpm-lock.yaml","*.lock"].map(Iu),wD=async e=>{const u=["diff","--cached","--diff-algorithm=minimal"],{stdout:t}=await re("git",[...u,"--name-only",...bD,...e?e.map(Iu):[]]);if(!t)return;const{stdout:D}=await re("git",[...u,...bD,...e?e.map(Iu):[]]);return{files:t.split(`
61
- `),diff:D}},Ui=e=>`Detected ${e.length.toLocaleString()} staged file${e.length>1?"s":""}`,qi=["","conventional"],{hasOwnProperty:Hi}=Object.prototype,vD=(e,u)=>Hi.call(e,u),S=(e,u,t)=>{if(!u)throw new B(`Invalid config property ${e}: ${t}`)},pe=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),H=e=>typeof e=="string"||typeof e=="number"||typeof e=="boolean"?e:void 0,Vi={cn:"zh-CN","zh-cn":"zh-CN","zh-hans":"zh-CN",zh:"zh-CN","zh-tw":"zh-TW","zh-hant":"zh-TW"},Ki=e=>{const u=e.trim().replace(/_/g,"-");return Vi[u.toLowerCase()]??u},ku=(e,u,t)=>{if(u==null||u==="")return t;if(typeof u=="boolean")return u;if(typeof u=="number"){if(u===1)return!0;if(u===0)return!1}if(typeof u=="string"){const D=u.trim().toLowerCase();if(["true","1","yes","on"].includes(D))return!0;if(["false","0","no","off"].includes(D))return!1}throw new B(`Invalid config property ${e}: Must be a boolean (true/false)`)},Ji=e=>{let u;try{u=JSON.parse(e)}catch{throw new B("Invalid config property conventional-types: Must be valid JSON")}S("conventional-types",typeof u=="object"&&u!==null&&!Array.isArray(u),'Must be a JSON object with "type":"description" pairs');const t=Object.entries(u).map(([D,r])=>[D.trim(),String(r).trim()]).filter(([D,r])=>D.length>0&&r.length>0);return S("conventional-types",t.length>0,"Must contain at least one type"),JSON.stringify(Object.fromEntries(t))},me={"api-key"(e){if(!e)throw new B("Please set your API key via `aicommits config set api-key=<your token>`");if(typeof e!="string")throw new B("Invalid config property api-key: Must be a string");const u=e.trim();return S("api-key",u.length>0,"Cannot be empty"),u},"base-url"(e){if(e==null||e==="")throw new B("Please set your API base URL via `aicommits config set base-url=<https://...>`");if(typeof e!="string")throw new B("Invalid config property base-url: Must be a valid URL");const u=e.trim();let t;try{t=new URL(u)}catch{throw new B("Invalid config property base-url: Must be a valid URL")}S("base-url",t.protocol==="https:","Must be an HTTPS URL"),S("base-url",t.hash==="","Must not include URL fragments"),S("base-url",t.search==="","Must not include query parameters");const D=t.pathname.replace(/\/+$/,"");return`${t.origin}${D}`},profile(e){if(e==null)return"";if(typeof e!="string")throw new B("Invalid config property profile: Must be a string");return e.trim()},locale(e){if(!e)return"en";if(typeof e!="string")throw new B("Invalid config property locale: Must be a string");const u=Ki(e);return S("locale",u.length>0,"Cannot be empty"),S("locale",/^[a-z]{2,3}(?:-[a-z\d]{2,8})*$/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},generate(e){if(!e)return 1;S("generate",typeof e=="string"||typeof e=="number","Must be an integer");const u=Number(e);return S("generate",Number.isInteger(u),"Must be an integer"),S("generate",u>0,"Must be greater than 0"),S("generate",u<=5,"Must be less or equal to 5"),u},type(e){return e?(S("type",typeof e=="string","Must be a string"),S("type",qi.includes(e),"Invalid commit type"),e):""},proxy(e){if(!(e==null||e==="")){if(typeof e!="string")throw new B("Invalid config property proxy: Must be a valid URL");return S("proxy",/^https?:\/\//.test(e),"Must be a valid URL"),e}},model(e){if(e==null||e==="")return"gpt-3.5-turbo";if(typeof e!="string")throw new B("Invalid config property model: Must be a string");return e},timeout(e){if(!e)return 1e4;S("timeout",typeof e=="string"||typeof e=="number","Must be an integer");const u=Number(e);return S("timeout",Number.isInteger(u),"Must be an integer"),S("timeout",u>=500,"Must be greater than 500ms"),u},"max-length"(e){if(!e)return 50;S("max-length",typeof e=="string"||typeof e=="number","Must be an integer");const u=Number(e);return S("max-length",Number.isInteger(u),"Must be an integer"),S("max-length",u>=20,"Must be greater than 20 characters"),u},details(e){return ku("details",e,!1)},"show-reasoning"(e){return ku("show-reasoning",e,!1)},"details-style"(e){if(e==null||e==="")return"paragraph";if(typeof e!="string")throw new B("Invalid config property details-style: Must be a string");const u=e.trim().toLowerCase();return S("details-style",["paragraph","list"].includes(u),"Must be one of: paragraph, list"),u},instructions(e){if(e==null)return"";if(typeof e!="string")throw new B("Invalid config property instructions: Must be a string");return e.trim()},"conventional-format"(e){if(e==null)return"";if(typeof e!="string")throw new B("Invalid config property conventional-format: Must be a string");return e.trim()},"conventional-types"(e){if(!e)return"";if(typeof e!="string")throw new B("Invalid config property conventional-types: Must be valid JSON");return Ji(e)},"conventional-scope"(e){return ku("conventional-scope",e,!1)}},Mu={"api-key":["openai-key","OPENAI_KEY","OPENAI_API_KEY"],"base-url":["openai-base-url","OPENAI_BASE_URL"],model:["OPENAI_MODEL"]},AD=U.join(ve.homedir(),".aicommits"),$D=U.join(AD,"config.toml"),Yi=[U.join(ve.homedir(),"aicommits.toml"),U.join(ve.homedir(),".aicommits")],Zi=e=>{let u=!1,t=!1,D=!1;for(let r=0;r<e.length;r+=1){const o=e[r];if(o==="\\"&&t&&!D){D=!0;continue}if(o==='"'&&!u&&!D)t=!t;else if(o==="'"&&!t)u=!u;else if(o==="#"&&!u&&!t)return e.slice(0,r);D=!1}return e},xD=e=>{const u=e.trim();return u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1):u},Xi=e=>{const u=e.trim();if(u==="")return"";if(u.startsWith('"')&&u.endsWith('"'))try{return JSON.parse(u)}catch{return u.slice(1,-1)}return u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1):/^(?:true|false)$/i.test(u)?u.toLowerCase()==="true":/^[+-]?\d+$/.test(u)||/^[+-]?\d+\.\d+$/.test(u)?Number(u):u},Qi=(e,u)=>{let t=e;for(const D of u){const r=t[D];if(!pe(r)){const o=Object.create(null);t[D]=o,t=o;continue}t=r}return t},ea=e=>{const u=Object.create(null);let t=u;for(const D of e.split(/\r?\n/)){const r=Zi(D).trim();if(!r)continue;if(r.startsWith("[")&&r.endsWith("]")){const i=r.slice(1,-1).trim();if(!i){t=u;continue}const c=i.split(".").map(xD).map(f=>f.trim()).filter(Boolean);if(c.length===0){t=u;continue}t=Qi(u,c);continue}const o=r.indexOf("=");if(o<=0)continue;const n=xD(r.slice(0,o));if(!n)continue;const s=Xi(r.slice(o+1));t[n]=s}return u},SD=e=>typeof e=="string"?JSON.stringify(e):String(e),ua=e=>{const u=[],t=[],D=(o,n)=>{const s=[],i=[];for(const[c,f]of Object.entries(n)){const a=H(f);if(a!==void 0){s.push(`${c} = ${SD(a)}`);continue}pe(f)&&i.push([c,f])}o.length>0&&s.length>0&&t.push(`[${o.join(".")}]`,...s,"");for(const[c,f]of i)D([...o,c],f)};for(const[o,n]of Object.entries(e)){const s=H(n);if(s!==void 0){u.push(`${o} = ${SD(s)}`);continue}pe(n)&&D([o],n)}for(;t[t.length-1]==="";)t.pop();return[...u,...u.length>0&&t.length>0?[""]:[],...t].join(`
62
- `)},TD=async e=>{try{if(!(await _.lstat(e)).isFile())return;const t=await _.readFile(e,"utf8");return ea(t)}catch{return}},OD=async()=>{const e=await TD($D);if(e)return e;for(const u of Yi){const t=await TD(u);if(t)return t}return Object.create(null)},PD=(e,u)=>{const t=Mu[e];if(!(!t||t.length===0))for(const D of t){const r=H(u[D]);if(r!==void 0)return r}},ta=e=>{for(const[u,t]of Object.entries(Mu)){if(H(e[u])===void 0)for(const D of t){const r=H(e[D]);if(r!==void 0){e[u]=r;break}}for(const D of t)delete e[D]}},Da=(e,u,t)=>{if(!u)return;const{profiles:D}=e;if(!pe(D))return;const r=D[u];if(pe(r))return H(r[t])},Ru=async(e,u)=>{const t=await OD(),D={},r=e?.profile??H(t.profile)??PD("profile",t);let o="";try{o=me.profile(r)}catch{if(!u)throw new B("Invalid config property profile: Must be a string")}for(const n of Object.keys(me)){const s=me[n],i=e?.[n]??(n==="profile"?void 0:Da(t,o,n))??H(t[n])??PD(n,t);if(u)try{D[n]=s(i)}catch{}else D[n]=s(i)}return D},na=async e=>{const u=await OD();ta(u);for(const[D,r]of e){if(!vD(me,D))throw new B(`Invalid config property: ${D}`);const o=D,n=me[o](r);u[o]=n;const s=Mu[o]||[];for(const i of s)delete u[i]}await _.mkdir(AD,{recursive:!0});const t=ua(u);await _.writeFile($D,`${t}
63
- `,"utf8")};var ju={},_u={exports:{}},he={exports:{}},Lu,ID;function ra(){if(ID)return Lu;ID=1;var e=1e3,u=e*60,t=u*60,D=t*24,r=D*7,o=D*365.25;Lu=function(f,a){a=a||{};var l=typeof f;if(l==="string"&&f.length>0)return n(f);if(l==="number"&&isFinite(f))return a.long?i(f):s(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))};function n(f){if(f=String(f),!(f.length>100)){var a=/^(-?(?:\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(a){var l=parseFloat(a[1]),F=(a[2]||"ms").toLowerCase();switch(F){case"years":case"year":case"yrs":case"yr":case"y":return l*o;case"weeks":case"week":case"w":return l*r;case"days":case"day":case"d":return l*D;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*u;case"seconds":case"second":case"secs":case"sec":case"s":return l*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}}}function s(f){var a=Math.abs(f);return a>=D?Math.round(f/D)+"d":a>=t?Math.round(f/t)+"h":a>=u?Math.round(f/u)+"m":a>=e?Math.round(f/e)+"s":f+"ms"}function i(f){var a=Math.abs(f);return a>=D?c(f,a,D,"day"):a>=t?c(f,a,t,"hour"):a>=u?c(f,a,u,"minute"):a>=e?c(f,a,e,"second"):f+" ms"}function c(f,a,l,F){var C=a>=l*1.5;return Math.round(f/l)+" "+F+(C?"s":"")}return Lu}var Nu,kD;function MD(){if(kD)return Nu;kD=1;function e(u){D.debug=D,D.default=D,D.coerce=c,D.disable=s,D.enable=o,D.enabled=i,D.humanize=ra(),D.destroy=f,Object.keys(u).forEach(a=>{D[a]=u[a]}),D.names=[],D.skips=[],D.formatters={};function t(a){let l=0;for(let F=0;F<a.length;F++)l=(l<<5)-l+a.charCodeAt(F),l|=0;return D.colors[Math.abs(l)%D.colors.length]}D.selectColor=t;function D(a){let l,F=null,C,d;function p(...h){if(!p.enabled)return;const g=p,m=Number(new Date),b=m-(l||m);g.diff=b,g.prev=l,g.curr=m,l=m,h[0]=D.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let y=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(v,P)=>{if(v==="%%")return"%";y++;const L=D.formatters[P];if(typeof L=="function"){const j=h[y];v=L.call(g,j),h.splice(y,1),y--}return v}),D.formatArgs.call(g,h),(g.log||D.log).apply(g,h)}return p.namespace=a,p.useColors=D.useColors(),p.color=D.selectColor(a),p.extend=r,p.destroy=D.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>F!==null?F:(C!==D.namespaces&&(C=D.namespaces,d=D.enabled(a)),d),set:h=>{F=h}}),typeof D.init=="function"&&D.init(p),p}function r(a,l){const F=D(this.namespace+(typeof l>"u"?":":l)+a);return F.log=this.log,F}function o(a){D.save(a),D.namespaces=a,D.names=[],D.skips=[];const l=(typeof a=="string"?a:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const F of l)F[0]==="-"?D.skips.push(F.slice(1)):D.names.push(F)}function n(a,l){let F=0,C=0,d=-1,p=0;for(;F<a.length;)if(C<l.length&&(l[C]===a[F]||l[C]==="*"))l[C]==="*"?(d=C,p=F,C++):(F++,C++);else if(d!==-1)C=d+1,p++,F=p;else return!1;for(;C<l.length&&l[C]==="*";)C++;return C===l.length}function s(){const a=[...D.names,...D.skips.map(l=>"-"+l)].join(",");return D.enable(""),a}function i(a){for(const l of D.skips)if(n(a,l))return!1;for(const l of D.names)if(n(a,l))return!0;return!1}function c(a){return a instanceof Error?a.stack||a.message:a}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 D.enable(D.load()),D}return Nu=e,Nu}he.exports;var RD;function oa(){return RD||(RD=1,function(e,u){u.formatArgs=D,u.save=r,u.load=o,u.useColors=t,u.storage=n(),u.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`."))}})(),u.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let i;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(i=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(i[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function D(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;i.splice(1,0,c,"color: inherit");let f=0,a=0;i[0].replace(/%[a-zA-Z%]/g,l=>{l!=="%%"&&(f++,l==="%c"&&(a=f))}),i.splice(a,0,c)}u.log=console.debug||console.log||(()=>{});function r(i){try{i?u.storage.setItem("debug",i):u.storage.removeItem("debug")}catch{}}function o(){let i;try{i=u.storage.getItem("debug")||u.storage.getItem("DEBUG")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}function n(){try{return localStorage}catch{}}e.exports=MD()(u);const{formatters:s}=e.exports;s.j=function(i){try{return JSON.stringify(i)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}}(he,he.exports)),he.exports}var Ee={exports:{}},Gu,jD;function sa(){return jD||(jD=1,Gu=(e,u=process.argv)=>{const t=e.startsWith("-")?"":e.length===1?"-":"--",D=u.indexOf(t+e),r=u.indexOf("--");return D!==-1&&(r===-1||D<r)}),Gu}var zu,_D;function ia(){if(_D)return zu;_D=1;const e=ve,u=Ue,t=sa(),{env:D}=process;let r;t("no-color")||t("no-colors")||t("color=false")||t("color=never")?r=0:(t("color")||t("colors")||t("color=true")||t("color=always"))&&(r=1),"FORCE_COLOR"in D&&(D.FORCE_COLOR==="true"?r=1:D.FORCE_COLOR==="false"?r=0:r=D.FORCE_COLOR.length===0?1:Math.min(parseInt(D.FORCE_COLOR,10),3));function o(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function n(i,c){if(r===0)return 0;if(t("color=16m")||t("color=full")||t("color=truecolor"))return 3;if(t("color=256"))return 2;if(i&&!c&&r===void 0)return 0;const f=r||0;if(D.TERM==="dumb")return f;if(process.platform==="win32"){const a=e.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in D)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(a=>a in D)||D.CI_NAME==="codeship"?1:f;if("TEAMCITY_VERSION"in D)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(D.TEAMCITY_VERSION)?1:0;if(D.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in D){const a=parseInt((D.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(D.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(D.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(D.TERM)||"COLORTERM"in D?1:f}function s(i){const c=n(i,i&&i.isTTY);return o(c)}return zu={supportsColor:s,stdout:o(n(!0,u.isatty(1))),stderr:o(n(!0,u.isatty(2)))},zu}Ee.exports;var LD;function aa(){return LD||(LD=1,function(e,u){const t=Ue,D=tt;u.init=f,u.log=s,u.formatArgs=o,u.save=i,u.load=c,u.useColors=r,u.destroy=D.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),u.colors=[6,2,3,4,5,1];try{const l=ia();l&&(l.stderr||l).level>=2&&(u.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{}u.inspectOpts=Object.keys(process.env).filter(l=>/^debug_/i.test(l)).reduce((l,F)=>{const C=F.substring(6).toLowerCase().replace(/_([a-z])/g,(p,h)=>h.toUpperCase());let d=process.env[F];return/^(yes|on|true|enabled)$/i.test(d)?d=!0:/^(no|off|false|disabled)$/i.test(d)?d=!1:d==="null"?d=null:d=Number(d),l[C]=d,l},{});function r(){return"colors"in u.inspectOpts?!!u.inspectOpts.colors:t.isatty(process.stderr.fd)}function o(l){const{namespace:F,useColors:C}=this;if(C){const d=this.color,p="\x1B[3"+(d<8?d:"8;5;"+d),h=` ${p};1m${F} \x1B[0m`;l[0]=h+l[0].split(`
59
+ ${Pu}${de(`aicommits v${Hs}`)}`),console.error(`
60
+ ${Pu}Please open a Bug report with the information above:`),console.error(`${Pu}${Js}`))},AD=async(e,u)=>{const{stdout:t,failed:D}=await oe("git",["rev-parse",...e],{reject:!1,cwd:u});if(D)throw new g("The current directory must be a Git repository!");return t.trim()},vD=async()=>AD(["--show-toplevel"]),Ys=async(e,u)=>{const t=u||process.cwd(),D=await AD(["--git-path",e],t);return z.isAbsolute(D)?D:z.resolve(t,D)},ku=e=>`:(exclude)${e}`,$D=["package-lock.json","pnpm-lock.yaml","*.lock"].map(ku),xD=async e=>{const u=["diff","--cached","--diff-algorithm=minimal"],{stdout:t}=await oe("git",[...u,"--name-only",...$D,...e?e.map(ku):[]]);if(!t)return;const{stdout:D}=await oe("git",[...u,...$D,...e?e.map(ku):[]]);return{files:t.split(`
61
+ `),diff:D}},Zs=e=>`Detected ${e.length.toLocaleString()} staged file${e.length>1?"s":""}`,Xs=["","conventional"],{hasOwnProperty:Qs}=Object.prototype,SD=(e,u)=>Qs.call(e,u),S=(e,u,t)=>{if(!u)throw new g(`Invalid config property ${e}: ${t}`)},me=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),V=e=>typeof e=="string"||typeof e=="number"||typeof e=="boolean"?e:void 0,ea={cn:"zh-CN","zh-cn":"zh-CN","zh-hans":"zh-CN",zh:"zh-CN","zh-tw":"zh-TW","zh-hant":"zh-TW"},ua=e=>{const u=e.trim().replace(/_/g,"-");return ea[u.toLowerCase()]??u},Mu=(e,u,t)=>{if(u==null||u==="")return t;if(typeof u=="boolean")return u;if(typeof u=="number"){if(u===1)return!0;if(u===0)return!1}if(typeof u=="string"){const D=u.trim().toLowerCase();if(["true","1","yes","on"].includes(D))return!0;if(["false","0","no","off"].includes(D))return!1}throw new g(`Invalid config property ${e}: Must be a boolean (true/false)`)},ta=e=>{let u;try{u=JSON.parse(e)}catch{throw new g("Invalid config property conventional-types: Must be valid JSON")}S("conventional-types",typeof u=="object"&&u!==null&&!Array.isArray(u),'Must be a JSON object with "type":"description" pairs');const t=Object.entries(u).map(([D,r])=>[D.trim(),String(r).trim()]).filter(([D,r])=>D.length>0&&r.length>0);return S("conventional-types",t.length>0,"Must contain at least one type"),JSON.stringify(Object.fromEntries(t))},he={"api-key"(e){if(!e)throw new g("Please set your API key via `aicommits config set api-key=<your token>`");if(typeof e!="string")throw new g("Invalid config property api-key: Must be a string");const u=e.trim();return S("api-key",u.length>0,"Cannot be empty"),u},"base-url"(e){if(e==null||e==="")throw new g("Please set your API base URL via `aicommits config set base-url=<https://...>`");if(typeof e!="string")throw new g("Invalid config property base-url: Must be a valid URL");const u=e.trim();let t;try{t=new URL(u)}catch{throw new g("Invalid config property base-url: Must be a valid URL")}S("base-url",t.protocol==="https:","Must be an HTTPS URL"),S("base-url",t.hash==="","Must not include URL fragments"),S("base-url",t.search==="","Must not include query parameters");const D=t.pathname.replace(/\/+$/,"");return`${t.origin}${D}`},profile(e){if(e==null)return"";if(typeof e!="string")throw new g("Invalid config property profile: Must be a string");return e.trim()},locale(e){if(!e)return"en";if(typeof e!="string")throw new g("Invalid config property locale: Must be a string");const u=ua(e);return S("locale",u.length>0,"Cannot be empty"),S("locale",/^[a-z]{2,3}(?:-[a-z\d]{2,8})*$/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},generate(e){if(!e)return 1;S("generate",typeof e=="string"||typeof e=="number","Must be an integer");const u=Number(e);return S("generate",Number.isInteger(u),"Must be an integer"),S("generate",u>0,"Must be greater than 0"),S("generate",u<=5,"Must be less or equal to 5"),u},type(e){return e?(S("type",typeof e=="string","Must be a string"),S("type",Xs.includes(e),"Invalid commit type"),e):""},proxy(e){if(!(e==null||e==="")){if(typeof e!="string")throw new g("Invalid config property proxy: Must be a valid URL");return S("proxy",/^https?:\/\//.test(e),"Must be a valid URL"),e}},model(e){if(e==null||e==="")return"gpt-3.5-turbo";if(typeof e!="string")throw new g("Invalid config property model: Must be a string");return e},timeout(e){if(!e)return 1e4;S("timeout",typeof e=="string"||typeof e=="number","Must be an integer");const u=Number(e);return S("timeout",Number.isInteger(u),"Must be an integer"),S("timeout",u>=500,"Must be greater than 500ms"),u},"max-length"(e){if(!e)return 50;S("max-length",typeof e=="string"||typeof e=="number","Must be an integer");const u=Number(e);return S("max-length",Number.isInteger(u),"Must be an integer"),S("max-length",u>=20,"Must be greater than 20 characters"),u},details(e){return Mu("details",e,!1)},"show-reasoning"(e){return Mu("show-reasoning",e,!1)},"details-style"(e){if(e==null||e==="")return"paragraph";if(typeof e!="string")throw new g("Invalid config property details-style: Must be a string");const u=e.trim().toLowerCase();return S("details-style",["paragraph","list"].includes(u),"Must be one of: paragraph, list"),u},instructions(e){if(e==null)return"";if(typeof e!="string")throw new g("Invalid config property instructions: Must be a string");return e.trim()},"conventional-format"(e){if(e==null)return"";if(typeof e!="string")throw new g("Invalid config property conventional-format: Must be a string");return e.trim()},"conventional-types"(e){if(!e)return"";if(typeof e!="string")throw new g("Invalid config property conventional-types: Must be valid JSON");return ta(e)},"conventional-scope"(e){return Mu("conventional-scope",e,!1)}},Ru={"api-key":["openai-key","OPENAI_KEY","OPENAI_API_KEY"],"base-url":["openai-base-url","OPENAI_BASE_URL"],model:["OPENAI_MODEL"]},TD=z.join(ve.homedir(),".aicommits"),OD=z.join(TD,"config.toml"),Da=[z.join(ve.homedir(),"aicommits.toml"),z.join(ve.homedir(),".aicommits")],na=e=>{let u=!1,t=!1,D=!1;for(let r=0;r<e.length;r+=1){const o=e[r];if(o==="\\"&&t&&!D){D=!0;continue}if(o==='"'&&!u&&!D)t=!t;else if(o==="'"&&!t)u=!u;else if(o==="#"&&!u&&!t)return e.slice(0,r);D=!1}return e},PD=e=>{const u=e.trim();return u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1):u},ra=e=>{const u=e.trim();if(u==="")return"";if(u.startsWith('"')&&u.endsWith('"'))try{return JSON.parse(u)}catch{return u.slice(1,-1)}return u.startsWith("'")&&u.endsWith("'")?u.slice(1,-1):/^(?:true|false)$/i.test(u)?u.toLowerCase()==="true":/^[+-]?\d+$/.test(u)||/^[+-]?\d+\.\d+$/.test(u)?Number(u):u},oa=(e,u)=>{let t=e;for(const D of u){const r=t[D];if(!me(r)){const o=Object.create(null);t[D]=o,t=o;continue}t=r}return t},ia=e=>{const u=Object.create(null);let t=u;for(const D of e.split(/\r?\n/)){const r=na(D).trim();if(!r)continue;if(r.startsWith("[")&&r.endsWith("]")){const s=r.slice(1,-1).trim();if(!s){t=u;continue}const c=s.split(".").map(PD).map(f=>f.trim()).filter(Boolean);if(c.length===0){t=u;continue}t=oa(u,c);continue}const o=r.indexOf("=");if(o<=0)continue;const n=PD(r.slice(0,o));if(!n)continue;const i=ra(r.slice(o+1));t[n]=i}return u},ID=e=>typeof e=="string"?JSON.stringify(e):String(e),sa=e=>{const u=[],t=[],D=(o,n)=>{const i=[],s=[];for(const[c,f]of Object.entries(n)){const a=V(f);if(a!==void 0){i.push(`${c} = ${ID(a)}`);continue}me(f)&&s.push([c,f])}o.length>0&&i.length>0&&t.push(`[${o.join(".")}]`,...i,"");for(const[c,f]of s)D([...o,c],f)};for(const[o,n]of Object.entries(e)){const i=V(n);if(i!==void 0){u.push(`${o} = ${ID(i)}`);continue}me(n)&&D([o],n)}for(;t[t.length-1]==="";)t.pop();return[...u,...u.length>0&&t.length>0?[""]:[],...t].join(`
62
+ `)},kD=async e=>{try{if(!(await _.lstat(e)).isFile())return;const t=await _.readFile(e,"utf8");return ia(t)}catch{return}},MD=async()=>{const e=await kD(OD);if(e)return e;for(const u of Da){const t=await kD(u);if(t)return t}return Object.create(null)},RD=(e,u)=>{const t=Ru[e];if(!(!t||t.length===0))for(const D of t){const r=V(u[D]);if(r!==void 0)return r}},aa=e=>{for(const[u,t]of Object.entries(Ru)){if(V(e[u])===void 0)for(const D of t){const r=V(e[D]);if(r!==void 0){e[u]=r;break}}for(const D of t)delete e[D]}},ca=(e,u,t)=>{if(!u)return;const{profiles:D}=e;if(!me(D))return;const r=D[u];if(me(r))return V(r[t])},ju=async(e,u)=>{const t=await MD(),D={},r=e?.profile??V(t.profile)??RD("profile",t);let o="";try{o=he.profile(r)}catch{if(!u)throw new g("Invalid config property profile: Must be a string")}for(const n of Object.keys(he)){const i=he[n],s=e?.[n]??(n==="profile"?void 0:ca(t,o,n))??V(t[n])??RD(n,t);if(u)try{D[n]=i(s)}catch{}else D[n]=i(s)}return D},la=async e=>{const u=await MD();aa(u);for(const[D,r]of e){if(!SD(he,D))throw new g(`Invalid config property: ${D}`);const o=D,n=he[o](r);u[o]=n;const i=Ru[o]||[];for(const s of i)delete u[s]}await _.mkdir(TD,{recursive:!0});const t=sa(u);await _.writeFile(OD,`${t}
63
+ `,"utf8")};var _u={},Lu={exports:{}},Ee={exports:{}},Nu,jD;function fa(){if(jD)return Nu;jD=1;var e=1e3,u=e*60,t=u*60,D=t*24,r=D*7,o=D*365.25;Nu=function(f,a){a=a||{};var l=typeof f;if(l==="string"&&f.length>0)return n(f);if(l==="number"&&isFinite(f))return a.long?s(f):i(f);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(f))};function n(f){if(f=String(f),!(f.length>100)){var a=/^(-?(?:\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(a){var l=parseFloat(a[1]),F=(a[2]||"ms").toLowerCase();switch(F){case"years":case"year":case"yrs":case"yr":case"y":return l*o;case"weeks":case"week":case"w":return l*r;case"days":case"day":case"d":return l*D;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*u;case"seconds":case"second":case"secs":case"sec":case"s":return l*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}}}function i(f){var a=Math.abs(f);return a>=D?Math.round(f/D)+"d":a>=t?Math.round(f/t)+"h":a>=u?Math.round(f/u)+"m":a>=e?Math.round(f/e)+"s":f+"ms"}function s(f){var a=Math.abs(f);return a>=D?c(f,a,D,"day"):a>=t?c(f,a,t,"hour"):a>=u?c(f,a,u,"minute"):a>=e?c(f,a,e,"second"):f+" ms"}function c(f,a,l,F){var C=a>=l*1.5;return Math.round(f/l)+" "+F+(C?"s":"")}return Nu}var Gu,_D;function LD(){if(_D)return Gu;_D=1;function e(u){D.debug=D,D.default=D,D.coerce=c,D.disable=i,D.enable=o,D.enabled=s,D.humanize=fa(),D.destroy=f,Object.keys(u).forEach(a=>{D[a]=u[a]}),D.names=[],D.skips=[],D.formatters={};function t(a){let l=0;for(let F=0;F<a.length;F++)l=(l<<5)-l+a.charCodeAt(F),l|=0;return D.colors[Math.abs(l)%D.colors.length]}D.selectColor=t;function D(a){let l,F=null,C,p;function d(...h){if(!d.enabled)return;const y=d,m=Number(new Date),b=m-(l||m);y.diff=b,y.prev=l,y.curr=m,l=m,h[0]=D.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let B=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(w,P)=>{if(w==="%%")return"%";B++;const L=D.formatters[P];if(typeof L=="function"){const U=h[B];w=L.call(y,U),h.splice(B,1),B--}return w}),D.formatArgs.call(y,h),(y.log||D.log).apply(y,h)}return d.namespace=a,d.useColors=D.useColors(),d.color=D.selectColor(a),d.extend=r,d.destroy=D.destroy,Object.defineProperty(d,"enabled",{enumerable:!0,configurable:!1,get:()=>F!==null?F:(C!==D.namespaces&&(C=D.namespaces,p=D.enabled(a)),p),set:h=>{F=h}}),typeof D.init=="function"&&D.init(d),d}function r(a,l){const F=D(this.namespace+(typeof l>"u"?":":l)+a);return F.log=this.log,F}function o(a){D.save(a),D.namespaces=a,D.names=[],D.skips=[];const l=(typeof a=="string"?a:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const F of l)F[0]==="-"?D.skips.push(F.slice(1)):D.names.push(F)}function n(a,l){let F=0,C=0,p=-1,d=0;for(;F<a.length;)if(C<l.length&&(l[C]===a[F]||l[C]==="*"))l[C]==="*"?(p=C,d=F,C++):(F++,C++);else if(p!==-1)C=p+1,d++,F=d;else return!1;for(;C<l.length&&l[C]==="*";)C++;return C===l.length}function i(){const a=[...D.names,...D.skips.map(l=>"-"+l)].join(",");return D.enable(""),a}function s(a){for(const l of D.skips)if(n(a,l))return!1;for(const l of D.names)if(n(a,l))return!0;return!1}function c(a){return a instanceof Error?a.stack||a.message:a}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 D.enable(D.load()),D}return Gu=e,Gu}Ee.exports;var ND;function Fa(){return ND||(ND=1,function(e,u){u.formatArgs=D,u.save=r,u.load=o,u.useColors=t,u.storage=n(),u.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`."))}})(),u.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+)/)}function D(s){if(s[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+s[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;s.splice(1,0,c,"color: inherit");let f=0,a=0;s[0].replace(/%[a-zA-Z%]/g,l=>{l!=="%%"&&(f++,l==="%c"&&(a=f))}),s.splice(a,0,c)}u.log=console.debug||console.log||(()=>{});function r(s){try{s?u.storage.setItem("debug",s):u.storage.removeItem("debug")}catch{}}function o(){let s;try{s=u.storage.getItem("debug")||u.storage.getItem("DEBUG")}catch{}return!s&&typeof process<"u"&&"env"in process&&(s=process.env.DEBUG),s}function n(){try{return localStorage}catch{}}e.exports=LD()(u);const{formatters:i}=e.exports;i.j=function(s){try{return JSON.stringify(s)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}}(Ee,Ee.exports)),Ee.exports}var ge={exports:{}},zu,GD;function Ca(){return GD||(GD=1,zu=(e,u=process.argv)=>{const t=e.startsWith("-")?"":e.length===1?"-":"--",D=u.indexOf(t+e),r=u.indexOf("--");return D!==-1&&(r===-1||D<r)}),zu}var Wu,zD;function da(){if(zD)return Wu;zD=1;const e=ve,u=qe,t=Ca(),{env:D}=process;let r;t("no-color")||t("no-colors")||t("color=false")||t("color=never")?r=0:(t("color")||t("colors")||t("color=true")||t("color=always"))&&(r=1),"FORCE_COLOR"in D&&(D.FORCE_COLOR==="true"?r=1:D.FORCE_COLOR==="false"?r=0:r=D.FORCE_COLOR.length===0?1:Math.min(parseInt(D.FORCE_COLOR,10),3));function o(s){return s===0?!1:{level:s,hasBasic:!0,has256:s>=2,has16m:s>=3}}function n(s,c){if(r===0)return 0;if(t("color=16m")||t("color=full")||t("color=truecolor"))return 3;if(t("color=256"))return 2;if(s&&!c&&r===void 0)return 0;const f=r||0;if(D.TERM==="dumb")return f;if(process.platform==="win32"){const a=e.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in D)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(a=>a in D)||D.CI_NAME==="codeship"?1:f;if("TEAMCITY_VERSION"in D)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(D.TEAMCITY_VERSION)?1:0;if(D.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in D){const a=parseInt((D.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(D.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(D.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(D.TERM)||"COLORTERM"in D?1:f}function i(s){const c=n(s,s&&s.isTTY);return o(c)}return Wu={supportsColor:i,stdout:o(n(!0,u.isatty(1))),stderr:o(n(!0,u.isatty(2)))},Wu}ge.exports;var WD;function pa(){return WD||(WD=1,function(e,u){const t=qe,D=nt;u.init=f,u.log=i,u.formatArgs=o,u.save=s,u.load=c,u.useColors=r,u.destroy=D.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),u.colors=[6,2,3,4,5,1];try{const l=da();l&&(l.stderr||l).level>=2&&(u.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{}u.inspectOpts=Object.keys(process.env).filter(l=>/^debug_/i.test(l)).reduce((l,F)=>{const C=F.substring(6).toLowerCase().replace(/_([a-z])/g,(d,h)=>h.toUpperCase());let p=process.env[F];return/^(yes|on|true|enabled)$/i.test(p)?p=!0:/^(no|off|false|disabled)$/i.test(p)?p=!1:p==="null"?p=null:p=Number(p),l[C]=p,l},{});function r(){return"colors"in u.inspectOpts?!!u.inspectOpts.colors:t.isatty(process.stderr.fd)}function o(l){const{namespace:F,useColors:C}=this;if(C){const p=this.color,d="\x1B[3"+(p<8?p:"8;5;"+p),h=` ${d};1m${F} \x1B[0m`;l[0]=h+l[0].split(`
64
64
  `).join(`
65
- `+h),l.push(p+"m+"+e.exports.humanize(this.diff)+"\x1B[0m")}else l[0]=n()+F+" "+l[0]}function n(){return u.inspectOpts.hideDate?"":new Date().toISOString()+" "}function s(...l){return process.stderr.write(D.formatWithOptions(u.inspectOpts,...l)+`
66
- `)}function i(l){l?process.env.DEBUG=l:delete process.env.DEBUG}function c(){return process.env.DEBUG}function f(l){l.inspectOpts={};const F=Object.keys(u.inspectOpts);for(let C=0;C<F.length;C++)l.inspectOpts[F[C]]=u.inspectOpts[F[C]]}e.exports=MD()(u);const{formatters:a}=e.exports;a.o=function(l){return this.inspectOpts.colors=this.useColors,D.inspect(l,this.inspectOpts).split(`
67
- `).map(F=>F.trim()).join(" ")},a.O=function(l){return this.inspectOpts.colors=this.useColors,D.inspect(l,this.inspectOpts)}}(Ee,Ee.exports)),Ee.exports}typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?_u.exports=oa():_u.exports=aa();var Wu=_u.exports,Uu={};Object.defineProperty(Uu,"__esModule",{value:!0});function ca(e){return function(u,t){return new Promise((D,r)=>{e.call(this,u,t,(o,n)=>{o?r(o):D(n)})})}}Uu.default=ca;var ND=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const la=ut,fa=ND(Wu),Fa=ND(Uu),ge=fa.default("agent-base");function Ca(e){return!!e&&typeof e.addRequest=="function"}function qu(){const{stack:e}=new Error;return typeof e!="string"?!1:e.split(`
68
- `).some(u=>u.indexOf("(https.js:")!==-1||u.indexOf("node:https:")!==-1)}function ze(e,u){return new ze.Agent(e,u)}(function(e){class u extends la.EventEmitter{constructor(D,r){super();let o=r;typeof D=="function"?this.callback=D:D&&(o=D),this.timeout=null,o&&typeof o.timeout=="number"&&(this.timeout=o.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:qu()?443:80}set defaultPort(D){this.explicitDefaultPort=D}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:qu()?"https:":"http:"}set protocol(D){this.explicitProtocol=D}callback(D,r,o){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(D,r){const o=Object.assign({},r);typeof o.secureEndpoint!="boolean"&&(o.secureEndpoint=qu()),o.host==null&&(o.host="localhost"),o.port==null&&(o.port=o.secureEndpoint?443:80),o.protocol==null&&(o.protocol=o.secureEndpoint?"https:":"http:"),o.host&&o.path&&delete o.path,delete o.agent,delete o.hostname,delete o._defaultAgent,delete o.defaultPort,delete o.createConnection,D._last=!0,D.shouldKeepAlive=!1;let n=!1,s=null;const i=o.timeout||this.timeout,c=F=>{D._hadError||(D.emit("error",F),D._hadError=!0)},f=()=>{s=null,n=!0;const F=new Error(`A "socket" was not created for HTTP request before ${i}ms`);F.code="ETIMEOUT",c(F)},a=F=>{n||(s!==null&&(clearTimeout(s),s=null),c(F))},l=F=>{if(n)return;if(s!=null&&(clearTimeout(s),s=null),Ca(F)){ge("Callback returned another Agent instance %o",F.constructor.name),F.addRequest(D,o);return}if(F){F.once("free",()=>{this.freeSocket(F,o)}),D.onSocket(F);return}const C=new Error(`no Duplex stream was returned to agent-base for \`${D.method} ${D.path}\``);c(C)};if(typeof this.callback!="function"){c(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(ge("Converting legacy callback function to promise"),this.promisifiedCallback=Fa.default(this.callback)):this.promisifiedCallback=this.callback),typeof i=="number"&&i>0&&(s=setTimeout(f,i)),"port"in o&&typeof o.port!="number"&&(o.port=Number(o.port));try{ge("Resolving socket for %o request: %o",o.protocol,`${D.method} ${D.path}`),Promise.resolve(this.promisifiedCallback(D,o)).then(l,a)}catch(F){Promise.reject(F).catch(a)}}freeSocket(D,r){ge("Freeing socket %o %o",D.constructor.name,r),D.destroy()}destroy(){ge("Destroying agent %o",this.constructor.name)}}e.Agent=u,e.prototype=e.Agent.prototype})(ze||(ze={}));var da=ze,Hu={},pa=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hu,"__esModule",{value:!0});const ma=pa(Wu),ye=ma.default("https-proxy-agent:parse-proxy-response");function ha(e){return new Promise((u,t)=>{let D=0;const r=[];function o(){const a=e.read();a?f(a):e.once("readable",o)}function n(){e.removeListener("end",i),e.removeListener("error",c),e.removeListener("close",s),e.removeListener("readable",o)}function s(a){ye("onclose had error %o",a)}function i(){ye("onend")}function c(a){n(),ye("onerror %o",a),t(a)}function f(a){r.push(a),D+=a.length;const l=Buffer.concat(r,D);if(l.indexOf(`\r
65
+ `+h),l.push(d+"m+"+e.exports.humanize(this.diff)+"\x1B[0m")}else l[0]=n()+F+" "+l[0]}function n(){return u.inspectOpts.hideDate?"":new Date().toISOString()+" "}function i(...l){return process.stderr.write(D.formatWithOptions(u.inspectOpts,...l)+`
66
+ `)}function s(l){l?process.env.DEBUG=l:delete process.env.DEBUG}function c(){return process.env.DEBUG}function f(l){l.inspectOpts={};const F=Object.keys(u.inspectOpts);for(let C=0;C<F.length;C++)l.inspectOpts[F[C]]=u.inspectOpts[F[C]]}e.exports=LD()(u);const{formatters:a}=e.exports;a.o=function(l){return this.inspectOpts.colors=this.useColors,D.inspect(l,this.inspectOpts).split(`
67
+ `).map(F=>F.trim()).join(" ")},a.O=function(l){return this.inspectOpts.colors=this.useColors,D.inspect(l,this.inspectOpts)}}(ge,ge.exports)),ge.exports}typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Lu.exports=Fa():Lu.exports=pa();var Uu=Lu.exports,qu={};Object.defineProperty(qu,"__esModule",{value:!0});function ma(e){return function(u,t){return new Promise((D,r)=>{e.call(this,u,t,(o,n)=>{o?r(o):D(n)})})}}qu.default=ma;var UD=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const ha=Dt,Ea=UD(Uu),ga=UD(qu),ye=Ea.default("agent-base");function ya(e){return!!e&&typeof e.addRequest=="function"}function Hu(){const{stack:e}=new Error;return typeof e!="string"?!1:e.split(`
68
+ `).some(u=>u.indexOf("(https.js:")!==-1||u.indexOf("node:https:")!==-1)}function We(e,u){return new We.Agent(e,u)}(function(e){class u extends ha.EventEmitter{constructor(D,r){super();let o=r;typeof D=="function"?this.callback=D:D&&(o=D),this.timeout=null,o&&typeof o.timeout=="number"&&(this.timeout=o.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:Hu()?443:80}set defaultPort(D){this.explicitDefaultPort=D}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:Hu()?"https:":"http:"}set protocol(D){this.explicitProtocol=D}callback(D,r,o){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(D,r){const o=Object.assign({},r);typeof o.secureEndpoint!="boolean"&&(o.secureEndpoint=Hu()),o.host==null&&(o.host="localhost"),o.port==null&&(o.port=o.secureEndpoint?443:80),o.protocol==null&&(o.protocol=o.secureEndpoint?"https:":"http:"),o.host&&o.path&&delete o.path,delete o.agent,delete o.hostname,delete o._defaultAgent,delete o.defaultPort,delete o.createConnection,D._last=!0,D.shouldKeepAlive=!1;let n=!1,i=null;const s=o.timeout||this.timeout,c=F=>{D._hadError||(D.emit("error",F),D._hadError=!0)},f=()=>{i=null,n=!0;const F=new Error(`A "socket" was not created for HTTP request before ${s}ms`);F.code="ETIMEOUT",c(F)},a=F=>{n||(i!==null&&(clearTimeout(i),i=null),c(F))},l=F=>{if(n)return;if(i!=null&&(clearTimeout(i),i=null),ya(F)){ye("Callback returned another Agent instance %o",F.constructor.name),F.addRequest(D,o);return}if(F){F.once("free",()=>{this.freeSocket(F,o)}),D.onSocket(F);return}const C=new Error(`no Duplex stream was returned to agent-base for \`${D.method} ${D.path}\``);c(C)};if(typeof this.callback!="function"){c(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(ye("Converting legacy callback function to promise"),this.promisifiedCallback=ga.default(this.callback)):this.promisifiedCallback=this.callback),typeof s=="number"&&s>0&&(i=setTimeout(f,s)),"port"in o&&typeof o.port!="number"&&(o.port=Number(o.port));try{ye("Resolving socket for %o request: %o",o.protocol,`${D.method} ${D.path}`),Promise.resolve(this.promisifiedCallback(D,o)).then(l,a)}catch(F){Promise.reject(F).catch(a)}}freeSocket(D,r){ye("Freeing socket %o %o",D.constructor.name,r),D.destroy()}destroy(){ye("Destroying agent %o",this.constructor.name)}}e.Agent=u,e.prototype=e.Agent.prototype})(We||(We={}));var Ba=We,Vu={},ba=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vu,"__esModule",{value:!0});const wa=ba(Uu),Be=wa.default("https-proxy-agent:parse-proxy-response");function Aa(e){return new Promise((u,t)=>{let D=0;const r=[];function o(){const a=e.read();a?f(a):e.once("readable",o)}function n(){e.removeListener("end",s),e.removeListener("error",c),e.removeListener("close",i),e.removeListener("readable",o)}function i(a){Be("onclose had error %o",a)}function s(){Be("onend")}function c(a){n(),Be("onerror %o",a),t(a)}function f(a){r.push(a),D+=a.length;const l=Buffer.concat(r,D);if(l.indexOf(`\r
69
69
  \r
70
- `)===-1){ye("have not received end of HTTP headers yet..."),o();return}const C=l.toString("ascii",0,l.indexOf(`\r
71
- `)),d=+C.split(" ")[1];ye("got proxy server response: %o",C),u({statusCode:d,buffered:l})}e.on("error",c),e.on("close",s),e.on("end",i),o()})}Hu.default=ha;var Ea=I&&I.__awaiter||function(e,u,t,D){function r(o){return o instanceof t?o:new t(function(n){n(o)})}return new(t||(t=Promise))(function(o,n){function s(f){try{c(D.next(f))}catch(a){n(a)}}function i(f){try{c(D.throw(f))}catch(a){n(a)}}function c(f){f.done?o(f.value):r(f.value).then(s,i)}c((D=D.apply(e,u||[])).next())})},se=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ju,"__esModule",{value:!0});const GD=se(bn),zD=se(wn),ga=se(vn),ya=se(et),Ba=se(Wu),ba=da,wa=se(Hu),Be=Ba.default("https-proxy-agent:agent");class va extends ba.Agent{constructor(u){let t;if(typeof u=="string"?t=ga.default.parse(u):t=u,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");Be("creating new HttpsProxyAgent instance: %o",t),super(t);const D=Object.assign({},t);this.secureProxy=t.secureProxy||xa(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(u,t){return Ea(this,void 0,void 0,function*(){const{proxy:D,secureProxy:r}=this;let o;r?(Be("Creating `tls.Socket`: %o",D),o=zD.default.connect(D)):(Be("Creating `net.Socket`: %o",D),o=GD.default.connect(D));const n=Object.assign({},D.headers);let i=`CONNECT ${`${t.host}:${t.port}`} HTTP/1.1\r
72
- `;D.auth&&(n["Proxy-Authorization"]=`Basic ${Buffer.from(D.auth).toString("base64")}`);let{host:c,port:f,secureEndpoint:a}=t;$a(f,a)||(c+=`:${f}`),n.Host=c,n.Connection="close";for(const p of Object.keys(n))i+=`${p}: ${n[p]}\r
73
- `;const l=wa.default(o);o.write(`${i}\r
74
- `);const{statusCode:F,buffered:C}=yield l;if(F===200){if(u.once("socket",Aa),t.secureEndpoint){Be("Upgrading socket connection to TLS");const p=t.servername||t.host;return zD.default.connect(Object.assign(Object.assign({},Sa(t,"host","hostname","path","port")),{socket:o,servername:p}))}return o}o.destroy();const d=new GD.default.Socket({writable:!1});return d.readable=!0,u.once("socket",p=>{Be("replaying proxy buffer for failed request"),ya.default(p.listenerCount("data")>0),p.push(C),p.push(null)}),d})}}ju.default=va;function Aa(e){e.resume()}function $a(e,u){return!!(!u&&e===80||u&&e===443)}function xa(e){return typeof e=="string"?/^https:?$/i.test(e):!1}function Sa(e,...u){const t={};let D;for(D in e)u.includes(D)||(t[D]=e[D]);return t}var Ta=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const Vu=Ta(ju);function Ku(e){return new Vu.default(e)}(function(e){e.HttpsProxyAgent=Vu.default,e.prototype=Vu.default.prototype})(Ku||(Ku={}));var Oa=Ku,Pa=ee(Oa);const We={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 improves code structure without changing functionality (renaming, restructuring classes/methods, extracting functions, etc)",perf:"A code change focused only on performance improvements, with no functional behavior fix and no structural refactor as the primary purpose",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 that corrects incorrect behavior, crashes, exceptions, regressions, or other defects"},WD={"":"<commit message>",conventional:"<type>[optional (<scope>)]: <commit message>"},UD=e=>{if(!e)return We;try{const u=JSON.parse(e);if(!u||typeof u!="object"||Array.isArray(u))return We;const t=Object.entries(u).map(([D,r])=>[D.trim(),String(r).trim()]).filter(([D,r])=>D.length>0&&r.length>0);return t.length===0?We:Object.fromEntries(t)}catch{return We}},qD=(e,u,t=!1)=>e==="conventional"?!t&&!u?.trim()?"<type>: <commit message>":u?.trim()||WD.conventional:WD[e],Ia=(e,u,t,D)=>D?`The commit title line must be in format:
75
- ${qD(e,u,t)}`:`The output response must be in format:
76
- ${qD(e,u,t)}`,ka=(e,u,t)=>{if(e==="conventional"){const D=t?.trim();return D?[`Selected conventional type (locked): ${D}`,"Use this exact type in the title prefix. Do not change it.","The title and body details must stay semantically consistent with this selected type."].join(`
77
- `):["Choose a type from the type-to-description JSON below that best describes the git diff:",JSON.stringify(UD(u),null,2),"Select the type directly from the diff intent. Do not run or describe any scoring process.","Type rules:","- fix: use only for explicit bug/defect correction evidence (wrong behavior, crash, exception, regression, data corruption).","- perf: use only when the primary purpose is performance improvement.","- refactor: use for structural/API/concurrency-flow changes without explicit bug-fix evidence.","- If uncertain between fix/perf and refactor, choose refactor.","The selected type must stay semantically consistent with both title and body.","Do not output any type-selection reasoning."].join(`
78
- `)}return""},Ma=(e,u)=>e?u==="list"?["Provide both a title and a body.","Output format must be exactly:","<title>","","<body>","The body must be 3-6 concise bullet points.",'Each bullet must start with "- ".','Do not use section labels like "Impact:", "Changes:", "Summary:", or markdown headings.',"Each bullet should describe one concrete code-path change with real symbols from the diff."].join(`
79
- `):["Provide both a title and a body.","Output format must be exactly:","<title>","","<body>","The body should be 3-6 concise technical prose sentences in one paragraph, not bullet points.",'Do not use section labels like "Impact:", "Changes:", "Summary:", or markdown headings.',"Describe concrete code-path changes with real symbols from the diff (classes, methods, APIs, actor/threading/cancellation/error-flow changes).","Prefer before/after wording for key behavior changes instead of generic claims."].join(`
80
- `):"Provide only the title, no description or body.",Ra=()=>["Use GitHub Copilot style.","Keep wording concise, technical, and neutral.","Use specific subsystem, class, API, and type names from the diff.","Prefer an imperative, action-led title (for example: Use..., Convert..., Refactor..., Simplify...).","Prioritize concrete change actions and concurrency/correctness context over generic phrasing.",'Avoid generic wording like "optimize logic" unless the concrete optimization is explicitly described.'].join(`
81
- `),ja=e=>e?.trim()?`Additional instructions from user:
82
- ${e.trim()}`:"",_a=e=>[`Message language: ${e}`,"You must write the commit message strictly in this language."].join(`
83
- `),La=e=>{if(!e||e.length===0)return"";const u=e.map(r=>r.trim()).filter(Boolean);if(u.length===0)return"";const t=u.slice(0,12),D=u.length-t.length;return["Changed files:",...t.map(r=>`- ${r}`),...D>0?[`- ...and ${D} more file(s)`]:[]].join(`
84
- `)},Na=(e,u)=>{if(e==="conventional"){const t=["Title anchor requirement:","- The commit title must mention at least one concrete anchor from the diff (file, class/type, module, or subsystem).","- Prefer class/type/module/subsystem names over raw file paths when possible.","- Avoid titles that only mention function names without file/class context."];return u?t.push("- For conventional commits, include scope using the primary file/class/module when possible (for example: refactor(RecentScrollshotController): ...).","- Only omit scope when there is no clear dominant anchor."):t.push("- Do not include scope in conventional titles.",'- Use "<type>: <subject>" format instead of "<type>(<scope>): <subject>".'),t.join(`
70
+ `)===-1){Be("have not received end of HTTP headers yet..."),o();return}const C=l.toString("ascii",0,l.indexOf(`\r
71
+ `)),p=+C.split(" ")[1];Be("got proxy server response: %o",C),u({statusCode:p,buffered:l})}e.on("error",c),e.on("close",i),e.on("end",s),o()})}Vu.default=Aa;var va=I&&I.__awaiter||function(e,u,t,D){function r(o){return o instanceof t?o:new t(function(n){n(o)})}return new(t||(t=Promise))(function(o,n){function i(f){try{c(D.next(f))}catch(a){n(a)}}function s(f){try{c(D.throw(f))}catch(a){n(a)}}function c(f){f.done?o(f.value):r(f.value).then(i,s)}c((D=D.apply(e,u||[])).next())})},se=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_u,"__esModule",{value:!0});const qD=se(An),HD=se(vn),$a=se($n),xa=se(tt),Sa=se(Uu),Ta=Ba,Oa=se(Vu),be=Sa.default("https-proxy-agent:agent");class Pa extends Ta.Agent{constructor(u){let t;if(typeof u=="string"?t=$a.default.parse(u):t=u,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");be("creating new HttpsProxyAgent instance: %o",t),super(t);const D=Object.assign({},t);this.secureProxy=t.secureProxy||Ma(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(u,t){return va(this,void 0,void 0,function*(){const{proxy:D,secureProxy:r}=this;let o;r?(be("Creating `tls.Socket`: %o",D),o=HD.default.connect(D)):(be("Creating `net.Socket`: %o",D),o=qD.default.connect(D));const n=Object.assign({},D.headers);let s=`CONNECT ${`${t.host}:${t.port}`} HTTP/1.1\r
72
+ `;D.auth&&(n["Proxy-Authorization"]=`Basic ${Buffer.from(D.auth).toString("base64")}`);let{host:c,port:f,secureEndpoint:a}=t;ka(f,a)||(c+=`:${f}`),n.Host=c,n.Connection="close";for(const d of Object.keys(n))s+=`${d}: ${n[d]}\r
73
+ `;const l=Oa.default(o);o.write(`${s}\r
74
+ `);const{statusCode:F,buffered:C}=yield l;if(F===200){if(u.once("socket",Ia),t.secureEndpoint){be("Upgrading socket connection to TLS");const d=t.servername||t.host;return HD.default.connect(Object.assign(Object.assign({},Ra(t,"host","hostname","path","port")),{socket:o,servername:d}))}return o}o.destroy();const p=new qD.default.Socket({writable:!1});return p.readable=!0,u.once("socket",d=>{be("replaying proxy buffer for failed request"),xa.default(d.listenerCount("data")>0),d.push(C),d.push(null)}),p})}}_u.default=Pa;function Ia(e){e.resume()}function ka(e,u){return!!(!u&&e===80||u&&e===443)}function Ma(e){return typeof e=="string"?/^https:?$/i.test(e):!1}function Ra(e,...u){const t={};let D;for(D in e)u.includes(D)||(t[D]=e[D]);return t}var ja=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const Ku=ja(_u);function Ju(e){return new Ku.default(e)}(function(e){e.HttpsProxyAgent=Ku.default,e.prototype=Ku.default.prototype})(Ju||(Ju={}));var _a=Ju,La=ue(_a);const Ue={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 improves code structure without changing functionality (renaming, restructuring classes/methods, extracting functions, etc)",perf:"A code change focused only on performance improvements, with no functional behavior fix and no structural refactor as the primary purpose",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 that corrects incorrect behavior, crashes, exceptions, regressions, or other defects"},VD={"":"<commit message>",conventional:"<type>[optional (<scope>)]: <commit message>"},KD=e=>{if(!e)return Ue;try{const u=JSON.parse(e);if(!u||typeof u!="object"||Array.isArray(u))return Ue;const t=Object.entries(u).map(([D,r])=>[D.trim(),String(r).trim()]).filter(([D,r])=>D.length>0&&r.length>0);return t.length===0?Ue:Object.fromEntries(t)}catch{return Ue}},JD=(e,u,t=!1)=>e==="conventional"?!t&&!u?.trim()?"<type>: <commit message>":u?.trim()||VD.conventional:VD[e],Na=(e,u,t,D)=>D?`The commit title line must be in format:
75
+ ${JD(e,u,t)}`:`The output response must be in format:
76
+ ${JD(e,u,t)}`,Ga=(e,u,t)=>{if(e==="conventional"){const D=t?.trim();return D?[`Selected conventional type (locked): ${D}`,"Use this exact type in the title prefix. Do not change it.","The title and body details must stay semantically consistent with this selected type."].join(`
77
+ `):["Choose a type from the type-to-description JSON below that best describes the git diff:",JSON.stringify(KD(u),null,2),"Select the type directly from the diff intent. Do not run or describe any scoring process.","Type rules:","- fix: use only for explicit bug/defect correction evidence (wrong behavior, crash, exception, regression, data corruption).","- perf: use only when the primary purpose is performance improvement.","- refactor: use for structural/API/concurrency-flow changes without explicit bug-fix evidence.","- If uncertain between fix/perf and refactor, choose refactor.","The selected type must stay semantically consistent with both title and body.","Do not output any type-selection reasoning."].join(`
78
+ `)}return""},za=(e,u)=>e?u==="list"?["When details are enabled, first decide whether the title alone already clearly explains what changed.","If the title is already sufficient, output only the title.","Do not add any explanation for omitting the body.","If the title is not sufficient, output format must be exactly:","<title>","","<body>","The body must be 3-6 concise bullet points.",'Each bullet must start with "- ".','Do not use section labels like "Impact:", "Changes:", "Summary:", or markdown headings.',"Each bullet should describe one concrete code-path change with real symbols from the diff."].join(`
79
+ `):["When details are enabled, first decide whether the title alone already clearly explains what changed.","If the title is already sufficient, output only the title.","Do not add any explanation for omitting the body.","If the title is not sufficient, output format must be exactly:","<title>","","<body>","The body should be 3-6 concise technical prose sentences in one paragraph, not bullet points.",'Do not use section labels like "Impact:", "Changes:", "Summary:", or markdown headings.',"Describe concrete code-path changes with real symbols from the diff (classes, methods, APIs, actor/threading/cancellation/error-flow changes).","Prefer before/after wording for key behavior changes instead of generic claims."].join(`
80
+ `):"Provide only the title, no description or body.",Wa=()=>["Use GitHub Copilot style.","Keep wording concise, technical, and neutral.","Use specific subsystem, class, API, and type names from the diff.","Prefer an imperative, action-led title (for example: Use..., Convert..., Refactor..., Simplify...).","Prioritize concrete change actions and concurrency/correctness context over generic phrasing.",'Avoid generic wording like "optimize logic" unless the concrete optimization is explicitly described.'].join(`
81
+ `),Ua=e=>e?.trim()?`Additional instructions from user:
82
+ ${e.trim()}`:"",qa=e=>[`Message language: ${e}`,"You must write the commit message strictly in this language."].join(`
83
+ `),Ha=e=>{if(!e||e.length===0)return"";const u=e.map(r=>r.trim()).filter(Boolean);if(u.length===0)return"";const t=u.slice(0,12),D=u.length-t.length;return["Changed files:",...t.map(r=>`- ${r}`),...D>0?[`- ...and ${D} more file(s)`]:[]].join(`
84
+ `)},Va=(e,u)=>{if(e==="conventional"){const t=["Title anchor requirement:","- The commit title must mention at least one concrete anchor from the diff (file, class/type, module, or subsystem).","- Prefer class/type/module/subsystem names over raw file paths when possible.","- Avoid titles that only mention function names without file/class context."];return u?t.push("- For conventional commits, include scope using the primary file/class/module when possible (for example: refactor(RecentScrollshotController): ...).","- Only omit scope when there is no clear dominant anchor."):t.push("- Do not include scope in conventional titles.",'- Use "<type>: <subject>" format instead of "<type>(<scope>): <subject>".'),t.join(`
85
85
  `)}return["Title anchor requirement:","- The commit title must mention at least one concrete anchor from the diff (file, class/type, module, or subsystem).","- Prefer class/type/module/subsystem names over raw file paths when possible.","- Avoid titles that only mention function names without file/class context."].join(`
86
- `)},Ga=(e,u)=>e!=="conventional"?"":["Conventional title subject rules:",`- The subject text after ${u?'"<type>(<scope>): "':'"<type>: "'} must not start with the same type word.`,'- Example to avoid: "refactor: refactor ...".','- The selected prefix must stay semantically consistent with the subject action; never output titles like "feat: refactor ..." or "fix: refactor ...".',"- For alphabetic languages (for example English), capitalize the first word in the subject.","- Run a final self-check before output: if subject starts with the selected type word, rewrite the subject."].join(`
87
- `),za=(e,u,t,D={})=>{const r=D.includeDetails??!1,o=D.detailsStyle??"paragraph",n=D.conventionalScope??!1;return["Generate a concise git commit message in present tense that precisely describes the key changes in the following code diff. Focus on what was changed, not just file names.",Ma(r,o),_a(e),`Commit title must be a maximum of ${u} characters.`,"Exclude anything unnecessary such as translation. Your entire response will be passed directly into git commit.",`IMPORTANT: Do not include any explanations, introductions, or additional text. Do not wrap the commit message in quotes or any other formatting. The commit title must not exceed ${u} characters. Respond with ONLY the commit message text.`,"Be specific: include concrete details (package names, versions, functionality) rather than generic statements.",La(D.changedFiles),Na(t,n),Ga(t,n),ka(t,D.conventionalTypes,D.lockedConventionalType),Ia(t,D.conventionalFormat,n,r),Ra(),ja(D.instructions)].filter(Boolean).join(`
88
- `)},Wa=async(e,u,t,D,r,o,n,s)=>new Promise((i,c)=>{const f=JSON.stringify(D),a={port:n??443,hostname:e,path:u,method:"POST",headers:{...t,"Content-Type":"application/json","Content-Length":Buffer.byteLength(f)},timeout:r,agent:o?Pa(o):void 0},l=Bn.request(a,F=>{const C=[];F.on("data",d=>{C.push(d),s?.(d.toString())}),F.on("end",()=>{i({request:l,response:F,data:Buffer.concat(C).toString()})})});l.on("error",c),l.on("timeout",()=>{l.destroy(),c(new B(`Time out error: request took over ${r}ms. Try increasing the \`timeout\` config, or checking your API provider status.`))}),l.write(f),l.end()}),Ua=e=>{if(!e?.trim())throw new B("Please set your API base URL via `aicommits config set base-url=<https://...>`");const u=e.trim(),t=new URL(u),D=t.pathname.replace(/\/+$/,"");return{hostname:t.hostname,port:t.port?Number(t.port):443,path:`${D}/chat/completions`}},HD=async(e,u,t,D,r,o)=>{const n={...u,stream:!0};let s="";const i=m=>{if(!o)return;const b=Array.isArray(m.choices)?m.choices:[];for(const y of b){if(typeof y!="object"||y===null)continue;const{delta:O}=y;if(typeof O!="object"||O===null)continue;const v=O,P=typeof v.reasoning_content=="string"?v.reasoning_content:typeof v.reasoning=="string"?v.reasoning:"";P&&o({kind:"reasoning",text:P}),typeof v.content=="string"&&v.content.length>0&&o({kind:"content",text:v.content})}},c=m=>{if(!o)return;s+=m.replace(/\r\n/g,`
89
- `);let b=s.indexOf(`
86
+ `)},Ka=(e,u)=>e!=="conventional"?"":["Conventional title subject rules:",`- The subject text after ${u?'"<type>(<scope>): "':'"<type>: "'} must not start with the same type word.`,'- Example to avoid: "refactor: refactor ...".','- The selected prefix must stay semantically consistent with the subject action; never output titles like "feat: refactor ..." or "fix: refactor ...".',"- For alphabetic languages (for example English), capitalize the first word in the subject.","- Run a final self-check before output: if subject starts with the selected type word, rewrite the subject."].join(`
87
+ `),Ja=(e,u,t,D={})=>{const r=D.includeDetails??!1,o=D.detailsStyle??"paragraph",n=D.conventionalScope??!1;return["Generate a concise git commit message in present tense that precisely describes the key changes in the following code diff. Focus on what was changed, not just file names.",za(r,o),qa(e),`Commit title must be a maximum of ${u} characters.`,"Exclude anything unnecessary such as translation. Your entire response will be passed directly into git commit.",`IMPORTANT: Do not include any explanations, introductions, or additional text. Do not wrap the commit message in quotes or any other formatting. The commit title must not exceed ${u} characters. Respond with ONLY the commit message text.`,"Be specific: include concrete details (package names, versions, functionality) rather than generic statements.",Ha(D.changedFiles),Va(t,n),Ka(t,n),Ga(t,D.conventionalTypes,D.lockedConventionalType),Na(t,D.conventionalFormat,n,r),Wa(),Ua(D.instructions)].filter(Boolean).join(`
88
+ `)},Ya=async(e,u,t,D,r,o,n,i)=>new Promise((s,c)=>{const f=JSON.stringify(D),a={port:n??443,hostname:e,path:u,method:"POST",headers:{...t,"Content-Type":"application/json","Content-Length":Buffer.byteLength(f)},timeout:r,agent:o?La(o):void 0},l=wn.request(a,F=>{const C=[];F.on("data",p=>{C.push(p),i?.(p.toString())}),F.on("end",()=>{s({request:l,response:F,data:Buffer.concat(C).toString()})})});l.on("error",c),l.on("timeout",()=>{l.destroy(),c(new g(`Time out error: request took over ${r}ms. Try increasing the \`timeout\` config, or checking your API provider status.`))}),l.write(f),l.end()}),Za=e=>{if(!e?.trim())throw new g("Please set your API base URL via `aicommits config set base-url=<https://...>`");const u=e.trim(),t=new URL(u),D=t.pathname.replace(/\/+$/,"");return{hostname:t.hostname,port:t.port?Number(t.port):443,path:`${D}/chat/completions`}},YD=async(e,u,t,D,r,o)=>{const n={...u,stream:!0};let i="";const s=m=>{if(!o)return;const b=Array.isArray(m.choices)?m.choices:[];for(const B of b){if(typeof B!="object"||B===null)continue;const{delta:O}=B;if(typeof O!="object"||O===null)continue;const w=O,P=typeof w.reasoning_content=="string"?w.reasoning_content:typeof w.reasoning=="string"?w.reasoning:"";P&&o({kind:"reasoning",text:P}),typeof w.content=="string"&&w.content.length>0&&o({kind:"content",text:w.content})}},c=m=>{if(!o)return;i+=m.replace(/\r\n/g,`
89
+ `);let b=i.indexOf(`
90
90
 
91
- `);for(;b!==-1;){const y=s.slice(0,b);s=s.slice(b+2);for(const O of y.split(`
92
- `)){const v=O.trim();if(!v.startsWith("data:"))continue;const P=v.slice(5).trim();if(!(!P||P==="[DONE]"))try{const L=JSON.parse(P);i(L)}catch{}}b=s.indexOf(`
91
+ `);for(;b!==-1;){const B=i.slice(0,b);i=i.slice(b+2);for(const O of B.split(`
92
+ `)){const w=O.trim();if(!w.startsWith("data:"))continue;const P=w.slice(5).trim();if(!(!P||P==="[DONE]"))try{const L=JSON.parse(P);s(L)}catch{}}b=i.indexOf(`
93
93
 
94
- `)}},f=Ua(r),{response:a,data:l}=await Wa(f.hostname,f.path,{Authorization:`Bearer ${e}`},n,t,D,f.port,c);if(!a.statusCode||a.statusCode<200||a.statusCode>299){let m=`API Error: ${a.statusCode} - ${a.statusMessage}`;throw l&&(m+=`
94
+ `)}},f=Za(r),{response:a,data:l}=await Ya(f.hostname,f.path,{Authorization:`Bearer ${e}`},n,t,D,f.port,c);if(!a.statusCode||a.statusCode<200||a.statusCode>299){let m=`API Error: ${a.statusCode} - ${a.statusMessage}`;throw l&&(m+=`
95
95
 
96
- ${l}`),new B(m)}const F=l.trim();if(!F)throw new B("API Error: Empty response body");if(F.startsWith("{"))return JSON.parse(F);const C=[];for(const m of F.split(/\r?\n/)){const b=m.trim();if(!b.startsWith("data:"))continue;const y=b.slice(5).trim();if(!(!y||y==="[DONE]"))try{C.push(JSON.parse(y))}catch{}}if(C.length===0)throw new B("API Error: Unable to parse streamed response");const d=C.find(m=>typeof m.error=="object"&&m.error!==null);if(d?.error&&typeof d.error=="object"&&d.error!==null){const m="message"in d.error&&typeof d.error.message=="string"?d.error.message:JSON.stringify(d.error);throw new B(`API Error: ${m}`)}const p=C.find(m=>typeof m.id=="string")||C[0],h=new Map;for(const m of C){const b=Array.isArray(m.choices)?m.choices:[];for(const y of b){if(typeof y!="object"||y===null)continue;const O=y,v=typeof O.index=="number"?O.index:0,P=h.get(v)||{index:v,contentParts:[],reasoningParts:[]},{delta:L}=O;if(typeof L=="object"&&L!==null){const M=L;typeof M.role=="string"&&(P.role=M.role),typeof M.content=="string"&&P.contentParts.push(M.content),typeof M.reasoning_content=="string"&&P.reasoningParts.push(M.reasoning_content),typeof M.reasoning=="string"&&P.reasoningParts.push(M.reasoning)}const j=O.finish_reason;(typeof j=="string"||j===null)&&(P.finishReason=j),h.set(v,P)}}const g=Array.from(h.values()).sort((m,b)=>m.index-b.index).map(m=>{const b={role:m.role||"assistant",content:m.contentParts.join("")},y=m.reasoningParts.join("");return y&&(b.reasoning_content=y),{index:m.index,finish_reason:m.finishReason??"stop",message:b}});if(g.length===0)throw new B("API Error: Streamed response did not include any choices");return{id:typeof p.id=="string"?p.id:"",object:"chat.completion",created:typeof p.created=="number"?p.created:Math.floor(Date.now()/1e3),model:typeof p.model=="string"?p.model:"",choices:g,usage:void 0}},VD=(e,u)=>({model:e,messages:u}),qa=e=>e.replace(/\r\n?/g,`
97
- `),KD=e=>{const u=e.match(/```[\w-]*\n([\s\S]*?)```/);return u?.[1]?u[1].trim():e.replace(/```/g,"").trim()},JD=e=>e.trim().replace(/^title:\s*/i,"").replace(/(\w)\.$/,"$1").replace(/^["'`]|["'`]$/g,""),Ha=e=>e.replace(/^\s*(body|description|details)\s*:\s*/i,"").replace(/^\s*(主要改动包括|主要改动|改动包括)\s*[::]\s*/,"").replace(/^\s*(impact|影响)\s*[::]\s*/i,""),Va=e=>e.split(/(?<=[。!?.!?])\s+/u).map(u=>u.trim()).filter(Boolean),YD=/^(?:[-*•]+|\d+[.)])\s*/u,Ka=/^[\s\-–—_*•.,;:!?()[\]{}"'`]+$/u,Ja=e=>{let u=e.trim();if(!u)return"";for(;YD.test(u);){const t=u.replace(YD,"").trim();if(!t||t===u)break;u=t}return!u||Ka.test(u)?"":u},Ya=e=>{const u=e.trim();if(!u)return;if(u.startsWith("- ")||u.startsWith("* ")||u.startsWith("\u2022 "))return u.slice(2).trim()||void 0;const t=/^\d+[.)]\s+/.exec(u);if(t?.[0])return u.slice(t[0].length).trim()||void 0},Za=e=>{if(!e.trim())return{paragraph:"",listItems:[]};const u=e.split(`
98
- `).map(n=>Ha(n.trim())).filter(Boolean);if(u.length===0)return{paragraph:"",listItems:[]};const t=[],D=[];for(const n of u){const s=Ya(n);s?t.push(s):(D.push(n.trim()),t.push(...Va(n)))}const r=[...D,...t].join(" ").replace(/\s{2,}/g," ").replace(/\s+([,.;:!?])/g,"$1").trim(),o=Array.from(new Set(t.map(Ja).filter(Boolean)));return{paragraph:r,listItems:o}},be=e=>{const u=qa(e).trim();if(!u)return{title:"",body:""};const t=u.split(`
99
- `).map(o=>o.replace(/\s+$/g,""));for(;t[0]?.trim()==="";)t.shift();const D=JD(t.shift()||"");for(;t[0]?.trim()==="";)t.shift();t[0]?.trim().toLowerCase().startsWith("body:")&&(t[0]=t[0].replace(/^body:\s*/i,""));const r=t.join(`
100
- `).trim();return{title:D,body:r}},we=(e,u)=>u?`${e}
96
+ ${l}`),new g(m)}const F=l.trim();if(!F)throw new g("API Error: Empty response body");if(F.startsWith("{"))return JSON.parse(F);const C=[];for(const m of F.split(/\r?\n/)){const b=m.trim();if(!b.startsWith("data:"))continue;const B=b.slice(5).trim();if(!(!B||B==="[DONE]"))try{C.push(JSON.parse(B))}catch{}}if(C.length===0)throw new g("API Error: Unable to parse streamed response");const p=C.find(m=>typeof m.error=="object"&&m.error!==null);if(p?.error&&typeof p.error=="object"&&p.error!==null){const m="message"in p.error&&typeof p.error.message=="string"?p.error.message:JSON.stringify(p.error);throw new g(`API Error: ${m}`)}const d=C.find(m=>typeof m.id=="string")||C[0],h=new Map;for(const m of C){const b=Array.isArray(m.choices)?m.choices:[];for(const B of b){if(typeof B!="object"||B===null)continue;const O=B,w=typeof O.index=="number"?O.index:0,P=h.get(w)||{index:w,contentParts:[],reasoningParts:[]},{delta:L}=O;if(typeof L=="object"&&L!==null){const k=L;typeof k.role=="string"&&(P.role=k.role),typeof k.content=="string"&&P.contentParts.push(k.content),typeof k.reasoning_content=="string"&&P.reasoningParts.push(k.reasoning_content),typeof k.reasoning=="string"&&P.reasoningParts.push(k.reasoning)}const U=O.finish_reason;(typeof U=="string"||U===null)&&(P.finishReason=U),h.set(w,P)}}const y=Array.from(h.values()).sort((m,b)=>m.index-b.index).map(m=>{const b={role:m.role||"assistant",content:m.contentParts.join("")},B=m.reasoningParts.join("");return B&&(b.reasoning_content=B),{index:m.index,finish_reason:m.finishReason??"stop",message:b}});if(y.length===0)throw new g("API Error: Streamed response did not include any choices");return{id:typeof d.id=="string"?d.id:"",object:"chat.completion",created:typeof d.created=="number"?d.created:Math.floor(Date.now()/1e3),model:typeof d.model=="string"?d.model:"",choices:y,usage:void 0}},ZD=(e,u)=>({model:e,messages:u}),Xa=e=>e.replace(/\r\n?/g,`
97
+ `),XD=e=>{const u=e.match(/```[\w-]*\n([\s\S]*?)```/);return u?.[1]?u[1].trim():e.replace(/```/g,"").trim()},QD=e=>e.trim().replace(/^title:\s*/i,"").replace(/(\w)\.$/,"$1").replace(/^["'`]|["'`]$/g,""),Qa=e=>e.replace(/^\s*(body|description|details)\s*:\s*/i,"").replace(/^\s*(主要改动包括|主要改动|改动包括)\s*[::]\s*/,"").replace(/^\s*(impact|影响)\s*[::]\s*/i,""),ec=e=>e.split(/(?<=[。!?.!?])\s+/u).map(u=>u.trim()).filter(Boolean),en=/^(?:[-*•]+|\d+[.)])\s*/u,uc=/^[\s\-–—_*•.,;:!?()[\]{}"'`]+$/u,tc=e=>{let u=e.trim();if(!u)return"";for(;en.test(u);){const t=u.replace(en,"").trim();if(!t||t===u)break;u=t}return!u||uc.test(u)?"":u},Dc=e=>{const u=e.trim();if(!u)return;if(u.startsWith("- ")||u.startsWith("* ")||u.startsWith("\u2022 "))return u.slice(2).trim()||void 0;const t=/^\d+[.)]\s+/.exec(u);if(t?.[0])return u.slice(t[0].length).trim()||void 0},nc=e=>{if(!e.trim())return{paragraph:"",listItems:[]};const u=e.split(`
98
+ `).map(n=>Qa(n.trim())).filter(Boolean);if(u.length===0)return{paragraph:"",listItems:[]};const t=[],D=[];for(const n of u){const i=Dc(n);i?t.push(i):(D.push(n.trim()),t.push(...ec(n)))}const r=[...D,...t].join(" ").replace(/\s{2,}/g," ").replace(/\s+([,.;:!?])/g,"$1").trim(),o=Array.from(new Set(t.map(tc).filter(Boolean)));return{paragraph:r,listItems:o}},we=e=>{const u=Xa(e).trim();if(!u)return{title:"",body:""};const t=u.split(`
99
+ `).map(o=>o.replace(/\s+$/g,""));for(;t[0]?.trim()==="";)t.shift();const D=QD(t.shift()||"");for(;t[0]?.trim()==="";)t.shift();t[0]?.trim().toLowerCase().startsWith("body:")&&(t[0]=t[0].replace(/^body:\s*/i,""));const r=t.join(`
100
+ `).trim();return{title:D,body:r}},Ae=(e,u)=>u?`${e}
101
101
 
102
- ${u}`:e,ZD=e=>JD(KD(e).trim().split(`
103
- `)[0]||""),Xa=(e,u)=>{const t=KD(e),{title:D,body:r}=be(t),o=Za(r);if(u==="list"){const n=o.listItems.slice(0,6).map(s=>`- ${s}`).join(`
104
- `);return we(D,n)}return we(D,o.paragraph)},Qa=(e,u,t)=>u?Xa(e,t):ZD(e),X=e=>e.trim().toLowerCase(),ec=e=>Array.from(new Set(e)),uc=/[\u3400-\u9FFF]/,XD=/^([a-z]+(?:\([^)]+\))?: )(.+)$/i,QD=/^([a-z]+)(\([^)]+\))?: (.+)$/i,tc=/^([a-z]+)(?:\s+|[:-])/i,Dc={feature:"feat",features:"feat",bug:"fix",bugfix:"fix",performance:"perf"},nc=e=>{const u=e.trim().toLowerCase();return u==="cn"||u.startsWith("zh")},en=e=>{const u=e.match(XD);return u?{prefix:u[1],subject:(u[2]||"").trim()}:{prefix:"",subject:e.trim()}},rc=e=>{const u=new Map,t=UD(e);for(const D of Object.keys(t))u.set(X(D),D);for(const[D,r]of Object.entries(Dc)){if(u.has(X(D)))continue;const o=u.get(X(r));o&&u.set(X(D),o)}return u},Ju=(e,u)=>u.get(X(e)),oc=(e,u)=>{const t=e.trim().match(tc);if(t?.[1])return Ju(t[1],u)},sc=(e,u,t)=>{const D=e.trim(),r=D.match(/^([a-z]+)(?:\s+|[:-])/i);if(!r?.[1])return e;const o=D.slice(r[0].length).trim();if(!o)return e;const n=Ju(r[1],t);return!n||X(n)!==X(u)?e:o||e},ic=(e,u)=>{const t=e.match(QD);if(!t)return e;const[,D,r="",o=""]=t,n=o.trim();if(!n)return e;const s=Ju(D,u)||D.toLowerCase(),c=oc(n,u)||s,f=sc(n,c,u);return`${c}${r}: ${f||n}`},ac=(e,u,t)=>{const{title:D,body:r}=u?be(e):{title:e.trim(),body:""},o=ic(D,t);return u?we(o,r):o},cc=(e,u)=>{const{title:t,body:D}=u?be(e):{title:e.trim(),body:""},r=t.match(QD);if(!r)return e;const[,o="",,n=""]=r,s=o.trim().toLowerCase(),i=n.trim();if(!s||!i)return e;const c=`${s}: ${i}`;return u?we(c,D):c},lc=/^[a-z]+\([^)\s][^)]*\):\s*\S/i,fc=(e,u)=>u?be(e).title:e.trim(),Fc=e=>e?.trim()?/<\s*scope\s*>/i.test(e):!0,un=(e,u)=>lc.test(fc(e,u)),Cc=(e,u)=>{if(!nc(u))return!1;const{subject:t}=en(e);return t.length===0?!1:!uc.test(t)},dc=async(e,u,t,D,r,o,n,s,i)=>{const{prefix:c,subject:f}=en(D),a=VD(u,[{role:"system",content:[`Rewrite ONLY this commit title into locale "${t}".`,"Keep technical meaning unchanged and keep wording concise.",`Maximum title length: ${r} characters.`,"Return only the rewritten title text. No quotes, no code fences, no explanations.",...c?[`Preserve this conventional prefix exactly: "${c}" and rewrite only the subject part.`]:[]].join(`
105
- `)},{role:"user",content:D}]),F=(await HD(e,a,o,n,s,i)).choices.map(p=>p.message?.content).find(p=>typeof p=="string");if(!F)return D;const C=ZD(F);if(!C)return D;if(!c)return C;const d=C.replace(XD,"$2").trim();return`${c}${d||f}`},pc=async(e,u,t,D,r,o,n,s,i,c)=>{const{title:f,body:a}=r?be(D):{title:D.trim(),body:""};if(!Cc(f,t))return D;try{const l=await dc(e,u,t,f,o,n,s,i,c);return r?we(l,a):l}catch{return D}},tn=async(e,u,t,D,r,o,n,s,i,c,f)=>{const a=c??{},l=a.includeDetails??!1,F=a.detailsStyle??"paragraph",C=rc(a.conventionalTypes),d=n==="conventional"&&(a.conventionalScope??!1)&&Fc(a.conventionalFormat),p=async(h,g=!0)=>{const m=[g?a.instructions?.trim():"",h?.trim()].filter(Boolean).join(`
106
- `),b={includeDetails:a.includeDetails,detailsStyle:a.detailsStyle,instructions:m,conventionalFormat:a.conventionalFormat,conventionalTypes:a.conventionalTypes,conventionalScope:a.conventionalScope,changedFiles:a.changedFiles},y=[{role:"system",content:za(t,o,n,b)},{role:"user",content:D}],O=Math.max(1,r),P=(await Promise.all(Array.from({length:O},()=>HD(e,VD(u,y),s,i,f,w=>a.onStreamEvent?.({phase:"message",...w}))))).flatMap(w=>w.choices).flatMap(w=>{const V=w.message?.content;return typeof V!="string"?[]:[Qa(V,l,F)]}).filter(Boolean),L=await Promise.all(P.map(w=>pc(e,u,t,w,l,o,s,i,f,V=>a.onStreamEvent?.({phase:"title-rewrite",...V})))),j=n==="conventional"?L.map(w=>ac(w,l,C)):L,M=n==="conventional"&&a.conventionalScope===!1?j.map(w=>cc(w,l)):j;return ec(M.filter(Boolean))};try{const h=await p();if(!d)return h;const g=h.filter(y=>un(y,l));if(g.length>0)return g;const m=await p(['Hard requirement for this run: use conventional title with non-empty scope exactly in "<type>(<scope>): <subject>" format.',"Do not omit scope. Pick the strongest file/class/module anchor as scope."].join(`
107
- `),!1),b=m.filter(y=>un(y,l));return b.length>0?b:m}catch(h){const g=h;throw g.code==="ENOTFOUND"?new B(`Error connecting to ${g.hostname} (${g.syscall}). Are you connected to the internet?`):g}},Dn=()=>{const e=["|","/","-","\\"],u=process.stdout.isTTY?120:1e4;let t=0,D="",r=!1,o;const n=ui("\u2502"),s=c=>{if(!process.stdout.isTTY){process.stdout.write(`${c}
108
- `);return}process.stdout.write(`\r\x1B[2K${c}`)},i=()=>{const c=e[t];s(`${ei("\u25C6")} ${c} ${D}`),t=(t+1)%e.length};return{start(c){if(D=c,r){i();return}if(r=!0,process.stdout.isTTY){process.stdout.write(`${n}
109
- `),i(),o=setInterval(i,u);return}s(D)},update(c){D=c,!(!r||!process.stdout.isTTY)&&i()},stop(c){if(r){if(r=!1,o&&(clearInterval(o),o=void 0),process.stdout.isTTY){const f=c.split(/\r?\n/),a=f.shift()??"";process.stdout.write(`\r\x1B[2K${Re("\u25C6")} ${a}
102
+ ${u}`:e,un=e=>QD(XD(e).trim().split(`
103
+ `)[0]||""),rc=(e,u)=>{const t=XD(e),{title:D,body:r}=we(t),o=nc(r);if(u==="list"){const n=o.listItems.slice(0,6).map(i=>`- ${i}`).join(`
104
+ `);return Ae(D,n)}return Ae(D,o.paragraph)},oc=(e,u,t)=>u?rc(e,t):un(e),X=e=>e.trim().toLowerCase(),ic=e=>Array.from(new Set(e)),sc=/[\u3400-\u9FFF]/,tn=/^([a-z]+(?:\([^)]+\))?: )(.+)$/i,Dn=/^([a-z]+)(\([^)]+\))?: (.+)$/i,ac=/^([a-z]+)(?:\s+|[:-])/i,cc={feature:"feat",features:"feat",bug:"fix",bugfix:"fix",performance:"perf"},lc=e=>{const u=e.trim().toLowerCase();return u==="cn"||u.startsWith("zh")},nn=e=>{const u=e.match(tn);return u?{prefix:u[1],subject:(u[2]||"").trim()}:{prefix:"",subject:e.trim()}},fc=e=>{const u=new Map,t=KD(e);for(const D of Object.keys(t))u.set(X(D),D);for(const[D,r]of Object.entries(cc)){if(u.has(X(D)))continue;const o=u.get(X(r));o&&u.set(X(D),o)}return u},Yu=(e,u)=>u.get(X(e)),Fc=(e,u)=>{const t=e.trim().match(ac);if(t?.[1])return Yu(t[1],u)},Cc=(e,u,t)=>{const D=e.trim(),r=D.match(/^([a-z]+)(?:\s+|[:-])/i);if(!r?.[1])return e;const o=D.slice(r[0].length).trim();if(!o)return e;const n=Yu(r[1],t);return!n||X(n)!==X(u)?e:o||e},dc=(e,u)=>{const t=e.match(Dn);if(!t)return e;const[,D,r="",o=""]=t,n=o.trim();if(!n)return e;const i=Yu(D,u)||D.toLowerCase(),c=Fc(n,u)||i,f=Cc(n,c,u);return`${c}${r}: ${f||n}`},pc=(e,u,t)=>{const{title:D,body:r}=u?we(e):{title:e.trim(),body:""},o=dc(D,t);return u?Ae(o,r):o},mc=(e,u)=>{const{title:t,body:D}=u?we(e):{title:e.trim(),body:""},r=t.match(Dn);if(!r)return e;const[,o="",,n=""]=r,i=o.trim().toLowerCase(),s=n.trim();if(!i||!s)return e;const c=`${i}: ${s}`;return u?Ae(c,D):c},hc=/^[a-z]+\([^)\s][^)]*\):\s*\S/i,Ec=(e,u)=>u?we(e).title:e.trim(),gc=e=>e?.trim()?/<\s*scope\s*>/i.test(e):!0,rn=(e,u)=>hc.test(Ec(e,u)),yc=(e,u)=>{if(!lc(u))return!1;const{subject:t}=nn(e);return t.length===0?!1:!sc.test(t)},Bc=async(e,u,t,D,r,o,n,i,s)=>{const{prefix:c,subject:f}=nn(D),a=ZD(u,[{role:"system",content:[`Rewrite ONLY this commit title into locale "${t}".`,"Keep technical meaning unchanged and keep wording concise.",`Maximum title length: ${r} characters.`,"Return only the rewritten title text. No quotes, no code fences, no explanations.",...c?[`Preserve this conventional prefix exactly: "${c}" and rewrite only the subject part.`]:[]].join(`
105
+ `)},{role:"user",content:D}]),F=(await YD(e,a,o,n,i,s)).choices.map(d=>d.message?.content).find(d=>typeof d=="string");if(!F)return D;const C=un(F);if(!C)return D;if(!c)return C;const p=C.replace(tn,"$2").trim();return`${c}${p||f}`},bc=async(e,u,t,D,r,o,n,i,s,c)=>{const{title:f,body:a}=r?we(D):{title:D.trim(),body:""};if(!yc(f,t))return D;try{const l=await Bc(e,u,t,f,o,n,i,s,c);return r?Ae(l,a):l}catch{return D}},on=async(e,u,t,D,r,o,n,i,s,c,f)=>{const a=c??{},l=a.includeDetails??!1,F=a.detailsStyle??"paragraph",C=fc(a.conventionalTypes),p=n==="conventional"&&(a.conventionalScope??!1)&&gc(a.conventionalFormat),d=async(h,y=!0)=>{const m=[y?a.instructions?.trim():"",h?.trim()].filter(Boolean).join(`
106
+ `),b={includeDetails:a.includeDetails,detailsStyle:a.detailsStyle,instructions:m,conventionalFormat:a.conventionalFormat,conventionalTypes:a.conventionalTypes,conventionalScope:a.conventionalScope,changedFiles:a.changedFiles},B=[{role:"system",content:Ja(t,o,n,b)},{role:"user",content:D}],O=Math.max(1,r),P=(await Promise.all(Array.from({length:O},()=>YD(e,ZD(u,B),i,s,f,M=>a.onStreamEvent?.({phase:"message",...M}))))).flatMap(M=>M.choices).flatMap(M=>{const $=M.message?.content;return typeof $!="string"?[]:[oc($,l,F)]}).filter(Boolean),L=await Promise.all(P.map(M=>bc(e,u,t,M,l,o,i,s,f,$=>a.onStreamEvent?.({phase:"title-rewrite",...$})))),U=n==="conventional"?L.map(M=>pc(M,l,C)):L,k=n==="conventional"&&a.conventionalScope===!1?U.map(M=>mc(M,l)):U;return ic(k.filter(Boolean))};try{const h=await d();if(!p)return h;const y=h.filter(B=>rn(B,l));if(y.length>0)return y;const m=await d(['Hard requirement for this run: use conventional title with non-empty scope exactly in "<type>(<scope>): <subject>" format.',"Do not omit scope. Pick the strongest file/class/module anchor as scope."].join(`
107
+ `),!1),b=m.filter(B=>rn(B,l));return b.length>0?b:m}catch(h){const y=h;throw y.code==="ENOTFOUND"?new g(`Error connecting to ${y.hostname} (${y.syscall}). Are you connected to the internet?`):y}},sn=()=>{const e=["|","/","-","\\"],u=process.stdout.isTTY?120:1e4;let t=0,D="",r=!1,o;const n=ns("\u2502"),i=c=>{if(!process.stdout.isTTY){process.stdout.write(`${c}
108
+ `);return}process.stdout.write(`\r\x1B[2K${c}`)},s=()=>{const c=e[t];i(`${Ds("\u25C6")} ${c} ${D}`),t=(t+1)%e.length};return{start(c){if(D=c,r){s();return}if(r=!0,process.stdout.isTTY){process.stdout.write(`${n}
109
+ `),s(),o=setInterval(s,u);return}i(D)},update(c){D=c,!(!r||!process.stdout.isTTY)&&s()},stop(c){if(r){if(r=!1,o&&(clearInterval(o),o=void 0),process.stdout.isTTY){const f=c.split(/\r?\n/),a=f.shift()??"";process.stdout.write(`\r\x1B[2K${je("\u25C6")} ${a}
110
110
  `);for(const l of f)process.stdout.write(`${n} ${l}
111
111
  `);return}process.stdout.write(`${c}
112
- `)}}}},mc=e=>{const u=Math.max(0,Math.floor(e/1e3)),t=Math.floor(u/3600),D=Math.floor(u%3600/60),r=u%60;return t>0?`${t}h ${D}m ${r}s`:D>0?`${D}m ${r}s`:`${r}s`},hc=(e,u)=>{const t=Date.now(),D=1e3,r=()=>e.update(`Thinking for ${mc(Date.now()-t)} (${u})`);r();const o=setInterval(r,D);return()=>clearInterval(o)};var Ec=async(e,u,t,D,r,o,n,s,i,c,f,a,l)=>(async()=>{zi(ti(Qs(" aicommits "))),await BD();const F=Dn();t&&await re("git",["add","--update"]),F.start("Detecting staged files");const C=await wD(u);if(!C)throw F.stop("Detecting staged files"),new B("No staged changes found. Stage your changes manually, or automatically stage all changes with the `--all` flag.");F.stop(`${Ui(C.files)}:
113
- ${C.files.map(w=>` ${w}`).join(`
114
- `)}`);const d=await Ru({generate:e?.toString(),type:D?.toString(),details:r===!0?"true":void 0,"show-reasoning":o===!0?"true":void 0,"details-style":n,instructions:s,"conventional-format":i,"conventional-types":c,"conventional-scope":f,"base-url":a}),p={includeDetails:d.details,detailsStyle:d["details-style"],instructions:d.instructions,conventionalFormat:d["conventional-format"],conventionalTypes:d["conventional-types"],conventionalScope:d["conventional-scope"],changedFiles:C.files},h=d["show-reasoning"]===!0,g=Dn();g.start(`The AI (${d.model}) is analyzing your changes`);let m,b=!1,y=!0,O=!1,v;const P={message:"Message Generation","title-rewrite":"Title Rewrite"},L=w=>{if(!(w.kind!=="reasoning"||!w.text)){if(!h){b||(m=hc(g,d.model),b=!0);return}y&&(g.stop(`Streaming reasoning from ${d.model}`),y=!1),O||(process.stdout.write(`${Ce(`
112
+ `)}}}},wc=e=>{const u=Math.max(0,Math.floor(e/1e3)),t=Math.floor(u/3600),D=Math.floor(u%3600/60),r=u%60;return t>0?`${t}h ${D}m ${r}s`:D>0?`${D}m ${r}s`:`${r}s`},Ac=(e,u)=>{const t=Date.now(),D=1e3,r=()=>e.update(`Thinking for ${wc(Date.now()-t)} (${u})`);r();const o=setInterval(r,D);return()=>clearInterval(o)};var vc=async(e,u,t,D,r,o,n,i,s,c,f,a,l,F)=>(async()=>{qs(rs(ts(" aicommits "))),await vD();const C=sn();t&&await oe("git",["add","--update"]),C.start("Detecting staged files");const p=await xD(u);if(!p)throw C.stop("Detecting staged files"),new g("No staged changes found. Stage your changes manually, or automatically stage all changes with the `--all` flag.");C.stop(`${Zs(p.files)}:
113
+ ${p.files.map($=>` ${$}`).join(`
114
+ `)}`);const d=await ju({generate:e?.toString(),type:D?.toString(),details:r===!0?"true":void 0,"show-reasoning":o===!0?"true":void 0,"details-style":n,instructions:i,"conventional-format":s,"conventional-types":c,"conventional-scope":f,"base-url":a}),h={includeDetails:d.details,detailsStyle:d["details-style"],instructions:d.instructions,conventionalFormat:d["conventional-format"],conventionalTypes:d["conventional-types"],conventionalScope:d["conventional-scope"],changedFiles:p.files},y=d["show-reasoning"]===!0,m=sn();m.start(`The AI (${d.model}) is analyzing your changes`);let b,B=!1,O=!0,w=!1,P;const L={message:"Message Generation","title-rewrite":"Title Rewrite"},U=$=>{if(!($.kind!=="reasoning"||!$.text)){if(!y){B||(b=Ac(m,d.model),B=!0);return}O&&(m.stop(`Streaming reasoning from ${d.model}`),O=!1),w||(process.stdout.write(`${de(`
115
115
  Reasoning stream (${d.model})`)}
116
- `),O=!0),w.phase!==v&&(v=w.phase,process.stdout.write(`${Ce(`[${P[w.phase]}]
117
- `)}`)),process.stdout.write(w.text)}};let j;try{j=await tn(d["api-key"],d.model,d.locale,C.diff,d.generate,d["max-length"],d.type,d.timeout,d.proxy,{...p,onStreamEvent:L},d["base-url"])}finally{m?.(),y?g.stop("Changes analyzed"):h&&process.stdout.write(`
118
- `)}if(j.length===0)throw new B("No commit messages were generated. Try again.");let M;if(j.length===1){[M]=j;const w=await Ni({message:`Use this commit message?
116
+ `),w=!0),$.phase!==P&&(P=$.phase,process.stdout.write(`${de(`[${L[$.phase]}]
117
+ `)}`)),process.stdout.write($.text)}};let k;try{k=await on(d["api-key"],d.model,d.locale,p.diff,d.generate,d["max-length"],d.type,d.timeout,d.proxy,{...h,onStreamEvent:U},d["base-url"])}finally{b?.(),O?m.stop("Changes analyzed"):y&&process.stdout.write(`
118
+ `)}if(k.length===0)throw new g("No commit messages were generated. Try again.");let M;if(l)[M]=k;else try{if(k.length===1){[M]=k;const $=await Ws({message:`Use this commit message?
119
119
 
120
120
  ${M}
121
- `});if(!w||pD(w)){Ge("Commit cancelled");return}}else{const w=await Gi({message:`Pick a commit message to use: ${Ce("(Ctrl+c to exit)")}`,options:j.map(V=>({label:V,value:V}))});if(pD(w)){Ge("Commit cancelled");return}M=w}await re("git",["commit","-m",M,...l]),Ge(`${Re("\u2714")} Successfully committed!`)})().catch(F=>{Ge(`${gu("\u2716")} ${F.message}`),Pu(F),process.exit(1)});const gc="prepare-commit-msg-hook",yc=()=>{const e=process.argv.slice(2);return e[0]===gc?e.slice(1):e},Bc=async()=>{const{stdout:e}=await re("git",["rev-parse","--git-path","COMMIT_EDITMSG"],{reject:!1}),u=e.trim();return u===""?void 0:u},bc=async e=>_.readFile(e,"utf8").catch(u=>{if(u.code==="ENOENT")return"";throw u});var wc=()=>(async()=>{const[e,u]=yc(),t=e?.trim()||await Bc();if(!t)return;const D=await bc(t);if(u==="message"&&D.trim()!=="")return;const o=await wD();if(!o)return;const n=await Ru({}),s={includeDetails:n.details,detailsStyle:n["details-style"],instructions:n.instructions,conventionalFormat:n["conventional-format"],conventionalTypes:n["conventional-types"],conventionalScope:n["conventional-scope"],changedFiles:o.files},i=await tn(n["api-key"],n.model,n.locale,o.diff,n.generate,n["max-length"],n.type,n.timeout,n.proxy,s,n["base-url"]);if(i.length===0)return;const c=i[0]?.trim();if(!c)return;const f=`${c}
122
- `;await _.writeFile(t,f),process.stdout.write(f)})().catch(()=>{});const vc=e=>{const u=e.indexOf("=");if(u<=0)throw new B(`Invalid config assignment: "${e}". Use <key>=<value>.`);return[e.slice(0,u),e.slice(u+1)]};var Ac=wt({name:"config",parameters:["<mode>","<key=value...>"]},e=>{(async()=>{const{mode:u,keyValue:t}=e._;if(u==="get"){const D=await Ru({},!0);for(const r of t)vD(D,r)&&console.log(`${r}=${D[r]}`);return}if(u==="set"){await na(t.map(vc));return}throw new B(`Invalid mode: ${u}`)})().catch(u=>{console.error(`${gu("\u2716")} ${u.message}`),Pu(u),process.exit(1)})});const $c=e=>_.lstat(e).then(()=>!0,()=>!1),nn="prepare-commit-msg",rn=`.git/hooks/${nn}`,xc="prepare-commit-msg-hook",on=An(new URL("cli.mjs",import.meta.url)),sn=`
121
+ `});if(!$||hD($)){ze("Commit cancelled");return}}else{const $=await Us({message:`Pick a commit message to use: ${de("(Ctrl+c to exit)")}`,options:k.map(Q=>({label:Q,value:Q}))});if(hD($)){ze("Commit cancelled");return}M=$}}catch($){const Q=$ instanceof Error?$.message:"";throw Q.includes("TTY initialization failed")||Q.includes("uv_tty_init returned EINVAL")||Q.includes("ERR_TTY_INIT_FAILED")?new g("Interactive terminal initialization failed in this environment. Re-run with `--confirm` or `--yes` to skip prompts."):$}await oe("git",["commit","-m",M,...F]),ze(`${je("\u2714")} Successfully committed!`)})().catch(C=>{ze(`${yu("\u2716")} ${C.message}`),Iu(C),process.exit(1)});const $c="prepare-commit-msg-hook",xc=()=>{const e=process.argv.slice(2);return e[0]===$c?e.slice(1):e},Sc=async()=>{const{stdout:e}=await oe("git",["rev-parse","--git-path","COMMIT_EDITMSG"],{reject:!1}),u=e.trim();return u===""?void 0:u},Tc=async e=>_.readFile(e,"utf8").catch(u=>{if(u.code==="ENOENT")return"";throw u});var Oc=()=>(async()=>{const[e,u]=xc(),t=e?.trim()||await Sc();if(!t)return;const D=await Tc(t);if(u==="message"&&D.trim()!=="")return;const o=await xD();if(!o)return;const n=await ju({}),i={includeDetails:n.details,detailsStyle:n["details-style"],instructions:n.instructions,conventionalFormat:n["conventional-format"],conventionalTypes:n["conventional-types"],conventionalScope:n["conventional-scope"],changedFiles:o.files},s=await on(n["api-key"],n.model,n.locale,o.diff,n.generate,n["max-length"],n.type,n.timeout,n.proxy,i,n["base-url"]);if(s.length===0)return;const c=s[0]?.trim();if(!c)return;const f=`${c}
122
+ `;await _.writeFile(t,f),process.stdout.write(f)})().catch(()=>{});const Pc=e=>{const u=e.indexOf("=");if(u<=0)throw new g(`Invalid config assignment: "${e}". Use <key>=<value>.`);return[e.slice(0,u),e.slice(u+1)]};var Ic=vt({name:"config",parameters:["<mode>","<key=value...>"]},e=>{(async()=>{const{mode:u,keyValue:t}=e._;if(u==="get"){const D=await ju({},!0);for(const r of t)SD(D,r)&&console.log(`${r}=${D[r]}`);return}if(u==="set"){await la(t.map(Pc));return}throw new g(`Invalid mode: ${u}`)})().catch(u=>{console.error(`${yu("\u2716")} ${u.message}`),Iu(u),process.exit(1)})});const kc=e=>_.lstat(e).then(()=>!0,()=>!1),Zu="prepare-commit-msg",Mc="prepare-commit-msg-hook",Rc=`/hooks/${Zu}`,an=xn(new URL("cli.mjs",import.meta.url)),cn=`
123
123
  #!/usr/bin/env node
124
- process.argv.splice(2, 0, ${JSON.stringify(xc)});
125
- import(${JSON.stringify($n(on))})
126
- `.trim(),Sc=(process.argv[1]||"").replace(/\\/g,"/").endsWith(`/${rn}`),an=async e=>await _.readFile(e,"utf8").catch(()=>{})===sn,cn=async e=>await _.realpath(e).catch(()=>{})===on;var Tc=wt({name:"hook",parameters:["<install/uninstall>"]},e=>{(async()=>{const u=await BD(),{installUninstall:t}=e._,D=U.join(u,rn),r=await $c(D);if(t==="install"){if(r){if(await an(D)){console.warn("The hook is already installed");return}if(await cn(D))await _.rm(D);else throw new B(`A different ${nn} hook seems to be installed. Please remove it before installing aicommits.`)}await _.mkdir(U.dirname(D),{recursive:!0}),await _.writeFile(D,sn),await _.chmod(D,493),console.log(`${Re("\u2714")} Hook installed`);return}if(t==="uninstall"){if(!r){console.warn("Hook is not installed");return}if(!(await an(D)||await cn(D))){console.warn("Hook is not installed");return}await _.rm(D),console.log(`${Re("\u2714")} Hook uninstalled`);return}throw new B(`Invalid mode: ${t}`)})().catch(u=>{console.error(`${gu("\u2716")} ${u.message}`),Pu(u),process.exit(1)})});const Oc=yD(),Yu=process.argv.slice(2),Pc=Yu[0]==="prepare-commit-msg-hook";Hr({name:"aicommits",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:"Git commit message format (default: plain). Supports conventional",alias:"t"},details:{type:Boolean,description:"Generate commit message details/body in addition to the title"},showReasoning:{type:Boolean,description:"Stream and print model reasoning while generating messages"},detailsStyle:{type:String,description:"Body style when --details is enabled: paragraph or list"},instructions:{type:String,description:"Additional custom prompt instructions (tone, detail level, wording, etc.)"},conventionalFormat:{type:String,description:"Custom conventional commit format template (works with --type conventional)"},conventionalTypes:{type:String,description:"Custom conventional commit type map as JSON (works with --type conventional)"},conventionalScope:{type:String,description:"Conventional scope preference: true or false (default: false)"},baseUrl:{type:String,description:"API base URL for chat completions (for example https://api.openai.com/v1)"},version:{type:Boolean,description:"Show version number",alias:"v"}},commands:[Ac,Tc],help:{description:Kr},ignoreArgv:e=>e==="unknown-flag"||e==="argument"},e=>{e.flags.version&&(console.log(Oc),process.exit(0)),Sc||Pc?wc():Ec(e.flags.generate,e.flags.exclude,e.flags.all,e.flags.type,e.flags.details,e.flags.showReasoning,e.flags.detailsStyle,e.flags.instructions,e.flags.conventionalFormat,e.flags.conventionalTypes,e.flags.conventionalScope,e.flags.baseUrl,Yu)},Yu);
124
+ process.argv.splice(2, 0, ${JSON.stringify(Mc)});
125
+ import(${JSON.stringify(Sn(an))})
126
+ `.trim(),jc=(process.argv[1]||"").replace(/\\/g,"/").endsWith(Rc),ln=async e=>await _.readFile(e,"utf8").catch(()=>{})===cn,fn=async e=>await _.realpath(e).catch(()=>{})===an;var _c=vt({name:"hook",parameters:["<install/uninstall>"]},e=>{(async()=>{const u=await vD(),{installUninstall:t}=e._,D=await Ys("hooks",u),r=z.join(D,Zu),o=await kc(r);if(t==="install"){if(o){if(await ln(r)){console.warn("The hook is already installed");return}if(await fn(r))await _.rm(r);else throw new g(`A different ${Zu} hook seems to be installed. Please remove it before installing aicommits.`)}await _.mkdir(z.dirname(r),{recursive:!0}),await _.writeFile(r,cn),await _.chmod(r,493),console.log(`${je("\u2714")} Hook installed`);return}if(t==="uninstall"){if(!o){console.warn("Hook is not installed");return}if(!(await ln(r)||await fn(r))){console.warn("Hook is not installed");return}await _.rm(r),console.log(`${je("\u2714")} Hook uninstalled`);return}throw new g(`Invalid mode: ${t}`)})().catch(u=>{console.error(`${yu("\u2716")} ${u.message}`),Iu(u),process.exit(1)})});const Lc=bD(),Xu=process.argv.slice(2),Nc=Xu[0]==="prepare-commit-msg-hook";Kr({name:"aicommits",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:"Git commit message format (default: plain). Supports conventional",alias:"t"},details:{type:Boolean,description:"Generate commit message details/body in addition to the title"},showReasoning:{type:Boolean,description:"Stream and print model reasoning while generating messages"},detailsStyle:{type:String,description:"Body style when --details is enabled: paragraph or list"},instructions:{type:String,description:"Additional custom prompt instructions (tone, detail level, wording, etc.)"},conventionalFormat:{type:String,description:"Custom conventional commit format template (works with --type conventional)"},conventionalTypes:{type:String,description:"Custom conventional commit type map as JSON (works with --type conventional)"},conventionalScope:{type:String,description:"Conventional scope preference: true or false (default: false)"},baseUrl:{type:String,description:"API base URL for chat completions (for example https://api.openai.com/v1)"},confirm:{type:Boolean,description:"Skip interactive confirmation/selection prompts and use the first generated message",alias:"y",default:!1},yes:{type:Boolean,description:"Alias for --confirm",default:!1},version:{type:Boolean,description:"Show version number",alias:"v"}},commands:[Ic,_c],help:{description:Yr},ignoreArgv:e=>e==="unknown-flag"||e==="argument"},e=>{e.flags.version&&(console.log(Lc),process.exit(0)),jc||Nc?Oc():vc(e.flags.generate,e.flags.exclude,e.flags.all,e.flags.type,e.flags.details,e.flags.showReasoning,e.flags.detailsStyle,e.flags.instructions,e.flags.conventionalFormat,e.flags.conventionalTypes,e.flags.conventionalScope,e.flags.baseUrl,e.flags.confirm||e.flags.yes,Xu)},Xu);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sugarmo/aicommits",
3
- "version": "1.13.2",
3
+ "version": "1.13.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "license": "MIT",
14
14
  "repository": "sugarmo/aicommits",
15
- "author": "Hassan El Mghari (@nutlope)",
15
+ "author": "Steven Mok (@sugarmo)",
16
16
  "type": "module",
17
17
  "files": [
18
18
  "dist"