"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7884],{niAJ:function(e,t,i){i.d(t,{I:function(){return InputCommentBar},P:function(){return PopupDanger},S:function(){return SharePopup},a:function(){return PopupFrame},b:function(){return SubmitReportForm},c:function(){return T},d:function(){return getPostFormData},e:function(){return editPost},f:function(){return createPost},g:function(){return getDefaultFailNoti},h:function(){return deletePost},i:function(){return R},j:function(){return deleteComment},k:function(){return decodeCommentBody},l:function(){return likeUnlikeComment},m:function(){return likeUnlikePost},u:function(){return useImagePicker}});var n=i("q1tI"),a=i("tuDO"),r=i("U+Ez"),o=i("uzh1"),l=i("CL9C"),s=i("i8i4"),d=i("d/ZZ"),p=i("rBCA"),c=i("iBNF"),m=i("vEfc"),u=i("Pn4S"),g=i("sFNn"),h=i("XsRk"),f=i("2O1/"),v=i("IQVP"),x=i("p4EI"),b=i("tsRq"),y=i("EiMf"),w=i("KoWj"),E=i("EZxD"),k=i("t/pd"),C=i("fKfj"),_=i("Z+Z0"),N=i("O6Wk"),P=i("/pFO");let useImagePicker=(e,t)=>{let[i,a]=(0,n.useState)(e||[]),r=(0,n.useMemo)(()=>(e||i).map(e=>"string"==typeof e?e:URL.createObjectURL(e)),[e,i]);return{onSelectImages:n=>{let r=n.target.files;if(r){if(t&&e){let n=e||i;t(n.concat(Array.from(r)))}else a(i=>{let n=e||i;return t&&t(n.concat(Array.from(r))),n.concat(Array.from(r))})}},onRemoveImage:i=>{t&&e?(e.splice(i,1),t(e.slice())):a(n=>{let a=e||n;return a.splice(i,1),t&&t(a.slice()),a.slice()})},onRemoveAllImages:()=>{t?t([]):a([])},imageSrcs:r,imageFiles:e||i}},getDefaultFailNoti=e=>({message:e("notification.failure"),type:"danger"}),likeUnlikePost=({id:e,locale:t})=>(0,m._)(void 0,void 0,void 0,function*(){if(!e)return;let i=yield(0,d.e)((0,d.f)(v.yy.POST.LIKE,{id:e,_locale:t}),"GET");return i}),deletePost=({id:e,locale:t})=>(0,m._)(void 0,void 0,void 0,function*(){if(!e)return;let i=yield(0,d.e)((0,d.f)(v.yy.POST.DELETE,{id:e,_locale:t}),"DELETE");return i}),getPostFormData=({title:e,description:t,communityId:i,imageFiles:n,previewUrl:a,topicIds:r,locale:o,sanitizeFunction:s,categoryCommunityId:d,categoryTopicIds:p,introUrl:c,bannerUrl:u,scheduleTime:g,isAnonymous:h,isAskDoctor:v})=>(0,m._)(void 0,void 0,void 0,function*(){let m=new FormData,b=(0,x.k)(t),y=(0,x.k)(e),w=(0,x.j)(b);if(m.append("title",y),m.append("description",(0,x.l)(b,s)),d?m.append("category_community",String(d)):i&&m.append("community_id",String(i)),m.append("is_anonymous",h?"1":"0"),m.append("is_question",v?"1":"0"),(null==a?void 0:a.title)&&m.append("preview_title",a.title),(null==a?void 0:a.description)&&m.append("preview_description",a.description),(null==a?void 0:a.url)&&m.append("preview_link",(0,l.c)(a.url)),(null==a?void 0:a.image)&&m.append("preview_image",(0,l.c)(a.image)),null==r||r.forEach(e=>{m.append("topics[]",String(e||""))}),null==p||p.forEach(e=>{m.append("category_topics[]",String(e||""))}),null==n?void 0:n.length){let e=yield Promise.all(n.map((e,t)=>new Promise(i=>{setTimeout(()=>{i((0,x.u)(e,o))},2e3*t)})));null==e||e.filter(Boolean).slice(0,f.M).forEach((e,t)=>{m.append(`images[${t}]`,e)})}else m.append("images","");return null==w||w.forEach(e=>{m.append("mention_ids[]",e)}),m.append("intro_url",c||""),m.append("banner",u||""),g&&(m.append("post_type","scheduled"),m.append("schedule_datetime",g)),m}),createPost=({locale:e,formData:t,isArticleComment:i})=>(0,m._)(void 0,void 0,void 0,function*(){let n=yield(0,d.e)((0,d.f)(i?v.yy.POST.CREATE_ARTICLE_COMMENT:v.yy.POST.CREATE,{_locale:e}),"POST",{data:t});return n}),editPost=({id:e,locale:t,formData:i})=>(0,m._)(void 0,void 0,void 0,function*(){let n=yield(0,d.e)((0,d.f)(v.yy.POST.UPDATE,{id:e,_locale:t}),"POST",{data:i});return n}),reportPost=({id:e,reason:t,locale:i})=>{let n=new FormData;return n.append("reason",t),(0,d.e)((0,d.f)(v.yy.POST.REPORT,{_locale:i,id:e}),"POST",{data:n})},z=p.Z.div` [data-type='confirm'] { max-width: 468px; /* height: 486px; */ padding: 0; .popup-content { display: flex; flex-direction: column; padding: 0; .close-button { top: 16px; right: 16px; width: 24px; height: 24px; z-index: 5; } .header { display: flex; height: 56px; align-items: center; padding: 16px 56px 16px 32px; border-bottom: 1px solid ${c.r.colors.neutral100}; font-weight: 900; width: 100%; justify-content: space-between; } .content { overflow: auto; flex: 1; .topic-list-wrapper { padding: 1rem; } } } } > div&[data-open='true'] { z-index: 250; &:last-child { z-index: 200; } } ${e=>e.isExpand&&` & > div[data-open] { width: 100%; height: 100%; max-width: none; max-height: none; } `} ${e=>e.hasFullscreen&&` & > div[data-open] { transition: all 0.5s ease-in-out, width 0s, height 0s; } `} `,M=p.Z.div` cursor: pointer; display: flex; align-items: center; `,PopupFrame=({className:e,style:t,closeIcon:i,heading:a="",children:o,isOpen:l=!1,hasFullscreen:s=!1,disableClickOutside:d=!1,initExpand:p=!1,onExpandChange:c,onClose:m=()=>null})=>{let[u,g]=(0,n.useState)(p);return n.createElement(z,{className:e,style:t,isExpand:u,hasFullscreen:s},n.createElement(_.P,{type:"confirm",onClose:m,isOpen:l,closeIcon:i||n.createElement("img",{src:N.C,loading:"lazy"}),enableAnimation:!s,disableClickOutside:d},n.createElement("div",{className:"header"},n.createElement(r.H,{tag:"h5"},a),s&&n.createElement(M,{onClick:()=>{null==c||c(),g(!u)}},n.createElement(C.Z,{size:14,isExpand:u}))),n.createElement("div",{className:"content"},"function"==typeof o?o(u):o)))};var T="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='25' fill='none'%3e%3cpath fill='%23262626' d='M12 22.984c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.478-10 10 4.477 10 10 10'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m14.828 10.156-5.657 5.657M9.172 10.156l5.657 5.657'/%3e%3c/svg%3e";let $=p.Z.div` [data-type='confirm'] { width: min(360px, 100%); height: auto; &[data-open='false'] { top: calc(-100% - 500px); } } z-index: 600; .header { display: none !important; } .confirm-dialog { position: relative; overflow: auto; width: 100%; padding-top: 44px; background: #fff; border-radius: ${c.r.borderRadius}; .confirm-content { display: flex; flex-direction: column; align-items: center; padding: 0 16px 16px; text-align: center; .title { margin-bottom: 8px; font-size: 24px; line-height: 32px; word-break: break-word; overflow-wrap: break-word; } .desc { margin-bottom: 24px; color: ${c.r.colors.gray500}; font-size: 18px; line-height: 24px; text-align: center; word-break: break-word; overflow-wrap: break-word; } .btn-group { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; button { margin: 0 4px 0.5rem; } } } } .thumbnail-container { width: 80px; height: 80px; margin-bottom: 32px; .thumbnail { width: 100%; height: 100%; } &.is-icon { display: flex; align-items: center; justify-content: center; background: #e0e9fc; border-radius: 1rem; .thumbnail { width: 40px; height: 40px; } } } &[data-is-marrybaby='true'] { .popup-frame { > div:first-child { overflow: hidden; border-radius: 1rem; &[data-open='true'] { ${l.M.mbDown} { top: 100%; transform: translate(-50%, -100%); max-width: unset; width: 100%; background: unset; overflow: unset; } } } .popup-content { .close-button { ${l.M.mbDown} { display: none; } } .confirm-dialog { ${l.M.mbDown} { background: unset; position: relative; overflow-x: hidden; &::before { content: ''; width: 200%; background: #fff; position: absolute; left: 50%; top: 0; transform: translateX(-50%); z-index: -1; height: 100%; border-top-left-radius: 100%; border-top-right-radius: 100%; } } .confirm-content { padding: 0 40px 40px; ${l.M.mbDown} { padding-left: 1.5rem; padding-right: 1.5rem; } .btn-group { width: 100%; justify-content: space-between; button { flex: 1; margin: 0; &:first-child { margin-right: 0.5rem; } } } } } } .thumbnail-container { ${l.M.mbDown} { display: none; } &.is-icon { background: #ffeaf1; border-radius: 24px; } &.is-mobile { position: absolute; top: 0; left: 50%; display: none; width: 48px; height: 48px; transform: translate(-50%, -50%); &.is-icon { border-radius: 1rem; .thumbnail { width: 24px; height: 24px; } } ${l.M.mbDown} { display: flex; } } } } } `,PopupDanger=({className:e,isMarryBaby:t,style:i,title:p,description:c,acceptText:m,cancelText:u,onAccept:g,onCancel:h,thumbnail:f,isThumbnailIcon:v,onClose:x,acceptBtnTracking:b,acceptBtnProps:y,cancelBtnProps:w})=>{let{data:{env:{isMarryBaby:E}}}=(0,n.useContext)(d.T),k="boolean"==typeof t?t:E,[C,_]=(0,n.useState)(!1);return((0,n.useEffect)(()=>((0,l.t)(!0),setTimeout(()=>_(!0),0),()=>(0,l.t)(!1)),[]),"undefined"==typeof window)?null:s.createPortal(n.createElement($,{"data-is-marrybaby":k,className:e,style:i,"data-open":C},n.createElement(PopupFrame,{className:"popup-frame",isOpen:C,onClose:x},n.createElement("div",{className:"confirm-dialog",onClick:e=>e.stopPropagation()},n.createElement("div",{className:"confirm-content"},f&&n.createElement("div",{className:`thumbnail-container ${v?"is-icon":""}`},n.createElement("img",{className:"thumbnail",src:f,loading:"lazy"})),n.createElement(r.H,{className:"title",tag:"h2"},p),n.createElement(o.T,{className:"desc",size:"lg"},c),n.createElement("div",{className:"btn-group"},n.createElement(a.B,Object.assign({theme:k?"marryBaby":"helloSites",size:"md",color:"tertiary",onClick:()=>{null==g||g(),null==x||x()}},y,b),m),n.createElement(a.B,Object.assign({theme:k?"marryBaby":"helloSites",size:"md",onClick:()=>{null==h||h(),null==x||x()}},w),u)))),k&&f&&n.createElement("div",{className:`thumbnail-container is-mobile ${v?"is-icon":""}`},n.createElement("img",{className:"thumbnail",src:f,loading:"lazy"})))),(0,l.a)())},D=p.Z.div` padding: 1rem; border-top: 1px solid #f2f2f2; &[data-is-reply='true'] { padding-right: 0; padding-left: 0; border-top: 1px solid #e4e8ec; margin-right: 1rem; margin-left: 1rem; } .error-text { padding: 1rem; color: ${c.r.colors.red700}; } .reply-to-container { display: flex; justify-content: space-between; padding-bottom: 0.75rem; margin-top: -0.25rem; .icon-close-comment { width: 16px; height: 16px; cursor: pointer; } a { text-decoration: none; } } .input-container { display: flex; align-items: center; .avatar-wrapper { display: flex; flex-shrink: 0; align-items: center; margin-right: 0.5rem; &.avatar-wrapper-reply { width: 32px; height: 32px; .avatar { width: 32px; height: 32px; } } } .input-wrapper { margin-right: 0.5rem; &[data-has-error] { .as-input { border-color: ${c.r.colors.red700}; } } .as-input { .textarea { width: 100%; max-height: 225px; min-height: 75px; .ql-toolbar { padding: 0; } .ql-editor { padding-left: 0; padding-right: 0; } .quill { height: 0; } } width: 100%; padding: 12px 16px; border: solid 1px ${c.r.colors.gray200}; border-radius: ${c.r.borderRadius}; &:active, &:focus { border-color: ${c.r.colors.primaryBase}; box-shadow: 0px 0px 2px 2px ${c.r.colors.primary200}; } &:disabled { background-color: ${c.r.colors.gray100}; cursor: not-allowed; } span { &[data-error='true'] { color: red; text-decoration: underline; } } } &[data-has-action-icon] { .as-input { padding: 12px 48px 12px 16px; } } &[data-has-display-icon] { .as-input { padding: 12px 16px 12px 48px; } } &[data-has-action-icon][data-has-display-icon] { .as-input { padding: 12px 48px; } } &[data-size='lg'] { .as-input { font-size: 16px; font-weight: ${c.r.sizes.fwRegular}; ${l.M.mbDown} { font-size: 22px; line-height: 1.2; } ${l.M.mbUp} { font-size: 26px; line-height: 1.2; } } } &[data-size='md'] { .as-input { font-weight: ${c.r.sizes.fwRegular}; line-height: 22px; ${l.M.mbDown} { font-size: 14px; line-height: 1.2; } ${l.M.mbUp} { font-size: 16px; line-height: 1.2; } } } &[data-size='sm'] { .as-input { font-weight: ${c.r.sizes.fwRegular}; line-height: 20px; ${l.M.mbDown} { font-size: 13px; line-height: 1.5; } ${l.M.mbUp} { font-size: 13px; line-height: 1.5; } } } } .images-input-label { height: 100%; cursor: pointer; .icon-images-input { width: 24px; height: 24px; vertical-align: middle; } } .send-button { display: flex; width: 40px; height: 40px; flex-shrink: 0; align-items: center; justify-content: center; padding: 0; border: none; &.send-button-post { background: ${c.r.colors.neutral100}; border-radius: 50%; } .icon-enter { width: 20px; height: 20px; vertical-align: middle; } &[data-is-loading='true'] { > div { display: flex; align-items: center; justify-content: center; } } } } .preview-images-container { margin-top: 1rem; .image-src-wrapper { position: relative; width: 100%; padding-top: 66.67%; &:not(:last-child) { margin-bottom: 1rem; } .preview-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; } .icon-close-circle { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; cursor: pointer; } } } `,S=(0,n.createContext)({}),getCommentFormBody=({postId:e,message:t,photos:i,link:n,locale:a,sanitizeFunction:r,replyingUserId:o,replyingUserName:l,replyingId:s})=>(0,m._)(void 0,void 0,void 0,function*(){let d=new FormData,p=(0,x.l)(t.replace(/(\ )+/g," "),r),c=(0,x.j)(p);if(i&&i.length>0){let e=yield Promise.all(null==i?void 0:i.map(e=>(0,x.u)(e,a)));e.filter(Boolean).slice(0,f.M).forEach(e=>{d.append("images[]",e)})}return n&&d.append("link",n),null==c||c.forEach(e=>{d.append("mention_ids[]",e)}),d.append("post_id",e),s&&d.append("parent_id",s),o&&(c.unshift(o),p=`[mention+id="${o}"+name="${(l||"").replace('"',"'")}"]${p}`,d.append("parent_user_id",String(o))),d.append("content",p),d.append("content",p),d}),submitComment=(e,t)=>(0,m._)(void 0,void 0,void 0,function*(){return(0,d.e)((0,d.f)(v.yy.COMMENT.CREATE,{_locale:t}),"POST",{data:e})}),decodeCommentBody=e=>{try{let t=e.match(/\[@([^\]]+)\]/),i=t?t[0].replace("[@","").replace("]",""):"",n=e.replace(/\[@([^\]]+)\]/,"");return{text:n.trim(),replyingTo:i}}catch(e){}return{text:""}},submitReply=(e,t)=>(0,m._)(void 0,void 0,void 0,function*(){return(0,d.e)((0,d.f)(v.yy.COMMENT.REPLY,{_locale:t}),"POST",{data:e})}),likeUnlikeComment=({commentId:e,setLike:t=!1,locale:i})=>(0,m._)(void 0,void 0,void 0,function*(){return(0,d.e)((0,d.f)(t?v.yy.COMMENT.LIKE:v.yy.COMMENT.UNLIKE,{_locale:i,id:e}),"GET")}),deleteComment=({id:e,locale:t})=>(0,d.e)((0,d.f)(v.yy.COMMENT.DELETE,{_locale:t,id:e}),"DELETE"),InputCommentBar=({isReply:e,className:t,onClose:i,replyToName:r,style:l,replyingId:s,replyingUser:p,onPostSuccess:c,post:v,isMarryBaby:x})=>{let{action:{pushNotifications:k,sanitizeFunction:C},data:{userInfo:_,locale:N,env:{isMarryBaby:P}}}=(0,n.useContext)(d.T),{t:z}=(0,g.u)(),{onSelectImages:M,onRemoveImage:$,imageSrcs:O,onRemoveAllImages:F,imageFiles:R}=useImagePicker(),[j,B]=(0,n.useState)(""),{trigger:I}=(0,n.useContext)(S),[U,L]=(0,n.useState)(!1),Z=(0,n.useRef)(null),A=(0,n.useRef)(null),q=(0,n.useRef)(null),[H,W]=(0,n.useState)([]),[K,J]=(0,n.useState)([]),[X,G]=(0,n.useState)(null);return(0,n.useEffect)(()=>{var e;null===(e=q.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout(()=>{var e;null===(e=A.current)||void 0===e||e.focus()},400)},[I]),n.createElement(D,{"data-is-reply":e,className:t,style:l},e&&n.createElement("div",{className:"reply-to-container"},n.createElement(o.T,{size:"p4"},n.createElement("span",{dangerouslySetInnerHTML:{__html:z("inputComment.replyTo",{name:`@${r||""}`})}})),n.createElement("img",{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' fill='none'%3e%3ccircle cx='8' cy='8.5' r='6.667' fill='white' stroke='%23404040'/%3e%3cpath stroke='%23404040' stroke-linecap='round' stroke-linejoin='round' d='m10 6.5-4 4M6 6.5l4 4'/%3e%3c/svg%3e",className:"icon-close-comment",onClick:()=>i&&i(),loading:"lazy"})),n.createElement("div",{className:"input-container",ref:q},n.createElement(w.U,{className:`avatar-wrapper ${e?"avatar-wrapper-reply":""}`,avatar:(null==_?void 0:_.id)?_.avatar:f.D,username:(null==_?void 0:_.name)||(null==_?void 0:_.username)}),n.createElement("input",{ref:Z,onChange:M,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),n.createElement(u.I,{value:j,name:"input",size:"md",className:"input-wrapper",displayIcon:n.createElement("img",{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M10.754 4.854H4.492a1.79 1.79 0 0 0-1.789 1.789v12.524a1.79 1.79 0 0 0 1.79 1.789h12.523a1.79 1.79 0 0 0 1.79-1.79v-6.261'/%3e%3cpath stroke='%232D87F3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M17.463 3.512a1.898 1.898 0 0 1 2.684 2.684l-8.498 8.498-3.579.895.895-3.579z'/%3e%3c/svg%3e",loading:"lazy"}),CustomInput:n.createElement("div",{className:"as-input"},n.createElement(E.R,{className:"textarea",html:j,onChange:B,onImagePickerClick:()=>{var e;return null===(e=Z.current)||void 0===e?void 0:e.click()},bannedWords:K,onPreviewUrlChange:G,onInvalidUrlsChange:W,setEditorRef:e=>A.current=e,isReplying:e}))}),n.createElement(a.B,{theme:("boolean"==typeof x?x:P)?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:()=>(0,m._)(void 0,void 0,void 0,function*(){var t,n,a,r,o,l,d,m,u;if((null==v?void 0:v.id)&&!U){L(!0);try{let g=yield getCommentFormBody(Object.assign({message:j,photos:R,postId:String(v.id),link:null==X?void 0:X.url,sanitizeFunction:C,locale:N},e&&s?{replyingUserId:String((null==p?void 0:p.id)||(null===(t=null==v?void 0:v.author)||void 0===t?void 0:t.id)||""),replyingId:s,replyingUserName:(null==p?void 0:p.name)||(null==p?void 0:p.username)||""}:{})),f=yield e&&s?submitReply(g,N):submitComment(g,N),x=null==f?void 0:f.data;(null==x?void 0:x.id)&&!(null===(a=null===(n=null==f?void 0:f.messages)||void 0===n?void 0:n.moderation)||void 0===a?void 0:a.type)?(e=>{B(""),F(),i&&i();let t=(0,h.g)(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),c&&c(t)})(f):(null===(o=null===(r=null==f?void 0:f.messages)||void 0===r?void 0:r.moderation)||void 0===o?void 0:o.type)==="banned"?(k({title:z("notification.comment.blocked.title"),message:z("notification.comment.blocked.message"),type:"danger"}),f.messages.moderation.words&&J(f.messages.moderation.words)):(null===(d=null===(l=null==f?void 0:f.messages)||void 0===l?void 0:l.moderation)||void 0===d?void 0:d.type)==="suspect"?(k({title:z("notification.comment.suspect.title"),message:z("notification.comment.suspect.message"),type:"warning"}),B(""),F(),i&&i()):(null===(m=null==f?void 0:f.messages)||void 0===m?void 0:m.find(e=>{var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))}))?(k({message:z("notification.suspend.message"),type:"warning"}),B(""),F(),i&&i()):k({title:"",message:(null===(u=null==f?void 0:f.messages)||void 0===u?void 0:u[0])||z("notification.comment.somethingWrong"),type:"danger"})}catch(e){k({title:"",message:z("notification.comment.somethingWrong"),type:"danger"})}L(!1)}}),isLoading:U,isDisabled:!!(null==H?void 0:H.length)||U||!j||(null==j?void 0:j.length)<2||!j.trim()},n.createElement("img",{src:"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='20' height='21' fill='none'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m7.5 9.734-3.75 3.75 3.75 3.75'/%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M16.25 4.734v5.569c0 .843-.33 1.653-.915 2.25a3.1 3.1 0 0 1-2.21.931H3.75'/%3e%3c/svg%3e",className:"icon-enter",loading:"lazy"}))),(null==H?void 0:H.length)?n.createElement("div",{className:"error-text"},z("notification.limitUrlDomain")):null,(!O||0===O.length)&&X&&n.createElement("div",{className:"link-preview-wrapper"},X.isFetching?n.createElement(y.L,null):n.createElement(n.Fragment,null,n.createElement(b.C,{title:X.title,url:X.url||"#",image:X.image,noRefetch:!0}),n.createElement("img",{src:T,className:"icon-close",onClick:()=>G(null),loading:"lazy"}))),O&&O.length>0&&n.createElement("div",{className:"preview-images-container"},O.map((e,t)=>n.createElement("div",{key:t,className:"image-src-wrapper"},n.createElement("img",{className:"preview-image",src:e,loading:"lazy"}),n.createElement("img",{src:T,className:"icon-close-circle",onClick:()=>$(t),loading:"lazy"})))))},SharePopup=({trackingCategory:e,className:t,style:i,url:a,text:r,onClose:o})=>{let{data:{env:{isMarryBaby:s}}}=(0,n.useContext)(d.T),{t:p}=(0,g.u)(),[c,m]=(0,n.useState)(!1);return(0,n.useEffect)(()=>((0,l.t)(!0),setTimeout(()=>m(!0),0),()=>(0,l.t)(!1)),[]),n.createElement(k.h,null,n.createElement(O,{"data-is-marrybaby":s,className:t,style:i},n.createElement(PopupFrame,{className:"share-popup",isOpen:c,onClose:o,heading:p("bottomBar.share")},c&&n.createElement(P.r,{trackingCategory:e,shareUrl:a||("undefined"!=typeof window?window.location.href:""),title:r}))))},O=p.Z.div` .share-popup { > div:first-child { height: unset; } } .custom-share__header { display: flex; flex-wrap: no-wrap; align-items: center; padding: 1rem; border-bottom: 1px solid ${c.r.colors.neutral100}; margin-bottom: 16px; .custom-share__header-image { width: 38px; height: 38px; flex-shrink: 0; & > img { width: 100%; height: 100%; object-fit: cover; object-position: center; } } .custom-share__header-info { flex: 1; padding: 0 8px; word-break: break-word; [data-tag='h4'] { margin-bottom: 8px; font-size: 14px; font-weight: bold; line-height: 14px; } [data-size='md'] { color: #a5a5a5; font-size: 14px; line-height: 14px; } } } &[data-is-marrybaby='true'] { .share-popup { > div:first-child { overflow: hidden; border-radius: 1rem; &[data-open='true'] { ${l.M.mbDown} { max-width: unset; width: 100%; top: 100%; transform: translate(-50%, -100%); border-bottom-left-radius: 0; border-bottom-right-radius: 0; } } } .close-button { display: block; } .popup-content { .header { display: block; padding: 1rem; background-color: rgb(243, 243, 243); } .content { padding-bottom: 1rem; } } .share-mb-text { margin: 1rem 1rem 0.5rem; } } } `,F=p.Z.div` padding: 0 8px; margin-top: 18px; .report-list { margin-bottom: 18px; .report-item { display: flex; align-items: center; margin-bottom: 10px; font-weight: 600; & > img { width: 12px; height: 12px; margin-right: 8px; } .__label { font-size: 14px; } } } .report-submit { width: 100%; } &[data-is-marrybaby='true'] { padding: 0 1rem 1rem; } `;var R="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3e%3cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12M8 5v3M8 11h.007'/%3e%3c/svg%3e";let SubmitReportForm=({className:e,style:t,reason:i,reasonText:r,onClose:l,postId:s})=>{let{data:{locale:p,env:{isMarryBaby:u}},action:{pushNotifications:h}}=(0,n.useContext)(d.T),{t:f}=(0,g.u)(),[v,x]=(0,n.useState)(!1);return n.createElement(F,{"data-is-marrybaby":u,className:e,style:t},n.createElement("ul",{className:"report-list"},n.createElement("li",{className:"report-item"},n.createElement("img",{src:R,loading:"lazy"}),n.createElement(o.T,{className:"__label",color:c.r.colors.gray800,size:"p4"},r))),n.createElement(a.B,{theme:u?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:v,onClick:()=>(0,m._)(void 0,void 0,void 0,function*(){if(s&&!v){x(!0);try{let e=yield reportPost({id:s,reason:i,locale:p});(null==e?void 0:e.status)===1&&(h({message:"Post reported",type:"success"}),l&&l())}catch(e){}x(!1)}})},f("submit")))}},fUCd:function(e,t,i){i.d(t,{D:function(){return DrawerBottom}});var n=i("vEfc"),a=i("q1tI"),r=i("iuhU"),o=i("h8tX"),l=i("uJ2t"),s=i("rSBk"),d=i("rBCA"),p=i("iBNF"),c=i("W9Px");(0,d.Z)(l.D)` /* max-height: 100vh; max-height: 100dvh; */ background-color: white; &[data-vaul-drawer-direction='bottom'] { top: initial !important; border-top-left-radius: 16px !important; border-top-right-radius: 16px !important; padding-bottom: 32px; padding-left: 20px; padding-right: 20px; } .drawer__handle { width: 44px; height: 3px; background-color: ${p.r.colors.neutral500}; margin: 16px auto; flex-shrink: 0; } `;let m=(0,d.Z)(s.dy.Content)` position: fixed; z-index: ${c.c-9e6+1}; inset: 0; background-color: #fff; outline: none !important; &[data-is-linear='true'] { background: linear-gradient(180deg, #c3e3ff 1.86%, #fff 20%) !important; } &::-webkit-scrollbar { width: 6px; height: 6px; } &::-webkit-scrollbar-track { background-color: transparent; } &::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, 0.4); border-radius: 6px; } &[data-vaul-drawer-direction='bottom'] { top: initial; border-top-left-radius: 16px; border-top-right-radius: 16px; /* padding-bottom: 16px; */ } ${e=>e.isDragging&&` input { caret-color: transparent; } `} `,u=(0,d.Z)(s.dy.Overlay)` position: fixed; inset: 0; z-index: ${c.c-9e6}; width: 100%; max-height: 100%; background-color: rgb(0, 0, 0, 0.4); `,g=(0,d.Z)(s.dy.Handle)` &[data-vaul-handle] { width: 44px; height: 3px; background-color: ${p.r.colors.neutral500}; margin: 16px auto; flex-shrink: 0; } `;function DrawerBottom(e){var{children:t,onClose:i,isOpen:d,onOpenChange:p,isMobile:c,classNames:h,isLinear:f,overlayClassName:v,contentClassName:x,handlerClassName:b,drawerOverlayProps:y}=e,w=(0,n.a)(e,["children","onClose","isOpen","onOpenChange","isMobile","classNames","isLinear","overlayClassName","contentClassName","handlerClassName","drawerOverlayProps"]);let{isDragging:E,handleDragStart:k,handleDragEnd:C}=(0,l.u)(),{onDrag:_,onRelease:N}=w,P=(0,n.a)(w,["onDrag","onRelease"]);return c?a.createElement(s.dy.Root,Object.assign({},P,{open:d,onOpenChange:p,onClose:i,onDrag:(e,t)=>{k(),null==_||_(e,t)},onRelease:(e,t)=>{C(),null==N||N(e,t)}}),a.createElement(s.dy.Portal,null,a.createElement(u,Object.assign({className:(0,r.default)(v,"drawer__overlay")},y)),a.createElement(m,{isDragging:E,className:(0,r.default)(x,"drawer__content"),"data-is-linear":f},a.createElement(s.dy.Title,{style:{display:"none"}}),a.createElement(g,{className:(0,r.default)(b,"drawer__handle")}),t))):a.createElement(o.u,Object.assign({withCloseButton:!0,centered:!0,zIndex:500,size:"auto",classNames:h,radius:"lg"},w,{onClose:i,opened:d,styles:{root:{maxHeight:"400px"},body:{background:f?"linear-gradient(180deg, #A5D4FF 0%, #FFFFFF 20%)":void 0}}}),t)}}}]);