1(this["webpackJsonpcoop-public-web"]=this["webpackJsonpcoop-public-web"]||[]).push([[47],{1026:function(e,t,a){"use strict";a.r(t);var n=a(100),i=a(1),r=a(32),s=a(919),c=a(920),o=a(21),l=a(53),u=a(112),b=a(74),d=a(250),j=a(25),h=a(88),m=a(201),O=a(111),p=a(203),f=a(101),x=a(174),g=a(81),y=a(15),v=a(22),w=a(308),S=a(309),C=a(828),L=a(135),N=a(131),B=a(105),k=a(2),E=function(){var e=Object(o.d)(),t=Object(o.e)(B.b);return Object(k.jsxs)(C.a,{themedIcon:"warning",isOpen:t,actions:[Object(k.jsx)(L.a,{variant:"primary",onClick:function(){return e(Object(N.c)())},"data-test-id":"logout-button","data-analytics-event":!0,children:"Log out"},"logout"),Object(k.jsx)(g.a,{as:y.a,to:"/dashboard","data-analytics-event":!0,children:"My banking"},"login")],title:"You are logged in to your internet banking",children:[Object(k.jsx)("p",{children:"If you wish to complete the join process for a different person, log out first."}),Object(k.jsx)("p",{children:"If you wish to open a new product, choose \u2018Open & Apply\u2019 from your internet banking."})]})},T=a(23),W=function(e,t){return Object(k.jsx)(u.a,{global:"full",medium:"1/2",children:Object(k.jsx)(b.a,{theme:"grey",contentClassName:"u-p-s","data-testid":"prereq-".concat(t),children:Object(k.jsx)(d.a,{figure:Object(k.jsx)(j.a,{icon:e.icon,size:"medium"}),figureClassName:"u-m-r-s",children:Object(k.jsx)(h.a,{className:e.isEmphasised?"u-font-weight-medium":void 0,children:Object(v.b)(e.text)})})})},t)},R=function(){var e=Object(o.e)(w.e),t=Object(o.e)(w.d);return Object(i.useEffect)((function(){Object(T.e)({event:"join_online_app_started",page_path:window.location.pathname,page_location:window.location.href})}),[]),e===S.b.Loading?Object(k.jsx)(l.e,{}):e===S.b.Failed?Object(k.jsx)(l.i,{}):t?Object(k.jsxs)("div",{className:"u-text-center",children:[Object(k.jsx)(E,{}),Object(k.jsx)(m.a,{children:Object(k.jsxs)(O.a,{children:[Object(k.jsx)("img",{className:"image-fixed-width-xl image-fixed-width-xxl@large",alt:"logo",src:p.a}),Object(k.jsx)("h1",{className:"u-h2 u-m-b-s","data-testid":"title",children:t.landingPage.title}),Object(k.jsx)("p",{children:t.landingPage.subTitle})]})}),Object(k.jsx)(m.a,{children:Object(k.jsx)(O.a,{children:Object(k.jsx)(f.a,{isCentered:!0,size:"large",children:Object(k.jsx)(x.a,{rowSpacingSize:"small",columnSpacingSize:"small",justifyContent:"center",alignItems:"stretch",children:t.landingPage.prerequisites.map(W)})})})}),Object(k.jsx)(m.a,{children:Object(k.jsx)(g.a,{as:y.a,to:"personal-details",variant:"primary",className:"u-margin-center",children:"Get started"})})]}):null},A=function(e){var t=e.isOpen,a=e.onClose,n=Object(r.g)();return Object(k.jsx)(C.a,{themedIcon:"warning",isOpen:Boolean(t),onRequestClose:a,actions:[Object(k.jsx)(L.a,{variant:"primary",onClick:function(){return n.push("landing")},"data-analytics-event":!0,children:"Leave the form"},"loginBtn"),Object(k.jsx)(L.a,{onClick:a,"data-analytics-event":!0,children:"Go back"},"cancelBtn")],title:"Are you sure you want to leave this form?",aria:{describedby:"description"},children:Object(k.jsx)("p",{id:"description",children:"Changes will not be saved."})})},D=a(7),I=a(914),M=a(923),q=a(942),z=a(964),P=a(935),V=a(1027),_=a(1024),F=a(193),Y=a(1023),G=a(973),J=a(1019),H=a(1020),U=Y.c.max(Object(V.a)(new Date,18),"You must be at least 18 years old"),Z="Enter your Resident Withholding Tax (RWT) rate",K=P.f().shape({fullName:Object(G.f)(),dateOfBirth:Object(Y.b)({dateSchema:U,requiredErrorMessage:"Enter your date of birth"}),gender:Object(J.c)({requiredErrorMessage:"Select how you identify"}),irdNumber:Object(H.b)(),rwtRate:P.e().transform((function(e){return isNaN(e)?void 0:e})).when("irdNumber",{is:function(e){return Boolean(e)},then:P.e().transform((function(e){return Number(e)})).typeError(Z).required(Z)}),isTertiaryStudent:Object(J.b)({requiredErrorMessage:"Select yes if you are a tertiary student"})}),Q=Object(_.a)(new Date),X=Q-130,$=Q,ee=function(e){var t=e.contentBundle,a=e.onStarted,n=e.onCompleted,r=e.submitButtonLabel,s=void 0===r?"Continue":r,c=Object(o.d)(),l=Object(o.e)(w.a),u=Object(q.d)({resolver:Object(z.a)(K),defaultValues:Object(D.a)({},null===l||void 0===l?void 0:l.personalDetails)}),b=u.handleSubmit,d=u.errors,j=u.control,h=u.watch,m=u.trigger,O=u.formState,p=h("irdNumber"),f=h(["dateOfBirth.day","dateOfBirth.month","dateOfBirth.year"]);return Object(i.useEffect)((function(){O.isSubmitted&&m("dateOfBirth")}),[O.isSubmitted,m,f]),Object(i.useEffect)((function(){O.isSubmitted&&m("r
1wtRate")}),[O.isSubmitted,m,p]),Object(i.useEffect)((function(){O.isDirty&&!(null===l||void 0===l?void 0:l.personalDetails)&&a&&a()}),[O.isDirty,l,a]),Object(k.jsx)("form",{onSubmit:b((function(e){c(Object(F.c)(e)),n()})),children:Object(k.jsxs)(I.a,{spacingSize:"large",children:[Object(k.jsx)(M.a,{errors:d,submitCount:O.submitCount}),Object(k.jsx)(G.e,{path:"fullName",label:"What\u2019s your name?",hasLargeLabel:!0,titleList:t.lookups.title,control:j,errors:d,autoFocus:!0}),Object(k.jsx)(Y.a,{path:"dateOfBirth",label:"What\u2019s your date of birth?",hasLargeLabel:!0,control:j,errors:d,yearRange:{from:X,to:$}}),Object(k.jsx)(J.a,{path:"gender",label:"How do you identify?",hasLargeLabel:!0,helpText:"We ask for this information to help ensure accuracy when processing the credit check.",control:j,errors:d,isVertical:!0,optionList:t.lookups.gender.map((function(e){return{value:e,label:e}}))}),Object(k.jsx)(H.a,{path:"irdNumber",label:"What\u2019s your IRD number?",helpText:"If we don\u2019t have your IRD number, you\u2019ll automatically pay 45% Resident Withholding Tax (RWT) on any interest you earn.",hasLargeLabel:!0,control:j,errors:d,optional:!0}),p&&Object(k.jsx)(J.a,{path:"rwtRate",label:"What\u2019s your Resident Withholding Tax (RWT) rate?",hasLargeLabel:!0,control:j,errors:d,isVerticalAtSmallOnly:!0,optionList:t.lookups.rwtRates.map((function(e){return{value:e.toString(),label:"".concat(Number(e),"%")}}))}),Object(k.jsx)(J.a,{path:"isTertiaryStudent",label:"Are you a tertiary student?",hasLargeLabel:!0,helpText:"Tertiary students may be eligible for special banking offers.",control:j,errors:d,optionList:[{value:"true",label:"Yes"},{value:"false",label:"No"}]}),Object(k.jsx)(L.a,{type:"submit",variant:"primary",children:s})]})})},te=a(1022),ae=a(976),ne=a(975),ie=P.f().shape({mobileNumber:Object(ae.c)(),emailAddress:Object(ne.b)(),residentialAddress:Object(te.b)("Enter a residential address")}),re=function(e){var t,a=e.contentBundle,n=e.onCompleted,i=e.submitButtonLabel,r=void 0===i?"Continue":i,s=Object(o.d)(),c=Object(o.e)(w.a),l=Object(q.d)({resolver:Object(z.a)(ie),defaultValues:Object(D.a)({},null===c||void 0===c?void 0:c.contactDetails)}),d=l.handleSubmit,j=l.errors,h=l.control,m=l.formState,O=l.setValue,p=l.watch;return Object(k.jsx)("form",{onSubmit:d((function(e){s(Object(F.b)(e)),n()})),children:Object(k.jsxs)(I.a,{spacingSize:"large",children:[Object(k.jsx)(M.a,{errors:j,submitCount:m.submitCount}),Object(k.jsx)(ae.b,{path:"mobileNumber",label:"What\u2019s your NZ mobile number?",hasLargeLabel:!0,errors:j,control:h,autoFocus:!0}),Object(k.jsx)(ne.a,{path:"emailAddress",label:"What\u2019s your email address?",hasLargeLabel:!0,errors:j,control:h}),Object(k.jsx)(te.a,{path:"residentialAddress",label:"Where do you live?",hasLargeLabel:!0,errors:j,control:h,setValue:O,watch:p}),(null===a||void 0===a||null===(t=a.customerConsentMessage)||void 0===t?void 0:t.body)&&Object(k.jsx)(u.a,{children:Object(k.jsx)(b.a,{theme:"grey",children:Object(v.b)(a.customerConsentMessage.body)})}),Object(k.jsx)(L.a,{type:"submit",variant:"primary",children:r})]})})},se=a(10),ce=a(3),oe=a.n(ce),le=a(244),ue=function(e){var t,a,n,i=e.contentBundle,r=e.applicationStatus,s=Object(o.e)(w.b);return n=r===S.a.Accepted?i.confirmation:s===le.a.UserAlreadyExists?i.errorExistingCustomer:s===le.a.ApplicationAlreadyExists?i.errorExistingApplication:i.generalErrorMessage,Object(k.jsx)(m.a,{children:Object(k.jsx)(O.a,{children:Object(k.jsx)(f.a,{size:n.image?"large":"medium",isCentered:!0,children:Object(k.jsxs)(x.a,{hasRowSpacing:!0,className:oe()("u-flex-justify-center",{"u-text-center":!n.image}),children:[n.image&&Object(k.jsx)(u.a,{global:"10/12",medium:"1/2",children:Object(k.jsx)("div",{className:oe()("u-auto",(t={},Object(se.a)(t,"u-width-".concat(n.imageWidth),n.imageWidth),Object(se.a)(t,"u-width-full",!n.imageWidth),t)),children:Object(k.jsx)("img",{src:n.image.file,alt:n.image.altText})})}),Object(k.jsx)(u.a,{medium:n.image?"1/2":void 0,className:oe()("u-flex u-flex-align-items-center"),children:Object(k.jsxs)("div",{className:oe()("u-auto u-width-full u-width-8/10@medium"),children:[Object(v.b)(n.body),(null===(a=n.button)||void 0===a?void 0:a.link)&&Object(k.jsx)(g.a,{as:y.a,variant:n.button.style,to:n.button.link,onClick:Object(T.a)(n.button.gtmEvent),className:"u-m-t-s",children:n.button.label})]})})]})})})})}
1,be=[{path:"personal-details",stepText:{title:"Personal details"},component:ee,isCompleted:function(e){return Boolean(e.personalDetails)}},{path:"contact-details",stepText:{title:"Contact details"},component:re,isCompleted:function(e){return Boolean(e.contactDetails)}}],de="landing",je="submitted",he=function(e,t){t.push(be[Math.max(0,Math.min(e,be.length-1))].path)};t.default=function(){var e=Object(o.d)(),t=Object(r.g)(),a=Object(r.i)().step,u=Object(i.useState)(),b=Object(n.a)(u,2),d=b[0],j=b[1],h=Object(r.j)("/join-us/".concat(de)),m=Object(r.j)("/join-us/".concat(je)),O=Object(o.e)(w.d),p=Object(o.e)(w.a),f=Object(o.e)(w.c),x=Object(o.e)(B.b),g=be.reduce((function(e,t,a){return p&&t.isCompleted(p)?{maxStep:a+1}:e}),{maxStep:0}).maxStep,y=Object(i.useState)(Boolean(g)),v=Object(n.a)(y,2),C=v[0],L=v[1],N=be.findIndex((function(e){return e.path===a})),E=N===be.length-1,T=N<0||!O||!p||x,W=f===S.a.Processing,D=f>S.a.Processing;if(h)return Object(k.jsx)(R,{});if(m&&O)return Object(k.jsx)(ue,{contentBundle:O,applicationStatus:f});if(D)return Object(k.jsx)(r.a,{to:je,push:!0});if(T)return Object(k.jsx)(r.a,{to:de});if(N>g)return Object(k.jsx)(r.a,{to:be[g].path});var I=be[N].component;return Object(k.jsxs)(k.Fragment,{children:[W&&Object(k.jsx)(l.e,{}),Object(k.jsxs)(s.a,{progressIndicator:Object(k.jsx)(c.a,{steps:be.map((function(e){return e.stepText})),activeStep:N}),onBackClick:N?function(){he(N-1,t)}:void 0,onCancelClick:function(){C?j(!0):t.push(de)},children:[Object(k.jsx)(I,{contentBundle:O,onStarted:0===N?function(){return L(!0)}:void 0,onCompleted:function(){E?e(Object(F.a)()):he(N+1,t)},submitButtonLabel:E?"Submit":void 0}),Object(k.jsx)(A,{isOpen:d,onClose:function(){return j(!1)}})]})]})}}}]);
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.