import{o as a,aP as k,k as b,j as t,aO as h,bT as j,c2 as B,g as m,aQ as P}from"./app-BgLa5dit.js";import{U as A}from"./D3UuIyr4.chunk.js";import{U as E}from"./ZKp_vc-v.chunk.js";import{a as J}from"./m4aqaK_l.chunk.js";import{u as S}from"./DL8ott7R.chunk.js";import{B as D}from"./DpUpv6rY.chunk.js";import{B as R}from"./DpWmZ9cE.chunk.js";import{C as o,U as v}from"./q-IBKcuF.chunk.js";import{J as w}from"./DfIMhO3y.chunk.js";import{B as G}from"./CTVUBibh.chunk.js";import{g as H}from"./B1ElCHu3.chunk.js";import"./Bl0-tJo1.chunk.js";import"./DULJTEyC.chunk.js";import"./De9um1Ze.chunk.js";import"./COKAB0_A.chunk.js";import"./BYVfdcaw.chunk.js";import"./BfMtaC_g.chunk.js";import"./R6rHoxuD.chunk.js";import"./MEkA24R1.chunk.js";import"./0GREfvNX.chunk.js";import"./CG7zbly5.chunk.js";import"./C53kfXmd.chunk.js";import"./DusGkY45.chunk.js";import"./DUpYPoLs.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";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";function Ie(e){var u;const{users:n,existingUsersHash:p}=S(),i=a(o.yearGroups(e.customerId)),c=a(o.passwordPolicy(e.customerId)),l=a(o.getCustomerProducts(e.customerId)),d=k(),U=b(),s=H(e.customerId,e.userType);function f(r){const T=v.formatCreateOrValidateUserRequest([r],e.userType,e.customerId);return U(o.bulkValidate(T,null))}function g(){if(Object.keys(p).length){y();return}C()}function y(){m.trigger(s.userUploadReviewExistingAccounts)}const x=D.useCreateJobErrorAlert();function C(){const r=R.getJobData({users:n,customerId:e.customerId,userType:e.userType});P(d,w.createUserJob(r,I,x))}function I(r){m.trigger({...s.userUploadStatus.polling,params:{userType:e.userType,jobId:r.id}})}return!e||!i.data?t.jsx(t.Fragment,{}):t.jsx(E.Provider,{value:J.Curator,children:t.jsx(G,{appLinks:s,userType:e.userType,currentStep:"fix-duplicates",canAddExistingUsers:!((u=l.data)!=null&&u.some(r=>r.id===B.Online)),customerId:e.customerId,children:t.jsx("div",{className:"px-3",children:t.jsx(A,{onClickConfirm:g,closePopup:e.closePopup,appLinks:s,userType:e.userType,currentUser:{},yearGroups:i.data,validateUser:f,emailRequired:e.userType===j.Staff,passwordPolicy:c.data,emptyStateImageUrl:h.EmptyStates.UserManager.DUPLICATES})})})})}export{Ie as BulkUserUploadFixDuplicatesView};
//# sourceMappingURL=7RUPkAOH.chunk.js.map
