import{j as e}from"./@radix-D8tIKeo-.js";import{w as f,bp as d,bA as l,bs as y,x as g,bw as j,k as b,e as N}from"./index-B44sgOyQ.js";import{u as v}from"./update-server-settings-mutation-tWPwIrcY.js";import{h as S}from"./@tanstack-nMqraTcu.js";import{a as u}from"./@monaco-editor-CuNQBT0l.js";import"./@elkjs-CmhuJAjY.js";import"./@react-router-D1ODL_Ub.js";import"./@reactflow-DgowYF6H.js";import"./@zod-2qqdh1cM.js";function k({settings:t}){const a=u.useId(),n=u.useId(),{toast:r}=f(),i=S(),m=t.body?.display_announcements??!1,p=t.body?.display_updates??!1,{mutate:o,isPending:c}=v({onError:s=>{i.invalidateQueries({queryKey:l()}),y(s)&&r({status:"error",emphasis:"subtle",icon:e.jsx(g,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:s.message,rounded:!0})},onSuccess:()=>{i.invalidateQueries({queryKey:l()}),r({status:"success",emphasis:"subtle",rounded:!0,description:"Settings updated successfully"})}}),x=s=>{o({display_announcements:s})},h=s=>{o({display_updates:s})};return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx(d,{checked:m,onCheckedChange:x,id:a,disabled:c}),e.jsxs("label",{htmlFor:a,className:"text-text-md",children:[e.jsx("p",{className:"font-semibold",children:"Announcements"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Enable Announcements for important ZenML updates, surveys, and feedback opportunities."})]})]}),e.jsx("hr",{}),e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx(d,{checked:p,onCheckedChange:h,id:n,disabled:c}),e.jsxs("label",{htmlFor:n,className:"text-text-md",children:[e.jsx("p",{className:"font-semibold",children:"Updates"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Activate Updates to receive the latest ZenML news and feature releases."})]})]})]})}function K(){const{data:t}=j({throwOnError:!0});return e.jsxs(b,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Notifications"}),e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"ZenML comes equipped with default widgets designed to enhance your experience by analyzing usage patterns, gathering your feedback, and ensuring you stay informed about our latest updates and features."})]}),e.jsx("div",{className:"",children:t?e.jsx(k,{settings:t}):e.jsx(N,{className:"h-[250px] w-full"})})]})}export{K as default};
