Module 664708

11,274 characters · in 64a86a8c231ea0ad.js, e8e4cbc2758f8e01.js
Dependencies
Source Raw
function(e,t,n){n.d(t,{A:()=>ep});var l=n(627968),i=n(64700),a=n(503698),s=n.n(a),r=n(505124),o=n(43990),u=n(683574);n(938796);var d=n(183812),c=n(665260),m=n(17928),g=n(459192),p=n(922016),h=n(460905),f=n(110384),x=n(939249),C=n(834730),I=n(493336),A=n(565645),j=n(822123),_=n(267889),v=n(228366),E=n(95701),M=n(232835),b=n(652215);let N=(0,m.UT)(M.A,{getQueryId:(e,t,n,l,i)=>null!=n&&null!=t&&null!=l&&i?e.id:null,get:e=>M.A.isReady(e.id)?M.A.getMessages(e.id):null,load:async(e,t,n,l)=>{if(null==n||null==t)return;let i=e.id;await I.A.fetchMessages({channelId:i,limit:100}),await v.h.dispatch({type:"THREAD_CREATE",channel:new E.Lt({id:i,parent_id:t,type:b.rbe.MEDIA_THREAD,name:e.title??"",guild_id:n??b.eGj,ownerId:l,threadMetadata:{archived:!0,autoArchiveDuration:60,locked:!0,invitable:!1}}),messageId:e.id})},getIsLoading:e=>M.A.isLoadingMessages(e.id)});var y=n(451909),T=n(118517),L=n(747926),S=n(734057),w=n(625494),P=n(475815);let k=(0,n(945810).mj)({kind:"user",name:"2026-05-clips-media-comments",defaultConfig:{enableMediaComments:!1},variations:{1:{enableMediaComments:!0}}});var R=n(307731),O=n(381941),H=n(16590),D=n(375708),$=n(731686);function G(e,t){let n=t?.current?.currentTime;return null==n?{attachment_id:e,timestamp:0}:{attachment_id:e,timestamp:Math.floor(1e3*n)}}function V(e){let{controlBarAnimationSpring:t,attachment:n,channelId:a,messageId:r,guildId:o,hidden:v=!1}=e,E=n.id,V=(0,j.QZ)(o).slice(0,3),z=(0,m.bG)([M.A],()=>M.A.getMessage(a,r),[a,r]),Z=(0,m.bG)([S.A],()=>S.A.getChannel(a),[a]),K=(0,m.bG)([S.A],()=>S.A.getChannel(E),[E]),{enableMediaComments:Y}=k.useConfig({location:"ClipEmbedMediaMentionBar"}),{activeLayer:B,videoRef:F}=(0,u.X$)(),Q=(0,c.Lt)(n.flags??0,b.sbO.HAS_TIMELINE_COMMENTS),{data:X}=N(n,a,o,z?.author.id,Y&&Q),J=i.useRef(null);function q(e,t){e?.stopPropagation(),function(e){if(null==Z||null==r||null==F?.current?.currentTime)return;let t=null!=e.id?!0===e.animated?`<a:${e.originalName??e.name}:${e.id}>`:`<:${e.originalName??e.name}:${e.id}>`:"surrogates"in e&&null!=e.surrogates?e.surrogates:e.name;I.A.sendMessage(Z.id,y.Ay.parse(Z,t),!1,{location:O.Hx.MEDIA_MENTION,doNotScroll:!0,messageReference:{channel_id:Z.id,guild_id:Z.getGuildId()??void 0,message_id:r},mediaMention:G(E,F)})}(t)}let W=X?.length??0;if(!Y||null==Z||null==r)return null;let ee=D.intl.formatToPlainString(H.default.OYDyt2,{count:W});return(0,l.jsxs)(d.animated.div,{className:s()($.M0,{[$.pd]:v}),inert:v,style:{opacity:(0,d.to)(t.to({range:[0,1],output:[0,1]}),e=>v?0:`${e}`),transform:(0,d.to)([t.to({range:[0,1],output:[42,0]})],e=>`translateY(${e}px) translateX(-50%)`)},children:[(0,l.jsx)("div",{className:$.gm,children:V.map(e=>(0,l.jsx)(g.u,{title:D.intl.formatToPlainString(H.default["CZCvn+"],{emoji:e.name}),body:D.intl.string(H.default.wQFVGI),children:(0,l.jsx)("button",{type:"button",className:$.x6,onClick:t=>q(t,e),children:(0,l.jsx)(A.A,{emojiId:e.id,emojiName:null!=e.id?e.name:e.surrogates,shouldAnimate:!1,animated:"animated"in e?e.animated:void 0,surrogate:"surrogates"in e?e.surrogates:void 0})})},`${e.id??0}:${e.name}`))}),(0,l.jsx)(U,{}),(0,l.jsx)(p.Y,{layerContext:B,targetElementRef:J,renderPopout:e=>{let{closePopout:t}=e;return(0,l.jsx)(_.A,{channel:Z,closePopout:t,messageId:r,pickerIntention:R.EmojiIntention.CHAT,onSelectEmoji:e=>{let{emoji:n}=e;null!=n&&(q(void 0,n),t())}})},position:"top",align:"center",clickTrap:!0,children:e=>(0,l.jsx)(g.u,{title:D.intl.string(H.default["ZEs/pI"]),body:D.intl.string(H.default.K8Khlc),targetElementRef:J,children:(0,l.jsx)("button",{...e,ref:J,type:"button",className:$.x6,children:(0,l.jsx)(h.n,{size:"sm"})})})}),(0,l.jsx)(g.u,{title:D.intl.string(H.default.y2TE38),body:D.intl.string(H.default.c3OIMS),children:(0,l.jsx)("button",{type:"button",className:$.x6,onClick:function(e){e.stopPropagation(),null==Z||null==z||null!=F?.current?.currentTime&&(P._U(F.current)&&P.sP(F.current),(0,T.Yf)({channel:Z,message:z,shouldMention:!e.shiftKey,showMentionToggle:!Z.isPrivate(),mediaMention:G(E,F)}),w._.dispatch(b.jej.FOCUS_CHANNEL_TEXT_AREA,{channelId:Z.id}))},children:(0,l.jsx)(f.W,{size:"sm"})})}),W>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(U,{}),(0,l.jsx)(x.D,{className:$.jC,tag:"span",onClick:function(e){e.stopPropagation(),null!=K&&(P._U(F.current)&&P.sP(F.current),(0,L.JA)(K))},"aria-label":ee,children:(0,l.jsx)(C.E,{variant:"text-sm/semibold",color:"text-link",lineClamp:1,children:ee})})]})]})}function U(){return(0,l.jsx)("div",{className:$.yF})}var z=n(534890),Z=n(661531),K=n(97808),Y=n(778712),B=n(7584);let F=/^<(a)?:(\w+):(\d+)>$/;var Q=n(521981),X=n(537452);function J(e){let{controlBarAnimationSpring:t,attachment:n,isActive:a,durationSeconds:s,guildId:r,channelId:o,messageId:u,hidden:g=!1}=e,{enableMediaComments:p}=k.useConfig({location:"ClipEmbedMediaMentionTimeline"}),h=(0,c.Lt)(n.flags??0,b.sbO.HAS_TIMELINE_COMMENTS),f=(0,m.bG)([M.A],()=>M.A.getMessage(o,u),[o,u]),{data:x}=N(n,o,r,f?.author.id,p&&h&&a);return(i.useEffect(()=>{a&&N.refetch(n,o,r,f?.author.id,p&&h&&a)},[a,n,o,r,f?.author.id,p,h]),!p||null==x||s<=0)?null:(0,l.jsx)(d.animated.div,{className:X.IO,inert:g,style:{opacity:a?(0,d.to)(t.to({range:[.5,1],output:[0,1]}),e=>g?0:`${e}`):1,transform:a?(0,d.to)([t.to({range:[0,1],output:[96,0]})],e=>`translateY(${e}px)`):"translateY(60px)"},children:x.map(e=>(0,l.jsx)(q,{message:e,durationSeconds:s},e.id))})}function q(e){let{message:t,durationSeconds:n}=e,a=`${Math.min(100,(t.mediaMention?.timestamp??0)/1e3/n*100)}%`,s=i.useMemo(()=>(function(e){let t=e.trim();if(0===t.length)return null;let n=t.match(F);return null!=n?{animated:"a"===n[1],emojiName:n[2],emojiId:n[3]}:""!==B.Ay.convertSurrogateToName(t,!1)?{surrogate:t,emojiName:t}:null})(t?.content??""),[t?.content]),r=i.useMemo(()=>null!=t&&""!==t.content?(0,Q.Ay)(t,{formatInline:!0}).content:null,[t]);if(null==t)return null;let o=(0,l.jsx)(x.D,{className:X.xL,style:{left:a},onClick:function(e){e.stopPropagation();let n=t.messageReference?.channel_id,l=t.messageReference?.message_id;null!=n&&null!=l&&I.A.jumpToMessage({channelId:n,messageId:l,flash:!0})},children:null!=s?(0,l.jsx)(A.A,{emojiId:s.emojiId,emojiName:s.emojiName,shouldAnimate:!1,animated:s.animated,surrogate:s.surrogate,className:X.Zg}):(0,l.jsx)(z.o,{colorClass:X.Or,color:Z.A.colors.ICON_OVERLAY_LIGHT,size:"refresh_sm"})});return null==r?o:(0,l.jsx)(g.u,{asset:(0,l.jsx)(K.eu,{src:t.author.getAvatarURL(void 0,16),size:Y._3.SIZE_16,"aria-hidden":!0}),assetSize:16,lineClamp:1,body:r,children:o})}var W=n(783384),ee=n(194498),et=n(376595),en=n(773503);let el=[];function ei(e){let{timeline:t,userIds:n,guildId:a,channelId:s}=e,r=i.useMemo(()=>et.H.fromAttachmentTimeline(t),[t]),[o,d]=i.useState({speakingUserIds:[],activeSoundboards:[]}),{videoRef:c}=(0,u.X$)();return(0,ee.A)(()=>{let e=c.current;if(null==e)return;let t=1e3*e.currentTime;d(r.getEventsAtTimestamp(t))}),(0,l.jsx)(en.A,{speakingUserIds:o.speakingUserIds,activeSoundboards:el,userIds:n,guildId:a,channelId:s})}var ea=n(915725),es=n(458977),er=n(352527),eo=n(996682),eu=n(27989);function ed(e){let{size:t="md",width:n,height:i,color:a=Z.A.colors.INTERACTIVE_ICON_DEFAULT,colorClass:s="",...r}=e,o=(0,eu.J)(t),u=o?.width??n,d=o?.height??i;return(0,l.jsxs)("svg",{...(0,eo.A)(r),width:u,height:d,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28.8334 13.3379C29.1092 13.3381 29.3332 13.562 29.3334 13.8379V25.3379C29.3334 27.5469 27.5423 29.3376 25.3334 29.3379H6.66738C4.45825 29.3379 2.66739 27.547 2.66738 25.3379V13.8379C2.66755 13.5619 2.89134 13.3379 3.16738 13.3379H28.8334ZM14.5853 15.7471C14.0777 15.2396 13.2551 15.2396 12.7475 15.7471L8.74746 19.7471C8.50377 19.9908 8.3666 20.3213 8.3666 20.666C8.3666 20.9676 8.47106 21.2589 8.66054 21.4902L8.74746 21.5849L12.7475 25.5849C13.2551 26.0923 14.0777 26.0924 14.5853 25.5849C15.0927 25.0773 15.0927 24.2547 14.5853 23.7471L12.8041 21.9658H16.0004C18.4117 21.9662 20.3666 23.9216 20.3666 26.333C20.3668 27.0508 20.9495 27.6328 21.6674 27.6328C22.3847 27.6322 22.967 27.0504 22.9672 26.333C22.9672 22.4857 19.8476 19.3666 16.0004 19.3662H12.8041L14.5853 17.5849C15.0927 17.0773 15.0927 16.2547 14.5853 15.7471Z",fill:"string"==typeof a?a:a.css,className:s}),(0,l.jsx)("path",{d:"M9.27675 4.02342C9.67707 3.95309 9.99001 4.3646 9.81484 4.73143L6.81191 11.0146C6.74229 11.1603 6.60667 11.2639 6.44765 11.292L3.27382 11.8515C3.00188 11.8995 2.74267 11.7172 2.69472 11.4453L2.31777 9.31248C1.93416 7.13691 3.38731 5.06133 5.56289 4.67772L9.27675 4.02342Z",fill:"string"==typeof a?a:a.css,className:s}),(0,l.jsx)("path",{d:"M19.7807 2.17088C20.1811 2.10027 20.494 2.51195 20.3187 2.87889L17.3168 9.16209C17.2472 9.30779 17.1116 9.4114 16.9525 9.43944L10.8852 10.5088C10.4848 10.5792 10.1718 10.1676 10.3471 9.80077L13.35 3.51756C13.4197 3.37203 13.5554 3.26921 13.7143 3.2412L19.7807 2.17088Z",fill:"string"==typeof a?a:a.css,className:s}),(0,l.jsx)("path",{d:"M24.2221 1.39745C26.2944 1.17734 28.2121 2.59832 28.5795 4.68163L28.9564 6.81541C29.0042 7.08724 28.822 7.34658 28.5502 7.39452L21.39 8.65721C20.9897 8.72774 20.6769 8.31607 20.8519 7.9492L23.8539 1.66698C23.9239 1.52058 24.0607 1.4146 24.2221 1.39745Z",fill:"string"==typeof a?a:a.css,className:s})]})}var ec=n(218474);function em(e){let{attachment:t,channelId:n,messageId:a,isControlBarExpanded:r,isPlayerActive:o}=e,{enableDistributedClips:u}=es.A.useConfig({location:"DistributedClipShareCTA"}),d=t.clip_remote_id,c=(0,m.bG)([ea.Ay],()=>null!=d?ea.Ay.getClipByRemoteId(d):null),{onShareClick:g}=(0,er.A)(n),p=(0,m.bG)([ea.Ay],()=>null!=c&&null!=n&&null!=d&&ea.Ay.wasClipSharedInChannel(d,n)),h=i.useCallback(e=>{null!=c&&(e.stopPropagation(),g({clips:[c],messageReference:{channel_id:n,message_id:a}}))},[g,c,n,a]);return!u||null==c||p?null:(0,l.jsxs)("button",{className:s()(ec.eZ,{[ec.vu]:r,[ec.jn]:!o}),onClick:h,children:[(0,l.jsx)(ed,{size:"refresh_sm",color:Z.A.colors.WHITE}),(0,l.jsx)(C.E,{variant:"text-xs/semibold",color:"text-overlay-light",children:D.intl.string(H.default.YKst58)})]})}var eg=n(668534);function ep(e){let{playerState:t,controlBarAnimationSpring:n,isControlBarExpanded:i,isActive:a,isVolumeExpanded:d,attachment:c,guildId:m,isFullScreen:g,showParticipants:p,showTextContent:h,channelId:f,messageId:x,showSpeakingIndicators:C,clipUserIds:I,durationSeconds:A}=e,{activeLayer:j}=(0,u.X$)();return(0,l.jsx)(o.N,{theme:r.NJ.MIDNIGHT,children:e=>(0,l.jsxs)("div",{className:s()(eg.MU,e),children:[(0,l.jsx)(W.A,{createdAt:null!=c.clip_created_at?Date.parse(c.clip_created_at):void 0,participantIds:p?I:[],applicationId:c.application?.id,title:c.title,guildId:m,playerState:t,isControlBarExpanded:i,isFullScreen:g,activeLayer:j,showTextContent:h}),null!=x&&null!=f&&(0,l.jsx)(em,{isControlBarExpanded:i,isPlayerActive:a,attachment:c,messageId:x,channelId:f}),C&&null!=c.clip_events_timeline&&null!=f&&(0,l.jsx)(ei,{guildId:m,timeline:c.clip_events_timeline,userIds:I,channelId:f}),a&&null!=m&&null!=f&&null!=x&&(0,l.jsx)(V,{controlBarAnimationSpring:n,attachment:c,channelId:f,messageId:x,guildId:m,hidden:!i||d}),null!=m&&null!=f&&null!=x&&(0,l.jsx)(J,{isActive:a,controlBarAnimationSpring:n,attachment:c,channelId:f,messageId:x,guildId:m,durationSeconds:c.duration_secs??A,hidden:a&&!i})]})})}}