-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3783.js
1 lines (1 loc) · 12.6 KB
/
3783.js
1
"use strict";(("undefined"!=typeof self?self:global).webpackChunkclient_web=("undefined"!=typeof self?self:global).webpackChunkclient_web||[]).push([[3783],{94566:(e,t,n)=>{n.d(t,{Y:()=>c});var i=n(30758),s=n(95079),o=n(94079),a=n(77750),r=n(62867),l=n(86070);const c=({comments:e,renderComment:t})=>(0,l.jsx)(s.A,{component:null,children:e.map(((e,n)=>{const s=(0,i.createRef)();return(0,l.jsx)(o.A,{in:!0,nodeRef:s,timeout:a.xt,classNames:{enter:r.A.enter,enterActive:r.A.enterActive,exit:r.A.exit,exitActive:r.A.exitActive},children:(0,l.jsx)("div",{className:r.A.item,ref:s,children:(0,l.jsx)("div",{className:r.A.itemInner,children:t(e,n)})})},e.uri)}))})},3864:(e,t,n)=>{n.d(t,{c:()=>me});var i=n(30758),s=n(97500),o=n.n(s),a=n(94934),r=n(61e3),l=n(12431),c=n(93492),m=n(12367),u=n(62411),d=n(72574),g=n(55669),x=n(80918),h=n(56032),p=n(36419),C=n(78943),y=n(56695),b=n(71338),v=n(4586),j=n(98929),S=n(46581),R=n(55037),I=n(58897);var U=n(50107),k=n(86070);const w=({commentUri:e,entityUri:t,divider:n})=>{const s=(0,u.wA)(),{enqueueSnackbar:o}=(0,b.d)(),a=((e,t)=>{const n=(0,I.n)(),i=(0,j.jE)(),{mutate:s}=(0,S.n)({mutationFn:()=>n.deleteComment(e),onSettled:()=>{i.invalidateQueries({queryKey:R.K.byEntity(t)})}});return s})(e,t),{logDeleteComment:r}=(0,v._)(),l=(0,i.useCallback)((()=>{s(U.FR.actions.open({onConfirm:()=>{r(e),a(),o(c.Ru.get("web-player.user-comments.delete-comment-dialog.success"))}}))}),[e,a,s,o,r]);return(0,k.jsx)(y.D,{role:"menuitem",divider:n,onClick:l,leadingIcon:(0,k.jsx)(C.P,{semanticColor:"textSubdued",size:"small"}),children:c.Ru.get("contextmenu.delete")})};var E=n(98962),N=n(24395),D=n(69611),f=n(78172);const A=i.memo((function({commentUri:e,entityUri:t,author:n}){const{user:s}=(0,u.d4)(E.Ht),{spec:o,logger:a}=(0,D.o)(e),{uri:r,name:l,type:c}=n,{refreshComments:m}=(0,p.$)(t),C=(0,i.useCallback)((()=>setTimeout((()=>m()),500)),[m]),y=(0,i.useCallback)((()=>{const e=o.blockButtonFactory().hitBlockUser({userToBeBlocked:r});a.logInteraction(e),C()}),[r,C,a,o]);if(!s?.uri)return null;const b=(0,d.B2u)(s.uri,r);return r?(0,k.jsx)(N.pZ,{value:"comment",children:(0,k.jsx)(g.W,{children:b?(0,k.jsx)(w,{commentUri:e,entityUri:t}):(0,k.jsxs)(k.Fragment,{children:[c===f.c.USER&&(0,k.jsx)(x.X,{uri:r,name:l??"",currentUserUri:s?.uri,onBlock:y}),(0,k.jsx)(h.P,{spec:o,uri:e})]})})}):null}));var B=n(13317),T=n(75189);const F="UJjZEfOFY27iPvvtHVqP",O="iG_rhOCCEbMofMMzLToY",_="m5OZXQj7TeGCKUuoKUQJ",P="fDtd4a5aWLa0rMQxCmn4",z="BcqJ5242UcnkbIJ3PabB",L="LWpR7exIYyWovDOCykgZ",M="UHUP_LyhKA2NR6aaVysB",H="U8WSYONc9O5jC7ci4mHs",Y="OwozHdpYAKIM0oPuDJrd",K="ixHYU0G9pFyR9yXX2PEs",W="E0bOD7hg_tyr9WBjrmHq",q="PRJpBjbhDySrUCuVu2Jh",V=({author:e})=>(0,k.jsx)(B.b,{className:P,images:e.images,shape:e.type===f.c.USER?B.u.CIRCLE:B.u.ROUNDED_CORNERS,size:T.Qe.SIZE_32,iconSize:"small",type:e.type,title:e.name});var Z=n(94154);const Q=({creationDate:e,isPendingReview:t})=>{if(!e.isoString)return null;const n=e.isoString&&Date.now()-new Date(e.isoString).getTime()<6e4?c.Ru.get("web-player.user-comments.just-now"):c.Ru.formatRelativeDate(new Date(e.isoString),{year:"numeric",month:"short",day:"numeric",timeZone:"UTC"},new Date,1/0),i=t?c.Ru.get("web-player.user-comments.in-review"):void 0;return(0,k.jsxs)(Z.j,{hasTextSeparator:!0,children:[n,i]})};var G=n(87662),J=n(55158),X=n(39550),$=n(34855),ee=n(5119);const te=({commentUri:e,author:t})=>{const n=t.type===f.c.USER?(0,k.jsx)($.B,{uri:t.uri}):(0,k.jsx)(X.H,{uri:t.uri}),{logNavigateToCommentAuthor:s}=(0,v._)(),o=(0,i.useCallback)((()=>{s(e,t.uri)}),[t.uri,e,s]);return(0,k.jsxs)("span",{className:z,children:[t.type===f.c.SHOW?(0,k.jsx)(G.I,{size:"small",semanticColor:"textSubdued",className:L}):null,(0,k.jsx)(J.d,{lineClamp:1,as:"div",dir:"auto",variant:"bodySmallBold",className:z,children:(0,k.jsx)(m.h,{menu:n,children:(0,k.jsx)(ee.N,{to:t.uri,onClick:o,children:t.name})})})]})};var ne=n(79202),ie=n(585);const se=({imagesReacted:e})=>(0,k.jsx)("div",{className:H,children:(0,k.jsx)(B.b,{className:Y,images:e,shape:B.u.ROUNDED_CORNERS,size:T.Qe.SIZE_24,iconSize:"small",type:f.c.SHOW,title:""})}),oe=({comment:e,entityUri:t,imagesReacted:n})=>{const{logCommentMenuOpened:s}=(0,v._)(),o=(0,i.useCallback)((()=>{s(e.uri)}),[e.uri,s]);return(0,k.jsxs)("div",{className:M,children:[(0,k.jsx)("div",{className:O,children:(0,k.jsx)(ie.b,{menu:(0,k.jsx)(A,{commentUri:e.uri,entityUri:t,author:e.author}),onShow:o,children:(0,k.jsx)(ne.e,{size:"small",condensedAll:!0})})}),n&&n.length>0&&(0,k.jsx)(se,{imagesReacted:n})]})},ae=({commentUri:e,numReplies:t,images:n,onClick:s})=>{const{logSeeRepliesClicked:o}=(0,v._)(),a=(0,i.useCallback)((()=>{o(e),s?.()}),[e,o,s]);return(0,k.jsxs)(r.H,{condensedAll:!0,className:W,size:"small",semanticColor:"textBase",onClick:a,children:[(0,k.jsx)(B.b,{className:q,images:n,shape:B.u.ROUNDED_CORNERS,size:T.Qe.SIZE_16,iconSize:"small",type:f.c.SHOW,title:""}),c.Ru.get("web-player.user-comments.collapsed-reply.count",t)]})};var re=n(80119),le=n(86869);const ce=({comment:e,entityUri:t,lineClamp:n,scrollIntoViewOnMount:s})=>{const o=(0,i.useRef)(null),u=(0,le.K)({ref:o}),d=(0,re.z)(s),{uri:g,author:x,creationDate:h,text:p}=e,C=(0,k.jsx)(V,{author:x}),y=(0,k.jsx)(te,{commentUri:e.uri,author:x}),b=(0,k.jsx)(Q,{creationDate:h}),v=(0,k.jsx)(oe,{comment:e,entityUri:t}),j=(0,k.jsxs)("div",{className:_,children:[(0,k.jsx)(a.v,{ref:e=>{o.current=e?.querySelector("span")??null},semanticColor:"textBase",lineClamp:n,children:p}),u&&(0,k.jsx)(r.H,{semanticColor:"textBase",condensedAll:!0,size:"small",children:c.Ru.get("web-player.user-comments.see-more")})]});return(0,k.jsx)(m.h,{menu:(0,k.jsx)(A,{commentUri:e.uri,entityUri:t,author:e.author}),children:(0,k.jsx)(l.v,{ref:d,className:F,id:`comment-${g}`,size:"md",media:C,title:y,subtitle:b,trailing:v,layout:"wide",body:j,paddingInlineStart:"52px",paddingInlineEnd:"8px",paddingBlockStart:"8px",titleGap:"0",hoverAnimationDuration:"0ms",isInteractive:!0,children:e.text})})},me=({comment:e,entityUri:t,showSeparator:n,lineClamp:s,onClickNavigate:u,scrollIntoViewOnMount:d,collapseReplies:g=!0})=>{const x=(0,i.useRef)(null),h=(0,le.K)({ref:x}),p=(0,re.z)(d),{uri:C,id:y,author:b,creationDate:v,text:j,imagesReacted:S,imagesReplied:R,replies:I,isPendingReview:U}=e,w=(0,i.useCallback)((()=>{u?.(y)}),[u,y]),E=u?w:void 0,N=(0,k.jsx)(V,{author:b}),D=(0,k.jsx)(te,{commentUri:e.uri,author:b}),f=(0,k.jsx)(Q,{creationDate:v,isPendingReview:U}),B=(0,k.jsx)(oe,{comment:e,entityUri:t,imagesReacted:S}),T=I&&I.length>0?I[0]:null;let O=null;T&&(O=g?(0,k.jsx)(ae,{commentUri:e.uri,numReplies:I.length,images:R,onClick:E}):(0,k.jsx)(ce,{comment:T,entityUri:t,scrollIntoViewOnMount:d,lineClamp:s}));const P=(0,k.jsxs)("div",{className:_,children:[(0,k.jsx)(a.v,{ref:e=>{x.current=e?.querySelector("span")??null},semanticColor:"textBase",lineClamp:s,children:j}),h&&(0,k.jsx)(r.H,{semanticColor:"textBase",condensedAll:!0,size:"small",onClick:E,children:c.Ru.get("web-player.user-comments.see-more")})]});return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(m.h,{menu:(0,k.jsx)(A,{commentUri:e.uri,entityUri:t,author:e.author}),children:(0,k.jsx)(l.v,{ref:p,className:o()(F,{[K]:n}),"data-comment-id":e.id,id:`comment-${C}`,size:"md",media:N,title:D,subtitle:f,trailing:B,layout:"wide",body:P,paddingInlineStart:"8px",paddingInlineEnd:"8px",paddingBlockStart:"16px",paddingBlockEnd:"8px",titleGap:"0",onClick:E,hoverBackgroundColor:E?"backgroundElevatedHighlight":"backgroundHighlight",hoverAnimationDuration:"0ms",isInteractive:!0,children:e.text})}),O]})}},50974:(e,t,n)=>{n.d(t,{K:()=>a});var i=n(13505),s=n(8267),o=n(86070);const a=({eligibility:e})=>{const{message:t,isRestricted:n}=(0,s.K)(e);return n?(0,o.jsx)(i.E,{variant:"bodySmall",semanticColor:"textSubdued",children:t}):null}},28616:(e,t,n)=>{n.d(t,{U:()=>y});var i=n(30758),s=n(55158),o=n(74905),a=n(93492),r=n(94566),l=n(3864),c=n(12431),m=n(69678),u=n(77750),d=n(80119);const g="VOTkpOM9T_uWw08V0idk",x="tT7fcnVhS31dtZnzuc99",h="m212OynDr3xEToeQapwg";var p=n(86070);const C=({title:e,divider:t,scrollIntoViewOnMount:n})=>{const i=(0,d.z)(n);return(0,p.jsx)(c.v,{id:"sensitive-comments-section",ref:i,media:(0,p.jsx)("div",{className:g,children:(0,p.jsx)(m.q,{size:"small",semanticColor:"textSubdued"})}),title:e,trailing:t&&(0,p.jsx)("div",{className:x}),horizontalGap:"12px",paddingInlineStart:"0px","data-comment-id":u.bM})},y=({sensitiveComments:e,entityUri:t,navigateOnShowAll:n,scrollIntoViewOnMount:c})=>{const[m,d]=(0,i.useState)(!1),g=(0,i.useCallback)((()=>{n?n(u.bM):d(!0)}),[n]);return 0===e.length?null:m||c?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(C,{title:(0,p.jsx)(s.d,{variant:"bodySmall",semanticColor:"textSubdued",children:a.Ru.get("web-player.user-comments.sensitive.showing-all")}),divider:!0,scrollIntoViewOnMount:!0}),(0,p.jsx)(r.Y,{comments:e,renderComment:(e,n)=>(0,p.jsx)(l.c,{comment:e,entityUri:t,showSeparator:n>0,collapseReplies:!1},e.id)})]}):(0,p.jsx)(C,{title:(0,p.jsxs)(s.d,{variant:"bodySmall",semanticColor:"textSubdued",children:[a.Ru.get("web-player.user-comments.sensitive.disclaimer"),(0,p.jsx)(o.Y,{className:h,semanticColor:"textBase",onClick:g,children:a.Ru.get("web-player.user-comments.sensitive.show-all")})]})})}},55037:(e,t,n)=>{n.d(t,{K:()=>i});const i={all:["user-comments"],byEntity:e=>[...i.all,e],topComments:e=>[...i.byEntity(e),"top"],allComments:e=>[...i.byEntity(e),"all"]}},36419:(e,t,n)=>{n.d(t,{$:()=>c});var i=n(30758),s=n(98929),o=n(12265),a=n(46581),r=n(55037),l=n(58897);const c=e=>{const t=(0,l.n)(),n=(0,s.jE)(),{data:c,isLoading:m,isError:u,fetchNextPage:d}=(0,o.q)({queryKey:r.K.allComments(e),queryFn:({pageParam:n})=>t.getComments(e,n),initialPageParam:void 0,getNextPageParam:e=>e.nextPageToken,gcTime:36e5,staleTime:3e4}),g=(0,i.useCallback)((()=>{n.invalidateQueries({queryKey:r.K.byEntity(e)})}),[n,e]),{mutate:x,isPending:h}=(0,a.n)({mutationFn:n=>t.addComment(e,n),onSettled:()=>{g()}});return{data:(0,i.useMemo)((()=>c&&0!==c.pages.length?{comments:c.pages.flatMap((e=>e.comments)),eligibilityStatus:c.pages[0].eligibilityStatus,totalCount:c.pages[0].totalCount,nextPageToken:null}:null),[c]),fetchNextPage:d,addComment:x,isPendingComment:h,isLoading:m,isError:u,refreshComments:g}}},58897:(e,t,n)=>{n.d(t,{n:()=>o});var i=n(35988),s=n(18308);const o=()=>(0,s.N)(i.v)},77750:(e,t,n)=>{n.d(t,{bA:()=>s,bM:()=>o,xt:()=>i});const i=400,s="all-boxed-required",o="sensitive-comments"},4586:(e,t,n)=>{n.d(t,{_:()=>r});var i=n(30758),s=n(49180),o=n(72574),a=n(82362);const r=()=>{const{spec:e,logger:t}=(0,a.r)(s.U,{});return{logCommentConsentAccepted:(0,i.useCallback)((()=>{const n=e.commentConsentFormFactory().acceptButtonFactory().hitUiReveal();t.logInteraction(n)}),[t,e]),logSubmitComment:(0,i.useCallback)((n=>{const i=e.commentInputFieldFactory().submitButtonFactory().hitSubmitComment({entityId:n});t.logInteraction(i)}),[t,e]),logNavigateToCommentAuthor:(0,i.useCallback)(((n,i)=>{const s=(0,o.o_h)(i).toURLPath(!0),a=e.commentListFactory().commentRowFactory({uri:n}).commentAuthorLinkFactory().hitUiNavigate({destination:s});t.logInteraction(a)}),[t,e]),logSeeRepliesClicked:(0,i.useCallback)((n=>{const i=e.commentListFactory().commentRowFactory({uri:n}).seeRepliesLinkFactory().hitUiNavigate({destination:n});t.logInteraction(i)}),[t,e]),logCommentMenuOpened:(0,i.useCallback)((n=>{const i=e.commentListFactory().commentRowFactory({uri:n}).contextMenuButtonFactory().hitUiReveal();t.logInteraction(i)}),[t,e]),logDeleteComment:(0,i.useCallback)((n=>{const i=e.deleteCommentDialogFactory().confirmDeleteButtonFactory().hitDeleteComment({commentId:n});t.logInteraction(i)}),[t,e]),logCancelDeleteComment:(0,i.useCallback)((()=>{const n=e.deleteCommentDialogFactory().cancelButtonFactory().hitUiHide();t.logInteraction(n)}),[t,e]),logCommentsNPVCardImpression:(0,i.useCallback)((n=>{const i=e.npvCommentCardFactory({uri:n}).impression();t.logImpression(i)}),[t,e])}}},80119:(e,t,n)=>{n.d(t,{z:()=>s});var i=n(30758);const s=e=>{const t=(0,i.useRef)(null);return(0,i.useEffect)((()=>{e&&t.current&&t.current.scrollIntoView({block:"start",behavior:"smooth"})}),[e]),t}},8267:(e,t,n)=>{n.d(t,{K:()=>o});var i=n(93492),s=n(12667);const o=e=>{let t=null,n=!1;switch(e){case s.S.ELIGIBILITY_STATUS_DISABLED:t=i.Ru.get("web-player.user-comments.commenting-restrictions.disabled");break;case s.S.ELIGIBILITY_STATUS_NEW_USER_ACCOUNT:t=i.Ru.get("web-player.user-comments.commenting-restrictions.new-user-account");break;case s.S.ELIGIBILITY_STATUS_ALREADY_COMMENTED:t=i.Ru.get("web-player.user-comments.commenting-restrictions.already-commented");break;case s.S.ELIGIBILITY_STATUS_HIDDEN:n=!0}return{message:t,isRestricted:null!==t,isHidden:n}}},62867:(e,t,n)=>{n.d(t,{A:()=>i});const i={container:"HGjuMwWSWy3FYYnzyodc",header:"QnZJ_bXjwXU8Z1ELdttH",item:"SWm5_7dZbqBLpSa84ggz",enter:"V3Nj9Mnzlg09Xcdwk3TB",enterActive:"xROP0Ig23PJ2H5IU1c48",exit:"DXTPKhkIcqbD4TJYZep1",exitActive:"dF6Pl3ng7XHrYQ3m6WjC",itemInner:"o9Qze90DYZNMlWhHYnbI"}}}]);