/* Socket Lib - Built with esbuild */
var j=Object.create;var u=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var A=(n,t)=>{for(var r in t)u(n,r,{get:t[r],enumerable:!0})},x=(n,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of y(t))!k.call(n,d)&&d!==r&&u(n,d,{get:()=>t[d],enumerable:!(i=w(t,d))||i.enumerable});return n};var M=(n,t,r)=>(r=n!=null?j(C(n)):{},x(t||!n||!n.__esModule?u(r,"default",{value:n,enumerable:!0}):r,n)),S=n=>x(u({},"__esModule",{value:!0}),n);var v={};A(v,{formatSimpleTable:()=>W,formatTable:()=>T});module.exports=S(v);var o=M(require("./external/yoctocolors-cjs")),b=require("./strings");function l(n){return(0,b.stripAnsi)(n).length}function g(n,t,r="left"){const d=(0,b.stripAnsi)(n).length,h=Math.max(0,t-d);switch(r){case"right":return" ".repeat(h)+n;case"center":{const a=Math.floor(h/2),m=h-a;return" ".repeat(a)+n+" ".repeat(m)}default:return n+" ".repeat(h)}}function T(n,t){if(n.length===0)return"(no data)";const r=t.map(e=>{const p=l(e.header),s=Math.max(...n.map(c=>l(String(c[e.key]??""))));return e.width??Math.max(p,s)}),i=[],d=`\u250C\u2500${r.map(e=>"\u2500".repeat(e)).join("\u2500\u252C\u2500")}\u2500\u2510`;i.push(o.default.dim(d));const h=t.map((e,p)=>{const s=o.default.bold(e.header);return g(s,r[p],e.align)});i.push(o.default.dim("\u2502 ")+h.join(o.default.dim(" \u2502 "))+o.default.dim(" \u2502"));const a=`\u251C\u2500${r.map(e=>"\u2500".repeat(e)).join("\u2500\u253C\u2500")}\u2500\u2524`;i.push(o.default.dim(a));for(const e of n){const p=t.map((s,c)=>{let f=String(e[s.key]??"");return s.color&&(f=s.color(f)),g(f,r[c],s.align)});i.push(o.default.dim("\u2502 ")+p.join(o.default.dim(" \u2502 "))+o.default.dim(" \u2502"))}const m=`\u2514\u2500${r.map(e=>"\u2500".repeat(e)).join("\u2500\u2534\u2500")}\u2500\u2518`;return i.push(o.default.dim(m)),i.join(`
`)}function W(n,t){if(n.length===0)return"(no data)";const r=t.map(a=>{const m=l(a.header),e=Math.max(...n.map(p=>l(String(p[a.key]??""))));return a.width??Math.max(m,e)}),i=[],d=t.map((a,m)=>g(o.default.bold(a.header),r[m],a.align));i.push(d.join("  "));const h=r.map(a=>o.default.dim("\u2500".repeat(a)));i.push(h.join("  "));for(const a of n){const m=t.map((e,p)=>{let s=String(a[e.key]??"");return e.color&&(s=e.color(s)),g(s,r[p],e.align)});i.push(m.join("  "))}return i.join(`
`)}0&&(module.exports={formatSimpleTable,formatTable});
//# sourceMappingURL=tables.js.map
