"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8674],{bmCs:function(e,t,a){a.d(t,{G:function(){return GenderOptionControl}});var o=a("NXpd"),n=a("q1tI"),r=a("XUjW"),l=a("ah6c"),i=a("/npG"),s=a("mYVa"),d=a("Eso5"),c=a("SPK5"),u=a("9aQb"),p=a("vCEM"),m=a("VkaC"),g=a("lk1G");let v={lg:{height:48},md:{height:40},sm:{height:32},xs:{height:32}};var h=(0,i.k)((e,{type:t,gap:a,size:o})=>{let n="mb"===e.other.template,r=v[o]||{},l=r.height;return{root:{},wrapper:Object.assign({gap:(0,s.h)(a||8)},"radio"===t&&{justifyContent:"flex-end",gap:(0,s.h)(a||24)}),groupErr:{fontSize:(0,s.h)(14)},itemRoot:Object.assign({},"button"===t?{flexGrow:1,width:"50%",'&[data-checked="true"]':{".mantine-Radio-label":{borderColor:e.fn.primaryColor()}}}:"radio"===t?{padding:`${(0,s.h)(10)} 0`,margin:0}:{}),itemLabelWrapper:{padding:0,width:"100%"},itemLabel:Object.assign({whiteSpace:"nowrap"},"button"===t?{position:"relative",padding:`${(0,s.h)(2)} ${(0,s.h)(16)}`,border:`1px solid ${n?"#EAEAEC":e.colors.gray[2]}`,backgroundColor:"#fff",borderRadius:(0,s.h)(n?16:4),cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center",height:l,'&[data-disabled="true"]':{background:e.colors.gray[1],color:`${e.colors.gray[4]} !important`,img:{opacity:.5}},img:{height:(0,s.h)("lg"===o?26:22)}}:"radio"===t?{fontSize:(0,s.h)(14)}:{}),itemInner:Object.assign(Object.assign({},"button"===t&&{display:"none"}),"radio"===t&&{alignSelf:"center"}),itemBody:Object.assign({},"radio"===t&&{alignItems:"center"})}});let GenderOptionControl=e=>{var{label:t,availableValue:a,styles:i,isBaby:v,genderValue:b={male:"male",female:"female"},type:f="button",hideLabel:x,labelTextProps:y,labelText:w,gap:E,size:C="md",LabelWrapper:k}=e,S=(0,o._)(e,["label","availableValue","styles","isBaby","genderValue","type","hideLabel","labelTextProps","labelText","gap","size","LabelWrapper"]);let{t:N}=(0,g.u)(),{classes:P,cx:$,theme:T}=h({type:f,gap:E,size:C},{name:"GenderOptionControl",styles:i}),I="mb"===T.other.template,[O,j]=(0,n.useState)(),L=(0,n.useRef)(null),A=k?{}:Object.assign({as:"label",size:"p2",weight:"semiBold",variant:"primary"},y),_=k||m.T,D=(0,n.useMemo)(()=>[{value:b.male,label:v?N("gender.boy"):N("gender.male"),icon:v?I?n.createElement(r.Z,null):p.C.getAssetPath("health-tools/boy-icon.svg"):p.C.getAssetPath("health-tools/male-icon.svg")},{value:b.female,label:v?N("gender.girl"):N("gender.female"),icon:v?I?n.createElement(l.Z,null):p.C.getAssetPath("health-tools/girl-icon.svg"):p.C.getAssetPath("health-tools/female-icon.svg")}],[]);return(0,n.useEffect)(()=>{j(a)},[a]),n.createElement(d.x,{ref:L,className:P.root},n.createElement(u.R.Group,Object.assign({className:"radio-group",label:x?void 0:n.createElement(_,Object.assign({id:"gender-option-control-label"},A),t||(v?N("tools.selectBabyGender"):N("tools.selectGender"))),size:"lg"},S,{classNames:{error:P.groupErr}},"radio"===f&&{error:null}),n.createElement(c.k,{className:$(P.wrapper)},D.map(e=>n.createElement(u.R,Object.assign({className:"gender-item",size:"sm",classNames:{root:P.itemRoot,labelWrapper:P.itemLabelWrapper,label:P.itemLabel,inner:P.itemInner,body:P.itemBody},key:e.value,value:e.value},O&&e.value!==O&&{disabled:!0},{label:n.createElement(c.k,{gap:(0,s.h)(8),align:"center",justify:"center",sx:{zIndex:0}},"button"===f&&("string"==typeof e.icon?n.createElement("img",{src:e.icon,className:"gender-image",alt:"female",loading:"lazy"}):e.icon),n.createElement(m.T,Object.assign({size:"p3"},w),e.label))}))))))}},"74fQ":function(e,t,a){a.d(t,{D:function(){return Dropdown}});var o=a("q1tI"),n=a("8vDj"),r=a("rBCA"),l=a("iBNF");let i=r.Z.div` --dropdown-padding: 12px 18px 12px 16px; position: relative; box-sizing: border-box; border: 1px solid ${l.r.colors.gray200}; background: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23595959' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A") no-repeat; background-position: right 16px center; border-radius: ${l.r.borderRadius}; &[data-disabled='true'], :disabled { background-color: #f2f2f2; cursor: not-allowed; } &[data-size='sm'] { font-size: 13px; line-height: 20px; } &[data-size='md'] { font-size: 14px; line-height: 21px; } &[data-size='lg'] { font-size: 16px; line-height: 24px; } &[data-has-icons='true'] { border: none; background: ${l.r.colors.gray100}; img, svg { display: inline-block; max-width: 16px; margin-right: 6px; } span { display: inline-block; vertical-align: middle; } &:hover { box-shadow: none; } > div { position: relative; display: flex; width: 100%; box-sizing: border-box; align-items: center; } > div::after { position: absolute; top: 50%; right: 12px; width: 10px; height: 8px; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23595959' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A"); background-repeat: no-repeat; content: ''; transform: translateY(-50%); } } &:hover { box-shadow: 0 0 2px 2px ${e=>e.shadowColor}; } &[data-is-native='true'] { padding: var(--dropdown-padding); line-height: 24px; &:focus { box-shadow: 0px 0px 2px 2px ${e=>e.shadowColor}; } } `,s=r.Z.div` padding: var(--dropdown-padding); cursor: pointer; &.with-label { padding-top: 34px; padding-bottom: 12px; } &[data-dropdown-open] { padding: 11px 15px 11px 15px; border: 1px solid ${e=>e.color}; border-radius: ${l.r.borderRadius}; box-shadow: 0 0 2px 2px ${e=>e.shadowColor}; } `,d=r.Z.ul` position: absolute; top: 100%; /* right: 0; */ min-width: 100%; left: 0; display: block; margin-top: 4px; background: ${l.r.colors.white}; border-radius: ${l.r.borderRadius}; box-shadow: -1px 1px 2px rgba(67, 70, 74, 0.0001), -2px 2px 5px rgba(67, 86, 100, 0.123689); cursor: pointer; &[data-has-icons='true'] { border: 1px solid ${l.r.colors.gray200}; background: white; box-shadow: none; filter: drop-shadow(0px 10px 16px rgba(0, 0, 0, 0.04)); } `,c=r.Z.li` display: flex; padding: 12px 18px 12px 16px; &[data-disabled='true'] { cursor: not-allowed; color: #bfbfbf; & > * { pointer-events: none; } } &:hover, :active { background: ${l.r.colors.gray100}; } `,u=r.Z.div` max-width: 16px; margin-right: 8px; `,p=r.Z.div` position: absolute; top: 12px; left: 16px; pointer-events: none; `,Dropdown=({className:e,value:t,options:a,onChange:r=()=>void 0,id:l,placeholderIcon:m,placeholder:g,style:v,size:h="lg",groupedWithLabel:b,disabled:f,dropdownLabelTrackingAttributes:x={},isNativeSelect:y=!1})=>{let w=(0,n.rZ)(),[E,C]=o.useState(!1),showDropdown=()=>!f&&C(!E);if(y){let e="object"==typeof(null==t?void 0:t.value)&&t.value instanceof Date?t.value.toString():null==t?void 0:t.value;return o.createElement(i,{color:w.fn.primaryColor(),shadowColor:w.colors[w.primaryColor][2],as:"select","data-is-native":"true",value:e||void 0,disabled:f,onChange:e=>{if("string"==typeof e.target.value){let t=a.find(t=>t.value===e.target.value);t&&r(t)}}},g&&o.createElement("option",{value:g,disabled:!0,selected:!0},g),a.map(e=>o.createElement("option",{key:`${l}-${e.value}`,value:e.value,disabled:!!e.disabled&&e.disabled},e.label)))}return o.createElement(i,{color:w.fn.primaryColor(),shadowColor:w.colors[w.primaryColor][2],className:e,"data-dropdown-open":E||void 0,"data-size":h,id:l,"data-has-icons":!!m,style:v,onBlur:()=>C(!1),tabIndex:0,"data-disabled":f},!!b&&o.createElement(p,null,b),o.createElement(s,Object.assign({color:w.fn.primaryColor(),shadowColor:w.colors[w.primaryColor][2],onClick:showDropdown,className:b&&"with-label"},x),m," ",o.createElement("span",null,t&&t.value?t.label:g)),E&&o.createElement(d,{onClick:showDropdown,"data-has-icons":!!m},a.map(e=>o.createElement(c,{key:`${l}-${e.value}`,"data-selected":t&&t.value===e.value||void 0,onClick:()=>!e.disabled&&!f&&(null==r?void 0:r(e)),"data-disabled":!!e.disabled&&e.disabled},e.icon&&o.createElement(u,null,e.icon),e.label))))}},"28zG":function(e,t,a){a.d(t,{C:function(){return Checkbox},I:function(){return ImageWrapV2},P:function(){return Pagination},S:function(){return y},a:function(){return h},b:function(){return SearchInput},c:function(){return Search2}});var o=a("q1tI"),n=a("rBCA"),r=a("tKpg"),l=a("iBNF"),i=a("NXpd"),s=a("jAVh"),d=a("9aQb"),c=a("tIlP");let Search2=e=>o.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 25",fill:"none"},e),o.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"}),o.createElement("path",{d:"M20 20.957L16 16.957",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),u=n.Z.div` display: flex; cursor: pointer; &[data-theme='marryBaby'] { input { width: 20px; height: 20px; border: 1.3px solid ${l.r.mbColors.midGray}; border-radius: 9px; cursor: inherit; transition: border-color 0.4s, box-shadow 0.4s; &:hover, &:active { border-color: ${l.r.mbColors.cobalt}; box-shadow: 0 0 2px 2px ${l.r.mbColors.cobalt}; } &:focus-visible { border: 2px solid ${l.r.mbColors.cobalt}; } &:checked { border: 0; background: ${l.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: ${l.r.mbColors.gray}; } } input { width: 20px; height: 20px; border: solid 1px ${l.r.colors.gray500}; border-radius: 2px; cursor: inherit; transition: border-color 0.4s, box-shadow 0.4s; &:hover, &:active { border-color: ${l.r.colors.primaryBase}; box-shadow: 0 0 2px 2px ${l.r.colors.primary200}; } &:focus-visible { border: 2px solid ${l.r.colors.primaryActive}; } &:checked { border: 0; background: ${l.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: ${l.r.sizes.fwRegular}; width: calc(100% - 24px); cursor: inherit; ${r.M.mbDown} { font-size: 14px; line-height: 24px; } ${r.M.mbUp} { font-size: 16px; line-height: 22px; } } &[data-is-rectangle] > input { position: relative; width: unset; height: unset; padding: 5px 12px; border: 1px solid ${l.r.colors.neutral100}; border-radius: 32px; &::after { color: ${l.r.colors.gray800}; content: attr(data-label-text); font-size: 13px; } &:checked { border-color: ${l.r.colors.primary50}; &::after { color: ${l.r.colors.primaryBase}; } } &:checked { background: ${l.r.colors.primary50}; } } &[data-disabled] { color: ${l.r.colors.gray300}; cursor: not-allowed; input { border-color: ${l.r.colors.gray300}; &:hover { border-color: ${l.r.colors.gray300}; box-shadow: none; } } } `,Checkbox=({label:e,name:t,checked:a,className:n,isDisabled:r,onChange:l,value:i,isRectangle:s,inputDataTestId:d,siteType:c})=>o.createElement(u,{className:n,"data-disabled":r||void 0,"data-is-rectangle":s||void 0,"data-label-text":e,"data-theme":c},o.createElement("input",{type:"checkbox",checked:a,name:t,onChange:()=>l(i,!a),disabled:r,value:i,id:`${t}-${i}`,"data-label-text":e,"data-testid":d}),!s&&o.createElement("label",{htmlFor:`${t}-${i}`},e)),p=n.Z.div` display: flex; align-items: center; justify-content: space-between; user-select: none; li { transition: all 0.3s ease; } [data-page-active] { background: ${l.r.colors.primaryBase}; color: ${l.r.colors.white}; > a { color: ${l.r.colors.white}; } } `,m=n.Z.div` display: flex; width: 32px; height: 32px; box-sizing: border-box; align-items: center; justify-content: center; border: 1px solid ${l.r.colors.gray200}; margin: 0 2px; border-radius: 4px; color: ${l.r.colors.gray800}; cursor: pointer; font-size: 14px; font-weight: ${l.r.sizes.fwBold}; &[data-last-page] { border: none; background-color: ${l.r.colors.gray100}; cursor: not-allowed; pointer-events: none; svg { path { stroke: ${l.r.colors.gray300}; } } } `,g=n.Z.li` display: flex; width: 32px; height: 32px; align-items: center; justify-content: center; margin: 0 2px; border-radius: 4px; color: ${l.r.colors.gray800}; cursor: pointer; font-size: 14px; font-weight: ${l.r.sizes.fwBold}; > a { color: ${l.r.colors.gray800}; text-decoration: unset; display: block; width: 100%; height: 100%; line-height: 32px; text-align: center; } `,RenderPagiWithDots=({pagesAmount:e,activePage:t,handlePageChange:a,handleClick:n,href:l,queryPageName:i="page"})=>{let s=[...Array(e)].map((e,t)=>t+1),[d,c]=(0,o.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,o.useEffect)(()=>{t<=4?c(s.slice(0,5)):t>=s.length-3?c(s.slice(s.length-5,s.length)):c(s.slice(t-2,t+1))},[t]),o.createElement(o.Fragment,null,t>4&&o.createElement(o.Fragment,null,o.createElement(g,{onClick:()=>a(1)},l?o.createElement("a",{href:l,onClick:n},1):1),o.createElement(g,null,"...")),d.map(e=>o.createElement(g,{key:`pagination+${e}`,"data-page-active":e===t||void 0,onClick:()=>a(e)},l?o.createElement("a",{href:(0,r.f)(l,e,i),onClick:n},e):e)),ta(s.length)},l?o.createElement("a",{href:(0,r.f)(l,s.length,i),onClick:n},s.length):s.length)))},Pagination=({className:e,pagesAmount:t,currentPage:a,onChange:n,onClick:l,style:i,href:s,queryPageName:d="page"})=>{let c=[...Array(t)].map((e,t)=>t+1),[u,v]=(0,o.useState)(a),h=(0,o.useMemo)(()=>s&&s.endsWith("&page=")?s.replace("&page=",""):s,[s]),b=t-1,handlePageChange=e=>{e<=t&&e>0&&(v(e),n(e))},handleClick=e=>{l&&l(e)};return(0,o.useEffect)(()=>{v(a)},[a]),o.createElement(p,{className:e,style:i},o.createElement(m,{className:"prev-page",onClick:()=>handlePageChange(u-1),"data-last-page":1===u||void 0},h?o.createElement("a",{href:(0,r.f)(h,u,d),onClick:handleClick},o.createElement("svg",{width:"7",height:"10",viewBox:"0 0 7 10",fill:"none"},o.createElement("path",{d:"M5.5 9L1.5 5L5.5 1",stroke:"#2D87F3",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))):o.createElement("svg",{width:"7",height:"10",viewBox:"0 0 7 10",fill:"none"},o.createElement("path",{d:"M5.5 9L1.5 5L5.5 1",stroke:"#2D87F3",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))),c.length>8?o.createElement(RenderPagiWithDots,{pagesAmount:t,activePage:u,handlePageChange:handlePageChange,handleClick:handleClick,href:h,queryPageName:d}):c.map(e=>o.createElement(g,{key:`pagination+${e}`,"data-page-active":e===u||void 0,onClick:()=>handlePageChange(e)},h?o.createElement("a",{href:(0,r.f)(h,e,d),onClick:handleClick},e):e)),o.createElement(m,{className:"next-page",onClick:()=>handlePageChange(u+1),"data-last-page":u===b+1||void 0},h?o.createElement("a",{href:(0,r.f)(h,u,d),onClick:handleClick},o.createElement("svg",{width:"7",height:"10",viewBox:"0 0 7 10",fill:"none"},o.createElement("path",{d:"M1.5 9L5.5 5L1.5 1",stroke:"#2D87F3",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))):o.createElement("svg",{width:"7",height:"10",viewBox:"0 0 7 10",fill:"none"},o.createElement("path",{d:"M1.5 9L5.5 5L1.5 1",stroke:"#2D87F3",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))))},v=n.Z.div` position: relative; width: 100%; &[data-has-error] { input { border-color: ${l.r.colors.red700}; } } input { width: 100%; padding: 12px 16px; border: solid 1px ${l.r.colors.gray200}; border-radius: ${l.r.borderRadius}; &:active, &:focus, .focused & { border-color: ${l.r.colors.primaryBase}; box-shadow: 0px 0px 2px 2px ${l.r.colors.primary200}; } &:disabled { background-color: ${l.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: ${l.r.sizes.fwRegular}; ${r.M.mbDown} { font-size: 22px; line-height: 1.2; } ${r.M.mbUp} { font-size: 26px; line-height: 1.2; } } } &[data-size='md'] { input { font-weight: ${l.r.sizes.fwRegular}; ${r.M.mbDown} { font-size: 14px; line-height: 1.2; } ${r.M.mbUp} { font-size: 16px; line-height: 1.2; } } } &[data-size='sm'] { input { font-weight: ${l.r.sizes.fwRegular}; ${r.M.mbDown} { font-size: 13px; line-height: 1.5; } ${r.M.mbUp} { font-size: 13px; line-height: 1.5; } } } `,h=o.forwardRef((e,t)=>{var{name:a,errorMessage:n,autoComplete:r="off",defaultValue:l,actionIcon:d,displayIcon:c,isDeleteAction:u,onActionClick:p,label:m,placeholder:g,className:h,onChange:b,onKeyPress:f,isDisabled:x,CustomInput:y,size:w,style:E,autoFocus:C,type:k="text",isNumerousKeyboard:S=!1,onFocus:N,enterKeyHint:P,nativeOnChange:$}=e,T=(0,i._)(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,O]=(0,o.useState)(l),handleOnChange=e=>{O(e),b(e)};return o.createElement(v,{"data-size":w,className:h,"data-has-action-icon":!!d||void 0,"data-has-display-icon":!!c||void 0,"data-has-error":n&&n.length>0||void 0,style:E},m&&o.createElement(s.L,{size:"label2",htmlFor:a,className:"inputLabel"},m),o.createElement("div",{style:{position:"relative"}},y||o.createElement("input",Object.assign({id:a,name:a,placeholder:g,onChange:null!=$?$:e=>handleOnChange(e.target.value),onKeyPress:f,type:k,"aria-label":k,disabled:x,value:I,autoComplete:r,ref:t,autoFocus:C,inputMode:S||"number"===k?"numeric":k,pattern:S?"[0-9]*":".*",onFocus:N,enterKeyHint:P},T)),c&&o.createElement(s.S,{className:"displayIcon"},c),d&&o.createElement(s.a,{className:"actionIcon",onClick:()=>{var e;u&&(O(""),null===(e=t.current)||void 0===e||e.focus()),p&&p()}},d)),n&&n.length>0&&o.createElement(s.b,{className:"errorLabel"},n))});h.displayName="PureInput";let b=[320,420,640,750,828,1080,1200,1440,1920,2048],defaultLoader=({src:e,width:t,quality:a})=>{try{let o=new URL(e,"undefined"!=typeof window?window.location.origin:"http://localhost");return o.searchParams.set("w",String(t)),o.searchParams.set("q",String(null!=a?a:75)),o.toString()}catch(t){return e}},ImageWrapV2=e=>{var{alt:t,backupSrc:a,src:n,placeholderSrc:r,style:l,ref:s,unoptimized:d=!1,quality:c,sizes:u,width:p}=e,m=(0,i._)(e,["alt","backupSrc","src","placeholderSrc","style","ref","unoptimized","quality","sizes","width"]);let[g,v]=(0,o.useState)(!1),h=(0,o.useMemo)(()=>d?[]:function(e){if(e.sizes)return b;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 b}({sizes:u,width:p}),[u,p,d]),x=(0,o.useMemo)(()=>{if(!d)return h.map(e=>`${defaultLoader({src:n,width:e,quality:c})} ${e}w`).join(", ")},[d,h,n,c]),y=(0,o.useMemo)(()=>{if(d)return n;let e=h.length?h[h.length-1]:null!=p?p:1920;return defaultLoader({src:n,width:e,quality:c})},[d,h,n,c,p]);return o.createElement(f,Object.assign({loading:"lazy",alt:t,srcSet:x,onError:()=>!g&&v(!0),src:g?a||y:y||a,style:Object.assign(Object.assign({},r?{backgroundImage:`url(${r})`}:{}),l),"data-has-placeholder":!!r,sizes:u,ref:s},m))},f=n.Z.img` &[data-has-placeholder='true'] { background-position: center; background-repeat: no-repeat; background-size: cover; } `,x=(0,n.Z)(d.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: ${l.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; } `,y=(0,n.Z)(Search2)` color: ${l.r.colors.primaryBase}; width: 20px; height: 20px; `,SearchInput=e=>{let{loading:t,disabled:a,placeholder:n,value:r,onChange:l,icon:s=o.createElement(y,null),className:d,style:u,enableClear:p}=e,m=(0,i._)(e,["loading","disabled","placeholder","value","onChange","icon","className","style","enableClear"]);return o.createElement(x,Object.assign({disabled:t||a,size:"lg",value:r,onChangeRaw:e=>{l(e.currentTarget.value)},type:"text",placeholder:n,className:d,icon:s,style:u,rightSection:p?o.createElement("div",{className:"close-icon-wrapper",onClick:()=>{l("")},"data-is-disabled":!r},o.createElement(c.C,{fill:"white",width:"100%",height:"100%"})):void 0},m,{"data-event-label":r}))}},ZiSB:function(e,t,a){a.d(t,{D:function(){return DatePicker}});var o=a("NXpd"),n=a("q1tI"),r=a("8vDj"),l=a("gHhT"),i=a("catb"),s=a("47J3"),d=a("vCEM"),c=a("aBaF"),u=a("Yida"),p=a("yNk5");let DatePicker=e=>{var t,{value:a,fullWidth:m=!0}=e,g=(0,o._)(e,["value","fullWidth"]);let v=(0,r.rZ)(),h="mb"===v.other.template,b=null===(t=s.I[p.env.UNIFY_LOCALE||u.L.Vietnam])||void 0===t?void 0:t.dateFormat;return n.createElement(i.a,Object.assign({locale:c.M[p.env.UNIFY_LOCALE||u.L.Vietnam],valueFormat:b,size:"md",clearable:!1,popoverProps:m?{styles:{dropdown:{minWidth:"100%",display:"flex",justifyContent:"center",alignItems:"center"}}}:{},styles:{root:{position:"relative"},rightSection:{pointerEvents:"none",cursor:"default"}},rightSection:n.createElement(l.E,{src:d.C.getAssetPath(h?"MB-calendar.svg":"OutlineCalendar.svg"),width:18,height:18}),value:a,placeholder:b},g,{className:`input-control ${(null==g?void 0:g.className)||""}`}))}},B1nu:function(e,t,a){a.d(t,{M:function(){return Modal}});var o=a("NXpd"),n=a("q1tI"),r=a("h8tX"),l=a("ttLs");let Modal=e=>{var{styles:t,classNames:a,transitionProps:i}=e,s=(0,o._)(e,["styles","classNames","transitionProps"]);let{classes:d}=(0,l.u)(void 0,{name:"Modal",styles:t,classNames:a});return n.createElement(r.u,Object.assign({centered:!0,classNames:d,transitionProps:Object.assign({transition:"fade"},i),trapFocus:!1},s))}},fUyO:function(e,t,a){a.d(t,{A:function(){return Avatar},D:function(){return DistanceTag},I:function(){return IconWrapper},P:function(){return Pin3},S:function(){return ShapedArrowDown},a:function(){return DrawerBottom}});var o=a("q1tI"),n=a("rBCA"),r=a("iBNF"),l=a("YwFi"),i=a("VkaC"),s=a("NXpd"),d=a("iuhU"),c=a("h8tX"),u=a("vGCM"),p=a("rSBk"),m=a("47J3");let Pin3=e=>o.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 12 12",fill:"none"},e),o.createElement("g",{clipPath:"url(#clip0_5371_10640)"},o.createElement("path",{d:"M6.6665 4.3335L8.1665 5.8335L6.6665 7.3335",stroke:"#8C8C8C",strokeWidth:.72,strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{d:"M8.16667 5.8335H5.83333C5.09667 5.8335 4.5 6.43016 4.5 7.16683V7.50016",stroke:"#8C8C8C",strokeWidth:.72,strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{d:"M6.94331 10.3902L10.3907 6.94281C10.9114 6.42211 10.9114 5.57789 10.3907 5.05719L6.94331 1.60981C6.42261 1.08911 5.57839 1.08911 5.05769 1.60981L1.61031 5.05719C1.08961 5.57789 1.08961 6.42211 1.61031 6.94281L5.05769 10.3902C5.57839 10.9109 6.42261 10.9109 6.94331 10.3902Z",stroke:"#8C8C8C",strokeWidth:.72,strokeLinecap:"round",strokeLinejoin:"round"})),o.createElement("defs",null,o.createElement("clipPath",{id:"clip0_5371_10640"},o.createElement("rect",{width:12,height:12,fill:"white"})))),ShapedArrowDown=e=>o.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"none"},e),o.createElement("path",{d:"M13.5554 9.33398L7.99989 5.55621L2.44434 9.33398",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"})),g=n.Z.div` background-color: var(--background-color, transparent); color: white; cursor: pointer; img { --width: var(--width-prop, 40px); --height: var(--height-prop, 40px); width: var(--width); height: var(--height); } &[data-has-max='true'] { img { max-width: var(--width); max-height: var(--height); } } &[data-avatar-type='square'] { img { --width: var(--width-prop, 72px); --height: var(--height-prop, 72px); border-radius: ${r.r.borderRadius}; } } &[data-avatar-type='rounded'] { img { border-radius: 50%; } } &[data-custom-size='true'] { display: flex; overflow: hidden; overflow: hidden; width: var(--size); height: var(--size); align-items: center; justify-content: center; background-size: cover; font-size: calc(var(--size) / 2); font-weight: bold; &[data-avatar-type='square'] { border-radius: ${r.r.borderRadius}; } &[data-avatar-type='rounded'] { border-radius: 50%; img { --width: 100%; --height: 100%; } } img { object-fit: cover; } } `,v={xs:28,small:32,medium:40,large:48,xl:64,xxl:80,xxxl:96},Avatar=({type:e="square",size:t,avatarImg:a,avatarUrl:n,firstLetter:r,backgroundColor:i,onClick:s,style:d,className:c,width:u,height:p,alt:m})=>{let h=t?v[t]:void 0,[b,f]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(n){let e=document.createElement("img");e.setAttribute("src",n),e.addEventListener("error",()=>{f(!0)})}},[n,f]);let x=(!n&&!a||b)&&r;return o.createElement(g,{style:Object.assign(Object.assign({},d),{"--size":h?h+"px":void 0,"--width-prop":u?u+"px":void 0,"--height-prop":p?p+"px":void 0,"--background-color":i}),"data-has-max":!!(u&&p),"data-avatar-type":e,onClick:s,className:c,avatarUrl:n,"data-custom-size":!!t},a,n&&!b&&o.createElement(l.I,{src:n,alt:m||"avatar"}),x&&r)},h=n.Z.div` display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; color: ${r.r.colors.red700}; border-radius: 8px; border: 1px solid ${r.r.colors.neutral100}; font-size: 0.6875rem; line-height: 1rem; border-radius: 0.5rem; `,b=(0,n.Z)(Pin3)` width: 0.75rem; height: 0.75rem; color: ${r.r.colors.gray400}; `;function DistanceTag({value:e,className:t}){return o.createElement(h,{className:t},o.createElement(b,null),o.createElement(i.T,{size:"p3",weight:"regular",color:r.r.colors.gray400},e))}let f=n.Z.div` display: inline-flex; align-items: center; justify-content: center; flex-grow: 0; flex-shrink: 0; width: calc(var(--wrapper-size, var(--icon-size)) * 1px); height: calc(var(--wrapper-size, var(--icon-size)) * 1px); &[data-clickable='true'] { cursor: pointer; } > * { width: calc(var(--icon-size) * 1px); height: calc(var(--icon-size) * 1px); } &[data-svg-custom-stroke='true'] > svg * { stroke: var(--icon-stroke-color); } &[data-svg-custom-fill='true'] > svg * { fill: var(--icon-fill-color); } `,IconWrapper=({children:e,className:t,onClick:a,wrapperSize:n,iconSize:r=24,wrapperStyle:l,iconStyle:i,svgIcon:s,wrapperProps:d})=>o.createElement(f,Object.assign({className:t,onClick:a,style:Object.assign(Object.assign(Object.assign(Object.assign({},n&&{"--wrapper-size":n}),r&&{"--icon-size":r}),s&&Object.assign(Object.assign({},s.fill&&{"--icon-fill-color":s.fill}),s.stroke&&{"--icon-stroke-color":s.stroke})),l),"data-clickable":!!a,"data-svg-custom-stroke":!!(null==s?void 0:s.stroke),"data-svg-custom-fill":!!(null==s?void 0:s.fill)},d),o.cloneElement(e,{style:i}));(0,n.Z)(u.D)` /* max-height: 100vh; max-height: 100dvh; */ background-color: white; &[data-vaul-drawer-direction='bottom'] { top: initial !important; border-top-left-radius: 16px !important; border-top-right-radius: 16px !important; padding-bottom: 32px; padding-left: 20px; padding-right: 20px; } .drawer__handle { width: 44px; height: 3px; background-color: ${r.r.colors.neutral500}; margin: 16px auto; flex-shrink: 0; } `;let x=(0,n.Z)(p.dy.Content)` position: fixed; z-index: ${m.Z-9e6+1}; inset: 0; background-color: #fff; outline: none !important; &[data-is-linear='true'] { background: linear-gradient(180deg, #c3e3ff 1.86%, #fff 20%) !important; } &::-webkit-scrollbar { width: 6px; height: 6px; } &::-webkit-scrollbar-track { background-color: transparent; } &::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, 0.4); border-radius: 6px; } &[data-vaul-drawer-direction='bottom'] { top: initial; border-top-left-radius: 16px; border-top-right-radius: 16px; /* padding-bottom: 16px; */ } ${e=>e.isDragging&&` input { caret-color: transparent; } `} `,y=(0,n.Z)(p.dy.Overlay)` position: fixed; inset: 0; z-index: ${m.Z-9e6}; width: 100%; max-height: 100%; background-color: rgb(0, 0, 0, 0.4); `,w=(0,n.Z)(p.dy.Handle)` &[data-vaul-handle] { width: 44px; height: 3px; background-color: ${r.r.colors.neutral500}; margin: 16px auto; flex-shrink: 0; } `;function DrawerBottom(e){var{children:t,onClose:a,isOpen:n,onOpenChange:r,isMobile:l,classNames:i,isLinear:m,overlayClassName:g,contentClassName:v,handlerClassName:h}=e,b=(0,s._)(e,["children","onClose","isOpen","onOpenChange","isMobile","classNames","isLinear","overlayClassName","contentClassName","handlerClassName"]);let{isDragging:f,handleDragStart:E,handleDragEnd:C}=(0,u.u)();return l?o.createElement(p.dy.Root,Object.assign({onDrag:E,onRelease:C,open:n,onOpenChange:r,onClose:a},b),o.createElement(p.dy.Portal,null,o.createElement(y,{className:(0,d.default)(g,"drawer__overlay")}),o.createElement(x,{isDragging:f,className:(0,d.default)(v,"drawer__content"),"data-is-linear":m},o.createElement(p.dy.Title,{style:{display:"none"}}),o.createElement(w,{className:(0,d.default)(h,"drawer__handle")}),t))):o.createElement(c.u,Object.assign({withCloseButton:!0,centered:!0,zIndex:500,size:"auto",classNames:i,radius:"lg"},b,{onClose:a,opened:n,styles:{root:{maxHeight:"400px"},body:{background:m?"linear-gradient(180deg, #A5D4FF 0%, #FFFFFF 20%)":void 0}}}),t)}},"9ZZs":function(e,t,a){a.d(t,{B:function(){return BabyVaccineForm}});var o,n,r=a("NXpd"),l=a("q1tI"),i=a("iuhU"),s=a("8vDj"),d=a("cChf"),c=a("ZFu2"),u=a("ZiSB"),p=a("VkaC"),m=a("lk1G"),g=a("X5xi"),v=a("TJFH"),h=a("bmCs"),b=a("Zge2");let f=(0,l.createContext)({}),DefaultLayout=e=>{var t=(0,r._)(e,[]);let{t:a}=(0,m.u)(),{currentUrl:o,submitProps:n,form:s}=(0,l.useContext)(f),{classes:d={}}=(0,l.useContext)(g.C);return l.createElement(v.H,Object.assign({formLayout:"default"},t),l.createElement(v.H.FormRow,null,l.createElement(h.G,Object.assign({isBaby:!0},s.getInputProps("gender")))),l.createElement(v.H.FormRow,null,l.createElement(u.D,Object.assign({label:l.createElement(p.T,{size:"p2",weight:"semiBold"},a("babyGrowth.input.birthday")),placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0},maxDate:new Date},s.getInputProps("age")))),l.createElement(v.H.FormRow,{className:d.submitWrapper},l.createElement(v.H.Submit,Object.assign({type:"submit",className:(0,i.default)("due-date-calculate-button",d.submitBtn),dataEventCategory:"Health Tool",dataEventAction:"Vaccination Tool",dataEventLabel:o},n),a("dueDatePage.lastPeriod.calculate"))))},InlineLayout=e=>{var t=(0,r._)(e,[]);let{t:a}=(0,m.u)(),{currentUrl:o,submitProps:n,form:s}=(0,l.useContext)(f),{classes:d={}}=(0,l.useContext)(g.C);return l.createElement(v.H,Object.assign({formLayout:"inline"},t),l.createElement(v.H.FormRow,null,l.createElement(v.H.BorderInlineControl,{label:a("tools.selectBabyGender"),width:"none"},l.createElement(h.G,Object.assign({isBaby:!0,hideLabel:!0,type:"radio"},s.getInputProps("gender")))),s.errors.gender&&l.createElement(v.H.Error,null,s.errors.gender)),l.createElement(v.H.FormRow,null,l.createElement(v.H.BorderInlineControl,{label:a("babyGrowth.input.birthday")},l.createElement(u.D,Object.assign({placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0},maxDate:new Date},s.getInputProps("age"),{error:null}))),s.errors.age&&l.createElement(v.H.Error,null,s.errors.age)),l.createElement(v.H.FormRow,{className:d.submitWrapper},l.createElement(v.H.Submit,Object.assign({type:"submit",className:(0,i.default)("due-date-calculate-button",d.submitBtn),dataEventCategory:"Health Tool",dataEventAction:"Vaccination Tool",dataEventLabel:o},n),a("dueDatePage.lastPeriod.calculate"))))},MbLayout=e=>{var t=(0,r._)(e,[]);let{t:a}=(0,m.u)(),{currentUrl:o,submitProps:n,form:i}=(0,l.useContext)(f);return l.createElement(v.H,Object.assign({formLayout:"default"},t),l.createElement(v.H.Control,null,l.createElement(h.G,Object.assign({isBaby:!0},i.getInputProps("gender"),{error:null}))),i.errors.gender&&l.createElement(v.H.Error,null,i.errors.gender),l.createElement(v.H.FormRow,null,l.createElement(v.H.BorderBoxControl,{label:a("babyGrowth.input.birthday"),rightSection:l.createElement(b.Z,null)},l.createElement(u.D,Object.assign({placeholder:"DD/MM/YYYY",popoverProps:{withinPortal:!0},maxDate:new Date,rightSection:null},i.getInputProps("age"),{error:null}))),i.errors.age&&l.createElement(v.H.Error,null,i.errors.age)),l.createElement(v.H.Submit,Object.assign({type:"submit",className:"due-date-calculate-button",dataEventCategory:"Health Tool",dataEventAction:"Vaccination Tool",dataEventLabel:o},n),a("dueDatePage.lastPeriod.calculate")))};(o=n||(n={}))[o.trackPeriod=0]="trackPeriod",o[o.conceive=1]="conceive",o[o.avoidPregnancy=2]="avoidPregnancy";let BabyVaccineForm=e=>{var{formLayout:t="default",submitProps:a,currentUrl:o,onSubmit:n}=e,i=(0,r._)(e,["formLayout","submitProps","currentUrl","onSubmit"]);let{t:u}=(0,m.u)(),p=(0,s.rZ)(),g="mb"===p.other.template,v=(0,d.c)({validate:{gender:(0,c.U)(u("validation.error.requiredField")),age:(0,c.U)(u("validation.error.requiredField"))}}),h=Object.assign({onSubmit:v.onSubmit(n)},i);return l.createElement(f.Provider,{value:{submitProps:a,currentUrl:o,form:v}},"inline"===t?l.createElement(InlineLayout,Object.assign({},h)):g?l.createElement(MbLayout,Object.assign({formLayout:t},h)):l.createElement(DefaultLayout,Object.assign({},h)))}},"7h2w":function(e,t,a){a.d(t,{R:function(){return RadioImageGroup}});var o=a("q1tI"),n=a("iBNF"),r=a("rBCA"),l=a("1AKC"),i=a("rAbs");let s=r.Z.div` display: flex; width: 100%; &[data-direction='vertical'] { flex-direction: column; } &[data-direction='horizontal'] { flex-wrap: wrap; } `,d=r.Z.div` display: flex; padding: 8px; border-radius: ${n.r.borderRadius}; cursor: pointer; & > div { display: flex; width: 100%; height: 100%; flex-direction: column; align-items: center; justify-content: flex-start; } &[data-is-mb='false'] { &[data-selected='true'] { border: 1px solid #2d87f3; background: white; } &[data-selected='false'] { border: 1px solid #f2f2f2; box-shadow: 0px 5px 12px rgba(40, 74, 117, 0.08); } } &[data-is-mb='true'] { border-radius: 16px; background: white; padding: 16px auto; &[data-selected='true'] { border: 1px solid ${n.r.mbColors.mint}; box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.06); } &[data-selected='false'] { border: none; } } &[data-disabled='true'] { cursor: auto; } .radio-group-item-heading { margin-top: 8px; //height: 48px; text-align: center; } .gender-image { width: 70px; height: 70px; &[data-is-mobile='true'] { width: 40px; height: 40px; } } `,RadioImageGroup=({value:e,options:t,className:a,direction:r="horizontal",onChange:c,isDisabled:u,siteType:p})=>{let[m,g]=(0,o.useState)(e),handleOnChange=e=>{!u&&(g(e),c&&c(e))},v="marryBaby"===p;return o.createElement(s,{className:a,"data-direction":r},t.map((t,a)=>o.createElement(d,{"data-selected":(e||m)===t.value,"data-is-mb":v,"data-disabled":u,key:a,onClick:()=>{handleOnChange(t.value)}},o.createElement("div",null,t.content,t.label&&o.createElement(o.Fragment,null,v?o.createElement(l.M,{type:"subtitle-2",color:(e||m)===t.value?n.r.mbColors.dark:n.r.mbColors.midGray},t.label):o.createElement(i.T,{type:"bold",color:(e||m)===t.value?"#2D87F3":"black",className:"radio-group-item-heading",size:"label1"},t.label))))))}},r8aS:function(e,t,a){a.d(t,{C:function(){return CartCareButton},S:function(){return ShoppingCartCare}});var o=a("q1tI"),n=a("xXM3"),r=a.n(n),l=a("rBCA"),i=a("Eso5"),s=a("tKpg"),d=a("iBNF"),c=a("lk1G"),u=a("VkaC");let ShoppingCartCare=e=>o.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"none"},e),o.createElement("path",{d:"M1.94434 1.94434L3.44545 2.31989C3.88211 2.42878 4.20989 2.791 4.27545 3.23656L5.55656 11.9454",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{d:"M16.9444 14.7218H4.99997C4.23331 14.7218 3.61108 14.0996 3.61108 13.3329C3.61108 12.5662 4.23331 11.944 4.99997 11.944H14.4766C14.9544 11.944 15.38 11.6385 15.5311 11.184L17.0122 6.73957C17.2522 6.01957 16.7166 5.27734 15.9578 5.27734H4.57553",stroke:"currentColor",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{d:"M4.16648 18.8891C4.93354 18.8891 5.55537 18.2673 5.55537 17.5002C5.55537 16.7332 4.93354 16.1113 4.16648 16.1113C3.39941 16.1113 2.77759 16.7332 2.77759 17.5002C2.77759 18.2673 3.39941 18.8891 4.16648 18.8891Z",fill:"currentColor"}),o.createElement("path",{d:"M15.8332 18.8891C16.6003 18.8891 17.2221 18.2673 17.2221 17.5002C17.2221 16.7332 16.6003 16.1113 15.8332 16.1113C15.0662 16.1113 14.4443 16.7332 14.4443 17.5002C14.4443 18.2673 15.0662 18.8891 15.8332 18.8891Z",fill:"currentColor"})),p=(0,l.Z)(i.x)` display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #ffffff33; position: relative; flex-shrink: 0; cursor: pointer; /* Desktop: Square layout */ border-radius: 28px; max-height: 40px; padding: 9px 1rem; background-color: inherit; white-space: nowrap; .cart-care-icon { width: 20px; height: 20px; color: ${d.r.colors.white}; flex-shrink: 0; } .cart-care-button-text { display: block; font-size: 14px; font-weight: 500; line-height: 22px; } /* Mobile: Circle layout */ ${s.M.mbDown} { border-radius: 100%; aspect-ratio: 1/1; width: 32px; height: 32px; padding: auto; background-color: ${d.r.colors.white}; max-height: none; padding: 0; .cart-care-icon { width: 20px; height: 20px; color: ${d.r.colors.blue900}; flex-shrink: 0; } .cart-care-button-text { display: none; } } `,m=(0,l.Z)(i.x)` min-width: 20px; min-height: 20px; aspect-ratio: 1/1; border-radius: 100%; background-color: ${d.r.colors.red500}; color: ${d.r.colors.white}; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: absolute; top: -4px; right: -4px; ${s.M.mbDown} { top: -8px; right: -8px; } `,CartCareButton=e=>{let{count:t=0,href:a,classes:n,boxProps:l,anchorProps:i,tracking:s}=e,{t:g}=(0,c.u)();return o.createElement("a",Object.assign({className:r()("cart-care-button"),href:a,"data-testid":"cart-care-button","data-event-category":"Hamburger Navigation","data-event-action":"Cart Click","data-event-label":a},s,i),o.createElement(p,Object.assign({className:r()("cart-care-button-box",null==n?void 0:n.box)},l),o.createElement(ShoppingCartCare,{className:"cart-care-icon"}),o.createElement(u.T,{size:"label1",color:d.r.colors.white,fw:500,className:"cart-care-button-text"},g("navigation.button.cartCareService")),t>0&&o.createElement(m,{className:r()("cart-care-button-count-box",null==n?void 0:n.count)},o.createElement(u.T,{size:t>99?"label2":"c1",color:d.r.colors.white,fw:600,className:"cart-care-button-count-text"},t>99?"99+":t))))}},DThU:function(e,t,a){a.d(t,{D:function(){return Drawer}});var o=a("q1tI"),n=a("t/pd"),r=a("tKpg"),l=a("AeFk"),i=a("rBCA"),s=a("iBNF"),d=a("LbHy"),c=a("VkaC");let u="600ms",generateStyleBasedOnPlacement=(e,t)=>{switch(e){case"top":return l.iv` top: 0; width: 100%; border-radius: 0px 0px 6px 6px; ${t?l.iv` animation: ${d.a} ${u} ease-in-out forwards; `:null} &.slideOut { animation: ${d.d} ${u} ease-in-out forwards; } `;case"right":return l.iv` right: 0; height: 100%; min-width: 300px; border-radius: 6px 0px 0px 6px; ${t?l.iv` animation: ${d.c} ${u} ease-in-out forwards; `:null} &.slideOut { animation: ${d.g} ${u} ease-in-out forwards; } `;case"bottom":return l.iv` bottom: 0; width: 100%; border-radius: 6px 6px 0px 0px; ${t?l.iv` animation: ${d.s} ${u} ease-in-out forwards; `:null} &.slideOut { animation: ${d.e} ${u} ease-in-out forwards; } `;case"left":return l.iv` left: 0; height: 100%; min-width: 300px; border-radius: 0px 6px 6px 0px; ${t?l.iv` animation: ${d.b} ${u} ease-in-out forwards; `:null} &.slideOut { animation: ${d.f} ${u} ease-in-out forwards; } `;default:return l.iv` left: 0; height: 100%; min-width: 300px; border-radius: 0px 6px 6px 0px; ${t?l.iv` animation: ${d.s} ${u} ease-in-out forwards; `:null} &.slideOut { animation: ${d.e} ${u} ease-in-out forwards; } `}},p=i.Z.div` position: fixed; inset: 0; z-index: ${s.r.zIndexes.drawer}; pointer-events: ${e=>e.open?"auto":"none"}; `,m=i.Z.div` position: fixed; z-index: 300; background: #ffffff; visibility: ${e=>e.open?"visible":"hidden"}; max-height: calc(100vh - 100px); display: flex; flex-direction: column; .title { display: flex; align-items: center; justify-content: space-between; padding: 16px; ${e=>e.hasTitle?l.iv` border-bottom: 1px solid ${s.r.colors.neutral100}; `:null} } .close-button { margin-left: auto; } ${e=>generateStyleBasedOnPlacement(e.placement,e.open)} `,g=i.Z.div` min-height: 200px; padding: 16px; overflow-y: auto; `,v=i.Z.div` position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; overflow-x: hidden; overflow-y: auto; outline: 0; background-color: rgba(38, 38, 38, 0.3); z-index: 1; &[data-open='false'] { visibility: hidden; pointer-events: none; } &[data-open='true'] { visibility: visible; pointer-events: auto; } `,Backdrop=({open:e=!1,onClickOutside:t})=>o.createElement(v,{"data-open":e,onClick:t}),Drawer=({children:e,title:t,onClose:a,open:l=!1,placement:i="left",destroyOnClose:s=!1,isPropagationEvent:d=!0,className:u})=>{let v=(0,o.useRef)();(0,o.useEffect)(()=>((0,r.t)(l),()=>(0,r.t)(!1)),[l]);let onCloseDrawer=()=>{v.current.classList.add("slideOut"),setTimeout(()=>{a()},800)};return!l&&s?null:o.createElement(n.h,null,o.createElement(p,{className:u,open:l},o.createElement(Backdrop,{open:l,onClickOutside:onCloseDrawer}),o.createElement(m,{open:l,placement:i,ref:v,hasTitle:!!t},o.createElement("div",{className:"title"},t&&o.createElement(c.T,{size:"s2",weight:"semiBold"},t),o.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",className:"close-button",onClick:onCloseDrawer},o.createElement("path",{d:"M5.99007 4.99067C5.79114 4.99072 5.59674 5.0501 5.43173 5.16121C5.26672 5.27233 5.1386 5.43013 5.06374 5.61444C4.98889 5.79875 4.9707 6.0012 5.0115 6.1959C5.05231 6.39061 5.15025 6.56872 5.29281 6.70747L10.5858 12.0004L5.29281 17.2934C5.19684 17.3855 5.12021 17.4959 5.06743 17.618C5.01464 17.7402 4.98676 17.8716 4.9854 18.0046C4.98405 18.1377 5.00926 18.2697 5.05954 18.3928C5.10983 18.516 5.1842 18.6279 5.27827 18.722C5.37235 18.8161 5.48426 18.8904 5.60743 18.9407C5.73061 18.991 5.86259 19.0162 5.99563 19.0149C6.12867 19.0135 6.2601 18.9856 6.38223 18.9328C6.50436 18.8801 6.61473 18.8034 6.70687 18.7075L11.9998 13.4145L17.2928 18.7075C17.385 18.8034 17.4953 18.8801 17.6175 18.9328C17.7396 18.9856 17.871 19.0135 18.0041 19.0149C18.1371 19.0162 18.2691 18.991 18.3922 18.9407C18.5154 18.8904 18.6273 18.8161 18.7214 18.722C18.8155 18.6279 18.8899 18.516 18.9401 18.3928C18.9904 18.2697 19.0156 18.1377 19.0143 18.0047C19.0129 17.8716 18.985 17.7402 18.9323 17.618C18.8795 17.4959 18.8028 17.3855 18.7069 17.2934L13.4139 12.0004L18.7069 6.70747C18.8514 6.567 18.9501 6.38616 18.99 6.18864C19.03 5.99112 19.0093 5.78614 18.9308 5.60055C18.8523 5.41497 18.7195 5.25744 18.5499 5.14861C18.3803 5.03978 18.1817 4.98473 17.9803 4.99067C17.7205 4.99841 17.4739 5.10699 17.2928 5.2934L11.9998 10.5864L6.70687 5.2934C6.61368 5.19761 6.50224 5.12146 6.37912 5.06947C6.25601 5.01747 6.12372 4.99068 5.99007 4.99067Z",fill:"#595959"}))),o.createElement(g,{onClick:e=>{d&&e.stopPropagation()}},e&&(o.isValidElement(e)?e:"function"==typeof e?e({internalClose:onCloseDrawer}):null)))))}},"x/x+":function(e,t,a){a.d(t,{C:function(){return n}});var o=a("q1tI");let n=(0,o.forwardRef)(function(e,t){return o.createElement("circle",Object.assign({},e,{ref:t}),o.createElement("animate",{attributeName:"r",values:"4;8;4",dur:"2s",begin:"0s",repeatCount:"indefinite"}))})},Mh4R:function(e,t,a){a.d(t,{c:function(){return s}});var o=Object.prototype.toString,n=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,r=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,l=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,i=/^[\u0020-\u003A\u003D-\u007E]*$/;function startIndex(e,t,a){do{var o=e.charCodeAt(t);if(32!==o&&9!==o)return t}while(++ta;){var o=e.charCodeAt(--t);if(32!==o&&9!==o)return t+1}return a}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 a={},o=e.length;if(o<2)return a;var n=t&&t.decode||decode,r=0,l=0,i=0;do{if(-1===(l=e.indexOf("=",r)))break;if(-1===(i=e.indexOf(";",r)))i=o;else if(l>i){r=e.lastIndexOf(";",l-1)+1;continue}var s=startIndex(e,r,l),d=endIndex(e,l,s),c=e.slice(s,d);if(!a.hasOwnProperty(c)){var u=startIndex(e,l+1,i),p=endIndex(e,i,u);34===e.charCodeAt(u)&&34===e.charCodeAt(p-1)&&(u++,p--);var m=e.slice(u,p);a[c]=function(e,t){try{return t(e)}catch(t){return e}}(m,n)}r=i+1}while(r *:first-child, */ > mention:first-child ~ * { &:not(ul), &:not(ol) { display: inline-block; } } > mention:first-child { margin-right: 5px; } &.has-see-more { *:last-child { &:not(ul), &:not(ol) { display: inline; } } } img { width: 100%; height: unset; } ul, ol { list-style-position: inside; padding-left: 1rem; display: block; } ol { list-style-type: decimal; } ul { list-style-type: disc; } mention { color: ${e=>e.mentionColor||"#1890ff"}; padding-right: 4px; :hover { text-decoration: underline; } } .markdown { white-space: normal; p, ul, ol { margin-top: 1em; &:first-child { margin-top: 0; } } li { margin-top: 0.5em; &:first-child { margin-top: 0; } } } } `,M=L.Z.span` overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: ${e=>e.line||1}; display: -webkit-box; -webkit-box-orient: vertical; &.post-content-show-all { display: block; } `,R=L.Z.span` padding-left: 2px; background-color: ${P.r.colors.white}; bottom: 8px; position: absolute; right: 0; z-index: 10; cursor: pointer; `;var B=(0,b.k)(e=>({root:{mention:{color:e.fn.primaryColor()},a:{"&,&:visited,&:focus":{color:e.fn.primaryColor()}},".create-post-link":{display:"inline",color:e.fn.primaryColor(),cursor:"pointer"}}}));let PostContent=e=>{var{trackingCategory:t,url:a,className:o,style:n,replyingTo:r,mentionedUser:l,description:d,disableShortenContent:c,mentions:u=[],maxChars:p=1e3,maxLines:m,hideShowAllBtn:g,styles:h,onClickCreatePostLink:b}=e,x=(0,i._)(e,["trackingCategory","url","className","style","replyingTo","mentionedUser","description","disableShortenContent","mentions","maxChars","maxLines","hideShowAllBtn","styles","onClickCreatePostLink"]);let{classes:y,theme:w}=B(void 0,{name:"PostContent",styles:h}),[E,C]=(0,s.useState)(!1),[S,P]=(0,s.useState)(!1),{t:$}=(0,N.u)(),{authActionWrapper:T}=(0,A.iV)(),[I,O]=(0,s.useState)(!1),j=(0,_.d)((0,_.b)(d||"","display"),u),{action:{sanitizeFunction:L}}=(0,s.useContext)(v.T),D=(0,s.useMemo)(()=>{let e=L(j||"");if(c||E)return{showContent:e,hasSeeMore:!1};let t=e.slice(0,p),a=p-((t.match(/<\/div>/g)||[]).length-1)*27,o=(t||"").slice(0,a<40?40:a),n=L(o.replace(/(<|<\/)( +|[a-zA-Z]*)$/gi,"")),r=n.lengths.createElement(s.Fragment,null,"... ",!g&&s.createElement(f.e,Object.assign({onClick:e=>{e.preventDefault(),e.stopPropagation(),T(()=>C(!0))},className:"see-more-text"},t?{"data-event-category":t,"data-event-action":"See More Post Click","data-event-label":a}:{}),$("post.seeMore"))),[g,a,t]),handleCreatePostClick=e=>{e.preventDefault(),null==b||b()},isEllipsisActive=e=>e.scrollHeight>e.clientHeight;return(0,s.useEffect)(()=>{var e;return null===(e=null==G?void 0:G.current)||void 0===e||e.querySelectorAll("[data-create-post]").forEach(e=>{e.addEventListener("click",handleCreatePostClick,{passive:!0})}),()=>{var e;null===(e=null==G?void 0:G.current)||void 0===e||e.querySelectorAll("[data-create-post]").forEach(e=>{e.removeEventListener("click",handleCreatePostClick,!1)})}},[c,E,j]),(0,s.useEffect)(()=>{V.current&&j&&m&&(isEllipsisActive(V.current)?P(!0):P(!1))},[j,m]),s.createElement(s.Fragment,null,F&&s.createElement(k.P,{isOpen:I,onClose:()=>O(!1),expertId:String(null==l?void 0:l.partnerId)}),s.createElement(z,Object.assign({ref:G,className:`${y.root} ${o} no-replace-click`,style:n,mentionColor:w.fn.primaryColor()},x),Z&&s.createElement(f.e,{onClick:()=>F&&O(!0),className:"post-content-replying"},"@",Z),(null==d?void 0:d.startsWith("[mention+id="))&&s.createElement("span",{className:"post-content-replying tag-only",style:{color:w.fn.primaryColor()}},"@"),m?s.createElement(s.Fragment,null,s.createElement(M,{dangerouslySetInnerHTML:{__html:j},className:`post-content-line ${E?"post-content-show-all":""}`,line:m,ref:V}),S&&!E&&s.createElement(R,null,U())):s.createElement(s.Fragment,null,s.createElement("span",{dangerouslySetInnerHTML:{__html:D.showContent},className:`post-content ${D.hasSeeMore?"has-see-more":""}`}),D.hasSeeMore&&!E&&s.createElement("span",null,U()))))},CategoryText=({children:e,className:t=""})=>s.createElement("div",{className:`l5fL1xL ${t}`},e),Title=({children:e,className:t=""})=>s.createElement("div",{className:`L-aGKo7 ${t}`},e),Thumbnail=({src:e,defaultSrc:t=E.C.getAssetPath("logo/logomark.png"),ratio:a=1,size:o=80,radius:n=8,alt:r,className:l=""})=>s.createElement("div",{className:l},s.createElement("div",{className:"DZmf3s7",style:{width:`${o}px`,height:`${o*a}px`,borderRadius:`${n}px`}},s.createElement(C.I,{src:e,backupSrc:t,alt:r}))),CardArticle=({category:e,title:t,src:a,children:o,className:n=""})=>s.createElement("div",{className:`eaR8ATZ ${n}`},s.createElement(Thumbnail,{src:a}),s.createElement("div",{className:"xM-7K0a"},o||s.createElement("div",null,e&&s.createElement(CategoryText,null,e),t&&s.createElement(Title,null,t))));CardArticle.CategoryText=CategoryText,CardArticle.Title=Title;let ArticleCard=({featureImage:e,postTitle:t,author:a,categories:o,isReview:n,className:r=""})=>{var l;return s.createElement(CardArticle,{src:e,className:r},s.createElement(s.Fragment,null,s.createElement(CardArticle.CategoryText,null,null===(l=null==o?void 0:o[0])||void 0===l?void 0:l.name),s.createElement(CardArticle.Title,null,t),s.createElement(k.d,{avatarProps:Object.assign(Object.assign({},a),{size:32}),subTitle:s.createElement(s.Fragment,null,n?"Medically reviewed by Jobelle Ann Dela Cruz Bigalbal, MD":"Written by Jobelle Ann Dela Cruz Bigalbal, MD",s.createElement(k.d.SubDivider,null),"Dec 12, 2022")})))};var Z={container:"SFSgnOz",header:"Tf3aoVa",heading:"TOt4QXl",headingIcon:"_5XYN1KT",accBodyGroup:"yE-tZRj",accBodyGroupItem:"LXiGuGT",accBodyGroupDesc:"r4rx-6v",subTitle:"XrHh8-C",subIcon:"c5-Yecd",group:"UBj6nWr",groupBody:"_2vptVBd",articleCardLink:"ZPDAwiR",relatedList:"_6wJn-NR",socialItem:"_21XDdFv",mbChevronWrapper:"LSyr3Zo"};let F=(0,s.createContext)({}),About=({className:e=""})=>{var t,a,o,n,r;let{t:l}=(0,N.u)(),{info:i,isMarryBaby:d,currentPageUrl:c}=(0,s.useContext)(F),u=null==i?void 0:i.data,p=[{type:S.S.LinkedIn,icon:E.C.getAssetPath("linkedin.svg"),url:null===(t=null==i?void 0:i.contact)||void 0===t?void 0:t.linkedin,eventAction:"Doctor Profile - Linkedin"},{type:S.S.Instagram,icon:E.C.getAssetPath("instagram.svg"),url:null===(a=null==i?void 0:i.contact)||void 0===a?void 0:a.instagram,eventAction:"Doctor Profile - Instagram"},{type:S.S.Facebook,icon:E.C.getAssetPath("facebook.svg"),url:null===(o=null==i?void 0:i.contact)||void 0===o?void 0:o.facebook,eventAction:"Doctor Profile - Facebook"},{type:S.S.Youtube,icon:E.C.getAssetPath("youtube.svg"),url:null===(n=null==i?void 0:i.contact)||void 0===n?void 0:n.youtube,eventAction:"Doctor Profile - Youtube"},{type:S.S.Tiktok,icon:E.C.getAssetPath("tiktok.svg"),url:null===(r=null==i?void 0:i.contact)||void 0===r?void 0:r.tiktok,eventAction:"Doctor Profile - TikTok"}],m=[...((null==i?void 0:i.experiences)||[]).length>0?[{key:"experience",heading:l("profilePanel.experience"),iconSrc:E.C.getAssetPath(d?"award-doc-mb.svg":"award-doc.svg"),eventAction:"Doctor Experience Click",panel:s.createElement("div",{className:Z.accBodyGroup},null==i?void 0:i.experiences.map((e,t)=>s.createElement("div",{className:Z.accBodyGroupItem,key:String(t)},s.createElement("div",{className:Z.accBodyGroupTitle},e.title),s.createElement("div",{className:Z.accBodyGroupDesc},s.createElement("p",null,e.organization),s.createElement("p",null,e.duration)))))}]:[],...((null==i?void 0:i.educations)||[]).length>0?[{key:"education",heading:l("profilePanel.education"),iconSrc:E.C.getAssetPath(d?"book-mb.svg":"book.svg"),eventAction:"Doctor Degree Click",panel:s.createElement("div",{className:Z.accBodyGroup},null==i?void 0:i.educations.map((e,t)=>s.createElement("div",{className:Z.accBodyGroupItem,key:String(t)},s.createElement("div",{className:Z.accBodyGroupTitle},e.schoolName),s.createElement("div",{className:Z.accBodyGroupDesc},s.createElement("p",null,e.study),s.createElement("p",null,e.completedYear)))))}]:[],...((null==i?void 0:i.awards)||[]).length>0?[{key:"awards",heading:l("profilePanel.awards"),iconSrc:E.C.getAssetPath(d?"award-mb.svg":"award.svg"),eventAction:"Doctor Award Click",panel:s.createElement("div",{className:Z.accBodyGroup},null==i?void 0:i.awards.map((e,t)=>s.createElement("div",{className:Z.accBodyGroupTitle,key:t},e.title)))}]:[]],g=(null==i?void 0:i.relatedPosts)||[],v=p.filter(e=>e.url);return s.createElement("div",{className:`${Z.container} ${e}`,"data-is-marrybaby":d},m.length>0&&s.createElement(x.U,{defaultValue:m[0].key,chevron:d?s.createElement("div",{className:Z.mbChevronWrapper},s.createElement(h.Z,{size:12,color:P.r.mbColors.midGray})):s.createElement(h.Z,{color:P.r.colors.gray400}),styles:{chevron:{"&[data-rotate]":{".minus-path":{display:"block"},".plus-path":{display:"none"}}},content:{display:"flex",flexDirection:"column",gap:"16px",padding:"0"},item:{border:0},control:{paddingLeft:0,"&:hover":{background:"transparent"},"*":{pointerEvents:"none"}}}},m.map(e=>s.createElement(x.U.Item,{key:e.key,value:e.key},s.createElement(x.U.Control,{"data-event-category":"Together","data-event-action":e.eventAction,"data-event-label":c},s.createElement("div",{className:Z.header},s.createElement("div",{className:Z.headingIcon},s.createElement("img",{src:e.iconSrc,loading:"lazy"})),s.createElement("div",{className:Z.heading},e.heading))),s.createElement(x.U.Panel,null,e.panel)))),g.length>0&&s.createElement("div",{className:Z.group},s.createElement("div",{className:Z.subTitle},s.createElement("img",{className:Z.subIcon,src:E.C.getAssetPath(d?"mb-logo.svg":"logo/circle-solid.svg"),loading:"lazy"}),l("profilePanel.publishedArticles")),s.createElement("div",{className:`${Z.relatedList}`},null==i?void 0:i.relatedPosts.map(e=>s.createElement("a",{key:String(e.id),href:`${window.location.origin}${null==e?void 0:e.permalink}`,className:Z.articleCardLink},s.createElement(ArticleCard,Object.assign({className:"article-card"},Object.assign(Object.assign({},e),!e.author&&{author:{displayName:null==u?void 0:u.name,avatar:null==u?void 0:u.avatar}}),{isReview:!0})))))),v.length>0&&s.createElement("div",{className:Z.group},s.createElement("div",{className:Z.subTitle},s.createElement("img",{className:Z.subIcon,src:E.C.getAssetPath(d?"social-mb.svg":"social.svg"),loading:"lazy"}),l("profilePanel.socialLinks")),s.createElement("div",{className:Z.groupBody},s.createElement(y.k,null,p.map((e,t)=>e.url&&s.createElement("div",{className:Z.socialItem,key:t},s.createElement("a",{href:e.url,target:"_blank",rel:"noreferrer"},s.createElement("img",{src:e.icon,loading:"lazy",width:"32px","data-event-category":"Together","data-event-action":e.eventAction,"data-event-label":c}))))))))};var G={container:"GYUElSy",question:"_3C6QpT1",questionTitle:"_9M9VYL6",community:"_1RuSyv3",questionCard:"_1IG-eEp"};let PostCard$1=({post:e,className:t=""})=>{var a,o,n,r,l,i,d,c;let{t:u}=(0,N.u)(),{data:{userInfo:p,env:{togetherBasePath:m}}}=(0,s.useContext)(v.T),{authActionWrapper:g,authorProps:h,currentPageUrl:b}=(0,s.useContext)(F),f=`${window.location.origin}${m}/${null===(a=null==e?void 0:e.community)||void 0===a?void 0:a.slug}/${null==e?void 0:e.slug}/`;return s.createElement("div",{className:`${G.container} ${t}`},s.createElement("div",{className:G.header},s.createElement("div",{className:G.question},u("profilePanel.question")," ",s.createElement(I.b,{className:G.questionTitle,href:"#",onClick:()=>{(null==p?void 0:p.id)||null==g||g(()=>window.location.href=f,{_location:f})}},"#",null==e?void 0:e.title)),s.createElement("div",{className:G.community},null===(o=null==e?void 0:e.community)||void 0===o?void 0:o.name," - ",null==e?void 0:e.createdTime)),s.createElement("div",{className:G.questionCard},s.createElement(k.C,Object.assign({className:"card-author"},h,{role:"user",avatarIcon:s.createElement($.Z,null),subLine:s.createElement(k.C.SubTextRow,null,s.createElement(k.C.SubText,null,null===(l=null===(r=null===(n=null==e?void 0:e.expertAnswer)||void 0===n?void 0:n.answer)||void 0===r?void 0:r[0])||void 0===l?void 0:l.createdTime))})),s.createElement(PostContent,{className:"post-content-wrapper",description:(null===(c=null===(d=null===(i=null==e?void 0:e.expertAnswer)||void 0===i?void 0:i.answer)||void 0===d?void 0:d[0])||void 0===c?void 0:c.content)||"",mentions:null==e?void 0:e.mentions,"data-testid":"Content of the Post"})),s.createElement(j.B,{variant:"secondary","data-event-category":"Together","data-event-action":"Doctor Reply Click","data-event-label":b,size:"md",onClick:()=>{(null==p?void 0:p.id)?window.location.href=f:null==g||g(()=>window.location.href=f,{_location:f})}},u("profilePanel.anserwing.viewFull")))};var V={container:"_8fd7YMs",thumb:"DomiQfw",content:"-b2qnfL"};let EmptyMessage=({message:e,buttonTxt:t,imgSrc:a,onBtnClick:o})=>{let{siteType:n,isMarryBaby:r}=(0,s.useContext)(F);return s.createElement("div",{className:V.container},s.createElement("div",{className:V.thumb},s.createElement("img",{src:a||E.C.getAssetPath(r?"comments-mb.svg":"comments.svg"),loading:"lazy"})),e&&s.createElement("div",{className:V.content},e),t&&s.createElement(D.B,{size:"md",theme:n,color:"secondary",onClick:o},t))},Answering=({id:e})=>{let{t}=(0,N.u)(),{data:{locale:a}}=(0,s.useContext)(v.T),{authorProps:o}=(0,s.useContext)(F),[n,r]=(0,s.useState)(null),[l,d]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{e&&(0,i.a)(void 0,void 0,void 0,function*(){var t;d(!0);let o=yield(0,v.c)((0,v.e)(g.yy.USER.LIST_ANSWERS,{_locale:a,id:e}),"GET"),n=((null===(t=null==o?void 0:o.data)||void 0===t?void 0:t.replies)||[]).map(m.a);r(n),d(!1)})},[]),s.createElement("div",{className:"MrdoES3"},l?s.createElement(p.L,null):null!==n&&(n.length>0?n.map(e=>s.createElement(PostCard$1,{className:"post-card",key:e.id,post:e})):s.createElement(EmptyMessage,{message:t("profilePanel.emptyPostMess.content",{name:(null==o?void 0:o.name)||(null==o?void 0:o.username)})})))},QuestionCard=e=>{var t,a,o,n,{post:r}=e,l=(0,i._)(e,["post"]);let{data:{env:{togetherBasePath:d}}}=(0,s.useContext)(v.T);return s.createElement(s.Fragment,null,s.createElement("div",Object.assign({},l,{className:`toEutn7 ${(null==l?void 0:l.className)||""}`}),s.createElement(k.C,{className:"card-author",avatar:null===(t=null==r?void 0:r.author)||void 0===t?void 0:t.avatar,name:(null===(a=null==r?void 0:r.author)||void 0===a?void 0:a.name)||(null===(o=null==r?void 0:r.author)||void 0===o?void 0:o.username),isAnonymous:!!(null==r?void 0:r.isAnonymous),subLine:s.createElement(k.C.SubTextRow,null,s.createElement(k.C.SubText,null,null==r?void 0:r.createdTime))}),s.createElement(I.b,{href:`${window.location.origin}${d}/${null===(n=null==r?void 0:r.community)||void 0===n?void 0:n.slug}/${null==r?void 0:r.slug}/`,className:"drdisHs",rel:"noreferrer"},null==r?void 0:r.title)))};var U={accordion:"I-uIJ6E",header:"_41WRsj2",heading:"AcOGL93",headingIcon:"JD3dWJN",chevron:"L2Q9T6m",container:"h-pSmhX"};let Care=()=>{var e,t;let{t:a}=(0,N.u)(),{data:{locale:o,userInfo:n}}=(0,s.useContext)(v.T),{onSkipQuestion:r,countValues:l,setCountValues:d}=(0,s.useContext)(F),[c,u]=(0,s.useState)(),[h,b]=(0,s.useState)([]),[f,y]=(0,s.useState)(!1),w=null==n?void 0:n.id;(0,s.useEffect)(()=>{w&&(0,i.a)(void 0,void 0,void 0,function*(){var e;y(!0);let t=yield(0,v.b)((0,v.e)(g.yy.USER.LIST_QUESTION_NEED_REPLY,{_locale:o}),"GET"),a=[],n=Object.create({});((null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.communities)||[]).filter(e=>((null==e?void 0:e.question)||[]).length>0).map(e=>{n[e.id]=e.question.map(m.a),delete e.question,a.push((0,m.f)(e))}),b(a),u(n),y(!1)})},[]);let handleSkipQuestion=({id:e,communityId:t})=>{if(e&&t&&c){let a=Object.assign(Object.assign({},c),{[t]:[...((null==c?void 0:c[t])||[]).filter(t=>t.id!==e)]}),o=0;Object.keys(a).map(e=>o+=a[e].length||0),u(a),d(Object.assign(Object.assign({},l),{total_question:o})),null==r||r(o)}};return s.createElement("div",{className:U.container},f?s.createElement(p.L,null):(null==l?void 0:l.total_question)>0?h.length>0&&s.createElement(x.U,{className:U.accordion,defaultValue:String((null===(t=h[null===(e=Object.keys(h))||void 0===e?void 0:e[0]])||void 0===t?void 0:t.id)||""),styles:e=>({control:{padding:"16px",border:`1px solid ${e.colors.neutral[1]}`,borderTopLeftRadius:"8px",borderTopRightRadius:"8px",'&[aria-expanded="false"]':{borderBottom:0}},chevron:{width:"32px",height:"32px"},content:{padding:0,border:`1px solid ${e.colors.neutral[1]}`,borderTop:0,borderBottom:0},label:{padding:0},item:{marginBottom:"16px"}}),chevron:s.createElement("div",{className:U.chevron},s.createElement(T.Z,{color:P.r.colors.gray600,size:20}))},h.map(e=>{let t=c&&(null==c?void 0:c[e.id])||[];return t.length>0&&s.createElement(x.U.Item,{key:e.id,value:String(e.id)},s.createElement(x.U.Control,null,s.createElement("div",{className:U.header},s.createElement("div",{className:U.headingIcon},s.createElement("img",{src:e.thumbnail,loading:"lazy"})),s.createElement("div",{className:U.heading},e.name))),s.createElement(x.U.Panel,null,s.createElement("div",{className:U.body},t.map(e=>s.createElement(QuestionCard,{className:"question-card",key:e.id,post:e,onSkip:handleSkipQuestion})))))})):s.createElement(EmptyMessage,{message:a("profilePanel.emptyCareMess.content"),imgSrc:E.C.getAssetPath("questions.svg")}))},PostCard=({post:e,className:t=""})=>{var a;let{data:{userInfo:o,env:{togetherBasePath:n}}}=(0,s.useContext)(v.T),{t:r}=(0,N.u)(),l=(0,w.rZ)(),{authActionWrapper:i,authorProps:d}=(0,s.useContext)(F),c=`${window.location.origin}${n}/${null===(a=null==e?void 0:e.community)||void 0===a?void 0:a.slug}/${null==e?void 0:e.slug}/`;return s.createElement("div",{className:`GA-zc-O ${t}`},s.createElement("div",{className:"IB049vj"},s.createElement("a",{"data-event-category":"Together","data-event-action":"Click Post","data-event-label":c,className:"_8I--vEV",href:c,onClick:e=>{(null==o?void 0:o.id)||(e.preventDefault(),null==i||i(()=>window.location.href=c,{_location:c}))}}),s.createElement(k.d,{className:"card-author",avatarProps:{avatar:null==d?void 0:d.avatar,size:32}},s.createElement(k.C.MainText,{className:"A18McWD"},null==e?void 0:e.title),s.createElement(k.C.SubTextRow,null,s.createElement(k.C.SubText,null,null==e?void 0:e.createdTime))),s.createElement(PostContent,{className:"post-content-wrapper",description:null==e?void 0:e.description,mentions:null==e?void 0:e.mentions,maxChars:200,"data-testid":"Content of the Post",hideShowAllBtn:!0}),s.createElement(O.T,{size:"p3",color:l.fn.primaryColor()},r("post.seeMore"))))},Posts=()=>{let{t:e}=(0,N.u)(),{data:{locale:t}}=(0,s.useContext)(v.T),{authorId:a,authorProps:o,isAuthorLogin:n,onCloseFromPost:r}=(0,s.useContext)(F),[l,d]=(0,s.useState)(null),[c,u]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{a&&(0,i.a)(void 0,void 0,void 0,function*(){var e;u(!0);let o=yield(0,v.c)((0,v.e)(g.yy.USER.LIST_POST,{_locale:t,id:a,isAnonymous:0}),"GET"),n=((null===(e=null==o?void 0:o.data)||void 0===e?void 0:e.posts)||[]).map(m.a);d(n),u(!1)})},[a]),s.createElement("div",{className:"TSMHoEM"},c?s.createElement(p.L,null):null!==l&&(l.length>0?l.map(e=>s.createElement(PostCard,{className:"post-card",key:e.id,post:e})):s.createElement(EmptyMessage,{message:e("profilePanel.emptyPostMess.content",{name:(null==o?void 0:o.name)||(null==o?void 0:o.username)||""}),buttonTxt:n&&e("profilePanel.createPost"),onBtnClick:()=>{null==r||r()}})))};var H={container:"_4Vekw96",info:"DIJdGcB",body:"aQSt4-Q"};let formatExperience=e=>e?{title:null==e?void 0:e.title,organization:null==e?void 0:e.organization,duration:e.duration}:{},formatEducation=e=>e?{completedYear:null==e?void 0:e.completed_year,schoolName:e.school_name,study:e.study}:{};(o=r||(r={}))[o.About=0]="About",o[o.Care=1]="Care",o[o.Answer=2]="Answer",o[o.Posts=3]="Posts",(n=l||(l={}))[n.Expert=0]="Expert",n[n.User=1]="User";let q={experiences:[],relatedPosts:[],educations:[],awards:[],contact:{},data:{}},ProfileDetail=e=>{var t,{authorProps:a,selectedTab:o,authActionWrapper:n,onSkipQuestion:l,onCloseFromPost:d,hideQuestionTab:h,hideAnswerTab:b,showSkipQuestionTag:f,rolesToShowQuestionsTab:x=["expert"],currentPageUrl:y}=e,w=(0,i._)(e,["authorProps","selectedTab","authActionWrapper","onSkipQuestion","onCloseFromPost","hideQuestionTab","hideAnswerTab","showSkipQuestionTag","rolesToShowQuestionsTab","currentPageUrl"]);let{data:{locale:E,userInfo:C,env:{isMarryBaby:S}}}=(0,s.useContext)(v.T),{t:P}=(0,N.u)(),$=null==a?void 0:a.role,T=null==C?void 0:C.role,I=String(null==a?void 0:a.userId),[O,j]=(0,s.useState)(),[L,A]=(0,s.useState)(!1),[_,D]=(0,s.useState)(),z=(null==C?void 0:C._togetherUserId)===(null==a?void 0:a.userId),M=[...-1!==x.indexOf($)?[{value:r.About,text:P("profilePanel.tabs.highlight"),content:s.createElement(About,{id:I,info:_}),dataEventCategory:"Together",dataEventAction:"Doctor Profile Click",dataEventLabel:y}]:[],{value:r.Posts,text:P("profilePanel.tabs.posts"),content:s.createElement(Posts,null),hasCountResult:!0,keyOfCountApi:"post",keyOfResult:"total_post"},...h||-1===x.indexOf(T)||(null==C?void 0:C._togetherUserId)!==(null==a?void 0:a.userId)?[]:[{value:r.Care,text:`${P("profilePanel.tabs.care")}`,content:s.createElement(Care,null),hasCountResult:!0,keyOfCountApi:"question",keyOfResult:"total_question",dataEventCategory:"Together",dataEventAction:"Doctor Questions Click",dataEventLabel:y}],...b||-1===x.indexOf($)?[]:[{value:r.Answer,text:`${P("profilePanel.tabs.expertAnswer")}`,content:s.createElement(Answering,{id:I}),hasCountResult:!0,keyOfCountApi:"reply",keyOfResult:"total_reply",dataEventCategory:"Together",dataEventAction:"Doctor Reply Tab Click",dataEventLabel:y}]],[R,B]=(0,s.useState)(null),[Z,G]=(0,s.useState)(null),V={value:String(Z),dataList:R,onTabChange:e=>G(Number(e))},U=null==M?void 0:M.filter(e=>null==e?void 0:e.hasCountResult);(0,s.useEffect)(()=>{(0,i.a)(void 0,void 0,void 0,function*(){var e,t,a,n,l,i,s,d,c,u;A(!0);let p=yield Promise.all([(0,v.c)((0,v.e)(g.yy.USER.DETAIL,{_locale:E,id:I}),"GET"),...U.map(e=>(0,v.c)((0,v.e)(g.yy.USER.COUNT_TABS,{_locale:E,id:I,[e.keyOfCountApi]:1}),"GET"))]),[h]=p,b={data:null==h?void 0:h.data,experiences:((null===(t=null===(e=null==h?void 0:h.data)||void 0===e?void 0:e.fields)||void 0===t?void 0:t.experiences)||[]).map(formatExperience),relatedPosts:((null===(a=null==h?void 0:h.data)||void 0===a?void 0:a.related_post)||[]).map(e=>(0,m.g)(e.post)),educations:((null===(l=null===(n=null==h?void 0:h.data)||void 0===n?void 0:n.fields)||void 0===l?void 0:l.educations)||[]).map(formatEducation),awards:(null===(s=null===(i=null==h?void 0:h.data)||void 0===i?void 0:i.fields)||void 0===s?void 0:s.awards_accreditations)||[],contact:(null===(c=null===(d=null==h?void 0:h.data)||void 0===d?void 0:d.fields)||void 0===c?void 0:c.contact)||{}};(null==h?void 0:h.status)===1&&D(b);let f=(null==b?void 0:b.relatedPosts)||[],x=Object.keys(b.contact).map(e=>{var t;return(null===(t=null==b?void 0:b.contact)||void 0===t?void 0:t[e])!==""}),y=[...(null==b?void 0:b.experiences)||[],...(null==b?void 0:b.educations)||[],...(null==b?void 0:b.awards)||[]],w=f.length>0||x.length>0||y.length>0,C={},k=U.map((e,t)=>{var a,o,n;let l=(null===(n=null===(o=null===(a=p[t+1])||void 0===a?void 0:a.data)||void 0===o?void 0:o.counting)||void 0===n?void 0:n[e.keyOfResult])||0;return l>0?(C[e.keyOfResult]=l,e):-1!==[r.Care,r.Posts].indexOf(e.value)?e:void 0}).filter(Boolean).map(e=>e.value),S=M.map(e=>{let t=Object.assign(Object.assign({},e),{text:e.text+(e.keyOfResult?` (${(null==C?void 0:C[e.keyOfResult])||"0"})`:"")});return t.hasCountResult?-1!==k.indexOf(t.value)?t:void 0:t.value===r.About?w&&t:t}).filter(Boolean);B(S),G(o||(null===(u=null==S?void 0:S[0])||void 0===u?void 0:u.value)),j(C),A(!1)})},[]);let q=null==_?void 0:_.data;return s.createElement(F.Provider,{value:{isMarryBaby:S,siteType:S?"marryBaby":"helloSites",authorId:String((null==a?void 0:a.userId)||""),authActionWrapper:n,onSkipQuestion:l,info:_,authorProps:a,onCloseFromPost:d,countValues:O,setCountValues:j,isAuthorLogin:z,showSkipQuestionTag:f,currentPageUrl:y}},s.createElement("div",Object.assign({},w,{className:`${H.container} ${(null==w?void 0:w.className)||""}`,"data-is-marrybaby":S}),L?s.createElement(p.L,null):s.createElement(s.Fragment,null,s.createElement(k.C,Object.assign({},a,{className:"card-author",showDetailPopup:!1,subLine:(null==a?void 0:a.role)==="expert"?(null==q?void 0:q.specialty)&&(null==q?void 0:q.organisation)&&s.createElement(k.C.SubTextRow,null,(null==q?void 0:q.specialty)&&s.createElement(s.Fragment,null,s.createElement(k.C.SubText,null,null==q?void 0:q.specialty),s.createElement(k.C.SubDivider,null)),s.createElement(k.C.SubText,null,null==q?void 0:q.organisation)):(null==q?void 0:q.created_at)&&s.createElement(k.C.SubTextRow,null,s.createElement(k.C.SubText,null,P("profilePanel.joined")," ",c()(null==q?void 0:q.created_at).toNow(!0)))})),"expert"===$&&s.createElement("div",{className:H.info,dangerouslySetInnerHTML:{__html:null===(t=null==_?void 0:_.data)||void 0===t?void 0:t.description}}),null!==R&&null!==Z&&(R.length>0?s.createElement("div",{className:H.body},s.createElement(u.T,Object.assign({},V))):s.createElement(EmptyMessage,{message:P("profilePanel.emptyPostMess.content",{text:(null==a?void 0:a.name)||(null==a?void 0:a.username)||""})})))))}},hECX:function(e,t,a){a.d(t,{M:function(){return MantineProvider}});var o=a("NXpd"),n=a("q1tI"),r=a("8vDj"),l=a("aBaF"),i=a("+Hg+");let MantineProvider=e=>{var{children:t,locale:a,template:s="hb",isNotifications:d=!0,customStyleType:c=i.C.NONE}=e,u=(0,o._)(e,["children","locale","template","isNotifications","customStyleType"]);return(0,l.u)(a),n.createElement(r.Me,Object.assign({theme:(0,l.g)(a,s,c)},u),n.createElement(i.T,{variant:c},t,d&&n.createElement(l.N,null)))}},DiOG:function(e,t,a){a.d(t,{C:function(){return CardPost},S:function(){return SourceList},V:function(){return VerifiedTag},a:function(){return CardPostPopoverMore},b:function(){return CardReply},c:function(){return CardReplyPopover}});var o=a("NXpd"),n=a("q1tI"),r=a("CqtA"),l=a("w9lR"),i=a("lk1G"),s=a("ns0B"),d=a.n(s),c=a("aklU"),u=a("vCEM"),p=a("NnTf"),m=a("aZjv"),g=a("Xp6P"),v=a("x2zZ"),h=a("rBCA"),b=a("tKpg"),f=a("iBNF"),x=a("KF2R"),y=a("IQVP"),w=a("KAYV"),E=a("Di7p"),C=a("NepD"),k=a("+7ua"),S=a("y26R"),N=a("tzWM"),P=a("oTwY"),$=a("iZ8j"),T=a("e0pn"),I=a("LWwf"),O=a("PbOM"),j=a("bpvy"),L=a("jAVh"),A=a("VkaC"),_=a("1H8c"),D=a("S1NM"),z=a("xrdX"),M="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath fill='%233E3F58' d='M5 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M19 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2'/%3e%3c/svg%3e",R="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='3' height='13' fill='none'%3e%3ccircle cx='1.583' cy='6.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 6.417)'/%3e%3ccircle cx='1.583' cy='1.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 1.417)'/%3e%3ccircle cx='1.583' cy='11.417' r='1.25' fill='%23595959' transform='rotate(90 1.583 11.417)'/%3e%3c/svg%3e",B="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M2 4h12'/%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.334 1.334 0 0 1 1.334 1.334V4m2 0v9.333a1.334 1.334 0 0 1-1.334 1.334H4.667a1.334 1.334 0 0 1-1.334-1.334V4zM6.667 7.333v4M9.333 7.333v4'/%3e%3c/svg%3e";let CardPostPopoverMore=({authorEmail:e,onDeletePost:t,shareUrl:a,post:r,className:l="",popoverClassName:s="",onEditPost:d})=>{let{data:{locale:h,userInfo:b,env:{isMarryBaby:f}}}=(0,n.useContext)(g.T),{t:x}=(0,i.u)(),[y,w]=(0,n.useState)(!1),[E,C]=(0,n.useState)(!1),[k,S]=(0,n.useState)(!1),{authActionWrapper:N}=(0,m.iV)(),P=e&&(null==b?void 0:b.email)&&e===String(null==b?void 0:b.email);return n.createElement("div",{className:l,onClick:e=>{e.preventDefault(),e.stopPropagation()}},k&&n.createElement(c.S,{url:a,text:null==r?void 0:r.title,onClose:()=>S(!1)}),E&&n.createElement(c.P,{thumbnail:u.C.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:x("popup.deletePost.title"),description:x("popup.deletePost.description"),acceptText:x("popup.deletePost.accept"),cancelText:x("popup.deletePost.cancel"),onAccept:()=>(0,o.a)(void 0,void 0,void 0,function*(){if((null==r?void 0:r.id)&&!y){w(!0);try{let e=yield(0,c.h)({id:r.id,locale:h});(null==e?void 0:e.status)===1&&(null==t||t())}catch(e){}w(!1)}}),onClose:()=>C(!1)}),n.createElement(v.b,{className:s,toggleButtonContent:n.createElement("img",{src:f?M:R,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:y},data:P?{isShowheader:!1,type:"list",list:[{icon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M7.17 3.236H2.995a1.193 1.193 0 0 0-1.193 1.192v8.35a1.193 1.193 0 0 0 1.193 1.192h8.35a1.193 1.193 0 0 0 1.192-1.192V8.603'/%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M11.643 2.341a1.265 1.265 0 0 1 1.789 1.79L7.766 9.795l-2.385.596.596-2.385z'/%3e%3c/svg%3e",label:x("actionPopover.edit"),onClick:d},{icon:B,label:x("actionPopover.delete"),onClick:()=>{N(()=>C(!0))}}]}:{isShowheader:!1,type:"list",list:[{icon:c.i,label:x("morePopover.report"),subTree:{title:x("morePopover.report.title"),description:x("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(p.R).map(e=>({label:p.R[e].label,reason:p.R[e].reportReasonText,reasonValue:e})).map(e=>({label:x(e.label),subTree:{title:x("morePopover.reportSubmit.title"),description:x("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>n.createElement(c.b,{reason:e.reasonValue,reasonText:x(e.reason),postId:null==r?void 0:r.id,onClose:()=>t&&t(!1)})}}))}}]}}))},Z=h.Z.div` position: relative; margin-bottom: 24px; background: white; border-radius: ${f.r.borderRadius}; a { text-decoration: none; } ${b.M.mbDown} { margin-bottom: 8px; } &.flat-top { border-top-left-radius: 0; border-top-right-radius: 0; } .post-pin { padding: 0.5rem 1rem; border-radius: ${f.r.borderRadius} 6px 0 0; } .post-author { display: flex; align-items: center; justify-content: space-between; &.comment { padding-right: 2.6rem; } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.M.mbDown} { width: 32px; height: 32px; font-size: 16px; } } } .post-content-link-wrapper { color: inherit; cursor: pointer; .post-content-title { padding: 1rem 1rem 0; word-break: break-word; } } .social-preview-wrapper.has-image { margin-bottom: 5px; } .social-preview-wrapper, .image-preview-wrapper, .link-preview-wrapper { width: 100%; &[data-is-reply='true'] { padding-right: 1rem; padding-left: 1rem; } } .post-topics { padding: 0 1rem; } .post-reaction { background: none; border-radius: 0 0 6px 6px; &.hide-top-border { ::before { display: none; } } } .most-engaging-wrapper { padding: 1rem; cursor: pointer; .author-avatar-wrapper { width: 2rem; height: 2rem; font-size: 1rem; } .see-more-comments { width: 100%; padding: 12px 0 0; text-align: unset; } } &[data-most-engaging='true'] { border: none; ${b.M.mbDown} { margin: 1rem; border: 1px solid #e4e8ec; } } .top-divider { border-color: #e4e8ec; } .popover { .popover-menu__btn { display: flex; width: 1.5rem; height: 1rem; align-items: center; justify-content: center; padding: 0; background: transparent; &:hover { background-color: transparent; } } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 12.5px; } } } } } &[data-is-marrybaby='true'] { border: 1px solid #f3f3f3; border-radius: 1rem; /* shadow */ box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.08); .image-preview-wrapper, .link-preview-wrapper { padding-right: 1rem; padding-left: 1rem; } .popover { .popover-menu__btn { width: 24px; height: 24px; ${b.M.mbDown} { width: 18px; height: 18px; } } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 1rem; } width: 350px; ${b.M.mbDown} { max-width: calc(320px - 2rem); } } } } } .most-engaging-wrapper { position: relative; padding: 0; &::before { position: absolute; z-index: 5; top: 0; left: 50%; width: calc(100% - 2rem); height: 1px; background: #f3f3f3; content: ' '; transform: translateX(-50%); } } ${b.M.mbDown} { margin-bottom: 12px; } } `;var F="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e";let CardReplyPopover=({onDeleteComment:e,commentId:t,className:a="",popoverClassName:r=""})=>{let{data:{env:{isMarryBaby:l},locale:s},action:{pushNotifications:d}}=(0,n.useContext)(g.T),{t:u}=(0,i.u)(),[p,h]=(0,n.useState)(!1),{authActionWrapper:b}=(0,m.iV)();return n.createElement("div",{className:a,onClick:e=>{e.preventDefault(),e.stopPropagation()}},p&&n.createElement(c.P,{thumbnail:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cg stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' clip-path='url(%23a)'%3e%3cpath d='M2 4.008h12m-8.667 0V2.675a1.333 1.333 0 0 1 1.334-1.333h2.666a1.333 1.333 0 0 1 1.334 1.333v1.333m2 0v9.334a1.333 1.333 0 0 1-1.334 1.333H4.667a1.333 1.333 0 0 1-1.334-1.333V4.008zm-6 3.334v4m2.666-4v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='a'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:u("popup.deleteComment.title"),description:u("popup.deleteComment.description"),acceptText:u("popup.deletePost.accept"),cancelText:u("popup.deletePost.cancel"),onAccept:()=>(0,o.a)(void 0,void 0,void 0,function*(){var a;if(!t)return;let o=yield(0,c.j)({id:t,locale:s});(null==o?void 0:o.status)===1?(e&&e(),d({title:"",message:u("notification.success"),type:"success"})):d({title:"",message:(null===(a=null==o?void 0:o.messages)||void 0===a?void 0:a[0])||u("notification.failure"),type:"danger"})}),onClose:()=>h(!1)}),n.createElement(v.b,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:B,label:u("actionPopover.delete"),onClick:()=>{b(()=>{h(!0)})}}]},className:r,toggleButtonContent:n.createElement("img",{src:l?M:R,loading:"lazy"}),buttonProps:{}}))},G=h.Z.div` .add-link { color: ${f.r.colors.primaryBase}; } `,V=h.Z.div` margin: 16px 0; background: ${f.r.colors.yellow50}; padding: 5px 10px; border-radius: 2px; .icon { display: inline-block; vertical-align: middle; margin-right: 6px; } `,U=h.Z.div` display: flex; align-items: center; gap: 8px; `,H=h.Z.div` padding: 8px 16px; `,q=h.Z.div` margin-bottom: 12px; width: 100%; `,W=h.Z.div``,Y=h.Z.div` margin-bottom: 16px; `,Q=h.Z.div` display: flex; flex-wrap: wrap; row-gap: 16px; ${b.M.tdUp} { align-items: center; column-gap: 24px; } `,X=h.Z.a` display: flex; align-items: center; gap: 16px; ${b.M.mbDown} { width: 100%; justify-content: space-between; } `,K=h.Z.div` display: flex; align-items: center; gap: 16px; `,J=h.Z.div` border-radius: ${f.r.borderRadius}; overflow: hidden; width: 48px; height: 48px; img { object-fit: cover; width: 100%; height: 100%; } `,RecommentCategories=({categories:e})=>{let{t}=(0,i.u)(),{data:{locale:a,env:{isMarryBaby:o}}}=(0,n.useContext)(g.T),r=(0,D.g)(a,o);return n.createElement(W,null,n.createElement(Y,null,n.createElement(l.H,{tag:"h6",as:"h5"},t("cardReply.recommentCategories.heading"))),n.createElement(Q,null,e.map(e=>n.createElement(X,{href:r+e.permalink,key:String(e.termId),target:"_blank"},n.createElement(K,null,n.createElement(J,null,n.createElement("img",{src:e.featureImage||u.C.getAssetPath(o?"mb-logo.svg":"/logo/logomark.png"),alt:e.displayName,loading:"lazy"})),n.createElement(A.T,{size:"s3",weight:"bold"},e.displayName)),n.createElement($.Z,{size:20,color:f.r.colors.gray400})))))},ee=h.Z.a` padding: 12px 0; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid ${f.r.colors.neutral100}; text-decoration: none; &:first-child { border-top: 0; } `,SourceItem=({postTitle:e,articleReviewed:t,modifiedTime:a,href:o})=>{let{t:r}=(0,i.u)(),l=(()=>{let{expert:e,editor:a,is_author:o}=t;if(e){let t={name:e.display_name,role:"expert",avatar:e.avatar};return o?Object.assign({title:r("articleAuthor.title.written-by")},t):"expert"===e.role?Object.assign({title:r("articleAuthor.title.expert")},t):Object.assign({title:r("articleAuthor.title.medical")},t)}if(a)return{title:r("articleAuthor.title.fact-check"),name:a.display_name,avatar:a.avatar}})();return n.createElement(ee,{href:o,title:e,target:"_blank"},n.createElement(A.T,{size:"s3",as:"h5",weight:"bold"},e),n.createElement("div",null,n.createElement(E.C,{avatar:null==l?void 0:l.avatar,avatarProps:{size:32},name:null==l?void 0:l.name,role:null==l?void 0:l.role,hideBackground:!0},n.createElement(E.C.SubTextRow,null,n.createElement(E.C.SubText,null,null==l?void 0:l.title," ",n.createElement("span",{style:{color:f.r.colors.gray800}},null==l?void 0:l.name)),n.createElement(E.C.SubDivider,null),n.createElement(E.C.SubText,null,a)))))};var et={header:"F4mmgSy",chevron:"A7QrQ7A"};let SourceList=e=>{var{listUrl:t,hideSourceList:a,categorySlug:s,editMode:d,collapseSource:c,onListChange:p,isMarryBaby:m}=e,v=(0,o._)(e,["listUrl","hideSourceList","categorySlug","editMode","collapseSource","onListChange","isMarryBaby"]);let{t:h}=(0,i.u)(),[b,w]=(0,n.useState)(t||[]),[E,C]=(0,n.useState)([]),[k,S]=(0,n.useState)([]),[N,$]=(0,n.useState)(!1);(0,n.useEffect)(()=>{a||(0,o.a)(void 0,void 0,void 0,function*(){$(!0);let e=b.map(e=>{let t=new URL(e),a=String(t.pathname).split("/").filter(e=>""!=e),o=t.origin,n=-1!==o.search("marrybaby.vn");return{isMarrySite:n,path:a[a.length-1],href:e}}),t=[...e.map(e=>(0,g.c)(e.isMarrySite?(0,g.s)(y.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0):(0,g.o)(y.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0),"GET"))],a=yield Promise.all(t);C(a.map((t,a)=>{var o,n;return(null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.post)&&Object.assign(Object.assign({},(0,x.g)(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.post)),{href:e[a].href})}).filter(Boolean)),$(!1)})},[]),(0,n.useEffect)(()=>{!a&&(null==E?void 0:E.length)===0&&s&&(0,o.a)(void 0,void 0,void 0,function*(){var e;let t=yield(0,g.c)(m?(0,g.s)(y.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0):(0,g.o)(y.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0),"GET");(null==t?void 0:t.data)&&S([(0,x.h)(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.category)])})},[E]);let handleRemoveItem=e=>{w(t=>{let a=[...t];return a.splice(e,1),a}),C(t=>{let a=[...t];return a.splice(e,1),a})};return(0,n.useEffect)(()=>{null==p||p(b)},[b]),n.createElement("div",Object.assign({},v),!d&&n.createElement(V,null,n.createElement("img",{className:"icon",src:u.C.getAssetPath("warning.svg"),alt:"warning",style:{marginBottom:"3px",width:"18px"},loading:"lazy"}),n.createElement(A.T,{size:"s3",as:"span",dangerouslySetInnerHTML:{__html:h("cardReply.disclaimer")}})),a?null:N?n.createElement(_.L,null):E.length>0||d?n.createElement(G,null,n.createElement(j.U,{defaultValue:!c&&"accordion",styles:{control:{borderRadius:"inherit",'&[aria-expanded="false"]':{borderBottom:0}},chevron:{width:"32px",height:"32px"},content:{padding:0,borderBottom:0,borderTop:`1px solid ${f.r.colors.neutral100}`},item:{marginBottom:"16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",border:`1px solid ${f.r.colors.neutral100}`,borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px","&[data-active]":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},chevron:n.createElement("div",{className:et.chevron},n.createElement(T.Z,{color:f.r.colors.gray600,size:20}))},n.createElement(j.U.Item,{value:"accordion"},n.createElement(j.U.Control,null,n.createElement("div",{className:et.header},n.createElement(l.H,{as:"h4",tag:"h6"},h("cardReply.source")))),n.createElement(j.U.Panel,null,n.createElement(H,null,(E||[]).map((e,t)=>n.createElement(U,{key:String(t)},"object"==typeof e?n.createElement(SourceItem,Object.assign({},e)):n.createElement(q,null,n.createElement(L.I,{style:{width:"100%"},name:"source-list",value:e||"",size:"sm",onChange:e=>{w(a=>{let o=[...a];return o[t]=e,o}),C(a=>{let o=[...a];return o[t]=e,o})}})),d&&n.createElement(r.B,{size:"md",color:"transparent",icon:n.createElement(I.Z,null),onClick:()=>handleRemoveItem(t)}))),d&&n.createElement(r.B,{className:"add-link",color:"transparent",size:"md",icon:n.createElement(P.Z,{color:f.r.colors.primaryBase,size:18}),onClick:()=>{w(e=>[...e,""]),C(e=>[...e,""])}},"Add source")))))):n.createElement(RecommentCategories,{categories:k}))},ea=h.Z.div` position: relative; margin-bottom: 0; background: white; border-radius: ${f.r.borderRadius}; .verify-tag { margin-top: 12px; } .post-author { &.with-popover { padding-right: 2.6rem; } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.M.mbDown} { width: 32px; height: 32px; font-size: 16px; } } } .image-preview-wrapper, .link-preview-wrapper { width: 100%; &[data-is-reply='true'] { padding-right: 1rem; padding-left: 1rem; } } .post-reaction { background: none; border-radius: 0 0 6px 6px; } &[data-is-reply='true'] { > .post-author .author-avatar-wrapper { width: 20px; height: 20px; font-size: 10px; } } &[data-is-reply='false'] { border: 1px solid #e4e8ec; } .expert-wrapper { width: 100%; } &[data-has-booking='true'] { display: grid; .post-author { background-color: ${f.r.colors.primary50}; } .btn-wrapper { padding: 0 16px; .btn-booking { width: 100%; margin: 12px 0; } } } .comment-reply-wrapper { padding: 0 1rem; .more-cmt { .chevron-right { height: 1rem; width: 1rem; vertical-align: middle; } } } .top-divider { border-color: #e4e8ec; } .popover { position: absolute; top: 1.5rem; right: 1rem; .popover-menu__btn { display: flex; width: 1rem; height: 1rem; align-items: center; justify-content: center; padding: 0; background: transparent; &:hover { background-color: transparent; } .popover-menu__content { &.--position-bottom { &.--align-end { &::before { right: 12.5px; } } } } } } &[data-is-marrybaby='true'] { &[data-is-reply='false'] { border: none; } .image-preview-wrapper, .link-preview-wrapper { padding-right: 1rem; padding-left: 1rem; } .popover { .popover-menu__btn { width: 24px; height: 24px; } } margin-left: 56px; ${b.M.mbDown} { margin-left: 40px; } > .post-author { margin-left: -56px; ${b.M.mbDown} { margin-left: -40px; } .author-info { align-items: center; display: flex; align-items: center; .author-info-top { width: 100%; } .author-info-text-wrapper { justify-content: space-between; } } .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.M.mbDown} { width: 24px; height: 24px; font-size: 12px; } } } &[data-is-reply] { > .post-author { .author-avatar-wrapper { width: 40px; height: 40px; font-size: 20px; ${b.M.mbDown} { width: 24px; height: 24px; font-size: 12px; } } } } .comment-reply-wrapper { padding-right: 0; padding-left: 0; } .post-reaction { &::after { position: absolute; bottom: 0; left: 50%; width: calc(100% - 2rem); height: 1px; background: #f3f3f3; content: ' '; transform: translateX(-50%); } } .post-content-wrapper { padding-top: 0; padding-bottom: 0; ${b.M.mbDown} { padding-left: 0.5rem; } } ${b.M.mbDown} { margin-bottom: 12px; } } `,eo=(0,h.Z)(SourceList)` margin-top: 12px; padding: 0.5rem 1rem 1rem; `,VerifiedTag=({userId:e,avatar:t,name:a,role:o,title:l,className:s})=>{let{t:d}=(0,i.u)(),[c,u]=(0,n.useState)(!1);return n.createElement(n.Fragment,null,n.createElement(r.B,{className:`-dzIuHr ${s}`,color:"success",size:"xs",onClick:()=>u(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},n.createElement("span",{className:"text"},n.createElement(O.Z,{isSolid:!0,size:18,color:f.r.colors.green800,className:"icon"}),d("cardReply.verifyBy",{name:`${a||""}`}))),n.createElement(E.c,{open:c,onClose:()=>u(!1),profileModalProps:{zIndex:1e3}},n.createElement(C.a,{authorProps:{userId:e,avatar:t,name:a,role:o,title:l},hideQuestionTab:!0})))},CardReply=({className:e,style:t,comment:a,type:l="comment",level:s=0,replyingId:d,onPostCommentSuccess:u,post:p,onDeleteComment:h,refetchComment:b,hasQuickBookingEnable:f,handleMakeAppointment:x,cardAuthorProps:S,maxChars:P=600,disableShortenContent:$})=>{var T,I,O,j,L,A,_,D,M,R,B,Z,F;let{data:{locale:G,userInfo:V,env:{isMarryBaby:U}}}=(0,n.useContext)(g.T),{t:H}=(0,i.u)(),[q,W]=(0,n.useState)(a||null),{id:Y,countLikes:Q,content:X,replies:K=[],images:J=[],author:ee,liked:et,link:en,mentionedUser:er,mentions:el}=q,{text:ei,replyingTo:es}=(0,c.k)(X),{authActionWrapper:ed}=(0,m.iV)({_joinCommunityIds:[null===(T=null==p?void 0:p.community)||void 0===T?void 0:T.id],_joinTopicIds:null===(I=null==p?void 0:p.topics)||void 0===I?void 0:I.map(e=>e.id)}),[ec,eu]=(0,n.useState)(4),ep=null!=V&&!!V.id&&(null==K?void 0:K.some(e=>e.author.id===V.id)),addNewReply=e=>{W(t=>{if(!t.replies.find(t=>t.id===e.id)){t.replies.unshift(e);let a=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return b&&b(a),a}return t})},[em,eg]=(0,n.useState)(!1),ev=(0,n.useMemo)(()=>"comment"===l&&K&&0!=K.length?K.sort((e,t)=>{let a=new Date(e.createdAt).getTime(),o=new Date(t.createdAt).getTime();return a>o?-1:a{var e,t;(null==ee?void 0:ee.hospitalId)&&(e=ee.hospitalId,(0,o.a)(void 0,void 0,void 0,function*(){var t;let a=yield(0,g.c)((0,g.g)(y.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:z.v[G]}),"get");(null===(t=null==a?void 0:a._data)||void 0===t?void 0:t.branch)&&ek(null==a?void 0:a._data.branch)})),(null==ee?void 0:ee.doctorId)&&(t=ee.doctorId,(0,o.a)(void 0,void 0,void 0,function*(){var e;let a=yield(0,g.c)((0,g.g)(y.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:z.v[G]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&eN(null==a?void 0:a._data.doctor)}))},[ee.hospitalId,ee.doctorId]);let eP=(null==eS?void 0:eS.valid_outpatient)||(null==eS?void 0:eS.valid_telemedicine),e$=((null==eC?void 0:eC.total_available_service)||(null==eC?void 0:eC.total_available_doctor))>0,eT=f&&(eP||e$),eI=(null===(j=null==q?void 0:q.author)||void 0===j?void 0:j.type)==="chatbot";return n.createElement(m.I_,{defaultParams:{_joinCommunityIds:[null===(L=null==p?void 0:p.community)||void 0===L?void 0:L.id],_joinTopicIds:null===(A=null==p?void 0:p.topics)||void 0===A?void 0:A.map(e=>e.id)}},n.createElement(ea,{className:e,style:t,"data-is-reply":!!s,"data-is-marrybaby":U,"data-has-booking":eT},"reply"===l&&n.createElement(N.D,{className:"top-divider",type:"solid"}),n.createElement("div",{style:{padding:"16px 16px 0"}},n.createElement(E.C,Object.assign({avatar:ey,name:ef,username:ex,timeText:null==p?void 0:p.createdTime,community:null==p?void 0:p.community,className:`post-author ${eb?"with-popover":""}`,type:l,userId:null==ee?void 0:ee.id,role:ew,expertId:null==ee?void 0:ee.partnerId,title:null==ee?void 0:ee.title,doctorId:null==ee?void 0:ee.doctorId,hospitalId:null==ee?void 0:ee.hospitalId,hasQuickBooking:eT,handleMakeAppointment:x,isAnonymous:(null==q?void 0:q.isAnonymous)||!!(null==p?void 0:p.isAnonymous)&&(null===(_=null==p?void 0:p.author)||void 0===_?void 0:_.username)===(null==ee?void 0:ee.username),hideBackground:eI,userType:null==ee?void 0:ee.type},S)),!!(null==q?void 0:q.isVerify)&&!(null==q?void 0:q.isOppose)&&n.createElement(VerifiedTag,{title:null===(D=null==q?void 0:q.userVerify)||void 0===D?void 0:D.title,name:null===(M=null==q?void 0:q.userVerify)||void 0===M?void 0:M.name,userId:null===(R=null==q?void 0:q.userVerify)||void 0===R?void 0:R.id,role:null===(B=null==q?void 0:q.userVerify)||void 0===B?void 0:B.role,avatar:null===(Z=null==q?void 0:q.userVerify)||void 0===Z?void 0:Z.avatar,className:"verify-tag"})),n.createElement(C.P,{className:"post-content-wrapper",replyingTo:es,mentionedUser:er,description:ei,mentions:eE,maxChars:P,disableShortenContent:$}),n.createElement("span",null),n.createElement("span",null),J&&J.length>0?n.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},n.createElement(k.a,{images:J,authorName:null==ee?void 0:ee.username})):null,(!J||0===J.length)&&en?n.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},n.createElement(w.C,{url:en})):null,"most-engaging"!==l?n.createElement(n.Fragment,null,eI&&n.createElement(eo,{listUrl:null==q?void 0:q.source,categorySlug:null==q?void 0:q.categorySlug}),n.createElement(v.C,{type:v.c.reply,loveCount:Q,replyCount:eh,className:"post-reaction",liked:et,isReplied:ep,hideCommentIcon:"reply"===l||eI,hasShare:!1,onCommentClick:()=>ed(()=>eg(e=>!e)),onCommentCountClick:()=>ed(()=>{eg(!0)}),onLikeClick:()=>ed(()=>(0,o.a)(void 0,void 0,void 0,function*(){if(Y){let e=yield(0,c.l)({commentId:Y,setLike:!et,locale:G});1===e.status&&W(e=>Object.assign(Object.assign({},e),{liked:!et,countLikes:e.countLikes+(et?-1:1)}))}}))}),em&&n.createElement(c.I,{replyingId:d||q.id,replyToName:ef,isReply:!0,onClose:()=>eg(!1),onPostSuccess:e=>{"reply"===l?u&&u(e):addNewReply(e)},post:p,replyingUser:ee}),"comment"===l&&K&&K.length>0?n.createElement("div",{className:"comment-reply-wrapper"},null===(F=null==ev?void 0:ev.slice(0,ec))||void 0===F?void 0:F.map(e=>n.createElement(CardReply,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:s+1,replyingId:Y,onPostCommentSuccess:addNewReply,post:p,onDeleteComment:()=>{W(t=>Object.assign(Object.assign({},t),{replies:t.replies.filter(t=>t.id!==e.id),countReplies:t.countReplies-1}))},handleMakeAppointment:x,hasQuickBookingEnable:f})),eh>ec&&n.createElement(n.Fragment,null,n.createElement(N.D,{className:"top-divider",type:"solid"}),n.createElement(r.B,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>eu(e=>e+4)},H("comment.seeMoreReplies",{count:eh-ec}),n.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 12 4-4-4-4'/%3e%3c/svg%3e",loading:"lazy"})))):null):null,eb&&n.createElement(CardReplyPopover,{onDeleteComment:h,className:"popover",commentId:q.id})))},getMostEngagingComment=(e,t)=>(0,o.a)(void 0,void 0,void 0,function*(){var a,o,n;let r=yield(0,g.t)((0,g.e)(y.yy.COMMENT.LIST,{postId:e,_locale:t,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(n=null===(o=null===(a=null==r?void 0:r.data)||void 0===a?void 0:a.comments)||void 0===o?void 0:o.map(x.e))||void 0===n?void 0:n[0]}),CardPost=({className:e,style:t,hideViewMoreComment:a,showMostEngaging:s,onCommentClick:u,onCommentCountClick:h,onMostEngagingCommentClick:b,onPostCommentSuccess:f,disableCardLink:x,disableShortenContent:N,onDeletePost:P,onEditPost:$,post:T,mostEngagingComment:I,onDeleteComment:O,showInputComment:j,InlineCommentsComponent:L,hasQuickBookingEnable:A,handleMakeAppointment:_,onSaveUnsaveSuccess:D,cardAuthorProps:z,verticalReactions:M=!1})=>{let[R,B]=(0,n.useState)(T),[G,V]=(0,n.useState)(!1),[U,H]=(0,n.useState)(I),{community:q,topics:W,author:Y,slug:Q,isPin:X,liked:K,photos:J,mentions:ee,title:et,description:ea,previewUrl:eo,likesCount:en,commentsCount:er,id:el,commented:ei}=R,{data:{locale:es,togetherUserId:ed,userInfo:ec,env:{isMarryBaby:eu,togetherBasePath:ep}},action:{pushNotifications:em}}=(0,n.useContext)(g.T),eg=!!(null==ec?void 0:ec.id),{t:ev}=(0,i.u)(),[eh,eb]=(0,n.useState)(j),ef=`${ep}/${(null==q?void 0:q.slug)||"_"}/${Q||""}`,ex=`${(0,g.k)(es)}${ef}`,{authActionWrapper:ey}=(0,m.iV)((null==q?void 0:q.slug)?{_joinCommunityIds:[q.id],_joinTopicIds:null==W?void 0:W.map(e=>e.id)}:void 0),[ew,eE]=(0,n.useState)(!1);(0,n.useEffect)(()=>{eb(j)},[j]);let eC=(null==Y?void 0:Y.name)||(null==Y?void 0:Y.username)||"",ek=(null==Y?void 0:Y.username)||(null==Y?void 0:Y.name)||"",eS=null==Y?void 0:Y.avatar,eN=(null==R?void 0:R.isAnonymous)?void 0:null==Y?void 0:Y.role,[eP,e$]=(0,n.useState)(null),[eT,eI]=(0,n.useState)(null);(0,n.useEffect)(()=>{var e,t;(null==Y?void 0:Y.hospitalId)&&(e=Y.hospitalId,(0,o.a)(void 0,void 0,void 0,function*(){var t;let a=yield(0,g.c)((0,g.g)(y.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:g.l[es]}),"get");(null===(t=null==a?void 0:a._data)||void 0===t?void 0:t.branch)&&e$(null==a?void 0:a._data.branch)})),(null==Y?void 0:Y.doctorId)&&(t=Y.doctorId,(0,o.a)(void 0,void 0,void 0,function*(){var e;let a=yield(0,g.c)((0,g.g)(y.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:g.l[es]}),"get");(null===(e=null==a?void 0:a._data)||void 0===e?void 0:e.doctor)&&eI(null==a?void 0:a._data.doctor)}))},[Y.hospitalId,Y.doctorId]);let eO=(null==eT?void 0:eT.valid_outpatient)||(null==eT?void 0:eT.valid_telemedicine),ej=((null==eP?void 0:eP.total_available_service)||(null==eP?void 0:eP.total_available_doctor))>0;(0,n.useEffect)(()=>{(0,o.a)(void 0,void 0,void 0,function*(){if(el&&er&&s&&!(null==I?void 0:I.id)){let e=yield getMostEngagingComment(el,es);H(e)}})},[el,es,er,s,null==I?void 0:I.id]),(0,n.useEffect)(()=>{H(I)},[null==I?void 0:I.id]);let onDeleteComment=e=>(0,o.a)(void 0,void 0,void 0,function*(){if(er>1&&(null==U?void 0:U.id)&&(null==U?void 0:U.id)===(null==e?void 0:e.id)){let e=yield getMostEngagingComment(el,es);H(e)}B(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1})),O&&O(e)});return n.createElement(m.I_,{defaultParams:(null==q?void 0:q.slug)?{_joinCommunityIds:[q.id],_joinTopicIds:null==W?void 0:W.map(e=>e.id)}:void 0},G&&n.createElement(c.S,{url:ex,avatar:p.D,text:et,onClose:()=>V(!1)}),n.createElement(Z,{className:e,style:t,"data-is-marrybaby":eu},X?n.createElement(v.a,{className:"post-pin"}):null,n.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},n.createElement(E.C,Object.assign({avatar:eS,name:eC,username:ek,url:x?void 0:ef,community:q,timeText:null==R?void 0:R.createdTime,className:"post-author",role:eN,userId:null==Y?void 0:Y.id,expertId:null==Y?void 0:Y.partnerId,doctorId:null==Y?void 0:Y.doctorId,hospitalId:null==Y?void 0:Y.hospitalId,title:null==Y?void 0:Y.title,hasQuickBooking:A&&(eO||ej),handleMakeAppointment:_,"data-testid":"name",isAnonymous:!!(null==R?void 0:R.isAnonymous),extendEle:n.createElement(CardPostPopoverMore,{authorEmail:String(null==Y?void 0:Y.email),onDeletePost:P,shareUrl:ex,post:R,className:"popover",onEditPost:$})},z))),n.createElement("a",{href:x?void 0:ef,className:"post-content-link-wrapper"},et&&n.createElement(l.H,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},d()(et)),n.createElement(C.P,{className:"post-content-wrapper",description:ea,disableShortenContent:N,mentions:ee,"data-testid":"Content of the Post"})),n.createElement("span",null),n.createElement("span",null),n.createElement("div",{key:"tag-topic"},W&&W.length>0?n.createElement(v.T,{topics:W,className:"post-topics"}):null),n.createElement("div",{key:"social-preview"},(null==R?void 0:R.introUrl)?n.createElement("div",{className:`social-preview-wrapper ${(null==J?void 0:J.length)?"has-image":""}`},n.createElement(S.S,{url:R.introUrl,image:R.bannerImage})):null),n.createElement("div",{key:"image-preview"},(null==J?void 0:J.length)?n.createElement("div",{className:"image-preview-wrapper"},n.createElement(k.a,{images:J,authorName:null==Y?void 0:Y.name,isSensitive:!!(null==R?void 0:R.isSensitive)})):null),n.createElement("div",{key:"link-preview"},(null==R?void 0:R.introUrl)||(null==J?void 0:J.length)||null==eo||!eo.url?null:n.createElement("div",{className:"link-preview-wrapper"},n.createElement(w.C,{title:eo.title,url:eo.url,image:eo.image}))),n.createElement(v.C,{isMarryBaby:eu,type:v.c.post,loveCount:en,replyCount:er,className:`post-reaction ${(null==J?void 0:J.length)||(null==eo?void 0:eo.url)?"hide-top-border":""}`,liked:ew?!K:K,isReplied:ei,isSaved:(null==R?void 0:R.bookmarked)||!1,onCommentClick:()=>ey(()=>{u?u():eb(e=>!e)}),onCommentCountClick:()=>{ey(()=>{eu?eb(!0):h?h():x||(window.location.href=ef)})},onShareClick:()=>{V(!0)},onLikeClick:()=>(0,o.a)(void 0,void 0,void 0,function*(){ey(()=>(0,o.a)(void 0,void 0,void 0,function*(){if(el&&!ew){eE(!0);try{let e=yield(0,c.m)({id:el,locale:es});(null==e?void 0:e.status)!==1?em((0,c.g)(ev)):B(e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked}))}catch(e){em((0,c.g)(ev))}eE(!1)}}))}),onSaveClick:()=>{ey(()=>(0,o.a)(void 0,void 0,void 0,function*(){if((null==ec?void 0:ec.id)&&(null==R?void 0:R.id)){if(null==R?void 0:R.bookmarked){let e=yield(0,g.b)((0,g.e)(y.yy.BOOKMARK.DELETE,{_locale:es}),"DELETE",{headers:{"Content-Type":"application/json"},data:{post_id:String(R.id)}});(null==e?void 0:e.status)===1?(em({title:"",message:ev("post.remove.success"),type:"success",displayIcon:F}),null==D||D()):em({title:"",message:ev("post.remove.failed"),type:"danger",displayIcon:F})}else{let e=yield(0,g.b)((0,g.e)(y.yy.BOOKMARK.CREATE,{_locale:es}),"POST",{headers:{"Content-Type":"application/json"},data:{user_id:ed||ec.id,post_id:R.id}});(null==e?void 0:e.status)===1?(em({title:"",message:ev("post.save.success"),type:"success",displayIcon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23595959'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e"}),null==D||D()):em({title:"",message:ev("post.save.failed"),type:"danger",displayIcon:F})}}}))},onGoToUrl:e=>{let t=e?`${ex}${e}`:ex;eg?window.location.href=t:ey(()=>window.location.href=t)},showingMostEngaging:!!(s&&(null==U?void 0:U.id)),isVertical:M}),eh&&n.createElement(c.I,{isMainCmt:!j,onClose:()=>eb(!1),onPostSuccess:e=>{0!==er||(null==U?void 0:U.id)||H(e),B(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0})),f&&f(e)},post:R}),s&&(null==U?void 0:U.id)?n.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{b?(e.stopPropagation(),b()):window.location.href=ef}},n.createElement(CardReply,{hasQuickBookingEnable:A,handleMakeAppointment:_,comment:U,post:R,onDeleteComment:()=>{onDeleteComment&&onDeleteComment(U)},className:"most-engaging-comment",type:"most-engaging",key:U.id,cardAuthorProps:z}),er>1&&!a&&n.createElement(r.B,{className:"see-more-comments",color:"ghost",size:"md"},ev("comment.seeMoreComments",{count:er-1}))):null,L))}}}]);