import{_ as z}from"./AbstraButton.vue_vue_type_script_setup_true_lang.d8bcc7e4.js";import{F as H}from"./PhKey.vue.4738d25e.js";import{G as T}from"./PhPencil.vue.4e45fda4.js";import{f as v,c as k}from"./vue-flow-core.b8b3bffa.js";import{d as $,c as g,j as D,o as i,a as c,b as a,f as o,u as t,A as V,g as h,t as y,h as u,dj as b,ac as A,eB as E,ez as p,df as C,aY as L,_ as F}from"./jwt-decode.esm.7c9b757c.js";import{C as K}from"./Card.929a13fd.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},m=new Error().stack;m&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[m]="96d58fa2-1920-47ac-a4cb-8e5eabb0a253",e._sentryDebugIdIdentifier="sentry-dbid-96d58fa2-1920-47ac-a4cb-8e5eabb0a253")}catch{}})();const N=$({__name:"TableCard",props:{table:{},projectId:{},showHandles:{type:Boolean},maxVisibleColumns:{},connectedColumns:{},highlightedColumns:{},isHighlighted:{type:Boolean},showEditButton:{type:Boolean,default:!0}},emits:["dblclick"],setup(e,{emit:m}){const l=e,x=m,f=g(()=>{var d;return(d=l.maxVisibleColumns)!=null?d:5}),w=g(()=>l.table.getColumns().slice(0,f.value)),B=g(()=>l.table.getColumns().length>f.value),I=g(()=>!l.highlightedColumns||l.highlightedColumns.length===0?!1:l.table.getColumns().slice(f.value).some(n=>{var r;return n.id&&((r=l.highlightedColumns)==null?void 0:r.includes(n.id))})),j=d=>{var n,r;return(r=(n=l.connectedColumns)==null?void 0:n.includes(d))!=null?r:!1};return(d,n)=>{const r=D("RouterLink");return i(),c(t(K),{hoverable:!0,class:p(["table-card",{"table-highlighted":e.isHighlighted}]),onDblclick:n[0]||(n[0]=s=>x("dblclick"))},{title:a(()=>[o(t(b),{align:"center",justify:"space-between"},{default:a(()=>[o(t(V),{level:5,style:{margin:"0"}},{default:a(()=>[h(y(e.table.name),1)]),_:1}),e.showEditButton?(i(),c(r,{key:0,to:`/projects/${e.projectId}/tables/${e.table.id}`},{default:a(()=>[o(z,{size:"small",type:"text"},{default:a(()=>[o(t(T),{size:16})]),_:1})]),_:1},8,["to"])):u("",!0)]),_:1})]),default:a(()=>[o(t(b),{vertical:"",gap:"small",class:"columns-list"},{default:a(()=>[(i(!0),A(L,null,E(w.value,s=>{var _;return i(),c(t(b),{key:s.id,align:"center",gap:"small",class:p(["column-row",{"column-highlighted":s.id&&((_=e.highlightedColumns)==null?void 0:_.includes(s.id))}])},{default:a(()=>[e.showHandles&&s.foreignKey?(i(),c(t(v),{key:0,id:`target-${s.id}`,type:"target",position:t(k).Left,connectable:!1},null,8,["id","position"])):u("",!0),s.primaryKey?(i(),c(t(H),{key:1,size:14,class:"key-icon"})):u("",!0),o(t(C),{strong:"",style:{flex:"1","font-size":"13px","line-height":"1"}},{default:a(()=>[h(y(s.name),1)]),_:2},1024),o(t(C),{type:"secondary",style:{"line-height":"1"}},{default:a(()=>[h(y(s.type),1)]),_:2},1024),e.showHandles&&(s.primaryKey||s.id&&j(s.id))?(i(),c(t(v),{key:2,id:`source-${s.id}`,type:"source",position:t(k).Right,connectable:!1},null,8,["id","position"])):u("",!0)]),_:2},1032,["class"])}),128)),B.value?(i(),c(t(b),{key:0,justify:"center",align:"center",style:{"padding-top":"8px"},class:p({"more-columns-highlighted":I.value})},{default:a(()=>[o(t(C),{type:"secondary",style:{"font-size":"12px"}},{default:a(()=>[h(" +"+y(e.table.getColumns().length-f.value)+" more columns ",1)]),_:1})]),_:1},8,["class"])):u("",!0)]),_:1})]),_:1},8,["class"])}}});const q=F(N,[["__scopeId","data-v-e197befa"]]);export{q as T};
//# sourceMappingURL=TableCard.0dc4cff2.js.map
