1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2828,6185],{42828:function(e,r,t){t.r(r);var n=t(80318),o=t(30266),a=t(809),i=t.n(a),u=t(67294),l=t(40420),s=t(40849),d=t(46185),c=t(68315),f=t(78131),m=t(29123),h=t(7248),p=t(76813),g=t(52772),v=t(72249),b=t(12557),x=t(85893);r.default=function(e){var r=e.submit,t=e.cancel,a=e.hasError,y=e.parentLoader,j=e.errorCallback,C=e.stages,q=(0,u.useContext)(g.default),k=q.profile,S=q.saveProfile,w=(0,u.useState)(0),F=w[0],Z=w[1],B=(0,u.useState)(C),P=B[0],D=B[1],M=(0,u.useState)((0,v.nO)(p.default)),T=M[0],R=M[1],E=(0,u.useState)(!1),I=E[0],L=E[1];(0,u.useEffect)((function(){var e=T;k&&(e.street=k.street,e.suburb=k.suburb,e.city=k.city,e.postcode=k.postcode),R(e)}),[]),(0,u.useEffect)((function(){L(y)}),[y]),(0,u.useEffect)((function(){a&&3===F&&Z(0)}),[a]);var W=function(){var e=(0,o.Z)(i().mark((function e(t){var o,a,u,l,s=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=s.length>1&&void 0!==s[1]?s[1]:null,L(!0),R(t),2!==F){e.next=26;break}if(e.prev=4,!t.IsF2FReferralRequested){e.next=13;break}return k.street=t.street,k.suburb=t.suburb,k.city=t.city,k.postcode=t.postcode,k.hasAddress=!0,e.next=13,S(k);case 13:e.next=26;break;case 15:return e.prev=15,e.t0=e.catch(4),j(e.t0.response.data.message),b.Logger.error("Profile save ".concat(e.t0.response.data.message)),(a=e.t0.response.data.data)&&(u=Object.fromEntries(Object.entries(a).filter((function(e){var r=(0,n.Z)(e,2);r[0];return r[1]}))),o(u)),window.scrollTo(0,0),document.getElementById("scrollWrapper").scrollTop=0,L(!1),e.abrupt("return");case 26:if(F<=2&&(P[F].completed=!0,D(P),Z(F+1),j(null)),3!==F){e.next=36;break}if(P[F].completed=!0,!(l=P.find((function(e){return!e.completed})))){e.next=34;break}Z(l.step),e.next=36;break;case 34:return e.next=36,r(t);case 36:L(!1);case 37:case"end":return e.stop()}}),e,null,[[4,15]])})));return function(r){return e.apply(this,arguments)}}(),V=function(){j(null),Z(F-1)};return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(l.Z,{inverted:!0,active:I,children:(0,x.jsx)(s.Z,{active:!0,children:"Loading"})}),(0,x.jsx)(d.Progress,{data:P,currentStep:F,handleChange:function(e){return Z(e)}}),0===F&&(0,x.jsx)(c.default,{data:T,submit:function(e){return W(e)},cancel:t}),1===F&&(0,x.jsx)(f.default,{data:T,submit:function(e){return W(e)},previous:V}),2===F&&(0,x.jsx)(m.default,{data:T,submit:function(e,r){var t=r.setErrors;return W(e,t)},previous:V,profile:k,hasError:a}),3===F&&(0,x.jsx)(h.default,{data:T,submit:function(e){return W(e)},previous:V})]})}},68315:function(e,r,t){t.r(r);var n=t(67294),o=t(52772),a=t(49127),i=t(96150),u=t(54098),l=t(78191),s=t(17860),d=t(88771),c=t(85893);r.default=function(e){var r=e.data,t=e.submit,f=e.cancel,m=(e.hasError,(0,n.useContext)(o.default).profile);return(0,c.jsx)(a.J9,{initialValues:r,validationSchema:l.schemaQuitProgramMotivators,onSubmit:t,render:function(e){var r=e.values,t=e.errors,n=e.touched,o=e.handleChange,a=e.handleSubmit,l=e.handleBlur,h=e.setFieldValue;e.setFieldTouched;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(i.Z,{children:(0,c.jsxs)(u.Z,{color:"blue",children:[(0,c.jsx)(i.Z.Dropdown,{error:!!n.quitMotivation&&t.quitMotivation,required:!0,selection:!0,floating:!0,label:"What is your main motivation to quit at this time?",name:"quitMotivation",id:"quitMotivation",options:s.v,value:r.quitMotivation,onChange:function(e,r){var t=r.value;o(e),h("quitMotivation",t)},onBlur:l}),m&&"male"!==m.gender&&(0,c.jsx)(i.Z.Dropdown,{error:!!n.isPregnant&&t.isPregnant,required:!0,selection:!0,floating:!0,label:"Are you currently pregnant?",name:"isPregnant",id:"isPregnant",options:s.CV,value:r.isPregnant,onChange:function(e,r){var t=r.value;o(e),h("isPregnant",t)},onBlur:l}),m&&"male"!==m.gender&&!0===r.isPregnant&&(0,c.jsx)(i.Z.Checkbox,{label:"Are you registered with Bay of Plenty Heru & Hap\u016b M\u0101m\u0101? (Only applicable if you are a maternal smoker living in the Bay of Plenty)",name:"regBayofPlenty",defaultChecked:r.regBayofPlenty,onChange:function(e,r){var t=r.checked;o(e),h("regBayofPlenty",t)},onBlur:l})]})})}),(0,c.jsx)(d.default,{fixed:!0,handleCancel:f,handleSubmit:a,cancelContent:"Cancel",submitContent:"Next"})]})}})}},7248:function(e,r,t){t.r(r);t(67294);
1var n=t(49127),o=t(30381),a=t.n(o),i=t(52689),u=t(96150),l=t(54098),s=t(18530),d=t(99763),c=t(88771),f=t(78191),m=t(17860),h=t(85893);r.default=function(e){var r=e.submit,t=e.previous,o=e.data;e.hasError;return(0,h.jsx)(n.J9,{initialValues:o,validationSchema:f.schemaQuitProgramPreferences,onSubmit:r,render:function(e){var r=e.values,n=e.errors,o=e.touched,f=e.handleChange,p=e.handleSubmit,g=e.handleBlur,v=e.setFieldValue;return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(u.Z,{children:(0,h.jsxs)(l.Z,{color:"blue",children:[(0,h.jsx)(s.Z,{as:"h3",content:"Set a start date!"}),(0,h.jsx)(u.Z.Field,{required:!0,error:!!o.quitDate&&n.quitDate,label:"This is the day you start quitting, not the day you plan to be completely Smokefree.",name:"quitDate",value:r.quitDate,dateFormat:"DD MMMM YYYY",maxDate:a()().add(30,"days"),minDate:a()(),initialDate:a()(),popupPosition:"bottom center",hideMobileKeyboard:!0,animation:"none",preserveViewMode:!1,closable:!0,icon:!1,onKeyPress:function(e){return e.key&&e.preventDefault()},onChange:function(e,r){var t=r.value;f(e),v("quitDate",t)},control:i.Wr}),(0,h.jsx)(u.Z.Field,{required:!0,label:"How would you like to be contacted?",error:!!o.preferredMediums&&n.preferredMediums,control:function(){return(0,h.jsx)(h.Fragment,{children:m.B9.map((function(e,t){var n=r.preferredMediums.indexOf(e.value),o=r.preferredMediums;return(0,h.jsx)(u.Z.Checkbox,{label:e.text,name:e.value,defaultChecked:n>-1,onChange:function(){-1===n?o.push(e.value):o=o.filter((function(r){return r!==e.value})),v("preferredMediums",o)}},t)}))})}}),(0,h.jsx)(u.Z.Dropdown,{error:!!o.mobileTextLanguage&&n.mobileTextLanguage,required:!0,selection:!0,floating:!0,upward:!0,label:"What language would you prefer to receive SMS in?",name:"mobileTextLanguage",options:m._N,value:r.mobileTextLanguage,onChange:function(e,r){var t=r.value;f(e),v("mobileTextLanguage",t)},onBlur:g}),(0,h.jsx)(d.Z,{children:"All text messages you send us are FREE. Whichever channel you sign up to, we do send an occasional text message to check in, and to measure your quit smoking status at 4-weeks and 3-months. This helps us to understand what helps people to quit smoking, and if we do not receive a reply about your quit smoking status, we will call you to see how you are going."})]})})}),(0,h.jsx)(c.default,{fixed:!0,handleCancel:t,handleSubmit:p,cancelContent:"Back",submitContent:"Submit"})]})}})}},46185:function(e,r,t){t.r(r),t.d(r,{Progress:function(){return a}});t(67294);var n=t(21269),o=t(85893),a=function(e){var r=e.data,t=e.currentStep,a=e.handleChange;return(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(n.Z.Group,{ordered:!0,fluid:!0,unstackable:!0,className:"quit-journey-progres",children:r.map((function(e){return(0,o.jsx)(n.Z,{active:t===e.step,onClick:function(){return a(e.step)},completed:e.completed,content:e.stage},e.step)}))})})}},29123:function(e,r,t){t.r(r);t(67294);var n=t(49127),o=t(96150),a=t(54098),i=t(60345),u=t(78191),l=t(88771),s=t(17860),d=t(85893);r.default=function(e){var r=e.submit,t=e.previous,c=e.data,f=e.hasError,m=void 0!==f&&f;return(0,d.jsx)(n.J9,{initialValues:c,validationSchema:u.schemaQuitProgramTriggers,onSubmit:r,render:function(e){var r=e.values,n=e.errors,u=e.touched,c=e.handleChange,f=e.handleSubmit,h=e.handleBlur,p=e.setFieldValue,g=function(e,r){r.name,r.value;c(e)};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(o.Z,{children:[(0,d.jsxs)(a.Z,{color:"blue",children:[(0,d.jsx)(o.Z.Dropdown,{error:!!u.mostCommonTrigger&&n.mostCommonTrigger,required:!0,selection:!0,floating:!0,label:"What is your most common trigger to start smoking/vaping?",name:"mostCommonTrigger",id:"mostCommonTrigger",options:s.WB,value:r.mostCommonTrigger,onChange:function(e,r){var t=r.value;c(e),p("mostCommonTrigger",t)},onBlur:h}),(0,d.jsx)(o.Z.Dropdown,{error:!!u.liveWithSmoker&&n.liveWithSmoker,required:!0,selection:!0,floating:!0,label:"Are you living with someone who smokes/vape?",name:"liveWithSmoker",id:"liveWithSmoker",options:s.CV,value:r.liveWithSmoker,onChange:function(e,r){var t=r.value;p("liveWithSmoker",t)}}),(0,d.jsx)(o.Z.Dropdown,{required:!0,selection:!0,upward:!0,floating:!0,error:!!u.smokeUnderStress&&n.smokeUnderStress,label:"How likely is it that you\u2019d reach for a smoke/vape when you\u2019re feeling down, stressed anxious, or grumpy",name:"smokeUnderStress",id:"smokeUnderStress",options:s.gF,value:r.smokeUnderStress,onChange:function(e,r){var t=r.value;c(e),p("smokeUnderStress",t)},onBlur:h}),(0,d.jsx)(o.Z.Dropdown,{error:!!u.quitConfidence&&n.quitConfidence,required:!0,selection:!0,floating:!0,label:"How confident are you that you can quit smoking/vaping?",name:"quitConfidence",id:"quitConfidence",options:s.gF,value:r.quitConfidence,onChange:function(e,r){var t=r.value;c(e),p("quitConfidence",t)},onBlur:h}),(0,d.jsx)(o.Z.Dropdown,{error:!!u.familySupportLevel&&n.familySupportLevel,required:!0,selection:!0,floating:!0,label:"How supported do you feel by friends and wh\u0101nau with your quit attempt?",name:"familySupportLevel",id:"familySupportLevel",options:s.gF,value:r.familySupportLevel,onChange:function(e,r){var t=r.value;c(e),p("familySupportLevel",t)},onBlur:h}),(0,d.jsx)(o.Z.Dropdown,{error:!!u.IsF2FReferralRequested&&n.IsF2FReferralRequested,required:!0,selection:!0,floating:!0,label:"Would you like to be referred to a face to face service?",name:"IsF2FReferralRequested",i
1d:"IsF2FReferralRequested",options:s.CV,value:r.IsF2FReferralRequested,onChange:function(e,r){var t=r.value;c(e),p("IsF2FReferralRequested",t)},onBlur:h})]}),r.IsF2FReferralRequested&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i.Z,{style:{marginTop:"2.5em"},horizontal:!0,content:"Face to Face Referral"}),(0,d.jsxs)(a.Z,{color:m?"red":"green",children:[(0,d.jsx)("p",{children:"Please ensure your contact information is correct before submitting the form."}),(0,d.jsx)(o.Z.Input,{required:!0,error:!!u.street&&n.street,label:"Street",name:"street",value:r.street,onChange:g,onBlur:h}),(0,d.jsxs)(o.Z.Group,{widths:"equal",children:[(0,d.jsx)(o.Z.Input,{required:!0,error:!!u.suburb&&n.suburb,label:"Suburb",name:"suburb",value:r.suburb,onChange:g,onBlur:h}),(0,d.jsx)(o.Z.Input,{fluid:!0,required:!0,error:!!u.city&&n.city,label:"City",name:"city",value:r.city,onChange:g,onBlur:h}),(0,d.jsx)(o.Z.Input,{fluid:!0,required:!0,error:!!u.postcode&&n.postcode,label:"Postcode",name:"postcode",value:r.postcode,onChange:c,onBlur:h})]})]})]})]})}),(0,d.jsx)(l.default,{fixed:!0,handleCancel:t,handleSubmit:f,cancelContent:"Back",submitContent:"Next"})]})}})}},80318:function(e,r,t){t.d(r,{Z:function(){return o}});var n=t(16988);function o(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a=[],i=!0,u=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(a.push(n.value),!r||a.length!==r);i=!0);}catch(l){u=!0,o=l}finally{try{i||null==t.return||t.return()}finally{if(u)throw o}}return a}}(e,r)||(0,n.Z)(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}}}]);
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.