import{a7 as n,bc as u}from"./app-BgLa5dit.js";const m={getOnlinePassThrough(e,s){return`/ajax/online/${e}?endpoint=${encodeURIComponent(s)}`}},c={getOrgIds:e=>m.getOnlinePassThrough(e.toUpperCase(),"/Ajax/GetOrganisations"),addOrgId:e=>m.getOnlinePassThrough(e.toUpperCase(),"/Ajax/AddOrganisation")},p={getOrgIds(e,s,a,o){return{url:c.getOrgIds(e),key:`system:org:id:${e}`,type:u.GET,formatData:t=>Array.isArray(t)?(t==null?void 0:t.map(r=>({id:r.Id,name:r.Name,description:r.Description}))).sort((r,i)=>r.name.localeCompare(i.name)):[],success:s,error:a,always:o}},addOrgId(e,s,a,o,t,r){return{url:c.addOrgId(a),key:"add:system:org:id",invalidationKeys:`system:org:id:${a}`,type:u.POST,data:{name:e,description:s},success:o,error:t,always:r}},customerByCrmId(e){return{url:`/ajax/system/customers?crmId=${e}`,key:`customer:crmid:${e}`,type:u.GET}},searchCustomers(e){const{query:s,page:a,customerStatus:o,status:t,customerType:r}=e;let i="limit:25";a&&(i+=`,page:${a}`),o&&(i+=`,customerStatus:${o}`),t&&(i+=`,status:${t}`),r&&(i+=`,customerType:${r}`);const l={query:s,filter:`{${i}}`};return{url:n.urlBuilder("/ajax/system/customers/search",l),key:`customer:search:${s}:${a}:${o}:${t}:${r}`,type:u.GET}},searchCustomersByCrmIds(e){const s={filter:`{limit:25,crmId:[${e.join(",")}]}`};return{url:n.urlBuilder("/ajax/system/customers/search",s),key:`customer:search:crmIds:${e.join(",")}`,type:u.GET}},customerAccessPolicies(e){return{url:n.urlBuilder("/ajax/system/customers/access-policies",{id:e}),key:`customer:access:policies:${e.join(",")}`,normalize:!1}}};export{p as S};
//# sourceMappingURL=CfEK6qIW.chunk.js.map
