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