import{R as d,j as t,b7 as l,bT as n,br as U,F as h,bv as y,bq as S,bs as A,bw as L,g as c,o as x,aO as u}from"./app-BgLa5dit.js";import{C as T}from"./B6YXg1_D.chunk.js";import{U as g}from"./ZKp_vc-v.chunk.js";import{a as o}from"./m4aqaK_l.chunk.js";import{W as k}from"./BYVfdcaw.chunk.js";import{C as M}from"./q-IBKcuF.chunk.js";import{g as P}from"./B1ElCHu3.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"./DpUpv6rY.chunk.js";import"./CG7zbly5.chunk.js";import"./MEkA24R1.chunk.js";import"./C53kfXmd.chunk.js";const m="userManager.editSsoUserWarning";function b(e){const s=d.useContext(g);function a(){return e.isNew?s===o.Curator?"ssoWarningCreateCurator":e.userType===n.Learner?"ssoWarningCreateStudent":"ssoWarningCreateStaff":s===o.Curator?"ssoWarningEditCurator":"ssoWarningEditUser"}return t.jsxs(k,{children:[t.jsx(l,{namespace:m,phrase:a()}),!!e.helpArticle&&t.jsx("a",{className:"info-link d-block",href:e.helpArticle,target:"_blank",children:t.jsx(l,{namespace:m,phrase:e.isNew?"kbArticleEdit":"kbArticleCreate"})})]})}const w="_optionImage_19sz3_1",p={optionImage:w},I="userManager.addNewUsers",r=h.encloseNamespace(I);function E(e){const s=U[e.userType===n.Learner?"StudentManager":"StaffManager"],[a,i]=d.useState(null);function f(){if(a.id==="create-manually"){y.logUserAction({},{workflowPhase:L.Start,actionType:A.Create,entity:S.User,location:s}),c.trigger(e.appLinks.newUser);return}c.trigger(e.appLinks.userUploadPopup)}const C=[{id:"create-manually",title:r("createManuallyTitle"),description:r(e.userType===n.Learner?"createManuallyDescStudents":"createManuallyDescStaff"),imageUrl:e.createManuallyImageUrl,imageClassName:e.isLite?p.optionImage:""},{id:"upload-spreadsheet",title:r("uploadSpreadsheetTitle"),description:r(e.userType===n.Learner?"uploadSpreadsheetDescStudents":"uploadSpreadsheetDescStaff"),imageUrl:e.uploadSpreadsheetImageUrl,imageClassName:e.isLite?p.optionImage:""}];return t.jsx(T,{title:r(e.userType===n.Learner?"titleStudents":"titleStaff"),closePopup:e.closePopup,options:C,selection:a,selectOption:i,cancelButtonProps:{onClick:e.closePopup,text:r("cancel"),variant:"link"},submitButtonProps:{onClick:f,text:r("continue"),variant:"dark",disabled:!a},warningComponent:e.customerHasSso&&!e.isLite&&t.jsx(b,{isNew:!0,userType:e.userType,helpArticle:e.ssoHelpArticle})})}function J(e){var i;const s=x(M.getAuthenticationMethods(e.customerId)),a=P(e.customerId,e.userType);return t.jsx(g.Provider,{value:o.Curator,children:t.jsx(E,{userType:e.userType,appLinks:a,closePopup:e.closePopup,createManuallyImageUrl:u.UserManager.CREATE_MANUALLY,uploadSpreadsheetImageUrl:u.UserManager.UPLOAD_SPREADSHEET,customerHasSso:!!((i=s.data)!=null&&i.external.length)})})}export{J as AddNewUsersView};
//# sourceMappingURL=oesvtpse.chunk.js.map
