import{_ as j}from"./AbstraButton.vue_vue_type_script_setup_true_lang-BPJs_oss.js";import{F as H}from"./PhKey.vue-BXYySxJN.js";import{G as $}from"./PhPencil.vue-DbapJaiy.js";import{_ as C,P as k}from"./vue-flow-core-81FTRzl4.js";import{C as z}from"./index-C8KaSCto.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 l,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-CQm3LY6y.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},c=new Error().stack;c&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[c]="9177d99a-c577-4521-accd-5b1bfc7ee41b",e._sentryDebugIdIdentifier="sentry-dbid-9177d99a-c577-4521-accd-5b1bfc7ee41b")}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:c}){const a=e,v=c,u=g(()=>a.maxVisibleColumns??5),x=g(()=>a.table.getColumns().slice(0,u.value)),w=g(()=>a.table.getColumns().length>u.value),_=g(()=>!a.highlightedColumns||a.highlightedColumns.length===0?!1:a.table.getColumns().slice(u.value).some(d=>d.id&&a.highlightedColumns?.includes(d.id))),I=m=>a.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:l(()=>[i(t(f),{align:"center",justify:"space-between"},{default:l(()=>[i(t(N),{level:5,style:{margin:"0"}},{default:l(()=>[h(y(e.table.name),1)]),_:1}),e.showEditButton?(n(),o(B,{key:0,to:`/projects/${e.projectId}/tables/${e.table.id}`},{default:l(()=>[i(j,{size:"small",type:"text"},{default:l(()=>[i(t($),{size:16})]),_:1})]),_:1},8,["to"])):r("",!0)]),_:1})]),default:l(()=>[i(t(f),{vertical:"",gap:"small",class:"columns-list"},{default:l(()=>[(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:l(()=>[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:l(()=>[h(y(s.name),1)]),_:2},1024),i(t(p),{type:"secondary",style:{"line-height":"1"}},{default:l(()=>[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:l(()=>[i(t(p),{type:"secondary",style:{"font-size":"12px"}},{default:l(()=>[h(" +"+y(e.table.getColumns().length-u.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-BO8ppmS-.js.map
