import{_ as j}from"./AbstraButton.vue_vue_type_script_setup_true_lang-C8pP27Qo.js";import{F as H}from"./PhKey.vue-DBqckwv8.js";import{G as $}from"./PhPencil.vue-9qE0PBL8.js";import{_ as C,P as k}from"./vue-flow-core-DfGpqJrt.js";import{C as z}from"./index-CO1CcaGf.js";import{a as D,c as g,a4 as T,p as o,e as n,u as t,E as b,w as a,j as i,b as V,g as r,M as E,W as L,v as f,ak as p,S as h,U as y,aj as N,aN as F}from"./jwt-decode.esm-DyyavT6h.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},u=new Error().stack;u&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[u]="2df00e88-01a5-4b99-a3a1-420a4109502d",e._sentryDebugIdIdentifier="sentry-dbid-2df00e88-01a5-4b99-a3a1-420a4109502d")}catch{}})();const K=D({__name:"TableCard",props:{table:{},projectId:{},showHandles:{type:Boolean},maxVisibleColumns:{},connectedColumns:{},highlightedColumns:{},isHighlighted:{type:Boolean},showEditButton:{type:Boolean,default:!0}},emits:["dblclick"],setup(e,{emit:u}){const l=e,v=u,c=g(()=>l.maxVisibleColumns??5),x=g(()=>l.table.getColumns().slice(0,c.value)),w=g(()=>l.table.getColumns().length>c.value),_=g(()=>!l.highlightedColumns||l.highlightedColumns.length===0?!1:l.table.getColumns().slice(c.value).some(d=>d.id&&l.highlightedColumns?.includes(d.id))),I=m=>l.connectedColumns?.includes(m)??!1;return(m,d)=>{const B=T("RouterLink");return n(),o(t(z),{hoverable:!0,class:b(["table-card",{"table-highlighted":e.isHighlighted}]),onDblclick:d[0]||(d[0]=s=>v("dblclick"))},{title:a(()=>[i(t(f),{align:"center",justify:"space-between"},{default:a(()=>[i(t(N),{level:5,style:{margin:"0"}},{default:a(()=>[h(y(e.table.name),1)]),_:1}),e.showEditButton?(n(),o(B,{key:0,to:`/projects/${e.projectId}/tables/${e.table.id}`},{default:a(()=>[i(j,{size:"small",type:"text"},{default:a(()=>[i(t($),{size:16})]),_:1})]),_:1},8,["to"])):r("",!0)]),_:1})]),default:a(()=>[i(t(f),{vertical:"",gap:"small",class:"columns-list"},{default:a(()=>[(n(!0),V(E,null,L(x.value,s=>(n(),o(t(f),{key:s.id,align:"center",gap:"small",class:b(["column-row",{"column-highlighted":s.id&&e.highlightedColumns?.includes(s.id)}])},{default:a(()=>[e.showHandles&&s.foreignKey?(n(),o(t(C),{key:0,id:`target-${s.id}`,type:"target",position:t(k).Left,connectable:!1},null,8,["id","position"])):r("",!0),s.primaryKey?(n(),o(t(H),{key:1,size:14,class:"key-icon"})):r("",!0),i(t(p),{strong:"",style:{flex:"1","font-size":"13px","line-height":"1"}},{default:a(()=>[h(y(s.name),1)]),_:2},1024),i(t(p),{type:"secondary",style:{"line-height":"1"}},{default:a(()=>[h(y(s.type),1)]),_:2},1024),e.showHandles&&(s.primaryKey||s.id&&I(s.id))?(n(),o(t(C),{key:2,id:`source-${s.id}`,type:"source",position:t(k).Right,connectable:!1},null,8,["id","position"])):r("",!0)]),_:2},1032,["class"]))),128)),w.value?(n(),o(t(f),{key:0,justify:"center",align:"center",style:{"padding-top":"8px"},class:b({"more-columns-highlighted":_.value})},{default:a(()=>[i(t(p),{type:"secondary",style:{"font-size":"12px"}},{default:a(()=>[h(" +"+y(e.table.getColumns().length-c.value)+" more columns ",1)]),_:1})]),_:1},8,["class"])):r("",!0)]),_:1})]),_:1},8,["class"])}}}),U=F(K,[["__scopeId","data-v-e197befa"]]);export{U as T};
//# sourceMappingURL=TableCard-z_yo_KTU.js.map
