import{p as k,a as m,c as t,o as e,d as o,t as n,F as i,h as u,g as r,b}from"./app-fEKA3BkQ.js";const v={key:0},w={class:"text-center font-bold"},j={key:1,class:"rounded-md bg-slate-50 p-4 text-black dark:bg-dark-800 dark:text-slate-50"},B={key:0},I={key:0,class:"font-bold"},N=["src"],V=["src"],z=["href"],C={key:1},F={class:"text-[12px] font-light"},D={key:2},E={class:"text-[12px] font-light"},L={key:3,class:"mt-4"},M={key:0},S=["href"],T={key:1,class:"flex flex-col"},q={key:2,class:"min-w-52"},A={class:"font-weight-500 py-1 pl-1 text-lg"},G={class:"border-b py-1 text-xs font-semibold text-gray-600 dark:border-gray-600 dark:text-gray-200"},H={class:"mt-1"},J={class:"flex w-full items-start justify-between"},K={class:"text-left"},O={class:"text-sm leading-4 text-gray-600 dark:text-gray-400"},P={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},Q={class:"text-center text-[10px] text-gray-500"},W={__name:"InteractiveMessage",props:["message","components"],setup(f){const y=f,_=k(()=>{var d;return y.components||((d=y.message)==null?void 0:d.body)||{type:"",header:{},body:{},footer:{},action:{}}});return(d,R)=>{var h;const x=m("Icon");return((h=_.value)==null?void 0:h.type)=="button_reply"?(e(),t("div",v,[o("p",w,n(_.value.button_reply.title),1)])):(e(),t("div",j,[(e(!0),t(i,null,u(_.value,(s,l)=>(e(),t("div",{key:l},[l=="header"?(e(),t("div",B,[s.type=="text"?(e(),t("p",I,n(s.text),1)):r("",!0),s.type=="image"?(e(),t("img",{key:1,src:s.image.link,class:"h-36 w-full rounded object-cover"},null,8,N)):r("",!0),s.type=="video"?(e(),t("video",{key:2,src:s.video.link,class:"h-36 w-full rounded object-cover"},null,8,V)):r("",!0),s.type=="document"?(e(),t("a",{key:3,href:s.document.link,target:"_blank",rel:"noopener noreferrer"},null,8,z)):r("",!0)])):r("",!0),l=="body"?(e(),t("div",C,[o("p",F,n(s.text),1)])):r("",!0),l=="footer"?(e(),t("div",D,[o("p",E,n(s.text),1)])):r("",!0),l=="action"?(e(),t("div",L,[s.name==="cta_url"?(e(),t("div",M,[o("a",{href:s.parameters.url,class:"flex w-full items-center justify-center gap-1 border-t py-2 text-xs text-primary-500 hover:text-primary-600"},[b(x,{icon:"mdi:arrow-top-right-thin-circle-outline",class:"size-4"}),o("span",null,n(s.parameters.display_text),1)],8,S)])):r("",!0),s.buttons?(e(),t("div",T,[(e(!0),t(i,null,u(s.buttons,(c,p)=>{var a;return e(),t("button",{key:p,class:"flex w-full items-center justify-center gap-1 border-t py-2 text-xs text-primary-500 hover:text-primary-600 dark:border-gray-700"},[b(x,{icon:"basil:reply-outline",class:"size-4"}),o("span",null,n(((a=c.reply)==null?void 0:a.title)??c.title),1)])}),128))])):r("",!0),s.sections?(e(),t("div",q,[o("p",A,n(s.title),1),o("ul",null,[(e(!0),t(i,null,u(s.sections,(c,p)=>(e(),t("li",{key:p,class:"mb-6"},[o("p",G,n(c.title),1),o("ul",H,[(e(!0),t(i,null,u(c.rows,(a,g)=>(e(),t("li",{key:g,class:"border-b py-3 dark:border-gray-600"},[o("button",J,[o("div",K,[o("p",O,n(a.title),1),a.description?(e(),t("p",P,n(a.description),1)):r("",!0)])])]))),128))])]))),128))]),o("p",Q,n(d.trans("Tap an item to select it")),1)])):r("",!0)])):r("",!0)]))),128))]))}}};export{W as default};
