"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[137],{xQTE:function(e,t,n){n.d(t,{C:function(){return CardPost},S:function(){return SourceList},V:function(){return VerifiedTag},a:function(){return CardPostPopoverMore},b:function(){return CardReply},c:function(){return CardReplyPopover}});var l=n("XBaX"),a=n("q1tI"),r=n("cw2P"),i=n("0mzb"),o=n("RVQf"),s=n("ns0B"),d=n.n(s),c=n("lcQT"),u=n("0aVn"),m=n("EnpW"),p=n("aZjv"),g=n("Czgk"),h=n("YHaB"),v=n("rBCA"),b=n("+J3I"),E=n("iBNF"),y=n("KMnL"),f=n("IQVP"),x=n("OpGc"),w=n("Zzgq"),T=n("IIrQ"),S=n("9vqH"),I=n("YRwx"),C=n("qR8+"),_=n("vWP/"),R=n("VLUI"),O=n("h84G"),N=n("MZpI"),k=n("QaGV"),B=n("bpvy"),M=n("Of7P"),L=n("HalR"),A=n("Hoxw"),U=n("eosd"),P=n("xrdX"),D="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath fill='%233E3F58' d='M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M19 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2'/%3e%3c/svg%3e",H="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='3' height='13' fill='none'%3e%3ccircle cx='1.583' cy='6.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 6.417)'/%3e%3ccircle cx='1.583' cy='1.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 1.417)'/%3e%3ccircle cx='1.583' cy='11.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 11.417)'/%3e%3c/svg%3e",j="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M2 4h12'/%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.334 1.334 0 0 1 1.334 1.334V4m2 0v9.333a1.334 1.334 0 0 1-1.334 1.334H4.667a1.334 1.334 0 0 1-1.334-1.334V4zM6.667 7.333v4M9.333 7.333v4'/%3e%3c/svg%3e";let CardPostPopoverMore=({authorEmail:e,onDeletePost:t,shareUrl:n,post:r,className:i="",popoverClassName:s="",onEditPost:d})=>{let{data:{locale:v,userInfo:b,env:{isMarryBaby:E}}}=(0,a.useContext)(g.T),{t:y}=(0,o.u)(),[f,x]=(0,a.useState)(!1),[w,T]=(0,a.useState)(!1),[S,I]=(0,a.useState)(!1),{authActionWrapper:C}=(0,p.iV)(),_=e&&(null==b?void 0:b.email)&&e===String(null==b?void 0:b.email);return a.createElement("div",{className:i,onClick:e=>{e.preventDefault(),e.stopPropagation()}},S&&a.createElement(c.S,{url:n,text:null==r?void 0:r.title,onClose:()=>I(!1)}),w&&a.createElement(c.P,{thumbnail:u.C.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:y("popup.deletePost.title"),description:y("popup.deletePost.description"),acceptText:y("popup.deletePost.accept"),cancelText:y("popup.deletePost.cancel"),onAccept:()=>(0,l.a)(void 0,void 0,void 0,function*(){if((null==r?void 0:r.id)&&!f){x(!0);try{let e=yield(0,c.h)({id:r.id,locale:v});(null==e?void 0:e.status)===1&&(null==t||t())}catch(e){}x(!1)}}),onClose:()=>T(!1)}),a.createElement(h.b,{className:s,toggleButtonContent:a.createElement("img",{src:E?D:H,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:f},data:_?{isShowheader:!1,type:"list",list:[{icon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M7.17 3.236H2.995a1.193 1.193 0 0 0-1.193 1.192v8.35a1.193 1.193 0 0 0 1.193 1.192h8.35a1.193 1.193 0 0 0 1.192-1.192V8.603'/%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M11.643 2.341a1.265 1.265 0 0 1 1.789 1.79L7.766 9.795l-2.385.596.596-2.385z'/%3e%3c/svg%3e",label:y("actionPopover.edit"),onClick:d},{icon:j,label:y("actionPopover.delete"),onClick:()=>{C(()=>T(!0))}}]}:{isShowheader:!1,type:"list",list:[{icon:c.i,label:y("morePopover.report"),subTree:{title:y("morePopover.report.title"),description:y("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(m.R).map(e=>({label:m.R[e].label,reason:m.R[e].reportReasonText,reasonValue:e})).map(e=>({label:y(e.label),subTree:{title:y("morePopover.reportSubmit.title"),description:y("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>a.createElement(c.b,{reason:e.reasonValue,reasonText:y(e.reason),postId:null==r?void 0:r.id,onClose:()=>t&&t(!1)})}}))}}]}}))},z=v.Z.div` position: relative; margin-bottom: 24px; background: white; border-radius: ${E.r.borderRadius}; a { text-decoration: none; } ${b.M.mbDown} { margin-bottom: 8px; } &.flat-top { border-top-left-radius: 0; border-top-right-radius: 0; } .post-pin { padding: 0.5rem 1rem; border-radius: ${E.r.borderRadius} 6px 0 0; } .post-author { display: flex; align-items: center; justify-content: space-between; &.comment { padding-right: 2.6rem; } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.M.mbDown} { width: 32px; height: 32px; font-size: 16px; } } } .post-content-link-wrapper { color: inherit; cursor: pointer; .post-content-title { padding: 1rem 1rem 0; word-break: break-word; } } .social-preview-wrapper.has-image { margin-bottom: 5px; } .social-preview-wrapper, .image-preview-wrapper, .link-preview-wrapper { width: 100%; &[data-is-reply='true'] { padding-right: 1rem; padding-left: 1rem; } } .post-topics { padding: 0 1rem; } .post-reaction { background: none; border-radius: 0 0 6px 6px; &.hide-top-border { ::before { display: none; } } } .most-engaging-wrapper { padding: 1rem; cursor: pointer; .author-avatar-wrapper { width: 2rem; height: 2rem; font-size: 1rem; } .see-more-comments { width: 100%; padding: 12px 0 0; text-align: unset; } } &[data-most-engaging='true'] { border: none; ${b.M.mbDown} { margin: 1rem; border: 1px solid #e4e8ec; } } .top-divider { border-color: #e4e8ec; } .popover { .popover-menu__btn { display: flex; width: 1.5rem; height: 1rem; align-items: center; justify-content: center; padding: 0; background: transparent; &:hover { background-color: transparent; } } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 12.5px; } } } } } &[data-is-marrybaby='true'] { border: 1px solid #f3f3f3; border-radius: 1rem; /* shadow */ box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.08); .image-preview-wrapper, .link-preview-wrapper { padding-right: 1rem; padding-left: 1rem; } .popover { .popover-menu__btn { width: 24px; height: 24px; ${b.M.mbDown} { width: 18px; height: 18px; } } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 1rem; } width: 350px; ${b.M.mbDown} { max-width: calc(320px - 2rem); } } } } } .most-engaging-wrapper { position: relative; padding: 0; &::before { position: absolute; z-index: 5; top: 0; left: 50%; width: calc(100% - 2rem); height: 1px; background: #f3f3f3; content: ' '; transform: translateX(-50%); } } ${b.M.mbDown} { margin-bottom: 12px; } } `;var F="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e";let CardReplyPopover=({onDeleteComment:e,commentId:t,className:n="",popoverClassName:r=""})=>{let{data:{env:{isMarryBaby:i},locale:s},action:{pushNotifications:d}}=(0,a.useContext)(g.T),{t:u}=(0,o.u)(),[m,v]=(0,a.useState)(!1),{authActionWrapper:b}=(0,p.iV)();return a.createElement("div",{className:n,onClick:e=>{e.preventDefault(),e.stopPropagation()}},m&&a.createElement(c.P,{thumbnail:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cg stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' clip-path='url(%23a)'%3e%3cpath d='M2 4.008h12m-8.667 0V2.675a1.333 1.333 0 0 1 1.334-1.333h2.666a1.333 1.333 0 0 1 1.334 1.333v1.333m2 0v9.334a1.333 1.333 0 0 1-1.334 1.333H4.667a1.333 1.333 0 0 1-1.334-1.333V4.008zm-6 3.334v4m2.666-4v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='a'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:u("popup.deleteComment.title"),description:u("popup.deleteComment.description"),acceptText:u("popup.deletePost.accept"),cancelText:u("popup.deletePost.cancel"),onAccept:()=>(0,l.a)(void 0,void 0,void 0,function*(){var n;if(!t)return;let l=yield(0,c.j)({id:t,locale:s});(null==l?void 0:l.status)===1?(e&&e(),d({title:"",message:u("notification.success"),type:"success"})):d({title:"",message:(null===(n=null==l?void 0:l.messages)||void 0===n?void 0:n[0])||u("notification.failure"),type:"danger"})}),onClose:()=>v(!1)}),a.createElement(h.b,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:j,label:u("actionPopover.delete"),onClick:()=>{b(()=>{v(!0)})}}]},className:r,toggleButtonContent:a.createElement("img",{src:i?D:H,loading:"lazy"}),buttonProps:{}}))},G=v.Z.div` .add-link { color: ${E.r.colors.primaryBase}; } `,V=v.Z.div` margin: 16px 0; background: ${E.r.colors.yellow50}; padding: 5px 10px; border-radius: 2px; .icon { display: inline-block; vertical-align: middle; margin-right: 6px; } `,$=v.Z.div` display: flex; align-items: center; gap: 8px; `,W=v.Z.div` padding: 8px 16px; `,Q=v.Z.div` margin-bottom: 12px; width: 100%; `,Y=v.Z.div``,q=v.Z.div` margin-bottom: 16px; `,Z=v.Z.div` display: flex; flex-wrap: wrap; row-gap: 16px; ${b.M.tdUp} { align-items: center; column-gap: 24px; } `,K=v.Z.a` display: flex; align-items: center; gap: 16px; ${b.M.mbDown} { width: 100%; justify-content: space-between; } `,X=v.Z.div` display: flex; align-items: center; gap: 16px; `,J=v.Z.div` border-radius: ${E.r.borderRadius}; overflow: hidden; width: 48px; height: 48px; img { object-fit: cover; width: 100%; height: 100%; } `,RecommentCategories=({categories:e})=>{let{t}=(0,o.u)(),{data:{locale:n,env:{isMarryBaby:l}}}=(0,a.useContext)(g.T),r=(0,U.g)(n,l);return a.createElement(Y,null,a.createElement(q,null,a.createElement(i.H,{tag:"h6",as:"h5"},t("cardReply.recommentCategories.heading"))),a.createElement(Z,null,e.map(e=>a.createElement(K,{href:r+e.permalink,key:String(e.termId),target:"_blank"},a.createElement(X,null,a.createElement(J,null,a.createElement("img",{src:e.featureImage||u.C.getAssetPath(l?"mb-logo.svg":"/logo/logomark.png"),alt:e.displayName,loading:"lazy"})),a.createElement(L.T,{size:"s3",weight:"bold"},e.displayName)),a.createElement(R.Z,{size:20,color:E.r.colors.gray400})))))},ee=v.Z.a` padding: 12px 0; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid ${E.r.colors.neutral100}; text-decoration: none; &:first-child { border-top: 0; } `,SourceItem=({postTitle:e,articleReviewed:t,modifiedTime:n,href:l})=>{let{t:r}=(0,o.u)(),i=(()=>{let{expert:e,editor:n,is_author:l}=t;if(e){let t={name:e.display_name,role:"expert",avatar:e.avatar};return l?Object.assign({title:r("articleAuthor.title.written-by")},t):"expert"===e.role?Object.assign({title:r("articleAuthor.title.expert")},t):Object.assign({title:r("articleAuthor.title.medical")},t)}if(n)return{title:r("articleAuthor.title.fact-check"),name:n.display_name,avatar:n.avatar}})();return a.createElement(ee,{href:l,title:e,target:"_blank"},a.createElement(L.T,{size:"s3",as:"h5",weight:"bold"},e),a.createElement("div",null,a.createElement(w.C,{avatar:null==i?void 0:i.avatar,avatarProps:{size:32},name:null==i?void 0:i.name,role:null==i?void 0:i.role,hideBackground:!0},a.createElement(w.C.SubTextRow,null,a.createElement(w.C.SubText,null,null==i?void 0:i.title," ",a.createElement("span",{style:{color:E.r.colors.gray800}},null==i?void 0:i.name)),a.createElement(w.C.SubDivider,null),a.createElement(w.C.SubText,null,n)))))};var et={header:"F4mmgSy",chevron:"A7QrQ7A"};let SourceList=e=>{var{listUrl:t,hideSourceList:n,categorySlug:s,editMode:d,collapseSource:c,onListChange:m,isMarryBaby:p}=e,h=(0,l._)(e,["listUrl","hideSourceList","categorySlug","editMode","collapseSource","onListChange","isMarryBaby"]);let{t:v}=(0,o.u)(),[b,x]=(0,a.useState)(t||[]),[w,T]=(0,a.useState)([]),[S,I]=(0,a.useState)([]),[C,R]=(0,a.useState)(!1);(0,a.useEffect)(()=>{n||(0,l.a)(void 0,void 0,void 0,function*(){R(!0);let e=b.map(e=>{let t=new URL(e),n=String(t.pathname).split("/").filter(e=>""!=e),l=t.origin,a=-1!==l.search("marrybaby.vn");return{isMarrySite:a,path:n[n.length-1],href:e}}),t=[...e.map(e=>(0,g.c)(e.isMarrySite?(0,g.s)(f.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0):(0,g.g)(f.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0),"GET"))],n=yield Promise.all(t);T(n.map((t,n)=>{var l,a;return(null===(l=null==t?void 0:t.data)||void 0===l?void 0:l.post)&&Object.assign(Object.assign({},(0,y.b)(null===(a=null==t?void 0:t.data)||void 0===a?void 0:a.post)),{href:e[n].href})}).filter(Boolean)),R(!1)})},[]),(0,a.useEffect)(()=>{!n&&(null==w?void 0:w.length)===0&&s&&(0,l.a)(void 0,void 0,void 0,function*(){var e;let t=yield(0,g.c)(p?(0,g.s)(f.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0):(0,g.g)(f.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0),"GET");(null==t?void 0:t.data)&&I([(0,y.h)(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.category)])})},[w]);let handleRemoveItem=e=>{x(t=>{let n=[...t];return n.splice(e,1),n}),T(t=>{let n=[...t];return n.splice(e,1),n})};return(0,a.useEffect)(()=>{null==m||m(b)},[b]),a.createElement("div",Object.assign({},h),!d&&a.createElement(V,null,a.createElement("img",{className:"icon",src:u.C.getAssetPath("warning.svg"),alt:"warning",style:{marginBottom:"3px",width:"18px"},loading:"lazy"}),a.createElement(L.T,{size:"s3",as:"span",dangerouslySetInnerHTML:{__html:v("cardReply.disclaimer")}})),n?null:C?a.createElement(A.L,null):w.length>0||d?a.createElement(G,null,a.createElement(B.U,{defaultValue:!c&&"accordion",styles:{control:{borderRadius:"inherit",'&[aria-expanded="false"]':{borderBottom:0}},chevron:{width:"32px",height:"32px"},content:{padding:0,borderBottom:0,borderTop:`1px solid ${E.r.colors.neutral100}`},item:{marginBottom:"16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",border:`1px solid ${E.r.colors.neutral100}`,borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px","&[data-active]":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},chevron:a.createElement("div",{className:et.chevron},a.createElement(O.Z,{color:E.r.colors.gray600,size:20}))},a.createElement(B.U.Item,{value:"accordion"},a.createElement(B.U.Control,null,a.createElement("div",{className:et.header},a.createElement(i.H,{as:"h4",tag:"h6"},v("cardReply.source")))),a.createElement(B.U.Panel,null,a.createElement(W,null,(w||[]).map((e,t)=>a.createElement($,{key:String(t)},"object"==typeof e?a.createElement(SourceItem,Object.assign({},e)):a.createElement(Q,null,a.createElement(M.I,{style:{width:"100%"},name:"source-list",value:e||"",size:"sm",onChange:e=>{x(n=>{let l=[...n];return l[t]=e,l}),T(n=>{let l=[...n];return l[t]=e,l})}})),d&&a.createElement(r.B,{size:"md",color:"transparent",icon:a.createElement(N.Z,null),onClick:()=>handleRemoveItem(t)}))),d&&a.createElement(r.B,{className:"add-link",color:"transparent",size:"md",icon:a.createElement(_.Z,{color:E.r.colors.primaryBase,size:18}),onClick:()=>{x(e=>[...e,""]),T(e=>[...e,""])}},"Add source")))))):a.createElement(RecommentCategories,{categories:S}))},en=v.Z.div` position: relative; margin-bottom: 0; background: white; border-radius: ${E.r.borderRadius}; .verify-tag { margin-top: 12px; } .post-author { &.with-popover { padding-right: 2.6rem; } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.M.mbDown} { width: 32px; height: 32px; font-size: 16px; } } } .image-preview-wrapper, .link-preview-wrapper { width: 100%; &[data-is-reply='true'] { padding-right: 1rem; padding-left: 1rem; } } .post-reaction { background: none; border-radius: 0 0 6px 6px; } &[data-is-reply='true'] { > .post-author .author-avatar-wrapper { width: 20px; height: 20px; font-size: 10px; } } &[data-is-reply='false'] { border: 1px solid #e4e8ec; } .expert-wrapper { width: 100%; } &[data-has-booking='true'] { display: grid; .post-author { background-color: ${E.r.colors.primary50}; } .btn-wrapper { padding: 0 16px; .btn-booking { width: 100%; margin: 12px 0; } } } .comment-reply-wrapper { padding: 0 1rem; .more-cmt { .chevron-right { height: 1rem; width: 1rem; vertical-align: middle; } } } .top-divider { border-color: #e4e8ec; } .popover { position: absolute; top: 1.5rem; right: 1rem; .popover-menu__btn { display: flex; width: 1rem; height: 1rem; align-items: center; justify-content: center; padding: 0; background: transparent; &:hover { background-color: transparent; } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 12.5px; } } } } } } &[data-is-marrybaby='true'] { &[data-is-reply='false'] { border: none; } .image-preview-wrapper, .link-preview-wrapper { padding-right: 1rem; padding-left: 1rem; } .popover { .popover-menu__btn { width: 24px; height: 24px; } } margin-left: 56px; ${b.M.mbDown} { margin-left: 40px; } > .post-author { margin-left: -56px; ${b.M.mbDown} { margin-left: -40px; } .author-info { align-items: center; display: flex; align-items: center; .author-info-top { width: 100%; } .author-info-text-wrapper { justify-content: space-between; } } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.M.mbDown} { width: 24px; height: 24px; font-size: 12px; } } } &[data-is-reply] { > .post-author { .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.M.mbDown} { width: 24px; height: 24px; font-size: 12px; } } } } .comment-reply-wrapper { padding-right: 0; padding-left: 0; } .post-reaction { &::after { position: absolute; bottom: 0; left: 50%; width: calc(100% - 2rem); height: 1px; background: #f3f3f3; content: ' '; transform: translateX(-50%); } } .post-content-wrapper { padding-top: 0; padding-bottom: 0; ${b.M.mbDown} { padding-left: 0.5rem; } } ${b.M.mbDown} { margin-bottom: 12px; } } `,el=(0,v.Z)(SourceList)` margin-top: 12px; padding: 0.5rem 1rem 1rem; `,VerifiedTag=({userId:e,avatar:t,name:n,role:l,title:i,className:s})=>{let{t:d}=(0,o.u)(),[c,u]=(0,a.useState)(!1);return a.createElement(a.Fragment,null,a.createElement(r.B,{className:`-dzIuHr ${s}`,color:"success",size:"xs",onClick:()=>u(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},a.createElement("span",{className:"text"},a.createElement(k.Z,{isSolid:!0,size:18,color:E.r.colors.green800,className:"icon"}),d("cardReply.verifyBy",{name:`${n||""}`}))),a.createElement(w.c,{open:c,onClose:()=>u(!1),profileModalProps:{zIndex:1e3}},a.createElement(T.a,{authorProps:{userId:e,avatar:t,name:n,role:l,title:i},hideQuestionTab:!0})))},CardReply=({className:e,style:t,comment:n,type:i="comment",level:s=0,replyingId:d,onPostCommentSuccess:u,post:m,onDeleteComment:v,refetchComment:b,hasQuickBookingEnable:E,handleMakeAppointment:y,cardAuthorProps:I,maxChars:_=600,disableShortenContent:R})=>{var O,N,k,B,M,L,A,U,D,H,j,z,F;let{data:{locale:G,userInfo:V,env:{isMarryBaby:$}}}=(0,a.useContext)(g.T),{t:W}=(0,o.u)(),[Q,Y]=(0,a.useState)(n||null),{id:q,countLikes:Z,content:K,replies:X=[],images:J=[],author:ee,liked:et,link:ea,mentionedUser:er,mentions:ei}=Q,{text:eo,replyingTo:es}=(0,c.k)(K),{authActionWrapper:ed}=(0,p.iV)({_joinCommunityIds:[null===(O=null==m?void 0:m.community)||void 0===O?void 0:O.id],_joinTopicIds:null===(N=null==m?void 0:m.topics)||void 0===N?void 0:N.map(e=>e.id)}),[ec,eu]=(0,a.useState)(4),em=null!=V&&!!V.id&&(null==X?void 0:X.some(e=>e.author.id===V.id)),addNewReply=e=>{Y(t=>{if(!t.replies.find(t=>t.id===e.id)){t.replies.unshift(e);let n=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return b&&b(n),n}return t})},[ep,eg]=(0,a.useState)(!1),eh=(0,a.useMemo)(()=>"comment"===i&&X&&0!=X.length?X.sort((e,t)=>{let n=new Date(e.createdAt).getTime(),l=new Date(t.createdAt).getTime();return n>l?-1:n{var e,t;(null==ee?void 0:ee.hospitalId)&&(e=ee.hospitalId,(0,l.a)(void 0,void 0,void 0,function*(){var t;let n=yield(0,g.c)((0,g.b)(f.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:P.v[G]}),"get");(null===(t=null==n?void 0:n._data)||void 0===t?void 0:t.branch)&&eS(null==n?void 0:n._data.branch)})),(null==ee?void 0:ee.doctorId)&&(t=ee.doctorId,(0,l.a)(void 0,void 0,void 0,function*(){var e;let n=yield(0,g.c)((0,g.b)(f.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:P.v[G]}),"get");(null===(e=null==n?void 0:n._data)||void 0===e?void 0:e.doctor)&&eC(null==n?void 0:n._data.doctor)}))},[ee.hospitalId,ee.doctorId]);let e_=(null==eI?void 0:eI.valid_outpatient)||(null==eI?void 0:eI.valid_telemedicine),eR=((null==eT?void 0:eT.total_available_service)||(null==eT?void 0:eT.total_available_doctor))>0,eO=E&&(e_||eR),eN=(null===(B=null==Q?void 0:Q.author)||void 0===B?void 0:B.type)==="chatbot";return a.createElement(p.I_,{defaultParams:{_joinCommunityIds:[null===(M=null==m?void 0:m.community)||void 0===M?void 0:M.id],_joinTopicIds:null===(L=null==m?void 0:m.topics)||void 0===L?void 0:L.map(e=>e.id)}},a.createElement(en,{className:e,style:t,"data-is-reply":!!s,"data-is-marrybaby":$,"data-has-booking":eO},"reply"===i&&a.createElement(C.D,{className:"top-divider",type:"solid"}),a.createElement("div",{style:{padding:"16px 16px 0"}},a.createElement(w.C,Object.assign({avatar:ef,name:eE,username:ey,timeText:null==m?void 0:m.createdTime,community:null==m?void 0:m.community,className:`post-author ${eb?"with-popover":""}`,type:i,userId:null==ee?void 0:ee.id,role:ex,expertId:null==ee?void 0:ee.partnerId,title:null==ee?void 0:ee.title,doctorId:null==ee?void 0:ee.doctorId,hospitalId:null==ee?void 0:ee.hospitalId,hasQuickBooking:eO,handleMakeAppointment:y,isAnonymous:(null==Q?void 0:Q.isAnonymous)||!!(null==m?void 0:m.isAnonymous)&&(null===(A=null==m?void 0:m.author)||void 0===A?void 0:A.username)===(null==ee?void 0:ee.username),hideBackground:eN,userType:null==ee?void 0:ee.type},I)),!!(null==Q?void 0:Q.isVerify)&&!(null==Q?void 0:Q.isOppose)&&a.createElement(VerifiedTag,{title:null===(U=null==Q?void 0:Q.userVerify)||void 0===U?void 0:U.title,name:null===(D=null==Q?void 0:Q.userVerify)||void 0===D?void 0:D.name,userId:null===(H=null==Q?void 0:Q.userVerify)||void 0===H?void 0:H.id,role:null===(j=null==Q?void 0:Q.userVerify)||void 0===j?void 0:j.role,avatar:null===(z=null==Q?void 0:Q.userVerify)||void 0===z?void 0:z.avatar,className:"verify-tag"})),a.createElement(T.P,{className:"post-content-wrapper",replyingTo:es,mentionedUser:er,description:eo,mentions:ew,maxChars:_,disableShortenContent:R}),a.createElement("span",null),a.createElement("span",null),J&&J.length>0?a.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},a.createElement(S.a,{images:J,authorName:null==ee?void 0:ee.username})):null,(!J||0===J.length)&&ea?a.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},a.createElement(x.C,{url:ea})):null,"most-engaging"!==i?a.createElement(a.Fragment,null,eN&&a.createElement(el,{listUrl:null==Q?void 0:Q.source,categorySlug:null==Q?void 0:Q.categorySlug}),a.createElement(h.C,{type:h.c.reply,loveCount:Z,replyCount:ev,className:"post-reaction",liked:et,isReplied:em,hideCommentIcon:"reply"===i||eN,hasShare:!1,onCommentClick:()=>ed(()=>eg(e=>!e)),onCommentCountClick:()=>ed(()=>{eg(!0)}),onLikeClick:()=>ed(()=>(0,l.a)(void 0,void 0,void 0,function*(){if(q){let e=yield(0,c.l)({commentId:q,setLike:!et,locale:G});1===e.status&&Y(e=>Object.assign(Object.assign({},e),{liked:!et,countLikes:e.countLikes+(et?-1:1)}))}}))}),ep&&a.createElement(c.I,{replyingId:d||Q.id,replyToName:eE,isReply:!0,onClose:()=>eg(!1),onPostSuccess:e=>{"reply"===i?u&&u(e):addNewReply(e)},post:m,replyingUser:ee}),"comment"===i&&X&&X.length>0?a.createElement("div",{className:"comment-reply-wrapper"},null===(F=null==eh?void 0:eh.slice(0,ec))||void 0===F?void 0:F.map(e=>a.createElement(CardReply,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:s+1,replyingId:q,onPostCommentSuccess:addNewReply,post:m,onDeleteComment:()=>{Y(t=>Object.assign(Object.assign({},t),{replies:t.replies.filter(t=>t.id!==e.id),countReplies:t.countReplies-1}))},handleMakeAppointment:y,hasQuickBookingEnable:E})),ev>ec&&a.createElement(a.Fragment,null,a.createElement(C.D,{className:"top-divider",type:"solid"}),a.createElement(r.B,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>eu(e=>e+4)},W("comment.seeMoreReplies",{count:ev-ec}),a.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 12 4-4-4-4'/%3e%3c/svg%3e",loading:"lazy"})))):null):null,eb&&a.createElement(CardReplyPopover,{onDeleteComment:v,className:"popover",commentId:Q.id})))},getMostEngagingComment=(e,t)=>(0,l.a)(void 0,void 0,void 0,function*(){var n,l,a;let r=yield(0,g.t)((0,g.f)(f.yy.COMMENT.LIST,{postId:e,_locale:t,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(a=null===(l=null===(n=null==r?void 0:r.data)||void 0===n?void 0:n.comments)||void 0===l?void 0:l.map(y.g))||void 0===a?void 0:a[0]}),CardPost=({className:e,style:t,hideViewMoreComment:n,showMostEngaging:s,onCommentClick:u,onCommentCountClick:v,onMostEngagingCommentClick:b,onPostCommentSuccess:E,disableCardLink:y,disableShortenContent:C,onDeletePost:_,onEditPost:R,post:O,mostEngagingComment:N,onDeleteComment:k,showInputComment:B,InlineCommentsComponent:M,hasQuickBookingEnable:L,handleMakeAppointment:A,onSaveUnsaveSuccess:U,cardAuthorProps:P,verticalReactions:D=!1})=>{let[H,j]=(0,a.useState)(O),[G,V]=(0,a.useState)(!1),[$,W]=(0,a.useState)(N),{community:Q,topics:Y,author:q,slug:Z,isPin:K,liked:X,photos:J,mentions:ee,title:et,description:en,previewUrl:el,likesCount:ea,commentsCount:er,id:ei,commented:eo}=H,{data:{locale:es,togetherUserId:ed,userInfo:ec,env:{isMarryBaby:eu,togetherBasePath:em}},action:{pushNotifications:ep}}=(0,a.useContext)(g.T),eg=!!(null==ec?void 0:ec.id),{t:eh}=(0,o.u)(),[ev,eb]=(0,a.useState)(B),eE=`${em}/${(null==Q?void 0:Q.slug)||"_"}/${Z||""}`,ey=`${(0,g.l)(es)}${eE}`,{authActionWrapper:ef}=(0,p.iV)((null==Q?void 0:Q.slug)?{_joinCommunityIds:[Q.id],_joinTopicIds:null==Y?void 0:Y.map(e=>e.id)}:void 0),[ex,ew]=(0,a.useState)(!1);(0,a.useEffect)(()=>{eb(B)},[B]);let eT=(null==q?void 0:q.name)||(null==q?void 0:q.username)||"",eS=(null==q?void 0:q.username)||(null==q?void 0:q.name)||"",eI=null==q?void 0:q.avatar,eC=(null==H?void 0:H.isAnonymous)?void 0:null==q?void 0:q.role,[e_,eR]=(0,a.useState)(null),[eO,eN]=(0,a.useState)(null);(0,a.useEffect)(()=>{var e,t;(null==q?void 0:q.hospitalId)&&(e=q.hospitalId,(0,l.a)(void 0,void 0,void 0,function*(){var t;let n=yield(0,g.c)((0,g.b)(f.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:g.m[es]}),"get");(null===(t=null==n?void 0:n._data)||void 0===t?void 0:t.branch)&&eR(null==n?void 0:n._data.branch)})),(null==q?void 0:q.doctorId)&&(t=q.doctorId,(0,l.a)(void 0,void 0,void 0,function*(){var e;let n=yield(0,g.c)((0,g.b)(f.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:g.m[es]}),"get");(null===(e=null==n?void 0:n._data)||void 0===e?void 0:e.doctor)&&eN(null==n?void 0:n._data.doctor)}))},[q.hospitalId,q.doctorId]);let ek=(null==eO?void 0:eO.valid_outpatient)||(null==eO?void 0:eO.valid_telemedicine),eB=((null==e_?void 0:e_.total_available_service)||(null==e_?void 0:e_.total_available_doctor))>0;(0,a.useEffect)(()=>{(0,l.a)(void 0,void 0,void 0,function*(){if(ei&&er&&s&&!(null==N?void 0:N.id)){let e=yield getMostEngagingComment(ei,es);W(e)}})},[ei,es,er,s,null==N?void 0:N.id]),(0,a.useEffect)(()=>{W(N)},[null==N?void 0:N.id]);let onDeleteComment=e=>(0,l.a)(void 0,void 0,void 0,function*(){if(er>1&&(null==$?void 0:$.id)&&(null==$?void 0:$.id)===(null==e?void 0:e.id)){let e=yield getMostEngagingComment(ei,es);W(e)}j(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1})),k&&k(e)});return a.createElement(p.I_,{defaultParams:(null==Q?void 0:Q.slug)?{_joinCommunityIds:[Q.id],_joinTopicIds:null==Y?void 0:Y.map(e=>e.id)}:void 0},G&&a.createElement(c.S,{url:ey,avatar:m.a,text:et,onClose:()=>V(!1)}),a.createElement(z,{className:e,style:t,"data-is-marrybaby":eu},K?a.createElement(h.a,{className:"post-pin"}):null,a.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},a.createElement(w.C,Object.assign({avatar:eI,name:eT,username:eS,url:y?void 0:eE,community:Q,timeText:null==H?void 0:H.createdTime,className:"post-author",role:eC,userId:null==q?void 0:q.id,expertId:null==q?void 0:q.partnerId,doctorId:null==q?void 0:q.doctorId,hospitalId:null==q?void 0:q.hospitalId,title:null==q?void 0:q.title,hasQuickBooking:L&&(ek||eB),handleMakeAppointment:A,"data-testid":"name",isAnonymous:!!(null==H?void 0:H.isAnonymous),extendEle:a.createElement(CardPostPopoverMore,{authorEmail:String(null==q?void 0:q.email),onDeletePost:_,shareUrl:ey,post:H,className:"popover",onEditPost:R})},P))),a.createElement("a",{href:y?void 0:eE,className:"post-content-link-wrapper"},et&&a.createElement(i.H,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},d()(et)),a.createElement(T.P,{className:"post-content-wrapper",description:en,disableShortenContent:C,mentions:ee,"data-testid":"Content of the Post"})),a.createElement("span",null),a.createElement("span",null),a.createElement("div",{key:"tag-topic"},Y&&Y.length>0?a.createElement(h.T,{topics:Y,className:"post-topics"}):null),a.createElement("div",{key:"social-preview"},(null==H?void 0:H.introUrl)?a.createElement("div",{className:`social-preview-wrapper ${(null==J?void 0:J.length)?"has-image":""}`},a.createElement(I.S,{url:H.introUrl,image:H.bannerImage})):null),a.createElement("div",{key:"image-preview"},(null==J?void 0:J.length)?a.createElement("div",{className:"image-preview-wrapper"},a.createElement(S.a,{images:J,authorName:null==q?void 0:q.name,isSensitive:!!(null==H?void 0:H.isSensitive)})):null),a.createElement("div",{key:"link-preview"},(null==H?void 0:H.introUrl)||(null==J?void 0:J.length)||null==el||!el.url?null:a.createElement("div",{className:"link-preview-wrapper"},a.createElement(x.C,{title:el.title,url:el.url,image:el.image}))),a.createElement(h.C,{isMarryBaby:eu,type:h.c.post,loveCount:ea,replyCount:er,className:`post-reaction ${(null==J?void 0:J.length)||(null==el?void 0:el.url)?"hide-top-border":""}`,liked:ex?!X:X,isReplied:eo,isSaved:(null==H?void 0:H.bookmarked)||!1,onCommentClick:()=>ef(()=>{u?u():eb(e=>!e)}),onCommentCountClick:()=>{ef(()=>{eu?eb(!0):v?v():y||(window.location.href=eE)})},onShareClick:()=>{V(!0)},onLikeClick:()=>(0,l.a)(void 0,void 0,void 0,function*(){ef(()=>(0,l.a)(void 0,void 0,void 0,function*(){if(ei&&!ex){ew(!0);try{let e=yield(0,c.m)({id:ei,locale:es});(null==e?void 0:e.status)!==1?ep((0,c.g)(eh)):j(e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked}))}catch(e){ep((0,c.g)(eh))}ew(!1)}}))}),onSaveClick:()=>{ef(()=>(0,l.a)(void 0,void 0,void 0,function*(){if((null==ec?void 0:ec.id)&&(null==H?void 0:H.id)){if(null==H?void 0:H.bookmarked){let e=yield(0,g.e)((0,g.f)(f.yy.BOOKMARK.DELETE,{_locale:es}),"DELETE",{headers:{"Content-Type":"application/json"},data:{post_id:String(H.id)}});(null==e?void 0:e.status)===1?(ep({title:"",message:eh("post.remove.success"),type:"success",displayIcon:F}),null==U||U()):ep({title:"",message:eh("post.remove.failed"),type:"danger",displayIcon:F})}else{let e=yield(0,g.e)((0,g.f)(f.yy.BOOKMARK.CREATE,{_locale:es}),"POST",{headers:{"Content-Type":"application/json"},data:{user_id:ed||ec.id,post_id:H.id}});(null==e?void 0:e.status)===1?(ep({title:"",message:eh("post.save.success"),type:"success",displayIcon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23595959'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e"}),null==U||U()):ep({title:"",message:eh("post.save.failed"),type:"danger",displayIcon:F})}}}))},onGoToUrl:e=>{let t=e?`${ey}${e}`:ey;eg?window.location.href=t:ef(()=>window.location.href=t)},showingMostEngaging:!!(s&&(null==$?void 0:$.id)),isVertical:D}),ev&&a.createElement(c.I,{isMainCmt:!B,onClose:()=>eb(!1),onPostSuccess:e=>{0!==er||(null==$?void 0:$.id)||W(e),j(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0})),E&&E(e)},post:H}),s&&(null==$?void 0:$.id)?a.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{b?(e.stopPropagation(),b()):window.location.href=eE}},a.createElement(CardReply,{hasQuickBookingEnable:L,handleMakeAppointment:A,comment:$,post:H,onDeleteComment:()=>{onDeleteComment&&onDeleteComment($)},className:"most-engaging-comment",type:"most-engaging",key:$.id,cardAuthorProps:P}),er>1&&!n&&a.createElement(r.B,{className:"see-more-comments",color:"ghost",size:"md"},eh("comment.seeMoreComments",{count:er-1}))):null,M))}},fRs9:function(e,t,n){n.d(t,{R:function(){return RadioImageGroup}});var l=n("q1tI"),a=n("iBNF"),r=n("rBCA"),i=n("q8y3"),o=n("5Pdi");let s=r.Z.div` display: flex; width: 100%; &[data-direction='vertical'] { flex-direction: column; } &[data-direction='horizontal'] { flex-wrap: wrap; } `,d=r.Z.div` display: flex; padding: 8px; border-radius: ${a.r.borderRadius}; cursor: pointer; & > div { display: flex; width: 100%; height: 100%; flex-direction: column; align-items: center; justify-content: flex-start; } &[data-is-mb='false'] { &[data-selected='true'] { border: 1px solid #2d87f3; background: white; } &[data-selected='false'] { border: 1px solid #f2f2f2; box-shadow: 0px 5px 12px rgba(40, 74, 117, 0.08); } } &[data-is-mb='true'] { border-radius: 16px; background: white; padding: 16px auto; &[data-selected='true'] { border: 1px solid ${a.r.mbColors.mint}; box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.06); } &[data-selected='false'] { border: none; } } &[data-disabled='true'] { cursor: auto; } .radio-group-item-heading { margin-top: 8px; //height: 48px; text-align: center; } .gender-image { width: 70px; height: 70px; &[data-is-mobile='true'] { width: 40px; height: 40px; } } `,RadioImageGroup=({value:e,options:t,className:n,direction:r="horizontal",onChange:c,isDisabled:u,siteType:m})=>{let[p,g]=(0,l.useState)(e),handleOnChange=e=>{!u&&(g(e),c&&c(e))},h="marryBaby"===m;return l.createElement(s,{className:n,"data-direction":r},t.map((t,n)=>l.createElement(d,{"data-selected":(e||p)===t.value,"data-is-mb":h,"data-disabled":u,key:n,onClick:()=>{handleOnChange(t.value)}},l.createElement("div",null,t.content,t.label&&l.createElement(l.Fragment,null,h?l.createElement(i.M,{type:"subtitle-2",color:(e||p)===t.value?a.r.mbColors.dark:a.r.mbColors.midGray},t.label):l.createElement(o.T,{type:"bold",color:(e||p)===t.value?"#2D87F3":"black",className:"radio-group-item-heading",size:"label1"},t.label))))))}},q8y3:function(e,t,n){n.d(t,{M:function(){return MarryBabyText},a:function(){return MarryBabyHeading}});var l=n("XBaX"),a=n("q1tI"),r=n("rBCA"),i=n("iBNF");let o=(0,r.Z)(e=>{var{type:t}=e,n=(0,l._)(e,["type"]);return a.createElement(t,n)})` color: var(--text-color, ${i.r.mbColors.dark}); font-family: Krub; font-weight: 600; letter-spacing: -0.2px; &[data-type='headline-1'] { font-size: 40px; line-height: 60px; } &[data-type='headline-2'] { font-size: 32px; line-height: 48px; } &[data-type='headline-3'] { font-size: 24px; line-height: 40px; } &[data-type='headline-4'] { font-size: 18px; line-height: 32px; } `,s=r.Z.p` color: var(--text-color, ${i.r.mbColors.dark}); letter-spacing: -0.2px; &[data-type='subtitle-1'] { font-size: 16px; font-weight: 600; line-height: 26px; } &[data-type='subtitle-2'] { font-size: 14px; font-weight: 500; line-height: 24px; } &[data-type='subtitle-3'] { font-size: 12px; font-weight: 500; line-height: 20px; } &[data-type='bodytext-1'] { font-size: 16px; font-weight: 400; line-height: 28px; } &[data-type='bodytext-2'] { font-size: 14px; font-weight: 400; line-height: 24px; } &[data-type='bodytext-3'] { font-size: 12px; font-weight: 400; line-height: 20px; } &[data-type='caption-1'] { font-size: 10px; font-weight: 500; letter-spacing: -0.1px; line-height: 14px; } &[data-type='caption-2'] { font-size: 10px; font-weight: 400; letter-spacing: -0.1px; line-height: 14px; } `,MarryBabyHeading=e=>{var{type:t,color:n,style:r}=e,i=(0,l._)(e,["type","color","style"]);return a.createElement(o,Object.assign({type:t,"data-type":{h1:"headline-1",h2:"headline-2",h3:"headline-3",h4:"headline-4"}[t],style:Object.assign(Object.assign({},n&&{"--text-color":n}),r)},i))},MarryBabyText=e=>{var{type:t,color:n,style:r}=e,i=(0,l._)(e,["type","color","style"]);return a.createElement(s,Object.assign({"data-type":t,style:Object.assign(Object.assign({},r),n&&{"--text-color":n})},i))}},"Ld+2":function(e,t,n){n.d(t,{S:function(){return a}});var l=n("2wr/");let a=l.r},"0mzb":function(e,t,n){n.d(t,{H:function(){return Heading}});var l=n("XBaX"),a=n("q1tI"),r=n("8vDj"),i=n("HalR");let Heading=e=>{var{as:t,tag:n,color:o,fontWeight:s,dataEventCategory:d,dataEventAction:c,dataEventLabel:u}=e,m=(0,l._)(e,["as","tag","color","fontWeight","dataEventCategory","dataEventAction","dataEventLabel"]);let p=(0,r.rZ)();return a.createElement(i.T,Object.assign({as:t||n,color:o||p.colors.gray[8],"data-event-category":d,"data-event-action":c,"data-event-label":u,weight:"semibold"===s?"semiBold":"bold",size:n,"data-size":n,"data-font-weight":s||void 0},m))}},sQFf:function(e,t,n){n.d(t,{B:function(){return BabyVaccineForm}});var l,a,r=n("XBaX"),i=n("q1tI"),o=n("iuhU"),s=n("8vDj"),d=n("cChf"),c=n("ZFu2"),u=n("6p9C"),m=n("HalR"),p=n("RVQf"),g=n("g+a8"),h=n("dU++"),v=n("xzoI"),b=n("fkrl");let E=(0,i.createContext)({}),DefaultLayout=e=>{var t=(0,r._)(e,[]);let{t:n}=(0,p.u)(),{currentUrl:l,submitProps:a,form:s}=(0,i.useContext)(E),{classes:d={}}=(0,i.useContext)(g.C);return i.createElement(h.H,Object.assign({formLayout:"default"},t),i.createElement(h.H.FormRow,null,i.createElement(v.G,Object.assign({isBaby:!0},s.getInputProps("gender")))),i.createElement(h.H.FormRow,null,i.createElement(u.D,Object.assign({label:i.createElement(m.T,{size:"p2",weight:"semiBold"},n("babyGrowth.input.birthday")),placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0},maxDate:new Date},s.getInputProps("age")))),i.createElement(h.H.FormRow,{className:d.submitWrapper},i.createElement(h.H.Submit,Object.assign({type:"submit",className:(0,o.default)("due-date-calculate-button",d.submitBtn),dataEventCategory:"Health Tool",dataEventAction:"Vaccination Tool",dataEventLabel:l},a),n("dueDatePage.lastPeriod.calculate"))))},InlineLayout=e=>{var t=(0,r._)(e,[]);let{t:n}=(0,p.u)(),{currentUrl:l,submitProps:a,form:s}=(0,i.useContext)(E),{classes:d={}}=(0,i.useContext)(g.C);return i.createElement(h.H,Object.assign({formLayout:"inline"},t),i.createElement(h.H.FormRow,null,i.createElement(h.H.BorderInlineControl,{label:n("tools.selectBabyGender"),width:"none"},i.createElement(v.G,Object.assign({isBaby:!0,hideLabel:!0,type:"radio"},s.getInputProps("gender")))),s.errors.gender&&i.createElement(h.H.Error,null,s.errors.gender)),i.createElement(h.H.FormRow,null,i.createElement(h.H.BorderInlineControl,{label:n("babyGrowth.input.birthday")},i.createElement(u.D,Object.assign({placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0},maxDate:new Date},s.getInputProps("age"),{error:null}))),s.errors.age&&i.createElement(h.H.Error,null,s.errors.age)),i.createElement(h.H.FormRow,{className:d.submitWrapper},i.createElement(h.H.Submit,Object.assign({type:"submit",className:(0,o.default)("due-date-calculate-button",d.submitBtn),dataEventCategory:"Health Tool",dataEventAction:"Vaccination Tool",dataEventLabel:l},a),n("dueDatePage.lastPeriod.calculate"))))},MbLayout=e=>{var t=(0,r._)(e,[]);let{t:n}=(0,p.u)(),{currentUrl:l,submitProps:a,form:o}=(0,i.useContext)(E);return i.createElement(h.H,Object.assign({formLayout:"default"},t),i.createElement(h.H.Control,null,i.createElement(v.G,Object.assign({isBaby:!0},o.getInputProps("gender"),{error:null}))),o.errors.gender&&i.createElement(h.H.Error,null,o.errors.gender),i.createElement(h.H.FormRow,null,i.createElement(h.H.BorderBoxControl,{label:n("babyGrowth.input.birthday"),rightSection:i.createElement(b.Z,null)},i.createElement(u.D,Object.assign({placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0},maxDate:new Date,rightSection:null},o.getInputProps("age"),{error:null}))),o.errors.age&&i.createElement(h.H.Error,null,o.errors.age)),i.createElement(h.H.Submit,Object.assign({type:"submit",className:"due-date-calculate-button",dataEventCategory:"Health Tool",dataEventAction:"Vaccination Tool",dataEventLabel:l},a),n("dueDatePage.lastPeriod.calculate")))};(l=a||(a={}))[l.trackPeriod=0]="trackPeriod",l[l.conceive=1]="conceive",l[l.avoidPregnancy=2]="avoidPregnancy";let BabyVaccineForm=e=>{var{formLayout:t="default",submitProps:n,currentUrl:l,onSubmit:a}=e,o=(0,r._)(e,["formLayout","submitProps","currentUrl","onSubmit"]);let{t:u}=(0,p.u)(),m=(0,s.rZ)(),g="mb"===m.other.template,h=(0,d.c)({validate:{gender:(0,c.U)(u("validation.error.requiredField")),age:(0,c.U)(u("validation.error.requiredField"))}}),v=Object.assign({onSubmit:h.onSubmit(a)},o);return i.createElement(E.Provider,{value:{submitProps:n,currentUrl:l,form:h}},"inline"===t?i.createElement(InlineLayout,Object.assign({},v)):g?i.createElement(MbLayout,Object.assign({formLayout:t},v)):i.createElement(DefaultLayout,Object.assign({},v)))}},Zh1C:function(e,t,n){n.d(t,{B:function(){return BmiForm},F:function(){return FitnessToolUnitPicker},H:function(){return L},N:function(){return NewsletterCheckbox},Q:function(){return Question1Label},a:function(){return Question2Label},b:function(){return Question2Description}});var l=n("XBaX"),a=n("q1tI"),r=n("wUmw"),i=n("Tn+8"),o=n("EnpW"),s=n("/npG"),d=n("SPK5"),c=n("Eso5"),u=n("8vDj"),m=n("Zo/N"),p=n("mYVa"),g=n("lSJj"),h=n("TIp3"),v=n("OAL+"),b=n("iuhU"),E=n("C/sX"),y=n("NQDR"),f=n("HalR"),x=n("O8A1"),w=n("RVQf"),T=n("dU++"),S=n("/6O3"),I=n("g+a8"),C=n("xzoI"),_=n("qpOh"),R=n("xrdX"),O=n("mx4j");let Question1Label=e=>{var{LabelWrapper:t}=e,n=(0,l._)(e,["LabelWrapper"]);let{t:r}=(0,w.u)(),i=t?{}:Object.assign({size:"p2"},n),o=t||f.T;return a.createElement(o,Object.assign({},i),r("bmi.question.weightLossSupport"))},Question2Label=e=>{var{LabelWrapper:t}=e,n=(0,l._)(e,["LabelWrapper"]);let{t:r}=(0,w.u)(),i=t?{}:Object.assign({size:"p2"},n),o=t||f.T;return a.createElement(o,Object.assign({},i),r("bmi.question.glp1Awareness"))},Question2Description=e=>{var{LabelWrapper:t}=e,n=(0,l._)(e,["LabelWrapper"]);let{t:r}=(0,w.u)(),i=t?{}:Object.assign({size:"p2"},n),o=t||f.T;return a.createElement(o,Object.assign({},i),r("bmi.question.glp1Awareness.desc"))},N=(0,a.createContext)({});var k=(0,s.k)(()=>({label:{marginTop:2,cursor:"pointer",userSelect:"none"}}));let NewsletterCheckbox=e=>{var{labelTextProps:t,checked:n,LabelWrapper:r,useCollapse:i=!0}=e,o=(0,l._)(e,["labelTextProps","checked","LabelWrapper","useCollapse"]);let{t:s}=(0,w.u)(),[u,m]=(0,a.useState)(!i),[p,g]=(0,a.useState)(!0),[h,v]=(0,a.useState)(n),b=r?{}:Object.assign({size:"p3"},t),E=r||f.T,{classes:x}=k(void 0,{name:"NewsletterCheckbox"});return a.createElement(d.k,{gap:8,align:"flex-start"},a.createElement(y.d,Object.assign({},o,{label:void 0,size:"sm",checked:h,onChange:e=>{p?g(!1):v(e.currentTarget.checked)},styles:{labelWrapper:{display:"none"}}})),a.createElement(c.x,null,a.createElement(E,Object.assign({},b,{onClick:()=>{i&&m(e=>!e)},className:x.label,lineClamp:u?void 0:1}),s("bmi.newsletter.label"))))},FitnessToolUnitPicker=({displayValue:e,field:t,onChange:n})=>{let l=(0,u.rZ)(),r=l.colors.gray[1],i="height"===t?[{label:"cm",system:"metric"},{label:"ft",system:"imperial"}]:[{label:"kg",system:"metric"},{label:"lbs",system:"imperial"}];return a.createElement(m.v,{position:"bottom-end",withinPortal:!0,offset:0,styles:{dropdown:{backgroundColor:l.white,border:`${(0,p.h)(1)} solid ${r}`,borderRadius:12,boxShadow:"0px 0px 1px 0px #0000000A,0px 2px 8px 0px #0000000A,0px 10px 16px 0px #0000000A",padding:(0,p.h)(4),minWidth:(0,p.h)(90)},item:{fontSize:l.fontSizes.sm,lineHeight:1.4,padding:`${(0,p.h)(6)} ${(0,p.h)(10)}`,borderRadius:l.radius.xs,color:l.colors.dark[9],"&[data-hovered]":{backgroundColor:"transparent"}}}},a.createElement(m.v.Target,null,a.createElement(g.k,{type:"button",sx:e=>({height:"100%",display:"flex",alignItems:"center",justifyContent:"flex-end",width:"100%",paddingRight:e.spacing.xs,gap:4})},a.createElement(h.x,{component:"span",size:"sm",sx:{lineHeight:1}},e),a.createElement(S.C,{style:{width:18,height:18}}))),a.createElement(m.v.Dropdown,null,i.map(r=>{let i=e===r.label;return a.createElement(m.v.Item,{key:r.label,onClick:()=>n(r.system,t),sx:{backgroundColor:i?l.colors.gray[1]:void 0,"&[data-hovered]":{backgroundColor:i?l.colors.gray[1]:"transparent"}}},r.label)})))},DefaultForm=e=>{var t,n,i,o,s,u,m;let{t:p,locale:g}=(0,w.u)(),{classes:h={}}=(0,a.useContext)(I.C),{control:E,bmiGenerated:f,linkTool:x,submitProps:S,withAdditionalQuestion:C,classes:O={},enableUnitPicker:k,unitSystem:B,unitHeight:M,unitWeight:A,onUnitChange:U}=(0,a.useContext)(N),P={body:{alignItems:"center"}};return a.createElement(T.H,Object.assign({formLayout:"default"},e),a.createElement(L,{isMobile:e.isMobile,gutter:4},a.createElement(v.K,{spacing:4,px:16},a.createElement(r.Qr,{name:"gender",control:E,rules:null===(t=f.gender)||void 0===t?void 0:t.rule,render:({field:{onChange:e},fieldState:{error:t}})=>a.createElement("div",null,a.createElement(L.GenderControl,{LabelWrapper:L.Label,error:void 0,onChange:e,gap:4}),(null==t?void 0:t.message)&&a.createElement(L.Error,{label:t.message}))}),a.createElement(r.Qr,{name:"age",control:E,rules:null===(n=f.age)||void 0===n?void 0:n.rule,render:({field:{name:e,value:t,onChange:n},fieldState:{error:l}})=>a.createElement("div",null,a.createElement(L.InputNumber,{label:a.createElement(L.Label,null,p("bmi.ageInput")),placeholder:p("tools.inputPlaceholder",{content:"25"}),name:e,value:t,onChange:n,min:0,rightSection:p("bmi.ageInput.desc"),classNames:{rightSection:O.inputRightSection}}),(null==l?void 0:l.message)&&a.createElement(L.Error,{label:l.message}))}),a.createElement(r.Qr,{name:"height",control:E,rules:null===(i=f.height)||void 0===i?void 0:i.rule,render:({field:{name:e,value:t,onChange:n},fieldState:{error:l}})=>a.createElement("div",null,a.createElement(L.InputNumber,{label:a.createElement(L.Label,null,p("bmi.heightInput")),placeholder:p("tools.inputPlaceholder",{content:"imperial"===B?6:170}),name:e,value:t,onChange:n,min:0,precision:1,inputMode:"decimal",rightSection:k?a.createElement(FitnessToolUnitPicker,{displayValue:M,field:"height",onChange:U}):p("bmi.heightInput.desc"),rightSectionWidth:70,classNames:{rightSection:O.inputRightSection},styles:k?void 0:()=>({rightSection:{paddingRight:0}})}),(null==l?void 0:l.message)&&a.createElement(L.Error,{label:l.message}))}),a.createElement(r.Qr,{name:"weight",control:E,rules:null===(o=f.weight)||void 0===o?void 0:o.rule,render:({field:{name:e,value:t,onChange:n},fieldState:{error:l}})=>a.createElement("div",null,a.createElement(L.InputNumber,{label:a.createElement(L.Label,null,p("bmi.weightInput")),placeholder:p("tools.inputPlaceholder",{content:"imperial"===B?130:60}),name:e,value:t,onChange:n,precision:1,inputMode:"decimal",min:0,rightSection:k?a.createElement(FitnessToolUnitPicker,{displayValue:A,field:"weight",onChange:U}):p("bmi.weightInput.desc"),rightSectionWidth:70,classNames:{rightSection:O.inputRightSection},styles:k?void 0:()=>({rightSection:{paddingRight:0}})}),(null==l?void 0:l.message)&&a.createElement(L.Error,{label:l.message}))})),C?a.createElement(a.Fragment,null,a.createElement(v.K,{spacing:4,px:16},a.createElement(r.Qr,{name:"question1",control:E,rules:null===(s=f.question1)||void 0===s?void 0:s.rule,render:({field:{value:e,onChange:t,name:n},fieldState:{error:l}})=>a.createElement("div",null,a.createElement(y.R.Group,{name:n,value:e,onChange:t,sx:{flex:1},label:a.createElement(Question1Label,{LabelWrapper:L.Label}),size:"lg"},a.createElement(d.k,{gap:"lg"},a.createElement(y.R,{size:"sm",value:"1",label:a.createElement(L.OptionLabel,null,p("switchBtn.yes")),styles:P}),a.createElement(y.R,{size:"sm",value:"0",label:a.createElement(L.OptionLabel,null,p("switchBtn.no")),styles:P}))),(null==l?void 0:l.message)&&a.createElement(L.Error,{label:l.message}))}),a.createElement(r.Qr,{name:"question2",control:E,rules:null===(u=f.question2)||void 0===u?void 0:u.rule,render:({field:{name:e,value:t,onChange:n},fieldState:{error:l}})=>a.createElement("div",null,a.createElement(y.R.Group,{name:e,value:t,onChange:n,sx:{flex:1},label:a.createElement(Question2Label,{LabelWrapper:L.Label}),size:"lg",description:g!==_.L.Malaysia&&a.createElement(Question2Description,{LabelWrapper:L.SubLabel})},a.createElement(d.k,{gap:"lg"},a.createElement(y.R,{size:"sm",value:"1",label:a.createElement(L.OptionLabel,null,p("switchBtn.yes")),styles:P}),a.createElement(y.R,{size:"sm",value:"0",label:a.createElement(L.OptionLabel,null,p("switchBtn.no")),styles:P}))),(null==l?void 0:l.message)&&a.createElement(L.Error,{label:l.message}))})),a.createElement(c.x,{className:(0,b.default)(O.newsletterBlock,h.newsletterBlock)},a.createElement(v.K,{spacing:8,px:16,py:12},a.createElement(r.Qr,{name:"newsletter",control:E,rules:null===(m=f.newsletter)||void 0===m?void 0:m.rule,render:e=>{var t=e.field,{value:n,onChange:r,name:i}=t,o=(0,l._)(t,["value","onChange","name"]);return a.createElement(NewsletterCheckbox,Object.assign({size:"sm",onChange:e=>r(e.currentTarget.checked),name:i,checked:!!n},o))}}),a.createElement(T.H.Submit,Object.assign({className:"bmi-btn bmi--btn-submit",dataEventCategory:"Health Tool",dataEventAction:"BMI",dataEventLabel:`https://${R.v[g]}/${x}`,type:"submit",fullWidth:!0},S),p("bmi.submit"))))):a.createElement(c.x,{px:16,sx:{paddingBottom:8}},a.createElement(T.H.Submit,Object.assign({className:"bmi-btn bmi--btn-submit",dataEventCategory:"Health Tool",dataEventAction:"BMI",dataEventLabel:`https://${R.v[g]}/${x}`,type:"submit",fullWidth:!0},S),p("bmi.submit")))))};var B=(0,s.k)(e=>({newsletterBlock:{backgroundColor:e.colors.neutral[0],borderBottomLeftRadius:"inherit",borderBottomRightRadius:"inherit",".bmi-btn":{marginTop:0}},inputRightSection:{fontSize:(0,p.h)(13),lineHeight:(0,p.h)(24),color:e.colors.gray[4],justifyContent:"flex-end",paddingRight:8,whiteSpace:"nowrap"}}));let InlineForm=e=>{var t,n,i,o,s,u,m,g;let{t:h,locale:E}=(0,w.u)(),{control:x,bmiGenerated:S,isTouched:O,linkTool:k,submitProps:B,withAdditionalQuestion:M,enableUnitPicker:L,unitSystem:A,unitHeight:U,unitWeight:P,onUnitChange:D}=(0,a.useContext)(N),{classes:H={},variant:j}=(0,a.useContext)(I.C),{classes:z={}}=(0,a.useContext)(N);return a.createElement(T.H,Object.assign({formLayout:"inline"},e),a.createElement(r.Qr,{name:"gender",control:x,rules:null===(t=S.gender)||void 0===t?void 0:t.rule,render:({field:{onChange:e},fieldState:{error:t}})=>a.createElement(T.H.FormRow,null,a.createElement(T.H.BorderInlineControl,{label:h("tools.selectGender"),width:"none",errorMess:O&&(null==t?void 0:t.message)},a.createElement(C.G,{type:"radio",hideLabel:!0,error:O?a.createElement(a.Fragment,null):"",onChange:e})))}),a.createElement(r.Qr,{name:"age",control:x,rules:null===(n=S.age)||void 0===n?void 0:n.rule,render:({field:{name:e,value:t,onChange:n},fieldState:{error:l}})=>a.createElement(T.H.FormRow,null,a.createElement(T.H.BorderInlineControl,{label:h("bmi.ageInput"),errorMess:O&&(null==l?void 0:l.message)},a.createElement(y.I.Number,{placeholder:h("tools.inputPlaceholder",{content:"25"}),name:e,value:t,onChange:n,error:O&&(null==l?void 0:l.message)?a.createElement(a.Fragment,null):"",min:0,rightSection:a.createElement(T.H.Unit,null,h("tools.yearsOld")),styles:()=>({rightSection:{width:"auto"}})})))}),a.createElement(r.Qr,{name:"height",control:x,rules:null===(i=S.height)||void 0===i?void 0:i.rule,render:({field:{name:e,value:t,onChange:n},fieldState:{error:l}})=>a.createElement(T.H.FormRow,null,a.createElement(T.H.BorderInlineControl,{label:h("bmi.heightInput"),errorMess:O&&(null==l?void 0:l.message)},a.createElement(y.I.Number,{placeholder:h("tools.inputPlaceholder",{content:"imperial"===A?6:170}),name:e,value:t,onChange:n,min:0,precision:1,inputMode:"decimal",error:O&&(null==l?void 0:l.message)?a.createElement(a.Fragment,null):"",rightSection:L?a.createElement(FitnessToolUnitPicker,{displayValue:U,field:"height",onChange:D}):a.createElement(T.H.Unit,{styles:{root:{paddingRight:0}}},h("bmi.heightInput.desc")),rightSectionWidth:70,styles:L?void 0:()=>({rightSection:{paddingRight:0}})})))}),a.createElement(r.Qr,{name:"weight",control:x,rules:null===(o=S.weight)||void 0===o?void 0:o.rule,render:({field:{name:e,value:t,onChange:n},fieldState:{error:l}})=>a.createElement(T.H.FormRow,null,a.createElement(T.H.BorderInlineControl,{label:h("bmi.weightInput"),errorMess:O&&(null==l?void 0:l.message)},a.createElement(y.I.Number,{placeholder:h("tools.inputPlaceholder",{content:"imperial"===A?130:60}),name:e,value:t,onChange:n,error:O&&(null==l?void 0:l.message)?a.createElement(a.Fragment,null):"",precision:1,inputMode:"decimal",min:0,rightSection:L?a.createElement(FitnessToolUnitPicker,{displayValue:P,field:"weight",onChange:D}):a.createElement(T.H.Unit,{styles:{root:{paddingRight:0}}},h("bmi.weightInput.desc")),rightSectionWidth:70,styles:L?void 0:()=>({rightSection:{paddingRight:0}})})))}),M?a.createElement(a.Fragment,null,a.createElement(r.Qr,{name:"question1",control:x,rules:null===(s=S.question1)||void 0===s?void 0:s.rule,render:({field:{value:e,onChange:t,name:n},fieldState:{error:l}})=>a.createElement(T.H.FormRow,null,a.createElement(y.R.Group,{name:n,value:e,onChange:t,sx:{flex:1},label:a.createElement(f.T,{size:"s4",weight:"semiBold",span:!0},h("bmi.question.weightLossSupport")),size:"lg"},a.createElement(d.k,{gap:"lg",sx:{paddingTop:(0,p.h)(8)}},a.createElement(y.R,{size:"sm",value:"1",label:h("switchBtn.yes")}),a.createElement(y.R,{size:"sm",value:"0",label:h("switchBtn.no")}))),O&&(null==l?void 0:l.message)&&a.createElement(y.e,{label:l.message,textProps:{size:"p4"},sx:{marginTop:6}}))}),a.createElement(r.Qr,{name:"question2",control:x,rules:null===(u=S.question2)||void 0===u?void 0:u.rule,render:({field:{name:e,value:t,onChange:n},fieldState:{error:l}})=>a.createElement(T.H.FormRow,null,a.createElement(y.R.Group,{name:e,value:t,onChange:n,sx:{flex:1},label:a.createElement(f.T,{size:"s4",weight:"semiBold",span:!0},h("bmi.question.glp1Awareness")),size:"lg",description:E!==_.L.Malaysia&&a.createElement(f.T,{style:{fontSize:"10px"},span:!0},h("bmi.question.glp1Awareness.desc"))},a.createElement(d.k,{gap:"lg",sx:{paddingTop:(0,p.h)(8)}},a.createElement(y.R,{size:"sm",value:"1",label:h("switchBtn.yes")}),a.createElement(y.R,{size:"sm",value:"0",label:h("switchBtn.no")}))),O&&(null==l?void 0:l.message)&&a.createElement(y.e,{label:l.message,textProps:{size:"p4"},sx:{marginTop:6}}))}),"gray"===j||"violet"===j?a.createElement(a.Fragment,null,a.createElement(r.Qr,{name:"newsletter",control:x,rules:null===(m=S.newsletter)||void 0===m?void 0:m.rule,render:e=>{var t=e.field,{value:n,onChange:r,name:i}=t,o=(0,l._)(t,["value","onChange","name"]);return a.createElement(T.H.FormRow,null,a.createElement(y.d,Object.assign({size:"sm",label:a.createElement(f.T,{size:"p3"},h("bmi.newsletter.label")),onChange:e=>r(e.currentTarget.checked),name:i,checked:!!n},o)))}}),a.createElement(T.H.FormRow,{className:(0,b.default)(H.submitWrapper)},a.createElement(T.H.Submit,Object.assign({className:(0,b.default)("bmi-btn bmi--btn-submit",H.submitBtn),dataEventCategory:"Health Tool",dataEventAction:"BMI",dataEventLabel:`https://${R.v[E]}/${k}`,type:"submit"},B),h("bmi.submit")))):a.createElement(T.H.FormRow,{py:16,className:(0,b.default)(z.newsletterBlock,H.newsletterBlock)},a.createElement(v.K,{spacing:16},a.createElement(r.Qr,{name:"newsletter",control:x,rules:null===(g=S.newsletter)||void 0===g?void 0:g.rule,render:e=>{var t=e.field,{value:n,onChange:r,name:i}=t,o=(0,l._)(t,["value","onChange","name"]);return a.createElement(NewsletterCheckbox,Object.assign({size:"sm",labelTextProps:{size:"p4"},onChange:e=>r(e.currentTarget.checked),name:i,checked:!!n,useCollapse:!1},o))}}),a.createElement(c.x,{className:(0,b.default)(H.submitWrapper)},a.createElement(T.H.Submit,Object.assign({className:(0,b.default)("bmi-btn bmi--btn-submit",H.submitBtn),dataEventCategory:"Health Tool",dataEventAction:"BMI",dataEventLabel:`https://${R.v[E]}/${k}`,type:"submit"},B),h("bmi.submit")))))):a.createElement(T.H.FormRow,{className:(0,b.default)(H.submitWrapper)},a.createElement(T.H.Submit,Object.assign({className:"bmi-btn bmi--btn-submit",dataEventCategory:"Health Tool",dataEventAction:"BMI",dataEventLabel:`https://${R.v[E]}/${k}`,type:"submit"},B),h("bmi.submit"))))},BmiForm=e=>{var{value:t,onChange:n,onSubmit:s,bmiGenerated:d,bmiUnit:c,defaultUnitSystem:u,enableUnitPicker:m=!0,formLayout:p="default",submitProps:g,withAdditionalQuestion:h,isMobile:v}=e,b=(0,l._)(e,["value","onChange","onSubmit","bmiGenerated","bmiUnit","defaultUnitSystem","enableUnitPicker","formLayout","submitProps","withAdditionalQuestion","isMobile"]);let{classes:E}=B(void 0,{name:"BmiForm"}),{locale:y}=(0,w.u)(),[f,T]=(0,a.useState)(!1),S=(0,a.useMemo)(()=>u||"metric",[u]),[I,C]=(0,a.useState)(S),{control:_,handleSubmit:R,setValue:k,watch:M}=(0,r.cI)({defaultValues:{question1:void 0,question2:void 0,newsletter:!0}}),L=M(),{getHealthToolLink:A}=(0,i.u)(y),U=(0,a.useMemo)(()=>A(o.H.OVULATION),[A]),P="imperial"===I?"ft":"cm",D="imperial"===I?"lbs":"kg",convertHeightToCm=e=>"imperial"===I?30.48*e:e,convertWeightToKg=e=>"imperial"===I?.45359237*e:e,onInValid=()=>{T(!0)};(0,a.useEffect)(()=>{Object.keys(t||{}).forEach(e=>{k(e,null==t?void 0:t[e],{shouldTouch:!1,shouldDirty:!1,shouldValidate:!1})})},[t]),(0,a.useEffect)(()=>{n&&n(L)},[L]),(0,a.useEffect)(()=>{C(S)},[S]);let H=Object.assign({onSubmit:R(e=>(0,l.a)(void 0,void 0,void 0,function*(){let t="number"==typeof e.height?e.height:Number(e.height),n="number"==typeof e.weight?e.weight:Number(e.weight),l=m?Object.assign(Object.assign({},e),{bmi:(0,O.F)({height:convertHeightToCm(t),weight:convertWeightToKg(n)}),unit:I}):(()=>{let l=c.heightConvert(t),a=c.weightConvert(n);return Object.assign(Object.assign({},e),{height:l,weight:a,bmi:(0,O.F)({height:l,weight:a})})})();onInValid(),s&&s(l)}),onInValid)},b);return a.createElement(x.T,{variant:x.C.LEADGEN},a.createElement(N.Provider,{value:{control:_,bmiGenerated:d,isTouched:f,linkTool:U,submitProps:g,withAdditionalQuestion:h,classes:E,enableUnitPicker:m,unitSystem:I,unitHeight:P,unitWeight:D,onUnitChange:(e,t)=>{m&&e!==I&&(C(e),k("height","",{shouldDirty:!0,shouldValidate:!1}),k("weight","",{shouldDirty:!0,shouldValidate:!1}))}}},"inline"===p?a.createElement(InlineForm,Object.assign({},H)):a.createElement(DefaultForm,Object.assign({},H,{isMobile:v}))))},M=(0,a.createContext)({}),Error=e=>{let{errorLabelSize:t}=(0,a.useContext)(M);return a.createElement(y.e,Object.assign({textProps:{size:t},sx:{marginTop:5}},e))};var L=Object.assign(e=>{var t,n,r,i,o,s,{children:d,isMobile:c}=e,u=(0,l._)(e,["children","isMobile"]);let m=Object.assign({isMobile:c,labelSize:null!==(t=u.labelSize)&&void 0!==t?t:c?"p2":"s4",subLabelSize:null!==(n=u.subLabelSize)&&void 0!==n?n:"subText",optionLabelSize:null!==(r=u.optionLabelSize)&&void 0!==r?r:c?"p2":"s4",inputSize:null!==(i=u.inputSize)&&void 0!==i?i:c?"sm":"md",gutter:null!==(o=u.gutter)&&void 0!==o?o:c?4:12,errorLabelSize:null!==(s=u.errorLabelSize)&&void 0!==s?s:"p3"},u);return a.createElement(M.Provider,{value:m},d)},{Row:e=>{var{children:t}=e,n=(0,l._)(e,["children"]);let{gutter:r}=(0,a.useContext)(M);return a.createElement(E.r,Object.assign({gutter:r},n),t)},Col:e=>{var{children:t}=e,n=(0,l._)(e,["children"]);return a.createElement(E.r.Col,Object.assign({span:12},n),t)},SubLabel:e=>{var{children:t}=e,n=(0,l._)(e,["children"]);let{subLabelSize:r}=(0,a.useContext)(M);return a.createElement(f.T,Object.assign({size:r},n),t)},Label:e=>{var{children:t}=e,n=(0,l._)(e,["children"]);let{labelSize:r}=(0,a.useContext)(M);return a.createElement(f.T,Object.assign({size:r,weight:"semiBold"},n,{span:!0}),t)},OptionLabel:e=>{var{children:t}=e,n=(0,l._)(e,["children"]);let{optionLabelSize:r}=(0,a.useContext)(M);return a.createElement(f.T,Object.assign({size:r,weight:"regular"},n,{span:!0}),t)},Input:y.I,InputNumber:e=>{var{error:t}=e,n=(0,l._)(e,["error"]);let{inputSize:r}=(0,a.useContext)(M);return a.createElement("div",null,a.createElement(y.I.Number,Object.assign({size:r},n)),t&&a.createElement(Error,{label:t}))},GenderControl:e=>{let{inputSize:t}=(0,a.useContext)(M);return a.createElement(C.G,Object.assign({size:t},e))},Error})},jONk:function(e,t,n){n.d(t,{C:function(){return Container}});var l=n("q1tI");let Container=({children:e,className:t,style:n,type:a})=>l.createElement("div",{className:`d76E4SH ${t||""}`,style:n,"data-type":a},e)},"D0+0":function(e,t,n){n.d(t,{i:function(){return isVideo}});let isVideo=e=>e.endsWith(".mp4")},"/yV4":function(e,t,n){n.d(t,{B:function(){return v},C:function(){return B},E:function(){return N},F:function(){return O},G:function(){return h},N:function(){return w},S:function(){return C},V:function(){return I},a:function(){return b},c:function(){return f},d:function(){return x},e:function(){return R},f:function(){return T},g:function(){return S},h:function(){return k},i:function(){return M}});var l,a,r,i,o,s,d,c,u,m,p,g,h,v,b,E,y,f,x,w,T,S,I,C,_=n("qpOh");(l=h||(h={})).Boy="boy",l.Girl="girl",(a=v||(v={}))[a.Height=0]="Height",a[a.Weight=1]="Weight",a[a.Head=2]="Head",a[a.BMI=3]="BMI",(r=b||(b={}))[r.Weekly=0]="Weekly",r[r.Monthly=1]="Monthly",r[r.Yearly=2]="Yearly",(i=E||(E={}))[i.Height=0]="Height",i[i.Weight=1]="Weight",i[i.Head=2]="Head",i[i.BMI=3]="BMI",i[i.Record=4]="Record",(o=y||(y={}))[o.Phone=0]="Phone",o[o.OTP=1]="OTP",o[o.OTPEmail=2]="OTPEmail",o[o.PersonalInfo=3]="PersonalInfo",o[o.UpdatePassword=4]="UpdatePassword",o[o.Result=5]="Result",o[o.DynamicForm=6]="DynamicForm",(s=f||(f={}))[s.HEAD=0]="HEAD",s[s.TAIL=1]="TAIL",s[s.MIDDLE=2]="MIDDLE",s[s.CONNECT=3]="CONNECT",s[s.SSO=4]="SSO",s[s.MULTIPLE=5]="MULTIPLE",(d=x||(x={}))[d.UNDEFINED=-1]="UNDEFINED",d[d.TEXT=0]="TEXT",d[d.IMAGE=1]="IMAGE",d[d.FORM=2]="FORM",d[d.CONDITION=3]="CONDITION",d[d.POLL=4]="POLL",d[d.FINAL_STANDARD=5]="FINAL_STANDARD",d[d.FINAL=6]="FINAL",d[d.FINAL_THANK_YOU=7]="FINAL_THANK_YOU",d[d.RATING=8]="RATING",d[d.REACTION=9]="REACTION",d[d.REVIEW=10]="REVIEW",d[d.RESULT_POLL=11]="RESULT_POLL",d[d.RESULT_RATING=12]="RESULT_RATING",d[d.RESULT_REACTION=13]="RESULT_REACTION",d[d.OTP=14]="OTP";let R=[x.FINAL,x.FINAL_STANDARD,x.FINAL_THANK_YOU];(c=w||(w={})).BOT_TEXT="bot-text",c.BOT_IMAGE="bot-image",c.BOT_BACKGROUND_IMAGE="bot-background-image",c.BOT_BUTTON="bot-button",c.BOT_URL="bot-url",c.BOT_RECALCULATE="bot-recalculate",c.BOT_BOOKING="bot-booking",c.BOT_MAIN_TITLE="bot-main-title",c.BOT_MAIN_IMAGE="bot-main-image",c.BOT_MAIN_BODY="bot-main-body",c.BOT_MAIN_BUTTON="bot-main-button",c.BOT_SUB_TITLE="bot-sub-title",c.BOT_SUB_BODY="bot-sub-body",c.BOT_LANDING_PAGE_URL="bot-landing-page-url",c.BOT_LANDING_PAGE_BUTTON="bot-landing-page-button",c.BOT_RISK_SCREEN="bot-risk-screen",c.BOT_RELATED_ARTICLE="bot-related-article",c.THANK_YOU_IMAGE="thank-you-image",c.THANK_YOU_TITLE="thank-you-title",c.THANK_YOU_BODY="thank-you-body",c.TOTAL_LINE="total-line",c.BOT_SUBMISSION="bot-submission",c.BOT_EVENT_SUBMISSION="bot-event-submission",c.BOT_SUGGESTED_SERVICE="bot-suggested-service",c.SSO_INTENT="sso-intent",(u=T||(T={})).ACTION_CONDITION="action-condition",u.ACTION_INTERNAL="action-internal",u.ACTION_EXTERNAL="action-external",u.ACTION_SSO_REDIRECT="action-sso-redirect",u.ACTION_MULTIPLE_BUTTON="action-multiple-button",u.USER_CHOICE_TEXT="user-choice-text",u.USER_CHOICE_TEXT_BY_INPUT="user-choice-text-by-input",u.USER_CHOICE_NEXT="user-choice-next",u.USER_CHOICE_IMAGE="user-choice-image",u.USER_SUBMIT_TEXT="user-submit-text",u.USER_SUBMIT_NUMBER="user-submit-number",u.USER_SUBMIT_NAME="user-submit-name",u.USER_SUBMIT_PHONE="user-submit-phone",u.USER_SUBMIT_EMAIL="user-submit-email",u.USER_SUBMIT_DROPDOWN="user-submit-dropdown",u.USER_SUBMIT_DATE="user-submit-date",u.USER_SUBMIT_DOB="user-submit-dob",u.USER_SUBMIT_CONFIRM="user-submit-confirm",u.USER_SUBMIT_SEND="user-submit-send",u.USER_SUBMIT_RESEND="user-submit-resend",u.USER_SUBMIT_ADDRESS="user-submit-address",u.USER_SUBMIT_ADDRESS_PROVINCE="user-submit-address-province",u.USER_SUBMIT_ADDRESS_DISTRICT="user-submit-address-district",u.USER_SUBMIT_ADDRESS_COMMUNE="user-submit-address-commune",u.USER_SUBMIT_BMI="user-submit-bmi",u.USER_SUBMIT_BMI_HIDDEN="user-submit-bmi-hidden",u.USER_SUBMIT_TERMS="user-submit-terms",u.USER_SUBMIT_GENDER="user-submit-gender",u.USER_SUBMIT_OTP="user-submit-otp",u.USER_SUBMIT_WHATSAPP="user-submit-whatsapp",u.POLL_CHOICE="poll-choice",u.POLL_CHOICE_TEXT_BY_INPUT="poll-choice-text-by-input",u.POLL_CHOICE_IMAGE="poll-choice-image",u.POLL_BUTTON="poll-button",u.RATING_STAR="rating-star",u.RATING_DESCRIPTION="rating-description",u.RATING_BUTTON="rating-button",u.LIKE_CHOICE="like-choice",u.DISLIKE_CHOICE="dislike-choice",u.REVIEW_CHOICE="review-choice",u.REVIEW_DESCRIPTION="review-description",u.REVIEW_BUTTON="review-button",u.RESULT_BUTTON="result-button",u.POLL_RESULT="poll-result",u.USER_SUBMIT_GOOGLE_API_ADDRESS="user-submit-google-api-address";let O=[T.USER_SUBMIT_ADDRESS_PROVINCE,T.USER_SUBMIT_ADDRESS_DISTRICT,T.USER_SUBMIT_ADDRESS_COMMUNE,T.USER_SUBMIT_ADDRESS];(m=S||(S={}))[m.UNLIMITED=0]="UNLIMITED",m[m.EXACT_NUMBER=1]="EXACT_NUMBER",m[m.RANGE=2]="RANGE";let N={[T.USER_SUBMIT_EMAIL]:"email",[T.USER_SUBMIT_TEXT]:"text",[T.USER_SUBMIT_DROPDOWN]:"text",[T.USER_SUBMIT_NAME]:"name",[T.USER_SUBMIT_NUMBER]:"number",[T.USER_SUBMIT_ADDRESS]:"address",[T.USER_SUBMIT_PHONE]:"tel",[T.USER_SUBMIT_OTP]:"tel",[T.USER_SUBMIT_WHATSAPP]:"tel",[T.USER_SUBMIT_DATE]:"date",[T.USER_SUBMIT_CONFIRM]:"confirm",[T.USER_SUBMIT_SEND]:"submit",[T.USER_SUBMIT_TERMS]:"terms",[T.USER_SUBMIT_ADDRESS_PROVINCE]:"province",[T.USER_SUBMIT_ADDRESS_DISTRICT]:"district",[T.USER_SUBMIT_ADDRESS_COMMUNE]:"commune",[T.USER_SUBMIT_BMI]:"bmi",[T.USER_SUBMIT_GENDER]:"gender",[T.POLL_CHOICE]:"poll",[T.POLL_CHOICE_TEXT_BY_INPUT]:"poll",[T.POLL_CHOICE_IMAGE]:"poll",[T.RATING_STAR]:"rating",[T.RATING_DESCRIPTION]:"text",[T.LIKE_CHOICE]:"like",[T.DISLIKE_CHOICE]:"dislike",[T.REVIEW_CHOICE]:"review",[T.USER_SUBMIT_GOOGLE_API_ADDRESS]:"google-api-address",[T.USER_SUBMIT_DOB]:"dob"},k={FRU:"FRU",survey:"Survey",ristScreener:"risk_screener",voucherAcuvue:"ACUVUE"};(p=I||(I={})).VIDEO="video",p.SHORTS="short",p.PODCAST="podcast",p.LIVESTREAM="live-stream",(g=C||(C={})).Facebook="facebook",g.Zalo="zalo",g.Twitter="twitter",g.WhatsApp="whatsApp",g.Line="line",g.Instagram="instagram",g.LinkedIn="linkedin",g.Youtube="youtube",g.Tiktok="tiktok",g.Telegram="telegram",g.Viber="viber";let B={DD:{id:"common.day",defaultMessage:"Day"},MM:{id:"common.month",defaultMessage:"Month"},YYYY:{id:"common.year",defaultMessage:"Year"}};var M=Object.freeze({__proto__:null,get SocialType(){return C},COMMON_DATE_TRANSLATE_KEY:B,get Gender(){return h},get BabyGrowthChartType(){return v},get BabyGrowthChartDuration(){return b},get BabyGrowthResultTab(){return E},get LOCALE(){return _.L},get OnboardingStep(){return y},get NodePosition(){return f},get NodeType(){return x},NodeFinalTypes:R,get NodeIntentType(){return w},get NodeActionType(){return T},FULL_KEY_ADDRESS:O,get NodeMultipleOptions(){return S},ELEMENT_CONTROL_INPUT_TYPE:N,SubotType:k,get VideoType(){return I}})},UK9O:function(e,t,n){n.d(t,{u:function(){return l}});var l=(0,n("/npG").k)(e=>({root:{},inner:{},content:{borderRadius:16},header:{borderBottom:`1px solid ${e.colors.neutral[1]}`,marginRight:0,marginBottom:0,padding:"12px"},overlay:{},title:{fontSize:16,fontWeight:700,lineHeight:1.5},body:{},close:{cursor:"pointer",width:"unset",height:"unset",svg:{width:"24px !important",height:"24px !important"}}}))},"/eWd":function(e,t,n){n.d(t,{L:function(){return LabelSorting}});var l,a,r=n("q1tI"),i=n("HalR"),o=n("Czgk"),s=n("YHaB");(l=a||(a={})).latest="latest",l.oldest="oldest",l.popular="popular";let LabelSorting=({onChange:e,className:t,style:n,leftLabel:l,rightLabel:a,color:d,value:c,choices:u})=>{let{data:{env:{isMarryBaby:m}}}=(0,r.useContext)(o.T);return r.createElement(s.L,{label:l,rightLabel:r.createElement(s.b,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:u.map(t=>({label:t.label,onClick:()=>e&&e(String(t.value)),selected:t.value===c,className:"bold-item"}))},toggleButtonContent:r.createElement("div",{style:{display:"flex"}},r.createElement(i.T,{style:{display:"flex",alignItems:"center",fontWeight:"normal",marginRight:12},size:"p4"},a),r.createElement("img",{src:m?"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%233E3F58' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m8 14 4 4 4-4M16 10l-4-4-4 4'/%3e%3c/svg%3e":"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath fill='%238C8C8C' d='M4.5 7h7a.46.46 0 0 0 .351-.165.56.56 0 0 0 .149-.39q0-.226-.149-.391l-3.5-3.89a.458.458 0 0 0-.703 0l-3.5 3.89a.56.56 0 0 0-.148.39q0 .226.148.391Q4.298 7 4.5 7M11.5 9h-7a.46.46 0 0 0-.352.165.56.56 0 0 0-.148.39q0 .226.148.391l3.5 3.889a.46.46 0 0 0 .703 0l3.5-3.889a.56.56 0 0 0 .149-.39q0-.226-.149-.391A.46.46 0 0 0 11.5 9'/%3e%3c/svg%3e",style:{width:16,height:16,alignSelf:"center"},loading:"lazy"}))}),color:"gray",className:t,style:n})}},HJ8n:function(e,t,n){n.d(t,{c:function(){return convertLocalizedStringToNumber},f:function(){return formatPhoneNumber},l:function(){return localizeNumberFormat}});var l=n("A9bs");let localizeNumberFormat=(e,t,n=2)=>Intl.NumberFormat(void 0,{maximumFractionDigits:n}).format(e),convertLocalizedStringToNumber=e=>Number(e.replace(/,/gi,".")),formatPhoneNumber=e=>{try{let t=(0,l.parsePhoneNumber)(e,"VN");if(!(null==t?void 0:t.number))throw Error("Invalid number");return(0,l.formatPhoneNumber)(t.number)}catch(t){return console.log("\uD83D\uDE80 ~ formatPhoneNumber ~ error:",t),e}}},xDjP:function(e,t,n){n.d(t,{L:function(){return i}});var l=n("q1tI"),a=n("0aVn"),r=n("fkwy");let i=(0,l.memo)(({type:e,width:t,height:n,isLight:i})=>{let o=(0,l.useMemo)(()=>{switch(e){case"hellobacsi":return{width:t||"107px",height:n||"24px",src:a.C.getAssetPath("logo/hellobacsi.png"),srcLight:a.C.getAssetPath("logo/hellobacsi-light.png")};case"hellodoktor":return{width:t||"127px",height:n||"24px",src:a.C.getAssetPath("logo/hellodoktor.png")};case"hellosehat":return{width:t||"121px",height:n||"27px",src:a.C.getAssetPath("logo/hellosehat.png")};case"hellojiankang":return{width:t||"87px",height:n||"24px",src:a.C.getAssetPath("logo/hellojiankang.png")};case"hellohealth":return{width:t||"123px",height:n||"24px",src:a.C.getAssetPath("logo/hellohealth.png")};case"hellotogether":return{width:t||"150px",height:n||"24px",src:a.C.getAssetPath("logo/hellotogether.png")};case"hellocare":return{width:t||"99px",height:n||"24px",src:a.C.getAssetPath("logo/hellocare.png")};case"hellodoctor":return{width:t||"127px",height:n||"24px",src:a.C.getAssetPath("logo/hellodoctor.png")};case"hellokrupet":return{width:t||"101px",height:n||"24px",src:a.C.getAssetPath("logo/hellokrupet.png")};case"hellosayarwon":return{width:t||"111px",height:n||"24px",src:a.C.getAssetPath("logo/hellosayarwon.png")};case"helloyishi":return{width:t||"89px",height:n||"24px",src:a.C.getAssetPath("logo/helloyishi.png")};case"hellokhunmor":return{width:t||"123px",height:n||"24px",src:a.C.getAssetPath("logo/hellokhunmor.png")};case"helloswasthya":return{width:t||"105px",height:n||"24px",src:a.C.getAssetPath("logo/helloswasthya.png")};case"logomark":return{width:t||"60px",height:n||"57px",src:a.C.getAssetPath("logo/logomark.png")};case"marryBaby":return{width:t||"145px",height:n||"28px",src:a.C.getAssetPath("logo/marrybaby.png")};default:return null}},[e,t,n]),{src:s,width:d,height:c,srcLight:u}=o||{};return l.createElement(r.I,{alt:`${e} logo`,className:"main-logo-icon",src:i&&u||s,style:{width:d,height:c}})})}}]);