eazy-git 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -22
- package/dist/git.js +25 -3
- package/dist/index.js +174 -77
- package/dist/install.js +54 -49
- package/dist/run.js +3 -3
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -1,78 +1,174 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var He=Object.create;var Uu=Object.defineProperty;var Ze=Object.getOwnPropertyDescriptor;var Qe=Object.getOwnPropertyNames;var Xe=Object.getPrototypeOf,uD=Object.prototype.hasOwnProperty;var Yu=(D,e)=>()=>(e||D((e={exports:{}}).exports,e),e.exports);var eD=(D,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Qe(e))!uD.call(D,s)&&s!==t&&Uu(D,s,{get:()=>e[s],enumerable:!(r=Ze(e,s))||r.enumerable});return D};var su=(D,e,t)=>(t=D!=null?He(Xe(D)):{},eD(e||!D||!D.__esModule?Uu(t,"default",{value:D,enumerable:!0}):t,D));var Au=Yu((wt,zu)=>{"use strict";var $u="\x1B",d=`${$u}[`,DD="\x07",vu={to(D,e){return e?`${d}${e+1};${D+1}H`:`${d}${D+1}G`},move(D,e){let t="";return D<0?t+=`${d}${-D}D`:D>0&&(t+=`${d}${D}C`),e<0?t+=`${d}${-e}A`:e>0&&(t+=`${d}${e}B`),t},up:(D=1)=>`${d}${D}A`,down:(D=1)=>`${d}${D}B`,forward:(D=1)=>`${d}${D}C`,backward:(D=1)=>`${d}${D}D`,nextLine:(D=1)=>`${d}E`.repeat(D),prevLine:(D=1)=>`${d}F`.repeat(D),left:`${d}G`,hide:`${d}?25l`,show:`${d}?25h`,save:`${$u}7`,restore:`${$u}8`},tD={up:(D=1)=>`${d}S`.repeat(D),down:(D=1)=>`${d}T`.repeat(D)},rD={screen:`${d}2J`,up:(D=1)=>`${d}1J`.repeat(D),down:(D=1)=>`${d}J`.repeat(D),line:`${d}2K`,lineEnd:`${d}K`,lineStart:`${d}1K`,lines(D){let e="";for(let t=0;t<D;t++)e+=this.line+(t<D-1?vu.up():"");return D&&(e+=vu.left),e}};zu.exports={cursor:vu,scroll:tD,erase:rD,beep:DD}});var xu=Yu((Tt,yu)=>{var ou=process||{},Ku=ou.argv||[],iu=ou.env||{},sD=!(iu.NO_COLOR||Ku.includes("--no-color"))&&(!!iu.FORCE_COLOR||Ku.includes("--color")||ou.platform==="win32"||(ou.stdout||{}).isTTY&&iu.TERM!=="dumb"||!!iu.CI),iD=(D,e,t=D)=>r=>{let s=""+r,o=s.indexOf(e,D.length);return~o?D+oD(s,e,t,o)+e:D+s+e},oD=(D,e,t,r)=>{let s="",o=0;do s+=D.substring(o,r)+t,o=r+e.length,r=D.indexOf(e,o);while(~r);return s+D.substring(o)},Ju=(D=sD)=>{let e=D?iD:()=>String;return{isColorSupported:D,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};yu.exports=Ju();yu.exports.createColors=Ju});import{stripVTControlCharacters as Mu}from"node:util";var x=su(Au(),1),oe=su(xu(),1);import{stdin as se,stdout as ie}from"node:process";import*as L from"node:readline";import Hu from"node:readline";import{Writable as nD}from"node:stream";function aD({onlyFirst:D=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,D?void 0:"g")}var lD=aD();function ne(D){if(typeof D!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(lD,"")}function ae(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}var le={exports:{}};(function(D){var e={};D.exports=e,e.eastAsianWidth=function(r){var s=r.charCodeAt(0),o=r.length==2?r.charCodeAt(1):0,u=s;return 55296<=s&&s<=56319&&56320<=o&&o<=57343&&(s&=1023,o&=1023,u=s<<10|o,u+=65536),u==12288||65281<=u&&u<=65376||65504<=u&&u<=65510?"F":u==8361||65377<=u&&u<=65470||65474<=u&&u<=65479||65482<=u&&u<=65487||65490<=u&&u<=65495||65498<=u&&u<=65500||65512<=u&&u<=65518?"H":4352<=u&&u<=4447||4515<=u&&u<=4519||4602<=u&&u<=4607||9001<=u&&u<=9002||11904<=u&&u<=11929||11931<=u&&u<=12019||12032<=u&&u<=12245||12272<=u&&u<=12283||12289<=u&&u<=12350||12353<=u&&u<=12438||12441<=u&&u<=12543||12549<=u&&u<=12589||12593<=u&&u<=12686||12688<=u&&u<=12730||12736<=u&&u<=12771||12784<=u&&u<=12830||12832<=u&&u<=12871||12880<=u&&u<=13054||13056<=u&&u<=19903||19968<=u&&u<=42124||42128<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||55216<=u&&u<=55238||55243<=u&&u<=55291||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65106||65108<=u&&u<=65126||65128<=u&&u<=65131||110592<=u&&u<=110593||127488<=u&&u<=127490||127504<=u&&u<=127546||127552<=u&&u<=127560||127568<=u&&u<=127569||131072<=u&&u<=194367||177984<=u&&u<=196605||196608<=u&&u<=262141?"W":32<=u&&u<=126||162<=u&&u<=163||165<=u&&u<=166||u==172||u==175||10214<=u&&u<=10221||10629<=u&&u<=10630?"Na":u==161||u==164||167<=u&&u<=168||u==170||173<=u&&u<=174||176<=u&&u<=180||182<=u&&u<=186||188<=u&&u<=191||u==198||u==208||215<=u&&u<=216||222<=u&&u<=225||u==230||232<=u&&u<=234||236<=u&&u<=237||u==240||242<=u&&u<=243||247<=u&&u<=250||u==252||u==254||u==257||u==273||u==275||u==283||294<=u&&u<=295||u==299||305<=u&&u<=307||u==312||319<=u&&u<=322||u==324||328<=u&&u<=331||u==333||338<=u&&u<=339||358<=u&&u<=359||u==363||u==462||u==464||u==466||u==468||u==470||u==472||u==474||u==476||u==593||u==609||u==708||u==711||713<=u&&u<=715||u==717||u==720||728<=u&&u<=731||u==733||u==735||768<=u&&u<=879||913<=u&&u<=929||931<=u&&u<=937||945<=u&&u<=961||963<=u&&u<=969||u==1025||1040<=u&&u<=1103||u==1105||u==8208||8211<=u&&u<=8214||8216<=u&&u<=8217||8220<=u&&u<=8221||8224<=u&&u<=8226||8228<=u&&u<=8231||u==8240||8242<=u&&u<=8243||u==8245||u==8251||u==8254||u==8308||u==8319||8321<=u&&u<=8324||u==8364||u==8451||u==8453||u==8457||u==8467||u==8470||8481<=u&&u<=8482||u==8486||u==8491||8531<=u&&u<=8532||8539<=u&&u<=8542||8544<=u&&u<=8555||8560<=u&&u<=8569||u==8585||8592<=u&&u<=8601||8632<=u&&u<=8633||u==8658||u==8660||u==8679||u==8704||8706<=u&&u<=8707||8711<=u&&u<=8712||u==8715||u==8719||u==8721||u==8725||u==8730||8733<=u&&u<=8736||u==8739||u==8741||8743<=u&&u<=8748||u==8750||8756<=u&&u<=8759||8764<=u&&u<=8765||u==8776||u==8780||u==8786||8800<=u&&u<=8801||8804<=u&&u<=8807||8810<=u&&u<=8811||8814<=u&&u<=8815||8834<=u&&u<=8835||8838<=u&&u<=8839||u==8853||u==8857||u==8869||u==8895||u==8978||9312<=u&&u<=9449||9451<=u&&u<=9547||9552<=u&&u<=9587||9600<=u&&u<=9615||9618<=u&&u<=9621||9632<=u&&u<=9633||9635<=u&&u<=9641||9650<=u&&u<=9651||9654<=u&&u<=9655||9660<=u&&u<=9661||9664<=u&&u<=9665||9670<=u&&u<=9672||u==9675||9678<=u&&u<=9681||9698<=u&&u<=9701||u==9711||9733<=u&&u<=9734||u==9737||9742<=u&&u<=9743||9748<=u&&u<=9749||u==9756||u==9758||u==9792||u==9794||9824<=u&&u<=9825||9827<=u&&u<=9829||9831<=u&&u<=9834||9836<=u&&u<=9837||u==9839||9886<=u&&u<=9887||9918<=u&&u<=9919||9924<=u&&u<=9933||9935<=u&&u<=9953||u==9955||9960<=u&&u<=9983||u==10045||u==10071||10102<=u&&u<=10111||11093<=u&&u<=11097||12872<=u&&u<=12879||57344<=u&&u<=63743||65024<=u&&u<=65039||u==65533||127232<=u&&u<=127242||127248<=u&&u<=127277||127280<=u&&u<=127337||127344<=u&&u<=127386||917760<=u&&u<=917999||983040<=u&&u<=1048573||1048576<=u&&u<=1114109?"A":"N"},e.characterLength=function(r){var s=this.eastAsianWidth(r);return s=="F"||s=="W"||s=="A"?2:1};function t(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(r){for(var s=t(r),o=0,u=0;u<s.length;u++)o=o+this.characterLength(s[u]);return o},e.slice=function(r,s,o){textLen=e.length(r),s=s||0,o=o||1,s<0&&(s=textLen+s),o<0&&(o=textLen+o);for(var u="",n=0,F=t(r),h=0;h<F.length;h++){var g=F[h],c=e.length(g);if(n>=s-(c==2?1:0))if(n+c<=o)u+=g;else break;n+=c}return u}})(le);var cD=le.exports,FD=ae(cD),hD=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},CD=ae(hD);function X(D,e={}){if(typeof D!="string"||D.length===0||(e={ambiguousIsNarrow:!0,...e},D=ne(D),D.length===0))return 0;D=D.replace(CD()," ");let t=e.ambiguousIsNarrow?1:2,r=0;for(let s of D){let o=s.codePointAt(0);if(!(o<=31||o>=127&&o<=159||o>=768&&o<=879))switch(FD.eastAsianWidth(s)){case"F":case"W":r+=2;break;case"A":r+=t;break;default:r+=1}}return r}var wu=10,Zu=(D=0)=>e=>`\x1B[${e+D}m`,Qu=(D=0)=>e=>`\x1B[${38+D};5;${e}m`,Xu=(D=0)=>(e,t,r)=>`\x1B[${38+D};2;${e};${t};${r}m`,m={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(m.modifier);var mD=Object.keys(m.color),pD=Object.keys(m.bgColor);[...mD,...pD];function ED(){let D=new Map;for(let[e,t]of Object.entries(m)){for(let[r,s]of Object.entries(t))m[r]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},t[r]=m[r],D.set(s[0],s[1]);Object.defineProperty(m,e,{value:t,enumerable:!1})}return Object.defineProperty(m,"codes",{value:D,enumerable:!1}),m.color.close="\x1B[39m",m.bgColor.close="\x1B[49m",m.color.ansi=Zu(),m.color.ansi256=Qu(),m.color.ansi16m=Xu(),m.bgColor.ansi=Zu(wu),m.bgColor.ansi256=Qu(wu),m.bgColor.ansi16m=Xu(wu),Object.defineProperties(m,{rgbToAnsi256:{value:(e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(o=>o+o).join(""));let s=Number.parseInt(r,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>m.rgbToAnsi256(...m.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,r,s;if(e>=232)t=((e-232)*10+8)/255,r=t,s=t;else{e-=16;let n=e%36;t=Math.floor(e/36)/5,r=Math.floor(n/6)/5,s=n%6/5}let o=Math.max(t,r,s)*2;if(o===0)return 30;let u=30+(Math.round(s)<<2|Math.round(r)<<1|Math.round(t));return o===2&&(u+=60),u},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>m.ansi256ToAnsi(m.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>m.ansi256ToAnsi(m.hexToAnsi256(e)),enumerable:!1}}),m}var dD=ED(),hu=new Set(["\x1B","\x9B"]),gD=39,ku="\x07",ce="[",fD="]",Fe="m",Ru=`${fD}8;;`,ue=D=>`${hu.values().next().value}${ce}${D}${Fe}`,ee=D=>`${hu.values().next().value}${Ru}${D}${ku}`,bD=D=>D.split(" ").map(e=>X(e)),Tu=(D,e,t)=>{let r=[...e],s=!1,o=!1,u=X(ne(D[D.length-1]));for(let[n,F]of r.entries()){let h=X(F);if(u+h<=t?D[D.length-1]+=F:(D.push(F),u=0),hu.has(F)&&(s=!0,o=r.slice(n+1).join("").startsWith(Ru)),s){o?F===ku&&(s=!1,o=!1):F===Fe&&(s=!1);continue}u+=h,u===t&&n<r.length-1&&(D.push(""),u=0)}!u&&D[D.length-1].length>0&&D.length>1&&(D[D.length-2]+=D.pop())},BD=D=>{let e=D.split(" "),t=e.length;for(;t>0&&!(X(e[t-1])>0);)t--;return t===e.length?D:e.slice(0,t).join(" ")+e.slice(t).join("")},$D=(D,e,t={})=>{if(t.trim!==!1&&D.trim()==="")return"";let r="",s,o,u=bD(D),n=[""];for(let[h,g]of D.split(" ").entries()){t.trim!==!1&&(n[n.length-1]=n[n.length-1].trimStart());let c=X(n[n.length-1]);if(h!==0&&(c>=e&&(t.wordWrap===!1||t.trim===!1)&&(n.push(""),c=0),(c>0||t.trim===!1)&&(n[n.length-1]+=" ",c++)),t.hard&&u[h]>e){let y=e-c,j=1+Math.floor((u[h]-y-1)/e);Math.floor((u[h]-1)/e)<j&&n.push(""),Tu(n,g,e);continue}if(c+u[h]>e&&c>0&&u[h]>0){if(t.wordWrap===!1&&c<e){Tu(n,g,e);continue}n.push("")}if(c+u[h]>e&&t.wordWrap===!1){Tu(n,g,e);continue}n[n.length-1]+=g}t.trim!==!1&&(n=n.map(h=>BD(h)));let F=[...n.join(`
|
|
3
|
-
`)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`).split(`
|
|
7
|
-
`).
|
|
8
|
-
`)
|
|
9
|
-
`),r=e.split(`
|
|
10
|
-
`)
|
|
11
|
-
`),
|
|
12
|
-
`)
|
|
13
|
-
`);this.output.write(
|
|
14
|
-
`).
|
|
15
|
-
`)
|
|
16
|
-
${
|
|
17
|
-
|
|
18
|
-
${i.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
${i.
|
|
22
|
-
${i.
|
|
23
|
-
`
|
|
24
|
-
${
|
|
25
|
-
|
|
26
|
-
${
|
|
27
|
-
${i.
|
|
28
|
-
|
|
29
|
-
${
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
`
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
${
|
|
42
|
-
${
|
|
43
|
-
`}
|
|
44
|
-
${
|
|
45
|
-
${
|
|
46
|
-
|
|
47
|
-
${
|
|
48
|
-
|
|
49
|
-
`
|
|
50
|
-
|
|
51
|
-
${
|
|
52
|
-
|
|
53
|
-
${
|
|
54
|
-
|
|
2
|
+
var dr=Object.create;var nt=Object.defineProperty;var mr=Object.getOwnPropertyDescriptor;var pr=Object.getOwnPropertyNames;var gr=Object.getPrototypeOf,fr=Object.prototype.hasOwnProperty;var we=(e,t)=>()=>(e&&(t=e(e=0)),t);var $r=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),yr=(e,t)=>{for(var s in t)nt(e,s,{get:t[s],enumerable:!0})},vr=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of pr(t))!fr.call(e,i)&&i!==s&&nt(e,i,{get:()=>t[i],enumerable:!(r=mr(t,i))||r.enumerable});return e};var Wt=(e,t,s)=>(s=e!=null?dr(gr(e)):{},vr(t||!e||!e.__esModule?nt(s,"default",{value:e,enumerable:!0}):s,e));var qt,Ht,Kt,zt=we(()=>{qt=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let s=0;for(e.lastIndex=0;e.test(t);)s+=1;return t.length-s}})(),Ht=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,Kt=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141});var br,wr,Jt,Cr,Yt,Ir,Sr,Er,Qt,Xt,Zt=we(()=>{zt();br=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,wr=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Jt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,Cr=/\t{1,1000}/y,Yt=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,Ir=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Sr=/\p{M}+/gu,Er={limit:1/0,ellipsis:""},Qt=(e,t={},s={})=>{let r=t.limit??1/0,i=t.ellipsis??"",o=t?.ellipsisWidth??(i?Qt(i,Er,s).width:0),a=0,l=s.controlWidth??0,c=s.tabWidth??8,u=s.emojiWidth??2,d=2,g=s.regularWidth??1,p=s.wideWidth??d,y=[[Ir,g],[br,a],[wr,l],[Cr,c],[Yt,u],[Jt,p]],m=0,b=0,$=e.length,v=0,C=!1,T=$,R=Math.max(0,r-o),x=0,L=0,M=0,k=0;e:for(;;){if(L>x||b>=$&&b>m){let N=e.slice(x,L)||e.slice(m,b);v=0;for(let W of N.replaceAll(Sr,"")){let w=W.codePointAt(0)||0;if(Ht(w)?k=d:Kt(w)?k=p:k=g,M+k>R&&(T=Math.min(T,Math.max(x,m)+v)),M+k>r){C=!0;break e}v+=W.length,M+=k}x=L=0}if(b>=$)break e;for(let N=0,W=y.length;N<W;N++){let[w,O]=y[N];if(w.lastIndex=b,w.test(e)){if(v=w===Jt?qt(e.slice(b,w.lastIndex)):w===Yt?1:w.lastIndex-b,k=v*O,M+k>R&&(T=Math.min(T,b+Math.floor((R-M)/O))),M+k>r){C=!0;break e}M+=k,x=m,L=b,b=m=w.lastIndex;continue e}}b+=1}return{width:C?R:M,index:C?T:$,truncated:C,ellipsed:C&&r>=o}},Xt=Qt});var xr,Tr,j,ot=we(()=>{Zt();xr={limit:1/0,ellipsis:"",ellipsisWidth:0},Tr=(e,t={})=>Xt(e,xr,t).width,j=Tr});function se(e,t,s){return String(e).normalize().split(Mr).map(r=>Fr(r,t,s)).join(`
|
|
3
|
+
`)}var ke,is,Rr,ct,ns,_r,os,lt,es,ts,ss,rs,at,Ar,Fr,Mr,ut=we(()=>{ot();ke="\x1B",is="\x9B",Rr=39,ct="\x07",ns="[",_r="]",os="m",lt=`${_r}8;;`,es=new RegExp(`(?:\\${ns}(?<code>\\d+)m|\\${lt}(?<uri>.*)${ct})`,"y"),ts=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},ss=e=>`${ke}${ns}${e}${os}`,rs=e=>`${ke}${lt}${e}${ct}`,at=(e,t,s)=>{let r=t[Symbol.iterator](),i=!1,o=!1,a=e.at(-1),l=a===void 0?0:j(a),c=r.next(),u=r.next(),d=0;for(;!c.done;){let g=c.value,p=j(g);l+p<=s?e[e.length-1]+=g:(e.push(g),l=0),(g===ke||g===is)&&(i=!0,o=t.startsWith(lt,d+1)),i?o?g===ct&&(i=!1,o=!1):g===os&&(i=!1):(l+=p,l===s&&!u.done&&(e.push(""),l=0)),c=u,u=r.next(),d+=g.length}a=e.at(-1),!l&&a!==void 0&&a.length&&e.length>1&&(e[e.length-2]+=e.pop())},Ar=e=>{let t=e.split(" "),s=t.length;for(;s&&!j(t[s-1]);)s--;return s===t.length?e:t.slice(0,s).join(" ")+t.slice(s).join("")},Fr=(e,t,s={})=>{if(s.trim!==!1&&e.trim()==="")return"";let r="",i,o,a=e.split(" "),l=[""],c=0;for(let g=0;g<a.length;g++){let p=a[g];if(s.trim!==!1){let m=l.at(-1)??"",b=m.trimStart();m.length!==b.length&&(l[l.length-1]=b,c=j(b))}g!==0&&(c>=t&&(s.wordWrap===!1||s.trim===!1)&&(l.push(""),c=0),(c||s.trim===!1)&&(l[l.length-1]+=" ",c++));let y=j(p);if(s.hard&&y>t){let m=t-c,b=1+Math.floor((y-m-1)/t);Math.floor((y-1)/t)<b&&l.push(""),at(l,p,t),c=j(l.at(-1)??"");continue}if(c+y>t&&c&&y){if(s.wordWrap===!1&&c<t){at(l,p,t),c=j(l.at(-1)??"");continue}l.push(""),c=0}if(c+y>t&&s.wordWrap===!1){at(l,p,t),c=j(l.at(-1)??"");continue}l[l.length-1]+=p,c+=y}s.trim!==!1&&(l=l.map(g=>Ar(g)));let u=l.join(`
|
|
4
|
+
`),d=!1;for(let g=0;g<u.length;g++){let p=u[g];if(r+=p,d)d=!1;else if(d=p>="\uD800"&&p<="\uDBFF",d)continue;if(p===ke||p===is){es.lastIndex=g+1;let m=es.exec(u)?.groups;if(m?.code!==void 0){let b=Number.parseFloat(m.code);i=b===Rr?void 0:b}else m?.uri!==void 0&&(o=m.uri.length===0?void 0:m.uri)}if(u[g+1]===`
|
|
5
|
+
`){o&&(r+=rs(""));let y=i?ts(i):void 0;i&&y&&(r+=ss(y))}else p===`
|
|
6
|
+
`&&(i&&ts(i)&&(r+=ss(i)),o&&(r+=rs(o)))}return r},Mr=/\r?\n/});var mt=$r((pn,as)=>{"use strict";var ht="\x1B",D=`${ht}[`,Or="\x07",dt={to(e,t){return t?`${D}${t+1};${e+1}H`:`${D}${e+1}G`},move(e,t){let s="";return e<0?s+=`${D}${-e}D`:e>0&&(s+=`${D}${e}C`),t<0?s+=`${D}${-t}A`:t>0&&(s+=`${D}${t}B`),s},up:(e=1)=>`${D}${e}A`,down:(e=1)=>`${D}${e}B`,forward:(e=1)=>`${D}${e}C`,backward:(e=1)=>`${D}${e}D`,nextLine:(e=1)=>`${D}E`.repeat(e),prevLine:(e=1)=>`${D}F`.repeat(e),left:`${D}G`,hide:`${D}?25l`,show:`${D}?25h`,save:`${ht}7`,restore:`${ht}8`},Br={up:(e=1)=>`${D}S`.repeat(e),down:(e=1)=>`${D}T`.repeat(e)},kr={screen:`${D}2J`,up:(e=1)=>`${D}1J`.repeat(e),down:(e=1)=>`${D}J`.repeat(e),line:`${D}2K`,lineEnd:`${D}K`,lineStart:`${D}1K`,lines(e){let t="";for(let s=0;s<e;s++)t+=this.line+(s<e-1?dt.up():"");return e&&(t+=dt.left),t}};as.exports={cursor:dt,scroll:Br,erase:kr,beep:Or}});import{styleText as Ce}from"node:util";import{stdout as $t,stdin as hs}from"node:process";import*as ae from"node:readline";import Lr from"node:readline";import{ReadStream as cs}from"node:tty";function oe(e,t,s){if(!s.some(a=>!a.disabled))return e;let r=e+t,i=Math.max(s.length-1,0),o=r<0?i:r>i?0:r;return s[o].disabled?oe(o,t<0?-1:1,s):o}function Le(e,t,s,r){let i=r.split(`
|
|
7
|
+
`),o=0,a=e;for(let c of i){if(a<=c.length)break;a-=c.length+1,o++}for(o=Math.max(0,Math.min(i.length-1,o+s)),a=Math.min(a,i[o].length)+t;a<0&&o>0;)o--,a+=i[o].length+1;for(;a>i[o].length&&o<i.length-1;)a-=i[o].length+1,o++;a=Math.max(0,Math.min(i[o].length,a));let l=0;for(let c=0;c<o;c++)l+=i[c].length+1;return l+a}function ds(e){if(e.aliases!==void 0){let t=e.aliases;for(let s in t){if(!Object.hasOwn(t,s))continue;let r=t[s];I.actions.has(r)&&(I.aliases.has(s)||I.aliases.set(s,r))}}if(e.messages!==void 0){let t=e.messages;t.cancel!==void 0&&(I.messages.cancel=t.cancel),t.error!==void 0&&(I.messages.error=t.error)}if(e.withGuide!==void 0&&(I.withGuide=e.withGuide!==!1),e.date!==void 0){let t=e.date;t.monthNames!==void 0&&(I.date.monthNames=[...t.monthNames]),t.messages!==void 0&&(t.messages.required!==void 0&&(I.date.messages.required=t.messages.required),t.messages.invalidMonth!==void 0&&(I.date.messages.invalidMonth=t.messages.invalidMonth),t.messages.invalidDay!==void 0&&(I.date.messages.invalidDay=t.messages.invalidDay),t.messages.afterMin!==void 0&&(I.date.messages.afterMin=t.messages.afterMin),t.messages.beforeMax!==void 0&&(I.date.messages.beforeMax=t.messages.beforeMax))}}function yt(e,t){if(typeof e=="string")return I.aliases.get(e)===t;for(let s of e)if(s!==void 0&&yt(s,t))return!0;return!1}function Dr(e,t){if(e===t)return;let s=e.split(`
|
|
8
|
+
`),r=t.split(`
|
|
9
|
+
`),i=Math.max(s.length,r.length),o=[];for(let a=0;a<i;a++)s[a]!==r[a]&&o.push(a);return{lines:o,numLinesBefore:s.length,numLinesAfter:r.length,numLines:i}}function Ie(e){return e===gt}function Pe(e,t){let s=e;s.isTTY&&s.setRawMode(t)}function ms({input:e=hs,output:t=$t,overwrite:s=!0,hideCursor:r=!0}={}){let i=ae.createInterface({input:e,output:t,prompt:"",tabSize:1});ae.emitKeypressEvents(e,i),e instanceof cs&&e.isTTY&&e.setRawMode(!0);let o=(a,{name:l,sequence:c})=>{let u=String(a);if(yt([u,l,c],"cancel")){r&&t.write(K.cursor.show),process.exit(0);return}if(!s)return;ae.moveCursor(t,l==="return"?0:-1,l==="return"?-1:0,()=>{ae.clearLine(t,1,()=>{e.once("keypress",o)})})};return r&&t.write(K.cursor.hide),e.once("keypress",o),()=>{e.off("keypress",o),r&&t.write(K.cursor.show),e instanceof cs&&e.isTTY&&!Vr&&e.setRawMode(!1),i.terminal=!1,i.close()}}function G(e,t,s,r=s,i=s,o){let a=he(e??$t);return se(t,a-s.length,{hard:!0,trim:!1}).split(`
|
|
10
|
+
`).map((l,c,u)=>{let d=o?o(l,c):l;return c===0?`${r}${d}`:c===u.length-1?`${i}${d}`:`${s}${d}`}).join(`
|
|
11
|
+
`)}function Ur(e,t){if(e===void 0||t.length===0)return 0;let s=t.findIndex(r=>r.value===e);return s!==-1?s:0}function Gr(e,t){return(t.label??String(t.value)).toLowerCase().includes(e.toLowerCase())}function jr(e,t){if(t)return e?t:t[0]}function ls(e){return[...e].map(t=>Wr[t])}function qr(e){let t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date(2e3,0,15)),s=[],r="/";for(let i of t)i.type==="literal"?r=i.value.trim()||i.value:(i.type==="year"||i.type==="month"||i.type==="day")&&s.push({type:i.type,len:i.type==="year"?4:2});return{segments:s,separator:r}}function pt(e){return Number.parseInt((e||"0").replace(/_/g,"0"),10)||0}function Ne(e){return{year:pt(e.year),month:pt(e.month),day:pt(e.day)}}function ft(e,t){return new Date(e||2001,t||1,0).getDate()}function ps(e){let{year:t,month:s,day:r}=Ne(e);if(!t||t<0||t>9999||!s||s<1||s>12||!r||r<1)return;let i=new Date(Date.UTC(t,s-1,r));if(!(i.getUTCFullYear()!==t||i.getUTCMonth()!==s-1||i.getUTCDate()!==r))return{year:t,month:s,day:r}}function us(e){let t=ps(e);return t?new Date(Date.UTC(t.year,t.month-1,t.day)):void 0}function Hr(e,t,s,r){let i=s?{year:s.getUTCFullYear(),month:s.getUTCMonth()+1,day:s.getUTCDate()}:null,o=r?{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate()}:null;return e==="year"?{min:i?.year??1,max:o?.year??9999}:e==="month"?{min:i&&t.year===i.year?i.month:1,max:o&&t.year===o.year?o.month:12}:{min:i&&t.year===i.year&&t.month===i.month?i.day:1,max:o&&t.year===o.year&&t.month===o.month?o.day:ft(t.year,t.month)}}var K,Pr,Nr,I,Vr,gt,he,vt,ne,bt,De,Wr,Ve,Ue,Ge,gs,je,We,qe,He,wt=we(()=>{ut();K=Wt(mt(),1);Pr=["up","down","left","right","space","enter","cancel"],Nr=["January","February","March","April","May","June","July","August","September","October","November","December"],I={actions:new Set(Pr),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...Nr],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};Vr=globalThis.process.platform.startsWith("win"),gt=Symbol("clack:cancel");he=e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,vt=e=>"rows"in e&&typeof e.rows=="number"?e.rows:20;ne=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(e,t=!0){let{input:s=hs,output:r=$t,render:i,signal:o,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=t,this._abortSignal=o,this.input=s,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let s=this._subscribers.get(e)??[];s.push(t),this._subscribers.set(e,s)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let s=this._subscribers.get(e)??[],r=[];for(let i of s)i.cb(...t),i.once&&r.push(()=>s.splice(s.indexOf(i),1));for(let i of r)i()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(gt);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=Lr.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),Pe(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(K.cursor.show),this.output.off("resize",this.render),Pe(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(K.cursor.show),this.output.off("resize",this.render),Pe(this.input,!1),e(gt)})})}_isActionKey(e,t){return e===" "}_shouldSubmit(e,t){return!0}_setValue(e){this.value=e,this.emit("value",this.value)}_setUserInput(e,t){this.userInput=e??"",this.emit("userInput",this.userInput),t&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(e,t){if(this._track&&t.name!=="return"&&(t.name&&this._isActionKey(e,t)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),t?.name&&(!this._track&&I.aliases.has(t.name)&&this.emit("cursor",I.aliases.get(t.name)),I.actions.has(t.name)&&this.emit("cursor",t.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),this.emit("key",e?.toLowerCase(),t),t?.name==="return"&&this._shouldSubmit(e,t)){if(this.opts.validate){let s=this.opts.validate(this.value);s&&(this.error=s instanceof Error?s.message:s,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}yt([e,t?.name,t?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
12
|
+
`),Pe(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=se(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
|
|
13
|
+
`).length-1;this.output.write(K.cursor.move(-999,e*-1))}render(){let e=se(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(K.cursor.hide);else{let t=Dr(this._prevFrame,e),s=vt(this.output);if(this.restoreCursor(),t){let r=Math.max(0,t.numLinesAfter-s),i=Math.max(0,t.numLinesBefore-s),o=t.lines.find(a=>a>=r);if(o===void 0){this._prevFrame=e;return}if(t.lines.length===1){this.output.write(K.cursor.move(0,o-i)),this.output.write(K.erase.lines(1));let a=e.split(`
|
|
14
|
+
`);this.output.write(a[o]),this._prevFrame=e,this.output.write(K.cursor.move(0,a.length-o-1));return}else if(t.lines.length>1){if(r<i)o=r;else{let l=o-i;l>0&&this.output.write(K.cursor.move(0,l))}this.output.write(K.erase.down());let a=e.split(`
|
|
15
|
+
`).slice(o);this.output.write(a.join(`
|
|
16
|
+
`)),this._prevFrame=e;return}}this.output.write(K.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};bt=class extends ne{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#t=0;#i="";#e;#n;#a;get cursor(){return this.#t}get userInputWithCursor(){if(!this.userInput)return Ce(["inverse","hidden"],"_");if(this._cursor>=this.userInput.length)return`${this.userInput}\u2588`;let e=this.userInput.slice(0,this._cursor),[t,...s]=this.userInput.slice(this._cursor);return`${e}${Ce("inverse",t)}${s.join("")}`}get options(){return typeof this.#n=="function"?this.#n():this.#n}constructor(e){super(e),this.#n=e.options,this.#a=e.placeholder;let t=this.options;this.filteredOptions=[...t],this.multiple=e.multiple===!0,this.#e=typeof e.options=="function"?e.filter:e.filter??Gr;let s;if(e.initialValue&&Array.isArray(e.initialValue)?this.multiple?s=e.initialValue:s=e.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(s=[this.options[0].value]),s)for(let r of s){let i=t.findIndex(o=>o.value===r);i!==-1&&(this.toggleSelected(r),this.#t=i)}this.focusedValue=this.options[this.#t]?.value,this.on("key",(r,i)=>this.#s(r,i)),this.on("userInput",r=>this.#r(r))}_isActionKey(e,t){return e===" "||this.multiple&&this.isNavigating&&t.name==="space"&&e!==void 0&&e!==""}#s(e,t){let s=t.name==="up",r=t.name==="down",i=t.name==="return",o=this.userInput===""||this.userInput===" ",a=this.#a,l=this.options,c=a!==void 0&&a!==""&&l.some(u=>!u.disabled&&(this.#e?this.#e(a,u):!0));if(t.name==="tab"&&o&&c){this.userInput===" "&&this._clearUserInput(),this._setUserInput(a,!0),this.isNavigating=!1;return}s||r?(this.#t=oe(this.#t,s?-1:1,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#t]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):i?this.value=jr(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(t.name==="tab"||this.isNavigating&&t.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected(e){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(e)?this.selectedValues=this.selectedValues.filter(t=>t!==e):this.selectedValues=[...this.selectedValues,e]:this.selectedValues=[e])}#r(e){if(e!==this.#i){this.#i=e;let t=this.options;e&&this.#e?this.filteredOptions=t.filter(i=>this.#e?.(e,i)):this.filteredOptions=[...t];let s=Ur(this.focusedValue,this.filteredOptions);this.#t=oe(s,0,this.filteredOptions);let r=this.filteredOptions[this.#t];r&&!r.disabled?this.focusedValue=r.value:this.focusedValue=void 0,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}},De=class extends ne{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",s=>{this.output.write(K.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},Wr={Y:{type:"year",len:4},M:{type:"month",len:2},D:{type:"day",len:2}};Ve=class extends ne{#t;#i;#e;#n;#a;#s={segmentIndex:0,positionInSegment:0};#r=!0;#o=null;inlineError="";get segmentCursor(){return{...this.#s}}get segmentValues(){return{...this.#e}}get segments(){return this.#t}get separator(){return this.#i}get formattedValue(){return this.#h(this.#e)}#h(t){return this.#t.map(s=>t[s.type]).join(this.#i)}#c(){this._setUserInput(this.#h(this.#e)),this._setValue(us(this.#e)??void 0)}constructor(t){let s=t.format?{segments:ls(t.format),separator:t.separator??"/"}:qr(t.locale),r=t.separator??s.separator,i=t.format?ls(t.format):s.segments,o=t.initialValue??t.defaultValue,a=o?{year:String(o.getUTCFullYear()).padStart(4,"0"),month:String(o.getUTCMonth()+1).padStart(2,"0"),day:String(o.getUTCDate()).padStart(2,"0")}:{year:"____",month:"__",day:"__"},l=i.map(c=>a[c.type]).join(r);super({...t,initialUserInput:l},!1),this.#t=i,this.#i=r,this.#e=a,this.#n=t.minDate,this.#a=t.maxDate,this.#c(),this.on("cursor",c=>this.#p(c)),this.on("key",(c,u)=>this.#g(c,u)),this.on("finalize",()=>this.#f(t))}#l(){let t=Math.max(0,Math.min(this.#s.segmentIndex,this.#t.length-1)),s=this.#t[t];if(s)return this.#s.positionInSegment=Math.max(0,Math.min(this.#s.positionInSegment,s.len-1)),{segment:s,index:t}}#u(t){this.inlineError="",this.#o=null;let s=this.#l();s&&(this.#s.segmentIndex=Math.max(0,Math.min(this.#t.length-1,s.index+t)),this.#s.positionInSegment=0,this.#r=!0)}#d(t){let s=this.#l();if(!s)return;let{segment:r}=s,i=this.#e[r.type],o=!i||i.replace(/_/g,"")==="",a=Number.parseInt((i||"0").replace(/_/g,"0"),10)||0,l=Hr(r.type,Ne(this.#e),this.#n,this.#a),c;o?c=t===1?l.min:l.max:c=Math.max(Math.min(l.max,a+t),l.min),this.#e={...this.#e,[r.type]:c.toString().padStart(r.len,"0")},this.#r=!0,this.#o=null,this.#c()}#p(t){if(t)switch(t){case"right":return this.#u(1);case"left":return this.#u(-1);case"up":return this.#d(1);case"down":return this.#d(-1)}}#g(t,s){if(s?.name==="backspace"||s?.sequence==="\x7F"||s?.sequence==="\b"||t==="\x7F"||t==="\b"){this.inlineError="";let r=this.#l();if(!r)return;if(!this.#e[r.segment.type].replace(/_/g,"")){this.#u(-1);return}this.#e[r.segment.type]="_".repeat(r.segment.len),this.#r=!0,this.#s.positionInSegment=0,this.#c();return}if(s?.name==="tab"){this.inlineError="";let r=this.#l();if(!r)return;let i=s.shift?-1:1,o=r.index+i;o>=0&&o<this.#t.length&&(this.#s.segmentIndex=o,this.#s.positionInSegment=0,this.#r=!0);return}if(t&&/^[0-9]$/.test(t)){let r=this.#l();if(!r)return;let{segment:i}=r,o=!this.#e[i.type].replace(/_/g,"");if(this.#r&&this.#o!==null&&!o){let y=this.#o+t,m={...this.#e,[i.type]:y},b=this.#m(m,i);if(b){this.inlineError=b,this.#o=null,this.#r=!1;return}this.inlineError="",this.#e[i.type]=y,this.#o=null,this.#r=!1,this.#c(),r.index<this.#t.length-1&&(this.#s.segmentIndex=r.index+1,this.#s.positionInSegment=0,this.#r=!0);return}this.#r&&!o&&(this.#e[i.type]="_".repeat(i.len),this.#s.positionInSegment=0),this.#r=!1,this.#o=null;let a=this.#e[i.type],l=a.indexOf("_"),c=l>=0?l:Math.min(this.#s.positionInSegment,i.len-1);if(c<0||c>=i.len)return;let u=a.slice(0,c)+t+a.slice(c+1),d=!1;if(c===0&&a==="__"&&(i.type==="month"||i.type==="day")){let y=Number.parseInt(t,10);u=`0${t}`,d=y<=(i.type==="month"?1:2)}if(i.type==="year"&&(u=(a.replace(/_/g,"")+t).padStart(i.len,"_")),!u.includes("_")){let y={...this.#e,[i.type]:u},m=this.#m(y,i);if(m){this.inlineError=m;return}}this.inlineError="",this.#e[i.type]=u;let g=u.includes("_")?void 0:ps(this.#e);if(g){let{year:y,month:m}=g,b=ft(y,m);this.#e={year:String(Math.max(0,Math.min(9999,y))).padStart(4,"0"),month:String(Math.max(1,Math.min(12,m))).padStart(2,"0"),day:String(Math.max(1,Math.min(b,g.day))).padStart(2,"0")}}this.#c();let p=u.indexOf("_");d?(this.#r=!0,this.#o=t):p>=0?this.#s.positionInSegment=p:l>=0&&r.index<this.#t.length-1?(this.#s.segmentIndex=r.index+1,this.#s.positionInSegment=0,this.#r=!0):this.#s.positionInSegment=Math.min(c+1,i.len-1)}}#m(t,s){let{month:r,day:i}=Ne(t);if(s.type==="month"&&(r<0||r>12))return I.date.messages.invalidMonth;if(s.type==="day"&&(i<0||i>31))return I.date.messages.invalidDay(31,"any month")}#f(t){let{year:s,month:r,day:i}=Ne(this.#e);if(s&&r&&i){let o=ft(s,r);this.#e={...this.#e,day:String(Math.min(i,o)).padStart(2,"0")}}this.value=us(this.#e)??t.defaultValue??void 0}},Ue=class extends ne{options;cursor=0;#t;getGroupItems(t){return this.options.filter(s=>s.group===t)}isGroupSelected(t){let s=this.getGroupItems(t),r=this.value;return r===void 0?!1:s.every(i=>r.includes(i.value))}toggleValue(){let t=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),t.group===!0){let s=t.value,r=this.getGroupItems(s);this.isGroupSelected(s)?this.value=this.value.filter(i=>r.findIndex(o=>o.value===i)===-1):this.value=[...this.value,...r.map(i=>i.value)],this.value=Array.from(new Set(this.value))}else{let s=this.value.includes(t.value);this.value=s?this.value.filter(r=>r!==t.value):[...this.value,t.value]}}constructor(t){super(t,!1);let{options:s}=t;this.#t=t.selectableGroups!==!1,this.options=Object.entries(s).flatMap(([r,i])=>[{value:r,group:!0,label:r},...i.map(o=>({...o,group:r}))]),this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:r})=>r===t.cursorAt),this.#t?0:1),this.on("cursor",r=>{switch(r){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let i=this.options[this.cursor]?.group===!0;!this.#t&&i&&(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;let i=this.options[this.cursor]?.group===!0;!this.#t&&i&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}},Ge=class extends ne{#t=!1;#i;focused="editor";get userInputWithCursor(){if(this.state==="submit")return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${t}\u2588`;let s=t.slice(0,this.cursor),r=t[this.cursor],i=t.slice(this.cursor+1);return r===`
|
|
17
|
+
`?`${s}\u2588
|
|
18
|
+
${i}`:`${s}${Ce("inverse",r)}${i}`}get cursor(){return this._cursor}#e(t){if(this.userInput.length===0){this._setUserInput(t);return}this._setUserInput(this.userInput.slice(0,this.cursor)+t+this.userInput.slice(this.cursor))}#n(t){let s=this.value??"";switch(t){case"up":this._cursor=Le(this._cursor,0,-1,s);return;case"down":this._cursor=Le(this._cursor,0,1,s);return;case"left":this._cursor=Le(this._cursor,-1,0,s);return;case"right":this._cursor=Le(this._cursor,1,0,s);return}}_shouldSubmit(t,s){if(this.#i)return this.focused==="submit"?!0:(this.#e(`
|
|
19
|
+
`),this._cursor++,!1);let r=this.#t;return this.#t=!0,r?(this.userInput[this.cursor-1]===`
|
|
20
|
+
`&&(this._setUserInput(this.userInput.slice(0,this.cursor-1)+this.userInput.slice(this.cursor)),this._cursor--),!0):(this.#e(`
|
|
21
|
+
`),this._cursor++,!1)}constructor(t){super(t,!1),this.#i=t.showSubmit??!1,this.on("key",(s,r)=>{if(r?.name&&I.actions.has(r.name)){this.#n(r.name);return}if(s===" "&&this.#i){this.focused=this.focused==="editor"?"submit":"editor";return}if(r?.name!=="return"){if(this.#t=!1,r?.name==="backspace"&&this.cursor>0){this._setUserInput(this.userInput.slice(0,this.cursor-1)+this.userInput.slice(this.cursor)),this._cursor--;return}if(r?.name==="delete"&&this.cursor<this.userInput.length){this._setUserInput(this.userInput.slice(0,this.cursor)+this.userInput.slice(this.cursor+1));return}s&&(this.#i&&this.focused==="submit"&&(this.focused="editor"),this.#e(s??""),this._cursor++)}}),this.on("userInput",s=>{this._setValue(s)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}},gs=class extends ne{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter(e=>e.disabled!==!0)}toggleAll(){let e=this._enabledOptions,t=this.value!==void 0&&this.value.length===e.length;this.value=t?[]:e.map(s=>s.value)}toggleInvert(){let e=this.value;if(!e)return;let t=this._enabledOptions.filter(s=>!e.includes(s.value));this.value=t.map(s=>s.value)}toggleValue(){this.value===void 0&&(this.value=[]);let e=this.value.includes(this._value);this.value=e?this.value.filter(t=>t!==this._value):[...this.value,this._value]}constructor(e){super(e,!1),this.options=e.options,this.value=[...e.initialValues??[]];let t=Math.max(this.options.findIndex(({value:s})=>s===e.cursorAt),0);this.cursor=this.options[t].disabled?oe(t,1,this.options):t,this.on("key",s=>{s==="a"&&this.toggleAll(),s==="i"&&this.toggleInvert()}),this.on("cursor",s=>{switch(s){case"left":case"up":this.cursor=oe(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=oe(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}},je=class extends ne{_mask="\u2022";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;let t=this.userInput;if(this.cursor>=t.length)return`${this.masked}${Ce(["inverse","hidden"],"_")}`;let s=this.masked,r=s.slice(0,this.cursor),i=s.slice(this.cursor);return`${r}${Ce("inverse",i[0])}${i.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:t,...s}){super(s),this._mask=t??"\u2022",this.on("userInput",r=>{this._setValue(r)})}},We=class extends ne{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(t){super(t,!1),this.options=t.options;let s=this.options.findIndex(({value:i})=>i===t.initialValue),r=s===-1?0:s;this.cursor=this.options[r].disabled?oe(r,1,this.options):r,this.changeValue(),this.on("cursor",i=>{switch(i){case"left":case"up":this.cursor=oe(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=oe(this.cursor,1,this.options);break}this.changeValue()})}},qe=class extends ne{options;cursor=0;constructor(t){super(t,!1),this.options=t.options;let s=t.caseSensitive===!0,r=this.options.map(({value:[i]})=>s?i:i?.toLowerCase());this.cursor=Math.max(r.indexOf(t.initialValue),0),this.on("key",(i,o)=>{if(!i)return;let a=s&&o.shift?i.toUpperCase():i;if(!r.includes(a))return;let l=this.options.find(({value:[c]})=>s?c===a:c?.toLowerCase()===i);l&&(this.value=l.value,this.state="submit",this.emit("submit"))})}},He=class extends ne{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${this.userInput}\u2588`;let s=t.slice(0,this.cursor),[r,...i]=t.slice(this.cursor);return`${s}${Ce("inverse",r)}${i.join("")}`}get cursor(){return this._cursor}constructor(t){super({...t,initialUserInput:t.initialUserInput??t.initialValue}),this.on("userInput",s=>{this._setValue(s)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}}});var Ms={};yr(Ms,{S_BAR:()=>f,S_BAR_END:()=>V,S_BAR_END_RIGHT:()=>xs,S_BAR_H:()=>Ye,S_BAR_START:()=>xt,S_BAR_START_RIGHT:()=>Es,S_CHECKBOX_ACTIVE:()=>Je,S_CHECKBOX_INACTIVE:()=>Ee,S_CHECKBOX_SELECTED:()=>me,S_CONNECT_LEFT:()=>Rs,S_CORNER_BOTTOM_LEFT:()=>_t,S_CORNER_BOTTOM_RIGHT:()=>Rt,S_CORNER_TOP_LEFT:()=>_s,S_CORNER_TOP_RIGHT:()=>Tt,S_ERROR:()=>Ot,S_INFO:()=>At,S_PASSWORD_MASK:()=>Ts,S_RADIO_ACTIVE:()=>Fe,S_RADIO_INACTIVE:()=>pe,S_STEP_ACTIVE:()=>Ss,S_STEP_CANCEL:()=>St,S_STEP_ERROR:()=>Et,S_STEP_SUBMIT:()=>ge,S_SUCCESS:()=>Ft,S_WARN:()=>Mt,autocomplete:()=>Fs,autocompleteMultiselect:()=>Xr,box:()=>si,cancel:()=>Me,confirm:()=>le,date:()=>ri,group:()=>ai,groupMultiselect:()=>ci,intro:()=>kt,isCI:()=>It,isCancel:()=>Ie,isTTY:()=>Is,limitOptions:()=>ce,log:()=>E,multiline:()=>li,multiselect:()=>Pt,note:()=>fe,outro:()=>Lt,password:()=>di,path:()=>mi,progress:()=>gi,select:()=>H,selectKey:()=>fi,settings:()=>I,spinner:()=>$e,stream:()=>de,symbol:()=>J,symbolBar:()=>Bt,taskLog:()=>vi,tasks:()=>$i,text:()=>ue,unicode:()=>ze,unicodeOr:()=>_,updateSettings:()=>ds});import{styleText as n,stripVTControlCharacters as Ct}from"node:util";import X from"node:process";import{existsSync as Kr,lstatSync as fs,readdirSync as zr}from"node:fs";import{dirname as $s,join as Jr}from"node:path";function Yr(){return X.platform!=="win32"?X.env.TERM!=="linux":!!X.env.CI||!!X.env.WT_SESSION||!!X.env.TERMINUS_SUBLIME||X.env.ConEmuTask==="{cmd::Cmder}"||X.env.TERM_PROGRAM==="Terminus-Sublime"||X.env.TERM_PROGRAM==="vscode"||X.env.TERM==="xterm-256color"||X.env.TERM==="alacritty"||X.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}function vs(e){return e.label??String(e.value??"")}function As(e,t){if(!e)return!0;let s=(t.label??String(t.value??"")).toLowerCase(),r=(t.hint??"").toLowerCase(),i=String(t.value).toLowerCase(),o=e.toLowerCase();return s.includes(o)||r.includes(o)||i.includes(o)}function Qr(e,t){let s=[];for(let r of t)e.includes(r.value)&&s.push(r);return s}function bs(e,t,s,r){let i=s,o=s;return r==="center"?i=Math.floor((t-e)/2):r==="right"&&(i=t-e-s),o=t-i-e,[i,o]}function ii(e,t){let s=e.segmentValues,r=e.segmentCursor;if(t==="submit"||t==="cancel")return e.formattedValue;let i=n("gray",e.separator);return e.segments.map((o,a)=>{let l=a===r.segmentIndex&&!["submit","cancel"].includes(t),c=oi[o.type];return ni(s[o.type],{isActive:l,label:c})}).join(i)}function ni(e,t){let s=!e||e.replace(/_/g,"")==="";return t.isActive?n("inverse",s?t.label:e.replace(/_/g," ")):s?n("dim",t.label):e.replace(/_/g,n("dim"," "))}function gi({style:e="heavy",max:t=100,size:s=40,...r}={}){let i=$e(r),o=0,a="",l=Math.max(1,t),c=Math.max(1,s),u=y=>{switch(y){case"initial":case"active":return m=>n("magenta",m);case"error":case"cancel":return m=>n("red",m);case"submit":return m=>n("green",m);default:return m=>n("magenta",m)}},d=(y,m)=>{let b=Math.floor(o/l*c);return`${u(y)(ws[e].repeat(b))}${n("dim",ws[e].repeat(c-b))} ${m}`},g=(y="")=>{a=y,i.start(d("initial",y))},p=(y=1,m)=>{o=Math.min(l,y+o),i.message(d("active",m??a)),a=m??a};return{start:g,stop:i.stop,cancel:i.cancel,error:i.error,clear:i.clear,advance:p,isCancelled:i.isCancelled,message:y=>p(0,y)}}var Se,ze,It,Is,_,Ss,St,Et,ge,xt,f,V,Es,xs,Fe,pe,Je,me,Ee,Ts,Ye,Tt,Rs,Rt,_t,_s,At,Ft,Mt,Ot,J,Bt,ys,ce,Fs,Xr,Zr,ei,ti,si,le,ri,oi,ai,ci,E,Me,kt,Lt,li,Ae,Pt,ui,hi,fe,di,mi,pi,$e,ws,Ke,H,fi,Cs,de,$i,yi,vi,ue,Z=we(()=>{wt();wt();ut();ot();Se=Wt(mt(),1);ze=Yr(),It=()=>process.env.CI==="true",Is=e=>e.isTTY===!0,_=(e,t)=>ze?e:t,Ss=_("\u25C6","*"),St=_("\u25A0","x"),Et=_("\u25B2","x"),ge=_("\u25C7","o"),xt=_("\u250C","T"),f=_("\u2502","|"),V=_("\u2514","\u2014"),Es=_("\u2510","T"),xs=_("\u2518","\u2014"),Fe=_("\u25CF",">"),pe=_("\u25CB"," "),Je=_("\u25FB","[\u2022]"),me=_("\u25FC","[+]"),Ee=_("\u25FB","[ ]"),Ts=_("\u25AA","\u2022"),Ye=_("\u2500","-"),Tt=_("\u256E","+"),Rs=_("\u251C","+"),Rt=_("\u256F","+"),_t=_("\u2570","+"),_s=_("\u256D","+"),At=_("\u25CF","\u2022"),Ft=_("\u25C6","*"),Mt=_("\u25B2","!"),Ot=_("\u25A0","x"),J=e=>{switch(e){case"initial":case"active":return n("cyan",Ss);case"cancel":return n("red",St);case"error":return n("yellow",Et);case"submit":return n("green",ge)}},Bt=e=>{switch(e){case"initial":case"active":return n("cyan",f);case"cancel":return n("red",f);case"error":return n("yellow",f);case"submit":return n("green",f)}},ys=(e,t,s,r,i,o=!1)=>{let a=t,l=0;if(o)for(let c=r-1;c>=s&&(a-=e[c].length,l++,!(a<=i));c--);else for(let c=s;c<r&&(a-=e[c].length,l++,!(a<=i));c++);return{lineCount:a,removals:l}},ce=({cursor:e,options:t,style:s,output:r=process.stdout,maxItems:i=Number.POSITIVE_INFINITY,columnPadding:o=0,rowPadding:a=4})=>{let l=he(r)-o,c=vt(r),u=n("dim","..."),d=Math.max(c-a,0),g=Math.max(Math.min(i,d),5),p=0;e>=g-3&&(p=Math.max(Math.min(e-g+3,t.length-g),0));let y=g<t.length&&p>0,m=g<t.length&&p+g<t.length,b=Math.min(p+g,t.length),$=[],v=0;y&&v++,m&&v++;let C=p+(y?1:0),T=b-(m?1:0);for(let x=C;x<T;x++){let L=se(s(t[x],x===e),l,{hard:!0,trim:!1}).split(`
|
|
22
|
+
`);$.push(L),v+=L.length}if(v>d){let x=0,L=0,M=v,k=e-C,N=d,W=()=>ys($,M,0,k,N),w=()=>ys($,M,k+1,$.length,N,!0);y?({lineCount:M,removals:x}=W(),M>N&&(m||(N-=1),{lineCount:M,removals:L}=w())):(m||(N-=1),{lineCount:M,removals:L}=w(),M>N&&(N-=1,{lineCount:M,removals:x}=W())),x>0&&(y=!0,$.splice(0,x)),L>0&&(m=!0,$.splice($.length-L,L))}let R=[];y&&R.push(u);for(let x of $)for(let L of x)R.push(L);return m&&R.push(u),R};Fs=e=>new bt({options:e.options,initialValue:e.initialValue?[e.initialValue]:void 0,initialUserInput:e.initialUserInput,placeholder:e.placeholder,filter:e.filter??((t,s)=>As(t,s)),signal:e.signal,input:e.input,output:e.output,validate:e.validate,render(){let t=e.withGuide??I.withGuide,s=t?[`${n("gray",f)}`,`${J(this.state)} ${e.message}`]:[`${J(this.state)} ${e.message}`],r=this.userInput,i=this.options,o=e.placeholder,a=r===""&&o!==void 0,l=(c,u)=>{let d=vs(c),g=c.hint&&c.value===this.focusedValue?n("dim",` (${c.hint})`):"";switch(u){case"active":return`${n("green",Fe)} ${d}${g}`;case"inactive":return`${n("dim",pe)} ${n("dim",d)}`;case"disabled":return`${n("gray",pe)} ${n(["strikethrough","gray"],d)}`}};switch(this.state){case"submit":{let c=Qr(this.selectedValues,i),u=c.length>0?` ${n("dim",c.map(vs).join(", "))}`:"",d=t?n("gray",f):"";return`${s.join(`
|
|
23
|
+
`)}
|
|
24
|
+
${d}${u}`}case"cancel":{let c=r?` ${n(["strikethrough","dim"],r)}`:"",u=t?n("gray",f):"";return`${s.join(`
|
|
25
|
+
`)}
|
|
26
|
+
${u}${c}`}default:{let c=this.state==="error"?"yellow":"cyan",u=t?`${n(c,f)} `:"",d=t?n(c,V):"",g="";if(this.isNavigating||a){let C=a?o:r;g=C!==""?` ${n("dim",C)}`:""}else g=` ${this.userInputWithCursor}`;let p=this.filteredOptions.length!==i.length?n("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"",y=this.filteredOptions.length===0&&r?[`${u}${n("yellow","No matches found")}`]:[],m=this.state==="error"?[`${u}${n("yellow",this.error)}`]:[];t&&s.push(`${u.trimEnd()}`),s.push(`${u}${n("dim","Search:")}${g}${p}`,...y,...m);let b=[`${n("dim","\u2191/\u2193")} to select`,`${n("dim","Enter:")} confirm`,`${n("dim","Type:")} to search`],$=[`${u}${b.join(" \u2022 ")}`,d],v=this.filteredOptions.length===0?[]:ce({cursor:this.cursor,options:this.filteredOptions,columnPadding:t?3:0,rowPadding:s.length+$.length,style:(C,T)=>l(C,C.disabled?"disabled":T?"active":"inactive"),maxItems:e.maxItems,output:e.output});return[...s,...v.map(C=>`${u}${C}`),...$].join(`
|
|
27
|
+
`)}}}}).prompt(),Xr=e=>{let t=(r,i,o,a)=>{let l=o.includes(r.value),c=r.label??String(r.value??""),u=r.hint&&a!==void 0&&r.value===a?n("dim",` (${r.hint})`):"",d=l?n("green",me):n("dim",Ee);return r.disabled?`${n("gray",Ee)} ${n(["strikethrough","gray"],c)}`:i?`${d} ${c}${u}`:`${d} ${n("dim",c)}`},s=new bt({options:e.options,multiple:!0,placeholder:e.placeholder,filter:e.filter??((r,i)=>As(r,i)),validate:()=>{if(e.required&&s.selectedValues.length===0)return"Please select at least one item"},initialValue:e.initialValues,signal:e.signal,input:e.input,output:e.output,render(){let r=e.withGuide??I.withGuide,i=`${r?`${n("gray",f)}
|
|
28
|
+
`:""}${J(this.state)} ${e.message}
|
|
29
|
+
`,o=this.userInput,a=e.placeholder,l=o===""&&a!==void 0,c=this.isNavigating||l?n("dim",l?a:o):this.userInputWithCursor,u=this.options,d=this.filteredOptions.length!==u.length?n("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"";switch(this.state){case"submit":return`${i}${r?`${n("gray",f)} `:""}${n("dim",`${this.selectedValues.length} items selected`)}`;case"cancel":return`${i}${r?`${n("gray",f)} `:""}${n(["strikethrough","dim"],o)}`;default:{let g=this.state==="error"?"yellow":"cyan",p=r?`${n(g,f)} `:"",y=r?n(g,V):"",m=[`${n("dim","\u2191/\u2193")} to navigate`,`${n("dim",this.isNavigating?"Space/Tab:":"Tab:")} select`,`${n("dim","Enter:")} confirm`,`${n("dim","Type:")} to search`],b=this.filteredOptions.length===0&&o?[`${p}${n("yellow","No matches found")}`]:[],$=this.state==="error"?[`${p}${n("yellow",this.error)}`]:[],v=[...`${i}${r?n(g,f):""}`.split(`
|
|
30
|
+
`),`${p}${n("dim","Search:")} ${c}${d}`,...b,...$],C=[`${p}${m.join(" \u2022 ")}`,y],T=ce({cursor:this.cursor,options:this.filteredOptions,style:(R,x)=>t(R,x,this.selectedValues,this.focusedValue),maxItems:e.maxItems,output:e.output,rowPadding:v.length+C.length});return[...v,...T.map(R=>`${p}${R}`),...C].join(`
|
|
31
|
+
`)}}}});return s.prompt()},Zr=[_s,Tt,_t,Rt],ei=[xt,Es,V,xs];ti=e=>e,si=(e="",t="",s)=>{let r=s?.output??process.stdout,i=he(r),o=2,a=s?.titlePadding??1,l=s?.contentPadding??2,c=s?.width===void 0||s.width==="auto"?1:Math.min(1,s.width),u=s?.withGuide??I.withGuide?`${f} `:"",d=s?.formatBorder??ti,g=(s?.rounded?Zr:ei).map(d),p=d(Ye),y=d(f),m=j(u),b=j(t),$=i-m,v=Math.floor(i*c)-m;if(s?.width==="auto"){let N=e.split(`
|
|
32
|
+
`),W=b+a*2;for(let O of N){let q=j(O)+l*2;q>W&&(W=q)}let w=W+o;w<v&&(v=w)}v%2!==0&&(v<$?v++:v--);let C=v-o,T=C-a*2,R=b>T?`${t.slice(0,T-3)}...`:t,[x,L]=bs(j(R),C,a,s?.titleAlign),M=se(e,C-l*2,{hard:!0,trim:!1});r.write(`${u}${g[0]}${p.repeat(x)}${R}${p.repeat(L)}${g[1]}
|
|
33
|
+
`);let k=M.split(`
|
|
34
|
+
`);for(let N of k){let[W,w]=bs(j(N),C,l,s?.contentAlign);r.write(`${u}${y}${" ".repeat(W)}${N}${" ".repeat(w)}${y}
|
|
35
|
+
`)}r.write(`${u}${g[2]}${p.repeat(C)}${g[3]}
|
|
36
|
+
`)},le=e=>{let t=e.active??"Yes",s=e.inactive??"No";return new De({active:t,inactive:s,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let r=e.withGuide??I.withGuide,i=`${J(this.state)} `,o=r?`${n("gray",f)} `:"",a=G(e.output,e.message,o,i),l=`${r?`${n("gray",f)}
|
|
37
|
+
`:""}${a}
|
|
38
|
+
`,c=this.value?t:s;switch(this.state){case"submit":{let u=r?`${n("gray",f)} `:"";return`${l}${u}${n("dim",c)}`}case"cancel":{let u=r?`${n("gray",f)} `:"";return`${l}${u}${n(["strikethrough","dim"],c)}${r?`
|
|
39
|
+
${n("gray",f)}`:""}`}default:{let u=r?`${n("cyan",f)} `:"",d=r?n("cyan",V):"";return`${l}${u}${this.value?`${n("green",Fe)} ${t}`:`${n("dim",pe)} ${n("dim",t)}`}${e.vertical?r?`
|
|
40
|
+
${n("cyan",f)} `:`
|
|
41
|
+
`:` ${n("dim","/")} `}${this.value?`${n("dim",pe)} ${n("dim",s)}`:`${n("green",Fe)} ${s}`}
|
|
42
|
+
${d}
|
|
43
|
+
`}}}}).prompt()},ri=e=>{let t=e.validate;return new Ve({...e,validate(s){if(s===void 0)return e.defaultValue!==void 0?void 0:t?t(s):I.date.messages.required;let r=i=>i.toISOString().slice(0,10);if(e.minDate&&r(s)<r(e.minDate))return I.date.messages.afterMin(e.minDate);if(e.maxDate&&r(s)>r(e.maxDate))return I.date.messages.beforeMax(e.maxDate);if(t)return t(s)},render(){let s=(e?.withGuide??I.withGuide)!==!1,r=`${`${s?`${n("gray",f)}
|
|
44
|
+
`:""}${J(this.state)} `}${e.message}
|
|
45
|
+
`,i=this.state!=="initial"?this.state:"active",o=ii(this,i),a=this.value instanceof Date?this.formattedValue:"";switch(this.state){case"error":{let l=this.error?` ${n("yellow",this.error)}`:"",c=s?`${n("yellow",f)} `:"",u=s?n("yellow",V):"";return`${r.trim()}
|
|
46
|
+
${c}${o}
|
|
47
|
+
${u}${l}
|
|
48
|
+
`}case"submit":{let l=a?` ${n("dim",a)}`:"",c=s?n("gray",f):"";return`${r}${c}${l}`}case"cancel":{let l=a?` ${n(["strikethrough","dim"],a)}`:"",c=s?n("gray",f):"";return`${r}${c}${l}${a.trim()?`
|
|
49
|
+
${c}`:""}`}default:{let l=s?`${n("cyan",f)} `:"",c=s?n("cyan",V):"",u=s?`${n("cyan",f)} `:"",d=this.inlineError?`
|
|
50
|
+
${u}${n("yellow",this.inlineError)}`:"";return`${r}${l}${o}${d}
|
|
51
|
+
${c}
|
|
52
|
+
`}}}}).prompt()};oi={year:"yyyy",month:"mm",day:"dd"},ai=async(e,t)=>{let s={},r=Object.keys(e);for(let i of r){let o=e[i],a=await o({results:s})?.catch(l=>{throw l});if(typeof t?.onCancel=="function"&&Ie(a)){s[i]="canceled",t.onCancel({results:s});continue}s[i]=a}return s},ci=e=>{let{selectableGroups:t=!0,groupSpacing:s=0}=e,r=(o,a,l=[])=>{let c=o.label??String(o.value),u=typeof o.group=="string",d=u&&(l[l.indexOf(o)+1]??{group:!0}),g=u&&d&&d.group===!0,p="",y="";u&&(t?(p=g?`${V} `:`${f} `,y=g?" ":`${f} `):p=" ");let m="";if(s>0&&!u&&(m=`
|
|
53
|
+
`.repeat(s)),a==="active")return G(e.output,`${c}${o.hint?` ${n("dim",`(${o.hint})`)}`:""}`,`${m}${n("dim",p)} `,`${m}${n("dim",p)}${n("cyan",Je)} `,`${m}${n("dim",y)} `);if(a==="group-active")return G(e.output,c,`${m}${p} `,`${m}${p}${n("cyan",Je)} `,`${m}${y} `,$=>n("dim",$));if(a==="group-active-selected")return G(e.output,c,`${m}${p} `,`${m}${p}${n("green",me)} `,`${m}${y} `,$=>n("dim",$));if(a==="selected"){let $=u||t?n("green",me):"";return G(e.output,`${c}${o.hint?` (${o.hint})`:""}`,`${m}${n("dim",p)} `,`${m}${n("dim",p)}${$} `,`${m}${n("dim",y)} `,v=>n("dim",v))}if(a==="cancelled")return`${n(["strikethrough","dim"],c)}`;if(a==="active-selected")return G(e.output,`${c}${o.hint?` ${n("dim",`(${o.hint})`)}`:""}`,`${m}${n("dim",p)} `,`${m}${n("dim",p)}${n("green",me)} `,`${m}${n("dim",y)} `);if(a==="submitted")return`${n("dim",c)}`;let b=u||t?n("dim",Ee):"";return G(e.output,c,`${m}${n("dim",p)} `,`${m}${n("dim",p)}${b} `,`${m}${n("dim",y)} `,$=>n("dim",$))},i=e.required??!0;return new Ue({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:i,cursorAt:e.cursorAt,selectableGroups:t,validate(o){if(i&&(o===void 0||o.length===0))return`Please select at least one option.
|
|
54
|
+
${n("reset",n("dim",`Press ${n(["gray","bgWhite","inverse"]," space ")} to select, ${n("gray",n(["bgWhite","inverse"]," enter "))} to submit`))}`},render(){let o=e.withGuide??I.withGuide,a=`${o?`${n("gray",f)}
|
|
55
|
+
`:""}${J(this.state)} ${e.message}
|
|
56
|
+
`,l=this.value??[],c=(u,d)=>{let g=this.options,p=l.includes(u.value)||u.group===!0&&this.isGroupSelected(`${u.value}`);return!d&&typeof u.group=="string"&&this.options[this.cursor].value===u.group?r(u,p?"group-active-selected":"group-active",g):d&&p?r(u,"active-selected",g):p?r(u,"selected",g):r(u,d?"active":"inactive",g)};switch(this.state){case"submit":{let u=this.options.filter(({value:g})=>l.includes(g)).map(g=>r(g,"submitted")),d=u.length===0?"":` ${u.join(n("dim",", "))}`;return`${a}${o?n("gray",f):""}${d}`}case"cancel":{let u=this.options.filter(({value:d})=>l.includes(d)).map(d=>r(d,"cancelled")).join(n("dim",", "));return`${a}${o?`${n("gray",f)} `:""}${u.trim()?`${u}${o?`
|
|
57
|
+
${n("gray",f)}`:""}`:""}`}case"error":{let u=o?`${n("yellow",f)} `:"",d=this.error.split(`
|
|
58
|
+
`).map((m,b)=>b===0?`${o?`${n("yellow",V)} `:""}${n("yellow",m)}`:` ${m}`).join(`
|
|
59
|
+
`),g=a.split(`
|
|
60
|
+
`).length,p=d.split(`
|
|
61
|
+
`).length+1,y=ce({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:u.length,rowPadding:g+p,style:c}).join(`
|
|
62
|
+
${u}`);return`${a}${u}${y}
|
|
63
|
+
${d}
|
|
64
|
+
`}default:{let u=o?`${n("cyan",f)} `:"",d=a.split(`
|
|
65
|
+
`).length,g=(o?1:0)+1,p=ce({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:u.length,rowPadding:d+g,style:c}).join(`
|
|
66
|
+
${u}`);return`${a}${u}${p}
|
|
67
|
+
${o?n("cyan",V):""}
|
|
68
|
+
`}}}}).prompt()},E={message:(e=[],{symbol:t=n("gray",f),secondarySymbol:s=n("gray",f),output:r=process.stdout,spacing:i=1,withGuide:o}={})=>{let a=[],l=o??I.withGuide,c=l?s:"",u=l?`${t} `:"",d=l?`${s} `:"";for(let p=0;p<i;p++)a.push(c);let g=Array.isArray(e)?e:e.split(`
|
|
69
|
+
`);if(g.length>0){let[p,...y]=g;p.length>0?a.push(`${u}${p}`):a.push(l?t:"");for(let m of y)m.length>0?a.push(`${d}${m}`):a.push(l?s:"")}r.write(`${a.join(`
|
|
70
|
+
`)}
|
|
71
|
+
`)},info:(e,t)=>{E.message(e,{...t,symbol:n("blue",At)})},success:(e,t)=>{E.message(e,{...t,symbol:n("green",Ft)})},step:(e,t)=>{E.message(e,{...t,symbol:n("green",ge)})},warn:(e,t)=>{E.message(e,{...t,symbol:n("yellow",Mt)})},warning:(e,t)=>{E.warn(e,t)},error:(e,t)=>{E.message(e,{...t,symbol:n("red",Ot)})}},Me=(e="",t)=>{let s=t?.output??process.stdout,r=t?.withGuide??I.withGuide?`${n("gray",V)} `:"";s.write(`${r}${n("red",e)}
|
|
55
72
|
|
|
56
|
-
`)},
|
|
57
|
-
`)},
|
|
58
|
-
${
|
|
73
|
+
`)},kt=(e="",t)=>{let s=t?.output??process.stdout,r=t?.withGuide??I.withGuide?`${n("gray",xt)} `:"";s.write(`${r}${e}
|
|
74
|
+
`)},Lt=(e="",t)=>{let s=t?.output??process.stdout,r=t?.withGuide??I.withGuide?`${n("gray",f)}
|
|
75
|
+
${n("gray",V)} `:"";s.write(`${r}${e}
|
|
59
76
|
|
|
60
|
-
`)},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
`)
|
|
66
|
-
|
|
67
|
-
`)
|
|
68
|
-
`)
|
|
77
|
+
`)},li=e=>new Ge({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,showSubmit:e.showSubmit,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??I.withGuide,s=`${`${t?`${n("gray",f)}
|
|
78
|
+
`:""}${J(this.state)} `}${e.message}
|
|
79
|
+
`,r=e.placeholder?n("inverse",e.placeholder[0])+n("dim",e.placeholder.slice(1)):n(["inverse","hidden"],"_"),i=this.userInput?this.userInputWithCursor:r,o=this.value??"",a=e.showSubmit?`
|
|
80
|
+
${n(this.focused==="submit"?"cyan":"dim","[ submit ]")}`:"";switch(this.state){case"error":{let l=`${n("yellow",f)} `,c=t?G(e.output,i,l,void 0):i,u=n("yellow",V);return`${s}${c}
|
|
81
|
+
${u} ${n("yellow",this.error)}${a}
|
|
82
|
+
`}case"submit":{let l=`${n("gray",f)} `,c=t?G(e.output,o,l,void 0,void 0,u=>n("dim",u)):o?n("dim",o):"";return`${s}${c}`}case"cancel":{let l=`${n("gray",f)} `,c=t?G(e.output,o,l,void 0,void 0,u=>n(["strikethrough","dim"],u)):o?n(["strikethrough","dim"],o):"";return`${s}${c}`}default:{let l=t?`${n("cyan",f)} `:"",c=t?n("cyan",V):"",u=t?G(e.output,i,l):i;return`${s}${u}
|
|
83
|
+
${c}${a}
|
|
84
|
+
`}}}}).prompt(),Ae=(e,t)=>e.split(`
|
|
85
|
+
`).map(s=>t(s)).join(`
|
|
86
|
+
`),Pt=e=>{let t=(r,i)=>{let o=r.label??String(r.value);return i==="disabled"?`${n("gray",Ee)} ${Ae(o,a=>n(["strikethrough","gray"],a))}${r.hint?` ${n("dim",`(${r.hint??"disabled"})`)}`:""}`:i==="active"?`${n("cyan",Je)} ${o}${r.hint?` ${n("dim",`(${r.hint})`)}`:""}`:i==="selected"?`${n("green",me)} ${Ae(o,a=>n("dim",a))}${r.hint?` ${n("dim",`(${r.hint})`)}`:""}`:i==="cancelled"?`${Ae(o,a=>n(["strikethrough","dim"],a))}`:i==="active-selected"?`${n("green",me)} ${o}${r.hint?` ${n("dim",`(${r.hint})`)}`:""}`:i==="submitted"?`${Ae(o,a=>n("dim",a))}`:`${n("dim",Ee)} ${Ae(o,a=>n("dim",a))}`},s=e.required??!0;return new gs({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:s,cursorAt:e.cursorAt,validate(r){if(s&&(r===void 0||r.length===0))return`Please select at least one option.
|
|
87
|
+
${n("reset",n("dim",`Press ${n(["gray","bgWhite","inverse"]," space ")} to select, ${n("gray",n("bgWhite",n("inverse"," enter ")))} to submit`))}`},render(){let r=e.withGuide??I.withGuide,i=G(e.output,e.message,r?`${Bt(this.state)} `:"",`${J(this.state)} `),o=`${r?`${n("gray",f)}
|
|
88
|
+
`:""}${i}
|
|
89
|
+
`,a=this.value??[],l=(c,u)=>{if(c.disabled)return t(c,"disabled");let d=a.includes(c.value);return u&&d?t(c,"active-selected"):d?t(c,"selected"):t(c,u?"active":"inactive")};switch(this.state){case"submit":{let c=this.options.filter(({value:d})=>a.includes(d)).map(d=>t(d,"submitted")).join(n("dim",", "))||n("dim","none"),u=G(e.output,c,r?`${n("gray",f)} `:"");return`${o}${u}`}case"cancel":{let c=this.options.filter(({value:d})=>a.includes(d)).map(d=>t(d,"cancelled")).join(n("dim",", "));if(c.trim()==="")return`${o}${n("gray",f)}`;let u=G(e.output,c,r?`${n("gray",f)} `:"");return`${o}${u}${r?`
|
|
90
|
+
${n("gray",f)}`:""}`}case"error":{let c=r?`${n("yellow",f)} `:"",u=this.error.split(`
|
|
91
|
+
`).map((p,y)=>y===0?`${r?`${n("yellow",V)} `:""}${n("yellow",p)}`:` ${p}`).join(`
|
|
92
|
+
`),d=o.split(`
|
|
93
|
+
`).length,g=u.split(`
|
|
94
|
+
`).length+1;return`${o}${c}${ce({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:c.length,rowPadding:d+g,style:l}).join(`
|
|
95
|
+
${c}`)}
|
|
96
|
+
${u}
|
|
97
|
+
`}default:{let c=r?`${n("cyan",f)} `:"",u=o.split(`
|
|
98
|
+
`).length,d=r?2:1;return`${o}${c}${ce({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:c.length,rowPadding:u+d,style:l}).join(`
|
|
99
|
+
${c}`)}
|
|
100
|
+
${r?n("cyan",V):""}
|
|
101
|
+
`}}}}).prompt()},ui=e=>n("dim",e),hi=(e,t,s)=>{let r={hard:!0,trim:!1},i=se(e,t,r).split(`
|
|
102
|
+
`),o=i.reduce((c,u)=>Math.max(j(u),c),0),a=i.map(s).reduce((c,u)=>Math.max(j(u),c),0),l=t-(a-o);return se(e,l,r)},fe=(e="",t="",s)=>{let r=s?.output??X.stdout,i=s?.withGuide??I.withGuide,o=s?.format??ui,a=["",...hi(e,he(r)-6,o).split(`
|
|
103
|
+
`).map(o),""],l=j(t),c=Math.max(a.reduce((p,y)=>{let m=j(y);return m>p?m:p},0),l)+2,u=a.map(p=>`${n("gray",f)} ${p}${" ".repeat(c-j(p))}${n("gray",f)}`).join(`
|
|
104
|
+
`),d=i?`${n("gray",f)}
|
|
105
|
+
`:"",g=i?Rs:_t;r.write(`${d}${n("green",ge)} ${n("reset",t)} ${n("gray",Ye.repeat(Math.max(c-l-1,1))+Tt)}
|
|
106
|
+
${u}
|
|
107
|
+
${n("gray",g+Ye.repeat(c+2)+Rt)}
|
|
108
|
+
`)},di=e=>new je({validate:e.validate,mask:e.mask??Ts,signal:e.signal,input:e.input,output:e.output,render(){let t=e.withGuide??I.withGuide,s=`${t?`${n("gray",f)}
|
|
109
|
+
`:""}${J(this.state)} ${e.message}
|
|
110
|
+
`,r=this.userInputWithCursor,i=this.masked;switch(this.state){case"error":{let o=t?`${n("yellow",f)} `:"",a=t?`${n("yellow",V)} `:"",l=i??"";return e.clearOnError&&this.clear(),`${s.trim()}
|
|
111
|
+
${o}${l}
|
|
112
|
+
${a}${n("yellow",this.error)}
|
|
113
|
+
`}case"submit":{let o=t?`${n("gray",f)} `:"",a=i?n("dim",i):"";return`${s}${o}${a}`}case"cancel":{let o=t?`${n("gray",f)} `:"",a=i?n(["strikethrough","dim"],i):"";return`${s}${o}${a}${i&&t?`
|
|
114
|
+
${n("gray",f)}`:""}`}default:{let o=t?`${n("cyan",f)} `:"",a=t?n("cyan",V):"";return`${s}${o}${r}
|
|
115
|
+
${a}
|
|
116
|
+
`}}}}).prompt(),mi=e=>{let t=e.validate;return Fs({...e,initialUserInput:e.initialValue??e.root??process.cwd(),maxItems:5,validate(s){if(!Array.isArray(s)){if(!s)return"Please select a path";if(t)return t(s)}},options(){let s=this.userInput;if(s==="")return[];try{let r;Kr(s)?fs(s).isDirectory()&&(!e.directory||s.endsWith("/"))?r=s:r=$s(s):r=$s(s);let i=s.length>1&&s.endsWith("/")?s.slice(0,-1):s;return zr(r).map(o=>{let a=Jr(r,o),l=fs(a);return{name:o,path:a,isDirectory:l.isDirectory()}}).filter(({path:o,isDirectory:a})=>o.startsWith(i)&&(a||!e.directory)).map(o=>({value:o.path}))}catch{return[]}}})},pi=e=>n("magenta",e),$e=({indicator:e="dots",onCancel:t,output:s=process.stdout,cancelMessage:r,errorMessage:i,frames:o=ze?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:a=ze?80:120,signal:l,...c}={})=>{let u=It(),d,g,p=!1,y=!1,m="",b,$=performance.now(),v=he(s),C=c?.styleFrame??pi,T=S=>{let B=S>1?i??I.messages.error:r??I.messages.cancel;y=S===1,p&&(q(B,S),y&&typeof t=="function"&&t())},R=()=>T(2),x=()=>T(1),L=()=>{process.on("uncaughtExceptionMonitor",R),process.on("unhandledRejection",R),process.on("SIGINT",x),process.on("SIGTERM",x),process.on("exit",T),l&&l.addEventListener("abort",x)},M=()=>{process.removeListener("uncaughtExceptionMonitor",R),process.removeListener("unhandledRejection",R),process.removeListener("SIGINT",x),process.removeListener("SIGTERM",x),process.removeListener("exit",T),l&&l.removeEventListener("abort",x)},k=()=>{if(b===void 0)return;u&&s.write(`
|
|
117
|
+
`);let S=se(b,v,{hard:!0,trim:!1}).split(`
|
|
118
|
+
`);S.length>1&&s.write(Se.cursor.up(S.length-1)),s.write(Se.cursor.to(0)),s.write(Se.erase.down())},N=S=>S.replace(/\.+$/,""),W=S=>{let B=(performance.now()-S)/1e3,z=Math.floor(B/60),Q=Math.floor(B%60);return z>0?`[${z}m ${Q}s]`:`[${Q}s]`},w=c.withGuide??I.withGuide,O=(S="")=>{p=!0,d=ms({output:s}),m=N(S),$=performance.now(),w&&s.write(`${n("gray",f)}
|
|
119
|
+
`);let B=0,z=0;L(),g=setInterval(()=>{if(u&&m===b)return;k(),b=m;let Q=C(o[B]),ie;if(u)ie=`${Q} ${m}...`;else if(e==="timer")ie=`${Q} ${m} ${W($)}`;else{let it=".".repeat(Math.floor(z)).slice(0,3);ie=`${Q} ${m}${it}`}let be=se(ie,v,{hard:!0,trim:!1});s.write(be),B=B+1<o.length?B+1:0,z=z<4?z+.125:0},a)},q=(S="",B=0,z=!1)=>{if(!p)return;p=!1,clearInterval(g),k();let Q=B===0?n("green",ge):B===1?n("red",St):n("red",Et);m=S??m,z||(e==="timer"?s.write(`${Q} ${m} ${W($)}
|
|
120
|
+
`):s.write(`${Q} ${m}
|
|
121
|
+
`)),M(),d()};return{start:O,stop:(S="")=>q(S,0),message:(S="")=>{m=N(S??m)},cancel:(S="")=>q(S,1),error:(S="")=>q(S,2),clear:()=>q("",0,!0),get isCancelled(){return y}}},ws={light:_("\u2500","-"),heavy:_("\u2501","="),block:_("\u2588","#")};Ke=(e,t)=>e.includes(`
|
|
122
|
+
`)?e.split(`
|
|
123
|
+
`).map(s=>t(s)).join(`
|
|
124
|
+
`):t(e),H=e=>{let t=(s,r)=>{let i=s.label??String(s.value);switch(r){case"disabled":return`${n("gray",pe)} ${Ke(i,o=>n("gray",o))}${s.hint?` ${n("dim",`(${s.hint??"disabled"})`)}`:""}`;case"selected":return`${Ke(i,o=>n("dim",o))}`;case"active":return`${n("green",Fe)} ${i}${s.hint?` ${n("dim",`(${s.hint})`)}`:""}`;case"cancelled":return`${Ke(i,o=>n(["strikethrough","dim"],o))}`;default:return`${n("dim",pe)} ${Ke(i,o=>n("dim",o))}`}};return new We({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let s=e.withGuide??I.withGuide,r=`${J(this.state)} `,i=`${Bt(this.state)} `,o=G(e.output,e.message,i,r),a=`${s?`${n("gray",f)}
|
|
125
|
+
`:""}${o}
|
|
126
|
+
`;switch(this.state){case"submit":{let l=s?`${n("gray",f)} `:"",c=G(e.output,t(this.options[this.cursor],"selected"),l);return`${a}${c}`}case"cancel":{let l=s?`${n("gray",f)} `:"",c=G(e.output,t(this.options[this.cursor],"cancelled"),l);return`${a}${c}${s?`
|
|
127
|
+
${n("gray",f)}`:""}`}default:{let l=s?`${n("cyan",f)} `:"",c=s?n("cyan",V):"",u=a.split(`
|
|
128
|
+
`).length,d=s?2:1;return`${a}${l}${ce({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:l.length,rowPadding:u+d,style:(g,p)=>t(g,g.disabled?"disabled":p?"active":"inactive")}).join(`
|
|
129
|
+
${l}`)}
|
|
130
|
+
${c}
|
|
131
|
+
`}}}}).prompt()},fi=e=>{let t=(s,r="inactive")=>{let i=s.label??String(s.value);return r==="selected"?`${n("dim",i)}`:r==="cancelled"?`${n(["strikethrough","dim"],i)}`:r==="active"?`${n(["bgCyan","gray"],` ${s.value} `)} ${i}${s.hint?` ${n("dim",`(${s.hint})`)}`:""}`:`${n(["gray","bgWhite","inverse"],` ${s.value} `)} ${i}${s.hint?` ${n("dim",`(${s.hint})`)}`:""}`};return new qe({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,caseSensitive:e.caseSensitive,render(){let s=e.withGuide??I.withGuide,r=`${s?`${n("gray",f)}
|
|
132
|
+
`:""}${J(this.state)} ${e.message}
|
|
133
|
+
`;switch(this.state){case"submit":{let i=s?`${n("gray",f)} `:"",o=this.options.find(l=>l.value===this.value)??e.options[0],a=G(e.output,t(o,"selected"),i);return`${r}${a}`}case"cancel":{let i=s?`${n("gray",f)} `:"",o=G(e.output,t(this.options[0],"cancelled"),i);return`${r}${o}${s?`
|
|
134
|
+
${n("gray",f)}`:""}`}default:{let i=s?`${n("cyan",f)} `:"",o=s?n("cyan",V):"",a=this.options.map((l,c)=>G(e.output,t(l,c===this.cursor?"active":"inactive"),i)).join(`
|
|
135
|
+
`);return`${r}${a}
|
|
136
|
+
${o}
|
|
137
|
+
`}}}}).prompt()},Cs=`${n("gray",f)} `,de={message:async(e,{symbol:t=n("gray",f)}={})=>{process.stdout.write(`${n("gray",f)}
|
|
138
|
+
${t} `);let s=3;for await(let r of e){r=r.replace(/\n/g,`
|
|
139
|
+
${Cs}`),r.includes(`
|
|
140
|
+
`)&&(s=3+Ct(r.slice(r.lastIndexOf(`
|
|
141
|
+
`))).length);let i=Ct(r).length;s+i<process.stdout.columns?(s+=i,process.stdout.write(r)):(process.stdout.write(`
|
|
142
|
+
${Cs}${r.trimStart()}`),s=3+Ct(r.trimStart()).length)}process.stdout.write(`
|
|
143
|
+
`)},info:e=>de.message(e,{symbol:n("blue",At)}),success:e=>de.message(e,{symbol:n("green",Ft)}),step:e=>de.message(e,{symbol:n("green",ge)}),warn:e=>de.message(e,{symbol:n("yellow",Mt)}),warning:e=>de.warn(e),error:e=>de.message(e,{symbol:n("red",Ot)})},$i=async(e,t)=>{for(let s of e){if(s.enabled===!1)continue;let r=$e(t);r.start(s.title);let i=await s.task(r.message);r.stop(i||s.title)}},yi=e=>e.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g,""),vi=e=>{let t=e.output??process.stdout,s=he(t),r=n("gray",f),i=e.spacing??1,o=3,a=e.retainLog===!0,l=!It()&&Is(t);t.write(`${r}
|
|
144
|
+
`),t.write(`${n("green",ge)} ${e.title}
|
|
145
|
+
`);for(let $=0;$<i;$++)t.write(`${r}
|
|
146
|
+
`);let c=[{value:"",full:""}],u=!1,d=$=>{if(c.length===0)return;let v=0;$&&(v+=i+2);for(let C of c){let{value:T,result:R}=C,x=R?.message??T;if(x.length===0)continue;R===void 0&&C.header!==void 0&&C.header!==""&&(x+=`
|
|
147
|
+
${C.header}`);let L=x.split(`
|
|
148
|
+
`).reduce((M,k)=>k===""?M+1:M+Math.ceil((k.length+o)/s),0);v+=L}v>0&&(v+=1,t.write(Se.erase.lines(v)))},g=($,v,C)=>{let T=C?`${$.full}
|
|
149
|
+
${$.value}`:$.value;$.header!==void 0&&$.header!==""&&E.message($.header.split(`
|
|
150
|
+
`).map(R=>n("bold",R)),{output:t,secondarySymbol:r,symbol:r,spacing:0}),E.message(T.split(`
|
|
151
|
+
`).map(R=>n("dim",R)),{output:t,secondarySymbol:r,symbol:r,spacing:v??i})},p=()=>{for(let $ of c){let{header:v,value:C,full:T}=$;(v===void 0||v.length===0)&&C.length===0||g($,void 0,a===!0&&T.length>0)}},y=($,v,C)=>{if(d(!1),(C?.raw!==!0||!u)&&$.value!==""&&($.value+=`
|
|
152
|
+
`),$.value+=yi(v),u=C?.raw===!0,e.limit!==void 0){let T=$.value.split(`
|
|
153
|
+
`),R=T.length-e.limit;if(R>0){let x=T.splice(0,R);a&&($.full+=($.full===""?"":`
|
|
154
|
+
`)+x.join(`
|
|
155
|
+
`))}$.value=T.join(`
|
|
156
|
+
`)}l&&m()},m=()=>{for(let $ of c)$.result?$.result.status==="error"?E.error($.result.message,{output:t,secondarySymbol:r,spacing:0}):E.success($.result.message,{output:t,secondarySymbol:r,spacing:0}):$.value!==""&&g($,0)},b=($,v)=>{d(!1),$.result=v,l&&m()};return{message($,v){y(c[0],$,v)},group($){let v={header:$,value:"",full:""};return c.push(v),{message(C,T){y(v,C,T)},error(C){b(v,{status:"error",message:C})},success(C){b(v,{status:"success",message:C})}}},error($,v){d(!0),E.error($,{output:t,secondarySymbol:r,spacing:1}),v?.showLog!==!1&&p(),c.splice(1,c.length-1),c[0].value="",c[0].full=""},success($,v){d(!0),E.success($,{output:t,secondarySymbol:r,spacing:1}),v?.showLog===!0&&p(),c.splice(1,c.length-1),c[0].value="",c[0].full=""}}},ue=e=>new He({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??I.withGuide,s=`${`${t?`${n("gray",f)}
|
|
157
|
+
`:""}${J(this.state)} `}${e.message}
|
|
158
|
+
`,r=e.placeholder?n("inverse",e.placeholder[0])+n("dim",e.placeholder.slice(1)):n(["inverse","hidden"],"_"),i=this.userInput?this.userInputWithCursor:r,o=this.value??"";switch(this.state){case"error":{let a=this.error?` ${n("yellow",this.error)}`:"",l=t?`${n("yellow",f)} `:"",c=t?n("yellow",V):"";return`${s.trim()}
|
|
159
|
+
${l}${i}
|
|
160
|
+
${c}${a}
|
|
161
|
+
`}case"submit":{let a=o?` ${n("dim",o)}`:"",l=t?n("gray",f):"";return`${s}${l}${a}`}case"cancel":{let a=o?` ${n(["strikethrough","dim"],o)}`:"",l=t?n("gray",f):"";return`${s}${l}${a}${o.trim()?`
|
|
162
|
+
${l}`:""}`}default:{let a=t?`${n("cyan",f)} `:"",l=t?n("cyan",V):"";return`${s}${a}${i}
|
|
163
|
+
${l}
|
|
164
|
+
`}}}}).prompt()});Z();Z();import{spawnSync as tr}from"child_process";Z();Z();import{existsSync as Bs,readFileSync as bi,writeFileSync as wi,mkdirSync as Ci}from"fs";import Ii from"os";import ks from"path";var Nt=ks.join(Ii.homedir(),".eazy-git"),Dt=ks.join(Nt,"config.json"),Os={language:"es",defaultBaseBranch:"release",aiProvider:"claude"};function Y(){try{if(Bs(Dt)){let e=bi(Dt,"utf-8");return{...Os,...JSON.parse(e)}}}catch{}return{...Os}}function Qe(e){let s={...Y(),...e};return Bs(Nt)||Ci(Nt,{recursive:!0}),wi(Dt,JSON.stringify(s,null,2)),s}var Ls={welcome:"Bienvenido a",subtitle:"tu CLI de confianza para gestionar ramas en GIT",operationCompleted:"Operacion completada!",operationCancelled:"Operacion cancelada. Saliendo...",unknownCommand:"Comando desconocido",errorExecuting:"Error al ejecutar el comando",version:"eazy-git version",whatToDo:"Que deseas hacer?",addChanges:"Agregar cambios a una rama",createOriginal:"Crear rama original",createTemporal:"Crear rama temporal",notGitRepo:"Este directorio no es un repositorio git",gitNotInstalled:"git no esta instalado en el sistema",currentBranch:"Branch actual",filesChanged:"Archivos con cambios",noChangesPending:"No hay cambios pendientes. Deseas continuar de todas formas?",updatingRefs:"Actualizando referencias remotas...",refsUpdated:"Referencias actualizadas",fetchFailed:"No se pudo hacer fetch (continuando...)",baseBranch:"Desde que branch base quieres crear la rama?",baseBranchRequired:"El branch base es requerido",ticketId:"Cual es el identificador del ticket? (ej: DPW-0000)",ticketRequired:"El ticket es requerido",changeType:"Que tipo de cambio es?",branchExistsLocal:e=>`La rama "${e}" ya existe localmente. Que deseas hacer?`,switchToIt:"Cambiarme a ella y continuar",cancel:"Cancelar",cancelledOp:"Operacion cancelada.",creatingBranch:(e,t)=>`Creando rama ${e} desde origin/${t}...`,branchCreated:e=>`Rama ${e} creada`,errorCreatingBranch:e=>`Error al crear la rama: ${e}`,noFilesToStage:"No hay archivos para stagear.",selectFiles:"Cuales archivos quieres incluir en el commit?",selectAllFiles:"Seleccionar todos los archivos",stagedFiles:"Archivos en stage",stagedCorrect:"Los archivos en stage son correctos?",aiProvider:"Con que IA quieres generar la sugerencia de commit?",generatingCommit:e=>`Generando sugerencia de commit con ${e}...`,aiSuggestionFailed:e=>`No se pudo obtener sugerencia de ${e}. Escribe el mensaje manualmente.`,writeCommitMsg:"Escribe el mensaje de commit:",commitMsgRequired:"El mensaje es requerido",suggestionOf:e=>`Sugerencia de ${e}`,useThisCommit:"Este mensaje de commit te parece bien?",yesUseIt:"Si, usar este",modify:"Modificar",commitSuccess:"Commit realizado correctamente",hookBlocked:"El pre-commit hook bloqueo el commit. Que deseas hacer?",retryHook:"Ya lo corregi, agrega los cambios y vuelve a intentarlo",skipHook:"Saltar el hook (--no-verify)",commitNoHooks:"Commit realizado (sin hooks)",pushToRemote:"Deseas subir la rama al repositorio remoto?",pushSuccess:"Push realizado",pushForceQuestion:"La rama ya existe en el remoto con historial diferente. Deseas forzar el push? (git push -f)",pushForceSuccess:"Push forzado realizado",pushForceError:e=>`Error en el push forzado: ${e}`,pushError:e=>`Error en el push: ${e}`,summaryTitle:"Resumen",summaryBranch:"Rama",summaryFrom:"Desde",summaryCommit:"Commit",summaryFiles:e=>`${e} archivos commiteados`,summaryPush:"Push",summaryPR:"Crear PR",statusModified:"modificado",statusAdded:"agregado",statusDeleted:"eliminado",statusRenamed:"renombrado",statusUntracked:"sin rastrear",commitTypes:{fix:"fix \u2014 correccion de bug",feat:"feat \u2014 nueva funcionalidad",refactor:"refactor \u2014 mejora sin cambio funcional",chore:"chore \u2014 mantenimiento, dependencias",docs:"docs \u2014 documentacion",test:"test \u2014 pruebas",ci:"ci \u2014 integracion continua",perf:"perf \u2014 rendimiento",style:"style \u2014 formato, sin cambio de logica"},selectBranchType:"Selecciona el tipo de rama:",branchFix:"Fix",branchImprovement:"Mejora",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creando rama original...",branchCreatedAndPushed:e=>`Rama "${e}" creada y pusheada correctamente!`,branchCreatedSuccess:e=>`Rama "${e}" creada correctamente!`,mergeBranchQuestion:"A que rama deseas hacer merge?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Rama temporal creada correctamente",temporalBranchMerged:"Rama temporal mergeada correctamente",conflictsDetected:"Conflictos detectados. Resolvelos manualmente!",branchPushedToRemote:"Rama pusheada al repositorio remoto",removeTemporalBranch:"Deseas eliminar la rama temporal?",temporalBranchDeleted:"Rama temporal eliminada correctamente",errorCreatingTemporal:"Error creando la rama temporal",enterJiraCode:"Ingresa el codigo del ticket JIRA:",jiraRequired:"El codigo JIRA es requerido!",jiraInvalidFormat:"El codigo JIRA debe tener el formato DPW-0000",fetchingRemote:"Obteniendo cambios remotos...",pullingChanges:"Aplicando cambios en tu rama...",pullError:e=>`Error: ${e}`,pushingChanges:"Subiendo cambios al remoto...",pushedSuccess:"Cambios subidos correctamente!",pushedForceSuccess:"Cambios subidos (forzado) correctamente!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Proporciona un mensaje de commit",stagingChanges:"Stageando cambios...",creatingCommit:"Creando commit...",commitCreated:"Commit creado correctamente!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Cambiando a la rama anterior...",switchedTo:e=>`Cambiado a rama ${e} correctamente!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Obteniendo ultimos cambios...",mergingWith:e=>`Mergeando con ${e}...`,pushingMerged:"Subiendo cambios mergeados...",mergeCompleted:"Merge completado correctamente!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Eliminando ultimo commit...",removeLastConfirm:"Esto eliminara el ultimo commit (los cambios se mantienen en staging). Continuar?",lastCommitRemoved:"Ultimo commit eliminado correctamente!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Configurando tu entorno",configSaved:"Configuracion guardada",missingConfigValues:"Faltan valores de configuracion requeridos.",errorWritingConfig:"Error escribiendo archivo de configuracion:",currentConfig:"Configuracion actual",useThisConfig:"Deseas usar esta configuracion?",installingDeps:"Instalando dependencias...",depsInstalled:"Todas las dependencias fueron instaladas",authFailed:"Autenticacion fallida",unexpectedError:"Ocurrio un error inesperado",enterEndpoint:"Ingresa la URL del endpoint:",urlRequired:"La URL es requerida!",urlMustBeHttp:"La URL debe usar protocolo HTTP/HTTPS",urlMustHaveHost:"La URL debe incluir un hostname",urlInvalid:"Ingresa una URL valida",enterApiKey:"Ingresa tu apikey:",apiKeyRequired:"El API key es requerido!",enterRegistryName:"Ingresa el nombre del registro NPM (sin caracteres especiales):",registryNameRequired:"El nombre del registro es requerido!",registryNameLettersOnly:"El nombre del registro debe contener solo letras",enterRegistryURL:"Ingresa la URL del registro NPM (sin http/https):",registryURLRequired:"La URL del registro es requerida!",registryURLStartWithName:"La URL debe empezar con un nombre, evita caracteres especiales",registryURLNoProtocol:"La URL no debe incluir protocolo 'http/https' y debe empezar con una letra",registryURLNoSlash:"La URL no debe empezar con '/' y debe empezar con una letra o numero",registryURLNoWWW:"La URL no debe empezar con 'www' y debe empezar con una letra o numero",languageSelect:"Selecciona el idioma de la interfaz:",languageChanged:e=>`Idioma cambiado a: ${e}`,configMenu:"Que deseas configurar?",configLanguage:"Idioma de la interfaz",configDefaultBranch:"Rama base por defecto",configAIProvider:"Proveedor de IA por defecto",configView:"Ver configuracion actual",defaultBranchSet:e=>`Rama base por defecto: ${e}`,aiProviderSet:e=>`Proveedor de IA por defecto: ${e}`};var Ps={welcome:"Welcome to",subtitle:"your trusted CLI for GIT branch management",operationCompleted:"Operation completed!",operationCancelled:"Operation cancelled. Exiting...",unknownCommand:"Unknown command",errorExecuting:"Error executing command",version:"eazy-git version",whatToDo:"What would you like to do?",addChanges:"Add Changes to Branch",createOriginal:"Create Original Branch",createTemporal:"Create Temporal Branch",notGitRepo:"This directory is not a git repository",gitNotInstalled:"git is not installed on the system",currentBranch:"Current branch",filesChanged:"Files with changes",noChangesPending:"No pending changes. Do you want to continue anyway?",updatingRefs:"Updating remote references...",refsUpdated:"References updated",fetchFailed:"Could not fetch (continuing...)",baseBranch:"From which base branch do you want to create the branch?",baseBranchRequired:"Base branch is required",ticketId:"What is the ticket identifier? (e.g.: DPW-0000)",ticketRequired:"Ticket is required",changeType:"What type of change is this?",branchExistsLocal:e=>`Branch "${e}" already exists locally. What would you like to do?`,switchToIt:"Switch to it and continue",cancel:"Cancel",cancelledOp:"Operation cancelled.",creatingBranch:(e,t)=>`Creating branch ${e} from origin/${t}...`,branchCreated:e=>`Branch ${e} created`,errorCreatingBranch:e=>`Error creating branch: ${e}`,noFilesToStage:"No files to stage.",selectFiles:"Which files do you want to include in the commit?",selectAllFiles:"Select all files",stagedFiles:"Staged files",stagedCorrect:"Are the staged files correct?",aiProvider:"Which AI do you want to use for the commit suggestion?",generatingCommit:e=>`Generating commit suggestion with ${e}...`,aiSuggestionFailed:e=>`Could not get suggestion from ${e}. Write the message manually.`,writeCommitMsg:"Write the commit message:",commitMsgRequired:"Message is required",suggestionOf:e=>`${e} suggestion`,useThisCommit:"Does this commit message look good?",yesUseIt:"Yes, use it",modify:"Modify",commitSuccess:"Commit created successfully",hookBlocked:"The pre-commit hook blocked the commit. What would you like to do?",retryHook:"I fixed it, re-stage and retry",skipHook:"Skip the hook (--no-verify)",commitNoHooks:"Commit created (without hooks)",pushToRemote:"Do you want to push the branch to the remote repository?",pushSuccess:"Push completed",pushForceQuestion:"The branch already exists on remote with different history. Force push? (git push -f)",pushForceSuccess:"Force push completed",pushForceError:e=>`Error in force push: ${e}`,pushError:e=>`Error in push: ${e}`,summaryTitle:"Summary",summaryBranch:"Branch",summaryFrom:"From",summaryCommit:"Commit",summaryFiles:e=>`${e} files committed`,summaryPush:"Push",summaryPR:"Create PR",statusModified:"modified",statusAdded:"added",statusDeleted:"deleted",statusRenamed:"renamed",statusUntracked:"untracked",commitTypes:{fix:"fix - bug fix",feat:"feat - new feature",refactor:"refactor - improvement without functional change",chore:"chore - maintenance, dependencies",docs:"docs - documentation",test:"test - testing",ci:"ci - continuous integration",perf:"perf - performance",style:"style - formatting, no logic change"},selectBranchType:"Select the branch type:",branchFix:"Fix",branchImprovement:"Improvement",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creating original branch...",branchCreatedAndPushed:e=>`Branch "${e}" created and pushed successfully!`,branchCreatedSuccess:e=>`Branch "${e}" created successfully!`,mergeBranchQuestion:"Which branch do you want to merge into?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Temporal branch created successfully",temporalBranchMerged:"Temporal branch merged successfully",conflictsDetected:"Conflicts detected. Please resolve them manually!",branchPushedToRemote:"Branch pushed to remote repository",removeTemporalBranch:"Do you want to remove the temporal branch?",temporalBranchDeleted:"Temporal branch deleted successfully",errorCreatingTemporal:"Error creating the temporal branch",enterJiraCode:"Enter the JIRA ticket code:",jiraRequired:"JIRA code is required!",jiraInvalidFormat:"JIRA code must have the format DPW-0000",fetchingRemote:"Fetching remote changes...",pullingChanges:"Pulling changes into your branch...",pullError:e=>`Error: ${e}`,pushingChanges:"Pushing changes to remote...",pushedSuccess:"Changes pushed successfully!",pushedForceSuccess:"Changes pushed (force) successfully!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Please provide a commit message",stagingChanges:"Staging changes...",creatingCommit:"Creating commit...",commitCreated:"Commit created successfully!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Switching to previous branch...",switchedTo:e=>`Successfully switched to ${e} branch!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Fetching latest changes...",mergingWith:e=>`Merging with ${e}...`,pushingMerged:"Pushing merged changes...",mergeCompleted:"Merge completed successfully!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Removing last commit...",removeLastConfirm:"This will remove the last commit (changes will remain in staging). Continue?",lastCommitRemoved:"Last commit removed successfully!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Setting up your configuration",configSaved:"Configuration saved",missingConfigValues:"Missing required configuration values.",errorWritingConfig:"Error writing configuration file:",currentConfig:"Current configuration",useThisConfig:"Would you like to use this configuration?",installingDeps:"Installing dependencies...",depsInstalled:"All dependencies were installed",authFailed:"Authentication failed",unexpectedError:"An unexpected error occurred",enterEndpoint:"Enter your endpoint URL:",urlRequired:"URL is required!",urlMustBeHttp:"URL must use HTTP/HTTPS protocol",urlMustHaveHost:"URL must include a hostname",urlInvalid:"Please enter a valid URL",enterApiKey:"Enter your apikey:",apiKeyRequired:"API key is required!",enterRegistryName:"Enter your NPM registry name (without special characters):",registryNameRequired:"Registry name is required!",registryNameLettersOnly:"Registry name must contain only letters",enterRegistryURL:"Enter your NPM registry URL (without http/https):",registryURLRequired:"Registry URL is required!",registryURLStartWithName:"URL must start with a name only, avoid special characters",registryURLNoProtocol:"URL must not include 'http/https' protocol and must start with a letter",registryURLNoSlash:"URL must not start with '/' and must begin with a letter or number",registryURLNoWWW:"URL must not start with 'www' and must begin with a letter or number",languageSelect:"Select the interface language:",languageChanged:e=>`Language changed to: ${e}`,configMenu:"What would you like to configure?",configLanguage:"Interface language",configDefaultBranch:"Default base branch",configAIProvider:"Default AI provider",configView:"View current configuration",defaultBranchSet:e=>`Default base branch: ${e}`,aiProviderSet:e=>`Default AI provider: ${e}`};var Xe={es:Ls,en:Ps};function h(e,...t){let r=Y().language||"es",o=(Xe[r]||Xe.es)[e];return typeof o=="function"?o(...t):o||e}function Ns(){let t=Y().language||"es";return(Xe[t]||Xe.es).commitTypes}function Ds(){return[{value:"es",label:"Espanol"},{value:"en",label:"English"}]}function A(e){if(Ie(e))return Me(h("operationCancelled")),process.exit(0)}var Vs=(e=0)=>t=>`\x1B[${t+e}m`,Us=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Gs=(e=0)=>(t,s,r)=>`\x1B[${38+e};2;${t};${s};${r}m`,P={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]}},qn=Object.keys(P.modifier),Si=Object.keys(P.color),Ei=Object.keys(P.bgColor),Hn=[...Si,...Ei];function xi(){let e=new Map;for(let[t,s]of Object.entries(P)){for(let[r,i]of Object.entries(s))P[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},s[r]=P[r],e.set(i[0],i[1]);Object.defineProperty(P,t,{value:s,enumerable:!1})}return Object.defineProperty(P,"codes",{value:e,enumerable:!1}),P.color.close="\x1B[39m",P.bgColor.close="\x1B[49m",P.color.ansi=Vs(),P.color.ansi256=Us(),P.color.ansi16m=Gs(),P.bgColor.ansi=Vs(10),P.bgColor.ansi256=Us(10),P.bgColor.ansi16m=Gs(10),Object.defineProperties(P,{rgbToAnsi256:{value(t,s,r){return t===s&&s===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(s/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(t){let s=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!s)return[0,0,0];let[r]=s;r.length===3&&(r=[...r].map(o=>o+o).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>P.rgbToAnsi256(...P.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let s,r,i;if(t>=232)s=((t-232)*10+8)/255,r=s,i=s;else{t-=16;let l=t%36;s=Math.floor(t/36)/5,r=Math.floor(l/6)/5,i=l%6/5}let o=Math.max(s,r,i)*2;if(o===0)return 30;let a=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(s));return o===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(t,s,r)=>P.ansi256ToAnsi(P.rgbToAnsi256(t,s,r)),enumerable:!1},hexToAnsi:{value:t=>P.ansi256ToAnsi(P.hexToAnsi256(t)),enumerable:!1}}),P}var Ti=xi(),re=Ti;import Vt from"node:process";import Ri from"node:os";import js from"node:tty";function ee(e,t=globalThis.Deno?globalThis.Deno.args:Vt.argv){let s=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(s+e),i=t.indexOf("--");return r!==-1&&(i===-1||r<i)}var{env:U}=Vt,Ze;ee("no-color")||ee("no-colors")||ee("color=false")||ee("color=never")?Ze=0:(ee("color")||ee("colors")||ee("color=true")||ee("color=always"))&&(Ze=1);function _i(){if("FORCE_COLOR"in U)return U.FORCE_COLOR==="true"?1:U.FORCE_COLOR==="false"?0:U.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(U.FORCE_COLOR,10),3)}function Ai(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Fi(e,{streamIsTTY:t,sniffFlags:s=!0}={}){let r=_i();r!==void 0&&(Ze=r);let i=s?Ze:r;if(i===0)return 0;if(s){if(ee("color=16m")||ee("color=full")||ee("color=truecolor"))return 3;if(ee("color=256"))return 2}if("TF_BUILD"in U&&"AGENT_NAME"in U)return 1;if(e&&!t&&i===void 0)return 0;let o=i||0;if(U.TERM==="dumb")return o;if(Vt.platform==="win32"){let a=Ri.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in U)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(a=>a in U)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in U)||U.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in U)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(U.TEAMCITY_VERSION)?1:0;if(U.COLORTERM==="truecolor"||U.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in U){let a=Number.parseInt((U.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(U.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(U.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(U.TERM)||"COLORTERM"in U?1:o}function Ws(e,t={}){let s=Fi(e,{streamIsTTY:e&&e.isTTY,...t});return Ai(s)}var Mi={stdout:Ws({isTTY:js.isatty(1)}),stderr:Ws({isTTY:js.isatty(2)})},qs=Mi;function Hs(e,t,s){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,o=0,a="";do a+=e.slice(o,r)+t+s,o=r+i,r=e.indexOf(t,o);while(r!==-1);return a+=e.slice(o),a}function Ks(e,t,s,r){let i=0,o="";do{let a=e[r-1]==="\r";o+=e.slice(i,a?r-1:r)+t+(a?`\r
|
|
69
165
|
`:`
|
|
70
|
-
`)+
|
|
71
|
-
`,
|
|
72
|
-
`);return o!==-1&&(
|
|
73
|
-
`):[]}var
|
|
166
|
+
`)+s,i=r+1,r=e.indexOf(`
|
|
167
|
+
`,i)}while(r!==-1);return o+=e.slice(i),o}var{stdout:zs,stderr:Js}=qs,Ut=Symbol("GENERATOR"),xe=Symbol("STYLER"),Oe=Symbol("IS_EMPTY"),Ys=["ansi","ansi","ansi256","ansi16m"],Te=Object.create(null),Oi=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let s=zs?zs.level:0;e.level=t.level===void 0?s:t.level};var Bi=e=>{let t=(...s)=>s.join(" ");return Oi(t,e),Object.setPrototypeOf(t,Be.prototype),t};function Be(e){return Bi(e)}Object.setPrototypeOf(Be.prototype,Function.prototype);for(let[e,t]of Object.entries(re))Te[e]={get(){let s=et(this,jt(t.open,t.close,this[xe]),this[Oe]);return Object.defineProperty(this,e,{value:s}),s}};Te.visible={get(){let e=et(this,this[xe],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Gt=(e,t,s,...r)=>e==="rgb"?t==="ansi16m"?re[s].ansi16m(...r):t==="ansi256"?re[s].ansi256(re.rgbToAnsi256(...r)):re[s].ansi(re.rgbToAnsi(...r)):e==="hex"?Gt("rgb",t,s,...re.hexToRgb(...r)):re[s][e](...r),ki=["rgb","hex","ansi256"];for(let e of ki){Te[e]={get(){let{level:s}=this;return function(...r){let i=jt(Gt(e,Ys[s],"color",...r),re.color.close,this[xe]);return et(this,i,this[Oe])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);Te[t]={get(){let{level:s}=this;return function(...r){let i=jt(Gt(e,Ys[s],"bgColor",...r),re.bgColor.close,this[xe]);return et(this,i,this[Oe])}}}}var Li=Object.defineProperties(()=>{},{...Te,level:{enumerable:!0,get(){return this[Ut].level},set(e){this[Ut].level=e}}}),jt=(e,t,s)=>{let r,i;return s===void 0?(r=e,i=t):(r=s.openAll+e,i=t+s.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:s}},et=(e,t,s)=>{let r=(...i)=>Pi(r,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(r,Li),r[Ut]=e,r[xe]=t,r[Oe]=s,r},Pi=(e,t)=>{if(e.level<=0||!t)return e[Oe]?"":t;let s=e[xe];if(s===void 0)return t;let{openAll:r,closeAll:i}=s;if(t.includes("\x1B"))for(;s!==void 0;)t=Hs(t,s.close,s.open),s=s.parent;let o=t.indexOf(`
|
|
168
|
+
`);return o!==-1&&(t=Ks(t,i,r,o)),r+t+i};Object.defineProperties(Be.prototype,Te);var Ni=Be(),so=Be({level:Js?Js.level:0});var ye=Ni;var Re={primary:"#57d7c4",secondary:"#199288",muted:"#9ca3af",success:"#06D6A0",error:"#EF4444",warning:"#F59E0B"},F={primary:e=>ye.hex(Re.primary)(e),secondary:e=>ye.hex(Re.secondary)(e),muted:e=>ye.hex(Re.muted)(e),success:e=>ye.hex(Re.success)(e),error:e=>ye.hex(Re.error)(e),warning:e=>ye.hex(Re.warning)(e)};var Di=async()=>{let e=await H({message:F.secondary(h("selectBranchType")),options:[{value:"fix",label:h("branchFix")},{value:"improvement",label:h("branchImprovement")},{value:"feature",label:h("branchFeature")},{value:"refactor",label:h("branchRefactor")}]});return A(e),e},Qs=Di;Z();var Vi=e=>/^[A-Z]{3}-\d{4}$/.test(e),Xs=Vi;var Ui=async()=>{let e=await ue({message:F.secondary(h("enterJiraCode")),placeholder:"DPW-0000",initialValue:"",validate(t){if(!t?.trim())return h("jiraRequired");if(!Xs(t))return h("jiraInvalidFormat")}});return A(e),e},Zs=Ui;var Gi=async()=>{let e=await Qs(),t=await Zs();return`${e}/${t}`},er=Gi;var ji=async()=>{let e=Y(),t=await er(),s=$e();try{s.start(h("creatingOriginalBranch")),tr("git",["checkout","-b",t,`origin/${e.defaultBaseBranch}`],{stdio:"inherit"}),tr("git",["push","origin",t],{stdio:"inherit"}),s.stop(h("branchCreatedAndPushed",t)),E.success(h("branchCreatedSuccess",t))}catch(r){s.stop(""),E.error(h("errorCreatingBranch",r.message))}},sr=ji;Z();import{spawnSync as _e}from"child_process";Z();var Wi=async()=>{let e=await H({message:F.secondary(h("mergeBranchQuestion")),options:[{value:"develop",label:h("developDEV")},{value:"release",label:h("releaseUAT")}],required:!0,initialValue:"develop"});return A(e),e},rr=Wi;import{execSync as qi}from"child_process";var Hi=()=>qi("git rev-parse --abbrev-ref HEAD").toString().trim(),ir=Hi;var Ki=async()=>{try{let e=await rr(),t=ir(),s=`${t}-${e}`;if(_e("git",["checkout","-b",s,`origin/${e}`],{stdio:"inherit"}),E.success(h("temporalBranchCreated")),_e("git",["merge",`origin/${t}`],{stdio:"inherit"}),E.success(h("temporalBranchMerged")),_e("git",["status","--porcelain"],{encoding:"utf-8"}).stdout.includes("UU")){E.warn(h("conflictsDetected"));return}_e("git",["push","origin",s],{stdio:"inherit"}),E.info(h("branchPushedToRemote"));let i=await le({message:h("removeTemporalBranch")});A(i),i&&(_e("git",["checkout",t],{stdio:"inherit"}),_e("git",["branch","-D",s],{stdio:"inherit"}),E.info(h("temporalBranchDeleted")))}catch(e){E.error(`${h("errorCreatingTemporal")}: ${e.message}`)}},nr=Ki;Z();import{execSync as ve,spawnSync as te,spawn as zi}from"child_process";function or(e){let t=e.slice(3).trim();return t.includes(" -> ")?t.split(" -> ")[1].trim():t}function ar(){let e=ve("git status --short",{encoding:"utf-8"}).trim();return e?e.split(`
|
|
169
|
+
`):[]}var Ji=async()=>{let e=Y(),t=Ns(),s=Object.entries(t).map(([w,O])=>({value:w,label:O})),r={M:h("statusModified"),A:h("statusAdded"),D:h("statusDeleted"),R:h("statusRenamed"),"??":h("statusUntracked")},i=ve("git rev-parse --abbrev-ref HEAD",{encoding:"utf-8"}).trim(),o=ar();if(E.info(`${h("currentBranch")}: ${i}`),E.info(`${h("filesChanged")}: ${o.length}`),o.length===0){let w=await le({message:h("noChangesPending")});if(A(w),!w)return}let a=$e();a.start(h("updatingRefs"));try{ve("git fetch --quiet"),a.stop(h("refsUpdated"))}catch{a.stop(h("fetchFailed"))}let l=await ue({message:F.secondary(h("baseBranch")),placeholder:e.defaultBaseBranch,initialValue:e.defaultBaseBranch,validate:w=>w?.trim()?void 0:h("baseBranchRequired")});A(l);let c=await ue({message:F.secondary(h("ticketId")),placeholder:"DPW-0000",validate:w=>w?.trim()?void 0:h("ticketRequired")});A(c);let u=await H({message:F.secondary(h("changeType")),options:s});A(u);let d=`${u}/${c}`;if(te("git",["branch","--list",d],{encoding:"utf-8"}).stdout.trim()){let w=await H({message:F.secondary(h("branchExistsLocal",d)),options:[{value:"checkout",label:h("switchToIt")},{value:"cancel",label:h("cancel")}]});if(A(w),w==="cancel"){E.warn(h("cancelledOp"));return}te("git",["checkout",d],{stdio:"inherit"})}else try{a.start(h("creatingBranch",d,l)),te("git",["checkout","-b",d,`origin/${l}`],{stdio:"pipe"}),a.stop(h("branchCreated",d))}catch(w){a.stop(""),E.error(h("errorCreatingBranch",w.message));return}let p=!1;for(;!p;){let w=ar();if(w.length===0){E.warn(h("noFilesToStage"));return}let O="__select_all__",q=w.map(ie=>{let be=ie.slice(0,2).trim(),it=or(ie),hr=r[be]??be;return{value:ie,label:it,hint:hr}}),S=await Pt({message:F.secondary(h("selectFiles")),options:[{value:O,label:F.primary(h("selectAllFiles"))},...q],required:!0});A(S);let B=S.includes(O)?w:S;te("git",["restore","--staged","."],{encoding:"utf-8"});for(let ie of B){let be=or(ie);te("git",["add",be],{encoding:"utf-8"})}let z=ve("git status --short",{encoding:"utf-8"}).trim();fe(z,h("stagedFiles"));let Q=await le({message:h("stagedCorrect")});A(Q),p=Q,p||te("git",["restore","--staged","."],{encoding:"utf-8"})}let y=ve("git diff --cached",{encoding:"utf-8"}),m=`Analiza el siguiente git diff y sugiere UN SOLO mensaje de commit en formato convencional.
|
|
74
170
|
|
|
75
|
-
Formato requerido: ${
|
|
171
|
+
Formato requerido: ${u}(${c}): descripcion en ingles
|
|
76
172
|
Reglas:
|
|
77
173
|
- Maximo 72 caracteres en total
|
|
78
174
|
- Verbo en presente ("add", "fix", "update", NO "added", "fixed")
|
|
@@ -81,10 +177,11 @@ Reglas:
|
|
|
81
177
|
- Responde UNICAMENTE con el mensaje de commit, sin explicaciones, sin comillas, sin markdown
|
|
82
178
|
|
|
83
179
|
Git diff:
|
|
84
|
-
${
|
|
85
|
-
`).filter(Boolean).length,
|
|
86
|
-
`),"
|
|
87
|
-
|
|
180
|
+
${y}`,b=await H({message:F.secondary(h("aiProvider")),options:[{value:"claude",label:"Claude"},{value:"opencode",label:"Opencode"}],initialValue:e.aiProvider});A(b);let $={claude:{binary:"claude",args:["-p",m],label:"Claude"},opencode:{binary:"opencode",args:["run",m],label:"Opencode"}},{binary:v,args:C,label:T}=$[b];a.start(h("generatingCommit",T));let R=await new Promise(w=>{let O="",q="",S=zi(v,C,{stdio:["ignore","pipe","pipe"]});S.stdout.on("data",B=>{O+=B}),S.stderr.on("data",B=>{q+=B}),S.on("close",B=>w({status:B,stdout:O,stderr:q,error:null})),S.on("error",B=>w({status:1,stdout:"",stderr:"",error:B}))});a.stop("");let x;if(R.error||R.status!==0){E.warn(h("aiSuggestionFailed",T));let w=await ue({message:F.secondary(h("writeCommitMsg")),initialValue:`${u}(${c}): `,validate:O=>O?.trim()?void 0:h("commitMsgRequired")});A(w),x=w}else{let w=R.stdout.trim();fe(w,h("suggestionOf",T));let O=await H({message:F.secondary(h("useThisCommit")),options:[{value:"yes",label:h("yesUseIt")},{value:"modify",label:h("modify")}]});if(A(O),O==="yes")x=w;else{let q=await ue({message:F.secondary(h("writeCommitMsg")),initialValue:w,validate:S=>S?.trim()?void 0:h("commitMsgRequired")});A(q),x=q}}let L=!1;for(;!L;)if(te("git",["commit","-m",x],{stdio:"inherit"}).status===0)E.success(h("commitSuccess")),L=!0;else{let O=await H({message:F.secondary(h("hookBlocked")),options:[{value:"retry",label:h("retryHook")},{value:"noverify",label:h("skipHook")},{value:"cancel",label:h("cancel")}]});if(A(O),O==="cancel")return;O==="noverify"&&(te("git",["commit","--no-verify","-m",x],{stdio:"inherit"}),E.success(h("commitNoHooks")),L=!0),O==="retry"&&te("git",["add","-u"],{stdio:"inherit"})}let M=await le({message:h("pushToRemote")});A(M);let k="";if(M){let w=(S=!1)=>{te("git",S?["push","-f","origin",d]:["push","-u","origin",d],{stdio:"inherit"})},O=()=>{let S=ve("git remote get-url origin",{encoding:"utf-8"}).trim(),B=S.match(/[:/]([^/]+\/[^/]+?)(\.git)?$/),z=B?B[1]:"";return S.includes("github.com")?`https://github.com/${z}/compare/${d}?expand=1`:S.includes("bitbucket.org")?`https://bitbucket.org/${z}/pull-requests/new?source=${d}`:S.includes("gitlab.com")?`https://gitlab.com/${z}/-/merge_requests/new?merge_request[source_branch]=${d}`:""};if(te("git",["push","-u","origin",d],{stdio:"inherit"}).status===0)E.success(h("pushSuccess")),k=O();else{let S=await le({message:h("pushForceQuestion")});A(S),S&&(te("git",["push","-f","origin",d],{stdio:"inherit"}).status===0?(E.success(h("pushForceSuccess")),k=O()):E.error(h("pushForceError","push failed")))}}let N=ve('git diff --name-only HEAD~1 HEAD 2>/dev/null || git show --name-only --format="" HEAD',{encoding:"utf-8"}).trim().split(`
|
|
181
|
+
`).filter(Boolean).length,W=[`${h("summaryBranch")}: ${d}`,`${h("summaryFrom")}: origin/${l}`,`${h("summaryCommit")}: ${x}`,`${h("summaryFiles",N)}`,...M&&k?[`${h("summaryPush")}: origin/${d}`,`${h("summaryPR")}: ${k}`]:[]];fe(W.join(`
|
|
182
|
+
`),h("summaryTitle"))},cr=Ji;Z();async function tt(){let e=await H({message:F.secondary(h("configMenu")),options:[{value:"language",label:h("configLanguage")},{value:"defaultBranch",label:h("configDefaultBranch")},{value:"aiProvider",label:h("configAIProvider")},{value:"view",label:h("configView")}]});if(A(e),e==="language"){let t=await H({message:F.secondary(h("languageSelect")),options:Ds(),initialValue:Y().language});A(t),Qe({language:t}),E.success(h("languageChanged",t))}if(e==="defaultBranch"){let{text:t}=await Promise.resolve().then(()=>(Z(),Ms)),s=await t({message:F.secondary(h("baseBranch")),initialValue:Y().defaultBaseBranch,validate:r=>r?.trim()?void 0:h("baseBranchRequired")});A(s),Qe({defaultBaseBranch:s}),E.success(h("defaultBranchSet",s))}if(e==="aiProvider"){let t=await H({message:F.secondary(h("aiProvider")),options:[{value:"claude",label:"Claude"},{value:"opencode",label:"Opencode"}],initialValue:Y().aiProvider});A(t),Qe({aiProvider:t}),E.success(h("aiProviderSet",t))}if(e==="view"){let t=Y(),s=Object.entries(t).map(([r,i])=>` ${r}: ${i}`).join(`
|
|
183
|
+
`);fe(s,F.secondary(h("currentConfig")))}}import{readFileSync as Yi}from"fs";import{fileURLToPath as Qi}from"url";import{dirname as Xi,resolve as Zi}from"path";var en=()=>{let e=Qi(import.meta.url),t=Xi(e);return JSON.parse(Yi(Zi(t,"../package.json"),"utf8"))?.version},lr=en;Z();import{existsSync as tn}from"fs";import{join as sn}from"path";import{execSync as rn}from"child_process";var nn=()=>{try{rn("git --version",{stdio:"ignore"})}catch{E.error(h("gitNotInstalled")),process.exit(1)}let e=sn(process.cwd(),".git");tn(e)||(E.error(h("notGitRepo")),process.exit(1))},ur=nn;var rt=process.argv.slice(2);(rt.includes("-v")||rt.includes("--version"))&&(console.log(`${h("version")}: ${lr()}`),process.exit(0));(rt.includes("config")||rt.includes("--config"))&&(await tt(),process.exit(0));ur();kt(F.primary(`
|
|
184
|
+
${h("welcome")}
|
|
88
185
|
|
|
89
186
|
.-------------------------------------------------------------------------------.
|
|
90
187
|
| \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588|
|
|
@@ -96,6 +193,6 @@ ${h}`,c=await S({message:"Con que IA quieres generar la sugerencia de commit?",o
|
|
|
96
193
|
| \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 |
|
|
97
194
|
|\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 |
|
|
98
195
|
'-------------------------------------------------------------------------------'
|
|
99
|
-
|
|
100
|
-
${
|
|
101
|
-
`));var
|
|
196
|
+
|
|
197
|
+
${F.muted(h("subtitle"))}
|
|
198
|
+
`));var st=await H({message:F.secondary(h("whatToDo")),options:[{value:"ACB",label:h("addChanges")},{value:"CRO",label:h("createOriginal")},{value:"CRT",label:h("createTemporal")},{value:"CFG",label:h("configMenu")}],required:!0,initialValue:"ACB"});st==="ACB"?await cr():st==="CRO"?await sr():st==="CRT"?await nr():st==="CFG"?await tt():(Me(h("operationCancelled")),process.exit(0));Lt(F.success(h("operationCompleted")));
|