/* sohutv 2025-09-25 17:51:56 */ var de=Object.defineProperty,ge=Object.defineProperties;var pe=Object.getOwnPropertyDescriptors;var se=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable;var ae=(r,_,m)=>_ in r?de(r,_,{enumerable:!0,configurable:!0,writable:!0,value:m}):r[_]=m,F=(r,_)=>{for(var m in _||(_={}))me.call(_,m)&&ae(r,m,_[m]);if(se)for(var m of se(_))fe.call(_,m)&&ae(r,m,_[m]);return r},X=(r,_)=>ge(r,pe(_));var z=(r,_,m)=>new Promise((C,p)=>{var w=t=>{try{k(m.next(t))}catch(x){p(x)}},y=t=>{try{k(m.throw(t))}catch(x){p(x)}},k=t=>t.done?C(t.value):Promise.resolve(t.value).then(w,y);k((m=m.apply(r,_)).next())});import{d as J,r as P,o as ee,b as R,f as b,I as O,i as T,P as he,j as q,e as H,w as le,J as ce,x as ve,t as ne,V as _e,F as Y,p as ye,g as ue,n as Q,T as we,k as ke,s as oe,D as be}from"./vendor-CylMHHih.js";import{u as Ce}from"./emotions-DbiRi93f.js";import{_ as Z,d as ie,p as xe,b as G,A as re}from"./lazyload-CI9HSlFC.js";import{c as Ne}from"./formatImageSize-D8RRbRbb.js";const Le={class:"rich-edit"},Ie=["placeholder"],Te=J({__name:"RichTextarea",props:{modelValue:String,placeholder:String,editable:{type:Boolean,default:!0},height:{type:String,default:"40px"},width:{type:String,default:"100%"},backgroundColor:{type:String,default:"#fff"},autofocus:{type:Boolean,default:!0}},emits:["update:modelValue","enter","change","focus","blur","atUser","userChange"],setup(r,{expose:_,emit:m}){const C=Ce(),p=m,w=r,y=P([]),k=P(null),t=e=>{const s=document.createRange();s.selectNode(e);const g=window.getSelection();return g&&(g.removeAllRanges(),g.addRange(s)),s},x=e=>{const s=e.target;s&&s.classList.contains("atusername")?t(s):L()},A=(e,s)=>{for(var g=e[s-1],c=s-1;c>=0;c--){var n=e[c];if(n.nodeType===Node.TEXT_NODE){var l=n.textContent;if(!l.trim()||l=="鈥"){n.remove();continue}}else if(n.nodeName=="BR"){n.remove();continue}g=e[c];break}return g},W=e=>{var s,g;if((e.key==="ArrowUp"||e.key==="ArrowDown"||e.key==="ArrowLeft"||e.key==="ArrowRight")&&setTimeout(()=>{L()},0),e.key=="Enter"&&(e.preventDefault(),document.execCommand("insertHTML",!1,"
​")),e.key==="Backspace"){e.preventDefault();const c=window.getSelection();if(c&&c.rangeCount>0){const n=c.getRangeAt(0);if(!n.collapsed){c.anchorNode&&((s=k.value)!=null&&s.contains(c.anchorNode))&&n.deleteContents(),L();return}const{startContainer:l,startOffset:V}=n;if(l.nodeType===Node.TEXT_NODE){const E=l.textContent||"";if(E==="鈥"&&l.parentNode&&l.previousSibling&&l.previousSibling.nodeName==="BR"&&l.previousSibling.remove(),V>0){const U=V>0?E.substring(0,V-1):"",B=E.substring(V),te=U+B;te.length>=1?(l.textContent=te,n.setStart(l,V-1),n.collapse(!0)):(g=l.parentNode)==null||g.removeChild(l)}else if(l.previousSibling){const U=t(l.previousSibling);if(!U.collapsed){U.deleteContents(),L();return}}L();return}if(l.nodeType===Node.ELEMENT_NODE&&V>0&&l.childNodes&&l.childNodes.length>=V){const E=A(l.childNodes,V);if(E&&E.nodeType===Node.TEXT_NODE){const U=E.textContent||"";if(U.length>1){E.textContent=U.substring(0,U.length-1),n.setStart(E,U.length-1),n.collapse(!0),L();return}else E.remove()}else if(E){E.remove(),L();return}}if(l.nodeType===Node.ELEMENT_NODE&&l.childNodes&&l.childNodes.length>0){let E=!0;const U=[];if(l.childNodes.forEach(B=>{B.nodeType===Node.ELEMENT_NODE&&B.nodeName==="BR"||B.nodeType===Node.TEXT_NODE&&(!B.textContent||B.textContent==="鈥")?U.push(B):E=!1}),E){U.forEach(B=>B.remove()),L();return}}L()}}},f=e=>(e||"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),v=e=>{e.preventDefault();const s=e.clipboardData;if(!s)return;const g=s.getData("text/plain"),c=f(g.replace(/\r?\n/g,"
"));document.execCommand("insertHTML",!1,c),L()};let h=null;const D=()=>{const e=k.value;if(!e)return;const s=window.getSelection();s&&s.rangeCount>0&&s.anchorNode&&e.contains(s.anchorNode)&&(h=s.getRangeAt(0).cloneRange())},I=()=>{if(h){const e=window.getSelection();return e==null||e.removeAllRanges(),e==null||e.addRange(h),e}else return S(),window.getSelection()},M=()=>{p("blur")},j=()=>{p("focus")},L=()=>{D();let e=$();p("atUser",e);const{result:s,users:g}=N();p("userChange",g),p("update:modelValue",s==null?void 0:s.trim())},a=e=>{if(k.value){const s=I();if(s&&s.rangeCount>0){const g=s.getRangeAt(0),c=document.createElement("div");c.innerHTML=e;const n=document.createDocumentFragment();n.appendChild(c.firstChild),g.deleteContents(),g.insertNode(n),g.collapse(!1),s.removeAllRanges(),s.addRange(g)}}},d=e=>{I(),$(!0);const s=`@${e.nickname}`;a(s),L()};function o(){return z(this,null,function*(){yield C.getEmotionsList(),y.value=C.emotionsList})}const i=e=>{const s=`${e.description}`;a(s),L()},u=()=>{I(),document.execCommand("insertText",!1,"@")},N=()=>{if(k.value){const e=k.value;let s="",g=[];e.childNodes.length&&e.childNodes.forEach(n=>{if(n.nodeType===Node.TEXT_NODE)n.textContent!="鈥"&&(s+=n.nodeValue);else if(n.nodeType===Node.ELEMENT_NODE)if(n.tagName==="IMG"&&n.getAttribute("data-emojiCode"))s+=n.getAttribute("data-emojiCode");else if(n.tagName==="DIV")n.remove();else if(n.tagName==="BR")s+=` `;else if(n.tagName==="SPAN"){s+=n.textContent;const l=n.dataset;l&&g.push({sourceUserID:l.sourceuserid,sourceUserPassport:l.sourceuserpassport,targetUserID:l.targetuserid,targetUserPassport:l.targetuserpassport,targetUserNickname:l.targetusernickname})}else n.remove()});let c=-1;return g.map(function(n){return c=n.startIndex=s.indexOf("@"+n.targetUserNickname,c+1),n.length=n.targetUserNickname.length+1,n}),s=s.replace(/\u200B/g,""),{result:s,users:g}}},$=e=>{const s=window.getSelection();let g="";if(!s||s.rangeCount===0)return g;const c=s.getRangeAt(0);if(c.endContainer.nodeType==Node.TEXT_NODE){const n=c.endContainer.textContent||"",l=n.lastIndexOf("@",c.startOffset);l===-1?g=n.substring(0,c.endOffset):g=n.substring(l,c.endOffset)}return e&&(c.setStart(c.endContainer,c.endOffset-g.length),c.setEnd(c.endContainer,c.endOffset),c.deleteContents()),g},S=()=>{k.value&&k.value.focus()};return _({focus:S,insertAt:u,insertEmoji:i,insertUser:d,restoreSelection:I}),ee(()=>{o(),w.autofocus&&S()}),(e,s)=>(T(),R("div",Le,[b("div",{class:"rich-textarea scrollbar",ref_key:"richTextarea",ref:k,contenteditable:"true",placeholder:r.placeholder,onKeydown:O(W,["self"]),onClick:x,onPasteCapture:v,onMouseout:O(D,["self"]),onInput:O(L,["self"]),onFocus:O(j,["self"]),onBlur:O(M,["self"])},null,40,Ie)]))}}),it=Z(Te,[["__scopeId","data-v-c0e6f051"]]),$e=he.create({timeout:1e4,headers:{"content-type":"application/x-www-form-urlencoded"},withCredentials:!0}),Se="//posts.tv.sohu.com";function Ee(r,_){return $e.request({url:Se+"/post/admin/api/image/upload",method:"post",data:r,params:_})}const Re={class:"image-viewer-container"},De=["disabled"],Ue={class:"image-display-area"},Pe={key:0,class:"loading-overlay"},Ae=["src"],Oe={key:1,class:"page-indicator"},Be=["disabled"],Me=J({__name:"ImageViewer",setup(r,{expose:_}){const m=P(!1),C=P(!1),p=P(0),w=P([]),y=q(()=>w.value[p.value]||null),k=q(()=>y.value&&(y.value.imageURL||y.value.imgurl||y.value.imageJpgURL)||""),t=q(()=>{if(!y.value)return{};const{width:D,height:I}=y.value,M=window.innerWidth*.8,j=window.innerHeight*.8;if(D>=M||I>=j){const L=M/D,a=j/I,d=Math.min(L,a);return{width:`${D*d}px`,height:`${I*d}px`}}else return{width:`${D}px`,height:`${I}px`}}),x=(D,I=0)=>{w.value=D,p.value=I,C.value=!0,m.value=!0,document.body.style.overflow="hidden"},A=()=>{m.value=!1,document.body.style.overflow=""},W=()=>{p.value>0&&(p.value--,C.value=!0)},f=()=>{p.value{C.value=!1},h=()=>{C.value=!1};return _({open:x,close:A}),(D,I)=>m.value?(T(),R("div",{key:0,class:"image-viewer-overlay",onClick:O(A,["self"])},[b("div",{class:"clickable-overlay",onClick:A}),b("div",{class:"close-button",onClick:A}),b("div",Re,[w.value.length>1?(T(),R("button",{key:0,class:"nav-button nav-left",onClick:W,disabled:p.value===0},null,8,De)):H("",!0),b("div",Ue,[C.value?(T(),R("div",Pe,I[0]||(I[0]=[b("div",{class:"loading-spinner"},null,-1)]))):H("",!0),le(b("img",{src:k.value,onLoad:v,onError:h,class:"viewer-image",style:ve(t.value)},null,44,Ae),[[ce,!C.value]]),w.value.length>1&&!C.value?(T(),R("div",Oe,ne(p.value+1)+"/"+ne(w.value.length),1)):H("",!0)]),w.value.length>1?(T(),R("button",{key:1,class:"nav-button nav-right",onClick:f,disabled:p.value===w.value.length-1},null,8,Be)):H("",!0)])])):H("",!0)}}),He=Z(Me,[["__scopeId","data-v-454924a0"]]),Ve=["accept","disabled","multiple"],We=["onClick"],je=["src"],ze={class:"opt-buttons"},Ge=["onClick"],Fe={class:"page-btn-wrap"},Xe=J({__name:"uploadTopicImg",props:{multiple:{type:Boolean,default:!1},allowGif:{type:Boolean,default:!1},domindex:{type:Number,default:0},count:{type:Number,default:9}},emits:["updateImgList"],setup(r,{expose:_,emit:m}){const C=m,p=P(null),w=P(null),y=P(null),k=P(null),t=_e({appid:100114,accept:"image/jpg,image/jpeg,image/png,image/gif",maxSize:10*1024*1024,maxGifLimit:10*1024*1024,minWidth:640,minHeight:480,minGifWidth:320,minGifHeight:240,needCompress:"true",isSupportHttps:"true",totalCount:0,successCount:0,errorCount:0,overCount:0,type:"single",res:{height:"",width:"",size:"",url:"",urlKey:""},imgList:[],pageInfo:{prePage:!1,nextPage:!1}}),x=r;ee(()=>{x.allowGif&&(t.accept="image/webp,image/jpg,image/jpeg,image/png,image/gif")});const A=a=>{const d=t;if(a.size>d.maxSize){h({},a.tempname,"fail");return}const o={100114:"ea86bbbe07094484fefdf9a5f7037dee"};var i=new FormData;let u=xe.getPassport();i.append("appid","100114"),i.append("appidKey",o[100114]),i.append("allowGif",x.allowGif?"1":"0"),i.append("needCompress",d.needCompress),i.append("isSupportHttps",d.isSupportHttps),i.append("image",a),i.append("valie","1"),i.append("passport",u),Ee(i,{valid:1,passport:u}).then($=>{const S=$.data;d.totalCount--,(S==null?void 0:S.status)==200&&(S!=null&&S.message)?(t.res=S,h(S,a.tempname,"ok")):h(S,a.tempname,"fail")}).catch($=>{h({},a.tempname,"fail")})},W=a=>z(this,null,function*(){const d=t,o=a.target.files;o.length>1&&(d.type="some"),t.imgList.length+o.length>x.count?(d.totalCount=x.count-t.imgList.length,d.overCount=t.imgList.length+o.length-x.count,ie({message:"鏈澶氬彧鍏佽娣诲姞"+x.count+"寮犲浘鐗囷紝瓒呭嚭閮ㄥ垎鏈笂浼"})):d.totalCount=o.length;let i=d.totalCount;for(var u=0;u{const d=t;if(a.size>d.maxSize/2){var o="//photocdn.tv.sohu.com/img/20240820/pic_org_aa730366-2860-42d3-ac2e-c3e106fba257.png";const u={message:{name:a.tempname,url:o,status:"loading",width:0,height:0,type:"local"}};h(u,a.tempname,"loading")}else try{var i=new FileReader;i.readAsDataURL(a),i.onload=function(u){var N=u.target.result;const $={message:{name:a.tempname,url:N,status:"loading",width:0,height:0,type:""}};h($,a.tempname,"loading")},i.onerror=function(u){var N="//photocdn.tv.sohu.com/img/20240820/pic_org_aa730366-2860-42d3-ac2e-c3e106fba257.png";const $={message:{name:a.tempname,url:N,status:"loading",width:0,height:0,type:"local"}};h($,a.tempname,"loading")}}catch(u){}},v=()=>{if(t.imgList.length>=x.count){ie({message:"鏈澶氬彧鍏佽娣诲姞"+x.count+"寮犲浘鐗"});return}const a=w.value;a.value="",a.click()},h=(a={},d,o)=>{var u;const i=t.imgList.findIndex(N=>N.name===d);if(i!=-1)o=="fail"?t.imgList[i].status=o:o=="ok"&&(t.imgList[i].status=o,t.imgList[i].width=a.message.width||0,t.imgList[i].height=a.message.height||0,t.imgList[i].url=a.message.url||"",t.imgList[i].type=="local"&&(t.imgList[i].tempurl=Ne(a.message.url)||""));else if(o=="loading"&&Object.keys(a).length>0){const N={name:d,tempurl:a.message.url||"",url:"",width:a.message.width||0,height:a.message.height||0,status:o,type:((u=a.message)==null?void 0:u.type)||""};t.imgList.push(N)}oe(()=>{M();const N=t.imgList.filter($=>$.status=="ok").map(({width:$,height:S,url:e})=>({width:$,height:S,url:e}));C("updateImgList",N)})},D=(a,d)=>{t.imgList.splice(a,1),oe(()=>{M()});const o=t.imgList.filter(i=>i.status=="ok").map(({width:i,height:u,url:N})=>({width:i,height:u,url:N}));C("updateImgList",o)},I=a=>{if(a.status!=="ok")return;const d=t.imgList.filter(u=>u.status=="ok"),o=d.findIndex(u=>u.name==a.name),i=d.map(({width:u,height:N,url:$})=>({width:u,height:N,imageURL:$}));p.value&&p.value.open(i,o)},M=()=>{if(k&&y){const a=k.value.clientWidth,d=y.value.clientWidth;if(a>d){const o=y.value.scrollLeft;o>0?t.pageInfo.prePage=!0:t.pageInfo.prePage=!1,o+d{y&&(y.value.scrollLeft-=56),M()},L=()=>{y&&(y.value.scrollLeft+=56),M()};return _({bindOutClick:v}),(a,d)=>(T(),R(Y,null,[b("div",{class:"uploadImgWrap",ref_key:"imgWrapRef",ref:y},[b("input",{type:"file",class:"uploadImg",accept:t.accept,disabled:t.imgList.length>=r.count,onChange:W,ref_key:"imgUploadInput",ref:w,multiple:r.multiple,name:"imgUpload"},null,40,Ve),le(b("ul",{class:"repost-img-list",ref_key:"imgListRef",ref:k},[(T(!0),R(Y,null,ue(t.imgList,(o,i)=>(T(),R("li",{key:o.tempurl},[b("div",{class:Q(["img-box",o.status]),onClick:O(u=>I(o),["stop"])},[b("img",{src:o.tempurl},null,8,je),o.status!="ok"?(T(),R("div",{key:0,class:Q(o.status+"-mask")},[b("div",{class:Q(["status-img",o.status+"-img"])},null,2)],2)):H("",!0),b("div",ze,[b("i",{class:"delete",title:"鍒犻櫎",onClick:O(u=>D(i),["stop"])},null,8,Ge)])],10,We)]))),128))],512),[[ce,t.imgList.length>0]]),b("div",Fe,[t.pageInfo.prePage?(T(),R("div",{key:0,class:"pre-page",onClick:O(j,["stop"])})):H("",!0),t.pageInfo.nextPage?(T(),R("div",{key:1,class:"next-page",onClick:O(L,["stop"])})):H("",!0)])],512),(T(),ye(we,{to:"body"},[ke(He,{ref_key:"imageViewer",ref:p},null,512)]))],64))}}),rt=Z(Xe,[["__scopeId","data-v-212b9547"]]),K="//push.my.tv.sohu.com",Ke={getList(r){return G(`${K}/user/a/fo/list.do?encoding=utf-8&size=10&currPage=${r}`)},subscribe(r){return G(`${K}/user/a/fo/batchadd.do?encoding=utf-8&uids=${r}`)},unSubscribe(r){return G(`${K}/user/a/fo/batchcancel.do?encoding=utf-8&uids=${r}`)},checkSubscribe(r){return G(`${K}/user/a/fo/batchJudge.do?encoding=utf-8&uids=${r}`)},getRecomList(r){return G(`https://hd.my.tv.sohu.com/aggregation/api/v1/pc/getInterestedList?businessType=4&nums=4&uid=${r}`)}},qe={key:0,class:"recom-user"},Je={class:"scrollbar"},Ze=["title","onClick"],Qe=["src"],Ye=["innerHTML"],et=J({__name:"atRecomUser",props:{keyword:{}},emits:["select"],setup(r,{emit:_}){const m=r,C=_,p=P([]),w=P([]),y=()=>z(this,null,function*(){try{const{data:f}=yield re.getRecentAtList();f.status==200&&(p.value=f.data.map(v=>X(F({},v),{nickname:v.nickname,showName:t(v.nickname),showPic:v.smallphoto})))}catch(f){}yield k()}),k=()=>z(this,null,function*(){try{const{data:f}=yield Ke.getList(1);f.statusText=="success"&&f.data.forEach(v=>{p.value.some(h=>h.uid===v.uid)||p.value.push(X(F({},v),{nickname:v.nickname,showName:v.nickname,showPic:v.smallPic}))})}catch(f){}}),t=f=>{if(!f)return"";var v=f.replaceAll("<<<",'').replaceAll(">>>","");return v},x=f=>z(this,null,function*(){try{if(!f||f.length>20||/[\s\r\n]/.test(f)){w.value=[];return}const{data:v}=yield re.searchUser({key:f});v.status==200&&(w.value=v.data.items.map(h=>X(F({},h),{nickname:h.original_nickname,showName:t(h.nickName),showPic:h.smallPic})))}catch(v){}});be(()=>m.keyword,f=>{x(f)},{immediate:!0});const A=q(()=>m.keyword?w.value:p.value),W=f=>{C("select",f)};return ee(()=>{y()}),(f,v)=>A.value.length>0?(T(),R("div",qe,[v[0]||(v[0]=b("div",{class:"recom-tip"},"閫夋嫨鎴栬緭鍏ヤ綘鎯矦鐨勪汉",-1)),b("ul",Je,[(T(!0),R(Y,null,ue(A.value,h=>(T(),R("li",{key:h.id,class:"inline-user-list",title:h.nickname,onClick:O(D=>W(h),["stop"])},[b("img",{src:h.showPic,alt:"鐢ㄦ埛澶村儚"},null,8,Qe),b("span",{innerHTML:h.showName},null,8,Ye)],8,Ze))),128))])])):H("",!0)}}),lt=Z(et,[["__scopeId","data-v-291a83c7"]]);export{He as I,it as R,lt as a,rt as u};