@gilbert_oliveira/commit-wizard 2.0.2 → 2.0.3
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 +4 -4
- package/dist/commit-wizard.js +51 -51
- package/package.json +2 -3
- package/src/core/index.ts +5 -1
- package/src/core/openai.ts +29 -11
- package/src/core/smart-split.ts +59 -35
- package/src/git/index.ts +16 -4
- package/src/utils/polyfill.ts +16 -12
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://github.com/gilbert-oliveira/commit-wizard/actions)
|
|
6
6
|
[](https://github.com/gilbert-oliveira/commit-wizard/actions)
|
|
7
7
|
[](https://github.com/gilbert-oliveira/commit-wizard/actions)
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
[](https://www.npmjs.com/package/@gilbert_oliveira/commit-wizard)
|
|
10
10
|
[](https://opensource.org/licenses/MIT)
|
|
11
11
|
|
|
@@ -168,9 +168,9 @@ Crie um arquivo `.commit-wizardrc` no seu projeto ou no diretório home:
|
|
|
168
168
|
"compactMode": false
|
|
169
169
|
},
|
|
170
170
|
"cache": {
|
|
171
|
-
"enabled": true,
|
|
172
|
-
"ttl": 60,
|
|
173
|
-
"maxSize": 100
|
|
171
|
+
"enabled": true, // ✅ Cache inteligente implementado
|
|
172
|
+
"ttl": 60, // Tempo de vida em minutos
|
|
173
|
+
"maxSize": 100 // Máximo de entradas no cache
|
|
174
174
|
},
|
|
175
175
|
"advanced": {
|
|
176
176
|
"maxFileSize": 1024,
|
package/dist/commit-wizard.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var
|
|
3
|
+
var c9=Object.create;var{getPrototypeOf:u9,defineProperty:n1,getOwnPropertyNames:g9}=Object;var p9=Object.prototype.hasOwnProperty;var F=(b,I,$)=>{$=b!=null?c9(u9(b)):{};let H=I||!b||!b.__esModule?n1($,"default",{value:b,enumerable:!0}):$;for(let Y of g9(b))if(!p9.call(H,Y))n1(H,Y,{get:()=>b[Y],enumerable:!0});return H};var O=(b,I)=>()=>(I||b((I={exports:{}}).exports,I),I.exports);var b1=(b,I)=>{for(var $ in I)n1(b,$,{get:I[$],enumerable:!0,configurable:!0,set:(H)=>I[$]=()=>H})};var N=(b,I)=>()=>(b&&(I=b(b=0)),I);var A=import.meta.require;var a1=O((F$,qI)=>{var l1={to(b,I){if(!I)return`\x1B[${b+1}G`;return`\x1B[${I+1};${b+1}H`},move(b,I){let $="";if(b<0)$+=`\x1B[${-b}D`;else if(b>0)$+=`\x1B[${b}C`;if(I<0)$+=`\x1B[${-I}A`;else if(I>0)$+=`\x1B[${I}B`;return $},up:(b=1)=>`\x1B[${b}A`,down:(b=1)=>`\x1B[${b}B`,forward:(b=1)=>`\x1B[${b}C`,backward:(b=1)=>`\x1B[${b}D`,nextLine:(b=1)=>"\x1B[E".repeat(b),prevLine:(b=1)=>"\x1B[F".repeat(b),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},n9={up:(b=1)=>"\x1B[S".repeat(b),down:(b=1)=>"\x1B[T".repeat(b)},l9={screen:"\x1B[2J",up:(b=1)=>"\x1B[1J".repeat(b),down:(b=1)=>"\x1B[J".repeat(b),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(b){let I="";for(let $=0;$<b;$++)I+=this.line+($<b-1?l1.up():"");if(b)I+=l1.left;return I}};qI.exports={cursor:l1,scroll:n9,erase:l9,beep:"\x07"}});var r1=O((v$,i1)=>{var K1=process||{},QI=K1.argv||[],N1=K1.env||{},a9=!(!!N1.NO_COLOR||QI.includes("--no-color"))&&(!!N1.FORCE_COLOR||QI.includes("--color")||K1.platform==="win32"||(K1.stdout||{}).isTTY&&N1.TERM!=="dumb"||!!N1.CI),i9=(b,I,$=b)=>(H)=>{let Y=""+H,X=Y.indexOf(I,b.length);return~X?b+r9(Y,I,$,X)+I:b+Y+I},r9=(b,I,$,H)=>{let Y="",X=0;do Y+=b.substring(X,H)+$,X=H+I.length,H=b.indexOf(I,X);while(~H);return Y+b.substring(X)},UI=(b=a9)=>{let I=b?i9:()=>String;return{isColorSupported:b,reset:I("\x1B[0m","\x1B[0m"),bold:I("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:I("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:I("\x1B[3m","\x1B[23m"),underline:I("\x1B[4m","\x1B[24m"),inverse:I("\x1B[7m","\x1B[27m"),hidden:I("\x1B[8m","\x1B[28m"),strikethrough:I("\x1B[9m","\x1B[29m"),black:I("\x1B[30m","\x1B[39m"),red:I("\x1B[31m","\x1B[39m"),green:I("\x1B[32m","\x1B[39m"),yellow:I("\x1B[33m","\x1B[39m"),blue:I("\x1B[34m","\x1B[39m"),magenta:I("\x1B[35m","\x1B[39m"),cyan:I("\x1B[36m","\x1B[39m"),white:I("\x1B[37m","\x1B[39m"),gray:I("\x1B[90m","\x1B[39m"),bgBlack:I("\x1B[40m","\x1B[49m"),bgRed:I("\x1B[41m","\x1B[49m"),bgGreen:I("\x1B[42m","\x1B[49m"),bgYellow:I("\x1B[43m","\x1B[49m"),bgBlue:I("\x1B[44m","\x1B[49m"),bgMagenta:I("\x1B[45m","\x1B[49m"),bgCyan:I("\x1B[46m","\x1B[49m"),bgWhite:I("\x1B[47m","\x1B[49m"),blackBright:I("\x1B[90m","\x1B[39m"),redBright:I("\x1B[91m","\x1B[39m"),greenBright:I("\x1B[92m","\x1B[39m"),yellowBright:I("\x1B[93m","\x1B[39m"),blueBright:I("\x1B[94m","\x1B[39m"),magentaBright:I("\x1B[95m","\x1B[39m"),cyanBright:I("\x1B[96m","\x1B[39m"),whiteBright:I("\x1B[97m","\x1B[39m"),bgBlackBright:I("\x1B[100m","\x1B[49m"),bgRedBright:I("\x1B[101m","\x1B[49m"),bgGreenBright:I("\x1B[102m","\x1B[49m"),bgYellowBright:I("\x1B[103m","\x1B[49m"),bgBlueBright:I("\x1B[104m","\x1B[49m"),bgMagentaBright:I("\x1B[105m","\x1B[49m"),bgCyanBright:I("\x1B[106m","\x1B[49m"),bgWhiteBright:I("\x1B[107m","\x1B[49m")}};i1.exports=UI();i1.exports.createColors=UI});import{stdin as t9,stdout as o9}from"process";import VI from"readline";import{Writable as s9}from"stream";function e9({onlyFirst:b=!1}={}){let I=["[\\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(I,b?void 0:"g")}function BI(b){if(typeof b!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof b}\``);return b.replace(b4,"")}function _I(b){return b&&b.__esModule&&Object.prototype.hasOwnProperty.call(b,"default")?b.default:b}function I1(b,I={}){if(typeof b!="string"||b.length===0||(I={ambiguousIsNarrow:!0,...I},b=BI(b),b.length===0))return 0;b=b.replace(H4()," ");let $=I.ambiguousIsNarrow?1:2,H=0;for(let Y of b){let X=Y.codePointAt(0);if(X<=31||X>=127&&X<=159||X>=768&&X<=879)continue;switch(G4.eastAsianWidth(Y)){case"F":case"W":H+=2;break;case"A":H+=$;break;default:H+=1}}return H}function Z4(){let b=new Map;for(let[I,$]of Object.entries(L)){for(let[H,Y]of Object.entries($))L[H]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},$[H]=L[H],b.set(Y[0],Y[1]);Object.defineProperty(L,I,{value:$,enumerable:!1})}return Object.defineProperty(L,"codes",{value:b,enumerable:!1}),L.color.close="\x1B[39m",L.bgColor.close="\x1B[49m",L.color.ansi=WI(),L.color.ansi256=zI(),L.color.ansi16m=NI(),L.bgColor.ansi=WI(t1),L.bgColor.ansi256=zI(t1),L.bgColor.ansi16m=NI(t1),Object.defineProperties(L,{rgbToAnsi256:{value:(I,$,H)=>I===$&&$===H?I<8?16:I>248?231:Math.round((I-8)/247*24)+232:16+36*Math.round(I/255*5)+6*Math.round($/255*5)+Math.round(H/255*5),enumerable:!1},hexToRgb:{value:(I)=>{let $=/[a-f\d]{6}|[a-f\d]{3}/i.exec(I.toString(16));if(!$)return[0,0,0];let[H]=$;H.length===3&&(H=[...H].map((X)=>X+X).join(""));let Y=Number.parseInt(H,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:(I)=>L.rgbToAnsi256(...L.hexToRgb(I)),enumerable:!1},ansi256ToAnsi:{value:(I)=>{if(I<8)return 30+I;if(I<16)return 90+(I-8);let $,H,Y;if(I>=232)$=((I-232)*10+8)/255,H=$,Y=$;else{I-=16;let Z=I%36;$=Math.floor(I/36)/5,H=Math.floor(Z/6)/5,Y=Z%6/5}let X=Math.max($,H,Y)*2;if(X===0)return 30;let G=30+(Math.round(Y)<<2|Math.round(H)<<1|Math.round($));return X===2&&(G+=60),G},enumerable:!1},rgbToAnsi:{value:(I,$,H)=>L.ansi256ToAnsi(L.rgbToAnsi256(I,$,H)),enumerable:!1},hexToAnsi:{value:(I)=>L.ansi256ToAnsi(L.hexToAnsi256(I)),enumerable:!1}}),L}function SI(b,I,$){return String(b).normalize().replace(/\r\n/g,`
|
|
4
4
|
`).split(`
|
|
5
|
-
`).map((H)=>
|
|
6
|
-
`)}function
|
|
5
|
+
`).map((H)=>W4(H,I,$)).join(`
|
|
6
|
+
`)}function RI(b,I){if(typeof b=="string")return S1.aliases.get(b)===I;for(let $ of b)if($!==void 0&&RI($,I))return!0;return!1}function N4(b,I){if(b===I)return;let $=b.split(`
|
|
7
7
|
`),H=I.split(`
|
|
8
|
-
`),Y=[];for(let X=0;X<Math.max($.length,H.length);X++)$[X]!==H[X]&&Y.push(X);return Y}function P(b){return b===
|
|
9
|
-
`),
|
|
10
|
-
`).length-1;this.output.write(y.cursor.move(-999,b*-1))}render(){let b=
|
|
8
|
+
`),Y=[];for(let X=0;X<Math.max($.length,H.length);X++)$[X]!==H[X]&&Y.push(X);return Y}function P(b){return b===s1}function j1(b,I){let $=b;$.isTTY&&$.setRawMode(I)}class L1{constructor(b,I=!0){E(this,"input"),E(this,"output"),E(this,"_abortSignal"),E(this,"rl"),E(this,"opts"),E(this,"_render"),E(this,"_track",!1),E(this,"_prevFrame",""),E(this,"_subscribers",new Map),E(this,"_cursor",0),E(this,"state","initial"),E(this,"error",""),E(this,"value");let{input:$=t9,output:H=o9,render:Y,signal:X,...G}=b;this.opts=G,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=Y.bind(this),this._track=I,this._abortSignal=X,this.input=$,this.output=H}unsubscribe(){this._subscribers.clear()}setSubscriber(b,I){let $=this._subscribers.get(b)??[];$.push(I),this._subscribers.set(b,$)}on(b,I){this.setSubscriber(b,{cb:I})}once(b,I){this.setSubscriber(b,{cb:I,once:!0})}emit(b,...I){let $=this._subscribers.get(b)??[],H=[];for(let Y of $)Y.cb(...I),Y.once&&H.push(()=>$.splice($.indexOf(Y),1));for(let Y of H)Y()}prompt(){return new Promise((b,I)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),b(s1);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let $=new s9;$._write=(H,Y,X)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),X()},this.input.pipe($),this.rl=VI.createInterface({input:this.input,output:$,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),VI.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),j1(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(y.cursor.show),this.output.off("resize",this.render),j1(this.input,!1),b(this.value)}),this.once("cancel",()=>{this.output.write(y.cursor.show),this.output.off("resize",this.render),j1(this.input,!1),b(s1)})})}onKeypress(b,I){if(this.state==="error"&&(this.state="active"),I?.name&&(!this._track&&S1.aliases.has(I.name)&&this.emit("cursor",S1.aliases.get(I.name)),S1.actions.has(I.name)&&this.emit("cursor",I.name)),b&&(b.toLowerCase()==="y"||b.toLowerCase()==="n")&&this.emit("confirm",b.toLowerCase()==="y"),b==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),b&&this.emit("key",b.toLowerCase()),I?.name==="return"){if(this.opts.validate){let $=this.opts.validate(this.value);$&&(this.error=$ instanceof Error?$.message:$,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}RI([b,I?.name,I?.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(`
|
|
9
|
+
`),j1(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let b=SI(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
10
|
+
`).length-1;this.output.write(y.cursor.move(-999,b*-1))}render(){let b=SI(this._render(this)??"",process.stdout.columns,{hard:!0});if(b!==this._prevFrame){if(this.state==="initial")this.output.write(y.cursor.hide);else{let I=N4(this._prevFrame,b);if(this.restoreCursor(),I&&I?.length===1){let $=I[0];this.output.write(y.cursor.move(0,$)),this.output.write(y.erase.lines(1));let H=b.split(`
|
|
11
11
|
`);this.output.write(H[$]),this._prevFrame=b,this.output.write(y.cursor.move(0,H.length-$-1));return}if(I&&I?.length>1){let $=I[0];this.output.write(y.cursor.move(0,$)),this.output.write(y.erase.down());let H=b.split(`
|
|
12
12
|
`).slice($);this.output.write(H.join(`
|
|
13
|
-
`)),this._prevFrame=b;return}this.output.write(y.erase.down())}this.output.write(b),this.state==="initial"&&(this.state="active"),this._prevFrame=b}}}var y,TI,s9,_I,e9,b4,I4=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},G4,a1=10,VI=(b=0)=>(I)=>`\x1B[${I+b}m`,WI=(b=0)=>(I)=>`\x1B[${38+b};5;${I}m`,zI=(b=0)=>(I,$,H)=>`\x1B[${38+b};2;${I};${$};${H}m`,L,$4,H4,X4,K1,Z4=39,t1="\x07",MI="[",J4="]",AI="m",o1,SI=(b)=>`${K1.values().next().value}${MI}${b}${AI}`,NI=(b)=>`${K1.values().next().value}${o1}${b}${t1}`,q4=(b)=>b.split(" ").map((I)=>b1(I)),i1=(b,I,$)=>{let H=[...I],Y=!1,X=!1,G=b1(LI(b[b.length-1]));for(let[Z,J]of H.entries()){let q=b1(J);if(G+q<=$?b[b.length-1]+=J:(b.push(J),G=0),K1.has(J)&&(Y=!0,X=H.slice(Z+1).join("").startsWith(o1)),Y){X?J===t1&&(Y=!1,X=!1):J===AI&&(Y=!1);continue}G+=q,G===$&&Z<H.length-1&&(b.push(""),G=0)}!G&&b[b.length-1].length>0&&b.length>1&&(b[b.length-2]+=b.pop())},Q4=(b)=>{let I=b.split(" "),$=I.length;for(;$>0&&!(b1(I[$-1])>0);)$--;return $===I.length?b:I.slice(0,$).join(" ")+I.slice($).join("")},U4=(b,I,$={})=>{if($.trim!==!1&&b.trim()==="")return"";let H="",Y,X,G=q4(b),Z=[""];for(let[q,Q]of b.split(" ").entries()){$.trim!==!1&&(Z[Z.length-1]=Z[Z.length-1].trimStart());let W=b1(Z[Z.length-1]);if(q!==0&&(W>=I&&($.wordWrap===!1||$.trim===!1)&&(Z.push(""),W=0),(W>0||$.trim===!1)&&(Z[Z.length-1]+=" ",W++)),$.hard&&G[q]>I){let z=I-W,N=1+Math.floor((G[q]-z-1)/I);Math.floor((G[q]-1)/I)<N&&Z.push(""),i1(Z,Q,I);continue}if(W+G[q]>I&&W>0&&G[q]>0){if($.wordWrap===!1&&W<I){i1(Z,Q,I);continue}Z.push("")}if(W+G[q]>I&&$.wordWrap===!1){i1(Z,Q,I);continue}Z[Z.length-1]+=Q}$.trim!==!1&&(Z=Z.map((q)=>Q4(q)));let J=[...Z.join(`
|
|
14
|
-
`)];for(let[q,Q]of J.entries()){if(H+=Q,
|
|
15
|
-
`?(X&&(H+=
|
|
16
|
-
`&&(Y&&W&&(H+=
|
|
17
|
-
${
|
|
13
|
+
`)),this._prevFrame=b;return}this.output.write(y.erase.down())}this.output.write(b),this.state==="initial"&&(this.state="active"),this._prevFrame=b}}}var y,LI,b4,MI,I4,G4,$4=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},H4,t1=10,WI=(b=0)=>(I)=>`\x1B[${I+b}m`,zI=(b=0)=>(I)=>`\x1B[${38+b};5;${I}m`,NI=(b=0)=>(I,$,H)=>`\x1B[${38+b};2;${I};${$};${H}m`,L,Y4,X4,J4,T1,q4=39,e1="\x07",OI="[",Q4="]",AI="m",bb,KI=(b)=>`${T1.values().next().value}${OI}${b}${AI}`,jI=(b)=>`${T1.values().next().value}${bb}${b}${e1}`,U4=(b)=>b.split(" ").map((I)=>I1(I)),o1=(b,I,$)=>{let H=[...I],Y=!1,X=!1,G=I1(BI(b[b.length-1]));for(let[Z,J]of H.entries()){let q=I1(J);if(G+q<=$?b[b.length-1]+=J:(b.push(J),G=0),T1.has(J)&&(Y=!0,X=H.slice(Z+1).join("").startsWith(bb)),Y){X?J===e1&&(Y=!1,X=!1):J===AI&&(Y=!1);continue}G+=q,G===$&&Z<H.length-1&&(b.push(""),G=0)}!G&&b[b.length-1].length>0&&b.length>1&&(b[b.length-2]+=b.pop())},V4=(b)=>{let I=b.split(" "),$=I.length;for(;$>0&&!(I1(I[$-1])>0);)$--;return $===I.length?b:I.slice(0,$).join(" ")+I.slice($).join("")},W4=(b,I,$={})=>{if($.trim!==!1&&b.trim()==="")return"";let H="",Y,X,G=U4(b),Z=[""];for(let[q,Q]of b.split(" ").entries()){$.trim!==!1&&(Z[Z.length-1]=Z[Z.length-1].trimStart());let W=I1(Z[Z.length-1]);if(q!==0&&(W>=I&&($.wordWrap===!1||$.trim===!1)&&(Z.push(""),W=0),(W>0||$.trim===!1)&&(Z[Z.length-1]+=" ",W++)),$.hard&&G[q]>I){let z=I-W,K=1+Math.floor((G[q]-z-1)/I);Math.floor((G[q]-1)/I)<K&&Z.push(""),o1(Z,Q,I);continue}if(W+G[q]>I&&W>0&&G[q]>0){if($.wordWrap===!1&&W<I){o1(Z,Q,I);continue}Z.push("")}if(W+G[q]>I&&$.wordWrap===!1){o1(Z,Q,I);continue}Z[Z.length-1]+=Q}$.trim!==!1&&(Z=Z.map((q)=>V4(q)));let J=[...Z.join(`
|
|
14
|
+
`)];for(let[q,Q]of J.entries()){if(H+=Q,T1.has(Q)){let{groups:z}=new RegExp(`(?:\\${OI}(?<code>\\d+)m|\\${bb}(?<uri>.*)${e1})`).exec(J.slice(q).join(""))||{groups:{}};if(z.code!==void 0){let K=Number.parseFloat(z.code);Y=K===q4?void 0:K}else z.uri!==void 0&&(X=z.uri.length===0?void 0:z.uri)}let W=J4.codes.get(Number(Y));J[q+1]===`
|
|
15
|
+
`?(X&&(H+=jI("")),Y&&W&&(H+=KI(W))):Q===`
|
|
16
|
+
`&&(Y&&W&&(H+=KI(Y)),X&&(H+=jI(X)))}return H},z4,S1,D$,s1,K4,j4=(b,I,$)=>(I in b)?K4(b,I,{enumerable:!0,configurable:!0,writable:!0,value:$}):b[I]=$,E=(b,I,$)=>(j4(b,typeof I!="symbol"?I+"":I,$),$),Ib,S4,T4,L4=(b,I,$)=>(I in b)?T4(b,I,{enumerable:!0,configurable:!0,writable:!0,value:$}):b[I]=$,TI=(b,I,$)=>(L4(b,typeof I!="symbol"?I+"":I,$),$),Gb,$b;var Hb=N(()=>{y=F(a1(),1),LI=F(r1(),1);b4=e9();MI={exports:{}};(function(b){var I={};b.exports=I,I.eastAsianWidth=function(H){var Y=H.charCodeAt(0),X=H.length==2?H.charCodeAt(1):0,G=Y;return 55296<=Y&&Y<=56319&&56320<=X&&X<=57343&&(Y&=1023,X&=1023,G=Y<<10|X,G+=65536),G==12288||65281<=G&&G<=65376||65504<=G&&G<=65510?"F":G==8361||65377<=G&&G<=65470||65474<=G&&G<=65479||65482<=G&&G<=65487||65490<=G&&G<=65495||65498<=G&&G<=65500||65512<=G&&G<=65518?"H":4352<=G&&G<=4447||4515<=G&&G<=4519||4602<=G&&G<=4607||9001<=G&&G<=9002||11904<=G&&G<=11929||11931<=G&&G<=12019||12032<=G&&G<=12245||12272<=G&&G<=12283||12289<=G&&G<=12350||12353<=G&&G<=12438||12441<=G&&G<=12543||12549<=G&&G<=12589||12593<=G&&G<=12686||12688<=G&&G<=12730||12736<=G&&G<=12771||12784<=G&&G<=12830||12832<=G&&G<=12871||12880<=G&&G<=13054||13056<=G&&G<=19903||19968<=G&&G<=42124||42128<=G&&G<=42182||43360<=G&&G<=43388||44032<=G&&G<=55203||55216<=G&&G<=55238||55243<=G&&G<=55291||63744<=G&&G<=64255||65040<=G&&G<=65049||65072<=G&&G<=65106||65108<=G&&G<=65126||65128<=G&&G<=65131||110592<=G&&G<=110593||127488<=G&&G<=127490||127504<=G&&G<=127546||127552<=G&&G<=127560||127568<=G&&G<=127569||131072<=G&&G<=194367||177984<=G&&G<=196605||196608<=G&&G<=262141?"W":32<=G&&G<=126||162<=G&&G<=163||165<=G&&G<=166||G==172||G==175||10214<=G&&G<=10221||10629<=G&&G<=10630?"Na":G==161||G==164||167<=G&&G<=168||G==170||173<=G&&G<=174||176<=G&&G<=180||182<=G&&G<=186||188<=G&&G<=191||G==198||G==208||215<=G&&G<=216||222<=G&&G<=225||G==230||232<=G&&G<=234||236<=G&&G<=237||G==240||242<=G&&G<=243||247<=G&&G<=250||G==252||G==254||G==257||G==273||G==275||G==283||294<=G&&G<=295||G==299||305<=G&&G<=307||G==312||319<=G&&G<=322||G==324||328<=G&&G<=331||G==333||338<=G&&G<=339||358<=G&&G<=359||G==363||G==462||G==464||G==466||G==468||G==470||G==472||G==474||G==476||G==593||G==609||G==708||G==711||713<=G&&G<=715||G==717||G==720||728<=G&&G<=731||G==733||G==735||768<=G&&G<=879||913<=G&&G<=929||931<=G&&G<=937||945<=G&&G<=961||963<=G&&G<=969||G==1025||1040<=G&&G<=1103||G==1105||G==8208||8211<=G&&G<=8214||8216<=G&&G<=8217||8220<=G&&G<=8221||8224<=G&&G<=8226||8228<=G&&G<=8231||G==8240||8242<=G&&G<=8243||G==8245||G==8251||G==8254||G==8308||G==8319||8321<=G&&G<=8324||G==8364||G==8451||G==8453||G==8457||G==8467||G==8470||8481<=G&&G<=8482||G==8486||G==8491||8531<=G&&G<=8532||8539<=G&&G<=8542||8544<=G&&G<=8555||8560<=G&&G<=8569||G==8585||8592<=G&&G<=8601||8632<=G&&G<=8633||G==8658||G==8660||G==8679||G==8704||8706<=G&&G<=8707||8711<=G&&G<=8712||G==8715||G==8719||G==8721||G==8725||G==8730||8733<=G&&G<=8736||G==8739||G==8741||8743<=G&&G<=8748||G==8750||8756<=G&&G<=8759||8764<=G&&G<=8765||G==8776||G==8780||G==8786||8800<=G&&G<=8801||8804<=G&&G<=8807||8810<=G&&G<=8811||8814<=G&&G<=8815||8834<=G&&G<=8835||8838<=G&&G<=8839||G==8853||G==8857||G==8869||G==8895||G==8978||9312<=G&&G<=9449||9451<=G&&G<=9547||9552<=G&&G<=9587||9600<=G&&G<=9615||9618<=G&&G<=9621||9632<=G&&G<=9633||9635<=G&&G<=9641||9650<=G&&G<=9651||9654<=G&&G<=9655||9660<=G&&G<=9661||9664<=G&&G<=9665||9670<=G&&G<=9672||G==9675||9678<=G&&G<=9681||9698<=G&&G<=9701||G==9711||9733<=G&&G<=9734||G==9737||9742<=G&&G<=9743||9748<=G&&G<=9749||G==9756||G==9758||G==9792||G==9794||9824<=G&&G<=9825||9827<=G&&G<=9829||9831<=G&&G<=9834||9836<=G&&G<=9837||G==9839||9886<=G&&G<=9887||9918<=G&&G<=9919||9924<=G&&G<=9933||9935<=G&&G<=9953||G==9955||9960<=G&&G<=9983||G==10045||G==10071||10102<=G&&G<=10111||11093<=G&&G<=11097||12872<=G&&G<=12879||57344<=G&&G<=63743||65024<=G&&G<=65039||G==65533||127232<=G&&G<=127242||127248<=G&&G<=127277||127280<=G&&G<=127337||127344<=G&&G<=127386||917760<=G&&G<=917999||983040<=G&&G<=1048573||1048576<=G&&G<=1114109?"A":"N"},I.characterLength=function(H){var Y=this.eastAsianWidth(H);return Y=="F"||Y=="W"||Y=="A"?2:1};function $(H){return H.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}I.length=function(H){for(var Y=$(H),X=0,G=0;G<Y.length;G++)X=X+this.characterLength(Y[G]);return X},I.slice=function(H,Y,X){textLen=I.length(H),Y=Y||0,X=X||1,Y<0&&(Y=textLen+Y),X<0&&(X=textLen+X);for(var G="",Z=0,J=$(H),q=0;q<J.length;q++){var Q=J[q],W=I.length(Q);if(Z>=Y-(W==2?1:0))if(Z+W<=X)G+=Q;else break;Z+=W}return G}})(MI);I4=MI.exports,G4=_I(I4),H4=_I($4);L={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(L.modifier);Y4=Object.keys(L.color),X4=Object.keys(L.bgColor);[...Y4];J4=Z4(),T1=new Set(["\x1B","\x9B"]),bb=`${Q4}8;;`;z4=["up","down","left","right","space","enter","cancel"],S1={actions:new Set(z4),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};D$=globalThis.process.platform.startsWith("win"),s1=Symbol("clack:cancel");K4=Object.defineProperty;Ib=class Ib extends L1{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(b){super(b,!1),this.value=!!b.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(I)=>{this.output.write(y.cursor.move(0,-1)),this.value=I,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};S4=new WeakMap;T4=Object.defineProperty;Gb=class Gb extends L1{constructor(b){super(b,!1),TI(this,"options"),TI(this,"cursor",0),this.options=b.options,this.cursor=this.options.findIndex(({value:I})=>I===b.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(I)=>{switch(I){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};$b=class $b extends L1{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let b=this.value.slice(0,this.cursor),[I,...$]=this.value.slice(this.cursor);return`${b}${LI.default.inverse(I)}${$.join("")}`}get cursor(){return this._cursor}constructor(b){super(b),this.on("finalize",()=>{this.value||(this.value=b.defaultValue)})}}});import{stripVTControlCharacters as Yb}from"util";import v from"process";function B4(){return v.platform!=="win32"?v.env.TERM!=="linux":!!v.env.CI||!!v.env.WT_SESSION||!!v.env.TERMINUS_SUBLIME||v.env.ConEmuTask==="{cmd::Cmder}"||v.env.TERM_PROGRAM==="Terminus-Sublime"||v.env.TERM_PROGRAM==="vscode"||v.env.TERM==="xterm-256color"||v.env.TERM==="alacritty"||v.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var U,yI,_4,B=(b,I)=>_4?b:I,M4,O4,A4,Jb,R4,T,a,Xb,Zb,r$,t$,o$,s$,EI,E4,y4,P4,w4,x4,k4,F4,qb=(b)=>{switch(b){case"initial":case"active":return U.default.cyan(M4);case"cancel":return U.default.red(O4);case"error":return U.default.yellow(A4);case"submit":return U.default.green(Jb)}},v4=(b)=>{let{cursor:I,options:$,style:H}=b,Y=b.maxItems??Number.POSITIVE_INFINITY,X=Math.max(process.stdout.rows-4,0),G=Math.min(X,Math.max(Y,5)),Z=0;I>=Z+G-3?Z=Math.max(Math.min(I-G+3,$.length-G),0):I<Z+2&&(Z=Math.max(I-2,0));let J=G<$.length&&Z>0,q=G<$.length&&Z+G<$.length;return $.slice(Z,Z+G).map((Q,W,z)=>{let K=W===0&&J,S=W===z.length-1&&q;return K||S?U.default.dim("..."):H(Q,W+Z===I)})},PI=(b)=>new $b({validate:b.validate,placeholder:b.placeholder,defaultValue:b.defaultValue,initialValue:b.initialValue,render(){let I=`${U.default.gray(T)}
|
|
17
|
+
${qb(this.state)} ${b.message}
|
|
18
18
|
`,$=b.placeholder?U.default.inverse(b.placeholder[0])+U.default.dim(b.placeholder.slice(1)):U.default.inverse(U.default.hidden("_")),H=this.value?this.valueWithCursor:$;switch(this.state){case"error":return`${I.trim()}
|
|
19
19
|
${U.default.yellow(T)} ${H}
|
|
20
|
-
${U.default.yellow(
|
|
20
|
+
${U.default.yellow(a)} ${U.default.yellow(this.error)}
|
|
21
21
|
`;case"submit":return`${I}${U.default.gray(T)} ${U.default.dim(this.value||b.placeholder)}`;case"cancel":return`${I}${U.default.gray(T)} ${U.default.strikethrough(U.default.dim(this.value??""))}${this.value?.trim()?`
|
|
22
22
|
${U.default.gray(T)}`:""}`;default:return`${I}${U.default.cyan(T)} ${H}
|
|
23
|
-
${U.default.cyan(
|
|
24
|
-
`}}}).prompt(),
|
|
25
|
-
${
|
|
23
|
+
${U.default.cyan(a)}
|
|
24
|
+
`}}}).prompt(),g=(b)=>{let I=b.active??"Yes",$=b.inactive??"No";return new Ib({active:I,inactive:$,initialValue:b.initialValue??!0,render(){let H=`${U.default.gray(T)}
|
|
25
|
+
${qb(this.state)} ${b.message}
|
|
26
26
|
`,Y=this.value?I:$;switch(this.state){case"submit":return`${H}${U.default.gray(T)} ${U.default.dim(Y)}`;case"cancel":return`${H}${U.default.gray(T)} ${U.default.strikethrough(U.default.dim(Y))}
|
|
27
|
-
${U.default.gray(T)}`;default:return`${H}${U.default.cyan(T)} ${this.value?`${U.default.green(
|
|
28
|
-
${U.default.cyan(
|
|
29
|
-
`}}}).prompt()},
|
|
30
|
-
${
|
|
27
|
+
${U.default.gray(T)}`;default:return`${H}${U.default.cyan(T)} ${this.value?`${U.default.green(Xb)} ${I}`:`${U.default.dim(Zb)} ${U.default.dim(I)}`} ${U.default.dim("/")} ${this.value?`${U.default.dim(Zb)} ${U.default.dim($)}`:`${U.default.green(Xb)} ${$}`}
|
|
28
|
+
${U.default.cyan(a)}
|
|
29
|
+
`}}}).prompt()},G1=(b)=>{let I=($,H)=>{let Y=$.label??String($.value);switch(H){case"selected":return`${U.default.dim(Y)}`;case"active":return`${U.default.green(Xb)} ${Y} ${$.hint?U.default.dim(`(${$.hint})`):""}`;case"cancelled":return`${U.default.strikethrough(U.default.dim(Y))}`;default:return`${U.default.dim(Zb)} ${U.default.dim(Y)}`}};return new Gb({options:b.options,initialValue:b.initialValue,render(){let $=`${U.default.gray(T)}
|
|
30
|
+
${qb(this.state)} ${b.message}
|
|
31
31
|
`;switch(this.state){case"submit":return`${$}${U.default.gray(T)} ${I(this.options[this.cursor],"selected")}`;case"cancel":return`${$}${U.default.gray(T)} ${I(this.options[this.cursor],"cancelled")}
|
|
32
|
-
${U.default.gray(T)}`;default:return`${$}${U.default.cyan(T)} ${
|
|
32
|
+
${U.default.gray(T)}`;default:return`${$}${U.default.cyan(T)} ${v4({cursor:this.cursor,options:this.options,maxItems:b.maxItems,style:(H,Y)=>I(H,Y?"active":"inactive")}).join(`
|
|
33
33
|
${U.default.cyan(T)} `)}
|
|
34
|
-
${U.default.cyan(
|
|
35
|
-
`}}}).prompt()},
|
|
34
|
+
${U.default.cyan(a)}
|
|
35
|
+
`}}}).prompt()},i=(b="",I="")=>{let $=`
|
|
36
36
|
${b}
|
|
37
37
|
`.split(`
|
|
38
|
-
`),H=
|
|
38
|
+
`),H=Yb(I).length,Y=Math.max($.reduce((G,Z)=>{let J=Yb(Z);return J.length>G?J.length:G},0),H)+2,X=$.map((G)=>`${U.default.gray(T)} ${U.default.dim(G)}${" ".repeat(Y-Yb(G).length)}${U.default.gray(T)}`).join(`
|
|
39
39
|
`);process.stdout.write(`${U.default.gray(T)}
|
|
40
|
-
${U.default.green(
|
|
40
|
+
${U.default.green(Jb)} ${U.default.reset(I)} ${U.default.gray(EI.repeat(Math.max(Y-H-1,1))+E4)}
|
|
41
41
|
${X}
|
|
42
|
-
${U.default.gray(
|
|
43
|
-
`)},
|
|
42
|
+
${U.default.gray(y4+EI.repeat(Y+2)+P4)}
|
|
43
|
+
`)},wI=(b="")=>{process.stdout.write(`${U.default.gray(a)} ${U.default.red(b)}
|
|
44
44
|
|
|
45
|
-
`)},xI=(b="")=>{process.stdout.write(`${U.default.gray(
|
|
46
|
-
`)},
|
|
47
|
-
${U.default.gray(
|
|
45
|
+
`)},xI=(b="")=>{process.stdout.write(`${U.default.gray(R4)} ${b}
|
|
46
|
+
`)},kI=(b="")=>{process.stdout.write(`${U.default.gray(T)}
|
|
47
|
+
${U.default.gray(a)} ${b}
|
|
48
48
|
|
|
49
|
-
`)},V,
|
|
49
|
+
`)},V,e$;var r=N(()=>{Hb();Hb();U=F(r1(),1),yI=F(a1(),1);_4=B4(),M4=B("\u25C6","*"),O4=B("\u25A0","x"),A4=B("\u25B2","x"),Jb=B("\u25C7","o"),R4=B("\u250C","T"),T=B("\u2502","|"),a=B("\u2514","\u2014"),Xb=B("\u25CF",">"),Zb=B("\u25CB"," "),r$=B("\u25FB","[\u2022]"),t$=B("\u25FC","[+]"),o$=B("\u25FB","[ ]"),s$=B("\u25AA","\u2022"),EI=B("\u2500","-"),E4=B("\u256E","+"),y4=B("\u251C","+"),P4=B("\u256F","+"),w4=B("\u25CF","\u2022"),x4=B("\u25C6","*"),k4=B("\u25B2","!"),F4=B("\u25A0","x"),V={message:(b="",{symbol:I=U.default.gray(T)}={})=>{let $=[`${U.default.gray(T)}`];if(b){let[H,...Y]=b.split(`
|
|
50
50
|
`);$.push(`${I} ${H}`,...Y.map((X)=>`${U.default.gray(T)} ${X}`))}process.stdout.write(`${$.join(`
|
|
51
51
|
`)}
|
|
52
|
-
`)},info:(b)=>{V.message(b,{symbol:U.default.blue(
|
|
53
|
-
`);let H;while((H=
|
|
54
|
-
`),X=X.replace(/\\r/g,"\r");I[Y]=X}return I}function
|
|
55
|
-
`).filter((H)=>H.length>0),$=I.length>0?
|
|
56
|
-
`).filter((Y)=>Y.length>0),$=0,H=0;return I.forEach((Y)=>{let[X,G]=Y.split("\t");if(X&&X!=="-")$+=parseInt(X)||0;if(G&&G!=="-")H+=parseInt(G)||0}),{added:$,removed:H,files:I.length}}catch{return{added:0,removed:0,files:0}}}var
|
|
52
|
+
`)},info:(b)=>{V.message(b,{symbol:U.default.blue(w4)})},success:(b)=>{V.message(b,{symbol:U.default.green(x4)})},step:(b)=>{V.message(b,{symbol:U.default.green(Jb)})},warn:(b)=>{V.message(b,{symbol:U.default.yellow(k4)})},warning:(b)=>{V.warn(b)},error:(b)=>{V.message(b,{symbol:U.default.red(F4)})}},e$=`${U.default.gray(T)} `});var FI=O((G6,C4)=>{C4.exports={name:"dotenv",version:"17.2.0",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var fI=O(($6,f)=>{var Qb=A("fs"),B1=A("path"),h4=A("os"),m4=A("crypto"),D4=FI(),Ub=D4.version,vI=["\uD83D\uDD10 encrypt with dotenvx: https://dotenvx.com","\uD83D\uDD10 prevent committing .env to code: https://dotenvx.com/precommit","\uD83D\uDD10 prevent building .env in docker: https://dotenvx.com/prebuild","\uD83D\uDEE0\uFE0F run anywhere with `dotenvx run -- yourcommand`","\u2699\uFE0F specify custom .env file path with { path: '/custom/path/.env' }","\u2699\uFE0F enable debug logging with { debug: true }","\u2699\uFE0F override existing env vars with { override: true }","\u2699\uFE0F suppress all logs with { quiet: true }","\u2699\uFE0F write to custom object with { processEnv: myObject }","\u2699\uFE0F load multiple .env files with { path: ['.env.local', '.env'] }"];function f4(){return vI[Math.floor(Math.random()*vI.length)]}function t(b){if(typeof b==="string")return!["false","0","no","off",""].includes(b.toLowerCase());return Boolean(b)}function d4(){return process.stdout.isTTY}function c4(b){return d4()?`\x1B[2m${b}\x1B[0m`:b}var u4=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function g4(b){let I={},$=b.toString();$=$.replace(/\r\n?/mg,`
|
|
53
|
+
`);let H;while((H=u4.exec($))!=null){let Y=H[1],X=H[2]||"";X=X.trim();let G=X[0];if(X=X.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),G==='"')X=X.replace(/\\n/g,`
|
|
54
|
+
`),X=X.replace(/\\r/g,"\r");I[Y]=X}return I}function p4(b){b=b||{};let I=DI(b);b.path=I;let $=M.configDotenv(b);if(!$.parsed){let G=new Error(`MISSING_DATA: Cannot parse ${I} for an unknown reason`);throw G.code="MISSING_DATA",G}let H=mI(b).split(","),Y=H.length,X;for(let G=0;G<Y;G++)try{let Z=H[G].trim(),J=l4($,Z);X=M.decrypt(J.ciphertext,J.key);break}catch(Z){if(G+1>=Y)throw Z}return M.parse(X)}function n4(b){console.error(`[dotenv@${Ub}][WARN] ${b}`)}function $1(b){console.log(`[dotenv@${Ub}][DEBUG] ${b}`)}function hI(b){console.log(`[dotenv@${Ub}] ${b}`)}function mI(b){if(b&&b.DOTENV_KEY&&b.DOTENV_KEY.length>0)return b.DOTENV_KEY;if(process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0)return process.env.DOTENV_KEY;return""}function l4(b,I){let $;try{$=new URL(I)}catch(Z){if(Z.code==="ERR_INVALID_URL"){let J=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw J.code="INVALID_DOTENV_KEY",J}throw Z}let H=$.password;if(!H){let Z=new Error("INVALID_DOTENV_KEY: Missing key part");throw Z.code="INVALID_DOTENV_KEY",Z}let Y=$.searchParams.get("environment");if(!Y){let Z=new Error("INVALID_DOTENV_KEY: Missing environment part");throw Z.code="INVALID_DOTENV_KEY",Z}let X=`DOTENV_VAULT_${Y.toUpperCase()}`,G=b.parsed[X];if(!G){let Z=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${X} in your .env.vault file.`);throw Z.code="NOT_FOUND_DOTENV_ENVIRONMENT",Z}return{ciphertext:G,key:H}}function DI(b){let I=null;if(b&&b.path&&b.path.length>0)if(Array.isArray(b.path)){for(let $ of b.path)if(Qb.existsSync($))I=$.endsWith(".vault")?$:`${$}.vault`}else I=b.path.endsWith(".vault")?b.path:`${b.path}.vault`;else I=B1.resolve(process.cwd(),".env.vault");if(Qb.existsSync(I))return I;return null}function CI(b){return b[0]==="~"?B1.join(h4.homedir(),b.slice(1)):b}function a4(b){let I=t(process.env.DOTENV_CONFIG_DEBUG||b&&b.debug),$=t(process.env.DOTENV_CONFIG_QUIET||b&&b.quiet);if(I||!$)hI("Loading env from encrypted .env.vault");let H=M._parseVault(b),Y=process.env;if(b&&b.processEnv!=null)Y=b.processEnv;return M.populate(Y,H,b),{parsed:H}}function i4(b){let I=B1.resolve(process.cwd(),".env"),$="utf8",H=process.env;if(b&&b.processEnv!=null)H=b.processEnv;let Y=t(H.DOTENV_CONFIG_DEBUG||b&&b.debug),X=t(H.DOTENV_CONFIG_QUIET||b&&b.quiet);if(b&&b.encoding)$=b.encoding;else if(Y)$1("No encoding is specified. UTF-8 is used by default");let G=[I];if(b&&b.path)if(!Array.isArray(b.path))G=[CI(b.path)];else{G=[];for(let Q of b.path)G.push(CI(Q))}let Z,J={};for(let Q of G)try{let W=M.parse(Qb.readFileSync(Q,{encoding:$}));M.populate(J,W,b)}catch(W){if(Y)$1(`Failed to load ${Q} ${W.message}`);Z=W}let q=M.populate(H,J,b);if(Y=t(H.DOTENV_CONFIG_DEBUG||Y),X=t(H.DOTENV_CONFIG_QUIET||X),Y||!X){let Q=Object.keys(q).length,W=[];for(let z of G)try{let K=B1.relative(process.cwd(),z);W.push(K)}catch(K){if(Y)$1(`Failed to load ${z} ${K.message}`);Z=K}hI(`injecting env (${Q}) from ${W.join(",")} ${c4(`(tip: ${f4()})`)}`)}if(Z)return{parsed:J,error:Z};else return{parsed:J}}function r4(b){if(mI(b).length===0)return M.configDotenv(b);let I=DI(b);if(!I)return n4(`You set DOTENV_KEY but you are missing a .env.vault file at ${I}. Did you forget to build it?`),M.configDotenv(b);return M._configVault(b)}function t4(b,I){let $=Buffer.from(I.slice(-64),"hex"),H=Buffer.from(b,"base64"),Y=H.subarray(0,12),X=H.subarray(-16);H=H.subarray(12,-16);try{let G=m4.createDecipheriv("aes-256-gcm",$,Y);return G.setAuthTag(X),`${G.update(H)}${G.final()}`}catch(G){let Z=G instanceof RangeError,J=G.message==="Invalid key length",q=G.message==="Unsupported state or unable to authenticate data";if(Z||J){let Q=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw Q.code="INVALID_DOTENV_KEY",Q}else if(q){let Q=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw Q.code="DECRYPTION_FAILED",Q}else throw G}}function o4(b,I,$={}){let H=Boolean($&&$.debug),Y=Boolean($&&$.override),X={};if(typeof I!=="object"){let G=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw G.code="OBJECT_REQUIRED",G}for(let G of Object.keys(I))if(Object.prototype.hasOwnProperty.call(b,G)){if(Y===!0)b[G]=I[G],X[G]=I[G];if(H)if(Y===!0)$1(`"${G}" is already defined and WAS overwritten`);else $1(`"${G}" is already defined and was NOT overwritten`)}else b[G]=I[G],X[G]=I[G];return X}var M={configDotenv:i4,_configVault:a4,_parseVault:p4,config:r4,decrypt:t4,parse:g4,populate:o4};$6.configDotenv=M.configDotenv;$6._configVault=M._configVault;$6._parseVault=M._parseVault;$6.config=M.config;$6.decrypt=M.decrypt;$6.parse=M.parse;$6.populate=M.populate;f.exports=M});import{existsSync as dI,readFileSync as cI}from"fs";import{join as uI}from"path";function nI(b){let I;try{I=uI(process.cwd(),".commit-wizardrc")}catch{I="/tmp/.commit-wizardrc"}let $=uI(process.env.HOME||process.env.USERPROFILE||"/tmp",".commit-wizardrc"),H={...Y3};try{if(dI($)){let X=cI($,"utf-8"),G=JSON.parse(X);H=gI(H,G)}}catch{console.warn("\u26A0\uFE0F Erro ao ler configura\xE7\xE3o global: Erro desconhecido")}let Y=b||I;try{if(dI(Y)){let X=cI(Y,"utf-8"),G=JSON.parse(X);H=gI(H,G)}}catch{console.warn("\u26A0\uFE0F Erro ao ler .commit-wizardrc: Erro desconhecido")}if(H.openai.apiKey=process.env.OPENAI_API_KEY,process.env.COMMIT_WIZARD_DEBUG==="true");if(process.env.COMMIT_WIZARD_DRY_RUN==="true")H.dryRun=!0;return H}function gI(b,I){return{...b,...I,openai:{...b.openai,...I.openai},smartSplit:{...b.smartSplit,...I.smartSplit},cache:{...b.cache,...I.cache}}}function lI(b){let I=[];if(!b.openai.apiKey)I.push("OPENAI_API_KEY n\xE3o encontrada nas vari\xE1veis de ambiente");if(b.openai.maxTokens<10||b.openai.maxTokens>4000)I.push("maxTokens deve estar entre 10 e 4000");if(b.openai.temperature<0||b.openai.temperature>2)I.push("temperature deve estar entre 0 e 2");if(!["pt","en","es","fr","de","it","ja","ko","zh"].includes(b.language))I.push("language deve ser um idioma suportado (pt, en, es, fr, de, it, ja, ko, zh)");if(!["conventional","simple","detailed"].includes(b.commitStyle))I.push("commitStyle deve ser conventional, simple ou detailed");if(b.smartSplit.minGroupSize<1)I.push("smartSplit.minGroupSize deve ser pelo menos 1");if(b.smartSplit.maxGroups<1||b.smartSplit.maxGroups>10)I.push("smartSplit.maxGroups deve estar entre 1 e 10");if(b.smartSplit.confidenceThreshold<0||b.smartSplit.confidenceThreshold>1)I.push("smartSplit.confidenceThreshold deve estar entre 0 e 1");if(b.cache.ttl<1)I.push("cache.ttl deve ser pelo menos 1 minuto");if(b.cache.maxSize<1)I.push("cache.maxSize deve ser pelo menos 1");return I}var pI,Y3;var aI=N(()=>{pI=F(fI(),1);pI.default.config();Y3={openai:{model:"gpt-4o",maxTokens:150,temperature:0.7,timeout:30000,retries:2},language:"pt",commitStyle:"conventional",autoCommit:!1,splitCommits:!1,dryRun:!1,smartSplit:{enabled:!0,minGroupSize:1,maxGroups:5,confidenceThreshold:0.7},cache:{enabled:!0,ttl:60,maxSize:100}}});var c={};b1(c,{isGitRepository:()=>Vb,getGitStatus:()=>Wb,getFileDiff:()=>X3,getDiffStats:()=>zb,executeFileCommit:()=>H1,executeCommit:()=>u,escapeShellArg:()=>_1});import{execSync as d}from"child_process";function _1(b){return`'${b.replace(/'/g,`'"'"'`)}'`}function Vb(){try{return d("git rev-parse --git-dir",{stdio:"ignore"}),!0}catch{return!1}}function Wb(){try{let I=d("git diff --cached --name-only",{encoding:"utf-8",stdio:"pipe"}).trim().split(`
|
|
55
|
+
`).filter((H)=>H.length>0),$=I.length>0?d("git diff --cached",{encoding:"utf-8",stdio:"pipe"}):"";return{hasStaged:I.length>0,stagedFiles:I,diff:$.trim()}}catch(b){throw new Error(`Erro ao obter status do Git: ${b instanceof Error?b.message:"Erro desconhecido"}`)}}function X3(b){try{return d(`git diff --cached -- "${b}"`,{encoding:"utf-8",stdio:"pipe"})}catch(I){throw new Error(`Erro ao obter diff do arquivo ${b}: ${I instanceof Error?I.message:"Erro desconhecido"}`)}}function u(b){try{let I=_1(b);return d(`git commit -m ${I}`,{stdio:"pipe"}),{success:!0,hash:d("git rev-parse HEAD",{encoding:"utf-8",stdio:"pipe"}).trim(),message:b}}catch(I){return{success:!1,error:I instanceof Error?I.message:"Erro desconhecido ao executar commit"}}}function H1(b,I){try{let $=_1(I),H=_1(b);return d(`git commit ${H} -m ${$}`,{stdio:"pipe"}),{success:!0,hash:d("git rev-parse HEAD",{encoding:"utf-8",stdio:"pipe"}).trim(),message:I}}catch($){return{success:!1,error:$ instanceof Error?$.message:"Erro desconhecido ao executar commit do arquivo"}}}function zb(){try{let I=d("git diff --cached --numstat",{encoding:"utf-8",stdio:"pipe"}).trim().split(`
|
|
56
|
+
`).filter((Y)=>Y.length>0),$=0,H=0;return I.forEach((Y)=>{let[X,G]=Y.split("\t");if(X&&X!=="-")$+=parseInt(X)||0;if(G&&G!=="-")H+=parseInt(G)||0}),{added:$,removed:H,files:I.length}}catch{return{added:0,removed:0,files:0}}}var D=()=>{};var eI={};b1(eI,{processOpenAIMessage:()=>oI,generateWithRetry:()=>M1,generateCommitMessage:()=>sI,extractCommitTypeFromMessage:()=>rI,detectCommitType:()=>tI,buildPrompt:()=>iI});function iI(b,I,$){let H=I.language==="pt"?"portugu\xEAs":"english",Y=Z3(I.commitStyle,I.language),X=6000,G=b.length>6000?b.substring(0,6000)+`
|
|
57
57
|
... (diff truncado)`:b,Z=$.length>10?`${$.length} arquivos: ${$.slice(0,5).join(", ")}...`:$.join(", ");return`Gere mensagem de commit em ${H} (${I.commitStyle}).
|
|
58
58
|
|
|
59
59
|
Arquivos: ${Z}
|
|
@@ -65,7 +65,7 @@ Diff:
|
|
|
65
65
|
${G}
|
|
66
66
|
\`\`\`
|
|
67
67
|
|
|
68
|
-
Mensagem:`}function
|
|
68
|
+
Mensagem:`}function Z3(b,I){let $={pt:{conventional:`- Use formato: tipo(escopo): descri\xE7\xE3o
|
|
69
69
|
- Tipos v\xE1lidos: feat, fix, docs, style, refactor, test, chore, build, ci
|
|
70
70
|
- Exemplo: "feat(auth): adicionar valida\xE7\xE3o de email"
|
|
71
71
|
- Mantenha a primeira linha com at\xE9 50 caracteres`,simple:`- Use formato simples e direto
|
|
@@ -83,23 +83,23 @@ Mensagem:`}function Y3(b,I){let $={pt:{conventional:`- Use formato: tipo(escopo)
|
|
|
83
83
|
- Maximum 50 characters`,detailed:`- First line: summary under 50 characters
|
|
84
84
|
- Add explanatory body if needed
|
|
85
85
|
- Use imperative mood
|
|
86
|
-
- Be descriptive but concise`}},H=I==="pt"?"pt":"en";return $[H][b]||$[H].conventional}function
|
|
86
|
+
- Be descriptive but concise`}},H=I==="pt"?"pt":"en";return $[H][b]||$[H].conventional}function rI(b){let I={feat:/^(feat|feature)(\([^)]+\))?:/i,fix:/^(fix|bugfix)(\([^)]+\))?:/i,docs:/^(docs|documentation)(\([^)]+\))?:/i,style:/^(style|format)(\([^)]+\))?:/i,refactor:/^(refactor|refactoring)(\([^)]+\))?:/i,test:/^(test|testing)(\([^)]+\))?:/i,chore:/^(chore|maintenance)(\([^)]+\))?:/i,build:/^(build|ci)(\([^)]+\))?:/i,ci:/^(ci|continuous-integration)(\([^)]+\))?:/i};for(let[$,H]of Object.entries(I))if(H.test(b))return $;return null}function tI(b,I){let $=b.toLowerCase(),H=I.join(" ").toLowerCase();if(H.includes("test")||H.includes("spec")||$.includes("test("))return"test";if(H.includes("readme")||H.includes(".md")||H.includes("docs"))return"docs";if(H.includes("package.json")||H.includes("dockerfile")||H.includes(".yml")||H.includes(".yaml")||H.includes("webpack")||H.includes("tsconfig"))return"build";if(H.includes(".css")||H.includes(".scss")||$.includes("style")||$.includes("format"))return"style";if($.includes("fix")||$.includes("bug")||$.includes("error")||$.includes("issue"))return"fix";if($.includes("add")||$.includes("new")||$.includes("create")||$.includes("implement"))return"feat";if($.includes("refactor")||$.includes("restructure")||$.includes("rename"))return"refactor";return"chore"}function oI(b){if(b.match(/^```[\s\S]*```$/))b=b.replace(/^```(?:plaintext|javascript|typescript|python|java|html|css|json|xml|yaml|yml|bash|shell|text)?\s*/,"").replace(/\s*```$/,"");return b=b.trim(),b}async function sI(b,I,$){try{if(!I.openai.apiKey)return{success:!1,error:"Chave da OpenAI n\xE3o encontrada. Configure OPENAI_API_KEY nas vari\xE1veis de ambiente."};let H=iI(b,I,$),Y=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${I.openai.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify({model:I.openai.model,messages:[{role:"user",content:H}],max_tokens:Math.min(I.openai.maxTokens,150),temperature:I.openai.temperature})});if(!Y.ok){let q=await Y.json().catch(()=>({}));return{success:!1,error:`Erro da OpenAI (${Y.status}): ${q.error?.message||"Erro desconhecido"}`}}let G=(await Y.json()).choices?.[0]?.message?.content?.trim();if(!G)return{success:!1,error:"OpenAI retornou resposta vazia"};G=oI(G);let Z=rI(G),J=tI(b,$);return{success:!0,suggestion:{message:G,type:Z||J,confidence:0.8}}}catch(H){return{success:!1,error:`Erro ao conectar com OpenAI: ${H instanceof Error?H.message:"Erro desconhecido"}`}}}async function M1(b,I,$,H=3){let Y="";for(let X=0;X<H;X++){let G=await sI(b,I,$);if(G.success)return G;if(Y=G.error||"Erro desconhecido",X<H-1)await new Promise((Z)=>setTimeout(Z,Math.pow(2,X)*1000))}return{success:!1,error:`Falha ap\xF3s ${H} tentativas. \xDAltimo erro: ${Y}`}}import b0 from"fs";function J3(){try{return b0.statSync("/.dockerenv"),!0}catch{return!1}}function q3(){try{return b0.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Kb(){if(Nb===void 0)Nb=J3()||q3();return Nb}var Nb;var I0=()=>{};import Q3 from"fs";function O1(){if(jb===void 0)jb=U3()||Kb();return jb}var jb,U3=()=>{try{return Q3.statSync("/run/.containerenv"),!0}catch{return!1}};var G0=N(()=>{I0()});import H0 from"process";import V3 from"os";import W3 from"fs";var $0=()=>{if(H0.platform!=="linux")return!1;if(V3.release().toLowerCase().includes("microsoft")){if(O1())return!1;return!0}try{return W3.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!O1():!1}catch{return!1}},Y0;var X0=N(()=>{G0();Y0=H0.env.__IS_WSL_TEST__?$0:$0()});var U0=O((S6,Q0)=>{Q0.exports=q0;q0.sync=N3;var Z0=A("fs");function z3(b,I){var $=I.pathExt!==void 0?I.pathExt:process.env.PATHEXT;if(!$)return!0;if($=$.split(";"),$.indexOf("")!==-1)return!0;for(var H=0;H<$.length;H++){var Y=$[H].toLowerCase();if(Y&&b.substr(-Y.length).toLowerCase()===Y)return!0}return!1}function J0(b,I,$){if(!b.isSymbolicLink()&&!b.isFile())return!1;return z3(I,$)}function q0(b,I,$){Z0.stat(b,function(H,Y){$(H,H?!1:J0(Y,b,I))})}function N3(b,I){return J0(Z0.statSync(b),b,I)}});var K0=O((T6,N0)=>{N0.exports=W0;W0.sync=K3;var V0=A("fs");function W0(b,I,$){V0.stat(b,function(H,Y){$(H,H?!1:z0(Y,I))})}function K3(b,I){return z0(V0.statSync(b),I)}function z0(b,I){return b.isFile()&&j3(b,I)}function j3(b,I){var{mode:$,uid:H,gid:Y}=b,X=I.uid!==void 0?I.uid:process.getuid&&process.getuid(),G=I.gid!==void 0?I.gid:process.getgid&&process.getgid(),Z=parseInt("100",8),J=parseInt("010",8),q=parseInt("001",8),Q=Z|J,W=$&q||$&J&&Y===G||$&Z&&H===X||$&Q&&X===0;return W}});var S0=O((B6,j0)=>{var L6=A("fs"),A1;if(process.platform==="win32"||global.TESTING_WINDOWS)A1=U0();else A1=K0();j0.exports=Sb;Sb.sync=S3;function Sb(b,I,$){if(typeof I==="function")$=I,I={};if(!$){if(typeof Promise!=="function")throw new TypeError("callback not provided");return new Promise(function(H,Y){Sb(b,I||{},function(X,G){if(X)Y(X);else H(G)})})}A1(b,I||{},function(H,Y){if(H){if(H.code==="EACCES"||I&&I.ignoreErrors)H=null,Y=!1}$(H,Y)})}function S3(b,I){try{return A1.sync(b,I||{})}catch($){if(I&&I.ignoreErrors||$.code==="EACCES")return!1;else throw $}}});var A0=O((_6,O0)=>{var o=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",T0=A("path"),T3=o?";":":",L0=S0(),B0=(b)=>Object.assign(new Error(`not found: ${b}`),{code:"ENOENT"}),_0=(b,I)=>{let $=I.colon||T3,H=b.match(/\//)||o&&b.match(/\\/)?[""]:[...o?[process.cwd()]:[],...(I.path||process.env.PATH||"").split($)],Y=o?I.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",X=o?Y.split($):[""];if(o){if(b.indexOf(".")!==-1&&X[0]!=="")X.unshift("")}return{pathEnv:H,pathExt:X,pathExtExe:Y}},M0=(b,I,$)=>{if(typeof I==="function")$=I,I={};if(!I)I={};let{pathEnv:H,pathExt:Y,pathExtExe:X}=_0(b,I),G=[],Z=(q)=>new Promise((Q,W)=>{if(q===H.length)return I.all&&G.length?Q(G):W(B0(b));let z=H[q],K=/^".*"$/.test(z)?z.slice(1,-1):z,S=T0.join(K,b),j=!K&&/^\.[\\\/]/.test(b)?b.slice(0,2)+S:S;Q(J(j,q,0))}),J=(q,Q,W)=>new Promise((z,K)=>{if(W===Y.length)return z(Z(Q+1));let S=Y[W];L0(q+S,{pathExt:X},(j,_)=>{if(!j&&_)if(I.all)G.push(q+S);else return z(q+S);return z(J(q,Q,W+1))})});return $?Z(0).then((q)=>$(null,q),$):Z(0)},L3=(b,I)=>{I=I||{};let{pathEnv:$,pathExt:H,pathExtExe:Y}=_0(b,I),X=[];for(let G=0;G<$.length;G++){let Z=$[G],J=/^".*"$/.test(Z)?Z.slice(1,-1):Z,q=T0.join(J,b),Q=!J&&/^\.[\\\/]/.test(b)?b.slice(0,2)+q:q;for(let W=0;W<H.length;W++){let z=Q+H[W];try{if(L0.sync(z,{pathExt:Y}))if(I.all)X.push(z);else return z}catch(K){}}}if(I.all&&X.length)return X;if(I.nothrow)return null;throw B0(b)};O0.exports=M0;M0.sync=L3});var E0=O((M6,Tb)=>{var R0=(b={})=>{let I=b.env||process.env;if((b.platform||process.platform)!=="win32")return"PATH";return Object.keys(I).reverse().find((H)=>H.toUpperCase()==="PATH")||"Path"};Tb.exports=R0;Tb.exports.default=R0});var x0=O((O6,w0)=>{var y0=A("path"),B3=A0(),_3=E0();function P0(b,I){let $=b.options.env||process.env,H=process.cwd(),Y=b.options.cwd!=null,X=Y&&process.chdir!==void 0&&!process.chdir.disabled;if(X)try{process.chdir(b.options.cwd)}catch(Z){}let G;try{G=B3.sync(b.command,{path:$[_3({env:$})],pathExt:I?y0.delimiter:void 0})}catch(Z){}finally{if(X)process.chdir(H)}if(G)G=y0.resolve(Y?b.options.cwd:"",G);return G}function M3(b){return P0(b)||P0(b,!0)}w0.exports=M3});var k0=O((R3,Bb)=>{var Lb=/([()\][%!^"`<>&|;, *?])/g;function O3(b){return b=b.replace(Lb,"^$1"),b}function A3(b,I){if(b=`${b}`,b=b.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),b=b.replace(/(?=(\\+?)?)\1$/,"$1$1"),b=`"${b}"`,b=b.replace(Lb,"^$1"),I)b=b.replace(Lb,"^$1");return b}R3.command=O3;R3.argument=A3});var v0=O((A6,F0)=>{F0.exports=/^#!(.*)/});var h0=O((R6,C0)=>{var P3=v0();C0.exports=(b="")=>{let I=b.match(P3);if(!I)return null;let[$,H]=I[0].replace(/#! ?/,"").split(" "),Y=$.split("/").pop();if(Y==="env")return H;return H?`${Y} ${H}`:Y}});var D0=O((E6,m0)=>{var _b=A("fs"),w3=h0();function x3(b){let $=Buffer.alloc(150),H;try{H=_b.openSync(b,"r"),_b.readSync(H,$,0,150,0),_b.closeSync(H)}catch(Y){}return w3($.toString())}m0.exports=x3});var u0=O((y6,c0)=>{var k3=A("path"),f0=x0(),d0=k0(),F3=D0(),v3=process.platform==="win32",C3=/\.(?:com|exe)$/i,h3=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function m3(b){b.file=f0(b);let I=b.file&&F3(b.file);if(I)return b.args.unshift(b.file),b.command=I,f0(b);return b.file}function D3(b){if(!v3)return b;let I=m3(b),$=!C3.test(I);if(b.options.forceShell||$){let H=h3.test(I);b.command=k3.normalize(b.command),b.command=d0.command(b.command),b.args=b.args.map((X)=>d0.argument(X,H));let Y=[b.command].concat(b.args).join(" ");b.args=["/d","/s","/c",`"${Y}"`],b.command=process.env.comspec||"cmd.exe",b.options.windowsVerbatimArguments=!0}return b}function f3(b,I,$){if(I&&!Array.isArray(I))$=I,I=null;I=I?I.slice(0):[],$=Object.assign({},$);let H={command:b,args:I,options:$,file:void 0,original:{command:b,args:I}};return $.shell?H:D3(H)}c0.exports=f3});var n0=O((P6,p0)=>{var Mb=process.platform==="win32";function Ob(b,I){return Object.assign(new Error(`${I} ${b.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${I} ${b.command}`,path:b.command,spawnargs:b.args})}function d3(b,I){if(!Mb)return;let $=b.emit;b.emit=function(H,Y){if(H==="exit"){let X=g0(Y,I);if(X)return $.call(b,"error",X)}return $.apply(b,arguments)}}function g0(b,I){if(Mb&&b===1&&!I.file)return Ob(I.original,"spawn");return null}function c3(b,I){if(Mb&&b===1&&!I.file)return Ob(I.original,"spawnSync");return null}p0.exports={hookChildProcess:d3,verifyENOENT:g0,verifyENOENTSync:c3,notFoundError:Ob}});var i0=O((w6,s)=>{var l0=A("child_process"),Ab=u0(),Rb=n0();function a0(b,I,$){let H=Ab(b,I,$),Y=l0.spawn(H.command,H.args,H.options);return Rb.hookChildProcess(Y,H),Y}function u3(b,I,$){let H=Ab(b,I,$),Y=l0.spawnSync(H.command,H.args,H.options);return Y.error=Y.error||Rb.verifyENOENTSync(Y.status,H),Y}s.exports=a0;s.exports.spawn=a0;s.exports.sync=u3;s.exports._parse=Ab;s.exports._enoent=Rb});function Eb(b){let I=typeof b==="string"?`
|
|
87
87
|
`:`
|
|
88
|
-
`.charCodeAt(),$=typeof b==="string"?"\r":"\r".charCodeAt();if(b[b.length-1]===I)b=b.slice(0,-1);if(b[b.length-1]===$)b=b.slice(0,-1);return b}function
|
|
89
|
-
${I}`,
|
|
90
|
-
${H.message}`:
|
|
91
|
-
`);if(h)H.originalMessage=H.message,H.message=u;else H=new Error(u);if(H.shortMessage=R,H.command=G,H.escapedCommand=Z,H.exitCode=X,H.signal=Y,H.signalDescription=N,H.stdout=b,H.stderr=I,H.cwd=z,$!==void 0)H.all=$;if("bufferedData"in H)delete H.bufferedData;return H.failed=!0,H.timedOut=Boolean(J),H.isCanceled=q,H.killed=Q&&!J,H};var Z2=S(()=>{X2()});var R1,JG=(b)=>R1.some((I)=>b[I]!==void 0),J2=(b)=>{if(!b)return;let{stdio:I}=b;if(I===void 0)return R1.map((H)=>b[H]);if(JG(b))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${R1.map((H)=>`\`${H}\``).join(", ")}`);if(typeof I==="string")return I;if(!Array.isArray(I))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof I}\``);let $=Math.max(I.length,R1.length);return Array.from({length:$},(H,Y)=>I[Y])};var q2=S(()=>{R1=["stdin","stdout","stderr"]});var g;var Q2=S(()=>{g=[];g.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")g.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")g.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class U2{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Pb[yb])return Pb[yb];qG(Pb,yb,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(b,I){this.listeners[b].push(I)}removeListener(b,I){let $=this.listeners[b],H=$.indexOf(I);if(H===-1)return;if(H===0&&$.length===1)$.length=0;else $.splice(H,1)}emit(b,I,$){if(this.emitted[b])return!1;this.emitted[b]=!0;let H=!1;for(let Y of this.listeners[b])H=Y(I,$)===!0||H;if(b==="exit")H=this.emit("afterExit",I,$)||H;return H}}class wb{}var E1=(b)=>!!b&&typeof b==="object"&&typeof b.removeListener==="function"&&typeof b.emit==="function"&&typeof b.reallyExit==="function"&&typeof b.listeners==="function"&&typeof b.kill==="function"&&typeof b.pid==="number"&&typeof b.on==="function",yb,Pb,qG,QG=(b)=>{return{onExit(I,$){return b.onExit(I,$)},load(){return b.load()},unload(){return b.unload()}}},V2,W2,xb,z2,G8,$8;var S2=S(()=>{Q2();yb=Symbol.for("signal-exit emitter"),Pb=globalThis,qG=Object.defineProperty.bind(Object);V2=class V2 extends wb{onExit(){return()=>{}}load(){}unload(){}};W2=class W2 extends wb{#X=xb.platform==="win32"?"SIGINT":"SIGHUP";#I=new U2;#b;#H;#Y;#$={};#G=!1;constructor(b){super();this.#b=b,this.#$={};for(let I of g)this.#$[I]=()=>{let $=this.#b.listeners(I),{count:H}=this.#I,Y=b;if(typeof Y.__signal_exit_emitter__==="object"&&typeof Y.__signal_exit_emitter__.count==="number")H+=Y.__signal_exit_emitter__.count;if($.length===H){this.unload();let X=this.#I.emit("exit",null,I),G=I==="SIGHUP"?this.#X:I;if(!X)b.kill(b.pid,G)}};this.#Y=b.reallyExit,this.#H=b.emit}onExit(b,I){if(!E1(this.#b))return()=>{};if(this.#G===!1)this.load();let $=I?.alwaysLast?"afterExit":"exit";return this.#I.on($,b),()=>{if(this.#I.removeListener($,b),this.#I.listeners.exit.length===0&&this.#I.listeners.afterExit.length===0)this.unload()}}load(){if(this.#G)return;this.#G=!0,this.#I.count+=1;for(let b of g)try{let I=this.#$[b];if(I)this.#b.on(b,I)}catch(I){}this.#b.emit=(b,...I)=>{return this.#J(b,...I)},this.#b.reallyExit=(b)=>{return this.#Z(b)}}unload(){if(!this.#G)return;this.#G=!1,g.forEach((b)=>{let I=this.#$[b];if(!I)throw new Error("Listener not defined for signal: "+b);try{this.#b.removeListener(b,I)}catch($){}}),this.#b.emit=this.#H,this.#b.reallyExit=this.#Y,this.#I.count-=1}#Z(b){if(!E1(this.#b))return 0;return this.#b.exitCode=b||0,this.#I.emit("exit",this.#b.exitCode,null),this.#Y.call(this.#b,this.#b.exitCode)}#J(b,...I){let $=this.#H;if(b==="exit"&&E1(this.#b)){if(typeof I[0]==="number")this.#b.exitCode=I[0];let H=$.call(this.#b,b,...I);return this.#I.emit("exit",this.#b.exitCode,null),H}else return $.call(this.#b,b,...I)}};xb=globalThis.process,{onExit:z2,load:G8,unload:$8}=QG(E1(xb)?new W2(xb):new V2)});import UG from"os";var VG=5000,N2=(b,I="SIGTERM",$={})=>{let H=b(I);return WG(b,I,$,H),H},WG=(b,I,$,H)=>{if(!zG(I,$,H))return;let Y=NG($),X=setTimeout(()=>{b("SIGKILL")},Y);if(X.unref)X.unref()},zG=(b,{forceKillAfterTimeout:I},$)=>SG(b)&&I!==!1&&$,SG=(b)=>b===UG.constants.signals.SIGTERM||typeof b==="string"&&b.toUpperCase()==="SIGTERM",NG=({forceKillAfterTimeout:b=!0})=>{if(b===!0)return VG;if(!Number.isFinite(b)||b<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${b}\` (${typeof b})`);return b},K2=(b,I)=>{if(b.kill())I.isCanceled=!0},KG=(b,I,$)=>{b.kill(I),$(Object.assign(new Error("Timed out"),{timedOut:!0,signal:I}))},j2=(b,{timeout:I,killSignal:$="SIGTERM"},H)=>{if(I===0||I===void 0)return H;let Y,X=new Promise((Z,J)=>{Y=setTimeout(()=>{KG(b,$,J)},I)}),G=H.finally(()=>{clearTimeout(Y)});return Promise.race([X,G])},T2=({timeout:b})=>{if(b!==void 0&&(!Number.isFinite(b)||b<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${b}\` (${typeof b})`)},L2=async(b,{cleanup:I,detached:$},H)=>{if(!I||$)return H;let Y=z2(()=>{b.kill()});return H.finally(()=>{Y()})};var B2=S(()=>{S2()});function y1(b){return b!==null&&typeof b==="object"&&typeof b.pipe==="function"}function kb(b){return y1(b)&&b.writable!==!1&&typeof b._write==="function"&&typeof b._writableState==="object"}import{createWriteStream as jG}from"fs";import{ChildProcess as TG}from"child_process";var LG=(b)=>b instanceof TG&&typeof b.then==="function",Fb=(b,I,$)=>{if(typeof $==="string")return b[I].pipe(jG($)),b;if(kb($))return b[I].pipe($),b;if(!LG($))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!kb($.stdin))throw new TypeError("The target child process's stdin must be available.");return b[I].pipe($.stdin),$},_2=(b)=>{if(b.stdout!==null)b.pipeStdout=Fb.bind(void 0,b,"stdout");if(b.stderr!==null)b.pipeStderr=Fb.bind(void 0,b,"stderr");if(b.all!==void 0)b.pipeAll=Fb.bind(void 0,b,"all")};var M2=()=>{};var X1=async(b,{init:I,convertChunk:$,getSize:H,truncateChunk:Y,addChunk:X,getFinalChunk:G,finalize:Z},{maxBuffer:J=Number.POSITIVE_INFINITY}={})=>{if(!_G(b))throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");let q=I();q.length=0;try{for await(let Q of b){let W=MG(Q),z=$[W](Q,q);R2({convertedChunk:z,state:q,getSize:H,truncateChunk:Y,addChunk:X,maxBuffer:J})}return BG({state:q,convertChunk:$,getSize:H,truncateChunk:Y,addChunk:X,getFinalChunk:G,maxBuffer:J}),Z(q)}catch(Q){throw Q.bufferedData=Z(q),Q}},BG=({state:b,getSize:I,truncateChunk:$,addChunk:H,getFinalChunk:Y,maxBuffer:X})=>{let G=Y(b);if(G!==void 0)R2({convertedChunk:G,state:b,getSize:I,truncateChunk:$,addChunk:H,maxBuffer:X})},R2=({convertedChunk:b,state:I,getSize:$,truncateChunk:H,addChunk:Y,maxBuffer:X})=>{let G=$(b),Z=I.length+G;if(Z<=X){A2(b,I,Y,Z);return}let J=H(b,X-I.length);if(J!==void 0)A2(J,I,Y,X);throw new vb},A2=(b,I,$,H)=>{I.contents=$(b,I,H),I.length=H},_G=(b)=>typeof b==="object"&&b!==null&&typeof b[Symbol.asyncIterator]==="function",MG=(b)=>{let I=typeof b;if(I==="string")return"string";if(I!=="object"||b===null)return"others";if(globalThis.Buffer?.isBuffer(b))return"buffer";let $=O2.call(b);if($==="[object ArrayBuffer]")return"arrayBuffer";if($==="[object DataView]")return"dataView";if(Number.isInteger(b.byteLength)&&Number.isInteger(b.byteOffset)&&O2.call(b.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},O2,vb;var Z1=S(()=>{({toString:O2}=Object.prototype);vb=class vb extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var Cb=(b)=>b,hb=()=>{return},mb=({contents:b})=>b,P1=(b)=>{throw new Error(`Streams in object mode are not supported: ${String(b)}`)},x1=(b)=>b.length;var E2=S(()=>{Z1()});async function Db(b,I){return X1(b,kG,I)}var AG=()=>({contents:new ArrayBuffer(0)}),OG=(b)=>RG.encode(b),RG,y2=(b)=>new Uint8Array(b),P2=(b)=>new Uint8Array(b.buffer,b.byteOffset,b.byteLength),EG=(b,I)=>b.slice(0,I),yG=(b,{contents:I,length:$},H)=>{let Y=k2()?xG(I,H):PG(I,H);return new Uint8Array(Y).set(b,$),Y},PG=(b,I)=>{if(I<=b.byteLength)return b;let $=new ArrayBuffer(w2(I));return new Uint8Array($).set(new Uint8Array(b),0),$},xG=(b,I)=>{if(I<=b.maxByteLength)return b.resize(I),b;let $=new ArrayBuffer(I,{maxByteLength:w2(I)});return new Uint8Array($).set(new Uint8Array(b),0),$},w2=(b)=>x2**Math.ceil(Math.log(b)/Math.log(x2)),x2=2,wG=({contents:b,length:I})=>k2()?b:b.slice(0,I),k2=()=>("resize"in ArrayBuffer.prototype),kG;var fb=S(()=>{Z1();RG=new TextEncoder,kG={init:AG,convertChunk:{string:OG,buffer:y2,arrayBuffer:y2,dataView:P2,typedArray:P2,others:P1},getSize:x1,truncateChunk:EG,addChunk:yG,getFinalChunk:hb,finalize:wG}});async function w1(b,I){if(!("Buffer"in globalThis))throw new Error("getStreamAsBuffer() is only supported in Node.js");try{return F2(await Db(b,I))}catch($){if($.bufferedData!==void 0)$.bufferedData=F2($.bufferedData);throw $}}var F2=(b)=>globalThis.Buffer.from(b);var v2=S(()=>{fb()});async function db(b,I){return X1(b,mG,I)}var FG=()=>({contents:"",textDecoder:new TextDecoder}),k1=(b,{textDecoder:I})=>I.decode(b,{stream:!0}),vG=(b,{contents:I})=>I+b,CG=(b,I)=>b.slice(0,I),hG=({textDecoder:b})=>{let I=b.decode();return I===""?void 0:I},mG;var C2=S(()=>{Z1();mG={init:FG,convertChunk:{string:Cb,buffer:k1,arrayBuffer:k1,dataView:k1,typedArray:k1,others:P1},getSize:x1,truncateChunk:CG,addChunk:vG,getFinalChunk:hG,finalize:mb}});var h2=S(()=>{E2();fb();v2();C2();Z1()});var D2=M((F8,m2)=>{var{PassThrough:DG}=O("stream");m2.exports=function(){var b=[],I=new DG({objectMode:!0});return I.setMaxListeners(0),I.add=$,I.isEmpty=H,I.on("unpipe",Y),Array.prototype.slice.call(arguments).forEach($),I;function $(X){if(Array.isArray(X))return X.forEach($),this;return b.push(X),X.once("end",Y.bind(null,X)),X.once("error",I.emit.bind(I,"error")),X.pipe(I,{end:!1}),this}function H(){return b.length==0}function Y(X){if(b=b.filter(function(G){return G!==X}),!b.length&&I.readable)I.end()}}});import{createReadStream as fG,readFileSync as dG}from"fs";import{setTimeout as cG}from"timers/promises";var f2,d2=(b)=>{if(b!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},gG=({input:b,inputFile:I})=>{if(typeof I!=="string")return b;return d2(b),dG(I)},c2=(b)=>{let I=gG(b);if(y1(I))throw new TypeError("The `input` option cannot be a stream in sync mode");return I},uG=({input:b,inputFile:I})=>{if(typeof I!=="string")return b;return d2(b),fG(I)},g2=(b,I)=>{let $=uG(I);if($===void 0)return;if(y1($))$.pipe(b.stdin);else b.stdin.end($)},u2=(b,{all:I})=>{if(!I||!b.stdout&&!b.stderr)return;let $=f2.default();if(b.stdout)$.add(b.stdout);if(b.stderr)$.add(b.stderr);return $},cb=async(b,I)=>{if(!b||I===void 0)return;await cG(0),b.destroy();try{return await I}catch($){return $.bufferedData}},gb=(b,{encoding:I,buffer:$,maxBuffer:H})=>{if(!b||!$)return;if(I==="utf8"||I==="utf-8")return db(b,{maxBuffer:H});if(I===null||I==="buffer")return w1(b,{maxBuffer:H});return pG(b,H,I)},pG=async(b,I,$)=>{return(await w1(b,{maxBuffer:I})).toString($)},p2=async({stdout:b,stderr:I,all:$},{encoding:H,buffer:Y,maxBuffer:X},G)=>{let Z=gb(b,{encoding:H,buffer:Y,maxBuffer:X}),J=gb(I,{encoding:H,buffer:Y,maxBuffer:X}),q=gb($,{encoding:H,buffer:Y,maxBuffer:X*2});try{return await Promise.all([G,Z,J,q])}catch(Q){return Promise.all([{error:Q,signal:Q.signal,timedOut:Q.timedOut},cb(b,Z),cb(I,J),cb($,q)])}};var n2=S(()=>{h2();f2=F(D2(),1)});var nG,lG,ub=(b,I)=>{for(let[$,H]of lG){let Y=typeof I==="function"?(...X)=>Reflect.apply(H.value,I(),X):H.value.bind(I);Reflect.defineProperty(b,$,{...H,value:Y})}},l2=(b)=>new Promise((I,$)=>{if(b.on("exit",(H,Y)=>{I({exitCode:H,signal:Y})}),b.on("error",(H)=>{$(H)}),b.stdin)b.stdin.on("error",(H)=>{$(H)})});var a2=S(()=>{nG=(async()=>{})().constructor.prototype,lG=["then","catch","finally"].map((b)=>[b,Reflect.getOwnPropertyDescriptor(nG,b)])});import{Buffer as aG}from"buffer";import{ChildProcess as iG}from"child_process";var t2=(b,I=[])=>{if(!Array.isArray(I))return[b];return[b,...I]},rG,tG=(b)=>{if(typeof b!=="string"||rG.test(b))return b;return`"${b.replaceAll('"',"\\\"")}"`},pb=(b,I)=>t2(b,I).join(" "),nb=(b,I)=>t2(b,I).map(($)=>tG($)).join(" "),oG,i2=(b)=>{let I=typeof b;if(I==="string")return b;if(I==="number")return String(b);if(I==="object"&&b!==null&&!(b instanceof iG)&&"stdout"in b){let $=typeof b.stdout;if($==="string")return b.stdout;if(aG.isBuffer(b.stdout))return b.stdout.toString();throw new TypeError(`Unexpected "${$}" stdout in template expression`)}throw new TypeError(`Unexpected "${I}" in template expression`)},r2=(b,I,$)=>$||b.length===0||I.length===0?[...b,...I]:[...b.slice(0,-1),`${b.at(-1)}${I[0]}`,...I.slice(1)],sG=({templates:b,expressions:I,tokens:$,index:H,template:Y})=>{let X=Y??b.raw[H],G=X.split(oG).filter(Boolean),Z=r2($,G,X.startsWith(" "));if(H===I.length)return Z;let J=I[H],q=Array.isArray(J)?J.map((Q)=>i2(Q)):[i2(J)];return r2(Z,q,X.endsWith(" "))},lb=(b,I)=>{let $=[];for(let[H,Y]of b.entries())$=sG({templates:b,expressions:I,tokens:$,index:H,template:Y});return $};var o2=S(()=>{rG=/^[\w.-]+$/,oG=/ +/g});import{debuglog as eG}from"util";import b$ from"process";var s2,F1=(b,I)=>String(b).padStart(I,"0"),I$=()=>{let b=new Date;return`${F1(b.getHours(),2)}:${F1(b.getMinutes(),2)}:${F1(b.getSeconds(),2)}.${F1(b.getMilliseconds(),3)}`},ab=(b,{verbose:I})=>{if(!I)return;b$.stderr.write(`[${I$()}] ${b}
|
|
92
|
-
`)};var
|
|
93
|
-
Mensagem: "${b.message}"`,"\uD83D\uDCAD Sugest\xE3o de Commit");let I=await
|
|
88
|
+
`.charCodeAt(),$=typeof b==="string"?"\r":"\r".charCodeAt();if(b[b.length-1]===I)b=b.slice(0,-1);if(b[b.length-1]===$)b=b.slice(0,-1);return b}function R1(b={}){let{env:I=process.env,platform:$=process.platform}=b;if($!=="win32")return"PATH";return Object.keys(I).reverse().find((H)=>H.toUpperCase()==="PATH")||"Path"}import E1 from"process";import Y1 from"path";import{fileURLToPath as r0}from"url";var g3=({cwd:b=E1.cwd(),path:I=E1.env[R1()],preferLocal:$=!0,execPath:H=E1.execPath,addExecPath:Y=!0}={})=>{let X=b instanceof URL?r0(b):b,G=Y1.resolve(X),Z=[];if($)p3(Z,G);if(Y)n3(Z,H,G);return[...Z,I].join(Y1.delimiter)},p3=(b,I)=>{let $;while($!==I)b.push(Y1.join(I,"node_modules/.bin")),$=I,I=Y1.resolve(I,"..")},n3=(b,I,$)=>{let H=I instanceof URL?r0(I):I;b.push(Y1.resolve($,H,".."))},t0=({env:b=E1.env,...I}={})=>{b={...b};let $=R1({env:b});return I.path=b[$],b[$]=g3(I),b};var o0=()=>{};function yb(b,I,{ignoreNonConfigurable:$=!1}={}){let{name:H}=b;for(let Y of Reflect.ownKeys(I))l3(b,I,Y,$);return i3(b,I),s3(b,I,H),b}var l3=(b,I,$,H)=>{if($==="length"||$==="prototype")return;if($==="arguments"||$==="caller")return;let Y=Object.getOwnPropertyDescriptor(b,$),X=Object.getOwnPropertyDescriptor(I,$);if(!a3(Y,X)&&H)return;Object.defineProperty(b,$,X)},a3=function(b,I){return b===void 0||b.configurable||b.writable===I.writable&&b.enumerable===I.enumerable&&b.configurable===I.configurable&&(b.writable||b.value===I.value)},i3=(b,I)=>{let $=Object.getPrototypeOf(I);if($===Object.getPrototypeOf(b))return;Object.setPrototypeOf(b,$)},r3=(b,I)=>`/* Wrapped ${b}*/
|
|
89
|
+
${I}`,t3,o3,s3=(b,I,$)=>{let H=$===""?"":`with ${$.trim()}() `,Y=r3.bind(null,H,I.toString());Object.defineProperty(Y,"name",o3),Object.defineProperty(b,"toString",{...t3,value:Y})};var s0=N(()=>{t3=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),o3=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var y1,e0=(b,I={})=>{if(typeof b!=="function")throw new TypeError("Expected a function");let $,H=0,Y=b.displayName||b.name||"<anonymous>",X=function(...G){if(y1.set(X,++H),H===1)$=b.apply(this,G),b=null;else if(I.throw===!0)throw new Error(`Function \`${Y}\` can only be called once`);return $};return yb(X,b),y1.set(X,H),X},b2;var I2=N(()=>{s0();y1=new WeakMap;e0.callCount=(b)=>{if(!y1.has(b))throw new Error(`The given function \`${b.name}\` is not wrapped by the \`onetime\` package`);return y1.get(b)};b2=e0});var G2=()=>{let b=Pb-$2+1;return Array.from({length:b},e3)},e3=(b,I)=>({name:`SIGRT${I+1}`,number:$2+I,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),$2=34,Pb=64;var H2;var Y2=N(()=>{H2=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}]});import{constants as bG}from"os";var wb=()=>{let b=G2();return[...H2,...b].map(IG)},IG=({name:b,number:I,description:$,action:H,forced:Y=!1,standard:X})=>{let{signals:{[b]:G}}=bG,Z=G!==void 0;return{name:b,number:Z?G:I,description:$,supported:Z,action:H,forced:Y,standard:X}};var X2=N(()=>{Y2()});import{constants as GG}from"os";var $G=()=>{let b=wb();return Object.fromEntries(b.map(HG))},HG=({name:b,number:I,description:$,supported:H,action:Y,forced:X,standard:G})=>[b,{name:b,number:I,description:$,supported:H,action:Y,forced:X,standard:G}],Z2,YG=()=>{let b=wb(),I=Pb+1,$=Array.from({length:I},(H,Y)=>XG(Y,b));return Object.assign({},...$)},XG=(b,I)=>{let $=ZG(b,I);if($===void 0)return{};let{name:H,description:Y,supported:X,action:G,forced:Z,standard:J}=$;return{[b]:{name:H,number:b,description:Y,supported:X,action:G,forced:Z,standard:J}}},ZG=(b,I)=>{let $=I.find(({name:H})=>GG.signals[H]===b);if($!==void 0)return $;return I.find((H)=>H.number===b)},t6;var J2=N(()=>{X2();Z2=$G(),t6=YG()});import JG from"process";var qG=({timedOut:b,timeout:I,errorCode:$,signal:H,signalDescription:Y,exitCode:X,isCanceled:G})=>{if(b)return`timed out after ${I} milliseconds`;if(G)return"was canceled";if($!==void 0)return`failed with ${$}`;if(H!==void 0)return`was killed with ${H} (${Y})`;if(X!==void 0)return`failed with exit code ${X}`;return"failed"},X1=({stdout:b,stderr:I,all:$,error:H,signal:Y,exitCode:X,command:G,escapedCommand:Z,timedOut:J,isCanceled:q,killed:Q,parsed:{options:{timeout:W,cwd:z=JG.cwd()}}})=>{X=X===null?void 0:X,Y=Y===null?void 0:Y;let K=Y===void 0?void 0:Z2[Y].description,S=H&&H.code,_=`Command ${qG({timedOut:J,timeout:W,errorCode:S,signal:Y,signalDescription:K,exitCode:X,isCanceled:q})}: ${G}`,h=Object.prototype.toString.call(H)==="[object Error]",m=h?`${_}
|
|
90
|
+
${H.message}`:_,R=[m,I,b].filter(Boolean).join(`
|
|
91
|
+
`);if(h)H.originalMessage=H.message,H.message=R;else H=new Error(R);if(H.shortMessage=m,H.command=G,H.escapedCommand=Z,H.exitCode=X,H.signal=Y,H.signalDescription=K,H.stdout=b,H.stderr=I,H.cwd=z,$!==void 0)H.all=$;if("bufferedData"in H)delete H.bufferedData;return H.failed=!0,H.timedOut=Boolean(J),H.isCanceled=q,H.killed=Q&&!J,H};var q2=N(()=>{J2()});var P1,QG=(b)=>P1.some((I)=>b[I]!==void 0),Q2=(b)=>{if(!b)return;let{stdio:I}=b;if(I===void 0)return P1.map((H)=>b[H]);if(QG(b))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${P1.map((H)=>`\`${H}\``).join(", ")}`);if(typeof I==="string")return I;if(!Array.isArray(I))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof I}\``);let $=Math.max(I.length,P1.length);return Array.from({length:$},(H,Y)=>I[Y])};var U2=N(()=>{P1=["stdin","stdout","stderr"]});var p;var V2=N(()=>{p=[];p.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")p.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")p.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class W2{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(kb[xb])return kb[xb];UG(kb,xb,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(b,I){this.listeners[b].push(I)}removeListener(b,I){let $=this.listeners[b],H=$.indexOf(I);if(H===-1)return;if(H===0&&$.length===1)$.length=0;else $.splice(H,1)}emit(b,I,$){if(this.emitted[b])return!1;this.emitted[b]=!0;let H=!1;for(let Y of this.listeners[b])H=Y(I,$)===!0||H;if(b==="exit")H=this.emit("afterExit",I,$)||H;return H}}class vb{}var w1=(b)=>!!b&&typeof b==="object"&&typeof b.removeListener==="function"&&typeof b.emit==="function"&&typeof b.reallyExit==="function"&&typeof b.listeners==="function"&&typeof b.kill==="function"&&typeof b.pid==="number"&&typeof b.on==="function",xb,kb,UG,VG=(b)=>{return{onExit(I,$){return b.onExit(I,$)},load(){return b.load()},unload(){return b.unload()}}},z2,N2,Fb,K2,H8,Y8;var j2=N(()=>{V2();xb=Symbol.for("signal-exit emitter"),kb=globalThis,UG=Object.defineProperty.bind(Object);z2=class z2 extends vb{onExit(){return()=>{}}load(){}unload(){}};N2=class N2 extends vb{#X=Fb.platform==="win32"?"SIGINT":"SIGHUP";#I=new W2;#b;#H;#Y;#$={};#G=!1;constructor(b){super();this.#b=b,this.#$={};for(let I of p)this.#$[I]=()=>{let $=this.#b.listeners(I),{count:H}=this.#I,Y=b;if(typeof Y.__signal_exit_emitter__==="object"&&typeof Y.__signal_exit_emitter__.count==="number")H+=Y.__signal_exit_emitter__.count;if($.length===H){this.unload();let X=this.#I.emit("exit",null,I),G=I==="SIGHUP"?this.#X:I;if(!X)b.kill(b.pid,G)}};this.#Y=b.reallyExit,this.#H=b.emit}onExit(b,I){if(!w1(this.#b))return()=>{};if(this.#G===!1)this.load();let $=I?.alwaysLast?"afterExit":"exit";return this.#I.on($,b),()=>{if(this.#I.removeListener($,b),this.#I.listeners.exit.length===0&&this.#I.listeners.afterExit.length===0)this.unload()}}load(){if(this.#G)return;this.#G=!0,this.#I.count+=1;for(let b of p)try{let I=this.#$[b];if(I)this.#b.on(b,I)}catch(I){}this.#b.emit=(b,...I)=>{return this.#J(b,...I)},this.#b.reallyExit=(b)=>{return this.#Z(b)}}unload(){if(!this.#G)return;this.#G=!1,p.forEach((b)=>{let I=this.#$[b];if(!I)throw new Error("Listener not defined for signal: "+b);try{this.#b.removeListener(b,I)}catch($){}}),this.#b.emit=this.#H,this.#b.reallyExit=this.#Y,this.#I.count-=1}#Z(b){if(!w1(this.#b))return 0;return this.#b.exitCode=b||0,this.#I.emit("exit",this.#b.exitCode,null),this.#Y.call(this.#b,this.#b.exitCode)}#J(b,...I){let $=this.#H;if(b==="exit"&&w1(this.#b)){if(typeof I[0]==="number")this.#b.exitCode=I[0];let H=$.call(this.#b,b,...I);return this.#I.emit("exit",this.#b.exitCode,null),H}else return $.call(this.#b,b,...I)}};Fb=globalThis.process,{onExit:K2,load:H8,unload:Y8}=VG(w1(Fb)?new N2(Fb):new z2)});import WG from"os";var zG=5000,S2=(b,I="SIGTERM",$={})=>{let H=b(I);return NG(b,I,$,H),H},NG=(b,I,$,H)=>{if(!KG(I,$,H))return;let Y=SG($),X=setTimeout(()=>{b("SIGKILL")},Y);if(X.unref)X.unref()},KG=(b,{forceKillAfterTimeout:I},$)=>jG(b)&&I!==!1&&$,jG=(b)=>b===WG.constants.signals.SIGTERM||typeof b==="string"&&b.toUpperCase()==="SIGTERM",SG=({forceKillAfterTimeout:b=!0})=>{if(b===!0)return zG;if(!Number.isFinite(b)||b<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${b}\` (${typeof b})`);return b},T2=(b,I)=>{if(b.kill())I.isCanceled=!0},TG=(b,I,$)=>{b.kill(I),$(Object.assign(new Error("Timed out"),{timedOut:!0,signal:I}))},L2=(b,{timeout:I,killSignal:$="SIGTERM"},H)=>{if(I===0||I===void 0)return H;let Y,X=new Promise((Z,J)=>{Y=setTimeout(()=>{TG(b,$,J)},I)}),G=H.finally(()=>{clearTimeout(Y)});return Promise.race([X,G])},B2=({timeout:b})=>{if(b!==void 0&&(!Number.isFinite(b)||b<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${b}\` (${typeof b})`)},_2=async(b,{cleanup:I,detached:$},H)=>{if(!I||$)return H;let Y=K2(()=>{b.kill()});return H.finally(()=>{Y()})};var M2=N(()=>{j2()});function x1(b){return b!==null&&typeof b==="object"&&typeof b.pipe==="function"}function Cb(b){return x1(b)&&b.writable!==!1&&typeof b._write==="function"&&typeof b._writableState==="object"}import{createWriteStream as LG}from"fs";import{ChildProcess as BG}from"child_process";var _G=(b)=>b instanceof BG&&typeof b.then==="function",hb=(b,I,$)=>{if(typeof $==="string")return b[I].pipe(LG($)),b;if(Cb($))return b[I].pipe($),b;if(!_G($))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!Cb($.stdin))throw new TypeError("The target child process's stdin must be available.");return b[I].pipe($.stdin),$},O2=(b)=>{if(b.stdout!==null)b.pipeStdout=hb.bind(void 0,b,"stdout");if(b.stderr!==null)b.pipeStderr=hb.bind(void 0,b,"stderr");if(b.all!==void 0)b.pipeAll=hb.bind(void 0,b,"all")};var A2=()=>{};var Z1=async(b,{init:I,convertChunk:$,getSize:H,truncateChunk:Y,addChunk:X,getFinalChunk:G,finalize:Z},{maxBuffer:J=Number.POSITIVE_INFINITY}={})=>{if(!OG(b))throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");let q=I();q.length=0;try{for await(let Q of b){let W=AG(Q),z=$[W](Q,q);y2({convertedChunk:z,state:q,getSize:H,truncateChunk:Y,addChunk:X,maxBuffer:J})}return MG({state:q,convertChunk:$,getSize:H,truncateChunk:Y,addChunk:X,getFinalChunk:G,maxBuffer:J}),Z(q)}catch(Q){throw Q.bufferedData=Z(q),Q}},MG=({state:b,getSize:I,truncateChunk:$,addChunk:H,getFinalChunk:Y,maxBuffer:X})=>{let G=Y(b);if(G!==void 0)y2({convertedChunk:G,state:b,getSize:I,truncateChunk:$,addChunk:H,maxBuffer:X})},y2=({convertedChunk:b,state:I,getSize:$,truncateChunk:H,addChunk:Y,maxBuffer:X})=>{let G=$(b),Z=I.length+G;if(Z<=X){R2(b,I,Y,Z);return}let J=H(b,X-I.length);if(J!==void 0)R2(J,I,Y,X);throw new mb},R2=(b,I,$,H)=>{I.contents=$(b,I,H),I.length=H},OG=(b)=>typeof b==="object"&&b!==null&&typeof b[Symbol.asyncIterator]==="function",AG=(b)=>{let I=typeof b;if(I==="string")return"string";if(I!=="object"||b===null)return"others";if(globalThis.Buffer?.isBuffer(b))return"buffer";let $=E2.call(b);if($==="[object ArrayBuffer]")return"arrayBuffer";if($==="[object DataView]")return"dataView";if(Number.isInteger(b.byteLength)&&Number.isInteger(b.byteOffset)&&E2.call(b.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},E2,mb;var J1=N(()=>{({toString:E2}=Object.prototype);mb=class mb extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var Db=(b)=>b,fb=()=>{return},db=({contents:b})=>b,k1=(b)=>{throw new Error(`Streams in object mode are not supported: ${String(b)}`)},F1=(b)=>b.length;var P2=N(()=>{J1()});async function cb(b,I){return Z1(b,vG,I)}var RG=()=>({contents:new ArrayBuffer(0)}),EG=(b)=>yG.encode(b),yG,w2=(b)=>new Uint8Array(b),x2=(b)=>new Uint8Array(b.buffer,b.byteOffset,b.byteLength),PG=(b,I)=>b.slice(0,I),wG=(b,{contents:I,length:$},H)=>{let Y=v2()?kG(I,H):xG(I,H);return new Uint8Array(Y).set(b,$),Y},xG=(b,I)=>{if(I<=b.byteLength)return b;let $=new ArrayBuffer(F2(I));return new Uint8Array($).set(new Uint8Array(b),0),$},kG=(b,I)=>{if(I<=b.maxByteLength)return b.resize(I),b;let $=new ArrayBuffer(I,{maxByteLength:F2(I)});return new Uint8Array($).set(new Uint8Array(b),0),$},F2=(b)=>k2**Math.ceil(Math.log(b)/Math.log(k2)),k2=2,FG=({contents:b,length:I})=>v2()?b:b.slice(0,I),v2=()=>("resize"in ArrayBuffer.prototype),vG;var ub=N(()=>{J1();yG=new TextEncoder,vG={init:RG,convertChunk:{string:EG,buffer:w2,arrayBuffer:w2,dataView:x2,typedArray:x2,others:k1},getSize:F1,truncateChunk:PG,addChunk:wG,getFinalChunk:fb,finalize:FG}});async function v1(b,I){if(!("Buffer"in globalThis))throw new Error("getStreamAsBuffer() is only supported in Node.js");try{return C2(await cb(b,I))}catch($){if($.bufferedData!==void 0)$.bufferedData=C2($.bufferedData);throw $}}var C2=(b)=>globalThis.Buffer.from(b);var h2=N(()=>{ub()});async function gb(b,I){return Z1(b,fG,I)}var CG=()=>({contents:"",textDecoder:new TextDecoder}),C1=(b,{textDecoder:I})=>I.decode(b,{stream:!0}),hG=(b,{contents:I})=>I+b,mG=(b,I)=>b.slice(0,I),DG=({textDecoder:b})=>{let I=b.decode();return I===""?void 0:I},fG;var m2=N(()=>{J1();fG={init:CG,convertChunk:{string:Db,buffer:C1,arrayBuffer:C1,dataView:C1,typedArray:C1,others:k1},getSize:F1,truncateChunk:mG,addChunk:hG,getFinalChunk:DG,finalize:db}});var D2=N(()=>{P2();ub();h2();m2();J1()});var d2=O((C8,f2)=>{var{PassThrough:dG}=A("stream");f2.exports=function(){var b=[],I=new dG({objectMode:!0});return I.setMaxListeners(0),I.add=$,I.isEmpty=H,I.on("unpipe",Y),Array.prototype.slice.call(arguments).forEach($),I;function $(X){if(Array.isArray(X))return X.forEach($),this;return b.push(X),X.once("end",Y.bind(null,X)),X.once("error",I.emit.bind(I,"error")),X.pipe(I,{end:!1}),this}function H(){return b.length==0}function Y(X){if(b=b.filter(function(G){return G!==X}),!b.length&&I.readable)I.end()}}});import{createReadStream as cG,readFileSync as uG}from"fs";import{setTimeout as gG}from"timers/promises";var c2,u2=(b)=>{if(b!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},pG=({input:b,inputFile:I})=>{if(typeof I!=="string")return b;return u2(b),uG(I)},g2=(b)=>{let I=pG(b);if(x1(I))throw new TypeError("The `input` option cannot be a stream in sync mode");return I},nG=({input:b,inputFile:I})=>{if(typeof I!=="string")return b;return u2(b),cG(I)},p2=(b,I)=>{let $=nG(I);if($===void 0)return;if(x1($))$.pipe(b.stdin);else b.stdin.end($)},n2=(b,{all:I})=>{if(!I||!b.stdout&&!b.stderr)return;let $=c2.default();if(b.stdout)$.add(b.stdout);if(b.stderr)$.add(b.stderr);return $},pb=async(b,I)=>{if(!b||I===void 0)return;await gG(0),b.destroy();try{return await I}catch($){return $.bufferedData}},nb=(b,{encoding:I,buffer:$,maxBuffer:H})=>{if(!b||!$)return;if(I==="utf8"||I==="utf-8")return gb(b,{maxBuffer:H});if(I===null||I==="buffer")return v1(b,{maxBuffer:H});return lG(b,H,I)},lG=async(b,I,$)=>{return(await v1(b,{maxBuffer:I})).toString($)},l2=async({stdout:b,stderr:I,all:$},{encoding:H,buffer:Y,maxBuffer:X},G)=>{let Z=nb(b,{encoding:H,buffer:Y,maxBuffer:X}),J=nb(I,{encoding:H,buffer:Y,maxBuffer:X}),q=nb($,{encoding:H,buffer:Y,maxBuffer:X*2});try{return await Promise.all([G,Z,J,q])}catch(Q){return Promise.all([{error:Q,signal:Q.signal,timedOut:Q.timedOut},pb(b,Z),pb(I,J),pb($,q)])}};var a2=N(()=>{D2();c2=F(d2(),1)});var aG,iG,lb=(b,I)=>{for(let[$,H]of iG){let Y=typeof I==="function"?(...X)=>Reflect.apply(H.value,I(),X):H.value.bind(I);Reflect.defineProperty(b,$,{...H,value:Y})}},i2=(b)=>new Promise((I,$)=>{if(b.on("exit",(H,Y)=>{I({exitCode:H,signal:Y})}),b.on("error",(H)=>{$(H)}),b.stdin)b.stdin.on("error",(H)=>{$(H)})});var r2=N(()=>{aG=(async()=>{})().constructor.prototype,iG=["then","catch","finally"].map((b)=>[b,Reflect.getOwnPropertyDescriptor(aG,b)])});import{Buffer as rG}from"buffer";import{ChildProcess as tG}from"child_process";var s2=(b,I=[])=>{if(!Array.isArray(I))return[b];return[b,...I]},oG,sG=(b)=>{if(typeof b!=="string"||oG.test(b))return b;return`"${b.replaceAll('"',"\\\"")}"`},ab=(b,I)=>s2(b,I).join(" "),ib=(b,I)=>s2(b,I).map(($)=>sG($)).join(" "),eG,t2=(b)=>{let I=typeof b;if(I==="string")return b;if(I==="number")return String(b);if(I==="object"&&b!==null&&!(b instanceof tG)&&"stdout"in b){let $=typeof b.stdout;if($==="string")return b.stdout;if(rG.isBuffer(b.stdout))return b.stdout.toString();throw new TypeError(`Unexpected "${$}" stdout in template expression`)}throw new TypeError(`Unexpected "${I}" in template expression`)},o2=(b,I,$)=>$||b.length===0||I.length===0?[...b,...I]:[...b.slice(0,-1),`${b.at(-1)}${I[0]}`,...I.slice(1)],b$=({templates:b,expressions:I,tokens:$,index:H,template:Y})=>{let X=Y??b.raw[H],G=X.split(eG).filter(Boolean),Z=o2($,G,X.startsWith(" "));if(H===I.length)return Z;let J=I[H],q=Array.isArray(J)?J.map((Q)=>t2(Q)):[t2(J)];return o2(Z,q,X.endsWith(" "))},rb=(b,I)=>{let $=[];for(let[H,Y]of b.entries())$=b$({templates:b,expressions:I,tokens:$,index:H,template:Y});return $};var e2=N(()=>{oG=/^[\w.-]+$/,eG=/ +/g});import{debuglog as I$}from"util";import G$ from"process";var b9,h1=(b,I)=>String(b).padStart(I,"0"),$$=()=>{let b=new Date;return`${h1(b.getHours(),2)}:${h1(b.getMinutes(),2)}:${h1(b.getSeconds(),2)}.${h1(b.getMilliseconds(),3)}`},tb=(b,{verbose:I})=>{if(!I)return;G$.stderr.write(`[${$$()}] ${b}
|
|
92
|
+
`)};var I9=N(()=>{b9=I$("execa").enabled});import{Buffer as H$}from"buffer";import Y$ from"path";import ob from"child_process";import m1 from"process";function w(b,I,$){let H=H9(b,I,$),Y=ab(b,I),X=ib(b,I);tb(X,H.options),B2(H.options);let G;try{G=ob.spawn(H.file,H.args,H.options)}catch(K){let S=new ob.ChildProcess,j=Promise.reject(X1({error:K,stdout:"",stderr:"",all:"",command:Y,escapedCommand:X,parsed:H,timedOut:!1,isCanceled:!1,killed:!1}));return lb(S,j),S}let Z=i2(G),J=L2(G,H.options,Z),q=_2(G,H.options,J),Q={isCanceled:!1};G.kill=S2.bind(null,G.kill.bind(G)),G.cancel=T2.bind(null,G,Q);let z=b2(async()=>{let[{error:K,exitCode:S,signal:j,timedOut:_},h,m,R]=await l2(G,H.options,q),n=q1(H.options,h),z1=q1(H.options,m),l=q1(H.options,R);if(K||S!==0||j!==null){let JI=X1({error:K,exitCode:S,signal:j,stdout:n,stderr:z1,all:l,command:Y,escapedCommand:X,parsed:H,timedOut:_,isCanceled:Q.isCanceled||(H.options.signal?H.options.signal.aborted:!1),killed:G.killed});if(!H.options.reject)return JI;throw JI}return{command:Y,escapedCommand:X,exitCode:0,stdout:n,stderr:z1,all:l,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return p2(G,H.options),G.all=n2(G,H.options),O2(G),lb(G,z),G}function x(b,I,$){let H=H9(b,I,$),Y=ab(b,I),X=ib(b,I);tb(X,H.options);let G=g2(H.options),Z;try{Z=ob.spawnSync(H.file,H.args,{...H.options,input:G})}catch(Q){throw X1({error:Q,stdout:"",stderr:"",all:"",command:Y,escapedCommand:X,parsed:H,timedOut:!1,isCanceled:!1,killed:!1})}let J=q1(H.options,Z.stdout,Z.error),q=q1(H.options,Z.stderr,Z.error);if(Z.error||Z.status!==0||Z.signal!==null){let Q=X1({stdout:J,stderr:q,error:Z.error,signal:Z.signal,exitCode:Z.status,command:Y,escapedCommand:X,parsed:H,timedOut:Z.error&&Z.error.code==="ETIMEDOUT",isCanceled:!1,killed:Z.signal!==null});if(!H.options.reject)return Q;throw Q}return{command:Y,escapedCommand:X,exitCode:0,stdout:J,stderr:q,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}function Y9(b){function I($,...H){if(!Array.isArray($))return Y9({...b,...$});let[Y,...X]=rb($,H);return w(Y,X,G9(b))}return I.sync=($,...H)=>{if(!Array.isArray($))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[Y,...X]=rb($,H);return x(Y,X,G9(b))},I}var $9,X$=1e8,Z$=({env:b,extendEnv:I,preferLocal:$,localDir:H,execPath:Y})=>{let X=I?{...m1.env,...b}:b;if($)return t0({env:X,cwd:H,execPath:Y});return X},H9=(b,I,$={})=>{let H=$9.default._parse(b,I,$);if(b=H.command,I=H.args,$=H.options,$={maxBuffer:X$,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:$.cwd||m1.cwd(),execPath:m1.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:b9,...$},$.env=Z$($),$.stdio=Q2($),m1.platform==="win32"&&Y$.basename(b,".exe")==="cmd")I.unshift("/q");return{file:b,args:I,options:$,parsed:H}},q1=(b,I,$)=>{if(typeof I!=="string"&&!H$.isBuffer(I))return $===void 0?void 0:"";if(b.stripFinalNewline)return Eb(I);return I},J$=({input:b,inputFile:I,stdio:$})=>b===void 0&&I===void 0&&$===void 0?{stdin:"inherit"}:{},G9=(b={})=>({preferLocal:!0,...J$(b),...b}),U7;var Q1=N(()=>{$9=F(i0(),1);o0();I2();q2();U2();M2();A2();a2();r2();e2();I9();U7=Y9()});var D1=(b)=>{if(b.code==="ENOENT")throw new Error("Couldn't find the termux-api scripts. You can install them with: apt install termux-api");throw b},q$,X9;var Z9=N(()=>{Q1();q$={async copy(b){try{await w("termux-clipboard-set",b)}catch(I){D1(I)}},async paste(b){try{let{stdout:I}=await w("termux-clipboard-get",b);return I}catch(I){D1(I)}},copySync(b){try{x("termux-clipboard-set",b)}catch(I){D1(I)}},pasteSync(b){try{return x("termux-clipboard-get",b).stdout}catch(I){D1(I)}}},X9=q$});import V9 from"path";import{fileURLToPath as Q$}from"url";var U$,W9="xsel",z9,J9,q9,N9=(b,I)=>{let $;if(b.code==="ENOENT")$=new Error("Couldn't find the `xsel` binary and fallback didn't work. On Debian/Ubuntu you can install xsel with: sudo apt install xsel");else $=new Error("Both xsel and fallback failed"),$.xselError=b;return $.fallbackError=I,$},Q9=async(b,I)=>{try{let{stdout:$}=await w(W9,b,I);return $}catch($){try{let{stdout:H}=await w(z9,b,I);return H}catch(H){throw N9($,H)}}},U9=(b,I)=>{try{return x(W9,b,I).stdout}catch($){try{return x(z9,b,I).stdout}catch(H){throw N9($,H)}}},V$,K9;var j9=N(()=>{Q1();U$=V9.dirname(Q$(import.meta.url)),z9=V9.join(U$,"../fallbacks/linux/xsel"),J9=["--clipboard","--input"],q9=["--clipboard","--output"],V$={async copy(b){await Q9(J9,b)},copySync(b){U9(J9,b)},paste:(b)=>Q9(q9,b),pasteSync:(b)=>U9(q9,b)},K9=V$});var f1,W$,S9;var T9=N(()=>{Q1();f1={LC_CTYPE:"UTF-8"},W$={copy:async(b)=>w("pbcopy",{...b,env:f1}),async paste(b){let{stdout:I}=await w("pbpaste",{...b,env:f1});return I},copySync:(b)=>x("pbcopy",{...b,env:f1}),pasteSync:(b)=>x("pbpaste",{...b,env:f1}).stdout},S9=W$});import{promisify as z$}from"util";import N$ from"process";import U1 from"child_process";function L9(){let{arch:b,platform:I,env:$}=N$;if(I==="darwin"&&b==="x64")return U1.execFileSync("sysctl",["-inq","sysctl.proc_translated"],{encoding:"utf8"}).trim()==="1"?"arm64":"x64";if(b==="arm64"||b==="x64")return b;if(I==="win32"&&Object.hasOwn($,"PROCESSOR_ARCHITEW6432"))return"x64";if(I==="linux"){if(U1.execFileSync("getconf",["LONG_BIT"],{encoding:"utf8"}).trim()==="64")return"x64"}return b}var O7;var B9=N(()=>{O7=z$(U1.execFile)});function _9(){return K$.has(L9())}var K$;var M9=N(()=>{B9();K$=new Set(["arm64","x64","ppc64","riscv64"])});import O9 from"path";import{fileURLToPath as j$}from"url";var S$,T$,d1,L$,sb;var A9=N(()=>{Q1();M9();S$=O9.dirname(j$(import.meta.url)),T$=_9()?"x86_64":"i686",d1=O9.join(S$,`../fallbacks/windows/clipboard_${T$}.exe`),L$={copy:async(b)=>w(d1,["--copy"],b),async paste(b){let{stdout:I}=await w(d1,["--paste"],b);return I},copySync:(b)=>x(d1,["--copy"],b),pasteSync:(b)=>x(d1,["--paste"],b).stdout},sb=L$});import R9 from"process";var c1,V1,E9;var y9=N(()=>{X0();Z9();j9();T9();A9();c1=(()=>{switch(R9.platform){case"darwin":return S9;case"win32":return sb;case"android":{if(R9.env.PREFIX!=="/data/data/com.termux/files/usr")throw new Error("You need to install Termux for this module to work on Android: https://termux.com");return X9}default:{if(Y0)return sb;return K9}}})(),V1={};V1.write=async(b)=>{if(typeof b!=="string")throw new TypeError(`Expected a string, got ${typeof b}`);await c1.copy({input:b})};V1.read=async()=>c1.paste({stripFinalNewline:!1});V1.writeSync=(b)=>{if(typeof b!=="string")throw new TypeError(`Expected a string, got ${typeof b}`);c1.copySync({input:b})};V1.readSync=()=>c1.pasteSync({stripFinalNewline:!1});E9=V1});var II={};b1(II,{showCommitResult:()=>k,showCommitPreview:()=>u1,showCancellation:()=>e,selectFilesForCommit:()=>eb,editCommitMessage:()=>g1,copyToClipboard:()=>p1,confirmCommit:()=>B$,askContinueCommits:()=>bI});async function u1(b){i(`Tipo: ${b.type}
|
|
93
|
+
Mensagem: "${b.message}"`,"\uD83D\uDCAD Sugest\xE3o de Commit");let I=await G1({message:"O que voc\xEA gostaria de fazer?",options:[{value:"commit",label:"\u2705 Fazer commit com esta mensagem",hint:"Executar git commit imediatamente"},{value:"edit",label:"\u270F\uFE0F Editar mensagem",hint:"Modificar a mensagem antes de commitar"},{value:"copy",label:"\uD83D\uDCCB Copiar para clipboard",hint:"Copiar mensagem e sair sem commitar"},{value:"cancel",label:"\u274C Cancelar",hint:"Sair sem fazer nada"}]});if(P(I))return{action:"cancel"};return{action:I}}async function g1(b){let I=await PI({message:"Edite a mensagem do commit:",initialValue:b,placeholder:"Digite a mensagem do commit...",validate:(H)=>{if(!H||H.trim().length===0)return"A mensagem n\xE3o pode estar vazia";if(H.trim().length>72)return"A mensagem est\xE1 muito longa (m\xE1ximo 72 caracteres recomendado)"}});if(P(I))return{action:"cancel"};let $=await g({message:`Confirma a mensagem editada: "${I}"?`});if(P($)||!$)return{action:"cancel"};return{action:"commit",message:I}}async function p1(b){try{return await E9.write(b),V.success("\u2705 Mensagem copiada para a \xE1rea de transfer\xEAncia!"),!0}catch(I){return V.error(`\u274C Erro ao copiar: ${I instanceof Error?I.message:"Erro desconhecido"}`),!1}}async function B$(b){i(`"${b}"`,"\uD83D\uDE80 Confirmar Commit");let I=await g({message:"Executar o commit agora?"});if(P(I))return!1;return I}function k(b,I,$){if(b&&I)V.success("\u2705 Commit realizado com sucesso!"),V.info(`\uD83D\uDD17 Hash: ${I.substring(0,8)}`);else V.error(`\u274C Erro ao realizar commit: ${$||"Erro desconhecido"}`)}async function eb(b){V.info("\uD83D\uDCCB Modo Split: Selecione os arquivos para este commit");let I=[];for(let $ of b){let H=await g({message:`Incluir "${$}" neste commit?`});if(P(H))break;if(H)I.push($)}return I}async function bI(b){if(b.length===0)return!1;V.info(`\uD83D\uDCC4 Arquivos restantes: ${b.join(", ")}`);let I=await g({message:"Gerar commit para os arquivos restantes?"});if(P(I))return!1;return I}function e(){wI("Opera\xE7\xE3o cancelada pelo usu\xE1rio")}var W1=N(()=>{r();y9()});var P9={};b1(P9,{showSmartSplitProgress:()=>O$,showSmartSplitGroups:()=>_$,confirmGroupCommit:()=>M$,chooseSplitMode:()=>GI});async function GI(){let b=await G1({message:"Como voc\xEA gostaria de organizar os commits?",options:[{value:"smart",label:"\uD83E\uDDE0 Smart Split (Recomendado)",hint:"IA analisa contexto e agrupa automaticamente"},{value:"manual",label:"\u270B Split Manual",hint:"Voc\xEA escolhe arquivos manualmente"},{value:"cancel",label:"\u274C Cancelar",hint:"Voltar ao modo normal"}]});if(P(b))return{action:"cancel"};if(b==="manual")return{action:"manual"};if(b==="smart")return{action:"proceed"};return{action:"cancel"}}async function _$(b){i(`Identificamos ${b.length} grupo(s) l\xF3gico(s) para seus commits:
|
|
94
94
|
|
|
95
95
|
`+b.map(($,H)=>`${H+1}. **${$.name}**
|
|
96
96
|
`+` \uD83D\uDCC4 ${$.files.join(", ")}
|
|
97
97
|
`+` \uD83D\uDCA1 ${$.description}
|
|
98
98
|
`+` \uD83C\uDFAF Confian\xE7a: ${Math.round($.confidence*100)}%`).join(`
|
|
99
99
|
|
|
100
|
-
`),"\uD83E\uDDE0 An\xE1lise de Contexto");let I=await
|
|
100
|
+
`),"\uD83E\uDDE0 An\xE1lise de Contexto");let I=await G1({message:"O que voc\xEA gostaria de fazer?",options:[{value:"proceed",label:"\u2705 Prosseguir com esta organiza\xE7\xE3o",hint:"Usar os grupos como sugeridos pela IA"},{value:"manual",label:"\u270B Fazer split manual",hint:"Escolher arquivos manualmente"},{value:"cancel",label:"\u274C Cancelar",hint:"Voltar ao modo normal"}]});if(P(I))return{action:"cancel"};if(I==="proceed")return{action:"proceed",groups:b};return{action:I}}async function M$(b,I){i(`**Grupo:** ${b.name}
|
|
101
101
|
**Arquivos:** ${b.files.join(", ")}
|
|
102
|
-
**Mensagem:** "${I}"`,"\uD83D\uDE80 Confirmar Commit do Grupo");let $=await
|
|
102
|
+
**Mensagem:** "${I}"`,"\uD83D\uDE80 Confirmar Commit do Grupo");let $=await g({message:`Fazer commit para "${b.name}"?`});if(P($))return!1;return $}function O$(b,I,$){let H=Math.round(b/I*100),Y="\u2588".repeat(Math.floor(H/10))+"\u2591".repeat(10-Math.floor(H/10));V.info(`\uD83D\uDD04 Progresso: [${Y}] ${H}% (${b}/${I})`),V.info(`\uD83D\uDCCB Processando: ${$}`)}var $I=N(()=>{r()});import A$ from"crypto";class w9{cache=new Map;config;constructor(b){this.config=b}generateHash(b,I){let $={files:b.sort(),diff:I.substring(0,1000),model:this.config.openai.model,temperature:this.config.openai.temperature};return A$.createHash("md5").update(JSON.stringify($)).digest("hex")}get(b,I){if(!this.config.cache.enabled)return{hit:!1};let $=this.generateHash(b,I),H=this.cache.get($);if(!H)return{hit:!1};let Y=Date.now(),X=this.config.cache.ttl*60*1000;if(Y-H.timestamp>X)return this.cache.delete($),{hit:!1};return{hit:!0,groups:H.groups}}set(b,I,$){if(!this.config.cache.enabled)return;if(this.cache.size>=this.config.cache.maxSize)this.cleanup();if(this.cache.size>=this.config.cache.maxSize)return;let H=this.generateHash(b,I),Y={groups:$,timestamp:Date.now(),hash:H};this.cache.set(H,Y)}cleanup(){let b=Date.now(),I=this.config.cache.ttl*60*1000;for(let[$,H]of this.cache.entries())if(b-H.timestamp>I)this.cache.delete($);if(this.cache.size>=this.config.cache.maxSize){let H=Array.from(this.cache.entries()).sort((Y,X)=>Y[1].timestamp-X[1].timestamp).slice(0,Math.ceil(this.config.cache.maxSize*0.5));for(let[Y]of H)this.cache.delete(Y)}}clear(){this.cache.clear()}getStats(){return{size:this.cache.size,maxSize:this.config.cache.maxSize,enabled:this.config.cache.enabled}}}function k9(b){x9=new w9(b)}function F9(){return x9}function v9(b,I){let $=F9();return $?$.get(b,I):{hit:!1}}function C9(b,I,$){let H=F9();if(H)H.set(b,I,$)}var x9=null;var HI=()=>{};function R$(b,I){let H=I.length>8000?I.substring(0,8000)+`
|
|
103
103
|
... (diff truncado)`:I,Y=b.length,X=b.reduce((Z,J)=>{let q=J.split(".").pop()||"sem-extensao";return Z[q]=(Z[q]||0)+1,Z},{}),G=Object.entries(X).map(([Z,J])=>`${Z}: ${J}`).join(", ");return`Analise os arquivos modificados e agrupe em commits l\xF3gicos.
|
|
104
104
|
|
|
105
105
|
ARQUIVOS (${Y}): ${b.join(", ")}
|
|
@@ -121,7 +121,7 @@ Agrupe arquivos relacionados. M\xE1ximo 5 grupos. Responda em JSON:
|
|
|
121
121
|
"confidence": 0.8
|
|
122
122
|
}
|
|
123
123
|
]
|
|
124
|
-
}`}function
|
|
124
|
+
}`}function E$(b){let I=b.reduce((H,Y)=>{let X=Y.split("/").slice(0,-1).join("/")||"root";if(!H[X])H[X]=[];return H[X].push(Y),H},{});return`Agrupe estes arquivos em commits l\xF3gicos baseado nos diret\xF3rios:
|
|
125
125
|
|
|
126
126
|
ARQUIVOS POR DIRET\xD3RIO:
|
|
127
127
|
${Object.entries(I).map(([H,Y])=>`${H}: ${Y.length} arquivo(s)`).join(`
|
|
@@ -140,7 +140,7 @@ Agrupe por funcionalidade relacionada. M\xE1ximo 5 grupos. JSON:
|
|
|
140
140
|
"confidence": 0.7
|
|
141
141
|
}
|
|
142
142
|
]
|
|
143
|
-
}`}async function
|
|
143
|
+
}`}async function y$(b,I,$){try{if(!$.openai.apiKey)return{success:!1,error:"Chave da OpenAI n\xE3o encontrada"};let H=v9(b,I);if(H.hit&&H.groups)return{success:!0,groups:H.groups};let Y=6000,X=I.length>Y,G=X?E$(b):R$(b,I);if(X)console.warn(`\u26A0\uFE0F Diff muito grande (${I.length} chars), usando an\xE1lise baseada em nomes de arquivos`);let Z=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${$.openai.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify({model:$.openai.model,messages:[{role:"user",content:G}],max_tokens:800,temperature:0.3})});if(!Z.ok){let j=await Z.json().catch(()=>({}));return{success:!1,error:`Erro da OpenAI (${Z.status}): ${j.error?.message||"Erro desconhecido"}`}}let q=(await Z.json()).choices?.[0]?.message?.content?.trim();if(!q)return{success:!1,error:"OpenAI retornou resposta vazia"};let Q=q.match(/\{[\s\S]*\}/);if(!Q)return{success:!1,error:"Resposta da OpenAI n\xE3o cont\xE9m JSON v\xE1lido"};let W=JSON.parse(Q[0]);if(!W.groups||!Array.isArray(W.groups))return{success:!1,error:"Formato de resposta inv\xE1lido da OpenAI"};let z=W.groups.flatMap((j)=>j.files||[]),K=b.filter((j)=>!z.includes(j));if(K.length>0)W.groups[0].files=[...W.groups[0].files||[],...K];let S=W.groups.map((j)=>({id:j.id||`group-${Math.random().toString(36).substr(2,9)}`,name:j.name||"Grupo sem nome",description:j.description||"Sem descri\xE7\xE3o",files:j.files||[],diff:"",confidence:j.confidence||0.5}));return C9(b,I,S),{success:!0,groups:S}}catch(H){return{success:!1,error:`Erro ao analisar contexto: ${H instanceof Error?H.message:"Erro desconhecido"}`}}}async function P$(b){let{getFileDiff:I}=await Promise.resolve().then(() => (D(),c)),$=b.files.map((X)=>{try{let G=I(X),Z=4000;return G.length>4000?G.substring(0,4000)+`
|
|
144
144
|
... (diff truncado)`:G}catch{return""}}).filter((X)=>X.length>0);if($.length===0&&b.files.length>0){let{execSync:X}=await import("child_process"),G=b.files.filter((J)=>{try{return X(`test -f "${J}"`,{stdio:"ignore"}),X(`git status --porcelain -- "${J}"`,{encoding:"utf-8",stdio:"pipe"}).trim().startsWith("??")}catch{return!1}});if(G.length>0)return G.map((J)=>{try{let q=X(`cat "${J}"`,{encoding:"utf-8",stdio:"pipe"}),Q=2000,W=q.length>2000?q.substring(0,2000)+`
|
|
145
145
|
... (conte\xFAdo truncado)`:q;return`diff --git a/${J} b/${J}
|
|
146
146
|
new file mode 100644
|
|
@@ -165,9 +165,9 @@ ${W.split(`
|
|
|
165
165
|
`)}`}catch{return""}}).filter((J)=>J.length>0).join(`
|
|
166
166
|
`)}let H=$.join(`
|
|
167
167
|
`),Y=8000;return H.length>Y?H.substring(0,Y)+`
|
|
168
|
-
... (diff total truncado)`:H}async function
|
|
169
|
-
\uD83D\uDD04 Processando grupo ${Y+1}/${H.groups.length}: ${X.name}`);let G=await
|
|
170
|
-
`);if(!G){if(!$.silent)V.warn("\u26A0\uFE0F Nenhum diff encontrado para os arquivos selecionados");H=H.filter((J)=>!Y.includes(J));continue}if(!$.silent)V.info(`\uD83E\uDD16 Gerando commit para: ${Y.join(", ")}`);let Z=await
|
|
168
|
+
... (diff total truncado)`:H}async function YI(b,I,$){if(!$.silent)V.info("\uD83E\uDDE0 Modo Smart Split ativado - Agrupando arquivos por contexto");if(!$.silent)V.info("\uD83E\uDD16 Analisando contexto das mudan\xE7as...");let H=await y$(b.stagedFiles,b.diff,I);if(!H.success){if(!$.silent)V.error(`\u274C Erro na an\xE1lise de contexto: ${H.error}`);return}if(!H.groups||H.groups.length===0){if(!$.silent)V.error("\u274C Nenhum grupo foi criado pela an\xE1lise");return}if(!$.silent)V.success(`\u2705 ${H.groups.length} grupo(s) identificado(s):`),H.groups.forEach((Y,X)=>{V.info(` ${X+1}. ${Y.name} (${Y.files.length} arquivo(s))`),V.info(` \uD83D\uDCC4 ${Y.files.join(", ")}`)});if(!$.yes&&!$.silent){let{showSmartSplitGroups:Y}=await Promise.resolve().then(() => ($I(),P9)),X=await Y(H.groups);if(X.action==="cancel"){if(!$.silent)V.info("\u274C Opera\xE7\xE3o cancelada pelo usu\xE1rio");return}if(X.action==="manual"){let G={...$,split:!0,smartSplit:!1},{main:Z}=await Promise.resolve().then(() => (XI(),m9));await Z(G);return}}for(let Y=0;Y<H.groups.length;Y++){let X=H.groups[Y];if(!X){if(!$.silent)V.error(`\u274C Grupo ${Y+1} \xE9 undefined`);continue}if(!$.silent)V.info(`
|
|
169
|
+
\uD83D\uDD04 Processando grupo ${Y+1}/${H.groups.length}: ${X.name}`);let G=await P$(X);if(!G){if(!$.silent)V.warn(`\u26A0\uFE0F Nenhum diff encontrado para o grupo: ${X.name}`),V.info(` \uD83D\uDCC4 Arquivos: ${X.files.join(", ")}`),V.info(" \uD83D\uDCA1 Poss\xEDvel causa: arquivos novos, deletados/recriados, ou sem mudan\xE7as");continue}if(!$.silent)V.info(`\uD83E\uDD16 Gerando commit para: ${X.name}`);let{generateWithRetry:Z}=await Promise.resolve().then(() => eI),J=await Z(G,I,X.files);if(!J.success){if(!$.silent)V.error(`\u274C Erro ao gerar commit para ${X.name}: ${J.error}`);continue}if(!J.suggestion){if(!$.silent)V.error(`\u274C Nenhuma sugest\xE3o gerada para ${X.name}`);continue}if(I.dryRun){if(!$.silent)V.info(`\uD83D\uDD0D Dry Run - Grupo: ${X.name}`),V.info(`\uD83D\uDCC4 Arquivos: ${X.files.join(", ")}`),V.info(`\uD83D\uDCAD Mensagem: "${J.suggestion.message}"`);continue}if($.yes){let{executeFileCommit:q}=await Promise.resolve().then(() => (D(),c)),Q;if(X.files.length===1&&X.files[0])Q=q(X.files[0],J.suggestion.message||"");else{let{execSync:W}=await import("child_process"),{escapeShellArg:z}=await Promise.resolve().then(() => (D(),c));try{let K=X.files.map((_)=>z(_)).join(" "),S=z(J.suggestion.message||"");W(`git commit ${K} -m ${S}`,{stdio:"pipe"}),Q={success:!0,hash:W("git rev-parse HEAD",{encoding:"utf-8",stdio:"pipe"}).trim(),message:J.suggestion.message||""}}catch(K){Q={success:!1,error:K instanceof Error?K.message:"Erro desconhecido ao executar commit"}}}k(Q.success,Q.hash,Q.error)}else{let{showCommitPreview:q,editCommitMessage:Q,copyToClipboard:W,showCancellation:z}=await Promise.resolve().then(() => (W1(),II));switch((await q(J.suggestion)).action){case"commit":{let{executeFileCommit:S}=await Promise.resolve().then(() => (D(),c)),j,_=J.suggestion.message||"Atualiza\xE7\xE3o de arquivos";if(X.files.length===1&&X.files[0])j=S(X.files[0],_);else{let{execSync:h}=await import("child_process"),{escapeShellArg:m}=await Promise.resolve().then(() => (D(),c));try{let R=X.files.map((l)=>m(l)).join(" "),n=m(_);h(`git commit ${R} -m ${n}`,{stdio:"pipe"}),j={success:!0,hash:h("git rev-parse HEAD",{encoding:"utf-8",stdio:"pipe"}).trim(),message:_}}catch(R){j={success:!1,error:R instanceof Error?R.message:"Erro desconhecido ao executar commit"}}}k(j.success,j.hash,j.error);break}case"edit":{let S=await Q(J.suggestion.message);if(S.action==="commit"&&S.message){let{executeFileCommit:j}=await Promise.resolve().then(() => (D(),c)),_;if(X.files.length===1&&X.files[0])_=j(X.files[0],S.message||"");else{let{execSync:h}=await import("child_process"),{escapeShellArg:m}=await Promise.resolve().then(() => (D(),c));try{let R=X.files.map((l)=>m(l)).join(" "),n=m(S.message||"");h(`git commit ${R} -m ${n}`,{stdio:"pipe"}),_={success:!0,hash:h("git rev-parse HEAD",{encoding:"utf-8",stdio:"pipe"}).trim(),message:S.message||""}}catch(R){_={success:!1,error:R instanceof Error?R.message:"Erro desconhecido ao executar commit"}}}k(_.success,_.hash,_.error)}break}case"copy":{if(await W(J.suggestion.message),!$.silent)V.info("\uD83C\uDFAF Mensagem copiada para clipboard");break}case"cancel":{z();return}}}if(Y<H.groups.length-1&&!$.yes){let{askContinueCommits:q}=await Promise.resolve().then(() => (W1(),II)),Q=H.groups.slice(Y+1).filter((z)=>z!==void 0).map((z)=>z.name);if(!await q(Q))break}}if(!$.silent)V.success("\u2705 Smart Split conclu\xEDdo!")}var h9=N(()=>{HI();W1();r()});var m9={};b1(m9,{main:()=>ZI});async function ZI(b={silent:!1,yes:!1,auto:!1,split:!1,smartSplit:!1,dryRun:!1,help:!1,version:!1}){if(!b.silent)V.info("\uD83D\uDE80 Commit Wizard iniciado!");if(!Vb()){if(V.error("\u274C N\xE3o foi encontrado um reposit\xF3rio Git neste diret\xF3rio."),!b.silent)V.info("\uD83D\uDCA1 Execute o comando em um diret\xF3rio com reposit\xF3rio Git inicializado.");process.exit(1)}if(!b.silent)V.info("\u2699\uFE0F Carregando configura\xE7\xE3o...");let I=nI();if(k9(I),b.split)I.splitCommits=!0;if(b.dryRun)I.dryRun=!0;let $=lI(I);if($.length>0)V.error("\u274C Erros na configura\xE7\xE3o:"),$.forEach((G)=>V.error(` \u2022 ${G}`)),process.exit(1);if(!b.silent)V.success(`\u2705 Configura\xE7\xE3o carregada (modelo: ${I.openai.model}, idioma: ${I.language})`);if(!b.silent)V.info("\uD83D\uDCCB Verificando arquivos staged...");let H=Wb();if(!H.hasStaged){if(V.warn("\u26A0\uFE0F Nenhum arquivo foi encontrado no stage."),!b.silent)V.info("\uD83D\uDCA1 Use `git add <arquivo>` para adicionar arquivos ao stage antes de gerar o commit.");process.exit(0)}let Y=zb();if(!b.silent)V.success(`\u2705 Encontrados ${H.stagedFiles.length} arquivo(s) staged:`),H.stagedFiles.forEach((G)=>V.info(` \uD83D\uDCC4 ${G}`)),V.info(`\uD83D\uDCCA Estat\xEDsticas: +${Y.added} -${Y.removed} linhas`);if(I.splitCommits||b.smartSplit)if(b.yes)return await YI(H,I,b);else switch((await GI()).action){case"proceed":return await YI(H,I,b);case"manual":return await w$(H,I,b);case"cancel":e();return}if(!b.silent)V.info("\uD83E\uDD16 Gerando mensagem de commit com IA...");let X=await M1(H.diff,I,H.stagedFiles);if(!X.success)V.error(`\u274C Erro ao gerar commit: ${X.error}`),process.exit(1);if(!X.suggestion)V.error("\u274C Nenhuma sugest\xE3o foi gerada"),process.exit(1);if(!b.silent)V.success("\u2728 Mensagem de commit gerada!");if(I.dryRun){V.info("\uD83D\uDD0D Modo Dry Run - Mensagem gerada:"),V.info(`"${X.suggestion.message}"`),V.info("\uD83D\uDCA1 Execute sem --dry-run para fazer o commit");return}if(b.yes){let G=u(X.suggestion.message);k(G.success,G.hash,G.error);return}while(!0)switch((await u1(X.suggestion)).action){case"commit":{let Z=u(X.suggestion.message);k(Z.success,Z.hash,Z.error);return}case"edit":{let Z=await g1(X.suggestion.message);if(Z.action==="cancel"){e();return}if(Z.action==="commit"&&Z.message){let J=u(Z.message);k(J.success,J.hash,J.error);return}break}case"copy":{if(await p1(X.suggestion.message),!b.silent)V.info('\uD83C\uDFAF Voc\xEA pode usar a mensagem copiada com: git commit -m "mensagem"');return}case"cancel":{e();return}}}async function w$(b,I,$){if(!$.silent)V.info("\uD83D\uDD04 Modo Split ativado - Commits separados por arquivo");let H=[...b.stagedFiles];while(H.length>0){let Y=$.yes?[H[0]]:await eb(H);if(Y.length===0){if(!$.silent)V.info("\u274C Nenhum arquivo selecionado");break}let{getFileDiff:X}=await Promise.resolve().then(() => (D(),c)),G=Y.filter((J)=>J!==void 0).map((J)=>{try{return X(J)}catch(q){return V.error(`\u274C Erro ao obter diff do arquivo ${J}: ${q instanceof Error?q.message:"Erro desconhecido"}`),""}}).filter((J)=>J.length>0).join(`
|
|
170
|
+
`);if(!G){if(!$.silent)V.warn("\u26A0\uFE0F Nenhum diff encontrado para os arquivos selecionados");H=H.filter((J)=>!Y.includes(J));continue}if(!$.silent)V.info(`\uD83E\uDD16 Gerando commit para: ${Y.join(", ")}`);let Z=await M1(G,I,Y.filter((J)=>J!==void 0));if(!Z.success){V.error(`\u274C Erro ao gerar commit: ${Z.error}`),H=H.filter((J)=>!Y.includes(J));continue}if(!Z.suggestion){V.error("\u274C Nenhuma sugest\xE3o foi gerada"),H=H.filter((J)=>!Y.includes(J));continue}if(I.dryRun){V.info(`\uD83D\uDD0D Dry Run - Mensagem para ${Y.join(", ")}:`),V.info(`"${Z.suggestion.message}"`),H=H.filter((J)=>!Y.includes(J));continue}if($.yes){let J=Y.length===1&&Y[0]?await H1(Y[0],Z.suggestion.message):await u(Z.suggestion.message);k(J.success,J.hash,J.error)}else{let J=await u1(Z.suggestion);if(J.action==="commit"){let q=Y.length===1&&Y[0]?await H1(Y[0],Z.suggestion.message):await u(Z.suggestion.message);k(q.success,q.hash,q.error)}else if(J.action==="edit"){let q=await g1(Z.suggestion.message);if(q.action==="commit"&&q.message){let Q=Y.length===1&&Y[0]?await H1(Y[0],q.message):await u(q.message);k(Q.success,Q.hash,Q.error)}}else if(J.action==="copy"){if(await p1(Z.suggestion.message),!$.silent)V.info("\uD83C\uDFAF Mensagem copiada para clipboard")}else if(J.action==="cancel"){e();return}}if(H=H.filter((J)=>!Y.includes(J)),H.length>0&&!$.yes){if(!await bI(H))break}}if(!$.silent)V.success("\u2705 Modo Split conclu\xEDdo!")}var XI=N(()=>{r();aI();D();W1();$I();h9();HI()});r();XI();function D9(b){return{silent:b.includes("--silent")||b.includes("-s"),yes:b.includes("--yes")||b.includes("-y"),auto:b.includes("--auto")||b.includes("-a"),split:b.includes("--split"),smartSplit:b.includes("--smart-split"),dryRun:b.includes("--dry-run")||b.includes("-n"),help:b.includes("--help")||b.includes("-h"),version:b.includes("--version")||b.includes("-v")}}function f9(){console.log(`
|
|
171
171
|
\uD83E\uDDD9\u200D\u2642\uFE0F Commit Wizard - Gerador inteligente de mensagens de commit
|
|
172
172
|
|
|
173
173
|
USAGE:
|
|
@@ -192,4 +192,4 @@ EXAMPLES:
|
|
|
192
192
|
commit-wizard --auto # Modo totalmente autom\xE1tico
|
|
193
193
|
|
|
194
194
|
Para mais informa\xE7\xF5es, visite: https://github.com/user/commit-wizard
|
|
195
|
-
`)}function
|
|
195
|
+
`)}function d9(){console.log("commit-wizard v1.0.0")}async function x$(){try{let b=D9(process.argv.slice(2));if(b.help)f9(),process.exit(0);if(b.version)d9(),process.exit(0);if(b.auto)b.silent=!0,b.yes=!0;if(!b.silent)xI("\uD83E\uDDD9\u200D\u2642\uFE0F Commit Wizard");if(await ZI(b),!b.silent)kI("At\xE9 logo! \u2728")}catch(b){V.error(`Erro: ${b instanceof Error?b.message:"Erro desconhecido"}`),process.exit(1)}}if(import.meta.main)x$();
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"displayName": "Commit Wizard",
|
|
4
4
|
"publisher": "gilbert-oliveira",
|
|
5
5
|
"description": "CLI inteligente para gerar mensagens de commit usando OpenAI",
|
|
6
|
-
"version": "2.0.
|
|
6
|
+
"version": "2.0.3",
|
|
7
7
|
"categories": [
|
|
8
8
|
"Other",
|
|
9
9
|
"SCM Providers"
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"test:watch": "bun test --watch",
|
|
22
22
|
"test:coverage": "bun test && node scripts/generate-lcov.js",
|
|
23
23
|
"test:coverage:report": "c8 --reporter=html --reporter=text --include='src/**/*.ts' --exclude='**/*.test.ts' bun test && open coverage/lcov-report/index.html",
|
|
24
|
-
"test:coverage:upload": "bun test && node scripts/generate-lcov.js && node scripts/upload-codecov.js",
|
|
25
24
|
"prepublishOnly": "bun run build && bun test",
|
|
26
25
|
"start": "bun run bin/commit-wizard.ts",
|
|
27
26
|
"ci:test": "bun test --reporter=verbose",
|
|
@@ -32,7 +31,7 @@
|
|
|
32
31
|
"release:patch": "./scripts/release.sh patch",
|
|
33
32
|
"release:minor": "./scripts/release.sh minor",
|
|
34
33
|
"release:major": "./scripts/release.sh major",
|
|
35
|
-
"check-changes": "node -e \"const { execSync } = require('child_process'); const changed = execSync('git diff --name-only HEAD~1 HEAD', { encoding: 'utf8' }).includes('package.json') || execSync('git diff --name-only HEAD~1 HEAD', { encoding: 'utf8' }).match(/(src|bin|scripts|dist)
|
|
34
|
+
"check-changes": "node -e \"const { execSync } = require('child_process'); const changed = execSync('git diff --name-only HEAD~1 HEAD', { encoding: 'utf8' }).includes('package.json') || execSync('git diff --name-only HEAD~1 HEAD', { encoding: 'utf8' }).match(/(src|bin|scripts|dist)/\\.*/); console.log(changed ? '🚀 Mudanças detectadas - deploy recomendado!' : '⚠️ Nenhuma mudança significativa detectada'); process.exit(changed ? 0 : 1);\"",
|
|
36
35
|
"type-check": "bun run tsc --noEmit",
|
|
37
36
|
"lint": "bun run eslint --fix",
|
|
38
37
|
"format": "bun run prettier --write ."
|
package/src/core/index.ts
CHANGED
|
@@ -278,7 +278,11 @@ async function handleSplitMode(gitStatus: any, config: any, args: CLIArgs) {
|
|
|
278
278
|
log.info(`🤖 Gerando commit para: ${selectedFiles.join(', ')}`);
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
const result = await generateWithRetry(
|
|
281
|
+
const result = await generateWithRetry(
|
|
282
|
+
fileDiffs,
|
|
283
|
+
config,
|
|
284
|
+
selectedFiles.filter((file): file is string => file !== undefined)
|
|
285
|
+
);
|
|
282
286
|
|
|
283
287
|
if (!result.success) {
|
|
284
288
|
log.error(`❌ Erro ao gerar commit: ${result.error}`);
|
package/src/core/openai.ts
CHANGED
|
@@ -37,14 +37,16 @@ export function buildPrompt(
|
|
|
37
37
|
|
|
38
38
|
// Limitar tamanho do diff para economizar tokens
|
|
39
39
|
const maxDiffLength = 6000;
|
|
40
|
-
const truncatedDiff =
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
const truncatedDiff =
|
|
41
|
+
diff.length > maxDiffLength
|
|
42
|
+
? diff.substring(0, maxDiffLength) + '\n... (diff truncado)'
|
|
43
|
+
: diff;
|
|
43
44
|
|
|
44
45
|
// Simplificar lista de arquivos se houver muitos
|
|
45
|
-
const fileList =
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
const fileList =
|
|
47
|
+
filenames.length > 10
|
|
48
|
+
? `${filenames.length} arquivos: ${filenames.slice(0, 5).join(', ')}...`
|
|
49
|
+
: filenames.join(', ');
|
|
48
50
|
|
|
49
51
|
const prompt = `Gere mensagem de commit em ${language} (${config.commitStyle}).
|
|
50
52
|
|
|
@@ -219,6 +221,25 @@ export function detectCommitType(
|
|
|
219
221
|
return 'chore';
|
|
220
222
|
}
|
|
221
223
|
|
|
224
|
+
/**
|
|
225
|
+
* Processa a mensagem retornada pela OpenAI removendo formatação desnecessária
|
|
226
|
+
*/
|
|
227
|
+
export function processOpenAIMessage(message: string): string {
|
|
228
|
+
// Remover backticks de código APENAS se a mensagem inteira está envolvida em backticks
|
|
229
|
+
// Isso preserva nomes de funções, métodos e variáveis dentro da mensagem
|
|
230
|
+
if (message.match(/^```[\s\S]*```$/)) {
|
|
231
|
+
// Se a mensagem inteira está em um bloco de código, remover as marcações
|
|
232
|
+
message = message
|
|
233
|
+
.replace(/^```(?:plaintext|javascript|typescript|python|java|html|css|json|xml|yaml|yml|bash|shell|text)?\s*/, '')
|
|
234
|
+
.replace(/\s*```$/, '');
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Remover quebras de linha extras do início e fim
|
|
238
|
+
message = message.trim();
|
|
239
|
+
|
|
240
|
+
return message;
|
|
241
|
+
}
|
|
242
|
+
|
|
222
243
|
/**
|
|
223
244
|
* Consome a API da OpenAI para gerar mensagem de commit
|
|
224
245
|
*/
|
|
@@ -275,11 +296,8 @@ export async function generateCommitMessage(
|
|
|
275
296
|
};
|
|
276
297
|
}
|
|
277
298
|
|
|
278
|
-
//
|
|
279
|
-
message = message
|
|
280
|
-
|
|
281
|
-
// Remover quebras de linha extras
|
|
282
|
-
message = message.trim();
|
|
299
|
+
// Processar mensagem para remover formatação
|
|
300
|
+
message = processOpenAIMessage(message);
|
|
283
301
|
|
|
284
302
|
// Extrair tipo da mensagem gerada pela OpenAI
|
|
285
303
|
const extractedType = extractCommitTypeFromMessage(message);
|
package/src/core/smart-split.ts
CHANGED
|
@@ -28,17 +28,21 @@ function buildContextAnalysisPrompt(
|
|
|
28
28
|
): string {
|
|
29
29
|
// Limitar o tamanho do diff para evitar exceder tokens
|
|
30
30
|
const maxDiffLength = 8000; // Limite conservador
|
|
31
|
-
const truncatedDiff =
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const truncatedDiff =
|
|
32
|
+
overallDiff.length > maxDiffLength
|
|
33
|
+
? overallDiff.substring(0, maxDiffLength) + '\n... (diff truncado)'
|
|
34
|
+
: overallDiff;
|
|
34
35
|
|
|
35
36
|
// Calcular estatísticas básicas
|
|
36
37
|
const totalFiles = files.length;
|
|
37
|
-
const fileTypes = files.reduce(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
const fileTypes = files.reduce(
|
|
39
|
+
(acc, file) => {
|
|
40
|
+
const ext = file.split('.').pop() || 'sem-extensao';
|
|
41
|
+
acc[ext] = (acc[ext] || 0) + 1;
|
|
42
|
+
return acc;
|
|
43
|
+
},
|
|
44
|
+
{} as Record<string, number>
|
|
45
|
+
);
|
|
42
46
|
|
|
43
47
|
const fileStats = Object.entries(fileTypes)
|
|
44
48
|
.map(([ext, count]) => `${ext}: ${count}`)
|
|
@@ -73,12 +77,15 @@ Agrupe arquivos relacionados. Máximo 5 grupos. Responda em JSON:
|
|
|
73
77
|
*/
|
|
74
78
|
function buildFallbackPrompt(files: string[]): string {
|
|
75
79
|
// Agrupar arquivos por diretório
|
|
76
|
-
const filesByDir = files.reduce(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
const filesByDir = files.reduce(
|
|
81
|
+
(acc, file) => {
|
|
82
|
+
const dir = file.split('/').slice(0, -1).join('/') || 'root';
|
|
83
|
+
if (!acc[dir]) acc[dir] = [];
|
|
84
|
+
acc[dir].push(file);
|
|
85
|
+
return acc;
|
|
86
|
+
},
|
|
87
|
+
{} as Record<string, string[]>
|
|
88
|
+
);
|
|
82
89
|
|
|
83
90
|
const dirStats = Object.entries(filesByDir)
|
|
84
91
|
.map(([dir, files]) => `${dir}: ${files.length} arquivo(s)`)
|
|
@@ -133,14 +140,16 @@ export async function analyzeFileContext(
|
|
|
133
140
|
// Decidir qual prompt usar baseado no tamanho
|
|
134
141
|
const maxDiffLength = 6000; // Limite mais conservador
|
|
135
142
|
const useFallback = overallDiff.length > maxDiffLength;
|
|
136
|
-
|
|
137
|
-
const prompt = useFallback
|
|
143
|
+
|
|
144
|
+
const prompt = useFallback
|
|
138
145
|
? buildFallbackPrompt(files)
|
|
139
146
|
: buildContextAnalysisPrompt(files, overallDiff);
|
|
140
147
|
|
|
141
148
|
// Log opcional sobre o uso do fallback
|
|
142
149
|
if (useFallback) {
|
|
143
|
-
console.warn(
|
|
150
|
+
console.warn(
|
|
151
|
+
`⚠️ Diff muito grande (${overallDiff.length} chars), usando análise baseada em nomes de arquivos`
|
|
152
|
+
);
|
|
144
153
|
}
|
|
145
154
|
|
|
146
155
|
const response = await fetch('https://api.openai.com/v1/chat/completions', {
|
|
@@ -250,7 +259,7 @@ export async function generateGroupDiff(group: FileGroup): Promise<string> {
|
|
|
250
259
|
const diff = getFileDiff(file);
|
|
251
260
|
// Limitar tamanho do diff individual
|
|
252
261
|
const maxDiffLength = 4000;
|
|
253
|
-
return diff.length > maxDiffLength
|
|
262
|
+
return diff.length > maxDiffLength
|
|
254
263
|
? diff.substring(0, maxDiffLength) + '\n... (diff truncado)'
|
|
255
264
|
: diff;
|
|
256
265
|
} catch {
|
|
@@ -294,10 +303,12 @@ export async function generateGroupDiff(group: FileGroup): Promise<string> {
|
|
|
294
303
|
});
|
|
295
304
|
// Limitar conteúdo do arquivo novo
|
|
296
305
|
const maxContentLength = 2000;
|
|
297
|
-
const truncatedContent =
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
306
|
+
const truncatedContent =
|
|
307
|
+
content.length > maxContentLength
|
|
308
|
+
? content.substring(0, maxContentLength) +
|
|
309
|
+
'\n... (conteúdo truncado)'
|
|
310
|
+
: content;
|
|
311
|
+
|
|
301
312
|
return `diff --git a/${file} b/${file}\nnew file mode 100644\nindex 0000000..${Math.random().toString(36).substr(2, 7)}\n--- /dev/null\n+++ b/${file}\n@@ -0,0 +1,${truncatedContent.split('\n').length} @@\n${truncatedContent
|
|
302
313
|
.split('\n')
|
|
303
314
|
.map((line) => `+${line}`)
|
|
@@ -341,10 +352,12 @@ export async function generateGroupDiff(group: FileGroup): Promise<string> {
|
|
|
341
352
|
});
|
|
342
353
|
// Limitar conteúdo do arquivo recriado
|
|
343
354
|
const maxContentLength = 2000;
|
|
344
|
-
const truncatedContent =
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
355
|
+
const truncatedContent =
|
|
356
|
+
content.length > maxContentLength
|
|
357
|
+
? content.substring(0, maxContentLength) +
|
|
358
|
+
'\n... (conteúdo truncado)'
|
|
359
|
+
: content;
|
|
360
|
+
|
|
348
361
|
return `diff --git a/${file} b/${file}\nindex 0000000..${Math.random().toString(36).substr(2, 7)} 100644\n--- a/${file}\n+++ b/${file}\n@@ -1 +1,${truncatedContent.split('\n').length} @@\n${truncatedContent
|
|
349
362
|
.split('\n')
|
|
350
363
|
.map((line) => `+${line}`)
|
|
@@ -361,8 +374,8 @@ export async function generateGroupDiff(group: FileGroup): Promise<string> {
|
|
|
361
374
|
// Limitar tamanho total do diff combinado
|
|
362
375
|
const combinedDiff = diffs.join('\n');
|
|
363
376
|
const maxTotalLength = 8000;
|
|
364
|
-
|
|
365
|
-
return combinedDiff.length > maxTotalLength
|
|
377
|
+
|
|
378
|
+
return combinedDiff.length > maxTotalLength
|
|
366
379
|
? combinedDiff.substring(0, maxTotalLength) + '\n... (diff total truncado)'
|
|
367
380
|
: combinedDiff;
|
|
368
381
|
}
|
|
@@ -478,7 +491,9 @@ export async function handleSmartSplitMode(
|
|
|
478
491
|
|
|
479
492
|
if (!result.success) {
|
|
480
493
|
if (!args.silent) {
|
|
481
|
-
log.error(
|
|
494
|
+
log.error(
|
|
495
|
+
`❌ Erro ao gerar commit para ${group.name}: ${result.error}`
|
|
496
|
+
);
|
|
482
497
|
}
|
|
483
498
|
continue;
|
|
484
499
|
}
|
|
@@ -515,11 +530,14 @@ export async function handleSmartSplitMode(
|
|
|
515
530
|
} else {
|
|
516
531
|
// Para múltiplos arquivos, usar commit normal mas com apenas os arquivos do grupo
|
|
517
532
|
const { execSync } = await import('child_process');
|
|
533
|
+
// Importar função de escape do módulo git
|
|
534
|
+
const { escapeShellArg } = await import('../git/index.ts');
|
|
518
535
|
try {
|
|
519
536
|
// Fazer commit apenas dos arquivos do grupo
|
|
520
|
-
const filesArg = group.files.map((f) =>
|
|
537
|
+
const filesArg = group.files.map((f) => escapeShellArg(f)).join(' ');
|
|
538
|
+
const escapedMessage = escapeShellArg(result.suggestion.message || '');
|
|
521
539
|
execSync(
|
|
522
|
-
`git commit ${filesArg} -m
|
|
540
|
+
`git commit ${filesArg} -m ${escapedMessage}`,
|
|
523
541
|
{
|
|
524
542
|
stdio: 'pipe',
|
|
525
543
|
}
|
|
@@ -575,11 +593,14 @@ export async function handleSmartSplitMode(
|
|
|
575
593
|
} else {
|
|
576
594
|
// Para múltiplos arquivos, usar commit normal mas com apenas os arquivos do grupo
|
|
577
595
|
const { execSync } = await import('child_process');
|
|
596
|
+
// Importar função de escape do módulo git
|
|
597
|
+
const { escapeShellArg } = await import('../git/index.ts');
|
|
578
598
|
try {
|
|
579
599
|
// Fazer commit apenas dos arquivos do grupo
|
|
580
|
-
const filesArg = group.files.map((f) =>
|
|
600
|
+
const filesArg = group.files.map((f) => escapeShellArg(f)).join(' ');
|
|
601
|
+
const escapedMessage = escapeShellArg(commitMessage);
|
|
581
602
|
execSync(
|
|
582
|
-
`git commit ${filesArg} -m
|
|
603
|
+
`git commit ${filesArg} -m ${escapedMessage}`,
|
|
583
604
|
{
|
|
584
605
|
stdio: 'pipe',
|
|
585
606
|
}
|
|
@@ -624,11 +645,14 @@ export async function handleSmartSplitMode(
|
|
|
624
645
|
} else {
|
|
625
646
|
// Para múltiplos arquivos, usar commit normal mas com apenas os arquivos do grupo
|
|
626
647
|
const { execSync } = await import('child_process');
|
|
648
|
+
// Importar função de escape do módulo git
|
|
649
|
+
const { escapeShellArg } = await import('../git/index.ts');
|
|
627
650
|
try {
|
|
628
651
|
// Fazer commit apenas dos arquivos do grupo
|
|
629
|
-
const filesArg = group.files.map((f) =>
|
|
652
|
+
const filesArg = group.files.map((f) => escapeShellArg(f)).join(' ');
|
|
653
|
+
const escapedMessage = escapeShellArg(editAction.message || '');
|
|
630
654
|
execSync(
|
|
631
|
-
`git commit ${filesArg} -m
|
|
655
|
+
`git commit ${filesArg} -m ${escapedMessage}`,
|
|
632
656
|
{
|
|
633
657
|
stdio: 'pipe',
|
|
634
658
|
}
|
package/src/git/index.ts
CHANGED
|
@@ -13,6 +13,15 @@ export interface GitCommitResult {
|
|
|
13
13
|
error?: string;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Escapa caracteres especiais para uso seguro em comandos shell
|
|
18
|
+
*/
|
|
19
|
+
export function escapeShellArg(arg: string): string {
|
|
20
|
+
// Para mensagens de commit, usamos aspas simples que são mais seguras
|
|
21
|
+
// Escapamos apenas aspas simples dentro da string
|
|
22
|
+
return `'${arg.replace(/'/g, "'\"'\"'")}'`;
|
|
23
|
+
}
|
|
24
|
+
|
|
16
25
|
/**
|
|
17
26
|
* Verifica se estamos em um repositório Git
|
|
18
27
|
*/
|
|
@@ -80,8 +89,9 @@ export function getFileDiff(filename: string): string {
|
|
|
80
89
|
*/
|
|
81
90
|
export function executeCommit(message: string): GitCommitResult {
|
|
82
91
|
try {
|
|
83
|
-
//
|
|
84
|
-
|
|
92
|
+
// Usar aspas simples para evitar problemas com caracteres especiais
|
|
93
|
+
const escapedMessage = escapeShellArg(message);
|
|
94
|
+
execSync(`git commit -m ${escapedMessage}`, {
|
|
85
95
|
stdio: 'pipe',
|
|
86
96
|
});
|
|
87
97
|
|
|
@@ -115,8 +125,10 @@ export function executeFileCommit(
|
|
|
115
125
|
message: string
|
|
116
126
|
): GitCommitResult {
|
|
117
127
|
try {
|
|
118
|
-
//
|
|
119
|
-
|
|
128
|
+
// Usar aspas simples para evitar problemas com caracteres especiais
|
|
129
|
+
const escapedMessage = escapeShellArg(message);
|
|
130
|
+
const escapedFilename = escapeShellArg(filename);
|
|
131
|
+
execSync(`git commit ${escapedFilename} -m ${escapedMessage}`, {
|
|
120
132
|
stdio: 'pipe',
|
|
121
133
|
});
|
|
122
134
|
|
package/src/utils/polyfill.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Polyfill para stripVTControlCharacters para compatibilidade com Bun/Node.js
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Este polyfill resolve problemas de compatibilidade onde o Bun não mapeia
|
|
5
5
|
* corretamente a função stripVTControlCharacters do módulo util do Node.js.
|
|
6
6
|
* A função foi adicionada ao Node.js v16.14.0+ mas pode não estar disponível
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
/**
|
|
11
11
|
* Remove caracteres de controle VT de uma string
|
|
12
12
|
* Implementação baseada na função nativa do Node.js
|
|
13
|
-
*
|
|
13
|
+
*
|
|
14
14
|
* @param str - String da qual remover os caracteres de controle
|
|
15
15
|
* @returns String limpa sem caracteres de controle VT/ANSI
|
|
16
16
|
*/
|
|
@@ -23,19 +23,22 @@ function stripVTControlCharacters(str: string): string {
|
|
|
23
23
|
// Baseada na implementação oficial do Node.js
|
|
24
24
|
const esc = String.fromCharCode(27); // ESC character (\u001B)
|
|
25
25
|
const csi = String.fromCharCode(155); // CSI character (\u009B)
|
|
26
|
-
const ansiRegex = new RegExp(
|
|
27
|
-
|
|
26
|
+
const ansiRegex = new RegExp(
|
|
27
|
+
`[${esc}${csi}][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]`,
|
|
28
|
+
'g'
|
|
29
|
+
);
|
|
30
|
+
|
|
28
31
|
return str.replace(ansiRegex, '');
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
// Interceptar require/import do módulo util antes de qualquer outra coisa
|
|
32
|
-
|
|
35
|
+
|
|
33
36
|
const Module = require('module');
|
|
34
37
|
const originalRequire = Module.prototype.require;
|
|
35
38
|
|
|
36
|
-
Module.prototype.require = function(id: string) {
|
|
39
|
+
Module.prototype.require = function (id: string) {
|
|
37
40
|
const result = originalRequire.apply(this, arguments);
|
|
38
|
-
|
|
41
|
+
|
|
39
42
|
// Se estiver importando o módulo util e stripVTControlCharacters não existe, adicionar
|
|
40
43
|
if (id === 'util' && result && !result.stripVTControlCharacters) {
|
|
41
44
|
result.stripVTControlCharacters = stripVTControlCharacters;
|
|
@@ -47,11 +50,10 @@ Module.prototype.require = function(id: string) {
|
|
|
47
50
|
configurable: false,
|
|
48
51
|
});
|
|
49
52
|
}
|
|
50
|
-
|
|
53
|
+
|
|
51
54
|
return result;
|
|
52
55
|
};
|
|
53
56
|
|
|
54
|
-
|
|
55
57
|
declare global {
|
|
56
58
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
57
59
|
namespace NodeJS {
|
|
@@ -62,15 +64,17 @@ declare global {
|
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
// Disponibilizar globalmente também como fallback
|
|
65
|
-
|
|
66
|
-
if (
|
|
67
|
+
|
|
68
|
+
if (
|
|
69
|
+
typeof globalThis !== 'undefined' &&
|
|
70
|
+
!(globalThis as any).stripVTControlCharacters
|
|
71
|
+
) {
|
|
67
72
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
68
73
|
(globalThis as any).stripVTControlCharacters = stripVTControlCharacters;
|
|
69
74
|
}
|
|
70
75
|
|
|
71
76
|
// Tentar aplicar diretamente ao módulo util se possível
|
|
72
77
|
try {
|
|
73
|
-
|
|
74
78
|
const util = require('util');
|
|
75
79
|
if (!util.stripVTControlCharacters) {
|
|
76
80
|
util.stripVTControlCharacters = stripVTControlCharacters;
|