const o=[168,184,198,208,218,228,238,248,258,268,278,292],s=2e5;function i(t){const r=new Date(t);return`${r.getFullYear()}-${`${r.getMonth()+1}`.padStart(2,"0")}-${`${r.getDate()}`.padStart(2,"0")} ${`${r.getHours()}`.padStart(2,"0")}:${`${r.getMinutes()}`.padStart(2,"0")}:${`${r.getSeconds()}`.padStart(2,"0")}`}function u(t){return t==null?"-":t.toLocaleString()}function l(t,r){const n=u(t);return n==="-"?"-":`${n} ${r}`}function f(t){return t?"true":"false"}function g(t,r){if(!t||t.trim().length===0)return r;if(t.length>s)return t;try{const n=JSON.parse(t);return JSON.stringify(n,null,2)}catch{return t}}function S(t,r){return t.status_code===null||t.status_code===void 0?t.error?{label:r("common.status.error"),tone:"error",variant:"destructive"}:{label:r("common.status.pending"),tone:"pending",variant:"warning"}:t.error||t.status_code>=400?{label:t.status_code.toString(),tone:"error",variant:"destructive"}:{label:t.status_code.toString(),tone:"success",variant:"success"}}function c(t){let r=0;for(let n=0;n<t.length;n+=1)r=r*31+t.charCodeAt(n)>>>0;return r}function d(t){const r=t==null?void 0:t.trim();if(!r)return null;const n=c(r),e=o[n%o.length],a=`hsl(${e} 74% 46%)`;return{sessionId:r,colorKey:`${e}`,rowStyle:{backgroundColor:`hsl(${e} 74% 46% / 0.05)`},hoverStyle:{backgroundColor:`hsl(${e} 74% 46% / 0.09)`},stickyStyle:{backgroundColor:`hsl(${e} 74% 46% / 0.08)`},accentStyle:{borderLeft:`3px solid ${a}`}}}export{l as a,i as b,f as c,u as d,d as e,g as f,S as g};
