@hhgtech/hhg-components 1.19.39 → 1.19.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/build/components/molecules/radioGroup/index.d.ts +5 -2
  2. package/build/components.js +1 -1
  3. package/build/esm/babyGrowth.js +1 -1
  4. package/build/esm/care.js +1 -1
  5. package/build/esm/components.js +1 -1
  6. package/build/esm/{constants-bd92e982.js → constants-4e52a6b1.js} +1 -1
  7. package/build/esm/{index-3b8f5d3a.js → index-061044d6.js} +1 -1
  8. package/build/esm/index-4643d5f0.js +1 -0
  9. package/build/esm/{index-e09947ac.js → index-7a791de2.js} +1 -1
  10. package/build/esm/{index-570254d1.js → index-be3ea0d9.js} +1 -1
  11. package/build/esm/index.js +1 -1
  12. package/build/esm/{index.styled-09287716.js → index.styled-25acea1f.js} +1 -1
  13. package/build/esm/{index.styled-a6269e59.js → index.styled-4154e676.js} +1 -1
  14. package/build/esm/index.styled-fe478117.js +1 -0
  15. package/build/esm/navigation.js +1 -1
  16. package/build/esm/together.js +1 -1
  17. package/build/esm/{types-ba278f5c.js → types-002306a2.js} +1 -1
  18. package/build/esm/{types-aef8a1c1.js → types-445b4089.js} +1 -1
  19. package/build/index-1e5f3bb9.js +1 -0
  20. package/build/{index-cd11825e.js → index-c0a2d14a.js} +1 -1
  21. package/build/{index-db0c8c89.js → index-f129906d.js} +1 -1
  22. package/build/index.js +1 -1
  23. package/build/index.styled-aeec8a9f.js +1 -0
  24. package/build/navigation.js +1 -1
  25. package/build/together.js +1 -1
  26. package/build/{types-9e2b5b61.js → types-454784c8.js} +1 -1
  27. package/package.json +1 -1
  28. package/build/esm/index-28859a65.js +0 -1
  29. package/build/esm/index.styled-08082348.js +0 -1
  30. package/build/index-fbdd8ef9.js +0 -1
  31. package/build/index.styled-3f048fc2.js +0 -1
@@ -1 +1 @@
1
- import"./tslib.es6-6ae0d506.js";import"react";import"./core-286f158c.js";import"./index.styled-a6269e59.js";import"./index.styled-08082348.js";import"react-id-generator";import"date-fns";import"react-day-picker/DayPickerInput";import"lodash/debounce";import"react-dom";import"./index.styled-09287716.js";import"lodash";import"keen-slider/react";import"./useTranslations-0b650088.js";import"react-range";import"./theme-0e20eeec.js";export{N as NavigationV2,g as getNavMenuContent,a as getNavMenuContentWithCache}from"./index-e09947ac.js";import"date-fns/locale/en-US";import"date-fns/locale/id";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"./lazyLoad-d80d3fd1.js";import"./translationsContext-78f42743.js";import"string-format";import"styled-components";import"./routing-914e53ff.js";import"date-fns/locale/hi";import"date-fns/locale/ms";import"date-fns/locale/th";import"smoothscroll-polyfill";import"./constants-bd92e982.js";import"./cookieHelper-0e8521c3.js";import"slugify";import"react-loading-skeleton";import"innertext";import"react-contenteditable";import"vanilla-lazyload";
1
+ import"./tslib.es6-6ae0d506.js";import"react";import"./core-286f158c.js";import"./index.styled-4154e676.js";import"./index.styled-fe478117.js";import"react-id-generator";import"date-fns";import"react-day-picker/DayPickerInput";import"lodash/debounce";import"react-dom";import"./index.styled-25acea1f.js";import"lodash";import"keen-slider/react";import"./useTranslations-0b650088.js";import"react-range";import"./theme-0e20eeec.js";export{N as NavigationV2,g as getNavMenuContent,a as getNavMenuContentWithCache}from"./index-7a791de2.js";import"date-fns/locale/en-US";import"date-fns/locale/id";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"./lazyLoad-d80d3fd1.js";import"./translationsContext-78f42743.js";import"string-format";import"styled-components";import"./routing-914e53ff.js";import"date-fns/locale/hi";import"date-fns/locale/ms";import"date-fns/locale/th";import"smoothscroll-polyfill";import"./constants-4e52a6b1.js";import"./cookieHelper-0e8521c3.js";import"slugify";import"react-loading-skeleton";import"innertext";import"react-contenteditable";import"vanilla-lazyload";
@@ -1 +1 @@
1
- export{i as CardAuthor,C as CardReactions,q as DefaultComponentGlobalContextData,G as GlobalData,g as LabelSortPin,h as LabelSorting,L as Loading,p as PopoverMenu,k as PopupDoctor,j as PopupExpert,m as PopupFrame,l as PopupHospital,o as ShareBox,n as SharePopup,T as TogetherAuthConfigContext,c as TogetherAuthConfigContextProvider,r as TogetherComponentGlobalContext,s as TogetherComponentGlobalContextProvider,f as TogetherConstants,e as TogetherDataTransforms,U as UserAvatar,u as useTogetherAuthRequiredAction}from"./index.styled-08082348.js";export{C as CardLink,i as CardPost,j as CardPostPopoverMore,k as CardReply,l as CardReplyPopover,a as CreateNewPostContent,b as CreatePostDescription,c as CreatePostTitle,f as ImagePreviewPopup,I as InputCommentBar,L as LabelPin,P as PopupDanger,e as PostContent,h as PostImagePreview,g as PostSingleImageViewPopup,S as SubmitReportForm,T as TagTopic,t as TogetherTypes,d as TopicSelectList}from"./types-ba278f5c.js";import"./tslib.es6-6ae0d506.js";import"react";import"./index.styled-09287716.js";import"./index.styled-a6269e59.js";import"styled-components";import"./theme-0e20eeec.js";import"./useTranslations-0b650088.js";import"./translationsContext-78f42743.js";import"string-format";import"react-dom";import"date-fns";import"date-fns/locale/en-US";import"date-fns/locale/hi";import"date-fns/locale/id";import"date-fns/locale/ms";import"date-fns/locale/th";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"react-id-generator";import"react-range";import"react-day-picker/DayPickerInput";import"lodash/debounce";import"lodash";import"smoothscroll-polyfill";import"keen-slider/react";import"./constants-bd92e982.js";import"./lazyLoad-d80d3fd1.js";import"vanilla-lazyload";import"./cookieHelper-0e8521c3.js";import"slugify";import"react-loading-skeleton";import"./routing-914e53ff.js";import"innertext";import"react-contenteditable";import"./index-570254d1.js";
1
+ export{j as CardAuthor,C as CardReactions,r as DefaultComponentGlobalContextData,G as GlobalData,h as LabelSortPin,i as LabelSorting,L as Loading,q as PopoverMenu,l as PopupDoctor,k as PopupExpert,n as PopupFrame,m as PopupHospital,p as ShareBox,o as SharePopup,T as TogetherAuthConfigContext,e as TogetherAuthConfigContextProvider,s as TogetherComponentGlobalContext,t as TogetherComponentGlobalContextProvider,g as TogetherConstants,f as TogetherDataTransforms,U as UserAvatar,u as useTogetherAuthRequiredAction}from"./index.styled-fe478117.js";export{C as CardLink,i as CardPost,j as CardPostPopoverMore,k as CardReply,l as CardReplyPopover,a as CreateNewPostContent,b as CreatePostDescription,c as CreatePostTitle,f as ImagePreviewPopup,I as InputCommentBar,L as LabelPin,P as PopupDanger,e as PostContent,h as PostImagePreview,g as PostSingleImageViewPopup,S as SubmitReportForm,T as TagTopic,t as TogetherTypes,d as TopicSelectList}from"./types-002306a2.js";import"./tslib.es6-6ae0d506.js";import"react";import"./index.styled-25acea1f.js";import"./index.styled-4154e676.js";import"styled-components";import"./theme-0e20eeec.js";import"./useTranslations-0b650088.js";import"./translationsContext-78f42743.js";import"string-format";import"react-dom";import"date-fns";import"date-fns/locale/en-US";import"date-fns/locale/hi";import"date-fns/locale/id";import"date-fns/locale/ms";import"date-fns/locale/th";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"react-id-generator";import"react-range";import"react-day-picker/DayPickerInput";import"lodash/debounce";import"lodash";import"smoothscroll-polyfill";import"keen-slider/react";import"./constants-4e52a6b1.js";import"./lazyLoad-d80d3fd1.js";import"vanilla-lazyload";import"./cookieHelper-0e8521c3.js";import"slugify";import"react-loading-skeleton";import"./routing-914e53ff.js";import"innertext";import"react-contenteditable";import"./index-be3ea0d9.js";
@@ -1 +1 @@
1
- import{_ as e,a as t,b as n,c as i}from"./tslib.es6-6ae0d506.js";import o,{useContext as a,useState as r,useRef as l,useEffect as s,useMemo as c,useCallback as u}from"react";import{H as d,B as m}from"./index.styled-09287716.js";import{T as p}from"./index.styled-a6269e59.js";import{a as v,D as g}from"./index-570254d1.js";import{u as f,t as h,k as C}from"./useTranslations-0b650088.js";import w from"innertext";import{t as E,d as k}from"./theme-0e20eeec.js";import{r as y,fq as b,fr as N,fs as I,ft as T,fu as x,fv as M,g as L,fw as P,fx as _,fy as S,fz as j,fA as B,fB as F,fC as R,fD as D,L as O,fE as A,fF as z,fG as U,fH as V,fI as H,fJ as W,fK as Z,fp as G,fL as K,m as Q,fM as X,fN as J,U as Y,fO as $,fP as q,fQ as ee,u as te,j as ne,fR as ie,fS as oe,fT as ae,fU as re,fV as le,fW as se,fX as ce,fY as ue,fZ as de,f_ as me,f$ as pe,g0 as ve,g1 as ge,g2 as fe,g3 as he,g4 as Ce,g5 as we,g6 as Ee,g7 as ke,g8 as ye,g9 as be,ga as Ne,gb as Ie,c as Te,gc as xe,i as Me,C as Le,gd as Pe,ge as _e,gf as Se,n as je,gg as Be,cU as Fe,gh as Re,gi as De,gj as Oe}from"./index.styled-08082348.js";import"react-range";import*as Ae from"react-dom";import{I as ze}from"./constants-bd92e982.js";import Ue from"lodash/debounce";import Ve from"react-contenteditable";import{l as He}from"./lazyLoad-d80d3fd1.js";import"date-fns";import"styled-components";var We=function(i){var c=i.title,u=i.url,m=i.image,v=i.logo,g=i.className,f=i.style,h=i.noRefetch,C=a(y).data,w=C.locale,E=C.env.isMarryBaby,k=r(!1),M=k[0],L=k[1],P=l(h);P.current=h;var _=r(null),S=_[0],j=_[1];s((function(){e(void 0,void 0,void 0,(function(){return t(this,(function(e){return P.current?[2]:u?(j((function(e){return n(n({},e),{isFetching:!0})})),I(T(x.FETCH_PREVIEW,{_locale:w}),"POST",{data:{link:u}}).then((function(e){var t,n,i;L(!1),j({title:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.title,url:u,image:(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.image)||(null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.logo)})})).catch((function(){j(null)})),[2]):[2,j(null)]}))}))}),[u]);var B=(null==S?void 0:S.image)||m,F=(null==S?void 0:S.title)||c,R=(null==S?void 0:S.logo)||v,D=(null==S?void 0:S.url)||u,O=D.replace("http://","").replace("https://","").split(/[/?#]/)[0],A=l(!1);return o.createElement(b,{"data-is-marrybaby":E,className:"".concat(g," no-replace-click"),style:f},o.createElement("a",{href:D,target:"_blank",rel:"noreferrer"},B&&o.createElement("div",{className:"link-image-wrapper"},!E&&o.createElement("img",{className:"link-image-blur",src:B,onError:function(e){A.current||(A.current=!0,e.currentTarget.src=N)}}),o.createElement("img",{className:"link-image",src:B,onError:function(e){A.current||(A.current=!0,e.currentTarget.src=N)}})),o.createElement("div",{className:"link-info-container"},o.createElement(p,{size:"n1"},E&&R&&!M&&o.createElement("img",{className:"link-logo",src:R,onError:function(e){return L(!0)}}),O),o.createElement(d,{tag:"h6"},F))))},Ze=function(e){var t=e.topics,n=e.onClick,i=e.className,s=e.style,c=function(){var e=r(!1),t=e[0],n=e[1],i=l(null),o=l(null),a=l();return{sliding:t,mouseDownHandler:function(e){if(i.current){a.current=setTimeout((function(){n(!0)}),500),o.current={left:i.current.scrollLeft,x:e.clientX};var t=function(e){var t=o.current;if(t){var n=e.clientX-t.x;i.current&&(i.current.scrollLeft=t.left-n)}},r=function(){a.current&&(clearTimeout(a.current),a.current=void 0),n(!1),document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",t),document.addEventListener("mouseup",r)}},sliderRef:i,pos:o}}(),u=c.sliding,d=c.mouseDownHandler,m=c.sliderRef,v=a(y),g=v.data.env.togetherBasePath,f=v.action.sanitizeFunction;return o.createElement(M,{ref:m,onClick:n,onMouseDown:function(e){return d(e)},className:"".concat(i," ").concat(u?"sliding":""),style:s},t.map((function(e,t){return o.createElement("a",{className:"tag-link-item",key:t,href:e.isActive&&!e.isHidden?"".concat(g).concat(e.url):void 0},o.createElement(p,{size:"p3"},o.createElement("span",{dangerouslySetInnerHTML:{__html:(null==f?void 0:f(e.name))||e.name}})))})))},Ge=function(e){var t=e.onClick;e.color;var n=e.className,i=e.style,r=a(y).data.env.isMarryBaby,l=f().t;return o.createElement(L,{label:o.createElement(o.Fragment,null,r&&o.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M3.5 19.9999L7.87 15.6299' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.95634 11.294C4.56534 11.685 4.56534 12.318 4.95634 12.708L7.87434 15.626L10.7923 18.544C11.1833 18.935 11.8163 18.935 12.2063 18.544L13.3813 17.369C13.5693 17.181 13.6743 16.927 13.6743 16.662V12.726L16.5743 9.82597L18.8833 9.94897C19.1663 9.96397 19.4433 9.85797 19.6433 9.65797L20.2173 9.08397C20.6083 8.69297 20.6083 8.05997 20.2173 7.66997L15.8313 3.28397C15.4403 2.89297 14.8073 2.89297 14.4173 3.28397L13.8433 3.85797C13.6423 4.05897 13.5363 4.33497 13.5523 4.61797L13.6753 6.92697L10.7753 9.82697H6.83834C6.57334 9.82697 6.31834 9.93197 6.13134 10.12L4.95634 11.294V11.294Z' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M16.5699 9.83018L13.6699 6.93018' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3c/svg%3e"})," ",l("label.pinnedPost")),rightLabel:!r&&o.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cline x1='7.18605' y1='7.68219' x2='3.68219' y2='13.8139' stroke='%23FEA21E' stroke-linecap='round'/%3e%3cpath d='M3.24591 7.78426C3.21275 7.84168 3.20376 7.90993 3.22092 7.97398C3.23808 8.03803 3.27998 8.09264 3.3374 8.12579L8.78429 11.2706C8.90385 11.3396 9.05674 11.2986 9.12578 11.1791C9.71191 10.1641 9.71348 8.97262 9.23682 7.99339L10.8583 5.18521C11.5115 5.00603 12.0982 4.57973 12.4638 3.94629C12.5328 3.82672 12.4919 3.67383 12.3723 3.6048L8.18237 1.18584C8.12494 1.15268 8.0567 1.1437 7.99265 1.16086C7.92861 1.17803 7.874 1.21993 7.84086 1.27736C7.47521 1.91077 7.39934 2.63194 7.57065 3.28723L5.94919 6.09545C4.86323 6.1723 3.83201 6.76934 3.24591 7.78426Z' fill='%23FEA21E' stroke='%23FEA21E' stroke-width='0.5' stroke-linejoin='round'/%3e%3c/svg%3e"}),onClick:t,color:"white",className:"label-pinned ".concat(n),style:i})},Ke=function(e){return{message:e("notification.failure"),type:"danger"}},Qe="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%23FE921D'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",Xe=function(n){var i=n.id,o=n.locale;return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return i?[4,P(T(x.POST.LIKE,{id:i,_locale:o}),"GET")]:[2];case 1:return[2,e.sent()]}}))}))},Je=function(n){var i=n.id,o=n.locale;return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return i?[4,P(T(x.POST.DELETE,{id:i,_locale:o}),"DELETE")]:[2];case 1:return[2,e.sent()]}}))}))},Ye=function(n){var i=n.title,o=n.description,a=n.communityId,r=n.imageFiles,l=n.previewUrl,s=n.topicIds,c=n.locale,u=n.sanitizeFunction,d=n.categoryCommunityId,m=n.categoryTopicIds,p=n.introUrl,v=n.bannerUrl,g=n.scheduleTime;return e(void 0,void 0,void 0,(function(){var e,n,f,h,C;return t(this,(function(t){switch(t.label){case 0:return e=new FormData,n=S(o),f=S(i),h=j(n),e.append("title",f),e.append("description",B(n,u)),d?e.append("category_community",String(d)):a&&e.append("community_id",String(a)),(null==l?void 0:l.title)&&e.append("preview_title",l.title),(null==l?void 0:l.description)&&e.append("preview_description",l.description),(null==l?void 0:l.url)&&e.append("preview_link",l.url),(null==l?void 0:l.image)&&e.append("preview_image",l.image),null==s||s.forEach((function(t){e.append("topics[]",String(t||""))})),null==m||m.forEach((function(t){e.append("category_topics[]",String(t||""))})),(null==r?void 0:r.length)?[4,Promise.all(r.map((function(e,t){return new Promise((function(n){setTimeout((function(){n(F(e,c))}),2e3*t)}))})))]:[3,2];case 1:return null==(C=t.sent())||C.filter(Boolean).slice(0,_).forEach((function(t,n){e.append("images[".concat(n,"]"),t)})),[3,3];case 2:e.append("images",""),t.label=3;case 3:return null==h||h.forEach((function(t){e.append("mention_ids[]",t)})),e.append("intro_url",p||""),e.append("banner",v||""),g&&(e.append("post_type","scheduled"),e.append("schedule_datetime",g)),[2,e]}}))}))},$e=function(n){var i=n.locale,o=n.formData,a=n.isArticleComment;return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,P(T(a?x.POST.CREATE_ARTICLE_COMMENT:x.POST.CREATE,{_locale:i}),"POST",{data:o,headers:{"Content-Type":"multipart/form-data"}})];case 1:return[2,e.sent()]}}))}))},qe=function(n){var i=n.id,o=n.locale,a=n.formData;return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,P(T(x.POST.UPDATE,{id:i,_locale:o}),"POST",{data:a})];case 1:return[2,e.sent()]}}))}))},et=function(e){var t=e.id,n=e.reason,i=e.locale,o=new FormData;return o.append("reason",n),P(T(x.POST.REPORT,{_locale:i,id:t}),"POST",{data:o})},tt=function(e,t){var n=r(e||[]),i=n[0],o=n[1];return{onSelectImages:function(n){var a=n.target.files;a&&(t&&e?t((e||i).concat(Array.from(a))):o((function(n){var i=e||n;return t&&t(i.concat(Array.from(a))),i.concat(Array.from(a))})))},onRemoveImage:function(n){if(t&&e){var i=e;i.splice(n,1),t(i.slice())}else o((function(i){var o=e||i;return o.splice(n,1),t&&t(o.slice()),o.slice()}))},onRemoveAllImages:function(){t?t([]):o([])},imageSrcs:c((function(){return(e||i).map((function(e){return"string"==typeof e?e:URL.createObjectURL(e)}))}),[e,i]),imageFiles:e||i}},nt="data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 22.9844C17.5228 22.9844 22 18.5072 22 12.9844C22 7.46153 17.5228 2.98438 12 2.98438C6.47715 2.98438 2 7.46153 2 12.9844C2 18.5072 6.47715 22.9844 12 22.9844Z' fill='%23262626'/%3e%3cpath d='M14.8281 10.1562L9.17127 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.17188 10.1562L14.8287 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",it=function(e){var t=e.className,n=e.style,i=e.bannedWords,a=void 0===i?[]:i,c=e.value,u=e.onChange,d=e.onPreviewUrlChange,m=e.onInvalidUrlsChange,v=e.onImageFilesChange,g=e.imageFiles,h=e.isReplying,C=f().t,k=r(null),y=k[0],b=k[1],N=l(null),I=tt(g,v),T=I.onSelectImages,x=I.onRemoveImage,M=I.imageSrcs;return s((function(){d&&((null==y?void 0:y.url)?d({title:y.title||"",url:y.url||"",image:y.image||"",description:y.description||""}):d(null))}),[y]),o.createElement(R,{className:t,style:n},o.createElement(p,{size:"p4",className:"description-label"},C("createPost.popup.description")),o.createElement("div",{className:"textarea-control"},o.createElement("div",{className:"textarea-wrapper"},o.createElement(D,{html:c||"",onChange:u,bannedWords:a,onImagePickerClick:function(){var e;return null===(e=N.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:b,onInvalidUrlsChange:m,isReplying:h}))),o.createElement(p,{size:"p4",className:"count-string"},C("character"),": ",w(c||"").length),(!M||0===M.length)&&y&&o.createElement("div",{className:"link-preview-wrapper"},y.isFetching?o.createElement(O,null):o.createElement(o.Fragment,null,o.createElement(We,{title:y.title,url:y.url||"#",image:y.image,noRefetch:!0}),o.createElement("img",{src:nt,className:"icon-close",onClick:function(){return b(null)}}))),o.createElement("input",{ref:N,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:T}),M.length>_?o.createElement("div",{className:"input-notification"},o.createElement("img",{src:Qe}),o.createElement(p,{size:"p4",color:E.colors.alertWarning},C("createPost.popup.warningImage"))):null,M.length>0&&o.createElement("div",{className:"image-gallery"},M.map((function(e,t){return o.createElement("div",{key:t,className:"image-item"},o.createElement("img",{src:e}),o.createElement("img",{className:"close-btn",src:nt,onClick:function(){return x(t)}}))}))))},ot=function(e,t){if(!t)return e;var n=t.limit,i=t.bannedWords,o=void 0===i?[]:i,a="number"==typeof n&&n>=0?e.substring(0,n):e;return A(a,o)},at=function(e){var t,n=e.className,i=e.style,a=e.bannedWords,c=void 0===a?[]:a,d=e.value,m=e.onChange,v=f().t,g=r(""),h=g[0],C=g[1],w=l(null);s((function(){if(w.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=w.current;return t.addEventListener("paste",e),function(){return t.removeEventListener("paste",e)}}}),[w]);var E=(null==c?void 0:c.join(","))||"";s((function(){var e;if(E){var t=null===(e=w.current)||void 0===e?void 0:e.innerText;if(t){var n=A(t,c);n!==t&&(m&&m(n),C(n))}}}),[E]);var k=u(Ue((function(e){if(w.current){var t=ot(w.current.innerText,{limit:120,bannedWords:c});m&&m(t),C(t)}}),300),[]);return s((function(){setTimeout((function(){var e;null===(e=w.current)||void 0===e||e.focus()}),500)}),[]),o.createElement(z,{className:n,style:i},o.createElement(ze,{name:"title",value:d||h,size:"md",label:v("createPost.title"),CustomInput:o.createElement(Ve,{innerRef:w,html:d||h,onChange:function(e){if(w.current&&w.current.innerText!==(d||h)){var t=ot(w.current.innerText,{bannedWords:c});m&&m(t),C(t),k(w.current.innerText)}},className:"title-input"})}),o.createElement(p,{size:"p4",className:"count-string"},v("createPost.popup.wordCount",{count:(null===(t=w.current)||void 0===t?void 0:t.innerText.length)||0,max:120})))},rt=function(n){var u=n.className,d=n.style,m=n.topics,p=n.communityId,v=n.onChange,g=n.isLoading,f=n.disabled,h=n.forceTopics,C=n.selectedTopics,w=n.noFetch,E=a(y).data,k=E.locale,b=E.env.isMarryBaby,N=r(m?i([],m,!0):[]),M=N[0],L=N[1],P=r(C?i([],C,!0):[]),_=P[0],S=P[1],j=r(!1),B=j[0],F=j[1],R=l(m);R.current=m,s((function(){var n;!p||w||(null===(n=R.current)||void 0===n?void 0:n.length)||(L([]),F(!0),e(void 0,void 0,void 0,(function(){var e,n,i,o;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,I(T(x.TOPIC.LIST,{communityId:p,_locale:k}),"GET")];case 1:return e=t.sent(),n=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.topics,Array.isArray(n)&&L((function(){return(null==n?void 0:n.map(V).sort((function(e,t){return(e.order||0)-(t.order||0)})))||[]})),[3,3];case 2:return i=t.sent(),console.log(i),F(!1),[3,3];case 3:return F(!1),[2]}}))})))}),[p,w]);var D=null==m?void 0:m.map((function(e){return e.id})).join("-"),A=null==M?void 0:M.map((function(e){return e.id})).join("-"),z=null==h?void 0:h.map((function(e){return e.id})).join("-");s((function(){m&&void 0!==D&&D!==A&&L(m)}),[m,D,A]);var H=c((function(){return M.filter((function(e){return!(null==h?void 0:h.some((function(t){return t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId})))}))}),[A,z]);return o.createElement(U,{"data-is-marrybaby":b,className:u,style:d},h.map((function(e){return o.createElement(lt,{key:"".concat(e.id,"-").concat(e.mappedCategoryId),topic:e,disabled:!0,selected:!0})})),H.map((function(e){return o.createElement(lt,{key:"".concat(e.id,"-").concat(e.mappedCategoryId),topic:e,disabled:f,selected:(C||_).some((function(t){return t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId})),onClick:function(){var t=C||_,n=t.findIndex((function(t){return t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId}));-1!==n?t.splice(n,1):t.push(e),v&&C?v(t.slice()):(v&&v(t.slice()),S(t.slice()))}})})),(g||B)&&o.createElement(O,{className:"topic-spinner"}))},lt=function(e){var t=e.topic,n=e.disabled,i=e.selected,a=e.onClick;return o.createElement("div",{className:"tag-item"+(i?" --active":""),"data-disabled":n,onClick:n?void 0:a},t.name)},st=function(n){var l=n.className,c=n.style,u=n.onPostCreatedEdited,d=n.onClose,g=n.communities,h=void 0===g?[]:g,C=n.forceSelectCommunity,k=n.forceSelectTopics,b=n.articleId,N=n.optionalTopic,I=n.editPostData,T=n.defaultCommunity,x=n.defaultTopics,M=n.noFetchTopic,L=n.hideTopicList,P=!!(null==I?void 0:I.id),S=a(y),j=S.data,B=j.locale,F=j.env.isMarryBaby,R=S.action,D=R.pushNotifications,O=R.sanitizeFunction,A=f().t,z=r(!1),U=z[0],V=z[1],K=r(""),Q=K[0],X=K[1],J=r(""),Y=J[0],$=J[1],q=r(C?{label:C.name,value:"".concat(C.id||"","-").concat(C.mappedCategoryId||"")}:{label:A("community.choose"),value:""}),ee=q[0],te=q[1],ne=r(i([],k,!0)||[]),ie=ne[0],oe=ne[1],ae=r([]),re=ae[0],le=ae[1],se=r([]),ce=se[0],ue=se[1],de=C||h.find((function(e){return"".concat(e.id||"","-").concat(e.mappedCategoryId||"")===ee.value})),me=C?[C]:h.filter((function(e){return e.isActive})).sort((function(e,t){return e.name>t.name?1:e.name<t.name?-1:0})),pe=r(null),ve=pe[0],ge=pe[1],fe=r([]),he=fe[0],Ce=fe[1],we=Q&&w(Y)&&(N||!N&&ie.length>0)&&de&&(!re||re.length<=_)&&!(null==he?void 0:he.length)&&!U;s((function(){if(I){var e=I;X(e.title||""),$(H(W(e.description||"","edit"),e.mentions)),te({label:e.community.name,value:"".concat(e.community.id||"","-").concat(e.community.mappedCategoryId||"")}),oe(e.topics||[]),le(e.photos||[])}else T&&te({label:T.name,value:"".concat(T.id||"","-").concat(T.mappedCategoryId||"")}),x&&oe(x)}),[]);var Ee=function(){return e(void 0,void 0,void 0,(function(){var e,n,i,o,a,r,l,s,c,m,p,v;return t(this,(function(t){switch(t.label){case 0:return[4,Ye({title:Q,description:Y,communityId:String((null==de?void 0:de.id)||""),imageFiles:re,previewUrl:ve,topicIds:null==ie?void 0:ie.map((function(e){return String(e.id||"")})).filter(Boolean),locale:B,sanitizeFunction:O,categoryCommunityId:String((null==de?void 0:de.mappedCategoryId)||""),categoryTopicIds:null==ie?void 0:ie.map((function(e){return String(e.mappedCategoryId||"")})).filter(Boolean)})];case 1:return e=t.sent(),b&&e.append("article_id",b),P?(null==I?void 0:I.id)?[4,qe({id:I.id,formData:e,locale:B})]:[3,3]:[3,4];case 2:n=t.sent(),t.label=3;case 3:return[3,6];case 4:return[4,$e({formData:e,locale:B,isArticleComment:!(null==de?void 0:de.id)&&!!(null==de?void 0:de.mappedCategoryId)})];case 5:n=t.sent(),t.label=6;case 6:return(null==(i=null==n?void 0:n.data)?void 0:i.id)&&!(null===(a=null===(o=null==n?void 0:n.messages)||void 0===o?void 0:o.moderation)||void 0===a?void 0:a.type)?(D({message:A("createPost.popup.success"),type:"success"}),function(e){u&&u(G(e),P),d&&d()}(i)):"banned"===(null===(l=null===(r=null==n?void 0:n.messages)||void 0===r?void 0:r.moderation)||void 0===l?void 0:l.type)?(D({title:A("notification.post.blocked.title"),message:A("notification.post.blocked.message"),type:"danger"}),n.messages.moderation.words&&ue(n.messages.moderation.words)):"suspect"===(null===(c=null===(s=null==n?void 0:n.messages)||void 0===s?void 0:s.moderation)||void 0===c?void 0:c.type)?(D({title:A("notification.post.suspect.title"),message:A("notification.post.suspect.message"),type:"warning"}),d&&d()):(null===(p=null===(m=null==n?void 0:n.messages)||void 0===m?void 0:m.find)||void 0===p?void 0:p.call(m,(function(e){var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(D({message:A("notification.suspend.message"),type:"danger"}),d&&d()):D({message:(null===(v=null==n?void 0:n.messages)||void 0===v?void 0:v[0])||A("notification.failure"),type:"danger"}),[2]}}))}))};return o.createElement(Z,{className:l,style:c},o.createElement("div",{className:"input-group-container"},o.createElement(at,{className:"input-group",bannedWords:ce,value:Q,onChange:X}),o.createElement(it,{className:"input-group",bannedWords:ce,value:Y,onChange:$,onPreviewUrlChange:ge,onInvalidUrlsChange:Ce,onImageFilesChange:le,imageFiles:re}),o.createElement("div",{className:"input-group"},o.createElement(p,{size:"p4",className:"input-group-label"},A("admin.community")),o.createElement(v,{options:(null==me?void 0:me.map((function(e,t){return{label:e.name,value:"".concat(e.id||"","-").concat(e.mappedCategoryId||"")}})))||[],id:"community-picker",placeholder:A("community.choose"),value:ee,onChange:function(e){te({label:e.label,value:String(e.value)}),oe([])},disabled:!!C}),o.createElement(p,{size:"sm",className:"warning",color:E.colors.gray400},"* ",A("commentPopup.warning.newPost"))),!L&&o.createElement("div",{className:"input-group"},o.createElement(p,{size:"p4",className:"input-group-label"},A("tab.topic")),o.createElement("div",{className:"input-notification"},o.createElement("img",{src:de?"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%232D87F3'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e":Qe}),o.createElement(p,{size:"base",color:E.colors.gray500},A(de?"createPost.popup.primary":"createPost.popup.warning"))),de&&o.createElement(rt,{className:"tag-list",communityId:de.id,forceTopics:k,onChange:oe,selectedTopics:ie,noFetch:M}))),o.createElement(m,{theme:F?"marryBaby":"helloSites",className:"submit-btn",size:"lg",onClick:function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!we||U)return[3,5];V(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Ee()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),console.error(e),D(Ke(A)),[3,4];case 4:V(!1),t.label=5;case 5:return[2]}}))}))},isDisabled:!we,isLoading:U},A("createPost.popup.submit")))},ct=function(e){var t=e.className,n=e.isMarryBaby,i=e.style,l=e.title,c=e.description,u=e.acceptText,v=e.cancelText,g=e.onAccept,f=e.thumbnail,w=e.isThumbnailIcon,E=e.onClose,k=a(y).data.env.isMarryBaby,b="boolean"==typeof n?n:k,N=r(!1),I=N[0],T=N[1];return s((function(){return h(!0),setTimeout((function(){return T(!0)}),0),function(){return h(!1)}}),[]),Ae.createPortal(o.createElement(K,{"data-is-marrybaby":b,className:t,style:i,"data-open":I},o.createElement(Q,{className:"popup-frame",isOpen:I,onClose:E},o.createElement("div",{className:"confirm-dialog",onClick:function(e){return e.stopPropagation()}},o.createElement("div",{className:"confirm-content"},f&&o.createElement("div",{className:"thumbnail-container ".concat(w?"is-icon":"")},o.createElement("img",{className:"thumbnail",src:f})),o.createElement(d,{className:"title",tag:"h2"},l),o.createElement(p,{className:"desc",size:"lg"},c),o.createElement("div",{className:"btn-group"},o.createElement(m,{theme:b?"marryBaby":"helloSites",size:"md",color:"secondary",onClick:function(){null==g||g(),null==E||E()}},u),o.createElement(m,{theme:b?"marryBaby":"helloSites",size:"md",onClick:E},v)))),b&&f&&o.createElement("div",{className:"thumbnail-container is-mobile ".concat(w?"is-icon":"")},o.createElement("img",{className:"thumbnail",src:f})))),C())},ut=function(n){var i=n.postId,o=n.message,a=n.photos,r=n.link,l=n.locale,s=n.sanitizeFunction,c=n.replyingUserId,u=n.replyingUserName,d=n.replyingId;return e(void 0,void 0,void 0,(function(){var e,n,m;return t(this,(function(t){switch(t.label){case 0:return e=new FormData,n=B(o.replace(/(\&nbsp;)+/g," "),s),m=j(n),a&&a.length>0?[4,Promise.all(null==a?void 0:a.map((function(e){return F(e,l)})))]:[3,2];case 1:t.sent().filter(Boolean).slice(0,_).forEach((function(t){e.append("images[]",t)})),t.label=2;case 2:return r&&e.append("link",r),null==m||m.forEach((function(t){e.append("mention_ids[]",t)})),e.append("post_id",i),d&&e.append("parent_id",d),c&&(m.unshift(c),n='[mention+id="'.concat(c,'"+name="').concat((u||"").replace('"',"'"),'"]').concat(n),e.append("parent_user_id",String(c))),e.append("content",n),e.append("content",n),[2,e]}}))}))},dt=function(n,i){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,P(T(x.COMMENT.CREATE,{_locale:i}),"POST",{data:n,headers:{"Content-Type":"multipart/form-data"}})]}))}))},mt=function(n,i){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,P(T(x.COMMENT.REPLY,{_locale:i}),"POST",{data:n,headers:{"Content-Type":"multipart/form-data"}})]}))}))},pt=function(n){var i=n.commentId,o=n.setLike,a=void 0!==o&&o,r=n.locale;return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,P(T(a?x.COMMENT.LIKE:x.COMMENT.UNLIKE,{_locale:r,id:i}),"GET")]}))}))},vt=function(e){var t=e.id,n=e.locale;return P(T(x.COMMENT.DELETE,{_locale:n,id:t}),"DELETE")},gt=function(i){var c=i.isReply,u=i.className,d=i.onClose,v=i.replyToName,g=i.style,h=i.replyingId,C=i.replyingUser,w=i.onPostSuccess;i.isMainCmt;var E=i.post,k=i.isMarryBaby,b=a(y),N=b.action,I=N.pushNotifications,T=N.sanitizeFunction,x=b.data,M=x.userInfo,L=x.locale,P=x.env.isMarryBaby,_="boolean"==typeof k?k:P,S=f().t,j=tt(),B=j.onSelectImages,F=j.onRemoveImage,R=j.imageSrcs,A=j.onRemoveAllImages,z=j.imageFiles,U=r(""),V=U[0],H=U[1],W=a(X).trigger,Z=r(!1),G=Z[0],K=Z[1],Q=l(null),ee=l(null),te=l(null),ne=r([]),ie=ne[0],oe=ne[1],ae=r([]),re=ae[0],le=ae[1],se=r(null),ce=se[0],ue=se[1];return s((function(){var e;null===(e=te.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout((function(){var e;null===(e=ee.current)||void 0===e||e.focus()}),400)}),[W]),o.createElement(J,{"data-is-reply":c,className:u,style:g},c&&o.createElement("div",{className:"reply-to-container"},o.createElement(p,{size:"p4"},o.createElement("span",{dangerouslySetInnerHTML:{__html:S("inputComment.replyTo",{name:'<span style="color: #2D87F3; cursor: pointer">@'.concat(v||"","</span>")})}})),o.createElement("img",{src:"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8.00016' cy='8.50004' r='6.66667' fill='white' stroke='%23404040'/%3e%3cpath d='M10 6.5L6 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6 6.5L10 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-close-comment",onClick:function(){return d&&d()}})),o.createElement("div",{className:"input-container",ref:te},o.createElement(Y,{className:"avatar-wrapper ".concat(c?"avatar-wrapper-reply":""),avatar:(null==M?void 0:M.id)?M.avatar:$,username:(null==M?void 0:M.name)||(null==M?void 0:M.username)}),o.createElement("input",{ref:Q,onChange:B,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),o.createElement(ze,{value:V,name:"input",size:"md",className:"input-wrapper",displayIcon:o.createElement("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.7543 4.85352H4.49227C4.01776 4.85352 3.56268 5.04201 3.22715 5.37754C2.89162 5.71307 2.70313 6.16815 2.70312 6.64266V19.1667C2.70313 19.6412 2.89162 20.0963 3.22715 20.4318C3.56268 20.7673 4.01776 20.9558 4.49227 20.9558H17.0163C17.4908 20.9558 17.9459 20.7673 18.2814 20.4318C18.6169 20.0963 18.8054 19.6412 18.8054 19.1667V12.9047' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M17.4633 3.51187C17.8192 3.15599 18.3019 2.95605 18.8052 2.95605C19.3085 2.95605 19.7912 3.15599 20.147 3.51187C20.5029 3.86775 20.7029 4.35044 20.7029 4.85373C20.7029 5.35702 20.5029 5.83971 20.147 6.19559L11.6486 14.694L8.07031 15.5886L8.96489 12.0103L17.4633 3.51187Z' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e"}),CustomInput:o.createElement("div",{className:"as-input"},o.createElement(D,{className:"textarea",html:V,onChange:H,onImagePickerClick:function(){var e;return null===(e=Q.current)||void 0===e?void 0:e.click()},bannedWords:re,onPreviewUrlChange:ue,onInvalidUrlsChange:oe,setEditorRef:function(e){return ee.current=e},isReplying:c}))}),o.createElement(m,{theme:_?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:function(){return e(void 0,void 0,void 0,(function(){var e,i,o,a,r,l,s,u,m,p,v,g,f;return t(this,(function(t){switch(t.label){case 0:if(!(null==E?void 0:E.id)||G)return[2];K(!0),t.label=1;case 1:return t.trys.push([1,4,,5]),e=function(e){H(""),A(),d&&d();var t=q(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),w&&w(t)},[4,ut(n({message:V,photos:z,postId:String(E.id),link:null==ce?void 0:ce.url,sanitizeFunction:T,locale:L},c&&h?{replyingUserId:String((null==C?void 0:C.id)||(null===(r=null==E?void 0:E.author)||void 0===r?void 0:r.id)||""),replyingId:h,replyingUserName:(null==C?void 0:C.name)||(null==C?void 0:C.username)||""}:{}))];case 2:return i=t.sent(),[4,c&&h?mt(i,L):dt(i,L)];case 3:return o=t.sent(),(null==(a=null==o?void 0:o.data)?void 0:a.id)&&!(null===(s=null===(l=null==o?void 0:o.messages)||void 0===l?void 0:l.moderation)||void 0===s?void 0:s.type)?e(o):"banned"===(null===(m=null===(u=null==o?void 0:o.messages)||void 0===u?void 0:u.moderation)||void 0===m?void 0:m.type)?(I({title:S("notification.comment.blocked.title"),message:S("notification.comment.blocked.message"),type:"danger"}),o.messages.moderation.words&&le(o.messages.moderation.words)):"suspect"===(null===(v=null===(p=null==o?void 0:o.messages)||void 0===p?void 0:p.moderation)||void 0===v?void 0:v.type)?(I({title:S("notification.comment.suspect.title"),message:S("notification.comment.suspect.message"),type:"warning"}),H(""),A(),d&&d()):(null===(g=null==o?void 0:o.messages)||void 0===g?void 0:g.find((function(e){var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(I({message:S("notification.suspend.message"),type:"warning"}),H(""),A(),d&&d()):I({title:"",message:(null===(f=null==o?void 0:o.messages)||void 0===f?void 0:f[0])||S("notification.comment.somethingWrong"),type:"danger"}),[3,5];case 4:return t.sent(),I({title:"",message:S("notification.comment.somethingWrong"),type:"danger"}),[3,5];case 5:return K(!1),[2]}}))}))},isLoading:G,isDisabled:!!(null==ie?void 0:ie.length)||G||!V||(null==V?void 0:V.length)<2||!V.trim()},o.createElement("img",{src:"data:image/svg+xml,%3csvg width='20' height='21' viewBox='0 0 20 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.5 9.73438L3.75 13.4844L7.5 17.2344' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M16.25 4.73438L16.25 10.3026C16.25 11.1464 15.9208 11.9557 15.3347 12.5524C14.7487 13.1491 13.9538 13.4844 13.125 13.4844L3.75 13.4844' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-enter"}))),(null==ie?void 0:ie.length)?o.createElement("div",{className:"error-text"},S("notification.limitUrlDomain")):null,(!R||0===R.length)&&ce&&o.createElement("div",{className:"link-preview-wrapper"},ce.isFetching?o.createElement(O,null):o.createElement(o.Fragment,null,o.createElement(We,{title:ce.title,url:ce.url||"#",image:ce.image,noRefetch:!0}),o.createElement("img",{src:nt,className:"icon-close",onClick:function(){return ue(null)}}))),R&&R.length>0&&o.createElement("div",{className:"preview-images-container"},R.map((function(e,t){return o.createElement("div",{key:t,className:"image-src-wrapper"},o.createElement("img",{className:"preview-image",src:e}),o.createElement("img",{src:nt,className:"icon-close-circle",onClick:function(){return F(t)}}))}))))},ft="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 5V8' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11H8.00708' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",ht=function(n){var i=n.className,l=n.style,s=n.reason,c=n.reasonText,u=n.onClose,d=n.postId,v=a(y),g=v.data,h=g.locale,C=g.env.isMarryBaby,w=v.action.pushNotifications,k=f().t,b=r(!1),N=b[0],I=b[1];return o.createElement(ee,{"data-is-marrybaby":C,className:i,style:l},o.createElement("ul",{className:"report-list"},o.createElement("li",{className:"report-item"},o.createElement("img",{src:ft}),o.createElement(p,{className:"__label",color:E.colors.gray800,size:"p4"},c))),o.createElement(m,{theme:C?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:N,onClick:function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!d||N)return[2];I(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,et({id:d,reason:s,locale:h})];case 2:return 1===(null==(e=t.sent())?void 0:e.status)&&(w({message:"Post reported",type:"success"}),u&&u()),[3,4];case 3:return t.sent(),[3,4];case 4:return I(!1),[2]}}))}))}},k("submit")))},Ct=function(e){var t=e.className,n=e.style,i=e.replyingTo,l=e.mentionedUser,s=e.description,u=e.disableShortenContent,d=e.mentions,m=void 0===d?[]:d,p=r(!1),v=p[0],g=p[1],h=f().t,C=te().authActionWrapper,w=r(!1),E=w[0],k=w[1],b=H(W(s||"","display"),m),N=a(y).action.sanitizeFunction,I=c((function(){var e=N(b||"");if(u||v)return{showContent:e,hasSeeMore:!1};var t=e.slice(0,1e3),n=1e3-27*((t.match(/<\/div>/g)||[]).length-1),i=(t||"").slice(0,n<40?40:n),o=N(i.replace(/(<|<\/)( +|[a-zA-Z]*)$/gi,"")),a=o.length<e.length-10;return{showContent:a?o:e,hasSeeMore:a}}),[u,v,b]),T=(null==l?void 0:l.name)||i,x="expert"===(null==l?void 0:l.role)&&!!(null==l?void 0:l.partnerId);return o.createElement(o.Fragment,null,x&&o.createElement(ne,{isOpen:E,onClose:function(){return k(!1)},expertId:String(null==l?void 0:l.partnerId)}),o.createElement(ie,{className:"".concat(t," no-replace-click"),style:n},T&&o.createElement("span",{onClick:function(){return x&&k(!0)},className:"post-content-replying"},"@",T),(null==s?void 0:s.startsWith("[mention+id="))&&o.createElement("span",{className:"post-content-replying tag-only"},"@"),o.createElement("span",{dangerouslySetInnerHTML:{__html:I.showContent},className:"post-content ".concat(I.hasSeeMore?"has-see-more":"")}),I.hasSeeMore&&!v&&o.createElement("span",null,"... ",o.createElement("span",{onClick:function(e){e.preventDefault(),e.stopPropagation(),C((function(){return g(!0)}))},className:"see-more-text"},h("post.seeMore")))))},wt=function(e){var t=e.className,n=e.style,i=e.authorName,a=e.images,l=e.onClose,c=e.onOpenSingleView,u=f().t,d=r(!1),m=d[0],v=d[1];return s((function(){setTimeout((function(){v(!0)}),0)}),[]),Ae.createPortal(o.createElement(oe,{className:t,style:n,"data-open":m},o.createElement("div",{className:"top-bar"},o.createElement("img",{className:"icon-arrow-left",src:"data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.0508 18.0607L4.00078 12.0367L10.0508 6.01172' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4.00195 12.0352L19.002 12.0352' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",onClick:l,alt:"go back"}),o.createElement(p,{size:"p2",type:"bold",style:{textAlign:"center"}},u("previewPhotos.title",{name:i}))),o.createElement("div",{className:"container"},a.map((function(e,t){return o.createElement("img",{className:"img-preview",key:t,src:e,onClick:function(){return null==c?void 0:c(t)},alt:"post img"})})))),C())},Et="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12.8125L10 8.8125L6 4.8125' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",kt=function(e){var t=e.initialViewIndex,n=e.images,i=e.onClose,a=r(t),l=a[0],c=a[1],u=r(!1),d=u[0],m=u[1];s((function(){setTimeout((function(){m(!0)}),0)}),[]);var p=null==n?void 0:n[l],v=0===l,g=!(null==n?void 0:n.length)||l===(null==n?void 0:n.length)-1;return Ae.createPortal(o.createElement(ae,{"data-open":d&&!!p},o.createElement(re,null,o.createElement("img",{src:le,className:"icon-close",onClick:i,alt:"close"})),p&&l>=0&&o.createElement(o.Fragment,null,o.createElement(se,null,o.createElement("img",{className:"img-preview",src:p,alt:"post img open"}),o.createElement(ce,{"data-disabled":v,onClick:function(){return!v&&c(l-1)}},o.createElement(ue,null,o.createElement("img",{src:Et,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":v}))),o.createElement(ce,{"data-right":!0,"data-disabled":g,onClick:function(){return!g&&c(l+1)}},o.createElement(ue,null,o.createElement("img",{src:Et,alt:"right arrow","data-disabled":g})))))),C())},yt=function(e){var t=e.image,n=e.isShortcut,i=r(!0),a=i[0],l=i[1],c=f().t;return s((function(){setTimeout((function(){return null==He?void 0:He.update()}),100)}),[t]),o.createElement(de,{"data-is-blurred":a,onClick:function(e){return a&&e.stopPropagation()}},o.createElement("img",{className:"lazy img-preview","data-src":t}),o.createElement(me,null,o.createElement(pe,null,o.createElement(ve,{"data-is-shortcut":n,onClick:function(){return l(!a)}},o.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.71 4.54039C2.32 4.15039 2.32 3.52039 2.71 3.13039C3.1 2.74039 3.74 2.74039 4.13 3.13039L20.44 19.4604C20.83 19.8504 20.83 20.4804 20.44 20.8704C20.05 21.2604 19.42 21.2604 19.03 20.8704L16.31 18.1504C14.97 18.6704 13.52 18.9704 12 18.9704C7 18.9704 2.73 15.8604 1 11.4704C1.77 9.50039 3.06 7.80039 4.68 6.51039L2.71 4.54039ZM17 11.4704C17 8.71039 14.76 6.47039 12 6.47039C11.49 6.47039 11 6.57039 10.53 6.71039L8.36 4.54039C9.51 4.17039 10.73 3.97039 12 3.97039C17 3.97039 21.27 7.08039 23 11.4604C22.31 13.2204 21.21 14.7604 19.82 15.9904L16.76 12.9304C16.9 12.4704 17 11.9804 17 11.4704ZM12 16.4704C9.24 16.4704 7 14.2304 7 11.4704C7 10.7004 7.18 9.97039 7.49 9.33039L9.06 10.9004C9.03 11.0804 9 11.2704 9 11.4704C9 13.1304 10.34 14.4704 12 14.4704C12.2 14.4704 12.38 14.4404 12.57 14.4004L14.14 15.9704C13.49 16.2904 12.77 16.4704 12 16.4704ZM14.97 11.1404C14.82 9.74039 13.72 8.65039 12.33 8.50039L14.97 11.1404Z",fill:"#ffffff"}))),o.createElement(ge,null,!n&&o.createElement(fe,null,o.createElement(he,null,c("sensitiveMask.contentWarningMessage")),o.createElement(Ce,null,c("sensitiveMask.contentWarningDescription"))),(n&&!a||!n)&&o.createElement(we,null,o.createElement(Ee,{size:"sm",onClick:function(e){!a&&e.stopPropagation(),l(!a)}},c(a?"sensitiveMask.unblur":"sensitiveMask.blur")))))))},bt=function(e){var t=e.className,n=e.images,i=void 0===n?[]:n,c=e.style,u=e.authorName,m=e.isSensitive,p=void 0!==m&&m,v=a(y).data.env.isMarryBaby,g="+ ".concat((i.length||0)-4),f=r(!1),C=f[0],w=f[1],E=r(-1),k=E[0],b=E[1];s((function(){setTimeout((function(){return null==He?void 0:He.update()}),100)}),[null==i?void 0:i.slice(0,5).join("|")]);var N=i.length>5,I=l(!1);return s((function(){return function(){I.current&&h(!1)}}),[]),s((function(){C||k>=0?(h(!0),I.current=!0):(h(!1),I.current=!1)}),[C,k]),o.createElement(o.Fragment,null,o.createElement(ke,{className:t,style:c,"data-image-count":N?5:i.length||0,"data-is-marrybaby":v},null==i?void 0:i.slice(0,5).map((function(e,t){return o.createElement("div",{className:"img-wrapper",key:t,onClick:function(){t>=4&&N?w(!0):b(t)}},p&&o.createElement(yt,{image:e,isShortcut:0!==t}),!v&&o.createElement("img",{className:"lazy img-preview-blur","data-src":e}),o.createElement("img",{className:"lazy img-preview","data-src":e}),4===t&&N&&o.createElement("div",{className:"img-more-overlay"},o.createElement(d,{tag:"h1",color:"white"},g)))}))),C&&o.createElement(wt,{authorName:u||"",images:i,onClose:function(){return w(!1)},onOpenSingleView:b}),k>=0&&o.createElement(kt,{images:i,initialViewIndex:k,onClose:function(){return b(-1)}}))},Nt=function(i){var u=i.url,d=i.image,m=i.className,p=i.style,v=a(y).data.locale,g=r(null),f=g[0],h=g[1];s((function(){e(void 0,void 0,void 0,(function(){return t(this,(function(e){return d?[2]:u?(h((function(e){return n(n({},e),{isFetching:!0})})),I(T(x.FETCH_PREVIEW,{_locale:v}),"POST",{data:{link:u}}).then((function(e){var t,n;h({url:u,image:(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.image)||(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.logo)})})).catch((function(){h(null)})),[2]):[2,h(null)]}))}))}),[u,d]);var C=(null==f?void 0:f.image)||d,w=(null==f?void 0:f.url)||u,E=c((function(){return ye(w)}),[w]),k=c((function(){return be(w)}),[w]),b=l(0),M=l(0),L=r(!1),P=L[0],_=L[1];s((function(){var e=function(){var e,t=null===(e=S.current)||void 0===e?void 0:e.getBoundingClientRect(),n=!1;t&&(!b.current||Math.abs((b.current-t.width)/(null==t?void 0:t.width))>.2)&&(b.current=Math.floor(t.width),n=!0),t&&(!M.current||Math.abs((M.current-t.height)/(null==t?void 0:t.height))>.2)&&(M.current=Math.floor(t.height),n=!0),n&&_((function(e){return!e}))};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var S=l(null),j=l(!1);return o.createElement(Ne,{className:"".concat(m," no-replace-click"),style:p,ref:S},d||!E&&!k?o.createElement("a",{href:w,target:"_blank",rel:"noreferrer"},o.createElement("div",{className:"link-image-wrapper ".concat((null==f?void 0:f.isFetching)?"fetching":"")},(null==f?void 0:f.isFetching)?o.createElement(O,{className:"loading-spinner"}):o.createElement("img",{className:"link-image",src:C||N,onError:function(e){j.current||(j.current=!0,e.currentTarget.src=N)}}))):o.createElement("div",{className:"link-image-wrapper"},E?o.createElement("iframe",{width:"100%",height:"100%",src:"https://www.youtube.com/embed/".concat(E,"?&autoplay=1&mute=1"),frameBorder:"0",allowFullScreen:!0,style:{position:"absolute",top:0,left:0,border:"none",overflow:"hidden"}}):k?o.createElement("iframe",{key:String(P),src:"https://www.facebook.com/plugins/video.php?href=".concat(encodeURIComponent(w),"&autoplay=1&show_text=false&t=0&width=").concat(b.current,"&height=").concat(M.current),style:{position:"absolute",top:"50%",left:"50%",border:"none",overflow:"hidden",height:M.current,width:b.current,transform:"translate(-50%, -50%)"},scrolling:"no",frameBorder:"0",allowFullScreen:!0,allow:"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"}):null))},It="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10Z' fill='%233E3F58'/%3e %3cpath d='M19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10Z' fill='%233E3F58'/%3e %3cpath d='M12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z' fill='%233E3F58'/%3e %3c/svg%3e",Tt="data:image/svg+xml,%3csvg width='3' height='13' viewBox='0 0 3 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='1.58326' cy='6.41663' r='1.25' transform='rotate(89.9997 1.58326 6.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='1.41663' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 1.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='11.4166' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 11.4166)' fill='%23595959'/%3e%3c/svg%3e",xt="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2 4H3.33333H14' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.33334 3.99992V2.66659C5.33334 2.31296 5.47382 1.97382 5.72387 1.72378C5.97392 1.47373 6.31305 1.33325 6.66668 1.33325H9.33334C9.68697 1.33325 10.0261 1.47373 10.2762 1.72378C10.5262 1.97382 10.6667 2.31296 10.6667 2.66659V3.99992M12.6667 3.99992V13.3333C12.6667 13.6869 12.5262 14.026 12.2762 14.2761C12.0261 14.5261 11.687 14.6666 11.3333 14.6666H4.66668C4.31305 14.6666 3.97392 14.5261 3.72387 14.2761C3.47382 14.026 3.33334 13.6869 3.33334 13.3333V3.99992H12.6667Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6.66666 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.33334 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",Mt=function(n){var i=n.onDeleteComment,l=n.commentId,s=n.className,c=void 0===s?"":s,u=n.popoverClassName,d=void 0===u?"":u,m=a(y),p=m.data,v=p.env.isMarryBaby,g=p.locale,h=m.action.pushNotifications,C=f().t,w=r(!1),E=w[0],k=w[1],b=te().authActionWrapper;return o.createElement("div",{className:c,onClick:function(e){e.preventDefault(),e.stopPropagation()}},E&&o.createElement(ct,{thumbnail:"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0)'%3e%3cpath d='M2 4.00781H3.33333H14' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.33337 4.00846V2.67513C5.33337 2.32151 5.47385 1.98237 5.7239 1.73232C5.97395 1.48227 6.31309 1.3418 6.66671 1.3418H9.33337C9.687 1.3418 10.0261 1.48227 10.2762 1.73232C10.5262 1.98237 10.6667 2.32151 10.6667 2.67513V4.00846M12.6667 4.00846V13.3418C12.6667 13.6954 12.5262 14.0346 12.2762 14.2846C12.0261 14.5347 11.687 14.6751 11.3334 14.6751H4.66671C4.31309 14.6751 3.97395 14.5347 3.7239 14.2846C3.47385 14.0346 3.33337 13.6954 3.33337 13.3418V4.00846H12.6667Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6.66663 7.3418V11.3418' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.33337 7.3418V11.3418' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0'%3e%3crect width='16' height='16' fill='white' transform='translate(0 0.0078125)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:C("popup.deleteComment.title"),description:C("popup.deleteComment.description"),acceptText:C("popup.deletePost.accept"),cancelText:C("popup.deletePost.cancel"),onAccept:function(){return e(void 0,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return l?[4,vt({id:l,locale:g})]:[2];case 1:return 1===(null==(e=t.sent())?void 0:e.status)?(i&&i(),h({title:"",message:C("notification.success"),type:"success"})):h({title:"",message:(null===(n=null==e?void 0:e.messages)||void 0===n?void 0:n[0])||C("notification.failure"),type:"danger"}),[2]}}))}))},onClose:function(){return k(!1)}}),o.createElement(Ie,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:xt,label:C("actionPopover.delete"),onClick:function(){b((function(){k(!0)}))}}]},className:d,toggleButtonContent:o.createElement("img",{src:v?It:Tt}),buttonProps:{}}))},Lt=function(i){var l,u,d,p,v,h=i.className,C=i.style,w=i.comment,E=i.type,b=void 0===E?"comment":E,N=i.level,T=void 0===N?0:N,x=i.replyingId,M=i.onPostCommentSuccess,L=i.post,P=i.onDeleteComment,_=i.refetchComment,S=i.hasQuickBookingEnable,j=i.handleMakeAppointment,B=a(y).data,F=B.locale,R=B.userInfo,D=B.env.isMarryBaby,O=f().t,A=r(w||null),z=A[0],U=A[1],V=z.id;z.countReplies;var H=z.countLikes,W=z.content,Z=z.createdAt,G=z.replies,K=void 0===G?[]:G,Q=z.images,X=void 0===Q?[]:Q,J=z.author,Y=z.liked,$=z.link,q=z.mentionedUser,ee=z.mentions,ne=function(e){try{var t=e.match(/\[@([^\]]+)\]/),n=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:n}}catch(e){}return{text:""}}(W),ie=ne.text,oe=ne.replyingTo,ae=te({_joinCommunityIds:[null===(l=null==L?void 0:L.community)||void 0===l?void 0:l.id],_joinTopicIds:null===(u=null==L?void 0:L.topics)||void 0===u?void 0:u.map((function(e){return e.id}))}).authActionWrapper,re=r(4),le=re[0],se=re[1],ce=!!(null==R?void 0:R.id)&&(null==K?void 0:K.some((function(e){return e.author.id===R.id}))),ue=function(e){U((function(t){if(!t.replies.find((function(t){return t.id===e.id}))){t.replies.unshift(e);var i=n(n({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return _&&_(i),i}return t}))},de=r(!1),me=de[0],pe=de[1],ve=c((function(){return"comment"===b&&K&&0!=K.length?K.sort((function(e,t){var n=new Date(e.createdAt).getTime(),i=new Date(t.createdAt).getTime();return n>i?-1:n<i?1:0})):K}),[b,K]),ge=(null==K?void 0:K.length)||0,fe=String(null==J?void 0:J.email)&&(null==R?void 0:R.email)&&String(null==J?void 0:J.email)===String(null==R?void 0:R.email),he=(null==J?void 0:J.name)||(null==J?void 0:J.username)||"",Ce=null==J?void 0:J.avatar,we=(null==J?void 0:J.username)||(null==J?void 0:J.name)||"",Ee=r(null),ke=Ee[0],ye=Ee[1],be=r(null),Ne=be[0],Ie=be[1];s((function(){if(null==J?void 0:J.hospitalId){n=J.hospitalId,e(void 0,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return[4,I(_e(Se.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:k[F]}),"get")];case 1:return e=t.sent(),(null===(i=null==e?void 0:e._data)||void 0===i?void 0:i.branch)&&ye(null==e?void 0:e._data.branch),[2]}}))}))}var n,i;if(null==J?void 0:J.doctorId){i=J.doctorId,e(void 0,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return[4,I(_e(Se.GET_DOCTOR_INFO,{doctorId:i,website_url:k[F]}),"get")];case 1:return e=t.sent(),(null===(n=null==e?void 0:e._data)||void 0===n?void 0:n.doctor)&&Ie(null==e?void 0:e._data.doctor),[2]}}))}))}}),[J.hospitalId,J.doctorId]);var je=(null==Ne?void 0:Ne.valid_outpatient)||(null==Ne?void 0:Ne.valid_telemedicine),Be=((null==ke?void 0:ke.total_available_service)||(null==ke?void 0:ke.total_available_doctor))>0,Fe=S&&(je||Be);return o.createElement(Te,{defaultParams:{_joinCommunityIds:[null===(d=null==L?void 0:L.community)||void 0===d?void 0:d.id],_joinTopicIds:null===(p=null==L?void 0:L.topics)||void 0===p?void 0:p.map((function(e){return e.id}))}},o.createElement(xe,{className:h,style:C,"data-is-reply":!!T,"data-is-marrybaby":D,"data-has-booking":Fe},"reply"===b&&o.createElement(g,{className:"top-divider",type:"solid"}),o.createElement(Me,{avatar:Ce,name:he,username:we,email:null==J?void 0:J.email,time:Z,className:"post-author ".concat(fe?"with-popover":""),type:b,userId:null==J?void 0:J.id,role:null==J?void 0:J.role,expertId:null==J?void 0:J.partnerId,title:null==J?void 0:J.title,doctorId:null==J?void 0:J.doctorId,hospitalId:null==J?void 0:J.hospitalId,hasQuickBooking:Fe,handleMakeAppointment:j}),o.createElement(Ct,{className:"post-content-wrapper",replyingTo:oe,mentionedUser:q,description:ie,mentions:ee}),o.createElement("span",null),o.createElement("span",null),X&&X.length>0?o.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},o.createElement(bt,{images:X,authorName:null==J?void 0:J.username})):null,X&&0!==X.length||!$?null:o.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},o.createElement(We,{url:$})),"most-engaging"!==b?o.createElement(o.Fragment,null,o.createElement(Le,{type:Pe.reply,loveCount:H,replyCount:ge,className:"post-reaction",liked:Y,isReplied:ce,hideCommentIcon:"reply"===b,onCommentClick:function(){return ae((function(){return pe((function(e){return!e}))}))},onCommentCountClick:function(){return ae((function(){pe(!0)}))},onLikeClick:function(){return ae((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return V?[4,pt({commentId:V,setLike:!Y,locale:F})]:[3,2];case 1:1===e.sent().status&&U((function(e){return n(n({},e),{liked:!Y,countLikes:e.countLikes+(Y?-1:1)})})),e.label=2;case 2:return[2]}}))}))}))}}),me&&o.createElement(gt,{replyingId:x||z.id,replyToName:J.name||J.username||"",isReply:!0,onClose:function(){return pe(!1)},onPostSuccess:function(e){"reply"===b?M&&M(e):ue(e)},post:L,replyingUser:J}),"comment"===b&&K&&K.length>0?o.createElement("div",{className:"comment-reply-wrapper"},null===(v=null==ve?void 0:ve.slice(0,le))||void 0===v?void 0:v.map((function(e){return o.createElement(Lt,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:T+1,replyingId:V,onPostCommentSuccess:ue,post:L,onDeleteComment:function(){U((function(t){return n(n({},t),{replies:t.replies.filter((function(t){return t.id!==e.id})),countReplies:t.countReplies-1})}))},handleMakeAppointment:j,hasQuickBookingEnable:S})})),ge>le&&o.createElement(o.Fragment,null,o.createElement(g,{className:"top-divider",type:"solid"}),o.createElement(m,{className:"more-cmt",size:"lg",color:"ghost",onClick:function(){return se((function(e){return e+4}))}},O("comment.seeMoreReplies",{count:ge-le}),o.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12L10 8L6 4' stroke='%232D87F3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e"})))):null):null,fe&&o.createElement(Mt,{onDeleteComment:P,className:"popover",commentId:z.id})))},Pt="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='%23595959' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",_t="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",St="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 5.33337C13.1046 5.33337 14 4.43794 14 3.33337C14 2.2288 13.1046 1.33337 12 1.33337C10.8954 1.33337 10 2.2288 10 3.33337C10 4.43794 10.8954 5.33337 12 5.33337Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M12 14.6666C13.1046 14.6666 14 13.7712 14 12.6666C14 11.5621 13.1046 10.6666 12 10.6666C10.8954 10.6666 10 11.5621 10 12.6666C10 13.7712 10.8954 14.6666 12 14.6666Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.72668 9.00665L10.28 11.66' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M10.2734 4.33997L5.72668 6.9933' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",jt=function(n){var i=n.authorEmail,l=n.onDeletePost,s=n.shareUrl,c=n.post,u=n.className,d=void 0===u?"":u,m=n.popoverClassName,p=void 0===m?"":m,v=n.onBookmark,g=n.onRemoveBookmark,h=n.onEditPost,C=a(y),w=C.data,E=w.locale,k=w.userInfo,b=w.togetherUserId,N=w.env.isMarryBaby,I=C.action.pushNotifications,M=f().t,L=r(!1),_=L[0],S=L[1],j=r(!1),B=j[0],F=j[1],R=r(!1),D=R[0],O=R[1],A=te().authActionWrapper,z=i&&(null==k?void 0:k.email)&&i===String(null==k?void 0:k.email);return o.createElement("div",{className:d,onClick:function(e){e.preventDefault(),e.stopPropagation()}},D&&o.createElement(je,{url:s,text:null==c?void 0:c.title,onClose:function(){return O(!1)}}),B&&o.createElement(ct,{thumbnail:"./svg/delete.svg",isThumbnailIcon:!0,title:M("popup.deletePost.title"),description:M("popup.deletePost.description"),acceptText:M("popup.deletePost.accept"),cancelText:M("popup.deletePost.cancel"),onAccept:function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!(null==c?void 0:c.id)||_)return[2];S(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Je({id:c.id,locale:E})];case 2:return 1===(null==(e=t.sent())?void 0:e.status)&&(null==l||l()),[3,4];case 3:return t.sent(),[3,4];case 4:return S(!1),[2]}}))}))},onClose:function(){return F(!1)}}),o.createElement(Ie,{className:p,toggleButtonContent:o.createElement("img",{src:N?It:Tt}),position:"bottom",align:"end",buttonProps:{isLoading:_},data:z?{isShowheader:!1,type:"list",list:[{icon:St,label:M("morePopover.share"),onClick:function(){return O(!0)}},{icon:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.16952 3.2356H2.99484C2.6785 3.2356 2.37512 3.36126 2.15143 3.58495C1.92774 3.80863 1.80208 4.11202 1.80208 4.42836V12.7777C1.80208 13.094 1.92774 13.3974 2.15143 13.6211C2.37512 13.8448 2.6785 13.9705 2.99484 13.9705H11.3442C11.6605 13.9705 11.9639 13.8448 12.1876 13.6211C12.4113 13.3974 12.537 13.094 12.537 12.7777V8.60303' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M11.6425 2.341C11.8798 2.10375 12.2016 1.97046 12.5371 1.97046C12.8726 1.97046 13.1944 2.10375 13.4317 2.341C13.6689 2.57826 13.8022 2.90005 13.8022 3.23558C13.8022 3.57111 13.6689 3.89289 13.4317 4.13015L7.76607 9.79578L5.38054 10.3922L5.97692 8.00663L11.6425 2.341Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",label:M("actionPopover.edit"),onClick:h},{icon:xt,label:M("actionPopover.delete"),onClick:function(){A((function(){return F(!0)}))}}]}:{isShowheader:!1,type:"list",list:[{icon:St,label:M("morePopover.share"),onClick:function(){return O(!0)}},{icon:(null==c?void 0:c.bookmarked)?Pt:_t,label:(null==c?void 0:c.bookmarked)?M("morePopover.unsavePost"):M("morePopover.savePost"),onClick:function(){A((function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return(null==k?void 0:k.id)&&(null==c?void 0:c.id)?(null==c?void 0:c.bookmarked)?[4,P(T(x.BOOKMARK.DELETE,{_locale:E}),"DELETE",{data:{post_id:String(c.id)}})]:[3,2]:[2];case 1:return 1===(null==(e=t.sent())?void 0:e.status)?(I({title:"",message:"Removed saved post",type:"success",displayIcon:_t}),g&&g()):I({title:"",message:"Remove failed",type:"danger",displayIcon:_t}),[3,4];case 2:return[4,P(T(x.BOOKMARK.CREATE,{_locale:E}),"POST",{data:{user_id:b||k.id,post_id:c.id}})];case 3:1===(null==(e=t.sent())?void 0:e.status)?(I({title:"",message:"Post saved",type:"success",displayIcon:Pt}),v&&v()):I({title:"",message:"Post saved failed",type:"danger",displayIcon:_t}),t.label=4;case 4:return[2]}}))}))}))}},{icon:ft,label:M("morePopover.report"),subTree:{title:M("morePopover.report.title"),description:M("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(Be).map((function(e){return{label:Be[e].label,reason:Be[e].reportReasonText,reasonValue:e}})).map((function(e){return{label:M(e.label),subTree:{title:M("morePopover.reportSubmit.title"),description:M("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:function(t){return o.createElement(ht,{reason:e.reasonValue,reasonText:M(e.reason),postId:null==c?void 0:c.id,onClose:function(){return t&&t(!1)}})}}}}))}}]}}))},Bt=function(n,i){return e(void 0,void 0,void 0,(function(){var e,o,a,r;return t(this,(function(t){switch(t.label){case 0:return[4,Oe(T(x.COMMENT.LIST,{postId:n,_locale:i,sort:"popularity",perPage:1,withoutReply:1}),"GET")];case 1:return e=t.sent(),[2,null===(r=null===(a=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.comments)||void 0===a?void 0:a.map(q))||void 0===r?void 0:r[0]]}}))}))},Ft=function(i){var l=i.className,c=i.style,u=i.hideViewMoreComment,p=i.showMostEngaging,v=i.onCommentClick,g=i.onCommentCountClick,h=i.onMostEngagingCommentClick,C=i.onPostCommentSuccess,E=i.disableCardLink,k=i.disableShortenContent,b=i.onDeletePost,T=i.onEditPost,x=i.post,M=i.mostEngagingComment,L=i.onDeleteComment,P=i.showInputComment,_=i.InlineCommentsComponent,S=i.hasQuickBookingEnable,j=i.handleMakeAppointment,B=r(x),F=B[0],R=B[1],D=r(!1),O=D[0],A=D[1],z=r(M),U=z[0],V=z[1],H=F.community,W=F.topics,Z=F.author,G=F.slug,K=F.isPin,Q=F.liked,X=F.scheduleDateTime,J=F.createdAt,Y=F.photos,$=F.mentions,q=F.title,ee=F.description,ne=F.previewUrl,ie=F.likesCount,oe=F.commentsCount,ae=F.id,re=F.commented,le=a(y),se=le.data,ce=se.locale,ue=se.env,de=ue.isMarryBaby,me=ue.togetherBasePath,pe=le.action.pushNotifications,ve=f().t,ge=r(P),fe=ge[0],he=ge[1],Ce="".concat(me,"/").concat((null==H?void 0:H.slug)||"_","/").concat(G||""),we="".concat(Fe(ce)).concat(Ce),Ee=te((null==H?void 0:H.slug)?{_joinCommunityIds:[H.id],_joinTopicIds:null==W?void 0:W.map((function(e){return e.id}))}:void 0).authActionWrapper,ke=r(!1),ye=ke[0],be=ke[1];s((function(){he(P)}),[P]);var Ne=(null==Z?void 0:Z.name)||(null==Z?void 0:Z.username)||"",Ie=(null==Z?void 0:Z.username)||(null==Z?void 0:Z.name)||"",xe=null==Z?void 0:Z.avatar,Be=r(null),Oe=Be[0],Ae=Be[1],ze=r(null),Ue=ze[0],Ve=ze[1];s((function(){if(null==Z?void 0:Z.hospitalId){n=Z.hospitalId,e(void 0,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return[4,I(_e(Se.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:De[ce]}),"get")];case 1:return e=t.sent(),(null===(i=null==e?void 0:e._data)||void 0===i?void 0:i.branch)&&Ae(null==e?void 0:e._data.branch),[2]}}))}))}var n,i;if(null==Z?void 0:Z.doctorId){i=Z.doctorId,e(void 0,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return[4,I(_e(Se.GET_DOCTOR_INFO,{doctorId:i,website_url:De[ce]}),"get")];case 1:return e=t.sent(),(null===(n=null==e?void 0:e._data)||void 0===n?void 0:n.doctor)&&Ve(null==e?void 0:e._data.doctor),[2]}}))}))}}),[Z.hospitalId,Z.doctorId]);var He=(null==Ue?void 0:Ue.valid_outpatient)||(null==Ue?void 0:Ue.valid_telemedicine),Qe=((null==Oe?void 0:Oe.total_available_service)||(null==Oe?void 0:Oe.total_available_doctor))>0,Je=S&&(He||Qe);s((function(){e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return ae&&oe&&p&&!(null==M?void 0:M.id)?[4,Bt(ae,ce)]:[3,2];case 1:e=t.sent(),V(e),t.label=2;case 2:return[2]}}))}))}),[ae,ce,oe,p,null==M?void 0:M.id]),s((function(){V(M)}),[null==M?void 0:M.id]);var Ye=function(i){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return oe>1&&(null==U?void 0:U.id)&&(null==U?void 0:U.id)===(null==i?void 0:i.id)?[4,Bt(ae,ce)]:[3,2];case 1:e=t.sent(),V(e),t.label=2;case 2:return R((function(e){return n(n({},e),{commentsCount:e.commentsCount-1})})),L&&L(i),[2]}}))}))};return o.createElement(Te,{defaultParams:(null==H?void 0:H.slug)?{_joinCommunityIds:[H.id],_joinTopicIds:null==W?void 0:W.map((function(e){return e.id}))}:void 0},O&&o.createElement(je,{url:we,avatar:N,text:q,onClose:function(){return A(!1)}}),o.createElement(Re,{className:l,style:c,"data-is-marrybaby":de},K?o.createElement(Ge,{className:"post-pin"}):null,o.createElement("div",{style:{position:"relative"}},o.createElement(Me,{avatar:xe,name:Ne,username:Ie,url:E?void 0:Ce,email:null==Z?void 0:Z.email,time:X||J,community:H,className:"post-author",role:null==Z?void 0:Z.role,userId:null==Z?void 0:Z.id,expertId:null==Z?void 0:Z.partnerId,doctorId:null==Z?void 0:Z.doctorId,hospitalId:null==Z?void 0:Z.hospitalId,title:null==Z?void 0:Z.title,hasQuickBooking:Je,handleMakeAppointment:j}),o.createElement(jt,{authorEmail:String(null==Z?void 0:Z.email),onDeletePost:b,shareUrl:we,post:F,className:"popover",onEditPost:T})),o.createElement("a",{href:E?void 0:Ce,className:"post-content-link-wrapper"},q&&o.createElement(d,{className:"post-content-title",as:"h1",tag:"h5",fontWeight:"bold"},w(q)),o.createElement(Ct,{className:"post-content-wrapper",description:ee,disableShortenContent:k,mentions:$})),o.createElement("span",null),o.createElement("span",null),o.createElement("div",{key:"tag-topic"},W&&W.length>0?o.createElement(Ze,{topics:W,className:"post-topics"}):null),o.createElement("div",{key:"social-preview"},(null==F?void 0:F.introUrl)?o.createElement("div",{className:"social-preview-wrapper ".concat((null==Y?void 0:Y.length)?"has-image":"")},o.createElement(Nt,{url:F.introUrl,image:F.bannerImage})):null),o.createElement("div",{key:"image-preview"},(null==Y?void 0:Y.length)?o.createElement("div",{className:"image-preview-wrapper"},o.createElement(bt,{images:Y,authorName:null==Z?void 0:Z.name})):null),o.createElement("div",{key:"link-preview"},(null==F?void 0:F.introUrl)||(null==Y?void 0:Y.length)||!(null==ne?void 0:ne.url)?null:o.createElement("div",{className:"link-preview-wrapper"},o.createElement(We,{title:ne.title,url:ne.url,image:ne.image}))),o.createElement(Le,{type:Pe.post,loveCount:ie,replyCount:oe,className:"post-reaction ".concat((null==Y?void 0:Y.length)||(null==ne?void 0:ne.url)?"hide-top-border":""),liked:ye?!Q:Q,isReplied:re,onCommentClick:function(){return Ee((function(){v?v():he((function(e){return!e}))}))},onCommentCountClick:function(){Ee((function(){de?he(!0):g?g():!E&&(window.location.href=Ce)}))},onShareClick:function(){A(!0)},onLikeClick:function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!ae||ye)return[2];be(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Xe({id:ae,locale:ce})];case 2:return 1!==(null==(e=t.sent())?void 0:e.status)?pe(Ke(ve)):R((function(e){return n(n({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})})),[3,4];case 3:return t.sent(),pe(Ke(ve)),[3,4];case 4:return be(!1),[2]}}))}))},showingMostEngaging:!(!p||!(null==U?void 0:U.id))}),fe&&o.createElement(gt,{isMainCmt:!P,onClose:function(){return he(!1)},onPostSuccess:function(e){0!==oe||(null==U?void 0:U.id)||V(e),R((function(e){return n(n({},e),{commentsCount:e.commentsCount+1,commented:!0})})),C&&C(e)},post:F}),p&&(null==U?void 0:U.id)?o.createElement("div",{className:"most-engaging-wrapper",onClick:function(e){h?(e.stopPropagation(),h()):window.location.href=Ce}},o.createElement(Lt,{hasQuickBookingEnable:S,handleMakeAppointment:j,comment:U,onDeleteComment:function(){Ye&&Ye(U)},className:"most-engaging-comment",type:"most-engaging",key:U.id}),oe>1&&!u&&o.createElement(m,{className:"see-more-comments",color:"ghost",size:"md"},ve("comment.seeMoreComments",{count:oe-1}))):null,_))},Rt=Object.freeze({__proto__:null});export{We as C,gt as I,Ge as L,ct as P,ht as S,Ze as T,st as a,it as b,at as c,rt as d,Ct as e,wt as f,kt as g,bt as h,Ft as i,jt as j,Lt as k,Mt as l,Rt as t};
1
+ import{_ as e,a as t,b as n,c as i}from"./tslib.es6-6ae0d506.js";import o,{useContext as a,useState as r,useRef as l,useEffect as s,useMemo as c,useCallback as u}from"react";import{H as d,B as m}from"./index.styled-25acea1f.js";import{T as p}from"./index.styled-4154e676.js";import{a as v,D as g}from"./index-be3ea0d9.js";import{u as f,t as h,k as C}from"./useTranslations-0b650088.js";import w from"innertext";import{t as E,d as k}from"./theme-0e20eeec.js";import{s as y,fr as b,fs as N,ft as I,fu as T,fv as x,fw as M,h as L,fx as P,fy as _,fz as S,fA as j,fB as B,fC as F,fD as R,fE as D,L as O,fF as A,fG as z,fH as V,fI as U,fJ as H,fK as W,fL as Z,fq as G,fM as K,n as Q,fN as X,fO as J,U as Y,fP as $,fQ as q,fR as ee,u as te,k as ne,fS as ie,fT as oe,fU as ae,fV as re,fW as le,fX as se,fY as ce,fZ as ue,f_ as de,f$ as me,g0 as pe,g1 as ve,g2 as ge,g3 as fe,g4 as he,g5 as Ce,g6 as we,g7 as Ee,g8 as ke,g9 as ye,ga as be,gb as Ne,gc as Ie,e as Te,gd as xe,j as Me,C as Le,ge as Pe,gf as _e,gg as Se,o as je,gh as Be,cV as Fe,gi as Re,gj as De,gk as Oe}from"./index.styled-fe478117.js";import"react-range";import*as Ae from"react-dom";import{I as ze}from"./constants-4e52a6b1.js";import Ve from"lodash/debounce";import Ue from"react-contenteditable";import{l as He}from"./lazyLoad-d80d3fd1.js";import"date-fns";import"styled-components";var We=function(i){var c=i.title,u=i.url,m=i.image,v=i.logo,g=i.className,f=i.style,h=i.noRefetch,C=a(y).data,w=C.locale,E=C.env.isMarryBaby,k=r(!1),M=k[0],L=k[1],P=l(h);P.current=h;var _=r(null),S=_[0],j=_[1];s((function(){e(void 0,void 0,void 0,(function(){return t(this,(function(e){return P.current?[2]:u?(j((function(e){return n(n({},e),{isFetching:!0})})),I(T(x.FETCH_PREVIEW,{_locale:w}),"POST",{data:{link:u}}).then((function(e){var t,n,i;L(!1),j({title:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.title,url:u,image:(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.image)||(null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.logo)})})).catch((function(){j(null)})),[2]):[2,j(null)]}))}))}),[u]);var B=(null==S?void 0:S.image)||m,F=(null==S?void 0:S.title)||c,R=(null==S?void 0:S.logo)||v,D=(null==S?void 0:S.url)||u,O=D.replace("http://","").replace("https://","").split(/[/?#]/)[0],A=l(!1);return o.createElement(b,{"data-is-marrybaby":E,className:"".concat(g," no-replace-click"),style:f},o.createElement("a",{href:D,target:"_blank",rel:"noreferrer"},B&&o.createElement("div",{className:"link-image-wrapper"},!E&&o.createElement("img",{className:"link-image-blur",src:B,onError:function(e){A.current||(A.current=!0,e.currentTarget.src=N)}}),o.createElement("img",{className:"link-image",src:B,onError:function(e){A.current||(A.current=!0,e.currentTarget.src=N)}})),o.createElement("div",{className:"link-info-container"},o.createElement(p,{size:"n1"},E&&R&&!M&&o.createElement("img",{className:"link-logo",src:R,onError:function(e){return L(!0)}}),O),o.createElement(d,{tag:"h6"},F))))},Ze=function(e){var t=e.topics,n=e.onClick,i=e.className,s=e.style,c=function(){var e=r(!1),t=e[0],n=e[1],i=l(null),o=l(null),a=l();return{sliding:t,mouseDownHandler:function(e){if(i.current){a.current=setTimeout((function(){n(!0)}),500),o.current={left:i.current.scrollLeft,x:e.clientX};var t=function(e){var t=o.current;if(t){var n=e.clientX-t.x;i.current&&(i.current.scrollLeft=t.left-n)}},r=function(){a.current&&(clearTimeout(a.current),a.current=void 0),n(!1),document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",t),document.addEventListener("mouseup",r)}},sliderRef:i,pos:o}}(),u=c.sliding,d=c.mouseDownHandler,m=c.sliderRef,v=a(y),g=v.data.env.togetherBasePath,f=v.action.sanitizeFunction;return o.createElement(M,{ref:m,onClick:n,onMouseDown:function(e){return d(e)},className:"".concat(i," ").concat(u?"sliding":""),style:s},t.map((function(e,t){return o.createElement("a",{className:"tag-link-item",key:t,href:e.isActive&&!e.isHidden?"".concat(g).concat(e.url):void 0},o.createElement(p,{size:"p3"},o.createElement("span",{dangerouslySetInnerHTML:{__html:(null==f?void 0:f(e.name))||e.name}})))})))},Ge=function(e){var t=e.onClick;e.color;var n=e.className,i=e.style,r=a(y).data.env.isMarryBaby,l=f().t;return o.createElement(L,{label:o.createElement(o.Fragment,null,r&&o.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M3.5 19.9999L7.87 15.6299' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.95634 11.294C4.56534 11.685 4.56534 12.318 4.95634 12.708L7.87434 15.626L10.7923 18.544C11.1833 18.935 11.8163 18.935 12.2063 18.544L13.3813 17.369C13.5693 17.181 13.6743 16.927 13.6743 16.662V12.726L16.5743 9.82597L18.8833 9.94897C19.1663 9.96397 19.4433 9.85797 19.6433 9.65797L20.2173 9.08397C20.6083 8.69297 20.6083 8.05997 20.2173 7.66997L15.8313 3.28397C15.4403 2.89297 14.8073 2.89297 14.4173 3.28397L13.8433 3.85797C13.6423 4.05897 13.5363 4.33497 13.5523 4.61797L13.6753 6.92697L10.7753 9.82697H6.83834C6.57334 9.82697 6.31834 9.93197 6.13134 10.12L4.95634 11.294V11.294Z' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M16.5699 9.83018L13.6699 6.93018' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3c/svg%3e"})," ",l("label.pinnedPost")),rightLabel:!r&&o.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cline x1='7.18605' y1='7.68219' x2='3.68219' y2='13.8139' stroke='%23FEA21E' stroke-linecap='round'/%3e%3cpath d='M3.24591 7.78426C3.21275 7.84168 3.20376 7.90993 3.22092 7.97398C3.23808 8.03803 3.27998 8.09264 3.3374 8.12579L8.78429 11.2706C8.90385 11.3396 9.05674 11.2986 9.12578 11.1791C9.71191 10.1641 9.71348 8.97262 9.23682 7.99339L10.8583 5.18521C11.5115 5.00603 12.0982 4.57973 12.4638 3.94629C12.5328 3.82672 12.4919 3.67383 12.3723 3.6048L8.18237 1.18584C8.12494 1.15268 8.0567 1.1437 7.99265 1.16086C7.92861 1.17803 7.874 1.21993 7.84086 1.27736C7.47521 1.91077 7.39934 2.63194 7.57065 3.28723L5.94919 6.09545C4.86323 6.1723 3.83201 6.76934 3.24591 7.78426Z' fill='%23FEA21E' stroke='%23FEA21E' stroke-width='0.5' stroke-linejoin='round'/%3e%3c/svg%3e"}),onClick:t,color:"white",className:"label-pinned ".concat(n),style:i})},Ke=function(e){return{message:e("notification.failure"),type:"danger"}},Qe="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%23FE921D'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",Xe=function(n){var i=n.id,o=n.locale;return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return i?[4,P(T(x.POST.LIKE,{id:i,_locale:o}),"GET")]:[2];case 1:return[2,e.sent()]}}))}))},Je=function(n){var i=n.id,o=n.locale;return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return i?[4,P(T(x.POST.DELETE,{id:i,_locale:o}),"DELETE")]:[2];case 1:return[2,e.sent()]}}))}))},Ye=function(n){var i=n.title,o=n.description,a=n.communityId,r=n.imageFiles,l=n.previewUrl,s=n.topicIds,c=n.locale,u=n.sanitizeFunction,d=n.categoryCommunityId,m=n.categoryTopicIds,p=n.introUrl,v=n.bannerUrl,g=n.scheduleTime;return e(void 0,void 0,void 0,(function(){var e,n,f,h,C;return t(this,(function(t){switch(t.label){case 0:return e=new FormData,n=S(o),f=S(i),h=j(n),e.append("title",f),e.append("description",B(n,u)),d?e.append("category_community",String(d)):a&&e.append("community_id",String(a)),(null==l?void 0:l.title)&&e.append("preview_title",l.title),(null==l?void 0:l.description)&&e.append("preview_description",l.description),(null==l?void 0:l.url)&&e.append("preview_link",l.url),(null==l?void 0:l.image)&&e.append("preview_image",l.image),null==s||s.forEach((function(t){e.append("topics[]",String(t||""))})),null==m||m.forEach((function(t){e.append("category_topics[]",String(t||""))})),(null==r?void 0:r.length)?[4,Promise.all(r.map((function(e,t){return new Promise((function(n){setTimeout((function(){n(F(e,c))}),2e3*t)}))})))]:[3,2];case 1:return null==(C=t.sent())||C.filter(Boolean).slice(0,_).forEach((function(t,n){e.append("images[".concat(n,"]"),t)})),[3,3];case 2:e.append("images",""),t.label=3;case 3:return null==h||h.forEach((function(t){e.append("mention_ids[]",t)})),e.append("intro_url",p||""),e.append("banner",v||""),g&&(e.append("post_type","scheduled"),e.append("schedule_datetime",g)),[2,e]}}))}))},$e=function(n){var i=n.locale,o=n.formData,a=n.isArticleComment;return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,P(T(a?x.POST.CREATE_ARTICLE_COMMENT:x.POST.CREATE,{_locale:i}),"POST",{data:o,headers:{"Content-Type":"multipart/form-data"}})];case 1:return[2,e.sent()]}}))}))},qe=function(n){var i=n.id,o=n.locale,a=n.formData;return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,P(T(x.POST.UPDATE,{id:i,_locale:o}),"POST",{data:a})];case 1:return[2,e.sent()]}}))}))},et=function(e){var t=e.id,n=e.reason,i=e.locale,o=new FormData;return o.append("reason",n),P(T(x.POST.REPORT,{_locale:i,id:t}),"POST",{data:o})},tt=function(e,t){var n=r(e||[]),i=n[0],o=n[1];return{onSelectImages:function(n){var a=n.target.files;a&&(t&&e?t((e||i).concat(Array.from(a))):o((function(n){var i=e||n;return t&&t(i.concat(Array.from(a))),i.concat(Array.from(a))})))},onRemoveImage:function(n){if(t&&e){var i=e;i.splice(n,1),t(i.slice())}else o((function(i){var o=e||i;return o.splice(n,1),t&&t(o.slice()),o.slice()}))},onRemoveAllImages:function(){t?t([]):o([])},imageSrcs:c((function(){return(e||i).map((function(e){return"string"==typeof e?e:URL.createObjectURL(e)}))}),[e,i]),imageFiles:e||i}},nt="data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 22.9844C17.5228 22.9844 22 18.5072 22 12.9844C22 7.46153 17.5228 2.98438 12 2.98438C6.47715 2.98438 2 7.46153 2 12.9844C2 18.5072 6.47715 22.9844 12 22.9844Z' fill='%23262626'/%3e%3cpath d='M14.8281 10.1562L9.17127 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.17188 10.1562L14.8287 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",it=function(e){var t=e.className,n=e.style,i=e.bannedWords,a=void 0===i?[]:i,c=e.value,u=e.onChange,d=e.onPreviewUrlChange,m=e.onInvalidUrlsChange,v=e.onImageFilesChange,g=e.imageFiles,h=e.isReplying,C=f().t,k=r(null),y=k[0],b=k[1],N=l(null),I=tt(g,v),T=I.onSelectImages,x=I.onRemoveImage,M=I.imageSrcs;return s((function(){d&&((null==y?void 0:y.url)?d({title:y.title||"",url:y.url||"",image:y.image||"",description:y.description||""}):d(null))}),[y]),o.createElement(R,{className:t,style:n},o.createElement(p,{size:"p4",className:"description-label"},C("createPost.popup.description")),o.createElement("div",{className:"textarea-control"},o.createElement("div",{className:"textarea-wrapper"},o.createElement(D,{html:c||"",onChange:u,bannedWords:a,onImagePickerClick:function(){var e;return null===(e=N.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:b,onInvalidUrlsChange:m,isReplying:h}))),o.createElement(p,{size:"p4",className:"count-string"},C("character"),": ",w(c||"").length),(!M||0===M.length)&&y&&o.createElement("div",{className:"link-preview-wrapper"},y.isFetching?o.createElement(O,null):o.createElement(o.Fragment,null,o.createElement(We,{title:y.title,url:y.url||"#",image:y.image,noRefetch:!0}),o.createElement("img",{src:nt,className:"icon-close",onClick:function(){return b(null)}}))),o.createElement("input",{ref:N,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:T}),M.length>_?o.createElement("div",{className:"input-notification"},o.createElement("img",{src:Qe}),o.createElement(p,{size:"p4",color:E.colors.alertWarning},C("createPost.popup.warningImage"))):null,M.length>0&&o.createElement("div",{className:"image-gallery"},M.map((function(e,t){return o.createElement("div",{key:t,className:"image-item"},o.createElement("img",{src:e}),o.createElement("img",{className:"close-btn",src:nt,onClick:function(){return x(t)}}))}))))},ot=function(e,t){if(!t)return e;var n=t.limit,i=t.bannedWords,o=void 0===i?[]:i,a="number"==typeof n&&n>=0?e.substring(0,n):e;return A(a,o)},at=function(e){var t,n=e.className,i=e.style,a=e.bannedWords,c=void 0===a?[]:a,d=e.value,m=e.onChange,v=f().t,g=r(""),h=g[0],C=g[1],w=l(null);s((function(){if(w.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=w.current;return t.addEventListener("paste",e),function(){return t.removeEventListener("paste",e)}}}),[w]);var E=(null==c?void 0:c.join(","))||"";s((function(){var e;if(E){var t=null===(e=w.current)||void 0===e?void 0:e.innerText;if(t){var n=A(t,c);n!==t&&(m&&m(n),C(n))}}}),[E]);var k=u(Ve((function(e){if(w.current){var t=ot(w.current.innerText,{limit:120,bannedWords:c});m&&m(t),C(t)}}),300),[]);return s((function(){setTimeout((function(){var e;null===(e=w.current)||void 0===e||e.focus()}),500)}),[]),o.createElement(z,{className:n,style:i},o.createElement(ze,{name:"title",value:d||h,size:"md",label:v("createPost.title"),CustomInput:o.createElement(Ue,{innerRef:w,html:d||h,onChange:function(e){if(w.current&&w.current.innerText!==(d||h)){var t=ot(w.current.innerText,{bannedWords:c});m&&m(t),C(t),k(w.current.innerText)}},className:"title-input"})}),o.createElement(p,{size:"p4",className:"count-string"},v("createPost.popup.wordCount",{count:(null===(t=w.current)||void 0===t?void 0:t.innerText.length)||0,max:120})))},rt=function(n){var u=n.className,d=n.style,m=n.topics,p=n.communityId,v=n.onChange,g=n.isLoading,f=n.disabled,h=n.forceTopics,C=n.selectedTopics,w=n.noFetch,E=a(y).data,k=E.locale,b=E.env.isMarryBaby,N=r(m?i([],m,!0):[]),M=N[0],L=N[1],P=r(C?i([],C,!0):[]),_=P[0],S=P[1],j=r(!1),B=j[0],F=j[1],R=l(m);R.current=m,s((function(){var n;!p||w||(null===(n=R.current)||void 0===n?void 0:n.length)||(L([]),F(!0),e(void 0,void 0,void 0,(function(){var e,n,i,o;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,I(T(x.TOPIC.LIST,{communityId:p,_locale:k}),"GET")];case 1:return e=t.sent(),n=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.topics,Array.isArray(n)&&L((function(){return(null==n?void 0:n.map(U).sort((function(e,t){return(e.order||0)-(t.order||0)})))||[]})),[3,3];case 2:return i=t.sent(),console.log(i),F(!1),[3,3];case 3:return F(!1),[2]}}))})))}),[p,w]);var D=null==m?void 0:m.map((function(e){return e.id})).join("-"),A=null==M?void 0:M.map((function(e){return e.id})).join("-"),z=null==h?void 0:h.map((function(e){return e.id})).join("-");s((function(){m&&void 0!==D&&D!==A&&L(m)}),[m,D,A]);var H=c((function(){return M.filter((function(e){return!(null==h?void 0:h.some((function(t){return t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId})))}))}),[A,z]);return o.createElement(V,{"data-is-marrybaby":b,className:u,style:d},h.map((function(e){return o.createElement(lt,{key:"".concat(e.id,"-").concat(e.mappedCategoryId),topic:e,disabled:!0,selected:!0})})),H.map((function(e){return o.createElement(lt,{key:"".concat(e.id,"-").concat(e.mappedCategoryId),topic:e,disabled:f,selected:(C||_).some((function(t){return t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId})),onClick:function(){var t=C||_,n=t.findIndex((function(t){return t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId}));-1!==n?t.splice(n,1):t.push(e),v&&C?v(t.slice()):(v&&v(t.slice()),S(t.slice()))}})})),(g||B)&&o.createElement(O,{className:"topic-spinner"}))},lt=function(e){var t=e.topic,n=e.disabled,i=e.selected,a=e.onClick;return o.createElement("div",{className:"tag-item"+(i?" --active":""),"data-disabled":n,onClick:n?void 0:a},t.name)},st=function(n){var l=n.className,c=n.style,u=n.onPostCreatedEdited,d=n.onClose,g=n.communities,h=void 0===g?[]:g,C=n.forceSelectCommunity,k=n.forceSelectTopics,b=n.articleId,N=n.optionalTopic,I=n.editPostData,T=n.defaultCommunity,x=n.defaultTopics,M=n.noFetchTopic,L=n.hideTopicList,P=!!(null==I?void 0:I.id),S=a(y),j=S.data,B=j.locale,F=j.env.isMarryBaby,R=S.action,D=R.pushNotifications,O=R.sanitizeFunction,A=f().t,z=r(!1),V=z[0],U=z[1],K=r(""),Q=K[0],X=K[1],J=r(""),Y=J[0],$=J[1],q=r(C?{label:C.name,value:"".concat(C.id||"","-").concat(C.mappedCategoryId||"")}:{label:A("community.choose"),value:""}),ee=q[0],te=q[1],ne=r(i([],k,!0)||[]),ie=ne[0],oe=ne[1],ae=r([]),re=ae[0],le=ae[1],se=r([]),ce=se[0],ue=se[1],de=C||h.find((function(e){return"".concat(e.id||"","-").concat(e.mappedCategoryId||"")===ee.value})),me=C?[C]:h.filter((function(e){return e.isActive})).sort((function(e,t){return e.name>t.name?1:e.name<t.name?-1:0})),pe=r(null),ve=pe[0],ge=pe[1],fe=r([]),he=fe[0],Ce=fe[1],we=Q&&w(Y)&&(N||!N&&ie.length>0)&&de&&(!re||re.length<=_)&&!(null==he?void 0:he.length)&&!V;s((function(){if(I){var e=I;X(e.title||""),$(H(W(e.description||"","edit"),e.mentions)),te({label:e.community.name,value:"".concat(e.community.id||"","-").concat(e.community.mappedCategoryId||"")}),oe(e.topics||[]),le(e.photos||[])}else T&&te({label:T.name,value:"".concat(T.id||"","-").concat(T.mappedCategoryId||"")}),x&&oe(x)}),[]);var Ee=function(){return e(void 0,void 0,void 0,(function(){var e,n,i,o,a,r,l,s,c,m,p,v;return t(this,(function(t){switch(t.label){case 0:return[4,Ye({title:Q,description:Y,communityId:String((null==de?void 0:de.id)||""),imageFiles:re,previewUrl:ve,topicIds:null==ie?void 0:ie.map((function(e){return String(e.id||"")})).filter(Boolean),locale:B,sanitizeFunction:O,categoryCommunityId:String((null==de?void 0:de.mappedCategoryId)||""),categoryTopicIds:null==ie?void 0:ie.map((function(e){return String(e.mappedCategoryId||"")})).filter(Boolean)})];case 1:return e=t.sent(),b&&e.append("article_id",b),P?(null==I?void 0:I.id)?[4,qe({id:I.id,formData:e,locale:B})]:[3,3]:[3,4];case 2:n=t.sent(),t.label=3;case 3:return[3,6];case 4:return[4,$e({formData:e,locale:B,isArticleComment:!(null==de?void 0:de.id)&&!!(null==de?void 0:de.mappedCategoryId)})];case 5:n=t.sent(),t.label=6;case 6:return(null==(i=null==n?void 0:n.data)?void 0:i.id)&&!(null===(a=null===(o=null==n?void 0:n.messages)||void 0===o?void 0:o.moderation)||void 0===a?void 0:a.type)?(D({message:A("createPost.popup.success"),type:"success"}),function(e){u&&u(G(e),P),d&&d()}(i)):"banned"===(null===(l=null===(r=null==n?void 0:n.messages)||void 0===r?void 0:r.moderation)||void 0===l?void 0:l.type)?(D({title:A("notification.post.blocked.title"),message:A("notification.post.blocked.message"),type:"danger"}),n.messages.moderation.words&&ue(n.messages.moderation.words)):"suspect"===(null===(c=null===(s=null==n?void 0:n.messages)||void 0===s?void 0:s.moderation)||void 0===c?void 0:c.type)?(D({title:A("notification.post.suspect.title"),message:A("notification.post.suspect.message"),type:"warning"}),d&&d()):(null===(p=null===(m=null==n?void 0:n.messages)||void 0===m?void 0:m.find)||void 0===p?void 0:p.call(m,(function(e){var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(D({message:A("notification.suspend.message"),type:"danger"}),d&&d()):D({message:(null===(v=null==n?void 0:n.messages)||void 0===v?void 0:v[0])||A("notification.failure"),type:"danger"}),[2]}}))}))};return o.createElement(Z,{className:l,style:c},o.createElement("div",{className:"input-group-container"},o.createElement(at,{className:"input-group",bannedWords:ce,value:Q,onChange:X}),o.createElement(it,{className:"input-group",bannedWords:ce,value:Y,onChange:$,onPreviewUrlChange:ge,onInvalidUrlsChange:Ce,onImageFilesChange:le,imageFiles:re}),o.createElement("div",{className:"input-group"},o.createElement(p,{size:"p4",className:"input-group-label"},A("admin.community")),o.createElement(v,{options:(null==me?void 0:me.map((function(e,t){return{label:e.name,value:"".concat(e.id||"","-").concat(e.mappedCategoryId||"")}})))||[],id:"community-picker",placeholder:A("community.choose"),value:ee,onChange:function(e){te({label:e.label,value:String(e.value)}),oe([])},disabled:!!C}),o.createElement(p,{size:"sm",className:"warning",color:E.colors.gray400},"* ",A("commentPopup.warning.newPost"))),!L&&o.createElement("div",{className:"input-group"},o.createElement(p,{size:"p4",className:"input-group-label"},A("tab.topic")),o.createElement("div",{className:"input-notification"},o.createElement("img",{src:de?"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%232D87F3'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e":Qe}),o.createElement(p,{size:"base",color:E.colors.gray500},A(de?"createPost.popup.primary":"createPost.popup.warning"))),de&&o.createElement(rt,{className:"tag-list",communityId:de.id,forceTopics:k,onChange:oe,selectedTopics:ie,noFetch:M}))),o.createElement(m,{theme:F?"marryBaby":"helloSites",className:"submit-btn",size:"lg",onClick:function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!we||V)return[3,5];U(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Ee()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),console.error(e),D(Ke(A)),[3,4];case 4:U(!1),t.label=5;case 5:return[2]}}))}))},isDisabled:!we,isLoading:V},A("createPost.popup.submit")))},ct=function(e){var t=e.className,n=e.isMarryBaby,i=e.style,l=e.title,c=e.description,u=e.acceptText,v=e.cancelText,g=e.onAccept,f=e.thumbnail,w=e.isThumbnailIcon,E=e.onClose,k=a(y).data.env.isMarryBaby,b="boolean"==typeof n?n:k,N=r(!1),I=N[0],T=N[1];return s((function(){return h(!0),setTimeout((function(){return T(!0)}),0),function(){return h(!1)}}),[]),Ae.createPortal(o.createElement(K,{"data-is-marrybaby":b,className:t,style:i,"data-open":I},o.createElement(Q,{className:"popup-frame",isOpen:I,onClose:E},o.createElement("div",{className:"confirm-dialog",onClick:function(e){return e.stopPropagation()}},o.createElement("div",{className:"confirm-content"},f&&o.createElement("div",{className:"thumbnail-container ".concat(w?"is-icon":"")},o.createElement("img",{className:"thumbnail",src:f})),o.createElement(d,{className:"title",tag:"h2"},l),o.createElement(p,{className:"desc",size:"lg"},c),o.createElement("div",{className:"btn-group"},o.createElement(m,{theme:b?"marryBaby":"helloSites",size:"md",color:"secondary",onClick:function(){null==g||g(),null==E||E()}},u),o.createElement(m,{theme:b?"marryBaby":"helloSites",size:"md",onClick:E},v)))),b&&f&&o.createElement("div",{className:"thumbnail-container is-mobile ".concat(w?"is-icon":"")},o.createElement("img",{className:"thumbnail",src:f})))),C())},ut=function(n){var i=n.postId,o=n.message,a=n.photos,r=n.link,l=n.locale,s=n.sanitizeFunction,c=n.replyingUserId,u=n.replyingUserName,d=n.replyingId;return e(void 0,void 0,void 0,(function(){var e,n,m;return t(this,(function(t){switch(t.label){case 0:return e=new FormData,n=B(o.replace(/(\&nbsp;)+/g," "),s),m=j(n),a&&a.length>0?[4,Promise.all(null==a?void 0:a.map((function(e){return F(e,l)})))]:[3,2];case 1:t.sent().filter(Boolean).slice(0,_).forEach((function(t){e.append("images[]",t)})),t.label=2;case 2:return r&&e.append("link",r),null==m||m.forEach((function(t){e.append("mention_ids[]",t)})),e.append("post_id",i),d&&e.append("parent_id",d),c&&(m.unshift(c),n='[mention+id="'.concat(c,'"+name="').concat((u||"").replace('"',"'"),'"]').concat(n),e.append("parent_user_id",String(c))),e.append("content",n),e.append("content",n),[2,e]}}))}))},dt=function(n,i){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,P(T(x.COMMENT.CREATE,{_locale:i}),"POST",{data:n,headers:{"Content-Type":"multipart/form-data"}})]}))}))},mt=function(n,i){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,P(T(x.COMMENT.REPLY,{_locale:i}),"POST",{data:n,headers:{"Content-Type":"multipart/form-data"}})]}))}))},pt=function(n){var i=n.commentId,o=n.setLike,a=void 0!==o&&o,r=n.locale;return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,P(T(a?x.COMMENT.LIKE:x.COMMENT.UNLIKE,{_locale:r,id:i}),"GET")]}))}))},vt=function(e){var t=e.id,n=e.locale;return P(T(x.COMMENT.DELETE,{_locale:n,id:t}),"DELETE")},gt=function(i){var c=i.isReply,u=i.className,d=i.onClose,v=i.replyToName,g=i.style,h=i.replyingId,C=i.replyingUser,w=i.onPostSuccess;i.isMainCmt;var E=i.post,k=i.isMarryBaby,b=a(y),N=b.action,I=N.pushNotifications,T=N.sanitizeFunction,x=b.data,M=x.userInfo,L=x.locale,P=x.env.isMarryBaby,_="boolean"==typeof k?k:P,S=f().t,j=tt(),B=j.onSelectImages,F=j.onRemoveImage,R=j.imageSrcs,A=j.onRemoveAllImages,z=j.imageFiles,V=r(""),U=V[0],H=V[1],W=a(X).trigger,Z=r(!1),G=Z[0],K=Z[1],Q=l(null),ee=l(null),te=l(null),ne=r([]),ie=ne[0],oe=ne[1],ae=r([]),re=ae[0],le=ae[1],se=r(null),ce=se[0],ue=se[1];return s((function(){var e;null===(e=te.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout((function(){var e;null===(e=ee.current)||void 0===e||e.focus()}),400)}),[W]),o.createElement(J,{"data-is-reply":c,className:u,style:g},c&&o.createElement("div",{className:"reply-to-container"},o.createElement(p,{size:"p4"},o.createElement("span",{dangerouslySetInnerHTML:{__html:S("inputComment.replyTo",{name:'<span style="color: #2D87F3; cursor: pointer">@'.concat(v||"","</span>")})}})),o.createElement("img",{src:"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8.00016' cy='8.50004' r='6.66667' fill='white' stroke='%23404040'/%3e%3cpath d='M10 6.5L6 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6 6.5L10 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-close-comment",onClick:function(){return d&&d()}})),o.createElement("div",{className:"input-container",ref:te},o.createElement(Y,{className:"avatar-wrapper ".concat(c?"avatar-wrapper-reply":""),avatar:(null==M?void 0:M.id)?M.avatar:$,username:(null==M?void 0:M.name)||(null==M?void 0:M.username)}),o.createElement("input",{ref:Q,onChange:B,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),o.createElement(ze,{value:U,name:"input",size:"md",className:"input-wrapper",displayIcon:o.createElement("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.7543 4.85352H4.49227C4.01776 4.85352 3.56268 5.04201 3.22715 5.37754C2.89162 5.71307 2.70313 6.16815 2.70312 6.64266V19.1667C2.70313 19.6412 2.89162 20.0963 3.22715 20.4318C3.56268 20.7673 4.01776 20.9558 4.49227 20.9558H17.0163C17.4908 20.9558 17.9459 20.7673 18.2814 20.4318C18.6169 20.0963 18.8054 19.6412 18.8054 19.1667V12.9047' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M17.4633 3.51187C17.8192 3.15599 18.3019 2.95605 18.8052 2.95605C19.3085 2.95605 19.7912 3.15599 20.147 3.51187C20.5029 3.86775 20.7029 4.35044 20.7029 4.85373C20.7029 5.35702 20.5029 5.83971 20.147 6.19559L11.6486 14.694L8.07031 15.5886L8.96489 12.0103L17.4633 3.51187Z' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e"}),CustomInput:o.createElement("div",{className:"as-input"},o.createElement(D,{className:"textarea",html:U,onChange:H,onImagePickerClick:function(){var e;return null===(e=Q.current)||void 0===e?void 0:e.click()},bannedWords:re,onPreviewUrlChange:ue,onInvalidUrlsChange:oe,setEditorRef:function(e){return ee.current=e},isReplying:c}))}),o.createElement(m,{theme:_?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:function(){return e(void 0,void 0,void 0,(function(){var e,i,o,a,r,l,s,u,m,p,v,g,f;return t(this,(function(t){switch(t.label){case 0:if(!(null==E?void 0:E.id)||G)return[2];K(!0),t.label=1;case 1:return t.trys.push([1,4,,5]),e=function(e){H(""),A(),d&&d();var t=q(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),w&&w(t)},[4,ut(n({message:U,photos:z,postId:String(E.id),link:null==ce?void 0:ce.url,sanitizeFunction:T,locale:L},c&&h?{replyingUserId:String((null==C?void 0:C.id)||(null===(r=null==E?void 0:E.author)||void 0===r?void 0:r.id)||""),replyingId:h,replyingUserName:(null==C?void 0:C.name)||(null==C?void 0:C.username)||""}:{}))];case 2:return i=t.sent(),[4,c&&h?mt(i,L):dt(i,L)];case 3:return o=t.sent(),(null==(a=null==o?void 0:o.data)?void 0:a.id)&&!(null===(s=null===(l=null==o?void 0:o.messages)||void 0===l?void 0:l.moderation)||void 0===s?void 0:s.type)?e(o):"banned"===(null===(m=null===(u=null==o?void 0:o.messages)||void 0===u?void 0:u.moderation)||void 0===m?void 0:m.type)?(I({title:S("notification.comment.blocked.title"),message:S("notification.comment.blocked.message"),type:"danger"}),o.messages.moderation.words&&le(o.messages.moderation.words)):"suspect"===(null===(v=null===(p=null==o?void 0:o.messages)||void 0===p?void 0:p.moderation)||void 0===v?void 0:v.type)?(I({title:S("notification.comment.suspect.title"),message:S("notification.comment.suspect.message"),type:"warning"}),H(""),A(),d&&d()):(null===(g=null==o?void 0:o.messages)||void 0===g?void 0:g.find((function(e){var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(I({message:S("notification.suspend.message"),type:"warning"}),H(""),A(),d&&d()):I({title:"",message:(null===(f=null==o?void 0:o.messages)||void 0===f?void 0:f[0])||S("notification.comment.somethingWrong"),type:"danger"}),[3,5];case 4:return t.sent(),I({title:"",message:S("notification.comment.somethingWrong"),type:"danger"}),[3,5];case 5:return K(!1),[2]}}))}))},isLoading:G,isDisabled:!!(null==ie?void 0:ie.length)||G||!U||(null==U?void 0:U.length)<2||!U.trim()},o.createElement("img",{src:"data:image/svg+xml,%3csvg width='20' height='21' viewBox='0 0 20 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.5 9.73438L3.75 13.4844L7.5 17.2344' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M16.25 4.73438L16.25 10.3026C16.25 11.1464 15.9208 11.9557 15.3347 12.5524C14.7487 13.1491 13.9538 13.4844 13.125 13.4844L3.75 13.4844' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-enter"}))),(null==ie?void 0:ie.length)?o.createElement("div",{className:"error-text"},S("notification.limitUrlDomain")):null,(!R||0===R.length)&&ce&&o.createElement("div",{className:"link-preview-wrapper"},ce.isFetching?o.createElement(O,null):o.createElement(o.Fragment,null,o.createElement(We,{title:ce.title,url:ce.url||"#",image:ce.image,noRefetch:!0}),o.createElement("img",{src:nt,className:"icon-close",onClick:function(){return ue(null)}}))),R&&R.length>0&&o.createElement("div",{className:"preview-images-container"},R.map((function(e,t){return o.createElement("div",{key:t,className:"image-src-wrapper"},o.createElement("img",{className:"preview-image",src:e}),o.createElement("img",{src:nt,className:"icon-close-circle",onClick:function(){return F(t)}}))}))))},ft="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 5V8' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11H8.00708' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",ht=function(n){var i=n.className,l=n.style,s=n.reason,c=n.reasonText,u=n.onClose,d=n.postId,v=a(y),g=v.data,h=g.locale,C=g.env.isMarryBaby,w=v.action.pushNotifications,k=f().t,b=r(!1),N=b[0],I=b[1];return o.createElement(ee,{"data-is-marrybaby":C,className:i,style:l},o.createElement("ul",{className:"report-list"},o.createElement("li",{className:"report-item"},o.createElement("img",{src:ft}),o.createElement(p,{className:"__label",color:E.colors.gray800,size:"p4"},c))),o.createElement(m,{theme:C?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:N,onClick:function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!d||N)return[2];I(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,et({id:d,reason:s,locale:h})];case 2:return 1===(null==(e=t.sent())?void 0:e.status)&&(w({message:"Post reported",type:"success"}),u&&u()),[3,4];case 3:return t.sent(),[3,4];case 4:return I(!1),[2]}}))}))}},k("submit")))},Ct=function(e){var t=e.className,n=e.style,i=e.replyingTo,l=e.mentionedUser,s=e.description,u=e.disableShortenContent,d=e.mentions,m=void 0===d?[]:d,p=r(!1),v=p[0],g=p[1],h=f().t,C=te().authActionWrapper,w=r(!1),E=w[0],k=w[1],b=H(W(s||"","display"),m),N=a(y).action.sanitizeFunction,I=c((function(){var e=N(b||"");if(u||v)return{showContent:e,hasSeeMore:!1};var t=e.slice(0,1e3),n=1e3-27*((t.match(/<\/div>/g)||[]).length-1),i=(t||"").slice(0,n<40?40:n),o=N(i.replace(/(<|<\/)( +|[a-zA-Z]*)$/gi,"")),a=o.length<e.length-10;return{showContent:a?o:e,hasSeeMore:a}}),[u,v,b]),T=(null==l?void 0:l.name)||i,x="expert"===(null==l?void 0:l.role)&&!!(null==l?void 0:l.partnerId);return o.createElement(o.Fragment,null,x&&o.createElement(ne,{isOpen:E,onClose:function(){return k(!1)},expertId:String(null==l?void 0:l.partnerId)}),o.createElement(ie,{className:"".concat(t," no-replace-click"),style:n},T&&o.createElement("span",{onClick:function(){return x&&k(!0)},className:"post-content-replying"},"@",T),(null==s?void 0:s.startsWith("[mention+id="))&&o.createElement("span",{className:"post-content-replying tag-only"},"@"),o.createElement("span",{dangerouslySetInnerHTML:{__html:I.showContent},className:"post-content ".concat(I.hasSeeMore?"has-see-more":"")}),I.hasSeeMore&&!v&&o.createElement("span",null,"... ",o.createElement("span",{onClick:function(e){e.preventDefault(),e.stopPropagation(),C((function(){return g(!0)}))},className:"see-more-text"},h("post.seeMore")))))},wt=function(e){var t=e.className,n=e.style,i=e.authorName,a=e.images,l=e.onClose,c=e.onOpenSingleView,u=f().t,d=r(!1),m=d[0],v=d[1];return s((function(){setTimeout((function(){v(!0)}),0)}),[]),Ae.createPortal(o.createElement(oe,{className:t,style:n,"data-open":m},o.createElement("div",{className:"top-bar"},o.createElement("img",{className:"icon-arrow-left",src:"data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.0508 18.0607L4.00078 12.0367L10.0508 6.01172' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4.00195 12.0352L19.002 12.0352' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",onClick:l,alt:"go back"}),o.createElement(p,{size:"p2",type:"bold",style:{textAlign:"center"}},u("previewPhotos.title",{name:i}))),o.createElement("div",{className:"container"},a.map((function(e,t){return o.createElement("img",{className:"img-preview",key:t,src:e,onClick:function(){return null==c?void 0:c(t)},alt:"post img"})})))),C())},Et="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12.8125L10 8.8125L6 4.8125' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",kt=function(e){var t=e.initialViewIndex,n=e.images,i=e.onClose,a=r(t),l=a[0],c=a[1],u=r(!1),d=u[0],m=u[1];s((function(){setTimeout((function(){m(!0)}),0)}),[]);var p=null==n?void 0:n[l],v=0===l,g=!(null==n?void 0:n.length)||l===(null==n?void 0:n.length)-1;return Ae.createPortal(o.createElement(ae,{"data-open":d&&!!p},o.createElement(re,null,o.createElement("img",{src:le,className:"icon-close",onClick:i,alt:"close"})),p&&l>=0&&o.createElement(o.Fragment,null,o.createElement(se,null,o.createElement("img",{className:"img-preview",src:p,alt:"post img open"}),o.createElement(ce,{"data-disabled":v,onClick:function(){return!v&&c(l-1)}},o.createElement(ue,null,o.createElement("img",{src:Et,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":v}))),o.createElement(ce,{"data-right":!0,"data-disabled":g,onClick:function(){return!g&&c(l+1)}},o.createElement(ue,null,o.createElement("img",{src:Et,alt:"right arrow","data-disabled":g})))))),C())},yt=function(e){var t=e.image,n=e.isShortcut,i=r(!0),a=i[0],l=i[1],c=f().t;return s((function(){setTimeout((function(){return null==He?void 0:He.update()}),100)}),[t]),o.createElement(de,{"data-is-blurred":a,onClick:function(e){return a&&e.stopPropagation()}},o.createElement("img",{className:"lazy img-preview","data-src":t}),o.createElement(me,null,o.createElement(pe,null,o.createElement(ve,{"data-is-shortcut":n,onClick:function(){return l(!a)}},o.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.71 4.54039C2.32 4.15039 2.32 3.52039 2.71 3.13039C3.1 2.74039 3.74 2.74039 4.13 3.13039L20.44 19.4604C20.83 19.8504 20.83 20.4804 20.44 20.8704C20.05 21.2604 19.42 21.2604 19.03 20.8704L16.31 18.1504C14.97 18.6704 13.52 18.9704 12 18.9704C7 18.9704 2.73 15.8604 1 11.4704C1.77 9.50039 3.06 7.80039 4.68 6.51039L2.71 4.54039ZM17 11.4704C17 8.71039 14.76 6.47039 12 6.47039C11.49 6.47039 11 6.57039 10.53 6.71039L8.36 4.54039C9.51 4.17039 10.73 3.97039 12 3.97039C17 3.97039 21.27 7.08039 23 11.4604C22.31 13.2204 21.21 14.7604 19.82 15.9904L16.76 12.9304C16.9 12.4704 17 11.9804 17 11.4704ZM12 16.4704C9.24 16.4704 7 14.2304 7 11.4704C7 10.7004 7.18 9.97039 7.49 9.33039L9.06 10.9004C9.03 11.0804 9 11.2704 9 11.4704C9 13.1304 10.34 14.4704 12 14.4704C12.2 14.4704 12.38 14.4404 12.57 14.4004L14.14 15.9704C13.49 16.2904 12.77 16.4704 12 16.4704ZM14.97 11.1404C14.82 9.74039 13.72 8.65039 12.33 8.50039L14.97 11.1404Z",fill:"#ffffff"}))),o.createElement(ge,null,!n&&o.createElement(fe,null,o.createElement(he,null,c("sensitiveMask.contentWarningMessage")),o.createElement(Ce,null,c("sensitiveMask.contentWarningDescription"))),(n&&!a||!n)&&o.createElement(we,null,o.createElement(Ee,{size:"sm",onClick:function(e){!a&&e.stopPropagation(),l(!a)}},c(a?"sensitiveMask.unblur":"sensitiveMask.blur")))))))},bt=function(e){var t=e.className,n=e.images,i=void 0===n?[]:n,c=e.style,u=e.authorName,m=e.isSensitive,p=void 0!==m&&m,v=a(y).data.env.isMarryBaby,g="+ ".concat((i.length||0)-4),f=r(!1),C=f[0],w=f[1],E=r(-1),k=E[0],b=E[1];s((function(){setTimeout((function(){return null==He?void 0:He.update()}),100)}),[null==i?void 0:i.slice(0,5).join("|")]);var N=i.length>5,I=l(!1);return s((function(){return function(){I.current&&h(!1)}}),[]),s((function(){C||k>=0?(h(!0),I.current=!0):(h(!1),I.current=!1)}),[C,k]),o.createElement(o.Fragment,null,o.createElement(ke,{className:t,style:c,"data-image-count":N?5:i.length||0,"data-is-marrybaby":v},null==i?void 0:i.slice(0,5).map((function(e,t){return o.createElement("div",{className:"img-wrapper",key:t,onClick:function(){t>=4&&N?w(!0):b(t)}},p&&o.createElement(yt,{image:e,isShortcut:0!==t}),!v&&o.createElement("img",{className:"lazy img-preview-blur","data-src":e}),o.createElement("img",{className:"lazy img-preview","data-src":e}),4===t&&N&&o.createElement("div",{className:"img-more-overlay"},o.createElement(d,{tag:"h1",color:"white"},g)))}))),C&&o.createElement(wt,{authorName:u||"",images:i,onClose:function(){return w(!1)},onOpenSingleView:b}),k>=0&&o.createElement(kt,{images:i,initialViewIndex:k,onClose:function(){return b(-1)}}))},Nt=function(i){var u=i.url,d=i.image,m=i.className,p=i.style,v=a(y).data.locale,g=r(null),f=g[0],h=g[1];s((function(){e(void 0,void 0,void 0,(function(){return t(this,(function(e){return d?[2]:u?(h((function(e){return n(n({},e),{isFetching:!0})})),I(T(x.FETCH_PREVIEW,{_locale:v}),"POST",{data:{link:u}}).then((function(e){var t,n;h({url:u,image:(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.image)||(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.logo)})})).catch((function(){h(null)})),[2]):[2,h(null)]}))}))}),[u,d]);var C=(null==f?void 0:f.image)||d,w=(null==f?void 0:f.url)||u,E=c((function(){return ye(w)}),[w]),k=c((function(){return be(w)}),[w]),b=l(0),M=l(0),L=r(!1),P=L[0],_=L[1];s((function(){var e=function(){var e,t=null===(e=S.current)||void 0===e?void 0:e.getBoundingClientRect(),n=!1;t&&(!b.current||Math.abs((b.current-t.width)/(null==t?void 0:t.width))>.2)&&(b.current=Math.floor(t.width),n=!0),t&&(!M.current||Math.abs((M.current-t.height)/(null==t?void 0:t.height))>.2)&&(M.current=Math.floor(t.height),n=!0),n&&_((function(e){return!e}))};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var S=l(null),j=l(!1);return o.createElement(Ne,{className:"".concat(m," no-replace-click"),style:p,ref:S},d||!E&&!k?o.createElement("a",{href:w,target:"_blank",rel:"noreferrer"},o.createElement("div",{className:"link-image-wrapper ".concat((null==f?void 0:f.isFetching)?"fetching":"")},(null==f?void 0:f.isFetching)?o.createElement(O,{className:"loading-spinner"}):o.createElement("img",{className:"link-image",src:C||N,onError:function(e){j.current||(j.current=!0,e.currentTarget.src=N)}}))):o.createElement("div",{className:"link-image-wrapper"},E?o.createElement("iframe",{width:"100%",height:"100%",src:"https://www.youtube.com/embed/".concat(E,"?&autoplay=1&mute=1"),frameBorder:"0",allowFullScreen:!0,style:{position:"absolute",top:0,left:0,border:"none",overflow:"hidden"}}):k?o.createElement("iframe",{key:String(P),src:"https://www.facebook.com/plugins/video.php?href=".concat(encodeURIComponent(w),"&autoplay=1&show_text=false&t=0&width=").concat(b.current,"&height=").concat(M.current),style:{position:"absolute",top:"50%",left:"50%",border:"none",overflow:"hidden",height:M.current,width:b.current,transform:"translate(-50%, -50%)"},scrolling:"no",frameBorder:"0",allowFullScreen:!0,allow:"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"}):null))},It="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10Z' fill='%233E3F58'/%3e %3cpath d='M19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10Z' fill='%233E3F58'/%3e %3cpath d='M12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z' fill='%233E3F58'/%3e %3c/svg%3e",Tt="data:image/svg+xml,%3csvg width='3' height='13' viewBox='0 0 3 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='1.58326' cy='6.41663' r='1.25' transform='rotate(89.9997 1.58326 6.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='1.41663' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 1.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='11.4166' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 11.4166)' fill='%23595959'/%3e%3c/svg%3e",xt="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2 4H3.33333H14' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.33334 3.99992V2.66659C5.33334 2.31296 5.47382 1.97382 5.72387 1.72378C5.97392 1.47373 6.31305 1.33325 6.66668 1.33325H9.33334C9.68697 1.33325 10.0261 1.47373 10.2762 1.72378C10.5262 1.97382 10.6667 2.31296 10.6667 2.66659V3.99992M12.6667 3.99992V13.3333C12.6667 13.6869 12.5262 14.026 12.2762 14.2761C12.0261 14.5261 11.687 14.6666 11.3333 14.6666H4.66668C4.31305 14.6666 3.97392 14.5261 3.72387 14.2761C3.47382 14.026 3.33334 13.6869 3.33334 13.3333V3.99992H12.6667Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6.66666 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.33334 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",Mt=function(n){var i=n.onDeleteComment,l=n.commentId,s=n.className,c=void 0===s?"":s,u=n.popoverClassName,d=void 0===u?"":u,m=a(y),p=m.data,v=p.env.isMarryBaby,g=p.locale,h=m.action.pushNotifications,C=f().t,w=r(!1),E=w[0],k=w[1],b=te().authActionWrapper;return o.createElement("div",{className:c,onClick:function(e){e.preventDefault(),e.stopPropagation()}},E&&o.createElement(ct,{thumbnail:"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0)'%3e%3cpath d='M2 4.00781H3.33333H14' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.33337 4.00846V2.67513C5.33337 2.32151 5.47385 1.98237 5.7239 1.73232C5.97395 1.48227 6.31309 1.3418 6.66671 1.3418H9.33337C9.687 1.3418 10.0261 1.48227 10.2762 1.73232C10.5262 1.98237 10.6667 2.32151 10.6667 2.67513V4.00846M12.6667 4.00846V13.3418C12.6667 13.6954 12.5262 14.0346 12.2762 14.2846C12.0261 14.5347 11.687 14.6751 11.3334 14.6751H4.66671C4.31309 14.6751 3.97395 14.5347 3.7239 14.2846C3.47385 14.0346 3.33337 13.6954 3.33337 13.3418V4.00846H12.6667Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6.66663 7.3418V11.3418' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.33337 7.3418V11.3418' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0'%3e%3crect width='16' height='16' fill='white' transform='translate(0 0.0078125)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:C("popup.deleteComment.title"),description:C("popup.deleteComment.description"),acceptText:C("popup.deletePost.accept"),cancelText:C("popup.deletePost.cancel"),onAccept:function(){return e(void 0,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return l?[4,vt({id:l,locale:g})]:[2];case 1:return 1===(null==(e=t.sent())?void 0:e.status)?(i&&i(),h({title:"",message:C("notification.success"),type:"success"})):h({title:"",message:(null===(n=null==e?void 0:e.messages)||void 0===n?void 0:n[0])||C("notification.failure"),type:"danger"}),[2]}}))}))},onClose:function(){return k(!1)}}),o.createElement(Ie,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:xt,label:C("actionPopover.delete"),onClick:function(){b((function(){k(!0)}))}}]},className:d,toggleButtonContent:o.createElement("img",{src:v?It:Tt}),buttonProps:{}}))},Lt=function(i){var l,u,d,p,v,h=i.className,C=i.style,w=i.comment,E=i.type,b=void 0===E?"comment":E,N=i.level,T=void 0===N?0:N,x=i.replyingId,M=i.onPostCommentSuccess,L=i.post,P=i.onDeleteComment,_=i.refetchComment,S=i.hasQuickBookingEnable,j=i.handleMakeAppointment,B=a(y).data,F=B.locale,R=B.userInfo,D=B.env.isMarryBaby,O=f().t,A=r(w||null),z=A[0],V=A[1],U=z.id;z.countReplies;var H=z.countLikes,W=z.content,Z=z.createdAt,G=z.replies,K=void 0===G?[]:G,Q=z.images,X=void 0===Q?[]:Q,J=z.author,Y=z.liked,$=z.link,q=z.mentionedUser,ee=z.mentions,ne=function(e){try{var t=e.match(/\[@([^\]]+)\]/),n=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:n}}catch(e){}return{text:""}}(W),ie=ne.text,oe=ne.replyingTo,ae=te({_joinCommunityIds:[null===(l=null==L?void 0:L.community)||void 0===l?void 0:l.id],_joinTopicIds:null===(u=null==L?void 0:L.topics)||void 0===u?void 0:u.map((function(e){return e.id}))}).authActionWrapper,re=r(4),le=re[0],se=re[1],ce=!!(null==R?void 0:R.id)&&(null==K?void 0:K.some((function(e){return e.author.id===R.id}))),ue=function(e){V((function(t){if(!t.replies.find((function(t){return t.id===e.id}))){t.replies.unshift(e);var i=n(n({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return _&&_(i),i}return t}))},de=r(!1),me=de[0],pe=de[1],ve=c((function(){return"comment"===b&&K&&0!=K.length?K.sort((function(e,t){var n=new Date(e.createdAt).getTime(),i=new Date(t.createdAt).getTime();return n>i?-1:n<i?1:0})):K}),[b,K]),ge=(null==K?void 0:K.length)||0,fe=String(null==J?void 0:J.email)&&(null==R?void 0:R.email)&&String(null==J?void 0:J.email)===String(null==R?void 0:R.email),he=(null==J?void 0:J.name)||(null==J?void 0:J.username)||"",Ce=null==J?void 0:J.avatar,we=(null==J?void 0:J.username)||(null==J?void 0:J.name)||"",Ee=r(null),ke=Ee[0],ye=Ee[1],be=r(null),Ne=be[0],Ie=be[1];s((function(){if(null==J?void 0:J.hospitalId){n=J.hospitalId,e(void 0,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return[4,I(_e(Se.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:k[F]}),"get")];case 1:return e=t.sent(),(null===(i=null==e?void 0:e._data)||void 0===i?void 0:i.branch)&&ye(null==e?void 0:e._data.branch),[2]}}))}))}var n,i;if(null==J?void 0:J.doctorId){i=J.doctorId,e(void 0,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return[4,I(_e(Se.GET_DOCTOR_INFO,{doctorId:i,website_url:k[F]}),"get")];case 1:return e=t.sent(),(null===(n=null==e?void 0:e._data)||void 0===n?void 0:n.doctor)&&Ie(null==e?void 0:e._data.doctor),[2]}}))}))}}),[J.hospitalId,J.doctorId]);var je=(null==Ne?void 0:Ne.valid_outpatient)||(null==Ne?void 0:Ne.valid_telemedicine),Be=((null==ke?void 0:ke.total_available_service)||(null==ke?void 0:ke.total_available_doctor))>0,Fe=S&&(je||Be);return o.createElement(Te,{defaultParams:{_joinCommunityIds:[null===(d=null==L?void 0:L.community)||void 0===d?void 0:d.id],_joinTopicIds:null===(p=null==L?void 0:L.topics)||void 0===p?void 0:p.map((function(e){return e.id}))}},o.createElement(xe,{className:h,style:C,"data-is-reply":!!T,"data-is-marrybaby":D,"data-has-booking":Fe},"reply"===b&&o.createElement(g,{className:"top-divider",type:"solid"}),o.createElement(Me,{avatar:Ce,name:he,username:we,email:null==J?void 0:J.email,time:Z,className:"post-author ".concat(fe?"with-popover":""),type:b,userId:null==J?void 0:J.id,role:null==J?void 0:J.role,expertId:null==J?void 0:J.partnerId,title:null==J?void 0:J.title,doctorId:null==J?void 0:J.doctorId,hospitalId:null==J?void 0:J.hospitalId,hasQuickBooking:Fe,handleMakeAppointment:j}),o.createElement(Ct,{className:"post-content-wrapper",replyingTo:oe,mentionedUser:q,description:ie,mentions:ee}),o.createElement("span",null),o.createElement("span",null),X&&X.length>0?o.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},o.createElement(bt,{images:X,authorName:null==J?void 0:J.username})):null,X&&0!==X.length||!$?null:o.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},o.createElement(We,{url:$})),"most-engaging"!==b?o.createElement(o.Fragment,null,o.createElement(Le,{type:Pe.reply,loveCount:H,replyCount:ge,className:"post-reaction",liked:Y,isReplied:ce,hideCommentIcon:"reply"===b,onCommentClick:function(){return ae((function(){return pe((function(e){return!e}))}))},onCommentCountClick:function(){return ae((function(){pe(!0)}))},onLikeClick:function(){return ae((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return U?[4,pt({commentId:U,setLike:!Y,locale:F})]:[3,2];case 1:1===e.sent().status&&V((function(e){return n(n({},e),{liked:!Y,countLikes:e.countLikes+(Y?-1:1)})})),e.label=2;case 2:return[2]}}))}))}))}}),me&&o.createElement(gt,{replyingId:x||z.id,replyToName:J.name||J.username||"",isReply:!0,onClose:function(){return pe(!1)},onPostSuccess:function(e){"reply"===b?M&&M(e):ue(e)},post:L,replyingUser:J}),"comment"===b&&K&&K.length>0?o.createElement("div",{className:"comment-reply-wrapper"},null===(v=null==ve?void 0:ve.slice(0,le))||void 0===v?void 0:v.map((function(e){return o.createElement(Lt,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:T+1,replyingId:U,onPostCommentSuccess:ue,post:L,onDeleteComment:function(){V((function(t){return n(n({},t),{replies:t.replies.filter((function(t){return t.id!==e.id})),countReplies:t.countReplies-1})}))},handleMakeAppointment:j,hasQuickBookingEnable:S})})),ge>le&&o.createElement(o.Fragment,null,o.createElement(g,{className:"top-divider",type:"solid"}),o.createElement(m,{className:"more-cmt",size:"lg",color:"ghost",onClick:function(){return se((function(e){return e+4}))}},O("comment.seeMoreReplies",{count:ge-le}),o.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12L10 8L6 4' stroke='%232D87F3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e"})))):null):null,fe&&o.createElement(Mt,{onDeleteComment:P,className:"popover",commentId:z.id})))},Pt="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='%23595959' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",_t="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",St="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 5.33337C13.1046 5.33337 14 4.43794 14 3.33337C14 2.2288 13.1046 1.33337 12 1.33337C10.8954 1.33337 10 2.2288 10 3.33337C10 4.43794 10.8954 5.33337 12 5.33337Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M12 14.6666C13.1046 14.6666 14 13.7712 14 12.6666C14 11.5621 13.1046 10.6666 12 10.6666C10.8954 10.6666 10 11.5621 10 12.6666C10 13.7712 10.8954 14.6666 12 14.6666Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.72668 9.00665L10.28 11.66' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M10.2734 4.33997L5.72668 6.9933' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",jt=function(n){var i=n.authorEmail,l=n.onDeletePost,s=n.shareUrl,c=n.post,u=n.className,d=void 0===u?"":u,m=n.popoverClassName,p=void 0===m?"":m,v=n.onBookmark,g=n.onRemoveBookmark,h=n.onEditPost,C=a(y),w=C.data,E=w.locale,k=w.userInfo,b=w.togetherUserId,N=w.env.isMarryBaby,I=C.action.pushNotifications,M=f().t,L=r(!1),_=L[0],S=L[1],j=r(!1),B=j[0],F=j[1],R=r(!1),D=R[0],O=R[1],A=te().authActionWrapper,z=i&&(null==k?void 0:k.email)&&i===String(null==k?void 0:k.email);return o.createElement("div",{className:d,onClick:function(e){e.preventDefault(),e.stopPropagation()}},D&&o.createElement(je,{url:s,text:null==c?void 0:c.title,onClose:function(){return O(!1)}}),B&&o.createElement(ct,{thumbnail:"./svg/delete.svg",isThumbnailIcon:!0,title:M("popup.deletePost.title"),description:M("popup.deletePost.description"),acceptText:M("popup.deletePost.accept"),cancelText:M("popup.deletePost.cancel"),onAccept:function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!(null==c?void 0:c.id)||_)return[2];S(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Je({id:c.id,locale:E})];case 2:return 1===(null==(e=t.sent())?void 0:e.status)&&(null==l||l()),[3,4];case 3:return t.sent(),[3,4];case 4:return S(!1),[2]}}))}))},onClose:function(){return F(!1)}}),o.createElement(Ie,{className:p,toggleButtonContent:o.createElement("img",{src:N?It:Tt}),position:"bottom",align:"end",buttonProps:{isLoading:_},data:z?{isShowheader:!1,type:"list",list:[{icon:St,label:M("morePopover.share"),onClick:function(){return O(!0)}},{icon:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.16952 3.2356H2.99484C2.6785 3.2356 2.37512 3.36126 2.15143 3.58495C1.92774 3.80863 1.80208 4.11202 1.80208 4.42836V12.7777C1.80208 13.094 1.92774 13.3974 2.15143 13.6211C2.37512 13.8448 2.6785 13.9705 2.99484 13.9705H11.3442C11.6605 13.9705 11.9639 13.8448 12.1876 13.6211C12.4113 13.3974 12.537 13.094 12.537 12.7777V8.60303' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M11.6425 2.341C11.8798 2.10375 12.2016 1.97046 12.5371 1.97046C12.8726 1.97046 13.1944 2.10375 13.4317 2.341C13.6689 2.57826 13.8022 2.90005 13.8022 3.23558C13.8022 3.57111 13.6689 3.89289 13.4317 4.13015L7.76607 9.79578L5.38054 10.3922L5.97692 8.00663L11.6425 2.341Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",label:M("actionPopover.edit"),onClick:h},{icon:xt,label:M("actionPopover.delete"),onClick:function(){A((function(){return F(!0)}))}}]}:{isShowheader:!1,type:"list",list:[{icon:St,label:M("morePopover.share"),onClick:function(){return O(!0)}},{icon:(null==c?void 0:c.bookmarked)?Pt:_t,label:(null==c?void 0:c.bookmarked)?M("morePopover.unsavePost"):M("morePopover.savePost"),onClick:function(){A((function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return(null==k?void 0:k.id)&&(null==c?void 0:c.id)?(null==c?void 0:c.bookmarked)?[4,P(T(x.BOOKMARK.DELETE,{_locale:E}),"DELETE",{data:{post_id:String(c.id)}})]:[3,2]:[2];case 1:return 1===(null==(e=t.sent())?void 0:e.status)?(I({title:"",message:"Removed saved post",type:"success",displayIcon:_t}),g&&g()):I({title:"",message:"Remove failed",type:"danger",displayIcon:_t}),[3,4];case 2:return[4,P(T(x.BOOKMARK.CREATE,{_locale:E}),"POST",{data:{user_id:b||k.id,post_id:c.id}})];case 3:1===(null==(e=t.sent())?void 0:e.status)?(I({title:"",message:"Post saved",type:"success",displayIcon:Pt}),v&&v()):I({title:"",message:"Post saved failed",type:"danger",displayIcon:_t}),t.label=4;case 4:return[2]}}))}))}))}},{icon:ft,label:M("morePopover.report"),subTree:{title:M("morePopover.report.title"),description:M("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(Be).map((function(e){return{label:Be[e].label,reason:Be[e].reportReasonText,reasonValue:e}})).map((function(e){return{label:M(e.label),subTree:{title:M("morePopover.reportSubmit.title"),description:M("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:function(t){return o.createElement(ht,{reason:e.reasonValue,reasonText:M(e.reason),postId:null==c?void 0:c.id,onClose:function(){return t&&t(!1)}})}}}}))}}]}}))},Bt=function(n,i){return e(void 0,void 0,void 0,(function(){var e,o,a,r;return t(this,(function(t){switch(t.label){case 0:return[4,Oe(T(x.COMMENT.LIST,{postId:n,_locale:i,sort:"popularity",perPage:1,withoutReply:1}),"GET")];case 1:return e=t.sent(),[2,null===(r=null===(a=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.comments)||void 0===a?void 0:a.map(q))||void 0===r?void 0:r[0]]}}))}))},Ft=function(i){var l=i.className,c=i.style,u=i.hideViewMoreComment,p=i.showMostEngaging,v=i.onCommentClick,g=i.onCommentCountClick,h=i.onMostEngagingCommentClick,C=i.onPostCommentSuccess,E=i.disableCardLink,k=i.disableShortenContent,b=i.onDeletePost,T=i.onEditPost,x=i.post,M=i.mostEngagingComment,L=i.onDeleteComment,P=i.showInputComment,_=i.InlineCommentsComponent,S=i.hasQuickBookingEnable,j=i.handleMakeAppointment,B=r(x),F=B[0],R=B[1],D=r(!1),O=D[0],A=D[1],z=r(M),V=z[0],U=z[1],H=F.community,W=F.topics,Z=F.author,G=F.slug,K=F.isPin,Q=F.liked,X=F.scheduleDateTime,J=F.createdAt,Y=F.photos,$=F.mentions,q=F.title,ee=F.description,ne=F.previewUrl,ie=F.likesCount,oe=F.commentsCount,ae=F.id,re=F.commented,le=a(y),se=le.data,ce=se.locale,ue=se.env,de=ue.isMarryBaby,me=ue.togetherBasePath,pe=le.action.pushNotifications,ve=f().t,ge=r(P),fe=ge[0],he=ge[1],Ce="".concat(me,"/").concat((null==H?void 0:H.slug)||"_","/").concat(G||""),we="".concat(Fe(ce)).concat(Ce),Ee=te((null==H?void 0:H.slug)?{_joinCommunityIds:[H.id],_joinTopicIds:null==W?void 0:W.map((function(e){return e.id}))}:void 0).authActionWrapper,ke=r(!1),ye=ke[0],be=ke[1];s((function(){he(P)}),[P]);var Ne=(null==Z?void 0:Z.name)||(null==Z?void 0:Z.username)||"",Ie=(null==Z?void 0:Z.username)||(null==Z?void 0:Z.name)||"",xe=null==Z?void 0:Z.avatar,Be=r(null),Oe=Be[0],Ae=Be[1],ze=r(null),Ve=ze[0],Ue=ze[1];s((function(){if(null==Z?void 0:Z.hospitalId){n=Z.hospitalId,e(void 0,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return[4,I(_e(Se.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:De[ce]}),"get")];case 1:return e=t.sent(),(null===(i=null==e?void 0:e._data)||void 0===i?void 0:i.branch)&&Ae(null==e?void 0:e._data.branch),[2]}}))}))}var n,i;if(null==Z?void 0:Z.doctorId){i=Z.doctorId,e(void 0,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return[4,I(_e(Se.GET_DOCTOR_INFO,{doctorId:i,website_url:De[ce]}),"get")];case 1:return e=t.sent(),(null===(n=null==e?void 0:e._data)||void 0===n?void 0:n.doctor)&&Ue(null==e?void 0:e._data.doctor),[2]}}))}))}}),[Z.hospitalId,Z.doctorId]);var He=(null==Ve?void 0:Ve.valid_outpatient)||(null==Ve?void 0:Ve.valid_telemedicine),Qe=((null==Oe?void 0:Oe.total_available_service)||(null==Oe?void 0:Oe.total_available_doctor))>0,Je=S&&(He||Qe);s((function(){e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return ae&&oe&&p&&!(null==M?void 0:M.id)?[4,Bt(ae,ce)]:[3,2];case 1:e=t.sent(),U(e),t.label=2;case 2:return[2]}}))}))}),[ae,ce,oe,p,null==M?void 0:M.id]),s((function(){U(M)}),[null==M?void 0:M.id]);var Ye=function(i){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return oe>1&&(null==V?void 0:V.id)&&(null==V?void 0:V.id)===(null==i?void 0:i.id)?[4,Bt(ae,ce)]:[3,2];case 1:e=t.sent(),U(e),t.label=2;case 2:return R((function(e){return n(n({},e),{commentsCount:e.commentsCount-1})})),L&&L(i),[2]}}))}))};return o.createElement(Te,{defaultParams:(null==H?void 0:H.slug)?{_joinCommunityIds:[H.id],_joinTopicIds:null==W?void 0:W.map((function(e){return e.id}))}:void 0},O&&o.createElement(je,{url:we,avatar:N,text:q,onClose:function(){return A(!1)}}),o.createElement(Re,{className:l,style:c,"data-is-marrybaby":de},K?o.createElement(Ge,{className:"post-pin"}):null,o.createElement("div",{style:{position:"relative"}},o.createElement(Me,{avatar:xe,name:Ne,username:Ie,url:E?void 0:Ce,email:null==Z?void 0:Z.email,time:X||J,community:H,className:"post-author",role:null==Z?void 0:Z.role,userId:null==Z?void 0:Z.id,expertId:null==Z?void 0:Z.partnerId,doctorId:null==Z?void 0:Z.doctorId,hospitalId:null==Z?void 0:Z.hospitalId,title:null==Z?void 0:Z.title,hasQuickBooking:Je,handleMakeAppointment:j}),o.createElement(jt,{authorEmail:String(null==Z?void 0:Z.email),onDeletePost:b,shareUrl:we,post:F,className:"popover",onEditPost:T})),o.createElement("a",{href:E?void 0:Ce,className:"post-content-link-wrapper"},q&&o.createElement(d,{className:"post-content-title",as:"h1",tag:"h5",fontWeight:"bold"},w(q)),o.createElement(Ct,{className:"post-content-wrapper",description:ee,disableShortenContent:k,mentions:$})),o.createElement("span",null),o.createElement("span",null),o.createElement("div",{key:"tag-topic"},W&&W.length>0?o.createElement(Ze,{topics:W,className:"post-topics"}):null),o.createElement("div",{key:"social-preview"},(null==F?void 0:F.introUrl)?o.createElement("div",{className:"social-preview-wrapper ".concat((null==Y?void 0:Y.length)?"has-image":"")},o.createElement(Nt,{url:F.introUrl,image:F.bannerImage})):null),o.createElement("div",{key:"image-preview"},(null==Y?void 0:Y.length)?o.createElement("div",{className:"image-preview-wrapper"},o.createElement(bt,{images:Y,authorName:null==Z?void 0:Z.name})):null),o.createElement("div",{key:"link-preview"},(null==F?void 0:F.introUrl)||(null==Y?void 0:Y.length)||!(null==ne?void 0:ne.url)?null:o.createElement("div",{className:"link-preview-wrapper"},o.createElement(We,{title:ne.title,url:ne.url,image:ne.image}))),o.createElement(Le,{type:Pe.post,loveCount:ie,replyCount:oe,className:"post-reaction ".concat((null==Y?void 0:Y.length)||(null==ne?void 0:ne.url)?"hide-top-border":""),liked:ye?!Q:Q,isReplied:re,onCommentClick:function(){return Ee((function(){v?v():he((function(e){return!e}))}))},onCommentCountClick:function(){Ee((function(){de?he(!0):g?g():!E&&(window.location.href=Ce)}))},onShareClick:function(){A(!0)},onLikeClick:function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!ae||ye)return[2];be(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Xe({id:ae,locale:ce})];case 2:return 1!==(null==(e=t.sent())?void 0:e.status)?pe(Ke(ve)):R((function(e){return n(n({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})})),[3,4];case 3:return t.sent(),pe(Ke(ve)),[3,4];case 4:return be(!1),[2]}}))}))},showingMostEngaging:!(!p||!(null==V?void 0:V.id))}),fe&&o.createElement(gt,{isMainCmt:!P,onClose:function(){return he(!1)},onPostSuccess:function(e){0!==oe||(null==V?void 0:V.id)||U(e),R((function(e){return n(n({},e),{commentsCount:e.commentsCount+1,commented:!0})})),C&&C(e)},post:F}),p&&(null==V?void 0:V.id)?o.createElement("div",{className:"most-engaging-wrapper",onClick:function(e){h?(e.stopPropagation(),h()):window.location.href=Ce}},o.createElement(Lt,{hasQuickBookingEnable:S,handleMakeAppointment:j,comment:V,onDeleteComment:function(){Ye&&Ye(V)},className:"most-engaging-comment",type:"most-engaging",key:V.id}),oe>1&&!u&&o.createElement(m,{className:"see-more-comments",color:"ghost",size:"md"},ve("comment.seeMoreComments",{count:oe-1}))):null,_))},Rt=Object.freeze({__proto__:null});export{We as C,gt as I,Ge as L,ct as P,ht as S,Ze as T,st as a,it as b,at as c,rt as d,Ct as e,wt as f,kt as g,bt as h,Ft as i,jt as j,Lt as k,Mt as l,Rt as t};