import{a as e,g as t,s as n,t as r}from"./api-Duu96wkE.js";import{G as i}from"./index-DyQEyT-0.js";function a(n={}){return e({queryKey:[`payroll`,`runs`,n],queryFn:async()=>{let e=await r.get(`/payroll/runs`,{params:n});return{runs:e.data.data,meta:e.data.meta}},placeholderData:t})}function o(t){return e({queryKey:[`payroll`,`runs`,t],queryFn:async()=>(await r.get(`/payroll/runs/${t}`)).data.data,enabled:!!t})}function s(){return e({queryKey:[`payroll`,`components`],queryFn:async()=>(await r.get(`/payroll/components`)).data.data})}function c(t){return e({queryKey:[`employees`,t,`salary-structure`],queryFn:async()=>(await r.get(`/employees/${t}/salary-structure`)).data.data,enabled:!!t})}function l(e){let t=n();return i({mutationFn:e,onSuccess:()=>{t.invalidateQueries({queryKey:[`payroll`]}),t.invalidateQueries({queryKey:[`employees`]}),t.invalidateQueries({queryKey:[`ledger`]}),t.invalidateQueries({queryKey:[`dashboard`]})}})}function u(){return l(e=>r.post(`/payroll/runs`,e))}function d(){return l(({id:e,action:t,...n})=>r.post(`/payroll/runs/${e}/${t}`,n))}function f(){return l(({employeeId:e,...t})=>r.post(`/employees/${e}/salary-structure`,t))}export{s as a,a as i,d as n,c as o,o as r,f as s,u as t};