"use strict";(self.webpackChunkhhgHealthCareV1=self.webpackChunkhhgHealthCareV1||[]).push([[4613],{78773:function(e,n,t){t.d(n,{G:function(){return i}});var i="__subscription_add_another_card__"},47683:function(e,n,t){t.d(n,{L3:function(){return _},Lo:function(){return A},ze:function(){return C}});var i=t(40568),r=t(2445),a=t(73884),l=t(36814),o=t(84655),s=t(59850),c=t(84091),d=t(9934),u=t(63231),p=t(42280),f=t(73419),m=t(6442),h=t(39755),g="10_percent",v="100_percent",y="full_payment",x="subscription",b=["bind_card","subscription"];function C(e){var n=(0,i.A)(e.split("-"),4);return{provider:n[0],paymentVia:n[1],paymentType:n[2],providerTitle:n[3]}}var A=function(e){return!!e&&b.includes(C(e).paymentType)},_=function(e,n){return A(n)?1:e};n.Ay=function(e){var n=e.hospitalId,t=e.doctorId,i=(0,f.$)().locale,C=(0,m.A)().formatMessage,A=(0,a.useState)(!0),_=A[0],N=A[1],k=(0,a.useState)(),Y=k[0],w=k[1],M=(0,h.C)(),F=M.providers,L=M.setProviders,P=M.selectedPaymentValue,S=(0,p.Jf)();(0,a.useEffect)((function(){S.setProviders(F)}),[F]),(0,a.useEffect)((function(){S.setSelectedPaymentValue(P)}),[P]),(0,a.useEffect)((function(){return p.Jf.subscribe((function(e){var n,t=h.C.getState();(e.selectedPaymentValue!==t.selectedPaymentValue&&t.setSelectedPaymentValue(e.selectedPaymentValue),e.selectedSubPaymentValue!==t.selectedSubPaymentValue&&t.setSelectedSubPaymentValue(e.selectedSubPaymentValue),e.openOnlineBanking!==t.openOnlineBanking)&&t.setOpenOnlineBanking(null!==(n=e.openOnlineBanking)&&void 0!==n&&n)}))}),[]);var D=(0,a.useMemo)((function(){var e=F.filter((function(e){return e.payment_type===g})),n=F.filter((function(e){return e.payment_type===y})),t=F.filter((function(e){return e.payment_type===v})),i=F.filter((function(e){var n=e.payment_type;return b.includes(n)}));return{ten_percent:e,full_payment:n,one_hundred_percent:t,subscription:i}}),[F]),B=D.subscription.length>0,O=(0,a.useMemo)((function(){var e=[];return D.one_hundred_percent.length&&e.push({label:D.one_hundred_percent[0].display_label||C({id:"vaccination.payment.tabs.pay_100_percent",defaultMessage:"Pay 100%"}),value:v}),D.ten_percent.length&&e.push({label:D.ten_percent[0].display_label||C({id:"vaccination.payment.tabs.pay_10_percent",defaultMessage:"Pay 10% to Book"}),value:g}),D.full_payment.length&&e.push({label:D.full_payment[0].display_label||C({id:"vaccination.payment.tabs.buy_now_pay_later",defaultMessage:"Buy Now Pay Later"}),value:y}),e}),[D.ten_percent,D.full_payment,D.one_hundred_percent,D.subscription]);(0,a.useMemo)((function(){if(O.length){var e=O[0].value;P&&P.includes(y)&&(e=y),P&&P.includes(g)&&(e=g),P&&P.includes(v)&&(e=v),P&&P.includes(x)&&(e=x),w(e)}}),[O,P]);var V=(0,a.useMemo)((function(){return B?F:Y===g?D.ten_percent:Y===v?D.one_hundred_percent:Y===y?D.full_payment:Y===x?D.subscription:F}),[Y,D,F,B]);return(0,a.useEffect)((function(){if(n){N(!0);var e="teleconsult_payment_providers_".concat(n,"_").concat(t);o.W.withCached(e,(function(){return(0,c.px)((0,c.fK)(s.R.GET_VACCINATION_PAYMENT_PROVIDER,{locale:String(i),hospitalId:n,doctorId:"".concat(t||"")}),"GET")})).then((function(e){var n,t;(null===e||void 0===e||null===(n=e.data)||void 0===n||null===(t=n.items)||void 0===t?void 0:t.length)&&(L(e.data.items),N(!1))}))}}),[n]),(0,r.FD)("div",{id:"payment-method-tele-step-1",className:"paymentMethod",children:[!B&&(0,r.Y)(u.A,{tabs:O,currentTab:Y,onChangeTab:w}),(0,r.Y)(l.a,{className:"pt-[14px] bg-white",children:(0,r.FD)(l.a,{className:"px-4 pb-5 lg:pb-6",children:[B&&(0,r.Y)(l.a,{className:"flex justify-between items-center mb-3",children:(0,r.Y)("h2",{className:"text-[17px] leading-6 tracking-[-0.4px] text-dark font-semibold",children:C({id:"teleconsultation.payment.step2.payment_method",defaultMessage:"Payment Method"})})}),(0,r.Y)(d.A,{loading:_,options:B?F:V})]})})]})}},39755:function(e,n,t){t.d(n,{C:function(){return a},R:function(){return r}});var i=t(44745),r={RESULT:0,ONE:1,TWO:2},a=(0,i.vt)()((function(e){return{currentStep:r.ONE,setCurrentStep:function(n){return e((function(){return{currentStep:n}}))},providers:[],setProviders:function(n){return e((function(){return{providers:n}}))},setSelectedPaymentValue:function(n){return e((function(){return{selectedPaymentValue:n}}))},setSelectedSubPaymentValue:function(n){return e((function(){return{selectedSubPaymentValue:n}}))},setOpenOnlineBanking:function(n){return e((function(){return{openOnlineBanking:n}}))},setDoctorInfo:function(n){return e((function(){return{doctorInfo:n}}))},setSlotInfo:function(n){return e((function(){return{slotInfo:n}}))},setDate:function(n){return e((function(){return{date:n}}))},setScheduleId:function(n){return e((function(){return{scheduleId:n}}))},setPaymentResult:function(n){return e((function(){return{paymentResult:n}}))}}}))},24613:function(e,n,t){t.d(n,{h:function(){return le},A:function(){return ce}});var i=t(858),r=t(38971),a=t(44898),l=t(53513),o=t(63538),s=t(83776),c=t(2445),d=t(73884),u=t(31898),p=t(35291),f=t(39450),m=t(6043),h=t(4174),g=t(92793),v=t(22615),y=t(1657),x=t(36814),b=t(72280),C=t(6596),A=t(84091),_=t(32485),N=t.n(_),k=t(35652),Y=t(78773),w=t(47683),M=t(88491),F=t(73419),L=t(6442),P=t(67722),S=t(86706),D=t(37680),B=t(88411),O=t(27773),V=t(20396),j=t(41543),Z=t(62481),T=t(99745),E=t(46270),I=t(57448),z=t(59850),H=t(40959),R=["image/png","image/jpeg","image/jpg","application/pdf","image/heic","image/heif"],U=(0,d.forwardRef)((function(e,n){var t,a=e.prescriptionFiles,u=e.setPrescriptionFiles,f=e.formData,m=e.setFormData,h=e.onValidate,g=e.loadingPayment,v=e.isDisableUpload,y=(0,L.A)().formatMessage,b=(0,d.useRef)(null),C=(0,F.$)(),_=C.locale,N=C.router;(0,d.useImperativeHandle)(n,(function(){return{handleFileSelect:function(e){k(e)}}}));var k=function(e){if(!g){var n=Array.from(e),t=Object.keys(a).filter((function(e){var n;return null===(n=a[e])||void 0===n?void 0:n.fileObject})).length;if(t+n.length>3)m((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{error:y({id:"vaccination.payment.prescription.maxFilesExceeded",defaultMessage:"Maximum 3 files/images allowed"}),touched:!0})})}));else{var i=new Set;Object.keys(a).forEach((function(e){var n=a[e];if(null===n||void 0===n?void 0:n.fileObject){var t="".concat(n.fileObject.name,"_").concat(n.fileObject.size);i.add(t)}}));var r=new Set,s=[];if(n.forEach((function(e){var n="".concat(e.name,"_").concat(e.size);i.has(n)||r.has(n)?s.push(e):r.add(n)})),s.length>0)m((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{error:y({id:"vaccination.payment.prescription.duplicateFile",defaultMessage:'File "{fileName}" has already been selected'},{fileName:s[0].name}),touched:!0})})}));else{var c=[];if(n.forEach((function(e){var n=function(e){return e.size>5242880?y({id:"vaccination.payment.prescription.fileTooLarge",defaultMessage:"File size must be less than 5MB"}):R.includes(e.type)||e.name.toLowerCase().endsWith(".heic")||e.name.toLowerCase().endsWith(".heif")?null:y({id:"vaccination.payment.prescription.invalidFileType",defaultMessage:"Invalid file type. Only PNG, JPG, JPEG, PDF, HEIC, HEIF are allowed"})}(e);n&&c.push({file:e,error:n})})),c.length>0)m((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{error:c[0].error,touched:!0})})}));else{var d=["File1","File2","File3"],p=new Set(Object.keys(a).filter((function(e){var n;return null===(n=a[e])||void 0===n?void 0:n.fileObject}))),f=[],h=!0,v=!1,x=void 0;try{for(var b,C=n[Symbol.iterator]();!(h=(b=C.next()).done);h=!0){var A=b.value,_=d.find((function(e){return!p.has(e)}));if(!_)return void m((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{error:"vaccination.payment.prescription.maxFilesExceeded",touched:!0})})}));p.add(_),f.push({file:A,key:_})}}catch(N){v=!0,x=N}finally{try{h||null==C.return||C.return()}finally{if(v)throw x}}m((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{error:""})})})),u((function(e){var n=(0,l.A)({},e);f.forEach((function(e){var t=e.file,i=e.key;n[i]={fileObject:t,status:"pending"}}));var t=Object.keys(n).filter((function(e){var t;return null===(t=n[e])||void 0===t?void 0:t.fileObject}));return t.sort((function(e,n){var t={File1:1,File2:2,File3:3};return t[e]-t[n]})),m((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{value:t.join("|"),touched:!0})})})),n}))}}}}},Y=function(e){if(!g){u((function(n){var t=(0,l.A)({},n);return delete t[e],t}));var n=Object.keys(a).filter((function(n){return n!==e})).filter((function(e){var n;return null===(n=a[e])||void 0===n?void 0:n.fileObject}));m((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{value:n.join("|"),touched:!0})})})),requestAnimationFrame((function(){h("prescription")}))}},w=function(){var e=(0,i.A)((function(e){var n,t,i,c,d,p;return(0,s.__generator)(this,(function(s){switch(s.label){case 0:if(g)return[2];if(!(null===(n=a[e])||void 0===n?void 0:n.fileObject)||"failed"!==n.status)return[2];u((function(n){var t=n[e];return t?(0,o.A)((0,l.A)({},n),(0,r.A)({},e,(0,o.A)((0,l.A)({},t),{status:"loading"}))):n})),m((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{error:""})})})),s.label=1;case 1:return s.trys.push([1,7,,8]),t=window.location.href.includes("localhost"),(i=new FormData).append("file",n.fileObject),t?(d={URL:"https://cdn-hermes.hellohealthgroup.com/2026/01/c73bb9c0c77b33740c67833e5081c2b25b7e2f8b01b88c15e5c4743617476022.png",message:"Upload Successful",status:!0},[3,4]):[3,2];case 2:return[4,(0,A.px)((0,A.Gx)(z.R.POST_IMAGE_UPLOAD),"POST",{data:i,headers:{"Content-Type":"multipart/form-data"}})];case 3:d=s.sent(),s.label=4;case 4:return c=d,t?[4,new Promise((function(e){return setTimeout(e,1e3)}))]:[3,6];case 5:s.sent(),s.label=6;case 6:if(!(p=(null===c||void 0===c?void 0:c.URL)||""))throw new Error("No URL returned");return u((function(n){var t=n[e];return t?(0,o.A)((0,l.A)({},n),(0,r.A)({},e,(0,o.A)((0,l.A)({},t),{status:"success",url:p}))):n})),[3,8];case 7:return s.sent(),u((function(n){var t=n[e];return t?(0,o.A)((0,l.A)({},n),(0,r.A)({},e,(0,o.A)((0,l.A)({},t),{status:"failed"}))):n})),[3,8];case 8:return[2]}}))}));return function(n){return e.apply(this,arguments)}}(),M=Object.keys(a).filter((function(e){var n,t;return(null===(n=a[e])||void 0===n?void 0:n.fileObject)||(null===(t=a[e])||void 0===t?void 0:t.url)})),P=M.length>=3,S=g||P||v;return(0,c.FD)(x.a,{className:"pt-4 flex gap-3 flex-col",children:[(0,c.Y)("p",{className:"text-[15px] leading-6 tracking-[-0.3px] text-gray1000 font-semibold",children:y({id:"vaccination.payment.prescription_upload_description",defaultMessage:"Please upload a valid prescription for our medical expert to review"})}),M.length>0&&(0,c.Y)(x.a,{className:"flex gap-2 flex-col",children:M.map((function(e){var n=function(e){var n=a[e];if(!n)return{text:"",icon:null,bgColor:"",status:"pending"};switch(n.status){case"pending":return{text:"",icon:null,bgColor:"bg-neutral50",status:"pending"};case"loading":return{text:y({id:"vaccination.payment.prescription.uploading",defaultMessage:"Uploading"}),icon:(0,c.Y)(I.a,{size:20,color:p.w.colors.primaryBase}),bgColor:"bg-neutral50",status:"loading"};case"success":return{text:"",icon:(0,c.Y)(O.A,{color:p.w.colors.green600,size:20,className:"flex-shrink-0"}),bgColor:"bg-green50",status:"success"};case"failed":return{text:y({id:"vaccination.payment.prescription.resend",defaultMessage:"Resend"}),icon:(0,c.Y)(Z.A,{color:p.w.colors.red600,size:20,className:"flex-shrink-0"}),bgColor:"bg-red50",status:"failed"};default:return{text:"",icon:null,bgColor:"",status:"pending"}}}(e),t=function(e){var n=a[e];if(null===n||void 0===n?void 0:n.fileObject)return n.fileObject.name;if(null===n||void 0===n?void 0:n.url){var t,i=n.url.match(/([^/?#]+\.(?:png|jpg|jpeg|pdf|heic|heif|webp))(?=$|[?#])/i);return null!==(t=null===i||void 0===i?void 0:i[1])&&void 0!==t?t:"prescription_01.jpeg"}return""}(e);return(0,c.FD)(x.a,{className:"".concat(n.bgColor," rounded-lg px-4 py-3 flex items-center gap-3"),children:[n.icon&&(0,c.Y)(x.a,{className:"flex-shrink-0",children:n.icon}),(0,c.Y)("p",{className:"flex-1 text-[13px] leading-5 tracking-[-0.3px] text-dark truncate",children:t}),n.text&&"loading"===n.status&&(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-primaryBase",children:n.text}),n.text&&"failed"===n.status&&(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-red600 cursor-pointer",onClick:function(){return w(e)},children:n.text}),!v&&(0,c.Y)(c.FK,{children:"success"===n.status?(0,c.Y)(T.A,{size:20,color:p.w.colors.gray700,className:"flex-shrink-0 cursor-pointer",onClick:function(){return Y(e)}}):(0,c.Y)(V.A,{size:20,color:p.w.colors.gray700,className:"flex-shrink-0 cursor-pointer",onClick:function(){return Y(e)}})})]},e)}))}),(null===(t=f.prescription)||void 0===t?void 0:t.error)&&(0,c.Y)("p",{className:"text-[12px] leading-5 tracking-[-0.3px] text-red600",children:f.prescription.error}),(0,c.FD)(x.a,{className:"flex gap-2 flex-col lg:flex-row lg:gap-4 lg:items-center",children:[(0,c.Y)("input",{ref:b,type:"file",id:"prescription-upload-input",accept:".png,.jpg,.jpeg,.pdf,.heic,.heif",multiple:!0,onChange:function(e){e.target.files&&e.target.files.length>0&&(k(e.target.files),b.current&&(b.current.value=""))},className:"hidden",disabled:S}),(0,c.FD)(B.B,{variant:"tertiary",fullWidth:!0,size:"lg",onClick:function(){var e;return null===(e=b.current)||void 0===e?void 0:e.click()},disabled:S,className:S?"opacity-50 cursor-not-allowed !w-auto":"!w-auto",children:[(0,c.Y)(j.A,{color:p.w.colors.primaryBase,size:20,className:"mr-2"}),(0,c.Y)("span",{className:"text-[15px] leading-6 tracking-[-0.3px] font-medium ".concat(S?"text-gray400":"text-primaryBase"),children:y({id:"vaccination.payment.prescription_upload_button",defaultMessage:"Upload prescription"})})]}),(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray400",children:y({id:"vaccination.payment.prescription_upload_description_2",defaultMessage:"Max files upload size can be 5MB"})})]}),!v&&(0,c.FD)(x.a,{onClick:function(){var e,n;N.push("/".concat(null===(e=H.y1A[_])||void 0===e?void 0:e.ALL,"/").concat(null===(n=H.y1A[_])||void 0===n?void 0:n.DOCTOR))},className:"bg-neutral50 rounded-xl p-4 flex items-center gap-3 cursor-pointer",children:[(0,c.Y)(W,{className:"min-w-[24px]"}),(0,c.Y)("p",{className:"text-dark text-[13px] leading-5 tracking-[-0.3px]",children:y({id:"vaccination.payment.prescription_upload_description_3",defaultMessage:"Don't have a prescription? Book a tele-consultation with our partner doctors"},{a:function(e){return(0,c.Y)("span",{className:"text-blue900 font-semibold",children:e})}})}),(0,c.Y)(E.A,{className:"min-w-[24px]",color:"#8C8C8C"})]})]})})),W=function(e){var n=e.className;return(0,c.FD)("svg",{width:"24",height:"24",className:n,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,c.FD)("g",{clipPath:"url(#clip0_14688_443)",children:[(0,c.Y)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.9813 12.3885C16.2548 12.3885 16.5056 12.5432 16.628 12.7878L17.7532 15.0404L20.008 16.1688C20.2525 16.2911 20.4071 16.541 20.4073 16.8145C20.4073 17.088 20.2527 17.3388 20.008 17.4612L17.7543 18.5875L16.628 20.8412C16.5056 21.0858 16.2548 21.2405 15.9813 21.2405C15.7079 21.2403 15.458 21.0857 15.3357 20.8412L14.2072 18.5864L11.9546 17.4612C11.71 17.3388 11.5553 17.088 11.5553 16.8145C11.5554 16.5412 11.7102 16.2912 11.9546 16.1688L14.2083 15.0415L15.3357 12.7878L15.3877 12.701C15.5212 12.5076 15.7421 12.3886 15.9813 12.3885ZM15.3932 15.903C15.3233 16.0428 15.2096 16.1565 15.0698 16.2264L13.8925 16.8145L15.0698 17.4037L15.1697 17.4633C15.2638 17.5312 15.3407 17.6212 15.3932 17.7259L15.9813 18.9032L16.5705 17.7259L16.6302 17.6272C16.698 17.533 16.788 17.4561 16.8927 17.4037L18.07 16.8145L16.8927 16.2264C16.7531 16.1565 16.6403 16.0427 16.5705 15.903L15.9813 14.7257L15.3932 15.903Z",fill:"#00B16A"}),(0,c.Y)("path",{d:"M17.0002 3.2218C18.6268 3.2218 19.945 4.54003 19.945 6.16668V12.5556C19.945 12.9544 19.6213 13.2782 19.2224 13.2782C18.8235 13.2782 18.4997 12.9544 18.4997 12.5556V6.16668C18.4997 5.33777 17.8291 4.66711 17.0002 4.66711H7.55572C6.72681 4.66711 6.05615 5.33777 6.05615 6.16668V17.8333C6.05615 18.6623 6.72681 19.3329 7.55572 19.3329H12.5557C12.9546 19.3329 13.2784 19.6567 13.2784 20.0556C13.2784 20.4544 12.9546 20.7782 12.5557 20.7782H7.55572C5.92907 20.7782 4.61084 19.46 4.61084 17.8333V6.16668C4.61084 4.54003 5.92907 3.2218 7.55572 3.2218H17.0002Z",fill:"#00B16A"}),(0,c.Y)("path",{d:"M9.22238 13.7774C9.62126 13.7774 9.94504 14.1011 9.94504 14.5C9.94504 14.8989 9.62126 15.2227 9.22238 15.2227H8.66683C8.26796 15.2227 7.94417 14.8989 7.94417 14.5C7.94417 14.1011 8.26796 13.7774 8.66683 13.7774H9.22238Z",fill:"#00B16A"}),(0,c.Y)("path",{d:"M9.22238 10.444C9.62126 10.444 9.94504 10.7678 9.94504 11.1667C9.94504 11.5656 9.62126 11.8893 9.22238 11.8893H8.66683C8.26796 11.8893 7.94417 11.5656 7.94417 11.1667C7.94417 10.7678 8.26796 10.444 8.66683 10.444H9.22238Z",fill:"#00B16A"}),(0,c.Y)("path",{d:"M13.9446 10.444C14.3435 10.444 14.6673 10.7678 14.6673 11.1667C14.6673 11.5656 14.3435 11.8893 13.9446 11.8893H12.0002C11.6013 11.8893 11.2775 11.5656 11.2775 11.1667C11.2775 10.7678 11.6013 10.444 12.0002 10.444H13.9446Z",fill:"#00B16A"}),(0,c.Y)("path",{d:"M9.22238 7.11069C9.62126 7.11069 9.94504 7.43447 9.94504 7.83335C9.94504 8.23222 9.62126 8.556 9.22238 8.556H8.66683C8.26796 8.556 7.94417 8.23222 7.94417 7.83335C7.94417 7.43447 8.26796 7.11069 8.66683 7.11069H9.22238Z",fill:"#00B16A"}),(0,c.Y)("path",{d:"M15.8891 7.11069C16.2879 7.11069 16.6117 7.43447 16.6117 7.83335C16.6117 8.23222 16.2879 8.556 15.8891 8.556H12.0002C11.6013 8.556 11.2775 8.23222 11.2775 7.83335C11.2775 7.43447 11.6013 7.11069 12.0002 7.11069H15.8891Z",fill:"#00B16A"})]}),(0,c.Y)("defs",{children:(0,c.Y)("clipPath",{id:"clip0_14688_443",children:(0,c.Y)("rect",{width:"20",height:"20",fill:"white",transform:"translate(2 2)"})})})]})};U.displayName="PrescriptionUpload";var G,q,$=U,J=t(42280),K=t(9655),Q=t(96149),X=t(95204),ee=u.i.TextField,ne=(0,d.lazy)((function(){return t.e(3299).then(t.bind(t,43299))})),te={wrapper:{":has(input[data-disabled])":{backgroundColor:X.bm,borderColor:X.AF,color:X.Dp,opacity:1}},input:{fontSize:"15px",letterSpacing:"-0.3px",fontWeight:500,color:"#111111"}},ie={name:{value:"",error:""},idNumber:{value:"",error:""},phone:{value:"",error:""},gender:{value:"male",error:"",touched:!0},age:{value:"",error:""},email:{value:"",error:""},shippingAddressLine:{value:"",error:""},shippingCity:{value:"",error:""},shippingZipCode:{value:"",error:""},shippingCountry:{value:"",error:""},userAddressLine:{value:"",error:""},userCity:{value:"",error:""},userZipCode:{value:"",error:""},userCountry:{value:"",error:""},prescription:{value:"",error:""},creditCardNumber:{value:"",error:""}},re=["name","idNumber","phone","gender","age","email","userAddressLine","userCity","userZipCode","userCountry","creditCardNumber","shippingAddressLine","shippingCity","shippingZipCode","shippingCountry","prescription"],ae=["name","idNumber","phone","gender","age","creditCardNumber","prescription"],le=function(e){var n=e.action,t=(0,S.T)(),i=t.displayDiscountPrice,r=t.displayTotalPrice,a=t.displayTaxPrice,l=t.displayShippingFee,o=t.displayPricePayTenPercentage,s=t.displayPriceRemaining,u=t.displayPriceWithUnitAndQuantity,p=(0,J.Jf)(),f=p.vaccinationDetail,m=p.selectedPaymentValue,h=p.providers,v=(0,L.A)().formatMessage,y=(0,F.$)().locale,b=(0,d.useMemo)((function(){var e=(0,D.ze)(m||""),n=e.provider,t=e.paymentVia,i=e.paymentType;return h.find((function(e){return e.provider===n&&e.payment_via===Number(t)&&e.payment_type===i}))}),[m,h]),C=null===f||void 0===f?void 0:f.hospital_branch.name;return(0,c.FD)(x.a,{"data-testid":"payment-details",className:"bg-white pt-6 px-4 pb-0.5",children:[(0,c.Y)(d.Suspense,{fallback:null,children:(0,c.Y)(ne,{})}),(0,c.Y)("h2",{className:"flex-1 text-[17px] leading-6 tracking-[-0.4px] text-dark font-semibold pb-4",children:v({id:"vaccination.payment.details",defaultMessage:"Payment Details"})}),(0,c.FD)(x.a,{className:"flex justify-between pb-3",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:v({id:(null===K.Y||void 0===K.Y?void 0:K.Y[y])||K.Y[g.L.Vietnam],defaultMessage:"Package price"})}),(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:u})]}),l&&(0,c.FD)(x.a,{className:"flex justify-between py-3 border-t border-solid border-neutral100",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:v({id:"vaccination.payment.shipping_fee",defaultMessage:"Shipping Fee"})}),(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:l})]}),a&&(0,c.FD)(x.a,{className:"flex justify-between py-3 border-t border-solid border-neutral100",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:v({id:"vaccination.payment.tax",defaultMessage:"Tax"})}),(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:a})]}),i&&(0,c.FD)(x.a,{className:"flex justify-between py-3 border-t border-solid border-neutral100",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:v({id:"vaccination.payment.discount",defaultMessage:"Discount"})}),(0,c.FD)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-green600 font-medium",children:["-",i]})]}),(null===b||void 0===b?void 0:b.payment_type)===D.Ai.ten_percent&&(0,c.FD)(c.FK,{children:[(0,c.FD)(x.a,{className:"flex gap-3 justify-between py-3 border-t border-solid border-neutral100",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:v({id:"vaccination.payment.pay_later",defaultMessage:"Pay later (at {hospital_name})"},{hospital_name:C})}),(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium whitespace-nowrap",children:s})]}),(0,c.FD)(x.a,{className:"flex gap-3 justify-between py-3 border-t border-solid border-neutral100",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:v({id:"vaccination.payment.pay_now_only",defaultMessage:"Pay now only"})}),(0,c.Y)("p",{className:"text-[15px] leading-5 lg:leading-6 tracking-[-0.3px] text-dark font-semibold whitespace-nowrap",children:o})]})]}),(null===b||void 0===b?void 0:b.payment_type)===D.Ai.full_payment&&(0,c.FD)(x.a,{className:"flex gap-3 justify-between py-3 border-t border-solid border-neutral100",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:v({id:"vaccination.payment.pay_later_via_installment",defaultMessage:"Pay Later Via Installment"})}),(0,c.Y)("p",{className:"text-[15px] leading-6 tracking-[-0.3px] text-dark font-semibold whitespace-nowrap",children:r})]}),(null===b||void 0===b?void 0:b.payment_type)===D.Ai.one_hundred_percent&&(0,c.FD)(x.a,{className:"flex gap-3 justify-between py-3 border-t border-solid border-neutral100",children:[(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:v({id:"vaccination.payment.pay_now_100",defaultMessage:"Pay now 100%"})}),(0,c.Y)("p",{className:"text-[15px] leading-6 tracking-[-0.3px] text-dark font-semibold whitespace-nowrap",children:r})]}),n]})},oe=(G={},(0,r.A)(G,g.L.Vietnam,"VN"),(0,r.A)(G,g.L.Malaysia,"MY"),G),se=(q={},(0,r.A)(q,g.L.Vietnam,"Vietnam"),(0,r.A)(q,g.L.Malaysia,"Malaysia"),q),ce=(0,d.forwardRef)((function(e,n){var t,u=e.loadingPayment,_=e.backToStepOne,S=e.subscriptionCustomerPrefill,B=e.lockPrefilledCustomerFields,O=e.isHidePaymentDetail,V=e.renderPaymentDetail,j=(0,L.A)().formatMessage,Z=(0,d.useState)(ie),T=Z[0],E=Z[1],I=(0,d.useState)({}),z=I[0],H=I[1],R=(0,d.useState)(!0),U=R[0],W=R[1],G=(0,d.useRef)(null),q=(0,J.Jf)(),K=q.selectedPaymentValue,ne=q.selectedSubPaymentValue,ce=q.providers,de=q.computedPrice,ue=(0,k.i)((function(e){return e.subscriptionSavedCards})),pe=(0,d.useMemo)((function(){var e,n;if(!K||!(0,w.Lo)(K))return"";if(!ne||ne===Y.G)return"";var t=ue.find((function(e){return e.token_id===ne}));return(null===t||void 0===t?void 0:t.cc_no)?t.cc_no:(null===(e=T.creditCardNumber)||void 0===e||null===(n=e.value)||void 0===n?void 0:n.trim())||""}),[K,ne,ue,null===(t=T.creditCardNumber)||void 0===t?void 0:t.value]),fe=(0,M.d)().isMobileOrTablet,me=(0,F.$)().locale,he=(0,d.useMemo)((function(){var e=S;if(!e)return{};var n={},t=!0,i=!1,r=void 0;try{for(var a,l=re[Symbol.iterator]();!(t=(a=l.next()).done);t=!0){var o=a.value,s=e[o];null!=s&&""!==String(s).trim()&&(n[o]=String(s))}}catch(c){i=!0,r=c}finally{try{t||null==l.return||l.return()}finally{if(i)throw r}}return n}),[S]),ge=(0,d.useMemo)((function(){var e=Boolean(B),n=he,t={},i=!0,r=!1,a=void 0;try{for(var l,o=ae[Symbol.iterator]();!(i=(l=o.next()).done);i=!0){var s=l.value,c=n[s];t[s]=e&&null!=c&&""!==String(c).trim()}}catch(d){r=!0,a=d}finally{try{i||null==o.return||o.return()}finally{if(r)throw a}}return t}),[he,B]);(0,d.useEffect)((function(){var e=he;0!==Object.keys(e).length&&(E((function(n){var t=(0,l.A)({},n),i=!0,r=!1,a=void 0;try{for(var s,c=re[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var d=s.value,u=e[d];if(void 0!==u){var p=n[d];p&&(t[d]=(0,o.A)((0,l.A)({},p),{value:u,touched:!0}))}}}catch(f){r=!0,a=f}finally{try{i||null==c.return||c.return()}finally{if(r)throw a}}return t})),e.prescription&&H((function(n){return(0,o.A)((0,l.A)({},n),{File1:{fileObject:null,status:"success",url:e.prescription}})})))}),[he]),(0,d.useImperativeHandle)(n,(function(){return{getFormData:function(){return(0,i.A)((function(){var e;return(0,s.__generator)(this,(function(n){return e=[],Object.keys(z).forEach((function(n){var t=z[n];"success"===(null===t||void 0===t?void 0:t.status)&&t.url&&e.push(t.url)})),[2,(0,o.A)((0,l.A)({},T),{prescriptionUrls:e})]}))}))()},startUploadPrescription:function(){return(0,i.A)((function(){var e,n;return(0,s.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,(0,Q.RL)({prescriptionFiles:z,setPrescriptionFiles:H,formatMessage:j})];case 1:return e=t.sent(),E((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{error:""})})})),[2,e];case 2:throw n=t.sent(),(0,a.A)(n,Q._l)&&E((function(e){return(0,o.A)((0,l.A)({},e),{prescription:(0,o.A)((0,l.A)({},e.prescription),{error:n.message,touched:!0})})})),n;case 3:return[2]}}))}))()},isFormValid:function(){var e=!1;return Object.keys(T).map((function(n){var t=ve(n,T[n].value);console.log("\ud83d\ude80 ~ error:",t,n,T[n].value||"-x"),t&&(e=!0),E((function(e){return(0,o.A)((0,l.A)({},e),(0,r.A)({},n,(0,o.A)((0,l.A)({},e[n]),{value:T[n].value,error:t})))}))})),!e}}}));var ve=function(e,n){return"phone"===e?window.intlTelInputUtils&&window.intlTelInputUtils.isValidNumber(String(n),"vn")?"":"error.pleaseEnterAValidPhone":"idNumber"===e?(0,X.SE)(n,j):"age"===e?Number(n)>=18&&Number(n)===parseInt(n)?"":"error.pleaseEnterAValidAge":["shippingAddressLine","shippingCity","shippingCountry","userAddressLine","userCity","userCountry"].includes(e)?!de.show_delivery_fee&&["shippingAddressLine","shippingCity","shippingCountry"].includes(e)?"":["shippingAddressLine","userAddressLine"].includes(e)?(0,X.tz)(n,j):["shippingCity","userCity"].includes(e)?(0,X.Y$)(n,j):"":"shippingZipCode"===e||"userZipCode"===e?de.show_delivery_fee||"shippingZipCode"!==e?(0,X.b_)(n,j):"":"prescription"===e?de.prescription_required?Object.keys(z).some((function(e){var n=z[e];return n&&(null!==n.fileObject||n.url)}))?"":j({id:"vaccination.payment.prescription.required",defaultMessage:"Please upload at least one prescription file"}):"":"creditCardNumber"===e?"":(0,A.tf)(e,n)},ye=function(e,n){if(!u&&!ge[e]){var t=n;if("idNumber"===e){var i=n.trim(),a=i.replace(/\D/g,"").length,s=/^[\d-]*$/.test(i)&&a<=12;t=me!==g.L.Vietnam&&s?function(e){var n=e.replace(/\D/g,"");return n.length<=6?n:n.length<=8?"".concat(n.slice(0,6),"-").concat(n.slice(6)):"".concat(n.slice(0,6),"-").concat(n.slice(6,8),"-").concat(n.slice(8,12))}(i):i}E((function(n){return(0,o.A)((0,l.A)({},n),(0,r.A)({},e,(0,o.A)((0,l.A)({},n[e]),{value:t,touched:!0})))}))}},xe=function(e){u||E((function(n){return(0,o.A)((0,l.A)({},n),(0,r.A)({},e,(0,o.A)((0,l.A)({},n[e]),{error:ve(e,n[e].value)})))}))},be=function(e,n){if(de.show_delivery_fee)return"all"===e?(ye("shippingAddressLine",T.userAddressLine.value),ye("shippingCity",T.userCity.value),ye("shippingZipCode",T.userZipCode.value),void requestAnimationFrame((function(){T.userAddressLine.value&&xe("shippingAddressLine"),T.userCity.value&&xe("shippingCity"),T.userZipCode.value&&xe("shippingZipCode")}))):void(U&&(ye(e,n),requestAnimationFrame((function(){xe(e)}))))};(0,d.useEffect)((function(){ye("userCountry",se[me]),de.show_delivery_fee&&ye("shippingCountry",se[me]),requestAnimationFrame((function(){xe("userCountry"),xe("shippingCountry")}))}),[de.show_delivery_fee,me]);var Ce=(0,d.useMemo)((function(){var e=(0,D.ze)(K||""),n=e.provider,t=e.paymentVia,i=e.paymentType;return ce.find((function(e){return e.provider===n&&e.payment_via===Number(t)&&e.payment_type===i}))}),[K,ce]),Ae=(0,d.useMemo)((function(){var e;return null===Ce||void 0===Ce||null===(e=Ce.sub_payment_methods)||void 0===e?void 0:e.find((function(e){return e.code===ne}))}),[ne,null===Ce||void 0===Ce?void 0:Ce.sub_payment_methods]),_e=(0,d.useMemo)((function(){return[{value:"Vietnam",label:j({id:"vaccination.payment.field_country_vn",defaultMessage:"Vietnam"})},{value:"Malaysia",label:j({id:"vaccination.payment.field_country_my",defaultMessage:"Malaysia"})}]}),[j]);return(0,c.FD)(c.FK,{children:[(0,c.FD)(x.a,{"data-testid":"customer-info",className:"bg-white pt-6 px-4 pb-4 lg:pb-6",children:[(0,c.Y)("h2",{className:"flex-1 text-[17px] leading-6 tracking-[-0.3px] lg:tracking-[-0.4px] text-dark font-semibold",children:j({id:"vaccination.payment.customer_info",defaultMessage:"Customer's Info"})}),(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray400 mt-1 mb-4",children:j({id:"vaccination.payment.customer_info.desc",defaultMessage:"We need your information to make a booking and contact you later."})}),(0,c.FD)(X.q,{className:"flex gap-3 flex-col",children:[(0,c.Y)(ee,{shrink:!!T.name.touched||!!T.name.value,className:"w-full",children:(0,c.Y)(ee.Control,{children:(0,c.Y)(b.k,{spellCheck:!1,type:"text",id:"name",placeholder:"",value:T.name.value,label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:j({id:"vaccination.payment.field_name"})}),styles:te,error:T.name.error?(0,c.Y)("p",{className:"text-[12px]",children:j({id:T.name.error})}):void 0,onChange:function(e){return ye("name",e.target.value)},onBlur:function(){return xe("name")},disabled:u||Boolean(ge.name)})})}),(0,c.Y)(ee,{shrink:!!T.idNumber.touched||!!T.idNumber.value,className:"w-full",children:(0,c.Y)(ee.Control,{children:(0,c.Y)(b.k,{spellCheck:!1,type:"text",id:"idNumber",placeholder:"",value:T.idNumber.value,label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:j({id:"vaccination.payment.field_id_number",defaultMessage:"ID/Passport number"})}),styles:te,error:T.idNumber.error?(0,c.Y)("p",{className:"text-[12px]",children:j({id:T.idNumber.error})}):void 0,onChange:function(e){return ye("idNumber",e.target.value)},onBlur:function(){return xe("idNumber")},disabled:u||Boolean(ge.idNumber)})})}),(0,c.Y)(ee,{shrink:!!T.phone.touched||!!T.phone.value,children:(0,c.Y)(ee.Control,{children:(0,c.Y)(C.p.Wrapper,{size:"md",className:"form--phone_field",label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:j({id:"vaccination.payment.field_phone"})}),error:T.phone.error?(0,c.Y)("p",{className:"text-[12px]",children:j({id:T.phone.error})}):void 0,children:(0,c.Y)(f.n,{id:"phone",name:"phone",className:"mantine-Input-input",value:T.phone.value,spellCheck:!1,type:"tel",placeholder:" ",defaultCountry:(null===oe||void 0===oe?void 0:oe[me])||"VN",countryCallingCodeEditable:!1,onChange:function(e){return ye("phone",e)},onBlur:function(){return xe("phone")},disabled:u||Boolean(ge.phone)})})})}),(0,c.FD)(x.a,{className:"flex gap-3",children:[(0,c.Y)(ee,{shrink:!!T.gender.touched||!!T.gender.value,className:"flex-1",children:(0,c.Y)(ee.Control,{children:(0,c.Y)(f.S,{id:"gender",label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:j({id:"vaccination.payment.field_gender"})}),name:"gender",searchable:!0,onChange:function(e){return ye("gender",e)},onBlur:function(){return xe("gender")},value:T.gender.value,data:[{value:"male",label:j({id:"vaccination.payment.field_gender_male"})},{value:"female",label:j({id:"vaccination.payment.field_gender_female"})}],rightSection:(0,c.Y)(v.A,{color:p.w.colors.gray600,size:24}),styles:te,disabled:u||Boolean(ge.gender),sx:{"&:has(input[disabled])":{".mantine-Select-wrapper":{backgroundColor:X.bm,borderColor:X.AF,color:X.Dp,opacity:1}}}})})}),(0,c.Y)(ee,{shrink:!!T.age.touched||!!T.age.value,className:"flex-1",children:(0,c.Y)(ee.Control,{children:(0,c.Y)(b.k,{id:"age",label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:j({id:"vaccination.payment.field_age"})}),onChange:function(e){return ye("age",e.target.value)},onBlur:function(){return xe("age")},value:T.age.value,error:T.age.error?(0,c.Y)("p",{className:"text-[12px]",children:j({id:T.age.error})}):void 0,styles:te,placeholder:"",type:"number",disabled:u||Boolean(ge.age)})})})]}),(0,c.Y)(ee,{shrink:!!T.email.touched||!!T.email.value,className:"w-full",children:(0,c.Y)(ee.Control,{children:(0,c.Y)(b.k,{id:"email",type:"text",placeholder:"",label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:j({id:"vaccination.payment.field_email"})}),styles:te,value:T.email.value,error:T.email.error?(0,c.Y)("p",{className:"text-[12px]",children:j({id:T.email.error})}):void 0,onChange:function(e){return ye("email",e.target.value)},onBlur:function(){return xe("email")},disabled:u||Boolean(ge.email)})})}),(0,c.FD)(x.a,{className:"flex flex-col gap-2",children:[(0,c.Y)("p",{className:"text-dark font-semibold text-[15px] leading-6 tracking-[-0.3px] pt-4 md:pt-5",children:j({id:"vaccination.payment.your_address",defaultMessage:"Your address"})}),(0,c.Y)(ee,{shrink:!!T.userAddressLine.touched||!!T.userAddressLine.value,className:"w-full",children:(0,c.Y)(ee.Control,{children:(0,c.Y)(b.k,{spellCheck:!1,type:"text",id:"userAddressLine",placeholder:"",value:T.userAddressLine.value,label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:j({id:"vaccination.payment.field_address_line",defaultMessage:"Address line"})}),styles:te,error:T.userAddressLine.error?(0,c.Y)("p",{className:"text-[12px]",children:T.userAddressLine.error}):void 0,onChange:function(e){ye("userAddressLine",e.target.value),be("shippingAddressLine",e.target.value)},onBlur:function(){return xe("userAddressLine")},disabled:u||Boolean(ge.userAddressLine)})})}),(0,c.Y)(ee,{shrink:!!T.userCity.touched||!!T.userCity.value,className:"w-full",children:(0,c.Y)(ee.Control,{children:(0,c.Y)(b.k,{spellCheck:!1,type:"text",id:"userCity",placeholder:"",value:T.userCity.value,label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:j({id:"vaccination.payment.field_city",defaultMessage:"City"})}),styles:te,error:T.userCity.error?(0,c.Y)("p",{className:"text-[12px]",children:T.userCity.error}):void 0,onChange:function(e){ye("userCity",e.target.value),be("shippingCity",e.target.value)},onBlur:function(){return xe("userCity")},disabled:u||Boolean(ge.userCity)})})}),(0,c.FD)(x.a,{className:"flex gap-3",sx:{"& .mantine-Select-wrapper":{backgroundColor:"#f2f2f2"}},children:[(0,c.Y)(ee,{shrink:!!T.userCountry.touched||!!T.userCountry.value,className:"flex-1 pointer-events-none",children:(0,c.Y)(ee.Control,{children:(0,c.Y)(f.S,{id:"userCountry",label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:j({id:"vaccination.payment.field_country",defaultMessage:"Country"})}),name:"userCountry",disabled:!0,value:T.userCountry.value,data:_e,rightSection:(0,c.Y)(v.A,{color:p.w.colors.gray600,size:24}),styles:te,className:"rounded-lg cursor-not-allowed"})})}),(0,c.Y)(ee,{shrink:!!T.userZipCode.touched||!!T.userZipCode.value,className:"flex-1",children:(0,c.Y)(ee.Control,{children:(0,c.Y)(b.k,{spellCheck:!1,type:"text",id:"userZipCode",placeholder:"",value:T.userZipCode.value,label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:j({id:"vaccination.payment.field_zip_code",defaultMessage:"ZIP / Postal Code"})}),styles:te,error:T.userZipCode.error?(0,c.Y)("p",{className:"text-[12px]",children:T.userZipCode.error}):void 0,onChange:function(e){ye("userZipCode",e.target.value),be("shippingZipCode",e.target.value)},onBlur:function(){return xe("userZipCode")},disabled:u||Boolean(ge.userZipCode)})})})]})]}),de.show_delivery_fee&&(0,c.FD)(x.a,{className:"flex flex-col gap-2",children:[(0,c.Y)("p",{className:"text-dark font-semibold text-[15px] leading-6 tracking-[-0.3px] pt-4 md:pt-5",children:j({id:"vaccination.payment.shipping_address",defaultMessage:"Shipping address"})}),(0,c.Y)(m.S,{id:"shippingAddressSwitch",label:j({id:"vaccination.payment.field_same_as_your_address",defaultMessage:"Same as your address"}),checked:U,onChange:function(e){W(e.target.checked),e.target.checked&&be("all","")},className:"py-[5px]",styles:{track:{width:"30px",minWidth:"30px"},label:{color:p.w.colors.gray700,fontSize:"13px",lineHeight:"20px",letterSpacing:"-0.3px",fontWeight:500}}}),(0,c.Y)(ee,{shrink:!!T.shippingAddressLine.touched||!!T.shippingAddressLine.value,className:N()("w-full",U&&"!hidden"),children:(0,c.Y)(ee.Control,{children:(0,c.Y)(b.k,{spellCheck:!1,type:"text",id:"shippingAddressLine",placeholder:"",value:T.shippingAddressLine.value,label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:j({id:"vaccination.payment.field_address_line",defaultMessage:"Address line"})}),styles:te,error:T.shippingAddressLine.error?(0,c.Y)("p",{className:"text-[12px]",children:T.shippingAddressLine.error}):void 0,onChange:function(e){return ye("shippingAddressLine",e.target.value)},onBlur:function(){return xe("shippingAddressLine")}})})}),(0,c.Y)(ee,{shrink:!!T.shippingCity.touched||!!T.shippingCity.value,className:N()("w-full",U&&"!hidden"),children:(0,c.Y)(ee.Control,{children:(0,c.Y)(b.k,{spellCheck:!1,type:"text",id:"shippingCity",placeholder:"",value:T.shippingCity.value,label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:j({id:"vaccination.payment.field_city",defaultMessage:"City"})}),styles:te,error:T.shippingCity.error?(0,c.Y)("p",{className:"text-[12px]",children:T.shippingCity.error}):void 0,onChange:function(e){return ye("shippingCity",e.target.value)},onBlur:function(){return xe("shippingCity")}})})}),(0,c.FD)(x.a,{className:N()("flex gap-3",U&&"!hidden"),sx:{"& .mantine-Select-wrapper":{backgroundColor:"#f2f2f2"}},children:[(0,c.Y)(ee,{shrink:!!T.shippingCountry.touched||!!T.shippingCountry.value,className:"flex-1 pointer-events-none",children:(0,c.Y)(ee.Control,{children:(0,c.Y)(f.S,{id:"shippingCountry",label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:j({id:"vaccination.payment.field_country",defaultMessage:"Country"})}),name:"shippingCountry",disabled:!0,value:T.shippingCountry.value,data:[{value:"Vietnam",label:j({id:"vaccination.payment.field_country_vn",defaultMessage:"Vietnam"})},{value:"Malaysia",label:j({id:"vaccination.payment.field_country_my",defaultMessage:"Malaysia"})}],rightSection:(0,c.Y)(v.A,{color:p.w.colors.gray600,size:24}),styles:te,className:"rounded-lg cursor-not-allowed"})})}),(0,c.Y)(ee,{shrink:!!T.shippingZipCode.touched||!!T.shippingZipCode.value,className:"flex-1",children:(0,c.Y)(ee.Control,{children:(0,c.Y)(b.k,{spellCheck:!1,type:"text",id:"shippingZipCode",placeholder:"",value:T.shippingZipCode.value,label:(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium",children:j({id:"vaccination.payment.field_zip_code",defaultMessage:"ZIP / Postal Code"})}),styles:te,error:T.shippingZipCode.error?(0,c.Y)("p",{className:"text-[12px]",children:T.shippingZipCode.error}):void 0,onChange:function(e){return ye("shippingZipCode",e.target.value)},onBlur:function(){return xe("shippingZipCode")}})})})]})]}),de.prescription_required&&(0,c.Y)($,{ref:G,isDisableUpload:!!ge.prescription,prescriptionFiles:z,setPrescriptionFiles:H,formData:T,setFormData:E,onValidate:xe,loadingPayment:u})]})]}),Ce&&(0,c.FD)(x.a,{"data-testid":"payment-method-step-2",className:"bg-white pb-5 lg:pb-6",children:[(0,c.FD)(x.a,{className:"flex gap-3 items-center justify-between px-4 pt-6 pb-4",children:[(0,c.Y)("h2",{className:"flex-1 text-[17px] leading-6 tracking-[-0.4px] text-dark font-semibold",children:j({id:"vaccination.payment.method",defaultMessage:"Payment Method"})}),(0,c.FD)("p",{onClick:function(){return _(!0)},className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 font-medium cursor-pointe flex items-center",children:[(0,c.Y)("span",{className:"align-middle",children:j({id:"vaccination.payment.change_method",defaultMessage:"Change method"})}),(0,c.Y)(y.A,{size:16,className:"align-middle"})]})]}),(0,c.Y)(x.a,{className:"px-4",children:(0,c.FD)(x.a,{className:"bg-neutral50 rounded-xl p-4 ",children:[(0,c.FD)("div",{className:"flex items-center gap-2",children:[(0,c.Y)("img",{src:(null===Ae||void 0===Ae?void 0:Ae.logo)||Ce.logo,alt:(null===Ae||void 0===Ae?void 0:Ae.title)||Ce.title,className:"w-6 h-6"}),(0,c.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:(null===Ae||void 0===Ae?void 0:Ae.title)?"".concat(j({id:"vaccination.payment.online_banking"})," - ").concat(null===Ae||void 0===Ae?void 0:Ae.title):Ce.title})]}),(0,w.Lo)(K)&&pe&&(0,c.Y)(x.a,{className:"flex items-center gap-2 pt-3",children:(0,c.Y)(h.T,{size:"title2",fw:700,color:"gray1000",children:(0,P.fQ)(pe)})})]})})]}),fe&&(void 0!==V?V:!O&&(0,c.Y)(le,{}))]})}))}}]);