PageSourceSearch

https://www.london.edu/_next/static/chunks/13366.5b71123a483f7189.js

js london.edu collected 2026-09-24 08:26:25 UTC 9,742 bytes, 4 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[13366],{13366:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ConsultantForm:()=>w,default:()=>A});var s=r(37876),a=r(69241),o=r(89099),l=r(14232),n=r(88992),i=r(4426),m=r(95177),c=r(96866),d=r(79956),u=r(64635),p=r(49340),x=r(8151),h=r(22490),f=r(94268),y=r(75661),T=r(96016),g=r(70834),N=r(38592),_=r(49723),b=r(84758),j=r.n(b),S=r(88845),v=r(10734);let C=0,w=e=>{let{content:t}=e,{consultantFormTitleText:r,introText:b=`Please complete the form below with details of your request.
2                  We’ll get back to you by email, so make sure you include the
3                  right email address.`,introLoggedInText:w,emailLabelText:A,firstNameLabelText:E,lastNameLabelText:k,countryCodeLabelText:R,telephoneNumberPlaceholderText:I,telephoneNumberHintText:F,commentEnquiryLabelText:q,successPageUrl:$,failedMessage:B,smsConsentText:M,programmesForSmsConsent:P}=t,[D,O]=(0,l.useState)(null),[G,L]=(0,l.useState)(!1),[U,V]=(0,l.useState)(null),[H,W]=(0,l.useState)(""),[Y,J]=(0,l.useState)(""),[Q,K]=(0,l.useState)(!1),[X,Z]=(0,l.useState)(null),[z,ee]=(0,l.useState)(null),[et,er]=(0,l.useState)(""),[es,ea]=(0,l.useState)(!1),[eo,el]=(0,l.useState)(!1),en=(0,o.useRouter)(),{user:ei}=(0,l.useContext)(T.R),em=en?.query?.referPage||en?.asPath,{register:ec,handleSubmit:ed,reset:eu,formState:ep,watch:ex,setValue:eh,setError:ef,clearErrors:ey}=(0,n.mN)({mode:"onBlur"}),eT=new URLSearchParams(window.location.search),eg=window.location.pathname;if(null!==eT?.get("itemId")){let e=(0,v.M3)(eg,eT);null!==e&&en.push(e)}let{apiErrorMessages:eN}=(0,u.t0)();(0,l.useEffect)(()=>{ei?ee(!0):ee(null),ei&&er((0,N.A)("access_token"))},[ei]),(0,l.useEffect)(()=>{z&&(async()=>{try{let e=await (0,p.FD)();V(e),el(e?.result?.preferences?.canContactBySms)}catch(e){K(!0)}})()},[z]),(0,l.useEffect)(()=>{P?.forEach(e=>{en?.query?.programmeTypeCode==e.fields.programmeTypeCode&&L(!0)})},[en?.query]);let e_=[{propertyName:"emailAddress",validation:{isRequired:!0,email:!0,maxLength:100},labelText:A,dataText:U?.result?.emailAddress},{propertyName:"firstName",validation:{isRequired:!0,maxLength:30,firstName:!0},labelText:E,dataText:U?.result?.firstName},{propertyName:"lastName",validation:{isRequired:!0,maxLength:30,lastName:!0},labelText:k,dataText:U?.result?.lastName},{propertyName:"telephone",labelText:"",hintText:"",optionalText:!1,options:null},{propertyName:"smsConsent",labelText:"",hintText:"",optionalText:!1,validation:{isRequired:!1}},{propertyName:"objectivesText",validation:{isRequired:!0,maxLength:140,textarea:!0},labelText:q,formType:"textarea"}];(0,l.useEffect)(()=>{let e=ex((t,r)=>{if("change"===r.type&&C<1)return(0,_.Ay)({event:"formStart",formName:"consultantForm"}),C++,()=>e.unsubscribe()});return()=>e.unsubscribe()},[ex]),(0,l.useEffect)(()=>{U&&eu([...e_].reduce((e,t)=>({...e,[t.propertyName]:t.dataText}),{}))},[U]);let eb=async e=>{Z(null),ea(!0);let{emailAddress:t,firstName:r,lastName:s,telephone:a,noBulkEmail:o,objectivesText:l}=e,n=(a||"").replace(/\D/g,""),i={profile:{isStayInformed:o,emailAddress:t,firstName:r,lastName:s},programmeType:{programmeTypeCode:en?.query?.programmeTypeCode||null,programmeTypeGroup:en?.query?.programmeTypeGroup||null},telephoneNumber:n||null,preferences:{canContactBySms:D||null},comments:l};try{let e=await (0,p.To)(i,sessionStorage.getItem("crm_campaign"));if(ea(!1),201===e.status)(0,_.Ay)({event:"formComplete",formName:"consultantForm",businessUnit:(0,g.Z)(),programmeCode:"",eventType:""}),en.push("/"+$+"?returnToPreviousPageUrl="+em);else{let t=(0,y.k)(e,eN);window.scrollTo(0,0),Z(t)}ea(!1)}catch(t){let e=(0,y.k)(null,eN);window.scrollTo(0,0),Z(e),ea(!1)}};return(0,s.jsx)("div",{className:"wrapper component-wrap",children:(0,s.jsx)(d.A,{row:!0,children:(0,s.jsx)(d.A,{column:!0,sm:12,md:6,children:(0,s.jsxs)("section",{className:(0,a.A)(j().component,j()["consult-form"],"form",j().cf),children:[(0,s.jsx)("h1",{className:"h2",children:r}),Q&&(0,s.jsx)(h.A,{failedRichText:B?.fields?.content,failedTinyMceRichText:B?.fields?.contentTinyMce}),X&&X.map((e,t)=>(0,s.jsx)(h.A,{text:e},t)),(0,s.jsx)("form",{method:"POST",className:"form",onSubmit:ed(eb),children:(0,s.jsxs)("div",{className:j()["fields-floated"],children:[(0,s.jsx)("p",{className:j().intro,children:z&&w?w:b}),(0,s.jsx)("div",{className:"form-row",children:(0,s.jsx)("section",{className:j()["form-group-wrapper"],children:e_.map((e,t)=>
3"telephone"===e.propertyName?(0,s.jsx)(i.A,{dialCodeLabelText:R,telephoneInputPlaceholderText:I,telephoneNumberHintText:F,optionsData:x.B,selectedDialCode:H,setSelectedDialCode:W,numberValue:Y,setNumberValue:J,register:ec,watch:ex,errors:ep.errors,fieldIsRequired:!1,setValue:eh,setError:ef,clearErrors:ey},`${R}${t}`):"smsConsent"===e.propertyName?(0,s.jsx)(S.A,{showSMSConsent:G,field:e,index:t,smsConsentText:M,smsConsentGiven:eo,isSMSconsentChecked:D,setIsSMSconsentChecked:O,register:ec},`${e.labelText}${t}`):(0,s.jsx)(m.A,{formType:e?.formType,watch:ex,validation:e?.validation,type:"text",register:ec,property:e.dataText,hintText:e?.hintText,placeholder:e.labelText,options:e.options,optionalText:e?.optionalText,name:e?.propertyName,errors:ep.errors},`${e.labelText}${t}`))})}),(0,s.jsx)(c.A,{register:ec,formState:ep,chosenEmailSubscription:z&&U?.result?.isStayInformed,isEmailAndSMSOptOut:G}),(0,s.jsx)("div",{className:"btn-and-text-wrapper",children:(0,s.jsx)(f.A,{loading:es,id:"submitButton",text:"Submit"})})]})})]})})})})},A=w},22490:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var s=r(37876),a=r(98566),o=r(61132),l=r(14232),n=r(58631),i=r(97624),m=r(35662),c=r.n(m);let d=e=>{let t,{text:r,failedRichText:m,failedTinyMceRichText:d,userEmail:u=""}=e,{setExistingUserEmail:p}=(0,i.Ue)();return(0,l.useEffect)(()=>{u&&p(u)},[p,u]),(0,s.jsx)("div",{className:`${c()["error-message"]} field_error_msg`,role:"alert",children:r?(0,s.jsx)("p",{children:(t={"{{log_in}}":(0,s.jsx)(o.A,{href:n.aW,className:"underline",children:"login"}),"{{recover_your_password}}":(0,s.jsx)(o.A,{href:n.VX,className:"underline",children:"recover your password"})},r.split(/(\{\{log_in\}\}|\{\{recover_your_password\}\})/).map((e,r)=>t[e]?l.cloneElement(t[e],{key:r}):e))}):(0,s.jsx)(a.A,{richText:m,tinyMceRichText:d})})}},35662:e=>{e.exports={"error-message":"FormErrorMessage_error-message__bpJEc"}},67932:e=>{e.exports={"radio-buttons":"RadioButtons_radio-buttons__kf1EC",error:"RadioButtons_error__39sys"}},75661:(e,t,r)=>{"use strict";r.d(t,{k:()=>s});let s=(e,t={})=>{let r=t.GENERIC_MESSAGE?[t.GENERIC_MESSAGE]:[];e?.errors?r=e.errors.map(e=>t[e.errorCode]):e?.errorCode&&(r=[t[e.errorCode]]);let s=r.filter((e,t,r)=>r.indexOf(e)===t);return s.length?s:["Something went wrong"]}},84758:e=>{e.exports={"consult-form":"ConsultantForm_consult-form__e0_aR",intro:"ConsultantForm_intro__KxJmH","fields-floated":"ConsultantForm_fields-floated__0g40b","form-group-wrapper":"ConsultantForm_form-group-wrapper__UoUvD","field-row":"ConsultantForm_field-row__DMW9Q",back:"ConsultantForm_back__4k2wi","edit-details":"ConsultantForm_edit-details__IgHEB"}},88845:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(37876),a=r(79469);function o({showSMSConsent:e,field:t,index:r,smsConsentText:l,isSMSconsentChecked:n,smsConsentGiven:i,setIsSMSconsentChecked:m,register:c}){return!e||i?null:(0,s.jsx)("div",{className:"form-row",children:(0,s.jsx)("div",{className:"form-field base6",children:(0,s.jsx)(a.A,{id:"canContactBySms",name:"canContactBySms",value:l,checked:n,label:l,...c("canContactBySms"),onChange:()=>m(!n)},`${t.labelText}${r}`)})})}},96866:(e,t,r)=>{"use strict";r.d(t,{A:()=>x});var s=r(37876),a=r(38592),o=r(14232),l=r(96016),n=r(49340),i=r(67932),m=r.n(i),c=r(69241);let d=e=>{let{register:t,options:r,formState:i,className:d}=e,{user:u}=(0,o.useContext)(l.R),[p,x]=(0,o.useState)(null);(0,o.useEffect)(()=>{(async()=>{if(u)try{let e=await (0,n.Q8)((0,a.A)("access_token"));x(e?.result?.canContactByEmail)}catch(e){console.log(e)}})()},[u]);let h=!!i?.errors?.[r.name],f=h?`${r.name}-message`:void 0;return(0,s.jsxs)("div",{className:(0,c.A)(m()["radio-buttons"],d),role:"radiogroup","aria-invalid":h?"true":void 0,children:[r?.options?.map(({id:e,label:a,val:l})=>(0,s.jsxs)(o.Fragment,{children:[(0,s.jsx)("input",{type:"radio",id:e,name:r.name,onClick:()=>{x(l)},checked:p===l,value:l,"aria-describedby":f,...t(r.name,{required:"This field is required"})}),(0,s.jsx)("label",{htmlFor:e,children:a})]},`${e}-${a}`)),h&&(0,s.jsx)("div",{className:m().error,id:`${r.name}-message`,children:(0,s.jsxs)("p",{children:[(0,s.jsx)("span",{className:"sr-only",children:"Error:"})," Please choose an option"]})})]})};var u=r(64635),p=r(75903);let x=e=>{let{register:t,formState:r,isShowStayInformed:a=!0,isShowPrivacyTitle:o=!0,policyType:l="regular",isEmailAndSMSOptOut:n=!1}=e,{siteSettings:i}=(0,u.t0)(),m="regular"===l?"privacyAndPolicyTextItems":"privacyAndPolicyEmbagTextItems",c={name:"isStayInformed",options:[{id:"chosenEmailSubscriptionYes",val:!0,label:(0,p.Ay)(i?.[m]?.stayInformRadioYes?.json)},{id:"chosenEmailSubscriptionNo",val:!1,label:(0,p.Ay)(i?.[m]?.stayInformRadioNo?.json)}]};return(0,s.jsxs)(s.Fragment,{children:[o&&(0,s.jsx)("h3",{className:"section-title",children:"Your Privacy"}),(0,s.jsx)("div",{className:"form-row",children:(0,p.Ay)(i?.[m]?.privacyTextData?.json)}),a&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h3",{className:"section-title",children:"Stay Informed"}),(0,s.jsx)("div",{className:"form-row",children:(0,p.Ay)(i?.[m]?.stayInformedText?.json)}),(0,s.jsx)(d,{register:t,options:c,formState:r}),(0,s.jsx)("div",{className:"form-row",children:(0,p.Ay)(n?i?.[m]?.emailAndSmsOptOutText?.json:i?.[m]?.emailOptOutText?.json)})]})]})}}}]);
4//# sourceMappingURL=13366.5b71123a483f7189.js.map

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.