"use strict";(self.webpackChunkhhgHealthCareV1=self.webpackChunkhhgHealthCareV1||[]).push([[1166],{84655:function(e,t,n){n.d(t,{W:function(){return o}});var i=n(858),a=n(44898),r=n(83776),o={cached:{},clearCached:function(e){console.log(o.cached),Object.keys(o.cached).filter((function(t){return t.startsWith(e)})).forEach((function(e){console.log(e),o.cached[e]=void 0}))},withCached:function(){var e=(0,i.A)((function(e,t){var n,i,l;return(0,r.__generator)(this,(function(r){switch(r.label){case 0:if("waitingTheFirstResponse"===o.cached[e])return[2,new Promise((function(t){var n=(new Date).getTime(),i=setInterval((function(){(new Date).getTime()-n>3e3&&clearInterval(i),"object"===typeof o.cached[e]&&(t(o.cached[e]),clearInterval(i))}),100)}))];if("object"===typeof o.cached[e])return[2,o.cached[e]];o.cached[e]="waitingTheFirstResponse",r.label=1;case 1:return r.trys.push([1,3,,4]),[4,t()];case 2:return n=r.sent(),o.cached[e]=n,setTimeout((function(){o.cached[e]=void 0}),18e5),[2,n];case 3:return i=r.sent(),o.cached[e]=void 0,l=(0,a.A)(i,Error)?i:new Error(String(i)),[2,Promise.reject(l)];case 4:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}()}},39385:function(e,t,n){n.d(t,{dR:function(){return v}});var i=n(858),a=n(44898),r=n(53513),o=n(53455),l=n(83776),c=n(27516),s=n(94886),u=n.n(s),d=n(59850),p=n(84091),f=n(40959),m=function(){try{var e=localStorage.getItem("hhg_subscription_test_token"),t=null===e||void 0===e?void 0:e.trim();return t||null}catch(n){return null}},h=u().create({baseURL:"https://health-care.hellohealthgroup.com/",headers:{accept:"application/json, text/plain, version=2.0.0"}});h.interceptors.request.use((function(e){return f.KVY||console.log("[Api] ".concat(e.baseURL).concat(e.url)),e}),(function(e){var t=(0,a.A)(e,Error)?e:new Error(String(e));return Promise.reject(t)}));var g=function(){var e=(0,i.A)((function(e){var t,n,i,a,c,s,u,d;return(0,l.__generator)(this,(function(l){return t=e.path,n=e.body,i=e.reqCookie,a=(0,p.fK)(t),c=n.card_token_id,s=(0,o.A)(n,["card_token_id"]),u=(0,r.A)({},s,c?{card_token_id:c}:{}),d=m(),[2,(null!=d?(0,p.px)(a,"POST",{data:u,headers:{Authorization:"Bearer ".concat(d)}}):(0,p.T7)(a,"POST",{data:u},i)).then((function(e){return e&&"object"===typeof e?e:null}))]}))}));return function(t){return e.apply(this,arguments)}}(),v={getSubscriptionProduct:function(e){var t,n=e.site,i=void 0===n?c.y["vi-VN"]:n,a=e.plan_key;return h.get((0,p.w5)(d.R.GET_SUBSCRIPTION_PRODUCT,{site:i,plan_key:a})).then((function(e){var n;return null!==(t=null===(n=e.data)||void 0===n?void 0:n._data)&&void 0!==t?t:null})).catch((function(){return null}))},getTeleconsultationSubscriptionData:function(e){var t=e.doctor_id,n=void 0===t?"":t,i=e.schedule_id,a=void 0===i?"":i,r=e.reqCookie,o=(0,p.fK)(d.R.GET_TELECONSULTATION_SUBSCRIPTION_DATA,{doctor_id:n,schedule_id:a}),l=m();return(null!=l?(0,p.px)(o,"GET",{headers:{Authorization:"Bearer ".concat(l)}}):(0,p.T7)(o,"GET",void 0,r)).then((function(e){return e&&"object"===typeof e?e:null}))},getTeleconsultationSubscriptionCards:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).reqCookie,t=(0,p.fK)(d.R.GET_TELECONSULTATION_SUBSCRIPTION_CARDS),n=m(),i=null!=n?(0,p.px)(t,"GET",{headers:{Authorization:"Bearer ".concat(n)}}):(0,p.T7)(t,"GET",void 0,e);return i.then((function(e){return e&&"object"===typeof e?e:null}))},chargeTeleconsultationSubscription:function(e){var t=e.subscription_id,n=e.customer_address,i=e.shipping_address,a=e.email,o=e.card_token_id,l=e.reqCookie;return g({path:d.R.POST_TELECONSULTATION_SUBSCRIPTION_CHARGE,body:(0,r.A)({subscription_id:t,customer_address:n,shipping_address:i,email:a},o?{card_token_id:o}:{}),reqCookie:l})},chargeTeleconsultationSubscriptionWithNewCard:function(e){var t=e.subscription_id,n=e.customer_address,i=e.shipping_address,a=e.email,r=e.reqCookie;return g({path:d.R.POST_TELECONSULTATION_SUBSCRIPTION_CHARGE_WITH_NEW_CARD,body:{subscription_id:t,customer_address:n,shipping_address:i,email:a},reqCookie:r})}}},99187:function(e,t,n){n.d(t,{Pj:function(){return m},Ty:function(){return v},u7:function(){return g}});var i,a,r,o=n(81539),l=n(73884),c=n(84091),s=n(73419),u=n(6442),d=n(35652),p=n(95204),f=function(e){var t=h(e).map((function(e){return e.name}));return t.length>0?t:(null===e||void 0===e?void 0:e.glp1_drug_name)?[e.glp1_drug_name]:[]},m=function(e){return f(e).join(" + ")},h=function(e){return(0,o.A)(null!==(i=null===e||void 0===e?void 0:e.breakdown)&&void 0!==i?i:[]).filter((function(e){return e.name})).sort((function(e,t){return(null!==(a=e.line_no)&&void 0!==a?a:0)-(null!==(r=t.line_no)&&void 0!==r?r:0)}))},g=function(e){return[e.subscription_brand_name,e.subscription_title].filter(Boolean).join(" - ")},v=function(){var e=(0,u.A)().formatMessage,t=(0,s.$)().locale,n=(0,d.i)().teleconsultationSubscription;return(0,l.useMemo)((function(){var i=null===n||void 0===n?void 0:n.order_schedule,a=null===i||void 0===i?void 0:i.find((function(e){return"current"===e.type})),r=m(a),o=f(a).length>1,l=g({subscription_brand_name:null===n||void 0===n?void 0:n.subscription_brand_name,subscription_title:null===n||void 0===n?void 0:n.subscription_title}),s=o?l:[r,null===n||void 0===n?void 0:n.subscription_title].filter(Boolean).join(" - "),u=!(null===i||void 0===i?void 0:i.some((function(e){return"previous"===e.type}))),d=u&&!o?e({id:"subscription.confirm.service_fee_first_month",defaultMessage:"{name} (1st month)"},{name:r}):r,v=(null===a||void 0===a?void 0:a.amount)?(0,c.UN)(a.amount,t):"",_=!!a&&"number"===typeof a.original_price&&a.original_price>a.amount,y=_?(0,c.UN)(a.original_price||0,t):"";return{currentOrder:a,currentOrderBreakdownLines:h(a),currentOrderImage:(null===a||void 0===a?void 0:a.glp1_drug_image_url)||p.XS,currentOrderName:s,isMultiDrug:o,isFirstMonth:u,serviceFeeLabel:d,currentOrderAmount:v,currentOrderOriginalAmount:y,showCurrentOrderOriginalPrice:_}}),[e,t,n])}},35652:function(e,t,n){n.d(t,{i:function(){return r}});var i=n(44745),a=n(95204),r=(0,i.vt)()((function(e,t){return{currentStep:1,quantity:1,setCurrentStep:function(t){return e((function(){return{currentStep:t}}))},setQuantity:function(t){e((function(){return{quantity:t}}))},providers:[],setProviders:function(t){return e((function(){return{providers:t}}))},computedPrice:a.vp,setComputedPrice:function(n){t().computedPrice.unit_price&&!n.unit_price||e((function(){return{computedPrice:n}}))},setSelectedPaymentValue:function(t){return e((function(){return{selectedPaymentValue:t}}))},setSubscriptionProduct:function(t){return e((function(){return{subscriptionProduct:t}}))},setTeleconsultationSubscription:function(t){return e((function(){return{teleconsultationSubscription:t}}))},subscriptionSavedCards:[],subscriptionSavedCardsCount:0,subscriptionSavedCardsMax:0,setSubscriptionSavedCards:function(t){var n=t.cards,i=t.count,a=t.max_cards;return e((function(){return{subscriptionSavedCards:n,subscriptionSavedCardsCount:i,subscriptionSavedCardsMax:a}}))},setOpenOnlineBanking:function(t){return e((function(){return{openOnlineBanking:t}}))},setSelectedSubPaymentValue:function(t){e((function(){return{selectedSubPaymentValue:t}}))}}}))},82187:function(e,t,n){function i(e){return e.flatMap((function(e){return e.split("\n").map((function(e){return e.trim()})).filter(Boolean)}))}function a(e){var t=i(e);return 0===t.length?{title:"",items:[]}:{title:t[0],items:t.slice(1)}}function r(e,t){var n,r=e.subscription_product_content,o=function(e){var t=e.toLowerCase();return"oral"===t||"standard"===t||"accelerate"===t?t:"oral"}(e.plan_key),l=a(r["Sokongan Berterusan"]||[]),c=a(r["Best For"]||[]),s=i(r["Diskaun Komitmen"]||[]).map((function(e){var t=/class=["']discount["']/.test(e);return{text:e.replace(/<[^>]+>/g,"").trim(),isHighlighted:t}})),u=i(r["Bagaimana Pendosan Berfungsi"]||[]),d=(null===(n=r.Subtext)||void 0===n?void 0:n.join(" "))||"";return{planKey:o,tierTitle:t({id:"subscription.payment.mapper.tier_title",defaultMessage:"{tierLabel} Plan"},{tierLabel:e.tier_label}),brandName:e.brand_name,brandSubtext:e.brand_subtext,medication:e.short_description,howDosingWorks:e.outcome_promise,howDosingDetail:u,outcomePromiseTitle:l.title,outcomePromiseItems:l.items,commitmentDiscountLines:s,bundleItems:r["Pakej Rangkuman Semua"]||[],bestForTitle:c.title,bestForBody:c.items.join(" "),pricingDisclaimer:t({id:"subscription.payment.pricingDisclaimer",defaultMessage:"Pricing is variable and depends on prescribed dose/treatment. You will only be charged the actual teleconsultation fee if you are approved for a prescription by the doctor."}),subtext:d}}n.d(t,{O:function(){return r}})},20394:function(e,t,n){n.d(t,{Y:function(){return w}});var i,a=n(38971),r=n(2445),o=n(73),l=n(35291),c=n(12167),s=n(15573),u=n(88411),d=n(92793),p=n(48085),f=n(36814),m=n(94858),h=n(88491),g=n(73419),v=n(6442),_=n(12034),y=(i={},(0,a.A)(i,d.L.Vietnam,{label:"Zalo",icon:s.C.getAssetPath("zalo-mini.png")}),(0,a.A)(i,d.L.Malaysia,{label:"WhatsApp",icon:s.C.getAssetPath("whatsapp.svg")}),i),x="CustomerSupport",b={root:{borderColor:"".concat(l.w.colors.gray200," !important")},label:{color:l.w.colors.gray700,fontSize:(0,p.D)(13),fontWeight:600,lineHeight:(0,p.D)(20),letterSpacing:(0,p.D)(-.3)}},w=function(e){var t=e.className,n=e.style,i=(0,h.d)().isMobile,a=(0,v.A)().formatMessage,l=(0,g.$)(),d=l.locale,p=l.push,w=l.router,N=(0,_.ZN)(),k=N.isOpenPopupCollection,Y=N.setIsOpenPopupCollection,A=N.onSubmitPopupCollection,D=o.Kt[d]||"",F=o.dm[d]||"",P=(null===y||void 0===y?void 0:y[d])||{},C=P.icon,M=P.label,S=w.pathname.includes("subscription");return(0,r.Y)(r.FK,{children:(0,r.FD)(f.a,{className:(0,m.A)(x,"pt-6 pb-7 px-4 bg-white lg:pb-6 lg:rounded-b-2xl",t),style:n,children:[(0,r.Y)("h2",{className:"".concat(x,"__title text-[17px] leading-6 tracking-[-0.4px] text-dark font-semibold mb-4"),children:a({id:"vaccination.payment.customer_support_title",defaultMessage:"Customer Support"})}),(0,r.Y)("p",{className:"".concat(x,"__desc text-[13px] leading-5 tracking-[-0.3px] text-gray700 mb-4 lg:mb-5"),children:a(S?{id:"vaccination.payment.customer_support_desc_whatsapp",defaultMessage:"For any questions or concerns regarding your booking, appointment scheduling, or cancellations, please contact the HelloDokter customer care team via Whatsapp."}:{id:"vaccination.payment.customer_support_desc",defaultMessage:"For any questions or concerns regarding your booking, appointment scheduling, or cancellations, please contact the HelloBacsi customer care team via Zalo or Facebook Messenger."})}),(0,r.FD)("div",{className:"".concat(x,"__footer flex gap-2"),children:[!!D&&!S&&(0,r.Y)(u.B,{"data-testid":"customer_support_button_1",variant:"tertiary",size:"lg",className:"".concat(x,"__button_1 flex-1 min-w-0"),onClick:function(){return p(D)},styles:b,leftIcon:(0,r.Y)("img",{src:s.C.getAssetPath("messenger.png"),className:"w-[23px] h-[23px]"}),children:"Messenger"}),!!C&&!!M&&(0,r.Y)(u.B,{"data-testid":"customer_support_button_2",variant:"tertiary",size:"lg",className:"".concat(x,"__button_2 flex-1 min-w-0"),onClick:function(){"Zalo"!==M?p(F):Y(!0)},styles:b,leftIcon:(0,r.Y)("img",{src:C,className:"w-[23px] h-[23px] rounded-md"}),children:M})]}),(0,r.Y)(c.P,{onOpenChange:Y,isOpen:k,isMobile:i,onSubmit:A})]})})}},60785:function(e,t,n){n.d(t,{F:function(){return p}});var i=n(2445),a=n(63848),r=n(82245),o=n(36814),l=n(32485),c=n.n(l),s=n(73419),u=n(32876),d=n.n(u),p=function(e){var t,n=e.customSize,o=(0,s.$)().locale,l=null===(t=r.L[o])||void 0===t?void 0:t.LOGO_TYPE;return(0,i.Y)(d(),{href:"/",children:(0,i.Y)("a",{href:"/",className:"block text-[0px]",children:(0,i.Y)(a.L,{customSize:n,type:l})})})};t.A=function(e){var t=e.className,n=e.customSize;return(0,i.Y)(o.a,{className:c()("p-4 sticky top-0 bg-white z-10",t),children:(0,i.Y)(p,{customSize:n})})}},86706:function(e,t,n){n.d(t,{T:function(){return c}});var i=n(73884),a=n(84091),r=n(73419),o=n(6442),l=n(42280),c=function(){var e=(0,r.$)().locale,t=(0,o.A)().formatMessage,n=(0,l.Jf)(),c=n.vaccinationDetail,s=n.computedPrice,u=n.quantity,d=(c||{}).price_unit,p=void 0===d?"":d,f=(0,i.useCallback)((function(n,i,r){return"%"===n&&i?"".concat(r,"%"):i?(0,a.nd)(t,(0,a.$g)(i,e),p):""}),[p,e]),m=(0,i.useCallback)((function(n,i,r){return n?(0,a.nd)(t,(0,a.$g)(i,e),r):""}),[e]),h=(0,i.useMemo)((function(){return m(s.show_delivery_fee,s.delivery_fee,s.delivery_fee_currency)}),[s.delivery_fee,s.delivery_fee_currency,e]);if(!c)return{quantity:1,displayTotalPrice:"",displayShippingFee:"",displayPriceWithUnit:"",displayDiscountPrice:"",displayDiscountReferral:"",displayTaxPrice:"",displayPricePayTenPercentage:"",displayPriceRemaining:"",displayPriceWithUnitAndQuantity:"",getDisplayTaxPrice:f,getDisplayDeliveryFee:m};var g=(0,a.nd)(t,(0,a.$g)(s.final_price,e),p),v=(0,a.nd)(t,(0,a.$g)(s.original_price,e),p),_="".concat((0,a.nd)(t,(0,a.$g)(s.unit_price,e),p)," X ").concat(u);return{quantity:u,displayTotalPrice:g,displayShippingFee:h,displayPriceWithUnit:v,displayDiscountPrice:s.voucher_discount_value+s.referral_discount_value>0?(0,a.nd)(t,(0,a.$g)(s.voucher_discount_value+s.referral_discount_value,e),p):"",displayDiscountReferral:(0,a.nd)(t,(0,a.$g)(s.referral_discount_value,e),p),displayTaxPrice:f(s.tax_unit,s.tax_computed,s.tax_amount),displayPricePayTenPercentage:(0,a.nd)(t,(0,a.$g)(Math.floor(.1*s.final_price)),p),displayPriceRemaining:(0,a.nd)(t,(0,a.$g)(s.final_price-Math.floor(.1*s.final_price)),p),getDisplayTaxPrice:f,getDisplayDeliveryFee:m,displayPriceWithUnitAndQuantity:_}}},9934:function(e,t,n){n.d(t,{A:function(){return N},e:function(){return w}});var i=n(53513),a=n(53455),r=n(2445),o=n(73884),l=n(35291),c=n(39450),s=n(1657),u=n(36814),d=n(94858),p=n(51387),f=n(48085),m=n(73827),h=n(30686),g=n(73419),v=n(6442),_=n(42280),y=n(95204),x=function(e){var t=e.collapsed,n=void 0===t||t,i=e.content,a=e.className,o=e.style,l=(0,v.A)().formatMessage,c=(null===i||void 0===i?void 0:i.split("\n").filter(Boolean))||[];if(!c.length)return null;if(1===(null===c||void 0===c?void 0:c.length))return(0,r.Y)("p",{className:(0,d.A)(a,"payment__listItemDescription text-[13px] leading-5 tracking-[-0.3px] text-gray700 [&>b]:text-green600"),style:o,dangerouslySetInnerHTML:{__html:c[0]}});var s=l({id:"vaccination.payment.offers_number",defaultMessage:"{number} offers"},{number:c.length});return(0,r.FD)("div",{className:(0,d.A)(a,"payment__listItemDescription text-[13px] leading-5 tracking-[-0.3px] text-gray700"),style:o,children:[n&&(0,r.Y)("span",{className:"text-green600",children:s}),!n&&(0,r.Y)("ul",{className:"payment__listItemDescription-list mt-1",children:c.map((function(e,t){return(0,r.Y)("li",{dangerouslySetInnerHTML:{__html:e},className:(0,d.A)("[&>b]:text-green600 pl-5 relative [&~&]:mt-1","before:content-[''] before:w-[4px] before:h-[4px] before:bg-dark before:absolute before:top-[8px] before:left-[6px] before:rounded-[50%]")},"".concat(e,"-").concat(t))}))})]})},b=n(24360);function w(e){var t=e.provider,n=e.payment_via,i=e.payment_type,a=e.title;return"".concat(t,"-").concat(n,"-").concat(i,"-").concat(a)}var N=function(e){var t=e.loading,n=e.options,N=e.defaultValue,k=e.onChange,Y=e.className,A=e.style,D=(0,g.$)(),F=(0,_.Jf)(),P=F.selectedPaymentValue,C=F.setSelectedPaymentValue,M=F.openOnlineBanking,S=F.setOpenOnlineBanking,T=F.selectedSubPaymentValue,O=F.setSelectedSubPaymentValue,E=(0,v.A)().formatMessage,R=(0,o.useMemo)((function(){var e,t=null===n||void 0===n?void 0:n.find((function(e){return P===w(e)}));return t&&(null===(e=t.sub_payment_methods)||void 0===e?void 0:e.length)?(T||S(!0),t.sub_payment_methods.filter((function(e){return e.is_active}))):[]}),[P]),L=(0,o.useMemo)((function(){return R.find((function(e){return e.code===T}))}),[T,R]),I=(0,o.useCallback)((function(e){C(e),O(""),null===k||void 0===k||k(e)}),[n,k]),j=(0,o.useCallback)((function(){S(!1),T||I("")}),[T,I]),V=(0,o.useCallback)((function(e){S(!1),O("".concat(e))}),[]);return t?(0,r.FD)(u.a,{className:(0,d.A)(Y,"payment__list","p-4 flex flex-col gap-2","border border-solid border-[rgba(0,0,0,0.1)] rounded-xl"),children:[(0,r.FD)("label",{className:"payment__listItem flex justify-between py-2",children:[(0,r.Y)(p.E,{width:24,height:24,radius:3,mr:(0,f.D)(8)}),(0,r.FD)("div",{className:"flex-1 min-w-0",children:[(0,r.Y)(p.E,{width:"100%",height:18,radius:5}),(0,r.Y)(p.E,{width:"30%",height:16,radius:5,mt:4})]}),(0,r.Y)(p.E,{width:16,height:16,circle:!0,ml:(0,f.D)(12)})]}),(0,r.Y)(m.c,{color:"rgba(0,0,0,0.1)"}),(0,r.FD)("label",{className:"payment__listItem flex justify-between py-2",children:[(0,r.Y)(p.E,{width:24,height:24,radius:3,mr:(0,f.D)(8)}),(0,r.FD)("div",{className:"flex-1 min-w-0",children:[(0,r.Y)(p.E,{width:"100%",height:18,radius:5}),(0,r.Y)(p.E,{width:"30%",height:16,radius:5,mt:4})]}),(0,r.Y)(p.E,{width:16,height:16,circle:!0,ml:(0,f.D)(12)})]}),(0,r.Y)(m.c,{color:"rgba(0,0,0,0.1)"}),(0,r.FD)("label",{className:"payment__listItem flex justify-between py-2",children:[(0,r.Y)(p.E,{width:24,height:24,radius:3,mr:(0,f.D)(8)}),(0,r.FD)("div",{className:"flex-1 min-w-0",children:[(0,r.Y)(p.E,{width:"100%",height:18,radius:5}),(0,r.Y)(p.E,{width:"30%",height:16,radius:5,mt:4})]}),(0,r.Y)(p.E,{width:16,height:16,circle:!0,ml:(0,f.D)(12)})]})]}):n&&n.length?(0,r.FD)(r.FK,{children:[(0,r.Y)(h.s.Group,{defaultValue:N,value:P,onChange:I,className:(0,d.A)(Y,"payment__list","p-4 flex flex-col gap-2","border border-solid border-[rgba(0,0,0,0.1)] rounded-xl"),style:A,children:n.map((function(e,t){var i,a=e.logo,p=e.title,g=e.description,v=e.provider,_=a||(null===y.pf||void 0===y.pf?void 0:y.pf[v])||y.uY.HHG,b=w(e),N=D.pathname.includes("teleconsultation")?e.discount:void 0;return(0,r.FD)(o.Fragment,{children:[(0,r.FD)("label",{className:"payment__listItem flex justify-between py-2 cursor-pointer",children:[(0,r.Y)("img",{src:_,alt:p,className:(0,d.A)("payment__listItemLogo","w-6 h-6 object-contain object-center mr-3")}),(0,r.FD)("div",{className:"payment__listItemContent flex-1 min-w-0 mr-4",children:[(0,r.Y)("p",{className:"payment__listItemTitle text-[15px] leading-6 tracking-[-0.3px] font-medium text-dark mb-0",children:p}),(null===N||void 0===N?void 0:N.has_discount)||(null===N||void 0===N?void 0:N.badge_label)||a.includes("CreditDebitCard")?(0,r.Y)(x,{content:"".concat((null===N||void 0===N?void 0:N.badge_label)||g,""),collapsed:!1,className:"font-medium"}):(0,r.Y)(x,{content:g,collapsed:b!==P})]}),(0,r.Y)(h.s,{value:b,checked:b===P,styles:{root:{marginTop:(0,f.D)(2)},radio:{width:(0,f.D)(16),height:(0,f.D)(16)},icon:{color:l.w.colors.primary600}}})]}),!!(null===(i=e.sub_payment_methods)||void 0===i?void 0:i.length)&&L&&(0,r.FD)(u.a,{className:"bg-neutral50 rounded-xl flex items-center gap-2 flex-col lg:flex-row p-3 lg:p-4 -mt-2",children:[(0,r.FD)(u.a,{className:"flex gap-3 items-center flex-1 min-w-full w-full md:min-w-0 text-gray900 text-[13px] leading-5 tracking-[-0.3px] font-medium",children:[(0,r.Y)("img",{src:null===L||void 0===L?void 0:L.logo,className:"w-8 h-6"}),(0,r.Y)("p",{className:"m-0 flex-1 min-w-0",children:null===L||void 0===L?void 0:L.title})]}),(0,r.Y)(m.c,{color:"rgba(0,0,0,0.1)",className:"border-[rgba(0,0,0,0.1)] border-[0.7px] w-full lg:hidden"}),(0,r.FD)(c.b,{onClick:function(){return S(!0)},className:"flex items-center text-primary600 !text-[13px] !leading-5 tracking-[-0.3px] cursor-pointer",children:[E({id:"vaccination.payment.change_method",defaultMessage:"Change method"}),(0,r.Y)(s.A,{size:"1em",color:"currentColor"})]})]}),t!==n.length-1&&(0,r.Y)(m.c,{color:"rgba(0,0,0,0.1)"})]},"".concat(e.title,"-").concat(t))}))}),(0,r.Y)(b.R,{open:M,onOpen:j,options:R.map((function(e){var t=e.title,n=e.code,r=(0,a.A)(e,["title","code"]);return(0,i.A)({label:t,value:n},r)})),value:"".concat(T),itemRender:function(e){return(0,r.FD)(u.a,{className:"flex gap-3 items-center flex-1 min-w-full w-full md:min-w-0 text-gray900 text-[13px] leading-5 tracking-[-0.3px] font-medium",children:[(0,r.Y)("img",{src:null===e||void 0===e?void 0:e.logo,className:"w-8 h-6"}),(0,r.Y)("p",{className:"m-0 flex-1 min-w-0",children:null===e||void 0===e?void 0:e.label})]})},onChange:V})]}):null}},63231:function(e,t,n){n.d(t,{A:function(){return d}});var i=n(53513),a=n(63538),r=n(2445),o=n(73884),l=n(36814),c=n(94858),s=n(35291),u=function(e){var t=e||{},n=t.w,l=t.h,u=t.active,d=t.className,p=t.style,f=(0,o.useMemo)((function(){return{width:n+2,height:l+2,viewBox:"0 0 ".concat(n+2," ").concat(l+2),className:(0,c.A)(d,"absolute z-[-1] inset-x-[-32px] top-[-1px] pointer-events-none"),style:p,xmlns:"http://www.w3.org/2000/svg"}}),[n,l,d,p]),m=(0,o.useMemo)((function(){if(!u)return"M0 56 H".concat(n+1," V").concat(l," H0 Z");var e=u.w,t=u.h,i=u.x,a=u.y,r=12,o=4/3*(Math.sqrt(2)-1)*r;return"M0,".concat(a+l,"\n\t\t\tV").concat(a+t,"\n\t\t\tH").concat(i-r,"\n\t\t\tC").concat(i-r+o,",").concat(a+t," ").concat(i,",").concat(a+t-o," ").concat(i,",").concat(a+t-r,"\n\t\t\tV").concat(a+r+1,"\n\t\t\tC").concat(i,",").concat(a+r+1-o," ").concat(i+o,",").concat(a+1," ").concat(i+r,",").concat(a+1,"\n\t\t\tH").concat(i+e-r,"\n\t\t\tC").concat(i+e-o,",").concat(a+1," ").concat(i+e,",").concat(a+r+1-o," ").concat(i+e,",").concat(a+r+1,"\n\t\t\tV").concat(t-r,"\n\t\t\tC").concat(i+e,",").concat(a+t-o," ").concat(i+e+r-o,",").concat(a+t," ").concat(i+e+r,",").concat(a+t,"\n\t\t\tH").concat(n+2,"\n\t\t\tV").concat(l+2,"\n\t\t\tH0\n\t\t\tZ")}),[n,l,null===u||void 0===u?void 0:u.x,null===u||void 0===u?void 0:u.y,null===u||void 0===u?void 0:u.w,null===u||void 0===u?void 0:u.h]);return(0,r.FD)("svg",(0,a.A)((0,i.A)({},f),{children:[(0,r.Y)("path",{d:m,fill:"white",stroke:s.w.colors.neutral100,strokeWidth:"1"}),(0,r.FD)("defs",{children:[(0,r.FD)("linearGradient",{id:"line__gradient",x1:(null===u||void 0===u?void 0:u.x)||0,y1:1,x2:((null===u||void 0===u?void 0:u.x)||0)+((null===u||void 0===u?void 0:u.w)||0),y2:1,gradientUnits:"userSpaceOnUse",colorInterpolation:"linearRGB",children:[(0,r.Y)("stop",{offset:"0%",stopColor:s.w.colors.neutral100,stopOpacity:"0"}),(0,r.Y)("stop",{offset:"50%",stopColor:s.w.colors.primary600,stopOpacity:"0.5"}),(0,r.Y)("stop",{offset:"100%",stopColor:s.w.colors.neutral100,stopOpacity:"0"})]}),(0,r.FD)("radialGradient",{id:"ellipse__radial",cx:"50%",cy:"50%",r:"50%",gradientTransform:"translate(0.5,0.5) scale(1,0.6) translate(-0.5,-0.5)",children:[(0,r.Y)("stop",{offset:"0%",stopColor:s.w.colors.primary600,stopOpacity:"0.1"}),(0,r.Y)("stop",{offset:"100%",stopColor:"white",stopOpacity:"0"})]})]}),(0,r.Y)("line",{fill:"none",stroke:"url(#line__gradient)",strokeWidth:"1",x1:(null===u||void 0===u?void 0:u.x)||0,y1:1,x2:((null===u||void 0===u?void 0:u.x)||0)+((null===u||void 0===u?void 0:u.w)||0),y2:1}),(0,r.Y)("rect",{x:(null===u||void 0===u?void 0:u.x)||0,y:-"".concat(((null===u||void 0===u?void 0:u.h)||0)/2),width:(null===u||void 0===u?void 0:u.w)||0,height:(null===u||void 0===u?void 0:u.h)||0,fill:"url(#ellipse__radial)"})]}))},d=function(e){var t=e.tabs,n=e.defaultTab,s=e.currentTab,d=e.onChangeTab,p=e.className,f=e.style,m=(0,o.useState)(n||s),h=m[0],g=m[1],v=(0,o.useRef)({}),_=(0,o.useRef)(null),y=(0,o.useState)(null),x=y[0],b=y[1],w=(0,o.useState)({w:1600,h:72}),N=w[0],k=w[1],Y=(0,o.useCallback)((function(e){requestAnimationFrame((function(){var t,n=v.current[e],i=_.current,a=null===i||void 0===i||null===(t=i.children)||void 0===t?void 0:t[0];n&&i&&a&&i.offsetWidth=m&&"after:content-[''] after:absolute after:h-[1px] after:bg-neutral100 after:bottom-[0.5px]",{"text-gray700":d!==h},{"payment__tabsNav-nav-active text-blue600":d===h}),"data-testid":d,onClick:A(d),sx:function(){return{"&::after":{width:"".concat(g,"px"),right:"-".concat(g+16,"px")}}},children:[d===h&&(0,r.Y)(u,(0,a.A)((0,i.A)({},N),{active:x,className:"payment__tabsNav-svg"})),s]})},"".concat(d,"-").concat(n))}))})})})}):null}},37680:function(e,t,n){n.d(t,{Ai:function(){return w},Ay:function(){return k},ze:function(){return N}});var i=n(40568),a=n(81539),r=n(2445),o=n(73884),l=n(4174),c=n(36814),s=n(51387),u=n(48085),d=n(84655),p=n(59850),f=n(84091),m=n(73419),h=n(6442),g=n(42280),v=n(9934),_=n(63231),y=n(94858),x=function(e){var t=e.icon,n=e.titleComponent,i=e.rightComponent,a=e.className,o=e.style;return t||n||i?(0,r.FD)(c.a,{className:(0,y.A)(a,"payment__warningBox","p-3 flex gap-2 items-center justify-between bg-yellow50","border border-solid border-yellow200 rounded-xl"),style:o,children:[!!t&&(0,r.Y)("img",{src:t,className:"payment__warningBoxIcon w-5 h-5 leading-none"}),!!n&&(0,r.Y)("div",{className:"payment__warningBoxContent flex-1 min-w-0 text-[13px] font-semibold leading-5 tracking-[-0.3px]",children:n}),!!i&&(0,r.Y)("p",{className:"payment__warningBoxPrice text-gray900 font-semibold text-[15px] leading-6 tracking-[-0.3px]",children:i})]}):null},b=n(40959),w={ten_percent:"10_percent",one_hundred_percent:"100_percent",full_payment:"full_payment"};function N(e){var t=(0,i.A)(e.split("-"),4);return{provider:t[0],paymentVia:t[1],paymentType:t[2],providerTitle:t[3]}}var k=function(e){var t=e.loadingPrice,n=e.displayPricePayNow,i=e.displayPriceRemaining,y=(0,m.$)().locale,N=(0,h.A)().formatMessage,k=(0,o.useState)(!0),Y=k[0],A=k[1],D=(0,o.useState)(),F=D[0],P=D[1],C=(0,g.Jf)(),M=C.providers,S=C.setProviders,T=C.selectedPaymentValue,O=C.vaccinationDetail,E=(0,o.useMemo)((function(){var e=M.filter((function(e){return"10_percent"===e.payment_type})),t=M.filter((function(e){return"full_payment"===e.payment_type})),n=M.filter((function(e){return"100_percent"===e.payment_type}));return{ten_percent:e,full_payment:t,one_hundred_percent:n}}),[M]),R=(0,o.useMemo)((function(){return(0,a.A)(E.full_payment).concat((0,a.A)(E.one_hundred_percent))}),[E]),L=(0,o.useMemo)((function(){var e,t,n,i=[];(E.ten_percent.length&&i.push({label:E.ten_percent[0].display_label||N({id:"vaccination.payment.tabs.pay_10_percent",defaultMessage:"Pay 10% to Book"}),value:w.ten_percent}),(null===(e=E.one_hundred_percent)||void 0===e?void 0:e.length)||(null===(t=E.full_payment)||void 0===t?void 0:t.length))&&i.push({label:(null===(n=E.one_hundred_percent[0])||void 0===n?void 0:n.display_label)||N({id:"vaccination.payment.tabs.pay_100_percent",defaultMessage:"Pay 100%"}),value:w.one_hundred_percent});return i}),[E.ten_percent,E.one_hundred_percent,E.full_payment]);return(0,o.useEffect)((function(){var e;(null===O||void 0===O||null===(e=O.organization)||void 0===e?void 0:e.id)&&(A(!0),d.W.withCached(p.R.GET_VACCINATION_PAYMENT_PROVIDER,(function(){var e;return(0,f.px)((0,f.fK)(p.R.GET_VACCINATION_PAYMENT_PROVIDER,{locale:String(y),hospitalId:null===O||void 0===O||null===(e=O.organization)||void 0===e?void 0:e.id}),"GET")})).then((function(e){var t,n;(null===e||void 0===e||null===(t=e.data)||void 0===t||null===(n=t.items)||void 0===n?void 0:n.length)&&(S(e.data.items),A(!1))})))}),[null===O||void 0===O?void 0:O.id]),(0,o.useMemo)((function(){if(L.length){var e=null===L||void 0===L?void 0:L[0].value;T&&T.includes(w.ten_percent)&&(e=w.ten_percent),T&&(T.includes(w.full_payment)||T.includes(w.one_hundred_percent))&&(e=w.one_hundred_percent),P(e)}}),[L,T]),(0,r.Y)("div",{id:"payment-method-step-1",className:"paymentMethod",children:E.ten_percent.length>0?(0,r.FD)(r.FK,{children:[(0,r.Y)(_.A,{tabs:L,currentTab:F,onChangeTab:P}),(0,r.FD)(c.a,{className:"pt-[14px] bg-white",children:[F==w.ten_percent&&(0,r.FD)(c.a,{className:"px-4 pb-5 lg:pb-6",children:[(0,r.Y)(x,{icon:"".concat(b.JpE,"/svg/coin.svg"),titleComponent:N({id:"vaccination.payment.warning.pay_now",defaultMessage:"Pay Now ({number})"},{number:"10%"}),rightComponent:t?(0,r.Y)(s.E,{width:"100%",height:(0,u.D)(24)}):n}),(0,r.Y)("p",{className:"mt-2 text-gray700 text-[13px] leading-5 tracking-[-0.3px]",children:N({id:"vaccination.payment.notice.remaining",defaultMessage:"You\u2019ll pay the remaining {percent} of the amount ({price}) at the clinic when you get the vaccine."},{percent:"90%",price:t?(0,r.Y)(s.E,{width:"50px"}):i})}),(0,r.Y)(v.A,{loading:Y,options:E.ten_percent,className:"mt-4"})]}),F==w.one_hundred_percent&&(0,r.Y)(c.a,{className:"px-4 pb-5 lg:pb-6",children:(0,r.Y)(v.A,{loading:Y,options:R})})]})]}):(0,r.FD)(c.a,{className:"flex flex-col rounded-2xl bg-white py-6 px-4 gap-4",children:[(0,r.Y)(c.a,{className:"flex items-center",children:(0,r.Y)(l.T,{size:"title1",fw:600,color:"gray1000",children:N({id:"subscription.payment.payment_method",defaultMessage:"Payment Method"})})}),(0,r.Y)(v.A,{loading:Y,options:R})]})})}},71166:function(e,t,n){n.d(t,{A:function(){return pe}});var i=n(858),a=n(53513),r=n(63538),o=n(83776),l=n(2445),c=n(73884),s=n(35291),u=n(15573),d=n(88411),p=n(92793),f=n(86436),m=n(36814),h=n(94858),g=n(59850),v=n(14265),_=n(39385),y=n(84091),x=n(32485),b=n.n(x),w=n(74353),N=n.n(w),k=n(88491),Y=n(23093),A=n(67722),D=function(e){var t,n=(0,Y.a)();if("success"===(null===e||void 0===e||null===(t=e.transaction)||void 0===t?void 0:t.status)){var i=n.getHref();if(i){var a,r=(0,A.VG)(i);r!==(null===e||void 0===e||null===(a=e.snapshot_order)||void 0===a?void 0:a.product_id)&&null!==r||n.resetHref()}}},F=n(73419),P=n(6442),C=n(36259),M=n(12034),S=n(92047),T=n(20394),O=n(60785),E=n(44898),R=n(81539),L=n(41543);function I(e,t){return j.apply(this,arguments)}function j(){return(j=(0,i.A)((function(e,t){return(0,o.__generator)(this,(function(n){switch(n.label){case 0:return e&&0!==t.length?window.location.href.includes("localhost")?[4,new Promise((function(e){return setTimeout(e,500)}))]:[3,2]:[2,!1];case 1:return n.sent(),[2,!0];case 2:return[4,(0,y.px)((0,y.fK)(g.R.POST_ORDER_PRESCRIPTIONS,{hhgToken:e}),"POST",{data:{prescription_urls:t}})];case 3:return[2,null!==n.sent()]}}))}))).apply(this,arguments)}var V=function(e){var t=e.className;return(0,l.FD)("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,l.Y)("path",{d:"M8 2V6",stroke:"#4D8DFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.Y)("path",{d:"M16 2V6",stroke:"#4D8DFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.Y)("path",{d:"M19 4H5C3.89543 4 3 4.89543 3 6V20C3 21.1046 3.89543 22 5 22H19C20.1046 22 21 21.1046 21 20V6C21 4.89543 20.1046 4 19 4Z",stroke:"#4D8DFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.Y)("path",{d:"M3 10H21",stroke:"#4D8DFF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})},B=function(e){var t=e.className;return(0,l.FD)("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,l.Y)("path",{d:"M8.00016 14.6673C11.6821 14.6673 14.6668 11.6825 14.6668 8.00065C14.6668 4.31875 11.6821 1.33398 8.00016 1.33398C4.31826 1.33398 1.3335 4.31875 1.3335 8.00065C1.3335 11.6825 4.31826 14.6673 8.00016 14.6673Z",stroke:"#009E5C",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.Y)("path",{d:"M6 7.99935L7.33333 9.33268L10 6.66602",stroke:"#009E5C",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})]})},U=function(e){return"submit_prescription_".concat(e)},z=function(e){return"submit_prescription_files_".concat(e)},G=["File1","File2","File3"],W=["image/png","image/jpeg","image/jpg","application/pdf","image/heic","image/heif"],q="prescription_01.jpeg",H=function(e){if(e.fileObject)return e.fileObject.name;if(e.url){var t,n=e.url.match(/([^/?#]+\.(?:png|jpg|jpeg|pdf|heic|heif|webp))(?=$|[?#])/i);return null!==(t=null===n||void 0===n?void 0:n[1])&&void 0!==t?t:q}return q},$=function(e){return W.includes(e.type)||e.name.toLowerCase().endsWith(".heic")||e.name.toLowerCase().endsWith(".heif")},K=function(e){return"".concat(e.name,"_").concat(e.size)},J=function(e){var t=new Set;return G.forEach((function(n){var i=e[n];(null===i||void 0===i?void 0:i.fileObject)&&t.add(K(i.fileObject))})),t},Z=n(96149),X=function(e){var t=e.teleconsultationUrl,n=e.paymentToken,r=(0,P.A)().formatMessage,u=(0,k.d)().isMobileOrTablet,p=(0,c.useContext)(C.B).pushNotifications,f=(0,c.useRef)(null),h=(0,c.useState)({}),g=h[0],v=h[1],_=(0,c.useState)(!1),y=_[0],x=_[1],b=(0,c.useState)([]),w=b[0],N=b[1],Y=(0,c.useState)(!1),A=Y[0],D=Y[1];(0,c.useEffect)((function(){n&&function(e){if(!e)return!1;try{return"true"===sessionStorage.getItem(U(e))}catch(t){return!1}}(n)&&(x(!0),N(function(e){if(!e)return[];try{var t=sessionStorage.getItem(z(e));if(!t)return[];var n=JSON.parse(t);return Array.isArray(n)?n.filter((function(e){return"string"===typeof e})):[]}catch(i){return[]}}(n)))}),[n]);var F=(0,c.useCallback)((function(e){var t=!0,n=!1,i=void 0;try{for(var a,r=G[Symbol.iterator]();!(t=(a=r.next()).done);t=!0){var o=a.value;if(!e[o])return o}}catch(l){n=!0,i=l}finally{try{t||null==r.return||r.return()}finally{if(n)throw i}}return null}),[]),M=(0,c.useCallback)((function(e){return G.filter((function(t){var n,i;return(null===(n=e[t])||void 0===n?void 0:n.fileObject)||(null===(i=e[t])||void 0===i?void 0:i.url)}))}),[]),S=(0,c.useCallback)(function(){var e=(0,i.A)((function(e,t){var i,a,l,c,s,u;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:if(!n||0===t.length)return[2];D(!0),i=e,o.label=1;case 1:return o.trys.push([1,4,5,6]),a=function(e){i="function"===typeof e?e(i):e,v(i)},[4,(0,Z.RL)({prescriptionFiles:i,setPrescriptionFiles:a,formatMessage:r,fileKeys:t})];case 2:return o.sent(),l=(0,Z.d9)(i),[4,I(n,l)];case 3:return o.sent()?(c=t.map((function(e){var t=i[e];return t?H(t):null})).filter((function(e){return Boolean(e)})),N((function(e){var t=y?(0,R.A)(e).concat((0,R.A)(c.filter((function(t){return!e.includes(t)})))):G.reduce((function(e,t){var n=i[t];return("success"===(null===n||void 0===n?void 0:n.status)||(null===n||void 0===n?void 0:n.url))&&e.push(H(n)),e}),[]);return function(e,t){if(e)try{sessionStorage.setItem(U(e),"true"),sessionStorage.setItem(z(e),JSON.stringify(t))}catch(n){}}(n,t),t})),x(!0),[3,6]):(p({message:r({id:"vaccination.payment.one_more_step.attach_failed",defaultMessage:"Failed to submit prescription. Please try again."}),type:"danger"}),[2]);case 4:return s=o.sent(),u=(0,E.A)(s,Z._l)?s.message:r({id:"vaccination.payment.prescription.uploadError",defaultMessage:"Failed to upload prescription files. Please try again."}),p({message:u,type:"danger"}),[3,6];case 5:return D(!1),[7];case 6:return[2]}}))}));return function(t,n){return e.apply(this,arguments)}}(),[r,y,n,p]),T=function(){var e=(0,i.A)((function(e){var t,n,i,l,c,s,u,d,f,m,h,_,x;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:if(!(null===(t=e.target.files)||void 0===t?void 0:t.length)||A)return[2];if(n=Array.from(t),i=y?w.length:M(g).length,l=function(e){var t=e.files,n=e.currentFileCount,i=e.existingFileSignatures,a=e.existingFileNames,r=e.formatMessage;if(0===t.length)return null;if(n+t.length>3)return r({id:"vaccination.payment.prescription.maxFilesExceeded",defaultMessage:"Maximum 3 files/images allowed"});var o=new Set,l=!0,c=!1,s=void 0;try{for(var u,d=t[Symbol.iterator]();!(l=(u=d.next()).done);l=!0){var p=u.value,f=K(p);if(i.has(f)||o.has(f)||a.includes(p.name))return r({id:"vaccination.payment.prescription.duplicateFile",defaultMessage:'File "{fileName}" has already been selected'},{fileName:p.name});if(o.add(f),p.size>5242880)return r({id:"vaccination.payment.prescription.fileTooLarge",defaultMessage:"File size must be less than 5MB"});if(!$(p))return r({id:"vaccination.payment.prescription.invalidFileType",defaultMessage:"Invalid file type. Only PNG, JPG, JPEG, PDF, HEIC, HEIF are allowed"})}}catch(m){c=!0,s=m}finally{try{l||null==d.return||d.return()}finally{if(c)throw s}}return null}({files:n,currentFileCount:i,existingFileSignatures:J(g),existingFileNames:w,formatMessage:r}),e.target.value="",l)return p({message:l,type:"danger"}),[2];c=[],s=(0,a.A)({},g),u=!0,d=!1,f=void 0;try{for(m=n[Symbol.iterator]();!(u=(h=m.next()).done)&&(_=h.value,x=F(s));u=!0)s[x]={fileObject:_,status:"pending"},c.push(x)}catch(b){d=!0,f=b}finally{try{u||null==m.return||m.return()}finally{if(d)throw f}}return 0===c.length?[2]:(v(s),[4,S(s,c)]);case 1:return o.sent(),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),O=M(g),j=(y?w.length:O.length)>=3,W=(0,l.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray400",children:r({id:"vaccination.payment.prescription_upload_description_2",defaultMessage:"Max files upload size can be 5MB"})}),q=(0,l.Y)("input",{ref:f,type:"file",accept:".png,.jpg,.jpeg,.pdf,.heic,.heif,image/png,image/jpeg,application/pdf,image/heic,image/heif",multiple:!0,className:"hidden",onChange:T});return y?(0,l.FD)(m.a,{className:"bg-white p-4 flex flex-col gap-3","data-testid":"one-more-step-submitted",children:[q,(0,l.Y)("p",{className:"text-[17px] leading-6 tracking-[-0.3px] text-dark font-semibold",children:r({id:"vaccination.payment.one_more_step.upload_success_title",defaultMessage:"Thanks for uploading the prescription. We will get your order moving right away."})}),w.length>0&&(0,l.Y)(m.a,{className:"flex flex-col gap-2",children:w.map((function(e,t){return(0,l.FD)(m.a,{className:"bg-green50 rounded-xl px-4 py-3 flex items-center gap-1.5",children:[(0,l.Y)(B,{className:"flex-shrink-0"}),(0,l.Y)("span",{className:"text-[13px] leading-[18px] tracking-[-0.3px] text-gray700 truncate",children:e})]},"".concat(e,"-").concat(t))}))}),(0,l.FD)(d.B,{size:"lg",fullWidth:!0,variant:"tertiary",loading:A,disabled:j,className:"!bg-neutral50 !border-neutral50 pointer-events-none",children:[(0,l.Y)(L.A,{color:s.w.colors.gray400,size:20,className:"mr-2"}),(0,l.Y)("span",{className:"text-[15px] leading-6 tracking-[-0.3px] font-medium text-gray400",children:r({id:"vaccination.payment.prescription_upload_button",defaultMessage:"Upload prescription"})})]}),W]}):(0,l.FD)(l.FK,{children:[(0,l.FD)(m.a,{className:"bg-white px-4 py-6 flex flex-col gap-4","data-testid":"one-more-step-initial",children:[q,(0,l.FD)(m.a,{className:"flex flex-col gap-4",children:[(0,l.Y)("h2",{className:"text-[17px] leading-6 tracking-[-0.4px] text-dark font-semibold",children:r({id:"vaccination.payment.one_more_step.title",defaultMessage:"Last step before we ship your medication"})}),(0,l.Y)("p",{className:"text-[13px] leading-5 md:text-[15px] md:leading-6 tracking-[-0.3px] text-dark",children:r({id:"vaccination.payment.one_more_step.description",defaultMessage:"Please upload a prescription from your doctor and we'll get your order moving right away."})})]}),(0,l.FD)(m.a,{className:"flex flex-col gap-2",children:[(0,l.FD)(d.B,{size:"lg",fullWidth:!0,loading:A,onClick:function(){var e;A||null===(e=f.current)||void 0===e||e.click()},children:[(0,l.Y)(L.A,{color:"white",size:20,className:"mr-2"}),(0,l.Y)("span",{className:"text-[15px] leading-6 tracking-[-0.3px] font-medium",children:r({id:"vaccination.payment.prescription_upload_button",defaultMessage:"Upload prescription"})})]}),W]}),(0,l.FD)(m.a,{className:"flex items-center gap-3",children:[(0,l.Y)("div",{className:"flex-1 h-px bg-black/10"}),(0,l.Y)("span",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:r({id:"vaccination.payment.one_more_step.or_divider",defaultMessage:"OR"})}),(0,l.Y)("div",{className:"flex-1 h-px bg-black/10"})]}),(0,l.FD)(m.a,{className:"flex flex-col gap-4",children:[(0,l.FD)(m.a,{className:"flex items-start gap-3 max-md:flex-row-reverse",children:[(0,l.Y)(m.a,{className:"flex-shrink-0 w-12 h-12 rounded-full bg-[#F0F7FF] flex items-center justify-center","aria-hidden":!0,children:(0,l.Y)(V,{})}),(0,l.FD)(m.a,{className:"flex-1 min-w-0",children:[(0,l.Y)("p",{className:"text-[15px] md:text-[17px] leading-6 tracking-[-0.3px] text-dark font-semibold",children:r({id:"vaccination.payment.one_more_step.no_prescription_title",defaultMessage:"Don't have a prescription?"})}),(0,l.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 mt-1",children:r({id:u?"vaccination.payment.one_more_step.no_prescription_description":"vaccination.payment.one_more_step.no_prescription_description_desktop",defaultMessage:u?"Our licensed doctors can issue one in a 15 min video consultation.":"Schedule a teleconsultation with our licensed doctors to get a prescription online."})})]})]}),(0,l.Y)(d.B,{size:"lg",fullWidth:!0,variant:"secondary",onClick:function(){window.location.href=t},children:(0,l.Y)("span",{className:"text-[15px] leading-6 tracking-[-0.3px] font-medium text-primaryBase",children:r({id:"vaccination.payment.one_more_step.schedule_teleconsultation",defaultMessage:"Schedule Teleconsultation"})})})]})]}),(0,l.FD)(m.a,{className:"bg-[#F0F7FF] p-4 flex items-start justify-center gap-2",children:[(0,l.Y)(B,{className:"flex-shrink-0 mt-0.5"}),(0,l.Y)("p",{className:"text-[13px] leading-[18px] tracking-[-0.3px] text-gray700",children:r({id:"vaccination.payment.one_more_step.verified_banner",defaultMessage:"Prescription verified before dispensing. Full refund if clinically unsuitable"})})]})]})};function Q(e){return ee.apply(this,arguments)}function ee(){return(ee=(0,i.A)((function(e){var t;return(0,o.__generator)(this,(function(n){switch(n.label){case 0:return e?[4,(0,y.px)((0,y.fK)(g.R.GET_PAYMENT_RESULT,{hhgToken:e}),"GET")]:[2,void 0];case 1:return[2,null===(t=n.sent())||void 0===t?void 0:t.data]}}))}))).apply(this,arguments)}var te=n(70254),ne=n(42280),ie=n(9655),ae=n(95204),re=n(37639),oe=n(40959),le=function(e){var t,n,s,u,p,f=e.vaccinationDetail,h=e.subscriptionProduct,x=(0,P.A)().formatMessage,w=(0,k.d)().isMobileOrTablet,N=(0,F.$)().query,Y=String(N.ref_id||""),A=(0,ne.Jf)(),E=A.paymentResult,R=A.setPaymentResult,L=(0,c.useState)(60),I=L[0],j=L[1],V=(0,c.useContext)(C.B).pushNotifications,B=(0,S.eZ)();D(E);var U=function(){var e=(0,i.A)((function(){var e,t,n,i,l,c,s,u,d,p,m,h,_,b,w,N,k,A,D,F,P,C;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:if(oe||!E||!J||!f)return[2];t=(e=E||{}).snapshot_order,n=e.payment_via,i=e.payment_type,l=e.payment_provider,s=(c=t||{}).type,u=c.product_id,d=c.clinic_id,p=c.voucher_code,m=c.referral_code,h=c.customer_info,_="".concat(window.location.origin).concat(window.location.pathname),b=null===f||void 0===f?void 0:f.id,w=null===l||void 0===l?void 0:l.toLowerCase(),s===v.V.vaccine_package&&(b=u),o.label=1;case 1:return o.trys.push([1,3,,4]),le(!0),[4,(0,y.px)((0,y.fK)(g.R.GET_PAYMENT_URL,{provider:w}),"POST",{data:(0,r.A)((0,a.A)({},E.snapshot_order),{ref_id:Y,amount:J.amount,price_unit:f.price_unit,order_info:f.name,product_name:f.name,clinic_name:null===(N=f.hospital_branch)||void 0===N?void 0:N.name,clinic_address:null===(k=f.hospital_branch)||void 0===k?void 0:k.address,hospital_name:null===(A=f.organization)||void 0===A?void 0:A.name,hospital_branch_name:null===(D=f.hospital_branch)||void 0===D?void 0:D.name,image:(0,ae.rm)(f),type:s,provider:w,return_url:_,product_id:b,payment_via:n,payment_type:i,clinic_id:d,voucher_code:p,referral_code:m,customer_info:h,sub_payment_method_code:null===E||void 0===E||null===(F=E.sub_payment_method)||void 0===F?void 0:F.code})})];case 2:if(P=o.sent(),!(C=P.data.url))throw new Error("");return window.location.href=C,le(!1),[3,4];case 3:return o.sent(),V({message:x({id:"vaccination.payment.failed_desc",defaultMessage:"There was an issue with your {provider} transaction. Please try again or use another payment method."},{provider:E.payment_provider_title}),type:"danger"}),le(!1),[3,4];case 4:return[2]}}))}));return function(){return e.apply(this,arguments)}}(),z=function(){var e=(0,i.A)((function(){var e,t,n,i,l,c,s,u;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:if(oe||!E||!h)return[2];o.label=1;case 1:return o.trys.push([1,6,,7]),le(!0),t={address_line:(E.snapshot_order.customer_address.address_line||"").trim(),city:(E.snapshot_order.customer_address.city||"").trim(),country:(E.snapshot_order.customer_address.country||"").trim(),zip_or_postal_code:(E.snapshot_order.customer_address.zip_or_postal_code||"").trim()},n={address_line:(E.snapshot_order.shipping_address.address_line||"").trim(),city:(E.snapshot_order.shipping_address.city||"").trim(),country:(E.snapshot_order.shipping_address.country||"").trim(),zip_or_postal_code:(E.snapshot_order.shipping_address.zip_or_postal_code||"").trim()},i="ipay88"===E.payment_provider&&"BCC"===E.sub_payment_method_code,l={subscription_id:E.snapshot_order.subscription_id,customer_address:t,shipping_address:n,email:E.snapshot_order.customer_info.email},i?[4,_.dR.chargeTeleconsultationSubscriptionWithNewCard(l)]:[3,3];case 2:return s=o.sent(),[3,5];case 3:return[4,_.dR.chargeTeleconsultationSubscription((0,r.A)((0,a.A)({},l),{card_token_id:E.snapshot_order.card_token_id}))];case 4:s=o.sent(),o.label=5;case 5:if(!(u=null===(c=s)||void 0===c||null===(e=c.data)||void 0===e?void 0:e.url))throw new Error("Missing payment url");return window.location.href=u,[3,7];case 6:return o.sent(),V({message:x({id:"vaccination.payment.failed_desc",defaultMessage:"There was an issue with your {provider} transaction. Please try again or use another payment method."},{provider:E.payment_provider_title}),type:"danger"}),le(!1),[3,7];case 7:return[2]}}))}));return function(){return e.apply(this,arguments)}}(),G=null===E||void 0===E||null===(t=E.transaction)||void 0===t?void 0:t.status,W=N.hhg_payment_token?String(N.hhg_payment_token):"",q=function(){"default"===G&&W&&(le(!0),(0,y.px)((0,y.fK)(g.R.GET_PAYMENT_RESULT,{hhgToken:W}),"GET").then((function(e){var t,n=null===e||void 0===e?void 0:e.data,i=null===n||void 0===n||null===(t=n.transaction)||void 0===t?void 0:t.status;E&&i&&"default"!==i&&R(n)})).finally((function(){le(!1)})))},H=function(){var e=(0,i.A)((function(){var e;return(0,o.__generator)(this,(function(t){switch(t.label){case 0:return W?[4,Q(W)]:[2];case 1:return(e=t.sent())&&R(e),[2]}}))}));return function(){return e.apply(this,arguments)}}(),$=E||{},K=$.payment_provider_title,J=$.transaction,Z=($.user_referral||{}).code,ee=(0,c.useState)(!1),oe=ee[0],le=ee[1],ce=(0,c.useState)(!1),se=ce[0],pe=ce[1],fe="success"===G,me="failed"===G,he="default"===G,ge=me&&(0,l.Y)(d.B,{size:"lg",fullWidth:!0,loading:oe,onClick:h?z:U,children:(0,l.Y)("span",{className:"text-[15px] leading-6 tracking-[-0.3px] font-medium",children:x({id:"vaccination.payment.retry",defaultMessage:"Retry Payment"})})}),ve=he&&(0,l.Y)(d.B,{size:"lg",fullWidth:!0,loading:oe,onClick:q,children:(0,l.Y)("span",{className:"text-[15px] leading-6 tracking-[-0.3px] font-medium pointer-events-none",children:x({id:"vaccination.payment.reload",defaultMessage:"Reload ({count})"},{count:I})})});return(0,c.useEffect)((function(){var e;if((null===E||void 0===E||null===(e=E.snapshot_order)||void 0===e?void 0:e.type)===v.V.vaccine_package){var t,n=null===E||void 0===E||null===(t=E.snapshot_order)||void 0===t?void 0:t.product_id.toString();(0,S.Gp)(n,((null===B||void 0===B?void 0:B[n])||0)-1)}}),[]),(0,c.useEffect)((function(){if("default"===G&&W){var e=setInterval((function(){j((function(e){var t=e-1;return 0===t&&q(),t||60}))}),1e3);return function(){j(60),clearInterval(e)}}}),[G,W]),(0,c.useEffect)((function(){var e;if(fe&&(null===E||void 0===E||null===(e=E.one_more_step)||void 0===e?void 0:e.show)&&W){var t=setTimeout((function(){H()}),5e3);return function(){return clearTimeout(t)}}}),[fe,null===E||void 0===E||null===(n=E.one_more_step)||void 0===n?void 0:n.show,W]),E&&J?(0,l.FD)(M.Ue,{value:{isOpenPopupCollection:se,setIsOpenPopupCollection:pe},children:[(0,l.FD)(m.a,{className:"bg-neutral50 min-h-screen",children:[(0,l.Y)(O.A,{className:"lg:mb-8 lg:border-b lg:border-solid lg:border-gray200 lg:py-6 lg:flex lg:justify-center",customSize:w?void 0:{width:"141px",height:"32px"}}),(0,l.FD)(m.a,{className:"max-w-[552px] mx-auto",children:[(0,l.FD)(m.a,{className:b()("flex flex-col gap-3 lg:gap-2",me||he?"pb-[100px]":"pb-[50px] lg:pb-[40px]"),children:[(null===J||void 0===J?void 0:J.status)&&(0,l.Y)(ue,{status:J.status,provider:K}),fe&&(null===(s=E.one_more_step)||void 0===s?void 0:s.show)&&(0,l.Y)(X,{teleconsultationUrl:E.one_more_step.teleconsultation_url,paymentToken:W}),(0,l.FD)(m.a,{className:"bg-white p-4 pt-6 lg:pb-6",children:[(0,l.FD)("div",{className:"payment__productInfo",children:[f&&(0,l.Y)(te.Ay.Inner,{stepNumber:0,vaccinationDetail:f,className:"mt-0",showDeliveryFee:null===(u=E.snapshot_order)||void 0===u?void 0:u.show_delivery_fee,quantity:null===(p=E.snapshot_order)||void 0===p?void 0:p.quantity}),h&&(0,l.Y)(te.Ay.SubscriptionInner,{subscriptionProduct:h,className:"mt-0"})]}),Z&&fe&&f&&(0,l.Y)(de,{paymentResult:E,vaccinationDetail:f,userReferral:E.user_referral,className:"mt-4 !px-0"})]}),(0,l.Y)(ie.A,{paymentResult:E,vaccinationDetail:f,subscriptionProduct:h,isFailed:me,isSuccess:fe,isPending:he,action:!w&&(me||he)&&(0,l.Y)(m.a,{className:"py-1","data-testid":me?"retry-button":"reload-button",children:me?ge:ve})}),(fe||h)&&(0,l.Y)(T.Y,{})]}),me&&w&&(0,l.Y)(m.a,{"data-testid":"retry-button",className:"fixed bottom-0 left-0 right-0 border-t border-solid border-neutral100 py-2 px-4 bg-white",children:ge}),he&&w&&(0,l.Y)(m.a,{"data-testid":"reload-button",className:"fixed bottom-0 left-0 right-0 border-t border-solid border-neutral100 py-2 px-4 bg-white",children:ve})]})]}),(0,l.Y)(re.A,{className:"!top-4 !right-4 !left-4"})]}):null},ce={success:u.C.getAssetPath("payment/payment_success.png"),failed:u.C.getAssetPath("payment/payment_failed.png"),default:u.C.getAssetPath("payment/payment_pending.png")},se={success:{title:{id:"vaccination.payment.success_title",defaultMessage:"Payment Successful"},description:{id:"vaccination.payment.success_desc",defaultMessage:"Your payment has been completed successfully. Thank you for your purchase!"}},failed:{title:{id:"vaccination.payment.failed_title",defaultMessage:"Payment Unsuccessful"},description:{id:"vaccination.payment.failed_desc",defaultMessage:"There was an issue with your {provider} transaction. Please try again or use another payment method."}},default:{title:{id:"vaccination.payment.pending_title",defaultMessage:"Pending Transaction"},description:{id:"vaccination.payment.pending_desc",defaultMessage:"Your payment is being processed. Please refresh to see the latest status"}}},ue=function(e){var t=e.status,n=e.provider,i=e.className,a=e.style,r=(0,P.A)().formatMessage,o=(null===ce||void 0===ce?void 0:ce[t])||ce.failed,s=(0,c.useMemo)((function(){var e=se.failed.title,i=se.failed.description;if(t in se){var a=se[t];e=a.title,i=a.description}return{title:r(e),description:r(i,{provider:n})}}),[r,n,t]),u=s.title,d=s.description;return(0,l.Y)(l.FK,{children:(0,l.FD)("div",{className:(0,h.A)(i,"result","result-".concat(t),"bg-white p-4 text-center lg:rounded-t-2xl"),style:a,"data-testid":"result-message",children:[(0,l.Y)("img",{src:o,alt:"hhg",className:"result__icon leading-none w-auto h-[96px] mb-2 block mx-auto"}),(0,l.Y)("h4",{className:"result__title mb-0 font-semibold text-[22px] text-dark leading-8 tracking-[-0.6px]",children:u}),(0,l.Y)("p",{className:"result__description mt-2 mb-0 text-[13px] text-gray600 leading-5 tracking-[-0.3px] lg:text-[14px] lg:leading-[22px] lg:tracking-[-0.2px]",children:d})]})})},de=function(e){var t=e.paymentResult,n=e.vaccinationDetail,i=e.userReferral,a=e.className,r=e.style,o=(0,P.A)().formatMessage,d=(0,F.$)(),g=d.locale,_=d.asPath,x=(0,k.d)().isMobileOrTablet,b=(0,c.useContext)(C.B).pushNotifications,w=null===i||void 0===i?void 0:i.code,Y=n||{},A=Y.name,D=(Y.hospital_branch||{}).name,M=t.snapshot_order,S=M.type,T=M.product_id,O=M.product_package_name,E="percentage"===(null===i||void 0===i?void 0:i.discount_type)?"".concat(null===i||void 0===i?void 0:i.discount_value,"%"):(0,y.nd)(o,(0,y.$g)((null===i||void 0===i?void 0:i.discount_value)||0,g),n.price_unit),R=(0,c.useMemo)((function(){if(oe.kUY)return"";var e=(0,ae.jX)(n)?ae.kx:(0,ae.J8)(n)?ae.W:(0,ae.FL)(n)?ae.km:(0,ae.LJ)(n)?ae.w7:ae.OP,t="".concat(window.location.origin).concat(oe.JpE).concat(e(n.slug,n.id,_),"payment?referral_code=").concat(w);if(S===v.V.vaccine_package){var i=encodeURIComponent(O);t+="&pkg_name=".concat(i,"&pkg_id=").concat(T)}return t}),[w,S,T,O,n]),L=(0,c.useMemo)((function(){var e=N()(1e3*((null===i||void 0===i?void 0:i.expires_at)||0)),t=N()(1e3*((null===i||void 0===i?void 0:i.created_at)||0)),n=function(e,t){var n=(t-e)/864e5;return Math.max(Math.round(n),1)}(Number(t),Number(e)),a=A;return S===v.V.vaccine_package&&O&&(a+=" - ".concat(O)),[o({id:"vaccination.share_sentence1"},{productName:a,clinicName:D}),o({id:"vaccination.share_sentence2"},{refCode:w,refAmount:E,expiresLength:o({id:"vaccination.share_day_length"},{days:n}),createdAt:t.format("DD/MM/YYYY")}),o({id:"vaccination.share_sentence3"}),o({id:"vaccination.share_sentence4"})].join("\n")}),[o,i,E,w,A,O]),I=function(e){(0,ae.lW)(e||R,(function(){b({type:"success",message:o({id:"widget.integrations.document.copiedToClipboard",defaultMessage:"Copied to clipboard!"})})}),(function(){}))};return(0,l.Y)(m.a,{"data-testid":"referral-code-box",className:(0,h.A)(a,"px-4"),style:r,children:(0,l.FD)(m.a,{style:x?ae.yi:ae.IL,className:"py-[20px] rounded-lg lg:rounded-2xl bg-primary500",children:[(0,l.Y)("div",{className:"w-[196px] h-[78px] mx-auto relative",children:(0,l.Y)("img",{alt:"cash back 40%",className:"w-[320px] absolute top-[-15px] left-1/2 pointer-events-none",style:{transform:"translateX(-50%)"},src:u.C.getAssetPath(g===p.L.Vietnam?"payment/referral_title_bg_vi-VN.png":"payment/referral_title_bg.png")})}),(0,l.Y)("p",{className:"text-[15px] leading-6 font-semibold tracking-[-0.3px] px-9 text-white text-center",children:o({id:"vaccination.payment_referral_desc",defaultMessage:"Share this code with your friends and get {amount} cashback for every friend (max {count}) who gets vaccinated using it."},{amount:E,count:(null===i||void 0===i?void 0:i.usage_limit)||2})}),(0,l.FD)(m.a,{className:"px-6 flex gap-2 mt-[18px]",children:[(0,l.FD)(m.a,{className:"flex justify-between rounded bg-white/[0.64] flex-1 px-4 py-[10px] backdrop-blur-[24px] min-w-0",children:[(0,l.Y)("p",{className:"text-[15px] leading-6 font-semibold tracking-[-0.3px] text-gray700 text-ellipsis overflow-hidden whitespace-nowrap pr-1",children:w}),(0,l.Y)(m.a,{className:"cursor-pointer",onClick:function(){return I()},children:(0,l.Y)(f.A,{color:s.w.colors.gray600,size:20})})]}),(0,l.Y)("button",{onClick:function(){if("undefined"!==typeof(null===navigator||void 0===navigator?void 0:navigator.share)){var e={url:R,title:n.name,text:L};navigator.share(e).then((function(){return console.log("Successful share")})).catch((function(e){console.log("Error sharing",e),I(L)}))}else I(L)},className:"bg-white rounded-xl text-[15px] leading-6 font-semibold tracking-[-0.3px] text-primaryBase px-[26px] py-[10px] w-auto whitespace-nowrap",children:o({id:"vaccination.payment_share",defaultMessage:"Share"})})]})]})})};le.Result=ue,le.ResultIcon=ce,le.ReferralCode=de;var pe=le},70254:function(e,t,n){n.d(t,{UB:function(){return x},tn:function(){return b}});var i,a,r,o=n(81539),l=n(2445),c=n(36814),s=n(32485),u=n.n(s),d=n(99187),p=n(82187),f=n(73419),m=n(32876),h=n.n(m),g=n(6442),v=n(42280),_=n(95204),y=function(e){return(0,o.A)(null!==(i=null===e||void 0===e?void 0:e.breakdown)&&void 0!==i?i:[]).filter((function(e){return e.name})).sort((function(e,t){return(null!==(a=e.line_no)&&void 0!==a?a:0)-(null!==(r=t.line_no)&&void 0!==r?r:0)}))},x=function(e){var t=e.stepNumber,n=e.vaccinationDetail,i=e.className,a=void 0===i?"mt-4":i,r=e.showDeliveryFee,o=e.quantity,s=n.id,d=n.slug,p=n.hospital_branch,m=n.display_name,g=(0,f.$)().asPath,v=(0,_.jX)(n),y=(0,_.OP)(d,s,g);return(0,l.FD)(c.a,{"data-testid":"product-info",className:u()("flex gap-3",a),children:[(0,l.FD)(c.a,{className:"flex-1",children:[v?(0,l.FD)("span",{className:"text-[17px] tracking-[-0.4px] leading-6 font-semibold text-dark block",children:[m,o&&o>=1&&" x ".concat(o)]}):(0,l.Y)(h(),{href:y,children:(0,l.FD)("a",{className:"text-[17px] tracking-[-0.4px] leading-6 font-semibold text-dark block cursor-pointer",children:[m,o&&o>=1&&" x ".concat(o)]})}),t!==_.RZ.ONE&&!r&&(0,l.Y)("p",{className:"border-l-2 border-solid border-gray200 pl-2 text-[13px] leading-5 tracking-[-0.3px] text-gray700 mt-2",children:p.name})]}),(0,l.Y)(c.a,{className:"w-[72px] h-[72px] min-w-[72px]",children:(0,l.Y)("img",{src:(0,_.rm)(n),className:"block w-full h-full object-cover rounded-lg"})})]})},b=function(){var e=(0,g.A)().formatMessage,t=(0,v.Jf)().currentStep;return t>0?(0,l.FD)(c.a,{"data-testid":"step-bar",className:"flex gap-1 justify-between items-start text-center",children:[(0,l.FD)(c.a,{className:"flex-1",children:[(0,l.Y)(c.a,{className:"h-1 rounded bg-primaryBase mb-2"}),(0,l.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] font-semibold text-primaryBase lg:whitespace-nowrap lg:px-4",children:e({id:"vaccination.payment.step_select_payment",defaultMessage:"SELECT PAYMENT"})})]}),(0,l.FD)(c.a,{className:"flex-1",children:[(0,l.Y)(c.a,{className:u()("h-1 rounded mb-2",{"bg-primaryBase":2===t,"bg-neutral100":t<2})}),(0,l.Y)("p",{className:u()("text-[13px] leading-5 tracking-[-0.3px] font-semibold lg:whitespace-nowrap lg:px-4",2===t?"text-primaryBase":"text-gray300"),children:e({id:"vaccination.payment.step_review_confirm",defaultMessage:"REVIEW AND CONFIRM"})})]})]}):null},w=function(e){var t=e.stepNumber,n=e.vaccinationDetail,i=e.children,a=e.showDeliveryFee,r=(0,g.A)().formatMessage,o=t===_.RZ.RESULT;return(0,l.FD)(c.a,{className:u()("bg-white pb-5 px-4 pt-3",o?"pt-2.5 pb-0":"pt-3"),children:[(0,l.Y)(b,{}),i,o&&(0,l.Y)("p",{className:"text-[22px] leading-8 font-semibold tracking-[-0.6px] text-dark",children:o&&r({id:"vaccination.payment_summary",defaultMessage:"Payment summary"})}),(0,l.Y)(x,{stepNumber:t,vaccinationDetail:n,className:o?"pt-5":"mt-7",showDeliveryFee:a})]})};w.Inner=x,w.SubscriptionInner=function(e){var t,n,i=e.subscriptionProduct,a=e.className,r=void 0===a?"mt-4":a,o=(0,g.A)().formatMessage,s=(0,v.Jf)().paymentResult,f=null===s||void 0===s?void 0:s.snapshot_order,m=null===f||void 0===f?void 0:f.image,h=(0,p.O)(i,o),x=function(e){return y(e).length>1}(s),b=(0,d.u7)({subscription_brand_name:null!==(t=null===f||void 0===f?void 0:f.subscription_brand_name)&&void 0!==t?t:i.brand_name,subscription_title:null!==(n=null===f||void 0===f?void 0:f.subscription_title)&&void 0!==n?n:i.title}),w=x?b:null===f||void 0===f?void 0:f.product_name,N=h.subtext,k=function(e){var t,n=y(e).map((function(e){return e.name}));return n.length>0?n.join(" + "):null===e||void 0===e||null===(t=e.snapshot_order)||void 0===t?void 0:t.drug_name}(s),Y=x?k:o({id:"subscription.payment.1st_month_label",defaultMessage:"{name} (1st month)"},{name:k||i.title});return(0,l.FD)(c.a,{"data-testid":"product-info-subscription",className:u()("flex gap-3",r),children:[(0,l.FD)(c.a,{className:"flex-1",children:[(0,l.Y)("p",{className:"text-[17px] tracking-[-0.4px] leading-6 font-semibold text-dark block",children:w}),Y&&(0,l.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-semibold mt-2",children:Y}),!x&&(0,l.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 mt-2",children:N})]}),(0,l.Y)(c.a,{className:"w-[72px] h-[72px] min-w-[72px]",children:(0,l.Y)("img",{src:m||_.XS,className:"block w-full h-full object-cover rounded-lg"})})]})},t.Ay=w},42280:function(e,t,n){n.d(t,{Jf:function(){return l},Ou:function(){return c},Zb:function(){return s}});var i=n(53513),a=n(63538),r=n(44745),o=n(95204),l=(0,r.vt)()((function(e,t){return{currentStep:o.RZ.ONE,quantity:1,setCurrentStep:function(t){return e((function(){return{currentStep:t}}))},setQuantity:function(t){e((function(){return{quantity:t}}))},providers:[],setProviders:function(t){return e((function(){return{providers:t}}))},setPaymentResult:function(t){return e((function(){return{paymentResult:t}}))},computedPrice:o.vp,setComputedPrice:function(n){if(!t().computedPrice.unit_price||n.unit_price){var i=t().vaccinationDetail;i&&(i.max_product_quantity=n.max_product_quantity,i.quantity_supported=Number(!!n.quantity_supported)),e((function(){return{computedPrice:n,vaccinationDetail:i}}))}},setSelectedPaymentValue:function(t){return e((function(){return{selectedPaymentValue:t}}))},setVaccinationDetail:function(t){return e((function(){return{vaccinationDetail:t}}))},setOpenOnlineBanking:function(t){return e((function(){return{openOnlineBanking:t}}))},setSelectedSubPaymentValue:function(t){e((function(){return{selectedSubPaymentValue:t}}))}}})),c={loading:!1,isOpenVoucher:!1,openResult:!1,listVoucher:[],appliedVoucher:null,lastVoucherApplied:null,referralData:null,appliedReferralCode:"",voucherCount:1},s=(0,r.vt)((function(e){return(0,a.A)((0,i.A)({},c),{setLoading:function(t){e((function(){return{loading:t}}))},setIsOpenVoucher:function(t){e((function(){return{isOpenVoucher:t}}))},setOpenResult:function(t){e((function(){return{openResult:t}}))},setListVoucher:function(t){t.length?e((function(){return{listVoucher:t}})):e((function(){return{listVoucher:t,lastVoucherApplied:null}}))},setAppliedVoucher:function(t){e(t?function(){return{appliedVoucher:t,lastVoucherApplied:t}}:function(){return{appliedVoucher:t}})},setLastVoucherApplied:function(t){e((function(){return{lastVoucherApplied:t}}))},setReferralData:function(t){e((function(){return{referralData:t}}))},setAppliedReferralCode:function(t){e((function(){return{appliedReferralCode:t}}))},setVoucherStore:function(t,n){e(t,n)}})}))},9655:function(e,t,n){n.d(t,{Y:function(){return b}});var i,a=n(38971),r=n(81539),o=n(2445),l=n(73884),c=n(92793),s=n(36814),u=n(94858),d=n(84091),p=n(74353),f=n.n(p),m=n(73419),h=n(6442),g=n(86706),v=n(37680);n(40860),n(65826);var _,y,x,b=(i={},(0,a.A)(i,c.L.Vietnam,"vaccination.payment.product_price"),(0,a.A)(i,c.L.Malaysia,"vaccination.payment.product_price"),i);t.A=function(e){var t=e.paymentResult,n=e.vaccinationDetail,i=e.isFailed,a=e.isSuccess,p=e.isPending,w=e.className,N=e.style,k=e.action,Y=e.subscriptionProduct,A=(0,m.$)().locale,D=(0,h.A)().formatMessage,F=A===c.L.Vietnam?"vi":"en",P=t.payment_provider_title,C=t.snapshot_order,M=t.sub_payment_method,S=(0,g.T)(),T=S.getDisplayTaxPrice,O=S.getDisplayDeliveryFee,E={default:D({id:"vaccination.payment.status_default",defaultMessage:"Pending"}),success:D({id:"vaccination.payment.success",defaultMessage:"Success"}),failed:D({id:"vaccination.payment.failed",defaultMessage:"Failed"})},R=(0,d.nd)(D,(0,d.$g)(C.final_price,A),null===n||void 0===n?void 0:n.price_unit),L=(0,d.nd)(D,(0,d.$g)(C.original_price,A),null===n||void 0===n?void 0:n.price_unit),I=T(C.tax_unit,C.tax_computed,C.tax_amount),j=O(C.show_delivery_fee,C.delivery_fee,C.delivery_fee_currency),V=(0,d.nd)(D,(0,d.$g)(t.remain_amount,A),null===n||void 0===n?void 0:n.price_unit),B=(0,d.nd)(D,(0,d.$g)(t.transaction.amount,A),null===n||void 0===n?void 0:n.price_unit),U=Number((null===C||void 0===C?void 0:C.referral_discount_value)||0)+Number((null===C||void 0===C?void 0:C.voucher_discount_value)||0),z=U>0?(0,d.nd)(D,(0,d.$g)(U,A),(null===n||void 0===n?void 0:n.price_unit)||"RM"):"",G=null===n||void 0===n?void 0:n.hospital_branch.name,W=(0,l.useMemo)((function(){var e,n=1===t.snapshot_order.charge_sequence,i=function(e){return(0,r.A)(null!==(_=e.breakdown)&&void 0!==_?_:[]).filter((function(e){return e.name})).sort((function(e,t){return(null!==(y=e.line_no)&&void 0!==y?y:0)-(null!==(x=t.line_no)&&void 0!==x?x:0)}))}(t),a=i.length>1,o=D({id:"subscription.payment.1st_month_label",defaultMessage:"{name} (1st month)"},{name:t.snapshot_order.drug_name||(null===Y||void 0===Y?void 0:Y.title)}),l=i.map((function(t){return{label:n&&!a?D({id:"subscription.payment.1st_month_label",defaultMessage:"{name} (1st month)"},{name:t.name}):t.name,amount:(0,d.UN)(null!==(e=t.original_price)&&void 0!==e?e:t.amount,A)}}));return{displayPriceFirstMonth:t.snapshot_order.original_price>0?(0,d.UN)(t.snapshot_order.original_price,A):"",displayDiscountFirstMonth:t.snapshot_order.voucher_discount_value>0?"- "+(0,d.UN)(t.snapshot_order.voucher_discount_value,A):"",display1stMonthLabel:o,displayTotalPriceSubscription:t.snapshot_order.final_price>0?(0,d.UN)(t.snapshot_order.final_price,A):"",subscriptionBreakdownLines:l}}),[D,A,t,null===Y||void 0===Y?void 0:Y.title]),q=W.displayPriceFirstMonth,H=W.display1stMonthLabel,$=W.displayDiscountFirstMonth,K=W.displayTotalPriceSubscription,J=W.subscriptionBreakdownLines;return(0,o.FD)(s.a,{"data-testid":"transaction-info",className:(0,u.A)(w,"bg-white pt-6 px-4 pb-2 lg:pb-3"),style:N,children:[(0,o.FD)(s.a,{className:"pb-4 flex justify-between items-center",children:[(0,o.Y)("h2",{className:"text-[17px] leading-6 tracking-[-0.4px] text-dark font-semibold",children:D({id:"vaccination.payment.transaction_info",defaultMessage:"Transaction Info"})}),a&&(0,o.Y)("label",{className:"rounded-[40px] py-[3px] px-2 bg-green50 font-medium text-[12px] leading-4 tracking-[-0.2px] text-green600",children:E.success}),i&&(0,o.Y)("label",{className:"rounded-[40px] py-[3px] px-2 bg-red50 font-medium text-[12px] leading-4 tracking-[-0.2px] text-red700",children:E.failed}),p&&(0,o.Y)("label",{className:"rounded-[40px] py-[3px] px-2 bg-yellow50 font-medium text-[12px] leading-4 tracking-[-0.2px] text-yellow800",children:E.default})]}),(0,o.FD)(s.a,{className:"py-3 flex justify-between border-b border-solid border-neutral100",children:[(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:D({id:"vaccination.payment.date"})}),(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:f()(t.transaction.created_at).locale(F).format("DD MMM YYYY - HH:mm")})]}),(0,o.FD)(s.a,{className:"py-3 flex justify-between border-b border-solid border-neutral100",children:[(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:D({id:"vaccination.payment.transaction_id"})}),(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:t.transaction.transaction_id})]}),n&&(0,o.FD)(s.a,{"data-testid":"price-for-1-dose",className:"py-3 flex justify-between border-b border-solid border-neutral100",children:[(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:D({id:(null===b||void 0===b?void 0:b[A])||b[c.L.Vietnam],defaultMessage:"Package price"})}),(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:L})]}),n&&j&&(0,o.FD)(s.a,{"data-testid":"shipping-fee",className:"py-3 flex justify-between border-b border-solid border-neutral100",children:[(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:D({id:"vaccination.payment.shipping_fee"})}),(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:j})]}),n&&I&&(0,o.FD)(s.a,{"data-testid":"tax-price",className:"py-3 flex justify-between border-b border-solid border-neutral100",children:[(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:D({id:"vaccination.payment.tax"})}),(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:I})]}),n&&z&&(0,o.FD)(s.a,{"data-testid":"discount-price",className:"py-3 flex justify-between border-b border-solid border-neutral100",children:[(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:D({id:"vaccination.payment.discount"})}),(0,o.FD)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-green600 font-medium",children:["-",z]})]}),n&&(null===t||void 0===t?void 0:t.payment_type)===v.Ai.ten_percent&&(0,o.FD)(o.FK,{children:[(0,o.FD)(s.a,{className:"py-3 gap-2 flex justify-between border-b border-solid border-neutral100",children:[(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 min-w-0",children:D({id:"vaccination.payment.pay_later",defaultMessage:"Pay later (at {hospital_name})"},{hospital_name:G})}),(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium whitespace-nowrap",children:V})]}),(0,o.FD)(s.a,{className:"py-3 flex justify-between border-b border-solid border-neutral100",children:[(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:D({id:a?"vaccination.payment.already_paid_10_percentage":i?"vaccination.payment.failed_paid_10_percentage":"vaccination.payment.pending_paid_10_percentage"})}),(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:B})]})]}),n&&(null===t||void 0===t?void 0:t.payment_type)===v.Ai.full_payment&&(0,o.FD)(s.a,{className:"py-3 flex justify-between border-b border-solid border-neutral100",children:[(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:D({id:"vaccination.payment.price_after_tax_discount",defaultMessage:"Package price after tax & discount"})}),(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:R})]}),n&&(null===t||void 0===t?void 0:t.payment_type)===v.Ai.one_hundred_percent&&(0,o.FD)(s.a,{"data-testid":"price-for-100-percent",className:"py-3 flex justify-between border-b border-solid border-neutral100",children:[(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:D({id:a?"vaccination.payment.already_paid_100":i?"vaccination.payment.failed_paid_100_percentage":"vaccination.payment.pending_paid_100_percentage"})}),(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:R})]}),Y&&(0,o.FD)(o.FK,{children:[J.length>0?J.map((function(e,t){return(0,o.FD)(s.a,{"data-testid":"price-for-first-month",className:"py-3 gap-3 flex justify-between border-b border-solid border-neutral100",children:[(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700 min-w-0",children:e.label}),(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium whitespace-nowrap",children:e.amount})]},"".concat(e.label,"-").concat(t))})):(0,o.FD)(s.a,{"data-testid":"price-for-first-month",className:"py-3 flex justify-between border-b border-solid border-neutral100",children:[(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:H}),(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:q})]}),$&&(0,o.FD)(s.a,{"data-testid":"price-for-first-month",className:"py-3 flex justify-between border-b border-solid border-neutral100",children:[(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:D({id:"subscription.payment.1st_month_discount_label",defaultMessage:"Discount (1st month)"})}),(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-green600 font-medium",children:$})]}),(0,o.FD)(s.a,{"data-testid":"price-for-first-month",className:"py-3 flex justify-between border-b border-solid border-neutral100",children:[(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:D({id:"vaccination.payment.total_payment"})}),(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:K})]})]}),(0,o.FD)(s.a,{className:"py-3 flex justify-between",children:[(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-gray700",children:D({id:"vaccination.payment.method"})}),(0,o.Y)("p",{className:"text-[13px] leading-5 tracking-[-0.3px] text-dark font-medium",children:(null===M||void 0===M?void 0:M.title)?"".concat(D({id:"vaccination.payment.online_banking"})," - ").concat(null===M||void 0===M?void 0:M.title):P})]}),k]})}},96149:function(e,t,n){n.d(t,{RL:function(){return h},_l:function(){return m},d9:function(){return v}});var i=n(858),a=n(95586),r=n(38971),o=n(29904),l=n(53513),c=n(63538),s=n(49433),u=n(22549),d=n(83776),p=n(59850),f=n(84091),m=function(e){(0,o.A)(n,e);var t=(0,u.A)(n);function n(e,i){var r;return(0,a.A)(this,n),(r=t.call(this,i)).code=e,r.name="PrescriptionUploadError",r}return n}((0,s.A)(Error));function h(e){return g.apply(this,arguments)}function g(){return(g=(0,i.A)((function(e){var t,n,i,a,o,s,u,h,g,v,_,y,x,b;return(0,d.__generator)(this,(function(w){switch(w.label){case 0:if(t=e.prescriptionFiles,n=e.setPrescriptionFiles,i=e.formatMessage,a=e.fileKeys,0===(o=null!==a&&void 0!==a?a:Object.keys(t).filter((function(e){var n;return null===(n=t[e])||void 0===n?void 0:n.fileObject}))).length)throw new m("NO_FILES",i({id:"vaccination.payment.prescription.required",defaultMessage:"Please upload at least one prescription file"}));s=[],u=0,h=!0,g=!1,v=void 0,w.label=1;case 1:w.trys.push([1,6,7,8]),_=function(){var e,i,a,o,m,h,g;return(0,d.__generator)(this,(function(d){switch(d.label){case 0:if(e=x.value,!(null===(i=t[e])||void 0===i?void 0:i.fileObject))return[2,"continue"];if("success"===i.status&&i.url)return s.push(i.url),[2,"continue"];n((function(t){var n=t[e];return n?(0,c.A)((0,l.A)({},t),(0,r.A)({},e,(0,c.A)((0,l.A)({},n),{status:"loading"}))):t})),d.label=1;case 1:return d.trys.push([1,7,,8]),a=window.location.href.includes("localhost"),(o=new FormData).append("file",i.fileObject),a?(h={URL:"File2"===e?"":"https://cdn-hermes.hellohealthgroup.com/2026/01/c73bb9c0c77b33740c67833e5081c2b25b7e2f8b01b88c15e5c4743617476022.png",message:"Upload Successful",status:!0},[3,4]):[3,2];case 2:return[4,(0,f.px)((0,f.Gx)(p.R.POST_IMAGE_UPLOAD),"POST",{data:o,headers:{"Content-Type":"multipart/form-data"}})];case 3:h=d.sent(),d.label=4;case 4:return m=h,a?[4,new Promise((function(e){return setTimeout(e,1e3)}))]:[3,6];case 5:d.sent(),d.label=6;case 6:if(!(g=(null===m||void 0===m?void 0:m.URL)||""))throw new Error("No URL returned");return s.push(g),n((function(t){var n=t[e];return n?(0,c.A)((0,l.A)({},t),(0,r.A)({},e,(0,c.A)((0,l.A)({},n),{status:"success",url:g}))):t})),[3,8];case 7:return d.sent(),u++,n((function(t){var n=t[e];return n?(0,c.A)((0,l.A)({},t),(0,r.A)({},e,(0,c.A)((0,l.A)({},n),{status:"failed"}))):t})),[3,8];case 8:return[2]}}))},y=o[Symbol.iterator](),w.label=2;case 2:return(h=(x=y.next()).done)?[3,5]:[5,(0,d.__values)(_())];case 3:w.sent(),w.label=4;case 4:return h=!0,[3,2];case 5:return[3,8];case 6:return b=w.sent(),g=!0,v=b,[3,8];case 7:try{h||null==y.return||y.return()}finally{if(g)throw v}return[7];case 8:if(0===s.length)throw new m("UPLOAD_FAILED",i({id:"vaccination.payment.prescription.uploadFailed",defaultMessage:"Failed to upload prescription files. Please try again."}));if(u>0)throw new m("PARTIAL_FAILED",i({id:"vaccination.payment.prescription.uploadFailed",defaultMessage:"Some files failed to upload. Please try again."}));return[2,s]}}))}))).apply(this,arguments)}var v=function(e){var t=[];return Object.keys(e).forEach((function(n){var i=e[n];"success"===(null===i||void 0===i?void 0:i.status)&&i.url&&t.push(i.url)})),t}},12034:function(e,t,n){n.d(t,{Ue:function(){return p},ZN:function(){return d}});var i=n(53513),a=n(63538),r=n(2445),o=n(73884),l=n(48894),c=n(13306),s=n(6442),u=(0,o.createContext)({isOpenPopupCollection:!1,setIsOpenPopupCollection:function(){},onSubmitPopupCollection:function(){return new Promise((function(){return!0}))}}),d=function(){return(0,o.useContext)(u)},p=function(e){var t=e.value,n=e.children,o=(0,s.A)().formatMessage;return(0,r.Y)(u.Provider,{value:(0,a.A)((0,i.A)({},t),{onSubmitPopupCollection:function(e){var t=e.callingCode,n=e.countryCode,i=e.phone;return l.F.collectionSubmitCTA({area_code:t,country_code:n,cta_text:o({id:"common.contactVia",defaultMessage:"Contact {name}"},{name:c.so.Zalo}),phone_number:i,source_url:window.location.href,messaging_app:c.so.Zalo})}}),children:n})}},92047:function(e,t,n){n.d(t,{Gp:function(){return y},IL:function(){return h},eZ:function(){return _}});var i=n(53513),a=n(63538),r=n(73884),o=n(27516),l=n(84655),c=n(59850),s=n(14265),u=n(84091),d=n(73419),p=n(12215),f=n.n(p),m=n(28543),h=function(e){var t=e.vaccinationDetail,n=e.vaccinationPackages,p=t.id,f=t.hospital_branch,h=t.organization,g=f.id,v=h.id,_=(0,r.useState)(!0),y=_[0],b=_[1],w=(0,r.useState)(n||[]),N=w[0],k=w[1],Y=(0,d.$)().locale,A=o.y[Y],D=(0,r.useCallback)((function(e){var t=e.clinic_id,n=e.product_id,r=e.hospital_id,o=e.product_type,d=void 0===o?s.V.vaccine_package:o,p=e.site;b(!0);var f={clinic_id:t,product_id:n,hospital_id:r,product_type:d,site:p};l.W.withCached(c.R.GET_VACCINATION_PACKAGES,(function(){return(0,u.px)((0,u.$k)(c.R.GET_VACCINATION_PACKAGES,f),"GET")})).then((function(e){var t=(e.data||{}).packages;if(t&&(null===t||void 0===t?void 0:t.length)){var n=x(t.map((function(e){var t=e.id;return"".concat(t)})));k(t.map((function(e){return(0,a.A)((0,i.A)({},e),{stock:n[e.id]})})))}})).finally((function(){return b(!1)}))}),[]);return(0,r.useEffect)((function(){p&&g&&v&&m.LG.includes(Y)?D({product_id:p,clinic_id:g,hospital_id:v,site:A}):b(!1)}),[p,g,v]),(0,r.useEffect)((function(){if(null===n||void 0===n?void 0:n.length){var e=x(n.map((function(e){var t=e.id;return"".concat(t)})));k(n.map((function(t){return(0,a.A)((0,i.A)({},t),{stock:e[t.id]})})))}}),[n]),(0,r.useMemo)((function(){return{loading:y,setLoading:b,vaccinationPackages:N,setVaccinationPackages:k,fetchVaccinationPackages:D}}),[y,b,N,k,D])},g="VC_PKG_MG_NUM",v=function(e,t){return e+Math.floor(Math.random()*(t-e+1))};function _(){try{return JSON.parse(f().get(g)||"{}")||{}}catch(e){return{}}}function y(e,t){var n=_();return n[e]?n[e]=t>0?t:v(3,6):n[e]=v(3,6),f().set(g,JSON.stringify(n)),n}function x(e){var t=_(),n=!0,i=!1,a=void 0;try{for(var r,o=e[Symbol.iterator]();!(n=(r=o.next()).done);n=!0){var l=r.value;t[l]||(t[l]=v(3,6))}}catch(c){i=!0,a=c}finally{try{n||null==o.return||o.return()}finally{if(i)throw a}}return Object.keys(t).length&&f().set(g,JSON.stringify(t)),t}},73:function(e,t,n){n.d(t,{Kt:function(){return o},dm:function(){return l}});var i,a=n(38971),r=n(92793),o=(i={},(0,a.A)(i,r.L.Vietnam,"https://m.me/hellobacsi"),(0,a.A)(i,r.L.Malaysia,"https://m.me/HelloDoktorMY"),i),l=(0,a.A)({},r.L.Malaysia,"https://api.whatsapp.com/send/?phone=60163469577&text&type=phone_number&app_absent=0");(0,a.A)({},r.L.Vietnam,"https://zalo.me/3186943975751313634")}}]);