import{d as v,r as C,aj as x,ai as b,al as p,as as B,af as i,ae as a,an as Q,ao as s,av as u,aw as k,ap as n,ad as w,ay as q,at as d,am as I}from"./index-BT5eY4j5.js";import{Q as N}from"./QBtnGroup-CDloiE4i.js";const V={class:"text-h6 q-mb-xs"},A={class:"text-subtitle2"},S={class:"text-caption"},_={key:0},$=["href"],D=v({__name:"AppointmentCancel",props:{appointmentId:{},title:{},subtitle:{},date:{},phone:{},status:{type:Boolean}},emits:["statusChange"],setup(c,{emit:m}){const f=c,h=m,o=C(!1),g=x(),y=b();async function r(e){o.value=!0;const t=await g.toggleAppointment(f.appointmentId,e).then(l=>l.status<300).catch(()=>!1);o.value=!1,t?h("statusChange",e):y.notify({type:"negative",message:"Unexpected error occurred!"})}return(e,t)=>(p(),B(I,{flat:"",style:{"min-width":"240px","max-width":"400px"}},{default:i(()=>[a(Q,null,{default:i(()=>[s("h1",V,[a(u,{name:"event",size:"sm",class:"q-mr-xs"}),k(n(e.title),1)]),s("p",A,n(e.subtitle),1),s("p",S,n(e.date.toLocaleString()),1),e.phone?(p(),w("p",_,[a(u,{name:"phone",class:"q-mr-xs text-primary"}),s("a",{href:"tel:"+e.phone,style:{"text-decoration":"none"},class:"text-weight-bold text-caption text-primary"},n(e.phone),9,$)])):q("",!0),t[2]||(t[2]=s("div",{style:{height:"16px"}},null,-1)),a(N,null,{default:i(()=>[a(d,{icon:"done",color:"primary",outline:!e.status,loading:!e.status&&o.value,disable:"",onClick:t[0]||(t[0]=l=>r(!0))},null,8,["outline","loading"]),a(d,{icon:"close",color:"red-7",outline:e.status,loading:e.status&&o.value,disable:!e.status,onClick:t[1]||(t[1]=l=>r(!1))},null,8,["outline","loading","disable"])]),_:1})]),_:1})]),_:1}))}});export{D as _};
