2 lines
38 KiB
JavaScript
2 lines
38 KiB
JavaScript
var An=Object.defineProperty;var In=(i,o,a)=>o in i?An(i,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[o]=a;var D=(i,o,a)=>In(i,typeof o!="symbol"?o+"":o,a);import{o as He,dx as bn,q as M,r as H,T as Z,P as B,s as b,O as ot,u as R,dy as kn,a7 as Rn,p as W,dz as Mn,ap as Ln,aq as Dn,R as xn,ac as Jt,ad as Zt,v as C,D as k,L as ke,br as Un,aw as wt,w as Vn,av as Re,K as Nn,a1 as Pn,dA as On,dB as Hn,b5 as Kn,bh as $n,dC as zn,dD as Wn,dE as jn,dF as Bn,dG as qn,dH as Fn,dI as Gn,dJ as Xn,dK as Yn,dL as Jn,dM as Zn,dr as Qn,t as Me,ae as to,ar as eo,M as p,dN as no,dq as x,n as Qt,dO as oo,ds as X,dt as Y,du as z,dP as ao}from"./.pnpm-BHOjf1ZS.js";import{u as io,l as so}from"./file-DgUwoHFQ.js";import{a as ro}from"./patient-10cOiqNf.js";import{Z as Ot,am as lo,aI as co,aJ as uo,aK as fo,at as mo}from"./tcm-ChtuqNhm.js";import{_ as Ke,u as ho,i as I}from"./index-FUvp6yIk.js";import{a as vo,c as Le}from"./appointment-type-DJT6wPaT.js";import{p as po}from"./im-business-message-parse-kN-fWnvR.js";import{T as J}from"./@tencentcloud/chat-Bg29VzHQ.js";import{X as Ht}from"./@tencentcloud/chat-uikit-engine-BJz4IWsw.js";import{c as Ct}from"./@tencentcloud/call-engine-js-CRx4G1jN.js";import"./dayjs-CF5xpNFg.js";import"./tim-upload-plugin-B7yxlBgj.js";import"./tim-profanity-filter-plugin-BJ7z5puq.js";import"./rtc-detect-CAvkmauD.js";function go(){const i=["video/webm;codecs=vp9,opus","video/webm;codecs=vp8,opus","video/webm;codecs=vp9","video/webm;codecs=vp8","video/webm"];for(const o of i)if(MediaRecorder.isTypeSupported(o))return o;return""}function _o(){const i=window;return i.AudioContext||i.webkitAudioContext||null}function De(i,o,a,r,s,c){const m=o.videoWidth||o.clientWidth||1,u=o.videoHeight||o.clientHeight||1,h=Math.max(s/m,c/u),d=m*h,v=u*h,T=a+(s-d)/2,U=r+(c-v)/2;try{i.drawImage(o,T,U,d,v)}catch{}}function yo(i,o,a,r){i.fillStyle="#0b0b0b",i.fillRect(0,0,a,r);const s=o.filter(d=>d.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA);if(s.length===0)return;if(s.length===1){De(i,s[0],0,0,a,r);return}const c=Math.ceil(Math.sqrt(s.length)),m=Math.ceil(s.length/c),u=a/c,h=r/m;s.forEach((d,v)=>{const T=v%c,U=Math.floor(v/c);De(i,d,T*u,U*h,u,h)})}function wo(i){const o=new Set,a=[];for(const r of i){const s=r.srcObject;if(s instanceof MediaStream)for(const c of s.getAudioTracks())c.kind!=="audio"||c.readyState==="ended"||!c.enabled||o.has(c.id)||(o.add(c.id),a.push(c))}return a}function Co(i){var r;const o=new Set,a=[];for(const s of i){if(s.readyState<HTMLMediaElement.HAVE_CURRENT_DATA)continue;const c=(r=s.captureStream)==null?void 0:r.call(s);if(c)for(const m of c.getAudioTracks())m.kind!=="audio"||m.readyState==="ended"||!m.enabled||o.has(m.id)||(o.add(m.id),a.push(m))}return a}function So(i){const o=new Set,a=[],r=[...document.body.querySelectorAll("audio")];i&&r.push(...i.querySelectorAll("audio"));const s=document.getElementById("tuicallkit-id");s&&r.push(...s.querySelectorAll("audio"));const c=new Set;for(const m of r){if(c.has(m))continue;c.add(m);const u=m.srcObject;if(u instanceof MediaStream)for(const h of u.getAudioTracks())h.kind!=="audio"||h.readyState==="ended"||!h.enabled||o.has(h.id)||(o.add(h.id),a.push(h))}return a}function te(i){const o=new Set,a=u=>{const h=[];for(const d of u)o.has(d)||(o.add(d),h.push(d));return h},r=[...i.querySelectorAll("video")];if(r.length>0)return a(r);const s=document.getElementById("tuicallkit-id");if(s){const u=[...s.querySelectorAll("video")];if(u.length>0)return a(u)}const m=[...document.body.querySelectorAll("video")].filter(u=>{const h=u.srcObject;return h instanceof MediaStream?h.getVideoTracks().some(d=>d.readyState==="live"):!1});return a(m)}class To{constructor(){D(this,"canvas",null);D(this,"ctx",null);D(this,"rafId",0);D(this,"container",null);D(this,"mediaRecorder",null);D(this,"chunks",[]);D(this,"mimeType","");D(this,"audioCtx",null);D(this,"audioDestination",null);D(this,"wiredTrackIds",new Set);D(this,"canvasVideoTrack",null);D(this,"silentOsc",null);D(this,"silentGain",null);D(this,"micStream",null);D(this,"stopResultPromise",null)}isRecording(){return this.mediaRecorder!==null&&this.mediaRecorder.state==="recording"}beginStopNow(){if(this.stopResultPromise)return;cancelAnimationFrame(this.rafId),this.rafId=0;const o=this.mediaRecorder,a=this.mimeType;!o||o.state==="inactive"||(this.stopResultPromise=new Promise(r=>{var s;o.onstop=()=>{this.teardownAudioGraph();const c=o.mimeType||a||"video/webm",m=this.chunks.length>0?new Blob(this.chunks,{type:c}):null;this.chunks=[],this.mediaRecorder=null,this.container=null,this.canvas=null,this.ctx=null,this.canvasVideoTrack=null,r(m&&m.size>0?m:null)};try{const c=o;(s=c.requestData)==null||s.call(c),o.stop()}catch{this.teardownAudioGraph(),this.chunks=[],this.mediaRecorder=null,this.container=null,this.canvas=null,this.ctx=null,this.canvasVideoTrack=null,r(null)}}))}teardownAudioGraph(){var o;try{(o=this.silentOsc)==null||o.stop()}catch{}if(this.silentOsc=null,this.silentGain=null,this.micStream){for(const a of this.micStream.getTracks())try{a.stop()}catch{}this.micStream=null}this.wiredTrackIds.clear(),this.audioDestination=null,this.audioCtx&&(this.audioCtx.close().catch(()=>{}),this.audioCtx=null)}connectTrackToMixer(o){if(!(o.kind!=="audio"||o.readyState==="ended"||!o.enabled)&&!(!this.audioCtx||!this.audioDestination)&&!this.wiredTrackIds.has(o.id))try{const a=this.audioCtx.createMediaStreamSource(new MediaStream([o])),r=this.audioCtx.createGain();r.gain.value=1.25,a.connect(r),r.connect(this.audioDestination),this.wiredTrackIds.add(o.id)}catch{}}attachMicForMixer(){if(!this.audioCtx||!this.audioDestination)return;const o=navigator.mediaDevices;o!=null&&o.getUserMedia&&o.getUserMedia({audio:!0,video:!1}).then(a=>{if(!this.audioDestination||!this.audioCtx){a.getTracks().forEach(r=>r.stop());return}if(this.micStream){a.getTracks().forEach(r=>r.stop());return}this.micStream=a;for(const r of a.getAudioTracks())this.connectTrackToMixer(r)}).catch(()=>{})}wireIncomingAudio(){var m;if(!this.audioCtx||!this.audioDestination||!this.container)return;this.audioCtx.state==="suspended"&&this.audioCtx.resume().catch(()=>{});const o=te(this.container),a=document.getElementById("tuicallkit-id"),r=[...document.body.querySelectorAll("audio"),...this.container.querySelectorAll("audio"),...a?a.querySelectorAll("audio"):[]],s=new Set,c=[];for(const u of o)s.has(u)||(s.add(u),c.push(u));for(const u of r)s.has(u)||(s.add(u),c.push(u));for(const u of c){const h=u.srcObject;if(h instanceof MediaStream)for(const d of h.getAudioTracks())this.connectTrackToMixer(d);if(u instanceof HTMLVideoElement&&u.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA){const d=(m=u.captureStream)==null?void 0:m.call(u);if(d)for(const v of d.getAudioTracks())this.connectTrackToMixer(v)}}}reset(){if(cancelAnimationFrame(this.rafId),this.rafId=0,this.stopResultPromise=null,this.canvasVideoTrack=null,this.mediaRecorder&&this.mediaRecorder.state!=="inactive")try{this.mediaRecorder.stop()}catch{}this.mediaRecorder=null,this.chunks=[],this.canvas=null,this.ctx=null,this.container=null,this.mimeType="",this.teardownAudioGraph()}start(o){if(typeof MediaRecorder>"u")return!1;this.reset(),this.container=o;const a=go();if(this.mimeType=a||"video/webm",this.canvas=document.createElement("canvas"),this.canvas.width=1280,this.canvas.height=720,this.ctx=this.canvas.getContext("2d",{alpha:!1}),!this.ctx)return!1;const s=this.canvas.captureStream(30).getVideoTracks();this.canvasVideoTrack=s[0]??null;const c=te(o),m=_o();let u;if(m)try{this.audioCtx=new m,this.audioDestination=this.audioCtx.createMediaStreamDestination(),this.audioCtx.resume().catch(()=>{}),this.wireIncomingAudio(),this.attachMicForMixer();const d=this.audioDestination.stream.getAudioTracks(),v=this.audioCtx.createOscillator(),T=this.audioCtx.createGain();T.gain.value=1e-5,v.frequency.value=20,v.connect(T),T.connect(this.audioDestination),v.start(),this.silentOsc=v,this.silentGain=T,u=new MediaStream([...s,...d])}catch{this.teardownAudioGraph(),u=this.buildStreamWithoutMixer(s,c)}else u=this.buildStreamWithoutMixer(s,c);try{this.mediaRecorder=a?new MediaRecorder(u,{mimeType:a}):new MediaRecorder(u)}catch{try{this.mediaRecorder=new MediaRecorder(u)}catch{return this.reset(),!1}}this.chunks=[],this.mediaRecorder.ondataavailable=d=>{d.data&&d.data.size>0&&this.chunks.push(d.data)},this.mediaRecorder.onerror=d=>{console.error("[call-local-recorder] MediaRecorder 错误",d)};const h=()=>{var v,T;if(!this.ctx||!this.canvas||!this.container)return;this.wireIncomingAudio();const d=te(this.container);yo(this.ctx,d,this.canvas.width,this.canvas.height),(T=(v=this.canvasVideoTrack)==null?void 0:v.requestFrame)==null||T.call(v),this.rafId=requestAnimationFrame(h)};this.rafId=requestAnimationFrame(h);try{this.mediaRecorder.start(250)}catch{return this.reset(),!1}return!0}buildStreamWithoutMixer(o,a){const r=new Set,s=[],c=m=>{for(const u of m)r.has(u.id)||(r.add(u.id),s.push(u))};return c(wo(a)),c(Co(a)),c(So(this.container)),new MediaStream([...o,...s])}async stop(){this.beginStopNow();const o=this.stopResultPromise;return o||null}}function Eo(i,o=()=>{}){const a=new Map;return r=>{if(!Number.isInteger(r)||r<=0)return Promise.resolve();const s=a.get(r);if(s)return s.again=!0,s.promise;const c={again:!1,promise:Promise.resolve()};return a.set(r,c),c.promise=(async()=>{var m;try{do{c.again=!1;let u;for(;;){const h=await i({diagnosis_id:r,scope:"current",sync_token:u});if(h.completed){if((m=h.errors)!=null&&m.length)throw new Error(h.errors.join(";"));break}if(!h.sync_token)throw new Error("聊天记录同步未返回进度");u=h.sync_token}}while(c.again)}catch(u){o(u)}finally{a.delete(r)}})(),c.promise}}function xe(i){const o=i.srcObject;return o instanceof MediaStream?o.getVideoTracks().some(a=>a.readyState==="live"):!1}function ct(i){const o=i.getBoundingClientRect();return Math.max(0,o.width)*Math.max(0,o.height)}function Ue(i){const o=i.videoWidth||i.clientWidth,a=i.videoHeight||i.clientHeight;return o*a}function Ao(i){const o=new Map,a=new Map;for(const r of i){const s=r.srcObject;if(!(s instanceof MediaStream))continue;const c=s.getVideoTracks(),m=s.id&&String(s.id)||c.map(d=>d.id).filter(Boolean).join("|")||`${c.length}`,u=ct(r),h=a.get(m)??0;u>=h&&(o.set(m,r),a.set(m,u))}return o.size===0?i:Array.from(o.values())}function Io(i){if(i.length<2)return i;let o=0;for(const r of i)o=Math.max(o,ct(r));return o<=1||Math.min(...i.map(r=>ct(r)))/o>=.25?i:i.filter(r=>ct(r)>=o*.25)}function bo(i){let o=i;for(let a=0;a<12&&o;a++){const r=getComputedStyle(o).transform;if(r&&r!=="none"&&(/matrix\(\s*-1\s*,/.test(r)||/scaleX\(\s*-1/.test(r)))return!0;o=o.parentElement}return!1}function ko(i){const o=/local|self|pusher|mini[_-]?stream|preview[_-]?self|own[_-]?camera|tui-local|tencent-local|stream-local|publisher|send|pip|picture[_-]?in[_-]?picture/i,a=/remote|subscriber|peer|other|tui-remote|stream-remote|big-stream|play[_-]?stream|receiver|pull|substream/i;let r=i;for(let s=0;s<20&&r;s++){const c=`${r.className||""} ${r.id||""} ${r.getAttribute("data-type")||""}`;if(a.test(c))return!1;if(o.test(c))return!0;r=r.parentElement}return!1}async function Ro(i,o){const a=(o==null?void 0:o.preferRemote)!==!1,r=[i,...(o==null?void 0:o.extraRoots)||[]].filter(_=>!!_),s=new Set;for(const _ of r)for(const w of _.querySelectorAll("video"))w instanceof HTMLVideoElement&&s.add(w);if(s.size===0){const _=document.querySelector(".chat-dialog-call-kit-wrapper");if(_)for(const w of _.querySelectorAll("video"))w instanceof HTMLVideoElement&&s.add(w)}s.size===0&&document.body.querySelectorAll("video").forEach(_=>{_ instanceof HTMLVideoElement&&xe(_)&&s.add(_)});let c=Array.from(s).filter(_=>_.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&xe(_));if(c.length===0&&(c=Array.from(s).filter(_=>_.readyState>=2)),c.length===0)return null;c=Ao(c);let m=null,u=0,h=0;if(a){const _=c.map(S=>({v:S,layout:ct(S),pixel:Ue(S),localClass:ko(S),mirror:bo(S)}));let w=_.filter(S=>!S.localClass&&!S.mirror);w.length===0&&(w=_.filter(S=>!S.localClass)),w.length===0&&(w=_.filter(S=>!S.mirror)),w.length===0&&(w=_);let K=w.map(S=>S.v);K=Io(K),w=w.filter(S=>K.includes(S.v));for(const S of w)(S.layout>u||S.layout===u&&S.pixel>h)&&(u=S.layout,h=S.pixel,m=S.v)}else for(const _ of c){const w=ct(_),K=Ue(_);(w>u||w===u&&K>h)&&(u=w,h=K,m=_)}if(!m)return null;const d=m.videoWidth||m.clientWidth,v=m.videoHeight||m.clientHeight;if(!d||!v)return null;const T=document.createElement("canvas");T.width=d,T.height=v;const U=T.getContext("2d");if(!U)return null;try{U.drawImage(m,0,0,d,v)}catch{return null}return new Promise(_=>{T.toBlob(w=>_(w),"image/jpeg",.92)})}let Et;function Mo(i){return Et=i,()=>{Et===i&&(Et=void 0)}}async function Lo(i){const o=Et;if(!o)throw new Error("请先打开本次挂号的聊天窗口");const a=i&&typeof i=="object"&&"type"in i?Number(i.type):2;if(await o(a===1?1:2),Et!==o)throw new Error("当前问诊已切换,请重新发起通话")}function Do(i){const o=[];let a=i,r=0;for(;a!=null&&r<6;){if(typeof a=="string"){o.push(a);break}if(typeof a=="object"){const s=a;typeof s.message=="string"&&o.push(s.message),typeof s.name=="string"&&o.push(s.name),typeof s.code<"u"&&o.push(String(s.code)),a=s.cause}else{o.push(String(a));break}r++}return o.join(" ").toLowerCase()}const Ve=-1001;function lt(i){if(i&&typeof i=="object"){const a=i,r=a.code??a.error_code;if(r===Ve||r===String(Ve))return!0}const o=Do(i);return o.includes("does not support this ability")||o.includes("package you purchased")||o.includes("-1001")&&o.includes("does not support")}function $e(){return"套餐欠费或未开通该能力,请联系管理员在腾讯云续费或升级套餐。"}function xo(i,o="通话操作失败"){return lt(i)?$e():i instanceof Error?i.message||o:typeof i=="string"&&i||o}const Uo={key:0,class:"chat-uikit-custom-msg"},Vo={key:0,class:"chat-uikit-custom-msg__tag"},No={class:"chat-uikit-custom-msg__main"},Po={key:1,class:"chat-uikit-custom-msg__sub"},Oo={key:1,class:"chat-uikit-custom-msg chat-uikit-custom-msg--plain"},Ho={class:"chat-uikit-custom-msg__main"},Ko={key:2,class:"chat-uikit-custom-msg chat-uikit-custom-msg--plain"},$o={key:0,class:"chat-uikit-custom-msg__sub"},zo=He({inheritAttrs:!1,__name:"ChatMessageItem",props:{message:{}},setup(i){const o=i,a=bn();function r(d){if(!d||typeof d!="object")return null;const v=d,T=v.data;if(typeof T=="string")return T;if(T&&typeof T=="object")return JSON.stringify(T);const U=v.extension;return typeof U=="string"&&U.trim().startsWith("{")?U:null}const s=W(()=>{var v;const d=(v=o.message)==null?void 0:v.type;return!!(d===Mn.CUSTOM||typeof d=="string"&&/custom/i.test(d))}),c=W(()=>{var v;if(!s.value)return null;const d=(v=r(o.message.payload))==null?void 0:v.trim();return d?po(d):null}),m=W(()=>s.value&&!!c.value),u=W(()=>{const d=o.message.payload,v=d==null?void 0:d.description;return typeof v=="string"&&v.trim()?v.trim():""}),h=W(()=>{var v;const d=(v=r(o.message.payload))==null?void 0:v.trim();return!d||d.length<2?"":d.length<=120?d:`${d.slice(0,117)}…`});return(d,v)=>m.value?(M(),H("div",Uo,[c.value.tag?(M(),H("span",Vo,Z(c.value.tag),1)):B("",!0),b("div",No,Z(c.value.main),1),c.value.sub?(M(),H("div",Po,Z(c.value.sub),1)):B("",!0)])):s.value&&u.value?(M(),H("div",Oo,[b("div",Ho,Z(u.value),1)])):s.value?(M(),H("div",Ko,[v[0]||(v[0]=b("div",{class:"chat-uikit-custom-msg__main"},"系统消息",-1)),h.value?(M(),H("div",$o,Z(h.value),1)):B("",!0)])):(M(),ot(R(kn),Rn({key:3},R(a),{message:i.message}),null,16,["message"]))}}),Wo=Ke(zo,[["__scopeId","data-v-1c506f55"]]);function jo(i){if(i==null)return null;if(typeof i=="object"&&!Array.isArray(i))return i;if(typeof i!="string")return null;const o=i.trim();if(!o.startsWith("{"))return null;try{return JSON.parse(o)}catch{return null}}function Ne(i){const o=i.toLowerCase();return["hangup","cancel","reject","timeout","linebusy","end"].includes(o)}function Bo(i){const o=i.trim();if(!o)return!1;if(/\bcall_end\b/i.test(o)&&(/call_engine|call_record|rtc/i.test(o)||/"reason"\s*:\s*\d/.test(o))||/call_engine_srv\.[a-z_]*call[a-z_]*/i.test(o)&&/hangup|end|leave|reject|cancel/i.test(o))return!0;if(!o.startsWith("{"))return!1;let a;try{a=JSON.parse(o)}catch{return!1}if(a.businessID===1||a.businessID==="1"){const s=jo(a.data);if(s){const c=String(s.cmd??"");if(Ne(c))return!0}}if((a.businessID==="rtc_call"||typeof a.cmd=="string")&&Ne(String(a.cmd??"")))return!0;const r=JSON.stringify(a);return!!(r.includes("call_engine_srv")&&/hangup|call_end|CALL_END|reject|cancel/i.test(r))}const qo={class:"chat-window-heading"},Fo=["title"],Go={class:"chat-container"},Xo={key:0,class:"loading-container"},Yo={key:1,class:"error-container"},Jo={key:2,class:"chat-content"},Zo={class:"chat-layout"},Qo={class:"message-toolbar"},ta={key:3,class:"text-consultation-hint"},ea={class:"call-kit-drag-handle-left"},na={key:0,class:"call-local-recording-hint"},oa={class:"call-kit-drag-handle-actions"},St="idle",Tt="calling",nt="connected",Pe=40,aa=100,ia=1500,sa=2600,ra=667,Oe=16,la=He({__name:"index",setup(i,{expose:o}){const a=p(""),r=p(!1),s=p(!1),c=p(!1),m=p(""),u=p(""),h=p("video"),d=p(0),v=p(""),T=W(()=>v.value||vo(h.value)),U=p(!1),_=p(!1),w=p("正在确认挂号类型"),K=W(()=>U.value&&Le(h.value)),S=W(()=>_.value&&(Le(h.value)||h.value==="phone"));let $,Q=0,ee=2;const j=p(null),E=p(null),ut=p("正在初始化..."),q=p(""),At=p(""),N=p(!1),F=p(!1),{login:ze}=ao(),{setActiveConversation:We,createC2CConversation:je,activeConversation:Be}=no(),qe=ho(),ne=Eo(mo,()=>{console.warn("[chat-dialog] 聊天记录归档未完成,可在诊单聊天记录中重试同步")});let It,tt;function bt(){const t=E.value;!s.value||!c.value||!t||(tt&&clearTimeout(tt),tt=setTimeout(()=>{tt=void 0,ne(t)},500))}function kt(t=!1){var e,n,l;It&&clearInterval(It),tt&&clearTimeout(tt),It=void 0,tt=void 0,t&&E.value&&c.value&&ne(E.value),(l=(n=(e=Ht)==null?void 0:e.chat)==null?void 0:n.off)==null||l.call(n,J.EVENT.CONVERSATION_LIST_UPDATED,bt)}function Fe(){var t,e,n;kt(),(n=(e=(t=Ht)==null?void 0:t.chat)==null?void 0:e.on)==null||n.call(e,J.EVENT.CONVERSATION_LIST_UPDATED,bt),It=setInterval(bt,15e3),bt()}function oe(t){"appointment_type"in t&&(h.value=t.appointment_type),v.value=t.appointment_type_desc||"",U.value=t.can_video_call===!0,_.value=t.can_audio_call===!0,w.value=t.call_disabled_reason||"当前挂号不支持该通话方式",Number(t.appointment_id)>0&&(d.value=Number(t.appointment_id))}async function Ge(t){const e=Q,n=()=>t===1?S.value:K.value;if(!s.value||!n()){const f=h.value==="text"?"图文问诊不支持音视频通话":w.value;throw I.msgWarning(f),new Error(f)}const l=await Ot({patient_id:j.value,diagnosis_id:E.value,appointment_id:d.value});if(!s.value||Q!==e)throw new Error("当前问诊已切换,请重新发起通话");if(oe(l),!n())throw I.msgWarning(w.value),new Error(w.value);ee=t}const dt=p("");let G=null,at=null,Kt=0;const P=new To,$t=p(!1),ft=p(!1);let zt=0,it=null,mt=null,Rt=Promise.resolve(),Wt=null;function st(){it&&(clearTimeout(it),it=null)}function jt(t){$t.value=!!(t!=null&&t.isLochostVod)}function Mt(){return mt||(mt=(async()=>{if(st(),ft.value=!1,!$t.value)return;P.beginStopNow();const t=Wt??E.value;try{await Rt}catch{}const e=await P.stop();if(!e){console.warn("[chat-dialog] 本地录制无有效文件(若通话较长仍出现,请换 Chrome 并看控制台是否有 MediaRecorder 报错)");return}if(t==null){I.msgWarning("缺少诊单信息,本地录制无法保存到通话记录");return}try{const n=await so(e,`call-rec-${t}-${Date.now()}.webm`),l=n.uri||n.url;if(!l){I.msgError("上传成功但未返回文件地址");return}await lo({diagnosis_id:t,file_url:l}),I.msgSuccess("本地录制已上传并关联到通话记录")}catch(n){const l=n instanceof Error?n.message:String(n);console.warn("[chat-dialog] 本地录制上传/关联失败",n),I.msgError(l||"本地录制上传失败")}})().finally(()=>{mt=null}),mt)}function Xe(){const t=X.getData(Y.CALL,z.ROOM_ID);if(t==null)return"";if(typeof t=="number")return t===0?"":String(t);const e=String(t).trim();return!e||e==="0"?"":e}function Ye(){var t,e;try{const n=(e=(t=x).getTUICallEngineInstance)==null?void 0:e.call(t);if(!n)return"";const l=[n.roomId,n.roomID,n._roomId,n._roomID,n.strRoomID];for(const f of l){if(f==null||f==="")continue;const g=String(f).trim();if(g&&g!=="0")return g}}catch{}return""}function Bt(){return Xe()||Ye()}function Lt(t,e){if(e!=null&&String(e).trim()!==""&&String(e)!=="0")return String(e).trim();if(typeof t=="number"&&t>0)return String(t);if(typeof t=="string"){const n=t.trim();if(n&&n!=="0")return n}return""}function ae(t){if(t==null||typeof t!="object")return"";const e=t,n=Lt(e.roomID,e.strRoomID)||Lt(e.roomId,e.strRoomId);if(n)return n;const l=e.data;if(l&&typeof l=="object"){const f=l,g=Lt(f.roomID,f.strRoomID)||Lt(f.roomId,f.strRoomId);if(g)return g}return""}function rt(){at&&(clearTimeout(at),at=null),Kt=0}function Je(){rt();const t=()=>{at=null;const e=X.getData(Y.CALL,z.CALL_STATUS);if(e===St||e!==Tt&&e!==nt)return;const n=Bt();if(n){pt(n);return}if(Kt++,Kt>=Pe){console.warn("[chat-dialog] 仍未解析到有效房间号(已重试",Pe,"次)");return}at=setTimeout(t,aa)};at=setTimeout(t,0)}async function ie(t){if(!(j.value==null||E.value==null)){await Qt();for(let e=0;e<40;e++){const n=Bt();if(n){await pt(n);return}await new Promise(l=>setTimeout(l,50))}console.warn("[chat-dialog] 发起通话后仍未解析到房间号(API:",t,")")}}function Ze(){var l,f;const t=window;if(t.__zytEngineRoomCapture__)return;const e=(f=(l=x).getTUICallEngineInstance)==null?void 0:f.call(l);if(!e||typeof e.calls!="function")return;t.__zytEngineRoomCapture__=!0,e.__zytEngineRoomCapture__=!0;const n=g=>{const y=e[g];typeof y=="function"&&(e[g]=async function(...L){const V=await y.apply(e,L),O=ae(V);return O&&pt(O),await ie("engine."+g),V})};n("calls"),n("call"),n("groupCall")}function Qe(){const t=window;if(t.__zytHangupPreStop__)return;const e=x,n=e.hangup;typeof n=="function"&&(t.__zytHangupPreStop__=!0,e.hangup=function(...f){return P.beginStopNow(),n.apply(x,f)})}function se(){var g,y;const t=window;if(t.__zytTrtcPreStop__)return;const e=(y=(g=x).getTUICallEngineInstance)==null?void 0:y.call(g),n=e==null?void 0:e.trtcCloud;if(!n||typeof n!="object")return;let l=0;const f=["stopLocalVideo","stopLocalAudio"];for(const A of f){const L=n[A];typeof L=="function"&&(n[A]=function(...O){return P.beginStopNow(),L.apply(n,O)},l++)}l>0&&(t.__zytTrtcPreStop__=!0)}let ht=[],vt=null,re=0;async function Dt(){const t=Wt??E.value;if(t==null){console.warn("[chat-dialog] endCall 跳过:无诊单 ID(快照与当前均为空)");return}try{await co({diagnosis_id:t}),console.log("[chat-dialog] endCall 已同步",{diagnosis_id:t})}catch(e){console.warn("[chat-dialog] endCall 失败",e)}}function le(t){const e=Date.now();e-re<ia||(re=e,console.log("[chat-dialog] 挂断停合流:",t),P.isRecording()&&P.beginStopNow(),Dt())}function tn(){var t;qt();try{const e=(t=Ht)==null?void 0:t.chat;if(!(e!=null&&e.on)){console.warn("[chat-dialog] TUIChatEngine.chat 不可用,无法监听 IM 视频挂断信令");return}vt=n=>{if(!s.value)return;const l=q.value;if(!l)return;const f=l.startsWith("C2C")?l:`C2C${l}`,g=Array.isArray(n.data)?n.data:[];for(const y of g){if(!y||y.conversationID!==f)continue;const A=y.type;if(!(A===J.TYPES.MSG_CUSTOM||A==="TIMCustomElem"||typeof A=="string"&&/custom/i.test(A)))continue;const V=y.payload,O=typeof(V==null?void 0:V.data)=="string"?V.data:"";if(!(!O||!Bo(O))){le("IM");break}}},e.on(J.EVENT.MESSAGE_RECEIVED,vt)}catch(e){console.warn("[chat-dialog] 绑定 IM 挂断监听失败",e)}}function qt(){var t,e;if(vt){try{const n=(t=Ht)==null?void 0:t.chat;(e=n==null?void 0:n.off)==null||e.call(n,J.EVENT.MESSAGE_RECEIVED,vt)}catch{}vt=null}}function en(){var t,e;try{const n=(e=(t=x).getTUICallEngineInstance)==null?void 0:e.call(t),l=n==null?void 0:n.on;if(!n||typeof l!="function"||n.__zytRoomEvents)return;n.__zytRoomEvents=!0;const f=L=>{const V=ae(L);if(V){pt(V);return}Ft()},g=()=>{le("TUICallEngine")},y=[Ct.TUICallEvent.CALL_END,Ct.TUICallEvent.USER_LEAVE,Ct.TUICallEvent.ON_CALL_NOT_CONNECTED];for(const L of y)l.call(n,L,g),ht.push({event:L,fn:g});const A=[Ct.TUICallEvent.USER_ENTER,Ct.TUICallEvent.ON_CALL_BEGIN];for(const L of A)l.call(n,L,f),ht.push({event:L,fn:f})}catch(n){console.warn("[chat-dialog] 绑定引擎房间事件失败",n)}}function nn(){var t,e;try{const n=(e=(t=x).getTUICallEngineInstance)==null?void 0:e.call(t);if(!(n!=null&&n.off)){ht=[];return}for(const{event:l,fn:f}of ht)n.off(l,f);n.__zytRoomEvents=!1}catch{}ht=[]}function on(){const t=window;if(t.__zytTUICallRoomHooks__)return;t.__zytTUICallRoomHooks__=!0;const e=x,n=l=>{const f=e[l];typeof f=="function"&&(e[l]=async function(...y){await Lo(y[0]);const A=await f.apply(e,y);return await ie(l),A})};n("calls"),n("call"),n("groupCall")}async function pt(t){try{await Rt}catch{}if(j.value==null||E.value==null)return;const e=`${E.value}:${t}`;if(e===dt.value){rt();return}dt.value=e;try{const n=await uo({diagnosis_id:E.value,room_id:t});rt(),console.log("[chat-dialog] bindCallRoom 成功",{room_id:t,bindRes:n});const l=n==null?void 0:n.cloud_recording;l&&l.started===!1&&l.message&&I.msgWarning(`云端合流录制未启动(关闭控制台全局录制后仅依赖 API):${l.message}`)}catch(n){console.warn("[chat-dialog] bindCallRoom 失败",n),dt.value=""}}async function Ft(){if(j.value==null||E.value==null)return;const t=X.getData(Y.CALL,z.CALL_STATUS);if(t===St){rt(),dt.value="";return}if(t!==Tt&&t!==nt)return;await Qt();const e=Bt();if(e){await pt(e);return}Je()}async function an(){if(!(j.value==null||E.value==null))try{await fo({diagnosis_id:E.value,patient_id:j.value,appointment_id:d.value,call_type:ee})}catch(t){console.warn("[chat-dialog] startCall 记录失败",t)}}function sn(){G==null||G();let t=X.getData(Y.CALL,z.CALL_STATUS)??St;const e=l=>{const f=l??St;if(f===St){(t===Tt||t===nt)&&P.beginStopNow(),st(),ft.value=!1,(t===Tt||t===nt)&&(async()=>(await Dt(),F.value=!1,await Mt()))(),rt(),dt.value="",t=f;return}if(f===nt){if(Ft(),st(),!$t.value){t=f;return}const g=zt,y=(A=0)=>{if(g!==zt){console.log("[chat-dialog] 录制轮次已变化,取消启动");return}const L=Xt.value,V=X.getData(Y.CALL,z.CALL_STATUS);if(!L||V!==nt){console.warn("[chat-dialog] 录制启动条件不满足",{root:!!L,status:V});return}console.log(`[chat-dialog] 尝试启动本地录制(第 ${A+1} 次)`);let O=Array.from(L.querySelectorAll("video"));if(O.length===0&&(O=Array.from(document.body.querySelectorAll("video")).filter(Tn=>{const be=Tn.srcObject;return be instanceof MediaStream?be.getVideoTracks().some(En=>En.readyState==="live"):!1}),console.log("[chat-dialog] 在 body 中找到活跃视频:",O.length)),O.length===0){A<10?(console.warn("[chat-dialog] 未找到视频元素,300ms 后重试"),it=setTimeout(()=>y(A+1),300)):console.error("[chat-dialog] 重试 10 次后仍未找到视频元素,放弃录制");return}if(!O.some(Ie=>Ie.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA)){A<10?(console.warn("[chat-dialog] 视频元素未就绪,300ms 后重试"),it=setTimeout(()=>y(A+1),300)):console.error("[chat-dialog] 重试 10 次后视频仍未就绪,放弃录制");return}console.log("[chat-dialog] 视频元素已就绪,立即启动录制");const Ae=P.start(L);ft.value=Ae,Ae?console.log("[chat-dialog] ✅ 本地录制已成功启动"):console.error("[chat-dialog] 本地录制启动失败(MediaRecorder 或画布初始化失败)")};it=setTimeout(()=>y(0),500)}else st();t=f},n=()=>{Ft()};X.watch(Y.CALL,{[z.CALL_STATUS]:e,[z.ROOM_ID]:n}),G=()=>{try{X.unwatch(Y.CALL,{[z.CALL_STATUS]:e,[z.ROOM_ID]:n})}catch{}rt(),G=null}}let ce=0;function gt(){const t=Date.now();t-ce<sa||(ce=t,I.msgError($e()),F.value=!1)}let _t=null,xt=!1,et=null;function rn(){xt||(_t=console.error.bind(console),xt=!0,console.error=(...t)=>{if(_t(...t),!s.value||!N.value)return;const e=t.map(n=>{if(typeof n=="string")return n;if(n instanceof Error)return n.message;try{return JSON.stringify(n)}catch{return String(n)}}).join(" ");lt(e)&>()})}function ln(){xt&&_t&&(console.error=_t),xt=!1,_t=null}function cn(){var t,e,n;try{const l=(e=(t=x).getTUICallEngineInstance)==null?void 0:e.call(t);if(!(l!=null&&l.on))return;et&&((n=l.off)==null||n.call(l,"error",et)),et=f=>{!s.value||!N.value||lt(f)&>()},l.on("error",et)}catch(l){console.warn("绑定 TUICallEngine error 监听失败:",l)}}function un(){var t,e;try{const n=(e=(t=x).getTUICallEngineInstance)==null?void 0:e.call(t);n!=null&&n.off&&et&&n.off("error",et)}catch{}et=null}async function dn(t,e){try{const n=J.create({SDKAppID:t}),l={businessID:"doctor_entered_consult_room",time:Date.now()},f=n.createCustomMessage({to:e,conversationType:J.TYPES.CONV_C2C,payload:{data:JSON.stringify(l)}});await n.sendMessage(f),console.log("已发送医生进入诊室信令(患者端聊天列表不展示)")}catch(n){console.warn("发送医生进入诊室信令失败:",n)}}const ue=t=>{!s.value||!N.value||lt(t.reason)&>()};Ln(()=>{rn(),window.addEventListener("unhandledrejection",ue)}),Dn(()=>{kt(!0),Q++,$==null||$(),st(),P.reset(),G==null||G(),nn(),qt(),ln(),un(),window.removeEventListener("unhandledrejection",ue)});const fn=async(t,e)=>{try{if(!t){console.warn("头像 URL 为空,跳过更新");return}console.log("开始更新头像到 IM:",t);const n=await new Promise((l,f)=>{setTimeout(async()=>{try{const y=await J.create({SDKAppID:e}).updateMyProfile({avatar:t});console.log("IM 头像更新成功:",y),l(y)}catch(g){console.error("更新头像异常:",g),l(null)}},500)})}catch(n){console.error("IM 头像更新失败:",n.message||n)}};xn(()=>Be.value,async t=>{if(t){if(u.value=t.getShowName()||u.value,console.log("会话切换:",t.conversationID,"名称:",u.value,t),t.userProfile.userID.includes("doctor"))console.log("当前会话是医生,跳过获取 assistant_id");else try{const e=await Ot({patient_id:t.userProfile.userID.replace("patient_",""),diagnosis_id:E.value,appointment_id:d.value});jt(e),q.value=e.patientUserId,a.value=e.assistant_id,console.log("会话切换后获取到 assistant_id:",a.value,"完整响应:",e)}catch(e){console.error("获取 assistant_id 失败:",e)}console.log("会话切换完成,userID:",t.userProfile.userID)}});const mn=async t=>{kt(!0);const e=++Q;$==null||$(),$=Mo(Ge),s.value=!0,r.value=!1,Ut.value=100,Vt.value=80,pe(),u.value=t.patientName,h.value=t.appointmentType,d.value=Number(t.appointmentId||0),v.value="",U.value=!1,_.value=!1,w.value="正在确认挂号类型",j.value=t.patientId,E.value=t.diagnosisId||null,m.value="",c.value=!1,N.value=!1,F.value=!1,ut.value="正在获取签名...";try{const n=await Ot({patient_id:t.patientId,diagnosis_id:t.diagnosisId||0,appointment_id:d.value});if(e!==Q||!s.value)return;if(oe(n),jt(n),a.value=n.assistant_id,console.log("后端返回的签名数据:",n),console.log("assistant_id:",a.value),!n||!n.userSig)throw new Error("获取签名失败");n.assistant_id||console.warn("警告:后端未返回 assistant_id,群视频通话可能无法正常工作"),q.value=n.patientUserId||`patient_${t.patientId}`,ut.value="正在登录聊天...",await ze({sdkAppId:Number(n.sdkAppId),userId:n.userId,userSig:n.userSig,useUploadPlugin:!0}),tn();const l=Number(n.sdkAppId);if(!window.__TUICallKitInited__){ut.value="正在初始化通话能力...";try{await x.init({userID:n.userId,userSig:n.userSig,SDKAppID:l}),window.__TUICallKitInited__=!0}catch(f){console.warn("TUICallKit 初始化失败,聊天仍可用,音视频通话不可用:",(f==null?void 0:f.message)||f),lt(f)&>()}}N.value=!!window.__TUICallKitInited__,N.value&&(x.setCallback({beforeCalling:()=>{se(),st(),P.reset(),ft.value=!1,zt++,Wt=E.value,pe(),F.value=!0,Rt=an()},afterCalling:()=>{P.beginStopNow(),(async()=>(await Dt(),F.value=!1,await Mt()))()}}),on(),Ze(),Qe(),se(),en(),sn(),cn()),console.log("Chat UIKit 登录成功,患者用户ID:",q.value),ut.value="加载聊天界面...",setTimeout(async()=>{var g;if(e!==Q||!s.value)return;c.value=!0,Fe(),await Qt(),await new Promise(y=>setTimeout(y,1e3));const f=(g=qe.userInfo)==null?void 0:g.avatar;console.log("准备更新头像,avatar:",f),f&&await fn(f,l);try{const y=await je(q.value);At.value=y.conversationID,console.log("已创建/获取会话:",At.value),We(At.value),console.log("已激活会话"),await dn(l,q.value)}catch(y){console.error("创建/激活会话失败:",y)}},800)}catch(n){console.error("初始化聊天失败:",n),m.value=n.message||"初始化聊天失败",I.msgError(m.value)}},hn=async()=>{if(!K.value){I.msgWarning(h.value==="text"?"图文问诊不支持视频通话":w.value);return}if(!N.value){I.msgWarning("通话服务初始化中,请稍后再试");return}if(!q.value){I.msgWarning("未找到患者通话ID,无法发起群视频");return}try{if(!a.value){console.warn("assistant_id 为空,尝试重新获取");const e=await Ot({patient_id:j.value,diagnosis_id:E.value,appointment_id:d.value});jt(e),a.value=e.assistant_id,console.log("重新获取 assistant_id:",a.value)}const t=[q.value,a.value].filter(e=>e);if(t.length<2){I.msgWarning("助理ID获取失败,无法发起群视频"),console.error("userIDList 不完整:",t,"assistant_ids:",a.value);return}console.log("发起群视频通话,参与者:",t),await x.calls({userIDList:t,type:oo.VIDEO_CALL})}catch(t){console.error("发起群视频失败:",t),lt(t)?gt():I.msgError(xo(t,"发起群视频失败"))}},vn=p(),Ut=p(100),Vt=p(80),Gt=p(!1),de=p(0),fe=p(0),me=p(0),he=p(0),ve=p(),Xt=p(),yt=p(!1),Nt=p(0),Pt=p(0);function pe(){Nt.value=Oe,Pt.value=Math.max(Oe,Math.floor((window.innerHeight-ra)/2))}const Yt=p(!1),ge=p(0),_e=p(0),ye=p(0),we=p(0),pn=W(()=>({left:`${Nt.value}px`,top:`${Pt.value}px`})),gn=t=>{Yt.value=!0,ge.value=t.clientX,_e.value=t.clientY,ye.value=Nt.value,we.value=Pt.value,document.addEventListener("mousemove",Ce),document.addEventListener("mouseup",Se)},Ce=t=>{Yt.value&&(Nt.value=Math.max(0,ye.value+t.clientX-ge.value),Pt.value=Math.max(0,we.value+t.clientY-_e.value))},Se=()=>{Yt.value=!1,document.removeEventListener("mousemove",Ce),document.removeEventListener("mouseup",Se)},_n=async()=>{if(!yt.value){yt.value=!0;try{if(j.value==null){I.msgWarning("缺少患者信息,无法同步舌苔照片");return}const t=ve.value,e=Xt.value,n=t||e;if(!n)return;const l=await Ro(n,{extraRoots:[e].filter(Boolean)});if(!l){I.msgWarning("截屏失败,请确认视频画面已加载");return}const f=await io(l,`callshot-${Date.now()}.jpg`),g=f.url||f.uri;if(!g){I.msgError("上传未返回图片路径");return}if(E.value==null){I.msgWarning("请先保存诊单后再从视频同步舌苔照片");return}await ro({diagnosis_id:E.value,tongue_images:[g]}),I.msgSuccess("舌苔照片已保存")}catch(t){const e=t;console.error(e),I.msgError((e==null?void 0:e.message)||"上传失败")}finally{yt.value=!1}}},yn=async()=>{if(N.value)try{P.beginStopNow(),await Mt(),await x.hangup()}catch(t){console.warn("关闭视频窗口时挂断失败:",t)}F.value=!1},wn=W(()=>({left:`${Ut.value}px`,top:`${Vt.value}px`})),Cn=t=>{const e=t.target;e.closest(".chat-close-btn")||e.closest(".chat-header-actions")||(Gt.value=!0,de.value=t.clientX,fe.value=t.clientY,me.value=Ut.value,he.value=Vt.value,document.addEventListener("mousemove",Te),document.addEventListener("mouseup",Ee))},Te=t=>{Gt.value&&(Ut.value=Math.max(0,me.value+t.clientX-de.value),Vt.value=Math.max(0,he.value+t.clientY-fe.value))},Ee=()=>{Gt.value=!1,document.removeEventListener("mousemove",Te),document.removeEventListener("mouseup",Ee)},Sn=async()=>{if(kt(!0),Q++,$==null||$(),qt(),N.value){const t=X.getData(Y.CALL,z.CALL_STATUS);if(t===Tt||t===nt)try{P.beginStopNow(),await Mt(),await x.hangup()}catch(e){console.warn("挂断通话时出错:",e)}}E.value!=null&&await Dt(),s.value=!1,F.value=!1};return o({open:mn}),(t,e)=>{const n=Un,l=Vn,f=Nn,g=Pn,y=$n;return M(),ot(eo,{to:"body"},[Jt(b("div",{ref_key:"chatWindowRef",ref:vn,class:to(["chat-floating-window",{"chat-floating-window--minimized":r.value}]),style:Me(wn.value)},[b("div",{class:"chat-window-header",onMousedown:Cn},[b("div",qo,[b("span",{class:"chat-window-title",title:u.value},"与 "+Z(u.value)+" 通讯",9,Fo),C(n,{size:"small",type:"info",class:"chat-appointment-type"},{default:k(()=>[ke(Z(T.value),1)]),_:1})]),b("div",{class:"chat-header-actions",onMousedown:e[2]||(e[2]=wt(()=>{},["stop"]))},[C(f,{type:"danger",link:"",class:"chat-close-btn",onClick:Sn},{default:k(()=>[C(l,null,{default:k(()=>[C(R(Re))]),_:1})]),_:1}),r.value?(M(),ot(g,{key:1,content:"展开聊天窗口",placement:"top"},{default:k(()=>[C(f,{type:"primary",link:"",class:"chat-expand-btn",onClick:e[1]||(e[1]=A=>r.value=!1)},{default:k(()=>[C(l,null,{default:k(()=>[C(R(Hn))]),_:1}),e[6]||(e[6]=b("span",{class:"chat-header-btn-text"},"展开",-1))]),_:1})]),_:1})):(M(),ot(g,{key:0,content:"缩小为标题条,不关闭会话",placement:"top"},{default:k(()=>[C(f,{type:"primary",link:"",class:"chat-minimize-btn",onClick:e[0]||(e[0]=A=>r.value=!0)},{default:k(()=>[C(l,null,{default:k(()=>[C(R(On))]),_:1}),e[5]||(e[5]=b("span",{class:"chat-header-btn-text"},"缩小",-1))]),_:1})]),_:1}))],32)],32),Jt(b("div",Go,[c.value?m.value?(M(),H("div",Yo,[C(y,{title:m.value,type:"error",closable:!1},null,8,["title"])])):(M(),H("div",Jo,[C(R(Yn),{language:"zh-CN",theme:"light"},{default:k(()=>[b("div",Zo,[C(R(zn),{class:"chat-area"},{default:k(()=>[C(R(Wn),{conversationID:At.value,Message:Wo},null,8,["conversationID"]),C(R(jn),null,{headerToolbar:k(()=>[b("div",Qo,[C(R(Bn)),C(R(qn)),C(R(Fn)),N.value&&S.value?(M(),ot(R(Gn),{key:0})):B("",!0),N.value&&K.value?(M(),ot(R(Xn),{key:1})):B("",!0),N.value&&K.value?(M(),ot(f,{key:2,size:"small",type:"primary",onClick:hn},{default:k(()=>[...e[7]||(e[7]=[ke(" 群视频 ",-1)])]),_:1})):B("",!0),h.value==="text"?(M(),H("span",ta,"图文问诊,不支持音视频通话")):B("",!0)])]),_:1})]),_:1})])]),_:1})])):(M(),H("div",Xo,[C(l,{class:"is-loading"},{default:k(()=>[C(R(Kn))]),_:1}),b("span",null,Z(ut.value),1)]))],512),[[Zt,!r.value]]),N.value?Jt((M(),H("div",{key:0,ref_key:"callKitWrapperRef",ref:ve,class:"chat-dialog-call-kit-wrapper",style:Me(pn.value)},[b("div",{class:"call-kit-drag-handle",onMousedown:gn},[b("div",ea,[e[8]||(e[8]=b("span",{class:"drag-handle-text"},"视频通话",-1)),ft.value?(M(),H("span",na,"本地录制中")):B("",!0)]),b("div",oa,[C(f,{type:"primary",link:"",class:"call-kit-screenshot-btn",loading:yt.value,disabled:yt.value,onMousedown:e[3]||(e[3]=wt(()=>{},["stop"])),onClick:wt(_n,["stop","prevent"])},{default:k(()=>[C(l,null,{default:k(()=>[C(R(Jn))]),_:1}),e[9]||(e[9]=b("span",{class:"call-kit-screenshot-text"},"截屏",-1))]),_:1},8,["loading","disabled"]),C(f,{type:"danger",link:"",class:"call-kit-close-btn",onMousedown:e[4]||(e[4]=wt(()=>{},["stop"])),onClick:wt(yn,["stop"])},{default:k(()=>[C(l,null,{default:k(()=>[C(R(Re))]),_:1})]),_:1}),C(l,{class:"drag-handle-icon"},{default:k(()=>[C(R(Zn))]),_:1})])],32),b("div",{ref_key:"callKitContentRef",ref:Xt,class:"call-kit-content"},[C(R(Qn),{allowedMinimized:!0,allowedFullScreen:!0,class:"chat-dialog-call-kit"})],512)],4)),[[Zt,F.value]]):B("",!0)],6),[[Zt,s.value]])])}}}),Aa=Ke(la,[["__scopeId","data-v-ecdcca87"]]);export{Aa as default};
|