import{i as h,f as I,n as S,aB as D,$ as k,a4 as E,X as T}from"./app-JmgyQoR0.js";import{X as U}from"./MkTimeline-nT4DjZRf.js";import{b as F,a as g,h as l,t as a,F as b,E as m,z as u,H as r,x,I as X,J as z,u as n,w as j,c as y,D as f,i as w,j as v,l as p,y as J}from"./vue-y3KLWBaS.js";import"./MkNotes-Z5KXbZLG.js";import"./MkNote-Y7yPCL5J.js";import"./MkReactionsViewer-iZKN4Via.js";import"./MkReactionIcon.vue_vue_type_script_setup_true_lang-MnLL2GJr.js";import"./share-available-LNRVMfAE.js";import"./get-note-summary-7eDLQp-L.js";import"./MkDateSeparatedList.vue_vue_type_style_index_0_lang-bpwwzSpi.js";import"./MkPagination-urywMrXv.js";const C=s=>(X("data-v-09271035"),s=s(),z(),s),O=["disabled"],R={key:0},q=C(()=>n("i",{class:"ph-minus ph-bold ph-lg"},null,-1)),G={key:0},K=C(()=>n("i",{class:"ph-plus ph-bold ph-lg"},null,-1)),L={key:0},Q=C(()=>n("i",{class:"ph-circle-notch ph-bold ph-lg fa-pulse ph-fw ph-lg"},null,-1)),W=F({__name:"MkChannelFollowButton",props:{channel:{},full:{type:Boolean,default:!1}},setup(s){const d=s,o=g(d.channel.isFollowing),e=g(!1);async function i(){e.value=!0;try{o.value?(await I("channels/unfollow",{channelId:d.channel.id}),o.value=!1):(await I("channels/follow",{channelId:d.channel.id}),o.value=!0)}catch(c){console.error(c)}finally{e.value=!1}}return(c,B)=>(l(),a("button",{class:x(["hdcaacmi _button",{wait:e.value,active:o.value,full:c.full}]),disabled:e.value,onClick:i},[e.value?(l(),a(b,{key:1},[c.full?(l(),a("span",L,m(u(h).ts.processing),1)):r("",!0),Q],64)):(l(),a(b,{key:0},[o.value?(l(),a(b,{key:0},[c.full?(l(),a("span",R,m(u(h).ts.unfollow),1)):r("",!0),q],64)):(l(),a(b,{key:1},[c.full?(l(),a("span",G,m(u(h).ts.follow),1)):r("",!0),K],64))],64))],10,O))}}),Y=S(W,[["__scopeId","data-v-09271035"]]),$=s=>(X("data-v-f0a82edb"),s=s(),z(),s),Z={key:0},ee={key:0,class:"ph-caret-up ph-bold ph-lg"},le={key:1,class:"ph-caret-down ph-bold ph-lg"},ne={key:0,class:"hideOverlay"},ae={class:"status"},se=$(()=>n("i",{class:"ph-users ph-bold ph-lg ph-fw ph-lg"},null,-1)),te=$(()=>n("i",{class:"ph-pencil ph-bold ph-lg ph-fw ph-lg"},null,-1)),oe=$(()=>n("div",{class:"fade"},null,-1)),ce={key:1,class:"description"},ie=F({__name:"channel",props:{channelId:{}},setup(s){const d=D(),o=s;let e=g(null),i=g(!0);j(()=>o.channelId,async()=>{e.value=await I("channels/show",{channelId:o.channelId})},{immediate:!0});function c(){var t;d.push(`/channels/${(t=e.value)==null?void 0:t.id}/edit`)}const B=y(()=>{var t,_;return[...e.value&&((t=e.value)==null?void 0:t.userId)===((_=k)==null?void 0:_.id)?[{icon:"ph-gear-six ph-bold ph-lg",text:h.ts.edit,handler:c}]:[]]}),P=y(()=>[]);return E(y(()=>e.value?{title:e.value.name,icon:"ph-television ph-bold ph-lg"}:null)),(t,_)=>{const A=f("MkPageHeader"),M=f("I18n"),H=f("Mfm"),N=f("MkSpacer"),V=f("MkStickyContainer");return l(),w(V,null,{header:v(()=>[p(A,{actions:B.value,tabs:P.value,"display-back-button":!0},null,8,["actions","tabs"])]),default:v(()=>[p(N,{"content-max":700},{default:v(()=>[e.value?(l(),a("div",Z,[n("div",{class:x(["wpgynlbz _panel _gap",{hide:!i.value}])},[p(Y,{channel:e.value,full:!0,class:"subscribe"},null,8,["channel"]),n("button",{class:"_button toggle",onClick:_[0]||(_[0]=()=>i.value=!i.value)},[i.value?(l(),a("i",ee)):(l(),a("i",le))]),i.value?r("",!0):(l(),a("div",ne)),n("div",{style:J({backgroundImage:e.value.bannerUrl?`url(${e.value.bannerUrl})`:null}),class:"banner"},[n("div",ae,[n("div",null,[se,p(M,{src:u(h).ts._channel.usersCount,tag:"span",style:{"margin-left":"4px"}},{n:v(()=>[n("b",null,m(e.value.usersCount),1)]),_:1},8,["src"])]),n("div",null,[te,p(M,{src:u(h).ts._channel.notesCount,tag:"span",style:{"margin-left":"4px"}},{n:v(()=>[n("b",null,m(e.value.notesCount),1)]),_:1},8,["src"])])]),oe],4),e.value.description?(l(),a("div",ce,[p(H,{text:e.value.description,"is-note":!1,i:u(k)},null,8,["text","i"])])):r("",!0)],2),u(k)?(l(),w(T,{key:0,channel:e.value,class:"post-form _panel _gap",fixed:""},null,8,["channel"])):r("",!0),(l(),w(U,{key:t.channelId,class:"_gap",src:"channel",channel:t.channelId,onBefore:t.before,onAfter:t.after},null,8,["channel","onBefore","onAfter"]))])):r("",!0)]),_:1})]),_:1})}}}),ke=S(ie,[["__scopeId","data-v-f0a82edb"]]);export{ke as default};
