"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8674],{C8CU:function(e,t,i){i.d(t,{A:function(){return AddressInput}});var n=i("ubET"),a=i("q1tI"),o=i("OAL+"),l=i("aDCK"),r=i("wY0a"),s=i("rvDO"),d=i("RF7b"),c=i("0UCW"),p=i("hKh/"),m=i("yNk5");let generateGetAddressDetail=e=>`${s.g}/cities-data-${c.M[e]}.json`,u={provinceByName:{},provinces:[],districts:[],wards:[],selectedProvince:"",selectedDistrict:"",selectedWard:""},reducer=(e,t)=>{switch(t.type){case"SET_DATA":return Object.assign(Object.assign({},e),t.payload);case"SET_DISTRICTS":return Object.assign(Object.assign({},e),{districts:t.payload});case"SET_WARDS":return Object.assign(Object.assign({},e),{wards:t.payload});case"SELECT_PROVINCE":return Object.assign(Object.assign({},e),{selectedProvince:t.payload,selectedDistrict:"",selectedWard:""});case"SELECT_DISTRICT":return Object.assign(Object.assign({},e),{selectedDistrict:t.payload,selectedWard:""});case"SELECT_WARD":return Object.assign(Object.assign({},e),{selectedWard:t.payload});default:return e}},mappingProvinceId=(e,t)=>{let i={};for(let[,e]of Object.entries(t)){let{id:t}=e;t&&(i[t]=e)}let n={};return e.map(e=>{n[e.name]=i[e.id]}),n},useAddress=({provinces:e})=>{let[t,i]=(0,a.useReducer)(reducer,u),{provinceByName:o,provinces:l,districts:r,wards:s,selectedProvince:d,selectedDistrict:c,selectedWard:g}=t,[h,v]=(0,a.useState)();return(0,a.useEffect)(()=>{(0,n._)(void 0,void 0,void 0,function*(){var t,n,a;try{let o=yield fetch(generateGetAddressDetail(m.env.UNIFY_LOCALE||p.L.Vietnam)).then(e=>e.json());v(o);let{list:l}=o,r=e?mappingProvinceId(e,l):l,s=Object.keys(r),d=Object.keys((null===(t=l[s[0]])||void 0===t?void 0:t.list)||{}),c=Object.keys((null===(a=null===(n=l[s[0]])||void 0===n?void 0:n[d[0]])||void 0===a?void 0:a.list)||{});i({type:"SET_DATA",payload:{provinceByName:r,provinces:s,districts:d,wards:c}})}catch(e){console.error("Error fetching address data:",e)}})},[m.env.UNIFY_LOCALE]),{provinces:l,districts:r,wards:s,selectedProvince:d,selectedDistrict:c,selectedWard:g,handleProvinceChange:e=>{var t;let n=Object.keys((null===(t=o[e])||void 0===t?void 0:t.list)||{});i({type:"SET_DISTRICTS",payload:n}),i({type:"SET_WARDS",payload:[]}),i({type:"SELECT_PROVINCE",payload:e})},handleDistrictChange:e=>{var t,n;let a=Object.keys((null===(n=null===(t=o[d])||void 0===t?void 0:t.list[e])||void 0===n?void 0:n.list)||{});i({type:"SET_WARDS",payload:a}),i({type:"SELECT_DISTRICT",payload:e})},handleWardChange:e=>{i({type:"SELECT_WARD",payload:e})}}},AddressInput=e=>{var{error:t,provinces:i,placeholder:s}=e,c=(0,n.a)(e,["error","provinces","placeholder"]);let{t:p}=(0,d.u)(),{provinces:m,districts:u,wards:g,selectedProvince:h,selectedDistrict:v,selectedWard:b,handleProvinceChange:w,handleDistrictChange:y,handleWardChange:f}=useAddress({provinces:i}),[E,x]=(0,a.useState)("");return(0,a.useEffect)(()=>{h&&v&&b&&E?c.onChange({selectedProvince:h,selectedDistrict:v,selectedWard:b,extraInfo:E}):c.onChange(null)},[h,v,b,E]),a.createElement(r.I.Wrapper,Object.assign({withAsterisk:!0},c),a.createElement(o.K,null,a.createElement(r.S,{placeholder:(null==s?void 0:s.province)||p("onboarding.similac.input.city"),data:i?m:m.sort(),searchable:!0,onChange:w,value:h}),a.createElement(r.S,{placeholder:(null==s?void 0:s.district)||p("onboarding.similac.input.district"),data:u.sort(),searchable:!0,onChange:y,value:v,disabled:!h}),a.createElement(r.S,{placeholder:(null==s?void 0:s.ward)||p("onboarding.similac.input.ward"),searchable:!0,data:g.sort(),value:b,onChange:f,disabled:!h||!v}),a.createElement(r.I,{placeholder:(null==s?void 0:s.address)||p("onboarding.similac.input.no"),disabled:!h||!v||!b,value:E,onChange:x,style:{marginBottom:0}})),a.createElement(l.I.Error,{size:"md"},t))}},tbvN:function(e,t,i){i.d(t,{M:function(){return MantineProvider}});var n=i("ubET"),a=i("q1tI"),o=i("8vDj"),l=i("WcvC"),r=i("usMy");let MantineProvider=e=>{var{children:t,locale:i,template:s="hb",isNotifications:d=!0,customStyleType:c=r.C.NONE}=e,p=(0,n.a)(e,["children","locale","template","isNotifications","customStyleType"]);return(0,l.u)(i),a.createElement(o.Me,Object.assign({theme:(0,l.g)(i,s,c)},p),a.createElement(r.T,{variant:c},t,d&&a.createElement(l.N,null)))}},UPG7:function(e,t,i){i.d(t,{C:function(){return g},I:function(){return ImagePreviewPopup},P:function(){return PostSingleImageViewPopup},a:function(){return PostImagePreview},b:function(){return h}});var n=i("q1tI"),a=i("VgLc"),o=i("nm4t"),l=i("RF7b"),r=i("Hcm0"),s=i("t/pd"),d=i("lhAG"),c=i("rBCA"),p=i("ubET"),m=i("iBNF"),u=i("gEnE"),g="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%23262626' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M18 6 6 18M6 6l12 12'/%3e%3c/svg%3e",h="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='25' fill='none'%3e%3cpath stroke='%23262626' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M10.05 18.06 4 12.038l6.05-6.025M4.002 12.035h15'/%3e%3c/svg%3e";let v=c.Z.div` padding: 14px 16px 14px 17px; background: ${e=>e.bgColor}; border-left: 3px solid ${e=>e.highlight}; ${o.M.mbUp} { padding: 12px 12px 12px 17px; } `,b=c.Z.div` display: flex; `,w=c.Z.div` font-size: 12px; line-height: 18px; &[data-has-icon='true'] { margin-left: 10px; } `,y=c.Z.div` flex-shrink: 0; `,f=c.Z.div` display: grid; grid-gap: 3px; grid-template-columns: 1fr 1fr; grid-template-rows: auto; .img-wrapper { position: relative; overflow: hidden; width: 100%; padding-top: 56.25%; grid-column: auto; & > img { cursor: zoom-in; } .img-preview-blur { position: absolute; top: 50%; left: 50%; width: 110%; height: 110%; /* Add the blur effect */ -webkit-filter: blur(8px); filter: blur(8px); object-fit: cover; object-position: center; opacity: 0.8; transform: translate(-50%, -50%); } .img-preview { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; } .img-more-overlay { position: absolute; top: 0; left: 0; display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.5); z-index: 4; } } &[data-image-count='1'] { .img-wrapper { /* padding-top: 100%; */ grid-column: 1/3; } } &[data-image-count='2'] { .img-wrapper { /* padding-top: 100%; */ } } &[data-image-count='3'] { .img-wrapper { &:first-child { grid-column: 1/3; } } } &[data-image-count='4'] { .img-wrapper { /* padding-top: 100%; */ } } &[data-image-count='5'] { grid-template-columns: repeat(6, 1fr); .img-wrapper { /* padding-top: 100%; */ grid-column: auto/ span 2; &:first-child { padding-top: 56.25%; grid-column: 1/4; } &:nth-child(2) { padding-top: 56.25%; grid-column: 4/7; } } } &[data-is-marrybaby='true'] { grid-gap: 8px; .img-wrapper { padding-top: 66.66%; border-radius: 1rem; .img-preview { object-fit: cover; } } &[data-image-count='3'] { grid-template-columns: 1fr 1fr 1fr; .img-wrapper { &:first-child { padding-top: 100%; grid-column: 1/3; grid-row: 1/3; } } } } `,E=c.Z.div` position: fixed; z-index: 999; top: 0; left: 0; display: flex; overflow: hidden; width: 100vw; height: 100vh; flex-direction: column; background: white; opacity: 0; pointer-events: none; transition: opacity 0.2s linear; &[data-open='true'] { opacity: 1; pointer-events: auto; } .top-bar { position: relative; padding: 20px 40px; .icon-arrow-left { position: absolute; top: 50%; left: 20px; height: 24px; width: 24px; cursor: pointer; transform: translateY(-50%); } } .container { flex: 1; overflow-y: auto; .img-preview { width: 100%; min-width: 100%; margin-bottom: 0.5rem; cursor: pointer; max-height: 100%; object-fit: cover; } } `,x=(0,c.Z)(e=>{var{icon:t,bgColor:i=m.r.colors.yellow50,highlightColor:a=m.r.colors.yellow800,message:o}=e,l=(0,p.a)(e,["icon","bgColor","highlightColor","message"]);return n.createElement(v,Object.assign({bgColor:i,highlight:a},l),n.createElement(b,null,t&&n.createElement(y,null,t),n.createElement(w,{"data-has-icon":!!t},o)))})` margin-bottom: 16px; &.noti-bottom { border-left: none; margin-top: 4px; padding: 4px 8px; margin-left: 16px; margin-right: 16px; border-radius: 4px; } `,ImagePreviewPopup=({className:e,style:t,authorName:i,images:a,onClose:o,onOpenSingleView:r,alt:c})=>{let{t:p}=(0,l.u)(),[m,u]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{setTimeout(()=>{u(!0)},0)},[]),n.createElement(s.h,null,n.createElement(E,{className:e,style:t,"data-open":m},n.createElement("div",{className:"top-bar"},n.createElement("img",{className:"icon-arrow-left",src:h,onClick:o,alt:"go back",loading:"lazy"}),n.createElement(d.T,{size:"p2",weight:"bold",style:{textAlign:"center"}},p("previewPhotos.title",{name:i}))),n.createElement("div",{className:"container"},a.map((e,t)=>n.createElement("img",{className:"img-preview",key:t,src:e,onClick:()=>null==r?void 0:r(t),alt:c,loading:"lazy"})))),",")},k=c.Z.div` position: fixed; z-index: 999; top: 0; left: 0; display: flex; width: 100%; height: 100%; flex-direction: column; background: black; opacity: 0; pointer-events: none; transition: opacity 0.2s linear; &[data-open='true'] { opacity: 1; pointer-events: auto; } `,C=c.Z.div` padding: 1rem; background: white; .icon-close { width: 26px; height: 26px; cursor: pointer; } `,I=c.Z.div` position: relative; flex: 1; overflow: hidden; > img { height: 100%; width: 100%; object-fit: contain; object-position: center; } `,S=c.Z.div` --inner-padding: max(16px, 20%); height: 100%; position: absolute; left: 0; padding: 8px; padding-right: var(--inner-padding); display: flex; align-items: center; top: 0; cursor: pointer; &[data-right] { padding-right: 8px; padding-left: var(--inner-padding); left: unset; right: 0; } &[data-disabled='true'] { cursor: not-allowed; } `,P=c.Z.div` border-radius: 50%; background: rgba(0, 0, 0, 0.3); display: flex; align-items: center; justify-content: center; padding: 4px; > img { width: 16px; height: 16px; &[data-disabled='true'] { opacity: 0.5; } } ${o.M.tdUp} { padding: 8px; > img { width: 30px; height: 30px; } } `;var T="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='m6 12.813 4-4-4-4'/%3e%3c/svg%3e";let PostSingleImageViewPopup=({initialViewIndex:e,images:t,onClose:i,alt:a})=>{let[o,l]=(0,n.useState)(e),[r,d]=(0,n.useState)(!1);(0,n.useEffect)(()=>{setTimeout(()=>{d(!0)},0)},[]);let c=null==t?void 0:t[o],p=0===o,m=!(null==t?void 0:t.length)||o===(null==t?void 0:t.length)-1;return n.createElement(s.h,null,n.createElement(k,{"data-open":r&&!!c},n.createElement(C,null,n.createElement("img",{src:g,className:"icon-close",onClick:i,alt:"close",loading:"lazy"})),c&&o>=0&&n.createElement(n.Fragment,null,n.createElement(I,null,n.createElement("img",{className:"img-preview",src:c,alt:a,loading:"lazy"}),n.createElement(S,{"data-disabled":p,onClick:()=>!p&&l(o-1)},n.createElement(P,null,n.createElement("img",{src:T,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":p,loading:"lazy"}))),n.createElement(S,{"data-right":!0,"data-disabled":m,onClick:()=>!m&&l(o+1)},n.createElement(P,null,n.createElement("img",{src:T,alt:"right arrow","data-disabled":m,loading:"lazy"})))))))},j=(0,u.Z)(c.Z.div` position: absolute; top: 0; right: 0; left: 0; bottom: 0; background: rgba(0, 0, 0, 0.4); color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; `,"hhgcomp-sensitivemask-inner"),_=c.Z.div``,N=c.Z.div` position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; z-index: 3; background: white; cursor: pointer; &, * { // transition: all 300ms; transform-origin: bottom left; } img { transition: none; } .img-preview { width: 100%; } &[data-is-blurred='true'] { .img-preview { /* Add the blur effect */ -webkit-filter: blur(24px); filter: blur(24px); } } &[data-is-blurred='false'] { background: transparent; cursor: zoom-in; ${j.classSelector} { top: auto; right: auto; left: 8px; bottom: 8px; background: rgba(0, 0, 0, 0); align-items: flex-end; justify-content: flex-start; } } `,SensitiveMask=({image:e,showIcon:t=!0})=>{let[i,a]=(0,n.useState)(!0);return n.createElement(N,{"data-is-blurred":i,onClick:e=>i&&e.stopPropagation()},n.createElement("img",{loading:"lazy",className:"img-preview",src:e}),n.createElement(j,{onClick:e=>{e.stopPropagation(),a(!i)}},t&&n.createElement(_,null,i?n.createElement("svg",{width:"22",height:"20",viewBox:"0 0 22 20",fill:"none"},n.createElement("path",{d:"M1.71 2.54a.996.996 0 0 1 0-1.41c.39-.39 1.03-.39 1.42 0l16.31 16.33a.996.996 0 1 1-1.41 1.41l-2.72-2.72c-1.34.52-2.79.82-4.31.82-5 0-9.27-3.11-11-7.5C.77 7.5 2.06 5.8 3.68 4.51zM16 9.47c0-2.76-2.24-5-5-5-.51 0-1 .1-1.47.24L7.36 2.54c1.15-.37 2.37-.57 3.64-.57 5 0 9.27 3.11 11 7.49-.69 1.76-1.79 3.3-3.18 4.53l-3.06-3.06c.14-.46.24-.95.24-1.46m-5 5c-2.76 0-5-2.24-5-5 0-.77.18-1.5.49-2.14L8.06 8.9c-.03.18-.06.37-.06.57 0 1.66 1.34 3 3 3 .2 0 .38-.03.57-.07l1.57 1.57c-.65.32-1.37.5-2.14.5m2.97-5.33a2.97 2.97 0 0 0-2.64-2.64z",fill:"#fff"})):n.createElement("svg",{width:"23",height:"16",viewBox:"0 0 23 16",fill:"none"},n.createElement("path",{d:"M12 0C5.142 0 1.886 5.879 1.096 7.557c-.132.28-.132.604 0 .884C1.886 10.121 5.142 16 12 16c6.834 0 10.092-5.837 10.896-7.54a1.08 1.08 0 0 0 0-.92C22.092 5.836 18.834 0 12 0m0 3a5 5 0 1 1-.001 10.001 5 5 0 0 1 0-10.001m0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6",fill:"#2D87F3"})))))},PostImagePreview=({className:e,images:t=[],style:i,authorName:s,isSensitive:d=!1,alt:c,positionAlert:p="top"})=>{let{data:{env:{isMarryBaby:m}}}=(0,n.useContext)(r.T),{t:u}=(0,l.u)(),g=`+ ${(t.length||0)-4}`,[h,v]=(0,n.useState)(!1),[b,w]=(0,n.useState)(-1),y=t.length>5,E=(0,n.useRef)(!1);return(0,n.useEffect)(()=>()=>{E.current&&(0,o.t)(!1)},[]),(0,n.useEffect)(()=>{h||b>=0?((0,o.t)(!0),E.current=!0):((0,o.t)(!1),E.current=!1)},[h,b]),n.createElement(n.Fragment,null,d&&"top"===p&&n.createElement(x,{message:u("sensitiveMask.contentWarningDescription"),icon:n.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},n.createElement("path",{d:"M9 .667A8.336 8.336 0 0 0 .667 9c0 4.6 3.733 8.333 8.333 8.333S17.333 13.6 17.333 9 13.6.667 9 .667m0 9.166A.836.836 0 0 1 8.167 9V5.667c0-.459.375-.834.833-.834s.833.375.833.834V9A.836.836 0 0 1 9 9.833M8.167 11.5v1.667h1.666V11.5z",fill:"#FE921D"}))}),n.createElement(f,{className:e,style:i,"data-image-count":y?5:t.length||0,"data-is-marrybaby":m,"data-cursor-pointer":!d},null==t?void 0:t.slice(0,5).map((e,t)=>{let i=4===t&&y;return n.createElement("div",{className:"img-wrapper",key:t,onClick:()=>{t>=4&&y?v(!0):w(t)}},d&&n.createElement(SensitiveMask,{image:e,showIcon:!i}),!m&&n.createElement("img",{loading:"lazy",className:"img-preview-blur",src:e,alt:c}),n.createElement("img",{loading:"lazy",className:"img-preview",src:e,alt:c}),i&&n.createElement("div",{className:"img-more-overlay"},n.createElement(a.H,{tag:"h1",as:"h2",color:"white"},g)))})),h&&n.createElement(ImagePreviewPopup,{authorName:s||"",images:t,onClose:()=>v(!1),onOpenSingleView:w,alt:c}),b>=0&&n.createElement(PostSingleImageViewPopup,{images:t,initialViewIndex:b,onClose:()=>w(-1),alt:c}),d&&"bottom"===p&&n.createElement(x,{message:u("sensitiveMask.contentWarningDescription.community"),className:"noti-bottom",icon:n.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},n.createElement("path",{d:"M9 .667A8.336 8.336 0 0 0 .667 9c0 4.6 3.733 8.333 8.333 8.333S17.333 13.6 17.333 9 13.6.667 9 .667m0 9.166A.836.836 0 0 1 8.167 9V5.667c0-.459.375-.834.833-.834s.833.375.833.834V9A.836.836 0 0 1 9 9.833M8.167 11.5v1.667h1.666V11.5z",fill:"#FE921D"}))}))}},"1NP8":function(e,t,i){i.d(t,{P:function(){return PWGForm}});var n=i("ubET"),a=i("q1tI"),o=i("8vDj"),l=i("iuhU"),r=i("cChf"),s=i("ZFu2"),d=i("Ix29"),c=i("RF7b"),p=i("990U"),m=i("wY0a"),u=i("lhAG"),g=i("yoWs"),h=i("GyZF"),v=i("5O5z"),b=i("xrdX");let w=(0,a.createContext)({}),DefaultForm=e=>{var t=(0,n.a)(e,[]);let{t:i,locale:r}=(0,c.u)(),{linkTool:s,form:d,submitProps:p}=(0,a.useContext)(w),{classes:y={}}=(0,a.useContext)(g.C),f=(0,o.rZ)(),E="mb"===f.other.template;return a.createElement(h.H,Object.assign({formLayout:"default"},t),a.createElement(h.H.FormRow,null,a.createElement(m.I.Number,Object.assign({label:a.createElement(u.T,{size:"p2",weight:"semiBold"},i("pregnancyWeightGain.weekInput")),min:v.I.pregnantWeek.min,max:v.I.pregnantWeek.max,placeholder:`${v.I.pregnantWeek.min} - ${v.I.pregnantWeek.max}`},d.getInputProps("pregnantWeek")))),a.createElement(h.H.FormRow,null,a.createElement(m.I.Number,Object.assign({label:a.createElement(u.T,{size:"p2",weight:"semiBold"},i("pregnancyWeightGain.weightBeforeInput")),min:v.I.weight.min,max:v.I.weight.max,placeholder:i("tools.inputPlaceholder",{content:"50"})},d.getInputProps("lastWeight")))),a.createElement(h.H.FormRow,null,a.createElement(m.I.Number,Object.assign({label:a.createElement(u.T,{size:"p2",weight:"semiBold"},i("pregnancyWeightGain.heightInput")),min:v.I.height.min,max:v.I.height.max,placeholder:i("tools.inputPlaceholder",{content:"160"})},d.getInputProps("height")))),a.createElement(h.H.FormRow,null,a.createElement(m.I.Number,Object.assign({label:a.createElement(u.T,{size:"p2",weight:"semiBold"},i("pregnancyWeightGain.weightInput")),min:v.I.weight.min,max:v.I.weight.max,placeholder:i("tools.inputPlaceholder",{content:"50"})},d.getInputProps("weight")))),a.createElement(h.H.FormRow,null,a.createElement(h.H.Switching,Object.assign({label:a.createElement(u.T,{size:"p2",weight:"semiBold"},i("pregnancyWeightGain.havingTwins"))},d.getInputProps("hasTwin")))),a.createElement(h.H.FormRow,{className:y.submitWrapper},a.createElement(h.H.Submit,Object.assign({type:"submit",dataEventCategory:"Health Tool",dataEventAction:"Embedded Pregnancy Weight Gain",dataEventLabel:`https://${b.v[E?"vi-VN_MB":r]}/${s}`,className:(0,l.default)("due-date-calculate-button",y.submitBtn)},p),i("dueDatePage.lastPeriod.calculate"))))},InlineForm=e=>{var t=(0,n.a)(e,[]);let{t:i,locale:r}=(0,c.u)(),{classes:s={}}=(0,a.useContext)(g.C),{linkTool:d,form:p,submitProps:u}=(0,a.useContext)(w),y=(0,o.rZ)(),f="mb"===y.other.template;return a.createElement(h.H,Object.assign({formLayout:"inline"},t),a.createElement(h.H.FormRow,null,a.createElement(h.H.BorderInlineControl,{label:i("pregnancyWeightGain.weekInput")},a.createElement(m.I.Number,Object.assign({min:v.I.pregnantWeek.min,max:v.I.pregnantWeek.max,placeholder:`${v.I.pregnantWeek.min} - ${v.I.pregnantWeek.max}`,rightSection:a.createElement(h.H.Unit,null,i("pwgForm.week"))},p.getInputProps("pregnantWeek"))))),a.createElement(h.H.FormRow,null,a.createElement(h.H.BorderInlineControl,{label:i("pregnancyWeightGain.weightBeforeInput")},a.createElement(m.I.Number,Object.assign({},p.getInputProps("lastWeight"),{min:v.I.weight.min,max:v.I.weight.max,placeholder:i("tools.inputPlaceholder",{content:"50"}),rightSection:a.createElement(h.H.Unit,null,i("babyGrowth.kg"))})))),a.createElement(h.H.FormRow,null,a.createElement(h.H.BorderInlineControl,{label:i("pregnancyWeightGain.heightInput")},a.createElement(m.I.Number,Object.assign({},p.getInputProps("height"),{min:v.I.height.min,max:v.I.height.max,placeholder:i("tools.inputPlaceholder",{content:"160"}),rightSection:a.createElement(h.H.Unit,null,i("babyGrowth.cm"))})))),a.createElement(h.H.FormRow,null,a.createElement(h.H.BorderInlineControl,{label:i("pregnancyWeightGain.weightInput")},a.createElement(m.I.Number,Object.assign({},p.getInputProps("weight"),{min:v.I.weight.min,max:v.I.weight.max,placeholder:i("tools.inputPlaceholder",{content:"50"}),rightSection:a.createElement(h.H.Unit,null,i("babyGrowth.kg"))})))),a.createElement(h.H.FormRow,null,a.createElement(h.H.BorderInlineControl,{label:i("pregnancyWeightGain.havingTwins"),width:"none"},a.createElement(h.H.Switching,Object.assign({},p.getInputProps("hasTwin"))))),a.createElement(h.H.FormRow,{className:s.submitWrapper},a.createElement(h.H.Submit,Object.assign({type:"submit",dataEventCategory:"Health Tool",dataEventAction:"Embedded Pregnancy Weight Gain",dataEventLabel:`https://${b.v[f?"vi-VN_MB":r]}/${d}`,className:(0,l.default)("due-date-calculate-button",s.submitBtn)},u),i("dueDatePage.lastPeriod.calculate"))))},MbLayout=e=>{var t=(0,n.a)(e,[]);let{t:i,locale:l}=(0,c.u)(),{linkTool:r,form:s,submitProps:d}=(0,a.useContext)(w),p=(0,o.rZ)(),u="mb"===p.other.template;return a.createElement(h.H,Object.assign({formLayout:"inline"},t),a.createElement(h.H.FormRow,null,a.createElement(h.H.BorderBoxControl,{label:i("pregnancyWeightGain.weekInput"),rightSection:i("pregnancy.week")},a.createElement(m.I.Number,Object.assign({min:v.I.pregnantWeek.min,max:v.I.pregnantWeek.max,placeholder:`${v.I.pregnantWeek.min} - ${v.I.pregnantWeek.max}`},s.getInputProps("pregnantWeek")))),s.errors.pregnantWeek&&a.createElement(h.H.Error,null,s.errors.pregnantWeek)),a.createElement(h.H.FormRow,null,a.createElement(h.H.BorderBoxControl,{label:i("pregnancyWeightGain.weightBeforeInput"),rightSection:"kg"},a.createElement(m.I.Number,Object.assign({min:v.I.weight.min,max:v.I.weight.max},s.getInputProps("lastWeight"),{placeholder:i("tools.inputPlaceholder",{content:"50"})}))),s.errors.lastWeight&&a.createElement(h.H.Error,null,s.errors.lastWeight)),a.createElement(h.H.FormRow,null,a.createElement(h.H.BorderBoxControl,{label:i("pregnancyWeightGain.heightInput"),rightSection:"cm"},a.createElement(m.I.Number,Object.assign({min:v.I.height.min,max:v.I.height.max},s.getInputProps("height"),{placeholder:i("tools.inputPlaceholder",{content:"160"})}))),s.errors.height&&a.createElement(h.H.Error,null,s.errors.height)),a.createElement(h.H.FormRow,null,a.createElement(h.H.BorderBoxControl,{label:i("pregnancyWeightGain.weightInput"),rightSection:"kg"},a.createElement(m.I.Number,Object.assign({min:v.I.weight.min,max:v.I.weight.max},s.getInputProps("weight"),{placeholder:i("tools.inputPlaceholder",{content:"50"})}))),s.errors.weight&&a.createElement(h.H.Error,null,s.errors.weight)),a.createElement(h.H.Switching,Object.assign({label:i("pregnancyWeightGain.havingTwins")},s.getInputProps("hasTwin"))),a.createElement(h.H.Submit,Object.assign({type:"submit",dataEventCategory:"Health Tool",dataEventAction:"Embedded Pregnancy Weight Gain",dataEventLabel:`https://${b.v[u?"vi-VN_MB":l]}/${r}`,className:"due-date-calculate-button"},d),i("dueDatePage.lastPeriod.calculate")))},PWGForm=e=>{var{formLayout:t="default",submitProps:i,onSubmit:l}=e,m=(0,n.a)(e,["formLayout","submitProps","onSubmit"]);let{t:u,locale:g}=(0,c.u)(),h=(0,o.rZ)(),v="mb"===h.other.template,b=(0,r.c)({validate:{pregnantWeek:(0,s.U)(u("validation.error.requiredField")),height:(0,s.U)(u("validation.error.requiredField")),weight:(e,t)=>e?Number(e)>=Number(t.lastWeight)?null:u("pregnancyWeightGain.weightInput.error"):u("validation.error.requiredField"),lastWeight:(e,t)=>e?Number(e)y(p.H.PWG),[y]),E=Object.assign({onSubmit:b.onSubmit(l)},m);return a.createElement(w.Provider,{value:{linkTool:f,form:b,submitProps:i}},"inline"===t?a.createElement(InlineForm,Object.assign({},E)):v?a.createElement(MbLayout,Object.assign({formLayout:t},E)):a.createElement(DefaultForm,Object.assign({},E)))}},HOn8:function(e,t,i){i.d(t,{M:function(){return MarryBabyText},a:function(){return MarryBabyHeading}});var n=i("ubET"),a=i("q1tI"),o=i("rBCA"),l=i("iBNF");let r=(0,o.Z)(e=>{var{type:t}=e,i=(0,n.a)(e,["type"]);return a.createElement(t,i)})` color: var(--text-color, ${l.r.mbColors.dark}); font-family: Krub; font-weight: 600; letter-spacing: -0.2px; &[data-type='headline-1'] { font-size: 40px; line-height: 60px; } &[data-type='headline-2'] { font-size: 32px; line-height: 48px; } &[data-type='headline-3'] { font-size: 24px; line-height: 40px; } &[data-type='headline-4'] { font-size: 18px; line-height: 32px; } `,s=o.Z.p` color: var(--text-color, ${l.r.mbColors.dark}); letter-spacing: -0.2px; &[data-type='subtitle-1'] { font-size: 16px; font-weight: 600; line-height: 26px; } &[data-type='subtitle-2'] { font-size: 14px; font-weight: 500; line-height: 24px; } &[data-type='subtitle-3'] { font-size: 12px; font-weight: 500; line-height: 20px; } &[data-type='bodytext-1'] { font-size: 16px; font-weight: 400; line-height: 28px; } &[data-type='bodytext-2'] { font-size: 14px; font-weight: 400; line-height: 24px; } &[data-type='bodytext-3'] { font-size: 12px; font-weight: 400; line-height: 20px; } &[data-type='caption-1'] { font-size: 10px; font-weight: 500; letter-spacing: -0.1px; line-height: 14px; } &[data-type='caption-2'] { font-size: 10px; font-weight: 400; letter-spacing: -0.1px; line-height: 14px; } `,MarryBabyHeading=e=>{var{type:t,color:i,style:o}=e,l=(0,n.a)(e,["type","color","style"]);return a.createElement(r,Object.assign({type:t,"data-type":{h1:"headline-1",h2:"headline-2",h3:"headline-3",h4:"headline-4"}[t],style:Object.assign(Object.assign({},i&&{"--text-color":i}),o)},l))},MarryBabyText=e=>{var{type:t,color:i,style:o}=e,l=(0,n.a)(e,["type","color","style"]);return a.createElement(s,Object.assign({"data-type":t,style:Object.assign(Object.assign({},o),i&&{"--text-color":i})},l))}},rq7i:function(e,t,i){i.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 n=i("ubET"),a=i("q1tI"),o=i("kqU0"),l=i("VgLc"),r=i("RF7b"),s=i("ns0B"),d=i.n(s),c=i("I12S"),p=i("x9hL"),m=i("990U"),u=i("aZjv"),g=i("Hcm0"),h=i("HNv6"),v=i("rBCA"),b=i("nm4t"),w=i("iBNF"),y=i("O4+M"),f=i("IQVP"),E=i("uPjh"),x=i("WbBJ"),k=i("Dz2Q"),C=i("UPG7"),I=i("sept"),S=i("wTqk"),P=i("vWP/"),T=i("VLUI"),j=i("h84G"),_=i("MZpI"),N=i("QaGV"),O=i("bpvy"),R=i("1WGw"),M=i("lhAG"),z=i("vec8"),A=i("nwSF"),B=i("xrdX"),W="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",D="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",H="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:i,post:o,className:l="",popoverClassName:s="",onEditPost:d})=>{let{data:{locale:v,userInfo:b,env:{isMarryBaby:w}}}=(0,a.useContext)(g.T),{t:y}=(0,r.u)(),[f,E]=(0,a.useState)(!1),[x,k]=(0,a.useState)(!1),[C,I]=(0,a.useState)(!1),{authActionWrapper:S}=(0,u.iV)(),P=e&&(null==b?void 0:b.email)&&e===String(null==b?void 0:b.email);return a.createElement("div",{className:l,onClick:e=>{e.preventDefault(),e.stopPropagation()}},C&&a.createElement(c.S,{url:i,text:null==o?void 0:o.title,onClose:()=>I(!1)}),x&&a.createElement(c.P,{thumbnail:p.C.getAssetPath("trash-bin.svg"),isThumbnailIcon:!0,title:y("popup.deletePost.title"),description:y("popup.deletePost.description"),acceptText:y("popup.deletePost.accept"),cancelText:y("popup.deletePost.cancel"),onAccept:()=>(0,n._)(void 0,void 0,void 0,function*(){if((null==o?void 0:o.id)&&!f){E(!0);try{let e=yield(0,c.h)({id:o.id,locale:v});(null==e?void 0:e.status)===1&&(null==t||t())}catch(e){}E(!1)}}),onClose:()=>k(!1)}),a.createElement(h.b,{className:s,toggleButtonContent:a.createElement("img",{src:w?W:D,loading:"lazy"}),position:"bottom",align:"end",buttonProps:{isLoading:f},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:y("actionPopover.edit"),onClick:d},{icon:H,label:y("actionPopover.delete"),onClick:()=>{S(()=>k(!0))}}]}:{isShowheader:!1,type:"list",list:[{icon:c.i,label:y("morePopover.report"),subTree:{title:y("morePopover.report.title"),description:y("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(m.R).map(e=>({label:m.R[e].label,reason:m.R[e].reportReasonText,reasonValue:e})).map(e=>({label:y(e.label),subTree:{title:y("morePopover.reportSubmit.title"),description:y("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:t=>a.createElement(c.b,{reason:e.reasonValue,reasonText:y(e.reason),postId:null==o?void 0:o.id,onClose:()=>t&&t(!1)})}}))}}]}}))},$=v.Z.div` position: relative; margin-bottom: 24px; background: white; border-radius: ${w.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: ${w.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 L="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:i="",popoverClassName:o=""})=>{let{data:{env:{isMarryBaby:l},locale:s},action:{pushNotifications:d}}=(0,a.useContext)(g.T),{t:p}=(0,r.u)(),[m,v]=(0,a.useState)(!1),{authActionWrapper:b}=(0,u.iV)();return a.createElement("div",{className:i,onClick:e=>{e.preventDefault(),e.stopPropagation()}},m&&a.createElement(c.P,{thumbnail:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3cg stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' clip-path='url(%23a)'%3e%3cpath d='M2 4.008h12m-8.667 0V2.675a1.333 1.333 0 0 1 1.334-1.333h2.666a1.333 1.333 0 0 1 1.334 1.333v1.333m2 0v9.334a1.333 1.333 0 0 1-1.334 1.333H4.667a1.333 1.333 0 0 1-1.334-1.333V4.008zm-6 3.334v4m2.666-4v4'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='a'%3e%3cpath fill='white' d='M0 .008h16v16H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:p("popup.deleteComment.title"),description:p("popup.deleteComment.description"),acceptText:p("popup.deletePost.accept"),cancelText:p("popup.deletePost.cancel"),onAccept:()=>(0,n._)(void 0,void 0,void 0,function*(){var i;if(!t)return;let n=yield(0,c.j)({id:t,locale:s});(null==n?void 0:n.status)===1?(e&&e(),d({title:"",message:p("notification.success"),type:"success"})):d({title:"",message:(null===(i=null==n?void 0:n.messages)||void 0===i?void 0:i[0])||p("notification.failure"),type:"danger"})}),onClose:()=>v(!1)}),a.createElement(h.b,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:H,label:p("actionPopover.delete"),onClick:()=>{b(()=>{v(!0)})}}]},className:o,toggleButtonContent:a.createElement("img",{src:l?W:D,loading:"lazy"}),buttonProps:{}}))},F=v.Z.div` .add-link { color: ${w.r.colors.primaryBase}; } `,G=v.Z.div` margin: 16px 0; background: ${w.r.colors.yellow50}; padding: 5px 10px; border-radius: 2px; .icon { display: inline-block; vertical-align: middle; margin-right: 6px; } `,V=v.Z.div` display: flex; align-items: center; gap: 8px; `,Z=v.Z.div` padding: 8px 16px; `,U=v.Z.div` margin-bottom: 12px; width: 100%; `,q=v.Z.div``,Q=v.Z.div` margin-bottom: 16px; `,K=v.Z.div` display: flex; flex-wrap: wrap; row-gap: 16px; ${b.M.tdUp} { align-items: center; column-gap: 24px; } `,Y=v.Z.a` display: flex; align-items: center; gap: 16px; ${b.M.mbDown} { width: 100%; justify-content: space-between; } `,X=v.Z.div` display: flex; align-items: center; gap: 16px; `,J=v.Z.div` border-radius: ${w.r.borderRadius}; overflow: hidden; width: 48px; height: 48px; img { object-fit: cover; width: 100%; height: 100%; } `,RecommentCategories=({categories:e})=>{let{t}=(0,r.u)(),{data:{locale:i,env:{isMarryBaby:n}}}=(0,a.useContext)(g.T),o=(0,A.g)(i,n);return a.createElement(q,null,a.createElement(Q,null,a.createElement(l.H,{tag:"h6",as:"h5"},t("cardReply.recommentCategories.heading"))),a.createElement(K,null,e.map(e=>a.createElement(Y,{href:o+e.permalink,key:String(e.termId),target:"_blank"},a.createElement(X,null,a.createElement(J,null,a.createElement("img",{src:e.featureImage||p.C.getAssetPath(n?"mb-logo.svg":"/logo/logomark.png"),alt:e.displayName,loading:"lazy"})),a.createElement(M.T,{size:"s3",weight:"bold"},e.displayName)),a.createElement(T.Z,{size:20,color:w.r.colors.gray400})))))},ee=v.Z.a` padding: 12px 0; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid ${w.r.colors.neutral100}; text-decoration: none; &:first-child { border-top: 0; } `,SourceItem=({postTitle:e,articleReviewed:t,modifiedTime:i,href:n})=>{let{t:o}=(0,r.u)(),l=(()=>{let{expert:e,editor:i,is_author:n}=t;if(e){let t={name:e.display_name,role:"expert",avatar:e.avatar};return n?Object.assign({title:o("articleAuthor.title.written-by")},t):"expert"===e.role?Object.assign({title:o("articleAuthor.title.expert")},t):Object.assign({title:o("articleAuthor.title.medical")},t)}if(i)return{title:o("articleAuthor.title.fact-check"),name:i.display_name,avatar:i.avatar}})();return a.createElement(ee,{href:n,title:e,target:"_blank"},a.createElement(M.T,{size:"s3",as:"h5",weight:"bold"},e),a.createElement("div",null,a.createElement(x.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},a.createElement(x.C.SubTextRow,null,a.createElement(x.C.SubText,null,null==l?void 0:l.title," ",a.createElement("span",{style:{color:w.r.colors.gray800}},null==l?void 0:l.name)),a.createElement(x.C.SubDivider,null),a.createElement(x.C.SubText,null,i)))))};var et={header:"F4mmgSy",chevron:"A7QrQ7A"};let SourceList=e=>{var{listUrl:t,hideSourceList:i,categorySlug:s,editMode:d,collapseSource:c,onListChange:m,isMarryBaby:u}=e,h=(0,n.a)(e,["listUrl","hideSourceList","categorySlug","editMode","collapseSource","onListChange","isMarryBaby"]);let{t:v}=(0,r.u)(),[b,E]=(0,a.useState)(t||[]),[x,k]=(0,a.useState)([]),[C,I]=(0,a.useState)([]),[S,T]=(0,a.useState)(!1);(0,a.useEffect)(()=>{i||(0,n._)(void 0,void 0,void 0,function*(){T(!0);let e=b.map(e=>{let t=new URL(e),i=String(t.pathname).split("/").filter(e=>""!=e),n=t.origin,a=-1!==n.search("marrybaby.vn");return{isMarrySite:a,path:i[i.length-1],href:e}}),t=[...e.map(e=>(0,g.c)(e.isMarrySite?(0,g.s)(f.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0):(0,g.g)(f.D9.GET_PREVIEW_ARTICLE,{fullSlug:e.path},!0),"GET"))],i=yield Promise.all(t);k(i.map((t,i)=>{var n,a;return(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.post)&&Object.assign(Object.assign({},(0,y.f)(null===(a=null==t?void 0:t.data)||void 0===a?void 0:a.post)),{href:e[i].href})}).filter(Boolean)),T(!1)})},[]),(0,a.useEffect)(()=>{!i&&(null==x?void 0:x.length)===0&&s&&(0,n._)(void 0,void 0,void 0,function*(){var e;let t=yield(0,g.c)(u?(0,g.s)(f.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0):(0,g.g)(f.D9.GET_CATEGORY_OR_ARTICLE_DETAIL,{fullSlug:s},!0),"GET");(null==t?void 0:t.data)&&I([(0,y.h)(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.category)])})},[x]);let handleRemoveItem=e=>{E(t=>{let i=[...t];return i.splice(e,1),i}),k(t=>{let i=[...t];return i.splice(e,1),i})};return(0,a.useEffect)(()=>{null==m||m(b)},[b]),a.createElement("div",Object.assign({},h),!d&&a.createElement(G,null,a.createElement("img",{className:"icon",src:p.C.getAssetPath("warning.svg"),alt:"warning",style:{marginBottom:"3px",width:"18px"},loading:"lazy"}),a.createElement(M.T,{size:"s3",as:"span",dangerouslySetInnerHTML:{__html:v("cardReply.disclaimer")}})),i?null:S?a.createElement(z.L,null):x.length>0||d?a.createElement(F,null,a.createElement(O.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 ${w.r.colors.neutral100}`},item:{marginBottom:"16px",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",border:`1px solid ${w.r.colors.neutral100}`,borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px","&[data-active]":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},chevron:a.createElement("div",{className:et.chevron},a.createElement(j.Z,{color:w.r.colors.gray600,size:20}))},a.createElement(O.U.Item,{value:"accordion"},a.createElement(O.U.Control,null,a.createElement("div",{className:et.header},a.createElement(l.H,{as:"h4",tag:"h6"},v("cardReply.source")))),a.createElement(O.U.Panel,null,a.createElement(Z,null,(x||[]).map((e,t)=>a.createElement(V,{key:String(t)},"object"==typeof e?a.createElement(SourceItem,Object.assign({},e)):a.createElement(U,null,a.createElement(R.I,{style:{width:"100%"},name:"source-list",value:e||"",size:"sm",onChange:e=>{E(i=>{let n=[...i];return n[t]=e,n}),k(i=>{let n=[...i];return n[t]=e,n})}})),d&&a.createElement(o.B,{size:"md",color:"transparent",icon:a.createElement(_.Z,null),onClick:()=>handleRemoveItem(t)}))),d&&a.createElement(o.B,{className:"add-link",color:"transparent",size:"md",icon:a.createElement(P.Z,{color:w.r.colors.primaryBase,size:18}),onClick:()=>{E(e=>[...e,""]),k(e=>[...e,""])}},"Add source")))))):a.createElement(RecommentCategories,{categories:C}))},ei=v.Z.div` position: relative; margin-bottom: 0; background: white; border-radius: ${w.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: ${w.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; } } `,en=(0,v.Z)(SourceList)` margin-top: 12px; padding: 0.5rem 1rem 1rem; `,VerifiedTag=({userId:e,avatar:t,name:i,role:n,title:l,className:s})=>{let{t:d}=(0,r.u)(),[c,p]=(0,a.useState)(!1);return a.createElement(a.Fragment,null,a.createElement(o.B,{className:`-dzIuHr ${s}`,color:"success",size:"xs",onClick:()=>p(!0),style:{padding:"5px 8px",marginBottom:"12px",borderRadius:"4px"}},a.createElement("span",{className:"text"},a.createElement(N.Z,{isSolid:!0,size:18,color:w.r.colors.green800,className:"icon"}),d("cardReply.verifyBy",{name:`${i||""}`}))),a.createElement(x.c,{open:c,onClose:()=>p(!1),profileModalProps:{zIndex:1e3}},a.createElement(k.a,{authorProps:{userId:e,avatar:t,name:i,role:n,title:l},hideQuestionTab:!0})))},CardReply=({className:e,style:t,comment:i,type:l="comment",level:s=0,replyingId:d,onPostCommentSuccess:p,post:m,onDeleteComment:v,refetchComment:b,hasQuickBookingEnable:w,handleMakeAppointment:y,cardAuthorProps:I,maxChars:P=600,disableShortenContent:T})=>{var j,_,N,O,R,M,z,A,W,D,H,$,L;let{data:{locale:F,userInfo:G,env:{isMarryBaby:V}}}=(0,a.useContext)(g.T),{t:Z}=(0,r.u)(),[U,q]=(0,a.useState)(i||null),{id:Q,countLikes:K,content:Y,replies:X=[],images:J=[],author:ee,liked:et,link:ea,mentionedUser:eo,mentions:el}=U,{text:er,replyingTo:es}=(0,c.k)(Y),{authActionWrapper:ed}=(0,u.iV)({_joinCommunityIds:[null===(j=null==m?void 0:m.community)||void 0===j?void 0:j.id],_joinTopicIds:null===(_=null==m?void 0:m.topics)||void 0===_?void 0:_.map(e=>e.id)}),[ec,ep]=(0,a.useState)(4),em=null!=G&&!!G.id&&(null==X?void 0:X.some(e=>e.author.id===G.id)),addNewReply=e=>{q(t=>{if(!t.replies.find(t=>t.id===e.id)){t.replies.unshift(e);let i=Object.assign(Object.assign({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return b&&b(i),i}return t})},[eu,eg]=(0,a.useState)(!1),eh=(0,a.useMemo)(()=>"comment"===l&&X&&0!=X.length?X.sort((e,t)=>{let i=new Date(e.createdAt).getTime(),n=new Date(t.createdAt).getTime();return i>n?-1:i{var e,t;(null==ee?void 0:ee.hospitalId)&&(e=ee.hospitalId,(0,n._)(void 0,void 0,void 0,function*(){var t;let i=yield(0,g.c)((0,g.b)(f.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:B.v[F]}),"get");(null===(t=null==i?void 0:i._data)||void 0===t?void 0:t.branch)&&eC(null==i?void 0:i._data.branch)})),(null==ee?void 0:ee.doctorId)&&(t=ee.doctorId,(0,n._)(void 0,void 0,void 0,function*(){var e;let i=yield(0,g.c)((0,g.b)(f.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:B.v[F]}),"get");(null===(e=null==i?void 0:i._data)||void 0===e?void 0:e.doctor)&&eS(null==i?void 0:i._data.doctor)}))},[ee.hospitalId,ee.doctorId]);let eP=(null==eI?void 0:eI.valid_outpatient)||(null==eI?void 0:eI.valid_telemedicine),eT=((null==ek?void 0:ek.total_available_service)||(null==ek?void 0:ek.total_available_doctor))>0,ej=w&&(eP||eT),e_=(null===(O=null==U?void 0:U.author)||void 0===O?void 0:O.type)==="chatbot";return a.createElement(u.I_,{defaultParams:{_joinCommunityIds:[null===(R=null==m?void 0:m.community)||void 0===R?void 0:R.id],_joinTopicIds:null===(M=null==m?void 0:m.topics)||void 0===M?void 0:M.map(e=>e.id)}},a.createElement(ei,{className:e,style:t,"data-is-reply":!!s,"data-is-marrybaby":V,"data-has-booking":ej},"reply"===l&&a.createElement(S.D,{className:"top-divider",type:"solid"}),a.createElement("div",{style:{padding:"16px 16px 0"}},a.createElement(x.C,Object.assign({avatar:ef,name:ew,username:ey,timeText:null==m?void 0:m.createdTime,community:null==m?void 0:m.community,className:`post-author ${eb?"with-popover":""}`,type:l,userId:null==ee?void 0:ee.id,role:eE,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:ej,handleMakeAppointment:y,isAnonymous:(null==U?void 0:U.isAnonymous)||!!(null==m?void 0:m.isAnonymous)&&(null===(z=null==m?void 0:m.author)||void 0===z?void 0:z.username)===(null==ee?void 0:ee.username),hideBackground:e_,userType:null==ee?void 0:ee.type},I)),!!(null==U?void 0:U.isVerify)&&!(null==U?void 0:U.isOppose)&&a.createElement(VerifiedTag,{title:null===(A=null==U?void 0:U.userVerify)||void 0===A?void 0:A.title,name:null===(W=null==U?void 0:U.userVerify)||void 0===W?void 0:W.name,userId:null===(D=null==U?void 0:U.userVerify)||void 0===D?void 0:D.id,role:null===(H=null==U?void 0:U.userVerify)||void 0===H?void 0:H.role,avatar:null===($=null==U?void 0:U.userVerify)||void 0===$?void 0:$.avatar,className:"verify-tag"})),a.createElement(k.P,{className:"post-content-wrapper",replyingTo:es,mentionedUser:eo,description:er,mentions:ex,maxChars:P,disableShortenContent:T}),a.createElement("span",null),a.createElement("span",null),J&&J.length>0?a.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},a.createElement(C.a,{images:J,authorName:null==ee?void 0:ee.username})):null,(!J||0===J.length)&&ea?a.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},a.createElement(E.C,{url:ea})):null,"most-engaging"!==l?a.createElement(a.Fragment,null,e_&&a.createElement(en,{listUrl:null==U?void 0:U.source,categorySlug:null==U?void 0:U.categorySlug}),a.createElement(h.C,{type:h.c.reply,loveCount:K,replyCount:ev,className:"post-reaction",liked:et,isReplied:em,hideCommentIcon:"reply"===l||e_,hasShare:!1,onCommentClick:()=>ed(()=>eg(e=>!e)),onCommentCountClick:()=>ed(()=>{eg(!0)}),onLikeClick:()=>ed(()=>(0,n._)(void 0,void 0,void 0,function*(){if(Q){let e=yield(0,c.l)({commentId:Q,setLike:!et,locale:F});1===e.status&&q(e=>Object.assign(Object.assign({},e),{liked:!et,countLikes:e.countLikes+(et?-1:1)}))}}))}),eu&&a.createElement(c.I,{replyingId:d||U.id,replyToName:ew,isReply:!0,onClose:()=>eg(!1),onPostSuccess:e=>{"reply"===l?p&&p(e):addNewReply(e)},post:m,replyingUser:ee}),"comment"===l&&X&&X.length>0?a.createElement("div",{className:"comment-reply-wrapper"},null===(L=null==eh?void 0:eh.slice(0,ec))||void 0===L?void 0:L.map(e=>a.createElement(CardReply,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:s+1,replyingId:Q,onPostCommentSuccess:addNewReply,post:m,onDeleteComment:()=>{q(t=>Object.assign(Object.assign({},t),{replies:t.replies.filter(t=>t.id!==e.id),countReplies:t.countReplies-1}))},handleMakeAppointment:y,hasQuickBookingEnable:w})),ev>ec&&a.createElement(a.Fragment,null,a.createElement(S.D,{className:"top-divider",type:"solid"}),a.createElement(o.B,{className:"more-cmt",size:"lg",color:"ghost",onClick:()=>ep(e=>e+4)},Z("comment.seeMoreReplies",{count:ev-ec}),a.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 12 4-4-4-4'/%3e%3c/svg%3e",loading:"lazy"})))):null):null,eb&&a.createElement(CardReplyPopover,{onDeleteComment:v,className:"popover",commentId:U.id})))},getMostEngagingComment=(e,t)=>(0,n._)(void 0,void 0,void 0,function*(){var i,n,a;let o=yield(0,g.t)((0,g.f)(f.yy.COMMENT.LIST,{postId:e,_locale:t,sort:"popularity",perPage:1,withoutReply:1}),"GET");return null===(a=null===(n=null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.comments)||void 0===n?void 0:n.map(y.g))||void 0===a?void 0:a[0]}),CardPost=({className:e,style:t,hideViewMoreComment:i,showMostEngaging:s,onCommentClick:p,onCommentCountClick:v,onMostEngagingCommentClick:b,onPostCommentSuccess:w,disableCardLink:y,disableShortenContent:S,onDeletePost:P,onEditPost:T,post:j,mostEngagingComment:_,onDeleteComment:N,showInputComment:O,InlineCommentsComponent:R,hasQuickBookingEnable:M,handleMakeAppointment:z,onSaveUnsaveSuccess:A,cardAuthorProps:B,verticalReactions:W=!1})=>{let[D,H]=(0,a.useState)(j),[F,G]=(0,a.useState)(!1),[V,Z]=(0,a.useState)(_),{community:U,topics:q,author:Q,slug:K,isPin:Y,liked:X,photos:J,mentions:ee,title:et,description:ei,previewUrl:en,likesCount:ea,commentsCount:eo,id:el,commented:er}=D,{data:{locale:es,togetherUserId:ed,userInfo:ec,env:{isMarryBaby:ep,togetherBasePath:em}},action:{pushNotifications:eu}}=(0,a.useContext)(g.T),eg=!!(null==ec?void 0:ec.id),{t:eh}=(0,r.u)(),[ev,eb]=(0,a.useState)(O),ew=`${em}/${(null==U?void 0:U.slug)||"_"}/${K||""}`,ey=`${(0,g.l)(es)}${ew}`,{authActionWrapper:ef}=(0,u.iV)((null==U?void 0:U.slug)?{_joinCommunityIds:[U.id],_joinTopicIds:null==q?void 0:q.map(e=>e.id)}:void 0),[eE,ex]=(0,a.useState)(!1);(0,a.useEffect)(()=>{eb(O)},[O]);let ek=(null==Q?void 0:Q.name)||(null==Q?void 0:Q.username)||"",eC=(null==Q?void 0:Q.username)||(null==Q?void 0:Q.name)||"",eI=null==Q?void 0:Q.avatar,eS=(null==D?void 0:D.isAnonymous)?void 0:null==Q?void 0:Q.role,[eP,eT]=(0,a.useState)(null),[ej,e_]=(0,a.useState)(null);(0,a.useEffect)(()=>{var e,t;(null==Q?void 0:Q.hospitalId)&&(e=Q.hospitalId,(0,n._)(void 0,void 0,void 0,function*(){var t;let i=yield(0,g.c)((0,g.b)(f.tC.GET_HOSPITAL_INFO,{hospital_branch_id:e,website_url:g.m[es]}),"get");(null===(t=null==i?void 0:i._data)||void 0===t?void 0:t.branch)&&eT(null==i?void 0:i._data.branch)})),(null==Q?void 0:Q.doctorId)&&(t=Q.doctorId,(0,n._)(void 0,void 0,void 0,function*(){var e;let i=yield(0,g.c)((0,g.b)(f.tC.GET_DOCTOR_INFO,{doctorId:t,website_url:g.m[es]}),"get");(null===(e=null==i?void 0:i._data)||void 0===e?void 0:e.doctor)&&e_(null==i?void 0:i._data.doctor)}))},[Q.hospitalId,Q.doctorId]);let eN=(null==ej?void 0:ej.valid_outpatient)||(null==ej?void 0:ej.valid_telemedicine),eO=((null==eP?void 0:eP.total_available_service)||(null==eP?void 0:eP.total_available_doctor))>0;(0,a.useEffect)(()=>{(0,n._)(void 0,void 0,void 0,function*(){if(el&&eo&&s&&!(null==_?void 0:_.id)){let e=yield getMostEngagingComment(el,es);Z(e)}})},[el,es,eo,s,null==_?void 0:_.id]),(0,a.useEffect)(()=>{Z(_)},[null==_?void 0:_.id]);let onDeleteComment=e=>(0,n._)(void 0,void 0,void 0,function*(){if(eo>1&&(null==V?void 0:V.id)&&(null==V?void 0:V.id)===(null==e?void 0:e.id)){let e=yield getMostEngagingComment(el,es);Z(e)}H(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount-1})),N&&N(e)});return a.createElement(u.I_,{defaultParams:(null==U?void 0:U.slug)?{_joinCommunityIds:[U.id],_joinTopicIds:null==q?void 0:q.map(e=>e.id)}:void 0},F&&a.createElement(c.S,{url:ey,avatar:m.a,text:et,onClose:()=>G(!1)}),a.createElement($,{className:e,style:t,"data-is-marrybaby":ep},Y?a.createElement(h.a,{className:"post-pin"}):null,a.createElement("div",{style:{position:"relative",padding:"1rem 1rem 0"}},a.createElement(x.C,Object.assign({avatar:eI,name:ek,username:eC,url:y?void 0:ew,community:U,timeText:null==D?void 0:D.createdTime,className:"post-author",role:eS,userId:null==Q?void 0:Q.id,expertId:null==Q?void 0:Q.partnerId,doctorId:null==Q?void 0:Q.doctorId,hospitalId:null==Q?void 0:Q.hospitalId,title:null==Q?void 0:Q.title,hasQuickBooking:M&&(eN||eO),handleMakeAppointment:z,"data-testid":"name",isAnonymous:!!(null==D?void 0:D.isAnonymous),extendEle:a.createElement(CardPostPopoverMore,{authorEmail:String(null==Q?void 0:Q.email),onDeletePost:P,shareUrl:ey,post:D,className:"popover",onEditPost:T})},B))),a.createElement("a",{href:y?void 0:ew,className:"post-content-link-wrapper"},et&&a.createElement(l.H,{className:"post-content-title",as:"h2",tag:"h5",fontWeight:"bold","data-testid":"Title of the Post"},d()(et)),a.createElement(k.P,{className:"post-content-wrapper",description:ei,disableShortenContent:S,mentions:ee,"data-testid":"Content of the Post"})),a.createElement("span",null),a.createElement("span",null),a.createElement("div",{key:"tag-topic"},q&&q.length>0?a.createElement(h.T,{topics:q,className:"post-topics"}):null),a.createElement("div",{key:"social-preview"},(null==D?void 0:D.introUrl)?a.createElement("div",{className:`social-preview-wrapper ${(null==J?void 0:J.length)?"has-image":""}`},a.createElement(I.S,{url:D.introUrl,image:D.bannerImage})):null),a.createElement("div",{key:"image-preview"},(null==J?void 0:J.length)?a.createElement("div",{className:"image-preview-wrapper"},a.createElement(C.a,{images:J,authorName:null==Q?void 0:Q.name,isSensitive:!!(null==D?void 0:D.isSensitive)})):null),a.createElement("div",{key:"link-preview"},(null==D?void 0:D.introUrl)||(null==J?void 0:J.length)||null==en||!en.url?null:a.createElement("div",{className:"link-preview-wrapper"},a.createElement(E.C,{title:en.title,url:en.url,image:en.image}))),a.createElement(h.C,{isMarryBaby:ep,type:h.c.post,loveCount:ea,replyCount:eo,className:`post-reaction ${(null==J?void 0:J.length)||(null==en?void 0:en.url)?"hide-top-border":""}`,liked:eE?!X:X,isReplied:er,isSaved:(null==D?void 0:D.bookmarked)||!1,onCommentClick:()=>ef(()=>{p?p():eb(e=>!e)}),onCommentCountClick:()=>{ef(()=>{ep?eb(!0):v?v():y||(window.location.href=ew)})},onShareClick:()=>{G(!0)},onLikeClick:()=>(0,n._)(void 0,void 0,void 0,function*(){ef(()=>(0,n._)(void 0,void 0,void 0,function*(){if(el&&!eE){ex(!0);try{let e=yield(0,c.m)({id:el,locale:es});(null==e?void 0:e.status)!==1?eu((0,c.g)(eh)):H(e=>Object.assign(Object.assign({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked}))}catch(e){eu((0,c.g)(eh))}ex(!1)}}))}),onSaveClick:()=>{ef(()=>(0,n._)(void 0,void 0,void 0,function*(){if((null==ec?void 0:ec.id)&&(null==D?void 0:D.id)){if(null==D?void 0:D.bookmarked){let e=yield(0,g.e)((0,g.f)(f.yy.BOOKMARK.DELETE,{_locale:es}),"DELETE",{headers:{"Content-Type":"application/json"},data:{post_id:String(D.id)}});(null==e?void 0:e.status)===1?(eu({title:"",message:eh("post.remove.success"),type:"success",displayIcon:L}),null==A||A()):eu({title:"",message:eh("post.remove.failed"),type:"danger",displayIcon:L})}else{let e=yield(0,g.e)((0,g.f)(f.yy.BOOKMARK.CREATE,{_locale:es}),"POST",{headers:{"Content-Type":"application/json"},data:{user_id:ed||ec.id,post_id:D.id}});(null==e?void 0:e.status)===1?(eu({title:"",message:eh("post.save.success"),type:"success",displayIcon:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23595959'%3e%3cpath stroke='%23595959' stroke-linecap='round' stroke-linejoin='round' d='M12 13.333 8 10.37l-4 2.963V3.852c0-.314.12-.616.335-.838.214-.222.505-.347.808-.347h5.714c.303 0 .594.125.808.347s.335.524.335.838z'/%3e%3c/svg%3e"}),null==A||A()):eu({title:"",message:eh("post.save.failed"),type:"danger",displayIcon:L})}}}))},onGoToUrl:e=>{let t=e?`${ey}${e}`:ey;eg?window.location.href=t:ef(()=>window.location.href=t)},showingMostEngaging:!!(s&&(null==V?void 0:V.id)),isVertical:W}),ev&&a.createElement(c.I,{isMainCmt:!O,onClose:()=>eb(!1),onPostSuccess:e=>{0!==eo||(null==V?void 0:V.id)||Z(e),H(e=>Object.assign(Object.assign({},e),{commentsCount:e.commentsCount+1,commented:!0})),w&&w(e)},post:D}),s&&(null==V?void 0:V.id)?a.createElement("div",{className:"most-engaging-wrapper",onClick:e=>{b?(e.stopPropagation(),b()):window.location.href=ew}},a.createElement(CardReply,{hasQuickBookingEnable:M,handleMakeAppointment:z,comment:V,post:D,onDeleteComment:()=>{onDeleteComment&&onDeleteComment(V)},className:"most-engaging-comment",type:"most-engaging",key:V.id,cardAuthorProps:B}),eo>1&&!i&&a.createElement(o.B,{className:"see-more-comments",color:"ghost",size:"md"},eh("comment.seeMoreComments",{count:eo-1}))):null,R))}},Fuix:function(e,t,i){i.d(t,{T:function(){return s}});var n=i("q1tI"),a=i("rBCA"),o=i("1WGw"),l=i("iBNF");let r=a.Z.div` textarea { width: 100%; height: var(--textarea-height, 116px); padding: 1rem; border: 1px solid ${l.r.colors.gray200}; border-radius: 6px; color: ${l.r.colors.gray800}; font-size: 14px; resize: none; &:focus { box-shadow: 0px 0px 2px 2px #91caff; } &::placeholder { color: ${l.r.colors.gray500}; } &:disabled { background-color: ${l.r.colors.neutral50}; cursor: not-allowed; } } `,s=n.forwardRef(({height:e,placeholder:t,labelText:i,labelColor:a,id:l,name:s,onChange:d,value:c,className:p,onKeyPress:m,disabled:u=!1},g)=>n.createElement(r,{className:p,style:{"--textarea-height":e||"116px"}},i&&n.createElement(o.L,{size:"label2",style:{color:a||"#595959"},htmlFor:l},i),n.createElement("textarea",{name:s,ref:g,placeholder:t,id:l,onChange:e=>d&&d(e.target.value),onKeyPress:e=>m&&m(e),value:c,disabled:u})))}}]);