import{a as k,c as o,o as a,d as s,b as d,k as f,t,F as u,h as w,u as i,I as r,w as v,j as x}from"./app-fEKA3BkQ.js";import{_ as C}from"./Paginate-D_g9VFI3.js";import{_ as N}from"./NoDataFound-Xi4CpDbx.js";import{s as $}from"./assetStore-BSVLrDIW.js";import{_ as j}from"./UserLayout-D_lxcpvH.js";import"./PageHeader-DmRLoM5E.js";import"./ValidationErrors-B24rcOPH.js";const B={class:"table-responsive w-full"},T={class:"table"},y={class:"!text-right"},D={class:"!text-right"},E={key:0,class:"tbody"},I={key:0,class:"badge badge-success"},L={key:1,class:"badge badge-info"},V={key:2,class:"badge badge-primary"},A=["href"],F={key:1},M={class:"!text-right"},S={key:0,class:"badge badge-success"},K={key:1,class:"badge badge-warning"},O={class:"flex justify-end"},q={class:"dropdown","data-placement":"bottom-start"},z={class:"dropdown-toggle"},G={class:"dropdown-content w-56"},H={class:"dropdown-list"},J={class:"dropdown-list-item"},P={class:"dropdown-list-item"},Q=["onClick"],as=Object.assign({layout:j},{__name:"Index",props:["autoReplies"],setup(l){const{deleteRow:h,textExcerpt:p}=$();return(n,U)=>{const g=k("Link");return a(),o("div",B,[s("table",T,[s("thead",null,[s("tr",null,[s("th",null,t(n.trans("Device Name")),1),s("th",null,t(n.trans("Message Type")),1),s("th",null,t(n.trans("Template")),1),s("th",null,t(n.trans("Keywords")),1),s("th",null,t(n.trans("Message")),1),s("th",y,t(n.trans("Status")),1),s("th",D,t(n.trans("Action")),1)])]),l.autoReplies.data.length?(a(),o("tbody",E,[(a(!0),o(u,null,w(l.autoReplies.data,(e,b)=>{var c,_,m;return a(),o("tr",{key:b},[s("td",null,t((c=e.platform)==null?void 0:c.name),1),s("td",null,[e.message_type=="text"?(a(),o("span",I,t(e.message_type),1)):e.message_type=="template"?(a(),o("span",L,t(e.message_type),1)):(a(),o("span",V,t(e.message_type),1))]),s("td",null,[e.message_type=="template"?(a(),o("a",{key:0,href:`/user/whatsapp/templates/${(_=e==null?void 0:e.template)==null?void 0:_.id}`},t((m=e==null?void 0:e.template)==null?void 0:m.name),9,A)):(a(),o("span",F,"N/A"))]),s("td",null,t(e.keywords.join(", ")),1),s("td",null,t(e.message_type=="template"?i(p)(e.message_template??e.message_type,50):e.message_type),1),s("td",M,[e.status=="active"?(a(),o("span",S,t(e.status),1)):(a(),o("span",K,t(e.status),1))]),s("td",null,[s("div",O,[s("div",q,[s("div",z,[d(i(r),{class:"h-5 text-3xl text-slate-400",icon:"bx:dots-vertical-rounded"})]),s("div",G,[s("ul",H,[s("li",J,[d(g,{class:"dropdown-link",href:n.route("user.whatsapp.auto-replies.edit",e.id)},{default:v(()=>[d(i(r),{icon:"bx:bxs-edit-alt"}),s("span",null,t(n.trans("Edit")),1)]),_:2},1032,["href"])]),s("li",P,[s("button",{class:"dropdown-link delete-confirm",onClick:W=>i(h)(n.route("user.whatsapp.auto-replies.destroy",e.id))},[d(i(r),{icon:"bx:trash"}),x(" "+t(n.trans("Delete")),1)],8,Q)])])])])])])])}),128))])):(a(),f(N,{key:1,forTable:!0}))]),d(C,{links:l.autoReplies.links},null,8,["links"])])}}});export{as as default};
