"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7884],{"+Ntx":function(e,t,n){n.d(t,{C:function(){return Checkbox},I:function(){return ImageWrapV2},P:function(){return Pagination},S:function(){return x},a:function(){return v},b:function(){return SearchInput},c:function(){return Search2}});var a=n("q1tI"),r=n("rBCA"),o=n("+J3I"),i=n("iBNF"),l=n("XBaX"),s=n("Of7P"),c=n("xrdX"),d=n("RVQf"),p=n("NQDR"),u=n("3on8");let Search2=e=>a.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 25",fill:"none"},e),a.createElement("path",{d:"M11 18.957C14.866 18.957 18 15.823 18 11.957C18 8.09104 14.866 4.95703 11 4.95703C7.13401 4.95703 4 8.09104 4 11.957C4 15.823 7.13401 18.957 11 18.957Z",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M20 20.957L16 16.957",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),m=r.Z.div` display: flex; cursor: pointer; &[data-theme='marryBaby'] { input { width: 20px; height: 20px; border: 1.3px solid ${i.r.mbColors.midGray}; border-radius: 9px; cursor: inherit; transition: border-color 0.4s, box-shadow 0.4s; &:hover, &:active { border-color: ${i.r.mbColors.cobalt}; box-shadow: 0 0 2px 2px ${i.r.mbColors.cobalt}; } &:focus-visible { border: 2px solid ${i.r.mbColors.cobalt}; } &:checked { border: 0; background: ${i.r.mbColors.cobalt} url("data:image/svg+xml,%3Csvg width='9' height='7' viewBox='0 0 9 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.5 4L3.45455 6L8 1' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A") no-repeat center center; } } label { max-width: 15rem; margin-left: 8px; width: calc(100% - 24px); cursor: inherit; font-weight: 600; font-size: 12px; line-height: 20px; letter-spacing: -0.2px; color: ${i.r.mbColors.gray}; } } input { width: 20px; height: 20px; border: solid 1px ${i.r.colors.gray500}; border-radius: 2px; cursor: inherit; transition: border-color 0.4s, box-shadow 0.4s; &:hover, &:active { border-color: ${i.r.colors.primaryBase}; box-shadow: 0 0 2px 2px ${i.r.colors.primary200}; } &:focus-visible { border: 2px solid ${i.r.colors.primaryActive}; } &:checked { border: 0; background: ${i.r.colors.primaryBase} url("data:image/svg+xml,%3Csvg width='12' height='9' viewBox='0 0 12 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 1L4.125 8L1 4.81819' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A") no-repeat center center; } } label { max-width: 15rem; margin-left: 8px; font-weight: ${i.r.sizes.fwRegular}; width: calc(100% - 24px); cursor: inherit; ${o.M.mbDown} { font-size: 14px; line-height: 24px; } ${o.M.mbUp} { font-size: 16px; line-height: 22px; } } &[data-is-rectangle] > input { position: relative; width: unset; height: unset; padding: 5px 12px; border: 1px solid ${i.r.colors.neutral100}; border-radius: 32px; &::after { color: ${i.r.colors.gray800}; content: attr(data-label-text); font-size: 13px; } &:checked { border-color: ${i.r.colors.primary50}; &::after { color: ${i.r.colors.primaryBase}; } } &:checked { background: ${i.r.colors.primary50}; } } &[data-disabled] { color: ${i.r.colors.gray300}; cursor: not-allowed; input { border-color: ${i.r.colors.gray300}; &:hover { border-color: ${i.r.colors.gray300}; box-shadow: none; } } } `,Checkbox=({label:e,name:t,checked:n,className:r,isDisabled:o,onChange:i,value:l,isRectangle:s,inputDataTestId:c,siteType:d})=>a.createElement(m,{className:r,"data-disabled":o||void 0,"data-is-rectangle":s||void 0,"data-label-text":e,"data-theme":d},a.createElement("input",{type:"checkbox",checked:n,name:t,onChange:()=>i(l,!n),disabled:o,value:l,id:`${t}-${l}`,"data-label-text":e,"data-testid":c}),!s&&a.createElement("label",{htmlFor:`${t}-${l}`},e)),h=r.Z.div` display: flex; align-items: center; justify-content: space-between; user-select: none; li { transition: all 0.3s ease; } [data-page-active] { background: ${i.r.colors.primaryBase}; color: ${i.r.colors.white}; > a { color: ${i.r.colors.white}; } } `,g=r.Z.div` display: flex; width: 32px; height: 32px; box-sizing: border-box; align-items: center; justify-content: center; border: 1px solid ${i.r.colors.gray200}; margin: 0 2px; border-radius: 4px; color: ${i.r.colors.gray800}; cursor: pointer; font-size: 14px; font-weight: ${i.r.sizes.fwBold}; &[data-last-page] { border: none; background-color: ${i.r.colors.gray100}; cursor: not-allowed; pointer-events: none; svg { path { stroke: ${i.r.colors.gray300}; } } } `,b=r.Z.li` display: flex; width: 32px; height: 32px; align-items: center; justify-content: center; margin: 0 2px; border-radius: 4px; color: ${i.r.colors.gray800}; cursor: pointer; font-size: 14px; font-weight: ${i.r.sizes.fwBold}; > a { color: ${i.r.colors.gray800}; text-decoration: unset; display: block; width: 100%; height: 100%; line-height: 32px; text-align: center; } `,RenderPagiWithDots=({pagesAmount:e,activePage:t,handlePageChange:n,handleClick:r,href:i,queryPageName:l="page"})=>{let s=[...Array(e)].map((e,t)=>t+1),[c,d]=(0,a.useState)(t<=4?s.slice(0,5):t>=s.length-3?s.slice(s.length-5,s.length):s.slice(t-2,t+1));return(0,a.useEffect)(()=>{t<=4?d(s.slice(0,5)):t>=s.length-3?d(s.slice(s.length-5,s.length)):d(s.slice(t-2,t+1))},[t]),a.createElement(a.Fragment,null,t>4&&a.createElement(a.Fragment,null,a.createElement(b,{onClick:()=>n(1)},i?a.createElement("a",{href:i,onClick:r},1):1),a.createElement(b,null,"...")),c.map(e=>a.createElement(b,{key:`pagination+${e}`,"data-page-active":e===t||void 0,onClick:()=>n(e)},i?a.createElement("a",{href:(0,o.f)(i,e,l),onClick:r},e):e)),tn(s.length)},i?a.createElement("a",{href:(0,o.f)(i,s.length,l),onClick:r},s.length):s.length)))},Pagination=({className:e,pagesAmount:t,currentPage:n,onChange:r,onClick:i,style:l,href:s,queryPageName:c="page"})=>{let d=[...Array(t)].map((e,t)=>t+1),[p,u]=(0,a.useState)(n),m=(0,a.useMemo)(()=>s&&s.endsWith("&page=")?s.replace("&page=",""):s,[s]),f=t-1,handlePageChange=e=>{e<=t&&e>0&&(u(e),r(e))},handleClick=e=>{i&&i(e)};return(0,a.useEffect)(()=>{u(n)},[n]),a.createElement(h,{className:e,style:l},a.createElement(g,{className:"prev-page",onClick:()=>handlePageChange(p-1),"data-last-page":1===p||void 0},m?a.createElement("a",{href:(0,o.f)(m,p,c),onClick:handleClick},a.createElement("svg",{width:"7",height:"10",viewBox:"0 0 7 10",fill:"none"},a.createElement("path",{d:"M5.5 9L1.5 5L5.5 1",stroke:"#2D87F3",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))):a.createElement("svg",{width:"7",height:"10",viewBox:"0 0 7 10",fill:"none"},a.createElement("path",{d:"M5.5 9L1.5 5L5.5 1",stroke:"#2D87F3",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))),d.length>8?a.createElement(RenderPagiWithDots,{pagesAmount:t,activePage:p,handlePageChange:handlePageChange,handleClick:handleClick,href:m,queryPageName:c}):d.map(e=>a.createElement(b,{key:`pagination+${e}`,"data-page-active":e===p||void 0,onClick:()=>handlePageChange(e)},m?a.createElement("a",{href:(0,o.f)(m,e,c),onClick:handleClick},e):e)),a.createElement(g,{className:"next-page",onClick:()=>handlePageChange(p+1),"data-last-page":p===f+1||void 0},m?a.createElement("a",{href:(0,o.f)(m,p,c),onClick:handleClick},a.createElement("svg",{width:"7",height:"10",viewBox:"0 0 7 10",fill:"none"},a.createElement("path",{d:"M1.5 9L5.5 5L1.5 1",stroke:"#2D87F3",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))):a.createElement("svg",{width:"7",height:"10",viewBox:"0 0 7 10",fill:"none"},a.createElement("path",{d:"M1.5 9L5.5 5L1.5 1",stroke:"#2D87F3",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))))},f=r.Z.div` position: relative; width: 100%; &[data-has-error] { input { border-color: ${i.r.colors.red700}; } } input { width: 100%; padding: 12px 16px; border: solid 1px ${i.r.colors.gray200}; border-radius: ${i.r.borderRadius}; &:active, &:focus, .focused & { border-color: ${i.r.colors.primaryBase}; box-shadow: 0px 0px 2px 2px ${i.r.colors.primary200}; } &:disabled { background-color: ${i.r.colors.gray100}; cursor: not-allowed; } } &[data-has-action-icon] { input { padding: 12px 48px 12px 16px; } } &[data-has-display-icon] { input { padding: 12px 16px 12px 48px; } } &[data-has-action-icon][data-has-display-icon] { input { padding: 12px 48px; } } &[data-size='lg'] { input { font-size: 16px; font-weight: ${i.r.sizes.fwRegular}; ${o.M.mbDown} { font-size: 22px; line-height: 1.2; } ${o.M.mbUp} { font-size: 26px; line-height: 1.2; } } } &[data-size='md'] { input { font-weight: ${i.r.sizes.fwRegular}; ${o.M.mbDown} { font-size: 14px; line-height: 1.2; } ${o.M.mbUp} { font-size: 16px; line-height: 1.2; } } } &[data-size='sm'] { input { font-weight: ${i.r.sizes.fwRegular}; ${o.M.mbDown} { font-size: 13px; line-height: 1.5; } ${o.M.mbUp} { font-size: 13px; line-height: 1.5; } } } `,v=a.forwardRef((e,t)=>{var{name:n,errorMessage:r,autoComplete:o="off",defaultValue:i,actionIcon:c,displayIcon:d,isDeleteAction:p,onActionClick:u,label:m,placeholder:h,className:g,onChange:b,onKeyPress:v,isDisabled:E,CustomInput:y,size:w,style:x,autoFocus:C,type:k="text",isNumerousKeyboard:S=!1,onFocus:T,enterKeyHint:B,nativeOnChange:P}=e,O=(0,l._)(e,["name","errorMessage","autoComplete","defaultValue","actionIcon","displayIcon","isDeleteAction","onActionClick","label","placeholder","className","onChange","onKeyPress","isDisabled","CustomInput","size","style","autoFocus","type","isNumerousKeyboard","onFocus","enterKeyHint","nativeOnChange"]);let[I,N]=(0,a.useState)(i),handleOnChange=e=>{N(e),b(e)};return a.createElement(f,{"data-size":w,className:g,"data-has-action-icon":!!c||void 0,"data-has-display-icon":!!d||void 0,"data-has-error":r&&r.length>0||void 0,style:x},m&&a.createElement(s.L,{size:"label2",htmlFor:n,className:"inputLabel"},m),a.createElement("div",{style:{position:"relative"}},y||a.createElement("input",Object.assign({id:n,name:n,placeholder:h,onChange:null!=P?P:e=>handleOnChange(e.target.value),onKeyPress:v,type:k,"aria-label":k,disabled:E,value:I,autoComplete:o,ref:t,autoFocus:C,inputMode:S||"number"===k?"numeric":k,pattern:S?"[0-9]*":".*",onFocus:T,enterKeyHint:B},O)),d&&a.createElement(s.S,{className:"displayIcon"},d),c&&a.createElement(s.a,{className:"actionIcon",onClick:()=>{var e;p&&(N(""),null===(e=t.current)||void 0===e||e.focus()),u&&u()}},c)),r&&r.length>0&&a.createElement(s.b,{className:"errorLabel"},r))});v.displayName="PureInput";let E=[320,420,640,750,828,1080,1200,1440,1920,2048],defaultLoader=({src:e,width:t,quality:n,locale:a})=>{try{let r="undefined"!=typeof window?window.location.origin:c.v[a]?`https://${c.v[a]}`:"";if(!r)return e;let o=new URL(e,r);return o.searchParams.set("w",String(t)),o.searchParams.set("q",String(null!=n?n:75)),o.toString()}catch(t){return e}},ImageWrapV2=e=>{var{alt:t,backupSrc:n,src:r,placeholderSrc:o,style:i,ref:s,unoptimized:c=!1,quality:p,sizes:u,width:m}=e,h=(0,l._)(e,["alt","backupSrc","src","placeholderSrc","style","ref","unoptimized","quality","sizes","width"]);let[g,b]=(0,a.useState)(!1),{locale:f="vi-VN"}=(0,d.u)(),v=(0,a.useMemo)(()=>c?[]:function(e){if(e.sizes)return E;if(e.width){let t=Math.max(1,Math.round(e.width));return Array.from(new Set([t,Math.min(2*t,2048)])).sort((e,t)=>e-t)}return E}({sizes:u,width:m}),[u,m,c]),w=(0,a.useMemo)(()=>{if(!c)return v.map(e=>`${defaultLoader({src:r,width:e,quality:p,locale:f})} ${e}w`).join(", ")},[c,v,r,p]),x=(0,a.useMemo)(()=>{if(c)return r;let e=v.length?v[v.length-1]:null!=m?m:1920;return defaultLoader({src:r,width:e,quality:p,locale:f})},[c,v,r,p,m]);return a.createElement(y,Object.assign({loading:"lazy",alt:t,srcSet:w,onError:()=>!g&&b(!0),src:g?n||x:x||n,style:Object.assign(Object.assign({},o?{backgroundImage:`url(${o})`}:{}),i),"data-has-placeholder":!!o,sizes:u,ref:s},h))},y=r.Z.img` &[data-has-placeholder='true'] { background-position: center; background-repeat: no-repeat; background-size: cover; } `,w=(0,r.Z)(p.I)` box-shadow: 0px 0px 1px 0px #0000000a, 0px 2px 8px 0px #0000000a, 0px 10px 16px 0px #0000000a; border-radius: 0.75rem; overflow: hidden; input.mantine-Input-input { border: none; font-size: 0.8125rem; line-height: 1.25rem; } .close-icon-wrapper { display: none; background-color: ${i.r.colors.gray400}; border-radius: 100%; cursor: pointer; width: 20px; height: 20px; padding: 2px; svg { pointer-events: none; } &[data-is-disabled='true'] { opacity: 0.2; cursor: not-allowed; pointer-events: none; } } input.mantine-Input-input:focus ~ .mantine-Input-rightSection .close-icon-wrapper, input.mantine-Input-input:not(:placeholder-shown) ~ .mantine-Input-rightSection .close-icon-wrapper { display: flex; } `,x=(0,r.Z)(Search2)` color: ${i.r.colors.primaryBase}; width: 20px; height: 20px; `,SearchInput=e=>{let{loading:t,disabled:n,placeholder:r,value:o,onChange:i,icon:s=a.createElement(x,null),className:c,style:d,enableClear:p}=e,m=(0,l._)(e,["loading","disabled","placeholder","value","onChange","icon","className","style","enableClear"]);return a.createElement(w,Object.assign({disabled:t||n,size:"lg",value:o,onChangeRaw:e=>{i(e.currentTarget.value)},type:"text",placeholder:r,className:c,icon:s,style:d,rightSection:p?a.createElement("div",{className:"close-icon-wrapper",onClick:()=>{i("")},"data-is-disabled":!o},a.createElement(u.C,{fill:"white",width:"100%",height:"100%"})):void 0},m,{"data-event-label":o}))}},"dU++":function(e,t,n){n.d(t,{H:function(){return HealthToolFormWrapper}});var a=n("XBaX"),r=n("q1tI"),o=n("/npG"),i=n("mYVa"),l=n("Eso5"),s=n("aDCK"),c=n("9n+W"),d=n("8vDj"),p=n("SPK5"),u=n("2wr/"),m=n("HalR"),h=n("k1Nl"),g=n("RVQf"),b=n("yVya"),f=n("iBNF"),v=(0,o.k)(()=>({root:{justifyContent:"flex-start"},group:{display:"flex",alignItems:"stretch",gap:(0,i.h)(8)},item:{flex:"1 1 0px"},icon:{flexShrink:0}}));let E=(0,r.createContext)({}),y=(0,o.k)(()=>({root:{display:"flex",flexDirection:"column",gap:(0,i.h)(8),paddingLeft:16,paddingRight:16,"&:last-child":{paddingBottom:16}}}));var w=(0,o.k)((e,{formLayout:t})=>({root:{display:"flex",flexDirection:"column",gap:(0,i.h)("inline"===t?8:16),borderRadius:"inherit",".mantine-Input-input::placeholder, .mantine-Input-input[data-invalid]::placeholder":{color:"#8C8C8C"},[e.fn.smallerThan("sm")]:Object.assign({"input, .mantine-DatePickerInput-input":{fontSize:(0,i.h)(14)}},"default"===t&&{gap:8})},control:{width:(0,i.h)(180),flexShrink:1,"&.error":{"button, input":{borderColor:e.colors.red[7]}}}}));let x=(0,o.k)((e,{formLayout:t})=>{let n="mb"===e.other.template;return{root:Object.assign(Object.assign({minWidth:(0,i.h)(180)},"inline"===t&&{alignSelf:"flex-end",marginTop:(0,i.h)(16)}),"default"===t&&Object.assign({},n&&{alignSelf:"center"}))}}),C=(0,o.k)(e=>({root:{color:e.colors.gray[6],whiteSpace:"nowrap",paddingRight:(0,i.h)(16)}}));var k=(0,o.k)(()=>({root:{display:"flex",gap:(0,i.h)(8),border:"1px solid #EAEAEC",borderRadius:(0,i.h)(16),padding:"10px 16px 12px 16px",flex:"1 1 0px",".mantine-Input-input":{border:0,paddingLeft:0,height:"22px",borderRadius:0,"&:focus":{outline:0,boxShadow:"none"}}},info:{display:"flex",flexDirection:"column",gap:0,flex:"1 1 0px"},label:{color:"#7C7C8F",fontWeight:"normal"},content:{},rightSection:{display:"flex",alignItems:"center",textTransform:"lowercase",color:"#3E3F58"}})),S=(0,o.k)((e,{width:t,direction:n})=>{let a="mb"===e.other.template;return{root:{display:"flex",flexDirection:"column",gap:(0,i.h)(8)},row:{display:"flex",flexDirection:n,alignItems:"stretch",justifyContent:"space-between",gap:(0,i.h)(16),minHeight:(0,i.h)(40)},labelWrapper:Object.assign({flex:"1 1 0px",display:"flex",alignItems:"center"},"row"===n&&{borderBottom:`1px solid ${e.colors.neutral[1]}`}),label:{fontSize:(0,i.h)(14),lineHeight:(0,i.h)(22),color:e.colors.gray[6]},content:{display:"flex",alignItems:"center",gap:(0,i.h)(8),input:{backgroundColor:"#fff"}},control:{width:"number"==typeof t?(0,i.h)(t):t,flexShrink:1,input:Object.assign({},a&&{borderRadius:(0,i.h)(12)}),"&.error":{"button, input":{borderColor:e.colors.red[7]}}},error:{color:"red",textAlign:"right"}}});let T=(0,o.k)(()=>({root:{color:"red",textAlign:"right",width:"auto"}}));var B=(0,o.k)(e=>{let t="mb"===e.other.template;return{root:{label:Object.assign({},t&&{color:f.r.mbColors.midGray,fontSize:(0,i.h)(12),fontWeight:"normal"})}}});let HealthToolFormWrapper=e=>{var{children:t,formLayout:n,styles:o,classNames:i,className:s,component:c="form"}=e,d=(0,a._)(e,["children","formLayout","styles","classNames","className","component"]);let p=n||"default",{classes:u,cx:m}=w({formLayout:p},{name:"HealthToolFormWrapper",styles:o,classNames:i});return r.createElement(E.Provider,{value:{formLayout:p}},r.createElement(l.x,Object.assign({component:c,className:m(s,u.root)},d),t))};HealthToolFormWrapper.Control=e=>{var{className:t,styles:n,classNames:o}=e,i=(0,a._)(e,["className","styles","classNames"]);let{classes:s,cx:c}=B(void 0,{name:"HealthToolFormWrapper__Control",styles:n,classNames:o});return r.createElement(l.x,Object.assign({className:c(t,s.root)},i))},HealthToolFormWrapper.BorderInlineControl=({label:e,children:t,styles:n,classNames:a,direction:o="row",width:i=180,errorMess:s})=>{let{classes:c}=S({width:i,direction:o},{name:"HealthToolFormWrapper__BorderInlineControl",styles:n,classNames:a});return r.createElement(l.x,{className:c.root},r.createElement(l.x,{className:c.row},r.createElement(l.x,{className:c.labelWrapper},e&&r.createElement("label",{className:c.label,htmlFor:"gender"},e)),r.createElement(l.x,{className:c.content},(0,b.Z)(t).map((e,t)=>r.createElement(l.x,{key:t,className:c.control},e)))),s&&r.createElement(m.T,{size:"p4",className:c.error},s))},HealthToolFormWrapper.BorderBoxControl=e=>{var{label:t,rightSection:n,children:o,styles:i,className:s,classNames:c}=e,d=(0,a._)(e,["label","rightSection","children","styles","className","classNames"]);let{classes:p,cx:u}=k(void 0,{name:"HealthToolFormWrapper__BorderBoxControl",styles:i,classNames:c});return r.createElement(l.x,Object.assign({className:u(p.root,s)},d),r.createElement(l.x,{className:p.info},t&&r.createElement(m.T,{size:"n1",as:"label",className:p.label},t),r.createElement(l.x,{className:p.content},r.isValidElement(o)?r.cloneElement(o,Object.assign(Object.assign({},o.props),{size:"sm",error:null})):null)),n&&r.createElement(l.x,{className:p.rightSection},"string"==typeof n?r.createElement(m.T,{size:"p4"},n):r.isValidElement(n)?r.cloneElement(n,{size:24}):null))},HealthToolFormWrapper.Error=e=>{var{styles:t,classNames:n,className:o}=e,i=(0,a._)(e,["styles","classNames","className"]);let{classes:l,cx:s}=T(void 0,{name:"HealthToolFormWrapper__UnitText",styles:t,classNames:n});return r.createElement(m.T,Object.assign({size:"p4",className:s(o,l.root)},i))},HealthToolFormWrapper.FormRow=e=>{var{styles:t,classNames:n,className:o,children:i}=e,s=(0,a._)(e,["styles","classNames","className","children"]);let{classes:c,cx:d}=y(void 0,{name:"HealthToolFormWrapper__FormRow",styles:t,classNames:n});return r.createElement(l.x,Object.assign({className:d(o,c.root)},s),i)},HealthToolFormWrapper.Submit=e=>{var{styles:t,classNames:n,className:o}=e,i=(0,a._)(e,["styles","classNames","className"]);let{formLayout:l}=(0,r.useContext)(E),{classes:s,cx:c}=x({formLayout:l},{name:"HealthToolFormWrapper__SubmitBtn",styles:t,classNames:n});return r.createElement(h.B,Object.assign({className:c("submit-btn",o,s.root)},i,{variant:"primary",size:"md"}))},HealthToolFormWrapper.Unit=e=>{var{styles:t,classNames:n,className:o}=e,i=(0,a._)(e,["styles","classNames","className"]);let{classes:l,cx:s}=C(void 0,{name:"HealthToolFormWrapper__UnitText",styles:t,classNames:n});return r.createElement(m.T,Object.assign({size:"p4",className:s(o,l.root)},i))},HealthToolFormWrapper.Switching=e=>{var{label:t}=e,n=(0,a._)(e,["label"]);let{t:o}=(0,g.u)(),l=(0,d.rZ)(),s="mb"===l.other.template;return r.createElement(p.k,{gap:(0,i.h)(4),sx:()=>({justifyContent:"space-between",alignItems:"center"})},t&&r.createElement(m.T,{size:s?"p4":"s4",color:"gray.6"},t),r.createElement(u.r,Object.assign({labelPosition:"left",onLabel:o("switchBtn.yes"),offLabel:o("switchBtn.no")},n,{styles:e=>({trackLabel:{fontSize:(0,i.h)(12)},track:{cursor:"pointer"},body:{[e.fn.largerThan("sm")]:{flexDirection:"column",alignItems:"flex-start"},[e.fn.smallerThan("sm")]:{justifyContent:"space-between"}},labelWrapper:{[e.fn.smallerThan("sm")]:{display:"flex",justifyContent:"center"}}})})))},HealthToolFormWrapper.ChipGroup=e=>{var{data:t=[],label:n,isMobile:o,layout:d="horizonal",classNames:p,styles:u}=e,h=(0,a._)(e,["data","label","isMobile","layout","classNames","styles"]);let{classes:g,theme:b}=v(void 0,{name:"ChipGroup",classNames:p,styles:u}),f="mb"===b.other.template,E=o?48:f?32:"vertical"===d?32:18;return r.createElement(l.x,null,r.createElement(s.I.Wrapper,{label:n&&r.createElement(m.T,{size:"p3",weight:"semiBold"},n)},r.createElement(c.A.Group,Object.assign({},h),r.createElement(l.x,{className:g.group},t.map((e,t)=>r.createElement(c.A,{className:g.item,key:t,value:String(e.value),styles:{iconWrapper:{display:"none"},label:{width:"100%",borderRadius:(0,i.h)(f?12:8),padding:0,border:`1px solid ${f?"#EAEAEC":b.colors.neutral[2]}`,height:"100%","&[data-checked]":{padding:0,backgroundColor:f?"#FFE9F1":b.colors.blue[0],border:`1px solid ${f?"#F5B4CB":b.colors.blue[1]}`},[b.fn.smallerThan("sm")]:{alignItems:"flex-start"}}}},r.createElement(l.x,{sx:Object.assign(Object.assign(Object.assign({width:"100%",display:"flex",gap:(0,i.h)(f?2:8),padding:"8px 16px 8px 12px",justifyContent:"center",alignItems:"center"},f&&{flexDirection:"column"}),"vertical"===d&&{flexDirection:"column",padding:"16px 8px 8px"}),{[b.fn.smallerThan("sm")]:{flexDirection:"column",padding:"16px 8px 8px"}})},r.isValidElement(e.icon)?r.cloneElement(e.icon,{size:E,isMarryBaby:f,className:g.icon}):null,r.createElement(m.T,{size:"p4",styles:{root:Object.assign(Object.assign({},f&&{textAlign:"center"}),{whiteSpace:"normal",[b.fn.smallerThan("sm")]:{fontSize:(0,i.h)(12),lineHeight:(0,i.h)(18),textAlign:"center"}})}},e.label))))))))}},fhYe:function(e,t,n){n.d(t,{B:function(){return BlueWhiteLogin},N:function(){return NavigationProfileButton},U:function(){return UserPlain},a:function(){return k},b:function(){return NavigationProvider},u:function(){return useCSSFocusPopupHelper}});var a=n("XBaX"),r=n("q1tI"),o=n("nmRb"),i=n("35xs"),l=n("NQDR"),s=n("k1Nl"),c=n("HalR"),d=n("RVQf"),p=n("0aVn"),u=n("iBNF"),m=n("rBCA"),h=n("+J3I"),g=n("gEnE"),b=n("xXM3"),f=n.n(b),v=n("LBVr"),E=n("Czgk"),y=n("eosd"),w=n("xrdX"),x=n("QHxc"),C=n("hPj0");let BlueWhiteLogin=e=>r.createElement("svg",Object.assign({width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),r.createElement("rect",{y:"0.5",width:"31",height:"31",rx:"15.5",fill:"white"}),r.createElement("path",{d:"M15.4999 14.3797C16.9062 14.3797 18.0462 13.2397 18.0462 11.8334C18.0462 10.4271 16.9062 9.28711 15.4999 9.28711C14.0936 9.28711 12.9536 10.4271 12.9536 11.8334C12.9536 13.2397 14.0936 14.3797 15.4999 14.3797Z",stroke:"#2743AD",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{d:"M19.9092 22.0335C20.7055 21.7825 21.124 20.9029 20.786 20.1399C19.8879 18.1112 17.861 16.6946 15.4999 16.6946C13.1388 16.6946 11.112 18.1112 10.2138 20.1399C9.87585 20.9038 10.2944 21.7825 11.0907 22.0335C12.2249 22.3909 13.7258 22.7131 15.4999 22.7131C17.274 22.7131 18.7749 22.3909 19.9092 22.0335Z",stroke:"#2743AD",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})),UserPlain=e=>r.createElement("svg",Object.assign({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),r.createElement("path",{d:"M9.99991 8.3797C11.4062 8.3797 12.5462 7.23969 12.5462 5.83341C12.5462 4.42712 11.4062 3.28711 9.99991 3.28711C8.59363 3.28711 7.45361 4.42712 7.45361 5.83341C7.45361 7.23969 8.59363 8.3797 9.99991 8.3797Z",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{d:"M14.4092 16.0335C15.2055 15.7825 15.624 14.9029 15.286 14.1399C14.3879 12.1112 12.361 10.6946 9.99992 10.6946C7.63881 10.6946 5.61196 12.1112 4.71381 14.1399C4.37585 14.9038 4.79436 15.7825 5.59066 16.0335C6.72492 16.3909 8.22584 16.7131 9.99992 16.7131C11.774 16.7131 13.2749 16.3909 14.4092 16.0335Z",stroke:"white",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})),useNavConfig=({locale:e,projectType:t,siteType:n,enableBookingBtn:a})=>{let o=(0,r.useMemo)(()=>{let r="discover"===t||"together"===t||"marryBaby"===t||"profile"===t&&"marryBaby"===n,o="marryBaby"!==n&&"marryBaby"!==t&&v.C.includes(e),i=a&&"marryBaby"!==t&&"discover"===t&&"marryBaby"!==n&&v.d.includes(e),l="marryBaby"===t||v.c.includes(e),s="marryBaby"!==n&&v.E.includes(e),c="marryBaby"!==n&&v.E.includes(e),d=v.V.includes(e),p=v.H.includes(e),u=v.e.includes(e),m=(0,y.g)(e,"marryBaby"===n),h=m;"undefined"!=typeof window&&(h.includes("//id.")&&(h=h.replace("id.","")),h.includes("//staging-id.")&&(h=h.replace("staging-id.","discover.")));let g=(0,y.a)(e,"marryBaby"===n),b={HOME_PAGE_URL:h,CARE_URL_FE:`${h}/care`,TOGETHER_URL_FE:`${h}/community`,VIDEO_URL_FE:`${h}/videos`,SSO_URL:g,TOGETHER_API:(0,y.b)(),DISCOVER_API:(0,y.c)(e)};return{enableSearchBar:r,enableNavCare:o,enableNavCareBooking:i,enableNavTogether:l,enableNavEcom:s,enableProfileEcom:c,enableNavVideo:d,enableProfileMyHealth:!0,enableNavDiscover:!0,enableNavHealthTools:!0,enableProfileMySaved:!0,statics:b,enableNavClinityDownload:p,enableNavCartCare:u}},[]);return o},k=r.createContext({}),NavigationProvider=e=>{var{children:t}=e,n=(0,a._)(e,["children"]);let[o,i]=r.useState(()=>n.currentUrl||`https://${"marryBaby"===n.siteType?E.d[n.locale||"en-PH"]:w.v[n.locale||"en-PH"]}${"together"===n.projectType?"/community":"ecom"===n.projectType?"/ecom":"care"===n.projectType?"/care":""}/`);(0,r.useEffect)(()=>{let update=()=>{i(window.location.href)};return window.addEventListener("popstate",update),update(),()=>{window.removeEventListener("popstate",update)}},[]);let l=useNavConfig({locale:n.locale,projectType:n.projectType,siteType:n.siteType,enableBookingBtn:n.enableBookingBtn});return r.createElement(k.Provider,{value:Object.assign(Object.assign({},n),{customClasses:n.customClasses||{},configs:Object.assign(Object.assign({},l),n.configs),currentUrl:n.currentUrl||o})},t)},useCSSFocusPopupHelper=e=>{let{allowBgScroll:t}=e||{},n=(0,r.useRef)();return{containerRef:n,onContainerFocus:()=>{t||(document.documentElement.style.overflow="hidden")},onContainerBlur:()=>{t||(document.documentElement.style.overflow="")},onButtonMouseDown:e=>{n.current&&(document.activeElement===n.current||n.current.contains(document.activeElement))&&(n.current.blur(),document.activeElement.blur(),e.preventDefault())},onClose:()=>{n.current&&(document.activeElement===n.current||n.current.contains(document.activeElement))&&(n.current.blur(),document.activeElement.blur())}}},S=(0,g.Z)(m.Z.div` position: absolute; right: 0; transition: all 0.5s ease-in-out; overflow-y: auto; &[data-open='true'] { z-index: 200; top: 120%; opacity: 1; visibility: visible; } &[data-open='false'] { display: none; } .popup-content { z-index: 111; height: 100%; border: 1px solid #0000001a; border-radius: 16px; border-top-left-radius: 0; border-top-right-radius: 0; } /* min-height: 415px; */ ${h.M.mbUp} { width: 320px; } ${h.M.mbDown} { position: fixed; left: 0; width: 100%; padding-bottom: 70px; } `,"hhgcomp-navprofilebutton-popup"),T=(0,g.Z)(m.Z.div` position: fixed; z-index: 150; top: var(--header-bottom, 56px); left: 0; width: 100%; height: 100%; align-items: center; ${h.M.mbUp} { background-color: transparent; &[data-type='welcome'] { background: rgba(38, 38, 38, 0.3); } &[data-type='due-date'] { background: rgba(38, 38, 38, 0.3); } } ${h.M.mbDown} { background: rgba(38, 38, 38, 0.3); } &[data-type='welcome'] { top: 0; } &[data-open='false'] { display: none; } `,"hhgcomp-navprofilebutton-popupwrapper"),B=m.Z.div` width: 36px; height: 36px; cursor: pointer; img { border-radius: 50%; } .avatar { width: 36px; height: 36px; object-fit: cover; } .avatar-default { display: flex; align-items: center; justify-content: center; background-color: ${u.r.colors.secondaryBase}; border-radius: 50%; color: white; font-size: 20px; font-weight: bold; } `,P=m.Z.div` display: inline-flex; position: relative; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; text-decoration: none; flex-shrink: 0; cursor: pointer; .user-close-icon { display: none; } &:focus-within { .user-close-icon { display: block; } .user-avatar { display: none; } ${S.classSelector} { z-index: 200; top: 120%; opacity: 1; visibility: visible; display: initial; ${h.M.mbDown} { top: 100%; } } ${T.classSelector} { display: initial; } } `,O=m.Z.a` display: inline-flex; .login-btn[data-color='tertiary'][data-size='md'] { padding-left: 12px; padding-right: 12px; } .mobile-only { ${h.M.mbUp} { display: none; } } .login-btn { display: none; ${h.M.mbUp} { display: block; border: 1px solid ${u.r.colors.neutral100}; } } &[data-win-cash-back-theme='true'] { .login-btn { ${h.M.mbUp} { color: ${u.r.colors.white}; } } } `,ProfilePopup=({isOpen:e,userInfo:t,closePopup:n,siteType:a="helloSites",dispatchLogout:o})=>{let{customClasses:i={},configs:{enableProfileFindMyBooking:l}}=(0,r.useContext)(k);return r.createElement(S,{className:i.profilePopup,"data-open":e},r.createElement("div",{className:f()("popup-content",i.profilePopupContent)},r.createElement(x.l,{siteType:a,onLogout:()=>{o&&(o(),n())},userInfo:t,configs:{enableProfileFindMyBooking:l}})))},NavigationProfileButton=({userInfo:e,siteType:t,onLoginClick:n,currentUrl:m,isMinifyLogin:h,onLogout:g,style:b,isLoading:f,isMobile:v,className:E})=>{let{isWinCashBackTheme:y}=(0,r.useContext)(k),{t:w}=(0,d.u)(),[x,S]=(0,r.useState)(!1),T=(null==e?void 0:e.name)||(null==e?void 0:e.username),{containerRef:I,onContainerFocus:N,onContainerBlur:_,onButtonMouseDown:j,onClose:A}=useCSSFocusPopupHelper(),L=(0,r.useMemo)(()=>v&&"helloSites"===t,[v]);return f?L?r.createElement(i.S,null):r.createElement(s.B,{size:"sm",color:"transparent",loading:!0}):(null==e?void 0:e.id)?r.createElement(r.Fragment,null,r.createElement(P,{ref:I,style:b,tabIndex:0,onBlur:_,onFocus:()=>{var e;N();let t=null===(e=I.current)||void 0===e?void 0:e.querySelector("#navigation-v2 .hhgcomp-navprofilebutton-popup");if(t){let e=t.getBoundingClientRect(),n=e.top,a=`calc(100vh - ${n}px)`;t.setAttribute("style",`max-height: ${a};`)}},className:E},r.createElement("div",{onMouseDown:j},r.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"user-close-icon"},r.createElement("path",{d:"M18 6L6 18M18 18L6 6",stroke:"#3E3F58",strokeWidth:"1.3",strokeLinecap:"round"})),r.createElement(l.A,{size:32,className:"user-avatar",src:null==e?void 0:e.avatar,color:"marryBaby"===t?u.r.mbColors.pink:u.r.colors.secondaryBase,placeholderText:T&&T.length?T[0].toUpperCase():"A"})),r.createElement(ProfilePopup,{dispatchLogout:()=>{A(),S(!0)},isOpen:!1,closePopup:A,siteType:t,userInfo:e})),r.createElement(C.F,{openLogoutPopup:x,onCloseHandler:()=>{document.body.classList.toggle("noscroll",!1),S(!1)},siteType:t,onLogoutHandler:()=>(0,a.a)(void 0,void 0,void 0,function*(){S(!1),document.body.classList.toggle("noscroll",!1),yield g()})})):r.createElement(O,{style:Object.assign({textDecoration:"none"},b),"data-event-category":"Sign Up","data-event-action":"Button Click","data-event-label":m,"data-win-cash-back-theme":y,"data-site-type":t,onClick:n},h?r.createElement(B,null,r.createElement("img",{src:p.C.getAssetPath("lock.png"),className:"avatar",loading:"lazy",alt:"avatar"})):r.createElement(r.Fragment,null,"helloSites"===t&&(L?y?r.createElement(BlueWhiteLogin,{className:"mobile-only",style:{cursor:"pointer",width:32,height:32,flexShrink:0}}):r.createElement("img",{className:"mobile-only",src:p.C.getAssetPath("login.svg"),style:{cursor:"pointer",height:24,width:24}}):r.createElement(s.B,{className:"mobile-only",size:"sm",leftIcon:r.createElement(o.Z,{color:"currentColor",isSolid:!0,size:22}),sx:{paddingLeft:"8px",paddingRight:"12px"},styles:{leftIcon:{marginRight:4}}},w("navigation.loginJoin"))),"marryBaby"===t&&r.createElement("div",{className:"mobile-only",style:{paddingLeft:16}},r.createElement(c.T,{size:"p3",color:u.r.mbColors.pink},w("navigation.loginJoin"))),"marryBaby"===t?r.createElement(s.B,{className:"login-btn",size:"md",leftIcon:r.createElement(o.Z,{color:"currentColor",isSolid:!0,size:22})},w("navigation.loginJoin")):r.createElement(s.B,{className:"login-btn",size:"md",leftIcon:y?r.createElement(UserPlain,{style:{flexShrink:0,width:20,height:20}}):r.createElement(o.Z,{color:"#595959",isSolid:!0,size:22}),variant:"ghost",color:"#262626",sx:{fontWeight:500,fontSize:14,lineHeight:22}},w("navigation.loginJoin"))))}},RllT:function(e,t,n){n.d(t,{T:function(){return m},a:function(){return getUserIdFromCookie},b:function(){return getSubotCookieId},c:function(){return getUserInfoFromCookie},d:function(){return getWindowId},e:function(){return checkUntilFinished},f:function(){return checkMobile},g:function(){return getHelloSitesUrl},h:function(){return clickAndOpenInNewTab},i:function(){return formatUrlWithEncrypedGa},j:function(){return isFakeEmail},k:function(){return getHhgIdFromCookie},o:function(){return overrideParamsByQuery},s:function(){return ssoIntents}});var a=n("plOY"),r=n("LBVr"),o=n("/yV4"),i=n("JIJ2"),l=n("hHL7"),s=n("GOBr"),c=n("xrdX");let d=["form_submit_meta","selected_actions","current_selected","current_keys","current_polls"],p=["bot_id","node_id","action_id","action_value","current_score","gtm_id","ga_client_id","is_new","title_url","url","window_id",...d],overrideParamsByQuery=(e,t)=>{let n=Object.keys(t);return n.map(n=>{let a=t[n];if("source"===n){e.is_new="first_login"===a;return}if(p.includes(n)){if(d.includes(n)){try{e[n]=JSON.parse(a)}catch(e){}return}if("account_id"===n||"current_score"===n||"bot_id"===n){e[n]=parseInt(a);return}e[n]=a}}),e},ssoIntents=e=>[{id:(0,l.Z)(),label:JSON.stringify({title:"",description:""}),type:o.N.SSO_INTENT,url:""},{id:(0,l.Z)(),label:JSON.stringify({title:e({id:"subot.myHealth.title",defaultMessage:"My Health"}),description:e({id:"subot.myHealth.description",defaultMessage:"Personal identifiers (like your name) will always be removed to protect your privacy. "})}),type:o.N.SSO_INTENT,url:"/images/subot/my-health.svg"},{id:(0,l.Z)(),label:JSON.stringify({title:e({id:"subot.saveData.title",defaultMessage:"Save Data"}),description:e({id:"subot.saveData.description",defaultMessage:"Hellobacsi would like to learn from your data to provide better healthcare for you"})}),type:o.N.SSO_INTENT,url:"/images/subot/file-storage.svg"},{id:(0,l.Z)(),label:JSON.stringify({title:e({id:"subot.productYourIdentifiers.title",defaultMessage:"Protect your identifiers"}),description:e({id:"subot.productYourIdentifiers.description",defaultMessage:"Personal identifiers (like your name) will always be removed to protect your privacy. "})}),type:o.N.SSO_INTENT,url:"/images/subot/shield.svg"}];function checkUntilFinished(e){let t=e.condition,n=e.finished,a=e.timeout||3e3,r=new Date().getTime(),o=setInterval(()=>{let e=new Date().getTime();(e-r>a||t())&&(clearInterval(o),n())},300)}let getHhgIdFromCookie=e=>{let t=a.c.parse(e||""),n=t["hhg-id"];return n||i.Z.get("hhg-id")||""},getSubotCookieId=e=>{if(e)return i.Z.set("hhg-id",e),e;let t=getHhgIdFromCookie();if(t)return t;let n=(0,l.Z)();return i.Z.set("hhg-id",n),n},getUserIdFromCookie=e=>{let t=a.c.parse(e||""),n=t[r.B],o=n||i.Z.get(r.B)||"";try{let e=o.split(".")[1],t=e.replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(n).sub}catch(e){return""}},getUserInfoFromCookie=e=>{let t=a.c.parse(e||""),n=t[r.B],o=n||i.Z.get(r.B)||"";try{let e=o.split(".")[1],t=e.replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join("")),a=JSON.parse(n);return{email:a.email,id:a.sub}}catch(e){return{email:"",id:0}}},u=(0,l.Z)(),getWindowId=()=>u,getHelloSitesUrl=(e,t)=>{let n=!t&&"undefined"!=typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname);return n?"http://localhost":`https://${s.y?"":"discover."}${c.v[e]}`},checkMobile=e=>{let t=e||("undefined"==typeof navigator?"":navigator.userAgent);return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substring(0,4)))},clickAndOpenInNewTab=e=>{let t=document.createElement("a");t.href=e,t.target="_blank",t.click()},m=30,isFakeEmail=e=>(null==e?void 0:e.endsWith("@hhg.com"))||(null==e?void 0:e.endsWith("@facebook.com"));function formatUrlWithEncrypedGa(e="",t=""){if(!e.startsWith("https://")||!t)return"";let n=new URL(e),a=n.searchParams;return a.get("hhgclid")?(a.delete("hhgclid"),a.set("hhgclid",t),`${n.origin}${n.pathname}?${a.toString()}`):e}},c3eO:function(e,t,n){n.d(t,{M:function(){return er},S:function(){return SurveyOrPremiumBanner},a:function(){return eo},b:function(){return SideBannerModal}});var a,r,o,i,l,s,c,d=n("q1tI"),p=n("mYVa"),u=n("7Ci/"),m=n("/npG"),h=n("Eso5"),g=n("OAL+"),b=n("SPK5"),f=n("RZSM"),v=n("vaps"),E=n("9n+W"),y=n("DA0W"),w=n("RGvF"),x=n("JZkZ"),C=n("MkcP"),k=n("0aVn"),S=n("Czgk"),T=n("LBVr"),B=n("tVbD"),P=n("UIg8"),O=n("XBaX"),I=n("9q1R"),N=n("fkwy"),_=n("eosd"),j=n("RVQf"),A=n("cChf"),L=n("ZFu2"),M=n("NQDR"),R=n("BSZG"),H=n("HalR"),F=n("k1Nl"),z=n("jD9D"),D=n("IQVP"),$=n("0mzb"),V=n("Tn+8"),W=n("rA4w"),U=n("xrdX"),G=n("GOBr"),Z=n("OWiL"),Y=n("vWP/"),q=n("D0+0"),X=n("if/6"),K=n("JIJ2"),J=n("TYy9"),Q=n.n(J),ee=n("qPyV"),et=n.n(ee),en=n("qpOh");let ea=[{title:"Health News & Current Affairs",description:"Covering the latest happenings in the health field, including medical breakthroughs, policies, and disease outbreaks",icon:k.C.getAssetPath("newsletter-prefer/newsletter-health.svg"),checked:!1,id:1},{title:"Educational Medical Hello Bacsi Content",description:"Covering the latest happenings in the health field, including medical breakthroughs, policies, and disease outbreaks",icon:k.C.getAssetPath("newsletter-prefer/newsletter-education.svg"),checked:!1,id:2},{title:"Hello Health Community Feed",description:"Covering the latest happenings in the health field, including medical breakthroughs, policies, and disease outbreaks",icon:k.C.getAssetPath("newsletter-prefer/newsletter-community.svg"),checked:!1,id:3}];(a=i||(i={})).Pregnant="pregnant",a.Parenting="parenting",(l||(l={})).Option="option",(r=s||(s={})).Button="button",r.Checkbox="checkbox",(o=c||(c={})).ShowTool="showTool",o.ShowPremiumModal="showPremiumModal",o.ShowOptionBanner="showOptionBanner",o.Hide="hide";let er={pregnancy:i.Pregnant,parenting:i.Parenting},eo={[i.Pregnant]:"pregnant",[i.Parenting]:"parent"},FLOW=(e,t)=>({[i.Pregnant]:{action:c.ShowOptionBanner,props:{heading:e("pnBanner.pregnancy.heading"),description:e("pnBanner.pregnancy.desc"),styleType:s.Button,thumbnail:{desktop:k.C.getAssetPath("newsletter/banner-option-pregnancy-desktop.png"),mobile:k.C.getAssetPath("newsletter/banner-option-pregnancy-mobile.png")},buttonProps:{variant:"white",styles:e=>({minWidth:(0,p.h)(80),[e.fn.largerThan("sm")]:{minWidth:(0,p.h)(120)}})},items:[{label:e("switchBtn.yes"),value:"yes",tracking:{dataEventCategory:"Focused Audience",dataEventAction:"Are you navigating the world of pregnancy - Yes Click",dataEventLabel:t}},{label:e("switchBtn.no"),value:"no",tracking:{dataEventCategory:"Focused Audience",dataEventAction:"Are you navigating the world of pregnancy - No Click",dataEventLabel:t}}]},submitHandler:{yes:{action:c.ShowTool,props:{value:B.H.DUE_DATE}},no:{action:c.ShowPremiumModal}}},[i.Parenting]:{action:c.ShowOptionBanner,props:{heading:e("pnBanner.parenting.heading"),description:e("pnBanner.parenting.desc"),thumbnail:{desktop:k.C.getAssetPath("newsletter/banner-option-parenting-desktop.png"),mobile:k.C.getAssetPath("newsletter/banner-option-parenting-mobile.png")},hideDescOnMobile:!0,styleType:s.Checkbox,items:[{label:e("pnBanner.toddlers"),value:"todders"},{label:e("pnBanner.teenager"),value:"teenager"}],submitBtnTracking:{dataEventCategory:"Focused Audience",dataEventAction:"What is the age range of your kids Click",dataEventLabel:t}},submitHandler:{todders:{action:c.ShowTool,props:{value:B.H.BABY_VACCINE}},teenager:{action:c.ShowOptionBanner,props:{styleType:s.Button,heading:e("pnBanner.teenager.heading"),description:e("pnBanner.parenting.desc"),thumbnail:{desktop:k.C.getAssetPath("newsletter/banner-option-parenting-desktop.png"),mobile:k.C.getAssetPath("newsletter/banner-option-parenting-mobile.png")},buttonProps:{variant:"white"},items:[{label:e("childCard.boy"),value:"teenager.boy",tracking:{dataEventCategory:"Focused Audience",dataEventAction:"What is the gender of your kids - Boy Click",dataEventLabel:t}},{label:e("childCard.girl"),value:"teenager.girl",tracking:{dataEventCategory:"Focused Audience",dataEventAction:"What is the gender of your kids - Girl Click",dataEventLabel:t}}]}},"teenager.boy":{action:c.ShowPremiumModal},"teenager.girl":{action:c.ShowTool,activeTool:P.t.HPV,props:{value:P.t.HPV}},"todders|teenager":{action:c.ShowOptionBanner,props:{styleType:s.Button,heading:e("pnBanner.both.heading"),description:e("pnBanner.both.desc"),thumbnail:{desktop:k.C.getAssetPath("newsletter/banner-option-parenting-desktop.png"),mobile:k.C.getAssetPath("newsletter/banner-option-parenting-mobile.png")},hideDescOnMobile:!0,buttonProps:{variant:"secondary"},styles:e=>({wrapper:{[e.fn.smallerThan("sm")]:{flexDirection:"column"}},button:{background:e.colors.blue[0]}}),items:[{label:e("pnBanner.vaccine.btnLabel"),activeTool:B.H.BABY_VACCINE,isLink:!0,tracking:{dataEventCategory:"Focused Audience",dataEventAction:"Experience our tools for parent - Baby Vaccine Click",dataEventLabel:t}},{label:e("pnBanner.pn.btnLabel"),value:"todders|teenager.showPN",isPNBtn:!0,tracking:{dataEventCategory:"Focused Audience",dataEventAction:"Experience our tools for parent - Premium Newsletter Click",dataEventLabel:t}}]}},"todders|teenager.showPN":{action:c.ShowOptionBanner,props:{styleType:s.Button,heading:e("pnBanner.both.heading"),description:e("pnBanner.both.desc"),thumbnail:{desktop:k.C.getAssetPath("newsletter/banner-option-parenting-desktop.png"),mobile:k.C.getAssetPath("newsletter/banner-option-parenting-mobile.png")},hideDescOnMobile:!0,buttonProps:{variant:"secondary"},styles:e=>({wrapper:{[e.fn.smallerThan("sm")]:{flexDirection:"column"}},button:{background:e.colors.blue[0]}}),items:[{label:e("pnBanner.vaccine.btnLabel"),activeTool:B.H.BABY_VACCINE,isLink:!0,tracking:{dataEventCategory:"Focused Audience",dataEventAction:"Experience our tools for parent - Baby Vaccine Click",dataEventLabel:t}}]}}}}}),TOOL_BANNERS_PROPS=e=>({[B.H.DUE_DATE]:{heading:e("pnBanner.dueDateTool.heading"),description:e("pnBanner.dueDateTool.desc"),btnLabel:e("pnBanner.caclNow"),value:B.H.DUE_DATE,dataEventAction:"Try our Due Date Calculator Click"},[B.H.BABY_VACCINE]:{heading:e("pnBanner.vaccination.heading"),description:e("pnBanner.vaccination.desc"),btnLabel:e("pnBanner.caclNow"),value:B.H.BABY_VACCINE,dataEventAction:"Try our Baby Vaccine Scheduler Click"},[B.H.BABY_GROWTH]:{heading:"Baby Growth",description:e("pnBanner.vaccination.desc"),btnLabel:e("pnBanner.caclNow"),value:B.H.BABY_GROWTH},[P.t.HPV]:{heading:e("pnBanner.hpv.heading"),description:e("pnBanner.hpv.desc"),thumbnail:{desktop:k.C.getAssetPath("newsletter/banner-option-hpv-desktop.png"),mobile:k.C.getAssetPath("newsletter/banner-option-hpv-mobile.png")},isRiskScreener:!0,btnLabel:e("pnBanner.checkNow"),value:P.t.HPV,hideDescOnMobile:!0,dataEventAction:"Keep safe from HPV virus Click"}}),ei=(0,d.createContext)({}),PnBannerEle=e=>{var t=(0,O._)(e,[]);let{locale:n}=(0,j.u)(),{type:a,isMobile:r,currentUrl:o,isMarketing:i,isLoggedIn:l,setShouldAcquisitionModalOpen:s}=(0,d.useContext)(ei),{triggerLogin:c}=(0,I.u)();return d.createElement(u.W,Object.assign({mih:{base:144,md:160},fluid:!0,p:0,sx:{borderRadius:4,cursor:"pointer"},onClick:()=>(0,O.a)(void 0,void 0,void 0,function*(){let e=i?(0,_.g)(n)+"/dang-ky-nhan-tin/":`${window.location.href}?source=acquisition`;l?null==s||s():(0,I.I)(n)?c({returnUrl:i?e:void 0,source:i?void 0:"acquisition"}):window.location.href=`${(0,_.a)(n)}/?returnUrl=${encodeURIComponent(e)}`}),"data-event-category":"Newsletter","data-event-action":"Banner Click","data-event-label":o,className:"pointer-event-child-none"},t),d.createElement(N.I,{src:i?k.C.getAssetPath(`newsletter/${r?"Mobile":"Desktop"}_Marketing.png`):k.C.getAssetPath(`newsletter/${r?"Mobile":"Desktop"}_${a}.png`),style:{maxWidth:"100%"},alt:"newsletter banner"}))},el={GET_NEWSLETTER_CATEGORIES:"api/v1/categories?site={website_url}",POST_SUBSCRIPTION:"api/v1/subscription?site={website_url}",GET_SUBSCRIPTION_CATEGORIES:"api/v1/categories?site={website_url}"};var es=(0,m.k)(e=>({root:{},wrapper:{[e.fn.smallerThan("sm")]:{width:"70%"}},button:{[e.fn.smallerThan("sm")]:{height:"auto",minHeight:(0,p.h)(32),padding:`${(0,p.h)(6)} ${(0,p.h)(16)}`,textAlign:"center",width:"100%"}},buttonLabel:{whiteSpace:"normal"}}));let BannerLayout=({heading:e,description:t,thumbnail:n={desktop:"",mobile:""},hideDescOnMobile:a,children:r})=>{let{isMobile:o,minHeight:i}=(0,d.useContext)(ei);return d.createElement(h.x,{sx:()=>({borderRadius:(0,p.h)(8),background:"linear-gradient(180deg, #FAFDFF 0%, #E3F2FF 100%)"})},d.createElement(h.x,{sx:e=>({minHeight:(0,p.h)(i),borderRadius:"inherit",background:`url(${o?n.mobile:n.desktop})`,backgroundPosition:"center right",backgroundRepeat:"no-repeat",backgroundSize:"contain",padding:`${(0,p.h)(24)} ${(0,p.h)(16)}`,display:"flex",flexDirection:"column",justifyContent:"center",[e.fn.largerThan("sm")]:{padding:`${(0,p.h)(22)} ${(0,p.h)(32)}`}})},d.createElement(g.K,{spacing:(0,p.h)(16)},d.createElement(g.K,{spacing:(0,p.h)(4),sx:e=>({maxWidth:"60%",[e.fn.largerThan("sm")]:{maxWidth:"70%"}})},e&&d.createElement($.H,{tag:"h4"},e),!(a&&o)&&t&&d.createElement(H.T,{size:"p4"},t)),d.createElement(h.x,null,r))))},BannerWithOptions=e=>{let{styleType:t=s.Button,items:n=[],buttonProps:a,styles:r,submitBtnTracking:o}=e,{classes:i}=es(void 0,{name:"PremiumBannerWithOptions",styles:r}),{t:l,locale:c}=(0,j.u)(),{surveyType:u,articleId:m,handleClickOption:g,hasPremiumBanner:f,source:v,isMobile:E,setShowPNModal:y}=(0,d.useContext)(ei),w=(0,d.useMemo)(()=>f?n:n.filter(e=>!e.isPNBtn).filter(Boolean),[n]),{getHealthToolLink:x}=(0,V.u)(c),C=(0,A.c)({initialValues:{bannerOptions:[]}}),saveStep=e=>(0,O.a)(void 0,void 0,void 0,function*(){return yield(0,S.e)((0,S.f)(D.yy.HEALTH_TOOL.CREATE,{_locale:c,type:eo[u]}),"POST",{headers:{"Content-Type":"application/json"},data:{value:e,article:m,source:v}})}),k=(0,d.useCallback)(()=>d.createElement(b.k,{gap:(0,p.h)(8),className:i.wrapper},w.map((e,t)=>d.createElement(h.x,{key:String(t),component:e.isLink?"a":"div",href:e.isRiskScreener?`https://${U.v[c]}/bot/${P.n[c][e.activeTool]}/`:e.isLink?x(e.activeTool):void 0},d.createElement(F.B,Object.assign({className:i.button,classNames:{label:i.buttonLabel},size:"sm"},e.tracking,a,{onClick:()=>{e.isLink||(e.isPNBtn&&y(!0),saveStep(e.value),g(e.value))}}),e.label)))),[w,C]),T=(0,d.useCallback)(()=>d.createElement(b.k,null,d.createElement(b.k,{align:"center",gap:(0,p.h)(24),sx:e=>({background:"white",borderRadius:(0,p.h)(8),padding:(0,p.h)(4),[e.fn.largerThan("sm")]:{paddingLeft:(0,p.h)(16)}})},d.createElement(M.d.Group,Object.assign({},C.getInputProps("bannerOptions",{type:"checkbox"})),d.createElement(b.k,{gap:(0,p.h)(16)},w.map((e,t)=>d.createElement(M.d,{key:String(t),value:e.value,label:e.label,styles:{label:{cursor:"pointer"}}})))),d.createElement(F.B,Object.assign({size:"sm"},o,a,{disabled:0===C.getInputProps("bannerOptions").value.length,leftIcon:E?d.createElement(W.I.ArrowRightTail,{size:18,useCurrentColor:!0}):void 0,onClick:()=>{let e=C.getInputProps("bannerOptions").value;saveStep(e.join("|")),g(e.join("|"))},styles:e=>({root:{[e.fn.smallerThan("sm")]:{width:(0,p.h)(38),minWidth:"auto",padding:0}}})}),!E&&l("pnBanner.submit")))),[w,C]);return d.createElement(BannerLayout,Object.assign({},e),t===s.Button?k():t===s.Checkbox?T():null)},ToolBanner=e=>{var t,n;let{t:a}=(0,j.u)(),{heading:r,description:o,thumbnail:i,btnLabel:l,value:s,isRiskScreener:c,hideDescOnMobile:u,dataEventAction:m}=e,{locale:h}=(0,j.u)(),{isMobile:f}=(0,d.useContext)(ei),{getHealthToolLink:v,allTools:E}=(0,V.u)(h),y=(0,d.useMemo)(()=>{let e=c?`https://${G.y?"":"discover."}${U.v[h]}/bot/${P.n[h][s]}`:v(s);return d.createElement("a",{href:e},d.createElement(F.B,{size:"sm","data-event-category":"Focused Audience","data-event-action":m,"data-event-label":e},l||a("pnBanner.caclNow")))},[E]);return"mainBanner"==(c?"mainBanner":"toolBanner")?d.createElement(BannerLayout,Object.assign({},Object.assign(Object.assign({},e),{thumbnail:e.thumbnail})),y):d.createElement(b.k,{gap:(0,p.h)(7),align:"center",justify:"space-between",sx:e=>({borderRadius:(0,p.h)(8),background:e.colors.blue[0],minHeight:(0,p.h)(180),padding:`${(0,p.h)(24)} ${(0,p.h)(16)}`,[e.fn.largerThan("sm")]:{padding:`${(0,p.h)(34)} ${(0,p.h)(32)}`}})},d.createElement(g.K,{spacing:(0,p.h)(12)},d.createElement(g.K,{spacing:(0,p.h)(4)},r&&d.createElement($.H,{tag:"h4"},r),!(f&&u)&&o&&d.createElement(H.T,{size:"p4"},o)),d.createElement(b.k,{gap:(0,p.h)(8),sx:{button:{minWidth:(0,p.h)(120)}}},y)),d.createElement(b.k,{align:"center",justify:"center",sx:e=>({width:(0,p.h)(96),height:(0,p.h)(96),borderRadius:"50%",background:"white",flexShrink:0,[e.fn.largerThan("sm")]:{width:(0,p.h)(112),height:(0,p.h)(112)},img:{maxWidth:(0,p.h)(64),[e.fn.largerThan("sm")]:{maxWidth:(0,p.h)(73)}}})},d.createElement("img",{alt:"health-tool-icon",src:i||(null===(n=null===(t=E.filter(e=>e.template===s))||void 0===t?void 0:t[0])||void 0===n?void 0:n.icon)||B.a[s]||"",loading:"lazy"})))},HandlerBanner=()=>{var e,t,n;let{t:a}=(0,j.u)(),{state:r,Outside:o}=(0,d.useContext)(ei);return(null==r?void 0:r.action)===c.ShowTool?d.createElement(o,null,TOOL_BANNERS_PROPS(a)[null===(e=null==r?void 0:r.props)||void 0===e?void 0:e.value]?d.createElement(ToolBanner,Object.assign({},TOOL_BANNERS_PROPS(a)[null===(t=null==r?void 0:r.props)||void 0===t?void 0:t.value],{value:null===(n=null==r?void 0:r.props)||void 0===n?void 0:n.value})):null):(null==r?void 0:r.action)===c.ShowOptionBanner?d.createElement(o,null,d.createElement(BannerWithOptions,Object.assign({},null==r?void 0:r.props))):null},SideBannerModal=e=>{var{isMobile:t,children:n,desktopBanner:a=k.C.getAssetPath("friso/onboarding-banner.jpg"),mobileBanner:r=k.C.getAssetPath("friso/onboarding-banner-mobile.jpg"),modalRatio:o={width:937,height:536},mobileBannerRatio:i={width:750,height:480},desktopBannerRatio:l={width:420,height:536},closeProps:s}=e,c=(0,O._)(e,["isMobile","children","desktopBanner","mobileBanner","modalRatio","mobileBannerRatio","desktopBannerRatio","closeProps"]);let{width:u,height:m}=(0,z.n)(),g=u*i.height/i.width,[b,v]=(0,d.useState)(!1);return d.createElement(X.M,Object.assign({styles:e=>({header:{display:"none"},content:{flex:"auto",background:"transparent",[e.fn.smallerThan("sm")]:{maxHeight:"100%",height:"100%",position:"relative",borderRadius:0},[e.fn.largerThan("sm")]:{maxWidth:(0,p.h)(o.width),width:"100%",height:"100%",maxHeight:(0,p.h)(o.height),boxShadow:"none"}},body:{padding:0,width:"100%",height:"100%",[e.fn.largerThan("sm")]:{display:"flex",alignItems:"center"}},inner:{padding:0,[e.fn.smallerThan("sm")]:{display:"flex",alignItems:"flex-end"}}})},c),t?d.createElement(h.x,{sx:{position:"relative",width:"100%",height:"100%"},onTouchStart:()=>v(!0)},d.createElement(h.x,{className:"mobile-template",sx:{position:"absolute",height:`${(b?1:((m<=667?190:265)+g+74)/m)*100}%`,left:0,bottom:0,right:0,transition:"height 0.4s ease"}},d.createElement(h.x,{className:"mobile-template-wrapper",sx:{height:"100%",backgroundColor:"white",borderTopLeftRadius:b?0:(0,p.h)(12),borderTopRightRadius:b?0:(0,p.h)(12)}},d.createElement(h.x,{sx:{height:"100%",background:`url(${r})`,backgroundSize:"contain",backgroundRepeat:"no-repeat",backgroundPosition:"top center",overflowY:"auto",borderRadius:"inherit"}},(0,q.i)(r)&&d.createElement("video",{loop:!0,muted:!0,autoPlay:!0,style:{width:"100%",position:"absolute",top:0,left:0}},d.createElement("source",{src:r})),d.createElement(F.B,Object.assign({variant:"white",leftIcon:d.createElement(Z.Z,null),sx:{position:"absolute",right:0,top:0,zIndex:1,padding:(0,p.h)(10)}},s,{onClick:()=>null==c?void 0:c.onClose()})),d.createElement(f.o,{ratio:(null==i?void 0:i.width)/(null==i?void 0:i.height),w:"100%"}),d.createElement(h.x,{className:"inner",sx:{padding:`${(0,p.h)(28)} ${(0,p.h)(16)} ${(0,p.h)(16)}`,background:"white",position:"relative"}},n))))):d.createElement(f.o,{className:"desktop-template",ratio:o.width/o.height,w:"100%",sx:{position:"relative","& > div":{justifyContent:"flex-end"}}},d.createElement(h.x,{sx:{width:"100%",height:"100%",justifyContent:"flex-end",alignItems:"stretch",borderRadius:(0,p.h)(8),background:"white",boxShadow:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 2.25rem 1.75rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 1.0625rem 1.0625rem -0.4375rem"}},(0,q.i)(a)?d.createElement("video",{loop:!0,muted:!0,autoPlay:!0,style:{borderTopLeftRadius:(0,p.h)(8),borderBottomLeftRadius:(0,p.h)(8),height:"100%",display:"block"}},d.createElement("source",{src:a})):d.createElement("img",{alt:"",src:a,loading:"lazy",style:{borderTopLeftRadius:(0,p.h)(8),borderBottomLeftRadius:(0,p.h)(8),height:"100%",display:"block"}}),d.createElement(h.x,{sx:{position:"relative",height:"100%",width:`${(o.width-l.width)/o.width*100}%`}},d.createElement(F.B,Object.assign({variant:"white",leftIcon:d.createElement(Z.Z,null)},s,{onClick:()=>null==c?void 0:c.onClose(),sx:{position:"absolute",right:0,top:0,backgroundColor:"transparent"}})),d.createElement(h.x,{className:"side-banner-modal-container",sx:{height:"100%",padding:`${(0,p.h)(40)} ${(0,p.h)(24)} 0`}},n)))))},ec={UPDATE_SUBSCRIPTION:"user/subscription"},ed=(0,d.createContext)({}),_NormalTopic=e=>{var{value:t,name:n}=e,a=(0,O._)(e,["value","name"]);return d.createElement(M.g,Object.assign({value:t,withIcon:!0},a,{buttonProps:{styles:()=>({leftIcon:{marginRight:(0,p.h)(6)},root:{paddingLeft:(0,p.h)(10),paddingRight:(0,p.h)(10)}})}}),n)},TopicSection=({topicsGroup:e,onTopicChange:t,isBlock:n=!1,selectedTopics:a=[],inputProps:r,labelProps:o,maxSelect:i=5,hasScroll:l,readonly:s})=>{let{action:{pushNotifications:c}}=(0,d.useContext)(S.T),p=Q()(e.map(e=>e.topics||[])),{t:u}=(0,j.u)(),[m,f]=(0,d.useState)([]);(0,d.useEffect)(()=>{f(a)},[a.length]),(0,d.useEffect)(()=>{null==t||t(m)},[m]);let onValueChange=e=>{if(e.length>5){c({type:"danger",title:u("pnTopicSection.maxSelectError.title",{maxSelect:i}),message:u("pnTopicSection.maxSelectError.desc")});return}s||f(()=>p.filter(t=>e.some(e=>t.catId===e)))};return d.createElement(g.K,{spacing:12},e.map((e,t)=>d.createElement(g.K,{key:String(t),spacing:12},e.label&&d.createElement(H.T,Object.assign({size:"s5",color:"gray.4",weight:"semiBold"},o),e.label),l?d.createElement(v.x,{w:"100%",offsetScrollbars:!0,scrollbarSize:4,p:16,m:-16,styles:{viewport:{margin:-16,padding:16}}},d.createElement(h.x,{w:800},d.createElement(E.A.Group,Object.assign({value:m.map(e=>e.catId),multiple:!0},r,{onChange:onValueChange}),d.createElement(b.k,{gap:8,wrap:"wrap"},e.topics.map(t=>d.createElement(_NormalTopic,Object.assign({key:t.catId,value:t.catId,name:t.localName,isBlock:n},e.tracking))))))):d.createElement(E.A.Group,Object.assign({value:m.map(e=>e.catId),multiple:!0},r,{onChange:onValueChange}),d.createElement(b.k,{gap:8,wrap:"wrap"},e.topics.map(t=>t.catId?d.createElement(_NormalTopic,Object.assign({key:t.catId,value:t.catId,name:t.localName,isBlock:n},e.tracking)):d.isValidElement(t.component)?t.component:null))))))},Layout=e=>{var{heading:t,children:n,stickyActions:a}=e,r=(0,O._)(e,["heading","children","stickyActions"]);let{isMobile:o}=(0,d.useContext)(ed),i=d.createElement(g.K,{spacing:(0,p.h)(24),sx:{height:"100%"}},d.createElement($.H,{tag:"h4",style:{textAlign:"center"}},t),d.createElement(h.x,null,n));return d.createElement(h.x,{sx:e=>({[e.fn.largerThan("sm")]:{position:"relative",height:"100%"}})},o?i:d.createElement(v.x,Object.assign({className:"layout-body",h:a?"calc(100% - 90px)":"100%"},r),i),a&&d.createElement(b.k,{gap:(0,p.h)(8),sx:e=>({position:"absolute",left:0,right:0,bottom:0,padding:(0,p.h)(16),button:{flexGrow:1},justifyContent:"center",[e.fn.largerThan("sm")]:{padding:`${(0,p.h)(24)} 0`}})},a))},MainForm=()=>{let{t:e,locale:t}=(0,j.u)(),{data:{userInfo:n},action:{pushNotifications:a}}=(0,d.useContext)(S.T),r=null==n?void 0:n.id,{currentUrl:o,isMobile:i,pnSuggestCategory:l=[],nextStep:s,formValues:c,setFormValues:u,onSubmit:m,submitLoading:h,selectCategory:b,setCategoryLibs:f,setSelectCategory:v,maxSelectCategory:E}=(0,d.useContext)(ed),y=l.map(e=>e.catId),w=(0,A.c)({validate:{name:(0,L.U)(e("healthToolPNModal.mainForm.requireName"))},initialValues:Object.assign(Object.assign({},c),{fitnessTopics:y})}),[x,C]=(0,d.useState)([]),[k,T]=(0,d.useState)([]);(0,d.useEffect)(()=>{(0,O.a)(void 0,void 0,void 0,function*(){var e;try{let n=yield(0,S.e)((0,S.h)(el.GET_SUBSCRIPTION_CATEGORIES,{_locale:t}),"get"),a=((null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.subscription)||[]).filter(e=>!y.includes(e.catId));C(l),T(a),f([...l,...a])}catch(e){console.log(e)}})},[]),(0,d.useEffect)(()=>{r&&w.setFieldValue("name",(null==n?void 0:n.name)||"")},[r]);let onMore=()=>{""!==w.getInputProps("name").value?(u(w.getTransformedValues()),s()):w.validateField("name")},B=(0,d.useMemo)(()=>d.createElement(F.B,{variant:"tertiary",dataEventCategory:"Newsletter",dataEventAction:"More Category Click",dataEventLabel:o,leftIcon:d.createElement(Y.Z,{size:16,color:"currentColor"}),onClick:onMore,styles:e=>({root:{borderRadius:(0,p.h)(6),padding:"2px 15px",height:(0,p.h)(40)},label:{fontSize:(0,p.h)(14),fontWeight:400,[e.fn.smallerThan("sm")]:{fontSize:(0,p.h)(12),lineHeight:(0,p.h)(16),height:(0,p.h)(40)}},leftIcon:{marginRight:"5px"}})},d.createElement(H.T,{size:i?"p3":"p4"},e("home.seeMore"))),[w]);return(0,d.useEffect)(()=>{w.setFieldValue("fitnessTopics",b.map(e=>e.catId))},[b]),d.createElement("form",{style:{height:"100%"},onSubmit:w.onSubmit(t=>{if(0===b.length)return a({type:"danger",title:e("newsletter.error.minTitle"),message:e("newsletter.error.minCotennt")}),!1;u(t),null==m||m(t.name)})},d.createElement(Layout,{heading:e("healthToolPNModal.heading"),stickyActions:d.createElement(d.Fragment,null,d.createElement(F.B,{fullWidth:!0,type:"submit",dataEventCategory:"Newsletter",dataEventAction:"Register Click",dataEventLabel:o,loading:h,sx:{maxWidth:(0,p.h)(240)}},e("healthToolPNModal.register")))},d.createElement(g.K,{spacing:(0,p.h)(16)},d.createElement(M.I,Object.assign({label:e("newsletter.welcome.description")},w.getInputProps("name"))),d.createElement(TopicSection,{topicsGroup:[...0===l.length&&0===k.length?[{topics:[{component:B}]}]:[],...l.length>0?[{label:e("healthToolPNModal.mainForm.tailorTopicsHeading"),topics:[...l,...0===k.length?[{component:B}]:[]]}]:[],...k.length>0?[{label:e("healthToolPNModal.findMore.chooseFav"),topics:[...k,...k.length>0?[{component:B}]:[]]}]:[]],selectedTopics:[...x],labelProps:{size:i?"p3":"p4",color:"gray.6"},onTopicChange:v,maxSelect:E}))))},ep=(0,d.forwardRef)(function(e,t){var{label:n}=e,a=(0,O._)(e,["label"]);return d.createElement("div",Object.assign({ref:t},a),d.createElement(y.Z,{noWrap:!0},d.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.97887 8.15493C2.97887 5.29627 5.29627 2.97887 8.15493 2.97887C11.0136 2.97887 13.331 5.29627 13.331 8.15493C13.331 11.0136 11.0136 13.331 8.15493 13.331C5.29627 13.331 2.97887 11.0136 2.97887 8.15493ZM8.15493 1.5C4.47951 1.5 1.5 4.47951 1.5 8.15493C1.5 11.8303 4.47951 14.8099 8.15493 14.8099C9.72615 14.8099 11.1702 14.2653 12.3086 13.3547L15.2376 16.2837C15.5264 16.5725 15.9946 16.5725 16.2833 16.2837C16.5721 15.9949 16.5721 15.5267 16.2833 15.238L13.3544 12.3091C14.2652 11.1705 14.8099 9.72634 14.8099 8.15493C14.8099 4.47951 11.8303 1.5 8.15493 1.5Z",fill:"#8C8C8C"})),d.createElement(H.T,{size:"p3"},n)))}),eu=(0,d.forwardRef)(function(e,t){var{label:n}=e,a=(0,O._)(e,["label"]);return d.createElement("div",Object.assign({ref:t},a),d.createElement(H.T,{size:"p3"},n))}),HistorySection=({history:e,onDelete:t})=>d.createElement(b.k,{wrap:"wrap",gap:8},et()(e,"catId").map(e=>d.createElement(w.C,{key:e.catId,rightSection:d.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",onClick:()=>null==t?void 0:t(e)},d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.5 9C1.5 4.8525 4.8525 1.5 9 1.5C13.1475 1.5 16.5 4.8525 16.5 9C16.5 13.1475 13.1475 16.5 9 16.5C4.8525 16.5 1.5 13.1475 1.5 9ZM11.1677 12.2248C11.4602 12.5173 11.9327 12.5173 12.2252 12.2248C12.5101 11.9323 12.5101 11.4523 12.2252 11.1673L10.0577 8.99979L12.2252 6.83229C12.5177 6.53979 12.5177 6.0673 12.2252 5.7748C11.9327 5.4823 11.4602 5.4823 11.1677 5.7748L9.00015 7.9423L6.83265 5.7748C6.54015 5.4823 6.06765 5.4823 5.77515 5.7748C5.63471 5.91492 5.55579 6.10516 5.55579 6.30354C5.55579 6.50193 5.63471 6.69217 5.77515 6.83229L7.94265 8.99979L5.77515 11.1673C5.63471 11.3074 5.55579 11.4977 5.55579 11.696C5.55579 11.8944 5.63471 12.0847 5.77515 12.2248C6.06765 12.5173 6.54015 12.5173 6.83265 12.2248L9.00015 10.0573L11.1677 12.2248Z",fill:"#8C8C8C"})),styles:{root:{height:32,background:"#ffffff",padding:"5px 12px",border:`1px solid ${R.t.neutral[4]}`,borderRadius:32,textTransform:"unset"},rightSection:{height:18,cursor:"pointer"}}},d.createElement(H.T,{size:"p4"},e.localName)))),RecentlyViewedSection=({topics:e,onTopicChange:t,isBlock:n=!1,selectedTopics:a,labelProps:r,maxSelect:o=5})=>{let{action:{pushNotifications:i}}=(0,d.useContext)(S.T),[l,s]=(0,d.useState)([]),{t:c}=(0,j.u)();return((0,d.useEffect)(()=>{s(a)},[a.length]),(0,d.useEffect)(()=>{t(l)},[l]),e&&0!==e.length)?d.createElement(g.K,{spacing:12,px:16,mx:-16},d.createElement(H.T,Object.assign({size:"s5",color:"gray.4",weight:"semiBold"},r),c("pnTopicSection.recentView")),d.createElement(E.A.Group,{value:l.map(e=>e.catId),onChange:t=>{if(n&&l.lengthe.filter(e=>t.some(t=>e.catId===t)))},multiple:!0},d.createElement(b.k,{gap:8,wrap:"wrap"},e.map((e,t)=>d.createElement(_NormalTopic,{key:t,value:e.catId,name:e.localName,isBlock:n}))))):null},_TopicSlide=e=>{var{topic:t,active:n,onClick:a}=e,r=(0,O._)(e,["topic","active","onClick"]);return d.createElement(h.x,Object.assign({sx:e=>({position:"relative",cursor:"pointer",padding:2,borderRadius:8,boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.04), 0px 0px 2px rgba(0, 0, 0, 0.06), 0px 0px 1px rgba(0, 0, 0, 0.04)",minHeight:(0,p.h)(130),[e.fn.largerThan("sm")]:{minHeight:(0,p.h)(138)}}),onClick:()=>a(t,n)},r),n&&d.createElement(h.x,{id:"test",sx:{position:"absolute",top:2,right:2,width:20,height:20,zIndex:1}},d.createElement("svg",{id:"test",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.66699 9.99984C1.66699 5.39984 5.40033 1.6665 10.0003 1.6665C14.6003 1.6665 18.3337 5.39984 18.3337 9.99984C18.3337 14.5998 14.6003 18.3332 10.0003 18.3332C5.40033 18.3332 1.66699 14.5998 1.66699 9.99984ZM4.75066 10.5827L7.74232 13.5744C8.06732 13.8994 8.60066 13.8994 8.91732 13.5744L15.2423 7.2494C15.5673 6.9244 15.5673 6.3994 15.2423 6.0744C14.9173 5.7494 14.3923 5.7494 14.0673 6.0744L8.33399 11.8077L5.92566 9.40773C5.60066 9.08273 5.07566 9.08273 4.75066 9.40773C4.59461 9.56342 4.50692 9.7748 4.50692 9.99523C4.50692 10.2157 4.59461 10.427 4.75066 10.5827Z",fill:"#2D87F3"}),d.createElement("path",{d:"M7.74224 13.5772L4.75057 10.5856C4.59453 10.4299 4.50684 10.2185 4.50684 9.99808C4.50684 9.77765 4.59453 9.56627 4.75057 9.41058C5.07557 9.08558 5.60057 9.08558 5.92557 9.41058L8.33391 11.8106L14.0672 6.07725C14.3922 5.75225 14.9172 5.75225 15.2422 6.07725C15.5672 6.40225 15.5672 6.92725 15.2422 7.25225L8.91724 13.5772C8.60057 13.9022 8.06724 13.9022 7.74224 13.5772Z",fill:"white"}))),d.createElement(h.x,{sx:{borderRadius:"8px"}},d.createElement(M.c,{ratio:1.5,mb:10,sx:e=>({background:e.colors.neutral[0]})},d.createElement(h.x,null,d.createElement("img",{src:t.guid||"",alt:"cat",loading:"lazy",style:{maxHeight:"63px"}})))),d.createElement(H.T,{size:"p4",ta:"center",px:6,sx:{display:"-webkit-box","-webkit-line-clamp":"2","-webkit-box-orient":"vertical",overflow:"hidden"}},t.localName||""))},TrendingCarousel=({topics:e,selectedTopics:t=[],onTopicChange:n,isBlock:a=!1,labelProps:r,pushNotifications:o,maxSelect:i=5})=>{let{t:l}=(0,j.u)(),[s,c]=(0,d.useState)([]),onSelect=(e,t)=>{if(t)c(t=>t.filter(t=>t.catId!==e.catId));else{if(a){o({type:"danger",title:l("pnTopicSection.maxSelectError.title",{maxSelect:i}),message:l("pnTopicSection.maxSelectError.desc")});return}c(t=>[...t,e])}};(0,d.useEffect)(()=>{c(t)},[t.length]),(0,d.useEffect)(()=>{n(s)},[s]);let[p,u]=(0,d.useState)(!1),[m,f]=(0,d.useState)(0),[E,y]=(0,d.useState)(0),w=(0,d.useRef)(null),handleMouseUp=()=>{u(!1)};return d.createElement(g.K,{spacing:10},d.createElement(b.k,{justify:"space-between",align:"center",w:"100%"},d.createElement(H.T,Object.assign({size:"s5",color:"gray.4",weight:"semiBold",span:!0},r),l("pnTopicSection.trending"))),d.createElement(h.x,null,d.createElement(v.x,{type:"always",w:"100%",offsetScrollbars:!0,scrollbarSize:4,px:4,viewportRef:w,viewportProps:{onMouseDown:e=>{e.preventDefault(),w.current&&(u(!0),f(e.pageX-w.current.offsetLeft),y(w.current.scrollLeft))},onMouseUp:handleMouseUp,onMouseLeave:handleMouseUp,onMouseMove:e=>{if(e.preventDefault(),!p||!w.current)return;let t=e.pageX-w.current.offsetLeft;w.current.scrollLeft=E-(t-m)*2}},styles:{viewport:{paddingBottom:16}}},d.createElement(h.x,{w:{base:112*e.length+8*(e.length-1)+10}},d.createElement(b.k,{gap:8},e.map((e,t)=>d.createElement(_TopicSlide,{key:t,topic:e,onClick:onSelect,active:s.some(t=>t.catId===e.catId),w:{base:112}})))))))},PremiumTopicSelect=e=>{var{isLoggedIn:t,maxSelect:n=5,values:a=[],labelProps:r,onChange:o}=e,i=(0,O._)(e,["isLoggedIn","maxSelect","values","labelProps","onChange"]);let{action:{pushNotifications:l}}=(0,d.useContext)(S.T),[s,c]=(0,d.useState)(""),{t:u,locale:m}=(0,j.u)(),b=(0,d.useRef)(null),[f,v]=(0,d.useState)([]),[E,y]=(0,d.useState)([]),[w,C]=(0,d.useState)([]),[k,T]=(0,d.useState)([]),[B,P]=(0,d.useState)(null),[I,N]=(0,d.useState)([]);(0,d.useEffect)(()=>{(0,O.a)(void 0,void 0,void 0,function*(){var e,t;let n=yield(0,S.e)((0,S.h)(el.GET_NEWSLETTER_CATEGORIES,{_locale:m}),"get"),r=(null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.interested)||[],o=(null===(t=null==n?void 0:n.data)||void 0===t?void 0:t.trending)||[],i=et()([...r,...o],"catId"),l=i.map(e=>Object.assign(Object.assign({},e),{value:e.catId||"",label:e.localName||""}));if(N(l||[]),P((null==n?void 0:n.data)||null),a.length>0){let e=r.filter(e=>a.includes(e.catId)).map(e=>Object.assign(Object.assign({},e),{template:"interested"})),t=o.filter(e=>a.includes(e.catId)).map(e=>Object.assign(Object.assign({},e),{template:"trending"}));T(e),y(t)}})},[t]);let _=(0,d.useMemo)(()=>et()([...f,...E,...k,...w],"catId"),[f,E,k,w]),[A,L]=(0,d.useState)(!1);(0,d.useEffect)(()=>{_.length>=n?L(!0):L(!1),null==o||o(_)},[_]);let onValueChange=e=>(0,O.a)(void 0,void 0,void 0,function*(){var t;let a="default";if(A)l({type:"danger",title:u("pnTopicSection.maxSelectError.title",{maxSelect:n}),message:u("pnTopicSection.maxSelectError.desc")});else{let n=[{key:"trending",array:null==B?void 0:B.trending},{key:"recently",array:null==B?void 0:B.recently},{key:"interested",array:null==B?void 0:B.interested}],r=n.find(t=>{var n;return null===(n=t.array)||void 0===n?void 0:n.some(t=>t.catId===e[0])});({trending:y,recently:C,interested:T,default:v})[a=(null==r?void 0:r.key)||"default"](t=>[...t,...I.filter(t=>e.some(e=>t.catId===e))].map(e=>Object.assign(Object.assign({},e),{template:a}))),null===(t=b.current)||void 0===t||t.blur()}return null});return d.createElement(g.K,Object.assign({spacing:(0,p.h)(16)},i),d.createElement(g.K,{spacing:(0,p.h)(8)},d.createElement(H.T,{size:"p3"},u("pnTopicSection.maxSelectError.detail",{max:n,maxTopic:_.length})),d.createElement(x.NU,{ref:b,maxSelectedValues:3,styles:{wrapper:{overflow:"initial !important"},separator:{padding:16},separatorLabel:{fontWeight:600,fontSize:12,lineHeight:"18px",textTransform:"uppercase",color:R.t.gray[4],"&::after":{display:"none"}},searchInput:{fontSize:"inherit"},input:{paddingRight:16}},nothingFound:d.createElement(H.T,{size:"s4",color:"gray.6"},u("pnTopicSection.notFound")),itemComponent:""===s?ep:eu,size:"lg",placeholder:u("pnTopicSection.plsEnterFavTopics"),data:I,onSearchChange:c,searchValue:s,icon:d.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},d.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.97183 10.8732C3.97183 7.0617 7.0617 3.97183 10.8732 3.97183C14.6848 3.97183 17.7746 7.0617 17.7746 10.8732C17.7746 14.6848 14.6848 17.7746 10.8732 17.7746C7.0617 17.7746 3.97183 14.6848 3.97183 10.8732ZM10.8732 2C5.97268 2 2 5.97268 2 10.8732C2 15.7738 5.97268 19.7465 10.8732 19.7465C12.9682 19.7465 14.8936 19.0205 16.4115 17.8063L20.3168 21.7116C20.7018 22.0966 21.3261 22.0966 21.7111 21.7116C22.0961 21.3266 22.0961 20.7023 21.7111 20.3173L17.8059 16.4121C19.0203 14.894 19.7465 12.9684 19.7465 10.8732C19.7465 5.97268 15.7738 2 10.8732 2Z",fill:"#595959"})),rightSection:d.createElement(d.Fragment,null),zIndex:500,searchable:!0,withinPortal:!0,onChange:e=>onValueChange(e),value:[]}),_&&_.length>0&&d.createElement(HistorySection,{history:_,onDelete:e=>{let t={trending:y,recently:C,interested:T,default:v},n=t[e.template]||t.default;n(t=>{let n=[...t],a=n.findIndex(t=>t.catId===e.catId);return n.splice(a,1),n})}})),d.createElement(h.x,{sx:e=>({position:"relative",height:(0,p.h)(175),[e.fn.largerThan("sm")]:{height:(0,p.h)(190)}})},d.createElement(h.x,{sx:{position:"absolute",top:0,right:0,left:0}},d.createElement(TrendingCarousel,{topics:((null==B?void 0:B.trending)||[]).map(e=>Object.assign(Object.assign({},e),{template:"trending"})),selectedTopics:E,onTopicChange:y,isBlock:A,labelProps:r}))),d.createElement(RecentlyViewedSection,{topics:((null==B?void 0:B.recently)||[]).map(e=>Object.assign(Object.assign({},e),{template:"recently"})),selectedTopics:w,onTopicChange:C,isBlock:A,labelProps:r}),d.createElement(TopicSection,{labelProps:r,topicsGroup:[{label:u("pnTopicSection.ppAlsoInterested"),topics:((null==B?void 0:B.interested)||[]).map(e=>Object.assign(Object.assign({},e),{template:"interested"}))}],selectedTopics:k,onTopicChange:T,isBlock:A}))},MoreTopics=()=>{let{t:e}=(0,j.u)(),{action:{pushNotifications:t}}=(0,d.useContext)(S.T),{prevStep:n,formValues:a,submitLoading:r,onSubmit:o,selectCategory:i,maxSelectCategory:l,setSelectCategory:s,currentUrl:c,isLoggedIn:u}=(0,d.useContext)(ed);return d.createElement(Layout,{heading:e("newsletter.topic.title"),type:"always",styles:{root:{paddingRight:(0,p.h)(25)}},stickyActions:d.createElement(d.Fragment,null,d.createElement(F.B,{fullWidth:!0,variant:"secondary",dataEventCategory:"Newsletter",dataEventAction:"Back Click",dataEventLabel:c,onClick:n},e("healthToolPNModal.back")),d.createElement(F.B,{fullWidth:!0,type:"submit",dataEventCategory:"Newsletter",dataEventAction:"Next Click",dataEventLabel:c,onClick:()=>{if(0===i.length)return t({type:"danger",title:e("newsletter.error.minTitle"),message:e("newsletter.error.minCotennt")}),!1;null==o||o(a.name)},loading:r},e("healthToolPNModal.next")))},d.createElement(PremiumTopicSelect,{isLoggedIn:u,maxSelect:l,values:a.fitnessTopics,onChange:s,labelProps:{size:"s5",sx:{textTransform:"uppercase"}}}))},Result=()=>{let{t:e}=(0,j.u)(),{close:t,selectCategory:n,onRegisterSuccess:a,currentUrl:r,finishLabelOnResult:o,disclaimerText:i}=(0,d.useContext)(ed);return(0,d.useEffect)(()=>()=>{setTimeout(()=>{null==a||a()},400)},[]),d.createElement(Layout,{heading:e("healthToolPNModal.heading"),stickyActions:d.createElement(F.B,{fullWidth:!0,sx:{maxWidth:(0,p.h)(300)},dataEventCategory:"Newsletter",dataEventAction:"Continue Reading Click",dataEventLabel:r,onClick:()=>{t()}},o||e("healthToolPNModal.finish"))},d.createElement(g.K,null,d.createElement(b.k,{gap:(0,p.h)(8),sx:e=>({background:e.colors.green[0],border:`1px solid ${e.colors.green[1]}`,borderRadius:(0,p.h)(8),padding:(0,p.h)(8)})},d.createElement(h.x,null,d.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},d.createElement("path",{d:"M9.99984 18.3334C14.6022 18.3334 18.3332 14.6025 18.3332 10.0001C18.3332 5.39771 14.6022 1.66675 9.99984 1.66675C5.39746 1.66675 1.6665 5.39771 1.6665 10.0001C1.6665 14.6025 5.39746 18.3334 9.99984 18.3334Z",fill:"#00B16A"}),d.createElement("path",{d:"M9.58558 12.6674C9.22944 12.668 8.87668 12.5983 8.54752 12.4623C8.21835 12.3264 7.91925 12.1268 7.66732 11.8751L6.68587 10.8931C6.55607 10.7587 6.48424 10.5787 6.48587 10.3919C6.48749 10.2051 6.56243 10.0263 6.69455 9.89422C6.82667 9.7621 7.00539 9.68716 7.19222 9.68554C7.37906 9.68391 7.55906 9.75574 7.69345 9.88554L8.67491 10.8675C8.79344 10.986 8.93415 11.08 9.08902 11.1442C9.24389 11.2083 9.40987 11.2413 9.5775 11.2413C9.74513 11.2413 9.91111 11.2083 10.066 11.1442C10.2208 11.08 10.3616 10.986 10.4801 10.8675L16.7033 5.24335C16.8443 5.12184 17.0272 5.06032 17.213 5.07195C17.3987 5.08358 17.5726 5.16744 17.6973 5.30558C17.8221 5.44373 17.8878 5.6252 17.8805 5.81118C17.8731 5.99717 17.7933 6.17291 17.6581 6.30081L11.4592 11.8998C11.2128 12.1448 10.9205 12.3387 10.5989 12.4705C10.2774 12.6022 9.93304 12.6692 9.58558 12.6674Z",fill:"white"}))),d.createElement(H.T,{size:"p3"},i||e("pnModal.disclaimer"))),d.createElement($.H,{tag:"h5"},e("healthToolPNModal.yourPre")),n.length>0&&d.createElement(TopicSection,{topicsGroup:[{label:"",topics:n}],selectedTopics:n,readonly:!0})))},PremiumNewsletterModal=({isMobile:e,isLoggedIn:t,pnSuggestCategory:n=[],acquisitionInfo:a,currentUrl:r,opened:o,close:i,finishLabelOnResult:l,onRegisterSuccess:s,disclaimerText:c})=>{let{t:p,locale:u}=(0,j.u)(),{action:{pushNotifications:m}}=(0,d.useContext)(S.T),h=k.C.getAssetPath("premiumNewsletter/side-banner-desktop.jpg"),g=k.C.getAssetPath("premiumNewsletter/side-banner-mobile.jpg"),[b,f]=(0,d.useState)([]),[v,E]=(0,d.useState)([]),[y,w]=(0,d.useState)(0),[x,B]=(0,d.useState)({name:"",fitnessTopics:[]}),[P,I]=(0,d.useState)(!1),lastStep=()=>w(2),N=(0,d.useCallback)(e=>(0,O.a)(void 0,void 0,void 0,function*(){try{I(!0),yield(0,S.e)((0,S.h)(el.POST_SUBSCRIPTION,{website_url:(0,S.i)(u)}),"post",{headers:{"Content-Type":"application/json"},method:"POST",data:{ga_client_id:K.Z.get(T.G),client_ip:window.clientIP||"",user_info:Object.assign(Object.assign({},a.userInfo),{name:e||x.name,type_subscription:1}),domain:U.v[u||en.L.Vietnam],category:v,perferred:a.preferredTopics.map(({id:e})=>({id:e}))}}),I(!1),yield(0,S.e)((0,S.j)(ec.UPDATE_SUBSCRIPTION),"post",{headers:{"Content-Type":"application/json"},method:"PUT",data:{subscription:1}}),lastStep()}catch(e){console.log({err:e}),I(!1),m({title:p("notification.comment.somethingWrong"),message:"",type:"danger"})}}),[x,v]);return(0,d.useEffect)(()=>{[h,g].forEach(e=>{let t=new Image;t.src=e})},[]),d.createElement(ed.Provider,{value:{currentUrl:r,isMobile:e,isLoggedIn:t,opened:o,close:i,pnSuggestCategory:n,nextStep:()=>w(e=>e<3?e+1:e),prevStep:()=>w(e=>e>0?e-1:e),lastStep,categoryLibs:b,setCategoryLibs:f,selectCategory:v,setSelectCategory:E,formValues:x,setFormValues:B,maxSelectCategory:5,submitLoading:P,onSubmit:N,onRegisterSuccess:s,finishLabelOnResult:l,disclaimerText:c}},d.createElement(SideBannerModal,{isMobile:e,desktopBanner:k.C.getAssetPath("premiumNewsletter/side-banner-desktop.jpg"),mobileBanner:k.C.getAssetPath("premiumNewsletter/side-banner-mobile.jpg"),modalRatio:{width:960,height:588},desktopBannerRatio:{width:384,height:588},opened:o,onClose:i,zIndex:305,closeProps:{dataEventCategory:"Newsletter",dataEventAction:"Close Click",dataEventLabel:r}},d.createElement(C.v,{active:y,onStepClick:w,styles:{root:{height:"100%"},content:{padding:0,height:"100%",width:"100%"},steps:{display:"none"}}},d.createElement(C.v.Step,null,d.createElement(MainForm,null)),d.createElement(C.v.Step,null,d.createElement(MoreTopics,null)),d.createElement(C.v.Step,null,d.createElement(Result,null)))))},SurveyBanner=()=>{let{locale:e}=(0,j.u)(),{isMobile:t,isLoggedIn:n,currentUrl:a,acquisitionInfo:r,categoryIds:o,state:i,setState:l,settings:s,submitHandler:p,subcribeHealthStatus:u,showPNModal:m,setShowPNModal:h,setIsBack:g}=(0,d.useContext)(ei),[b,f]=(0,d.useState)([]),[v,E]=(0,d.useState)(m);(0,d.useEffect)(()=>{(0,O.a)(void 0,void 0,void 0,function*(){var t,n;let a=yield(0,S.e)((0,S.h)(el.GET_NEWSLETTER_CATEGORIES,{_locale:e}),"get"),r=(null===(t=null==a?void 0:a.data)||void 0===t?void 0:t.interested)||[],i=(null===(n=null==a?void 0:a.data)||void 0===n?void 0:n.trending)||[],l=[...r,...i];f(l.filter(e=>o.includes(Number(e.catId))))})},[]);let y=(0,d.useRef)([]);return(0,d.useEffect)(()=>{let e=(null==u?void 0:u.value)||"",t=e.split("|").filter(Boolean),n=e;y.current.push(u),t.length>1&&(null!==y.current[0]&&g(!0),Object.keys(p).map(e=>{let a=e.split("|");if(t.length===a.length){let r=0;t.map(e=>{a.includes(String(e))&&(r+=1)}),r===t.length&&(n=e)}}));let a=t.length>0?p[n]:s;l(a)},[u]),(0,d.useEffect)(()=>{E(m)},[m]),(null==i?void 0:i.action)!==c.Hide?d.createElement(d.Fragment,null,d.createElement(HandlerBanner,Object.assign({},s.props)),d.createElement(PremiumNewsletterModal,{acquisitionInfo:r,isMobile:t,isLoggedIn:n,currentUrl:a,pnSuggestCategory:b,opened:v,close:()=>{var e;E(!1),h(!1),setTimeout(()=>{var e;(null===(e=i.actionParams)||void 0===e?void 0:e.hideBannerWhenClose)&&l({action:c.Hide})},400),(null===(e=i.actionParams)||void 0===e?void 0:e.hideBannerWhenClose)&&l({action:c.Hide})},onRegisterSuccess:()=>E(!1)})):null},SurveyOrPremiumBanner=({type:e,articleId:t=0,categoryIds:n=[],isMarketing:a,isSurveyType:r,hasPremiumBanner:o,currentUrl:i,isMobile:l,subcribeHealthStatus:s,setShouldAcquisitionModalOpen:p,onValueChange:u,source:m="discover",Wrapper:g})=>{let{t:b}=(0,j.u)(),{data:{userInfo:f}}=(0,d.useContext)(S.T),v=!!(null==f?void 0:f.id),[E,y]=(0,d.useState)(null),[w,x]=(0,d.useState)(),[C,k]=(0,d.useState)(""),[T,B]=(0,d.useState)(!1),[P,O]=(0,d.useState)(!1),I=(0,d.useMemo)(()=>er[e],[]),N=FLOW(b,i)[I],_=null==N?void 0:N.submitHandler,getMappingMultiValue=e=>{let t="",n=e.split("|");return 1===n.length?e:(Object.keys(_).map(e=>{let a=e.split("|");if(n.length===a.length){let r=0;n.map(e=>{a.includes(String(e))&&(r+=1)}),r===n.length&&(t=e)}}),t)},A=g||h.x,handleShowPNBannerFlowWhenLogin=()=>o&&(null==f?void 0:f.subscription)!==1?d.createElement(PnBannerEle,null):null;return(0,d.useEffect)(()=>{v&&y({userInfo:f,preferredTopics:ea,healthTopics:[]})},[v]),d.createElement(ei.Provider,{value:{settings:N,submitHandler:_,type:e,surveyType:I,value:C,setValue:k,isMobile:l,isLoggedIn:v,isMarketing:a,hasPremiumBanner:o,currentUrl:i,acquisitionInfo:E,categoryIds:n,subcribeHealthStatus:s,articleId:t,onValueChange:u,state:w,setState:x,handleClickOption:e=>{let t=getMappingMultiValue(e);if(t){let n=_[t];n.action===c.ShowPremiumModal?o?(B(!0),x(Object.assign(Object.assign({},w),{actionParams:{hideBannerWhenClose:n.action===c.ShowPremiumModal}}))):(x({action:c.Hide}),null==u||u(e)):(x(n),null==u||u(e))}},showPNModal:T,setShowPNModal:B,source:m,Outside:A,isBack:P,setIsBack:O,minHeight:180,setShouldAcquisitionModalOpen:p}},void 0!==s?v?r&&N?(()=>{let e=_[(null==s?void 0:s.value)||""];return(null==e?void 0:e.action)===c.ShowPremiumModal?handleShowPNBannerFlowWhenLogin():d.createElement(SurveyBanner,null)})():handleShowPNBannerFlowWhenLogin():o?d.createElement(PnBannerEle,null):null:null)}},O1f1:function(e,t,n){n.d(t,{B:function(){return BabyGrowthForm}});var a=n("XBaX"),r=n("q1tI"),o=n("/npG"),i=n("mYVa"),l=n("8vDj"),s=n("iuhU"),c=n("cChf"),d=n("ZFu2"),p=n("NQDR"),u=n("6p9C"),m=n("HalR"),h=n("iBNF"),g=n("RVQf"),b=n("g+a8"),f=n("vFnx"),v=n("dU++"),E=n("xzoI"),y=n("qpOh"),w=n("fkrl");let x=(0,r.createContext)({}),DefaultForm=e=>{let{t,locale:n}=(0,g.u)(),{classes:a={}}=(0,r.useContext)(b.C),{form:o,currentUrl:i,submitProps:l}=(0,r.useContext)(x),s={placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0}};return r.createElement(v.H,Object.assign({formLayout:"default"},e),r.createElement(v.H.FormRow,null,r.createElement(v.H.Control,null,r.createElement(E.G,Object.assign({isBaby:!0,genderValue:{male:"boy",female:"girl"}},o.getInputProps("gender"),{error:null}))),o.errors.gender&&r.createElement(v.H.Error,null,o.errors.gender)),r.createElement(v.H.FormRow,null,r.createElement(p.I.Wrapper,{label:r.createElement(m.T,{size:"p2",weight:"semiBold"},t("babyGrowth.input.birthday"))},r.createElement(u.D,Object.assign({},s,{maxDate:new Date},o.getInputProps("birthday"),{error:null,onChange:e=>{e&&o.validateField("measurementDate"),o.getInputProps("birthday").onChange(e)}}))),o.errors.birthday&&r.createElement(v.H.Error,null,o.errors.birthday)),r.createElement(v.H.FormRow,null,r.createElement(p.I.Number,Object.assign({label:r.createElement(m.T,{size:"p2",weight:"semiBold"},t("babyGrowth.height"),r.createElement(m.T,{size:"p2",weight:"semiBold",color:h.r.colors.gray300,as:"span"},` (${t("babyGrowth.cm")})`))},o.getInputProps("height"),{placeholder:t("babyGrowth.height"),min:f.I.height.min,max:f.I.height.max,onChange:e=>{o.setFieldValue("height",e),o.setFieldValue("checkMesureVal",!o.values.checkMesureVal)}}))),r.createElement(v.H.FormRow,null,r.createElement(p.I.Number,Object.assign({label:r.createElement(m.T,{size:"p2",weight:"semiBold"},t("babyGrowth.weight"),r.createElement(m.T,{size:"p2",weight:"semiBold",color:h.r.colors.gray300,as:"span"},` (${t("babyGrowth.kg")})`))},o.getInputProps("weight"),{placeholder:t("babyGrowth.weight"),min:f.I.weight.min,max:f.I.weight.max,onChange:e=>{o.setFieldValue("weight",e),o.setFieldValue("checkMesureVal",!o.values.checkMesureVal)}}))),n!==y.L.Vietnam&&r.createElement(v.H.FormRow,null,r.createElement(p.I.Number,Object.assign({label:r.createElement(m.T,{size:"p2",weight:"semiBold"},t("babyGrowth.head"),r.createElement(m.T,{size:"p2",weight:"semiBold",color:h.r.colors.gray300,as:"span"},` (${t("babyGrowth.cm")})`))},o.getInputProps("head"),{placeholder:t("babyGrowth.head"),onChange:e=>{o.setFieldValue("head",e),o.setFieldValue("checkMesureVal",!o.values.checkMesureVal)}}))),o.errors.checkMesureVal&&r.createElement(v.H.Error,null,o.errors.checkMesureVal),r.createElement(v.H.FormRow,null,r.createElement(p.I.Wrapper,{label:r.createElement(m.T,{size:"p2",weight:"semiBold"},t("babyGrowth.input.measurementDate"))},r.createElement(u.D,Object.assign({},s,{defaultValue:new Date},o.getInputProps("measurementDate"),{maxDate:new Date,error:null}))),o.errors.measurementDate&&r.createElement(v.H.Error,null,o.errors.measurementDate)),r.createElement(v.H.FormRow,{className:a.submitWrapper},r.createElement(v.H.Submit,Object.assign({className:a.submitBtn,type:"submit","data-event-category":"Health Tool","data-event-action":"Baby Growth","data-event-label":i},l),t("babyGrowth.input.submit"))))};var C=(0,o.k)(e=>({root:{display:"flex",flexDirection:"column",gap:(0,i.h)(8)},bmiVal:{display:"inline-block"},unitText:{color:e.colors.gray[6]},submitBtn:{}}));let localizeNumberFormat=(e,t=2)=>Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(e),bmiCalculate=(e=0,t=0)=>{try{if(e&&t){let n=Number(t)/Math.pow(Number(e)/100,2);if(isNaN(n))return 0;return Number(localizeNumberFormat(n))}}catch(e){}return 0},InlineForm=e=>{var{styles:t,classNames:n}=e,o=(0,a._)(e,["styles","classNames"]);let{t:i,locale:c}=(0,g.u)(),{form:d,currentUrl:h,submitProps:w}=(0,r.useContext)(x),{classes:k={}}=(0,r.useContext)(b.C),S=(0,l.rZ)(),{classes:T}=C(void 0,{name:"BabyGrowthForm__InlineForm",styles:t,classNames:n}),B={placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0}};return r.createElement(v.H,Object.assign({formLayout:"inline"},o),r.createElement(v.H.FormRow,null,r.createElement(v.H.BorderInlineControl,{label:i("tools.selectBabyGender")},r.createElement(E.G,Object.assign({type:"radio",hideLabel:!0,isBaby:!0,genderValue:{male:"boy",female:"girl"}},d.getInputProps("gender")))),d.errors.gender&&r.createElement(v.H.Error,null,d.errors.gender)),r.createElement(v.H.FormRow,null,r.createElement(v.H.BorderInlineControl,{label:i("babyGrowth.input.birthday")},r.createElement(u.D,Object.assign({},B,{maxDate:new Date},d.getInputProps("birthday"),{error:null,onChange:e=>{e&&d.validateField("measurementDate"),d.getInputProps("birthday").onChange(e)}}))),d.errors.birthday&&r.createElement(v.H.Error,null,d.errors.birthday)),r.createElement(v.H.FormRow,null,r.createElement(v.H.BorderInlineControl,{label:"BMI",styles:{control:{"&:first-child":{width:"auto"}}}},r.createElement(m.T,{size:"p3"},r.createElement("span",{className:T.bmiVal},d.getInputProps("height").value&&d.getInputProps("weight").value&&bmiCalculate(Number(d.getInputProps("height").value),Number(d.getInputProps("weight").value))),"(",i("babyGrowth.kg.m2"),")"),r.createElement(p.I.Number,Object.assign({},d.getInputProps("height"),{placeholder:i("babyGrowth.height"),min:f.I.height.min,max:f.I.height.max,onChange:e=>{d.setFieldValue("height",e),d.setFieldValue("checkMesureVal",!d.values.checkMesureVal)},rightSection:r.createElement(v.H.Unit,null,i("babyGrowth.cm"))})),r.createElement(p.I.Number,Object.assign({},d.getInputProps("weight"),{placeholder:i("babyGrowth.weight"),min:f.I.weight.min,max:f.I.weight.max,onChange:e=>{d.setFieldValue("weight",e),d.setFieldValue("checkMesureVal",!d.values.checkMesureVal)},rightSection:r.createElement(v.H.Unit,null,i("babyGrowth.kg"))}))),("mb"===S.other.template||c!==y.L.Vietnam)&&r.createElement(v.H.BorderInlineControl,{label:i("babyGrowth.head")},r.createElement(p.I.Number,Object.assign({},d.getInputProps("head"),{placeholder:i("babyGrowth.head"),onChange:e=>{d.setFieldValue("head",e),d.setFieldValue("checkMesureVal",!d.values.checkMesureVal)},rightSection:r.createElement(v.H.Unit,null,i("babyGrowth.cm"))}))),d.errors.checkMesureVal&&r.createElement(v.H.Error,null,d.errors.checkMesureVal)),r.createElement(v.H.FormRow,null,r.createElement(v.H.BorderInlineControl,{label:i("babyGrowth.input.measurementDate")},r.createElement(u.D,Object.assign({},B,{maxDate:new Date},d.getInputProps("measurementDate"),{error:null}))),d.errors.measurementDate&&r.createElement(v.H.Error,null,d.errors.measurementDate)),r.createElement(v.H.FormRow,{className:k.submitWrapper},r.createElement(v.H.Submit,Object.assign({type:"submit","data-event-category":"Health Tool","data-event-action":"Baby Growth","data-event-label":h,className:(0,s.default)(T.submitBtn,k.submitBtn)},w),i("babyGrowth.input.submit"))))},MbLayout=e=>{var t=(0,a._)(e,[]);let{t:n}=(0,g.u)(),{form:o,currentUrl:i,submitProps:l}=(0,r.useContext)(x),s={placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0}};return r.createElement(v.H,Object.assign({formLayout:"default"},t),r.createElement(v.H.FormRow,null,r.createElement(v.H.Control,null,r.createElement(E.G,Object.assign({isBaby:!0,genderValue:{male:"boy",female:"girl"}},o.getInputProps("gender"),{error:null}))),o.errors.gender&&r.createElement(v.H.Error,null,o.errors.gender)),r.createElement(v.H.BorderBoxControl,{label:n("babyGrowth.input.birthday"),rightSection:r.createElement(w.Z,null)},r.createElement(u.D,Object.assign({},s,{maxDate:new Date},o.getInputProps("birthday"),{error:null,rightSection:null,onChange:e=>{e&&o.validateField("measurementDate"),o.getInputProps("birthday").onChange(e)}}))),o.errors.birthday&&r.createElement(v.H.Error,null,o.errors.birthday),r.createElement(v.H.BorderBoxControl,{label:n("babyGrowth.height"),rightSection:n("babyGrowth.cm")},r.createElement(p.I.Number,Object.assign({},o.getInputProps("height"),{placeholder:n("tools.inputPlaceholder",{content:"160"}),min:f.I.height.min,max:f.I.height.max,onChange:e=>{o.setFieldValue("height",e),o.setFieldValue("checkMesureVal",!o.values.checkMesureVal)}}))),o.errors.height&&r.createElement(v.H.Error,null,o.errors.height),r.createElement(v.H.BorderBoxControl,{label:n("babyGrowth.weight"),rightSection:n("babyGrowth.kg")},r.createElement(p.I.Number,Object.assign({},o.getInputProps("weight"),{placeholder:n("tools.inputPlaceholder",{content:"50"}),min:f.I.weight.min,max:f.I.weight.max,onChange:e=>{o.setFieldValue("weight",e),o.setFieldValue("checkMesureVal",!o.values.checkMesureVal)}}))),o.errors.weight&&r.createElement(v.H.Error,null,o.errors.weight),r.createElement(v.H.BorderBoxControl,{label:n("babyGrowth.head"),rightSection:n("babyGrowth.cm")},r.createElement(p.I.Number,Object.assign({},o.getInputProps("head"),{placeholder:n("tools.inputPlaceholder",{content:"50"}),onChange:e=>{o.setFieldValue("head",e),o.setFieldValue("checkMesureVal",!o.values.checkMesureVal)}}))),o.errors.checkMesureVal&&r.createElement(v.H.Error,null,o.errors.checkMesureVal),r.createElement(v.H.BorderBoxControl,{label:n("babyGrowth.input.measurementDate"),rightSection:r.createElement(w.Z,null)},r.createElement(p.I.Wrapper,null,r.createElement(u.D,Object.assign({},s,{defaultValue:new Date},o.getInputProps("measurementDate"),{maxDate:new Date,rightSection:null,error:null})))),o.errors.measurementDate&&r.createElement(v.H.Error,null,o.errors.measurementDate),r.createElement(v.H.Submit,Object.assign({type:"submit","data-event-category":"Health Tool","data-event-action":"Baby Growth","data-event-label":i},l),n("babyGrowth.input.submit")))},BabyGrowthForm=e=>{var{onSubmit:t,formLayout:n="default",submitProps:o,currentUrl:i}=e,s=(0,a._)(e,["onSubmit","formLayout","submitProps","currentUrl"]);let{t:p}=(0,g.u)(),u=(0,l.rZ)(),m=(0,c.c)({initialValues:{measurementDate:new Date},validate:{gender:(0,d.U)(p("validation.error.requiredField")),birthday:(0,d.U)(p("validation.error.requiredField")),measurementDate:(e,t)=>t.birthday?t.birthday instanceof Date&&e instanceof Date&&t.birthday.getTime()<=e.getTime()?null:p("babyGrowth.error.measurementDateLowerThanBirthday",{name:""}):null,checkMesureVal:(e,t)=>void 0===t.head&&void 0===t.height&&void 0===t.weight||t.head||t.height||t.weight?null:p("babyGrowth.error.atLeastOneOf")},validateInputOnChange:["checkMesureVal"]}),h=Object.assign({onSubmit:m.onSubmit(e=>null==t?void 0:t(Object.assign(Object.assign({},e),{bmi:bmiCalculate(Number(m.getInputProps("height").value),Number(m.getInputProps("weight").value)).toString()})))},s);return r.createElement(x.Provider,{value:{submitProps:o,currentUrl:i,form:m}},"default"===n?"mb"===u.other.template?r.createElement(MbLayout,Object.assign({formLayout:n},h)):r.createElement(DefaultForm,Object.assign({},h)):r.createElement(InlineForm,Object.assign({},h)))}},"Oe0+":function(e,t,n){n.d(t,{T:function(){return s}});var a=n("q1tI"),r=n("rBCA"),o=n("Of7P"),i=n("iBNF");let l=r.Z.div` textarea { width: 100%; height: var(--textarea-height, 116px); padding: 1rem; border: 1px solid ${i.r.colors.gray200}; border-radius: 6px; color: ${i.r.colors.gray800}; font-size: 14px; resize: none; &:focus { box-shadow: 0px 0px 2px 2px #91caff; } &::placeholder { color: ${i.r.colors.gray500}; } &:disabled { background-color: ${i.r.colors.neutral50}; cursor: not-allowed; } } `,s=a.forwardRef(({height:e,placeholder:t,labelText:n,labelColor:r,id:i,name:s,onChange:c,value:d,className:p,onKeyPress:u,disabled:m=!1},h)=>a.createElement(l,{className:p,style:{"--textarea-height":e||"116px"}},n&&a.createElement(o.L,{size:"label2",style:{color:r||"#595959"},htmlFor:i},n),a.createElement("textarea",{name:s,ref:h,placeholder:t,id:i,onChange:e=>c&&c(e.target.value),onKeyPress:e=>u&&u(e),value:d,disabled:m})))},"9vqH":function(e,t,n){n.d(t,{C:function(){return h},I:function(){return ImagePreviewPopup},P:function(){return PostSingleImageViewPopup},a:function(){return PostImagePreview},b:function(){return g}});var a=n("q1tI"),r=n("0mzb"),o=n("+J3I"),i=n("RVQf"),l=n("Czgk"),s=n("t/pd"),c=n("HalR"),d=n("rBCA"),p=n("XBaX"),u=n("iBNF"),m=n("gEnE"),h="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%23262626' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M18 6 6 18M6 6l12 12'/%3e%3c/svg%3e",g="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='25' fill='none'%3e%3cpath stroke='%23262626' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M10.05 18.06 4 12.038l6.05-6.025M4.002 12.035h15'/%3e%3c/svg%3e";let b=d.Z.div` padding: 14px 16px 14px 17px; background: ${e=>e.bgColor}; border-left: 3px solid ${e=>e.highlight}; ${o.M.mbUp} { padding: 12px 12px 12px 17px; } `,f=d.Z.div` display: flex; `,v=d.Z.div` font-size: 12px; line-height: 18px; &[data-has-icon='true'] { margin-left: 10px; } `,E=d.Z.div` flex-shrink: 0; `,y=d.Z.div` display: grid; grid-gap: 3px; grid-template-columns: 1fr 1fr; grid-template-rows: auto; .img-wrapper { position: relative; overflow: hidden; width: 100%; padding-top: 56.25%; grid-column: auto; & > img { cursor: zoom-in; } .img-preview-blur { position: absolute; top: 50%; left: 50%; width: 110%; height: 110%; /* Add the blur effect */ -webkit-filter: blur(8px); filter: blur(8px); object-fit: cover; object-position: center; opacity: 0.8; transform: translate(-50%, -50%); } .img-preview { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; } .img-more-overlay { position: absolute; top: 0; left: 0; display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.5); z-index: 4; } } &[data-image-count='1'] { .img-wrapper { /* padding-top: 100%; */ grid-column: 1/3; } } &[data-image-count='2'] { .img-wrapper { /* padding-top: 100%; */ } } &[data-image-count='3'] { .img-wrapper { &:first-child { grid-column: 1/3; } } } &[data-image-count='4'] { .img-wrapper { /* padding-top: 100%; */ } } &[data-image-count='5'] { grid-template-columns: repeat(6, 1fr); .img-wrapper { /* padding-top: 100%; */ grid-column: auto/ span 2; &:first-child { padding-top: 56.25%; grid-column: 1/4; } &:nth-child(2) { padding-top: 56.25%; grid-column: 4/7; } } } &[data-is-marrybaby='true'] { grid-gap: 8px; .img-wrapper { padding-top: 66.66%; border-radius: 1rem; .img-preview { object-fit: cover; } } &[data-image-count='3'] { grid-template-columns: 1fr 1fr 1fr; .img-wrapper { &:first-child { padding-top: 100%; grid-column: 1/3; grid-row: 1/3; } } } } `,w=d.Z.div` position: fixed; z-index: 999; top: 0; left: 0; display: flex; overflow: hidden; width: 100vw; height: 100vh; flex-direction: column; background: white; opacity: 0; pointer-events: none; transition: opacity 0.2s linear; &[data-open='true'] { opacity: 1; pointer-events: auto; } .top-bar { position: relative; padding: 20px 40px; .icon-arrow-left { position: absolute; top: 50%; left: 20px; height: 24px; width: 24px; cursor: pointer; transform: translateY(-50%); } } .container { flex: 1; overflow-y: auto; .img-preview { width: 100%; min-width: 100%; margin-bottom: 0.5rem; cursor: pointer; max-height: 100%; object-fit: cover; } } `,x=(0,d.Z)(e=>{var{icon:t,bgColor:n=u.r.colors.yellow50,highlightColor:r=u.r.colors.yellow800,message:o}=e,i=(0,p._)(e,["icon","bgColor","highlightColor","message"]);return a.createElement(b,Object.assign({bgColor:n,highlight:r},i),a.createElement(f,null,t&&a.createElement(E,null,t),a.createElement(v,{"data-has-icon":!!t},o)))})` margin-bottom: 16px; &.noti-bottom { border-left: none; margin-top: 4px; padding: 4px 8px; margin-left: 16px; margin-right: 16px; border-radius: 4px; } `,ImagePreviewPopup=({className:e,style:t,authorName:n,images:r,onClose:o,onOpenSingleView:l,alt:d})=>{let{t:p}=(0,i.u)(),[u,m]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{setTimeout(()=>{m(!0)},0)},[]),a.createElement(s.h,null,a.createElement(w,{className:e,style:t,"data-open":u},a.createElement("div",{className:"top-bar"},a.createElement("img",{className:"icon-arrow-left",src:g,onClick:o,alt:"go back",loading:"lazy"}),a.createElement(c.T,{size:"p2",weight:"bold",style:{textAlign:"center"}},p("previewPhotos.title",{name:n}))),a.createElement("div",{className:"container"},r.map((e,t)=>a.createElement("img",{className:"img-preview",key:t,src:e,onClick:()=>null==l?void 0:l(t),alt:d,loading:"lazy"})))),",")},C=d.Z.div` position: fixed; z-index: 999; top: 0; left: 0; display: flex; width: 100%; height: 100%; flex-direction: column; background: black; opacity: 0; pointer-events: none; transition: opacity 0.2s linear; &[data-open='true'] { opacity: 1; pointer-events: auto; } `,k=d.Z.div` padding: 1rem; background: white; .icon-close { width: 26px; height: 26px; cursor: pointer; } `,S=d.Z.div` position: relative; flex: 1; overflow: hidden; > img { height: 100%; width: 100%; object-fit: contain; object-position: center; } `,T=d.Z.div` --inner-padding: max(16px, 20%); height: 100%; position: absolute; left: 0; padding: 8px; padding-right: var(--inner-padding); display: flex; align-items: center; top: 0; cursor: pointer; &[data-right] { padding-right: 8px; padding-left: var(--inner-padding); left: unset; right: 0; } &[data-disabled='true'] { cursor: not-allowed; } `,B=d.Z.div` border-radius: 50%; background: rgba(0, 0, 0, 0.3); display: flex; align-items: center; justify-content: center; padding: 4px; > img { width: 16px; height: 16px; &[data-disabled='true'] { opacity: 0.5; } } ${o.M.tdUp} { padding: 8px; > img { width: 30px; height: 30px; } } `;var P="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='m6 12.813 4-4-4-4'/%3e%3c/svg%3e";let PostSingleImageViewPopup=({initialViewIndex:e,images:t,onClose:n,alt:r})=>{let[o,i]=(0,a.useState)(e),[l,c]=(0,a.useState)(!1);(0,a.useEffect)(()=>{setTimeout(()=>{c(!0)},0)},[]);let d=null==t?void 0:t[o],p=0===o,u=!(null==t?void 0:t.length)||o===(null==t?void 0:t.length)-1;return a.createElement(s.h,null,a.createElement(C,{"data-open":l&&!!d},a.createElement(k,null,a.createElement("img",{src:h,className:"icon-close",onClick:n,alt:"close",loading:"lazy"})),d&&o>=0&&a.createElement(a.Fragment,null,a.createElement(S,null,a.createElement("img",{className:"img-preview",src:d,alt:r,loading:"lazy"}),a.createElement(T,{"data-disabled":p,onClick:()=>!p&&i(o-1)},a.createElement(B,null,a.createElement("img",{src:P,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":p,loading:"lazy"}))),a.createElement(T,{"data-right":!0,"data-disabled":u,onClick:()=>!u&&i(o+1)},a.createElement(B,null,a.createElement("img",{src:P,alt:"right arrow","data-disabled":u,loading:"lazy"})))))))},O=(0,m.Z)(d.Z.div` position: absolute; top: 0; right: 0; left: 0; bottom: 0; background: rgba(0, 0, 0, 0.4); color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; `,"hhgcomp-sensitivemask-inner"),I=d.Z.div``,N=d.Z.div` position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; z-index: 3; background: white; cursor: pointer; &, * { // transition: all 300ms; transform-origin: bottom left; } img { transition: none; } .img-preview { width: 100%; } &[data-is-blurred='true'] { .img-preview { /* Add the blur effect */ -webkit-filter: blur(24px); filter: blur(24px); } } &[data-is-blurred='false'] { background: transparent; cursor: zoom-in; ${O.classSelector} { top: auto; right: auto; left: 8px; bottom: 8px; background: rgba(0, 0, 0, 0); align-items: flex-end; justify-content: flex-start; } } `,SensitiveMask=({image:e,showIcon:t=!0})=>{let[n,r]=(0,a.useState)(!0);return a.createElement(N,{"data-is-blurred":n,onClick:e=>n&&e.stopPropagation()},a.createElement("img",{loading:"lazy",className:"img-preview",src:e}),a.createElement(O,{onClick:e=>{e.stopPropagation(),r(!n)}},t&&a.createElement(I,null,n?a.createElement("svg",{width:"22",height:"20",viewBox:"0 0 22 20",fill:"none"},a.createElement("path",{d:"M1.71 2.54a.996.996 0 0 1 0-1.41c.39-.39 1.03-.39 1.42 0l16.31 16.33a.996.996 0 1 1-1.41 1.41l-2.72-2.72c-1.34.52-2.79.82-4.31.82-5 0-9.27-3.11-11-7.5C.77 7.5 2.06 5.8 3.68 4.51zM16 9.47c0-2.76-2.24-5-5-5-.51 0-1 .1-1.47.24L7.36 2.54c1.15-.37 2.37-.57 3.64-.57 5 0 9.27 3.11 11 7.49-.69 1.76-1.79 3.3-3.18 4.53l-3.06-3.06c.14-.46.24-.95.24-1.46m-5 5c-2.76 0-5-2.24-5-5 0-.77.18-1.5.49-2.14L8.06 8.9c-.03.18-.06.37-.06.57 0 1.66 1.34 3 3 3 .2 0 .38-.03.57-.07l1.57 1.57c-.65.32-1.37.5-2.14.5m2.97-5.33a2.97 2.97 0 0 0-2.64-2.64z",fill:"#fff"})):a.createElement("svg",{width:"23",height:"16",viewBox:"0 0 23 16",fill:"none"},a.createElement("path",{d:"M12 0C5.142 0 1.886 5.879 1.096 7.557c-.132.28-.132.604 0 .884C1.886 10.121 5.142 16 12 16c6.834 0 10.092-5.837 10.896-7.54a1.08 1.08 0 0 0 0-.92C22.092 5.836 18.834 0 12 0m0 3a5 5 0 1 1-.001 10.001 5 5 0 0 1 0-10.001m0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6",fill:"#2D87F3"})))))},PostImagePreview=({className:e,images:t=[],style:n,authorName:s,isSensitive:c=!1,alt:d,positionAlert:p="top"})=>{let{data:{env:{isMarryBaby:u}}}=(0,a.useContext)(l.T),{t:m}=(0,i.u)(),h=`+ ${(t.length||0)-4}`,[g,b]=(0,a.useState)(!1),[f,v]=(0,a.useState)(-1),E=t.length>5,w=(0,a.useRef)(!1);return(0,a.useEffect)(()=>()=>{w.current&&(0,o.t)(!1)},[]),(0,a.useEffect)(()=>{g||f>=0?((0,o.t)(!0),w.current=!0):((0,o.t)(!1),w.current=!1)},[g,f]),a.createElement(a.Fragment,null,c&&"top"===p&&a.createElement(x,{message:m("sensitiveMask.contentWarningDescription"),icon:a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},a.createElement("path",{d:"M9 .667A8.336 8.336 0 0 0 .667 9c0 4.6 3.733 8.333 8.333 8.333S17.333 13.6 17.333 9 13.6.667 9 .667m0 9.166A.836.836 0 0 1 8.167 9V5.667c0-.459.375-.834.833-.834s.833.375.833.834V9A.836.836 0 0 1 9 9.833M8.167 11.5v1.667h1.666V11.5z",fill:"#FE921D"}))}),a.createElement(y,{className:e,style:n,"data-image-count":E?5:t.length||0,"data-is-marrybaby":u,"data-cursor-pointer":!c},null==t?void 0:t.slice(0,5).map((e,t)=>{let n=4===t&&E;return a.createElement("div",{className:"img-wrapper",key:t,onClick:()=>{t>=4&&E?b(!0):v(t)}},c&&a.createElement(SensitiveMask,{image:e,showIcon:!n}),!u&&a.createElement("img",{loading:"lazy",className:"img-preview-blur",src:e,alt:d}),a.createElement("img",{loading:"lazy",className:"img-preview",src:e,alt:d}),n&&a.createElement("div",{className:"img-more-overlay"},a.createElement(r.H,{tag:"h1",as:"h2",color:"white"},h)))})),g&&a.createElement(ImagePreviewPopup,{authorName:s||"",images:t,onClose:()=>b(!1),onOpenSingleView:v,alt:d}),f>=0&&a.createElement(PostSingleImageViewPopup,{images:t,initialViewIndex:f,onClose:()=>v(-1),alt:d}),c&&"bottom"===p&&a.createElement(x,{message:m("sensitiveMask.contentWarningDescription.community"),className:"noti-bottom",icon:a.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},a.createElement("path",{d:"M9 .667A8.336 8.336 0 0 0 .667 9c0 4.6 3.733 8.333 8.333 8.333S17.333 13.6 17.333 9 13.6.667 9 .667m0 9.166A.836.836 0 0 1 8.167 9V5.667c0-.459.375-.834.833-.834s.833.375.833.834V9A.836.836 0 0 1 9 9.833M8.167 11.5v1.667h1.666V11.5z",fill:"#FE921D"}))}))}},VXqy:function(e,t,n){n.d(t,{B:function(){return m},F:function(){return g},G:function(){return h},S:function(){return d},a:function(){return fetchSSOV2ApiJson},c:function(){return checkUserExist},f:function(){return fetchSSOV2Api},g:function(){return getUserInfo},h:function(){return handleAuthSuccess},l:function(){return p},r:function(){return resetPassword},u:function(){return updateUserInfo},w:function(){return u}});var a=n("XBaX"),r=n("GOBr"),o=n("eosd"),i=n("LBVr"),l=n("27Mu"),s=n("qpOh"),c=n("xrdX");let d={LOGIN_BY_SOCIAL:"member/social-login",EMAIL:{REGISTER_BY_SEND_OTP:"login/login-with-email",LOGIN_BY_PASSWORD:"member/login",VERIFY_BY_OTP:"login/email-verify-code",SEND_OTP:"login/email-resend-otp-code"},PHONE:{REGISTER_BY_SEND_OTP:"login/login-with-sms",SEND_OTP:"login/sms/sent-otp",VERIFY_BY_OTP:"login/phone-verify-code",LOGIN_BY_PASSWORD:"member/login-by-phone",UPDATE_PHONE_SEND_OTP:"login/sms-social/sent-otp",UPDATE_PHONE_VERIFY_OTP:"login/sms-social/phone-verify-code"},WHATSAPP:{LOGIN_OTP_WHATSAPP:"login/login-otp-whatsapp",REGISTER_BY_SEND_OTP:"login/login-with-whatsapp",SEND_OTP:"login/whatsapp/sent-otp",UPDATE_PHONE_SEND_OTP:"login/sms-social/whatsapp/sent-otp",UPDATE_PHONE_VERIFY_OTP:"login/sms-social/whatsapp-verify-code",VERIFY_BY_OTP:"login/whatsapp-verify-code"},ZALO:{REGISTER_BY_SEND_OTP:"login/login-with-zalo",SEND_OTP:"login/zalo/sent-otp",VERIFY_BY_OTP:"login/zalo-verify-code",UPDATE_PHONE_SEND_OTP:"login/sms-social/zalo/sent-otp",UPDATE_PHONE_VERIFY_OTP:"login/sms-social/zalo-verify-code"},RESET_PASSWORD:"login/reset-password",CHECK_USER_EXIST:"member/check-user-exist",UPDATE_USER_INFO:"login/update-first-info",SETUP_USER_INFO:"login/setup-first-info",ECOM_CARE:{SEND_OTP:"login/ecom-care/send-email-otp-code",VERIFY_OTP:"login/ecom-care/email-verify-code",RESEND_OTP:"login/ecom-care/resend-email-otp-code"}},p="vi-VN",u={[s.L.Vietnam]:"1",[s.L.Indonesia]:"2",[s.L.Malaysia]:"3"}[p];i.L[p].PHONE;let getSSOV2ApiUrl=e=>(0,o.n)(`${(0,o.a)(p)}/api/v2/${e}`),getSSOApiUrl=e=>(0,o.n)(`${(0,o.a)(p)}/api/${e}`),m="hhg_user_token",fetchSSOV2Api=(e,t={},n)=>(0,a.a)(void 0,void 0,void 0,function*(){var a;let r;let o=n?"":null===(a=document.cookie.split("; ").find(e=>e.startsWith(m)))||void 0===a?void 0:a.split("=")[1];try{t.body instanceof FormData&&(t.body.append("ga_client_id",(0,l.ej)("_ga")||""),t.body.append("referrer",window.location.href)),r=yield fetch(getSSOV2ApiUrl(e),o?Object.assign(Object.assign({},t),{headers:Object.assign({Authorization:`Bearer ${o}`},null==t?void 0:t.headers)}):t)}catch(e){return console.error(e),null}return null==r?void 0:r.json()}),fetchSSOV2ApiJson=(e,t,n)=>(0,a.a)(void 0,void 0,void 0,function*(){var a;let r;let o=n?"":null===(a=document.cookie.split("; ").find(e=>e.startsWith(m)))||void 0===a?void 0:a.split("=")[1];try{r=yield fetch(getSSOV2ApiUrl(e),{method:"POST",headers:Object.assign({Accept:"application/json","Content-Type":"application/json"},o?{Authorization:`Bearer ${o}`}:{}),body:JSON.stringify(t)})}catch(e){return console.error(e),null}return null==r?void 0:r.json()}),fetchSSOApi=(e,t={},n)=>(0,a.a)(void 0,void 0,void 0,function*(){var a;let r;let o=n?"":null===(a=document.cookie.split("; ").find(e=>e.startsWith(m)))||void 0===a?void 0:a.split("=")[1];try{r=yield fetch(getSSOApiUrl(e),o?Object.assign(Object.assign({},t),{headers:Object.assign({Authorization:`Bearer ${o}`},null==t?void 0:t.headers)}):t)}catch(e){return console.error(e),null}return null==r?void 0:r.json()}),resetPassword=(e,t)=>(0,a.a)(void 0,void 0,void 0,function*(){let n=new FormData;return n.append("password",e),n.append("confirm-password",t),fetchSSOV2Api(d.RESET_PASSWORD,{method:"POST",body:n})}),checkUserExist=({email:e,phone:t})=>(0,a.a)(void 0,void 0,void 0,function*(){let n=new FormData;return e?n.append("email",e):n.append("phone_number",t),fetchSSOV2Api(d.CHECK_USER_EXIST,{method:"POST",body:n})}),updateUserInfo=e=>(0,a.a)(void 0,void 0,void 0,function*(){let t=new FormData;return Object.keys(e).forEach(n=>{let a=e[n];null!=a&&("string"!=typeof a||a.trim())&&t.append(n,e[n])}),fetchSSOV2Api(d.SETUP_USER_INFO,{method:"POST",body:t})}),h=r.y?"289442006438-040a42cbidr6v5d178f3iqi9q95821r3.apps.googleusercontent.com":"289442006438-cihobuq1h3r4426pur7u0e43fqdnep59.apps.googleusercontent.com",g="2759888574045636",getUserInfo=()=>(0,a.a)(void 0,void 0,void 0,function*(){return fetchSSOApi("user/profile",{method:"POST"})}),handleAuthSuccess=e=>{(null==e?void 0:e.token)&&(0,l.d8)(m,e.token,{domain:"localhost"===window.location.hostname?"localhost":`.${c.v[p]}`,expires:new Date(1e3*e.expire_in).toUTCString()}),(null==e?void 0:e.refresh_token)&&(0,l.d8)(i.k,e.refresh_token,{domain:"localhost"===window.location.hostname?"localhost":`.${c.v[p]}`})}},"z+kB":function(e,t,n){n.d(t,{S:function(){return Spoiler}});var a=n("XBaX"),r=n("q1tI"),o=n("uCoU"),i=n("HalR"),l=n("RVQf"),s=n("iBNF");let Spoiler=e=>{var{children:t,line:n,lineHeight:c,trackingAttributes:d,maxHeight:p,customExpandFn:u}=e,m=(0,a._)(e,["children","line","lineHeight","trackingAttributes","maxHeight","customExpandFn"]);let{t:h}=(0,l.u)(),g=(0,r.useMemo)(()=>p||(n&&c?n*c:(console.error("[HHG-Comp]:[Spoiler] Please provide maxHeight, or line with lineHeight"),0)),[]);t||console.error("[HHG-Comp]:[Spoiler] Please provide children");let b=(0,r.useMemo)(()=>d?{"data-event-category":d.dataEventCategory,"data-event-action":d.dataEventAction,"data-event-label":d.dataEventLabel}:{},[d]);return r.createElement(o.o,Object.assign({showLabel:r.createElement(i.T,Object.assign({size:"p3",color:s.r.colors.primaryBase},b,{onClick:u}),h("articlePage.readMore")),hideLabel:r.createElement(i.T,Object.assign({size:"p3",color:s.r.colors.primaryBase},b),h("articlePage.showLess"))},m,{maxHeight:g}),t)}},ziEq:function(e,t,n){n.d(t,{A:function(){return AuthorBadge},B:function(){return BookingBtn}});var a=n("XBaX"),r=n("q1tI"),o=n("RVQf"),i=n("/npG"),l=n("aqw/"),s=n("qWy5"),c=n("k1Nl"),d=n("Czgk"),p=n("xrdX"),u=n("GOBr"),m=(0,i.k)(e=>({root:{display:"inline-block",flexShrink:0,padding:"2px 0.5rem",marginLeft:"4px",borderRadius:e.radius.xs,fontSize:"12px",fontWeight:400,lineHeight:"18px",'&[data-label-type="admin"]':{background:e.primaryColor[0],color:e.primaryColor[9]},'&[data-label-type="local admin"]':{background:e.primaryColor[8]},'&[data-label-type="ambassador"]':{background:e.colors.green[4]},'&[data-label-type="expert"]':{background:e.colors.yellow[6]},'&[data-label-type="moderator"]':{background:e.colors.red[0],color:e.colors.red[8]},'&[data-label-type="sponsor"]':{background:e.colors.teal[4]},'&[data-label-type="guide"]':{background:e.colors.teal[4]},'&[data-label-type="influencer"]':{background:e.colors.teal[4]}}}));let h={admin:"cardAuthor.admin",moderator:"cardAuthor.moderator",ambassador:"cardAuthor.ambassador",expert:"cardAuthor.expert",sponsor:"cardAuthor.sponsor",guide:"cardAuthor.guide",influencer:"cardAuthor.influencer"},looselyMatchRole=e=>["admin","moderator","ambassador","expert","sponsor","guide","influencer"].find(t=>t===e),AuthorBadge=e=>{var{siteType:t,role:n,title:i,styles:l,className:s}=e,c=(0,a._)(e,["siteType","role","title","styles","className"]);let{t:d}=(0,o.u)(),p=n?looselyMatchRole(n):"",{classes:u,cx:g}=m(void 0,{name:"AuthorBadge",styles:l});return p&&h[p]?r.createElement("div",Object.assign({className:g(u.root,s),"data-label-type":p,"data-is-marrybaby":"marryBaby"===t},c),i||d(h[p])):null},BookingBtn=e=>{var{label:t,bookingId:n,bookingType:i="doctor",locale:m="vi-VN"}=e,h=(0,a._)(e,["label","bookingId","bookingType","locale"]);let{t:g}=(0,o.u)(),[b,f]=(0,r.useState)(!1),v=(0,r.useMemo)(()=>"undefined"!=typeof window?window.location.href:"",[]),E=(0,r.useCallback)(()=>(0,a.a)(void 0,void 0,void 0,function*(){var e,t,a,r,o,c,h,g,b,v,E,y,w,x,C;let k="doctor"===i?l.P.GET_DOCTOR_DETAIL:"hospital"===i?l.P.GET_HOSPITAL_DETAIL:"service"===i?l.P.GET_SERVICE_DETAIL:"";try{f(!0);let l=yield(0,d.c)((0,d.b)(k,{id:n,site:p.v[m]}),"get");if((null==l?void 0:l._status)===1){let n="doctor"===i?{id:null===(t=null===(e=null==l?void 0:l._data)||void 0===e?void 0:e.doctor)||void 0===t?void 0:t.id,slug:null===(r=null===(a=null==l?void 0:l._data)||void 0===a?void 0:a.doctor)||void 0===r?void 0:r.slug,localSlug:null===(o=s.L[m])||void 0===o?void 0:o.DOCTOR}:"hospital"===i?{id:null===(h=null===(c=null==l?void 0:l._data)||void 0===c?void 0:c.branch)||void 0===h?void 0:h.id,slug:null===(b=null===(g=null==l?void 0:l._data)||void 0===g?void 0:g.branch)||void 0===b?void 0:b.slug,localSlug:null===(v=s.L[m])||void 0===v?void 0:v.HOSPITAL}:{id:null===(y=null===(E=null==l?void 0:l._data)||void 0===E?void 0:E.service)||void 0===y?void 0:y.id,slug:null===(x=null===(w=null==l?void 0:l._data)||void 0===w?void 0:w.service)||void 0===x?void 0:x.slug,localSlug:null===(C=s.L[m])||void 0===C?void 0:C.SERVICE};window.location.href=`https://${u.y?"":"discover."}${p.v[m]}/care/${n.localSlug}/${n.slug}-${n.id}/`}else f(!1)}catch(e){console.log(e),f(!1)}}),[]);return n&&i?r.createElement(c.B,Object.assign({dataEventCategory:"Care",dataEventAction:"Comment - Quick Booking",dataEventLabel:v,onClick:E,loading:b},h),t||g("careBooking.bookAnAppointment")):null}},Cb9a:function(e,t,n){n.d(t,{P:function(){return PopoverMenu},S:function(){return c}});var a=n("q1tI"),r=n("cw2P"),o=n("Czgk"),i=n("rBCA"),l=n("iBNF");let s=i.Z.div` position: relative; display: content; .popover-menu__btn { /* position: relative; */ > span { width: 100%; height: 100%; > img { width: 100%; height: 100%; } } } .popover-menu__content { position: absolute; z-index: 10; width: 320px; padding: 8px; border: none; background: #fff; border-radius: 8px; box-shadow: 3px 3px 20px rgba(0, 0, 0, 0.1); &::before { position: absolute; width: 16px; height: 8px; background: #fff; content: ''; } &.--position { &-top { bottom: calc(100% + 8px); &.--align { &-start { left: 0; &::before { top: 100%; left: 16px; clip-path: polygon(0 0, 50% 100%, 100% 0); } } &-end { left: 100%; transform: translateX(calc(-100% + 1rem)); &::before { top: 100%; right: 16px; clip-path: polygon(0 0, 50% 100%, 100% 0); } } } } &-right { left: calc(100% + 8px); &.--align { &-start { top: 0; &::before { top: 16px; left: 0; width: 8px; height: 16px; clip-path: polygon(0 50%, 100% 0%, 100% 100%); transform: translateX(-100%); } } &-end { top: 100%; transform: translateX(calc(-100% + 1rem)); &::before { bottom: 16px; left: 0; width: 8px; height: 16px; clip-path: polygon(0 50%, 100% 0%, 100% 100%); transform: translateX(-100%); } } } } &-bottom { top: calc(100% + 8px); &.--align { &-start { left: 0; &::before { bottom: 100%; left: 16px; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); } } &-end { left: 100%; transform: translateX(calc(-100% + 1rem)); &::before { right: 16px; bottom: 100%; clip-path: polygon(50% 0%, 0% 100%, 100% 100%); } } } } &-left { left: -8px; transform: translateX(-100%); &.--align { &-start { top: 0; &::before { top: 16px; left: 100%; width: 8px; height: 16px; clip-path: polygon(0 0%, 100% 50%, 0% 100%); transform: translateX(0); } } &-end { bottom: 0; &::before { bottom: 16px; left: 100%; width: 8px; height: 16px; clip-path: polygon(0 0%, 100% 50%, 0% 100%); transform: translateX(0); } } } } } } &[data-is-marrybaby='true'] { .popover-menu__content { padding: 0; border-radius: 12px; /* &::before { display: none; } */ } } `,c=i.Z.div` display: flex; /* max-height: 300px; */ flex-direction: column; cursor: default; .__header { position: relative; display: flex; align-items: center; justify-content: center; padding: 1rem 0; margin-bottom: 8px; .__back-btn { position: absolute; top: 50%; left: 8px; width: 16px; height: 16px; cursor: pointer; transform: translateY(-50%); } } .tree-text-description { padding-right: 8px; padding-left: 8px; margin-top: -8px; margin-bottom: 8px; font-size: 14px; font-weight: 400; line-height: 22px; text-align: left; } .__content { overflow: auto; flex: 1; } .__list { .__item { position: relative; &.bold-item { font-weight: 700; } &:last-child { .__btn { margin-bottom: 0; } } .__btn { position: relative; display: flex; width: 100%; height: 40px; align-items: center; padding: 0 1rem; border: none; margin-bottom: 8px; color: ${l.r.colors.gray800}; cursor: pointer; text-align: left; transition: background 0.3s; /* for better gtm tracking result */ * { pointer-events: none; } &.--checked { color: ${l.r.colors.gray500}; pointer-events: none; } &:hover { background: ${l.r.colors.gray100}; } .__icon { width: 16px; height: 16px; margin-right: 0.4rem; } & > span { position: relative; & > img { width: 16px; height: 16px; margin-right: 0.4rem; } } } .__toggle { position: absolute; top: 50%; right: 16px; width: 16px; height: 16px; pointer-events: none; transform: translateY(-50%); } } } &[data-is-marrybaby='true'] { .__header { padding: 1rem; } .tree-text-description { padding: 0 1rem; } .__list { .__item { &:first-child { .__btn { border-top-left-radius: 12px; border-top-right-radius: 12px; } } &:last-child { .__btn { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; } } .__btn { height: unset; padding: 1rem; margin-bottom: 0; &:hover { background: ${l.r.mbColors.lightPink}; } } } } } `,PopoverMenu=({className:e,style:t,toggleButtonContent:n,position:i="bottom",align:l="end",children:c,buttonProps:d})=>{let{data:{env:{isMarryBaby:p}}}=(0,a.useContext)(o.T),[u,m]=(0,a.useState)(!1),h=(0,a.useRef)(null),g=(0,a.useRef)(u);return(0,a.useEffect)(()=>{var e;g.current=u,u&&(null===(e=h.current)||void 0===e||e.focus())},[u]),(0,a.useEffect)(()=>{let clickHandler=e=>{var t;(null===(t=h.current)||void 0===t?void 0:t.contains(e.target))||!g.current||m(!1)};return window.addEventListener("click",clickHandler,{passive:!0}),()=>{window.removeEventListener("click",clickHandler)}},[]),a.createElement(s,{"data-is-marrybaby":p,className:e,style:t},a.createElement(r.B,Object.assign({theme:p?"marryBaby":"helloSites",className:"popover-menu__btn",size:"md",color:"transparent",onClick:()=>m(e=>!e)},d),n),u?a.createElement("div",{ref:h,className:`popover-menu__content --position-${i} --align-${l}`,tabIndex:0,onClick:e=>e.stopPropagation()},"function"==typeof c?c({setShow:m}):c):null)}},plOY:function(e,t,n){n.d(t,{c:function(){return s}});var a=Object.prototype.toString,r=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,o=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,i=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,l=/^[\u0020-\u003A\u003D-\u007E]*$/;function startIndex(e,t,n){do{var a=e.charCodeAt(t);if(32!==a&&9!==a)return t}while(++tn;){var a=e.charCodeAt(--t);if(32!==a&&9!==a)return t+1}return n}function decode(e){return -1!==e.indexOf("%")?decodeURIComponent(e):e}var s={parse:function(e,t){if("string"!=typeof e)throw TypeError("argument str must be a string");var n={},a=e.length;if(a<2)return n;var r=t&&t.decode||decode,o=0,i=0,l=0;do{if(-1===(i=e.indexOf("=",o)))break;if(-1===(l=e.indexOf(";",o)))l=a;else if(i>l){o=e.lastIndexOf(";",i-1)+1;continue}var s=startIndex(e,o,i),c=endIndex(e,i,s),d=e.slice(s,c);if(!n.hasOwnProperty(d)){var p=startIndex(e,i+1,l),u=endIndex(e,l,p);34===e.charCodeAt(p)&&34===e.charCodeAt(u-1)&&(p++,u--);var m=e.slice(p,u);n[d]=function(e,t){try{return t(e)}catch(t){return e}}(m,r)}o=l+1}while(o