Loading
function(e,n,t){t.d(n,{A:()=>em});var l=t(627968),i=t(64700),a=t(503698),s=t.n(a),r=t(505124),o=t(43990);t(938796);var u=t(372684),d=t(665260),c=t(17928),m=t(459192),g=t(922016),p=t(460905),h=t(110384),f=t(939249),x=t(834730),C=t(493336),I=t(565645),j=t(822123),A=t(334295),v=t(228366),_=t(95701),M=t(232835),b=t(652215);let E=(0,c.UT)(M.A,{getQueryId:(e,n,t,l,i)=>null!=t&&null!=n&&null!=l&&i?e.id:null,get:e=>M.A.isReady(e.id)?M.A.getMessages(e.id):null,load:async(e,n,t,l)=>{if(null==t||null==n)return;let i=e.id;await C.A.fetchMessages({channelId:i,limit:100}),await v.h.dispatch({type:"THREAD_CREATE",channel:new _.Lt({id:i,parent_id:n,type:b.rbe.MEDIA_THREAD,name:e.title??"",guild_id:t??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=t(451909),N=t(118517),L=t(747926),T=t(734057),S=t(625494);let w=(0,t(945810).mj)({kind:"user",name:"2026-05-clips-media-comments",defaultConfig:{enableMediaComments:!1},variations:{1:{enableMediaComments:!0}}});var k=t(307731),R=t(381941),P=t(16590),O=t(375708),H=t(909022);function D(e,n){let t=n?.current?.currentTime;return null==t?{attachment_id:e,timestamp:0}:{attachment_id:e,timestamp:Math.floor(1e3*t)}}function $(e){let{controlBarAnimationSpring:n,attachment:t,channelId:a,messageId:r,guildId:o,videoRef:v,hidden:_=!1}=e,$=t.id,z=(0,j.QZ)(o).slice(0,3),Z=(0,c.bG)([M.A],()=>M.A.getMessage(a,r),[a,r]),K=(0,c.bG)([T.A],()=>T.A.getChannel(a),[a]),V=(0,c.bG)([T.A],()=>T.A.getChannel($),[$]),{enableMediaComments:U}=w.useConfig({location:"ClipEmbedMediaMentionBar"}),Y=(0,d.Lt)(t.flags??0,b.sbO.HAS_TIMELINE_COMMENTS),{data:B}=E(t,a,o,Z?.author.id,U&&Y),F=i.useRef(null);function Q(e,n){e?.stopPropagation(),function(e){if(null==K||null==r||null==v?.current?.currentTime)return;let n=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;C.A.sendMessage(K.id,y.Ay.parse(K,n),!1,{location:R.Hx.MEDIA_MENTION,doNotScroll:!0,messageReference:{channel_id:K.id,guild_id:K.getGuildId()??void 0,message_id:r},mediaMention:D($,v)})}(n)}let q=B?.length??0;if(!U||null==K||null==r)return null;let J=O.intl.formatToPlainString(P.default.OYDyt2,{count:q});return(0,l.jsxs)(u.animated.div,{className:s()(H.M0,{[H.pd]:_}),inert:_,style:{opacity:(0,u.to)(n.to({range:[0,1],output:[0,1]}),e=>_?0:`${e}`),transform:(0,u.to)([n.to({range:[0,1],output:[42,0]})],e=>`translateY(${e}px) translateX(-50%)`)},children:[(0,l.jsx)("div",{className:H.gm,children:z.map(e=>(0,l.jsx)(m.u,{title:O.intl.formatToPlainString(P.default["CZCvn+"],{emoji:e.name}),body:O.intl.string(P.default.wQFVGI),children:(0,l.jsx)("button",{type:"button",className:H.x6,onClick:n=>Q(n,e),children:(0,l.jsx)(I.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)(G,{}),(0,l.jsx)(g.Y,{targetElementRef:F,renderPopout:e=>{let{closePopout:n}=e;return(0,l.jsx)(A.A,{channel:K,closePopout:n,messageId:r,pickerIntention:k.EmojiIntention.CHAT,onSelectEmoji:e=>{let{emoji:t}=e;null!=t&&(Q(void 0,t),n())}})},position:"top",align:"center",clickTrap:!0,children:e=>(0,l.jsx)(m.u,{title:O.intl.string(P.default["ZEs/pI"]),body:O.intl.string(P.default.K8Khlc),targetElementRef:F,children:(0,l.jsx)("button",{...e,ref:F,type:"button",className:H.x6,children:(0,l.jsx)(p.n,{size:"sm"})})})}),(0,l.jsx)(m.u,{title:O.intl.string(P.default.y2TE38),body:O.intl.string(P.default.c3OIMS),children:(0,l.jsx)("button",{type:"button",className:H.x6,onClick:function(e){e.stopPropagation(),null==K||null==Z||null!=v?.current?.currentTime&&((0,N.Yf)({channel:K,message:Z,shouldMention:!e.shiftKey,showMentionToggle:!K.isPrivate(),mediaMention:D($,v)}),S._.dispatch(b.jej.FOCUS_CHANNEL_TEXT_AREA,{channelId:K.id}))},children:(0,l.jsx)(h.W,{size:"sm"})})}),q>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(G,{}),(0,l.jsx)(f.D,{className:H.jC,tag:"span",onClick:function(e){e.stopPropagation(),null!=V&&(0,L.JA)(V)},"aria-label":J,children:(0,l.jsx)(x.E,{variant:"text-sm/semibold",color:"text-link",lineClamp:1,children:J})})]})]})}function G(){return(0,l.jsx)("div",{className:H.yF})}var z=t(534890),Z=t(661531),K=t(97808),V=t(778712),U=t(7584);let Y=/^<(a)?:(\w+):(\d+)>$/;var B=t(521981),F=t(933668);function Q(e){let{controlBarAnimationSpring:n,attachment:t,isActive:a,durationSeconds:s,guildId:r,channelId:o,messageId:m,hidden:g=!1}=e,{enableMediaComments:p}=w.useConfig({location:"ClipEmbedMediaMentionTimeline"}),h=(0,d.Lt)(t.flags??0,b.sbO.HAS_TIMELINE_COMMENTS),f=(0,c.bG)([M.A],()=>M.A.getMessage(o,m),[o,m]),{data:x}=E(t,o,r,f?.author.id,p&&h&&a);return(i.useEffect(()=>{a&&E.refetch(t,o,r,f?.author.id,p&&h&&a)},[a,t,o,r,f?.author.id,p,h]),!p||null==x||s<=0)?null:(0,l.jsx)(u.animated.div,{className:F.IO,inert:g,style:{opacity:a?(0,u.to)(n.to({range:[.5,1],output:[0,1]}),e=>g?0:`${e}`):1,transform:a?(0,u.to)([n.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:n,durationSeconds:t}=e,a=`${Math.min(100,(n.mediaMention?.timestamp??0)/1e3/t*100)}%`,s=i.useMemo(()=>(function(e){let n=e.trim();if(0===n.length)return null;let t=n.match(Y);return null!=t?{animated:"a"===t[1],emojiName:t[2],emojiId:t[3]}:""!==U.Ay.convertSurrogateToName(n,!1)?{surrogate:n,emojiName:n}:null})(n?.content??""),[n?.content]),r=i.useMemo(()=>null!=n&&""!==n.content?(0,B.Ay)(n,{formatInline:!0}).content:null,[n]);if(null==n)return null;let o=(0,l.jsx)(f.D,{className:F.xL,style:{left:a},onClick:function(e){e.stopPropagation();let t=n.messageReference?.channel_id,l=n.messageReference?.message_id;null!=t&&null!=l&&C.A.jumpToMessage({channelId:t,messageId:l,flash:!0})},children:null!=s?(0,l.jsx)(I.A,{emojiId:s.emojiId,emojiName:s.emojiName,shouldAnimate:!1,animated:s.animated,surrogate:s.surrogate,className:F.Zg}):(0,l.jsx)(z.o,{colorClass:F.Or,color:Z.A.colors.ICON_OVERLAY_LIGHT,size:"refresh_sm"})});return null==r?o:(0,l.jsx)(m.u,{asset:(0,l.jsx)(K.eu,{src:n.author.getAvatarURL(void 0,16),size:V._3.SIZE_16,"aria-hidden":!0}),assetSize:16,lineClamp:1,body:r,children:o})}var J=t(783384),W=t(194498),X=t(376595),ee=t(773503);let en=[];function et(e){let{timeline:n,userIds:t,videoRef:a,guildId:s,channelId:r}=e,o=i.useMemo(()=>X.H.fromAttachmentTimeline(n),[n]),[u,d]=i.useState({speakingUserIds:[],activeSoundboards:[]});return(0,W.A)(()=>{let e=a.current;if(null==e)return;let n=1e3*e.currentTime;d(o.getEventsAtTimestamp(n))}),(0,l.jsx)(ee.A,{speakingUserIds:u.speakingUserIds,activeSoundboards:en,userIds:t,guildId:s,channelId:r})}var el=t(915725),ei=t(458977),ea=t(352527),es=t(996682),er=t(27989);function eo(e){let{size:n="md",width:t,height:i,color:a=Z.A.colors.INTERACTIVE_ICON_DEFAULT,colorClass:s="",...r}=e,o=(0,er.J)(n),u=o?.width??t,d=o?.height??i;return(0,l.jsxs)("svg",{...(0,es.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 eu=t(310882);function ed(e){let{attachment:n,channelId:t,messageId:a,isControlBarExpanded:r,isPlayerActive:o}=e,{enableDistributedClips:u}=ei.A.useConfig({location:"DistributedClipShareCTA"}),d=n.clip_remote_id,m=(0,c.bG)([el.Ay],()=>null!=d?el.Ay.getClipByRemoteId(d):null),{onShareClick:g}=(0,ea.A)(t),p=(0,c.bG)([el.Ay],()=>null!=m&&null!=t&&null!=d&&el.Ay.wasClipSharedInChannel(d,t)),h=i.useCallback(e=>{null!=m&&(e.stopPropagation(),g({clips:[m],messageReference:{channel_id:t,message_id:a}}))},[g,m,t,a]);return!u||null==m||p?null:(0,l.jsxs)("button",{className:s()(eu.eZ,{[eu.vu]:r,[eu.jn]:!o}),onClick:h,children:[(0,l.jsx)(eo,{size:"refresh_sm",color:Z.A.colors.WHITE}),(0,l.jsx)(x.E,{variant:"text-xs/semibold",color:"text-overlay-light",children:O.intl.string(P.default.YKst58)})]})}var ec=t(834926);function em(e){let{playerState:n,controlBarAnimationSpring:t,isControlBarExpanded:i,videoRef:a,isActive:u,isVolumeExpanded:d,attachment:c,guildId:m,isFullScreen:g,showParticipants:p,showTextContent:h,channelId:f,messageId:x,showSpeakingIndicators:C,clipUserIds:I,durationSeconds:j}=e;return(0,l.jsx)(o.N,{theme:r.NJ.MIDNIGHT,children:e=>(0,l.jsxs)("div",{className:s()(ec.MU,e),children:[(0,l.jsx)(J.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:n,isControlBarExpanded:i,isFullScreen:g,showTextContent:h}),null!=x&&null!=f&&(0,l.jsx)(ed,{isControlBarExpanded:i,isPlayerActive:u,attachment:c,messageId:x,channelId:f}),C&&null!=c.clip_events_timeline&&null!=a&&null!=f&&(0,l.jsx)(et,{guildId:m,timeline:c.clip_events_timeline,videoRef:a,userIds:I,channelId:f}),u&&null!=m&&null!=f&&null!=x&&(0,l.jsx)($,{controlBarAnimationSpring:t,attachment:c,channelId:f,messageId:x,guildId:m,videoRef:a,hidden:!i||d}),null!=m&&null!=f&&null!=x&&(0,l.jsx)(Q,{isActive:u,controlBarAnimationSpring:t,attachment:c,channelId:f,messageId:x,guildId:m,durationSeconds:c.duration_secs??j,hidden:u&&!i})]})})}}