1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4562,3892],{4562:function(e,t,n){n.r(t),n.d(t,{default:function(){return S}});var i=n(5893),l=n(7294),r=n(2734),a=n(1536),o=n(5861),s=n(6886),d=n(7357),c=n(8396),u=n(2236),x=n(4853),h=n(4872),p=n(5047),m=n(3892),f=n(5888),v=n(6856),j=n(4368),Z=n(8080),g=n(1681);function w(e){var t;let{field:n,isDeadEnd:l}=e,s=null!==(t=n.label)&&void 0!==t?t:null,d=null;if(s){let e=s.match(/^(\d+)\s+(.*)/);d=e&&e[1]?"Q".concat(e[1]):null,s=e&&e[2]?e[2]:s}let c=(0,r.Z)(),{frenchGrey:u,rasinBlack:x}=c.palette.common;return(0,i.jsxs)(a.Z,{direction:{md:"row"},spacing:{xs:3.75,md:7.75},alignItems:{md:"flex-end"},mb:{xs:5,md:0},pr:{xs:7.5,md:0},children:[d&&(0,i.jsx)(o.Z,{variant:"h1",component:"h2",color:u,lineHeight:{md:"78px!important"},children:d}),(0,i.jsxs)(a.Z,{spacing:2.5,maxWidth:l?"400px":"330px",children:[(0,i.jsx)(o.Z,{variant:l?"h2":"h3",color:x,children:s}),n.description&&(0,i.jsx)(o.Z,{variant:"body1",color:x,children:n.description})]})]})}function y(e){var t;let{fields:n,error:l,onSubmit:d,setRecaptcha:c,recaptchaError:u,fieldValuesMap:h,handleInputChange:p}=e,m=(0,r.Z)(),{rasinBlack:v}=m.palette.common;return(0,i.jsx)("form",{id:"finalSection",onSubmit:d,children:(0,i.jsxs)(s.ZP,{container:!0,rowSpacing:1.25,columnSpacing:2,pl:{md:22.125},children:[n.map(e=>{var n;return(0,i.jsx)(s.ZP,{item:!0,xs:12,md:e.layoutGridColumnSpan,children:(0,i.jsx)(g.Z,{isConsultationPage:!0,field:e,handleChange:p,value:null!==(t=null===(n=h.get(e.id))||void 0===n?void 0:n.value)&&void 0!==t?t:void 0})},e.id)}),(0,i.jsx)(s.ZP,{item:!0,xs:12,children:(0,i.jsxs)(a.Z,{direction:{xs:"column-reverse",md:"row"},justifyContent:{md:"space-between"},py:{md:1.25},spacing:1.25,children:[(0,i.jsx)(x.Z,{sitekey:Z.Ac,onChange:e=>c(e)}),(0,i.jsx)(o.Z,{variant:"caption",color:v,alignSelf:{xs:"flex-end",md:"flex-start"},children:"*MANDATORY"})]})}),(0,i.jsx)(s.ZP,{item:!0,xs:12,children:(0,i.jsx)(f.Z,{children:(0,i.jsxs)(a.Z,{spacing:.5,children:[l&&(0,i.jsx)(o.Z,{variant:"caption",color:v,children:"Something went wrong - please try again."}),u&&(0,i.jsx)(o.Z,{variant:"caption",color:v,children:"Please complete the ReCAPTCHA."})]})})})]})})}let b=(0,u.q)(d.Z);function S(e){let{formPages:t,submitButtonText:n,currentPage:s,setCurrentPage:x,currentQuestionIndex:Z,noOfQuestions:S,formId:C,isDeadEnd:k}=e,{SECTION:E,PAGE:P,RADIO:I,SELECT:R,EMAIL:B}=h.r,q=(0,r.Z)(),{rasinBlack:z}=q.palette.common,A=(0,c.Z)(q.breakpoints.up("md")),F=l.useRef(-1),{loading:T,data:D,error:N,submitForm:X}=(0,j.Z)(),[_,G]=l.useState(()=>{let e=new Map;return t.forEach(t=>{t.forEach(t=>{t.type!==E&&t.type!==P&&e.set(t.id,{value:t.type===I||t.type===R?t.choices[0].value:"",type:t.type})})}),e}),[L,M]=l.useState(null),[O,Q]=l.useState(!1),[V,H]=l.useState(!1),[Y,W]=l.useState(!1);l.useEffect(()=>{(null==D?void 0:D.submitGfForm.confirmation)&&(x(s+1),A||et())},[D]),l.useEffect(()=>{L&&Q(!1)},[L]);let J=t[s].length>1&&t[s][0].type===E,K=0===s,U=A?"200px":"50%",$=(e,t)=>{let n=new Map(_);n.set(e.id,{value:t,type:e.type}),G(n)},ee=e=>{if(e.preventDefault(),!L){Q(!0);return}let t=[];_.forEach((e,n)=>t.push(e.type===B?{id:n,emailValues:{value:e.value}}:{id:n,value:e.value})),X({fieldValues:t,id:C})},et=()=>{var e,t;let n=null!==(t=null===(e=document.getElementById("consultationForm"))||void 0===e?void 0:e.offsetTop)&&void 0!==t?t:0;window.scrollTo({top:n-127,left:0,behavior:"smooth"})},en=(0,u.Yz)(s,{from:{transform:F.current>s?"translateX(100%)":"translateX(-100%)"},enter:{transform:"translateX(0%)",opacity:1},leave:{transform:F.current>s?"translateX(-100%)":"translateX(100%)",opacity:0,precision:.5},exitBeforeEnter:!0,onStart:()=>W(!0),onRest:()=>W(!1)}),ei=en((e,n)=>{var l,r;let a=t[n],s=a[0],d=t[n].length>1&&t[n][0].type===E;return(0,i.jsx)(b,{width:"100%",style:e,zIndex:d||s.type!==I?0:2,children:d?(0,i.jsx)(y,{fields:a.slice(1),error:!!N,onSubmit:ee,setRecaptcha:M,recaptchaError:O,fieldValuesMap:_,handleInputChange:$}):(0,i.jsxs)("form",{children:[(0,i.jsx)(g.Z,{isConsultationPage:!0,field:s,handleChange:$,value:null!==(r=null===(l=_.get(s.id))||void 0===l?void 0:l.value)&&void 0!==r?r:void 0}),(0,i.jsx)(f.Z,{children:V&&(0,i.jsx)(o.Z,{variant:"caption",color:z,display:"block",mt:1.25,children:"Please fill out the required field."})})]})})}),el=en((e,n)=>{let l=t[n],r=l[0],a=t[n][0].type===h.r.SECTION&&1===t[n].length;return(0,i.jsx)(b,{style:e,children:(0,i.jsx)(w,{field:r,isDeadEnd:a})})});return(0,i.jsxs)(a.Z,{pt:{xs:7.5,md:16.25},pb:{xs:11.25,md:8}
1,height:"100%",justifyContent:{md:"space-between"},pl:{xs:2.5,md:3.75},pr:{xs:2.5,md:5},id:"consultationForm",children:[A?(0,i.jsx)(a.Z,{direction:"row",position:"relative",zIndex:0,children:el}):(0,i.jsx)(f.Z,{children:(0,i.jsx)(a.Z,{direction:"row",position:"relative",zIndex:0,children:el})}),A?(0,i.jsx)(a.Z,{direction:"row",children:ei}):(0,i.jsx)(f.Z,{children:(0,i.jsx)(a.Z,{direction:"row",pb:J?3.75:5,children:ei})}),!A&&!J&&!k&&(0,i.jsx)(d.Z,{mb:3.75,children:(0,i.jsx)(m.default,{noOfQuestions:S,currentQuestionIndex:Z,variant:"small",isDeadEnd:k})}),(0,i.jsxs)(a.Z,{justifyContent:{md:"flex-end"},position:"relative",zIndex:100,direction:"row",spacing:1.5,children:[!k&&!K&&(0,i.jsx)(d.Z,{width:U,children:(0,i.jsx)(p.default,{variant:"rasinBlack",label:"Go Back",onClick:()=>{if(H(!1),s>0){let e;let n=t[s-1][0];if(F.current=s,n.conditionalLogic){let{fieldId:t,value:i}=n.conditionalLogic.rules[0],l=_.get(t),r=(null==l?void 0:l.value)===i;e=r?s-1:s-2}else e=s-1;x(e),A||et()}},disabled:T||Y,width:"100%"})}),(k||K)&&(0,i.jsx)(d.Z,{width:A?U:K?"50%":"100%",children:(0,i.jsx)(p.default,{variant:"rasinBlack",label:K?"Cancel":"Back to home",href:v.s6,width:"100%"})}),J&&(0,i.jsx)(d.Z,{width:U,children:(0,i.jsx)(p.default,{type:"submit",form:"finalSection",variant:"rasinBlack",label:n,loading:T,width:"100%"})}),!k&&!J&&(0,i.jsx)(d.Z,{width:U,children:(0,i.jsx)(p.default,{variant:"rasinBlack",label:"Next",onClick:()=>{var e;let n=t[s];if(n[0].isRequired&&!(null===(e=_.get(n[0].id))||void 0===e?void 0:e.value)){H(!0);return}if(H(!1),s<t.length-1){let e;let n=t[s+1][0];if(F.current=s,n.conditionalLogic){let{fieldId:t,value:i}=n.conditionalLogic.rules[0],l=_.get(t),r=(null==l?void 0:l.value)===i;e=r?s+1:s+2}else e=s+1;x(e),A||et()}},disabled:Y,width:"100%"})})]})]})}},3892:function(e,t,n){n.r(t),n.d(t,{default:function(){return p}});var i=n(5893),l=n(948),r=n(7357),a=n(2734),o=n(1796),s=n(1536),d=n(5861),c=n(2236),u=n(3998);let x=(0,l.ZP)((0,c.q)(r.Z))(()=>({width:"12px",height:"12px",borderRadius:"20px"}));function h(e){let{text:t,selected:n,isSmall:l}=e,r=(0,a.Z)(),{white:u,rasinBlack:h}=r.palette.common,p=l?h:u,m=(0,c.q_)({background:n?(0,o.Fq)(p,1):(0,o.Fq)(p,0),border:"1px solid ".concat(p)});return(0,i.jsxs)(s.Z,{direction:"row",spacing:1.25,children:[(0,i.jsx)(x,{style:m}),!l&&(0,i.jsx)(d.Z,{variant:"button",children:t})]})}function p(e){let{noOfQuestions:t,currentQuestionIndex:n,variant:l="large",isDeadEnd:o}=e,c="small"===l,x=(0,a.Z)(),{white:p}=x.palette.common,m=(0,i.jsxs)(i.Fragment,{children:[Array.from({length:t}).map((e,t)=>(0,i.jsx)(h,{text:"Q".concat(t+1,"."),selected:!o&&t===n,isSmall:c})),(0,i.jsx)(h,{text:"End",selected:o,isSmall:c})]});return c?(0,i.jsx)(s.Z,{direction:"row",spacing:1.25,justifyContent:"center",children:m}):(0,i.jsx)(r.Z,{position:"relative",zIndex:10,width:"100vw",pt:{xs:1.25,md:2.5},pb:{xs:4.25,md:12.5},mt:{xs:3,md:0},sx:{borderTop:"1px solid ".concat(p)},children:(0,i.jsxs)(u.default,{display:"flex",flexDirection:{xs:"column",md:"row"},pl:{md:5},children:[(0,i.jsx)(d.Z,{variant:"caption",mr:{md:5},mb:{xs:1.75,md:0},children:"PROGRESS"}),(0,i.jsx)(s.Z,{direction:"row",spacing:{xs:1.25,md:2.5},children:m})]})})}}}]);
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.