import{s as b}from"./chunk-LvLJmgfZ.js";import{t as z}from"./react-Bj1aDYRI.js";import{Tr as T}from"./cells-ChH37lAD.js";import{t as S}from"./compiler-runtime-B3qBwwSJ.js";import{_}from"./useEventListener-BakX-tnw.js";import{t as x}from"./cn-X2M2usMq.js";import{t as B}from"./jsx-runtime-PbYoItBR.js";import{t as M}from"./tooltip-CgQpRVyN.js";import{t as k}from"./button-BF7GSjhW.js";import{t as V}from"./createLucideIcon-BTp1tQDO.js";import{t as P}from"./chevron-right-C7RH0Nc7.js";import{n as R,t as A}from"./eye-off-DI0EQXw0.js";import{t as D}from"./refresh-cw-C9FftltI.js";var E=V("chevrons-down-up",[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]);const j={keyBy(o,t){let e=new Map,a=new Set;for(let s of o){let r=t(s);e.has(r)&&a.add(r),e.set(r,s)}return a.size>0&&_.trace(`Duplicate keys: ${[...a].join(", ")}`),e},collect(o,t,e){return j.mapValues(j.keyBy(o,t),e)},filterMap(o,t){let e=new Map;for(let[a,s]of o)t(s,a)&&e.set(a,s);return e},mapValues(o,t){let e=new Map;for(let[a,s]of o)e.set(a,t(s,a));return e}};var v=S(),C=b(z(),1),m=b(B(),1);const I=o=>{let t=(0,v.c)(5),{isExpanded:e,className:a}=o,s=e&&"rotate-90",r;t[0]!==a||t[1]!==s?(r=x("shrink-0 transition-transform",s,a),t[0]=a,t[1]=s,t[2]=r):r=t[2];let i;return t[3]===r?i=t[4]:(i=(0,m.jsx)(P,{className:r}),t[3]=r,t[4]=i),i},$=({onClick:o,tooltip:t="Refresh",className:e,iconClassName:a})=>{let[s,r]=(0,C.useState)(!1);return(0,m.jsx)(M,{content:t,children:(0,m.jsx)(k,{variant:"text",size:"xs",className:e,onClick:(0,C.useCallback)(async i=>{r(!0);let l=new Promise(n=>setTimeout(n,500));try{await Promise.all([o(i),l])}finally{r(!1)}},[o]),children:(0,m.jsx)(D,{className:x("h-4 w-4",a,s&&"animate-[spin_0.5s]")})})})},q=o=>{let t=(0,v.c)(15),{isVisible:e,onToggle:a,showTooltip:s,hideTooltip:r,size:i,className:l,iconClassName:n,"data-testid":c}=o,u=i===void 0?"xs":i,y=e?T:A,w=e?r:s,N=e&&"text-primary",p;t[0]!==n||t[1]!==N?(p=x("h-4 w-4",N,n),t[0]=n,t[1]=N,t[2]=p):p=t[2];let f;t[3]!==y||t[4]!==p?(f=(0,m.jsx)(y,{className:p}),t[3]=y,t[4]=p,t[5]=f):f=t[5];let d;t[6]!==l||t[7]!==c||t[8]!==a||t[9]!==u||t[10]!==f?(d=(0,m.jsx)(k,{"data-testid":c,variant:"text",size:u,className:l,onClick:a,children:f}),t[6]=l,t[7]=c,t[8]=a,t[9]=u,t[10]=f,t[11]=d):d=t[11];let h;return t[12]!==w||t[13]!==d?(h=(0,m.jsx)(M,{content:w,children:d}),t[12]=w,t[13]=d,t[14]=h):h=t[14],h},g=C.forwardRef((o,t)=>{let e=(0,v.c)(15),a,s,r;e[0]===o?(a=e[1],s=e[2],r=e[3]):({className:a,iconClassName:s,...r}=o,e[0]=o,e[1]=a,e[2]=s,e[3]=r);let i;e[4]===a?i=e[5]:(i=x("mb-0 opacity-0 group-hover:opacity-100 transition-opacity",a),e[4]=a,e[5]=i);let l;e[6]===s?l=e[7]:(l=x("w-4 h-4",s),e[6]=s,e[7]=l);let n;e[8]===l?n=e[9]:(n=(0,m.jsx)(R,{className:l}),e[8]=l,e[9]=n);let c;return e[10]!==r||e[11]!==t||e[12]!==i||e[13]!==n?(c=(0,m.jsx)(k,{ref:t,variant:"text",tabIndex:-1,size:"xs",className:i,"aria-label":"More options",...r,children:n}),e[10]=r,e[11]=t,e[12]=i,e[13]=n,e[14]=c):c=e[14],c});g.displayName="MoreActionsButton";const F="h-3.5 w-3.5 mr-2";export{q as a,I as i,g as n,j as o,$ as r,E as s,F as t};
