import{s as w,m as k,h as y,c as l,a as i,b as t,u as d,t as e,F as S,r as j,w as M,d as g,v as C,f as O,g as V,o as c,n as Y,O as z,q as B}from"./app-13978987.js";import{_ as D}from"./AdminLayout-bd13ff9d.js";import{_ as F}from"./PageHeader-8c638686.js";import{h as I}from"./moment-a9aaa855.js";import"./dropdown-45d66330.js";const N={class:"container flex-grow p-4 sm:pr-4"},T={class:"h-fit space-y-6"},U={class:"h-full"},$={class:"relative mx-auto rounded-primary bg-white shadow dark:bg-slate-800 2xl:w-8/12"},q={class:"flex items-center justify-between rounded-t-primary border-b border-b-slate-200 p-4 dark:border-b-slate-600"},A={class:"flex items-center justify-start gap-x-3"},E={id:"chat-btn-show-sidebar",class:"text-slate-500 hover:text-slate-700 focus:text-slate-700 dark:text-slate-400 dark:hover:text-slate-300 dark:focus:text-slate-300 xl:hidden"},L={class:"avatar avatar-circle avatar-indicator avatar-indicator-online"},P=["src"],G={class:"whitespace-nowrap text-sm font-medium text-slate-700 dark:text-slate-100"},H={class:"whitespace-normal text-sm font-normal text-slate-500 dark:text-slate-400"},J={class:"relative max-h-[calc(100vh-18rem)] overflow-auto px-4 pb-28 md:max-h-[calc(100vh-17rem)]","data-simplebar":""},K={class:"space-y-3"},Q={class:"flex gap-x-3 group-[.pr]:flex-row-reverse"},R={class:"avatar avatar-circle avatar-sm shrink-0"},W=["src"],X={class:"flex max-w-sm flex-col items-start gap-y-2 group-[.pr]:items-end"},Z={class:"rounded-primary rounded-tl-none bg-slate-100 p-2 text-sm text-slate-600 group-[.pr]:rounded-tl-primary group-[.pr]:rounded-tr-none group-[.pr]:bg-primary-500 group-[.pr]:text-slate-100 dark:bg-slate-700 dark:text-slate-300"},tt={class:"text-xs font-normal text-slate-400"},st=t("div",{id:"chat-scroll-view"},null,-1),et={class:"absolute bottom-[-0.5px] left-0 right-0 z-10 rounded-b-primary bg-white py-4 dark:bg-slate-800"},at={class:"flex items-center justify-end gap-x-4 px-4"},ot={value:"1"},rt={value:"2"},nt={value:"0"},lt=["disabled"],it={class:"hidden md:inline-block"},dt=t("div",{id:"chat-overlay",class:"absolute inset-0 z-10 hidden h-full w-full bg-black bg-opacity-0 transition-colors duration-300 ease-in-out xl:hidden"},null,-1),ct=V({layout:D}),_t=Object.assign(ct,{__name:"Show",props:["segments","buttons","support"],setup(o){const{uiAvatar:u}=w(),m=o,a=k({message:"",status:m.support.status}),x=()=>{z.patch(route("admin.support.update",m.support.id),{status:a.value.status,message:a.value.message},{onSuccess:()=>{a.value.message="",B.success("Submitted successfully")}})};return(r,n)=>{var h,v,_;const p=y("Icon");return c(),l("main",N,[i(F,{title:"Support",buttons:o.buttons},null,8,["buttons"]),t("div",T,[t("div",U,[t("div",$,[t("div",q,[t("div",A,[t("button",E,[i(p,{icon:"fe:menu",height:"1rem",width:"1rem"})]),t("div",L,[t("img",{class:"avatar-img",src:d(u)((h=o.support.user)==null?void 0:h.name,(v=o.support.user)==null?void 0:v.avatar),alt:"profile-img"},null,8,P)]),t("div",null,[t("h6",G,e((_=o.support.user)==null?void 0:_.name),1),t("p",H,e(r.trans("Subject :"))+" "+e(o.support.subject??""),1)])])]),t("div",J,[t("ul",K,[(c(!0),l(S,null,j(o.support.conversations,s=>{var b,f;return c(),l("li",{class:Y(["group mt-5",s.is_admin!=0?"pr":""]),key:s.id},[t("div",Q,[t("div",R,[t("img",{class:"avatar-img",src:d(u)((b=s.user)==null?void 0:b.name,(f=s.user)==null?void 0:f.avatar),onerror:"this.src = '/images/avatar1.png'",alt:"profile-img"},null,8,W)]),t("div",X,[t("p",Z,e(s.comment),1),t("span",tt,e(d(I)(s.created_at).format("D MMM, YYYY")),1)])])],2)}),128))]),st]),t("div",et,[t("form",{onSubmit:M(x,["prevent"]),class:"mx-4 flex h-[4.5rem] items-center rounded-primary border border-slate-200 shadow dark:border-slate-600"},[g(t("input",{"onUpdate:modelValue":n[0]||(n[0]=s=>a.value.message=s),class:"h-full w-full border-transparent bg-transparent px-4 text-sm text-slate-700 placeholder:text-slate-500 focus:border-transparent focus:ring-0 dark:text-slate-300 dark:placeholder:text-slate-400",type:"text",placeholder:"Type your message here"},null,512),[[C,a.value.message]]),t("div",at,[g(t("select",{class:"select w-[120px]",name:"status","onUpdate:modelValue":n[1]||(n[1]=s=>a.value.status=s)},[t("option",ot,e(r.trans("Open")),1),t("option",rt,e(r.trans("Pending")),1),t("option",nt,e(r.trans("Closed")),1)],512),[[O,a.value.status]]),t("button",{type:"submit",disabled:a.value.processing,class:"btn btn-sm btn-primary"},[i(p,{icon:"fe:send",height:"1rem",width:"1rem"}),t("span",it,e(r.trans("Send")),1)],8,lt)])],32)])]),dt])])])}}});export{_t as default};
