import{ab as i,b5 as g,V as a,w as r,i as s,a0 as u,ad as o,W as c}from"./index-Dbk1Plmn.js";function l(){return a("/agents")}function d(e){return a(`/agents/${encodeURIComponent(e)}`)}function y(e,n){return a(`/agents/${encodeURIComponent(e)}/records`,n)}function f(e){return a("/agents/grants",e)}function q(e){return a(`/agents/grants/${encodeURIComponent(e)}`)}function A(e){return i("/agents/grants",e)}function p(e,n){return g(`/agents/grants/${encodeURIComponent(e)}`,n)}function G(e,n){const t=n==="active"?"restore":n;return i(`/agents/grants/${encodeURIComponent(e)}/${t}`,{})}function m(){return r({queryKey:["agents"],queryFn:()=>l(),placeholderData:c,enabled:s()})}function C(e){return r({queryKey:["agents",e],queryFn:()=>d(e),enabled:s()&&!!e})}function F(e,n){return r({queryKey:["agents",e,"records",n],queryFn:()=>y(e,n),enabled:s()&&!!e})}function v(e){return r({queryKey:["agents","grants",e??null],queryFn:()=>f(e),enabled:s(),placeholderData:c})}function Q(e){return r({queryKey:["agents","grants","detail",e],queryFn:()=>q(e),enabled:s()&&!!e})}function R(){const e=u();return o({mutationFn:n=>A(n),onSuccess:()=>{e.invalidateQueries({queryKey:["agents","grants"]})}})}function U(e){const n=u();return o({mutationFn:t=>p(e,t),onSuccess:()=>{n.invalidateQueries({queryKey:["agents","grants"]}),n.invalidateQueries({queryKey:["agents","grants","detail",e]})}})}function K(e){const n=u();return o({mutationFn:t=>G(e,t),onSuccess:()=>{n.invalidateQueries({queryKey:["agents","grants"]}),n.invalidateQueries({queryKey:["agents","grants","detail",e]})}})}export{m as a,C as b,F as c,R as d,Q as e,U as f,K as g,v as u};
