import{R as g,k as C,o as k,j as s,c2 as x,g as y}from"./app-BgLa5dit.js";import{B}from"./BWI88cUh.chunk.js";import{U as I}from"./ZKp_vc-v.chunk.js";import{a as j}from"./m4aqaK_l.chunk.js";import{u as b}from"./DL8ott7R.chunk.js";import{B as h}from"./DpUpv6rY.chunk.js";import{B as m}from"./DpWmZ9cE.chunk.js";import{J as T}from"./DfIMhO3y.chunk.js";import{B as A}from"./CTVUBibh.chunk.js";import{C as J}from"./q-IBKcuF.chunk.js";import{g as E}from"./B1ElCHu3.chunk.js";import"./C16qNPRj.chunk.js";import"./CetbvyBn.chunk.js";import"./KPdA3ghp.chunk.js";import"./D8ca7W7r.chunk.js";import"./CZyx6Aii.chunk.js";import"./MEkA24R1.chunk.js";import"./CG7zbly5.chunk.js";import"./C53kfXmd.chunk.js";import"./DusGkY45.chunk.js";import"./DUpYPoLs.chunk.js";import"./BTbZzD17.chunk.js";import"./Dr5_kWYc.chunk.js";import"./DJ0pq8J_.chunk.js";import"./BUT90D7O.chunk.js";import"./CCcwLDvu.chunk.js";import"./DDfKZ_ng.chunk.js";import"./EZim8aq-.chunk.js";import"./BD9MrUJP.chunk.js";import"./s6cGcwlA.chunk.js";import"./Zwjmkasg.chunk.js";import"./4qGb1BIY.chunk.js";import"./DnXDEnAR.chunk.js";function pe(e){var n;const{users:o,existingUsersHash:i,existingUserToAdd:t,deleteUsers:p}=b();g.useEffect(()=>{var r;(t==null?void 0:t.length)<((r=Object.keys(i))==null?void 0:r.length)&&p(m.getDeletedExistingUsers(o,i,t).map(f=>f.lookupId))},[]);const a=E(e.customerId,e.userType),u=C(),c=k(J.getCustomerProducts(e.customerId)),l=h.useCreateJobErrorAlert();function d(){const r=m.getJobData({users:m.getNewUsers(o,i),existingUsers:t,customerId:e.customerId,userType:e.userType});u(T.createUserJob(r,U,l))}function U(r){y.trigger({...a.userUploadStatus.polling,params:{userType:e.userType,jobId:r.id}})}return o?s.jsx(I.Provider,{value:j.Primary,children:s.jsx(A,{appLinks:a,userType:e.userType,currentStep:"confirmation",canAddExistingUsers:!((n=c.data)!=null&&n.some(r=>r.id===x.Online)),customerId:e.customerId,children:s.jsx("div",{className:"px-3",children:s.jsx(B,{onClickConfirm:d,users:o,existingUsers:t,existingUsersHash:i,userType:e.userType,imageCdnUrl:ClickView.Config.Urls.ImageAPI})})})}):s.jsx(s.Fragment,{})}export{pe as BulkUserUploadConfirmationView};
//# sourceMappingURL=BDnV2Jtk.chunk.js.map
