(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4618],{8346:function(e,t,n){"use strict";n.d(t,{N:function(){return i},w:function(){return c}});var r=n(91256),o=n(95983),i=r.ZP.div.withConfig({displayName:"indexstyled__StyledLoading",componentId:"sc-4vozm6-0"})(["display:flex;align-items:center;justify-content:center;padding:1em;button{position:relative;}"]),a=(0,r.F4)(["0%{transfrom:rotate(0deg);}100%{transform:rotate(360deg);}"]),c=r.ZP.div.withConfig({displayName:"indexstyled__StyledLoadingCard",componentId:"sc-4vozm6-1"})(["display:flex;width:fit-content;width:-moz-fit-content;flex-direction:column;align-items:center;justify-content:center;padding:1rem 2rem;background:white;border-radius:6px;box-shadow:-1px 1px 2px rgba(67,70,74,0.0001),-2px 2px 5px rgba(67,86,100,0.123689);.loading-spinner{width:24px;height:24px;margin-bottom:0.5rem;animation:"," 1.2s linear infinite;}",""],a,o.fn&&(0,r.iv)(["box-shadow:none;"]))},68558:function(e,t,n){"use strict";n.d(t,{g:function(){return c}});var r=n(85893),o=n(42010),i=n(86896),a=n(8346),c=function(e){var t=e.className,n=e.size,c=void 0===n?"md":n,u=(0,i.Z)().formatMessage;return(0,r.jsx)(a.N,{className:t,children:(0,r.jsx)(o.B,{size:c,color:"transparent",isLoading:!0,style:{fontWeight:"normal"},children:u({id:"loading"})})})}},13723:function(e,t,n){"use strict";n.d(t,{R:function(){return g}});var r=n(85893),o=n(26265),i=(n(67294),n(11024)),a=n(46784),c=n(5152),u=n(86896),s=n(7632),l=n(91256).ZP.div.withConfig({displayName:"indexstyled__StyledCreatePostDescription",componentId:"sc-6wrgw0-0"})(["input:focus,textarea:focus,[contenteditable='true']{outline:none;}.textarea-control{position:relative;&.--focus{border-color:",";box-shadow:0px 0px 2px 2px ",";}}.description-label{margin-bottom:5px;color:",";font-size:13px;font-weight:bold;}.count-string{margin-top:5px;color:",";font-size:11px;text-align:right;}.input-notification{display:flex;& > img{width:16px;height:16px;margin-top:1.5px;margin-right:8px;}}.custom-media-popup-frame{> div[data-open='true']:first-child{z-index:1000;}.custom-media-dialog{padding:1rem;.image-gallery{.image-item{&.no-image{cursor:pointer;}.camera-btn{position:absolute;top:calc(100% - 32px);right:8px;left:unset;width:24px;height:24px;}}}.custom-media-add-btn{margin-left:auto;display:block;}}}"],(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.primaryBase}),(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.blue200}),(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.gray600}),(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.gray500}));function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t ../../molecules/editor"]}}),m=(0,c.default)((function(){return Promise.all([n.e(9774),n.e(2937),n.e(7127),n.e(8007),n.e(4447),n.e(9877)]).then(n.bind(n,4447)).then((function(e){return e.RichTextProvider.Editor}))}),{loading:function(){return null},ssr:!1,loadableGenerated:{webpack:function(){return[4447]},modules:["../components/molecules/createPostDescription/index.tsx -> ../../molecules/editor"]}}),v=(0,c.default)((function(){return Promise.all([n.e(9774),n.e(2937),n.e(7127),n.e(8007),n.e(4447),n.e(9877)]).then(n.bind(n,4447)).then((function(e){return e.RichTextProvider.PreviewCard}))}),{loading:function(){return null},ssr:!1,loadableGenerated:{webpack:function(){return[4447]},modules:["../components/molecules/createPostDescription/index.tsx -> ../../molecules/editor"]}}),h=(0,c.default)((function(){return Promise.all([n.e(9774),n.e(2937),n.e(7127),n.e(8007),n.e(4447),n.e(9877)]).then(n.bind(n,4447)).then((function(e){return e.RichTextProvider.Error}))}),{loading:function(){return null},ssr:!1,loadableGenerated:{webpack:function(){return[4447]},modules:["../components/molecules/createPostDescription/index.tsx -> ../../molecules/editor"]}}),g=function(e){var t=e.heading,n=e.className,o=void 0===n?"":n,c=e.style,d=void 0===c?{}:c,g=e.bannedWords,x=void 0===g?[]:g,b=e.value,y=e.onChange,w=e.onPreviewUrlChange,k=e.onInvalidUrlsChange,j=e.imageFiles,T=e.onImageFilesChange,O=e.isReplying,P=e.onSocialLinkChanged,S=e.socialLinkData,C=e.isComment,D=e.isFullscreen,_=void 0!==D&&D,N=e.showSocialLink,E=void 0===N||N,A=e.hasCreatePost,Z=(0,u.Z)().formatMessage,M={value:b,onChange:y,bannedWords:x,imageFiles:j,onImageFilesChange:T,onSocialLinkChanged:P,onInvalidUrlsChange:k,onPreviewUrlChange:w,isReplying:O,socialLinkData:S,hasEmbbedSocialLink:!C,hasExpandPopup:!1,hasExpandToolbar:!1,hasCreatePost:A};return(0,r.jsx)(f,p(p({},M),{},{children:(0,r.jsxs)(l,{className:o,style:d,children:[t&&(0,r.jsx)(i.T,{size:"p4",className:"description-label",children:t}),(0,r.jsx)("div",{className:"textarea-control",children:(0,r.jsx)("div",{className:"textarea-wrapper",children:(0,r.jsx)(m,{resize:!0,toolbarStyle:{borderTopLeftRadius:6,borderTopRightRadius:6,border:"1px solid ".concat(a.t.colors.gray200)},textareaStyle:p({border:"1px solid ".concat(a.t.colors.gray200),borderTop:0},_?{minHeight:155}:{height:155}),showSocialLink:E})})}),(0,r.jsx)(s.k,{}),(0,r.jsx)(h,{}),(0,r.jsx)(v,{socialLinkTitle:(0,r.jsx)(i.T,{size:"p4",type:"bold",children:Z({id:"editor.previewTitle.socialLink",defaultMessage:"Video/Social Link"})}),attachImageTitle:(0,r.jsx)(i.T,{size:"p4",type:"bold",children:Z({id:"editor.previewTitle.images",defaultMessage:"Images"})})})]})}))}},46298:function(e,t,n){"use strict";n.d(t,{Y:function(){return h}});var r=n(85893),o=n(67294),i=n(55482),a=n(11024),c=n(23279),u=n.n(c),s=n(61512),l=n.n(s),d=n(86896),p=n(13199),f=n(91256).ZP.div.withConfig({displayName:"indexstyled__StyledCreatePostTitle",componentId:"sc-2oizzo-0"})(["input:focus,textarea:focus,[contenteditable='true']{outline:none;}.title-input{overflow:hidden;width:100%;padding:12px 16px;border:solid 1px #d9d9d9;border-radius:6px;font-size:16px;line-height:1.2;white-space:nowrap;:focus{border-color:",";box-shadow:0px 0px 2px 2px ",";}br{display:none;}*{display:inline;white-space:nowrap;}mocka{padding:2px 6px;border-radius:1rem;&[data-error='true']{background-color:#ffeeee;color:red;text-decoration:underline;font-style:bold;}}ol,ul{padding-left:1rem;}}label{display:block;margin-bottom:5px;color:",";font-size:13px;font-weight:bold;}.count-string{margin-top:5px;color:",";font-size:11px;text-align:right;}"],(function(e){return e.color}),(function(e){return e.colorShadow}),(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.gray600}),(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.gray500})),m=(0,n(44036).k)((function(e){return{root:{}}})),v=function(e,t){if(!t)return e;var n=t.limit,r=t.bannedWords,o=void 0===r?[]:r,i="number"===typeof n&&n>=0?e.substring(0,n):e;return(0,p.on)(i,o)},h=function(e){var t,n=e.className,c=e.style,s=e.bannedWords,h=void 0===s?[]:s,g=e.value,x=e.onChange,b=m(void 0,{name:"CreatePostTitle"}).theme,y=b.colors,w=(0,d.Z)().formatMessage,k=(0,o.useState)(""),j=k[0],T=k[1],O=(0,o.useRef)(null);(0,o.useEffect)((function(){if(O.current){var e=function(e){var t;e.preventDefault();var n=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain");document.execCommand("insertHTML",!1,n)},t=O.current;return t.addEventListener("paste",e),function(){return t.removeEventListener("paste",e)}}}),[O]);var P=(null===h||void 0===h?void 0:h.join(","))||"";(0,o.useEffect)((function(){if(P){var e,t=null===(e=O.current)||void 0===e?void 0:e.innerText;if(t){var n=(0,p.on)(t,h);n!==t&&(x&&x(n),T(n))}}}),[P]);var S=(0,o.useCallback)(u()((function(e){if(O.current){var t=v(O.current.innerText,{limit:120,bannedWords:h});x&&x(t),T(t)}}),300),[]);return(0,o.useEffect)((function(){setTimeout((function(){var e;null===(e=O.current)||void 0===e||e.focus()}),500)}),[]),(0,r.jsxs)(f,{className:n,style:c,color:b.fn.primaryColor(),colorShadow:y[b.primaryColor][2],children:[(0,r.jsx)(i.I,{name:"title",value:g||j,size:"md",label:w({id:"createPost.title"}),CustomInput:(0,r.jsx)(l(),{innerRef:O,html:g||j,onChange:function(e){if(O.current&&O.current.innerText!==(g||j)){var t=v(O.current.innerText,{bannedWords:h});x&&x(t),T(t),S(O.current.innerText)}},className:"title-input"}),"data-testid":"Title Text box"}),(0,r.jsx)(a.T,{size:"p4",className:"count-string",children:w({id:"createPost.popup.wordCount"},{count:(null===(t=O.current)||void 0===t?void 0:t.innerText.length)||0,max:120})})]})}},94158:function(e,t,n){"use strict";n.d(t,{r:function(){return r}});var r=(0,n(67294).createContext)({})},7632:function(e,t,n){"use strict";n.d(t,{k:function(){return p}});var r=n(85893),o=n(40616),i=n(67294),a=n(36380),c=n.n(a),u=n(86896),s=n(94158),l=n(11024),d=(0,n(91256).ZP)(l.T).withConfig({displayName:"indexstyled__StyledTextWrapper",componentId:"sc-1b0bowg-0"})(["margin-top:5px;color:",";font-size:11px;text-align:right;"],(function(e){var t;return null===(t=e.theme)||void 0===t?void 0:t.colors.gray500})),p=function(e){(0,o.Z)(e);var t=(0,u.Z)().formatMessage,n=(0,i.useContext)(s.r).content;return(0,r.jsxs)(d,{size:"p4",children:[t({id:"character"}),": ",c()(n||"").length]})}},75653:function(e,t,n){"use strict";n.d(t,{w:function(){return D}});var r=n(85893),o=n(26265),i=n(67294),a=n(28140),c=n(809),u=n.n(c),s=n(92447),l=n(48560),d=n(75529),p=n(14646),f=n(93178),m=n(42874),v=n(31040),h=n(70027),g=n(96486),x=n(86896),b=n(25559),y=n(2810),w=n(24169),k=n(68558),j=n(26381),T=n(95983),O=(0,n(44036).k)((function(){return{root:{display:"flex",flexDirection:"column",gap:"1.5rem",padding:"0.5rem 0 1rem"},header:{display:"flex",flexWrap:"wrap",gap:"0.25rem"},icon:{marginTop:"1px"},group:{display:"flex",flexDirection:"column",gap:"0.5rem"},list:{display:"flex",flexWrap:"wrap",gap:"0.5rem"},dropdown:{paddingBottom:"42px"},dropdownInner:{maxHeight:"230px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"0.5rem"},item:{"&.month-topic":{textTransform:"capitalize"}},btnWrapper:{position:"absolute",right:"8px",bottom:"8px",left:"8px"}}}));function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t0&&(0,r.jsxs)("div",{className:z.group,children:[(0,r.jsxs)("div",{className:z.header,children:[(0,r.jsx)(v.Z,{className:z.icon,isSolid:!0,size:16,color:M.colors.gray[4]}),(0,r.jsx)(d.T,{size:"n1",color:M.colors.gray[6],children:A({id:"createPost.popup.guideSelectMonthTopics",defaultMessage:"Choose topics about your baby's birth month"})})]}),(0,r.jsxs)("div",{className:z.list,style:n,children:[re({data:$.filter((function(e){return 0!==(null===e||void 0===e?void 0:e.dueDateMonth)})),hasClose:!0,contentType:"both"}),(0,r.jsx)("div",{style:{width:"100%"}}),Object.keys(te).map((function(e){var t=(0,g.sortBy)(te[e]||[],["dueDateYear"]);return(0,r.jsx)(l.p,{width:120,withArrow:!0,shadow:"md",returnFocus:!0,onOpen:function(){B(e),q($.filter((function(t){return String(t.dueDateMonth)===e&&0!==t.dueDateMonth})))},onClose:function(){B(void 0),q([])},styles:{dropdown:{padding:"0.5rem"}},children:function(n){var o=n.open,i=n.close;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.p.Target,{children:(0,r.jsx)("div",{children:(0,r.jsx)(l.B,{variant:"tertiary",skipHover:!0,size:"sm",radius:"xl",className:"tag-item",styles:function(){return{root:{padding:"5px 12px"},label:{fontSize:"13px",lineHeight:"22px",fontWeight:"normal",textTransform:"capitalize"}}},onClick:o,children:C(e,E)})})}),(0,r.jsx)(l.p.Dropdown,{children:(0,r.jsxs)("div",{className:z.dropdown,children:[(0,r.jsx)("div",{className:z.dropdownInner,children:re({data:t,contentType:"year",isYearTag:!0,isTemp:!0})}),(0,r.jsx)("div",{className:z.btnWrapper,children:(0,r.jsx)(l.B,{fullWidth:!0,size:"sm",onClick:function(){U([].concat((0,a.Z)($.filter((function(e){return e.dueDateMonth!=H}))),(0,a.Z)(V))),null===i||void 0===i||i()},children:A({id:"createPost.popup.selectMonthTopicBtn",defaultMessage:"Select"})})})]})})]})}},e)}))]})]}),(T||X)&&(0,r.jsx)(k.g,{className:"topic-spinner"})]})}},1821:function(e,t,n){"use strict";n.d(t,{XR:function(){return j},ZL:function(){return O},rJ:function(){return P},qb:function(){return S},dq:function(){return C},fw:function(){return _},Jn:function(){return E}});var r=n(809),o=n.n(r),i=n(92447),a=n(67294),c=n(30381),u=n.n(c),s=n(11163),l=n(86896),d=n(2810),p=n(24169),f=n(95983),m=n(5886),v=n(18833),h=n(31474),g=n(43196),x=n(98218),b=n(13199),y=n(25559),w=n(21124),k=function(){var e=(0,i.Z)(o().mark((function e(t){var n,r,i,a,c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.id,r=t.locale,i=t.isLike,a=t.dispatch,n){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,(0,p.cA)((0,p.cN)(d.yy.POST.LIKE,{id:n,_locale:r}),"GET");case 5:return 1===(null===(c=e.sent)||void 0===c?void 0:c.status)&&a&&a({type:h.t.update,payload:{id:n,data:function(e){return{isLiked:i,likeCount:i?"number"===typeof(null===e||void 0===e?void 0:e.likeCount)?e.likeCount+1:1:"number"===typeof(null===e||void 0===e?void 0:e.likeCount)?e.likeCount-1:1}},ignoreNotFound:!0}}),e.abrupt("return",c);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),j=function(e){var t=(0,s.useRouter)().locale,n=void 0===t?"vi-VN":t,r=(0,a.useContext)(v.nj).dispatch,c=(0,a.useState)(!1),u=c[0],d=c[1],p=(0,l.Z)().formatMessage,f=(0,a.useContext)(m.I).pushNotifications,h=(0,w.h0)().authActionWrapper;return{loading:u,onLikeUnlike:function(t){var a=t.id,c=t.isLike,s=void 0!==c&&c,l=t.onCallback;return((null===e||void 0===e?void 0:e.authActionWrapper)||h)((0,i.Z)(o().mark((function e(){var t,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!u){e.next=2;break}return e.abrupt("return",t);case 2:return d(!0),e.prev=3,e.next=6,k({id:a,locale:n,isLike:s,dispatch:r});case 6:t=e.sent,1!==(null===(i=t)||void 0===i?void 0:i.status)?f((0,x.ti)(p)):null===l||void 0===l||l(s),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),f((0,x.ti)(p));case 13:return d(!1),e.abrupt("return",t);case 15:case"end":return e.stop()}}),e,null,[[3,10]])}))),{action:"like"})}}},T=function(){var e=(0,i.Z)(o().mark((function e(t){var n,r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.id,r=t.locale,i=t.dispatch,n){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,(0,p.cA)((0,p.cN)(d.yy.POST.DELETE,{id:n,_locale:r}),"DELETE");case 5:return 1===(null===(a=e.sent)||void 0===a?void 0:a.status)&&i&&i({type:h.t.remove,payload:{id:n}}),e.abrupt("return",a);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),O=function(){var e=(0,s.useRouter)().locale,t=void 0===e?"vi-VN":e,n=(0,a.useContext)(v.nj).dispatch,r=(0,w.h0)().authActionWrapper,c=(0,a.useContext)(m.I).pushNotifications,u=(0,a.useState)(!1),d=u[0],p=u[1],f=(0,l.Z)().formatMessage;return{loading:d,onDeletePost:function(e){return r((0,i.Z)(o().mark((function r(){var i,a;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!d){r.next=2;break}return r.abrupt("return",i);case 2:return p(!0),r.prev=3,r.next=6,T({id:e,locale:t,dispatch:n});case 6:i=r.sent,1===(null===(a=i)||void 0===a?void 0:a.status)?c({title:"",message:f({id:"notification.post.delete"}),type:"success"}):c((0,x.ti)(f)),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(3),c((0,x.ti)(f));case 13:return p(!1),r.abrupt("return",i);case 15:case"end":return r.stop()}}),r,null,[[3,10]])}))))}}},P=function(){var e=(0,i.Z)(o().mark((function e(t){var n,r,i,a,c,s,l,d,p,m,v,h,x,y,w,k,j,T,O,P,S,C,D;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.title,r=t.description,i=t.communityId,a=t.communityIds,c=t.imageFiles,s=t.previewUrl,l=t.topicIds,d=t.locale,p=t.isAnonymous,m=t.isAskDoctor,v=t.introUrl,h=t.bannerUrl,x=t.scheduleTime,y=t.isAdmin,w=t.isMinigame,k=t.eventStart,j=t.eventEnd,T=t.sponsorId,O=new FormData,P=(0,b.bu)(r),S=(0,b.bu)(n),C=(0,b.Dc)(P),O.append("title",S),O.append("description",(0,b.dM)(P)),i&&O.append("community_id",i),null===a||void 0===a||a.forEach((function(e){O.append("community_ids[]",String(e||""))})),O.append("is_anonymous",p?"1":"0"),O.append("is_question",m?"1":"0"),(null===s||void 0===s?void 0:s.title)&&O.append("preview_title",s.title),(null===s||void 0===s?void 0:s.description)&&O.append("preview_description",s.description),(null===s||void 0===s?void 0:s.url)&&O.append("preview_link",(0,g.R1)(s.url)),(null===s||void 0===s?void 0:s.image)&&O.append("preview_image",(0,g.R1)(s.image)),null===l||void 0===l||l.forEach((function(e){O.append("topics[]",String(e||""))})),T&&O.append("sponsor_id",T),null===c||void 0===c||!c.length){e.next=24;break}return e.next=20,Promise.all(c.map((function(e,t){return new Promise((function(n){setTimeout((function(){n((0,b.tx)(e,d,y))}),2e3*t)}))})));case 20:null===(D=e.sent)||void 0===D||D.filter(Boolean).slice(0,f.O_).forEach((function(e,t){O.append("images[".concat(t,"]"),e)})),e.next=25;break;case 24:O.append("images","");case 25:return null===C||void 0===C||C.forEach((function(e){O.append("mention_ids[]",e)})),O.append("intro_url",v||""),O.append("banner",h||""),x&&(O.append("post_type","scheduled"),O.append("schedule_datetime",u()(x,"YYYY-MM-DD HH:mm:ss").toISOString())),w&&(O.append("event_type","mini_game"),k&&O.append("event_start",u()("".concat(k," 00:00:00"),"YYYY-MM-DD HH:mm:ss").toISOString()),j&&O.append("event_end",u()("".concat(j," 23:59:59"),"YYYY-MM-DD HH:mm:ss").toISOString())),e.abrupt("return",O);case 31:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),S=function(){var e=(0,i.Z)(o().mark((function e(t){var n,r,i,a,c,u,s,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.formData,r=t.locale,i=t.dispatch,e.next=3,(0,p.cA)((0,p.cN)(d.yy.POST.CREATE,{_locale:r}),"POST",{data:n,headers:{"Content-Type":"multipart/form-data"}});case 3:if(a=e.sent,null===(c=null===a||void 0===a?void 0:a.data)||void 0===c||!c.slug||!i){e.next=10;break}return e.next=8,(0,p.cA)((0,p.cN)(d.yy.POST.DETAIL_BY_ID_OR_SLUG,{idSlug:c.slug,_locale:r}),"GET");case 8:null!==(s=e.sent)&&void 0!==s&&null!==(u=s.data)&&void 0!==u&&u.id&&(l=(0,y.W1)(s.data)).id&&i({type:h.t.update,payload:{data:l}});case 10:return e.abrupt("return",a);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),C=function(){var e=(0,i.Z)(o().mark((function e(t){var n,r,i,a,c,u,s;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.id,r=t.formData,i=t.locale,a=t.dispatch,e.next=3,(0,p.cA)((0,p.cN)(d.yy.POST.UPDATE,{id:n,_locale:i}),"POST",{data:r});case 3:return c=e.sent,null!==(u=null===c||void 0===c?void 0:c.data)&&void 0!==u&&u.id&&a&&(s=(0,y.W1)(u),a({type:h.t.update,payload:{data:s}})),e.abrupt("return",c);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),D=function(e){var t=e.id,n=e.locale;e.followValue;return(0,p.cA)((0,p.cN)(d.yy.POST.FOLLOW,{id:t,_locale:n}),"GET")},_=function(){var e=(0,l.Z)().formatMessage,t=(0,s.useRouter)().locale,n=void 0===t?"vi-VN":t,r=(0,a.useContext)(m.I).pushNotifications,c=(0,a.useState)(!1),u=c[0],d=c[1],p=(0,w.h0)().authActionWrapper;return{loading:u,onFollowUnfollowPost:function(t){var a=t.id,c=t.followValue;return p((0,i.Z)(o().mark((function t(){var i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!u){t.next=2;break}return t.abrupt("return",i);case 2:return d(!0),t.prev=3,t.next=6,D({id:a,locale:n,followValue:c});case 6:(i=t.sent)&&r({message:c?"Notification on":"Notification off",type:c?"success":"danger",displayIcon:c?(0,g.k3)("/svg/icon-bell-on.svg"):(0,g.k3)("/svg/icon-bell-off.svg")}),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),r((0,x.ti)(e));case 13:return d(!1),t.abrupt("return",i);case 15:case"end":return t.stop()}}),t,null,[[3,10]])}))))}}},N=function(e){var t=e.id,n=e.reason,r=e.locale,o=new FormData;return o.append("reason",n),(0,p.cA)((0,p.cN)(d.yy.POST.REPORT,{_locale:r,id:t}),"POST",{data:o})},E=function(){var e=(0,l.Z)().formatMessage,t=(0,s.useRouter)().locale,n=void 0===t?"vi-VN":t,r=(0,a.useContext)(m.I).pushNotifications,c=(0,a.useState)(!1),u=c[0],d=c[1],p=(0,w.h0)().authActionWrapper;return{loading:u,onReportPost:function(t){var a=t.id,c=t.reason;return p((0,i.Z)(o().mark((function t(){var i,s;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!u){t.next=2;break}return t.abrupt("return",i);case 2:return d(!0),t.prev=3,t.next=6,N({id:a,locale:n,reason:c});case 6:i=t.sent,1===(null===(s=i)||void 0===s?void 0:s.status)&&r({message:"Post reported",type:"success"}),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),r((0,x.ti)(e));case 13:return d(!1),t.abrupt("return",i);case 15:case"end":return t.stop()}}),t,null,[[3,10]])}))),{action:"report-post"})}}}},13199:function(e,t,n){"use strict";n.d(t,{Nw:function(){return m},rz:function(){return P},Tn:function(){return S},f0:function(){return C},Dc:function(){return D},a7:function(){return _},hr:function(){return N},I:function(){return E},eh:function(){return A},bu:function(){return Z},TV:function(){return M},dM:function(){return z},aD:function(){return L},el:function(){return W},on:function(){return R},vs:function(){return Y},Uo:function(){return $},XW:function(){return U},IA:function(){return F},tx:function(){return H}});var r=n(809),o=n.n(r),i=n(26265),a=n(92447),c=n(28140),u=n(29238),s=n.n(u),l=n(2810),d=n(24169);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t]*)data-url="true"[^<>]*>(.*?)<\/mocka>/gim,h=/((?:=")|(?:data-url="true">)|)(https?:\/\/(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))/gim,g=/\[a\+href="([^<"]+)"(?:\+text=\"([^<"]+)")?\]/gim,x=/]*data-id="([^<"]+)"[^>]*>([^<]+)<\/mention>/gim,b=/]*data-id="([^<"]+)" [^\>]*data-name="([^<"]+)"[^>]*>([^<]+)<\/mention>/gim,y=/\[mention\+id="([^<"]+)"([^\]]*)\]/gim,w=/^(https?:\/\/(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))$/gim,k=/^((https?:\/\/)?(www\.)?(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$]))$/gim,j=/]*href="([^>"]+)"[^>]*>([^<]+)<\/a>/gim,T=/]*data-bad-word="[^\"]*" [^\>]*data-error="true"[^\>]*>(.*?)<\/mocka>/gim,O=function(e){var t=e.url,n=e.text,r=e.method,o=n.indexOf(n.trimStart()),i=n.trimEnd().length,a=n.substring(0,o),c=n.substring(o,i),u=n.substring(i);return"edit"===r?"".concat(a,'').concat(c,"").concat(u):"display"===r&&(t.startsWith("http://")||t.startsWith("https://"))?"".concat(a,'').concat(c,"").concat(u):n},P=function(e,t){return e.replace(g,(function(e,n,r){return O({text:r||n,url:n,method:t})})).replace(j,(function(e,n,r){return O({text:r||n,url:n,method:t})}))},S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.replace(y,(function(e,n,r){var o=t.find((function(e){return String(e.id)===n}));if(!o){if(!r)return"";var i="";return r.replace(/\+name="([^<"]+)"/i,(function(e,t){return i=t,e})),'').concat(i,"")}return'').concat(o.name,"")}))},C=30,D=function(e,t){var n=[];return e.replace(x,(function(e,t,r){return n.push(t),e})).replace(y,(function(e,t,r){return n.push(t),e})),t?n:Array.from(new Set(n)).slice(0,C)},_=function(e){var t;return[].concat((0,c.Z)(function(e){var t=[];return e.replace(/(\&)+/g,"&").replace(h,(function(e,n,r){return'="'!==n&&'data-url="true">'!==n&&t.push(r),e})),t}(e)),(0,c.Z)((null===(t=e.match(v))||void 0===t?void 0:t.map((function(e){var t,n,r=null===(t=e.match(/data-href="([^"]*)"/im))||void 0===t?void 0:t[1],o=null===(n=e.match(/>(.*?)<\/mocka>/im))||void 0===n?void 0:n[1];return r||o})))||[])).filter((function(e){return!!e}))},N=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")};var E=function(e){var t,n;return null===(t=e.replace(/(\ )+/g," "))||void 0===t||null===(n=t.replace(/(\u200c|‌)+/g,""))||void 0===n?void 0:n.replace(v,(function(e,t,n){var r,o=null===(r=t.match(/data-href="([^"]*)"/im))||void 0===r?void 0:r[1];return!o||o===n||n.match(w)?n:o?'').concat(n,""):'').concat(n,"")})).replace(h,(function(e,t,n){if('="'!==t&&'data-url="true">'!==t){var r=new URL(n),o=I.some((function(e){return r.origin.endsWith(e)}))?n:n.toLowerCase(),i=o.startsWith("http")?"":" https://",a="".concat(i).concat(o);return O({text:a,url:a,method:"edit"})}return e})).replace(j,(function(e,t,n){return O({text:n||t,url:t,method:"edit"})}))},A=function(e){return e.replace(T,(function(e,t){var n=document.createElement("div");n.innerHTML=e;var r=n.firstChild;return(null===r||void 0===r?void 0:r.innerText)!==(null===r||void 0===r?void 0:r.getAttribute("data-bad-word"))?t:e}))},Z=function(e){return e.replace(T,"$1")},M=function(e){return e.replace(/]*>(.+)<\/font>/gim,(function(e,t){return t.replace(/]*>(.+)<\/u>/gim,"$1")}))},z=function(e){return function(e){var t;return m(null===(t=e.replace(/(\ )+/g," ").replace(/(\&)+/g,"&"))||void 0===t?void 0:t.replace(/(\u200c|‌)+/g,"").replace(h,(function(e,t,n){return'="'!==t&&'data-url="true">'!==t?'').concat(n,""):e})).replace(v,(function(e,t,n){var r,o=null===(r=t.match(/data-href="([^"]*)"/im))||void 0===r?void 0:r[1];return o?'').concat(n,""):'').concat(n,"")})))}(function(e){return e.replace(x,(function(e,t,n){return'[mention+id="'.concat(t,'"+name="').concat(n,'"]')}))}(Z(e)))},L=["hellobacsi.blog","hellosehat.com","hellodoktor.com","hellokrupet.com","hellodoctor.com.ph","hellokhunmor.com","hellosayarwon.com","helloyishi.com.tw","helloswasthya.com","marrybaby.vn","hellohealth.questionpro.com","hellobacsivn.page.link","hellohealthquiz.typeform.com"].concat((0,c.Z)([])),I=["hellohealthquiz.typeform.com"],W=function(e){return e.match(k)?e.startsWith("https://")||e.startsWith("http://")?e:"https://".concat(e):""},R=function(e,t){var n=t.filter(Boolean);return e&&n.length>0?Z(e).replace(new RegExp("\\b(".concat(n.map((function(e){return N(e)})).join("|"),")\\b"),"gi"),(function(e,t){var n=document.createElement("mocka");return n.setAttribute("data-bad-word",t),n.setAttribute("data-error","true"),n.innerText=t,"".concat(n.outerHTML)})):e},Y=function(e){return e.replace(b,(function(e,t,n,r){if(r!==n){var o=n.split(" "),i=o.findIndex((function(e,t){var n=o.slice(0,t+1).join(" ");return!r.startsWith(n)}));if(0===i)return"@".concat(r);var a=(i<0?o:o.slice(0,i)).join(" "),c=r.slice(a.length).trim();return console.log(i,a,c),'').concat(a," ").concat(c," ")}return e}))},$=function(e){var t;if(!e.includes("youtu"))return"";return(null===(t=/(.*?)(^|\/|v=)([a-z0-9_-]{11})(.*)?/gim.exec(e))||void 0===t?void 0:t[3])||""},U=function(e){var t="";return e.replace(/(?:https?:\/\/)?(?:www.|web.|m.)?facebook.com\/(?:video.php|photo.php|watch)?\/?\?v=(\d+)|\S+\/videos\/((\S+)\/(\d+)|(\d+))\/?/gim,(function(){for(var e=arguments.length,n=new Array(e),r=0;r2)return t[2]},H=function(e,t,r,i,c){return"string"===typeof e?Promise.resolve(e):(0,a.Z)(o().mark((function a(){var u,s,p,m,v,h,g,x;return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(s=/image/i.test(e.type),p=s?"image":"video",m=new FormData,!s){o.next=17;break}if(!e.type.startsWith("image/gif")){o.next=8;break}m.append(p,e),o.next=15;break;case 8:return o.next=10,n.e(1741).then(n.bind(n,41741));case 10:return v=o.sent,o.next=13,v.default(e,{maxSizeMB:.4,maxWidthOrHeight:1536,useWebWorker:!0});case 13:h=o.sent,m.append(p,h);case 15:o.next=18;break;case 17:m.append(p,e);case 18:return g=r?d.Cl:d.cA,o.next=21,g((0,d.cN)(s?r?l.qf.COMMENT.IMAGE_UPLOAD:l.yy.COMMENT.IMAGE_UPLOAD:l.qf.VIDEO_UPLOAD,{_locale:t}),"POST",f({data:m,timeout:i||3e4},c));case 21:return x=o.sent,o.abrupt("return",(null===x||void 0===x||null===(u=x.data)||void 0===u?void 0:u[p])||"");case 23:case"end":return o.stop()}}),a)})))()}}}]);