import{S as W,V as j,a as q}from"./virtual-BQH0NzJY.js";import{X as K}from"./MkTutorialDialog-CFZyQ5Bw.js";import{X as J}from"./MkTimeline-BHgihgS6.js";import{v as l,a as Q,c as g,$ as r,t as k,d as O,aA as Y,b as t,X as Z,f as T,_ as ee}from"./app-QjDgb7aF.js";import{b as te,f,c as oe,E as _,A as ie,j as c,g as b,i as u,k as y,l as ne,p as A,H as C,q as ae,u as n,F as se,G as le,a as w}from"./vue-Cm77DuTi.js";import"./media-DuCIZ-3n.js";import"./profile-ByRIrD3R.js";import"./split-B5EOpoau.js";import"./folder-DKyFtE95.js";import"./slot-BIWBfzr1.js";import"./charts-3gEHPHRq.js";import"./explore.users-CF98Gym3.js";import"./MkUserList-DmXj88Tc.js";import"./MkUserInfo-Brwzwv5t.js";import"./MkNumber.vue_vue_type_script_setup_true_lang-DCqylJGQ.js";import"./animation-wAdLxVJ8.js";import"./number-BJeYzK3l.js";import"./MkPagination-DzUgufpZ.js";import"./MkFolder-DXwFMXde.js";import"./MkTab.vue_vue_type_style_index_0_lang-Cn_SAquG.js";import"./MkPushNotificationAllowButton.vue_vue_type_script_setup_true_lang-DvaRqget.js";import"./MkNotes-DrVlMmnc.js";import"./MkNote-RPFbRjy2.js";import"./MkReactionsViewer-D75lmVQ0.js";import"./MkReactionIcon.vue_vue_type_script_setup_true_lang-D23mNn1N.js";import"./share-available-Drgr3YiT.js";import"./get-note-summary-DlGmePWF.js";import"./MkDateSeparatedList.vue_vue_type_style_index_0_lang-87CjANkN.js";const re={class:"tl _block"},L=500,ce=te({__name:"timeline",setup(pe){l.reactiveState.tutorial.value!==-1&&Q(K,{},{},"closed");const h=!g.disableLocalTimeline||r!=null&&(r.isModerator||r.isAdmin),S=!g.disableRecommendedTimeline,x=!g.disableGlobalTimeline||r!=null&&(r.isModerator||r.isAdmin),E={t:V};let o=["home"];h&&o.push("local"),h&&o.push("social"),S&&o.push("recommended"),x&&o.push("global");const X=w(k==="smartphone"||window.innerWidth<=L);window.addEventListener("resize",()=>{X.value=k==="smartphone"||window.innerWidth<=L});const B=w(),F=w(),i=f({get:()=>l.reactiveState.tl.value.src,set:e=>{M(e),v(o.indexOf(e))}}),H=O("users/lists/list");async function I(e){await H.then(s=>{const m=[{type:"link",text:t.ts.manageLists,icon:"ph-faders-horizontal ph-bold ph-lg",to:"/my/lists"}].concat(s.map(a=>({type:"link",text:a.name,icon:"",to:`/timeline/list/${a.id}`})));T(m,e.currentTarget??e.target)})}const P=O("antennas/list");async function R(e){await P.then(s=>{const m=[{type:"link",indicate:!1,text:t.ts.manageAntennas,icon:"ph-faders-horizontal ph-bold ph-lg",to:"/my/antennas"}].concat(s.map(a=>({type:"link",text:a.name,icon:"",indicate:a.hasUnreadNote,to:`/timeline/antenna/${a.id}`})));T(m,e.currentTarget??e.target)})}function M(e){l.set("tl",{...l.state.tl,src:e})}function V(){B.value.focus()}const $=f(()=>[{icon:"ph-list-bullets ph-bold ph-lg",title:t.ts.lists,text:t.ts.lists,iconOnly:!0,handler:I},{icon:"ph-flying-saucer ph-bold ph-lg",title:t.ts.antennas,text:t.ts.antennas,iconOnly:!0,handler:R}]),D=f(()=>[{key:"home",title:t.ts._timelines.home,icon:"ph-house ph-bold ph-lg",iconOnly:!0},...h?[{key:"local",title:t.ts._timelines.local,icon:"ph-users ph-bold ph-lg",iconOnly:!0}]:[],...h?[{key:"social",title:t.ts._timelines.social,icon:"ph-handshake ph-bold ph-lg",iconOnly:!0}]:[],...S?[{key:"recommended",title:t.ts._timelines.recommended,icon:"ph-thumbs-up ph-bold ph-lg",iconOnly:!0}]:[],...x?[{key:"global",title:t.ts._timelines.global,icon:"ph-planet ph-bold ph-lg",iconOnly:!0}]:[]]);Y(f(()=>({title:t.ts.timeline,icon:i.value==="local"?"ph-users ph-bold ph-lg":i.value==="social"?"ph-handshake ph-bold ph-lg":i.value==="recommended"?"ph-thumbs-up ph-bold ph-lg":i.value==="global"?"ph-planet ph-bold ph-lg":"ph-house ph-bold ph-lg"})));let p=null;function N(e){p=e,v(o.indexOf(i.value))}function z(){M(o[p.activeIndex])}function v(e){p.slideTo(e)}return oe(()=>{v(o.indexOf(p.activeIndex))}),(e,s)=>{const m=_("MkPageHeader"),a=_("MkSpacer"),G=_("MkStickyContainer"),U=ie("hotkey");return c(),b(G,null,{header:u(()=>[y(m,{tab:i.value,"onUpdate:tab":s[0]||(s[0]=d=>i.value=d),actions:$.value,tabs:D.value,"display-my-avatar":!0},null,8,["tab","actions","tabs"])]),default:u(()=>[y(a,{"content-max":800},{default:u(()=>[ne((c(),A("div",{ref_key:"rootEl",ref:F,class:"cmuxhskf"},[e.$store.reactiveState.showFixedPostForm.value?(c(),b(Z,{key:0,class:"post-form _block",fixed:""})):C("",!0),ae("div",re,[y(n(W),{"round-lengths":!0,"touch-angle":25,threshold:10,centeredSlides:!0,modules:[n(j)],"space-between":20,virtual:!0,"allow-touch-move":n(l).state.swipeOnMobile&&(n(k)!=="desktop"||n(l).state.swipeOnDesktop),onSwiper:N,onSlideChange:z},{default:u(()=>[(c(!0),A(se,null,le(n(o),d=>(c(),b(n(q),{key:d,"virtual-index":d},{default:u(()=>[d==n(o)[n(p).activeIndex]?(c(),b(J,{ref_for:!0,ref:"tl",key:i.value,class:"tl",src:i.value,sound:!0},null,8,["src"])):C("",!0)]),_:2},1032,["virtual-index"]))),128))]),_:1},8,["modules","allow-touch-move"])])])),[[U,E,void 0,{global:!0}]])]),_:1})]),_:1})}}}),Ve=ee(ce,[["__scopeId","data-v-65f1de55"]]);export{Ve as default};
//# sourceMappingURL=timeline-CqBVRPoX.js.map
