import{aI as U,ao as r,aq as l,iP as c,cb as n,p as S,L as h,o as y,E as A,r as C,W as L,v as u,az as d,aj as M,iO as k,aG as P,aP as g,aH as T}from"./app-k0jcl5PQ.js";import{C as x}from"./He_KJRxT.chunk.js";import{U as E}from"./B4GO8DD1.chunk.js";import{W as w}from"./Dqgyavxf.chunk.js";import{U as I}from"./9ls1F1Ve.chunk.js";import"./CBiwFpxE.chunk.js";import"./fstW5ZQE.chunk.js";const p="userManager.editSsoUserWarning";function N(e){const t=U.useContext(E);function a(){return e.isNew?t===c.Curator?"ssoWarningCreateCurator":e.userType===n.Learner?"ssoWarningCreateStudent":"ssoWarningCreateStaff":t===c.Curator?"ssoWarningEditCurator":"ssoWarningEditUser"}return r.jsxs(w,{children:[r.jsx(l,{namespace:p,phrase:a()}),!!e.helpArticle&&r.jsx("a",{className:"info-link d-block",href:e.helpArticle,target:"_blank",children:r.jsx(l,{namespace:p,phrase:e.isNew?"kbArticleEdit":"kbArticleCreate"})})]})}const W="_optionImage_19sz3_1",m={optionImage:W},j="userManager.addNewUsers",s=h.encloseNamespace(j);function H(e){const t=S[e.userType===n.Learner?"StudentManager":"StaffManager"],[a,o]=U.useState(null);function i(){if(a.id==="create-manually"){y.logUserAction({},{workflowPhase:L.Start,actionType:C.Create,entity:A.User,location:t}),u.trigger(e.appLinks.newUser);return}u.trigger(e.appLinks.userUploadPopup)}const f=[{id:"create-manually",title:s("createManuallyTitle"),description:s(e.userType===n.Learner?"createManuallyDescStudents":"createManuallyDescStaff"),imageUrl:e.createManuallyImageUrl,imageClassName:e.isLite?m.optionImage:""},{id:"upload-spreadsheet",title:s("uploadSpreadsheetTitle"),description:s(e.userType===n.Learner?"uploadSpreadsheetDescStudents":"uploadSpreadsheetDescStaff"),imageUrl:e.uploadSpreadsheetImageUrl,imageClassName:e.isLite?m.optionImage:""}];return r.jsx(x,{title:s(e.userType===n.Learner?"titleStudents":"titleStaff"),closePopup:e.closePopup,options:f,selection:a,selectOption:o,cancelButtonProps:{onClick:e.closePopup,text:s("cancel"),variant:"link"},submitButtonProps:{onClick:i,text:s("continue"),variant:"dark",disabled:!a},warningComponent:e.customerHasSso&&!e.isLite&&r.jsx(N,{isNew:!0,userType:e.userType,helpArticle:e.ssoHelpArticle})})}function O(e){var i;const t=d(M.currentUser()),a=d(!!t.data&&I.getAuthenticationMethods(t.data.customerId)),o=k(e.userType);return r.jsx(H,{userType:e.userType,appLinks:o,closePopup:e.closePopup,createManuallyImageUrl:g.UserManager.CREATE_MANUALLY,uploadSpreadsheetImageUrl:g.UserManager.UPLOAD_SPREADSHEET,customerHasSso:!!((i=a.data)!=null&&i.length),ssoHelpArticle:P.getLiteArticle(T.EditSsoAccounts),isLite:!0})}export{O as AddNewUsersView};
//# sourceMappingURL=Cl0TfEq0.chunk.js.map
