import{n as e}from"./chunk-QTnfLwEv.js";import{$ as t,C as n,I as r,L as i,O as a,W as o,X as s,_ as c,a as l,o as u,u as d,v as f,w as p,x as m}from"./app-DelTpQnx.js";import{t as h}from"./i18n-KsED6gN-.js";var g={class:`text-lg font-medium text-ink`},_={class:`mt-1 text-sm text-ink-2`},v={class:`grid grid-cols-[1fr_4rem_4rem] items-center gap-y-3`},y={class:`text-center text-xs font-semibold uppercase tracking-wide text-ink-muted`},b={class:`text-center text-xs font-semibold uppercase tracking-wide text-ink-muted`},x={class:`border-t border-line py-2.5 text-sm text-ink-2`},S={class:`flex justify-center border-t border-line py-2.5`},C=[`onUpdate:modelValue`],w={class:`flex justify-center border-t border-line py-2.5`},T=[`onUpdate:modelValue`],E={class:`mt-5 flex items-center gap-3`},D=[`disabled`],O={key:0,class:`text-sm text-emerald-500`},k=a({__name:`NotificationPreferencesForm`,setup(e){let a=u().props.notificationPrefs??{},k=[{key:`reply`,label:h(`Replies to your topics & posts`)},{key:`mention`,label:h(`Mentions (@you)`)},{key:`message`,label:h(`Direct messages`)},{key:`reaction`,label:h(`Reactions to your posts`)},{key:`wall`,label:h(`Posts on your profile`)},{key:`badge`,label:h(`Badges you earn`)}],A={};for(let e of k)A[e.key]={email:!!a[e.key]?.email,push:a[e.key]?.push??!0};let j=l({prefs:A});function M(){j.post(`/notifications/channel-prefs`,{preserveScroll:!0})}return(e,a)=>(r(),p(`section`,null,[m(`header`,null,[m(`h2`,g,t(s(h)(`Notifications`)),1),m(`p`,_,t(s(h)(`Choose what you get notified about, and how. In-app alerts (the bell) are always on.`)),1)]),m(`form`,{class:`mt-6`,onSubmit:c(M,[`prevent`])},[m(`div`,v,[a[0]||=m(`span`,null,null,-1),m(`span`,y,t(s(h)(`Email`)),1),m(`span`,b,t(s(h)(`Push`)),1),(r(),p(f,null,i(k,e=>(r(),p(f,{key:e.key},[m(`span`,x,t(e.label),1),m(`label`,S,[o(m(`input`,{"onUpdate:modelValue":t=>s(j).prefs[e.key].email=t,type:`checkbox`,class:`h-4 w-4 rounded border-line bg-appbg text-primary focus:ring-primary`},null,8,C),[[d,s(j).prefs[e.key].email]])]),m(`label`,w,[o(m(`input`,{"onUpdate:modelValue":t=>s(j).prefs[e.key].push=t,type:`checkbox`,class:`h-4 w-4 rounded border-line bg-appbg text-primary focus:ring-primary`},null,8,T),[[d,s(j).prefs[e.key].push]])])],64))),64))]),m(`div`,E,[m(`button`,{type:`submit`,disabled:s(j).processing,class:`rounded-lg bg-primary px-4 py-2 text-sm font-semibold text-white hover:bg-primary-600 disabled:opacity-60`},t(s(h)(`Save preferences`)),9,D),s(j).recentlySuccessful?(r(),p(`span`,O,t(s(h)(`Saved.`)),1)):n(``,!0)])],32)]))}}),A=e({default:()=>j}),j=k;export{A as n,j as t};