import{u}from"./useQuery-PdiC7-sY.js";import{a as i,b as s,d as n}from"./index-O0BQoyzo.js";const r={all:["settings"],env:e=>["settings","env",e],service:["settings","service"],admins:["settings","admins"],config:["settings","config"],workspaces:["settings","workspaces"]};function v(e={}){const t=!!e.reveal;return u({queryKey:r.env(t),queryFn:()=>n.getEnv({reveal:t})})}function l(){const e=i();return s({mutationFn:t=>n.updateEnv(t),onSuccess:()=>e.invalidateQueries({queryKey:["settings","env"]})})}function f(){return u({queryKey:r.service,queryFn:()=>n.getServiceStatus(),refetchInterval:5e3,refetchIntervalInBackground:!1})}function a(e,t){return s({mutationFn:e,onSuccess:()=>t.invalidateQueries({queryKey:r.service})})}function y(){const e=i();return a(()=>n.startService(),e)}function d(){const e=i();return a(()=>n.stopService(),e)}function m(){const e=i();return a(()=>n.restartService(),e)}function q(){return u({queryKey:r.admins,queryFn:()=>n.listAdminAllowlist()})}function g(){const e=i();return s({mutationFn:t=>n.addAdminAllowlist(t),onSuccess:()=>e.invalidateQueries({queryKey:r.admins})})}function p(){const e=i();return s({mutationFn:t=>n.removeAdminAllowlist(t),onSuccess:()=>e.invalidateQueries({queryKey:r.admins})})}function S(){return u({queryKey:r.config,queryFn:()=>n.getConfig()})}function F(){const e=i();return s({mutationFn:t=>n.updateConfig(t),onSuccess:()=>e.invalidateQueries({queryKey:r.config})})}function A(){return u({queryKey:r.workspaces,queryFn:()=>n.listWorkspacesFull()})}function h(){const e=i();return s({mutationFn:t=>n.upsertWorkspace(t),onSuccess:()=>e.invalidateQueries({queryKey:r.workspaces})})}function K(){return s({mutationFn:()=>n.startWechatQr()})}function w(e){return u({queryKey:["settings","wechat-qr",e??""],queryFn:()=>n.getWechatQrStatus({token:e}),enabled:!!e,refetchInterval:2e3,refetchIntervalInBackground:!1})}function Q(){return s({mutationFn:e=>n.testAcpAgent(e)})}function k(){return s({mutationFn:e=>n.discoverAcpAgents(e)})}function W(){return s({mutationFn:()=>n.testEmail()})}function E(){return u({queryKey:["settings","search","providers"],queryFn:()=>n.getSearchProviders()})}function I(){return s({mutationFn:e=>n.testSearchProvider(e)})}function C(){return u({queryKey:["settings","viewer-tunnel"],queryFn:()=>n.getViewerTunnel()})}export{l as a,S as b,F as c,K as d,w as e,W as f,C as g,Q as h,k as i,f as j,y as k,d as l,m,q as n,g as o,p,A as q,h as r,E as s,I as t,v as u};
//# sourceMappingURL=use-settings-DMdaoWsB.js.map
