import{$ as e,C as t,D as n,E as r,F as i,H as a,I as o,Q as s,S as c,X as l,Y as u,_ as d,b as f,n as p}from"./app-fMWXDdYq.js";import{t as m}from"./i18n-D5HYY_eZ.js";import{n as h,t as g}from"./AppLayout-DaLVXHrF.js";var _={class:`mx-auto max-w-[760px]`},v={class:`mb-5 flex items-center justify-between`},y={class:`text-2xl font-extrabold tracking-tight`},b={class:`overflow-hidden rounded-c border border-line bg-surface`},x=[`onClick`],S={class:`min-w-0 flex-1`},C={class:`text-sm leading-snug text-ink`},w={key:0,class:`mt-1 truncate text-sm text-ink-muted`},T={class:`mt-1 text-xs text-ink-muted`},E={key:0,class:`mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-primary`},D={key:0,class:`px-5 py-16 text-center text-ink-muted`},O={class:`mt-2 text-sm`},k=n({__name:`Index`,props:{items:{},unread:{}},setup(n){let k=n;function A(e){return e.type===`mention`?m(`{name} mentioned you in {topic}`,{name:e.actor.name,topic:e.topic.title}):e.type===`reaction`?m(`{name} reacted {emoji} to your post`,{name:e.actor.name,emoji:e.emoji??``}):m(`{name} replied in {topic}`,{name:e.actor.name,topic:e.topic.title})}function j(t){t.read||e.post(`/notifications/${t.id}/read`,{},{preserveScroll:!0}),e.visit(t.url)}function M(){e.post(`/notifications/read`,{},{preserveScroll:!0})}return(e,n)=>(i(),t(d,null,[r(u(p),{title:u(m)(`Notifications`)},null,8,[`title`]),r(g,null,{default:a(()=>[f(`div`,_,[f(`div`,v,[f(`h1`,y,s(u(m)(`Notifications`)),1),k.unread>0?(i(),t(`button`,{key:0,type:`button`,class:`rounded-lg border border-line bg-surface px-3 py-2 text-sm font-semibold text-ink-2 hover:bg-surface-2`,onClick:M},s(u(m)(`Mark all read`)),1)):c(``,!0)]),f(`div`,b,[(i(!0),t(d,null,o(k.items,e=>(i(),t(`button`,{key:e.id,type:`button`,class:l([`flex w-full gap-3 border-b border-line/60 px-5 py-4 text-left last:border-0 hover:bg-surface-2`,e.read?``:`bg-primary/10`]),onClick:t=>j(e)},[r(h,{avatar:{initials:e.actor.initials,color:e.actor.color},size:40},null,8,[`avatar`]),f(`div`,S,[f(`div`,C,s(A(e)),1),e.excerpt?(i(),t(`div`,w,s(e.excerpt),1)):c(``,!0),f(`div`,T,s(e.time),1)]),e.read?c(``,!0):(i(),t(`span`,E))],10,x))),128)),k.items.length?c(``,!0):(i(),t(`div`,D,[n[0]||=f(`div`,{class:`text-3xl`},`🎉`,-1),f(`p`,O,s(u(m)(`No notifications yet — you're all caught up.`)),1)]))])])]),_:1})],64))}});export{k as default};