import{T as k,c as i,b as e,F as v,e as g,a as m,w as f,f as w,u as o,o as r,g as S,C as P,j as N,t as _,d as V,m as C}from"./app-z_grtNg1.js";import{P as B}from"./PrimaryButton-i7WPAeR-.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const j={class:"text-sm font-semibold text-slate-900"},E={class:"mt-1 text-xs text-slate-500"},F={class:"relative inline-flex items-center"},R=["onUpdate:modelValue"],T={class:"flex items-center gap-4 pt-2"},U={key:0,class:"text-sm text-gray-600"},O={__name:"UpdateNotificationPreferencesForm",props:{preferences:{type:Object,default:()=>({inbox_enabled:!0,popup_enabled:!0,email_admin_updates:!0,email_transaction_updates:!0,marketing_opt_in:!1})}},setup(b){var l,p,d,c,u;const a=b,s=k({inbox_enabled:!!((l=a.preferences)!=null&&l.inbox_enabled),popup_enabled:!!((p=a.preferences)!=null&&p.popup_enabled),email_admin_updates:!!((d=a.preferences)!=null&&d.email_admin_updates),email_transaction_updates:!!((c=a.preferences)!=null&&c.email_transaction_updates),marketing_opt_in:!!((u=a.preferences)!=null&&u.marketing_opt_in)}),h=[{key:"inbox_enabled",title:"Inbox notifications",hint:"Show admin updates in your in-app notification inbox."},{key:"popup_enabled",title:"Popup alerts",hint:"Show popup alerts for urgent updates while using the app."},{key:"email_admin_updates",title:"Email admin updates",hint:"Receive important account updates by email when available."},{key:"email_transaction_updates",title:"Email transaction updates",hint:"Receive purchase and transaction status updates by email."},{key:"marketing_opt_in",title:"Promotions and offers",hint:"Receive product updates and promo offers from the platform."}],x=()=>{s.patch(route("profile.notification-preferences.update"),{preserveScroll:!0})};return(D,t)=>(r(),i("section",null,[t[3]||(t[3]=e("header",null,[e("h2",{class:"text-lg font-medium text-gray-900"},"Notification Preferences"),e("p",{class:"mt-1 text-sm text-gray-600"}," Choose how you want to receive updates from this platform. ")],-1)),e("form",{class:"mt-6 space-y-4",onSubmit:N(x,["prevent"])},[(r(),i(v,null,g(h,n=>e("label",{key:n.key,class:"flex items-start justify-between gap-4 rounded-xl border border-slate-200 p-4"},[e("div",null,[e("div",j,_(n.title),1),e("p",E,_(n.hint),1)]),e("span",F,[V(e("input",{"onUpdate:modelValue":y=>o(s)[n.key]=y,type:"checkbox",class:"peer sr-only"},null,8,R),[[C,o(s)[n.key]]]),t[0]||(t[0]=e("span",{class:"h-6 w-11 rounded-full bg-slate-300 transition peer-checked:bg-slate-900"},null,-1)),t[1]||(t[1]=e("span",{class:"pointer-events-none absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white transition peer-checked:translate-x-5"},null,-1))])])),64)),e("div",T,[m(B,{disabled:o(s).processing},{default:f(()=>[...t[2]||(t[2]=[w("Save Preferences",-1)])]),_:1},8,["disabled"]),m(P,{"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:f(()=>[o(s).recentlySuccessful?(r(),i("p",U,"Saved.")):S("",!0)]),_:1})])],32)]))}};export{O as default};
