import{_ as Te}from"./whisper-d959da10.js";import{_ as Ue,a as Ee}from"./post-item.vue_vue_type_style_index_0_lang-d5631a43.js";import{_ as Ve}from"./post-skeleton-47a1ebec.js";import{d as _e,H as n,c as ce,b as ge,e as d,f as y,bf as B,j as A,k as a,w as l,q as O,Y as k,y as ve,A as L,x as $,F as pe,u as de,E as Ne}from"./@vue-a481fc63.js";import{u as fe}from"./vuex-44de225f.js";import{l as me}from"./lodash-e0b37ac3.js";import{g as xe,a as Re,c as qe,b as Ge,d as Oe,e as Pe,_ as Ye}from"./index-5faa66a7.js";import{p as Fe}from"./content-2d41ca0a.js";import{V as G,P as Q}from"./IEnum-5453a777.js";import{I as Le,V as Se,A as Me,d as Ke,E as We}from"./@vicons-7a4ef312.js";import{o as he,v as je,j as Qe,e as He,w as Ze,x as Je,y as Xe,z as $e,A as et,B as tt,C as at,a as we,D as st,E as ot,F as nt,G as lt,l as it,H as rt,I as ut,k as ct}from"./naive-ui-d8de3dda.js";import{_ as pt}from"./main-nav.vue_vue_type_style_index_0_lang-0888b762.js";import{b as dt,u as vt}from"./vue-router-e5a2430e.js";import{W as mt}from"./v3-infinite-loading-2c58ec2f.js";import{S as _t}from"./@opentiny-d73a2d67.js";import"./copy-to-clipboard-4ef7d3eb.js";import"./@babel-725317a4.js";import"./toggle-selection-93f4ad84.js";import"./axios-4a70c6fc.js";import"./moment-2ab8298d.js";/* empty css */import"./seemly-76b7b838.js";import"./vueuc-39372edb.js";import"./evtd-b614532e.js";import"./@css-render-7124a1a5.js";import"./vooks-6d99783e.js";import"./vdirs-b0483831.js";import"./@juggle-41516555.js";import"./css-render-6a5c5852.js";import"./@emotion-8a8e73f6.js";import"./lodash-es-8412e618.js";import"./treemate-25c27bff.js";import"./async-validator-dee29e8b.js";import"./date-fns-975a2d8f.js";import"./paopao-video-player-2fe58954.js";import"./vue-1e3b54ec.js";import"./xss-a5544f63.js";import"./cssfilter-af71ba68.js";const gt=H=>{const Y=new FileReader,b=i=>["application/zip","application/x-zip","application/octet-stream","application/x-zip-compressed"].includes(i),T=()=>{const i=new Uint8Array(Y.result).subarray(0,4);let U="";for(let g=0;g{Y.onloadend=()=>{const g=H.type;i(g===""||g==="application/octet-stream"?T():b(g))},Y.readAsArrayBuffer(H.slice(0,4))})},ft={key:0,class:"compose-wrap"},ht={class:"compose-line"},wt={class:"compose-user"},yt={class:"compose-line compose-options"},kt={class:"attachment"},At={class:"submit-wrap"},bt={class:"attachment-list-wrap"},Ct={key:0,class:"attachment-price-wrap"},zt=A("span",null," 附件价格¥",-1),It={key:0,class:"eye-wrap"},Dt={key:1,class:"link-wrap"},Bt={key:1,class:"compose-wrap"},Tt=A("div",{class:"login-wrap"},[A("span",{class:"login-banner"}," 登录后,精彩更多")],-1),Ut={key:0,class:"login-only-wrap"},Et={key:1,class:"login-wrap"},Vt=_e({__name:"compose",emits:["post-success"],setup(H,{emit:Y}){const b=fe(),T=n([]),i=n(!1),U=n(!1),g=n(!1),P=n(!1),f=n(""),x=n([]),E=n(),V=n(0),m=n("public/image"),I=n([]),v=n([]),h=n([]),C=n([]),D=n(G.PUBLIC),R=n(G.PUBLIC),M="true".toLowerCase()==="true",F=+"400",Z=n("true".toLowerCase()==="true"),J=n("true".toLowerCase()==="true"),ee=n("true".toLowerCase()==="true"),S=n("false".toLowerCase()==="true"),te=n("true".toLowerCase()==="true"),K="/v1/attachment",q=ce(()=>"Bearer "+localStorage.getItem("PAOPAO_TOKEN")),X=ce(()=>{let e=[{value:G.PUBLIC,label:"公开"},{value:G.PRIVATE,label:"私密"},{value:G.Following,label:"关注可见"}];return M&&e.push({value:G.FRIEND,label:"好友可见"}),e}),ae=()=>{g.value=!g.value,g.value&&P.value&&(P.value=!1)},W=()=>{P.value=!P.value,P.value&&g.value&&(g.value=!1)},se=me.debounce(e=>{xe({k:e}).then(t=>{let o=[];t.suggest.map(s=>{o.push({label:s,value:s})}),T.value=o,i.value=!1}).catch(t=>{i.value=!1})},200),c=me.debounce(e=>{Re({k:e}).then(t=>{let o=[];t.suggest.map(s=>{o.push({label:s,value:s})}),T.value=o,i.value=!1}).catch(t=>{i.value=!1})},200),p=(e,t)=>{i.value||(i.value=!0,t==="@"?se(e):c(e))},N=e=>{e.length>F?f.value=e.substring(0,F):f.value=e},w=e=>{m.value=e},z=e=>{for(let u=0;u30&&(e[u].name=o.substring(0,18)+"..."+o.substring(o.length-9)+"."+s)}I.value=e},oe=async e=>{var t,o,s,u,r;return m.value==="public/image"&&!["image/png","image/jpg","image/jpeg","image/gif"].includes((t=e.file.file)==null?void 0:t.type)?(window.$message.warning("图片仅允许 png/jpg/gif 格式"),!1):m.value==="image"&&((o=e.file.file)==null?void 0:o.size)>10485760?(window.$message.warning("图片大小不能超过10MB"),!1):m.value==="public/video"&&!["video/mp4","video/quicktime"].includes((s=e.file.file)==null?void 0:s.type)?(window.$message.warning("视频仅允许 mp4/mov 格式"),!1):m.value==="public/video"&&((u=e.file.file)==null?void 0:u.size)>104857600?(window.$message.warning("视频大小不能超过100MB"),!1):m.value==="attachment"&&!await gt(e.file.file)?(window.$message.warning("附件仅允许 zip 格式"),!1):m.value==="attachment"&&((r=e.file.file)==null?void 0:r.size)>104857600?(window.$message.warning("附件大小不能超过100MB"),!1):!0},ne=({file:e,event:t})=>{var o;try{let s=JSON.parse((o=t.target)==null?void 0:o.response);s.code===0&&(m.value==="public/image"&&v.value.push({id:e.id,content:s.data.content}),m.value==="public/video"&&h.value.push({id:e.id,content:s.data.content}),m.value==="attachment"&&C.value.push({id:e.id,content:s.data.content}))}catch{window.$message.error("上传失败")}},le=({file:e,event:t})=>{var o;try{let s=JSON.parse((o=t.target)==null?void 0:o.response);if(s.code!==0){let u=s.msg||"上传失败";s.details&&s.details.length>0&&s.details.map(r=>{u+=":"+r}),window.$message.error(u)}}catch{window.$message.error("上传失败")}},ie=({file:e})=>{let t=v.value.findIndex(o=>o.id===e.id);t>-1&&v.value.splice(t,1),t=h.value.findIndex(o=>o.id===e.id),t>-1&&h.value.splice(t,1),t=C.value.findIndex(o=>o.id===e.id),t>-1&&C.value.splice(t,1)},re=()=>{if(f.value.trim().length===0){window.$message.warning("请输入内容哦");return}let{tags:e,users:t}=Fe(f.value);const o=[];let s=100;o.push({content:f.value,type:Q.TEXT,sort:s}),v.value.map(u=>{s++,o.push({content:u.content,type:Q.IMAGEURL,sort:s})}),h.value.map(u=>{s++,o.push({content:u.content,type:Q.VIDEOURL,sort:s})}),C.value.map(u=>{s++,o.push({content:u.content,type:Q.ATTACHMENT,sort:s})}),x.value.length>0&&x.value.map(u=>{s++,o.push({content:u,type:Q.LINKURL,sort:s})}),U.value=!0,qe({contents:o,tags:Array.from(new Set(e)),users:Array.from(new Set(t)),attachment_price:+V.value*100,visibility:D.value}).then(u=>{var r;window.$message.success("发布成功"),U.value=!1,Y("post-success",u),g.value=!1,P.value=!1,(r=E.value)==null||r.clear(),I.value=[],f.value="",x.value=[],v.value=[],h.value=[],C.value=[],D.value=R.value}).catch(u=>{U.value=!1})},j=e=>{b.commit("triggerAuth",!0),b.commit("triggerAuthKey",e)};return ge(()=>{const e="friend".toLowerCase();M&&e==="friend"?R.value=G.FRIEND:e==="following"?R.value=G.Following:e==="public"?R.value=G.PUBLIC:R.value=G.PRIVATE,D.value=R.value}),(e,t)=>{const o=he,s=je,u=Qe,r=He,ue=Ze,ye=Je,ke=Xe,Ae=$e,be=et,Ce=tt,ze=at,Ie=we,De=st,Be=ot;return d(),y("div",null,[B(b).state.userInfo.id>0?(d(),y("div",ft,[A("div",ht,[A("div",wt,[a(o,{round:"",size:30,src:B(b).state.userInfo.avatar},null,8,["src"])]),a(s,{type:"textarea",size:"large",autosize:"",bordered:!1,loading:i.value,value:f.value,prefix:["@","#"],options:T.value,onSearch:p,"onUpdate:value":N,placeholder:"说说您的新鲜事..."},null,8,["loading","value","options"])]),a(Ce,{ref_key:"uploadRef",ref:E,abstract:"","list-type":"image",multiple:!0,max:9,action:K,headers:{Authorization:q.value},data:{type:m.value},"file-list":I.value,onBeforeUpload:oe,onFinish:ne,onError:le,onRemove:ie,"onUpdate:fileList":z},{default:l(()=>[A("div",yt,[A("div",kt,[a(ue,{abstract:""},{default:l(({handleClick:_})=>[a(r,{disabled:I.value.length>0&&m.value==="public/video"||I.value.length===9,onClick:()=>{w("public/image"),_()},quaternary:"",circle:"",type:"primary"},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(B(Le))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1}),J.value?(d(),O(ue,{key:0,abstract:""},{default:l(({handleClick:_})=>[a(r,{disabled:I.value.length>0&&m.value!=="public/video"||I.value.length===9,onClick:()=>{w("public/video"),_()},quaternary:"",circle:"",type:"primary"},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(B(Se))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):k("",!0),ee.value?(d(),O(ue,{key:1,abstract:""},{default:l(({handleClick:_})=>[a(r,{disabled:I.value.length>0&&m.value==="public/video"||I.value.length===9,onClick:()=>{w("attachment"),_()},quaternary:"",circle:"",type:"primary"},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(B(Me))]),_:1})]),_:2},1032,["disabled","onClick"])]),_:1})):k("",!0),a(r,{quaternary:"",circle:"",type:"primary",onClick:ve(ae,["stop"])},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(B(Ke))]),_:1})]),_:1},8,["onClick"]),te.value?(d(),O(r,{key:2,quaternary:"",circle:"",type:"primary",onClick:ve(W,["stop"])},{icon:l(()=>[a(u,{size:"20",color:"var(--primary-color)"},{default:l(()=>[a(B(We))]),_:1})]),_:1},8,["onClick"])):k("",!0)]),A("div",At,[a(ke,{trigger:"hover",placement:"bottom"},{trigger:l(()=>[a(ye,{class:"text-statistic",type:"circle","show-indicator":!1,status:"success","stroke-width":10,percentage:f.value.length/B(F)*100},null,8,["percentage"])]),default:l(()=>[L(" "+$(f.value.length)+" / "+$(B(F)),1)]),_:1}),a(r,{loading:U.value,onClick:re,type:"primary",secondary:"",round:""},{default:l(()=>[L(" 发布 ")]),_:1},8,["loading"])])]),A("div",bt,[a(Ae),C.value.length>0?(d(),y("div",Ct,[S.value?(d(),O(be,{key:0,value:V.value,"onUpdate:value":t[0]||(t[0]=_=>V.value=_),min:0,max:1e5,placeholder:"请输入附件价格,0为免费附件"},{prefix:l(()=>[zt]),_:1},8,["value"])):k("",!0)])):k("",!0)])]),_:1},8,["headers","data","file-list"]),P.value?(d(),y("div",It,[a(De,{value:D.value,"onUpdate:value":t[1]||(t[1]=_=>D.value=_),name:"radiogroup"},{default:l(()=>[a(Ie,null,{default:l(()=>[(d(!0),y(pe,null,de(X.value,_=>(d(),O(ze,{key:_.value,value:_.value,label:_.label},null,8,["value","label"]))),128))]),_:1})]),_:1},8,["value"])])):k("",!0),g.value?(d(),y("div",Dt,[a(Be,{value:x.value,"onUpdate:value":t[2]||(t[2]=_=>x.value=_),placeholder:"请输入以http(s)://开头的链接",min:0,max:3},{"create-button-default":l(()=>[L(" 创建链接 ")]),_:1},8,["value"])])):k("",!0)])):(d(),y("div",Bt,[Tt,Z.value?k("",!0):(d(),y("div",Ut,[a(r,{strong:"",secondary:"",round:"",type:"primary",onClick:t[3]||(t[3]=_=>j("signin"))},{default:l(()=>[L(" 登录 ")]),_:1})])),Z.value?(d(),y("div",Et,[a(r,{strong:"",secondary:"",round:"",type:"primary",onClick:t[4]||(t[4]=_=>j("signin"))},{default:l(()=>[L(" 登录 ")]),_:1}),a(r,{strong:"",secondary:"",round:"",type:"info",onClick:t[5]||(t[5]=_=>j("signup"))},{default:l(()=>[L(" 注册 ")]),_:1})])):k("",!0)]))])}}});const Nt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA1lSURBVHgB7Z17cFTVHcd/59y7uze7ISSCqBBIeG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tsk3dmqXxnCn1we/JLEU3kZ5ZWVViLmez3g6cko7tkdK9YVoiAWYQyxz8fvQksA/4Kd90HFIWVtTwzzb2sU3O2q0tspwYjjMBi5wCFROZ4zdCPZ9P+zIyG1Msu2Yq2wZH1G30Pos8AG+3dKENrdujMcr0UNda+wuCFAuGFTggNAkCYw2mboIvp5WQzv6HMV3NePzx7GgmwVAO63DTUByW62mNd1mLEb0H/8DkOAXi0+nceAAAAAASUVORK5CYII=",xt="/assets/discover-tweets-ab101944.jpeg",Rt="/assets/following-tweets-e36b4410.jpeg",qt={class:"slide-bar-item"},Gt={class:"slide-bar-item-title slide-bar-user-link"},Ot={key:1,class:"skeleton-wrap"},Pt={key:0,class:"empty-wrap"},Yt={key:1},Ft={key:2},Lt={class:"load-more-wrap"},St={class:"load-more-spinner"},Mt=_e({__name:"Home",setup(H){const Y="true".toLowerCase()==="true",b="true".toLowerCase()==="true",T=fe(),i=dt(),U=vt(),g=n(9),P=n(8),f=n([{title:"最新动态",style:1,username:"",avatar:Nt,show:!0},{title:"热门推荐",style:2,username:"",avatar:xt,show:!1},{title:"正在关注",style:3,username:"",avatar:Rt,show:!1},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0},{title:"",style:1,username:"",avatar:"",show:!0}]),x=n("泡泡广场"),E=n(!1),V=n(!1),m=n(1),I=n(""),v=n([]),h=n(1),C=n(20),D=n(0),R=n(!1),M=n({id:0,avatar:"",username:"",nickname:"",is_admin:!1,is_friend:!0,is_following:!1,created_on:0,follows:0,followings:0,status:1}),F=c=>{M.value=c,R.value=!0},Z=()=>{R.value=!1},J=()=>{x.value="泡泡广场",i.query&&i.query.q&&(i.query.t&&i.query.t==="tag"?x.value="#"+decodeURIComponent(i.query.q):x.value="搜索: "+decodeURIComponent(i.query.q))},ee=ce(()=>Y&&b&&T.state.desktopModelShow&&T.state.userInfo.id>0),S=()=>{E.value=!1,V.value=!1,v.value=[],h.value=1,D.value=0},te=(c,p)=>{switch(S(),m.value=c.style,i.query.q&&(i.query.q=null,J()),c.style){case 1:q("newest");break;case 2:q("hots");break;case 3:i.query.q=null,q("following");break;case 21:I.value=c.username,X();break}f.value[p].show=!1},K=()=>{f.value=f.value.slice(0,3),!(!Y||!b||T.state.userInfo.id===0)&&Ge({page:1,page_size:50}).then(c=>{var p=0;const N=c.list||[];let w=[];for(;p0&&(f.value=f.value.concat(w))}).catch(c=>{console.log(c)})},q=c=>{E.value=!0,Oe({query:i.query.q?decodeURIComponent(i.query.q):null,type:i.query.t,style:c,page:h.value,page_size:C.value}).then(p=>{E.value=!1,p.list.length===0&&(V.value=!0),h.value>1?v.value=v.value.concat(p.list):(v.value=p.list,window.scrollTo(0,0)),D.value=Math.ceil(p.pager.total_rows/C.value)}).catch(p=>{E.value=!1,h.value>1&&h.value--})},X=()=>{E.value=!0,Pe({username:I.value,style:"post",page:h.value,page_size:C.value}).then(c=>{E.value=!1,c.list.length===0&&(V.value=!0),h.value>1?v.value=v.value.concat(c.list):(v.value=c.list||[],window.scrollTo(0,0)),D.value=Math.ceil(c.pager.total_rows/C.value)}).catch(c=>{v.value=[],h.value>1&&h.value--,E.value=!1})},ae=c=>{if(m.value!=1){U.push({name:"post",query:{id:c.id}});return}let p=[],N=v.value.length;N==C.value&&N--;for(var w=0;w{switch(m.value){case 1:q("newest");break;case 2:q("hots");break;case 3:q("following");break;case 21:i.query.q?q("search"):X();break}},se=()=>{h.value{S(),K(),q("newest")}),Ne(()=>({path:i.path,query:i.query,refresh:T.state.refresh}),(c,p)=>{if(J(),c.refresh!==p.refresh){S(),setTimeout(()=>{K(),W()},0);return}p.path!=="/post"&&c.path==="/"&&(S(),setTimeout(()=>{K(),W()},0))}),(c,p)=>{const N=pt,w=Vt,z=lt,oe=he,ne=it,le=rt,ie=Ve,re=ut,j=Ue,e=Ee,t=Te,o=nt,s=ct,u=we;return d(),y("div",null,[a(N,{title:x.value},null,8,["title"]),a(o,{class:"main-content-wrap",bordered:""},{default:l(()=>[a(z,null,{default:l(()=>[a(w,{onPostSuccess:ae})]),_:1}),ee.value?(d(),O(z,{key:0},{default:l(()=>[a(B(_t),{modelValue:f.value,"onUpdate:modelValue":p[0]||(p[0]=r=>f.value=r),"wheel-blocks":P.value,"init-blocks":g.value,onClick:te,tag:"div","sub-tag":"div"},{default:l(r=>[A("div",qt,[a(ne,{value:"1",offset:[-4,48],dot:"",show:r.slotData.show},{default:l(()=>[a(oe,{round:"",size:48,src:r.slotData.avatar,class:"slide-bar-item-avatar"},null,8,["src"])]),_:2},1032,["show"]),A("div",Gt,[a(le,{"line-clamp":2},{default:l(()=>[L($(r.slotData.title),1)]),_:2},1024)])])]),_:1},8,["modelValue","wheel-blocks","init-blocks"])]),_:1})):k("",!0),E.value&&v.value.length===0?(d(),y("div",Ot,[a(ie,{num:C.value},null,8,["num"])])):k("",!0),A("div",null,[v.value.length===0?(d(),y("div",Pt,[a(re,{size:"large",description:"暂无数据"})])):k("",!0),B(T).state.desktopModelShow?(d(),y("div",Yt,[(d(!0),y(pe,null,de(v.value,r=>(d(),O(z,{key:r.id},{default:l(()=>[a(j,{post:r,onSendWhisper:F},null,8,["post"])]),_:2},1024))),128))])):(d(),y("div",Ft,[(d(!0),y(pe,null,de(v.value,r=>(d(),O(z,{key:r.id},{default:l(()=>[a(e,{post:r,onSendWhisper:F},null,8,["post"])]),_:2},1024))),128))]))]),a(t,{show:R.value,user:M.value,onSuccess:Z},null,8,["show","user"])]),_:1}),D.value>0?(d(),O(u,{key:0,justify:"center"},{default:l(()=>[a(B(mt),{class:"load-more",slots:{complete:"没有更多泡泡了",error:"加载出错"},onInfinite:p[1]||(p[1]=r=>se())},{spinner:l(()=>[A("div",Lt,[V.value?k("",!0):(d(),O(s,{key:0,size:14})),A("span",St,$(V.value?"没有更多泡泡了":"加载更多"),1)])]),_:1})]),_:1})):k("",!0)])}}});const Ta=Ye(Mt,[["__scopeId","data-v-bae55427"]]);export{Ta as default};