1import{az as T,aA as c,aB as d,aC as a,b3 as K,a_ as q,aK as i,aY as R,aV as Z,b1 as D,aD as E,aE as k,aZ as $,ay as F,bq as G,br as P,a$ as W,bp as L,aN as j,aS as Y,aU as J,aW as Q,b0 as X}from"./entry.1f28c19f.js";import{_ as ee,a as te}from"./AcceptCall.a2cc0049.js";import{z as ae,A as oe,y as ne,B as N,C as le,D as se}from"./services.05f230ec.js";import{M as ce}from"./Minimize.3fde68b0.js";import{_ as ie}from"./Back.1f6417b4.js";import{_ as U,P as re,E as de}from"./pusher.cc239d66.js";import{_ as ue}from"./ModalClose.db38bb12.js";import _e from"./RecordAudio.134575ff.js";import he from"./MessageItem.31aaf657.js";import{_ as ve}from"./chat.1b41b0ce.js";import"./SendMessage.6fbbf2fa.js";import"./SidebarTreatmentPlan.0d6e6020.js";import"./VoiceMessage.59b31806.js";import"./VideoPlay.bd409aac.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new l.Error().stack;t&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[t]="bc73ad15-a843-4e7d-9fb2-cf2879d06488",l._sentryDebugIdIdentifier="sentry-dbid-bc73ad15-a843-4e7d-9fb2-cf2879d06488")}catch{}})();const me={setup(){return{}}},Ce={xmlns:"http://www.w3.org/2000/svg",width:"33",height:"32",viewBox:"0 0 33 32",fill:"none"},fe=a("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.83398 12C6.38627 12 6.83398 12.4477 6.83398 13V14.3333C6.83398 19.672 11.1619 24 16.5007 24C21.8394 24 26.1673 19.672 26.1673 14.3333V13C26.1673 12.4477 26.615 12 27.1673 12C27.7196 12 28.1673 12.4477 28.1673 13V14.3333C28.1673 20.4398 23.4759 25.4505 17.5007 25.9577V29C17.5007 29.5522 17.0529 30 16.5007 30C15.9484 30 15.5007 29.5522 15.5007 29V25.9577C9.52545 25.4505 4.83398 20.4398 4.83398 14.3333V13C4.83398 12.4477 5.2817 12 5.83398 12Z",fill:"white"},null,-1),ge=a("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16.5007 2.66663C12.2665 2.66663 8.83398 6.09911 8.83398 10.3333V14.3333C8.83398 18.5675 12.2665 22 16.5007 22C20.7348 22 24.1673 18.5675 24.1673 14.3333V10.3333C24.1673 6.09911 20.7348 2.66663 16.5007 2.66663ZM19.1673 15.3333C19.7196 15.3333 20.1673 14.8856 20.1673 14.3333C20.1673 13.781 19.7196 13.3333 19.1673 13.3333H13.834C13.2817 13.3333 12.834 13.781 12.834 14.3333C12.834 14.8856 13.2817 15.3333 13.834 15.3333H19.1673ZM18.834 10.3333C18.834 10.8856 18.3863 11.3333 17.834 11.3333H15.1673C14.615 11.3333 14.1673 10.8856 14.1673 10.3333C14.1673 9.78101 14.615 9.33329 15.1673 9.33329H17.834C18.3863 9.33329 18.834 9.78101 18.834 10.3333Z",fill:"white"},null,-1),pe=[fe,ge];function we(l,t,o,e,s,m){return c(),d("svg",Ce,pe)}const ke=T(me,[["render",we]]),Me={setup(){return{}}},ye={xmlns:"http://www.w3.org/2000/svg",width:"33",height:"32",viewBox:"0 0 33 32",fill:"none"},Ve=a("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M16.4987 3C12.2645 3 8.83203 6.43248 8.83203 10.6667V14.6667C8.83203 17.2766 10.1362 19.5819 12.1283 20.9665L17.4935 15.6013C17.319 15.6435 17.1575 15.6667 17.032 15.6667H13.832C13.2797 15.6667 12.832 15.219 12.832 14.6667C12.832 14.1144 13.2797 13.6667 13.832 13.6667H17.832C18.2637 13.6667 18.6315 13.9402 18.7715 14.3233L24.0034 9.09145C23.2769 5.6129 20.193 3 16.4987 3ZM24.1654 11.9999L14.1867 21.9786C14.9162 22.209 15.693 22.3333 16.4987 22.3333C20.7329 22.3333 24.1654 18.9008 24.1654 14.6667V11.9999ZM10.6961 22.3987C8.34964 20.635 6.83203 17.8281 6.83203 14.6667V13.3333C6.83203 12.781 6.38432 12.3333 5.83203 12.3333C5.27975 12.3333 4.83203 12.781 4.83203 13.3333V14.6667C4.83203 18.3799 6.56681 21.688 9.27012 23.8247L10.6961 22.3987ZM11.1352 25.0301L12.635 23.5303C13.8183 24.0468 15.125 24.3333 16.4987 24.3333C21.8375 24.3333 26.1654 20.0054 26.1654 14.6667V13.3333C26.1654 12.781 26.6131 12.3333 27.1654 12.3333C27.7176 12.3333 28.1654 12.781 28.1654 13.3333V14.6667C28.1654 20.7731 23.4739 25.7838 17.4987 26.2911V29.3333C17.4987 29.8856 17.051 30.3333 16.4987 30.3333C15.9464 30.3333 15.4987 29.8856 15.4987 29.3333V26.2911C13.9361 26.1584 12.4613 25.7178 11.1352 25.0301ZM15.1654 9.66667C14.6131 9.66667 14.1654 10.1144 14.1654 10.6667C14.1654 11.219 14.6131 11.6667 15.1654 11.6667H17.832C18.3843 11.6667 18.832 11.219 18.832 10.6667C18.832 10.1144 18.3843 9.66667 17.832 9.66667H15.1654Z",fill:"white"},null,-1),De=a("path",{d:"M29.3014 3.20044L2.63477 29.8671",stroke:"white","stroke-width":"2.17112","stroke-linecap":"round"},null,-1),be=[Ve,De];function Te(l,t,o,e,s,m){return c(),d("svg",ye,be)}const xe=T(Me,[["render",Te]]),Se={setup(){return{}}},Ie={xmlns:"http://www.w3.org/2000/svg",width:"33",height:"32",viewBox:"0 0 33 32",fill:"none"},Le=a("path",{d:"M3.16602 15.3334V16.6667C3.16602 21.05 3.16602 23.2417 4.37663 24.7168C4.59825 24.9869 4.84587 25.2345 5.11592 25.4561C6.59105 26.6667 8.78271 26.6667 13.166 26.6667C17.5493 26.6667 19.741 26.6667 21.2161 25.4561C21.4862 25.2345 21.7338 24.9869 21.9554 24.7168C22.8908 23.577 23.1035 22.0093 23.1518 19.3334L24.0438 19.7723C26.6383 21.0695 27.9356 21.7182 28.8841 21.1319C29.8327 20.5457 29.8327 19.0953 29.8327 16.1946V15.8055C29.8327 12.9047 29.8327 11.4544 28.8841 10.8681C27.9356 10.2819 26.6383 10.9305 24.0438 12.2278L23.1518 12.6667C23.1035 9.99075 22.8908 8.42311 21.9554 7.28328C2
11.7338 7.01323 21.4862 6.76561 21.2161 6.54399C19.741 5.33337 17.5493 5.33337 13.166 5.33337C8.78271 5.33337 6.59105 5.33337 5.11592 6.54399C4.84587 6.76561 4.59825 7.01323 4.37663 7.28328C3.16602 8.75841 3.16602 10.9501 3.16602 15.3334Z",fill:"white"},null,-1),Ae=[Le];function He(l,t,o,e,s,m){return c(),d("svg",Ie,Ae)}const Ze=T(Se,[["render",He]]),Ee={setup(){return{}}},$e={xmlns:"http://www.w3.org/2000/svg",width:"33",height:"32",viewBox:"0 0 33 32",fill:"none"},Pe=K('<g clip-path="url(#clip0_3408_20709)"><path d="M28.235 3.19995L1.56836 29.8666" stroke="white" stroke-width="2" stroke-linecap="round"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M22.8652 9.28907C22.6874 8.47259 22.4052 7.82885 21.9574 7.28315C21.7357 7.01311 21.4881 6.76549 21.2181 6.54386C19.7429 5.33325 17.5513 5.33325 13.168 5.33325C8.78466 5.33325 6.593 5.33325 5.11787 6.54386C4.84782 6.76549 4.6002 7.01311 4.37858 7.28315C3.16797 8.75829 3.16797 10.9499 3.16797 15.3333V16.6666C3.16797 21.0499 3.16797 23.2415 4.37858 24.7167C4.6002 24.9867 4.84782 25.2344 5.11787 25.456C5.41417 25.6991 5.73939 25.8935 6.10546 26.0488L22.8652 9.28907ZM8.42815 26.5545C9.65061 26.6666 11.185 26.6666 13.168 26.6666C17.5513 26.6666 19.7429 26.6666 21.2181 25.456C21.4881 25.2344 21.7357 24.9867 21.9574 24.7167C23.168 23.2415 23.168 21.0499 23.168 16.6666V15.3333C23.168 13.9771 23.168 12.8308 23.1321 11.8505L8.42815 26.5545Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M23.168 13.4143V19.3337L24.0458 19.7726C26.6403 21.0698 27.9376 21.7185 28.8861 21.1322C29.8346 20.546 29.8346 19.0956 29.8346 16.1949V15.8058C29.8346 12.905 29.8346 11.4547 28.8861 10.8684C28.0157 10.3305 26.8518 10.8323 24.6614 11.9209L23.168 13.4143Z" fill="white"></path></g><defs><clipPath id="clip0_3408_20709"><rect width="32" height="32" fill="white" transform="translate(0.5)"></rect></clipPath></defs>',2),Be=[Pe];function ze(l,t,o,e,s,m){return c(),d("svg",$e,Be)}const Oe=T(Ee,[["render",ze]]),je={setup(){return{}}},Ne={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},Re=a("path",{d:"M21 21H16.2M21 21L15 15L21 21ZM21 21V16.2V21Z",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),Fe=a("path",{d:"M3 21L9 15M3 16.2V21V16.2ZM3 21H7.8H3Z",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),Ue=a("path",{d:"M21 3L15 9M21 7.8V3V7.8ZM21 3H16.2H21Z",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),Ke=a("path",{d:"M3 3L9 9M3 7.8V3V7.8ZM3 3H7.8H3Z",stroke:"white","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),qe=[Re,Fe,Ue,Ke];function Ge(l,t,o,e,s,m){return c(),d("svg",Ne,qe)}const We=T(je,[["render",Ge]]),Ye={components:{Minimize:ce},props:{chat:Object,userAvatar:String,channel:String,token:String},setup(l,{emit:t}){const o=F(),e=q(),s=i(null),m=i(null),C=i(!1),y=o.public.agoraAppId,_=i(null),g=i(!0),p=i(!1),u=i(!1),V=i(!1),r=i({videoTrack:null,audioTrack:null}),h=async()=>{try{await ae(l.chat.id);const f=(await G(()=>import("./AgoraRTC_N-production.12a40605.js").then(v=>v.A),["./AgoraRTC_N-production.12a40605.js","./entry.1f28c19f.js","./entry.4262ef6d.css"],import.meta.url)).default;_.value=P(f.createClient({mode:"rtc",codec:"vp8"})),C.value=!0,await _.value.join(y,l.channel,l.token,l.chat.user_id),_.value.on("user-published",async(v,M)=>{try{await _.value.subscribe(v,M),M==="video"&&(v.videoTrack.play(m.value),g.value=!1),M==="audio"&&v.audioTrack.play()}catch(A){console.error("Failed to subscribe to user:",v.uid,"Error:",A)}}),_.value.on("user-unpublished",async v=>{await x();const M=document.getElementById(v.uid.toString());M&&M.remove()}),r.value.audioTrack=P(await f.createMicrophoneAudioTrack()),r.value.videoTrack=P(await f.createCameraVideoTrack()),r.value.videoTrack.play(s.value),await _.value.publish([r.value.audioTrack,r.value.videoTrack])}catch(f){console.log("VideoCall onMounted",f)}},x=async()=>{{C.value=!1;for(const f in r.value){const v=r.value[f];v&&(v.stop(),v.close(),r.value[f]=null)}
1await _.value.leave(),t("callEnd",!1),e.push("/personal-account/chats")}};return{inCall:C,localPlayer:s,remotePlayer:m,agoraEngine:_,localTracks:r,remoteVideo:g,audioMute:p,videoMute:u,fullScreen:V,decline:async()=>{await oe(l.chat.id),t("callEnd",!1)},microphoneMute:()=>{r.value.audioTrack.muted?(r.value.audioTrack.setMuted(!1),p.value=!1):(r.value.audioTrack.setMuted(!0),p.value=!0)},cameraMute:()=>{r.value.videoTrack.muted?(r.value.videoTrack.setMuted(!1),u.value=!1):(r.value.videoTrack.setMuted(!0),u.value=!0)},startCall:h,endCall:x}}},Je={ref:"remotePlayer",class:"video-call__staff-video"},Qe=["src"],Xe={key:0,ref:"localPlayer",class:"video-call__user-video"},et=["src"],tt={key:1,class:"video-call__staff-info"},at=["src"],ot=a("span",null,"Incoming video call...",-1),nt={class:"video-call__control"},lt={key:0,class:"video-call__incoming"},st={class:"icons-wrapper"},ct=a("p",null,"Decline",-1),it={class:"icons-wrapper"},rt=a("p",null,"Accept",-1),dt={key:1,class:"video-call__in-call"},ut={class:"icons-wrapper"},_t=a("p",null,"End",-1),ht={class:"icons-wrapper"},vt=a("p",null,"Mute",-1),mt={class:"icons-wrapper"},Ct=a("p",null,"Video",-1),ft={class:"icons-wrapper"};function gt(l,t,o,e,s,m){const C=ee,y=te,_=ke,g=xe,p=Ze,u=Oe,V=We,r=R("Minimize");return c(),d("div",{class:Z(["video-call__container",{"full-screen":e.fullScreen}])},[a("div",{class:Z(["video-call__shadow",{incoming:e.inCall,"in-video":!e.remoteVideo}])},null,2),a("div",Je,[e.remoteVideo?(c(),d("img",{key:0,src:o.chat.doctor.avatar,alt:""},null,8,Qe)):D("",!0)],512),e.inCall?(c(),d("div",Xe,[e.localTracks.videoTrack===null?(c(),d("img",{key:0,src:o.userAvatar,alt:""},null,8,et)):D("",!0)],512)):D("",!0),e.inCall?D("",!0):(c(),d("div",tt,[a("img",{src:o.chat.doctor.avatar,alt:""},null,8,at),a("p",null,E(o.chat.doctor.name),1),ot])),a("div",nt,[e.inCall?(c(),d("div",dt,[a("div",{class:"video-call__control__item end",onClick:t[2]||(t[2]=(...h)=>e.endCall&&e.endCall(...h))},[a("div",ut,[k(C)]),_t]),a("div",{class:Z(["video-call__control__item microphone",{mute:e.audioMute}]),onClick:t[3]||(t[3]=(...h)=>e.microphoneMute&&e.microphoneMute(...h))},[a("div",ht,[k(_,{class:"on"}),k(g,{class:"off"})]),vt],2),a("div",{class:Z(["video-call__control__item camera",{mute:e.videoMute}]),onClick:t[4]||(t[4]=(...h)=>e.cameraMute&&e.cameraMute(...h))},[a("div",mt,[k(p,{class:"on"}),k(u,{class:"off"})]),Ct],2),a("div",{class:"video-call__control__item full",onClick:t[5]||(t[5]=h=>e.fullScreen=!e.fullScreen)},[a("div",ft,[e.fullScreen?(c(),$(r,{key:1})):(c(),$(V,{key:0}))]),a("p",null,E(e.fullScreen?"Minimize":"Expand"),1)])])):(c(),d("div",lt,[a("div",{class:"video-call__control__item decline",onClick:t[0]||(t[0]=(...h)=>e.decline&&e.decline(...h))},[a("div",st,[k(C)]),ct]),a("div",{class:"video-call__control__item accept",onClick:t[1]||(t[1]=(...h)=>e.startCall&&e.startCall(...h))},[a("div",it,[k(y)]),rt])]))])],2)}const pt=T(Ye,[["render",gt]]);const wt={components:{ChatInputZone:U,MessageItem:he,RecordAudio:_e},props:{chatData:Object,currentPage:Number,lastPage:Number,incomingCall:Object},setup(l){const t=i(null),o=i(l.currentPage),e=i(l.lastPage),s=i(null),m=i(null),C=i(!1),y=i(!1),_=i(null),g=i(!1),p=i(null),u=i(!1),V=i(null),r=i(null),h=i(null),x=F(),B=n=>{_.value=n.src,n.video?g.value=!0:g.value=!1,y.value=!0},z=n=>new Date(n).toLocaleDateString()===new Date().toLocaleDateString(),S=n=>n.reverse().map(w=>({...w,created_at:z(w.created_at)?new Date(w.created_at).toLocaleString("en-US",{hour:"numeric",minute:"numeric",hour12:!0}):new Date(w.created_at).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0})})),f=async()=>{if(l.chatData)try{const n=await N(l.chatData.id);t.value=S(n.data.items),o.value=n.data.pagination.current_page,e.value=n.data.pagination.last_page,m.value=l.chatData.id}catch(n){console.log(n)}},v=async()=>{if(s.value.scrollTop===0&&o.value<e.value){C.value=!0;const n=s.value.scrollHeight,w=s.value.scrollTop,b=await N(l.chatData.id,{page:o.value+1});o.value=b.data.pagination.current_page,t.value=[...S(b.data.items),...t.value],C.value=!1,await L();const H=s.value.scrollHeight;s.value.scrollTop=H-n+w}},M=()=>{window.Echo&&window.Echo.disconnect(),window.Pusher=re,window.Echo=new de({broadcaster:"pusher",key:x.public.pusherKey,cluster:x.public.pusherCluster,wsHost:x.public.pusherHost,wsPort:443,
1wssPort:443,forceTLS:!0,enabledTransports:["ws","wss"],authorizer:(n,w)=>({authorize:async(b,H)=>{var O;try{let I=await le({socket_id:b,channel_name:n.name});H(!1,I)}catch(I){H(!0,(O=I==null?void 0:I.response)==null?void 0:O.data)}}})}),window.Echo.private("chat."+m.value).listen("SendMessage",async n=>{var w,b;n.metadata!==null?h.value!==((w=n.metadata)==null?void 0:w.message_id)&&(h.value=(b=n.metadata)==null?void 0:b.message_id,t.value=[...t.value,...S([n])],await L(),s.value&&(s.value.scrollTop=s.value.scrollHeight)):(t.value=[...t.value,...S([n])],await L(),s.value&&(s.value.scrollTop=s.value.scrollHeight))})},A=async()=>{let n=await se(l.chatData.id);V.value=n.data.token,r.value=n.data.channel,u.value=!0};return W(async()=>{await f(),await L(),l.incomingCall.status?await A():u.value=!1,s.value.scrollTop=s.value.scrollHeight,M();try{const n=await ne();p.value=n.data.image}catch(n){console.log("ChatMessenger onMounted",n)}}),j(()=>l.incomingCall,n=>{n.status?A():u.value=!1}),j(()=>l.chatData,async n=>{await f(),await L(),s.value.scrollTop=s.value.scrollHeight,M()}),{chat:t,chatContainer:s,userAvatar:p,loading:C,isModalOpen:y,isVideo:g,modalSrc:_,incoming:u,token:V,channel:r,avatar:ve,openModal:B,scrollChat:v}}},kt={key:0,class:"messenger"},Mt={class:"messenger__heading"},yt=["src"],Vt={class:"messenger__name"},Dt={key:0},bt={key:1},Tt={key:0,class:"loading"},xt={class:"media-modal"},St={class:"modal-content"},It=["src"],Lt=["src"];function At(l,t,o,e,s,m){const C=pt,y=ie,_=R("MessageItem"),g=U,p=ue;return o.chatData?(c(),d("div",kt,[e.incoming?(c(),$(C,{key:0,chat:o.chatData,userAvatar:e.userAvatar,token:e.token,channel:e.channel,onCallEnd:t[0]||(t[0]=u=>{e.incoming=!1,l.$emit("callEnd")})},null,8,["chat","userAvatar","token","channel"])):D("",!0),a("div",Mt,[k(y,{class:"icon-back",onClick:t[1]||(t[1]=u=>l.$emit("closeMobileChat"))}),a("img",{class:"messenger__avatar",src:o.chatData.doctor?o.chatData.doctor.avatar:e.avatar,alt:""},null,8,yt),a("div",Vt,[a("h5",null,E(o.chatData.doctor?o.chatData.doctor.name:"Doctor "+o.chatData.id),1),o.chatData.doctor&&o.chatData.doctor.specialization.length>0?(c(),d("p",Dt,[(c(!0),d(Y,null,J(o.chatData.doctor.specialization,(u,V)=>(c(),d("span",null,E(o.chatData.doctor.specialization.length===V+1?u.title:u.title+", "),1))),256))])):(c(),d("p",bt,"Greater Doctor"))])]),a("div",{ref:"chatContainer",class:"messenger__chat",onScroll:t[2]||(t[2]=(...u)=>e.scrollChat&&e.scrollChat(...u))},[e.loading?(c(),d("div",Tt)):D("",!0),e.chat?(c(),$(_,{key:1,messages:e.chat,chatData:o.chatData,userAvatar:e.userAvatar,onClickToMedia:e.openModal},null,8,["messages","chatData","userAvatar","onClickToMedia"])):D("",!0)],544),k(g,{id:o.chatData.id,isActive:o.chatData.active,onClickToMedia:e.openModal},null,8,["id","isActive","onClickToMedia"]),Q(a("div",xt,[k(p,{class:"close",onClick:t[3]||(t[3]=u=>e.isModalOpen=!1),color:"#E41F36"}),a("div",St,[e.isVideo?(c(),d("video",{key:0,src:e.modalSrc,controls:""},null,8,It)):(c(),d("img",{key:1,src:e.modalSrc},null,8,Lt))])],512),[[X,e.isModalOpen]])])):D("",!0)}const qt=T(wt,[["render",At],["__scopeId","data-v-7e813e93"]]);export{qt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.