import{d as M,C as k,h as Q,W as w,a0 as R,ad as f,r as m,ae as D,$ as C,a1 as y,o,f as a,u as e,J as i,n as A,K as T,q as I,t as r,af as p,ag as x,p as S,H as U,ah as G,i as V,z as H,ai as F,_ as b}from"./index-CUMBhq1p.js";const K={class:"chat-room"},Y={key:0,class:"item-box-my"},j={class:"msg-box"},z={class:"name"},P={class:"time"},J={class:"str"},L=["src"],N={key:1,class:"item-box"},W=["src"],O={class:"msg-box"},q={class:"name"},Z={class:"time"},X={class:"str"},$={class:"input-box"},AA=M({name:"ChatRoomContent",__name:"content",setup(sA){const _=k(),u=Q(),v=w(),E=R(),{chatRoom:d}=f(E),{sendDanmakuConfig:g}=f(v),l=m();D(()=>{d.value.chatRoomList.length&&C(()=>{var t;l.value.scrollTop=((t=l.value)==null?void 0:t.scrollHeight)??9999})}),y(()=>{C(()=>{var t;l.value.scrollTop=((t=l.value)==null?void 0:t.scrollHeight)??9999})});const n=m("");function h(){n.value.trim()&&(F(2,{type:1,str:n.value,color:g.value.color,size:g.value.fontSize}),n.value="")}const B=t=>{const c="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/sBCgoKCgoKCwwMCw8QDhAPFhQTExQWIhgaGBoYIjMgJSAgJSAzLTcsKSw3LVFAODhAUV5PSk9ecWVlcY+Ij7u7+//CABEIADIAMgMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAFBAYBAgMAB//aAAgBAQAAAAD7HU4ObhMC3AnlYvY8ISwA+6WDOd4/RA96FVeF66BOVWB3TsAOgZC27wv/xAAYAQEBAQEBAAAAAAAAAAAAAAACAwQAAf/aAAgBAhAAAAC3sw8uyRDQPV//xAAYAQADAQEAAAAAAAAAAAAAAAAAAgMBBP/aAAgBAxAAAACQ7LfmoUTNvFf/xAA0EAACAQMBBAcHAwUAAAAAAAABAgMABBESBRMxQRAhIjJRYbEUIzRCUnOBM3KSU2KRoeH/2gAIAQEAAT8AmmSCJpHOAoq6vZp8lmITkgonSQCMZxikkdGDxsVbxFbK2l7TGUkwHQfy6Ln4if7jetbcdglvH9TFv40hD71CGzlQpAyACRkt4VcxojxOdIj06GzwA5VKkilGUdjUcNxD9XlwI5g1Bfm0u4nC5UHDeYNWu0LS4B3D6mHHIwaufiJ/uN61tm6Et6GPCIbv8mtqi4gtrFkzjeuxIGRq+TP4orI1jpK+8MHAfVprYcM8kVysmoIGiwG8UfVgVcwh1ecDGiYcvlNWk7W9zDKucqwyPEVOczzfvb1q/wBkXWqR4Sja8nDHGCajAEagHIAx/jourmK0haaV9KrWyrFZLRZJ07MqNhc8Q3M/irfZFlaOGQF2HzOc1cACeYD+o3r0XptYEJKAyMx06TgsxOaupr+MhkIQk6TlfPlkVNCIxBc3A9onLjRG/WtWV1BPFlRp09TpzBHLoufiJ/uN69G05JLxt8C2ksQpTiAMHIq0mQz6HnMnZwurBwBRhKTLLK5Y6Oz/AGf9qwla3u4TykBRh/sdFx8RN9xvWpri43Unv5O6fmNSSSCHGtsb0DGfKrFm3zdZ7o9RUskhMnbbu+NLJJrh7bfqJz869onxjfSY/callk3knvG7x51//8QAIxEAAgEEAQMFAAAAAAAAAAAAAQIRAAMSMRAEIXETMjNBUf/aAAgBAgEBPwBMUTNv3tSdQrgZDYpwMmx0N8PdFv0iBMAyKS4QroF99JcxDhhMntwxgUCoJIER90jZCeG2PBpvjNWtHzx//8QAIBEAAgICAgIDAAAAAAAAAAAAAQIAERASAyEyM0GBkf/aAAgBAwEBPwBtmbURuErdRb1W/nCIW3vqMgJVr8YyWVIyvYG/5CKwJze36jY//9k=";t.target.src=c};return(t,c)=>(o(),a("div",K,[e(u).token?(o(),a(i,{key:0},[A("div",{class:"content",ref_key:"ChatBoxRef",ref:l},[(o(!0),a(i,null,T(e(d).chatRoomList,s=>(o(),a(i,{key:s.chat_id},[s.username==e(u).userInfo.username?(o(),a("div",Y,[A("div",j,[A("span",z,[I(r(s.nickname),1),A("span",P,"("+r(e(p)(new Date(s.time)))+")",1)]),A("span",J,r(s.str),1)]),A("img",{class:"head",src:`${e(x)}/user_headers/${s.head}`,onError:B},null,40,L)])):(o(),a("div",N,[A("img",{class:"head",src:`${e(x)}/user_headers/${s.head}`,onError:B},null,40,W),A("div",O,[A("span",q,[I(r(s.nickname)+" ",1),A("span",Z,"("+r(e(p)(new Date(s.time)))+")",1)]),A("span",X,r(s.str),1)])]))],64))),128))],512),A("div",$,[S(A("input",{onKeydown:G(h,["enter"]),type:"text",placeholder:"输入消息后Enter键发送","onUpdate:modelValue":c[0]||(c[0]=s=>V(n)?n.value=s:null)},null,544),[[U,e(n)]]),A("span",{onClick:h,class:"send-btn cursor-pointer"}," 发送 ")])],64)):(o(),a("div",{key:1,class:"no-login",onClick:c[1]||(c[1]=H(s=>e(_).isLogin=!0,["stop"]))},"登录后可进入聊天室发送弹幕"))]))}}),tA=b(AA,[["__scopeId","data-v-66149499"]]);export{tA as default};
