1import{r,j as s}from"./vendor-react-DgB3iddG.js";import{u as f}from"./usePageTitle-DrV3LWkF.js";import{e as b,a as u}from"./index-BsRQWV7N.js";import{L as y}from"./Loader-CS_NcaeR.js";import{V as p}from"./volume-2-D5gaJ3Gf.js";import"./vendor-realtime-BWTNjo9H.js";import"./vendor-mui-dates-KAGm-C0e.js";/** 2 * @license lucide-react v0.554.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const j=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],_=b("volume-x",j);function P(){f("Notifications");const[e,a]=r.useState({}),[c,d]=r.useState(!0),[t,l]=r.useState(!1);r.useEffect(()=>{x()},[]);const x=async()=>{try{const n=await u.get("/settings");a(n.settings||{})}catch(n){console.error("Failed to load preferences",n)}finally{d(!1)}},i=async n=>{const m=!e[n],h={...e,[n]:m};a(h),l(!0);try{await u.post("/settings",{settings:{[n]:m}}),n==="sound_enabled"&&localStorage.setItem("notification_prefs",JSON.stringify(h))}catch(g){console.error("Failed to save preferences",g),a(e)}finally{l(!1)}};return c?s.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:s.jsx(y,{text:"Loading settings...",size:"lg"})}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:"Notification Preferences"}),s.jsx("p",{className:"text-[#A0A0A0]",children:"Customize how you receive notifications"})]}),s.jsxs("div",{className:"bg-[#1E1E1E] rounded-lg border border-[#404040] p-6",children:[s.jsx("h3",{className:"text-lg font-semibold text-white mb-4",children:"General"}),s.jsxs("div",{className:"space-y-4",children:[s.jsx(o,{label:"Email Notifications",description:"Receive notifications via email",checked:(e==null?void 0:e.email_notifications)??!0,onChange:()=>i("email_notifications"),disabled:t}),s.jsx(o,{label:"Push Notifications",description:"Receive browser push notifications",checked:(e==null?void 0:e.push_notifications)??!0,onChange:()=>i("push_notifications"),disabled:t}),s.jsx(o,{label:"Sound Alerts",description:"Play sound when new notifications arrive",checked:(e==null?void 0:e.sound_enabled)??!0,onChange:()=>i("sound_enabled"),disabled:t,icon:e!=null&&e.sound_enabled?p:_})]})]}),s.jsxs("div",{className:"bg-[#1E1E1E] rounded-lg border border-[#404040] p-6",children:[s.jsx("h3",{className:"text-lg font-semibold text-white mb-4",children:"Notification Types"}),s.jsxs("div",{className:"space-y-4",children:[s.jsx(o,{label:"New Messages",description:"When you receive a new message",checked:(e==null?void 0:e.notify_new_message)??!0,onChange:()=>i("notify_new_message"),disabled:t}),s.jsx(o,{label:"New Comments",description:"When someone comments on your posts",checked:(e==null?void 0:e.notify_new_comment)??!0,onChange:()=>i("notify_new_comment"),disabled:t}),s.jsx(o,{label:"Post Published",description:"When your scheduled posts go live",checked:(e==null?void 0:e.notify_post_published)??!0,onChange:()=>i("notify_post_published"),disabled:t}),s.jsx(o,{label:"Mentions",description:"When someone mentions you",checked:(e==null?void 0:e.notify_mention)??!0,onChange:()=>i("notify_mention"),disabled:t}),s.jsx(o,{label:"License Expiring",description:"When your license is about to expire",checked:(e==null?void 0:e.notify_license_expiring)??!0,onChange:()=>i("notify_license_expiring"),disabled:t})]})]})]})}function o({label:e,description:a,checked:c,onChange:d,disabled:t,icon:l}){return s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[l&&s.jsx(l,{className:"w-5 h-5 text-[#7B61FF]"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-white font-medium",children:e}),s.jsx("p",{className:"text-[#A0A0A0] text-sm",children:a})]})]}),s.jsx("button",{onClick:d,disabled:t,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${c?"bg-[#7B61FF]":"bg-[#404040]"} ${t?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:s.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${c?"translate-x-6":"translate-x-1"}`})})]})}export{P as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.