import{C as e,D as t,E as n,F as r,H as i,I as a,Q as o,S as s,T as c,U as l,X as u,Y as d,_ as f,a as p,b as m,d as h,et as g,g as _,i as v,l as y,o as b}from"./app-YCWOtFpK.js";import{t as x}from"./i18n-Df3ROzzI.js";import{t as S}from"./InputLabel-DapSZQG7.js";import{t as C}from"./PrimaryButton-d3Z-OdlK.js";var w={class:`text-lg font-medium text-gray-900 dark:text-gray-100`},T={class:`mt-1 text-sm text-gray-600 dark:text-gray-400`},E={class:`mt-2 space-y-2`},D=[`value`],O={class:`block text-sm font-medium text-gray-900 dark:text-gray-100`},k={class:`block text-sm text-gray-500 dark:text-gray-400`},A={class:`flex cursor-pointer items-start gap-3 rounded-lg border border-gray-200 p-3 dark:border-gray-700`},j={class:`block text-sm font-medium text-gray-900 dark:text-gray-100`},M={class:`block text-sm text-gray-500 dark:text-gray-400`},N={class:`flex items-center gap-4`},P={key:0,class:`text-sm text-gray-600 dark:text-gray-400`},F=t({__name:`DigestPreferenceForm`,setup(t){let g=p().props.auth?.user??{},F=v({digest_frequency:g.digest_frequency??`weekly`,notify_email:g.notify_email??!0}),I=[{value:`off`,label:x(`Off`),hint:x(`No digest emails.`)},{value:`daily`,label:x(`Daily`),hint:x(`A summary every morning.`)},{value:`weekly`,label:x(`Weekly`),hint:x(`A summary once a week.`)}];function L(){F.post(route(`notifications.preferences`),{preserveScroll:!0})}return(t,p)=>(r(),e(`section`,null,[m(`header`,null,[m(`h2`,w,o(d(x)(`Email digest`)),1),m(`p`,T,o(d(x)(`Choose how often we email you a summary of new topics and unread notifications.`)),1)]),m(`form`,{class:`mt-6 space-y-6`,onSubmit:_(L,[`prevent`])},[m(`div`,null,[n(S,{value:d(x)(`Frequency`)},null,8,[`value`]),m(`div`,E,[(r(),e(f,null,a(I,e=>m(`label`,{key:e.value,class:u([`flex cursor-pointer items-start gap-3 rounded-lg border border-gray-200 p-3 dark:border-gray-700`,d(F).digest_frequency===e.value?`border-indigo-500 ring-1 ring-indigo-500`:``])},[l(m(`input`,{type:`radio`,class:`mt-0.5 text-indigo-600 focus:ring-indigo-500`,value:e.value,"onUpdate:modelValue":p[0]||=e=>d(F).digest_frequency=e},null,8,D),[[h,d(F).digest_frequency]]),m(`span`,null,[m(`span`,O,o(e.label),1),m(`span`,k,o(e.hint),1)])],2)),64))])]),m(`label`,A,[l(m(`input`,{type:`checkbox`,class:`mt-0.5 rounded text-indigo-600 focus:ring-indigo-500`,"onUpdate:modelValue":p[1]||=e=>d(F).notify_email=e},null,512),[[y,d(F).notify_email]]),m(`span`,null,[m(`span`,j,o(d(x)(`Instant email notifications`)),1),m(`span`,M,o(d(x)(`Email me when someone replies to me, mentions me, posts on my profile, or sends a message.`)),1)])]),m(`div`,N,[n(C,{disabled:d(F).processing},{default:i(()=>[c(o(d(x)(`Save`)),1)]),_:1},8,[`disabled`]),n(b,{"enter-active-class":`transition ease-in-out`,"enter-from-class":`opacity-0`,"leave-active-class":`transition ease-in-out`,"leave-to-class":`opacity-0`},{default:i(()=>[d(F).recentlySuccessful?(r(),e(`p`,P,o(d(x)(`Saved.`)),1)):s(``,!0)]),_:1})])],32)]))}}),I=g({default:()=>L}),L=F;export{I as n,L as t};