import{_ as E}from"./BopM0vw7.js";import{V as I}from"./C8MHOe0D.js";import{bB as n,X as u,cS as v,a3 as h,aa as O,cG as V,cl as F,bw as J,cR as N,p as U,ch as L,c7 as r,Z as m,F as C,bR as D,Y as $,W as f,c0 as w,r as R,O as B}from"#entry";import{V as T,_ as X}from"./BvY57J1L.js";import{u as j,D as M}from"./DsNA9-h5.js";import{u as q}from"./Bb3BcK1y.js";import"./BKDgfSxC.js";import"./CyrZsGpg.js";import"./Cp3UUybv.js";import"./-GcL7px7.js";import"./CEoxYnb5.js";import"./R1_j74h_.js";import"./Clw9ztwl.js";const G={__name:"Announcement",props:{announcement:{type:Object,default:()=>({})}},setup(p){return(a,d)=>{const l=E;return n(),u(l,{class:"text-decoration-none",to:`/announcement/${p.announcement?.id}`},{default:v(()=>[h(I,{class:"mt-2 mt-sm-4",type:"info",title:p.announcement.title},null,8,["title"])]),_:1},8,["to"])}}},H={key:0,id:"announcements",class:"mt-2 mt-sm-4"},P={class:"events mt-sm-4 mt-2"},W={key:0,class:"d-flex flex-column align-center ga-2 my-8 my-sm-12"},Y={class:"text-h4 text-medium-emphasis"},me=O({__name:"index",async setup(p){let a,d;const l=j(),e=V("settings");F({title:e.value?.title,meta:[{name:"description",content:e?.value.description},{name:"og:description",content:e?.value.description},{property:"og:title",content:e.value.title},{property:"og:url",content:e.value.baseurl},{property:"og:image",content:e.value.baseurl+"/logo.png"}],link:[{rel:"apple-touch-icon",href:e.value.baseurl+"/logo.png"},{rel:"alternate",type:"application/rss+xml",title:e.value.title,href:e.value.baseurl+"/feed/rss"},{rel:"alternate",type:"text/calendar",title:e.value.title,href:e.value.baseurl+"/feed/ics"},{rel:"search",type:"application/opensearchdescription+xml",title:e.value.title,href:e.value.baseurl+"/opensearch.xml"},{rel:"me",href:`${e.value.baseurl}/federation/u/${e.value.instance_name}`}]});const y=l.nowUnix(),_=V("selectedDate",()=>{}),{events:i,params:x,refresh:S}=q();J(()=>S());const z=B(()=>x.value.start===l.startMonth()),g=B(()=>{if(x.value.query)return i.value;if(_.value){const t=M.fromJSDate(_?.value)?.startOf("day")?.toUnixInteger(),c=M.fromJSDate(_?.value)?.endOf("day")?.toUnixInteger();return i.value?.filter(s=>s.start_datetime<=c&&(s.end_datetime||s.start_datetime)>=t)}else return z.value?i.value?.filter(t=>{const c=Math.max(t.start_datetime,t?.end_datetime??0);return t.end_datetime?c>=y:t.start_datetime+10800>=y}):i.value}),{data:b}=([a,d]=N(()=>L("/api/announcements","$xIynyJyXPB")),a=await a,d(),a);return(t,c)=>{const s=G,A=X;return n(),u(U,{id:"home",class:"px-2 px-sm-6 pt-0"},{default:v(()=>[r(b)?.length?(n(),m("section",H,[(n(!0),m(C,null,D(r(b),o=>(n(),u(s,{key:o.id,announcement:o},null,8,["announcement"]))),128))])):$("",!0),f("section",P,[(n(!0),m(C,null,D(r(g),(o,k)=>(n(),u(T,{key:o.id,class:"event","model-value":k<9,options:{threshold:.5,rootMargin:"500px"}},{default:v(()=>[h(A,{event:o,lazy:k>9,"hide-thumbs":r(e).hide_thumbs},null,8,["event","lazy","hide-thumbs"])]),_:2},1032,["model-value"]))),128)),r(g)?.length?$("",!0):(n(),m("div",W,[f("span",Y,w(t.$t("common.no_events_found")),1),f("span",null,w(t.$t("common.no_events_found_hint")),1),h(R,{icon:"mdi-cactus",size:200,class:"opacity-20 mt-2"})]))])]),_:1})}}});export{me as default};
