import{d as b,g as d,A as r,H as g,J as o,P as u,j as e,t as i,B as n,aH as v,C,O as y,K as B,L as M,a8 as w,e as $,c as x,aI as D,h as I}from"./index-DOFLUERq.js";import{I as c}from"./iconify-p99pbjf9.js";import{_ as L}from"./_plugin-vue_export-helper-DlAUqK2U.js";const N={class:"card-header"},S={class:"card-title"},V={key:0,class:"card-actions"},z=["title"],E=["title"],H=["title"],O={class:"card-body"},T={class:"card-links"},j=["onClick"],A={class:"link-text"},F=b({__name:"CardBlock",props:{title:{},links:{},editMode:{type:Boolean}},emits:["edit","delete"],setup(l,{emit:_}){const m=_,p=$(),h=x(()=>[{label:i("Delete"),key:"delete",icon:()=>I(c,{icon:"tabler:trash",size:16})}]);function f(t){if(!t)return;const s=(t.link_type||"").toLowerCase();if(s==="pagetype"||s==="report"){const a=D(t.link_to);p.push(`/app/${a}`)}else s==="page"&&p.push(`/${t.link_to}`)}function k(t){t==="delete"&&m("delete")}return(t,s)=>(d(),r("div",{class:g(["card",{"edit-mode":l.editMode}])},[o("div",N,[o("div",S,u(e(i)(l.title)),1),l.editMode?(d(),r("div",V,[o("button",{class:"action-btn",onClick:s[0]||(s[0]=a=>t.$emit("edit")),title:e(i)("Edit")},[n(e(c),{icon:"tabler:edit"})],8,z),o("button",{class:"action-btn drag-handle",title:e(i)("Drag")},[n(e(c),{icon:"tabler:grip-vertical"})],8,E),n(e(v),{trigger:"click",options:h.value,onSelect:k},{default:C(()=>[o("button",{class:"action-btn",title:e(i)("More")},[n(e(c),{icon:"tabler:dots"})],8,H)]),_:1},8,["options"])])):y("",!0)]),o("div",O,[o("div",T,[(d(!0),r(B,null,M(l.links,a=>(d(),r("a",{key:a.label,class:"link",onClick:w(J=>f(a),["prevent"])},[o("span",A,u(e(i)(a.label)),1),n(e(c),{class:"link-icon",icon:"tabler:arrow-up-right"})],8,j))),128))])])],2))}}),q=L(F,[["__scopeId","data-v-5e2035d7"]]);export{q as default};
