@visulima/vis 1.0.0-alpha.24 → 1.0.0-alpha.26
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/CHANGELOG.md +78 -0
- package/LICENSE.md +1154 -179
- package/README.md +5 -3
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +19 -0
- package/dist/packem_chunks/bin.js +299 -290
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/config.js +15 -15
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +2 -2
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +10 -10
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +2 -2
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler21.js +5 -5
- package/dist/packem_chunks/handler22.js +2 -2
- package/dist/packem_chunks/handler23.js +2 -2
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler31.js +1 -1
- package/dist/packem_chunks/handler32.js +3 -3
- package/dist/packem_chunks/handler34.js +5 -28
- package/dist/packem_chunks/handler35.js +22 -5
- package/dist/packem_chunks/handler36.js +60 -21
- package/dist/packem_chunks/handler37.js +6 -61
- package/dist/packem_chunks/handler38.js +24 -6
- package/dist/packem_chunks/handler39.js +152 -707
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler40.js +10 -24
- package/dist/packem_chunks/handler41.js +25 -286
- package/dist/packem_chunks/handler42.js +707 -152
- package/dist/packem_chunks/handler43.js +24 -10
- package/dist/packem_chunks/handler44.js +322 -25
- package/dist/packem_chunks/handler45.js +46 -24
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler47.js +7 -7
- package/dist/packem_chunks/handler48.js +66 -58
- package/dist/packem_chunks/handler5.js +3 -3
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +16 -16
- package/dist/packem_chunks/index.js +6 -6
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/prune.js +3 -3
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/{advisories-U1QKY_tg.js → advisories-DS8JEB_g.js} +1 -1
- package/dist/packem_shared/affected-shas-Dm7eqcI8.js +1 -0
- package/dist/packem_shared/{ai-analysis-B8pDCOuT.js → ai-analysis-Csn82p17.js} +1 -1
- package/dist/packem_shared/{ai-fix-DiGSrGKv.js → ai-fix-BlYyz5bI.js} +3 -3
- package/dist/packem_shared/{cyclonedx-DPEW0nwS.js → cyclonedx-ja1cbU69.js} +1 -1
- package/dist/packem_shared/dependency-scan-s2MD0vi-.js +1 -0
- package/dist/packem_shared/{docker-_pBC9Loj.js → docker-Bw9gKo69.js} +1 -1
- package/dist/packem_shared/{index-D_tAc2nS.js → index-88UK-tt_.js} +1 -1
- package/dist/packem_shared/index-CS6a2wFB.js +29 -0
- package/dist/packem_shared/lifecycle-ChCFTm5Q.js +2 -0
- package/dist/packem_shared/{lockfile-CQLFNyVa.js → lockfile-BG1HvBzH.js} +1 -1
- package/dist/packem_shared/{min-release-age-Cz6HbF-I.js → min-release-age-heJgeP7o.js} +1 -1
- package/dist/packem_shared/{osv-bloom-CyCDpXBl.js → osv-bloom-QSAn2Dcw.js} +2 -2
- package/dist/packem_shared/{pm-runner-Dnj9J3KF.js → pm-runner-BzGZmzYs.js} +1 -1
- package/dist/packem_shared/{provenance-yESbF7Vs.js → provenance-BsBn1f5S.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-BpxcFRuk.js → resolve-explicit-CBPr617N.js} +1 -1
- package/dist/packem_shared/{s1ngularity-B_xjP4lC.js → s1ngularity-j_ArCZAs.js} +1 -1
- package/dist/packem_shared/{signatures-DBwSnMBB.js → signatures-CaXzNuEn.js} +1 -1
- package/dist/packem_shared/{typosquats-Citu7BRY.js → typosquats-C1e6RNjF.js} +1 -1
- package/dist/packem_shared/vis-update-app-qhQPV97i.js +1 -0
- package/index.d.ts +201 -201
- package/index.js +52 -52
- package/package.json +14 -25
- package/schemas/project.schema.json +4 -0
- package/schemas/vis-config.schema.json +5 -0
- package/dist/packem_shared/dependency-scan-BbtivycX.js +0 -1
- package/dist/packem_shared/index-B8Ko8mwG.js +0 -29
- package/dist/packem_shared/lifecycle-DJDsjoic.js +0 -2
- package/dist/packem_shared/vis-update-app-BWA1kA1q.js +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var mr=Object.defineProperty;var O=(e,t)=>mr(e,"name",{value:t,configurable:!0});import{createRequire as pr}from"node:module";import{B as br,j as wr,I as G,N as R,q as fe,e as Ke}from"../packem_shared/index.server-B7ETiT4C.js";import{h as ve,H as Ee,E as Wt,d as yr}from"../packem_shared/index-B8Ko8mwG.js";const gr=pr(import.meta.url),ue=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,it=O(e=>{if(typeof ue<"u"&&ue.versions&&ue.versions.node){const[t,i]=ue.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return ue.getBuiltinModule(e)}return gr(e)},"__cjs_getBuiltinModule"),{createRequire:Si}=it("node:module"),X=ue,{execFileSync:vr}=it("node:child_process"),Oe=it("node:fs"),$r=it("node:tty");var xr=Object.defineProperty,Lt=O((e,t)=>xr(e,"name",{value:t,configurable:!0}),"u$5"),Wr=Object.defineProperty,rt=Lt((e,t)=>Wr(e,"name",{value:t,configurable:!0}),"l");const Or=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Br=12288,Sr=65510,Ar=[12288,12288,65281,65376,65504,65510],jr=8361,Ir=65518,Cr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Nr=32,Er=10630,kr=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Pr=4352,Rr=262141,Ai=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var Mr=Object.defineProperty,Tr=rt((e,t)=>Mr(e,"name",{value:t,configurable:!0}),"r$1");const Ae=Tr((e,t)=>{let i=0,r=Math.floor(e.length/2)-1;for(;i<=r;){const s=Math.floor((i+r)/2),o=s*2;if(t<e[o])r=s-1;else if(t>e[o+1])i=s+1;else return!0}return!1},"isInRange");var Fr=Object.defineProperty,re=rt((e,t)=>Fr(e,"name",{value:t,configurable:!0}),"r");const Kt=19968,[Lr,_r]=nt(Ai);function nt(e){let t=e[0],i=e[1];for(let r=0;r<e.length;r+=2){const s=e[r],o=e[r+1];if(Kt>=s&&Kt<=o)return[s,o];o-s>i-t&&(t=s,i=o)}return[t,i]}O(nt,"c$1");Lt(nt,"f");rt(nt,"k");re(nt,"findWideFastPathRange");const ji=re(e=>e<161||e>1114109?!1:Ae(Or,e),"isAmbiguous"),Ii=re(e=>e<Br||e>Sr?!1:Ae(Ar,e),"isFullWidth"),Hr=re(e=>e<jr||e>Ir?!1:Ae(Cr,e),"isHalfWidth"),Gr=re(e=>e<Nr||e>Er?!1:Ae(kr,e),"isNarrow"),Ci=re(e=>e>=Lr&&e<=_r?!0:e<Pr||e>Rr?!1:Ae(Ai,e),"isWide");function ot(e){return ji(e)?"ambiguous":Ii(e)?"fullwidth":Hr(e)?"halfwidth":Gr(e)?"narrow":Ci(e)?"wide":"neutral"}O(ot,"g$5");Lt(ot,"S");rt(ot,"getCategory");re(ot,"getCategory");var Vr=Object.defineProperty,st=O((e,t)=>Vr(e,"name",{value:t,configurable:!0}),"i$3"),Jr=Object.defineProperty,at=st((e,t)=>Jr(e,"name",{value:t,configurable:!0}),"a"),zr=Object.defineProperty,_t=at((e,t)=>zr(e,"name",{value:t,configurable:!0}),"e");function je(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}O(je,"s$3");st(je,"s");at(je,"r");_t(je,"validate");function Ie(e){return je(e),ot(e)}O(Ie,"r$2");st(Ie,"p");at(Ie,"eastAsianWidthType");_t(Ie,"eastAsianWidthType");function Ht(e,{ambiguousAsWide:t=!1}={}){return je(e),Ii(e)||Ci(e)||t&&ji(e)?2:1}O(Ht,"o$3");st(Ht,"W");at(Ht,"eastAsianWidth");_t(Ht,"eastAsianWidth");var qr=Object.defineProperty,Ur=O((e,t)=>qr(e,"name",{value:t,configurable:!0}),"E$3"),Dr=Object.defineProperty,Yr=Ur((e,t)=>Dr(e,"name",{value:t,configurable:!0}),"A"),Kr=Object.defineProperty,lt=Yr((e,t)=>Kr(e,"name",{value:t,configurable:!0}),"d");const Zt=new Map,ke=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Ge=lt(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),Zr=lt((e,t)=>{const i=Math.floor(e/65536),r=e%65536;let s=Zt.get(i);if(s||(s=new Map,Zt.set(i,s)),s.has(r))return s.get(r);let o;if(Ge(e)==="latin")o=t.width.regular;else if(Ge(e)==="control")o=t.width.control;else if(Ge(e)==="wide")o=t.width.wide;else switch(Ie(e)){case"ambiguous":{o=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{o=t.width.fullWidth;break}case"wide":{o=t.width.wide;break}default:o=t.width.regular}return s.set(r,o),o},"getCachedCharWidth"),Qr=lt(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),At=lt((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const i={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?At(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},r=Math.max(0,i.truncation.limit-i.truncation.ellipsisWidth),{length:s}=e,o=s>1e4;let n=0,a=0,l=s,h=!1;const c=e.includes("\x1B")||e.includes("");for(;n<s;){if(c&&(e[n]==="\x1B"||e[n]==="")){if(e.startsWith("\x1B]8;;",n)){const m="\x1B]8;;\x07",d=m.length,$=e.indexOf("\x07",n+5);if($!==-1){const w=e.indexOf(m,$+1);if(w!==-1){const v=w+d,x=e.slice($+1,w).replace(ve,""),W=At(x,{ambiguousIsNarrow:i.width.ambiguousIsNarrow,ansiWidth:i.width.ansi,controlWidth:i.width.control,countAnsiEscapeCodes:!1,ellipsis:i.truncation.ellipsis,ellipsisWidth:i.truncation.ellipsisWidth,emojiWidth:i.width.emoji,fullWidth:i.width.fullWidth,halfWidth:i.width.halfWidth,limit:Math.max(0,r-a),regularWidth:i.width.regular,tabWidth:i.width.tab,wideWidth:i.width.wide}),B=W.width;if(W.truncated)h=!0,l=Math.min(l,n);else if(a+B>r&&(l=Math.min(l,n),h=!0,a+B>i.truncation.limit))break;if(a+=B,n=v,h&&a>=i.truncation.limit)break;continue}}}if(ve.lastIndex=n,ve.test(e)){const m=ve.lastIndex-n,d=i.truncation.countAnsiEscapeCodes?m:i.width.ansi;if(a+d>r&&(l=Math.min(l,n),a+d>i.truncation.limit)){h=!0;break}a+=d,n=ve.lastIndex;continue}}const b=e.codePointAt(n);if(b===8203||b===65279||b>=8288&&b<=8292){n+=1;continue}if(b===9){if(a+i.width.tab>r&&(l=Math.min(l,n),a+i.width.tab>i.truncation.limit)){h=!0;break}a+=i.width.tab,n+=1;continue}if(ke.lastIndex=n,ke.test(e)){const m=(ke.lastIndex-n)*i.width.regular;if(a+m>r){const d=Math.floor((r-a)/i.width.regular);if(l=Math.min(l,n+d),a+m>i.truncation.limit){h=!0;break}}a+=m,n=ke.lastIndex;continue}if((b<=31||b>=127&&b<=159)&&(Ee.lastIndex=n,Ee.test(e))){const m=(Ee.lastIndex-n)*i.width.control;if(a+m>r&&(l=Math.min(l,n+Math.floor((r-a)/i.width.control)),a+m>i.truncation.limit)){h=!0;break}a+=m,n=Ee.lastIndex;continue}if(Wt.lastIndex=n,Wt.test(e)){if(a+i.width.emoji>r&&(l=Math.min(l,n),a+i.width.emoji>i.truncation.limit)){h=!0;break}a+=i.width.emoji,n=Wt.lastIndex;continue}const f=e.codePointAt(n)??0;if(Qr(f)){n+=f>65535?2:1;continue}let p;if(o)p=Zr(f,i);else switch(Ge(f)){case"control":{p=i.width.control;break}case"latin":{p=i.width.regular;break}case"wide":{p=i.width.wide;break}case"zero":{p=0;break}default:switch(Ie(f)){case"ambiguous":{p=i.width.ambiguousIsNarrow?i.width.regular:i.width.wide;break}case"fullwidth":{p=i.width.fullWidth;break}case"wide":{p=i.width.wide;break}default:p=i.width.regular}}if(a+p>r&&(l=Math.min(l,n),a+p>i.truncation.limit)){h=!0;break}a+=p,n+=f>65535?2:1}let u=a,g=!1;return h&&i.truncation.limit>=i.truncation.ellipsisWidth&&(u=i.truncation.limit,g=!0),{ellipsed:g,index:h?l:s,truncated:h,width:u}},"getStringTruncatedWidth");var Xr=Object.defineProperty,en=O((e,t)=>Xr(e,"name",{value:t,configurable:!0}),"i$2"),tn=Object.defineProperty,rn=en((e,t)=>tn(e,"name",{value:t,configurable:!0}),"e"),nn=Object.defineProperty,on=rn((e,t)=>nn(e,"name",{value:t,configurable:!0}),"r");const sn=on((e,t={})=>At(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var an=Object.defineProperty,V=O((e,t)=>an(e,"name",{value:t,configurable:!0}),"j$2"),ln=Object.defineProperty,A=V((e,t)=>ln(e,"name",{value:t,configurable:!0}),"$");const cn=Si(import.meta.url),de=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Gt=A(e=>{if(typeof de<"u"&&de.versions&&de.versions.node){const[t,i]=de.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return de.getBuiltinModule(e)}return cn(e)},"__cjs_getBuiltinModule"),ee=de,{execFileSync:hn}=Gt("node:child_process"),Be=Gt("node:fs"),un=Gt("node:tty");var dn=Object.defineProperty,Vt=A((e,t)=>dn(e,"name",{value:t,configurable:!0}),"u$5"),fn=Object.defineProperty,ct=Vt((e,t)=>fn(e,"name",{value:t,configurable:!0}),"l");const mn=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],pn=12288,gn=65510,bn=[12288,12288,65281,65376,65504,65510],wn=8361,yn=65518,vn=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],$n=32,xn=10630,Wn=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],On=4352,Bn=262141,Ni=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var Sn=Object.defineProperty,An=ct((e,t)=>Sn(e,"name",{value:t,configurable:!0}),"r$1");const Ce=An((e,t)=>{let i=0,r=Math.floor(e.length/2)-1;for(;i<=r;){const s=Math.floor((i+r)/2),o=s*2;if(t<e[o])r=s-1;else if(t>e[o+1])i=s+1;else return!0}return!1},"isInRange");var jn=Object.defineProperty,ne=ct((e,t)=>jn(e,"name",{value:t,configurable:!0}),"r");const Qt=19968,[In,Cn]=pe(Ni);function pe(e){let t=e[0],i=e[1];for(let r=0;r<e.length;r+=2){const s=e[r],o=e[r+1];if(Qt>=s&&Qt<=o)return[s,o];o-s>i-t&&(t=s,i=o)}return[t,i]}O(pe,"nt");V(pe,"ge");A(pe,"c$2");Vt(pe,"f");ct(pe,"k");ne(pe,"findWideFastPathRange");const Ei=ne(e=>e<161||e>1114109?!1:Ce(mn,e),"isAmbiguous"),ki=ne(e=>e<pn||e>gn?!1:Ce(bn,e),"isFullWidth"),Nn=ne(e=>e<wn||e>yn?!1:Ce(vn,e),"isHalfWidth"),En=ne(e=>e<$n||e>xn?!1:Ce(Wn,e),"isNarrow"),Pi=ne(e=>e>=In&&e<=Cn?!0:e<On||e>Bn?!1:Ce(Ni,e),"isWide");function ge(e){return Ei(e)?"ambiguous":ki(e)?"fullwidth":Nn(e)?"halfwidth":En(e)?"narrow":Pi(e)?"wide":"neutral"}O(ge,"rt");V(ge,"be");A(ge,"g$4");Vt(ge,"S");ct(ge,"getCategory");ne(ge,"getCategory");var kn=Object.defineProperty,ht=A((e,t)=>kn(e,"name",{value:t,configurable:!0}),"i$4"),Pn=Object.defineProperty,ut=ht((e,t)=>Pn(e,"name",{value:t,configurable:!0}),"a"),Rn=Object.defineProperty,Jt=ut((e,t)=>Rn(e,"name",{value:t,configurable:!0}),"e");function oe(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}O(oe,"U$3");V(oe,"ee");A(oe,"s$1");ht(oe,"s");ut(oe,"r");Jt(oe,"validate");function se(e){return oe(e),ge(e)}O(se,"Z$1");V(se,"te");A(se,"r$3");ht(se,"p");ut(se,"eastAsianWidthType");Jt(se,"eastAsianWidthType");function Ne(e,{ambiguousAsWide:t=!1}={}){return oe(e),ki(e)||Pi(e)||t&&Ei(e)?2:1}O(Ne,"yt");V(Ne,"je");A(Ne,"o$2");ht(Ne,"W");ut(Ne,"eastAsianWidth");Jt(Ne,"eastAsianWidth");var Mn=Object.defineProperty,Tn=A((e,t)=>Mn(e,"name",{value:t,configurable:!0}),"p$3"),Fn=Object.defineProperty,Ri=Tn((e,t)=>Fn(e,"name",{value:t,configurable:!0}),"e"),Ln=Object.defineProperty,_n=Ri((e,t)=>Ln(e,"name",{value:t,configurable:!0}),"E");const Mi=String.raw,Xt=Mi`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Hn=_n(()=>new RegExp(Mi`\p{RI}{2}|(?)${Xt}(?:\u200D${Xt})*`,"gu"),"default");var Gn=Object.defineProperty,Vn=Ri((e,t)=>Gn(e,"name",{value:t,configurable:!0}),"p");const be=new Set(["\x1B",""]),dt="\x07",Ti="[",zt="m",Ze="]8;;",Jn=39,zn=/[\u200B\uFEFF\u2060-\u2064]/g,qn=new RegExp(`(?:\\${Ti}(?<code>\\d+)m|\\${Ze}(?<uri>.*)${dt})`),Un=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),Q=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,ei=/\u001B\[(\d+(?:;\d+)*)?m[^\u001B]*(?:\u001B\[(?:\d+(?:;\d+)*)?m|$)/g,ti=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)(.*?)\u001B\]8;;(?:\u0007|\u001B\\)/g,Pe=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,Ve=Hn();Vn(e=>e.replace(Ve,""),"stripEmoji");var Dn=Object.defineProperty,Yn=A((e,t)=>Dn(e,"name",{value:t,configurable:!0}),"E$1"),Kn=Object.defineProperty,Zn=Yn((e,t)=>Kn(e,"name",{value:t,configurable:!0}),"A"),Qn=Object.defineProperty,ft=Zn((e,t)=>Qn(e,"name",{value:t,configurable:!0}),"d");const ii=new Map,Re=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Je=ft(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),Xn=ft((e,t)=>{const i=Math.floor(e/65536),r=e%65536;let s=ii.get(i);if(s||(s=new Map,ii.set(i,s)),s.has(r))return s.get(r);let o;if(Je(e)==="latin")o=t.width.regular;else if(Je(e)==="control")o=t.width.control;else if(Je(e)==="wide")o=t.width.wide;else switch(se(e)){case"ambiguous":{o=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{o=t.width.fullWidth;break}case"wide":{o=t.width.wide;break}default:o=t.width.regular}return s.set(r,o),o},"getCachedCharWidth"),eo=ft(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),me=ft((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const i={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?me(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},r=Math.max(0,i.truncation.limit-i.truncation.ellipsisWidth),{length:s}=e,o=s>1e4;let n=0,a=0,l=s,h=!1;const c=e.includes("\x1B")||e.includes("");for(;n<s;){if(c&&(e[n]==="\x1B"||e[n]==="")){if(e.startsWith("\x1B]8;;",n)){const m="\x1B]8;;\x07",d=m.length,$=e.indexOf("\x07",n+5);if($!==-1){const w=e.indexOf(m,$+1);if(w!==-1){const v=w+d,x=e.slice($+1,w).replace(Q,""),W=me(x,{ambiguousIsNarrow:i.width.ambiguousIsNarrow,ansiWidth:i.width.ansi,controlWidth:i.width.control,countAnsiEscapeCodes:!1,ellipsis:i.truncation.ellipsis,ellipsisWidth:i.truncation.ellipsisWidth,emojiWidth:i.width.emoji,fullWidth:i.width.fullWidth,halfWidth:i.width.halfWidth,limit:Math.max(0,r-a),regularWidth:i.width.regular,tabWidth:i.width.tab,wideWidth:i.width.wide}),B=W.width;if(W.truncated)h=!0,l=Math.min(l,n);else if(a+B>r&&(l=Math.min(l,n),h=!0,a+B>i.truncation.limit))break;if(a+=B,n=v,h&&a>=i.truncation.limit)break;continue}}}if(Q.lastIndex=n,Q.test(e)){const m=Q.lastIndex-n,d=i.truncation.countAnsiEscapeCodes?m:i.width.ansi;if(a+d>r&&(l=Math.min(l,n),a+d>i.truncation.limit)){h=!0;break}a+=d,n=Q.lastIndex;continue}}const b=e.codePointAt(n);if(b===8203||b===65279||b>=8288&&b<=8292){n+=1;continue}if(b===9){if(a+i.width.tab>r&&(l=Math.min(l,n),a+i.width.tab>i.truncation.limit)){h=!0;break}a+=i.width.tab,n+=1;continue}if(Re.lastIndex=n,Re.test(e)){const m=(Re.lastIndex-n)*i.width.regular;if(a+m>r){const d=Math.floor((r-a)/i.width.regular);if(l=Math.min(l,n+d),a+m>i.truncation.limit){h=!0;break}}a+=m,n=Re.lastIndex;continue}if((b<=31||b>=127&&b<=159)&&(Pe.lastIndex=n,Pe.test(e))){const m=(Pe.lastIndex-n)*i.width.control;if(a+m>r&&(l=Math.min(l,n+Math.floor((r-a)/i.width.control)),a+m>i.truncation.limit)){h=!0;break}a+=m,n=Pe.lastIndex;continue}if(Ve.lastIndex=n,Ve.test(e)){if(a+i.width.emoji>r&&(l=Math.min(l,n),a+i.width.emoji>i.truncation.limit)){h=!0;break}a+=i.width.emoji,n=Ve.lastIndex;continue}const f=e.codePointAt(n)??0;if(eo(f)){n+=f>65535?2:1;continue}let p;if(o)p=Xn(f,i);else switch(Je(f)){case"control":{p=i.width.control;break}case"latin":{p=i.width.regular;break}case"wide":{p=i.width.wide;break}case"zero":{p=0;break}default:switch(se(f)){case"ambiguous":{p=i.width.ambiguousIsNarrow?i.width.regular:i.width.wide;break}case"fullwidth":{p=i.width.fullWidth;break}case"wide":{p=i.width.wide;break}default:p=i.width.regular}}if(a+p>r&&(l=Math.min(l,n),a+p>i.truncation.limit)){h=!0;break}a+=p,n+=f>65535?2:1}let u=a,g=!1;return h&&i.truncation.limit>=i.truncation.ellipsisWidth&&(u=i.truncation.limit,g=!0),{ellipsed:g,index:h?l:s,truncated:h,width:u}},"getStringTruncatedWidth");var to=Object.defineProperty,io=A((e,t)=>to(e,"name",{value:t,configurable:!0}),"i$2"),ro=Object.defineProperty,no=io((e,t)=>ro(e,"name",{value:t,configurable:!0}),"e"),oo=Object.defineProperty,so=no((e,t)=>oo(e,"name",{value:t,configurable:!0}),"r");const E=so((e,t={})=>me(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var ao=Object.defineProperty,Fi=A((e,t)=>ao(e,"name",{value:t,configurable:!0}),"i$1"),lo=Object.defineProperty,Li=Fi((e,t)=>lo(e,"name",{value:t,configurable:!0}),"r"),co=Object.defineProperty,ho=Li((e,t)=>co(e,"name",{value:t,configurable:!0}),"c");let uo=class{static{O(this,"ki")}static{V(this,"Si")}static{A(this,"l")}static{Fi(this,"y")}static{Li(this,"s")}static{ho(this,"LRUCache")}capacity;cache;keyOrder;constructor(e){this.capacity=e,this.cache=new Map,this.keyOrder=[]}get(e){if(this.cache.has(e))return this.keyOrder=this.keyOrder.filter(t=>t!==e),this.keyOrder.push(e),this.cache.get(e)}has(e){return this.cache.has(e)}set(e,t){if(this.cache.has(e))this.keyOrder=this.keyOrder.filter(i=>i!==e);else if(this.cache.size>=this.capacity){const i=this.keyOrder.shift();i!==void 0&&this.cache.delete(i)}this.cache.set(e,t),this.keyOrder.push(e)}delete(e){this.cache.delete(e),this.keyOrder=this.keyOrder.filter(t=>t!==e)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}};var fo=Object.defineProperty,mo=A((e,t)=>fo(e,"name",{value:t,configurable:!0}),"S$1"),po=Object.defineProperty,go=mo((e,t)=>po(e,"name",{value:t,configurable:!0}),"w"),bo=Object.defineProperty,we=go((e,t)=>bo(e,"name",{value:t,configurable:!0}),"y");const ri=new uo(100),wo=new Intl.Segmenter("en",{granularity:"grapheme"}),yo=/^[\u0000-\u007F]*$/,vo=new Set(["0","22","23","24","27","28","29","39","49"]),$o=new Set(["1","3","4","7","8","9"]),ni=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),Me=we(e=>e>="30"&&e<="37"||e>="90"&&e<="97"||e.startsWith("38;"),"isForegroundColor"),Te=we(e=>e>="40"&&e<="47"||e>="100"&&e<="107"||e.startsWith("48;"),"isBackgroundColor"),xo=[{close:"\x1B[22m",open:"\x1B[1m"},{close:"\x1B[23m",open:"\x1B[3m"},{close:"\x1B[24m",open:"\x1B[4m"},{close:"\x1B[27m",open:"\x1B[7m"},{close:"\x1B[28m",open:"\x1B[8m"},{close:"\x1B[29m",open:"\x1B[9m"}],oi=we((e,t)=>{let i=-1;for(const r of t){const s=e.indexOf(r);s!==-1&&(i===-1||s<i)&&(i=s)}return i},"findFirstPositionOfAny"),Wo=we((e,t)=>{if(!e.includes("\x1B"))return[{after:"",before:"",content:e,visibleLength:E(e,t.width)}];const i=ri.get(e);if(i)return i;const r=[],s=[];let o=0,n;for(Q.lastIndex=0;(n=Q.exec(e))!==null;){const c=n[0];r.push(e.slice(o,n.index)),s.push(c),o=n.index+c.length}o<e.length&&r.push(e.slice(o));const a=[];for(const c of s){if(c==="\x1B[0m"||c==="\x1B]8;;\x07"){a.push(c);continue}if(c.startsWith("\x1B[")&&c.endsWith("m")){const u=c.slice(2,-1);if(vo.has(u)){a.push(c);continue}}}const l=new Set,h=[];for(const[c,u]of r.entries()){if(c>0&&s[c-1]){const f=s[c-1];if(f==="\x1B[0m")l.clear();else if(f==="\x1B]8;;\x07"){for(const p of l)if(p.startsWith("\x1B]8;;")&&!p.endsWith("\x1B]8;;\x07")){l.delete(p);break}}else if(f.startsWith("\x1B[")&&f.endsWith("m")){const p=f.slice(2,-1);if(p==="39"){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(Me(d)){l.delete(m);break}}}else if(p==="49"){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(Te(d)){l.delete(m);break}}}else if(ni.has(p)){const m=ni.get(p);for(const d of l)if(d===`\x1B[${m}m`){l.delete(d);break}}else{if(Me(p)){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(Me(d)){l.delete(m);break}}}else if(Te(p)){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(Te(d)){l.delete(m);break}}}else if($o.has(p)){const m=`\x1B[${p}m`;l.has(m)&&l.delete(m)}l.add(f)}}else if(f.startsWith("\x1B]8;;")&&!f.endsWith("\x1B]8;;\x07")){for(const p of l)if(p.startsWith("\x1B]8;;")&&!p.endsWith("\x1B]8;;\x07")){l.delete(p);break}l.add(f)}}if(u==="")continue;let g="";if(l.size>0)if(a.includes("\x1B[0m"))g="\x1B[0m";else{const f=[];let p=!1;for(const w of l)if(w.startsWith("\x1B]8;;")&&!w.endsWith("\x1B]8;;\x07")){p=!0;break}p&&a.includes("\x1B]8;;\x07")&&f.push("\x1B]8;;\x07");let m=!1,d=!1;for(const w of l)if(w.startsWith("\x1B[")&&w.endsWith("m")){const v=w.slice(2,-1);Me(v)?m=!0:Te(v)&&(d=!0)}if(m&&d){const w=oi(e,["\x1B[3","\x1B[9","\x1B[38;"]),v=oi(e,["\x1B[4","\x1B[10","\x1B[48;"]);w>=0&&v>=0?w>v?f.push("\x1B[39m","\x1B[49m"):f.push("\x1B[49m","\x1B[39m"):f.push("\x1B[39m","\x1B[49m")}else m&&f.push("\x1B[39m"),d&&f.push("\x1B[49m");m&&d&&e.includes("\x1B[39m")&&e.includes("\x1B[49m")&&(e.indexOf("\x1B[39m")<e.indexOf("\x1B[49m")?(f.length-=2,f.push("\x1B[39m","\x1B[49m")):e.indexOf("\x1B[49m")<e.indexOf("\x1B[39m")&&(f.length-=2,f.push("\x1B[49m","\x1B[39m")));const $=xo.filter(w=>l.has(w.open)).map(w=>({position:e.indexOf(w.open),style:w})).filter(w=>w.position>=0).toSorted((w,v)=>v.position-w.position);for(const w of $){const v=w;a.includes(v.style.close)&&f.push(v.style.close)}g=f.join("")}const b=[...l].join("");h.push({after:g,before:b,content:u,visibleLength:E(u,{fullWidth:1,wideWidth:1})})}return ri.set(e,h),h},"processIntoStyledSegments"),Oo=we((e,t,i,r)=>{const s=[...r.segmenter.segment(e)],o=[];let n=0,a=!1;for(const l of s){const h=E(l.segment,r.width),c=n,u=n+h;if(!a)if(c<t){n=u;continue}else a=!0;if(c>=i||u>i)break;o.push(l.segment),n=u}return o.join("")},"fastSlice"),q=we((e,t=0,i=Number.MAX_SAFE_INTEGER,r={})=>{const s={segmenter:wo,...r};if(t>=i||e==="")return"";const o=E(e,s.width);if(t===0&&i>=o)return e;if(t<0||i<0)throw new RangeError("Negative indices aren't supported");if(!e.includes("\x1B"))return yo.test(e)?e.slice(t,i):Oo(e,t,i,s);if(ei.lastIndex=0,ti.lastIndex=0,!ei.test(e)&&!ti.test(e))return e;const n=Wo(e,s);if(n.length===0)return"";let a=0;const l=[];for(const[u,g]of n.entries()){const b=a,f=a+g.visibleLength;if(f>t&&b<i){const p=Math.max(0,t-b),m=Math.min(g.visibleLength,i-b);l.push({end:m,index:u,segment:g,start:p})}a=f}if(l.length===0)return"";const h=[],c=l[0].segment;h.push(c.before);for(let u=0;u<l.length;u++){const{end:g,segment:b,start:f}=l[u];if(f===0&&g===b.visibleLength)h.push(b.content);else{const p=[...s.segmenter.segment(b.content)];h.push(p.slice(f,g).map(m=>m.segment).join(""))}if(u<l.length-1){const p=l[u+1].segment,m=b.after,d=p.before;m!==d&&(m||d)&&h.push(m,d)}}return h.push(l.at(-1).segment.after),h.join("")},"slice");var Bo=Object.defineProperty,So=A((e,t)=>Bo(e,"name",{value:t,configurable:!0}),"x"),Ao=Object.defineProperty,jo=So((e,t)=>Ao(e,"name",{value:t,configurable:!0}),"T"),Io=Object.defineProperty,mt=jo((e,t)=>Io(e,"name",{value:t,configurable:!0}),"f");const si="…",Co=3,Fe=mt((e,t,i=!1)=>{if(e.charAt(t)===" ")return t;const r=i?1:-1,s=Math.min(Co,i?e.length-t:t);for(let o=1;o<=s;o++){const n=t+o*r;if(e.charAt(n)===" ")return n}return t},"findNearestSpace"),Le=mt((e,t,i)=>me(e,{...i,ellipsis:"",ellipsisWidth:0,limit:t}).index,"widthToIndex"),_e=mt((e,t,i)=>E(e.slice(0,t),i),"indexToWidth"),ai=mt((e,t,i={})=>{if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof t!="number")throw new TypeError(`Expected \`limit\` to be a number, got ${typeof t}`);if(e===""||t<=0)return"";const r=e.normalize("NFC"),{ellipsis:s=si,position:o="end",preferTruncationOnSpace:n=!1}=i;let a=i.ellipsisWidth??s===si?1:void 0;a??=me(s,{...i.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:l}=me(r,{...i.width,ellipsis:s,ellipsisWidth:a});if(l<=t)return r;switch(o){case"end":{if(n){const h=t-a,c=Le(r,h,i.width),u=Fe(r,c),g=_e(r,u,i.width);return q(r,0,g,{width:i.width})+s}return q(r,0,t-a,{width:i.width})+s}case"middle":{const h=Math.floor(t/2),c=Math.max(0,t-a),u=Math.min(h,c),g=Math.max(0,c-u);if(n){const b=Le(r,u,i.width),f=Fe(r,b),p=_e(r,f,i.width),m=l-g,d=Le(r,m,i.width),$=Fe(r,d,!0),w=_e(r,$,i.width);return q(r,0,p,{width:i.width})+s+q(r,w,l,{width:i.width}).trim()}return q(r,0,u,{width:i.width})+s+q(r,l-g,l,{width:i.width})}case"start":{if(n){const h=l-t+a,c=Le(r,h,i.width),u=Fe(r,c,!0),g=_e(r,u,i.width);return s+q(r,g,l,{width:i.width}).trim()}return s+q(r,l-t+a,l,{width:i.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${o}'`)}},"truncate");var No=Object.defineProperty,_i=A((e,t)=>No(e,"name",{value:t,configurable:!0}),"b$2"),Eo=Object.defineProperty,ae=_i((e,t)=>Eo(e,"name",{value:t,configurable:!0}),"d"),ko=Object.defineProperty,Po=ae((e,t)=>ko(e,"name",{value:t,configurable:!0}),"a");const Ro=/\x1B\[(\d+)m/;class Hi{static{O(this,"he")}static{V(this,"at")}static{A(this,"T")}static{_i(this,"T")}static{ae(this,"d")}static{Po(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const i=Ro.exec(t);if(!i)return;const r=Number.parseInt(i[1],10);switch(r){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(r>=30&&r<=37||r>=90&&r<=97)this.activeForeground=t;else if(r>=40&&r<=47||r>=100&&r<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(r))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(r)){const s={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[r];s&&(this.activeFormatting=this.activeFormatting.filter(o=>!o.includes(s)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const i={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(r=>{const s=i[r];s&&t.push(s)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}}var Mo=Object.defineProperty,Gi=ae((e,t)=>Mo(e,"name",{value:t,configurable:!0}),"o");const Vi=Gi((e,t)=>{if(!be.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const i=!0,r=e.slice(t+1,t+1+Ze.length).join("")===Ze;return{isInsideEscape:i,isInsideLinkEscape:r}},"checkEscapeSequence"),To=Gi((e,t={})=>{const i=new Hi;let r="",s=!1,o="",n="",a=!1;const l=[...e];for(let h=0;h<l.length;h++){const c=l[h];if(c&&be.has(c)){if(r){const p=t.getWidth?.(r)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:r,width:p};if(a&&(m.isHyperlink=!0,m.hyperlinkUrl=n),t.onSegment?.(m,i)===!1)return;r=""}s=!0,o=c;const b=Vi(l,h),{isInsideLinkEscape:f}=b;if(f){let p=h+1;for(n="";p<l.length;){const d=l[p];if(d===dt)break;n+=d,p+=1}n=n.slice(4);const m={hyperlinkUrl:n,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(m,i)===!1)return;h=p,a=!0,s=!1,o="";continue}if(h+1<l.length&&l[h+1]==="\\"&&a){const p={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(p,i)===!1)return;a=!1,n="",h+=1,s=!1,o="";continue}}if(s){if(o!==c&&(o+=c),c===zt){s=!1,i.processEscape(o);const b={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(t.onSegment?.(b,i)===!1)return;o=""}continue}r+=c;const u=t.getWidth?.(r)??0,g={isEscapeSequence:!1,isGrapheme:!0,text:r,width:u};if(a&&(g.isHyperlink=!0,g.hyperlinkUrl=n),t.onSegment?.(g,i)===!1)return;r=""}if(r){const h=t.getWidth?.(r)??0,c={isEscapeSequence:!1,isGrapheme:!0,text:r,width:h};a&&(c.isHyperlink=!0,c.hyperlinkUrl=n),t.onSegment?.(c,i)}if(o){const h={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};t.onSegment?.(h,i)}},"processAnsiString");var Fo=Object.defineProperty,Lo=ae((e,t)=>Fo(e,"name",{value:t,configurable:!0}),"t$1");const li=Lo(e=>`${be.values().next().value}${Ti}${String(e)}${zt}`,"wrapAnsiCode");var _o=Object.defineProperty,Ho=ae((e,t)=>_o(e,"name",{value:t,configurable:!0}),"s");const ci=Ho(e=>`${be.values().next().value}${Ze}${e}${dt}`,"wrapAnsiHyperlink");var Go=Object.defineProperty,Vo=ae((e,t)=>Go(e,"name",{value:t,configurable:!0}),"l");const Jo=Vo(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",i,r;const s=e.join(`
|
|
2
|
-
`),o=[...s];let n=0;for(const[a,l]of o.entries()){if(t+=l,
|
|
3
|
-
`?(r&&(t+=
|
|
4
|
-
`&&(i&&h&&(t+=
|
|
1
|
+
var pr=Object.defineProperty;var O=(e,t)=>pr(e,"name",{value:t,configurable:!0});import{createRequire as gr}from"node:module";import{B as wr,j as yr,I as V,N as M,q as ge,e as et}from"../packem_shared/index.server-B7ETiT4C.js";import{b as vr,c as Be,f as Me,n as Wt}from"../packem_shared/index-CS6a2wFB.js";const br=gr(import.meta.url),me=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,st=O(e=>{if(typeof me<"u"&&me.versions&&me.versions.node){const[t,i]=me.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return me.getBuiltinModule(e)}return br(e)},"__cjs_getBuiltinModule"),{createRequire:Bi}=st("node:module"),ee=me,{execFileSync:xr}=st("node:child_process"),Ie=st("node:fs"),$r=st("node:tty");var Wr=Object.defineProperty,J=O((e,t)=>Wr(e,"name",{value:t,configurable:!0}),"j$3"),Or=Object.defineProperty,A=J((e,t)=>Or(e,"name",{value:t,configurable:!0}),"$");const Br=Bi(import.meta.url),pe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Lt=A(e=>{if(typeof pe<"u"&&pe.versions&&pe.versions.node){const[t,i]=pe.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return pe.getBuiltinModule(e)}return Br(e)},"__cjs_getBuiltinModule"),te=pe,{execFileSync:Sr}=Lt("node:child_process"),Ce=Lt("node:fs"),Ar=Lt("node:tty");var jr=Object.defineProperty,_t=A((e,t)=>jr(e,"name",{value:t,configurable:!0}),"u$5"),Ir=Object.defineProperty,at=_t((e,t)=>Ir(e,"name",{value:t,configurable:!0}),"l");const Cr=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Nr=12288,Er=65510,kr=[12288,12288,65281,65376,65504,65510],Rr=8361,Pr=65518,Mr=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Tr=32,Fr=10630,Lr=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],_r=4352,Hr=262141,Si=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var Gr=Object.defineProperty,Vr=at((e,t)=>Gr(e,"name",{value:t,configurable:!0}),"r$1");const Ee=Vr((e,t)=>{let i=0,r=Math.floor(e.length/2)-1;for(;i<=r;){const s=Math.floor((i+r)/2),o=s*2;if(t<e[o])r=s-1;else if(t>e[o+1])i=s+1;else return!0}return!1},"isInRange");var Jr=Object.defineProperty,ne=at((e,t)=>Jr(e,"name",{value:t,configurable:!0}),"r");const Yt=19968,[zr,qr]=we(Si);function we(e){let t=e[0],i=e[1];for(let r=0;r<e.length;r+=2){const s=e[r],o=e[r+1];if(Yt>=s&&Yt<=o)return[s,o];o-s>i-t&&(t=s,i=o)}return[t,i]}O(we,"nt");J(we,"ge");A(we,"c$2");_t(we,"f");at(we,"k");ne(we,"findWideFastPathRange");const Ai=ne(e=>e<161||e>1114109?!1:Ee(Cr,e),"isAmbiguous"),ji=ne(e=>e<Nr||e>Er?!1:Ee(kr,e),"isFullWidth"),Dr=ne(e=>e<Rr||e>Pr?!1:Ee(Mr,e),"isHalfWidth"),Ur=ne(e=>e<Tr||e>Fr?!1:Ee(Lr,e),"isNarrow"),Ii=ne(e=>e>=zr&&e<=qr?!0:e<_r||e>Hr?!1:Ee(Si,e),"isWide");function ye(e){return Ai(e)?"ambiguous":ji(e)?"fullwidth":Dr(e)?"halfwidth":Ur(e)?"narrow":Ii(e)?"wide":"neutral"}O(ye,"rt");J(ye,"be");A(ye,"g$4");_t(ye,"S");at(ye,"getCategory");ne(ye,"getCategory");var Yr=Object.defineProperty,lt=A((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"i$4"),Kr=Object.defineProperty,ct=lt((e,t)=>Kr(e,"name",{value:t,configurable:!0}),"a"),Zr=Object.defineProperty,Ht=ct((e,t)=>Zr(e,"name",{value:t,configurable:!0}),"e");function oe(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}O(oe,"U$2");J(oe,"ee");A(oe,"s$1");lt(oe,"s");ct(oe,"r");Ht(oe,"validate");function se(e){return oe(e),ye(e)}O(se,"Z$2");J(se,"te");A(se,"r$3");lt(se,"p");ct(se,"eastAsianWidthType");Ht(se,"eastAsianWidthType");function ke(e,{ambiguousAsWide:t=!1}={}){return oe(e),ji(e)||Ii(e)||t&&Ai(e)?2:1}O(ke,"yt$1");J(ke,"je");A(ke,"o$2");lt(ke,"W");ct(ke,"eastAsianWidth");Ht(ke,"eastAsianWidth");var Xr=Object.defineProperty,Qr=A((e,t)=>Xr(e,"name",{value:t,configurable:!0}),"p$3"),en=Object.defineProperty,Ci=Qr((e,t)=>en(e,"name",{value:t,configurable:!0}),"e"),tn=Object.defineProperty,rn=Ci((e,t)=>tn(e,"name",{value:t,configurable:!0}),"E");const Ni=String.raw,Kt=Ni`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,nn=rn(()=>new RegExp(Ni`\p{RI}{2}|(?)${Kt}(?:\u200D${Kt})*`,"gu"),"default");var on=Object.defineProperty,sn=Ci((e,t)=>on(e,"name",{value:t,configurable:!0}),"p");const ve=new Set(["\x1B",""]),ht="\x07",Ei="[",Gt="m",tt="]8;;",an=39,ln=/[\u200B\uFEFF\u2060-\u2064]/g,cn=new RegExp(`(?:\\${Ei}(?<code>\\d+)m|\\${tt}(?<uri>.*)${ht})`),hn=Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]])),Q=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\))/g,Zt=/\u001B\[(\d+(?:;\d+)*)?m[^\u001B]*(?:\u001B\[(?:\d+(?:;\d+)*)?m|$)/g,Xt=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)(.*?)\u001B\]8;;(?:\u0007|\u001B\\)/g,Te=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,qe=nn();sn(e=>e.replace(qe,""),"stripEmoji");var un=Object.defineProperty,dn=A((e,t)=>un(e,"name",{value:t,configurable:!0}),"E$1"),fn=Object.defineProperty,mn=dn((e,t)=>fn(e,"name",{value:t,configurable:!0}),"A"),pn=Object.defineProperty,ut=mn((e,t)=>pn(e,"name",{value:t,configurable:!0}),"d");const Qt=new Map,Fe=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,De=ut(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),gn=ut((e,t)=>{const i=Math.floor(e/65536),r=e%65536;let s=Qt.get(i);if(s||(s=new Map,Qt.set(i,s)),s.has(r))return s.get(r);let o;if(De(e)==="latin")o=t.width.regular;else if(De(e)==="control")o=t.width.control;else if(De(e)==="wide")o=t.width.wide;else switch(se(e)){case"ambiguous":{o=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{o=t.width.fullWidth;break}case"wide":{o=t.width.wide;break}default:o=t.width.regular}return s.set(r,o),o},"getCachedCharWidth"),bn=ut(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),be=ut((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const i={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?be(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},r=Math.max(0,i.truncation.limit-i.truncation.ellipsisWidth),{length:s}=e,o=s>1e4;let n=0,a=0,l=s,h=!1;const c=e.includes("\x1B")||e.includes("");for(;n<s;){if(c&&(e[n]==="\x1B"||e[n]==="")){if(e.startsWith("\x1B]8;;",n)){const m="\x1B]8;;\x07",d=m.length,x=e.indexOf("\x07",n+5);if(x!==-1){const w=e.indexOf(m,x+1);if(w!==-1){const v=w+d,$=e.slice(x+1,w).replace(Q,""),W=be($,{ambiguousIsNarrow:i.width.ambiguousIsNarrow,ansiWidth:i.width.ansi,controlWidth:i.width.control,countAnsiEscapeCodes:!1,ellipsis:i.truncation.ellipsis,ellipsisWidth:i.truncation.ellipsisWidth,emojiWidth:i.width.emoji,fullWidth:i.width.fullWidth,halfWidth:i.width.halfWidth,limit:Math.max(0,r-a),regularWidth:i.width.regular,tabWidth:i.width.tab,wideWidth:i.width.wide}),B=W.width;if(W.truncated)h=!0,l=Math.min(l,n);else if(a+B>r&&(l=Math.min(l,n),h=!0,a+B>i.truncation.limit))break;if(a+=B,n=v,h&&a>=i.truncation.limit)break;continue}}}if(Q.lastIndex=n,Q.test(e)){const m=Q.lastIndex-n,d=i.truncation.countAnsiEscapeCodes?m:i.width.ansi;if(a+d>r&&(l=Math.min(l,n),a+d>i.truncation.limit)){h=!0;break}a+=d,n=Q.lastIndex;continue}}const b=e.codePointAt(n);if(b===8203||b===65279||b>=8288&&b<=8292){n+=1;continue}if(b===9){if(a+i.width.tab>r&&(l=Math.min(l,n),a+i.width.tab>i.truncation.limit)){h=!0;break}a+=i.width.tab,n+=1;continue}if(Fe.lastIndex=n,Fe.test(e)){const m=(Fe.lastIndex-n)*i.width.regular;if(a+m>r){const d=Math.floor((r-a)/i.width.regular);if(l=Math.min(l,n+d),a+m>i.truncation.limit){h=!0;break}}a+=m,n=Fe.lastIndex;continue}if((b<=31||b>=127&&b<=159)&&(Te.lastIndex=n,Te.test(e))){const m=(Te.lastIndex-n)*i.width.control;if(a+m>r&&(l=Math.min(l,n+Math.floor((r-a)/i.width.control)),a+m>i.truncation.limit)){h=!0;break}a+=m,n=Te.lastIndex;continue}if(qe.lastIndex=n,qe.test(e)){if(a+i.width.emoji>r&&(l=Math.min(l,n),a+i.width.emoji>i.truncation.limit)){h=!0;break}a+=i.width.emoji,n=qe.lastIndex;continue}const f=e.codePointAt(n)??0;if(bn(f)){n+=f>65535?2:1;continue}let p;if(o)p=gn(f,i);else switch(De(f)){case"control":{p=i.width.control;break}case"latin":{p=i.width.regular;break}case"wide":{p=i.width.wide;break}case"zero":{p=0;break}default:switch(se(f)){case"ambiguous":{p=i.width.ambiguousIsNarrow?i.width.regular:i.width.wide;break}case"fullwidth":{p=i.width.fullWidth;break}case"wide":{p=i.width.wide;break}default:p=i.width.regular}}if(a+p>r&&(l=Math.min(l,n),a+p>i.truncation.limit)){h=!0;break}a+=p,n+=f>65535?2:1}let u=a,g=!1;return h&&i.truncation.limit>=i.truncation.ellipsisWidth&&(u=i.truncation.limit,g=!0),{ellipsed:g,index:h?l:s,truncated:h,width:u}},"getStringTruncatedWidth");var wn=Object.defineProperty,yn=A((e,t)=>wn(e,"name",{value:t,configurable:!0}),"i$2"),vn=Object.defineProperty,xn=yn((e,t)=>vn(e,"name",{value:t,configurable:!0}),"e"),$n=Object.defineProperty,Wn=xn((e,t)=>$n(e,"name",{value:t,configurable:!0}),"r");const E=Wn((e,t={})=>be(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var On=Object.defineProperty,ki=A((e,t)=>On(e,"name",{value:t,configurable:!0}),"i$1"),Bn=Object.defineProperty,Ri=ki((e,t)=>Bn(e,"name",{value:t,configurable:!0}),"r"),Sn=Object.defineProperty,An=Ri((e,t)=>Sn(e,"name",{value:t,configurable:!0}),"c");let jn=class{static{O(this,"ki")}static{J(this,"Si")}static{A(this,"l")}static{ki(this,"y")}static{Ri(this,"s")}static{An(this,"LRUCache")}capacity;cache;keyOrder;constructor(e){this.capacity=e,this.cache=new Map,this.keyOrder=[]}get(e){if(this.cache.has(e))return this.keyOrder=this.keyOrder.filter(t=>t!==e),this.keyOrder.push(e),this.cache.get(e)}has(e){return this.cache.has(e)}set(e,t){if(this.cache.has(e))this.keyOrder=this.keyOrder.filter(i=>i!==e);else if(this.cache.size>=this.capacity){const i=this.keyOrder.shift();i!==void 0&&this.cache.delete(i)}this.cache.set(e,t),this.keyOrder.push(e)}delete(e){this.cache.delete(e),this.keyOrder=this.keyOrder.filter(t=>t!==e)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}};var In=Object.defineProperty,Cn=A((e,t)=>In(e,"name",{value:t,configurable:!0}),"S$1"),Nn=Object.defineProperty,En=Cn((e,t)=>Nn(e,"name",{value:t,configurable:!0}),"w"),kn=Object.defineProperty,xe=En((e,t)=>kn(e,"name",{value:t,configurable:!0}),"y");const ei=new jn(100),Rn=new Intl.Segmenter("en",{granularity:"grapheme"}),Pn=/^[\u0000-\u007F]*$/,Mn=new Set(["0","22","23","24","27","28","29","39","49"]),Tn=new Set(["1","3","4","7","8","9"]),ti=new Map([["22","1"],["23","3"],["24","4"],["27","7"],["28","8"],["29","9"]]),Le=xe(e=>e>="30"&&e<="37"||e>="90"&&e<="97"||e.startsWith("38;"),"isForegroundColor"),_e=xe(e=>e>="40"&&e<="47"||e>="100"&&e<="107"||e.startsWith("48;"),"isBackgroundColor"),Fn=[{close:"\x1B[22m",open:"\x1B[1m"},{close:"\x1B[23m",open:"\x1B[3m"},{close:"\x1B[24m",open:"\x1B[4m"},{close:"\x1B[27m",open:"\x1B[7m"},{close:"\x1B[28m",open:"\x1B[8m"},{close:"\x1B[29m",open:"\x1B[9m"}],ii=xe((e,t)=>{let i=-1;for(const r of t){const s=e.indexOf(r);s!==-1&&(i===-1||s<i)&&(i=s)}return i},"findFirstPositionOfAny"),Ln=xe((e,t)=>{if(!e.includes("\x1B"))return[{after:"",before:"",content:e,visibleLength:E(e,t.width)}];const i=ei.get(e);if(i)return i;const r=[],s=[];let o=0,n;for(Q.lastIndex=0;(n=Q.exec(e))!==null;){const c=n[0];r.push(e.slice(o,n.index)),s.push(c),o=n.index+c.length}o<e.length&&r.push(e.slice(o));const a=[];for(const c of s){if(c==="\x1B[0m"||c==="\x1B]8;;\x07"){a.push(c);continue}if(c.startsWith("\x1B[")&&c.endsWith("m")){const u=c.slice(2,-1);if(Mn.has(u)){a.push(c);continue}}}const l=new Set,h=[];for(const[c,u]of r.entries()){if(c>0&&s[c-1]){const f=s[c-1];if(f==="\x1B[0m")l.clear();else if(f==="\x1B]8;;\x07"){for(const p of l)if(p.startsWith("\x1B]8;;")&&!p.endsWith("\x1B]8;;\x07")){l.delete(p);break}}else if(f.startsWith("\x1B[")&&f.endsWith("m")){const p=f.slice(2,-1);if(p==="39"){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(Le(d)){l.delete(m);break}}}else if(p==="49"){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(_e(d)){l.delete(m);break}}}else if(ti.has(p)){const m=ti.get(p);for(const d of l)if(d===`\x1B[${m}m`){l.delete(d);break}}else{if(Le(p)){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(Le(d)){l.delete(m);break}}}else if(_e(p)){for(const m of l)if(m.startsWith("\x1B[")&&m.endsWith("m")){const d=m.slice(2,-1);if(_e(d)){l.delete(m);break}}}else if(Tn.has(p)){const m=`\x1B[${p}m`;l.has(m)&&l.delete(m)}l.add(f)}}else if(f.startsWith("\x1B]8;;")&&!f.endsWith("\x1B]8;;\x07")){for(const p of l)if(p.startsWith("\x1B]8;;")&&!p.endsWith("\x1B]8;;\x07")){l.delete(p);break}l.add(f)}}if(u==="")continue;let g="";if(l.size>0)if(a.includes("\x1B[0m"))g="\x1B[0m";else{const f=[];let p=!1;for(const w of l)if(w.startsWith("\x1B]8;;")&&!w.endsWith("\x1B]8;;\x07")){p=!0;break}p&&a.includes("\x1B]8;;\x07")&&f.push("\x1B]8;;\x07");let m=!1,d=!1;for(const w of l)if(w.startsWith("\x1B[")&&w.endsWith("m")){const v=w.slice(2,-1);Le(v)?m=!0:_e(v)&&(d=!0)}if(m&&d){const w=ii(e,["\x1B[3","\x1B[9","\x1B[38;"]),v=ii(e,["\x1B[4","\x1B[10","\x1B[48;"]);w>=0&&v>=0?w>v?f.push("\x1B[39m","\x1B[49m"):f.push("\x1B[49m","\x1B[39m"):f.push("\x1B[39m","\x1B[49m")}else m&&f.push("\x1B[39m"),d&&f.push("\x1B[49m");m&&d&&e.includes("\x1B[39m")&&e.includes("\x1B[49m")&&(e.indexOf("\x1B[39m")<e.indexOf("\x1B[49m")?(f.length-=2,f.push("\x1B[39m","\x1B[49m")):e.indexOf("\x1B[49m")<e.indexOf("\x1B[39m")&&(f.length-=2,f.push("\x1B[49m","\x1B[39m")));const x=Fn.filter(w=>l.has(w.open)).map(w=>({position:e.indexOf(w.open),style:w})).filter(w=>w.position>=0).toSorted((w,v)=>v.position-w.position);for(const w of x){const v=w;a.includes(v.style.close)&&f.push(v.style.close)}g=f.join("")}const b=[...l].join("");h.push({after:g,before:b,content:u,visibleLength:E(u,{fullWidth:1,wideWidth:1})})}return ei.set(e,h),h},"processIntoStyledSegments"),_n=xe((e,t,i,r)=>{const s=[...r.segmenter.segment(e)],o=[];let n=0,a=!1;for(const l of s){const h=E(l.segment,r.width),c=n,u=n+h;if(!a)if(c<t){n=u;continue}else a=!0;if(c>=i||u>i)break;o.push(l.segment),n=u}return o.join("")},"fastSlice"),D=xe((e,t=0,i=Number.MAX_SAFE_INTEGER,r={})=>{const s={segmenter:Rn,...r};if(t>=i||e==="")return"";const o=E(e,s.width);if(t===0&&i>=o)return e;if(t<0||i<0)throw new RangeError("Negative indices aren't supported");if(!e.includes("\x1B"))return Pn.test(e)?e.slice(t,i):_n(e,t,i,s);if(Zt.lastIndex=0,Xt.lastIndex=0,!Zt.test(e)&&!Xt.test(e))return e;const n=Ln(e,s);if(n.length===0)return"";let a=0;const l=[];for(const[u,g]of n.entries()){const b=a,f=a+g.visibleLength;if(f>t&&b<i){const p=Math.max(0,t-b),m=Math.min(g.visibleLength,i-b);l.push({end:m,index:u,segment:g,start:p})}a=f}if(l.length===0)return"";const h=[],c=l[0].segment;h.push(c.before);for(let u=0;u<l.length;u++){const{end:g,segment:b,start:f}=l[u];if(f===0&&g===b.visibleLength)h.push(b.content);else{const p=[...s.segmenter.segment(b.content)];h.push(p.slice(f,g).map(m=>m.segment).join(""))}if(u<l.length-1){const p=l[u+1].segment,m=b.after,d=p.before;m!==d&&(m||d)&&h.push(m,d)}}return h.push(l.at(-1).segment.after),h.join("")},"slice");var Hn=Object.defineProperty,Gn=A((e,t)=>Hn(e,"name",{value:t,configurable:!0}),"x"),Vn=Object.defineProperty,Jn=Gn((e,t)=>Vn(e,"name",{value:t,configurable:!0}),"T"),zn=Object.defineProperty,dt=Jn((e,t)=>zn(e,"name",{value:t,configurable:!0}),"f");const ri="…",qn=3,He=dt((e,t,i=!1)=>{if(e.charAt(t)===" ")return t;const r=i?1:-1,s=Math.min(qn,i?e.length-t:t);for(let o=1;o<=s;o++){const n=t+o*r;if(e.charAt(n)===" ")return n}return t},"findNearestSpace"),Ge=dt((e,t,i)=>be(e,{...i,ellipsis:"",ellipsisWidth:0,limit:t}).index,"widthToIndex"),Ve=dt((e,t,i)=>E(e.slice(0,t),i),"indexToWidth"),ni=dt((e,t,i={})=>{if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof e}`);if(typeof t!="number")throw new TypeError(`Expected \`limit\` to be a number, got ${typeof t}`);if(e===""||t<=0)return"";const r=e.normalize("NFC"),{ellipsis:s=ri,position:o="end",preferTruncationOnSpace:n=!1}=i;let a=i.ellipsisWidth??s===ri?1:void 0;a??=be(s,{...i.width,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width;const{width:l}=be(r,{...i.width,ellipsis:s,ellipsisWidth:a});if(l<=t)return r;switch(o){case"end":{if(n){const h=t-a,c=Ge(r,h,i.width),u=He(r,c),g=Ve(r,u,i.width);return D(r,0,g,{width:i.width})+s}return D(r,0,t-a,{width:i.width})+s}case"middle":{const h=Math.floor(t/2),c=Math.max(0,t-a),u=Math.min(h,c),g=Math.max(0,c-u);if(n){const b=Ge(r,u,i.width),f=He(r,b),p=Ve(r,f,i.width),m=l-g,d=Ge(r,m,i.width),x=He(r,d,!0),w=Ve(r,x,i.width);return D(r,0,p,{width:i.width})+s+D(r,w,l,{width:i.width}).trim()}return D(r,0,u,{width:i.width})+s+D(r,l-g,l,{width:i.width})}case"start":{if(n){const h=l-t+a,c=Ge(r,h,i.width),u=He(r,c,!0),g=Ve(r,u,i.width);return s+D(r,g,l,{width:i.width}).trim()}return s+D(r,l-t+a,l,{width:i.width})}default:throw new Error(`Invalid position: expected 'start', 'middle' or 'end', got '${o}'`)}},"truncate");var Dn=Object.defineProperty,Pi=A((e,t)=>Dn(e,"name",{value:t,configurable:!0}),"b$2"),Un=Object.defineProperty,ae=Pi((e,t)=>Un(e,"name",{value:t,configurable:!0}),"d"),Yn=Object.defineProperty,Kn=ae((e,t)=>Yn(e,"name",{value:t,configurable:!0}),"a");const Zn=/\x1B\[(\d+)m/;class Mi{static{O(this,"he")}static{J(this,"at")}static{A(this,"T")}static{Pi(this,"T")}static{ae(this,"d")}static{Kn(this,"AnsiStateTracker")}activeForeground=void 0;activeBackground=void 0;activeFormatting=[];processEscape(t){const i=Zn.exec(t);if(!i)return;const r=Number.parseInt(i[1],10);switch(r){case 0:{this.activeForeground=void 0,this.activeBackground=void 0,this.activeFormatting=[];break}case 39:{this.activeForeground=void 0;break}case 49:{this.activeBackground=void 0;break}default:if(r>=30&&r<=37||r>=90&&r<=97)this.activeForeground=t;else if(r>=40&&r<=47||r>=100&&r<=107)this.activeBackground=t;else if([1,2,3,4,7,8,9].includes(r))this.activeFormatting.push(t);else if([22,23,24,27,28,29].includes(r)){const s={22:"[1m",23:"[3m",24:"[4m",27:"[7m",28:"[8m",29:"[9m"}[r];s&&(this.activeFormatting=this.activeFormatting.filter(o=>!o.includes(s)))}}}getStartEscapesForAllActiveAttributes(){return[this.activeBackground,this.activeForeground,...this.activeFormatting].filter(Boolean).join("")}getEndEscapesForAllActiveAttributes(){const t=[];if(this.activeFormatting.length>0){const i={"\x1B[1m":"\x1B[22m","\x1B[2m":"\x1B[22m","\x1B[3m":"\x1B[23m","\x1B[4m":"\x1B[24m","\x1B[7m":"\x1B[27m","\x1B[8m":"\x1B[28m","\x1B[9m":"\x1B[29m"};[...this.activeFormatting].toReversed().forEach(r=>{const s=i[r];s&&t.push(s)})}return this.activeForeground&&t.push("\x1B[39m"),this.activeBackground&&t.push("\x1B[49m"),t.join("")}}var Xn=Object.defineProperty,Ti=ae((e,t)=>Xn(e,"name",{value:t,configurable:!0}),"o");const Fi=Ti((e,t)=>{if(!ve.has(e[t]))return{isInsideEscape:!1,isInsideLinkEscape:!1};const i=!0,r=e.slice(t+1,t+1+tt.length).join("")===tt;return{isInsideEscape:i,isInsideLinkEscape:r}},"checkEscapeSequence"),Qn=Ti((e,t={})=>{const i=new Mi;let r="",s=!1,o="",n="",a=!1;const l=[...e];for(let h=0;h<l.length;h++){const c=l[h];if(c&&ve.has(c)){if(r){const p=t.getWidth?.(r)??0,m={isEscapeSequence:!1,isGrapheme:!0,text:r,width:p};if(a&&(m.isHyperlink=!0,m.hyperlinkUrl=n),t.onSegment?.(m,i)===!1)return;r=""}s=!0,o=c;const b=Fi(l,h),{isInsideLinkEscape:f}=b;if(f){let p=h+1;for(n="";p<l.length;){const d=l[p];if(d===ht)break;n+=d,p+=1}n=n.slice(4);const m={hyperlinkUrl:n,isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkStart:!0,width:0};if(t.onSegment?.(m,i)===!1)return;h=p,a=!0,s=!1,o="";continue}if(h+1<l.length&&l[h+1]==="\\"&&a){const p={isEscapeSequence:!0,isGrapheme:!1,isHyperlink:!0,isHyperlinkEnd:!0,width:0};if(t.onSegment?.(p,i)===!1)return;a=!1,n="",h+=1,s=!1,o="";continue}}if(s){if(o!==c&&(o+=c),c===Gt){s=!1,i.processEscape(o);const b={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};if(t.onSegment?.(b,i)===!1)return;o=""}continue}r+=c;const u=t.getWidth?.(r)??0,g={isEscapeSequence:!1,isGrapheme:!0,text:r,width:u};if(a&&(g.isHyperlink=!0,g.hyperlinkUrl=n),t.onSegment?.(g,i)===!1)return;r=""}if(r){const h=t.getWidth?.(r)??0,c={isEscapeSequence:!1,isGrapheme:!0,text:r,width:h};a&&(c.isHyperlink=!0,c.hyperlinkUrl=n),t.onSegment?.(c,i)}if(o){const h={isEscapeSequence:!0,isGrapheme:!1,text:o,width:0};t.onSegment?.(h,i)}},"processAnsiString");var eo=Object.defineProperty,to=ae((e,t)=>eo(e,"name",{value:t,configurable:!0}),"t$1");const oi=to(e=>`${ve.values().next().value}${Ei}${String(e)}${Gt}`,"wrapAnsiCode");var io=Object.defineProperty,ro=ae((e,t)=>io(e,"name",{value:t,configurable:!0}),"s");const si=ro(e=>`${ve.values().next().value}${tt}${e}${ht}`,"wrapAnsiHyperlink");var no=Object.defineProperty,oo=ae((e,t)=>no(e,"name",{value:t,configurable:!0}),"l");const so=oo(e=>{if(e.length===0)return"";if(e.length===1)return e[0];let t="",i,r;const s=e.join(`
|
|
2
|
+
`),o=[...s];let n=0;for(const[a,l]of o.entries()){if(t+=l,ve.has(l)){const c=cn.exec(s.slice(n))?.groups??{};if(c.code!==void 0){const u=Number.parseFloat(c.code);i=u===an?void 0:u}else c.uri!==void 0&&(r=c.uri.length===0?void 0:c.uri)}const h=hn.get(Number(i));o[a+1]===`
|
|
3
|
+
`?(r&&(t+=si("")),i&&h&&(t+=oi(h))):l===`
|
|
4
|
+
`&&(i&&h&&(t+=oi(i)),r&&(t+=si(r))),n+=l.length}return t},"preserveAnsi");var ao=Object.defineProperty,K=ae((e,t)=>ao(e,"name",{value:t,configurable:!0}),"f");const Li=/(?=\s)|(?<=\s)/,_i=/^\s+$/,Ot=K(e=>{if(!e.includes("\x1B"))return e;let t=e;return e.includes("\x1B[30m")&&(t+="\x1B[39m"),e.includes("\x1B[42m")&&(t+="\x1B[49m"),t},"resetAnsiAtLineBreak"),ie=K(e=>{const t=e.split(" ");let i=t.length;for(;i>0&&E(t[i-1])===0;)i--;return i===t.length?e:t.slice(0,i).join(" ")+t.slice(i).join("")},"stringVisibleTrimSpacesRight"),Hi=K((e,t,i)=>{if(e.length===0)return[""];if(t<=0)return[e];const r=[],s=new Mi;let o="",n=0,a=!1,l=!1,h="",c=0;for(;c<e.length;){const u=e[c];if(ve.has(u)){a=!0,h=u,o+=u,l=Fi([...e],c).isInsideLinkEscape,c+=1;continue}if(a){h+=u,o+=u,l?u===ht&&(a=l=!1):u===Gt&&(a=!1,s.processEscape(h)),c+=1;continue}const g=E(u),b=u===" ";if(g===0){o+=u,c+=1;continue}if(n+g>t&&(o&&r.push(o+s.getEndEscapesForAllActiveAttributes()),o=s.getStartEscapesForAllActiveAttributes(),n=E(o),b&&i)){for(;c<e.length&&e[c]===" ";)c+=1;continue}if(o+=u,n+=g,n===t&&c<e.length-1&&(r.push(o+s.getEndEscapesForAllActiveAttributes()),o=s.getStartEscapesForAllActiveAttributes(),n=E(o),c+1<e.length&&e[c+1]===" "&&i)){for(c+=1;c<e.length&&e[c]===" ";)c+=1;continue}c+=1}return o&&r.push(o+s.getEndEscapesForAllActiveAttributes()),i?r.map(u=>ie(u)):r},"wrapWithBreakAtWidth"),lo=K((e,t,i)=>{if(e.length===0)return[];const r=i?e.trim():e;if(r.length===0)return[];const s=[];let o="",n=0;return Qn(r,{getWidth:E,onSegment:K((a,l)=>{const h=a.text??"";if(a.isEscapeSequence)o+=h;else{const c=h===" ";if(a.width===0)return o+=h,!0;if(n+a.width>t&&(o&&s.push(o),o=l.getStartEscapesForAllActiveAttributes(),n=0,c))return i||s.push(l.getStartEscapesForAllActiveAttributes()+h),!0;o+=h,n+=a.width}return!0},"onSegment")}),o&&s.push(o),i?s.map(a=>ie(a)):s},"wrapCharByChar"),co=K((e,t,i)=>{if(e.length===0)return[];const r=i?e.trim():e;if(r.length===0)return[];const s=r.split(Li),o=[];let n="",a=0,l=0;for(;l<s.length;){const h=s[l],c=_i.test(h),u=E(h);if(h.length===0){l+=1;continue}if(i&&c&&a===0){l+=1;continue}if(a+u>t&&a>0){i?o.push(ie(n)):o.push(n),n="",a=0;continue}n+=h,a+=u,l+=1}return n&&(i?o.push(ie(n)):o.push(n)),o},"wrapWithWordBoundaries"),ho=K((e,t,i)=>{if(e.length===0)return[];const r=i?e.trim():e;if(r.length===0)return[];const s=r.split(Li),o=[];let n="",a=0,l=0;for(;l<s.length;){const h=s[l],c=_i.test(h),u=E(h);if(h.length===0){l+=1;continue}if(i&&c&&a===0){l+=1;continue}if(u>t){n&&o.push(Ot(i?ie(n):n));const g=Hi(h,t,i);if(g.length>0){for(let b=0;b<g.length-1;b+=1)o.push(g[b]);n=g.at(-1),a=E(n)}else n="",a=0;l+=1;continue}if(a+u>t&&a>0&&(o.push(Ot(i?ie(n):n)),n="",a=0,i&&c)){l+=1;continue}n+=h,a+=u,l+=1}return n&&o.push(Ot(i?ie(n):n)),o},"wrapAndBreakWords"),Je={BREAK_AT_CHARACTERS:"BREAK_AT_CHARACTERS",BREAK_WORDS:"BREAK_WORDS",PRESERVE_WORDS:"PRESERVE_WORDS",STRICT_WIDTH:"STRICT_WIDTH"},uo=K((e,t={})=>{const{removeZeroWidthCharacters:i=!0,trim:r=!0,width:s=80,wrapMode:o=Je.PRESERVE_WORDS}=t;if(r&&e.trim()==="")return"";let n=e.normalize("NFC").replaceAll(`\r
|
|
5
5
|
`,`
|
|
6
|
-
`);return i&&(n=n.replaceAll(
|
|
7
|
-
`).map(a=>{if(r&&a.trim()==="")return"";let l;switch(o){case
|
|
8
|
-
`)},"wordWrap");var Ko=Object.defineProperty,K=A((e,t)=>Ko(e,"name",{value:t,configurable:!0}),"n$3");const Ui=80,Di=24,jt=K((e,t,{shell:i,env:r}={})=>hn(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:i,env:r}).trim(),"exec"),ze=K((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),Yi=K((e,t)=>{const{columns:i,rows:r}=ze(e,t);if(!(Number.isNaN(i)||Number.isNaN(r))&&!(i===Ui&&r===Di))return{columns:i,rows:r}},"createIfNotDefault"),Zo=K(()=>{if(ee.platform!=="linux")return!0;try{const e=Be.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const i=e.slice(t+2).trim().split(/\s+/),r=Number.parseInt(i[2],10),s=Number.parseInt(i[5],10);return Number.isNaN(r)||Number.isNaN(s)||s<=0?!1:r===s}catch{return!1}},"isForegroundProcess");function pt(){const{env:e,stdout:t,stderr:i}=ee;if(t?.columns&&t?.rows)return ze(t.columns,t.rows);if(i?.columns&&i?.rows)return ze(i.columns,i.rows);if(e.COLUMNS&&e.LINES)return ze(e.COLUMNS,e.LINES);const r={columns:Ui,rows:Di};return ee.platform==="win32"?Bt()??r:ee.platform==="darwin"?hi()??Bt()??r:hi()??Bt()??Qo()??r}O(pt,"Tt");V(pt,"bt");A(pt,"O");K(pt,"terminalSize");const hi=K(()=>{try{const e=ee.platform==="darwin"?Be.constants.O_EVTONLY|Be.constants.O_NONBLOCK:Be.constants.O_NONBLOCK,{columns:t,rows:i}=un.WriteStream(Be.openSync("/dev/tty",e));return{columns:t,rows:i}}catch{}},"devTty"),Bt=K(()=>{try{const e=jt("tput",["cols"],{env:{TERM:"dumb",...ee.env}}),t=jt("tput",["lines"],{env:{TERM:"dumb",...ee.env}});if(e&&t)return Yi(e,t)}catch{}},"tput"),Qo=K(()=>{try{if(!Zo())return;const e=jt("resize",["-u"]).match(/\d+/g);if(e.length===2)return Yi(e[0],e[1])}catch{}},"resize");var Xo=Object.defineProperty,Ki=A((e,t)=>Xo(e,"name",{value:t,configurable:!0}),"e");const ce=Ki((e,t)=>{switch(t){case"bottom":return{body:e.bottomBody,join:e.bottomJoin,left:e.bottomLeft,right:e.bottomRight};case"middle":return{body:e.joinBody,join:e.joinJoin,left:e.joinLeft,right:e.joinRight};case"top":return{body:e.topBody,join:e.topJoin,left:e.topLeft,right:e.topRight};default:throw new Error(`Invalid borderType: ${String(t)}`)}},"getHorizontalBorderChars"),es=Ki(e=>({join:e.bodyJoin,left:e.bodyLeft,right:e.bodyRight}),"getVerticalBorderChars");var ts=Object.defineProperty,is=A((e,t)=>ts(e,"name",{value:t,configurable:!0}),"n$1");const Qe=is((e,t,i)=>{let r=0;for(let s=0;s<i;s+=1)r+=e[t+s]??0;return i>1&&(r+=i-1),r},"calculateCellTotalWidth");var rs=Object.defineProperty,ns=A((e,t)=>rs(e,"name",{value:t,configurable:!0}),"a");const It=ns((e,t,i,r)=>{let s=t;for(;s>0&&e[s-1]?.[i]===r;)s-=1;let o=t;for(;o<e.length-1&&e[o+1]?.[i]===r;)o+=1;let n;const a=o-s+1;if(a===1)n=!0;else switch(r.vAlign){case"bottom":{n=t===o;break}case"middle":{const l=s+Math.floor(a/2);n=t===l;break}case"top":{n=t===s;break}default:n=t===s}return{firstRow:s,lastRow:o,showContent:n}},"determineCellVerticalPosition");var os=Object.defineProperty,ss=A((e,t)=>os(e,"name",{value:t,configurable:!0}),"F");const as=ss((e,t,i,r,s)=>{if(e.length===0)return[];let o=e.length-1;for(let l=0;l<e.length;l+=1){const h=e[l];if(h){for(const[c,u]of h.entries())if(u&&s(e,l,c,u)===l){const g=It(e,l,c,u);o=Math.max(o,g.lastRow)}}}const n=Array.from({length:o+1}).fill(1);for(let l=0;l<e.length;l+=1){const h=e[l];if(h)for(let c=0;c<i.columns;c+=1){const u=h[c];if(u&&s(e,l,c,u)===l&&(u.rowSpan??1)===1){const g=u.colSpan??1,b=Qe(t,c,g),f=r(u,b).length;n[l]=Math.max(n[l]??1,f)}}}const a=Array.from({length:n.length}).fill(!1);if(i.fixedRowHeights)for(let l=0;l<n.length;l+=1){let h;i.fixedRowHeights[l]!==void 0?h=i.fixedRowHeights[l]:i.fixedRowHeights.length===1&&i.fixedRowHeights[0]!==void 0&&(h=i.fixedRowHeights[0]),h!==void 0&&(n[l]=Math.max(1,h),a[l]=!0)}for(let l=0;l<e.length;l+=1){const h=e[l];if(h)for(let c=0;c<i.columns;c+=1){const u=h[c];if(u&&s(e,l,c,u)===l&&(u.rowSpan??1)>1){const g=u.colSpan??1,b=Qe(t,c,g),f=r(u,b).length-1,p=It(e,l,c,u),{firstRow:m,lastRow:d}=p;let $=0,w=0;for(let x=m;x<=d&&x<n.length;x+=1)$+=n[x]??1,a[x]||(w+=1);const v=f-$;if(v>0)if(w>0){const x=Math.ceil(v/w);let W=0;for(let B=m;B<=d&&B<n.length;B+=1)if(!a[B]){const j=Math.min(x,v-W);if(n[B]=(n[B]??1)+j,W+=j,W>=v)break}}else console.warn(`[calculateRowHeights] Content of spanning cell exceeds fixed height allocated. Cell: ${JSON.stringify(u.content)}, Required: ${String(f)}, Allocated: ${String($)} (fixed).`)}}}return n},"calculateRowHeights");var ls=Object.defineProperty,cs=A((e,t)=>ls(e,"name",{value:t,configurable:!0}),"i");const he=cs((e,t,i,r)=>{let s=t;for(;s>0&&e[s-1]?.[i]===r;)s-=1;return s},"findFirstOccurrenceRow");var hs=Object.defineProperty,us=A((e,t)=>hs(e,"name",{value:t,configurable:!0}),"n");const Ct="__EMPTY__",ui=us(e=>{if(typeof e=="string")return{content:e};if(typeof e=="number"||typeof e=="bigint"||typeof e=="boolean")return{content:String(e)};if(e==null)return{content:Ct};if(typeof e=="object"&&"content"in e){let{content:t}=e;if(typeof t=="number"||typeof t=="bigint"||typeof t=="boolean")t=String(t);else if(t==null)t=Ct;else if(typeof t!="string")throw new TypeError(`Invalid item type in grid cell: expected string, number, null, undefined, or GridItem object, but received ${JSON.stringify(e)} (type: ${typeof e})`);return{...e,content:t}}throw new TypeError(`Invalid item type in grid cell: expected string, number, null, undefined, or GridItem object, but received ${JSON.stringify(e)} (type: ${typeof e})`)},"normalizeGridCell");var ds=Object.defineProperty,fs=A((e,t)=>ds(e,"name",{value:t,configurable:!0}),"p");const ms=fs((e,t,i,r,s)=>{const o=E(e),n=" ".repeat(Math.max(0,r)),a=" ".repeat(Math.max(0,s));if(o===0)return n+" ".repeat(Math.max(0,t))+a;const l=Math.max(0,t-o);switch(i){case"center":{const h=Math.floor(l/2),c=l-h;return n+" ".repeat(h)+e+" ".repeat(c)+a}case"right":return n+" ".repeat(l)+e+a;default:return n+e+" ".repeat(l)+a}},"padAndAlignContent");var ps=Object.defineProperty,qt=A((e,t)=>ps(e,"name",{value:t,configurable:!0}),"H");const $e=/\r?\n/,di=/\s+/,S=qt((e,t)=>!e||!t?e:typeof t=="function"?t(e):t.open+e+t.close,"applyColor");class gt{static{O(this,"It")}static{V(this,"Te")}static{A(this,"Grid")}static{qt(this,"Grid")}#e;#n=[];#t;#o=new WeakMap;#i=new WeakMap;static createGridLayout(){return[]}constructor(t){const i={autoColumns:1,autoFlow:"row",autoRows:1,balancedWidths:!1,gap:0,paddingLeft:1,paddingRight:1,rows:0,showBorders:t.border!==void 0,truncate:!1,truncateOverflow:!0,wordWrap:!1};let r;Array.isArray(t.fixedRowHeights)?r=t.fixedRowHeights:typeof t.fixedRowHeights=="number"&&(r=[t.fixedRowHeights]),this.#e={...i,...t,columns:t.columns,fixedRowHeights:r,showBorders:t.border!==void 0||(t.showBorders??!1)};let{terminalWidth:s}=this.#e;if(s===void 0){const{columns:o}=pt();s=o}this.#t=s,this.#e.maxWidth&&(this.#e.maxWidth=Math.min(this.#e.maxWidth,this.#t))}addItem(t){return this.#n.push(ui(t)),this}addItems(t){return this.#n.push(...t.map(i=>ui(i))),this}setColumns(t){return this.#e.columns=t,this}setRows(t){return this.#e.rows=t,this}setBorder(t){return this.#e.border=t,this}setShowBorders(t){return this.#e.showBorders=t,this}setMaxWidth(t){return this.#e.maxWidth=t,this}toString(){const t=gt.createGridLayout();if(this.placeItems(t),t.length===0||t[0]?.length===0)return"";let i=this.calculateColumnWidths(t);const r=this.calculateTotalGridWidth(i),s=typeof this.#e.maxWidth=="number"&&this.#e.maxWidth>0?Math.min(this.#e.maxWidth,this.#t):this.#t;return r>s&&(i=this.adjustColumnWidthsForTerminal(i,r)),this.renderGrid(t,i)}placeItems(t){let i=0,r=0;const s=this.#e.rows>0?this.#e.rows:Number.POSITIVE_INFINITY;for(let o=0;o<this.#n.length;o+=1){const n=this.#n[o];if(n.content===Ct&&!(n.rowSpan&&n.rowSpan>1)&&!(n.colSpan&&n.colSpan>1)){if(this.#e.autoFlow==="row")r+=1,r>=this.#e.columns&&(r=0,i+=1);else{i+=1;const f=t.length>0?t.length:s;i>=f&&f!==Number.POSITIVE_INFINITY?(i=0,r+=1):t.length===0&&f===Number.POSITIVE_INFINITY&&(r+=1)}continue}const a=n.colSpan??1,l=n.rowSpan??1;let h=!1,c=i,u=r,g=0;const b=(t.length+l+5)*this.#e.columns;for(;!h&&c<s&&g<b;){for(g+=1;c+l>t.length;)t.push(Array.from({length:this.#e.columns}).fill(void 0));if(this.canPlaceItem(t,c,u,a,l))if(this.placeItem(t,c,u,n),h=!0,this.#e.autoFlow==="row")r=u+a,i=c,r>=this.#e.columns&&(r=0,i+=1);else{i=c+l,r=u;const f=t.length>0?t.length:s;i>=f&&(i=0,r+=1)}else if(this.#e.autoFlow==="row")u+=1,u>=this.#e.columns&&(u=0,c+=1);else{for(c+=1;c+l>t.length;)t.push(Array.from({length:this.#e.columns}).fill(void 0));const f=t.length>0?t.length:s;if(c>=f&&(c=0,u+=1,u>=this.#e.columns))break}}if(!h)if(console.warn(`@visulima/tabular: Could not find position for item: ${JSON.stringify(n)} after ${String(g)} attempts. Grid might be too small or layout impossible.`),this.#e.autoFlow==="row")r+=1,r>=this.#e.columns&&(r=0,i+=1);else{i+=1;const f=t.length>0?t.length:s;i>=f&&(i=0,r+=1)}if(g>=b)break}if(this.#e.rows===0)for(;t.length>0&&t.at(-1)?.every(o=>o===void 0);)t.pop()}canPlaceItem(t,i,r,s,o,n=!1){if(r+s>this.#e.columns)return!1;for(let a=i;a<i+o;a+=1)if(a<t.length){if(!t[a])return console.warn(`Grid layout unexpectedly missing row ${String(a)} during canPlaceItem check.`),!1;for(let l=r;l<r+s;l+=1)if(t[a]?.[l]!==void 0)return!1}else if(!n)return!1;return!0}computeWrappedContentWidth(t,i,r,s){let o=t;if(s){if(o>20){let n=0;for(const a of i){const l=a.split(di);for(const h of l)n=Math.max(n,Math.min(E(h),r))}o=Math.min(o,Math.max(n+4,12))}}else{let n=0;for(const a of i){const l=a.split(di);for(const h of l)n=Math.max(n,Math.min(E(h),r))}o=Math.min(o,Math.max(n+12,20))}return o}placeItem(t,i,r,s){const o=s.rowSpan??1,n=s.colSpan??1;for(let a=i;a<i+o;a+=1){for(;a>=t.length;)t.push(Array.from({length:this.#e.columns}).fill(void 0));for(let l=r;l<r+n;l+=1)l<this.#e.columns&&(t[a]||(console.error(`Logic error: Row ${String(a)} not found in placeItem despite check.`),t[a]=Array.from({length:this.#e.columns}).fill(void 0)),t[a][l]=s)}}calculateTotalGridWidth(t){let i=0;const r=this.#e.showBorders?this.#e.border:void 0;r&&(i+=r.bodyLeft.width,i+=r.bodyRight.width);const s=t.length,o=this.#e.showBorders?r?.bodyJoin.width??0:0,n=this.#e.gap;for(let a=0;a<s;a+=1)i+=t[a]??0,a<s-1&&(i+=n,i+=o);return i}adjustColumnWidthsForTerminal(t,i){const r=typeof this.#e.maxWidth=="number"&&this.#e.maxWidth>0?Math.min(this.#e.maxWidth??0,this.#t):this.#t;if(i<=r)return t;let s=0;const o=t.length,n=this.#e.showBorders?this.#e.border:void 0;if(n&&(s+=n.bodyLeft.width,s+=n.bodyRight.width),o>1){s+=(o-1)*this.#e.gap;const u=n?.bodyJoin.width??0;s+=(o-1)*u}if(s>=r)return Array.from({length:o}).fill(1);const a=r-s,l=t.reduce((u,g)=>u+g,0);if(l===0){const u=Math.floor(a/o);return Array.from({length:o}).fill(u)}const h=t.map(u=>{const g=u/l;return Math.max(1,Math.floor(a*g))});let c=a-h.reduce((u,g)=>u+g,0);if(c>0){const u=h.map((g,b)=>{const f=l>0?(t[b]??0)/l:1/o;return{index:b,remainder:a*f%1}}).toSorted((g,b)=>b.remainder-g.remainder);for(const g of u){if(c<=0)break;const{index:b}=g;h[b]!==void 0&&(h[b]+=1,c-=1)}}return h}calculateBalancedColumnWidths(t){const i=this.calculateMinimumColumnWidthsWithGrowableInfo(t),r=i.widths,{growableColumns:s}=i,o=typeof this.#e.maxWidth=="number"&&this.#e.maxWidth>0?Math.min(this.#e.maxWidth,this.#t):this.#t,n=this.#e.showBorders?this.#e.border:void 0;let a=0;if(n&&(a+=n.bodyLeft.width,a+=n.bodyRight.width),this.#e.columns>1){a+=(this.#e.columns-1)*this.#e.gap;const c=n?.bodyJoin.width??0;a+=(this.#e.columns-1)*c}const l=Math.max(0,o-a);if(r.reduce((c,u)=>c+u,0)>0){const c=Math.floor(l/this.#e.columns),u=Array.from({length:this.#e.columns}).fill(c),g=c*this.#e.columns;let b=l-g;for(let d=0;d<u.length&&b>0;d+=1)u[d]=(u[d]??0)+1,b-=1;const f=[];let p=0;for(let d=0;d<this.#e.columns;d+=1){const $=u[d]??0,w=r[d]??0,v=Math.max($,w);f.push(v),p+=v}if(p>l){const d=l/p,$=f.map(x=>Math.max(3,Math.floor(x*d))),w=$.reduce((x,W)=>x+W,0);let v=l-w;for(let x=0;x<$.length&&v>0;x+=1)$[x]=($[x]??0)+1,v-=1;return $}let m=l-p;if(m>0){const d=s.length>0?s:f.map(($,w)=>w);for(;m>0&&d.length>0;)for(const $ of d){if(m<=0)break;f[$]=(f[$]??0)+1,m-=1}}return f}const h=Math.floor(l/this.#e.columns);return Array.from({length:this.#e.columns}).fill(h)}calculateMinimumColumnWidthsWithGrowableInfo(t){const i=Array.from({length:this.#e.columns}).fill(0),r=[],s=this.#e.paddingLeft+this.#e.paddingRight,o=this.#e.gap+(this.#e.showBorders?this.#e.border?.bodyJoin.width??0:0);for(let n=0;n<this.#e.columns;n+=1)for(let a=0;a<t.length;a+=1){const l=t[a]?.[n];if(!l||he(t,a,n,l)!==a||n>0&&t[a]?.[n-1]===l)continue;const h=l.colSpan??1,c=l.maxWidth??Number.POSITIVE_INFINITY,u=String(l.content??"").split($e),g=this.#e.wordWrap&&l.wordWrap!==!1;let b=0;for(const f of u)b=Math.max(b,Math.min(E(f),c));b=this.computeWrappedContentWidth(b,u,c,g),h===1&&(i[n]=Math.max(i[n]??0,b+s),g&&!r.includes(n)&&r.push(n))}for(let n=0;n<t.length;n+=1)for(let a=0;a<this.#e.columns;a+=1){const l=t[n]?.[a];if(!l||he(t,n,a,l)!==n||a>0&&t[n]?.[a-1]===l)continue;const h=l.colSpan??1;if(h>1){const c=l.maxWidth??Number.POSITIVE_INFINITY,u=String(l.content??"").split($e),g=this.#e.wordWrap&&l.wordWrap!==!1;let b=0;for(const d of u)b=Math.max(b,Math.min(E(d),c));b=this.computeWrappedContentWidth(b,u,c,g);const f=(h-1)*o,p=b+s+f;let m=0;for(let d=a;d<a+h;d+=1)m+=i[d]??0;if(p>m){const d=p-m,$=Math.ceil(d/h);for(let w=0;w<h&&a+w<this.#e.columns;w+=1)i[a+w]=Math.max(i[a+w]??0,$)}}}return{growableColumns:r,widths:i}}calculateColumnWidths(t){if(this.#e.fixedColumnWidths&&this.#e.fixedColumnWidths.length===this.#e.columns){const o=this.#e.fixedColumnWidths;if(!o.some(n=>n===void 0||!Number.isFinite(n)))return[...o];if(this.#e.balancedWidths){const n=Array.from({length:o.length}).fill(0),a=typeof this.#e.maxWidth=="number"&&this.#e.maxWidth>0?Math.min(this.#e.maxWidth,this.#t):this.#t,l=this.calculateTotalGridWidth(Array.from({length:n.length}).fill(0)),h=Math.max(0,a-l);let c=0;const u=[];for(const[f,p]of o.entries())typeof p=="number"&&Number.isFinite(p)?(n[f]=p,c+=p):u.push(f);let g=Math.max(0,h-c);const b=u.length>0?Math.floor(g/u.length):0;for(const f of u)n[f]=b;g-=b*u.length;for(const f of u){if(g<=0)break;n[f]+=1,g-=1}return n}}if(this.#e.balancedWidths)return this.calculateBalancedColumnWidths(t);const i=Array.from({length:this.#e.columns}).fill(0),r=this.#e.paddingLeft+this.#e.paddingRight,s=this.#e.gap+(this.#e.showBorders?this.#e.border?.bodyJoin.width??0:0);for(let o=0;o<this.#e.columns;o+=1)for(let n=0;n<t.length;n+=1){const a=t[n]?.[o];if(!a||he(t,n,o,a)!==n||o>0&&t[n]?.[o-1]===a)continue;const l=a.colSpan??1,h=a.maxWidth??Number.POSITIVE_INFINITY,c=String(a.content??"").split($e);let u=0;for(const g of c)u=Math.max(u,Math.min(E(g),h));l===1&&(i[o]=Math.max(i[o]??0,u+r))}for(let o=0;o<t.length;o+=1)for(let n=0;n<this.#e.columns;n+=1){const a=t[o]?.[n];if(!a||he(t,o,n,a)!==o||n>0&&t[o]?.[n-1]===a)continue;const l=a.colSpan??1;if(l>1){const h=a.maxWidth??Number.POSITIVE_INFINITY,c=String(a.content??"").split($e),u=this.#e.wordWrap&&a.wordWrap!==!1;let g=0;for(const d of c)g=Math.max(g,Math.min(E(d),h));g=this.computeWrappedContentWidth(g,c,h,u);let b=0;for(let d=n;d<n+l;d+=1)b+=i[d]??0;const f=l>1?(l-1)*s:0,p=g+r+f,m=b+f;if(p>m){const d=p-m,$=Math.floor(d/l);let w=0;for(let v=0;v<l&&n+v<this.#e.columns;v+=1){const x=Math.min($,d-w);if(i[n+v]=(i[n+v]??0)+x,w+=x,w>=d)break}}}}if(this.#e.maxWidth){const o=this.calculateTotalGridWidth(i);if(o>this.#e.maxWidth)return this.adjustColumnWidthsForTerminal(i,o)}return i}renderVisualRowContent(t,i,r,s,o){const n=t[i];if(!n)return"";const a=this.#e.borderColor??this.#e.foregroundColor??void 0,l=[],h=this.#e.showBorders&&this.#e.border?es(this.#e.border):void 0,c=h&&h.left.width>0?h.left.char:"",u=h&&h.right.width>0?h.right.char:"",g=h&&h.join.width>0?h.join.char:"",b=" ".repeat(this.#e.gap);c&&l.push(S(S(c,a),this.#e.backgroundColor));let f=0;for(;f<this.#e.columns;){const p=n[f]??void 0;let m=1,d;if(p){const $=p.colSpan??1;m=$;const w=he(t,i,f,p),v=Qe(s,f,$),x=this.alignCellContent(p,v),W=x.length,B=this.getCachedCellVerticalPosition(t,i,f,p);B.firstRow!==w&&console.warn(`Mismatch between findFirstOccurrenceRow (${String(w)}) and determineCellVerticalPosition (${String(B.firstRow)})`);const j=o.slice(w,B.lastRow+1).reduce((I,L)=>I+L,0),k=B.lastRow-B.firstRow+1;let T=r,F=0;for(let I=w;I<i;I+=1)I<o.length&&(T+=o[I]??1),I<B.lastRow&&(F+=1);T+=F;const z=p.vAlign??"top";let H;switch(z){case"bottom":{let I=r;for(let _=w;_<i;_+=1)I+=o[_]??1;const L=j-W;H=I>=L?I-L:-1;break}case"middle":{const I=Math.round((j-W)/2);let L=r;for(let _=w;_<i;_+=1)L+=o[_]??1;H=L>=I&&L<I+W?L-I:-1;break}case"top":{H=T;break}default:H=T}const $t=H>=0&&H<W;if(d=" ".repeat(Math.max(0,v)),$t){let I=!1;z==="middle"&&k%2===0&&H===0&&(I=!0),I||(d=x[H]??d)}p.colSpan&&p.colSpan>1&&(d+=b.repeat(p.colSpan)),p.foregroundColor?d=S(d,p.foregroundColor):this.#e.foregroundColor&&(d=S(d,this.#e.foregroundColor)),p.backgroundColor?d=S(d,p.backgroundColor):this.#e.backgroundColor&&(d=S(d,this.#e.backgroundColor))}else{const $=this.#e.paddingLeft+this.#e.paddingRight,w=Math.max(0,(s[f]??0)-$),v=" ".repeat(this.#e.paddingLeft+w+this.#e.paddingRight);d=S(S(r===0?v:" ".repeat(v.length),this.#e.foregroundColor),this.#e.backgroundColor)}l.push(d),f+m<this.#e.columns&&(l.push(b),this.#e.showBorders&&g&&l.push(S(S(g,a),this.#e.backgroundColor)),this.#e.gap>0&&l.push(b)),f+=m}return u&&l.push(S(S(u,a),this.#e.backgroundColor)),l.join("")}alignCellContent(t,i){const r=this.#o.get(t);if(r?.has(i))return r.get(i);const{paddingLeft:s,paddingRight:o}=this.#e,n=s+o,a=i-n;if(a<=0){const u=[" ".repeat(n+this.#e.gap)];return r?r.set(i,u):this.#o.set(t,new Map([[i,u]])),u}let l;const h=String(t.content??"");if(l=h.includes(`
|
|
9
|
-
`)||h.includes("\r")?h.split(
|
|
10
|
-
`)}if(this.#e.truncate&&t.truncate!==!1){const u=typeof this.#e.truncate=="object"?this.#e.truncate:{},g=typeof t.truncate=="object"?t.truncate:u;l=l.map(b=>
|
|
11
|
-
`)}getCachedCellVerticalPosition(t,i,r,s){const o=this.#i.get(s);if(o)return o;const n=It(t,i,r,s);return this.#i.set(s,n),n}}qt(e=>new gt(e),"createGrid");const gs={bodyJoin:{char:"│",width:1},bodyLeft:{char:"│",width:1},bodyRight:{char:"│",width:1},bottomBody:{char:"─",width:1},bottomJoin:{char:"┴",width:1},bottomLeft:{char:"└",width:1},bottomRight:{char:"┘",width:1},joinBody:{char:"─",width:1},joinJoin:{char:"┼",width:1},joinLeft:{char:"├",width:1},joinRight:{char:"┤",width:1},topBody:{char:"─",width:1},topJoin:{char:"┬",width:1},topLeft:{char:"┌",width:1},topRight:{char:"┐",width:1}},qe={bodyJoin:{char:"",width:0},bodyLeft:{char:"",width:0},bodyRight:{char:"",width:0},bottomBody:{char:"",width:0},bottomJoin:{char:"",width:0},bottomLeft:{char:"",width:0},bottomRight:{char:"",width:0},joinBody:{char:"",width:0},joinJoin:{char:"",width:0},joinLeft:{char:"",width:0},joinRight:{char:"",width:0},topBody:{char:"",width:0},topJoin:{char:"",width:0},topLeft:{char:"",width:0},topRight:{char:"",width:0}};var bs=Object.defineProperty,Zi=O((e,t)=>bs(e,"name",{value:t,configurable:!0}),"p$2"),ws=Object.defineProperty,Ut=Zi((e,t)=>ws(e,"name",{value:t,configurable:!0}),"g"),ys=Object.defineProperty,vs=Ut((e,t)=>ys(e,"name",{value:t,configurable:!0}),"u");const $s=vs(e=>e.reduce((t,i)=>i===null?t+1:typeof i=="object"&&!Array.isArray(i)?(i.colSpan??=1,i.colSpan<=0?t+1:t+i.colSpan):t+1,0),"computeRowLogicalWidth");var xs=Object.defineProperty,Qi=Ut((e,t)=>xs(e,"name",{value:t,configurable:!0}),"b");let Ws=class{static{O(this,"H")}static{Zi(this,"$")}static{Ut(this,"Table")}static{Qi(this,"Table")}#e;#n=[];#t=[];#o=[];#i=!0;#r=void 0;constructor(t={}){this.#e={...t,showFooter:t.showFooter??!0,showHeader:t.showHeader??!0,style:{border:gs,paddingLeft:1,paddingRight:1,...t.style}}}setHeaders(t){return t.length>0&&!Array.isArray(t[0])?this.#t=[t]:this.#t=t.map(i=>Array.isArray(i)?i:[i]),this.#i=!0,this.#r=void 0,this}setFooter(t){return t.length>0&&!Array.isArray(t[0])?this.#o=[t]:this.#o=t.map(i=>Array.isArray(i)?i:[i]),this.#i=!0,this.#r=void 0,this}addRow(t){if(!Array.isArray(t))throw new TypeError("Row must be an array");return this.#n.push(t),this.#i=!0,this.#r=void 0,this}addRows(...t){for(const i of t)this.addRow(i);return this.#i=!0,this.#r=void 0,this}toString(){if(!this.#i&&this.#r!==void 0)return this.#r;const t=this.#e.showHeader?this.#t:[],i=this.#e.showFooter?this.#o:[],r=[...t,...this.#n,...i];if(r.length===0)return this.#r="",this.#i=!1,"";let s=0;for(const u of r){const g=u;Array.isArray(g)?s=Math.max(s,$s(g)):console.error("Unexpected non-array element found while calculating columns:",g)}if(s===0)return this.#r="",this.#i=!1,"";let o;Array.isArray(this.#e.columnWidths)?o=this.#e.columnWidths.length>=s?this.#e.columnWidths.slice(0,s):[...this.#e.columnWidths,...Array.from({length:s-this.#e.columnWidths.length}).fill(void 0)]:typeof this.#e.columnWidths=="number"&&(o=Array.from({length:s}).fill(this.#e.columnWidths));let n;const a=r.length;if(Array.isArray(this.#e.rowHeights)?n=this.#e.rowHeights:typeof this.#e.rowHeights=="number"&&(n=Array.from({length:a}).fill(this.#e.rowHeights)),o&&Array.isArray(o)){const u=[...o];for(const g of r){const b=g;for(const[f,p]of b.entries()){let m={};if(typeof p=="object"&&p!==null&&!Array.isArray(p)){const{content:d,href:$,...w}=p;m=w}m.width!==void 0?u[f]=m.width:m.maxWidth!==void 0&&u[f]!==void 0&&(u[f]=Math.min(u[f],m.maxWidth))}}o=u}const l={autoFlow:"row",backgroundColor:this.#e.style?.backgroundColor,balancedWidths:this.#e.balancedWidths??!1,border:this.#e.style?.border,borderColor:this.#e.style?.borderColor,columns:s,fixedColumnWidths:o,fixedRowHeights:n,foregroundColor:this.#e.style?.foregroundColor,gap:this.#e.gap??0,maxWidth:this.#e.maxWidth,paddingLeft:this.#e.style?.paddingLeft,paddingRight:this.#e.style?.paddingRight,terminalWidth:this.#e.terminalWidth,truncate:this.#e.truncate??(o?.every(u=>typeof u=="number")||this.#e.maxWidth!==void 0&&!this.#e.balancedWidths),truncateOverflow:this.#e.truncateOverflow??!0,wordWrap:this.#e.wordWrap??!1},h=new gt(l),c=[];for(const[u,g]of r.entries()){const b=g;if(!Array.isArray(b)){console.error("Skipping non-array row while creating GridItems:",b);continue}const f=this.#e.showHeader?this.#t.length:0,p=this.#n.length,m=this.#e.showHeader&&u<f,d=this.#e.showFooter&&u>=f+p,$=m&&b.length===1&&s>1,w=d&&b.length===1&&s>1;for(const v of b){let x=v,W={};if(typeof x=="object"&&x!==null&&!Array.isArray(x)){const{content:T,href:F,...z}=x;x=F?`\x1B]8;;${F}\x1B\\${String(T)}\x1B]8;;\x1B\\`:T,W=z}$&&(W.colSpan=s),w&&(W.colSpan=s);const B=this.#e.transformTabToSpace&&typeof x=="string"?x.replaceAll(" "," ".repeat(this.#e.transformTabToSpace)):x,{maxWidth:j,width:k}=W;c.push({backgroundColor:W.backgroundColor,colSpan:W.colSpan,content:B,foregroundColor:W.foregroundColor,hAlign:W.hAlign,maxWidth:j,rowSpan:W.rowSpan,truncate:W.truncate??(j===void 0?void 0:!0),vAlign:W.vAlign,width:k,wordWrap:W.wordWrap})}}return h.addItems(c),this.#r=h.toString(),this.#i=!1,this.#r}};const Ue=Qi(e=>new Ws(e),"createTable");var Os=Object.defineProperty,Z=O((e,t)=>Os(e,"name",{value:t,configurable:!0}),"n");const Xi=80,er=24,Nt=Z((e,t,{shell:i,env:r}={})=>vr(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:i,env:r}).trim(),"exec"),De=Z((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),tr=Z((e,t)=>{const{columns:i,rows:r}=De(e,t);if(!(Number.isNaN(i)||Number.isNaN(r))&&!(i===Xi&&r===er))return{columns:i,rows:r}},"createIfNotDefault"),Bs=Z(()=>{if(X.platform!=="linux")return!0;try{const e=Oe.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const i=e.slice(t+2).trim().split(/\s+/),r=Number.parseInt(i[2],10),s=Number.parseInt(i[5],10);return Number.isNaN(r)||Number.isNaN(s)||s<=0?!1:r===s}catch{return!1}},"isForegroundProcess");function ir(){const{env:e,stdout:t,stderr:i}=X;if(t?.columns&&t?.rows)return De(t.columns,t.rows);if(i?.columns&&i?.rows)return De(i.columns,i.rows);if(e.COLUMNS&&e.LINES)return De(e.COLUMNS,e.LINES);const r={columns:Xi,rows:er};return X.platform==="win32"?St()??r:X.platform==="darwin"?fi()??St()??r:fi()??St()??Ss()??r}O(ir,"O$4");Z(ir,"terminalSize");const fi=Z(()=>{try{const e=X.platform==="darwin"?Oe.constants.O_EVTONLY|Oe.constants.O_NONBLOCK:Oe.constants.O_NONBLOCK,{columns:t,rows:i}=$r.WriteStream(Oe.openSync("/dev/tty",e));return{columns:t,rows:i}}catch{}},"devTty"),St=Z(()=>{try{const e=Nt("tput",["cols"],{env:{TERM:"dumb",...X.env}}),t=Nt("tput",["lines"],{env:{TERM:"dumb",...X.env}});if(e&&t)return tr(e,t)}catch{}},"tput"),Ss=Z(()=>{try{if(!Bs())return;const e=Nt("resize",["-u"]).match(/\d+/g);if(e.length===2)return tr(e[0],e[1])}catch{}},"resize");var As=Object.defineProperty,js=O((e,t)=>As(e,"name",{value:t,configurable:!0}),"b$5"),Is=Object.defineProperty,Cs=js((e,t)=>Is(e,"name",{value:t,configurable:!0}),"s"),Ns=Object.defineProperty,Es=Cs((e,t)=>Ns(e,"name",{value:t,configurable:!0}),"a");const ks=/([a-f\d]{3,6})/i,Et=Es(e=>{let[,t]=ks.exec(e)??[];const i=t?t.length:0;if(i===3){const s=t.charAt(0),o=t.charAt(1),n=t.charAt(2);t=s+s+o+o+n+n}else if(i!==6)return[0,0,0];const r=Number.parseInt(t,16);return[r>>16&255,r>>8&255,r&255]},"convertHexToRgb");var Ps=Object.defineProperty,Rs=O((e,t)=>Ps(e,"name",{value:t,configurable:!0}),"o$1"),Ms=Object.defineProperty,Ts=Rs((e,t)=>Ms(e,"name",{value:t,configurable:!0}),"s"),Fs=Object.defineProperty,Dt=Ts((e,t)=>Fs(e,"name",{value:t,configurable:!0}),"e");const rr=Dt((e,t,i)=>e===t&&t===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/51)+6*Math.round(t/51)+Math.round(i/51),"rgbToAnsi256"),kt=Dt(e=>{let t,i,r;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)t=i=r=((e-232)*10+8)/255;else{e-=16;const n=e%36;t=Math.floor(e/36)/5,i=Math.floor(n/6)/5,r=n%6/5}const s=Math.max(t,i,r)*2;if(s===0)return 30;const o=30+(Math.round(r)<<2|Math.round(i)<<1|Math.round(t));return s===2?o+60:o},"ansi256To16"),mi=Dt((e,t,i)=>kt(rr(e,t,i)),"rgbToAnsi16");var Ls=Object.defineProperty,nr=O((e,t)=>Ls(e,"name",{value:t,configurable:!0}),"m"),_s=Object.defineProperty,ye=nr((e,t)=>_s(e,"name",{value:t,configurable:!0}),"u"),Hs=Object.defineProperty,Gs=ye((e,t)=>Hs(e,"name",{value:t,configurable:!0}),"e");function bt({onlyFirst:e=!1}={}){const t="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(t,e?void 0:"g")}O(bt,"$$3");nr(bt,"j");ye(bt,"t$1");Gs(bt,"ansiRegex");var Vs=Object.defineProperty,Js=ye((e,t)=>Vs(e,"name",{value:t,configurable:!0}),"n$1");const U=Js((e,t,i)=>t>e?t:Math.min(e,i),"clamp");var zs=Object.defineProperty,M=ye((e,t)=>zs(e,"name",{value:t,configurable:!0}),"b");const C=39,N=49,pi=10,Pt=br(),or={close:"",open:""},y=Pt>0?(e,t)=>({close:`\x1B[${String(t)}m`,open:`\x1B[${String(e)}m`}):()=>or,gi=M(e=>(t,i,r)=>e(rr(Number(t),Number(i),Number(r))),"createRgbFunction"),bi=M(e=>t=>{const[i,r,s]=Et(t);return e(i,r,s)},"createHexFunction");let Rt=M(e=>y(`38;5;${String(e)}`,C),"createAnsi256"),Mt=M(e=>y(`48;5;${String(e)}`,N),"createBgAnsi256"),Xe=M((e,t,i)=>y(`38;2;${String(e)};${String(t)};${String(i)}`,C),"createRgb"),et=M((e,t,i)=>y(`48;2;${String(e)};${String(t)};${String(i)}`,N),"createBgRgb");Pt===1?(Rt=M(e=>y(kt(Number(e)),C),"createAnsi256"),Mt=M(e=>y(kt(Number(e))+pi,N),"createBgAnsi256"),Xe=M((e,t,i)=>y(mi(Number(e),Number(t),Number(i)),C),"createRgb"),et=M((e,t,i)=>y(mi(Number(e),Number(t),Number(i))+pi,N),"createBgRgb")):Pt===2&&(Xe=gi(Rt),et=gi(Mt));const wi={bold:y(1,22),dim:y(2,22),hidden:y(8,28),inverse:y(7,27),italic:y(3,23),overline:y(53,55),reset:y(0,0),strike:y(9,29),strikethrough:y(9,29),underline:y(4,24),visible:or},yi={bgBlack:y(40,N),bgBlackBright:y(100,N),bgBlue:y(44,N),bgBlueBright:y(104,N),bgCyan:y(46,N),bgCyanBright:y(106,N),bgGray:y(100,N),bgGreen:y(42,N),bgGreenBright:y(102,N),bgGrey:y(100,N),bgMagenta:y(45,N),bgMagentaBright:y(105,N),bgRed:y(41,N),bgRedBright:y(101,N),bgWhite:y(47,N),bgWhiteBright:y(107,N),bgYellow:y(43,N),bgYellowBright:y(103,N),black:y(30,C),blackBright:y(90,C),blue:y(34,C),blueBright:y(94,C),cyan:y(36,C),cyanBright:y(96,C),gray:y(90,C),green:y(32,C),greenBright:y(92,C),grey:y(90,C),magenta:y(35,C),magentaBright:y(95,C),red:y(31,C),redBright:y(91,C),white:y(37,C),whiteBright:y(97,C),yellow:y(33,C),yellowBright:y(93,C)},vi={bg:M(e=>Mt(U(e,0,255)),"bg"),bgHex:bi(et),bgRgb:M((e,t,i)=>et(U(e,0,255),U(t,0,255),U(i,0,255)),"bgRgb"),fg:M(e=>Rt(U(e,0,255)),"fg"),hex:bi(Xe),rgb:M((e,t,i)=>Xe(U(e,0,255),U(t,0,255),U(i,0,255)),"rgb")};var qs=Object.defineProperty,Us=ye((e,t)=>qs(e,"name",{value:t,configurable:!0}),"s");const Ds=Us((e,t,i)=>{if(t==="")return e;let r=e.indexOf(t);if(r<0)return e;const s=t.length;let o=0,n="";for(;~r;)n+=e.slice(o,r)+i,o=r+s,r=e.indexOf(t,o);return n+e.slice(o)},"stringReplaceAll");var Ys=Object.defineProperty,Se=ye((e,t)=>Ys(e,"name",{value:t,configurable:!0}),"a");const D={};let Tt=null;const Ks=Se((e,t,i)=>{if(!e)return"";let r;if(e.raw===void 0?r=String(e):r=String.raw(e,...t),r.includes("\x1B"))for(let s=i;s;s=s.props)r=Ds(r,s.close,s.open);return r.includes(`
|
|
12
|
-
`)&&(r=r.replace(/(\r*\n)/g,`${i.closeStack}$1${i.openStack}`)),i.openStack+r+i.closeStack},"wrapText"),
|
|
13
|
-
`],["r","\r"],["t"," "],["v","\v"]]),ar=na(e=>{const t=e.startsWith("u"),i=e[1]==="{";return t&&!i&&e.length===5||e.startsWith("x")&&e.length===3?String.fromCodePoint(Number.parseInt(e.slice(1),16)):t&&i?String.fromCodePoint(Number.parseInt(e.slice(2,-1),16)):oa.get(e)??e},"unescape");var sa=Object.defineProperty,yt=wt((e,t)=>sa(e,"name",{value:t,configurable:!0}),"u");const aa=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|\{(~)?(#?[\w:]+(?:\([^)]*\))?(?:\.#?[\w:]+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n))|(\})|((?:.|[\r\n\f])+?)/gi,$i=/(?:^|\.)(?:(\w+)(?:\(([^)]*)\))?|#(?=[:a-f\d]{2,})([a-f\d]{6})?(?::([a-f\d]{6}))?)/gi,la=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,ca=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,ha=/\s*,\s*/,ua=yt((e,t)=>{const i=[],r=t.trim().split(ha);let s;for(const o of r){const n=Number(o);if(!Number.isNaN(n))i.push(n);else if(s=la.exec(o))i.push(s[2].replaceAll(ca,(a,l,h)=>l?ar(l):h));else throw new Error(`Invalid template style argument: ${o} (in style '${e}')`)}return i},"parseArguments"),da=yt(e=>{$i.lastIndex=0;const t=[];let i;for(;(i=$i.exec(e))!==null;){const r=i[1];i[2]?t.push([r,...ua(r,i[2])]):i[3]||i[4]?(i[3]&&t.push(["rgb",...Et(i[3])]),i[4]&&t.push(["bgRgb",...Et(i[4])])):t.push([r])}return t},"parseStyle"),xi=yt((e,t)=>{const i={};for(const s of t)for(const o of s.styles)i[o[0]]=s.inverse?void 0:o.slice(1);let r=e;for(const[s,o]of Object.entries(i))if(Array.isArray(o)){if(!(s in r))throw new Error(`Unknown style: ${s}`);r=o.length>0?r[s](...o):r[s]}return r},"buildStyle"),lr=yt(e=>t=>{const i=[],r=[];let s=[];if(t.replaceAll(aa,(o,n,a,l,h,c)=>{if(n)s.push(ar(n));else if(l){const u=s.join("");s=[],r.push(i.length===0?u:xi(e,i)(u)),i.push({inverse:a,styles:da(l)})}else if(h){if(i.length===0)throw new Error("Found extraneous } in template literal");r.push(xi(e,i)(s.join(""))),s=[],i.pop()}else s.push(c)}),r.push(s.join("")),i.length>0)throw new Error(`template literal is missing ${String(i.length)} closing bracket${i.length===1?"":"s"} (\`}\`)`);return r.join("")},"makeTemplate");var fa=Object.defineProperty,ma=wt((e,t)=>fa(e,"name",{value:t,configurable:!0}),"e");const pa=new Zs;ma(e=>sr(lr(e)),"makeTaggedTemplate");const ga=lr(pa),ba=sr(ga);var wa=Object.defineProperty,vt=O((e,t)=>wa(e,"name",{value:t,configurable:!0}),"f"),ya=Object.defineProperty,J=vt((e,t)=>ya(e,"name",{value:t,configurable:!0}),"l");const va=Si(import.meta.url),xe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$a=J(e=>{if(typeof xe<"u"&&xe.versions&&xe.versions.node){const[t,i]=xe.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return xe.getBuiltinModule(e)}return va(e)},"__cjs_getBuiltinModule"),xa=$a("node:os");var Wa=Object.defineProperty,Oa=J((e,t)=>Wa(e,"name",{value:t,configurable:!0}),"s");const We=new Map,Ba=500,P=Oa(e=>{if(!e||e==="")return"";const t=We.get(e);if(t!==void 0)return t;const i=ba(Object.assign([],{raw:[e]}));if(We.size>=Ba){const r=We.keys().next().value;r!==void 0&&We.delete(r)}return We.set(e,i),i},"templateFormat");var Sa=Object.defineProperty,Aa=J((e,t)=>Sa(e,"name",{value:t,configurable:!0}),"t$1");const Ye=Aa(()=>{const e=yr().CEREBRO_TERMINAL_WIDTH;if(e===void 0)return;const t=Number.parseInt(e,10);if(!(Number.isNaN(t)||t<=0))return t},"getTerminalWidth");var ja=Object.defineProperty,Ia=J((e,t)=>ja(e,"name",{value:t,configurable:!0}),"t");let cr=class{static{O(this,"O")}static{vt(this,"w")}static{J(this,"n")}static{Ia(this,"BaseSection")}lines;constructor(){this.lines=[]}add(t){this.lines.push(t)}toString(){return this.lines.join(xa.EOL)}header(t){this.add(wr(t)),this.lines.push("")}};var Ca=Object.defineProperty,tt=J((e,t)=>Ca(e,"name",{value:t,configurable:!0}),"g");const Na=tt(e=>e!==void 0&&e>0?e:ir().columns,"resolveTerminalWidth"),Ea=tt((e,t,i,r)=>{if(e.length===0||e.some(h=>h.length!==2))return;let s=0;for(const h of e){const c=h[0];if(c===void 0)continue;const u=sn(c);u>s&&(s=u)}if(s===0)return;const o=i+r,n=s+o,a=20+o;if(n+a>t)return;const l=t-n;return[n,l]},"computeColumnWidths");class ka extends cr{static{O(this,"J")}static{vt(this,"z")}static{J(this,"S")}static{tt(this,"ContentSection")}constructor(t){if(super(),t.header&&this.header(P(t.header)),t.content){if(t.raw)if(Array.isArray(t.content)&&t.content.every(i=>typeof i=="string"))t.content.forEach(i=>{Array.isArray(i)?i.forEach(r=>{this.add(P(r))}):this.add(P(i))});else if(typeof t.content=="string")this.add(P(t.content));else throw new TypeError("Invalid raw content, must be a string or array of strings.");else this.add(this.getContentLines(t.content));this.add("")}}getContentLines(t){if(typeof t=="string"){const i=Ue({showHeader:!1,style:{border:qe,paddingLeft:4,paddingRight:1},terminalWidth:Ye(),truncateOverflow:!1,wordWrap:!0});return i.addRow([P(t)]),i.toString()}if(Array.isArray(t)&&t.every(i=>typeof i=="string"||Array.isArray(i)&&i.every(r=>typeof r=="string"))){const i=Na(Ye()),r=tt(a=>Array.isArray(a)?a.map(l=>P(l)):[P(a)],"formatRow"),s=t.map(a=>r(a)),o=Ea(s,i,4,1),n=Ue({columnWidths:o,showHeader:!1,style:{border:qe,paddingLeft:4,paddingRight:1},terminalWidth:i,truncateOverflow:!1,wordWrap:!0});return s.forEach(a=>{o!==void 0&&a.length===2?n.addRow([{content:a[0],wordWrap:!1},a[1]]):n.addRow(a)}),n.toString()}if(typeof t=="object"){const i=t;if(!i.options||!i.data)throw new Error(`Must have an "options" or "data" property
|
|
14
|
-
${JSON.stringify(t)}`);const r=
|
|
6
|
+
`);return i&&(n=n.replaceAll(ln,"")),n.split(`
|
|
7
|
+
`).map(a=>{if(r&&a.trim()==="")return"";let l;switch(o){case Je.BREAK_AT_CHARACTERS:{l=lo(a,s,r);break}case Je.BREAK_WORDS:{l=ho(a,s,r);break}case Je.STRICT_WIDTH:{l=Hi(a,s,r);break}default:l=co(a,s,r)}return so(l)}).join(`
|
|
8
|
+
`)},"wordWrap");var fo=Object.defineProperty,Z=A((e,t)=>fo(e,"name",{value:t,configurable:!0}),"n$3");const Gi=80,Vi=24,At=Z((e,t,{shell:i,env:r}={})=>Sr(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:i,env:r}).trim(),"exec"),Ue=Z((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),Ji=Z((e,t)=>{const{columns:i,rows:r}=Ue(e,t);if(!(Number.isNaN(i)||Number.isNaN(r))&&!(i===Gi&&r===Vi))return{columns:i,rows:r}},"createIfNotDefault"),mo=Z(()=>{if(te.platform!=="linux")return!0;try{const e=Ce.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const i=e.slice(t+2).trim().split(/\s+/),r=Number.parseInt(i[2],10),s=Number.parseInt(i[5],10);return Number.isNaN(r)||Number.isNaN(s)||s<=0?!1:r===s}catch{return!1}},"isForegroundProcess");function ft(){const{env:e,stdout:t,stderr:i}=te;if(t?.columns&&t?.rows)return Ue(t.columns,t.rows);if(i?.columns&&i?.rows)return Ue(i.columns,i.rows);if(e.COLUMNS&&e.LINES)return Ue(e.COLUMNS,e.LINES);const r={columns:Gi,rows:Vi};return te.platform==="win32"?Bt()??r:te.platform==="darwin"?ai()??Bt()??r:ai()??Bt()??po()??r}O(ft,"Tt$1");J(ft,"bt");A(ft,"O");Z(ft,"terminalSize");const ai=Z(()=>{try{const e=te.platform==="darwin"?Ce.constants.O_EVTONLY|Ce.constants.O_NONBLOCK:Ce.constants.O_NONBLOCK,{columns:t,rows:i}=Ar.WriteStream(Ce.openSync("/dev/tty",e));return{columns:t,rows:i}}catch{}},"devTty"),Bt=Z(()=>{try{const e=At("tput",["cols"],{env:{TERM:"dumb",...te.env}}),t=At("tput",["lines"],{env:{TERM:"dumb",...te.env}});if(e&&t)return Ji(e,t)}catch{}},"tput"),po=Z(()=>{try{if(!mo())return;const e=At("resize",["-u"]).match(/\d+/g);if(e.length===2)return Ji(e[0],e[1])}catch{}},"resize");var go=Object.defineProperty,zi=A((e,t)=>go(e,"name",{value:t,configurable:!0}),"e");const de=zi((e,t)=>{switch(t){case"bottom":return{body:e.bottomBody,join:e.bottomJoin,left:e.bottomLeft,right:e.bottomRight};case"middle":return{body:e.joinBody,join:e.joinJoin,left:e.joinLeft,right:e.joinRight};case"top":return{body:e.topBody,join:e.topJoin,left:e.topLeft,right:e.topRight};default:throw new Error(`Invalid borderType: ${String(t)}`)}},"getHorizontalBorderChars"),bo=zi(e=>({join:e.bodyJoin,left:e.bodyLeft,right:e.bodyRight}),"getVerticalBorderChars");var wo=Object.defineProperty,yo=A((e,t)=>wo(e,"name",{value:t,configurable:!0}),"n$1");const it=yo((e,t,i)=>{let r=0;for(let s=0;s<i;s+=1)r+=e[t+s]??0;return i>1&&(r+=i-1),r},"calculateCellTotalWidth");var vo=Object.defineProperty,xo=A((e,t)=>vo(e,"name",{value:t,configurable:!0}),"a");const jt=xo((e,t,i,r)=>{let s=t;for(;s>0&&e[s-1]?.[i]===r;)s-=1;let o=t;for(;o<e.length-1&&e[o+1]?.[i]===r;)o+=1;let n;const a=o-s+1;if(a===1)n=!0;else switch(r.vAlign){case"bottom":{n=t===o;break}case"middle":{const l=s+Math.floor(a/2);n=t===l;break}case"top":{n=t===s;break}default:n=t===s}return{firstRow:s,lastRow:o,showContent:n}},"determineCellVerticalPosition");var $o=Object.defineProperty,Wo=A((e,t)=>$o(e,"name",{value:t,configurable:!0}),"F");const Oo=Wo((e,t,i,r,s)=>{if(e.length===0)return[];let o=e.length-1;for(let l=0;l<e.length;l+=1){const h=e[l];if(h){for(const[c,u]of h.entries())if(u&&s(e,l,c,u)===l){const g=jt(e,l,c,u);o=Math.max(o,g.lastRow)}}}const n=Array.from({length:o+1}).fill(1);for(let l=0;l<e.length;l+=1){const h=e[l];if(h)for(let c=0;c<i.columns;c+=1){const u=h[c];if(u&&s(e,l,c,u)===l&&(u.rowSpan??1)===1){const g=u.colSpan??1,b=it(t,c,g),f=r(u,b).length;n[l]=Math.max(n[l]??1,f)}}}const a=Array.from({length:n.length}).fill(!1);if(i.fixedRowHeights)for(let l=0;l<n.length;l+=1){let h;i.fixedRowHeights[l]!==void 0?h=i.fixedRowHeights[l]:i.fixedRowHeights.length===1&&i.fixedRowHeights[0]!==void 0&&(h=i.fixedRowHeights[0]),h!==void 0&&(n[l]=Math.max(1,h),a[l]=!0)}for(let l=0;l<e.length;l+=1){const h=e[l];if(h)for(let c=0;c<i.columns;c+=1){const u=h[c];if(u&&s(e,l,c,u)===l&&(u.rowSpan??1)>1){const g=u.colSpan??1,b=it(t,c,g),f=r(u,b).length-1,p=jt(e,l,c,u),{firstRow:m,lastRow:d}=p;let x=0,w=0;for(let $=m;$<=d&&$<n.length;$+=1)x+=n[$]??1,a[$]||(w+=1);const v=f-x;if(v>0)if(w>0){const $=Math.ceil(v/w);let W=0;for(let B=m;B<=d&&B<n.length;B+=1)if(!a[B]){const j=Math.min($,v-W);if(n[B]=(n[B]??1)+j,W+=j,W>=v)break}}else console.warn(`[calculateRowHeights] Content of spanning cell exceeds fixed height allocated. Cell: ${JSON.stringify(u.content)}, Required: ${String(f)}, Allocated: ${String(x)} (fixed).`)}}}return n},"calculateRowHeights");var Bo=Object.defineProperty,So=A((e,t)=>Bo(e,"name",{value:t,configurable:!0}),"i");const fe=So((e,t,i,r)=>{let s=t;for(;s>0&&e[s-1]?.[i]===r;)s-=1;return s},"findFirstOccurrenceRow");var Ao=Object.defineProperty,jo=A((e,t)=>Ao(e,"name",{value:t,configurable:!0}),"n");const It="__EMPTY__",li=jo(e=>{if(typeof e=="string")return{content:e};if(typeof e=="number"||typeof e=="bigint"||typeof e=="boolean")return{content:String(e)};if(e==null)return{content:It};if(typeof e=="object"&&"content"in e){let{content:t}=e;if(typeof t=="number"||typeof t=="bigint"||typeof t=="boolean")t=String(t);else if(t==null)t=It;else if(typeof t!="string")throw new TypeError(`Invalid item type in grid cell: expected string, number, null, undefined, or GridItem object, but received ${JSON.stringify(e)} (type: ${typeof e})`);return{...e,content:t}}throw new TypeError(`Invalid item type in grid cell: expected string, number, null, undefined, or GridItem object, but received ${JSON.stringify(e)} (type: ${typeof e})`)},"normalizeGridCell");var Io=Object.defineProperty,Co=A((e,t)=>Io(e,"name",{value:t,configurable:!0}),"p");const No=Co((e,t,i,r,s)=>{const o=E(e),n=" ".repeat(Math.max(0,r)),a=" ".repeat(Math.max(0,s));if(o===0)return n+" ".repeat(Math.max(0,t))+a;const l=Math.max(0,t-o);switch(i){case"center":{const h=Math.floor(l/2),c=l-h;return n+" ".repeat(h)+e+" ".repeat(c)+a}case"right":return n+" ".repeat(l)+e+a;default:return n+e+" ".repeat(l)+a}},"padAndAlignContent");var Eo=Object.defineProperty,Vt=A((e,t)=>Eo(e,"name",{value:t,configurable:!0}),"H");const Se=/\r?\n/,ci=/\s+/,S=Vt((e,t)=>!e||!t?e:typeof t=="function"?t(e):t.open+e+t.close,"applyColor");let qi=class Di{static{O(this,"It")}static{J(this,"Te")}static{A(this,"Grid")}static{Vt(this,"Grid")}#e;#n=[];#t;#o=new WeakMap;#i=new WeakMap;static createGridLayout(){return[]}constructor(t){const i={autoColumns:1,autoFlow:"row",autoRows:1,balancedWidths:!1,gap:0,paddingLeft:1,paddingRight:1,rows:0,showBorders:t.border!==void 0,truncate:!1,truncateOverflow:!0,wordWrap:!1};let r;Array.isArray(t.fixedRowHeights)?r=t.fixedRowHeights:typeof t.fixedRowHeights=="number"&&(r=[t.fixedRowHeights]),this.#e={...i,...t,columns:t.columns,fixedRowHeights:r,showBorders:t.border!==void 0||(t.showBorders??!1)};let{terminalWidth:s}=this.#e;if(s===void 0){const{columns:o}=ft();s=o}this.#t=s,this.#e.maxWidth&&(this.#e.maxWidth=Math.min(this.#e.maxWidth,this.#t))}addItem(t){return this.#n.push(li(t)),this}addItems(t){return this.#n.push(...t.map(i=>li(i))),this}setColumns(t){return this.#e.columns=t,this}setRows(t){return this.#e.rows=t,this}setBorder(t){return this.#e.border=t,this}setShowBorders(t){return this.#e.showBorders=t,this}setMaxWidth(t){return this.#e.maxWidth=t,this}toString(){const t=Di.createGridLayout();if(this.placeItems(t),t.length===0||t[0]?.length===0)return"";let i=this.calculateColumnWidths(t);const r=this.calculateTotalGridWidth(i),s=typeof this.#e.maxWidth=="number"&&this.#e.maxWidth>0?Math.min(this.#e.maxWidth,this.#t):this.#t;return r>s&&(i=this.adjustColumnWidthsForTerminal(i,r)),this.renderGrid(t,i)}placeItems(t){let i=0,r=0;const s=this.#e.rows>0?this.#e.rows:Number.POSITIVE_INFINITY;for(let o=0;o<this.#n.length;o+=1){const n=this.#n[o];if(n.content===It&&!(n.rowSpan&&n.rowSpan>1)&&!(n.colSpan&&n.colSpan>1)){if(this.#e.autoFlow==="row")r+=1,r>=this.#e.columns&&(r=0,i+=1);else{i+=1;const f=t.length>0?t.length:s;i>=f&&f!==Number.POSITIVE_INFINITY?(i=0,r+=1):t.length===0&&f===Number.POSITIVE_INFINITY&&(r+=1)}continue}const a=n.colSpan??1,l=n.rowSpan??1;let h=!1,c=i,u=r,g=0;const b=(t.length+l+5)*this.#e.columns;for(;!h&&c<s&&g<b;){for(g+=1;c+l>t.length;)t.push(Array.from({length:this.#e.columns}).fill(void 0));if(this.canPlaceItem(t,c,u,a,l))if(this.placeItem(t,c,u,n),h=!0,this.#e.autoFlow==="row")r=u+a,i=c,r>=this.#e.columns&&(r=0,i+=1);else{i=c+l,r=u;const f=t.length>0?t.length:s;i>=f&&(i=0,r+=1)}else if(this.#e.autoFlow==="row")u+=1,u>=this.#e.columns&&(u=0,c+=1);else{for(c+=1;c+l>t.length;)t.push(Array.from({length:this.#e.columns}).fill(void 0));const f=t.length>0?t.length:s;if(c>=f&&(c=0,u+=1,u>=this.#e.columns))break}}if(!h)if(console.warn(`@visulima/tabular: Could not find position for item: ${JSON.stringify(n)} after ${String(g)} attempts. Grid might be too small or layout impossible.`),this.#e.autoFlow==="row")r+=1,r>=this.#e.columns&&(r=0,i+=1);else{i+=1;const f=t.length>0?t.length:s;i>=f&&(i=0,r+=1)}if(g>=b)break}if(this.#e.rows===0)for(;t.length>0&&t.at(-1)?.every(o=>o===void 0);)t.pop()}canPlaceItem(t,i,r,s,o,n=!1){if(r+s>this.#e.columns)return!1;for(let a=i;a<i+o;a+=1)if(a<t.length){if(!t[a])return console.warn(`Grid layout unexpectedly missing row ${String(a)} during canPlaceItem check.`),!1;for(let l=r;l<r+s;l+=1)if(t[a]?.[l]!==void 0)return!1}else if(!n)return!1;return!0}computeWrappedContentWidth(t,i,r,s){let o=t;if(s){if(o>20){let n=0;for(const a of i){const l=a.split(ci);for(const h of l)n=Math.max(n,Math.min(E(h),r))}o=Math.min(o,Math.max(n+4,12))}}else{let n=0;for(const a of i){const l=a.split(ci);for(const h of l)n=Math.max(n,Math.min(E(h),r))}o=Math.min(o,Math.max(n+12,20))}return o}placeItem(t,i,r,s){const o=s.rowSpan??1,n=s.colSpan??1;for(let a=i;a<i+o;a+=1){for(;a>=t.length;)t.push(Array.from({length:this.#e.columns}).fill(void 0));for(let l=r;l<r+n;l+=1)l<this.#e.columns&&(t[a]||(console.error(`Logic error: Row ${String(a)} not found in placeItem despite check.`),t[a]=Array.from({length:this.#e.columns}).fill(void 0)),t[a][l]=s)}}calculateTotalGridWidth(t){let i=0;const r=this.#e.showBorders?this.#e.border:void 0;r&&(i+=r.bodyLeft.width,i+=r.bodyRight.width);const s=t.length,o=this.#e.showBorders?r?.bodyJoin.width??0:0,n=this.#e.gap;for(let a=0;a<s;a+=1)i+=t[a]??0,a<s-1&&(i+=n,i+=o);return i}adjustColumnWidthsForTerminal(t,i){const r=typeof this.#e.maxWidth=="number"&&this.#e.maxWidth>0?Math.min(this.#e.maxWidth??0,this.#t):this.#t;if(i<=r)return t;let s=0;const o=t.length,n=this.#e.showBorders?this.#e.border:void 0;if(n&&(s+=n.bodyLeft.width,s+=n.bodyRight.width),o>1){s+=(o-1)*this.#e.gap;const u=n?.bodyJoin.width??0;s+=(o-1)*u}if(s>=r)return Array.from({length:o}).fill(1);const a=r-s,l=t.reduce((u,g)=>u+g,0);if(l===0){const u=Math.floor(a/o);return Array.from({length:o}).fill(u)}const h=t.map(u=>{const g=u/l;return Math.max(1,Math.floor(a*g))});let c=a-h.reduce((u,g)=>u+g,0);if(c>0){const u=h.map((g,b)=>{const f=l>0?(t[b]??0)/l:1/o;return{index:b,remainder:a*f%1}}).toSorted((g,b)=>b.remainder-g.remainder);for(const g of u){if(c<=0)break;const{index:b}=g;h[b]!==void 0&&(h[b]+=1,c-=1)}}return h}calculateBalancedColumnWidths(t){const i=this.calculateMinimumColumnWidthsWithGrowableInfo(t),r=i.widths,{growableColumns:s}=i,o=typeof this.#e.maxWidth=="number"&&this.#e.maxWidth>0?Math.min(this.#e.maxWidth,this.#t):this.#t,n=this.#e.showBorders?this.#e.border:void 0;let a=0;if(n&&(a+=n.bodyLeft.width,a+=n.bodyRight.width),this.#e.columns>1){a+=(this.#e.columns-1)*this.#e.gap;const c=n?.bodyJoin.width??0;a+=(this.#e.columns-1)*c}const l=Math.max(0,o-a);if(r.reduce((c,u)=>c+u,0)>0){const c=Math.floor(l/this.#e.columns),u=Array.from({length:this.#e.columns}).fill(c),g=c*this.#e.columns;let b=l-g;for(let d=0;d<u.length&&b>0;d+=1)u[d]=(u[d]??0)+1,b-=1;const f=[];let p=0;for(let d=0;d<this.#e.columns;d+=1){const x=u[d]??0,w=r[d]??0,v=Math.max(x,w);f.push(v),p+=v}if(p>l){const d=l/p,x=f.map($=>Math.max(3,Math.floor($*d))),w=x.reduce(($,W)=>$+W,0);let v=l-w;for(let $=0;$<x.length&&v>0;$+=1)x[$]=(x[$]??0)+1,v-=1;return x}let m=l-p;if(m>0){const d=s.length>0?s:f.map((x,w)=>w);for(;m>0&&d.length>0;)for(const x of d){if(m<=0)break;f[x]=(f[x]??0)+1,m-=1}}return f}const h=Math.floor(l/this.#e.columns);return Array.from({length:this.#e.columns}).fill(h)}calculateMinimumColumnWidthsWithGrowableInfo(t){const i=Array.from({length:this.#e.columns}).fill(0),r=[],s=this.#e.paddingLeft+this.#e.paddingRight,o=this.#e.gap+(this.#e.showBorders?this.#e.border?.bodyJoin.width??0:0);for(let n=0;n<this.#e.columns;n+=1)for(let a=0;a<t.length;a+=1){const l=t[a]?.[n];if(!l||fe(t,a,n,l)!==a||n>0&&t[a]?.[n-1]===l)continue;const h=l.colSpan??1,c=l.maxWidth??Number.POSITIVE_INFINITY,u=String(l.content??"").split(Se),g=this.#e.wordWrap&&l.wordWrap!==!1;let b=0;for(const f of u)b=Math.max(b,Math.min(E(f),c));b=this.computeWrappedContentWidth(b,u,c,g),h===1&&(i[n]=Math.max(i[n]??0,b+s),g&&!r.includes(n)&&r.push(n))}for(let n=0;n<t.length;n+=1)for(let a=0;a<this.#e.columns;a+=1){const l=t[n]?.[a];if(!l||fe(t,n,a,l)!==n||a>0&&t[n]?.[a-1]===l)continue;const h=l.colSpan??1;if(h>1){const c=l.maxWidth??Number.POSITIVE_INFINITY,u=String(l.content??"").split(Se),g=this.#e.wordWrap&&l.wordWrap!==!1;let b=0;for(const d of u)b=Math.max(b,Math.min(E(d),c));b=this.computeWrappedContentWidth(b,u,c,g);const f=(h-1)*o,p=b+s+f;let m=0;for(let d=a;d<a+h;d+=1)m+=i[d]??0;if(p>m){const d=p-m,x=Math.ceil(d/h);for(let w=0;w<h&&a+w<this.#e.columns;w+=1)i[a+w]=Math.max(i[a+w]??0,x)}}}return{growableColumns:r,widths:i}}calculateColumnWidths(t){if(this.#e.fixedColumnWidths&&this.#e.fixedColumnWidths.length===this.#e.columns){const o=this.#e.fixedColumnWidths;if(!o.some(n=>n===void 0||!Number.isFinite(n)))return[...o];if(this.#e.balancedWidths){const n=Array.from({length:o.length}).fill(0),a=typeof this.#e.maxWidth=="number"&&this.#e.maxWidth>0?Math.min(this.#e.maxWidth,this.#t):this.#t,l=this.calculateTotalGridWidth(Array.from({length:n.length}).fill(0)),h=Math.max(0,a-l);let c=0;const u=[];for(const[f,p]of o.entries())typeof p=="number"&&Number.isFinite(p)?(n[f]=p,c+=p):u.push(f);let g=Math.max(0,h-c);const b=u.length>0?Math.floor(g/u.length):0;for(const f of u)n[f]=b;g-=b*u.length;for(const f of u){if(g<=0)break;n[f]+=1,g-=1}return n}}if(this.#e.balancedWidths)return this.calculateBalancedColumnWidths(t);const i=Array.from({length:this.#e.columns}).fill(0),r=this.#e.paddingLeft+this.#e.paddingRight,s=this.#e.gap+(this.#e.showBorders?this.#e.border?.bodyJoin.width??0:0);for(let o=0;o<this.#e.columns;o+=1)for(let n=0;n<t.length;n+=1){const a=t[n]?.[o];if(!a||fe(t,n,o,a)!==n||o>0&&t[n]?.[o-1]===a)continue;const l=a.colSpan??1,h=a.maxWidth??Number.POSITIVE_INFINITY,c=String(a.content??"").split(Se);let u=0;for(const g of c)u=Math.max(u,Math.min(E(g),h));l===1&&(i[o]=Math.max(i[o]??0,u+r))}for(let o=0;o<t.length;o+=1)for(let n=0;n<this.#e.columns;n+=1){const a=t[o]?.[n];if(!a||fe(t,o,n,a)!==o||n>0&&t[o]?.[n-1]===a)continue;const l=a.colSpan??1;if(l>1){const h=a.maxWidth??Number.POSITIVE_INFINITY,c=String(a.content??"").split(Se),u=this.#e.wordWrap&&a.wordWrap!==!1;let g=0;for(const d of c)g=Math.max(g,Math.min(E(d),h));g=this.computeWrappedContentWidth(g,c,h,u);let b=0;for(let d=n;d<n+l;d+=1)b+=i[d]??0;const f=l>1?(l-1)*s:0,p=g+r+f,m=b+f;if(p>m){const d=p-m,x=Math.floor(d/l);let w=0;for(let v=0;v<l&&n+v<this.#e.columns;v+=1){const $=Math.min(x,d-w);if(i[n+v]=(i[n+v]??0)+$,w+=$,w>=d)break}}}}if(this.#e.maxWidth){const o=this.calculateTotalGridWidth(i);if(o>this.#e.maxWidth)return this.adjustColumnWidthsForTerminal(i,o)}return i}renderVisualRowContent(t,i,r,s,o){const n=t[i];if(!n)return"";const a=this.#e.borderColor??this.#e.foregroundColor??void 0,l=[],h=this.#e.showBorders&&this.#e.border?bo(this.#e.border):void 0,c=h&&h.left.width>0?h.left.char:"",u=h&&h.right.width>0?h.right.char:"",g=h&&h.join.width>0?h.join.char:"",b=" ".repeat(this.#e.gap);c&&l.push(S(S(c,a),this.#e.backgroundColor));let f=0;for(;f<this.#e.columns;){const p=n[f]??void 0;let m=1,d;if(p){const x=p.colSpan??1;m=x;const w=fe(t,i,f,p),v=it(s,f,x),$=this.alignCellContent(p,v),W=$.length,B=this.getCachedCellVerticalPosition(t,i,f,p);B.firstRow!==w&&console.warn(`Mismatch between findFirstOccurrenceRow (${String(w)}) and determineCellVerticalPosition (${String(B.firstRow)})`);const j=o.slice(w,B.lastRow+1).reduce((I,_)=>I+_,0),k=B.lastRow-B.firstRow+1;let F=r,L=0;for(let I=w;I<i;I+=1)I<o.length&&(F+=o[I]??1),I<B.lastRow&&(L+=1);F+=L;const z=p.vAlign??"top";let G;switch(z){case"bottom":{let I=r;for(let H=w;H<i;H+=1)I+=o[H]??1;const _=j-W;G=I>=_?I-_:-1;break}case"middle":{const I=Math.round((j-W)/2);let _=r;for(let H=w;H<i;H+=1)_+=o[H]??1;G=_>=I&&_<I+W?_-I:-1;break}case"top":{G=F;break}default:G=F}const xt=G>=0&&G<W;if(d=" ".repeat(Math.max(0,v)),xt){let I=!1;z==="middle"&&k%2===0&&G===0&&(I=!0),I||(d=$[G]??d)}p.colSpan&&p.colSpan>1&&(d+=b.repeat(p.colSpan)),p.foregroundColor?d=S(d,p.foregroundColor):this.#e.foregroundColor&&(d=S(d,this.#e.foregroundColor)),p.backgroundColor?d=S(d,p.backgroundColor):this.#e.backgroundColor&&(d=S(d,this.#e.backgroundColor))}else{const x=this.#e.paddingLeft+this.#e.paddingRight,w=Math.max(0,(s[f]??0)-x),v=" ".repeat(this.#e.paddingLeft+w+this.#e.paddingRight);d=S(S(r===0?v:" ".repeat(v.length),this.#e.foregroundColor),this.#e.backgroundColor)}l.push(d),f+m<this.#e.columns&&(l.push(b),this.#e.showBorders&&g&&l.push(S(S(g,a),this.#e.backgroundColor)),this.#e.gap>0&&l.push(b)),f+=m}return u&&l.push(S(S(u,a),this.#e.backgroundColor)),l.join("")}alignCellContent(t,i){const r=this.#o.get(t);if(r?.has(i))return r.get(i);const{paddingLeft:s,paddingRight:o}=this.#e,n=s+o,a=i-n;if(a<=0){const u=[" ".repeat(n+this.#e.gap)];return r?r.set(i,u):this.#o.set(t,new Map([[i,u]])),u}let l;const h=String(t.content??"");if(l=h.includes(`
|
|
9
|
+
`)||h.includes("\r")?h.split(Se):[h],this.#e.wordWrap&&t.wordWrap!==!1){const u=typeof this.#e.wordWrap=="object"?this.#e.wordWrap:{},g=typeof t.wordWrap=="object"?t.wordWrap:u;l=uo(h,{...g,width:a}).split(`
|
|
10
|
+
`)}if(this.#e.truncate&&t.truncate!==!1){const u=typeof this.#e.truncate=="object"?this.#e.truncate:{},g=typeof t.truncate=="object"?t.truncate:u;l=l.map(b=>ni(b,a,g))}else this.#e.truncateOverflow&&(l=l.map(u=>E(u)>a?ni(u,a,{}):u));const c=l.map(u=>No(u,a,t.hAlign??"left",s,o));return r?r.set(i,c):this.#o.set(t,new Map([[i,c]])),c}renderHorizontalBorder(t,i,r,s,o,n=-1){if(!this.#e.showBorders||!this.#e.border)return"";const a=this.#e.border,l=de(a,o),h=l.body.char,c=l.body.width,u=a.bodyJoin.char;if(o!=="middle"&&c===0)return"";let g=l.left.char,b=l.right.char;if(o==="middle"&&n!==-1){const d=t[r]?.[0]??void 0,x=t[n]?.[0]??void 0;d&&x&&d===x&&(g=u);const w=this.#e.columns-1,v=t[r]?.[w]??void 0,$=t[n]?.[w]??void 0;v&&$&&v===$&&(b=u)}const f=[],p=" ".repeat(this.#e.gap);g&&f.push(S(S(g,this.#e.borderColor),this.#e.backgroundColor));let m;for(let d=0;d<this.#e.columns;d+=1){const x=t[r]?.[d]??void 0,w=o==="middle"&&n!==-1?t[n]?.[d]??void 0:void 0;let v,$=!1;if(x&&(d===0||t[r]?.[d-1]!==x)&&(v=x,$=!0),x&&!$)continue;if(!x){const j=s[d]??0;if(m=c>0?h.repeat(j):" ".repeat(j),f.push(S(S(m,this.#e.borderColor),this.#e.backgroundColor)),d<this.#e.columns-1){const k=this.determineJoinChar(o,t,r,n,d,d+1);f.push(p),k.width>0&&f.push(S(S(k.char,this.#e.borderColor),this.#e.backgroundColor))}continue}const W=v?.colSpan??1;if(o==="middle"&&o==="middle"&&w&&x===w&&v){const j=v.vAlign==="middle",{firstRow:k,lastRow:F}=this.getCachedCellVerticalPosition(t,r,d,v),L=F-k+1,z=L%2===0,G=k+Math.ceil(L/2)-1,xt=it(s,d,W),I=this.alignCellContent(v,xt),_=I.length;if(j&&z&&r===G)m=S(I[0]??"",this.#e.borderColor);else{let H=0;for(let ue=k;ue<=r;ue+=1)H+=i[ue]??1,ue<r&&(H+=1);const $t=H;if($t>=0&&$t<_)m=S(I[$t]??"",this.#e.foregroundColor);else{const ue=s.slice(d,d+W).reduce((fr,mr)=>fr+mr,0)+(W-1)*(this.#e.gap+this.#e.border.bodyJoin.width);m=S(" ".repeat(ue),this.#e.borderColor)}}f.push(S(m,this.#e.backgroundColor))}else{const j=[];for(let k=d;k<d+W;k+=1){const F=s[k]??0,L=c>0?h:" ";if(j.push(L.repeat(F+this.#e.gap)),k<d+W-1){const z=this.determineJoinChar(o,t,r,n,k,k+1);z.width>0&&j.push(z.char)}}m=j.join(""),f.push(S(S(m,this.#e.borderColor),this.#e.backgroundColor))}const B=d+W-1;if(B<this.#e.columns-1){const j=this.determineJoinChar(o,t,r,n,B,B+1);j.width>0&&f.push(S(S(j.char,this.#e.borderColor),this.#e.backgroundColor))}d+=W-1}return b&&f.push(S(S(b,this.#e.borderColor),this.#e.backgroundColor)),f.join("")}determineJoinChar(t,i,r,s,o,n=-1){if(!this.#e.showBorders||!this.#e.border)return{char:" ",width:this.#e.gap};const a=this.#e.border;if(t!=="middle"){const $=de(a,t),W=i[r]?.[o]??void 0,B=n===-1?o+1:n,j=i[r]?.[B]??void 0,k=W!==void 0&&j!==void 0&&W===j?$.body:$.join,{char:F,width:L}=k;return{char:F,width:L>0?L:this.#e.gap}}if(s===-1||n===-1)return{char:" ",width:this.#e.gap};const l=a.bodyJoin,h=i[r]?.[o]??void 0,c=i[s]?.[o]??void 0,u=i[r]?.[n]??void 0,g=i[s]?.[n]??void 0,b=h!==void 0&&c!==void 0&&h===c,f=u!==void 0&&g!==void 0&&u===g,p=h!==void 0&&u!==void 0&&h===u,m=c!==void 0&&g!==void 0&&c===g;let d;const x=de(a,"middle");b&&f?d=p?{char:" ",width:l.width}:l:b?d=a.joinLeft:f?d=a.joinRight:p&&m?d=x.body:p?d=a.topJoin:m?d=a.bottomJoin:d=a.joinJoin;const{char:w,width:v}=d;return{char:w,width:v>0?v:this.#e.gap}}renderGrid(t,i){if(t.length===0)return"";const r=[],s=Oo(t,i,this.#e,this.alignCellContent.bind(this),fe),o=this.#e.showBorders&&this.#e.border?de(this.#e.border,"top"):void 0;o&&o.body.width>0&&r.push(this.renderHorizontalBorder(t,s,0,i,"top"));for(let a=0;a<t.length;a+=1){const l=s[a]??1;for(let c=0;c<l;c+=1)r.push(this.renderVisualRowContent(t,a,c,i,s));const h=this.#e.showBorders&&this.#e.border?de(this.#e.border,"middle"):void 0;if(a<t.length-1&&h&&h.body.width>0){const c=t[a],u=t[a+1];let g=!1;if(c&&u)for(let b=0;b<this.#e.columns;b+=1){const f=c[b],p=u[b];if(f!==p){g=!0;break}}g&&r.push(this.renderHorizontalBorder(t,s,a,i,"middle",a+1))}}const n=this.#e.showBorders&&this.#e.border?de(this.#e.border,"bottom"):void 0;return n&&n.body.width>0&&r.push(this.renderHorizontalBorder(t,s,t.length-1,i,"bottom")),r.join(`
|
|
11
|
+
`)}getCachedCellVerticalPosition(t,i,r,s){const o=this.#i.get(s);if(o)return o;const n=jt(t,i,r,s);return this.#i.set(s,n),n}};Vt(e=>new qi(e),"createGrid");const ko={bodyJoin:{char:"│",width:1},bodyLeft:{char:"│",width:1},bodyRight:{char:"│",width:1},bottomBody:{char:"─",width:1},bottomJoin:{char:"┴",width:1},bottomLeft:{char:"└",width:1},bottomRight:{char:"┘",width:1},joinBody:{char:"─",width:1},joinJoin:{char:"┼",width:1},joinLeft:{char:"├",width:1},joinRight:{char:"┤",width:1},topBody:{char:"─",width:1},topJoin:{char:"┬",width:1},topLeft:{char:"┌",width:1},topRight:{char:"┐",width:1}},Ye={bodyJoin:{char:"",width:0},bodyLeft:{char:"",width:0},bodyRight:{char:"",width:0},bottomBody:{char:"",width:0},bottomJoin:{char:"",width:0},bottomLeft:{char:"",width:0},bottomRight:{char:"",width:0},joinBody:{char:"",width:0},joinJoin:{char:"",width:0},joinLeft:{char:"",width:0},joinRight:{char:"",width:0},topBody:{char:"",width:0},topJoin:{char:"",width:0},topLeft:{char:"",width:0},topRight:{char:"",width:0}};var Ro=Object.defineProperty,Ui=O((e,t)=>Ro(e,"name",{value:t,configurable:!0}),"p$3"),Po=Object.defineProperty,Jt=Ui((e,t)=>Po(e,"name",{value:t,configurable:!0}),"g"),Mo=Object.defineProperty,To=Jt((e,t)=>Mo(e,"name",{value:t,configurable:!0}),"u");const Fo=To(e=>e.reduce((t,i)=>i===null?t+1:typeof i=="object"&&!Array.isArray(i)?(i.colSpan??=1,i.colSpan<=0?t+1:t+i.colSpan):t+1,0),"computeRowLogicalWidth");var Lo=Object.defineProperty,Yi=Jt((e,t)=>Lo(e,"name",{value:t,configurable:!0}),"b");let _o=class{static{O(this,"H")}static{Ui(this,"$")}static{Jt(this,"Table")}static{Yi(this,"Table")}#e;#n=[];#t=[];#o=[];#i=!0;#r=void 0;constructor(t={}){this.#e={...t,showFooter:t.showFooter??!0,showHeader:t.showHeader??!0,style:{border:ko,paddingLeft:1,paddingRight:1,...t.style}}}setHeaders(t){return t.length>0&&!Array.isArray(t[0])?this.#t=[t]:this.#t=t.map(i=>Array.isArray(i)?i:[i]),this.#i=!0,this.#r=void 0,this}setFooter(t){return t.length>0&&!Array.isArray(t[0])?this.#o=[t]:this.#o=t.map(i=>Array.isArray(i)?i:[i]),this.#i=!0,this.#r=void 0,this}addRow(t){if(!Array.isArray(t))throw new TypeError("Row must be an array");return this.#n.push(t),this.#i=!0,this.#r=void 0,this}addRows(...t){for(const i of t)this.addRow(i);return this.#i=!0,this.#r=void 0,this}toString(){if(!this.#i&&this.#r!==void 0)return this.#r;const t=this.#e.showHeader?this.#t:[],i=this.#e.showFooter?this.#o:[],r=[...t,...this.#n,...i];if(r.length===0)return this.#r="",this.#i=!1,"";let s=0;for(const u of r){const g=u;Array.isArray(g)?s=Math.max(s,Fo(g)):console.error("Unexpected non-array element found while calculating columns:",g)}if(s===0)return this.#r="",this.#i=!1,"";let o;Array.isArray(this.#e.columnWidths)?o=this.#e.columnWidths.length>=s?this.#e.columnWidths.slice(0,s):[...this.#e.columnWidths,...Array.from({length:s-this.#e.columnWidths.length}).fill(void 0)]:typeof this.#e.columnWidths=="number"&&(o=Array.from({length:s}).fill(this.#e.columnWidths));let n;const a=r.length;if(Array.isArray(this.#e.rowHeights)?n=this.#e.rowHeights:typeof this.#e.rowHeights=="number"&&(n=Array.from({length:a}).fill(this.#e.rowHeights)),o&&Array.isArray(o)){const u=[...o];for(const g of r){const b=g;for(const[f,p]of b.entries()){let m={};if(typeof p=="object"&&p!==null&&!Array.isArray(p)){const{content:d,href:x,...w}=p;m=w}m.width!==void 0?u[f]=m.width:m.maxWidth!==void 0&&u[f]!==void 0&&(u[f]=Math.min(u[f],m.maxWidth))}}o=u}const l={autoFlow:"row",backgroundColor:this.#e.style?.backgroundColor,balancedWidths:this.#e.balancedWidths??!1,border:this.#e.style?.border,borderColor:this.#e.style?.borderColor,columns:s,fixedColumnWidths:o,fixedRowHeights:n,foregroundColor:this.#e.style?.foregroundColor,gap:this.#e.gap??0,maxWidth:this.#e.maxWidth,paddingLeft:this.#e.style?.paddingLeft,paddingRight:this.#e.style?.paddingRight,terminalWidth:this.#e.terminalWidth,truncate:this.#e.truncate??(o?.every(u=>typeof u=="number")||this.#e.maxWidth!==void 0&&!this.#e.balancedWidths),truncateOverflow:this.#e.truncateOverflow??!0,wordWrap:this.#e.wordWrap??!1},h=new qi(l),c=[];for(const[u,g]of r.entries()){const b=g;if(!Array.isArray(b)){console.error("Skipping non-array row while creating GridItems:",b);continue}const f=this.#e.showHeader?this.#t.length:0,p=this.#n.length,m=this.#e.showHeader&&u<f,d=this.#e.showFooter&&u>=f+p,x=m&&b.length===1&&s>1,w=d&&b.length===1&&s>1;for(const v of b){let $=v,W={};if(typeof $=="object"&&$!==null&&!Array.isArray($)){const{content:F,href:L,...z}=$;$=L?`\x1B]8;;${L}\x1B\\${String(F)}\x1B]8;;\x1B\\`:F,W=z}x&&(W.colSpan=s),w&&(W.colSpan=s);const B=this.#e.transformTabToSpace&&typeof $=="string"?$.replaceAll(" "," ".repeat(this.#e.transformTabToSpace)):$,{maxWidth:j,width:k}=W;c.push({backgroundColor:W.backgroundColor,colSpan:W.colSpan,content:B,foregroundColor:W.foregroundColor,hAlign:W.hAlign,maxWidth:j,rowSpan:W.rowSpan,truncate:W.truncate??(j===void 0?void 0:!0),vAlign:W.vAlign,width:k,wordWrap:W.wordWrap})}}return h.addItems(c),this.#r=h.toString(),this.#i=!1,this.#r}};const Ke=Yi(e=>new _o(e),"createTable");var Ho=Object.defineProperty,X=O((e,t)=>Ho(e,"name",{value:t,configurable:!0}),"n");const Ki=80,Zi=24,Ct=X((e,t,{shell:i,env:r}={})=>xr(e,t,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:i,env:r}).trim(),"exec"),Ze=X((e,t)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(t,10)}),"create"),Xi=X((e,t)=>{const{columns:i,rows:r}=Ze(e,t);if(!(Number.isNaN(i)||Number.isNaN(r))&&!(i===Ki&&r===Zi))return{columns:i,rows:r}},"createIfNotDefault"),Go=X(()=>{if(ee.platform!=="linux")return!0;try{const e=Ie.readFileSync("/proc/self/stat","utf8"),t=e.lastIndexOf(") ");if(t===-1)return!1;const i=e.slice(t+2).trim().split(/\s+/),r=Number.parseInt(i[2],10),s=Number.parseInt(i[5],10);return Number.isNaN(r)||Number.isNaN(s)||s<=0?!1:r===s}catch{return!1}},"isForegroundProcess");function Qi(){const{env:e,stdout:t,stderr:i}=ee;if(t?.columns&&t?.rows)return Ze(t.columns,t.rows);if(i?.columns&&i?.rows)return Ze(i.columns,i.rows);if(e.COLUMNS&&e.LINES)return Ze(e.COLUMNS,e.LINES);const r={columns:Ki,rows:Zi};return ee.platform==="win32"?St()??r:ee.platform==="darwin"?hi()??St()??r:hi()??St()??Vo()??r}O(Qi,"O$3");X(Qi,"terminalSize");const hi=X(()=>{try{const e=ee.platform==="darwin"?Ie.constants.O_EVTONLY|Ie.constants.O_NONBLOCK:Ie.constants.O_NONBLOCK,{columns:t,rows:i}=$r.WriteStream(Ie.openSync("/dev/tty",e));return{columns:t,rows:i}}catch{}},"devTty"),St=X(()=>{try{const e=Ct("tput",["cols"],{env:{TERM:"dumb",...ee.env}}),t=Ct("tput",["lines"],{env:{TERM:"dumb",...ee.env}});if(e&&t)return Xi(e,t)}catch{}},"tput"),Vo=X(()=>{try{if(!Go())return;const e=Ct("resize",["-u"]).match(/\d+/g);if(e.length===2)return Xi(e[0],e[1])}catch{}},"resize");var Jo=Object.defineProperty,zo=O((e,t)=>Jo(e,"name",{value:t,configurable:!0}),"b$4"),qo=Object.defineProperty,Do=zo((e,t)=>qo(e,"name",{value:t,configurable:!0}),"s"),Uo=Object.defineProperty,Yo=Do((e,t)=>Uo(e,"name",{value:t,configurable:!0}),"a");const Ko=/([a-f\d]{3,6})/i,Nt=Yo(e=>{let[,t]=Ko.exec(e)??[];const i=t?t.length:0;if(i===3){const s=t.charAt(0),o=t.charAt(1),n=t.charAt(2);t=s+s+o+o+n+n}else if(i!==6)return[0,0,0];const r=Number.parseInt(t,16);return[r>>16&255,r>>8&255,r&255]},"convertHexToRgb");var Zo=Object.defineProperty,Xo=O((e,t)=>Zo(e,"name",{value:t,configurable:!0}),"o$1"),Qo=Object.defineProperty,es=Xo((e,t)=>Qo(e,"name",{value:t,configurable:!0}),"s"),ts=Object.defineProperty,zt=es((e,t)=>ts(e,"name",{value:t,configurable:!0}),"e");const er=zt((e,t,i)=>e===t&&t===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/51)+6*Math.round(t/51)+Math.round(i/51),"rgbToAnsi256"),Et=zt(e=>{let t,i,r;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)t=i=r=((e-232)*10+8)/255;else{e-=16;const n=e%36;t=Math.floor(e/36)/5,i=Math.floor(n/6)/5,r=n%6/5}const s=Math.max(t,i,r)*2;if(s===0)return 30;const o=30+(Math.round(r)<<2|Math.round(i)<<1|Math.round(t));return s===2?o+60:o},"ansi256To16"),ui=zt((e,t,i)=>Et(er(e,t,i)),"rgbToAnsi16");var is=Object.defineProperty,tr=O((e,t)=>is(e,"name",{value:t,configurable:!0}),"m"),rs=Object.defineProperty,$e=tr((e,t)=>rs(e,"name",{value:t,configurable:!0}),"u"),ns=Object.defineProperty,os=$e((e,t)=>ns(e,"name",{value:t,configurable:!0}),"e");function mt({onlyFirst:e=!1}={}){const t="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(t,e?void 0:"g")}O(mt,"$$3");tr(mt,"j");$e(mt,"t$1");os(mt,"ansiRegex");var ss=Object.defineProperty,as=$e((e,t)=>ss(e,"name",{value:t,configurable:!0}),"n$1");const U=as((e,t,i)=>t>e?t:Math.min(e,i),"clamp");var ls=Object.defineProperty,T=$e((e,t)=>ls(e,"name",{value:t,configurable:!0}),"b");const C=39,N=49,di=10,kt=wr(),ir={close:"",open:""},y=kt>0?(e,t)=>({close:`\x1B[${String(t)}m`,open:`\x1B[${String(e)}m`}):()=>ir,fi=T(e=>(t,i,r)=>e(er(Number(t),Number(i),Number(r))),"createRgbFunction"),mi=T(e=>t=>{const[i,r,s]=Nt(t);return e(i,r,s)},"createHexFunction");let Rt=T(e=>y(`38;5;${String(e)}`,C),"createAnsi256"),Pt=T(e=>y(`48;5;${String(e)}`,N),"createBgAnsi256"),rt=T((e,t,i)=>y(`38;2;${String(e)};${String(t)};${String(i)}`,C),"createRgb"),nt=T((e,t,i)=>y(`48;2;${String(e)};${String(t)};${String(i)}`,N),"createBgRgb");kt===1?(Rt=T(e=>y(Et(Number(e)),C),"createAnsi256"),Pt=T(e=>y(Et(Number(e))+di,N),"createBgAnsi256"),rt=T((e,t,i)=>y(ui(Number(e),Number(t),Number(i)),C),"createRgb"),nt=T((e,t,i)=>y(ui(Number(e),Number(t),Number(i))+di,N),"createBgRgb")):kt===2&&(rt=fi(Rt),nt=fi(Pt));const pi={bold:y(1,22),dim:y(2,22),hidden:y(8,28),inverse:y(7,27),italic:y(3,23),overline:y(53,55),reset:y(0,0),strike:y(9,29),strikethrough:y(9,29),underline:y(4,24),visible:ir},gi={bgBlack:y(40,N),bgBlackBright:y(100,N),bgBlue:y(44,N),bgBlueBright:y(104,N),bgCyan:y(46,N),bgCyanBright:y(106,N),bgGray:y(100,N),bgGreen:y(42,N),bgGreenBright:y(102,N),bgGrey:y(100,N),bgMagenta:y(45,N),bgMagentaBright:y(105,N),bgRed:y(41,N),bgRedBright:y(101,N),bgWhite:y(47,N),bgWhiteBright:y(107,N),bgYellow:y(43,N),bgYellowBright:y(103,N),black:y(30,C),blackBright:y(90,C),blue:y(34,C),blueBright:y(94,C),cyan:y(36,C),cyanBright:y(96,C),gray:y(90,C),green:y(32,C),greenBright:y(92,C),grey:y(90,C),magenta:y(35,C),magentaBright:y(95,C),red:y(31,C),redBright:y(91,C),white:y(37,C),whiteBright:y(97,C),yellow:y(33,C),yellowBright:y(93,C)},bi={bg:T(e=>Pt(U(e,0,255)),"bg"),bgHex:mi(nt),bgRgb:T((e,t,i)=>nt(U(e,0,255),U(t,0,255),U(i,0,255)),"bgRgb"),fg:T(e=>Rt(U(e,0,255)),"fg"),hex:mi(rt),rgb:T((e,t,i)=>rt(U(e,0,255),U(t,0,255),U(i,0,255)),"rgb")};var cs=Object.defineProperty,hs=$e((e,t)=>cs(e,"name",{value:t,configurable:!0}),"s");const us=hs((e,t,i)=>{if(t==="")return e;let r=e.indexOf(t);if(r<0)return e;const s=t.length;let o=0,n="";for(;~r;)n+=e.slice(o,r)+i,o=r+s,r=e.indexOf(t,o);return n+e.slice(o)},"stringReplaceAll");var ds=Object.defineProperty,Ne=$e((e,t)=>ds(e,"name",{value:t,configurable:!0}),"a");const Y={};let Mt=null;const fs=Ne((e,t,i)=>{if(!e)return"";let r;if(e.raw===void 0?r=String(e):r=String.raw(e,...t),r.includes("\x1B"))for(let s=i;s;s=s.props)r=us(r,s.close,s.open);return r.includes(`
|
|
12
|
+
`)&&(r=r.replace(/(\r*\n)/g,`${i.closeStack}$1${i.openStack}`)),i.openStack+r+i.closeStack},"wrapText"),Tt=Ne(({props:e},{close:t,open:i})=>{const r=(e?.openStack??"")+i,s=t+(e?.closeStack??""),o=Ne((n,...a)=>fs(n,a,o.props),"style");return Object.setPrototypeOf(o,Mt),o.props={close:t,closeStack:s,open:i,openStack:r,props:e},o.open=r,o.close=s,o},"createStyle"),ms=Ne(function(){const e=Ne(t=>String(t),"self");e.strip=t=>t.replaceAll(mt(),"");for(const t in gi)Y[t]={get(){const i=Tt(this,gi[t]);return Object.defineProperty(this,t,{value:i}),i}};for(const t in pi)Y[t]={get(){const i=Tt(this,pi[t]);return Object.defineProperty(this,t,{value:i}),i}};return Mt=Object.defineProperties({},Y),Object.setPrototypeOf(e,Mt),e},"Colorize");for(const e in bi)Y[e]={get(){return(...t)=>Tt(this,bi[e](...t))}};Y.ansi256=Y.fg;Y.bgAnsi256=Y.bg;var ps=Object.defineProperty,gs=O((e,t)=>ps(e,"name",{value:t,configurable:!0}),"g"),bs=Object.defineProperty,pt=gs((e,t)=>bs(e,"name",{value:t,configurable:!0}),"i"),ws=Object.defineProperty,ys=pt((e,t)=>ws(e,"name",{value:t,configurable:!0}),"n");const rr=ys(e=>(t,...i)=>{if(!Array.isArray(t)||!Array.isArray(t.raw))throw new TypeError("A tagged template literal must be provided");const r=[t.raw[0]];for(let s=1;s<t.raw.length;s+=1)r.push(String(i[s-1]).replaceAll(/[{}\\]/g,String.raw`\$&`),String(t.raw[s]));return e(r.join(""))},"makeColorizeTemplate");var vs=Object.defineProperty,xs=pt((e,t)=>vs(e,"name",{value:t,configurable:!0}),"e$1");const $s=new Map([["0","\0"],["\\","\\"],["a","\x07"],["b","\b"],["e","\x1B"],["f","\f"],["n",`
|
|
13
|
+
`],["r","\r"],["t"," "],["v","\v"]]),nr=xs(e=>{const t=e.startsWith("u"),i=e[1]==="{";return t&&!i&&e.length===5||e.startsWith("x")&&e.length===3?String.fromCodePoint(Number.parseInt(e.slice(1),16)):t&&i?String.fromCodePoint(Number.parseInt(e.slice(2,-1),16)):$s.get(e)??e},"unescape");var Ws=Object.defineProperty,gt=pt((e,t)=>Ws(e,"name",{value:t,configurable:!0}),"u");const Os=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|\{(~)?(#?[\w:]+(?:\([^)]*\))?(?:\.#?[\w:]+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n))|(\})|((?:.|[\r\n\f])+?)/gi,wi=/(?:^|\.)(?:(\w+)(?:\(([^)]*)\))?|#(?=[:a-f\d]{2,})([a-f\d]{6})?(?::([a-f\d]{6}))?)/gi,Bs=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,Ss=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,As=/\s*,\s*/,js=gt((e,t)=>{const i=[],r=t.trim().split(As);let s;for(const o of r){const n=Number(o);if(!Number.isNaN(n))i.push(n);else if(s=Bs.exec(o))i.push(s[2].replaceAll(Ss,(a,l,h)=>l?nr(l):h));else throw new Error(`Invalid template style argument: ${o} (in style '${e}')`)}return i},"parseArguments"),Is=gt(e=>{wi.lastIndex=0;const t=[];let i;for(;(i=wi.exec(e))!==null;){const r=i[1];i[2]?t.push([r,...js(r,i[2])]):i[3]||i[4]?(i[3]&&t.push(["rgb",...Nt(i[3])]),i[4]&&t.push(["bgRgb",...Nt(i[4])])):t.push([r])}return t},"parseStyle"),yi=gt((e,t)=>{const i={};for(const s of t)for(const o of s.styles)i[o[0]]=s.inverse?void 0:o.slice(1);let r=e;for(const[s,o]of Object.entries(i))if(Array.isArray(o)){if(!(s in r))throw new Error(`Unknown style: ${s}`);r=o.length>0?r[s](...o):r[s]}return r},"buildStyle"),or=gt(e=>t=>{const i=[],r=[];let s=[];if(t.replaceAll(Os,(o,n,a,l,h,c)=>{if(n)s.push(nr(n));else if(l){const u=s.join("");s=[],r.push(i.length===0?u:yi(e,i)(u)),i.push({inverse:a,styles:Is(l)})}else if(h){if(i.length===0)throw new Error("Found extraneous } in template literal");r.push(yi(e,i)(s.join(""))),s=[],i.pop()}else s.push(c)}),r.push(s.join("")),i.length>0)throw new Error(`template literal is missing ${String(i.length)} closing bracket${i.length===1?"":"s"} (\`}\`)`);return r.join("")},"makeTemplate");var Cs=Object.defineProperty,Ns=pt((e,t)=>Cs(e,"name",{value:t,configurable:!0}),"e");const Es=new ms;Ns(e=>rr(or(e)),"makeTaggedTemplate");const ks=or(Es),Rs=rr(ks);var Ps=Object.defineProperty,q=O((e,t)=>Ps(e,"name",{value:t,configurable:!0}),"p"),Ms=Object.defineProperty,R=q((e,t)=>Ms(e,"name",{value:t,configurable:!0}),"u");const Ts=Bi(import.meta.url),Ae=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fs=R(e=>{if(typeof Ae<"u"&&Ae.versions&&Ae.versions.node){const[t,i]=Ae.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return Ae.getBuiltinModule(e)}return Ts(e)},"__cjs_getBuiltinModule"),Ls=Fs("node:os");var _s=Object.defineProperty,qt=R((e,t)=>_s(e,"name",{value:t,configurable:!0}),"u$1"),Hs=Object.defineProperty,bt=qt((e,t)=>Hs(e,"name",{value:t,configurable:!0}),"l");const Gs=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Vs=12288,Js=65510,zs=[12288,12288,65281,65376,65504,65510],qs=8361,Ds=65518,Us=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Ys=32,Ks=10630,Zs=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Xs=4352,Qs=262141,sr=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var ea=Object.defineProperty,ta=bt((e,t)=>ea(e,"name",{value:t,configurable:!0}),"r$1");const Re=ta((e,t)=>{let i=0,r=Math.floor(e.length/2)-1;for(;i<=r;){const s=Math.floor((i+r)/2),o=s*2;if(t<e[o])r=s-1;else if(t>e[o+1])i=s+1;else return!0}return!1},"isInRange");var ia=Object.defineProperty,le=bt((e,t)=>ia(e,"name",{value:t,configurable:!0}),"r");const vi=19968,[ra,na]=We(sr);function We(e){let t=e[0],i=e[1];for(let r=0;r<e.length;r+=2){const s=e[r],o=e[r+1];if(vi>=s&&vi<=o)return[s,o];o-s>i-t&&(t=s,i=o)}return[t,i]}O(We,"N$1");q(We,"T");R(We,"c$2");qt(We,"f");bt(We,"k");le(We,"findWideFastPathRange");const ar=le(e=>e<161||e>1114109?!1:Re(Gs,e),"isAmbiguous"),lr=le(e=>e<Vs||e>Js?!1:Re(zs,e),"isFullWidth"),oa=le(e=>e<qs||e>Ds?!1:Re(Us,e),"isHalfWidth"),sa=le(e=>e<Ys||e>Ks?!1:Re(Zs,e),"isNarrow"),cr=le(e=>e>=ra&&e<=na?!0:e<Xs||e>Qs?!1:Re(sr,e),"isWide");function Oe(e){return ar(e)?"ambiguous":lr(e)?"fullwidth":oa(e)?"halfwidth":sa(e)?"narrow":cr(e)?"wide":"neutral"}O(Oe,"x");q(Oe,"R");R(Oe,"g$3");qt(Oe,"S");bt(Oe,"getCategory");le(Oe,"getCategory");var aa=Object.defineProperty,wt=R((e,t)=>aa(e,"name",{value:t,configurable:!0}),"i$2"),la=Object.defineProperty,yt=wt((e,t)=>la(e,"name",{value:t,configurable:!0}),"a"),ca=Object.defineProperty,Dt=yt((e,t)=>ca(e,"name",{value:t,configurable:!0}),"e");function ce(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}O(ce,"W");q(ce,"I");R(ce,"s$1");wt(ce,"s");yt(ce,"r");Dt(ce,"validate");function he(e){return ce(e),Oe(e)}O(he,"v");q(he,"A");R(he,"r$3");wt(he,"p");yt(he,"eastAsianWidthType");Dt(he,"eastAsianWidthType");function Pe(e,{ambiguousAsWide:t=!1}={}){return ce(e),lr(e)||cr(e)||t&&ar(e)?2:1}O(Pe,"_$1");q(Pe,"D");R(Pe,"o$2");wt(Pe,"W");yt(Pe,"eastAsianWidth");Dt(Pe,"eastAsianWidth");var ha=Object.defineProperty,ua=R((e,t)=>ha(e,"name",{value:t,configurable:!0}),"E"),da=Object.defineProperty,fa=ua((e,t)=>da(e,"name",{value:t,configurable:!0}),"A"),ma=Object.defineProperty,vt=fa((e,t)=>ma(e,"name",{value:t,configurable:!0}),"d");const xi=new Map,ze=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,Xe=vt(e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other","getCharType"),pa=vt((e,t)=>{const i=Math.floor(e/65536),r=e%65536;let s=xi.get(i);if(s||(s=new Map,xi.set(i,s)),s.has(r))return s.get(r);let o;if(Xe(e)==="latin")o=t.width.regular;else if(Xe(e)==="control")o=t.width.control;else if(Xe(e)==="wide")o=t.width.wide;else switch(he(e)){case"ambiguous":{o=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{o=t.width.fullWidth;break}case"wide":{o=t.width.wide;break}default:o=t.width.regular}return s.set(r,o),o},"getCachedCharWidth"),ga=vt(e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,"isCombiningCharacter"),Ft=vt((e,t={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const i={truncation:{countAnsiEscapeCodes:t.countAnsiEscapeCodes??!1,ellipsis:t.ellipsis??"",ellipsisWidth:t.ellipsisWidth??(t.ellipsis?Ft(t.ellipsis,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:t.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:t.ambiguousIsNarrow??!1,ansi:t.ansiWidth??0,control:t.controlWidth??0,emoji:t.emojiWidth??2,fullWidth:t.fullWidth??2,halfWidth:t.halfWidth??1,regular:t.regularWidth??1,tab:t.tabWidth??8,wide:t.wideWidth??2}},r=Math.max(0,i.truncation.limit-i.truncation.ellipsisWidth),{length:s}=e,o=s>1e4;let n=0,a=0,l=s,h=!1;const c=e.includes("\x1B")||e.includes("");for(;n<s;){if(c&&(e[n]==="\x1B"||e[n]==="")){if(e.startsWith("\x1B]8;;",n)){const m="\x1B]8;;\x07",d=m.length,x=e.indexOf("\x07",n+5);if(x!==-1){const w=e.indexOf(m,x+1);if(w!==-1){const v=w+d,$=e.slice(x+1,w).replace(Be,""),W=Ft($,{ambiguousIsNarrow:i.width.ambiguousIsNarrow,ansiWidth:i.width.ansi,controlWidth:i.width.control,countAnsiEscapeCodes:!1,ellipsis:i.truncation.ellipsis,ellipsisWidth:i.truncation.ellipsisWidth,emojiWidth:i.width.emoji,fullWidth:i.width.fullWidth,halfWidth:i.width.halfWidth,limit:Math.max(0,r-a),regularWidth:i.width.regular,tabWidth:i.width.tab,wideWidth:i.width.wide}),B=W.width;if(W.truncated)h=!0,l=Math.min(l,n);else if(a+B>r&&(l=Math.min(l,n),h=!0,a+B>i.truncation.limit))break;if(a+=B,n=v,h&&a>=i.truncation.limit)break;continue}}}if(Be.lastIndex=n,Be.test(e)){const m=Be.lastIndex-n,d=i.truncation.countAnsiEscapeCodes?m:i.width.ansi;if(a+d>r&&(l=Math.min(l,n),a+d>i.truncation.limit)){h=!0;break}a+=d,n=Be.lastIndex;continue}}const b=e.codePointAt(n);if(b===8203||b===65279||b>=8288&&b<=8292){n+=1;continue}if(b===9){if(a+i.width.tab>r&&(l=Math.min(l,n),a+i.width.tab>i.truncation.limit)){h=!0;break}a+=i.width.tab,n+=1;continue}if(ze.lastIndex=n,ze.test(e)){const m=(ze.lastIndex-n)*i.width.regular;if(a+m>r){const d=Math.floor((r-a)/i.width.regular);if(l=Math.min(l,n+d),a+m>i.truncation.limit){h=!0;break}}a+=m,n=ze.lastIndex;continue}if((b<=31||b>=127&&b<=159)&&(Me.lastIndex=n,Me.test(e))){const m=(Me.lastIndex-n)*i.width.control;if(a+m>r&&(l=Math.min(l,n+Math.floor((r-a)/i.width.control)),a+m>i.truncation.limit)){h=!0;break}a+=m,n=Me.lastIndex;continue}if(Wt.lastIndex=n,Wt.test(e)){if(a+i.width.emoji>r&&(l=Math.min(l,n),a+i.width.emoji>i.truncation.limit)){h=!0;break}a+=i.width.emoji,n=Wt.lastIndex;continue}const f=e.codePointAt(n)??0;if(ga(f)){n+=f>65535?2:1;continue}let p;if(o)p=pa(f,i);else switch(Xe(f)){case"control":{p=i.width.control;break}case"latin":{p=i.width.regular;break}case"wide":{p=i.width.wide;break}case"zero":{p=0;break}default:switch(he(f)){case"ambiguous":{p=i.width.ambiguousIsNarrow?i.width.regular:i.width.wide;break}case"fullwidth":{p=i.width.fullWidth;break}case"wide":{p=i.width.wide;break}default:p=i.width.regular}}if(a+p>r&&(l=Math.min(l,n),a+p>i.truncation.limit)){h=!0;break}a+=p,n+=f>65535?2:1}let u=a,g=!1;return h&&i.truncation.limit>=i.truncation.ellipsisWidth&&(u=i.truncation.limit,g=!0),{ellipsed:g,index:h?l:s,truncated:h,width:u}},"getStringTruncatedWidth");var ba=Object.defineProperty,wa=R((e,t)=>ba(e,"name",{value:t,configurable:!0}),"i$1"),ya=Object.defineProperty,va=wa((e,t)=>ya(e,"name",{value:t,configurable:!0}),"e"),xa=Object.defineProperty,$a=va((e,t)=>xa(e,"name",{value:t,configurable:!0}),"r");const Wa=$a((e,t={})=>Ft(e,{...t,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,"getStringWidth");var Oa=Object.defineProperty,Ba=R((e,t)=>Oa(e,"name",{value:t,configurable:!0}),"s");const je=new Map,Sa=500,P=Ba(e=>{if(!e||e==="")return"";const t=je.get(e);if(t!==void 0)return t;const i=Rs(Object.assign([],{raw:[e]}));if(je.size>=Sa){const r=je.keys().next().value;r!==void 0&&je.delete(r)}return je.set(e,i),i},"templateFormat");var Aa=Object.defineProperty,ja=R((e,t)=>Aa(e,"name",{value:t,configurable:!0}),"t$1");const Qe=ja(()=>{const e=vr().CEREBRO_TERMINAL_WIDTH;if(e===void 0)return;const t=Number.parseInt(e,10);if(!(Number.isNaN(t)||t<=0))return t},"getTerminalWidth");var Ia=Object.defineProperty,Ca=R((e,t)=>Ia(e,"name",{value:t,configurable:!0}),"t");class hr{static{O(this,"it")}static{q(this,"ie")}static{R(this,"n")}static{Ca(this,"BaseSection")}lines;constructor(){this.lines=[]}add(t){this.lines.push(t)}toString(){return this.lines.join(Ls.EOL)}header(t){this.add(yr(t)),this.lines.push("")}}var Na=Object.defineProperty,ot=R((e,t)=>Na(e,"name",{value:t,configurable:!0}),"g");const Ea=ot(e=>e!==void 0&&e>0?e:Qi().columns,"resolveTerminalWidth"),ka=ot((e,t,i,r)=>{if(e.length===0||e.some(h=>h.length!==2))return;let s=0;for(const h of e){const c=h[0];if(c===void 0)continue;const u=Wa(c);u>s&&(s=u)}if(s===0)return;const o=i+r,n=s+o,a=20+o;if(n+a>t)return;const l=t-n;return[n,l]},"computeColumnWidths");class Ra extends hr{static{O(this,"d1")}static{q(this,"si")}static{R(this,"S")}static{ot(this,"ContentSection")}constructor(t){if(super(),t.header&&this.header(P(t.header)),t.content){if(t.raw)if(Array.isArray(t.content)&&t.content.every(i=>typeof i=="string"))t.content.forEach(i=>{Array.isArray(i)?i.forEach(r=>{this.add(P(r))}):this.add(P(i))});else if(typeof t.content=="string")this.add(P(t.content));else throw new TypeError("Invalid raw content, must be a string or array of strings.");else this.add(this.getContentLines(t.content));this.add("")}}getContentLines(t){if(typeof t=="string"){const i=Ke({showHeader:!1,style:{border:Ye,paddingLeft:4,paddingRight:1},terminalWidth:Qe(),truncateOverflow:!1,wordWrap:!0});return i.addRow([P(t)]),i.toString()}if(Array.isArray(t)&&t.every(i=>typeof i=="string"||Array.isArray(i)&&i.every(r=>typeof r=="string"))){const i=Ea(Qe()),r=ot(a=>Array.isArray(a)?a.map(l=>P(l)):[P(a)],"formatRow"),s=t.map(a=>r(a)),o=ka(s,i,4,1),n=Ke({columnWidths:o,showHeader:!1,style:{border:Ye,paddingLeft:4,paddingRight:1},terminalWidth:i,truncateOverflow:!1,wordWrap:!0});return s.forEach(a=>{o!==void 0&&a.length===2?n.addRow([{content:a[0],wordWrap:!1},a[1]]):n.addRow(a)}),n.toString()}if(typeof t=="object"){const i=t;if(!i.options||!i.data)throw new Error(`Must have an "options" or "data" property
|
|
14
|
+
${JSON.stringify(t)}`);const r=Ke({showHeader:!1,style:{border:Ye,paddingLeft:4,paddingRight:1},terminalWidth:Qe(),truncateOverflow:!1,wordWrap:!0});return i.data.forEach(s=>{Array.isArray(s)?r.addRow(s.map(o=>P(o))):r.addRow([P(s)])}),r.toString()}throw new Error(`invalid input - 'content' must be a string, array of strings or a object:
|
|
15
15
|
|
|
16
|
-
${JSON.stringify(t)}`)}}var Pa=Object.defineProperty,
|
|
17
|
-
${e.map(t=>t.optionList?new
|
|
18
|
-
`)}`,"commandLineUsage");var
|
|
16
|
+
${JSON.stringify(t)}`)}}var Pa=Object.defineProperty,Ma=R((e,t)=>Pa(e,"name",{value:t,configurable:!0}),"m");class Ta extends hr{static{O(this,"h1")}static{q(this,"ui")}static{R(this,"O")}static{Ma(this,"OptionListSection")}constructor(t){super();let i=t.optionList??[];const r=Array.isArray(t.hide)?t.hide:[t.hide].filter(n=>typeof n=="string"),s=Array.isArray(t.group)?t.group:[t.group].filter(n=>typeof n=="string");r.length>0&&(i=i.filter(n=>!r.includes(n.name))),t.header&&this.header(P(t.header)),s.length>0&&(i=i.filter(n=>{const a=n,l=s.includes("_none")&&!a.group,h=a.group,c=this.intersect(Array.isArray(h)?h:[h],s);return l||c?n:void 0}));const o=Ke({showHeader:!1,style:{border:Ye,paddingLeft:2,paddingRight:1,...t.tableOptions?.style},terminalWidth:Qe()??t.tableOptions?.terminalWidth,truncateOverflow:!1,wordWrap:t.tableOptions?.wordWrap??!0,...t.tableOptions});i.forEach(n=>{const a=n;o.addRow([this.getOptionNames(a,t.reverseNameOrder??!1,t.isArgument??!1),P(a.description)])}),this.add(o.toString()),this.lines.push("")}getOptionNames(t,i,r){if(!t.name)throw new TypeError("Invalid option definition, name is required.");let s=t.type?t.type.name.toLowerCase():"string";const o=t.multiple||t.lazyMultiple?"[]":"";s=P(t.typeLabel??`{underline ${s}${o}}`);let n;if(t.alias)if(t.name){const a=r?t.name:`{yellow --${t.name}}`;n=P(i?`{bold ${a}}, {bold -${t.alias}} ${s}`:`{bold -${t.alias}}, {bold ${a}} ${s}`)}else i?n=P(`{bold -${t.alias}} ${s}`):n=P(`{bold -${t.alias}} ${s}`);else n=P(`{bold ${r?t.name:`{yellow --${t.name}}`}} ${s}`);return n}intersect(t,i){return t.some(r=>i.includes(r))}}var Fa=Object.defineProperty,La=R((e,t)=>Fa(e,"name",{value:t,configurable:!0}),"o");const Ut=La(e=>(Array.isArray(e)?e:[e]).length===0?"":`
|
|
17
|
+
${e.map(t=>t.optionList?new Ta(t).toString():new Ra(t).toString()).join(`
|
|
18
|
+
`)}`,"commandLineUsage");var _a=Object.defineProperty,ur=O((e,t)=>_a(e,"name",{value:t,configurable:!0}),"b"),Ha=Object.defineProperty,dr=ur((e,t)=>Ha(e,"name",{value:t,configurable:!0}),"b");const Ga=[{defaultValue:"32",description:"Controls the verbosity level of output. Valid values: '16' (quiet), '32' (normal), '64' (verbose), '128' (debug)",name:"CEREBRO_OUTPUT_LEVEL",type:String},{description:"Sets the minimum required Node.js version. Overrides the default minimum version check",name:"CEREBRO_MIN_NODE_VERSION",type:Number},{defaultValue:!1,description:"When set, disables the update notifier check",name:"NO_UPDATE_NOTIFIER",type:Boolean},{description:"Standard Node.js environment variable. When set to 'test', disables update notifier",name:"NODE_ENV",type:String},{defaultValue:!1,description:"When set, enables debug output (same as --debug flag)",name:"DEBUG",type:Boolean},{description:"Sets the terminal width for table rendering. Useful for testing and consistent output",name:"CEREBRO_TERMINAL_WIDTH",type:Number}];var Va=Object.defineProperty,re=dr((e,t)=>Va(e,"name",{value:t,configurable:!0}),"f");const $i="__Other",Wi=re(e=>e.charAt(0).toUpperCase()+e.slice(1),"upperFirstChar"),Ja=re((e,t,i,r)=>{e.debug("no command given, printing general help...");let s=[...new Set(i.values())].filter(a=>!a.hidden);r&&(s=s.filter(a=>a.group===r));const o=s.reduce((a,l)=>{const h=l.group??$i;return a[h]??=[],a[h].push(l),a},{}),n=re(a=>a.map(l=>{let h="";typeof l.alias=="string"?h=l.alias:Array.isArray(l.alias)&&(h=l.alias.join(", ")),h!==""&&(h=` [${h}]`);let c=l.name;return l.commandPath&&l.commandPath.length>0&&(c=`${l.commandPath.join(" ")} ${l.name}`),[`${V(c)}${h}`,l.description??""]}),"buildCommandList");(e.raw??e.log)(Ut([{content:`${ge(t.getCliName())} ${V("<command>")} [positional arguments] ${et("[options]")}`,header:M.cyan(" Usage ")},...Object.keys(o).map(a=>{const l=r?` ${Wi(r)}`:"";return{content:n(o[a]),header:a===$i||r?M.green(` Available${l} Commands `):` ${M.green(` ${Wi(a)} `)}`}}),i.has("help")?{header:M.yellow(" Command Options "),optionList:i.get("help").options?.filter(a=>!a.hidden)}:void 0,{header:M.yellow(" Global Options "),optionList:t.getGlobalOptions()},{content:Ga.filter(a=>!a.hidden).map(a=>[a.name,a.description??""]),header:M.magenta(" Environment Variables ")},{content:`Run "${ge(t.getCliName())} ${V("help <command>")}" or "${ge(t.getCliName())} ${V("<command>")} ${et("--help")}" for help with a specific command.`,raw:!0}].filter(Boolean)))},"printGeneralHelp"),Oi=re((e,t)=>{const i=[];for(const r of e.values()){if(r.hidden)continue;const s=r.commandPath??[];if(s.length!==t.length)continue;let o=!0;for(const[n,a]of t.entries())if(s[n]!==a){o=!1;break}o&&i.push(r)}return i},"findChildren"),za=re((e,t,i,r)=>{const s=i.join(" "),o=[{content:`${ge(t.getCliName())} ${V(s)} ${V("<subcommand>")} [positional arguments] ${et("[options]")}`,header:M.cyan(" Usage ")},{content:r.map(n=>{const a=[...n.commandPath??[],n.name].join(" ");return[V(a),n.description??""]}),header:M.green(" Subcommands ")},{header:M.yellow(" Global Options "),optionList:t.getGlobalOptions()},{content:`Run "${ge(t.getCliName())} ${V(`${s} <subcommand>`)} ${et("--help")}" for help with a specific subcommand.`,raw:!0}];(e.raw??e.log)(Ut(o))},"printParentHelp"),qa=re((e,t,i,r,s)=>{let o=s??i.get(r);if(!o)for(const c of i.values()){const u=c.commandPath?[...c.commandPath,c.name]:[c.name];if(u.at(-1)===r||u.join(" ")===r){o=c;break}}if(!o){const c=r.split(" ").filter(Boolean),u=c.length>0?Oi(i,c):[];if(u.length>0){za(e,t,c,u);return}e.error(`Command "${r}" not found`);return}const n=[],a=(o.commandPath?[...o.commandPath,o.name]:[o.name]).join(" ");if(n.push({content:`${ge(t.getCliName())} ${V(a)}${o.argument?" [positional arguments]":""}${o.options?" [options]":""}`,header:M.cyan(" Usage ")}),o.description&&n.push({content:o.description,header:M.green(" Description ")}),o.argument&&n.push({header:"Command Positional Arguments",isArgument:!0,optionList:[o.argument]}),Array.isArray(o.options)&&o.options.length>0&&n.push({header:M.yellow(" Command Options "),optionList:o.options.filter(c=>!c.hidden)}),n.push({header:M.yellow(" Global Options "),optionList:t.getGlobalOptions()}),Array.isArray(o.env)&&o.env.length>0){const c=o.env.filter(u=>!u.hidden);c.length>0&&n.push({content:c.map(u=>[u.name,u.description??""]),header:M.magenta(" Environment Variables ")})}if(o.alias!==void 0&&o.alias.length>0){let c=o.alias;typeof o.alias=="string"&&(c=[o.alias]),n.splice(1,0,{content:c,header:"Alias(es)"})}Array.isArray(o.examples)&&o.examples.length>0&&n.push({content:o.examples,header:"Examples"});const l=[...o.commandPath??[],o.name],h=Oi(i,l);h.length>0&&n.push({content:h.map(c=>{const u=[...c.commandPath??[],c.name].join(" ");return[V(u),c.description??""]}),header:M.green(" Subcommands ")}),(e.raw??e.log)(Ut(n))},"printCommandHelp");class Xa{static{O(this,"L")}static{ur(this,"L")}static{dr(this,"x")}static{re(this,"HelpCommand")}argument={description:"Command to show help for (subcommand path supported, e.g. `cli help docker build`)",name:"command",type:String};name="help";options=[{description:"Display only the specified group",name:"group",type:String}];commands;constructor(t){this.commands=t}execute(t){const{argument:i,command:r,commandName:s,logger:o,options:n,runtime:a}=t,{footer:l,header:h}=a.getCommandSection();h&&(o.raw??o.log)(P(h));const c=s==="help"&&Array.isArray(i)&&i.length>0?i.join(" "):void 0;if(s==="help"&&c===void 0)Ja(o,a,this.commands,typeof n?.group=="string"?n.group:void 0);else{const u=c!==void 0||r===void 0||r.name==="help"?void 0:r;qa(o,a,this.commands,c??s,u)}l&&(o.raw??o.log)(P(l))}}export{Xa as default};
|