(globalThis.webpackChunknotion_next=globalThis.webpackChunknotion_next||[]).push([[58324],{813195:(e,t,o)=>{"use strict";o.d(t,{DF:()=>k,Ri:()=>D,Xi:()=>B,YF:()=>L,Zo:()=>I,bh:()=>M});o(757658);var i=o(701302),n=o(845369),s=o(653965),r=o(585344),a=o(554564),l=o(594419),c=o(709953),d=o(761045),u=o(303898),m=o(800993),p=o(210228),g=o(977357),h=o(165598),f=o(389224),x=o(206258),v=o(304761),S=o(169296),b=o(559847),y=o(835491),C=o(855661),j=o(575497),w=o(485444);function k(e){var t,o;const{environment:i,store:s,text:a,files:l,transaction:c,discussionLocation:d,property_id:u,blockStore:p}=e,g=h.GP(s);if(!g)return;const{filesToCreate:f,fileStoresToDelete:x}=function(e,t){const o=[],i=new Set;t.forEach((e=>{"local"===e.type?o.push(e.file):i.add(e.id)}));const n=h.le(e),s=n.filter((e=>e.getAlive()&&!i.has(e.id)));return{filesToCreate:o,fileStoresToDelete:s}}(s,l);I({commentStore:s,fileBlocks:x,transaction:c}),(0,y.J)({commentStore:s,files:f,environment:i,transaction:c});const b=h.zP(s);m.sO({environment:i,store:b,value:a,transaction:c}),(0,w.Q)(s,c);const C=null==s||null===(t=s.getParentStore())||void 0===t?void 0:t.getParentStore(),j=n.B7.includes(d),k=null==g||null===(o=g.getParentStore())||void 0===o?void 0:o.getNavigableBlockStore(),{property_type:L,collection_id:M,collection_view_id:B,view_type:D,collection_view_block_id:R}=(0,S.o)(u,p);r.zd(i,{from:d,comment_id:s.id,discussion_id:g.id,discussion_type:g.getType(),parent_block_id:g.getParentId(),parent_collection_id:null==C?void 0:C.getParentCollectionIdUpToTwoLevels(),...j&&{inbox_session_id:v.ZP.state.sessionId,notification_page_id:null==k?void 0:k.id},property_type:L,collection_id:M,collection_view_id:B,view_type:D,collection_view_block_id:R})}function L(e){var t,o;const{environment:i,commentStore:s,transaction:a,discussionLocation:l}=e,d=h.GP(s);if(!d)return;const u=h.ak(d),m=u.getValue();if(!m)return;I({commentStore:s,fileBlocks:h.le(s),transaction:a}),c.sW({store:s,transaction:a,data:{alive:!1}}),p.applyOperation({store:u,operation:{pointer:u.pointer,path:u.path,command:"listRemove",args:{id:s.id}},transaction:a}),(0===m.length||1===m.length&&m[0]===s.id)&&(0,C.d)({environment:i,discussionStore:d,transaction:a}),(0,w.Q)(s,a);const g=n.B7.includes(l),f=null==d||null===(t=d.getParentStore())||void 0===t?void 0:t.getNavigableBlockStore();r.k$(i,{from:e.discussionLocation,discussion_id:d.id,discussion_type:d.getType(),comment_id:s.id,parent_block_id:d.getParentId(),parent_collection_id:null===(o=d.getParentStore())||void 0===o?void 0:o.getParentCollectionIdUpToTwoLevels(),...g&&{inbox_session_id:v.ZP.state.sessionId,notification_page_id:null==f?void 0:f.id}})}function M(e){var t,o;const{environment:i,commentStore:s,discussionStore:a,transaction:l,discussionLocation:d}=e;c.sW({store:a,data:{resolved:!1},transaction:l});const u=n.B7.includes(d),m=null==a||null===(t=a.getParentStore())||void 0===t?void 0:t.getNavigableBlockStore();r.SU(i,{comment_id:s.id,discussion_id:a.id,from:e.discussionLocation,parent_block_id:a.getParentId(),parent_collection_id:null===(o=a.getParentStore())||void 0===o?void 0:o.getAssociatedCollectionId(),...u&&{inbox_session_id:v.ZP.state.sessionId,notification_page_id:null==m?void 0:m.id}})}function B(e){var t,o;const{environment:i,discussionStore:a,textValue:l,transaction:c,files:d,property_id:u,blockStore:m}=e,{id:p}=i.currentUser;if(!p)return;const h=g.dm(d);if(s.Xy(l,[])&&0===h.length)return;const f=(0,b.X)({discussionStore:a,text:l,files:h,environment:i,transaction:c}),x=n.B7.includes(e.discussionLocation),y=null===(t=a.getParentStore())||void 0===t?void 0:t.getNavigableBlockStore(),{property_type:C,collection_id:j,collection_view_id:w,view_type:k,collection_view_block_id:L}=(0,S.o)(u,m);r.d2(i,{from:e.discussionLocation,comment_id:f.id,discussion_id:a.id,discussion_type:a.getType(),parent_block_id:a.getParentId(),parent_collection_id:null==a||null===(o=a.getParentStore())||void 0===o?void 0:o.getParentCollectionIdUpToTwoLevels(),...x&&{inbox_session_id:v.ZP.state.sessionId,notification_page_id:null==y?void 0:y.id},property_type:C,collection_id:j,collection_view_id:w,view_type:k,collection_view_block_id:L})}function I(e){const{commentStore:t,fileBlocks:o,transaction:i}=e,n=h.ig(t);o.forEach((e=>{c.sW({store:e,data:{alive:!1},transaction:i}),l.Od({parentStore:n,childToRemoveStore:e,transaction:i})}))}async function D(e){var t;let{discussionStore:o,currentBlockStore:n,environment:s,analyticsFrom:r,currentEl:l}=e;if(!n)return null;if(!o.isDefined())return;function c(e){const t=(0,j.L)({discussionId:o.id,blockId:e});if(!t)return;const i=document.getElementsByClassName(`discussion-id-${o.id}`)[0];return i?d.bx({element:i,scrollers:{verticalScroller:t.getContextVerticalScroller(),horizontalScroller:t.getContextHorizontalScroller()},vertical:{reveal:"top"},horizontal:{reveal:"closest"},animate:!0}):d.XW({handle:t,vertical:{reveal:"top"},horizontal:{reveal:"closest"},animate:!0}),t.displaySelectionHalo(750),t}const m=(null===(t=o.getRecordStoreUIParent())||void 0===t?void 0:t.id)??o.getParentId();c(m)||(await u.Nz(n,[m]),await i.default.afterNextFlush(),c(m));const p=x.G.createChildStore(n,o.getParentPointer()),g=f.get(),h=null==g?void 0:g.commonAncestorContainer,v=!(null!=g&&g.collapsed)&&h&&(l===h||(null==l?void 0:l.contains(h)));a.Ib({environment:s,blockStore:p||n,analyticsFrom:r,discussionIds:[o.id],shouldFocusDiscussion:!v,recursivelyLoadAllDiscussions:!1})}},774177:(e,t,o)=>{"use strict";o.r(t),o.d(t,{Comment:()=>Bt,CommentFileBlock:()=>ni.Z,Discussion:()=>Yt,DiscussionIndicator:()=>eo.ZP,DiscussionInput:()=>Mt.Z,DiscussionReactionBar:()=>et,MarginCommentsSection:()=>Uo,NewDiscussionMenu:()=>Qo,PropertyDiscussionIndicator:()=>co,ReactionBar:()=>tt,ReplyDiscussionMenu:()=>oi,SuggestionContext:()=>qt,discussionHelpers:()=>J,discussionViewActions:()=>i,reactionActions:()=>Ee});var i={};o.r(i),o.d(i,{isCommentUnread:()=>zt});var n=o(667294),s=o(701302),r=o(800480),a=o(706740),l=o(797511),c=o(533125),d=o(886628),u=o(724405),m=o(772141),p=o(421202),g=o(421838),h=o(709291),f=o(137810),x=o(554564),v=o(547307),S=o(761045),b=o(800993),y=o(898104),C=o(210228),j=o(174136),w=o(526388),k=o(164369),L=o(942402),M=o(167706),B=o(365085),I=o(212740),D=o(965187),R=o(311368),Z=o(304708),T=o(165598),_=o(816402),A=o(782527),K=o(478379),P=o(745238),F=o(785893);const V=(0,P.IU)("suggestionExtraSmall",{viewBox:"0 0 10 9",svg:(0,F.jsxs)("g",{children:[(0,F.jsx)("path",{d:"M5.175 4.745l-.906.339c-.07.027-.14.012-.205-.045-.064-.057-.08-.127-.048-.212l.342-.899L7.492.798l.814.813-3.131 3.134zm3.4-3.397L7.76.53l.359-.352A.617.617 0 018.48.005a.364.364 0 01.33.105l.14.14c.1.105.145.226.134.365a.596.596 0 01-.168.366l-.341.366z"}),(0,F.jsx)("path",{d:"M4.91 1.962L5.969.906H2.704c-.354 0-.66.072-.92.216-.26.14-.46.341-.601.601-.142.26-.212.566-.212.92v2.754c0 .354.074.66.222.92.148.26.345.461.591.605.249.141.524.212.827.212h.25v.694c0 .214.056.382.167.506a.603.603 0 00.465.184.84.84 0 00.383-.092c.125-.06.27-.16.434-.301l1.138-.991h1.846c.353 0 .66-.07.92-.212.26-.144.46-.345.6-.605a1.89 1.89 0 00.213-.92V2.643c0-.114-.007-.223-.022-.327l-.433.443-.601.602V5.32c0 .253-.064.442-.192.567-.125.126-.314.188-.567.188h-1.85a.757.757 0 00-.307.051.962.962 0 00-.256.192L3.743 7.349v-.926c0-.125-.031-.214-.093-.267a.372.372 0 00-.256-.082h-.608c-.251 0-.44-.062-.568-.188-.125-.125-.188-.314-.188-.567V2.72c0-.253.063-.442.188-.567.128-.128.317-.192.568-.192H4.91z"})]})});var E=o(60217),z=o(989574),U=o(825464),W=o(524229),N=o(61766),O=o(385555),H=o(896049),$=o(206258),G=o(813195),X=o(95306),q=o(130525),J=o(800678),Y=o(182994),Q=o(947002),ee=(o(757658),o(815145)),te=o(541432),oe=o(519889),ie=o(653965),ne=o(401898),se=o(800893),re=o(552275),ae=o(231945),le=o(573063),ce=o(478140),de=o(632163),ue=o(672495),me=o(483182),pe=o(95477),ge=o(843250),he=o(460709),fe=o(798165),xe=o(918514),ve=o(685917),Se=o(397876),be=o(464939),ye=o(349434),Ce=o(656046),je=o(414726);const we=(0,P.IU)("reopen",{viewBox:"0 0 14 14",svg:(0,F.jsx)("path",{d:"M1.64844 7.88477C1.64844 10.791 3.98047 13.1289 6.88086 13.1289C9.78125 13.1289 12.1133 10.791 12.1133 7.88477C12.1133 7.53906 11.873 7.29297 11.5273 7.29297C11.1934 7.29297 10.9707 7.53906 10.9707 7.88477C10.9707 10.1582 9.14844 11.9805 6.88086 11.9805C4.61328 11.9805 2.79688 10.1582 2.79688 7.88477C2.79688 5.59961 4.60156 3.78906 6.86328 3.78906C7.25 3.78906 7.60742 3.81836 7.90625 3.88281L6.3125 5.46484C6.20703 5.57617 6.1543 5.69922 6.1543 5.85156C6.1543 6.17383 6.39453 6.41992 6.71094 6.41992C6.875 6.41992 7.00977 6.36719 7.10938 6.26172L9.51758 3.83594C9.64062 3.71289 9.69922 3.57227 9.69922 3.41406C9.69922 3.26172 9.63477 3.10938 9.51758 2.99219L7.10938 0.548828C7.00977 0.4375 6.875 0.378906 6.71094 0.378906C6.39453 0.378906 6.1543 0.636719 6.1543 0.953125C6.1543 1.10547 6.20703 1.24023 6.30664 1.3457L7.72461 2.74609C7.4668 2.69336 7.16797 2.66406 6.86328 2.66406C3.96875 2.66406 1.64844 4.98438 1.64844 7.88477Z"})}),ke=(0,P.IU)("resolve",{viewBox:"0 0 16 16",svg:(0,F.jsx)(F.Fragment,{children:(0,F.jsx)("path",{d:"M6.6123 14.2646C7.07715 14.2646 7.43945 14.0869 7.68555 13.7109L14.0566 3.96973C14.2344 3.69629 14.3096 3.44336 14.3096 3.2041C14.3096 2.56152 13.8311 2.09668 13.1748 2.09668C12.7236 2.09668 12.4434 2.26074 12.1699 2.69141L6.57812 11.5098L3.74121 7.98926C3.48828 7.68848 3.21484 7.55176 2.83203 7.55176C2.16895 7.55176 1.69043 8.02344 1.69043 8.66602C1.69043 8.95312 1.7793 9.20605 2.02539 9.48633L5.55273 13.7588C5.84668 14.1074 6.1748 14.2646 6.6123 14.2646Z"})})});var Le=o(485103),Me=o(560682),Be=o(80444),Ie=o(199953),De=o(601600),Re=o(973935),Ze=o(870279),Te=o(933709),_e=o(531701),Ae=o(627153),Ke=o(623063),Pe=o(164921),Fe=o(711059),Ve=o(938530),Ee=o(521899),ze=o(828992),Ue=o(66957),We=o(370345),Ne=o(370775);function Oe(e){let{reactionStores:t,initialIndex:o}=e;const[i,s]=n.useState(o),r=(0,h.useIntl)(),a=(0,d.VK)((()=>t.map((e=>e.getIcon()))),[t]),l=(0,d.VK)((()=>t[i].getActorStores().map((e=>({id:e.id,store:e,name:e.getDisplayName(r)}))).filter(ne.$K)),[t,i,r]);return(0,F.jsxs)(ce.Z,{menuType:he.og.ActionSheet,children:[(0,F.jsx)(Ue.Z,{tabStyle:{flex:1,justifyContent:"center",display:"flex",minWidth:60},tabs:a,selectedIndex:i,onChange:e=>s(e)}),l.map((e=>(0,F.jsx)(ze.ZP,{title:e.name,dontShrinkIcon:!0,icon:(0,F.jsx)(Ne.S,{authorStore:e.store,avatarSize:20,avatarStyle:{width:20,height:20},placeholderStyle:{width:20,height:20}})},e.id)))]})}function He(e){const t=(0,r.Fy)(),o=(0,d.VK)((()=>$.bh.getUserVisibleReactions(e.store)),[e.store]),i=(0,n.useRef)(null),s=(0,We.Z)({onLongPress:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.setOpen(!0)}});if(!t.isMobile)return(0,F.jsx)(F.Fragment,{children:e.children});const a=o.findIndex((t=>!e.reactionStore||t===e.reactionStore))??0;return(0,F.jsx)(ae.ZP,{ref:i,renderOrigin:()=>(0,F.jsx)("div",{...s,children:e.children}),popupType:t.isTablet?ae.Z4.Popup:ae.Z4.SlideUp,render:()=>(0,F.jsx)(Oe,{initialIndex:a,reactionStores:o})},e.store.id)}const $e=(0,h.defineMessages)({addReaction:{defaultMessage:"Add reaction",id:"ReactionBar.newReaction.ariaLabel"},resolveDiscussion:{defaultMessage:"Resolve",id:"ReactionBar.resolveDiscussion.ariaLabel"},emojiPickerTitle:{defaultMessage:"Reaction",id:"ReactionBar.emojiModalMenu.title"}});function Ge(){const{isMobile:e}=(0,r.Fy)();return(0,u.yK)((t=>({reaction:{display:"flex",margin:"1px",padding:"1px 6px 1px 6px",justifyContent:"center",alignItems:"center",gap:"4px",border:`1px solid ${t.regularDividerColor}`,borderRadius:"100px",fontSize:14,fontVariantNumeric:"tabular-nums",background:t.whiteButtonBackground,height:25},count:{color:t.mediumTextColor,fontSize:e?f.Z.fontSize.UISmall.mobile:f.Z.fontSize.UISmall.desktop},countReacted:{color:t.blueColor},reacted:{background:_e.ZP.blueWithAlpha(.08),border:`1px solid ${t.filterPillBorder}`,fontWeight:500},reactedHover:{background:_e.ZP.blueWithAlpha(.18)},emojiStyle:{color:"black",marginTop:.75},reactionIcon:{width:18,height:18,fill:t.mediumIconColor,marginTop:-.5,marginRight:1},dropShadow:{boxShadow:t.marginDiscussionSelectedShadow}})),[e])}function Xe(e){let{store:t,disabled:o,onClick:i,dropShadow:n}=e;const s=(0,d.VK)((()=>t.getActors()),[t]),a=(0,d.VK)((()=>t.getIcon()),[t]),l=Ge(),{currentUser:c}=(0,r.O7)();if(!s||!a)return null;if(0===s.length)return null;const u=s.some((e=>e.id===c.id)),m={...l.reaction,...u&&l.reacted,...n&&l.dropShadow},p={...l.count,...u&&l.countReacted};return(0,F.jsx)(w.Z,{textWrap:!0,style:{maxWidth:350,width:"max-content"},placement:U.u.Bottom,delayThreshold:300,renderTooltip:()=>(0,F.jsx)(qe,{store:t,icon:a}),render:e=>(0,F.jsxs)(Pe.Z,{disabled:o,style:m,hoveredStyle:u?l.reactedHover:void 0,onClick:i,...e,children:[(0,F.jsx)("span",{style:l.emojiStyle,children:(0,F.jsx)(Fe.Z,{size:14,char:a})}),(0,F.jsx)("span",{style:p,children:s.length})]})})}function qe(e){let{store:t,icon:o}=e;const i=(0,u.yK)((e=>({text:{color:e.mediumInvertedTextColor}})),[]),n=(0,h.useIntl)(),s=(0,d.VK)((()=>t.getActorStores()),[t]),r=(0,d.VK)((()=>s.map((e=>e.getDisplayName(n))).filter(ne.$K)),[s,n]);return r.length>5?(0,F.jsx)(h.FormattedMessage,{defaultMessage:"{additionalNames, plural, one {{names} and {additionalNames} other <medium>reacted with</medium> {icon}} other {{names} and {additionalNames} others <medium>reacted with</medium> {icon}}}",id:"ReactionBar.hoverTooltip.textAbbreviated",values:{additionalNames:r.length-5,names:r.slice(0,5).join(", "),medium:e=>(0,F.jsx)("span",{style:i.text,children:e}),icon:(0,F.jsx)(Fe.Z,{size:14,char:o})}}):(0,F.jsx)(h.FormattedMessage,{defaultMessage:"{numberOfNames, plural, one {{nameOrNames} <medium>reacted with</medium> {icon}} other {{nameOrNames} <medium>reacted with</medium> {icon}}}",id:"ReactionBar.hoverTooltip.text",values:{numberOfNames:r.length,nameOrNames:r.join(", "),medium:e=>(0,F.jsx)("span",{style:i.text,children:e}),icon:(0,F.jsx)(Fe.Z,{size:14,char:o})}})}function Je(e){const{store:t,discussionLocation:o,onEmojiSelection:i,style:s}=e,a=(0,r.O7)(),l=(0,n.useRef)(null),c=(0,r.Fy)(),d=(0,u.yK)((e=>({container:{padding:2,display:"flex",boxShadow:e.lightBoxShadow,backgroundColor:e.buttonGroupBackground,borderRadius:c.isMobile?3:4,...s},addIcon:{width:21,height:21,fill:e.icon.secondary},iconButton:{height:24,width:24,flex:"0 0 auto"}})),[c.isMobile,s]),m=(0,h.useIntl)();return(0,F.jsx)("div",{style:d.container,children:(0,F.jsx)(le.Z,{hasBackground:!0,ariaLabel:m.formatMessage($e.addReaction),showShadow:!1,icon:()=>(0,je.V)(d.addIcon),style:d.iconButton,ref:l,onClick:()=>Qe(a,m,t,null==l?void 0:l.current,o,i)})})}function Ye(e){let{store:t,discussionLocation:o,onEmojiSelection:i}=e;const s=(0,r.O7)(),a=(0,n.useRef)(null),l=Ge(),c=(0,h.useIntl)();return(0,F.jsx)(Pe.Z,{style:{...l.reaction,minWidth:"2em"},ref:a,onClick:()=>Qe(s,c,t,null==a?void 0:a.current,o,i),children:(0,je.V)(l.reactionIcon)})}function Qe(e,t,o,i,n,s){const r=Re.findDOMNode(i);if(!r)return;if(!(r instanceof Element))return;const a=r.getBoundingClientRect();Ae.$(e,{originGap:4,originRect:a,popupWidth:Ve.FZ,popupHeight:Ve.kX,isSmallWidth:!1,title:t.formatMessage($e.emojiPickerTitle),currentTab:"emoji",tabs:[{type:"emoji",title:(0,F.jsx)(h.FormattedMessage,{defaultMessage:"Emojis",id:"recordIcon.emojiTab.title"}),hideRandomButton:!0,onChange:(t,i)=>{s&&s(),C.createAndCommit({environment:e,userAction:"Comment.toggleReactionFromMenu",perform:s=>{Ee.toggleReaction({environment:e,transaction:s,store:o,icon:t,discussionLocation:n}),i&&i.keepVisible||Ae.Z()}})}}]})}function et(e){const{parentStore:t,discussionLocation:o,onReact:i,focused:s}=e,[a,l]=(0,n.useState)(!1),c=(0,u.yK)((e=>({reactionIcon:{height:21,width:21,fill:e.mediumIconColor},resolveIcon:{height:16,width:16,fill:e.mediumIconColor},container:{gap:"4px",marginTop:"12px",display:"flex",flexWrap:"wrap",willChange:"transform",transition:"transform 200ms ease",transformOrigin:"center left",transform:s?"scale3d(1.05)":"scale(1)"},reactionItem:{display:"flex",flexDirection:"row"},actionButton:{borderRadius:"50%",marginLeft:2}})),[s]),m=e=>{C.createAndCommit({userAction:"Discussion.handleResolve",environment:f,perform:e=>{(0,Ie.D)({environment:f,discussionStore:t,transaction:e,discussionLocation:o})}}),x.Xv(),null==e||e.stopPropagation()},p=(0,d.VK)((()=>t.canComment()),[t]),g=(0,d.VK)((()=>t.canEdit()),[t]),f=(0,r.O7)(),v=(0,n.useRef)(null),S=(0,h.useIntl)(),b=a||e.focused,y=(0,d.VK)((()=>$.bh.getUserVisibleReactions(t)),[t]),j=e=>()=>{e.isDefined()&&(null==i||i(),C.createAndCommit({environment:f,userAction:"Comment.toggleReaction",perform:i=>{Ee.toggleReaction({environment:f,transaction:i,store:t,icon:e.getIcon(),discussionLocation:o})}}))},k=()=>{Qe(f,S,t,null==v?void 0:v.current,o,i)};return(0,F.jsx)("div",{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:c.container,children:y.map(((o,i)=>(0,F.jsxs)("div",{style:c.reactionItem,children:[(0,F.jsx)(He,{reactionStore:o,store:t,children:(0,F.jsx)(Xe,{dropShadow:e.focused&&!e.disableShadow,disabled:!p,store:o,onClick:j(o)})}),i===y.length-1&&(0,F.jsx)(Ke.Z,{isVisible:!0,animationStyle:{opacity:b?1:0,marginLeft:2},render:()=>(0,F.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[p&&(0,F.jsx)(He,{store:t,children:(0,F.jsx)(w.Z,{renderTooltip:()=>(0,F.jsx)(h.FormattedMessage,{...$e.addReaction}),render:e=>(0,F.jsx)(le.Z,{style:c.actionButton,hasBackground:!1,showShadow:!1,ref:v,icon:()=>(0,je.V)(c.reactionIcon),onClick:k,...e,ariaLabel:S.formatMessage($e.resolveDiscussion)})})}),g&&(0,F.jsx)(w.Z,{renderTooltip:()=>(0,F.jsx)(h.FormattedMessage,{...$e.resolveDiscussion}),render:e=>(0,F.jsx)(le.Z,{style:{borderRadius:"50%",marginLeft:4},hasBackground:!1,showShadow:!1,icon:()=>ke(c.resolveIcon),onClick:m,...e,ariaLabel:S.formatMessage($e.resolveDiscussion)})})]})})]},o.id)))})}const tt=function(e){const{parentStore:t,discussionLocation:o,onReactionToggle:i,newReactionStyle:n}=e,s=(0,d.VK)((()=>t.canComment()),[t]),a=(0,d.VK)((()=>$.bh.getUserVisibleReactions(t)),[t]),l=(0,r.O7)(),c=(0,d.VK)((()=>{if(t.table===Ze.x_){const e=t.getParentBlockStore();return Boolean(e&&e.pathIsDead())}if(t.table===Te.qF){const e=t.getParentStore();return Boolean(e&&e.pathIsDead())}return!1}),[t]),u=s&&!c&&a.length>0,m=s&&!c&&0===a.length;return(0,F.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px"},children:[a.map((e=>(0,F.jsx)(He,{reactionStore:e,store:t,children:(0,F.jsx)(Xe,{disabled:!s||c,store:e,onClick:()=>{if(e.isDefined()){const n=C.createAndCommit({environment:l,userAction:"Comment.toggleReaction",perform:i=>Ee.toggleReaction({environment:l,transaction:i,store:t,icon:e.getIcon(),discussionLocation:o})});void 0!==n.performResult&&i&&i(n.performResult)}}})},e.id))),u&&(0,F.jsx)(He,{store:t,children:(0,F.jsx)(Ye,{store:t,discussionLocation:o,onEmojiSelection:void 0!==i?()=>i("Added"):void 0})}),m&&(0,F.jsx)(Je,{store:t,discussionLocation:o,onEmojiSelection:void 0!==i?()=>i("Added"):void 0,style:n})]})},ot=(0,h.defineMessages)({addReaction:{id:"comment.actions.addReaction.label",defaultMessage:"Add reaction"},acceptButton:{id:"comment.actions.acceptButton.label",defaultMessage:"Accept"},rejectButton:{id:"comment.actions.rejectButton.label",defaultMessage:"Reject"},moreActions:{id:"comment.actions.moreActions.label",defaultMessage:"More actions"},reopenButton:{id:"comment.actions.reopenButton.label",defaultMessage:"Re-open"},resolveButton:{id:"comment.actions.resolveButton.label",defaultMessage:"Resolve"}});function it(e){const{discussionLocation:t}=e,o=(0,h.useIntl)(),i=(0,r.O7)(),s=i.device,a=(0,n.useRef)(null),c=(0,l.l)(),u=(0,d.VK)((()=>Boolean(e.discussionStore.getResolved())),[e.discussionStore]),p=(0,d.VK)((()=>e.store.isDefined()),[e.store]),g=(0,d.VK)((()=>{var e;return null===(e=Be.default.state.currentUserStore)||void 0===e?void 0:e.id}),[]),f=(0,d.VK)((()=>{const t=e.store.getCreatedById();return e.store.getCreatedByTable()===oe.KJ&&g===t}),[g,e.store]),v=(0,d.VK)((()=>{var e;const t=null===(e=Be.default.state.currentSpaceStore)||void 0===e?void 0:e.getRole();return t&&m.zz(t)}),[]),S=(0,d.VK)((()=>e.blockStore.getRole()),[e.blockStore]),b=(0,d.VK)((()=>{var e;return null==c||null===(e=c.publicEditModeStore.state)||void 0===e?void 0:e.permission}),[null==c?void 0:c.publicEditModeStore]),{isFirstCommentOfSuggestionDiscussion:y,disableAccept:j}=(0,d.VK)((()=>{var t;const o="suggestion"===e.discussionStore.getType()&&e.discussionStore.getCommentPointers()[0].id===e.store.id,i=(null===(t=e.blockStore.getNavigableBlockStore({skipCurrent:!0}))||void 0===t?void 0:t.canEdit())??!1;return{isFirstCommentOfSuggestionDiscussion:o,disableAccept:o&&!i}}),[e.discussionStore,e.blockStore,e.store]),w=(0,d.VK)((()=>e.blockStore.pathIsDead()),[e.blockStore]),k="comment_only"===S||"comment"===b;if(!p||!g)return null;const L=()=>{C.createAndCommit({userAction:"Comment.handleReopen",environment:i,perform:t=>{G.bh({environment:i,commentStore:e.store,discussionStore:e.discussionStore,transaction:t,discussionLocation:e.discussionLocation})}})},M=t=>{C.createAndCommit({userAction:"Comment.handleResolve",environment:i,perform:t=>{(0,Ie.D)({environment:i,commentStore:e.store,discussionStore:e.discussionStore,transaction:t,discussionLocation:e.discussionLocation})}}),x.Xv(),null==t||t.stopPropagation()},B=()=>{C.createAndCommit({userAction:"Suggestion.handleAccept",environment:i,perform:t=>{De.Yo({action:"accept",environment:i,commentStore:e.store,discussionStore:e.discussionStore,transaction:t,discussionLocation:e.discussionLocation,currentPageStore:fe.fM(e.discussionStore)})}}),x.Xv()},I=()=>{C.createAndCommit({userAction:"Suggestion.handleReject",environment:i,perform:t=>{De.Yo({action:"reject",environment:i,commentStore:e.store,discussionStore:e.discussionStore,transaction:t,discussionLocation:e.discussionLocation,currentPageStore:fe.fM(e.discussionStore)})}}),x.Xv()},D=()=>{var t,o;const n=e.store.getParentStore();if(!n||null==n||!n.isDefined())return null;let s=n.getParentStore();if(null===(t=s)||void 0===t||!t.isDefined())return null;var r;s.getType()===te.Ti.tableRow&&(s=null===(r=s)||void 0===r?void 0:r.getParentBlockStore());if(null===(o=s)||void 0===o||!o.isDefined())return null;const a=s.getModel().getRenderUrl({baseUrl:pe.default.domainBaseUrl,getRecordModel:e.store.getRecordModel,discussionId:n.id,pageVisitSource:ee.tY.CopyLink});se.RD({environment:i,stringValue:a,copiedMessage:se.tq.copiedLinkToClipboard})};if(!i.currentUser.isLoggedIn())return null;const R=S&&m.rz(S)||w;if(R)return null;const Z=e.isFirstComment&&"comment_unfurl"!==t&&!s.isMobile&&!k&&!R,T=[];!s.isMobile||k||R||(u?T.push("reopen"):T.push("resolve")),!y&&f&&T.push("edit"),e.isFirstComment&&T.push("copyLink"),y||!f&&!v||T.push("delete");const _=T.length>0;return _||Z||e.canShowReactions?(0,F.jsx)(ae.ZP,{ref:a,popupType:s.isMobile?ae.Z4.SlideUp:ae.Z4.Popup,buttonPopupStore:e.buttonPopupStore,placementToOrigin:ae.pO.Right,stopClickPropagation:!0,renderOrigin:n=>(0,F.jsx)(rt,{buttonConfig:{resolve:{visible:Z&&!y,resolved:u,onResolve:M,onReopen:L},react:{visible:e.canShowReactions,onReact:()=>{var n;Qe(i,o,e.store,(null===(n=a.current)||void 0===n?void 0:n.getAnchor())??null,t,e.handleReaction)}},accept:{visible:y&&!j&&!u,onAccept:B},reject:{visible:y&&!u&&(!k||f),onReject:I},moreActions:{visible:_}},visible:e.visible,buttonPopupEvents:n,discussionLocation:e.discussionLocation,store:e.store}),render:t=>{let o;o=s.isMobile?{menuType:he.og.ActionSheet}:{menuType:he.og.Popup};const i=T.map((t=>"reopen"===t?{key:"reopen",render:e=>(0,F.jsx)(re.Z,{...e,icon:(0,ve.V)({height:16,width:16}),title:(0,F.jsx)(h.FormattedMessage,{id:"comment.reopenDiscussion.button",defaultMessage:"Re-open discussion"})}),action:L}:"resolve"===t?{key:"resolve",render:e=>(0,F.jsx)(re.Z,{...e,icon:(0,Le.k)({height:16,width:16}),title:(0,F.jsx)(h.FormattedMessage,{id:"comment.resolveDiscussion.button",defaultMessage:"Resolve comments"})}),action:()=>M()}:"edit"===t?{key:"edit",render:e=>(0,F.jsx)(re.Z,{...e,icon:(0,Ce.R)({height:16,width:16}),title:(0,F.jsx)(h.FormattedMessage,{id:"comment.editComment.button",defaultMessage:"Edit comment"})}),action:e.handleEditComment}:"delete"===t?{key:"delete",render:e=>(0,F.jsx)(re.Z,{...e,icon:(0,Me.y)({height:16,width:16}),title:(0,F.jsx)(h.FormattedMessage,{id:"comment.deleteComment.button",defaultMessage:"Delete comment"})}),action:e.handleDeleteComment}:"copyLink"===t?{key:"copyLink",render:e=>(0,F.jsx)(re.Z,{...e,icon:(0,ye.N)({height:16,width:16}),title:(0,F.jsx)(h.FormattedMessage,{id:"comment.copyLinkToDiscussion.button",defaultMessage:"Copy link to discussion"})}),action:D}:void(0,ne.t1)(t)));return(0,F.jsx)("div",{className:ge.G6g,children:(0,F.jsxs)(ce.Z,{...o,children:[(0,F.jsx)(de.Z,{type:de.i.Vertical,initialFocus:void 0,onAccept:t.close,sections:ie.oA([i.length&&{key:0,render:e=>(0,F.jsx)(ue.Z,{...e}),items:i}])}),!s.isMobile&&(0,F.jsx)(ue.Z,{topBorder:!0,disableDesktopPadding:!1,children:(0,F.jsx)(me.Z,{title:(0,F.jsx)(h.FormattedMessage,{defaultMessage:"Learn about comments",id:"comments.learn"}),href:(0,xe.UY)("guides.comments"),analyticsFrom:"comments"})})]})})}}):null}function nt(e){return"accept"in e}function st(e){return"resolve"in e}function rt(e){const{buttonPopupEvents:t,buttonConfig:o}=e,i=(0,r.O7)().device,n=(0,h.useIntl)(),s=(0,u.yK)((t=>({addIcon:{height:21,width:21,fill:t.mediumIconColor},container:{display:"flex",boxShadow:"0px 2px 12px 0px rgba(29, 27, 22, 0.06)",borderWidth:1,borderStyle:"solid",borderColor:t.stroke.deemphasized,position:"absolute",flexShrink:0,padding:"2px",backgroundColor:t.buttonGroupBackground,right:0,...i.isMobile?{borderRadius:6,top:-3}:{marginRight:0,marginTop:"updates_sidebar"===e.discussionLocation?6:0,opacity:e.visible?1:0,gap:1,borderRadius:6,transition:"opacity 100ms ease-out",zIndex:1,top:-4}}})),[i.isMobile,e.discussionLocation,e.visible]);return(0,F.jsxs)("div",{style:s.container,children:[nt(o)&&o.accept.visible&&(0,F.jsx)(w.Z,{renderTooltip:()=>(0,F.jsx)(h.FormattedMessage,{...ot.acceptButton}),render:e=>(0,F.jsx)(le.Z,{hasBackground:!1,showShadow:!1,icon:ke,onClick:o.accept.onAccept,ariaLabel:n.formatMessage(ot.acceptButton),...e})}),nt(o)&&o.reject.visible&&(0,F.jsx)(w.Z,{renderTooltip:()=>(0,F.jsx)(h.FormattedMessage,{...ot.rejectButton}),render:e=>(0,F.jsx)(le.Z,{hasBackground:!1,showShadow:!1,icon:Se.D,onClick:o.reject.onReject,iconStyle:{height:18,width:18},ariaLabel:n.formatMessage(ot.rejectButton),...e})}),o.react.visible&&(0,F.jsx)(w.Z,{renderTooltip:()=>(0,F.jsx)(h.FormattedMessage,{...ot.addReaction}),render:e=>(0,F.jsx)(le.Z,{ariaLabel:n.formatMessage(ot.addReaction),hasBackground:!1,showShadow:!1,icon:()=>(0,je.V)(s.addIcon),onClick:o.react.onReact,...e})}),st(o)&&o.resolve.visible&&(0,F.jsx)(w.Z,{renderTooltip:()=>(0,F.jsx)(h.FormattedMessage,{...o.resolve.resolved?ot.reopenButton:ot.resolveButton}),render:e=>(0,F.jsx)(le.Z,{hasBackground:!1,showShadow:!1,icon:o.resolve.resolved?we:ke,onClick:o.resolve.resolved?o.resolve.onReopen:o.resolve.onResolve,...e,ariaLabel:n.formatMessage(o.resolve.resolved?ot.reopenButton:ot.resolveButton)})}),o.moreActions.visible&&(0,F.jsx)(w.Z,{renderTooltip:()=>(0,F.jsx)(h.FormattedMessage,{...ot.moreActions}),render:e=>(0,F.jsx)(le.Z,{...t,...e,hasBackground:!1,showShadow:!1,icon:be.o,ariaLabel:n.formatMessage(ot.moreActions)})})]})}var at=o(631781),lt=o(959062),ct=o(27411),dt=o(369721),ut=o(543803);const mt=3;function pt(e){let{stores:t,collapsed:o,shouldShowGrayFogInScroller:i,onRemoveBlockFromComment:n}=e;return 0===t.length?null:t.length<=mt?(0,F.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.map((e=>(0,F.jsx)(dt.Z,{store:e,disabled:!1,commentProps:{shouldHideBlockActionMenu:o,onRemoveBlockFromComment:n}},e.id)))}):(0,F.jsx)(ut.Z,{shouldShowGrayFog:i,children:t.map((e=>(0,F.jsx)(dt.Z,{store:e,disabled:!1,commentProps:{shouldHideBlockActionMenu:o,onRemoveBlockFromComment:n}},e.id)))})}var gt=o(311712);const ht=3,ft=4;function xt(e){let{stores:t,embedBlockLocation:o,onRemoveContent:i}=e;if(0===t.length)return null;if(t.length<=ht)return(0,F.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.map((e=>(0,F.jsx)(vt,{store:e,embedBlockLocation:o,onRemoveContent:i,isLarge:!0},e.id)))});if(t.length<=ft)return(0,F.jsx)("div",{style:{display:"flex",gap:4},children:t.map((e=>(0,F.jsx)(vt,{store:e,embedBlockLocation:o,onRemoveContent:i,isLarge:!1},e.id)))});const n=t.slice(0,ft-1),s=t[ft-1],r=t.length-ft+1,a=t.slice(ft);return(0,F.jsxs)("div",{style:{display:"flex",gap:4},children:[n.map((e=>(0,F.jsx)(vt,{store:e,embedBlockLocation:o,onRemoveContent:i,isLarge:!1},e.id))),(0,F.jsxs)("div",{children:[(0,F.jsx)(Pe.Z,{style:{position:"absolute",zIndex:1,width:48,height:48,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0, 0, 0, 0.4)",borderRadius:8,color:"white",fontWeight:f.Z.fontWeight.bold},hoveredStyle:{background:"rgba(0, 0, 0, 0.4)"},pressedStyle:{background:"rgba(0, 0, 0, 0.4)"},onClick:()=>{gt.dK({blocks:[s]})},children:`+${r}`}),(0,F.jsx)(vt,{store:s,embedBlockLocation:o,onRemoveContent:i,isLarge:!1},s.id)]}),(0,F.jsx)("div",{style:{display:"none"},children:a.map((e=>(0,F.jsx)(vt,{store:e,embedBlockLocation:o,onRemoveContent:i,isLarge:!1},e.id)))})]})}function vt(e){let{store:t,isLarge:o,embedBlockLocation:i,onRemoveContent:n}=e;const s=(0,u.yK)((e=>({imageShared:{border:`1px solid ${e.stroke.deemphasized}`,borderRadius:8,cursor:"zoom-in"}})),[]);return(0,F.jsx)(lt.ZP,{store:t,blockLocation:i,disabled:!1,disableDrag:!0,disableResizers:!0,preserveScale:!0,inlineContentStyle:{...s.imageShared,...o?St:bt},disableActions:!o,onRemoveBlockFromComment:o?n:void 0},t.id)}const St={objectFit:"contain",width:"auto",height:"auto",maxWidth:240,maxHeight:240,minWidth:48,minHeight:48},bt={width:48,height:48,minWidth:48,minHeight:48};var yt=o(568785),Ct=o(532854);function jt(e){let{store:t}=e;const o=(0,d.VK)((()=>ct.default.getKeyState(ct.default.getBlockKey(t.id))),[t.id]),i=(0,h.useIntl)(),n=(0,u.yK)((e=>({wrapper:{height:48,width:214,display:"flex",alignItems:"center",background:"white",border:`1px solid ${e.regularDividerColor}`,borderRadius:12,padding:"8px 10px 8px 8px",gap:8},icon:{background:e.tint.regular,borderRadius:6,width:32,minWidth:32,height:32,display:"flex",alignItems:"center",justifyContent:"center"},fileDetails:{display:"flex",flexDirection:"column"},fileName:{fontSize:14,fontWeight:f.Z.fontWeight.medium,lineHeight:"18px",color:e.text.primary,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},fileSizeText:{color:e.text.secondary},progressText:{color:e.text.tertiary},sizeAndProgressContainer:{display:"flex",alignItems:"center",gap:4,fontSize:12,lineHeight:"15px"}})),[]);if(!o)return(0,F.jsxs)("div",{style:n.wrapper,children:[(0,F.jsx)("div",{style:n.icon,children:(0,F.jsx)(yt.Z,{})}),(0,F.jsx)("div",{style:n.fileDetails,children:(0,F.jsx)("div",{style:n.fileName,children:i.formatMessage({id:"commentFilePlaceholder.loading",defaultMessage:"Loading..."})})})]});const{name:s,size:r,progressPercent:a}=o;return(0,F.jsxs)("div",{style:n.wrapper,children:[(0,F.jsx)("div",{style:n.icon,children:(0,F.jsx)(yt.Z,{})}),(0,F.jsx)("div",{style:{overflow:"hidden"},children:(0,F.jsxs)("div",{style:n.fileDetails,children:[(0,F.jsx)("div",{style:n.fileName,children:s}),(0,F.jsxs)("div",{style:n.sizeAndProgressContainer,children:[(0,F.jsx)("span",{style:n.fileSizeText,children:(0,J.formatFileSize)(r)}),(0,F.jsx)("span",{style:n.progressText,children:"—"}),(0,F.jsx)(yt.Z,{}),(0,F.jsx)(Ct.Z,{percentage:a,style:n.progressText})]})]})})]})}function wt(e){let{stores:t}=e;return 0===t.length?null:(0,F.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.map((e=>(0,F.jsx)(jt,{store:e},e.id)))})}function kt(e){const t=e.discussionFormat===J.DiscussionFormat.Sidebar?at.vW.SidebarComment:at.vW.PageComment,{uploading:o,images:i,embeds:n,files:s}=(0,d.VK)((()=>{const[t,o]=ie.uK(e.contentStores,(e=>{const t=Boolean(ct.default.getKeyState(ct.default.getBlockKey(e.id))),o=(0,lt.lI)(e);return t||!o})),[i,n]=ie.uK(o,(e=>e.getType()===te.Ti.image)),[s,r]=ie.uK(n,(e=>"video"===e.getType()));return{uploading:t,images:i,embeds:s,files:r}}),[e.contentStores]);return 0===o.length&&0===i.length&&0===n.length&&0===s.length?null:(0,F.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,marginTop:8},children:[(0,F.jsx)(wt,{stores:o}),(0,F.jsx)(xt,{stores:i,embedBlockLocation:t,onRemoveContent:e.onRemoveContent}),n.length>0&&(0,F.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:n.map((o=>(0,F.jsx)(lt.ZP,{store:o,blockLocation:t,disabled:!1,disableDrag:!0,disableResizers:!0,preserveScale:!0,inlineContentStyle:{},onRemoveBlockFromComment:e.onRemoveContent},o.id)))}),(0,F.jsx)(pt,{stores:s,collapsed:e.collapsed,shouldShowGrayFogInScroller:e.discussionHovered&&(e.discussionFormat===J.DiscussionFormat.Margin||e.discussionFormat===J.DiscussionFormat.Sidebar),onRemoveBlockFromComment:e.onRemoveContent})]})}function Lt(){const e=(0,u.yK)((e=>({newBarLine:{height:"0px",borderBottom:`1px solid ${e.darkDividerColor}`,width:"100%",marginLeft:0},newBarWrapper:{color:e.mediumTextColor,textTransform:"uppercase",fontSize:10.5,letterSpacing:.5,fontWeight:f.Z.fontWeight.semibold,display:"flex",alignItems:"center",margin:0,paddingTop:10,paddingBottom:10,paddingLeft:q.yx},newBarText:{padding:"0 10px",whiteSpace:"nowrap"},threadLine:{position:"absolute",backgroundColor:e.stroke.deemphasized,width:q.Ky,height:"100%",borderRadius:2,left:q.fT,top:-6}})),[]);return(0,F.jsxs)("div",{style:{position:"relative"},children:[(0,F.jsx)("div",{style:e.threadLine}),(0,F.jsxs)("div",{style:e.newBarWrapper,children:[(0,F.jsx)("div",{style:e.newBarLine}),(0,F.jsx)("div",{style:e.newBarText,children:(0,F.jsx)(h.FormattedMessage,{id:"comment.newIndicator.label",defaultMessage:"New comments"})}),(0,F.jsx)("div",{style:e.newBarLine})]})]})}var Mt=o(742438);const Bt=function(e){const{store:t,discussionContext:o,maxLines:i,discussionLocation:P,shouldShowThreadLine:ee,discussionStore:te,blockStore:oe}=e,ie=(0,r.O7)(),ne=(0,h.useIntl)(),[se,re]=(0,n.useState)(!1),[ae,le]=(0,n.useState)(!1),[ce,de]=(0,n.useState)(!1),ue=(0,d.VK)((()=>e.store.isDefined()?new Y.Z(ie,e.store.getSpaceId()):void 0),[ie,e.store]),me=(0,d.VK)((()=>T.le(e.store).filter((e=>(0,$.Vh)(e,{table:p.iU,id:e.id},"alive").getValue()))),[e.store]),pe=(0,d.VK)((()=>e.discussionStore.getResolved()),[e.discussionStore]),ge=(0,d.VK)((()=>null==ue?void 0:ue.state.files),[ue]),he=(0,d.VK)((()=>null==ue?void 0:ue.state.textStore),[ue]),fe=(0,n.useCallback)((e=>{const t=e.target;t instanceof HTMLElement&&(0,a.E)(t)&&le(!0)}),[]),xe=(0,n.useCallback)((()=>{le(!1)}),[]),ve=(0,n.useCallback)((()=>{H.Z.state||de(!0)}),[]),Se=(0,n.useCallback)((()=>{de(!1)}),[]),be=(0,l.l)(),ye=(0,d.qz)(void 0,N.Z),Ce=(0,d.VK)((()=>ye.state.open),[ye]),je=(0,E.L2)(e.blockStore),we=(0,d.VK)((()=>{const t=e.discussionStore.getComments();return Boolean(t&&t[0]===e.store.id)}),[e.discussionStore,e.store.id]),ke=(0,d.VK)((()=>{var t;const o=e.blockStore.getRole(),i=we&&"comment_unfurl"!==P,n=e.blockStore.pathIsDead(),s=o&&m.rz(o)||n,{device:r}=ie,a="comment_only"===o||be&&"comment"===(null===(t=be.publicEditModeStore.state)||void 0===t?void 0:t.permission),l=i&&!r.isMobile&&!a&&!s;return ce||ae||e.hoveringDiscussion&&i||Ce||r.isMobile||e.showResolveButtonByDefaultIfPossible&&l}),[e.blockStore,e.hoveringDiscussion,e.showResolveButtonByDefaultIfPossible,we,P,ie,be,ce,ae,Ce]),Le=(0,n.useContext)(R.Ue),Me=(0,d.VK)((()=>{const e=t.getCreatedByPointer();return e?{createdByPointer:e,lastEditedTime:t.getLastEditedTime(),createdTime:t.getCreatedTime(),text:t.getText(),reactions:$.bh.getUserVisibleReactions(t)}:null}),[t]),Be=(0,d.VK)((()=>{if(!Me)return null;const e=$.t1.createChildStore(t,Me.createdByPointer);return{displayName:e.getDisplayName(ne),store:e}}),[Me,ne,t]),Ie=(0,d.VK)((()=>(0,Z.En)()),[]),De=(0,d.VK)((()=>"on"===O.default.getEligibleGroup({experimentId:"dcu_allow_actions_while_commenting",defaultGroup:"control",disableExposureLogging:!0})),[]),Re=(0,n.useCallback)((()=>{C.createAndCommit({userAction:"Comment.deleteComment",environment:ie,perform:t=>{G.YF({environment:ie,commentStore:e.store,transaction:t,discussionLocation:P})},skipUpdatingEditedMetadata:!0})}),[ie,e.store,P]),Ze=(0,n.useCallback)((async()=>{await v.confirmUserAction({message:(0,F.jsx)(h.FormattedMessage,{defaultMessage:"Would you like to delete this comment?",id:"comment.confirmDialog.deleteComment.prompt"}),acceptLabel:(0,F.jsx)(h.FormattedMessage,{defaultMessage:"Delete",id:"comment.confirmDialog.deleteComment.deleteButton.label"})})&&(Re(),x.Xv(),De&&Q.Z.state.overlapsExistingDiscussionMenu&&!W.Z.state.open&&Q.Z.setState({...Q.Z.state,overlapsExistingDiscussionMenu:!1}),X.Cd(ie))}),[De,Re,ie]),Te=(0,n.useCallback)((async t=>{const o=T.zP(e.store).getValue(),i=T.le(e.store).filter((e=>e.id!==t.id)),n=o&&o.length>0,s=0===i.length;!n&&s?(await Ze(),re(!1)):C.createAndCommit({userAction:"Comment.handleRemoveFileFromActions",environment:ie,perform:o=>{G.Zo({commentStore:e.store,fileBlocks:[t],transaction:o})}})}),[ie,Ze,e.store]),_e=(0,n.useCallback)((()=>{Ve.current&&S.bx({element:Ve.current,scrollers:{verticalScroller:null==Le?void 0:Le.verticalScroller},vertical:{reveal:"closest"},horizontal:void 0,animate:!0})}),[Le]),Ae=(0,n.useCallback)((async()=>{if(!ue)return;const t=T.zP(e.store).getValue()||[],o=ue.state.textStore;C.createAndCommit({userAction:"Comment.handleEditComment",environment:ie,perform:e=>{b.sO({environment:ie,store:o,value:t,transaction:e})}}),re(!0),await s.default.afterNextFlush(),await s.default.afterNextFlush(),y.setSelectionAtEnd({store:o})}),[ue,ie,e.store]),Ke=(0,n.useCallback)((async()=>{if(!ue)return!1;if(!(0,J.hasCommentChanged)(ue,e.store))return re(!1),!0;if(await v.confirmUserAction({message:(0,F.jsx)(h.FormattedMessage,{defaultMessage:"Do you want to discard this edit?",id:"comment.confirmDialog.discardEdit.prompt"}),acceptLabel:(0,F.jsx)(h.FormattedMessage,{defaultMessage:"Discard",id:"comment.confirmDialog.discardEdit.discardButton.label"})}))return re(!1),!0;return!1}),[ue,e.store]),Pe=(0,n.useCallback)((async()=>{const t=null==he?void 0:he.getValue();t&&t.length>0||ge&&ge.length>0?C.createAndCommit({userAction:"Comment.handleSubmitEdit",environment:ie,perform:o=>{G.DF({environment:ie,store:e.store,text:t||[],transaction:o,discussionLocation:P,files:ge||[],property_id:te.getPropertyId(),blockStore:oe})}}):await Ze(),re(!1)}),[he,ge,ie,e.store,P,te,oe,Ze]),Fe=(0,n.useRef)(null),Ve=(0,n.useRef)(null);(0,c.c)(z.Z,(()=>({edit:Ae,handleCancelEdit:Ke,getNode:()=>Fe.current,isEditing:()=>se,discussionLocation:P,commentId:e.store.id})),[Ae,Ke,se,P,e.store.id]);const Ee=q.IX,ze=null==Me?void 0:Me.text,Ue=void 0!==ze&&ze.length>0&&g.VrM(ze)>0,We=Ue&&(0,J.isCommentAllEmojis)(ze),Oe=function(e){let{discussionLocation:t,isAllEmojis:o,avatarSize:i}=e;return(0,u.yK)((e=>({container:{flexGrow:"comment_unfurl"===t?1:void 0,paddingTop:"comment_unfurl"===t?q.tD:q.En,paddingRight:"margin_comments"===t?12:16,paddingBottom:q.rb,paddingLeft:q.vi(t)},comment:{position:"relative",fontSize:14},commentElementsBelowUserRow:{paddingLeft:q.yx},avatar:{marginTop:0,marginRight:8,userSelect:"none",WebkitUserSelect:"none"},avatarSuggestionBadge:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center",borderRadius:100,background:"light"===e.mode?"#fff":"#000",width:16,height:16,border:`1px solid ${e.accentColors.uiBlue[200]}`,fill:e.accentColors.uiBlue[600]},avatarSuggestionBadgeBacking:{position:"absolute",width:"100%",height:"100%",borderRadius:100,background:e.accentColors.uiBlue[100]},threadLine:{position:"absolute",backgroundColor:e.stroke.deemphasized,borderRadius:2,width:q.Ky,height:q.bd,left:q.fT,top:q.aH},userRow:{display:"flex",flexDirection:"row",alignItems:"center",userSelect:"none",WebkitUserSelect:"none"},placeholder:{height:8,width:81,borderRadius:6,background:e.lightDividerColor},unfurlMoreWrapper:{color:e.lightTextColor,fontWeight:"comment_unfurl"===t?f.Z.fontWeight.medium:void 0,display:"block",marginBottom:-1.5,pointerEvents:"auto"},attachIcon:{width:18,height:18,fill:e.mediumIconColor},text:{cursor:"comment_unfurl"!==t?"text":void 0,...o?{fontSize:32}:{},lineHeight:"20px",paddingTop:4},attachmentContainer:{display:"flex",alignItems:"center"},timestamp:{margin:"0 6px",flexBasis:"comment_unfurl"!==t?140:void 0,whiteSpace:"normal",flexGrow:"updates_sidebar"===t||"comment_unfurl"===t?void 0:1,display:"inline",color:e.text.tertiary},commentAttachment:{},commentAuthorPlaceholder:{marginRight:8,marginTop:"comment_unfurl"===t?14:2,height:i,width:i,borderRadius:20,flexShrink:0}})),[t,o,i])}({discussionLocation:P,isAllEmojis:We,avatarSize:Ee}),He=(0,n.useMemo)((()=>({type:"comment_match",commentId:e.store.id})),[e.store.id]);if(!ue)return null;if(!Me||!Be)return null;const $e="comment_unfurl"!==P;let Ge,Xe;Me.lastEditedTime&&Me.lastEditedTime>Me.createdTime+100?(Ge=(0,F.jsx)(h.FormattedMessage,{defaultMessage:"{lastEditedTime} (edited)",id:"comment.editedAtTime.label",values:{lastEditedTime:(0,_.IS)(Me.lastEditedTime,{useUltraCompactFormat:!0})}}),Xe=(0,_.uy)(Me.lastEditedTime)):(Ge=(0,_.IS)(Me.createdTime,{useUltraCompactFormat:!0}),Xe=(0,_.uy)(Me.createdTime));const qe=me.length>0&&(0,F.jsx)("div",{style:Oe.commentAttachment,children:(0,F.jsx)(kt,{contentStores:me,onRemoveContent:Te,discussionFormat:(0,J.discussionLocationToDiscussionFormat)(P),collapsed:e.collapsed,discussionHovered:e.hoveringDiscussion})});return(0,F.jsxs)("div",{ref:Fe,onClick:e=>se&&e.stopPropagation(),style:Oe.container,children:[e.showNewBar&&(0,F.jsx)(Lt,{}),(0,F.jsxs)("div",{style:Oe.comment,onFocus:fe,onBlur:xe,onMouseMove:ve,onMouseLeave:Se,children:[(0,F.jsxs)("div",{style:Oe.userRow,children:[e.isSuggestionComment?(0,F.jsxs)("div",{style:{position:"relative"},children:[(0,F.jsx)(Ne.S,{authorStore:null==Be?void 0:Be.store,avatarSize:Ee,avatarStyle:Oe.avatar,placeholderStyle:Oe.commentAuthorPlaceholder}),(0,F.jsx)("div",{style:{position:"absolute",right:4,bottom:-4},children:(0,F.jsxs)("div",{style:Oe.avatarSuggestionBadge,children:[V({height:8.5}),(0,F.jsx)("div",{style:Oe.avatarSuggestionBadgeBacking})]})})]}):(0,F.jsx)(Ne.S,{authorStore:null==Be?void 0:Be.store,avatarSize:Ee,avatarStyle:Oe.avatar,placeholderStyle:Oe.commentAuthorPlaceholder}),(0,F.jsxs)("div",{style:{overflow:"hidden"},children:[(0,F.jsx)("span",{style:{fontWeight:f.Z.fontWeight.medium,whiteSpace:"normal"},children:Ie?(0,F.jsx)(w.Z,{renderTooltip:()=>Be&&Be.store instanceof $.U6?(0,F.jsx)(I.Z,{targetUserStore:Be.store}):null,placement:U.u.Top,alignment:U.v.End,render:e=>(0,F.jsx)("span",{...e,children:Be.displayName}),delayThreshold:600,allowHover:!0,closeDelay:1500,isLightBackground:!0}):Be.displayName||(0,F.jsx)("span",{style:Oe.placeholder})}),(0,F.jsx)(k.Z,{isSmall:!0,isSecondaryColor:!0,isMultiline:!0,style:Oe.timestamp,children:(0,F.jsx)(M.Z,{text:Ge,tooltipText:Xe,icon:K.C})}),"comment_unfurl"===P&&pe&&(0,F.jsx)("div",{style:{display:"inline-flex"},children:(0,F.jsx)(j.Z,{children:(0,F.jsx)(h.FormattedMessage,{id:"comment.unfurl.resolvedStatus",defaultMessage:"Resolved"})})})]})]}),ee&&(0,F.jsx)("div",{style:Oe.threadLine}),(0,F.jsxs)("div",{style:Oe.commentElementsBelowUserRow,children:[Boolean(o)&&o,se&&(0,F.jsx)("div",{style:{marginTop:4},children:(0,F.jsx)(Mt.Z,{containerStyle:{width:"calc(100% + 8px)"},showAvatar:!1,parentStore:e.store,blockStore:e.blockStore,onCancel:Ke,onSubmit:Pe,discussionInputStore:ue,isEditingExistingComment:!0,isMobileSlideUpMenu:!0,shouldSaveUnsentComments:!1,commentStore:e.store,discussionFormat:(0,J.discussionLocationToDiscussionFormat)(P),canDrop:!0})}),Ue&&!se&&(0,F.jsx)(B.Z,{onMore:"comment_unfurl"===P?void 0:()=>{},moreElement:(0,F.jsxs)(L.Z,{disableUnderline:!0,style:Oe.unfurlMoreWrapper,hoverColor:"blue",children:["…"," ",(0,F.jsx)("span",{children:(0,F.jsx)(h.FormattedMessage,{id:"text.truncated.showMoreLabel",defaultMessage:"more"})})]}),maxLines:e.collapsed?i:void 0,children:(0,F.jsx)(D.Z,{style:Oe.text,store:T.zP(e.store),disabled:!0,disabledMentionTypes:{date:!0},disableEquationInteraction:!0,inPageFind:He})}),se||"comment_unfurl"===P?!Ue&&(0,F.jsxs)("div",{style:Oe.attachmentContainer,children:[(0,F.jsx)("div",{style:{marginRight:5},children:(0,A.s)(Oe.attachIcon)}),(0,F.jsx)(h.FormattedMessage,{defaultMessage:"{numberOfAttachments, plural, one {{numberOfAttachments} attachment} other {{numberOfAttachments} attachments}}",values:{numberOfAttachments:me.length},id:"comment.unfurl.attachments.title"})]}):qe,(0,F.jsx)("div",{ref:Ve,children:$e&&Me.reactions.length>0&&(0,F.jsx)("div",{style:{marginTop:8},children:(0,F.jsx)(tt,{parentStore:e.store,discussionLocation:P})})})]}),"comment_unfurl"!==P&&!se&&!je&&(0,F.jsx)(it,{store:e.store,discussionStore:e.discussionStore,blockStore:e.blockStore,discussionLocation:P,visible:ke,isFirstComment:we,buttonPopupStore:ye,canShowReactions:$e,handleEditComment:Ae,handleDeleteComment:Ze,handleReaction:_e})]})]})};var It=o(709410),Dt=o(182798),Rt=o(953336),Zt=o(279954),Tt=o(293963),_t=o(450627),At=o(246351),Kt=o(95802),Pt=o(621853),Ft=o(434859),Vt=o(745589),Et=o(156681);function zt(e){var t;let{discussionStore:o,commentStore:i}=e;if(!i.isDefined())return!1;const n=null===(t=Be.default.state.currentUserStore)||void 0===t?void 0:t.id;const s=Et.Z.state.lastInteractionTimes[o.id];if(i.getCreatedById()===n)return!1;const r=function(){if(!o.isDefined()||!n)return 0;const{pageVisitStore:e}=Be.default.state,{lastViewTime:t,lastExitTime:i}=e.state;return i||t}();if(void 0===r)return!1;const a=(0,J.getAndSortCommentStoresByTime)(o).filter((e=>e.getCreatedById()===n)).reverse()[0],l=i.getCreatedTime();return!l||!(a&&l<a.getCreatedTime())&&(!(s&&l<s)&&l>r)}var Ut=o(742506),Wt=o(99340),Nt=o(874638);const Ot={block_menu:"8px 16px 0px",page_discussion:"8px 0px 0px",updates_sidebar:"4px 16px 12px",margin_comments:"8px 12px 6px",comment_unfurl:"0",updates_menu_mentions_comments:"4px 16px 12px",updates_menu_all_updates:"4px 16px 12px",updates_menu_archive:"4px 16px 12px",reply_menu_mentions_comments:"8px 16px 0px",reply_menu_all_updates:"8px 16px 0px",reply_menu_archive:"8px 16px 0px",reply_menu_updates_sidebar:"8px 16px 0px",ai_reject_all_suggestions:"0"},Ht=n.forwardRef((function(e,t){const o=(0,r.O7)(),{format:i,role:n,showMoreCommentsButton:s,onMoreCommentsClick:a,inputVisible:l,blockStore:c}=e,d=(0,Wt.cR)(c),p=n&&m.rz(n)||d,g=o.currentUser.isLoggedIn(),f=(0,u.Fg)(),x=(0,u.yK)((e=>({container:{position:"relative",padding:0,...i===J.DiscussionFormat.Page?{marginLeft:16,marginRight:16}:{}},moreCommentsWrapper:{position:"absolute",display:"flex",justifyContent:"center",alignItems:"flex-start",zIndex:1,left:0,right:0,height:30,background:`linear-gradient(to bottom, ${e.contentBackgroundTransparent} 0px, ${e.selectedMarginDiscussionBackground} 30px`,marginTop:-28},tooltip:{...(0,w.J)(e,!1),cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center",marginTop:-4,borderRadius:6,padding:"4px 10px 4px 8px"}})),[i]);return(0,F.jsx)(F.Fragment,{children:g&&!p&&(s||l)&&(0,F.jsxs)("div",{style:x.container,children:[s&&(0,F.jsx)("div",{style:x.moreCommentsWrapper,children:(0,F.jsxs)("div",{style:x.tooltip,onClick:a,children:[(0,F.jsx)("div",{style:{marginRight:5},children:(0,Nt.K)({fill:f.regularInvertedTextColor,height:12,width:12})}),(0,F.jsx)(h.FormattedMessage,{defaultMessage:"See more",id:"discussion.moreMessageTooltip"})]})}),l&&(0,F.jsx)(Mt.Z,{showAvatar:!0,containerStyle:{padding:Ot[e.discussionLocation]},parentStore:e.store,onCancel:e.onCancel,onSubmit:e.onSubmit,discussionInputStore:e.discussionInputStore,isMobileSlideUpMenu:!1,shouldSaveUnsentComments:!0,onEditPreviousComment:e.onEditPreviousComment,inReplyToDiscussionId:e.store.id,discussionFormat:e.format,showCtaButtons:e.showCtaButtons,ref:t,onFileUploaded:e.onFileUploaded})]})})}));var $t=o(462385);function Gt(e){const t=(0,u.yK)((t=>{const o=q.vi(e.discussionLocation)+q.IX;return{newBarLine:{height:"0px",borderBottom:`1px solid ${t.darkDividerColor}`,marginLeft:0,flex:1},moreCommentsWrapper:{color:t.lightTextColor,fontSize:14,flexGrow:1,display:"flex",alignItems:"center",paddingLeft:8},button:{borderRadius:6,fontSize:14,color:t.mediumTextColor,justifyContent:"space-between",padding:"14px 0",margin:`0 0 0 ${o}px`,width:`calc(100% - ${o}px - 16px)`},buttonHovered:{background:t.focusDiscussionInputBackground},threadLine:{position:"absolute",backgroundColor:t.stroke.deemphasized,width:q.Ky,height:"100%",top:q.En-q._e,left:q.vi(e.discussionLocation)+q.fT,borderRadius:2}}}),[e.discussionLocation]);return e.count<=0?null:(0,F.jsxs)("div",{style:{position:"relative"},children:[(0,F.jsx)("div",{style:t.threadLine}),(0,F.jsx)($t.Z,{style:t.button,onClick:e.onClick,hoveredStyle:t.buttonHovered,children:(0,F.jsx)("div",{style:t.moreCommentsWrapper,children:(0,F.jsx)(h.FormattedMessage,{defaultMessage:"Show {moreCommentsNumber, plural, one {{moreCommentsNumber} reply} other {{moreCommentsNumber} replies}}",id:"discussion.showMoreCommentsSidebarButton.label",values:{moreCommentsNumber:e.count}})})},"show")]})}var Xt=o(542297);function qt(e){const{discussionStore:t}=e,o=(0,h.useIntl)(),i=(0,d.VK)((()=>t.isSuggestionDiscussion()),[t]),n=(0,d.VK)((()=>{const t=e.discussionStore.getContext();return(t?(0,It.GW)({discussionContextData:t,discussionId:e.discussionStore.id,discussionType:(0,Dt.TO)(e.discussionStore.getType()),intl:o}):[])??[]}),[e.discussionStore,o]),s=(0,u.yK)((e=>({container:{marginTop:2},label:{color:e.text.uiBlueSecondary,fontSize:14,lineHeight:"18px"},labelDeleteColor:{color:e.text.tertiary},text:{color:e.text.uiBluePrimary,fontSize:14,lineHeight:1.29},textDeleteColor:{color:e.text.secondary},suggestionContextItem:{display:"block",marginBottom:4,whiteSpace:"pre-wrap",wordBreak:"break-word"}})),[]),r=(0,Xt.Kc)(o).title;return i&&r&&0!==n.length?(0,F.jsx)("div",{style:s.container,children:(0,F.jsx)(B.Z,{maxLines:e.collapsed?1:void 0,clampOverride:{lineHeight:1.29,fontSize:14},children:n.map(((e,t)=>{let{label:o,value:i,shouldUseDeleteColor:n,removeQuotationMarks:r}=e;return(0,F.jsxs)("div",{style:s.suggestionContextItem,children:[(0,F.jsxs)("span",{style:{...s.label,...n&&s.labelDeleteColor},children:[o,": "]}),(0,F.jsxs)("span",{style:{...s.text,...n&&s.textDeleteColor},children:[r?null:"“",(0,F.jsx)("span",{children:(0,g.QaF)(i)}),r?null:"”"]})]},t)}))})}):null}function Jt(e){const t=(0,n.useRef)(null),o=(0,h.useIntl)(),i=(0,r.O7)(),a=(0,d.VK)((()=>"suggestion"===e.store.getType()),[e.store]),l=(0,d.VK)((()=>T.D4(e.store)),[e.store]),m=(0,d.VK)((()=>l.filter((e=>e.isDefined()))),[l]),p="page_discussion"===e.discussionLocation?3:5;(0,n.useEffect)((()=>{m.length===p&&M(!0)}),[m,p]);const f=(0,n.useRef)(e.discussionInputStore||new Y.Z(i,e.store.pointer.spaceId)).current,x=(0,d.VK)((()=>(0,J.inputIsEmpty)(f)),[f]),b=(0,d.VK)((()=>(0,_t.Wt)(e.blockStore)),[e.blockStore]),j=(0,d.VK)((()=>e.store.getResolved()),[e.store]),[w,k]=(0,n.useState)(!1),[L,M]=(0,n.useState)(void 0!==e.collapsed&&!e.collapsed),[B,I]=(0,n.useState)(!0),D=(0,d.qz)(void 0,Vt.Z),R=(0,d.VK)((()=>D.state.clientRect),[D]),Z=e.format===J.DiscussionFormat.Sidebar,_=e.format===J.DiscussionFormat.Margin,A=(0,n.useRef)(null);(0,c.c)(At.Z,(()=>({isSidebarFormat:()=>Z,isMarginFormat:()=>_,getStore:()=>e.store,getInputStore:()=>f,getNode:()=>A.current,getMarginDiscussionScrollContainer:()=>t.current})),[Z,_,e.store,f]);const K=(0,d.VK)((()=>{if(!Z)return;return(0,J.getAndSortCommentStoresByTime)(e.store).find((t=>zt({discussionStore:e.store,commentStore:t})))}),[Z,e.store]),P=(0,n.useRef)(K),V=void 0===P.current?K:P.current,E=(0,n.useCallback)((()=>{var t;const{showAllRepliesAfterTimestamp:o}=e;if(L||m.length<=p||"block_menu"===e.discussionLocation)return m;if("page_discussion"===e.discussionLocation)return ie.pm(m,1);const i=[o,null===(t=P.current)||void 0===t?void 0:t.getCreatedTime(),null==K?void 0:K.getCreatedTime()].filter(ne.$K),n=i.length>0?Math.min(...i):void 0;if(n){const e=m.filter((e=>(e.getCreatedTime()||0)>n)),t=m.filter((e=>(e.getCreatedTime()||0)<=n));return t.length<=5?m:[...ie.pm(t,2),...e]}return ie.pm(m,2)}),[m,K,p,e,L]),U=(0,d.VK)((()=>{const t=E(),o=new Set(t.map((e=>e.id))),i=m.filter((e=>!o.has(e.id)));return{commentStores:m,commentsToShow:t,commentsToCollapse:i,reactionsToShow:$.bh.getUserVisibleReactions(e.store)}}),[m,E,e],{useDeepEqual:!0}),W=(0,n.useCallback)((()=>{if(!e.store.isDefined())return;const t=e.store.getContext();if(!t)return;const i=(0,It.Bb)({discussionContextData:t,discussionType:(0,Dt.TO)(e.store.getType()),discussionId:e.store.id,intl:o});return g.VP_(i,(t=>!g.xw5(t)||g.h19(t)===e.store.id))}),[e.store,o]),N=(0,d.VK)((()=>{if(!Z)return;return(0,J.getAndSortCommentStoresByTime)(e.store).find((t=>zt({discussionStore:e.store,commentStore:t})))}),[Z,e.store]),O=(0,n.useRef)(null),X=(0,n.useRef)(e.blockStore.clone()).current,q=(0,u.yK)((t=>({discussionWrapper:{...e.format===J.DiscussionFormat.Page&&{margin:"0px -14px 16px"},...e.format===J.DiscussionFormat.Menu&&{padding:"6px 0 12px",marginLeft:-2,boxShadow:e.isFirst?"none":`0 -1px 0 ${t.regularDividerColor}`,marginTop:e.isFirst?0:1},...e.format===J.DiscussionFormat.Margin&&{padding:"4px 0",borderRadius:8}}})),[e.format,e.isFirst]);(0,n.useEffect)((()=>{i.KatexStore.loadIfNeeded(W)}),[i.KatexStore,W]);const Q=t=>{const{device:o}=i;if(!o.isMobile)return;if(!e.store.isDefined())return;t.stopPropagation(),t.preventDefault(),Pt.Z.setState({open:!1});const n=ie.oA(Kt.C.findSelectablesFromIds([e.store.getParentId()])),s=null==n?void 0:n[0];s&&S.XW({handle:s,vertical:{reveal:"bottom"},horizontal:{reveal:"closest"},animate:!0})},ee=()=>{const o=(0,J.lineClampForCommentCount)(l.length);if(!e.collapsed)return(0,F.jsx)(Rt.Z,{style:{display:"flex",flexDirection:"column",maxHeight:500,overflowY:"scroll"},ref:t,type:Ft.Z.Y,store:D,children:l.map(((t,i)=>{const n=a&&0===i;return(0,F.jsx)(Bt,{store:t,discussionStore:e.store,blockStore:e.blockStore,hoveringDiscussion:w,discussionLocation:e.discussionLocation,showResolveButtonByDefaultIfPossible:e.showResolveButtonByDefaultIfPossible,maxLines:o,shouldShowThreadLine:i!==l.length-1,discussionContext:n?(0,F.jsx)(qt,{discussionStore:e.store,collapsed:Boolean(e.collapsed)}):void 0,isSuggestionComment:n},t.id)}))});const i=l[0]&&(0,F.jsx)(Bt,{store:l[0],discussionStore:e.store,blockStore:e.blockStore,hoveringDiscussion:w,discussionLocation:e.discussionLocation,showResolveButtonByDefaultIfPossible:e.showResolveButtonByDefaultIfPossible,maxLines:o,collapsed:e.collapsed,shouldShowThreadLine:1!==l.length,discussionContext:a?(0,F.jsx)(qt,{discussionStore:e.store,collapsed:Boolean(e.collapsed)}):void 0,isSuggestionComment:a},l[0].id),n=l.length>1&&l[l.length-1]&&(0,F.jsx)(Bt,{store:l[l.length-1],discussionStore:e.store,blockStore:e.blockStore,hoveringDiscussion:w,discussionLocation:e.discussionLocation,showResolveButtonByDefaultIfPossible:e.showResolveButtonByDefaultIfPossible,maxLines:o,collapsed:e.collapsed,shouldShowThreadLine:!1},l[l.length-1].id),s=l.length-2;return(0,F.jsxs)(F.Fragment,{children:[i,(0,F.jsx)(Gt,{insetButton:!_,count:s,onClick:ce,discussionLocation:e.discussionLocation}),n]})};const te=(0,d.VK)((()=>e.blockStore.getRole()),[e.blockStore]),oe=t.current,se=(0,d.VK)((()=>(null==oe?void 0:oe.atScrollEnd())??!0),[oe]),re=B&&!e.collapsed&&_&&R&&t.current&&!se,ae=()=>{s.default.afterNextFlush((()=>{t.current&&t.current.scrollToBottom({animate:!0})}))},le=ie.Ds((()=>{setTimeout((()=>I(!0)),50)}),50),ce=e=>{_||(e.stopPropagation(),M(!0))},de=()=>{f.reset()},ue=()=>{H.Z.state||k(!0)},me=()=>{k(!1)};return 0===U.commentsToShow.length&&U.reactionsToShow.length>0?(0,F.jsx)("div",{ref:A,style:{...q.discussionWrapper,paddingLeft:16},onMouseMove:ue,onMouseLeave:me,children:(0,F.jsx)(et,{focused:!0,disableShadow:!0,parentStore:e.store,discussionLocation:e.discussionLocation})}):(0,F.jsx)(Zt.Z,{store:X,analyticsName:"discussion",canNativeDropOnto:!0,onNativeDrop:async e=>{let{files:t}=e;O.current&&await O.current.uploadFiles(t)},keepTextSelectionOnDrop:!0,shouldShowDropZone:!0,children:(0,F.jsxs)("div",{ref:A,style:q.discussionWrapper,onMouseMove:ue,onMouseLeave:me,children:[function(){if(_)return ee();const{commentStores:t,commentsToShow:o,commentsToCollapse:i}=U,n=i.length>0,s=o.map(((t,i)=>{const s=a&&0===i,r=s?(0,F.jsx)(qt,{discussionStore:e.store,collapsed:Boolean(e.collapsed)}):0===i&&!n&&(e.format===J.DiscussionFormat.Menu||e.format===J.DiscussionFormat.Sidebar)&&(0,F.jsx)(Ut.Z,{format:e.format,discussionLocation:e.discussionLocation,store:e.store,blockStore:e.blockStore,onClick:Q});return(0,F.jsx)(Bt,{store:t,discussionStore:e.store,blockStore:e.blockStore,hoveringDiscussion:w,discussionLocation:e.discussionLocation,showResolveButtonByDefaultIfPossible:e.showResolveButtonByDefaultIfPossible,discussionContext:r,isSuggestionComment:s,showNewBar:t.id===(null==V?void 0:V.id)&&0!==i,shouldShowThreadLine:i!==o.length-1},t.id)})),r=a,l=r?(0,F.jsx)(qt,{discussionStore:e.store,collapsed:Boolean(e.collapsed)}):(e.format===J.DiscussionFormat.Menu||e.format===J.DiscussionFormat.Sidebar)&&(0,F.jsx)(Ut.Z,{format:e.format,discussionLocation:e.discussionLocation,store:e.store,blockStore:e.blockStore,onClick:Q});return(0,F.jsxs)("div",{style:{position:"relative"},children:[Z&&N&&(0,F.jsx)(Tt.z,{style:Qt}),n&&(0,F.jsx)(Bt,{store:t[0],discussionStore:e.store,blockStore:e.blockStore,hoveringDiscussion:w,discussionLocation:e.discussionLocation,showResolveButtonByDefaultIfPossible:e.showResolveButtonByDefaultIfPossible,discussionContext:l,shouldShowThreadLine:1!==t.length,isSuggestionComment:r},t[0].id),(0,F.jsx)(Gt,{insetButton:!_,count:i.length-1,onClick:ce,discussionLocation:e.discussionLocation}),s]})}(),j?(0,F.jsx)("div",{style:{height:8}}):(0,F.jsx)(Ht,{ref:O,showMoreCommentsButton:!!re,onMoreCommentsClick:ae,inputVisible:!(b||e.collapsed&&x),store:e.store,blockStore:X,format:e.format,discussionInputStore:f,discussionLocation:e.discussionLocation,onCancel:async()=>{if((0,J.hasCommentChanged)(f)){await v.confirmUserAction({message:(0,F.jsx)(h.FormattedMessage,{defaultMessage:"Do you want to discard this reply?",id:"discussion.confirmDialog.discardReply.prompt"}),acceptLabel:(0,F.jsx)(h.FormattedMessage,{defaultMessage:"Discard",id:"discussion.confirmDialog.discardReplyButton.label"})})?(de(),e.onDismiss&&e.onDismiss()):(await s.default.afterNextFlush(),y.setSelectionAtEnd({store:f.state.textStore}))}else de(),e.onDismiss&&e.onDismiss()},onSubmit:async()=>{I(!1);const{device:t}=i,{store:o,blockStore:n,discussionLocation:r}=e;C.createAndCommit({userAction:"Discussion.handleSubmitReply",environment:i,perform:e=>{G.Xi({environment:i,discussionStore:o,textValue:f.state.textStore.getValue()||[],transaction:e,discussionLocation:r,files:f.state.files,property_id:o.getPropertyId(),blockStore:n})}}),de(),y.clear({environment:i}),ae(),le(),t.isMobile||(await s.default.afterNextFlush(),y.setSelectionAtStart({store:f.state.textStore}))},onEditPreviousComment:()=>{const t=i.currentUser.id;if(!t)return;const o=T.D4(e.store).filter((e=>e.getCreatedById()===t)),n=ie.Z$(o);if(!n)return;if(a&&1===o.length)return;const s=z.Z.find((t=>t.commentId===n.id&&t.discussionLocation===e.discussionLocation));s&&(y.clear({environment:i}),s.edit())},showCtaButtons:!!_||void 0,onFileUploaded:()=>{const e=Kt.C.findSelectableFromStore(X);e&&S.XW({handle:e,vertical:{reveal:"bottom"},horizontal:{reveal:"closest"},animate:!0})},role:te})]})})}const Yt=n.memo(Jt),Qt={marginRight:4,position:"absolute",right:16,top:14};var eo=o(625487),to=o(629551),oo=o(944461),io=o(431183),no=o(224646),so=o(607709),ro=o(406120),ao=o(598997);const lo=(0,h.defineMessages)({commentsAriaLabel:{defaultMessage:"{count, plural, one {1 comment} other {{count} comments}}",id:"comments.components.discussionindicator.commentAriaLabel"},suggestionsAriaLabel:{defaultMessage:"{count, plural, one {1 suggestion} other {{count} suggestions}}",id:"comments.components.discussionindicator.suggestionAriaLabel"},reactionsAriaLabel:{defaultMessage:"{count, plural, one {1 reaction} other {{count} reactions}}",id:"comments.components.discussionindicator.reactionsAriaLabel"}});function co(e){const t=(0,h.useIntl)(),{store:o,propertyId:i,style:n}=e,{showIndicator:s,formattedReactionCount:a,onlySuggestions:l,icon:c,showReactionsIcon:m,onlyHasDraftIndicator:p,formattedCommentCount:g,handleClick:x,discussionIsSelected:v,commentsCount:S,shouldShowDraftIndicator:b}=(0,ro.Z)({store:o,recursivelyLoadAllDiscussions:!1,onlyCountBlockLevelDiscussions:!1,propertyId:i}),y=(0,u.yK)((e=>({iconButton:{background:v?e.selectLightGray[100]:void 0,gap:2},icon:{width:14,color:e.lightTextColor},commentCount:{marginLeft:2,color:e.lightTextColor,fontWeight:f.Z.fontWeight.semibold,marginBottom:1},reactIcon:{width:14,height:14,color:e.lightTextColor},commentCaptionStyle:{fontWeight:f.Z.fontWeight.semibold,...b?{color:e.icon.tertiary}:{color:e.lightTextColor,marginBottom:1}},reactionCaptionStyle:{fontWeight:f.Z.fontWeight.semibold,color:e.lightTextColor}})),[v,b]),C=(0,r.O7)(),j=(0,d.VK)((()=>(0,no.vK)(C)),[C]),w=(0,d.VK)((()=>(0,so.fg)(C,o)),[C,o]),{isPropertyInPageDetails:k}=(0,io.d0)({store:o,propertyId:i});return!s||!k&&(j||w)?null:(0,F.jsxs)(to.gq,{style:n,children:[(S>0||p)&&(0,F.jsxs)(to.gq,{style:{position:"relative"},children:[(0,F.jsx)(le.Z,{ariaLabel:l?t.formatMessage(lo.suggestionsAriaLabel,{count:g}):t.formatMessage(lo.commentsAriaLabel,{count:g}),icon:c,style:y.iconButton,iconStyle:y.icon,onClick:x,caption:g,captionStyle:y.commentCaptionStyle}),b&&(0,F.jsx)(ao.Z,{customTop:3,customLeft:16,onlyShowDraftDot:!0})]}),m&&(0,F.jsx)(le.Z,{ariaLabel:t.formatMessage(lo.reactionsAriaLabel,{count:a}),icon:oo.a,style:y.iconButton,iconStyle:y.icon,onClick:x,captionStyle:y.reactionCaptionStyle,caption:a})]})}var uo=o(110906),mo=o(785957),po=o(282136),go=o(14577),ho=o(359933),fo=o(380503),xo=o(151454),vo=o(639500),So=o(849427),bo=o(436391),yo=o(650628),Co=o(992120),jo=o(948514),wo=o(838805),ko=o(736974);function Lo(e){let{discussionData:{groupedDiscussionsData:t,newDiscussionData:o,id:i},onClick:s}=e;const[a,l]=(0,n.useState)(!1),c=(0,r.O7)(),m=c.currentUser.id,p=(0,n.useCallback)((()=>{l(!0)}),[]),g=(0,n.useCallback)((()=>{l(!1)}),[]),x=(0,d.VK)((()=>"on"===O.default.getEligibleGroup({experimentId:"dcu_allow_actions_while_commenting",defaultGroup:"control",disableExposureLogging:!0})),[]),v=x&&o,S=(0,n.useCallback)((async e=>{if(v){const e=Be.default.state.mainEditorCurrentBlockStore;Q.Z.setActiveWithSource("margin_comments"),await(0,ko.U)({currentBlockStore:e,discussionInputStore:o.discussionInputStore,environment:c,allowActionsWhileCommenting:x})}else if(t.length>0){const o=t[0].discussionStore;await s(e,o)}}),[v,t,null==o?void 0:o.discussionInputStore,c,x,s]),{commentStores:b,reactionStores:y}=(0,d.VK)((()=>{if(t){return{commentStores:t.flatMap((e=>(0,T.D4)(e.discussionStore))),reactionStores:t.flatMap((e=>$.bh.getUserVisibleReactions(e.discussionStore)))}}return{commentStores:[],reactionStores:[]}}),[t]),C=(0,d.VK)((()=>{let e;if(v&&(e=o.parentBlockStore),t.length>0&&(e=t[0].parentBlockStore),!e)return;const i=b.map((e=>e.getCreatedById())).filter(ne.$K),n=y.map((e=>e.getActorPointers().map((e=>e.id)))).flat().filter(ne.$K);return Array.from(new Set([...i,...n,...v&&m?[m]:[]])).map((t=>$.U6.createChildStore(e,{table:oe.KJ,id:t}))).slice(0,5)}),[t,v,b,y,m,null==o?void 0:o.parentBlockStore]),j=(0,d.VK)((()=>{const e=b.map((e=>e.getLastEditedTime())),t=y.map((e=>e.getCreatedTime()));return Math.max(...e,...t)}),[b,y]),w=(0,u.yK)((e=>({discussion:{background:a?e.hoveredMarginDiscussionBackground:e.contentBackground,width:so.Z,display:"flex",cursor:"pointer",border:`1px solid ${e.stroke.deemphasized}`,borderRadius:10,padding:"12px",alignItems:"center",gap:6},userAvatarsContainer:{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row-reverse",marginRight:8},hiddenUsers:{fontSize:14,color:e.mediumTextColor,marginRight:6},lastEditedTime:{margin:"1px 0px 0px 0px",whiteSpace:"normal",display:"flex",justifyContent:"center",alignItems:"center",color:e.text.tertiary,fontSize:12,lineHeight:"15px"},commentAuthorAvatarStyle:{borderRadius:20,position:"relative",userSelect:"none",WebkitUserSelect:"none",width:24,height:24,boxShadow:e.avatarBoxShadow,marginRight:-6},commentAuthorPlaceholderStyle:{width:20,height:20,borderRadius:20,marginRight:-3,position:"relative"},secondaryLabel:{fontSize:f.Z.fontSize.UISmall.desktop,whiteSpace:"normal",display:"flex",justifyContent:"center",alignItems:"center",lineHeight:"21px",marginLeft:0,marginTop:0,color:e.text.tertiary},expandIcon:{width:f.Z.fontSize.UISmall.desktop,height:f.Z.fontSize.UISmall.desktop,fill:e.lightTextColor,marginTop:1},expandDiv:{display:"flex",justifyContent:"center",alignItems:"center",marginLeft:0}})),[a]),L=(0,F.jsx)("div",{style:w.secondaryLabel,children:(0,F.jsx)(h.FormattedMessage,{defaultMessage:"Draft",id:"marginComments.collapsed.draft.label"})}),B=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{style:w.expandDiv,children:(0,wo.s)(w.expandIcon)}),v?L:(0,F.jsx)("div",{style:w.secondaryLabel,children:(0,F.jsx)(h.FormattedMessage,{defaultMessage:"Expand",id:"marginComments.collapsed.expand.label"})})]}),I=v?L:j&&(0,F.jsx)(k.Z,{isSmall:!0,isSecondaryColor:!0,isMultiline:!0,style:w.lastEditedTime,children:(0,F.jsx)(M.Z,{text:(0,_.IS)(j,{useUltraCompactFormat:!0}),tooltipText:(0,_.uy)(j),icon:K.C})});return(0,F.jsx)("div",{style:w.discussion,onMouseEnter:p,onMouseLeave:g,onClick:S,className:ge.S9A,children:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("div",{style:w.userAvatarsContainer,children:null==C?void 0:C.map((e=>(0,F.jsx)(Ne.S,{authorStore:e,avatarSize:24,avatarStyle:w.commentAuthorAvatarStyle,placeholderStyle:w.commentAuthorPlaceholderStyle},e.id)))}),(0,F.jsx)(Mo,{reactionCount:y.length,commentCount:b.length+(v?1:0)}),a?B:I]})})}function Mo(e){const t=(0,u.yK)((e=>({commentCount:{fontSize:14,whiteSpace:"normal",marginLeft:0,color:e.text.primary,fontWeight:f.Z.fontWeight.medium,lineHeight:"18px"},textPlaceholder:{background:e.lightDividerColor,height:14,width:81,borderRadius:4,marginLeft:4}})),[]);return e.commentCount>0?(0,F.jsx)("div",{style:t.commentCount,children:(0,F.jsx)(h.FormattedMessage,{defaultMessage:"{numComments, plural, one {{numComments} comment} other {{numComments} comments}}",id:"marginComments.collapsed.numComments.count",values:{numComments:e.commentCount}})}):e.reactionCount>0?(0,F.jsx)("div",{style:t.commentCount,children:(0,F.jsx)(h.FormattedMessage,{defaultMessage:"{numReactions, plural, one {{numReactions} reaction} other {{numReactions} reactions}}",id:"marginComments.collapsed.numReactions.count",values:{numReactions:e.reactionCount}})}):(0,F.jsx)("div",{style:t.textPlaceholder})}var Bo=o(174725),Io=o(171728),Do=o(959151);function Ro(e){let{discussionData:{parentBlockStore:t,discussionInputStore:o},isVisible:i}=e;const s=(0,n.useRef)(null),a=(0,r.O7)(),l=(0,d.VK)((()=>"on"===O.default.getEligibleGroup({experimentId:"dcu_allow_actions_while_commenting",defaultGroup:"control",disableExposureLogging:!0})),[]),c=(0,n.useCallback)((()=>{Io.Dc(a,l)}),[l,a]),m=(0,d.VK)((()=>o.isEmpty()),[o]),p=(0,n.useCallback)((()=>{l&&Q.Z.setActiveWithSource("margin_comments")}),[l]),g=(0,n.useCallback)((()=>{l&&Q.Z.resetActiveSource("margin_comments")}),[l]),h=(0,n.useCallback)((()=>{l?(m&&jo.Z.reset(),Q.Z.resetEditorActiveSources()):(0,Do.uK)({discussionInputStore:o,environment:a,discussionHelpers:J})}),[l,o,a,m]),f=(0,n.useCallback)((()=>{l&&Q.Z.setHoverWithSource("margin_comments")}),[l]),x=(0,n.useCallback)((()=>{l&&Q.Z.resetHoverSource("margin_comments")}),[l]),v=(0,n.useMemo)((()=>[`.${ge.mJW}`]),[]),S=(0,d.VK)((()=>Q.Z.state.isActivelyComposing),[]),b=(0,d.VK)((()=>Q.Z.state.isHovered&&!Q.Z.state.isActivelyComposing),[]),y=Boolean(!l||S||m);(0,Bo.O)({active:i&&y,closeHandler:h,ref:s,excludedSelectors:v,ignoreKeydown:!0});const C=(0,u.yK)((e=>({discussion:{borderRadius:10,...l?S?{boxShadow:e.marginDiscussionSelectedShadow}:{border:`1px solid ${e.lightDividerColor}`}:{boxShadow:e.marginDiscussionSelectedShadow},width:so.Z,background:e.selectedMarginDiscussionBackground,...l&&{willChange:"transform",transition:"transform 200ms ease",transform:S?"translateX(-20px)":b?"translateX(-5px)":void 0}},discussionInputContainer:{borderRadius:6,padding:"8px 0px 4px 12px",...l&&{backgroundColor:b?e.hoveredMarginDiscussionBackground:void 0}}})),[l,S,b]);return(0,F.jsx)("div",{style:C.discussion,ref:s,className:ge.S9A,onMouseEnter:f,onMouseLeave:x,children:(0,F.jsx)(Mt.Z,{parentStore:t,discussionInputStore:o,shouldSaveUnsentComments:!1,isMobileSlideUpMenu:!1,discussionFormat:J.DiscussionFormat.Margin,onSubmit:c,onCancel:h,isNewComment:!0,blockStore:t,canDrop:!0,showAvatar:!1,containerStyle:C.discussionInputContainer,showCtaButtons:!0,onFocus:p,onBlur:g})})}var Zo=o(222491),To=o(585344),_o=o(305971);function Ao(e){let{discussionData:{discussionStore:t,parentBlockStore:o},timeMounted:i,onClick:s,isVisible:a,isDiscussionSelected:l,isDiscussionHovered:c}=e;const m=(0,n.useRef)(null),p=(0,r.O7)(),[g,h]=(0,n.useState)((()=>new Y.Z(p,t.pointer.spaceId))),f=(0,_o.E)("block_reactions"),v=t.id,S=(0,d.VK)((()=>t.getCommentStores().length>0),[t]),b=(0,d.VK)((()=>t.getReactionStores().length>0),[t]),y=(0,n.useMemo)((()=>[`.${(0,Zo.dk)({discussionId:v})}`,`.${ge.mJW}`,`.${ge.S9A}`]),[v]),C=(0,n.useCallback)((async()=>{const e=z.Z.find((e=>e.isEditing()));if(e){if(!(await e.handleCancelEdit()))return}x.LZ()}),[]);(0,Bo.O)({active:a&&l,closeHandler:C,ref:m,excludedSelectors:y,ignoreKeydown:!0});const j=(0,u.yK)((e=>({discussion:{border:l?void 0:`1px solid ${e.lightDividerColor}`,borderRadius:10,padding:l?"1px":void 0,background:l?e.selectedMarginDiscussionBackground:c?e.hoveredMarginDiscussionBackground:e.contentBackground,boxShadow:l?e.marginDiscussionSelectedShadow:void 0,width:so.Z,cursor:l?void 0:"pointer"},wrapper:{willChange:"transform",transition:"transform 200ms ease",transform:l?"translateX(-20px)":c?"translateX(-5px)":void 0}})),[c,l]),w=(0,n.useCallback)((async e=>{var o;l||(To.Uw(p,{discussion_id:t.id,discussion_type:t.getType(),from:"margin_comments",parent_block_id:t.getParentId(),parent_collection_id:null===(o=t.getParentStore())||void 0===o?void 0:o.getParentCollectionIdUpToTwoLevels()}),await s(e,t))}),[s,t,l,p]);return(0,F.jsxs)("div",{className:ge.S9A,ref:m,style:j.wrapper,onClick:w,children:[b&&f&&(0,F.jsx)("div",{style:{width:so.Z},children:(0,F.jsx)(et,{focused:l,parentStore:t,discussionLocation:"margin_comments"})}),S&&(0,F.jsx)("div",{style:j.discussion,children:(0,F.jsx)(Yt,{store:t,blockStore:o,format:J.DiscussionFormat.Margin,isFirst:!1,isOnly:!1,showResolveButtonByDefaultIfPossible:!1,discussionLocation:"margin_comments",showAllRepliesAfterTimestamp:i,discussionInputStore:g,collapsed:!l})})]})}const Ko=n.memo(Ao);function Po(e){const{discussionData:t,isLastItem:o,isDiscussionSelected:i,discussionItemElementMap:s}=e,a=(0,u.yK)((()=>({discussionContainer:{transition:t.hide?void 0:"opacity 200ms ease-in-out",top:t.offsetTop,position:"absolute",paddingBottom:o?so.Vs:so.wo,zIndex:i?1:void 0,opacity:t.hide?0:1,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",pointerEvents:"auto"}})),[t.hide,t.offsetTop,i,o]);let l;const c=t.type,m=(0,r.O7)();(0,d.VK)((()=>(0,so.az)(m,t.parentBlockStore)),[m,t.parentBlockStore])?"existing"===c?l=(0,F.jsx)(Ko,{...e,discussionData:t}):"new"===c?l=(0,F.jsx)(Ro,{...e,discussionData:t}):"grouped"===c?l=(0,F.jsx)(Lo,{...e,discussionData:t}):(0,ne.t1)(c):l=null;const p=(0,n.useCallback)((()=>{Co.Z.setState({source:"margin_comments",discussionIds:[t.id]})}),[t.id]),g=(0,n.useCallback)((()=>{Co.Z.setState({discussionIds:[]})}),[]),h=(0,n.useCallback)((e=>{s.set(t.id,e)}),[t.id,s]);return(0,F.jsx)("div",{style:a.discussionContainer,onMouseEnter:p,onMouseLeave:g,ref:h,children:l})}const Fo=n.memo(Po),Vo=`.${ho.zd}, .${ho.FB}`;function Eo(e){let{pageBlockStore:t,timeMounted:o,isVisible:i,animating:s,pageViewBlockAccessor:a,width:l}=e;const c=(0,r.O7)(),m=(0,n.useRef)(null),p=(0,n.useRef)(new Map),g=(0,n.useRef)(new Map),h=(0,d.VK)((()=>Co.Z.getFirstSelectedDiscussionId()),[]),f=(0,n.useCallback)((async(e,o)=>{(0,vo.X9)()||e.target instanceof Element&&e.target.closest(Vo)||await G.Ri({discussionStore:o,currentBlockStore:t,environment:c,analyticsFrom:"margin_comments",currentEl:m.current})}),[t,c]),[x,v]=(0,n.useState)({data:[],hasNewDiscussion:!1,selectedDiscussion:void 0}),[S,b]=(0,n.useState)(!1),{WindowSizeStore:y}=c,C=fo.R6(c.device.isElectronMac),j=(0,d.VK)((()=>"on"===O.default.getEligibleGroup({experimentId:"dcu_allow_actions_while_commenting",defaultGroup:"control",disableExposureLogging:!0})),[]);(0,n.useEffect)((()=>{if(!i)return;const e=new go.ZP((()=>({selectableRectMap:yo.Z.state.selectableRectMap,pageContentStores:t.getContentStores(),sidebarIsAnimating:bo.ZP.state.isAnimating,windowHeight:y.state.height})),{debugName:"effectDataStore"}),o=new go.ZP((()=>so.EM.state),{debugName:"discussionStoresStore"}),n=new go.ZP((()=>{const e=jo.Z.state,t=jo.Z.getBlockStore(),o=jo.Z.getClosestBlockStore();if(e.open&&e.rect&&"comment"===e.content&&(!j||t||o)){if(j){if(t&&(!So.Z.isBlockInFrame(t)||e.property_id))return;return{recomputeFocus:Q.Z.state.isActivelyComposing,blockStore:t??e.blockStore,discussionInputStore:e.discussionInputStore}}if(So.Z.isBlockInFrame(e.blockStore)&&!e.property_id)return{blockStore:e.blockStore,discussionInputStore:e.discussionInputStore}}}),{debugName:"newMarginDiscussionArgsStore"}),r=new go.ZP((()=>{if(!j||!Q.Z.state.isActivelyComposing)return W.Z.getFramePageFirstSelectedDiscussionId();W.Z.reset()}),{debugName:"selectedDiscussionIdStore"});let l=!1;const c=(0,ie.Ds)((()=>{const{selectableRectMap:i,pageContentStores:c,sidebarIsAnimating:d,windowHeight:u}=e.state,h=o.state,f=n.state,y=r.state;if(s||d)return;const w=a();if(!(w&&m.current&&i&&i.size))return;(0,so.H0)({discussionStores:h,pageContentStores:c,marginDiscussionItemRefs:p.current,selectedDiscussionId:y,newMarginDiscussionArgs:f,marginContainerElement:m.current,pageViewBlockElement:w,onComputeComplete:(e,t)=>{l||(g.current=t,S||b(!0),v(e))},computedOnce:S,topbarHeight:C,windowHeight:u,isFullWidth:t.isFullWidth(),prevSelectedDiscussionId:x.selectedDiscussion,previousDiscussionElements:g.current,allowActionsWhileCommenting:j})}),5);return e.addListener(c),o.addListener(c),r.addListener(c),n.addListener(c),()=>{l=!0,e.removeListener(c),o.removeListener(c),r.removeListener(c),n.removeListener(c)}}),[i,s,a,S,t,x.selectedDiscussion,y,C,j]);const w=(0,u.yK)((()=>({marginCommentsContainer:{display:"flex",flexDirection:"column",paddingTop:8,paddingBottom:8,paddingLeft:so.fS,paddingRight:so.fS,width:l-2*so.fS,flexShrink:0,height:"100%",position:"relative",pointerEvents:"none",zIndex:xo.p8}})),[l]);return(0,F.jsx)("div",{style:w.marginCommentsContainer,ref:m,children:x.data.map(((e,t)=>(0,F.jsx)(Fo,{discussionData:e,timeMounted:o,onClick:f,isVisible:i,discussionItemElementMap:p.current,isDiscussionSelected:e.selected||"new"===e.type,isDiscussionHovered:e.id===h,isLastItem:t===x.data.length-1},`margin-discussion-${e.id}`)))})}const zo=n.memo(Eo);function Uo(e){let{pageBlockStore:t,isVisible:o,pageViewBlockAccessor:i,context:s,isCollapsedAnchor:a}=e;const[l,c]=(0,n.useState)(!1),m=(0,r.O7)(),p=(0,n.useMemo)((()=>(new Date).getTime()),[]),g=(0,d.VK)((()=>t.isFullWidth()||s===po.S.CollectionPageView),[s,t]),h=(0,d.VK)((()=>"floating_right"===O.default.getEligibleGroup({experimentId:"floating_table_of_contents_variants",defaultGroup:"control"})),[]),f=(0,d.VK)((()=>a?{paddingLeft:g?96:h?16:42,height:0}:g?void 0:{position:"absolute",right:(0,so.oS)(m,(0,mo.wq)(t),(0,uo.Ks)(t))}),[a,g,m,t,h]),x=(0,n.useCallback)((()=>{c(!0)}),[]),v=(0,n.useCallback)((()=>{c(!1)}),[]),S=(0,u.yK)((()=>({marginCommentsSection:{display:o||l?"flex":"none",flexShrink:0,pointerEvents:"none",width:o?so.QB:0,...f}})),[o,l,f]);return(0,F.jsx)(Ke.Z,{isVisible:!0,animationStyle:{opacity:o?1:0},onAnimationStart:x,onAnimationEnd:v,render:()=>(0,F.jsx)("div",{style:S.marginCommentsSection,children:(0,F.jsx)(zo,{pageBlockStore:t,timeMounted:p,isVisible:o,animating:l,pageViewBlockAccessor:i,width:so.QB})})})}var Wo=o(436488),No=o(256940),Oo=o(953437),Ho=o(592015),$o=o(972402);const Go=function(e){const{capture:t,children:o}=e,i=(0,n.useRef)(null);return(0,c.c)($o.Z,(()=>({getNode:()=>i.current,isCaptured:()=>t})),[t]),(0,F.jsx)("div",{ref:i,children:n.Children.only(o)})};var Xo=o(223196),qo=o(619671),Jo=o(380351),Yo=o(934959);const Qo=function(){const e=(0,r.O7)(),t=(0,d.VK)((()=>"on"===O.default.getEligibleGroup({experimentId:"dcu_allow_actions_while_commenting",defaultGroup:"control",disableExposureLogging:!0})),[]),{device:o,WindowSizeStore:i}=e,s=(0,d.VK)((()=>jo.Z.state.rect),[]),a=(0,d.VK)((()=>{if(jo.Z.state.open&&"comment"===jo.Z.state.content){const{blockStore:n,discussionInputStore:s}=jo.Z.state;if(t){if((0,no.vK)(e))return null;if(jo.Z.updateRect(),Q.Z.state.isActivelyComposing){"comments_pane"===Q.Z.state.clickEntryPoint&&Q.Z.setActiveWithSource("popover_comments");const t=jo.Z.getBlockStore();var o;if(t)return{blockStore:t,discussionInputStore:s,canMarginCommentsRender:!(null!==(o=jo.Z.state)&&void 0!==o&&o.property_id)&&(0,so.az)(e,t)}}}else{var i;if(n)return{blockStore:n,discussionInputStore:s,canMarginCommentsRender:!(null!==(i=jo.Z.state)&&void 0!==i&&i.property_id)&&(0,so.az)(e,n)}}}return null}),[t,e]),l=(0,d.VK)((()=>({paddingLeft:o.isMobileNative?i.getSafePaddingLeftCSS(12):12,paddingRight:o.isMobileNative?i.getSafePaddingRightCSS(8):8})),[i,o.isMobileNative]),c=(0,u.yK)((()=>({inputWrapper:{width:o.isMobileNative?"100%":470,maxWidth:o.isMobileBrowser?"90vw":"100%",paddingTop:9,paddingBottom:o.isAndroid?12:8,paddingLeft:l.paddingLeft,paddingRight:l.paddingRight}})),[o,l]),m=(0,_o.E)("formulas_big_number"),p=()=>{Io.Dc(e,t,m)},g=(0,n.useCallback)((()=>{if(!t)return;const o=null==a?void 0:a.discussionInputStore;o&&(0,Yo.l)({discussionInputStore:o,environment:e,allowActionsWhileCommenting:t})}),[t,e,a]),h=()=>{t?jo.Z.hasContent()?Q.Z.resetEditorActiveSources():a&&(0,Jo.C)(e):a&&(0,Do.uK)({discussionInputStore:a.discussionInputStore,environment:e,discussionHelpers:J})},f=(0,d.VK)((()=>qo.Z.state.isOpen),[]),x=(0,d.VK)((()=>Q.Z.state.overlapsExistingDiscussionMenu),[]);return t&&x?null:(0,F.jsx)(Oo.ZP,{popupType:o.isMobileNative?Xo.k.SlideUp:Xo.k.Popup,keepFocus:!0,open:null!==a&&(!a.canMarginCommentsRender||f),originRect:s,placementToOrigin:Oo.ZP.Placement.Bottom,alignmentToOrigin:Oo.ZP.Alignment.Center,originGap:4,onDismiss:h,render:()=>{if(a){const{blockStore:e,discussionInputStore:t}=a;return(0,F.jsx)(No.Z,{capture:!0,ignoreBlockSelection:!0,restoreSelection:!0,render:()=>(0,F.jsx)(Wo.Z,{capture:!0,allowOpenLinkMenu:!0,render:()=>(0,F.jsx)(Ho.Z,{store:e,droppable:!0,render:()=>(0,F.jsx)(Go,{capture:!0,children:(0,F.jsx)("div",{style:c.inputWrapper,children:(0,F.jsx)(Mt.Z,{showAvatar:!0,parentStore:e,onCancel:h,onSubmit:p,discussionInputStore:t,isMobileSlideUpMenu:!0,shouldSaveUnsentComments:!1,discussionFormat:J.DiscussionFormat.Page,blockStore:e,canDrop:!0})})})},e.id)})})}},onAnimationEnd:g})};var ei=o(645010),ti=o(209080);const oi=function(){const e=(0,r.O7)(),{device:t}=e,{open:o,rect:i}=(0,d.VK)((()=>{const{open:e,rect:t}=ti.Z.state;return{open:e,rect:t}}),[]);return(0,F.jsx)(Oo.ZP,{popupType:t.isMobile?Xo.k.SlideUp:Xo.k.Popup,open:o,originRect:i,placementToOrigin:Oo.ZP.Placement.Bottom,alignmentToOrigin:Oo.ZP.Alignment.Center,originGap:4,onDismiss:()=>X.UZ(e),render:()=>(0,F.jsx)(ii,{})})};function ii(){const e=(0,r.O7)(),{device:t}=e,o=(0,d.VK)((()=>ti.Z.state),[]),i=(0,d.VK)((()=>ti.Z.state.open?ti.Z.state.discussionInputStore.state.textStore.getValue():null),[]);if((0,n.useEffect)((()=>{var e;null===(e=ei.Z.MenuScroller)||void 0===e||e.scrollToBottom()}),[i,o]),o.open){const{discussionStore:i,discussionInputStore:n,blockStore:s,discussionLocation:r}=o;let a;return a=t.isMobile?{menuType:he.og.Modal,title:(0,F.jsx)(h.FormattedMessage,{defaultMessage:"Comments",id:"discussion.mobileReplyMenu.title"}),right:(0,F.jsx)(h.FormattedMessage,{defaultMessage:"Close",id:"discussion.mobileReplyMenu.closeButton.label"}),onClickRight:()=>X.UZ(e),whiteBackground:!0}:{menuType:he.og.Popup,width:420,minHeight:"100px",maxHeight:"50vh",maxWidth:"100%"},(0,F.jsx)(ce.Z,{className:ge.LoZ,...a,children:(0,F.jsx)(Wo.Z,{capture:!0,allowMobileAutoScroll:!0,render:()=>(0,F.jsx)(Yt,{store:i,discussionInputStore:n,onDismiss:()=>X.UZ(e),format:J.DiscussionFormat.Menu,isFirst:!0,isOnly:!0,discussionLocation:r,showResolveButtonByDefaultIfPossible:!0,blockStore:s,collapsed:!1})})})}return null}var ni=o(64810)},370775:(e,t,o)=>{"use strict";o.d(t,{S:()=>p});o(667294);var i=o(886628),n=o(724405),s=o(554368),r=o(177420),a=o(519889),l=o(401898),c=o(670301),d=o(45653),u=o(983420),m=o(785893);function p(e){let{authorStore:t,avatarSize:o,avatarStyle:p}=e;const g=(0,i.VK)((()=>(0,u.TL)(t)),[t]),h=(0,n.yK)((e=>({placeholder:{width:o,height:o,background:e.lightDividerColor,borderRadius:o/2,flexShrink:0,...p}})),[o,p]);return g.asActor?g.table===a.KJ?(0,m.jsx)(d.Z,{hasTooltip:!0,userValue:g.asActor,style:p,size:o,avatarShouldShowShadow:!1}):g.table===r.cZ?(0,m.jsx)(c.Z,{botValue:g,size:o,style:p}):g.table===s.y0?(0,m.jsx)("div",{style:h.placeholder}):void(0,l.t1)(g):(0,m.jsx)("div",{style:h.placeholder})}},167706:(e,t,o)=>{"use strict";o.d(t,{Z:()=>l});o(667294);var i=o(724405),n=o(137810),s=o(953437),r=o(526388),a=o(785893);function l(e){let{text:t,tooltipText:o,icon:l}=e;const c=(0,i.yK)((e=>({icon:{height:"1em",width:"1em",marginRight:"0.25em",fill:e.mediumIconColor,marginBottom:"0.1em"},tooltip:{background:e.contentBackground,boxShadow:e.lightBoxShadow},container:{display:"flex",alignItems:"center",fontWeight:n.Z.fontWeight.regular,color:e.mediumTextColor,fontSize:n.Z.fontSize.UISmall.desktop,textAlign:"center"},text:{display:"inline"}})),[]);return(0,a.jsx)(r.Z,{style:c.tooltip,render:e=>(0,a.jsx)("div",{style:c.text,...e,children:t}),renderTooltip:()=>(0,a.jsxs)("div",{style:c.container,children:[l(c.icon),(0,a.jsx)("div",{children:o})]}),alignment:s.ZP.Alignment.Start,placement:s.ZP.Placement.Bottom})}},212740:(e,t,o)=>{"use strict";o.d(t,{Z:()=>F});o(757658);var i=o(667294),n=o(800480),s=o(886628),r=o(724405),a=o(406695),l=o(295519),c=o(421202),d=o(519889),u=o(709291),m=o(653965),p=o(307032),g=o(137810),h=(o(95477),o(566890)),f=o(317105),x=o(478379),v=o(80444),S=o(925489),b=o(788632),y=o(385555),C=o(619671),j=o(206258),w=o(176117),k=o(88893),L=o(288280),M=o(974123),B=o(278030),I=o(45653),D=o(629551),R=o(542297),Z=(o(551365),o(433929)),T=(o(61766),o(985526),o(813023),o(824118)),_=(o(753876),o(912867),o(785893));T.Ae;function A(e){return(0,s.VK)((()=>{if(!e)return{collectionStore:void 0,schema:void 0,format:void 0};const t=e.getAssociatedCollectionStore();let o,i;return o=t?t.getSchema():(0,R.Kc)(Z.default.getIntl()),t&&(i=(0,l.i)(t.getFormat(),o,void 0,a.j5.Collection)),{collectionStore:t,schema:o,format:i}}),[e])}const K=["Title","Pronoun","Teams (via Teams DB)","Office","Manager","Languages (Fluency)","Tenure"],P={"Teams (via Teams DB)":"Teams","Languages (Fluency)":"Languages"};function F(e){let{targetUserStore:t}=e;const o=(0,r.yK)((e=>({wrapper:{minWidth:100,maxWidth:300},profile:{padding:"10px 12px 12px 10px"},content:{padding:"8px 10px 10px"},breadcrumb:{color:e.text.secondary},profileTitle:{paddingLeft:20,fontSize:18,lineHeight:1.25,fontWeight:g.Z.fontWeight.semibold,color:e.text.primary},profileSubtitle:{paddingLeft:20,paddingTop:2,fontSize:g.Z.fontSize.UISmall.desktop,color:e.icon.primary,paddingBottom:1},profileMeetingContainer:{display:"flex",alignItems:"center",paddingLeft:20,paddingTop:2,cursor:"pointer"},profileMeetingLeftIcon:{},profileMeetingText:{paddingLeft:4,paddingRight:4,fontSize:g.Z.fontSize.UISmall.desktop,lineHeight:1.25,color:e.text.primary},profileMeetingRightIcon:{},profileKeyRow:{minWidth:80},profileKeyText:{textTransform:"capitalize",fontWeight:500},description:{padding:"6px 8px 12px 20px",fontSize:g.Z.fontSize.UISmall.desktop,color:e.icon.primary,borderTop:`1px solid ${e.regularDividerColor}`}})),[]),d=(0,s.VK)((()=>v.default.state.currentSpaceStore),[]),u=(0,s.VK)((()=>v.default.state.currentUserStore),[]),m=(0,s.VK)((()=>!!t&&t.isDefined()),[t]),f=(0,s.VK)((()=>{if(!t)return;const e=t.getEmail();if(!e)return;const o=y.default.getConfigKey("notion_people_block_id","data")[e];if(!o)return;return j.G.createChildStore(t,{table:c.iU,id:(0,p.Mt)(o)})}),[t]),{collectionStore:x,schema:b,format:w}=A(f),k=function(e){let{collectionStore:t,format:o,schema:i,userPeopleCollectionPageStore:n}=e;return(0,s.VK)((()=>{var e;if(!(t&&o&&i&&n))return;const s=(0,l.i)(o,i,void 0,a.j5.Collection),r=null==s||null===(e=s.collection_page_properties)||void 0===e?void 0:e.filter((e=>{var t;const o=null===(t=i[e.property])||void 0===t?void 0:t.name;return void 0!==o&&K.includes(o)}));if(!r)return;const c={};return r.forEach((e=>{var o;c[(null===(o=i[e.property])||void 0===o?void 0:o.name)||""]=(0,_.jsx)(M.Z,{store:n,property:e.property,locked:!0,disabled:!0,format:B.C.Page,onTab:()=>{},onUntab:()=>{},tableWrap:!1,blockPropertyValueOverlayStore:C.Z,collectionStore:t})})),c}),[t,i,o,n])}({collectionStore:x,format:w,schema:b,userPeopleCollectionPageStore:f}),L=(0,n.O7)(),I=(0,i.useMemo)((()=>new S.Z(L)),[L]);(0,i.useEffect)((()=>{x&&I.setContext({type:"collectionPage",collectionStore:x})}),[I,x]);const R=(0,s.VK)((()=>!!(t&&u&&m)&&t.id===u.id),[t,u,m]);return t&&m&&d?f&&I&&k?(0,_.jsx)("div",{style:o.wrapper,children:(0,_.jsx)(h.L1,{value:I,children:(0,_.jsxs)(D.Ht,{children:[(0,_.jsx)(D.gq,{gap:3,alignItems:"center",style:o.profile,children:(0,_.jsx)(V,{userStore:t,styles:o})}),(0,_.jsxs)("div",{style:o.description,children:[(0,_.jsx)(E,{userProfile:k,styles:o}),R?(0,_.jsx)(D.gq,{gap:1,alignItems:"center",children:(0,_.jsx)(z,{spaceStore:d,limit:5,styles:o})}):void 0]})]})})}):(0,_.jsx)("div",{style:o.wrapper,children:(0,_.jsxs)(D.Ht,{children:[(0,_.jsx)(D.gq,{gap:3,alignItems:"center",style:o.profile,children:(0,_.jsx)(V,{userStore:t,styles:o})}),R?(0,_.jsx)("div",{style:o.description,children:(0,_.jsx)(D.gq,{gap:1,alignItems:"center",children:(0,_.jsx)(z,{spaceStore:d,limit:5,styles:o})})}):void 0]})}):null}function V(e){let{userStore:t,styles:o}=e;const i=(0,u.useIntl)(),{name:n,email:r,firstName:a}=(0,s.VK)((()=>{var e;return{name:t.getFullName(i),email:t.getEmail(),firstName:null===(e=t.getFullName(i))||void 0===e?void 0:e.split(" ")[0]}}),[t,i]);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(I.Z,{userStore:t,size:70,borderStyle:"none"}),(0,_.jsxs)(D.Ht,{gap:1,children:[(0,_.jsx)("div",{style:o.profileTitle,children:n}),(0,_.jsx)("div",{style:o.profileSubtitle,children:r}),a?(0,_.jsxs)("div",{style:o.profileMeetingContainer,onClick:()=>{window.open(`https://calendar.notion.so/meet-with/${r}`,"_blank")},children:[(0,_.jsx)("div",{style:o.profileMeetingLeftIcon,children:(0,x.C)({width:12,height:12})}),(0,_.jsx)("div",{style:o.profileMeetingText,children:(0,_.jsx)(u.FormattedMessage,{id:"people.profile.setMeeting",defaultMessage:"Meet with {name}",values:{name:a}})}),(0,_.jsx)("div",{style:o.profileMeetingRightIcon,children:(0,f.J)({width:12,height:12})})]}):void 0]})]})}function E(e){let{userProfile:t,styles:o}=e;return t?(0,_.jsx)(_.Fragment,{children:K.filter((e=>t[e])).map((e=>(0,_.jsxs)(D.gq,{gap:1,alignItems:"center",children:[(0,_.jsx)(D.Ht,{children:(0,_.jsx)(D.gq,{style:o.profileKeyRow,children:(0,_.jsx)("div",{style:o.profileKeyText,children:P[e]?P[e]:e})})}),(0,_.jsx)(D.Ht,{style:{transform:"scale(0.9)",transformOrigin:"center left"},children:t[e]})]},e)))}):null}function z(e){let{spaceStore:t,limit:o,styles:i}=e;const{userSimilarityList:n}=(0,s.VK)((()=>{const e=L.subscriptionDataStoreInstance.state,i=e?k.CM(e):[],n=w.O.state||{},s=i.map((e=>{const t=n[e.userId];return{id:e.userId,similarity:t||0}})).sort(((e,t)=>t.similarity-e.similarity)).slice(0,o),r=[],a=m.yW(s.map((e=>{const o=j.U6.createChildStore(t,{table:d.KJ,id:e.id});return r.push({id:e.id,similarity:e.similarity,userStore:o}),o.isReady()})));return{isOnline:b.Z.state.online,subscriptionDataStoreData:e,userSimilarityData:w.O.state||{},visibleUsersLoaded:a,visibleUsers:i,userSimilarityList:r}}),[t,o]);return t&&n&&0!==n.length?(0,_.jsxs)(D.gq,{gap:1,alignItems:"center",style:{paddingTop:4},children:[(0,_.jsx)(D.Ht,{children:(0,_.jsx)(D.gq,{style:i.profileKeyRow,children:(0,_.jsx)("div",{style:i.profileKeyText,children:"Coworkers"})})}),(0,_.jsx)(D.Ht,{children:(0,_.jsx)(D.gq,{gap:5,children:(0,_.jsx)("div",{children:(0,_.jsx)("div",{style:{display:"flex",position:"relative",float:"right"},children:n.map((e=>(0,_.jsx)("div",{style:{marginLeft:1.5},children:(0,_.jsx)(I.Z,{userStore:e.userStore,size:18})},e.id)))})})})})]}):null}},293963:(e,t,o)=>{"use strict";o.d(t,{z:()=>a});o(667294);var i=o(724405),n=o(709291),s=o(785893);const r=8;function a(e){let{color:t,size:o,style:a}=e;const l=(0,n.useIntl)(),c=(0,i.yK)((e=>({dot:{height:o||r,width:o||r,background:t||e.blueColor,flexShrink:0,borderRadius:"100%",pointerEvents:"none",...a}})),[o,t,a]);return(0,s.jsx)("div",{role:"img","aria-label":l.formatMessage({id:"statusDot.ariaLabel",defaultMessage:"New"}),style:c.dot})}},66957:(e,t,o)=>{"use strict";o.d(t,{Z:()=>u});var i=o(667294),n=o(800480),s=o(886628),r=o(724405),a=o(460709),l=o(489728),c=o(785893);function d(e){let{tabs:t,selectedIndex:o,onChange:d,separatorIndexes:u,right:m,style:p,rightStyle:g,tabStyle:h,tabTitleStyle:f,selectedTabTitleStyle:x,tabBorderStyle:v,selectedTabStyle:S,readOnly:b,hideTabBorder:y}=e;const C=(0,i.useContext)(a.Xp),{device:j,WindowSizeStore:w}=(0,n.O7)(),{safePaddingLeft:k,safePaddingRight:L}=(0,s.VK)((()=>({safePaddingLeft:w.getSafePaddingLeftCSS(16),safePaddingRight:w.getSafePaddingRightCSS(16)})),[w]),M=(0,r.yK)((e=>{const t={paddingTop:6,paddingBottom:6,whiteSpace:"nowrap",minWidth:0,flexShrink:0,color:e.mediumTextColor,...h},o=`inset 0 -1px 0 ${e.regularDividerColor}`,i=C.menuType===a.og.Popup,n={fontSize:16,paddingTop:2,paddingLeft:i?16:k,paddingRight:i?16:L,zIndex:2,height:44,background:e.popoverBackground};return{container:{overflowY:"visible",overflowX:"auto",display:"flex",width:"100%",position:"relative",boxShadow:y?void 0:o,...j.isMobile?n:{fontSize:14,paddingLeft:8,paddingRight:8,zIndex:1},...p},separator:{display:"inline-flex",alignItems:"center",margin:"0 4px",paddingBottom:4,whiteSpace:"nowrap",minWidth:0,flexShrink:0,color:e.regularDividerColor},mobile:{},tab:t,selectedTab:{...t,position:"relative",color:e.regularTextColor,...S},border:{borderBottom:`2px solid ${e.regularTextColor}`,position:"absolute",bottom:0,left:8,right:8,...v},rightContainer:{flexGrow:1,display:"flex",alignItems:"center",justifyContent:"flex-end",color:e.mediumTextColor,...g}}}),[C.menuType,j.isMobile,g,k,L,S,p,v,h,y]);return(0,c.jsxs)("div",{className:"hide-scrollbar",style:M.container,children:[t.map(((e,t)=>{const n=t===o;return(0,c.jsxs)(i.Fragment,{children:[(0,c.jsxs)("div",{style:n?M.selectedTab:M.tab,children:[(0,c.jsx)(l.Z,{style:{...f,...n?x:{}},onClick:()=>d(t),disabled:b,mobileFeedback:j.isMobile,isLightGray:!Boolean(n),children:e}),n&&(0,c.jsx)("div",{style:M.border})]},`tabButton-${t}`),u&&u.includes(t)&&(0,c.jsx)("div",{style:M.separator,className:"notranslate",children:"|"},`${t}-separator`)]},t)})),m&&(0,c.jsx)("div",{style:M.rightContainer,children:m})]})}const u=i.memo(d)},972402:(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});var i=o(535431);class n extends i.Z{}const s=new n},983420:(e,t,o)=>{"use strict";o.d(t,{TL:()=>u,nc:()=>d,ue:()=>c});var i=o(266897),n=o(554368),s=o(177420),r=o(519889),a=o(401898),l=o(206258);function c(e){const{parentStore:t,pointer:o}=e,n=(0,l.Kv)(t,o).getValue();if(n)return(0,i.LU)({table:o.table,value:n})}function d(e){const{parentStore:t,pointer:o}=e;return o.table===s.cZ?l.Qx.createChildStore(t,o):o.table===r.KJ?l.U6.createChildStore(t,o):o.table===n.y0?l.fg.createChildStore(t,o):void(0,a.t1)(o)}function u(e){return e.table===s.cZ?(0,i.ON)(e.getValue()):e.table===r.KJ?(0,i.m3)(e.getValue()):e.table===n.y0?(0,i.I4)(e.getValue()):void(0,a.t1)(e)}},370345:(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});var i=o(667294),n=o(800480);function s(e){const t=(0,n.O7)(),{onLongPress:o,hapticsEnabled:s=!0,timeout:r=300}=e,a=(0,i.useCallback)((()=>{var e,i,n;s&&(null!==(e=t.mobileNative)&&void 0!==e&&e.buzz?t.mobileNative.buzz():null===(i=(n=window.navigator).vibrate)||void 0===i||i.call(n,20));o()}),[t.mobileNative,s,o]),l=(0,i.useRef)(),c=(0,i.useRef)(0),d=(0,i.useRef)(0),u=(0,i.useCallback)((()=>clearTimeout(l.current)),[]);(0,i.useEffect)((()=>u),[u]);return{onTouchStart:(0,i.useCallback)((()=>{clearTimeout(l.current),l.current=setTimeout(a,r)}),[r,a]),onTouchMove:(0,i.useCallback)((e=>{const t=e.touches[0].clientX,o=e.touches[0].clientY;(Math.abs(t-c.current)>50||Math.abs(o-d.current)>50)&&clearTimeout(l.current)}),[]),onTouchEnd:u,onTouchCancel:u}}},874638:(e,t,o)=>{"use strict";o.d(t,{K:()=>s});o(667294);var i=o(745238),n=o(785893);const s=(0,i.IU)("arrowDownSmall",{viewBox:"0 0 12 12",svg:(0,n.jsx)("path",{d:"M5.99756 0.850098C5.53564 0.850098 5.21875 1.17236 5.21875 1.65576V7.61768L5.27246 8.7832L4.19287 7.53711L2.98438 6.33398C2.84473 6.18896 2.66211 6.09229 2.42578 6.09229C2.00684 6.09229 1.68994 6.40381 1.68994 6.84424C1.68994 7.04834 1.77051 7.23633 1.93164 7.40283L5.42285 10.8994C5.56787 11.0498 5.78809 11.1357 5.99756 11.1357C6.2124 11.1357 6.42725 11.0498 6.57227 10.8994L10.0688 7.40283C10.23 7.23633 10.3105 7.04834 10.3105 6.84424C10.3105 6.40381 9.99365 6.09229 9.57471 6.09229C9.34375 6.09229 9.16113 6.18896 9.01611 6.33398L7.80762 7.53711L6.72803 8.7832L6.77637 7.61768V1.65576C6.77637 1.17236 6.46484 0.850098 5.99756 0.850098Z"})})},685917:(e,t,o)=>{"use strict";o.d(t,{V:()=>s});o(667294);var i=o(745238),n=o(785893);const s=(0,i.IU)("arrowLeft",{viewBox:"0 0 30 30",svg:(0,n.jsx)("polygon",{points:"29 14 4.813 14 13.406 5.406 12 4 1 15 12 26 13.406 24.594 4.813 16 29 16"})})},437292:(e,t,o)=>{"use strict";o.d(t,{r:()=>s});o(667294);var i=o(745238),n=o(785893);const s=(0,i.IU)("circleCheckFilled",{viewBox:"0 0 16 16",svg:(0,n.jsx)("path",{d:"M8 16c4.377 0 8-3.631 8-8 0-4.376-3.631-8-8.008-8C3.624 0 0 3.624 0 8c0 4.369 3.631 8 8 8zm-.886-4.165c-.267 0-.487-.11-.69-.384l-1.97-2.416a.852.852 0 01-.187-.51c0-.352.274-.643.627-.643.228 0 .4.07.596.33l1.592 2.055 3.35-5.38c.148-.236.352-.362.556-.362.345 0 .667.236.667.604 0 .173-.102.353-.196.518l-3.686 5.804c-.165.259-.393.384-.66.384z"})})},475070:(e,t,o)=>{"use strict";o.d(t,{O:()=>s});o(667294);var i=o(745238),n=o(785893);const s=(0,i.IU)("mention",{viewBox:"0 0 16 16",svg:(0,n.jsx)("path",{d:"M0.870117 8.40625C0.870117 4.01758 3.86426 1.09863 8.14355 1.09863C12.2109 1.09863 15.123 3.68945 15.123 7.6543C15.123 10.293 13.9131 12.1318 11.9443 12.1318C10.8506 12.1318 10.0439 11.5645 9.87988 10.6279H9.79785C9.4082 11.5781 8.62207 12.1318 7.57617 12.1318C5.77148 12.1318 4.53418 10.6143 4.53418 8.42676C4.53418 6.2666 5.76465 4.77637 7.52148 4.77637C8.52637 4.77637 9.36035 5.28906 9.70215 6.12305H9.79102V5.4668C9.79102 5.03613 10.0371 4.77637 10.4473 4.77637C10.8574 4.77637 11.0967 5.03613 11.0967 5.4668V9.85547C11.0967 10.5801 11.4932 11.0039 12.1904 11.0039C13.2363 11.0039 13.8926 9.69141 13.8926 7.74316C13.8926 4.26367 11.3223 2.28125 8.12988 2.28125C4.56836 2.28125 2.18262 4.81055 2.18262 8.44727C2.18262 12.2207 4.69141 14.4629 8.42383 14.4629C9.29883 14.4629 9.94141 14.3398 10.6797 14.1689C10.8164 14.1416 10.9326 14.1279 11.0283 14.1279C11.3428 14.1279 11.5547 14.3398 11.5547 14.6338C11.5547 14.9141 11.3975 15.1533 10.9463 15.3037C10.3242 15.5088 9.31934 15.6523 8.19824 15.6523C3.93262 15.6523 0.870117 12.8975 0.870117 8.40625ZM7.84277 10.9014C8.99805 10.9014 9.73633 9.93066 9.73633 8.41309C9.73633 6.92285 9.00488 5.98633 7.84961 5.98633C6.71484 5.98633 5.99707 6.93652 5.99707 8.44043C5.99707 9.95117 6.70801 10.9014 7.84277 10.9014Z"})})},656046:(e,t,o)=>{"use strict";o.d(t,{R:()=>i.R});var i=o(725651)},764152:(e,t,o)=>{"use strict";o.d(t,{_:()=>s});o(667294);var i=o(745238),n=o(785893);const s=(0,i.IU)("sendArrow",{viewBox:"0 0 20 20",svg:(0,n.jsx)("path",{d:"M9.79883 18.5894C14.6216 18.5894 18.5894 14.6216 18.5894 9.79883C18.5894 4.96777 14.6216 1 9.79053 1C4.95947 1 1 4.96777 1 9.79883C1 14.6216 4.96777 18.5894 9.79883 18.5894ZM9.79883 14.3062C9.20947 14.3062 8.76953 13.9077 8.76953 13.3433V9.69922L8.86914 8.00586L8.25488 8.84424L7.3916 9.81543C7.23389 10.0063 6.98486 10.1143 6.72754 10.1143C6.21289 10.1143 5.84766 9.75732 5.84766 9.25928C5.84766 8.99365 5.92236 8.79443 6.12158 8.58691L8.96045 5.61523C9.19287 5.35791 9.4585 5.2417 9.79883 5.2417C10.1309 5.2417 10.4048 5.36621 10.6372 5.61523L13.4761 8.58691C13.667 8.79443 13.75 8.99365 13.75 9.25928C13.75 9.75732 13.3848 10.1143 12.8618 10.1143C12.6128 10.1143 12.3638 10.0063 12.2061 9.81543L11.3428 8.86914L10.7202 7.99756L10.8281 9.69922V13.3433C10.8281 13.9077 10.3799 14.3062 9.79883 14.3062Z"})})},863334:(e,t,o)=>{"use strict";o.d(t,{Z:()=>s});var i=o(749085);class n extends i.default{getInitialState(){return{}}}const s=n},400939:e=>{var t=/[a-zA-Z0-9_\u0392-\u03c9\u00c0-\u00ff\u0600-\u06ff]+|[\u4e00-\u9fff\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g;e.exports=function(e){var o=e.match(t),i=0;if(!o)return 0;for(var n=0;n<o.length;n++)o[n].charCodeAt(0)>=19968?i+=o[n].length:i+=1;return i}}}]);