import{bc as s,a7 as n}from"./app-BgLa5dit.js";import{P as j}from"./DUpYPoLs.chunk.js";import{B as i,S as u}from"./DpUpv6rY.chunk.js";const p="user-manager",g={createJob(o,r,e){return{url:"/ajax/batch/jobs",key:"create:job",type:s.POST,data:o,success:r,error:e}},createUserJob(o,r,e){return{url:"/ajax/batch/jobs",key:"create:job",type:s.POST,data:{...o,metadata:{...o.metadata,product:{name:j.Curator,version:ClickView.Config.Version},source:p}},success:r,error:e}},getJobs(o,r){const e={};let t=[],b=[];return r.cursor&&(e.cursor=r.cursor),r.sort&&(r.sort==="oldest"?e.order="ASC":e.order="DESC"),r.bulkActionType?(t=Array.isArray(r.bulkActionType)?r.bulkActionType:[r.bulkActionType],e.type=t):e.type=u,r.userType&&(b=Array.isArray(r.userType)?r.userType:[r.userType],e.dataType=b.map(l=>i.mapUserTypeToDataType(l))),{url:n.urlBuilder(`/ajax/batch/jobs/customers/${o}`,e),key:`batch:jobs:${o}:${r.cursor}:${r.sort}:${t.sort().join(":")}:${b.sort().join(":")}`}},getJob(o){return{url:`/ajax/batch/jobs/${o}`,key:`job:${o}`}},getJobsByType(o,r,e,t,b="DESC"){const l={order:b};return r!=null&&r.length&&(l.dataType=r),e!=null&&e.length&&(l.status=e),t&&(l.cursor=t),{url:n.urlBuilder(`/ajax/batch/jobs/jobTypes/${o}`,l),key:`batch:jobs:type:${o}:${(r==null?void 0:r.slice().sort().join(":"))??""}:${(e==null?void 0:e.slice().sort().join(":"))??""}:${t??""}:${b}`}},getJobProgress(o,r,e){return{url:`/ajax/batch/jobs/${o}/progress`,key:`job:${o}:progress`,invalidationKeys:`job:${o}:progress`,success:r,error:e}},getJobResults(o,r,e,t,b,l){const c={status:r};return e&&(c.cursor=e),{url:n.urlBuilder(`/ajax/batch/jobs/${o}/results`,c),key:`job:${o}:results:${e}:${r}`,updateState:t,success:b,error:l}},getYearGroupRolloverStatus(o){return{url:`/ajax/batch/validations/customers/${o}/year-group-roll-over`,key:`year:group:rollover:status:${o}`}},sendJobReports(o,r){return{url:`/ajax/batch/jobs/customers/${o}/results/export`,key:`send:job:reports:${o}:${r.sort().join(":")}`,type:s.POST,data:{jobIds:r}}},getJobSummary(o){return{url:`/ajax/batch/jobs/${o}/summary`,key:`job:summary:${o}`}}};export{g as J};
//# sourceMappingURL=DfIMhO3y.chunk.js.map
