import{az as L,aj as d,b0 as U,bN as y,hZ as I,bs as J,aI as m,ao as e,aP as R,au as k,av as z,dj as E,bS as P,bT as A,aq as t,L as M,r as u,dJ as b,h_ as B}from"./app-k0jcl5PQ.js";import{J as H}from"./D41e4O-3.chunk.js";import{u as V,a as _,O as o,b as w,c as G}from"./JiP4blAc.chunk.js";import{U as q}from"./JAk_2FpV.chunk.js";import"./kLXBNYk1.chunk.js";import"./BZ-tsgAq.chunk.js";import"./CCKlkV4O.chunk.js";import"./CECGJrz_.chunk.js";import"./Cq8Wr_gd.chunk.js";const D="_customerLogo_jp7tk_1",F={customerLogo:D},p="onboarding.selectRole";function se(h){var l;const{onClickBack:x,completeStepAsync:j,onSaveError:S}=V(h.redirectUrl),{logEvent:i}=_(),s=L(d.currentUser()),f=U();y({title:I["select-role"].getPageTitle()});const v=J(),[a,C]=m.useState(""),[n,c]=m.useState("");function N(r){C(r),i(u.Select,b.SelectJobTitle,{jobTitle:a});const{isValid:T,errorMessage:g}=q.validateJobTitle(r);if(!T){c(g);return}g&&c("")}async function O(){var r;if(a){i(u.Click,b.Next,{jobTitle:a},{jobTitleOverride:a}),B.removeUsageIntention((r=s.data)==null?void 0:r.id);try{await f(d.updateUserJobTitle(a)),await j({jobTitleOverride:a})}catch{return S(),Promise.reject()}}}return e.jsxs(o,{namespace:p,children:[e.jsx(o.Left,{className:"bg-ultramarine d-flex align-items-center",children:e.jsx("div",{className:"px-5 pt-4",children:e.jsx("img",{className:"img-fluid",src:R.OnboardingV2.SelectRole.BACKGROUND})})}),e.jsxs(o.Right,{hasCustomButtons:!1,onClickNext:O,onClickBack:x,disableNext:!!n||!a,children:[e.jsxs("div",{className:"position-relative",children:[!!((l=s.data)!=null&&l.customerLogo)&&e.jsx("div",{className:`${F.customerLogo} mx-auto mb-3`,children:e.jsx(k,{imageUrl:P.createUrl(s.data.customerLogo,{size:A.Small}),svg:E,variant:"green",svgSize:z.ExtraLarge})}),e.jsx(w,{children:e.jsx(t,{phrase:"heading"})})]}),e.jsx(G,{className:"mb-3 mt-2",children:e.jsx(t,{phrase:"info",options:{schoolName:s.data.customerName}})}),e.jsx("label",{children:e.jsx(t,{phrase:"roleLabel"})}),e.jsx(H,{id:"onboarding-job-title",onChange:N,countryCode:s.data.countryCode,placeholder:M.getPhrase(p,"rolePlaceholder"),initialValue:a,error:n,size:"lg",labelClassName:"d-none",isTertiary:v})]})]})}export{se as OnboardingSelectRoleView};
//# sourceMappingURL=CVpPWJyx.chunk.js.map
