const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AudioMessage-C0wgRQWJ.js","assets/app-fEKA3BkQ.js","assets/app-D5HAdpT2.css","assets/ContactMessage-ll-MD5fQ.js","assets/PageHeader-DmRLoM5E.js","assets/assetStore-BSVLrDIW.js","assets/PageHeader-CWoONquL.css","assets/ContactMessage-CcL4C1YP.css","assets/ContactsMessage-Ci7vTy9C.js","assets/DocumentMessage-CaOQ3Rzw.js","assets/ImageMessage-BdUrxq6Q.js","assets/InteractiveMessage-GTvMPNF-.js","assets/LocationMessage-CFhrIr3r.js","assets/StickerMessage-BhjHJ8Wp.js","assets/TemplateMessage-BervSzlz.js","assets/TextMessage-GyyoF2yM.js","assets/VideoMessage-BRSiu9eU.js"])))=>i.map(i=>d[i]);
import{c as u,o as n,j as m,d as v,t as d,r as y,p as P,g as p,k as g,u as f,a3 as E,a1 as x,K as M,_ as e}from"./app-fEKA3BkQ.js";import{_ as b}from"./dynamic-import-helper-BheWnx7M.js";import{_ as h}from"./SpinnerBtn-BezRkGQj.js";import{t as w}from"./assetStore-BSVLrDIW.js";const A={class:"bg-white p-3 italic text-gray-500"},T={class:"font-semibold"},l={__name:"UnsupportedMessage",props:["message"],setup(o){return(r,a)=>(n(),u("p",A,[a[0]||(a[0]=m(d("unsupported message type:")+' "',-1)),v("span",T,d(o.message.type),1),a[1]||(a[1]=m('" ',-1))]))}},D=Object.freeze(Object.defineProperty({__proto__:null,default:l},Symbol.toStringTag,{value:"Module"})),O=["title"],R={key:0,class:"dark: m-2 flex justify-center rounded-lg border border-gray-700 bg-gray-100 p-5 dark:bg-gray-800"},C={__name:"MessagePreview",props:{message:{type:Object,required:!0}},setup(o){const r=o,a=()=>{const t=r.message.type,s=`${t[0].toUpperCase()}${t.slice(1)}Message`;return M({loader:()=>b(Object.assign({"./Preview/AudioMessage.vue":()=>e(()=>import("./AudioMessage-C0wgRQWJ.js"),__vite__mapDeps([0,1,2])),"./Preview/ContactMessage.vue":()=>e(()=>import("./ContactMessage-ll-MD5fQ.js"),__vite__mapDeps([3,4,1,2,5,6,7])),"./Preview/ContactsMessage.vue":()=>e(()=>import("./ContactsMessage-Ci7vTy9C.js"),__vite__mapDeps([8,1,2])),"./Preview/DocumentMessage.vue":()=>e(()=>import("./DocumentMessage-CaOQ3Rzw.js"),__vite__mapDeps([9,1,2])),"./Preview/ImageMessage.vue":()=>e(()=>import("./ImageMessage-BdUrxq6Q.js"),__vite__mapDeps([10,1,2])),"./Preview/InteractiveMessage.vue":()=>e(()=>import("./InteractiveMessage-GTvMPNF-.js"),__vite__mapDeps([11,1,2])),"./Preview/LocationMessage.vue":()=>e(()=>import("./LocationMessage-CFhrIr3r.js"),__vite__mapDeps([12,1,2])),"./Preview/StickerMessage.vue":()=>e(()=>import("./StickerMessage-BhjHJ8Wp.js"),__vite__mapDeps([13,1,2])),"./Preview/TemplateMessage.vue":()=>e(()=>import("./TemplateMessage-BervSzlz.js"),__vite__mapDeps([14,1,2])),"./Preview/TextMessage.vue":()=>e(()=>import("./TextMessage-GyyoF2yM.js"),__vite__mapDeps([15,1,2])),"./Preview/UnsupportedMessage.vue":()=>e(()=>Promise.resolve().then(()=>D),void 0),"./Preview/VideoMessage.vue":()=>e(()=>import("./VideoMessage-BRSiu9eU.js"),__vite__mapDeps([16,1,2]))}),`./Preview/${s}.vue`,3),errorComponent:l})},i=y(!1),_=P(()=>{var t,s;return((t=r.message.body)==null?void 0:t.mime_type)&&((s=r.message.meta)==null?void 0:s.media_url)==""}),c=()=>{i.value||(i.value=!0,axios.post(route("user.whatsapp.messages.load-attachment",r.message.uuid)).then(t=>{console.log("Attachment loaded:",t.data),r.message.meta=t.data,_.value=!1}).catch(t=>{var s;w.danger(((s=t.response.data)==null?void 0:s.message)??"Server Error")}).finally(()=>{i.value=!1}))};return(t,s)=>(n(),u("div",{title:o.message.type,class:"text-danger rounded-primary rounded-tl-none bg-slate-100 p-2 text-sm group-[.pr]:rounded-tl-primary group-[.pr]:rounded-tr-none group-[.pr]:text-white dark:bg-slate-700 dark:text-slate-300"},[_.value?(n(),u("div",R,[_.value?(n(),g(h,{key:0,onClick:c,processing:i.value,"btn-text":i.value?"Loading...":f(E)("Refresh"),icon:"bx:refresh",title:"Refresh Message Attachment",classes:"flex justify-center items-center text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"},null,8,["processing","btn-text"])):p("",!0)])):p("",!0),(n(),g(x(a()),{message:o.message},null,8,["message"]))],8,O))}};export{C as default};
