1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[930,546],{2360:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/register/steps/experience",function(){return r(3666)}])},3666:function(e,t,r){"use strict";r.r(t),r.d(t,{ExperienceStep:function(){return O},__N_SSP:function(){return X},default:function(){return B}});var i=r(5893),n=r(7294),o=r(9578),s=r(5313),a=r(4184),c=r.n(a),l=r(6486),u=r(6619),d=r(4321),h=r(9936),p=r(3973),g=r(8379),m=r(7191),x=r(1432),f=r(9245),E=r(5672),_=r(1835),y=r(329),j=r(8077),v=r(3046),b=r(233),C=r(2154),N=r(3800),w=r(5102),T=r(6086),F=r(5275),R=r(287);let k=e=>{let{validate:t,user:r,setFocus:n,setOpen:a,hideForm:l,modifyCurrentExperience:u,deleteExperience:d,clearCountrySearch:h,setOpenField:p,editMode:g,search:m,setSearch:x}=e,{countries:f,subjects:E,grades:_,curriculums:j}=(0,s.v9)(e=>e.flowData),{currentExperience:v}=r,b=r.errors,N=c()("ta-reggie__form-container--inner",{hidden:l}),w=new Date,k=w.getFullYear(),Z=w.getMonth()+1,P=v.from.year&&!(0,F.vk)(v.from,{year:k,month:Z+1})?"This field is required":"",{assetsUrl:I}=(0,C.Z)(),S=e=>t=>{let{target:{value:r}}=t;u(e)(r)},D=e=>t=>{let{value:r}=t;u(e)(r)},O=(e,t)=>r=>{let i={...v[t]};i[e]=r.value,u(t)(i)},X=(0,R.LS)("label",m,f);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:N,children:[(0,i.jsx)(T.o,{id:"position-title",className:"ta-reggie__input",isRequired:!0,placeholder:"Enter position Title",label:"Position Title:",fullWidth:!0,onChange:S("position"),onBlur:()=>t("experiencePosition"),value:v.position,error:b.experiencePosition.errorText,tooltip:"Be as specific as possible here. Include any subjects youâve taught and at which grade levels.","data-lpignore":"true","data-form-type":"other"}),(0,i.jsx)(T.o,{id:"institution",className:"ta-reggie__input",isRequired:!0,placeholder:"Enter school or district name",label:"School or District:",fullWidth:!0,onChange:S("institution"),onBlur:()=>t("experienceInstitution"),value:v.institution,error:b.experienceInstitution.errorText,tooltip:"If you worked at more than 1 school in the same district, you could save time by summarizing all your district experience in one entry.","data-lpignore":"true","data-form-type":"other"}),(0,i.jsx)(o.gA,{id:"country",label:"Country:",className:"ta-reggie__input",isRequired:!0,placeholder:"Select country",onChange:D("country"),selectedValue:f.find(e=>e.value===v.country),options:X,search:m,onClear:h,isOpen:e=>{a(e),p("country")},onSearch:e=>x(e),error:0===X.length&&m?"There is no such option":b.experienceCountry.errorText,fullWidth:!0,tooltip:"Country where the school was located.","data-lpignore":"true","data-form-type":"other"}),(0,i.jsx)(o.vO,{id:"curriculum",label:"Curriculum you taught:",className:"ta-reggie__input",placeholder:"Select curriculum",isRequired:!0,isOpen:e=>{a(e),p("curriculum")},value:v.curriculum,onChange:D("curriculum"),onFocus:()=>n(!0),onBlur:()=>n(!1),error:b.experienceCurriculum.errorText,fullWidth:!0,options:j}),(0,i.jsx)(o.ZJ,{id:"grades",label:"Grade(s) you taught:",className:"ta-reggie__input",placeholder:"Select grade(s)",selectedValues:v.grades,onChange:u("grades"),error:b.experienceGrades.errorText,isRequired:!0,fullWidth:!0,isOpen:e=>{a(e),p("grades")},onFocus:()=>n(!0),onBlur:()=>n(!1),options:_,withNoneOption:!1}),(0,i.jsx)(o.ZJ,{id:"subjects",label:"Subject(s) you taught:",className:"ta-reggie__input",fullWidth:!0,isRequired:!0,placeholder:"Select subject(s)",onChange:u("subjects"),selectedValues:v.subjects,error:b.experienceSubjects.errorText,options:E,isOpen:e=>{a(e),p("subjects")},onFocus:()=>n(!0),onBlur:()=>n(!1),withNoneOption:!1}),(0,i.jsx)(y.Wr,{id:"valid",label:"From",className:"ta-reggie__input--smallest",current:v.from,onChangeMonth:O("month","from"),onChangeYear:O("year","from"),onFocus:()=>n(!0),onBlur:()=>n(!1),error:b.experienceFrom.errorText||P,tooltip:"Date you began your employment at the school",maxYear:k,maxMonth:Z,isOpen:e=>{a(e),p("from")}}),!v.workingOnThisRole&&(0,i.jsx)(y.Wr,{id:"expiry",label:"To",className:"ta-reggie__input--smallest",current:v.to,onChangeMonth:O("month","to"),onChangeYear:O("year","to"),onFocus:()=>n(!0),onBlur:()=>n(!1),isOpen:e=>{a(e),p("to")},error:b.experienceTo.errorText||(0,F.GH)(v),tooltip:"Date you finished your employment at this school (if you are still there - check the box below!)"}),(0,i.jsx)(o.XZ,{id:"expiration-date-checkbox",label:"I am currently working in this role",className:"ta-reggie__input",checked:v.workingOnThisRole,onChange:e=>{let{target:{checked:t}}=e;u("workingOnThisRole")(t)}}),g&&(0,i.jsxs)(o.uT,{id:"delete-experience",element:o.V5.body.elements.a,size:"medium",weight:"bold",color:"ocean",className:"ta-reggie__form-delete",onClick:()=>d(v.id),tabIndex:"0",onFocus:()=>p("deleteButton"),children:[(0,i.jsx)("img",{src:"".concat(I,"/icons/delete.svg"),alt:"delete icon"}),"Delete Experience"]})]})})};var Z=r(9921),P=r(1074);let{assetsUrl:I}=(0,C.Z)(),S=()=>(0,i.jsxs)("div",{className:"ta-reggie__no-experience-container",children:[(0,i.jsx)(o.X6,{className:"ta-reggie__no-experience-title",weight:"bold",size:"x-small",children:"You've come to the right place"}),(0,i.jsx)("img",{src:"".concat(I,"/logos/smiling-apple.svg"),alt:""}),(0,i.jsx)(o.uT,{className:"ta-reggie__no-experience-subtitle",children:"We'll get you the resources you need to become a teacher and land a job!"})]}),D="experience";function O(){let e=(0,v.Z)(),t=(0,s.I0)(),r=(0,Z.v)(e=>e.user),a=(0,Z.v)(e=>e.userCopy),{isLoading:u}=(0,Z.v)(e=>e.flowData),{currentExperience:p,dontHaveExperience:C}
1=r,T=r.experience,[F,R]=(0,n.useState)(""),[I,O]=(0,n.useState)(!1),[X,B]=(0,n.useState)(!1),[W,G]=(0,n.useState)(!1),[z,L]=(0,n.useState)(!1),[V,q]=(0,n.useState)(""),[A,Y]=(0,n.useState)(!1),{appSiteUrl:M}=(0,b.W)(),U=["experiencePosition","experienceCountry","experienceInstitution","experienceCurriculum","experienceGrades","experienceSubjects","experienceFrom","experienceTo"],J=e=>t((0,h.Pv)({key:e,value:""})),K=()=>U.forEach(e=>J(e)),H=e=>{if(r.hasFieldValidation(e)){let i=r.validateField(e);t((0,h.Pv)({key:e,value:i}))}},$=()=>{G(!0),setTimeout(()=>{if((0,_.c0)(E.MP,2e3,"error",t),G(!1),(0,l.isEmpty)(p.from.month)||(0,l.isEmpty)(p.to.month))U.forEach(e=>{H(e)});else{let e=U.filter(e=>"experienceFrom"!==e&&"experienceTo"!==e);e.forEach(e=>{H(e)})}},500)},Q=(e,i)=>{let n=r.clone();if(n.currentExperience=i,n.hasFieldValidation(e)){let r=n.validateField(e);t((0,h.Pv)({key:e,value:r}))}},ee=e=>{let t="experience".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));return t},et=e=>r=>{let i=p.clone();i.modified=!0,i[e]=r,t((0,h.oP)(i)),"workingOnThisRole"!==e&&"from"!==e&&"to"!==e&&Q(ee(e),i)},er=e=>t((0,h.Pv)({key:e,value:""}));(0,w.Z)(()=>{z||"from"!==V||((0,l.isEmpty)(p.from.month)||(0,l.isEmpty)(p.from.year)?H("experienceFrom"):er("experienceFrom"))},[z]),(0,w.Z)(()=>{z||"to"!==V||((0,l.isEmpty)(p.to.month)||(0,l.isEmpty)(p.to.year)?H("experienceTo"):er("experienceTo"))},[z]),(0,w.Z)(()=>{z||"curriculum"!==V||H("experienceCurriculum"),z||"grades"!==V||H("experienceGrades"),z||"subjects"!==V||H("experienceSubjects"),z||"country"!==V||H("experienceCountry")},[z]);let ei=()=>{R(""),et("country")("")};(0,w.Z)(()=>{(0,l.isEmpty)(F)&&void 0!==p.country&&ei()},[F]);let en=()=>{O(!1),t((0,h.oP)(new g.Z)),R(""),K()},eo=()=>{let e=p.clone();return X||C?[...T]:I?(f.Z.trackReggieEvent(P.Rx.reggie.UPDATE_EXPERIENCE_REGGIE,"User updated an experience from Reggie"),T.map(t=>t.id===e.id?e:t)):(f.Z.trackReggieEvent(P.Rx.reggie.ADD_EXPERIENCE_REGGIE,"User added an experience from Reggie"),[...T,e])},es=async i=>{G(!0),i&&i.preventDefault(),f.Z._updateDataLayer({event:"newDim",hasExperience:!C});try{await m.Z.finishExperienceStep(d.Z.fromJson({...r,experience:eo()}),a),en(),f.Z._updateDataLayer({event:"registrationComplete"}),x.Z.loginDashboardRedirect({accessToken:r.jwtToken,newRegistration:!0,appSiteUrl:M}),e.info("The user ".concat(r.email," with cognito_id ").concat(r.id,", finish the ").concat(j.F1.EXPERIENCE," step successfully"),{meta_data:{...r.getIdentifiers(),step:j.F1.EXPERIENCE}})}catch(i){G(!1),e.error("The user ".concat(r.email," with cognito_id ").concat(r.id,", COULDN'T finish the ").concat(j.F1.EXPERIENCE," step successfully"),{meta_data:{error:i,...r.getIdentifiers(),step:j.F1.EXPERIENCE}}),(0,_.c0)(E.$Y,5e3,"error",t)}},ea=()=>{if(X)B(!1),en();else if(p.isValid()){let e=eo();t((0,h.nv)(e)),en()}else $();q(" ")},ec=e=>r=>{t((0,h.KZ)({key:e,newValue:r}))},el=e=>{let r=e||p.id,i=T.filter(e=>e.id!==r);t((0,h.nv)(i)),f.Z.trackReggieEvent(P.Rx.reggie.DELETE_EXPERIENCE_REGGIE,"User deleted an experience from Reggie"),en(),q(" ")},eu=c()("ta-reggie__form-header ta-reggie__form-header--experiences",{hidden:X}),ed=T.length>0&&!I,eh=!(X||C||p.isValid()),ep=(0,i.jsx)(y.ZL,{onClick:ea,text:"Add another experience",onFocus:()=>q("addButton")});return(0,N.K)({fn:"addButton"===V?ea:"deleteButton"===V?el:eh?$:es,targetKey:"Enter",disable:W||z||A}),(0,n.useEffect)(()=>{t((0,h.wt)(!0)),Promise.all([t((0,h.r2)()),t((0,h.oL)(D))]).catch(t=>{e.error("Error fetching data in the ".concat(j.F1.EXPERIENCE),{meta_data:{error:t,...r.getIdentifiers(),step:j.F1.EXPERIENCE}})}).finally(()=>{t((0,h.oP)(new g.Z)),t((0,h.wt)(!1))}),en()},[]),(0,i.jsxs)("div",{className:"ta-reggie__container",children:[(0,i.jsxs)("div",{className:"ta-reggie__header",children:[(0,i.jsx)(o.X6,{size:"small",className:"ta-reggie__title",children:"Let your experience shine"}),(0,i.jsx)(o.uT,{size:"large",weight:"semibold",className:"ta-reggie__subtitle",children:"Add your teaching experience here, so schools know youâre a good fit."})]}),u?(0,i.jsx)(y.aN,{}):(0,i.jsxs)("form",{autoComplete:"off",children:[0===T.length&&(0,i.jsx)(o.Zb,{className:"ta-reggie__no-experience",children:(0,i.jsx)(o.XZ,{id:"checkbox-no-experience",onChange:e=>{let{target:{checked:t}}=e;ec("dontHaveExperience")(t)},label:"I am an aspiring teacher without experience.",checked:C})}),0!==T.length&&(0,i.jsxs)(y.rJ,{title:"Experience details",children:[(0,i.jsx)(y.Yd,{clearErrors:K,experiences:T,editMode:()=>{O(!0),B(!1)},onFocus:()=>Y(!0),onBlur:()=>Y(!1)}),X&&ep]}),(0,i.jsx)(o.Zb,{className:"ta-reggie__form-container ta-reggie__form-container--experiences ",children:C?(0,i.jsx)(S,{}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:eu,children:[(0,i.jsx)(o.X6,{size:"x-small",weight:"semibold",className:"ta-reggie__form-header--typography",children:I?"Edit a position":"Add a position"}),ed&&(0,i.jsx)(o.zx,{id:"close-form",type:"outlined",size:"small",className:"ta-reggie__form-close",onClick:()=>{B(!0),q(" ")},onFocus:()=>Y(!0),onBlur:()=>Y(!1),children:(0,i.jsx)(o.Ei,{icon:"close"})})]}),(0,i.jsx)(k,{validate:H,setOpen:L,user:r,setFocus:Y,hideForm:X,modifyCurrentExperience:et,setOpenField:q,editMode:I,deleteExperience:el,clearCountrySearch:ei,search:F,setSearch:R}),!X&&ep]})}),(0,i.jsx)("div",{className:"ta-reggie__form-submit",children:(0,i.jsx)(o.zx,{id:"complete-next",fullWidth:!0,htmlType:"button",type:"status-green",disabled:W,onClick:eh?$:es,onFocus:()=>q(" "),children:W?(0,i.jsx)(o.Ei,{icon:"spinner",loading:!0}):(0,i.jsx)(o.oD,{children:"Finish up"})})})]})]})}var X=!0,B=(0,p.Z)((0,u.Z)(O,D))},6619:function(e,t,r){"use strict";var i=r(5893),n=r(5313),o=r(7294),s=r(329),a=r(9936),c=r(940);let l=(e,t)=>
1r=>{let l=(0,n.I0)();return(0,o.useEffect)(()=>{l((0,a.Bq)(t))},[]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.Z,{isOnboardingView:!0}),(0,i.jsx)(s.W_,{currentStep:t}),(0,i.jsx)(e,{...r})]})};t.Z=l},3973:function(e,t,r){"use strict";var i=r(5893),n=r(7294),o=r(3741),s=r(1163),a=r.n(s),c=r(5313),l=r(329),u=r(9936),d=r(5672);let h=e=>t=>{let[r,s]=(0,n.useState)(!1),h=(0,c.I0)();return(0,n.useEffect)(()=>{let e=async()=>{try{let e=await o.g.currentAuthenticatedUser(),{attributes:t,signInUserSession:r}=e,{sub:i,name:n,family_name:a,email:c}=t;h((0,u.JP)({userExist:t["custom:user_exist"],drupalId:t["custom:drupal_id"],id:null==t["custom:sub"]||"0"===t["custom:sub"]?i:t["custom:sub"],firstName:n,lastName:a,jwtToken:r.accessToken.jwtToken,email:c})),s(!0)}catch(e){h((0,u.wD)({text:d.$Y,delay:5e3,type:"error"})),a().push("/login")}};e()},[]),(0,i.jsx)(i.Fragment,{children:r?(0,i.jsx)(e,{...t}):(0,i.jsx)(l.aN,{})})};t.Z=h},6086:function(e,t,r){"use strict";r.d(t,{F:function(){return a},o:function(){return s}});var i=r(5893),n=r(9578);let o=RegExp('(\\p{Extended_Pictographic}|\\p{Emoji_Presentation})|["\\\\]',"gu"),s=e=>{let{blockChars:t=!0,...r}=e;return(0,i.jsx)(n.oi,{...r,blockChars:t?o:null})},a=e=>{let{blockChars:t=!0,...r}=e;return(0,i.jsx)(n.Fz,{...r,blockChars:t?o:null})}},3800:function(e,t,r){"use strict";r.d(t,{K:function(){return n}});var i=r(7294);let n=e=>{let{fn:t,targetKey:r,disable:n=!1}=e;(0,i.useEffect)(()=>{let e=e=>{let{key:i}=e;i!==r||n||t()};return document.addEventListener("keydown",e,!1),()=>document.removeEventListener("keydown",e,!1)},[t])}}},function(e){e.O(0,[329,529,774,888,179],function(){return e(e.s=2360)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.