Loading
function(e,t,n){"use strict";n.d(t,{HG:()=>nu,Sk:()=>ng,C:()=>nc,v7:()=>nm,Zx:()=>nr,L0:()=>np,N_:()=>nd,MD:()=>nx,Ay:()=>nC,uW:()=>nA,NO:()=>no,ck:()=>nf,ml:()=>nh,Vu:()=>na});var l=n(627968),i=n(64700),s=n(503698),r=n.n(s),a=n(143236),o=n(284009),c=n.n(o),u=n(942381),d=n(607399),h=n(136722),m=n(17928),p=n(192308),f=n(187322),g=n(511274),x=n(465532),A=n(765671),C=n(775602),E=n(793574),I=n(688810),y=n(177640),S=n(989837),v=n(289873),_=n(268218),N=n(750506),T=n(60809),j=n(375708),b=n(131552);let R={width:500,height:T.$V},O=(0,_.Fe)({createPromise:()=>Promise.all([n.e("98600"),n.e("56377"),n.e("30402"),n.e("44899"),n.e("55801"),n.e("57505"),n.e("34552"),n.e("93103"),n.e("71210"),n.e("88342"),n.e("37977"),n.e("42451"),n.e("98965"),n.e("71273"),n.e("80854"),n.e("35395"),n.e("43780"),n.e("35313"),n.e("54975"),n.e("8362"),n.e("71133"),n.e("54625"),n.e("49697"),n.e("27773"),n.e("52229"),n.e("61268"),n.e("18024"),n.e("78195"),n.e("22261"),n.e("41701"),n.e("74021"),n.e("37065"),n.e("22094"),n.e("83518"),n.e("61764"),n.e("59848"),n.e("68974"),n.e("56385"),n.e("59132"),n.e("89203"),n.e("35621")]).then(n.bind(n,854379)),webpackId:854379,renderLoader:()=>(0,l.jsx)("div",{className:b.R4,style:R,children:(0,l.jsx)(v.y,{})})}),M={height:T.$V},L=i.memo(function(e){let{positionTargetRef:t,align:n,...i}=e;return(0,l.jsx)("span",{style:T.sK,children:(0,l.jsx)(N.nE,{className:b.T8,targetRef:t,position:"top",align:n??"right",spacing:24,autoInvert:!0,nudgeAlignIntoViewport:!0,clickTrap:!0,children:e=>{let{isPositioned:t}=e;return(0,l.jsx)("section",{className:b.V6,role:"dialog",style:M,"aria-label":j.intl.string(j.t["3CNGLK"]),children:t&&(0,l.jsx)(O,{...i})})}})})});var w=n(861382),k=n(735438),P=n.n(k),D=n(537652),U=n(155718),G=n(95561),V=n(659280),F=n(579940),H=n(962125),B=n(915089),W=n(850992),K=n(464651),z=n(286509),Z=n(721768),Y=n(842209),q=n(210978),J=n(392054),$=n(168186),X=n(990078),Q=n(939249),ee=n(802019),et=n(649671),en=n(282214);let el=[16,8,8,8];function ei(e){let{className:t,channel:n,sections:s,activeCategoryIndex:a,filteredSectionId:o,onSectionClick:c,applicationCommandListRef:u}=e,d=i.useRef(null),h=i.useCallback((e,t)=>{let n=8;return s[t+1]?.type===J.Hf.BUILT_IN&&(n+=8),32+n},[s]),m=i.useCallback((e,t)=>t?8*(s[e+1]?.type!==J.Hf.BUILT_IN):8*(0!==e),[s]),p=i.useCallback((e,t)=>{let i=s[t];if(null==i)return;let r=(0,et.Rg)(i),u=4*(i.type===J.Hf.BUILT_IN),d=32-2*u,h=(0,l.jsx)(r,{channel:n,section:i,isSelected:null!=o?i.id===o:a===t,padding:u,width:d,height:d,selectable:!0}),m=i.type!==J.Hf.BUILT_IN&&t<s.length-1&&s[t+1].type===J.Hf.BUILT_IN;return(0,l.jsxs)("div",{className:en.uW,children:[(0,l.jsx)(X.m,{text:i.name,position:"right",asContainer:!0,children:(0,l.jsx)(Q.D,{"aria-label":i.name,onClick:()=>{c(i)},children:h})}),m?(0,l.jsx)("hr",{className:en.zQ}):null]},i.id)},[a,n,c,s,o]);return 0===s.length?null:(0,l.jsx)("div",{className:r()(t,en.iE),children:(0,l.jsx)(ee.A,{categoryListRef:d,expressionsListRef:u,store:W.LS,categories:s,className:en.p_,renderCategoryListItem:p,rowCount:s.length,categoryHeight:h,listPadding:el,getScrollOffsetForIndex:m})})}var es=n(746388),er=n(73510),ea=n(652215),eo=n(13297),ec=n(911385);let eu=[8,8,0,8],ed=P().debounce(()=>{(0,G.zV)(ea.HAw.APPLICATION_COMMAND_BROWSER_SCROLLED)},300),eh=i.forwardRef(function(e,t){let{channel:n,canOnlyUseTextCommands:s}=e,a=i.useRef(!1),o=i.useRef(0),[c,u]=i.useState(0),d=i.useRef(null),[h,m]=i.useState(!1),p=W.LS.useStore(e=>e.activeCategoryIndex);i.useEffect(()=>{(0,G.zV)(ea.HAw.APPLICATION_COMMAND_BROWSER_OPENED)},[]);let{sectionDescriptors:f,activeSections:g,commandsByActiveSection:x,hasMoreAfter:A,commands:C,filteredSectionId:E,scrollDown:I,filterSection:y}=Y.cu({context:{channel:n,type:"channel"},filters:{commandTypes:[U.kc.CHAT],builtIns:s?q.n.ONLY_TEXT:q.n.ALLOW,applicationCommands:!s},options:{placeholderCount:7,limit:er.Hi,includeFrecency:!0},allowFetch:!0}),S=(0,K.Fk)({activeCategoryIndex:p,isScrolling:a,listRef:d,onActiveCategoryIndexChange:e=>{let t=g[e];if(null!=t){let e=f.findIndex(e=>e.id===t.id);W.LS.setActiveCategoryIndex(e)}},scrollOffset:20,searchQuery:""}),v=e=>{let t=g.length,n=x.reduce((e,t)=>e+t.data.length,0)-7*!!A;A&&e+420>48*t+56*n-512&&I(),S(e),ed(),o.current=e},_=i.useRef(v);i.useEffect(()=>{_.current=v}),i.useEffect(()=>{_.current(o.current)},[C]);let N=i.useCallback(e=>e!==g.length-1||A?16:0,[g.length,A]),T=x.map(e=>e.data.length);i.useEffect(()=>{null!=d.current&&h&&null!=c&&d.current.scrollRowIntoView(c)},[h,c]),i.useLayoutEffect(()=>{null!=E&&d.current?.scrollToSectionTop(0)},[C,E]);let b=i.useCallback(e=>{e.id===E||e.id===er.Ik.FRECENCY?(y(null),d.current?.scrollToSectionTop(0)):y(e.id)},[y,E]),R=i.useCallback((e,t,l)=>{Z.Gf({channelId:n.id,command:e,section:t,location:J.Oh.DISCOVERY,triggerSection:l})},[n.id]);i.useImperativeHandle(t,()=>({onTabOrEnter:e=>{if(null==c)return!e&&(u(0),!0);if(null==c)return!1;let t=0,n=0;for(let e of x)if(t=n,c<(n+=e.data.length)){let n=e.data[c-t],l=f.find(e=>e.id===n.applicationId);R(n,l,(0,$.$S)(e.section));break}return!0},onMoveSelection:e=>{if(0===C.length)return!0;let t=7*!!A,n=C.length+t,l=null==c?0:c+e;return l>=n?l=n-1:l<0&&(l=0),u(l),m(!0),!0}}),[C.length,x,A,f,R,c]);let O=i.useCallback(e=>{let t=g[e];if(null==t)return null;let i=(0,et.Rg)(t),s=(0,l.jsx)(i,{channel:n,section:t,width:16,height:16,padding:0});return(0,l.jsx)(z.A,{className:eo.Km,icon:s,children:t.name},e)},[n,g]),M=i.useCallback((e,t)=>{let n=e===g.length-1,i=g[e],{data:s}=x[e];return(0,l.jsxs)("ul",{role:"group","aria-label":i.name,className:r()(eo.Wy,{[eo.YD]:n}),children:[t,0===s.length&&(0,l.jsx)(D.A,{message:j.intl.format(j.t.WoQXT6,{applicationName:i.name}),noResultsImageURL:ec,className:eo.qK})]},e)},[g,x]),L=i.useCallback((e,t)=>{let i=x[t.sectionIndex],s=i.data[t.sectionRowIndex],r=`${i.section.id}:${s?.id??e}`;if(null==s||i.section.id!==s.applicationId&&i.section.id!==er.Ik.FRECENCY||s.inputType===J.y$.PLACEHOLDER)return(0,l.jsx)(es.A,{},r);let a=f.find(e=>e.id===s.applicationId);return(0,l.jsx)(V.Ay.NewCommand,{index:e,command:s,channel:n,className:eo.D5,selected:c===e,showImage:i.section.id!==s.applicationId,section:a,onClick:()=>R(s,a,(0,$.$S)(i.section)),onHover:()=>{u(null),m(!1)}},r)},[n,x,R,f,c]),w=(0,B.GV)();return(0,F.gf)(w,!0,(0,V.aI)(c)),i.useEffect(()=>()=>{(0,F.nQ)()},[]),(0,l.jsxs)(V.Ay,{id:w,className:eo.x9,innerClassName:eo.iE,onMouseDown:em,children:[(0,l.jsx)(ei,{className:eo.H$,channel:n,sections:f,filteredSectionId:E,activeCategoryIndex:p,onSectionClick:b,applicationCommandListRef:d}),(0,l.jsx)(H.A,{role:"listbox",className:eo.p_,listPadding:eu,onScroll:v,renderRow:L,renderSection:M,renderSectionHeader:O,rowCount:g.length,rowCountBySection:T,rowHeight:56,sectionHeaderHeight:32,sectionMarginBottom:N,ref:d,stickyHeaders:!0})]})});function em(e){e.preventDefault()}var ep=n(702841),ef=n(305070),eg=n(31498),ex=n(598071),eA=n(151271),eC=n(731231),eE=n(256265),eI=n(703244),ey=n(857071),eS=n(135621),ev=n(105330),e_=n(495544),eN=n(559908),eT=n(620141),ej=n(224964),eb=n(31408),eR=n(536283);function eO(e){let{editorHeight:t,textValue:n,channelId:l}=e,s=i.useRef(n),r=(0,ev.l)({editorHeight:t}),a=(0,ej.A)(),o=(0,m.bG)([eN.Ay,e_.default],()=>eN.Ay.isComboing(e_.default.getId(),l)),c=r?.left??0,u=(r?.top??0)-16,d=0===n.length,h=i.useMemo(()=>.05>Math.random(),[d]);return i.useEffect(()=>{0!==n.length&&n!==s.current&&o&&(a.fire(c,u,h?{sprite:eR.dR}:null),s.current=n)},[n,o,c,u,h,a]),null}function eM(e){return(0,l.jsx)(eT.A,{confettiLocation:eb.k.CHAT_INPUT,children:(0,l.jsx)(eO,{...e})})}var eL=n(931664),ew=n(631576),ek=n(68935),eP=n(406704),eD=n(885386),eU=n(696451),eG=n(576705),eV=n(309010),eF=n(638128),eH=n(522602),eB=n(287809),eW=n(821102),eK=n(174459),ez=n(234320),eZ=n(625494),eY=n(488926),eq=n(723702),eJ=n(486319),e$=n(355622),eX=n(112541),eQ=n(834730),e0=n(140735),e1=n(176781),e2=n(463930),e6=n(935063),e3=n(252545),e7=n(650019),e4=n(763754),e8=n(967144),e5=n(118517),e9=n(976860),te=n(747926),tt=n(232835),tn=n(285796),tl=n(630816);function ti(e){let{onClick:t,"aria-label":n}=e;return(0,l.jsx)(Q.D,{className:tl.b,onClick:t,"aria-label":n,children:(0,l.jsx)(tn.a,{size:"md",color:"currentColor",className:tl.u})})}var ts=n(1468);let tr="channel-reply-bar-a11y-description";function ta(e){let{channel:t,message:n,replyChainLength:s}=e,r=i.useRef(s);return i.useEffect(()=>{r.current=s}),i.useEffect(()=>{(0,G.zV)(ea.HAw.THREAD_NUDGE_SHOWN,{type:"Reply Chain (3)",reply_chain_length:r.current+1,channel_id:t.id,guild_id:t.guild_id})},[t]),(0,l.jsxs)(Q.D,{onClick:function(){(0,e5.Jx)(t.id),(0,te.Tv)(t,n,"Reply Chain Nudge")},className:ts._r,focusProps:{offset:{right:-4,left:-4}},children:[(0,l.jsx)(eQ.E,{color:"text-default",className:ts.Qq,variant:"text-sm/normal",children:j.intl.format(j.t.B3V0FM,{count:Math.min(10,s+1)})}),(0,l.jsx)(eQ.E,{color:"text-link",className:ts.NG,variant:"text-sm/semibold",children:j.intl.string(j.t.rBIGBL)})]})}function to(e){let t,n,{reply:s,chatInputType:a}=e,{channel:o,message:c,shouldMention:u,showMentionToggle:d,mediaMention:h}=s,{guildId:p,nick:f,colorString:g,colorStrings:x,colorRoleName:A,authorId:C,displayNameStyles:E}=(0,e4.Ay)(c),I=(0,e8.gn)(p,C,x),y=(0,e3.a)({displayNameStyles:E}),S=(0,e7.A)(h,c.attachments),v=(t=o.id,n=c.id,(0,m.bG)([tt.A],()=>{let e=n;for(let n=0;n<10;n++){let l=tt.A.getMessage(t,e);if(l?.type!==ea.lAJ.REPLY||null==l.messageReference)return n;e=l.messageReference.message_id}return 10},[t,n])),_=(0,eP.n)(o,c),N=a.showThreadPromptOnReply&&v>=2&&_;return(0,l.jsx)("div",{className:ts.e1,children:(0,l.jsxs)("div",{className:ts.kL,children:[(0,l.jsxs)("div",{className:ts.eU,children:[(0,l.jsx)(e0.A,{id:tr,children:j.intl.formatToPlainString(j.t.EpJL4E,{username:f})}),(0,l.jsx)(Q.D,{onClick:()=>(0,e9.pX)(ea.BVt.CHANNEL(o.getGuildId(),o.id,c.id)),focusProps:{offset:{top:-8,right:-4,bottom:-8,left:-4}},children:(0,l.jsx)(eQ.E,{color:"text-default",className:r()(ts.Qq,ts.Fn),variant:"text-sm/normal",children:j.intl.format(j.t["8E4GxS"],{userHook:(e,t)=>(0,l.jsxs)(i.Fragment,{children:["\xa0",S?.title!=null?(0,l.jsxs)("span",{className:ts.H8,children:[S.isClip&&(0,l.jsx)(e1.x,{size:"xs",color:"currentColor",className:ts.gS}),(0,l.jsx)(eQ.E,{variant:"text-sm/semibold",color:"text-default",className:ts.NV,children:S.title}),(0,l.jsxs)(eQ.E,{variant:"text-sm/normal",color:"text-link",children:["@",S.timestamp]})]}):(0,l.jsx)(e2.g,{className:ts.UU,name:f,colorString:g,colorStrings:I,roleName:A,displayNameStylesFont:y})]},t)})})}),(0,l.jsxs)("div",{className:ts.o1,children:[d&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(X.m,{asContainer:!0,text:u?j.intl.string(j.t.DH2o6R):j.intl.string(j.t.utGGIY),children:(0,l.jsx)(Q.D,{role:"switch","aria-checked":u,onClick:function(e){e.stopPropagation(),(0,e5.vz)(o.id,!u)},children:(0,l.jsxs)(eQ.E,{variant:"text-sm/bold",color:u?"text-link":"text-muted",className:ts.Z4,children:[(0,l.jsx)(e6.X,{size:"md",color:"currentColor","aria-label":j.intl.string(j.t.P8tvKG),className:ts.mM}),u?j.intl.string(j.t.p9jC2r):j.intl.string(j.t.U7f3bK)]})})}),(0,l.jsx)("div",{className:ts.me,"aria-hidden":!0})]}),(0,l.jsx)(ti,{onClick:function(e){e.stopPropagation(),(0,e5.Jx)(o.id)},"aria-label":j.intl.string(j.t.jSnJGT)})]})]}),N&&(0,l.jsx)(ta,{channel:o,message:c,replyChainLength:v})]})})}var tc=n(749314),tu=n(148355),td=n(74995);let th=i.memo(function(e){let{channelId:t,chatInputType:n}=e,[s,r]=i.useState(null),a=(0,m.bG)([eL.A],()=>eL.A.getStickerPreview(t,n.drafts.type));return n.stickers?.allowSending&&null!=a&&0!==a.length?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:td.Tz,children:a.map(e=>(0,l.jsxs)("div",{className:td.dp,children:[(0,l.jsx)(Q.D,{onFocus:()=>r(e.id),onBlur:()=>r(null),className:td.b,"aria-label":j.intl.formatToPlainString(j.t.BGAQRd,{name:e.name}),onClick:()=>(0,ew.x5)(t,n.drafts.type),children:(0,l.jsx)("div",{className:td.Nk,children:(0,l.jsx)(tn.a,{size:"md",color:"currentColor",className:td.ut})})}),(0,l.jsx)(tu.A,{isInteracting:s===e.id,className:td.UV,size:48,sticker:e})]},e.id))}),(0,l.jsx)(tc.A,{className:td.R})]}):null});var tm=n(612394);n(321073);var tp=n(442433);n(827669);var tf=n(448702);function tg(e){let t,s,a,{className:o,activeCommand:c,activeOption:u,optionStates:d,channelId:h}=e,m=i.useCallback(e=>{let t=c?.rootCommand?.id;null==t?e.preventDefault():(0,tp.L3)(e,async()=>{let{default:e}=await n.e("15687").then(n.bind(n,646938));return n=>(0,l.jsx)(e,{...n,id:t,label:j.intl.string(j.t.oJ1Muw)})})},[c?.rootCommand?.id]),p=i.useCallback(()=>{Z.Gf({channelId:h,command:null,section:null})},[h]);if(null==c)return null;if(null!=u){let e=d[u.name].lastValidationResult;t=u.displayName,s=u.displayDescription,a=e?.success?null:e?.error}else t=`/${c.displayName}`,s=c.displayDescription,a=null;return(0,l.jsxs)("div",{className:r()(o,tf.M0),onContextMenu:m,children:[(0,l.jsxs)("div",{className:tf.iz,children:[(0,l.jsx)("span",{className:tf.UU,children:t}),null!=a?(0,l.jsx)("span",{className:tf.z3,children:a}):(0,l.jsx)("span",{className:tf.h_,children:s})]}),(0,l.jsx)("div",{className:tf.o1,children:(0,l.jsx)(ti,{onClick:p,"aria-label":j.intl.string(j.t.cpT0Cq)})})]})}var tx=n(228366),tA=n(734057);let tC=new Set;class tE extends m.Ay.PersistedStore{static displayName="PTOStore";static persistKey="PTOStore";initialize(e){this.waitFor(tA.A,eU.Ay,eV.A,eB.default),null!=e&&(tC=new Set(e))}hasId(e){return tC.has(e)}getState(){return[...tC]}}let tI=new tE(tx.h,{}),ty=()=>{let e=eV.A.getChannelId();if(null==e)return;let t=tA.A.getChannel(e);null!=t&&t.isPrivate()&&(tC.has(t.getRecipientId())||(tC.add(t.getRecipientId()),tI.emitChange()))},tS=()=>(0,l.jsxs)("div",{className:ts.eU,children:[(0,l.jsx)(eQ.E,{variant:"text-sm/medium",className:r()(ts.Qq,ts.Fn),children:j.intl.string(j.t["2UvR1E"])}),(0,l.jsx)("div",{className:ts.o1,children:(0,l.jsx)(ti,{onClick:ty,"aria-label":j.intl.string(j.t.cpT0Cq)})})]});var tv=n(278351);let t_=e=>{let{error:t}=e;return(0,l.jsxs)("div",{className:tv.M,children:[(0,l.jsx)(eQ.E,{variant:"text-xs/bold",color:"text-strong",children:j.intl.string(j.t["4VDCG0"])}),t?(0,l.jsx)(eQ.E,{variant:"text-xs/medium",className:tv.z,children:j.intl.string(j.t.qNorwt)}):(0,l.jsx)(eQ.E,{variant:"text-xs/medium",color:"text-muted",children:j.intl.string(j.t["260qZS"])})]})};var tN=n(575293),tT=n(151282),tj=n(1372);function tb(e){let{pendingScheduledMessage:t}=e,{channelId:n,scheduledTimestamp:i}=t;return(0,l.jsx)("div",{className:tj.e1,children:(0,l.jsx)("div",{className:tj.kL,children:(0,l.jsxs)("div",{className:tj.g3,children:[(0,l.jsx)(eQ.E,{color:"text-default",className:r()(tj.Qq,tj.a3),variant:"text-sm/normal",children:j.intl.formatToPlainString(j.t["MQcRX/"],{timestamp:new Date(i).valueOf()})}),(0,l.jsx)("div",{className:tj.o1,children:(0,l.jsx)(ti,{onClick:function(e){e.stopPropagation(),(0,tT.Ps)(n)},"aria-label":j.intl.string(j.t.cpT0Cq)})})]})})})}var tR=n(266599);function tO(e){let{bars:t}=e,n=t.stacked.map((e,t)=>(0,l.jsx)("div",{children:e},t)),s=t.floating.map((e,t)=>(0,l.jsx)(i.Fragment,{children:e},t));return 0===n.length&&0===s.length?null:(0,l.jsxs)(i.Fragment,{children:[s.length>0&&(0,l.jsx)("div",{className:tR.Vq,children:s}),n.length>0&&(0,l.jsx)("div",{className:tR.MD,children:n})]})}var tM=n(729666),tL=n(562708),tw=n(150934),tk=n(139286),tP=n(47167),tD=n(713654),tU=n(252263),tG=n(8455),tV=n(67259),tF=n(355026);function tH(e){let{thread:t,pendingScheduledMessage:n}=e,s=(0,tG.Vp)({location:"ThreadsAlsoSendToChannelArea"}),[r,a]=(0,m.yK)([tA.A,tV.A],()=>[t.isThread()?tA.A.getChannel(t.parent_id):null,tV.A.getAlsoSendToChannel(t.id)]),o=(0,tP.Ay)(r),c=i.useCallback(e=>{eK.default.track(ea.HAw.MESSAGE_ALSO_SEND_TO_CHANNEL_TOGGLED,{value:e,guild_id:t.guild_id,channel_id:t.id}),(0,tU.B)({channelId:t.id,enabled:e})},[t]);if((0,tk.A)({name:tL.ImpressionNames.MESSAGE_ALSO_SEND_TO_CHANNEL,type:tL.ImpressionTypes.VIEW},{disableTrack:null==r||!s.enabled},[r,s.enabled]),!s.enabled||null==r)return null;let u=(0,tD.gU)(r),d=j.intl.format(j.t.UqL10G,{callToActionHook:(e,t)=>(0,l.jsx)(eQ.E,{variant:"text-sm/normal",color:"text-subtle",lineClamp:1,className:tF.Pf,children:j.intl.string(j.t.Pi3JW7)},t),channelName:o,channelNameHook:(e,t)=>(0,l.jsxs)(eQ.E,{variant:"text-sm/normal",color:"text-subtle",lineClamp:1,className:tF.Pf,children:[null==u?null:(0,l.jsx)(u,{color:"currentColor",className:tF.Kk},t),e]},t)});return(0,l.jsx)("div",{className:tF.kL,children:(0,l.jsx)(tw.S,{checked:a,disabled:null!=n,onChange:c,label:d,labelType:"secondary"})})}function tB(e){let{channel:t,type:n,pendingScheduledMessage:i}=e,{shouldShow:s}=function(e){let{channel:t,type:n}=e,l=(0,m.bG)([tA.A],()=>{let e=tA.A.getChannel(t.parent_id);return e?.isForumLikeChannel()??!1}),i=[e$.oU.NORMAL,e$.oU.SIDEBAR].includes(n);return{shouldShow:t.isThread()&&!l&&i}}({channel:t,type:n});return s?(0,l.jsx)(tH,{thread:t,pendingScheduledMessage:i}):null}var tW=n(822610),tK=n(625928),tz=n(670482),tZ=n(621466),tY=n(902001),tq=n(899536),tJ=n(929788),t$=n(74833),tX=n(216964),tQ=n(387758),t0=n(39623),t1=n(267102),t2=n(186306),t6=n(339871),t3=n(820066),t7=n(128934);function t4(e){let{editorRef:t,options:n,iconClassName:i,dividerClassName:s}=e,a=t.current?.getSlateEditor();return null==a?null:(0,l.jsxs)("div",{className:t7.Uo,children:[(0,l.jsx)(t5,{slateEditor:a,markdownSyntax:"bold",children:(0,l.jsx)(tY.$,{size:"md",color:"currentColor",className:r()(t7.Kk,i)})}),(0,l.jsx)(t5,{slateEditor:a,markdownSyntax:"italics",children:(0,l.jsx)(tq.y,{size:"md",color:"currentColor",className:r()(t7.Kk,i)})}),(0,l.jsx)(t5,{slateEditor:a,markdownSyntax:"underline",children:(0,l.jsx)(tJ.q,{size:"md",color:"currentColor",className:r()(t7.Kk,i)})}),(0,l.jsx)(t5,{slateEditor:a,markdownSyntax:"strikethrough",children:(0,l.jsx)(t$.t,{size:"md",color:"currentColor",className:r()(t7.Kk,i)})}),(0,l.jsx)("div",{className:r()(t7.yF,s)}),!n?.disableBlockQuotes&&(0,l.jsx)(t9,{slateEditor:a,blockType:"blockQuote",children:(0,l.jsx)(tX.c,{size:"md",color:"currentColor",className:r()(t7.Kk,i)})}),!n?.disableInlineCode&&(0,l.jsx)(t5,{slateEditor:a,markdownSyntax:"inlineCode",children:(0,l.jsx)(tQ.G,{size:"custom",width:20,height:20,color:"currentColor",className:r()(t7.Kk,i)})}),(0,l.jsx)(t5,{slateEditor:a,markdownSyntax:"spoiler",children:(0,l.jsx)(t0.b,{size:"md",color:"currentColor",className:r()(t7.Kk,i)})})]})}let t8=i.forwardRef(function(e,t){let{editorRef:n,containerRef:s,options:r}=e,a=i.useRef(null),[o,c]=i.useState(!1),u=i.useRef(null),d=i.useContext(t1.Ay),h=i.useCallback(()=>{c(!1),clearTimeout(u.current)},[]),m=i.useCallback(e=>{let t=d.renderWindow;e.target instanceof t.Node&&a.current?.contains(e.target)||h()},[d,h]),p=i.useCallback(e=>{let t=d.renderWindow;if(e.target instanceof t.Element)if(0!==e.button)h();else{let n=e.target instanceof t.Node&&a.current?.contains(e.target);clearTimeout(u.current),u.current=setTimeout(()=>{let t=(0,tZ.BF)(e)?.activeElement,l=s.current;c(n||null!=t&&null!=l&&l.contains(t))},100)}else h()},[d,s,h]);i.useImperativeHandle(t,()=>({hide:h}),[h]),i.useEffect(()=>{let e=d.renderWindow;return e.document.addEventListener("keydown",h),e.document.addEventListener("mousedown",m),e.document.addEventListener("mouseup",p),e.addEventListener("focus",h),e.addEventListener("blur",h),()=>{e.document.removeEventListener("keydown",h),e.document.removeEventListener("mousedown",m),e.document.removeEventListener("mouseup",p),e.removeEventListener("focus",h),e.removeEventListener("blur",h),clearTimeout(u.current)}},[d,h,m,p]);let{x:f,y:g}=i.useMemo(()=>{let e=n.current?.getSlateEditor();if(e?.selection==null||t3.ZF.isCollapsed(e.selection)||!o)return{x:null,y:null};let t=tz.rL.findDocumentOrShadowRoot(e),l=t.getSelection();if(null==l||null==l.focusNode||null==l.anchorNode||l.isCollapsed)return{x:null,y:null};let i=t.createRange();i.setStart(l.focusNode,l.focusOffset),i.setEnd(l.focusNode,l.focusOffset);let r=i.getBoundingClientRect(),a=t.createRange();a.setStart(l.anchorNode,l.anchorOffset),a.setEnd(l.anchorNode,l.anchorOffset);let c=a.getBoundingClientRect(),u=t.createRange();u.setStart(l.anchorNode,l.anchorOffset),u.setEnd(l.focusNode,l.focusOffset);let d=u.getBoundingClientRect(),h=r.x===c.x,m=h?d.x:Math.min(r.x,c.x);return{x:m+((h?d.x+d.width:Math.max(r.x,c.x))-m)/2,y:Math.max(s.current?.getBoundingClientRect()?.y??0,Math.min(c.y,r.y))}},[s,o,n]),[x,A]=i.useState(0),[C,E]=i.useState(0);return(i.useLayoutEffect(()=>{if(null==f||null==g||null==a.current)return;let e=a.current.getBoundingClientRect();E(e.width/2),A(e.height+12)},[f,g]),null==f||null==g||null==n.current?.getSlateEditor())?null:(0,l.jsx)(N.Ay,{children:(0,l.jsx)("div",{id:"slate-toolbar",ref:a,className:t7.KE,style:{top:g-x,left:f-C},onMouseDown:e=>{e.stopPropagation()},onMouseUp:e=>{e.stopPropagation()},children:(0,l.jsx)(t4,{editorRef:n,options:r})})})});function t5(e){let{slateEditor:t,markdownSyntax:n,children:i}=e,s=!1;if(t?.selection!=null){let[e,l]=t3.ZF.edges(t.selection);s=null!=(0,t6.Sx)(t,e,l).before[n]}return(0,l.jsx)(f.vN,{children:(0,l.jsx)("button",{"aria-label":function(e){switch(e){case"bold":return j.intl.string(j.t.XI2CUr);case"italics":return j.intl.string(j.t.a96YKu);case"underline":return j.intl.string(j.t.PdIYwI);case"strikethrough":return j.intl.string(j.t["63uDvE"]);case"inlineCode":return j.intl.string(j.t.iBerkZ);case"spoiler":return j.intl.string(j.t["F+x38C"])}}(n),"aria-pressed":s,className:t7.x6,onClick:()=>{null!=t&&t2.o.withSingleEntry(t,()=>(0,t6.Px)(t,n))},children:i})})}function t9(e){let{blockType:t,slateEditor:n,children:i}=e,s=null!=n?t3.VW.getCurrentBlock(n):null,r=null!=s&&t3.AS.isType(s[0],t);return(0,l.jsx)(f.vN,{children:(0,l.jsx)("button",{"aria-label":function(e){if("blockQuote"===e)return j.intl.string(j.t.svB7eY)}(t),"aria-pressed":r,className:t7.x6,onClick:()=>{null!=n&&t2.o.withSingleEntry(n,()=>(0,t6.fO)(n,t))},children:i})})}var ne=n(922016),nt=n(375499),nn=n(267889),nl=n(307731);function ni(e){let{editorRef:t,type:n,channel:s}=e,r=t.current?.getSlateEditor(),a=i.useRef(null),o=i.useCallback(e=>{let{emoji:n,willClose:l}=e,i=t.current;null!=n&&null!=i&&i.insertEmoji({emoji:n,willClose:l}),l&&(0,eA.v8)()},[t]);return null==r?null:(0,l.jsxs)("div",{id:"slate-toolbar",className:t7.aL,children:[(0,l.jsx)("div",{className:t7.Wy,children:(0,l.jsx)(t4,{editorRef:t,options:n.markdown,iconClassName:t7.C7,dividerClassName:t7.us})}),(0,l.jsx)(ne.Y,{targetElementRef:a,renderPopout:e=>{let{closePopout:t}=e;return(0,l.jsx)(nn.A,{persistSearch:!0,channel:s,closePopout:t,onSelectEmoji:e=>{let{emoji:n,willClose:l}=e;o({emoji:n,willClose:l}),l&&t()},pickerIntention:n.expressionPicker?.emojiIntention??nl.EmojiIntention.COMMUNITY_CONTENT})},position:"bottom",animation:ne.Y.Animation.NONE,align:"left",children:(e,t)=>{let{isShown:n}=t;return(0,l.jsx)(nt.A,{...e,ref:a,active:n,className:t7.Z8,tabIndex:0})}})]})}var ns=n(698279);function nr(e,t,s,r,a){let[o,c]=i.useState(!1),u=i.useCallback((i,d,h,m,f,g)=>{if(o)return;c(!0);let A=eL.A.getStickerPreview(a,t.drafts.type)?.map(e=>e.id)??[],C=eH.A.getUploads(a,t.drafts.type)??[];if(null==d&&!m&&!f&&(0,eE.xz)(C,a)){c(!1),(0,p.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("23311"),n.e("81113"),n.e("4495"),n.e("24351"),n.e("46009"),n.e("86003"),n.e("81564"),n.e("90665"),n.e("49681"),n.e("76602"),n.e("34530"),n.e("28229"),n.e("21921"),n.e("39970"),n.e("72789"),n.e("65437"),n.e("79745"),n.e("5500"),n.e("32209"),n.e("49697"),n.e("68763"),n.e("58337"),n.e("18997"),n.e("47177"),n.e("26437"),n.e("98972"),n.e("12682"),n.e("33097"),n.e("36150"),n.e("99011"),n.e("15172"),n.e("10014"),n.e("86861"),n.e("70961"),n.e("23685"),n.e("42516"),n.e("84688")]).then(n.bind(n,538899));return t=>(0,l.jsx)(e,{...t,threadId:a,attachments:C,sendMessage:()=>u(i,void 0,void 0,void 0,!0)})});return}e({value:i,uploads:C,stickers:A,command:d,commandOptionValues:h,isGif:m,gifMetadata:g}).then(e=>{let{shouldClear:n,shouldRefocus:l}=e,i=(n&&t.submit?.clearOnSubmit)??!1,o=null!=s.current;i&&(a!==eV.A.getChannelId()?x.A.saveDraft(a,"",t.drafts.type):o&&(s.current?.clearValue(),r.current?.hide())),o&&(c(!1),(0,eA.v8)(),l&&s.current?.focus())})},[s,r,e,o,t,a]);return{submitting:o,submit:u,handleSubmit:i.useCallback(e=>{s?.current?.submit(e)},[s])}}function na(e,t,n){return i.useCallback(l=>{if(t===e$.oU.CREATE_FORUM_POST||t===e$.oU.CREATE_ANNOUNCEMENT_POST)n.current?.insertGIF(l);else{let t={gif_provider:l.provider??(0,eI.cf)(),load_id:eW.A.getAnalyticsID(),source_object:"GIF Picker",gif_url:l.url,gif_id:l.id};e(l.url,void 0,void 0,!0,void 0,t)}(0,eA.v8)(),n.current?.focus()},[n,e,t])}function no(e){return i.useCallback(t=>{let{emoji:n,willClose:l}=t,i=e.current;null!=n&&null!=i&&i.insertEmoji({emoji:n,willClose:l}),l&&(0,eA.v8)()},[e])}function nc(e){let{editorRef:t,disabled:n,textValue:l,channelId:s,chatInputType:r,submit:a}=e,{analyticsLocations:o}=(0,I.Ay)();return i.useCallback((e,i)=>{n||(r===e$.oU.CREATE_ANNOUNCEMENT_POST||(0,ek.YS)(i,l,s,r.drafts.type)?((0,tm.fh)({sticker:e,stickerSelectLocation:i,isReplacement:null!=eL.A.getStickerPreview(s,r.drafts.type),analyticsLocations:o}),(0,ew.$x)(s,e,r.drafts.type)):(a({value:"",uploads:void 0,stickers:[e.id]}),t.current?.clearValue()),(0,eA.v8)(),t.current?.focus())},[n,l,s,t,o,a,r])}function nu(e){return i.useCallback(t=>{let n=e.current;null!=n&&n.insertKaomoji(t),(0,eA.v8)(),n?.focus()},[e])}function nd(e,t,n){let l=i.useCallback(()=>{t||(0,eA.r$)(ns.kx.EMOJI,e,n)},[t,e,n]),s=i.useCallback(()=>{!t&&e.gifs?.allowSending&&(0,eA.r$)(ns.kx.GIF,e,n)},[t,e,n]),r=i.useCallback(()=>{!t&&e.stickers?.allowSending&&(0,eA.r$)(ns.kx.STICKER,e,n)},[t,e,n]);(0,ez.Vo)({event:ea.jej.TOGGLE_EMOJI_POPOUT,handler:l}),(0,ez.Vo)({event:ea.jej.TOGGLE_GIF_PICKER,handler:s}),(0,ez.Vo)({event:ea.jej.TOGGLE_STICKER_PICKER,handler:r})}function nh(e,t,n){let[l]=i.useState(()=>new a.EventEmitter);return i.useEffect(()=>{l.emit("text-changed",t,n)},[t,n,l]),{eventEmitter:l,handleEditorSelectionChanged:t=>{null!=e.current&&l.emit("selection-changed",t)}}}function nm(){let e=i.useRef(null),t=i.useCallback(()=>{e.current?.onMaybeShowAutocomplete()},[]),n=i.useCallback(()=>{e.current?.onHideAutocomplete()},[]);return{autocompleteRef:e,handleMaybeShowAutocomplete:t,handleHideAutocomplete:n}}function np(e){let t=i.useRef(null);if(null!=e&&"function"==typeof e)throw Error("Only Ref objects are supported");return null==e?t:e}function nf(e){let[t,n]=i.useState(0);return{editorHeight:t,handleResize:i.useCallback(t=>{n(t??0),e?.(t)},[e])}}function ng(e,t,n,l){let i=e.getGuildId(),s=(0,m.bG)([ey.A],()=>null!=i&&ey.A.isLurking(i),[i]),r=(0,m.bG)([eU.Ay,eB.default],()=>{let e=eB.default.getCurrentUser();return(null!=i&&null!=e?eU.Ay.getMember(i,e.id)?.isPending:null)??!1}),a=(0,m.cf)([eG.A],()=>{let i=e.isPrivate(),s=eG.A.computePermissions(e),a=h.zy(s,ea.xBc.CREATE_PUBLIC_THREADS)||h.zy(s,ea.xBc.CREATE_PRIVATE_THREADS),o=(!t.permissions?.requireCreateTherads||a)&&(!t.permissions?.requireSendMessages||h.zy(s,ea.xBc.SEND_MESSAGES)),c=o&&h.zy(s,ea.xBc.ATTACH_FILES),u=null!=n,d=(0,eP.UJ)(e);return{disabled:l||r||!i&&!o||d,canAttachFiles:!0===t.attachments&&(i||r||c||u),canCreateThreads:a,canEveryoneSendMessages:eY.MJ(ea.xBc.SEND_MESSAGES,e)}},[e,t.permissions.requireCreateTherads,t.permissions.requireSendMessages,t.attachments,n,l,r]);return{isLurking:s,isPendingMember:r,...a}}function nx(e,t,n){let[l,s,r]=(0,eA.RQ)(e=>[e.activeView,e.activeViewType,e.activeChannelId],u.x),a=(0,m.bG)([S.A],()=>S.A.shouldShowPopup()&&S.A.activeViewType()===e&&S.A.activeChannelId()===n);i.useEffect(()=>()=>{(0,eA.v8)(e,n)},[e,n]);let o=i.useCallback(()=>{null!=l||a||t.current?.handleOuterClick()},[l,a,t]),c=null==l||null==s||s!==e||r!==n;return{expressionPickerView:l,shouldHideExpressionPicker:c,handleOuterClick:o}}let nA=(e,t)=>({handleAutocompleteVisibilityChange:i.useCallback(n=>{n&&(0,eA.v8)(e,t)},[e,t])}),nC=i.memo(i.forwardRef(function(e,t){let n,{textValue:s,richValue:a,className:o,innerClassName:u,editorClassName:h,id:p,required:x,disabled:v,placeholder:_,accessibilityLabel:N,channel:T,type:j,focused:b,error:R,renderAttachButton:O,renderApplicationCommandIcon:M,renderButtons:k,pendingReply:P,onChange:D,onResize:U,onBlur:G,onFocus:V,onKeyDown:F,onSubmit:H,promptToUpload:B,highlighted:W,canMentionRoles:K,canMentionChannels:z,maxCharacterCount:Z,showRemainingCharsAfterCount:Y,allowNewLines:q=!0,characterCountClassName:J,"aria-describedby":$,"aria-labelledby":X,setEditorRef:Q,autoCompletePosition:ee,children:et,disableThemedBackground:en=!1,emojiPickerCloseOnModalOuterClick:el,parentModalKey:ei,pendingScheduledMessage:es,showValueWhenDisabled:er=!1}=e;c()(null!=j,"chat input type must be set");let{analyticsLocations:eo}=(0,I.Ay)(E.A.CHANNEL_TEXT_AREA),ec=np(t),eu=i.useRef(null),ed=i.useRef(null),em=i.useRef(null),eE=i.useRef(null),eI=i.useRef(null);Q?.(em.current);let ey=(0,y.A)(T),[ev,e_]=i.useState(!ey);(0,A.i4)(ec,e=>{let{width:t}=e;return e_(!ey&&(null==t||t>450))});let{activeCommand:eN,activeCommandSection:eT}=(0,m.cf)([w.A],()=>({activeCommand:j.commands?.enabled?w.A.getActiveCommand(T.id):null,activeCommandSection:j.commands?.enabled?w.A.getActiveCommandSection(T.id):null})),{isLurking:ej,isPendingMember:eb,disabled:eR,canAttachFiles:eO,canCreateThreads:eL,canEveryoneSendMessages:ew}=ng(T,j,eN,v),ek=j.toolbarType===e$.O1.STATIC,eP=!eD.D_.useSetting()&&!(0,eq.isAndroidWeb)()&&null!=window.ResizeObserver,eG=!eP||!j.commands?.enabled||!b||"/"!==s,eV=(0,eS.A)(),{fontSize:eH}=(0,m.cf)([C.A],()=>({fontSize:C.A.fontSize})),eW=(0,m.bG)([eF.A],()=>eF.A.isEnabled());nd(j,eR,T.id);let{eventEmitter:ez,handleEditorSelectionChanged:eY}=nh(em,s,a),eQ=i.useRef(s);eQ.current=s;let e0=i.useCallback((e,t,n)=>{"/"===t&&""===eQ.current&&j.commands?.enabled&&ez.emit("command-sentinel-typed"),D?.(e,t,n)},[D,j.commands?.enabled,ez]),{submitting:e1,submit:e2,handleSubmit:e6}=nr(H,j,em,eI,T.id),{autocompleteRef:e3,handleMaybeShowAutocomplete:e7,handleHideAutocomplete:e4}=nm(),e8=na(e2,j,em),e5=no(em),e9=nc({editorRef:em,disabled:eR,textValue:s,channelId:T.id,chatInputType:j,submit:H}),te=i.useCallback((e,t,n)=>{let l=em.current;null!=e&&null!=l&&(eK.default.track(ea.HAw.SOUNDMOJI_SELECT,{channel_id:T.id,guild_id:T.guild_id,sound_guild_id:e.guildId,sound_id:e.soundId,source:t}),l.insertSound(e)),n&&(0,eA.v8)(),l?.focus()},[em,T.id,T.guild_id]),tt=nu(em),tn=i.useCallback(()=>eI?.current?.hide(),[]),{editorHeight:tl,handleResize:ti}=nf(U),{handleTab:ts,handleEnter:ta,handleMoveSelection:tc}=(n=i.useCallback(()=>!!(!eG&&eu.current?.onTabOrEnter(!1))||e3.current?.onTabOrEnter(!1)||!1,[eG,eu,e3]),{handleTab:n,handleEnter:i.useCallback(()=>!!(!eG&&eu.current?.onTabOrEnter(!0))||e3.current?.onTabOrEnter(!0)||!1,[eG,eu,e3]),handleMoveSelection:i.useCallback(e=>!!(!eG&&eu.current?.onMoveSelection(e))||e3.current?.onMoveSelection(e)||!1,[eG,eu,e3])}),{expressionPickerView:tu,shouldHideExpressionPicker:td,handleOuterClick:tm}=nx(j,em,T.id),{selectedAutocompleteInputType:tp,selectedAutocompleteInputError:tf}=function(e,t){let[n,l]=i.useState({selectedAutocompleteInputType:null,selectedAutocompleteInputError:!1}),s=i.useCallback(()=>{let e,n=t.current?.getSlateEditor();null!=n&&(e=t3.VW.getSelectedParentOfType(n,eg.mk)?.[0]),l({selectedAutocompleteInputType:e?.type??null,selectedAutocompleteInputError:e?.error??!1})},[t]);return i.useEffect(()=>(e.on("selection-changed",s),e.on("submit-failure",s),s(),()=>{e.off("selection-changed",s),e.on("submit-failure",s)}),[s,e]),n}(ez,em),{handleAutocompleteVisibilityChange:tx}=nA(j,T.id),tA=function(e){let{type:t,channelId:n}=e;return(0,ep.bG)([S.A],()=>{let e=S.A.activeViewType();return null!=e&&e===t&&S.A.activeChannelId()===n&&S.A.shouldShowPopup()},[t,n])}({type:j,channelId:T.id}),tE=i.useCallback(()=>{ez.emit("submit-failure")},[ez]);(0,eJ.R)(ez,T.guild_id,T.id);let ty=null!=P,tv=eR&&!((ej||eb)&&ew)||e1&&j.submit?.useDisabledStylesOnSubmit,tT=null;null!=eN?tT=M?.(eN,eT,tR.g$):(!eR||eL)&&(tT=O?.(ty,tR.g$));let tj=eP&&null!=a&&!eR&&j.showCharacterCount&&null==eN,tL=eP&&!__OVERLAY__&&null!=a&&null==eN&&j.toolbarType!==e$.O1.NONE&&!eR,tw=function(e){let{channel:t,type:n,activeCommand:s,pendingReply:r,pendingScheduledMessage:a,selectedAutocompleteInputType:o,selectedAutocompleteInputError:c}=e,{activeCommandOption:u,activeCommandOptionStates:d}=(0,m.cf)([w.A],()=>({activeCommandOption:w.A.getActiveOption(t.id),activeCommandOptionStates:w.A.getOptionStates(t.id)})),h=(0,m.bG)([eU.Ay,eB.default,tI],()=>{let e=eB.default.getCurrentUser();if(null==e||!e.isStaff()||!t.isDM())return!1;let n=eB.default.getUser(t.getRecipientId());if(!n?.isStaff())return!1;let l=eU.Ay.getNicknames(n.id).some(e=>e.endsWith("[PTO]")||e.endsWith("[OOO]"));return l?!tI.hasId(n.id)&&l:(tC.delete(n.id)&&tI.emitChange(),!1)});return i.useMemo(()=>{let e=[],i=[];return null!=t.guild_id&&n===e$.oU.NORMAL&&i.push((0,l.jsx)(tN.A,{guildId:t.guild_id,channel:t,className:tR.UW})),null!=s&&e.push((0,l.jsx)(tg,{activeCommand:s,activeOption:u??null,optionStates:d,channelId:t.id})),null!=r&&e.push((0,l.jsx)(to,{reply:r,chatInputType:n})),h&&e.push((0,l.jsx)(tS,{})),null!=a&&e.push((0,l.jsx)(tb,{pendingScheduledMessage:a})),"timestampMentionInput"===o&&i.push((0,l.jsx)(t_,{error:c??!1})),{stacked:e,floating:i}},[s,u,d,t,r,h,n,a,o,c])}({channel:T,type:j,activeCommand:eN,pendingReply:P,pendingScheduledMessage:es,selectedAutocompleteInputType:tp,selectedAutocompleteInputError:tf}),tk=0===s.trim().length,tP=null!=P?[$,tr].filter(Boolean).join(" "):$,tD=j.layout===e$.wt.INLINE,tU=j.layout===e$.wt.FLUSH,tG=(0,l.jsx)("div",{ref:ed,className:tR.BW}),tV=tA?(0,l.jsx)(L,{align:"right",positionTargetRef:ed,channel:T}):null,tF=null!=k?k():(0,l.jsx)(tM.A,{type:j,disabled:eR,channel:T,handleSubmit:e6,isEmpty:tk,showAllButtons:ev}),tH=tj?(0,l.jsx)(tK.A,{type:j,textValue:s,className:J,maxCharacterCount:Z,showRemainingCharsAfterCount:Y}):null;return i.useEffect(()=>{b&&eZ._.dispatch(ea.jej.CHANNEL_TEXT_AREA_FOCUSED,{channelId:T.id})},[b,T.id]),(0,l.jsx)(ex.Sv,{value:ez,children:(0,l.jsxs)(I.f5,{value:eo,children:[tL&&ek?(0,l.jsx)(ni,{editorRef:em,type:j,channel:T}):tL?(0,l.jsx)(t8,{ref:eI,editorRef:em,containerRef:eE,options:j.markdown}):null,(0,l.jsxs)("div",{ref:ec,className:r()(o,{[tR.gM]:!0,[tR.h9]:tv,[tR.mr]:W,[tR.Wn]:d.Fr,[tR.Ls]:tD,[tR.AH]:tU,[tR.z3]:null!=R}),children:[tD||tU?null:(0,l.jsx)(tO,{bars:tw}),(0,l.jsxs)("div",{ref:eE,onScroll:tn,className:r()(u,{[tR.xx]:!0,[tR.k6]:!en,[tR.Ri]:tw.stacked.length>0}),children:[(0,l.jsx)(th,{channelId:T.id,chatInputType:j}),j.hideAttachmentArea?null:(0,l.jsx)(tW.A,{channelId:T.id,type:j,canAttachFiles:eO}),(0,l.jsxs)("div",{className:r()(tR.vW,{[tR.BF]:tv,[tR.RL]:j!==e$.oU.EDIT&&(null!=tT||tv&&null==tT||ej),[tR.fk]:j===e$.oU.THREAD_CREATION,[tR.TZ]:j===e$.oU.CREATE_FORUM_POST||j===e$.oU.FORWARD_MESSAGE_INPUT,[tR.$i]:j===e$.oU.USER_PROFILE_REPLY}),onMouseDown:tm,children:[tV,tT,(0,l.jsx)(f.vN,{ringTarget:ec,ringClassName:tR.Rg,children:(0,l.jsx)(eX.A,{ref:em,id:p,focused:b,useSlate:eP,textValue:s,richValue:a,disabled:eR,placeholder:_,required:x,accessibilityLabel:N,isPreviewing:(ej||eb)&&ew,channel:T,type:j,canPasteFiles:eO,uploadPromptCharacterCount:ea.CS1,maxCharacterCount:Z??eV,allowNewLines:q,"aria-describedby":tP,onChange:e0,onResize:ti,onBlur:G,onFocus:V,onKeyDown:F,onSubmit:e2,onSubmitFailure:tE,onTab:ts,onEnter:ta,onMoveSelection:tc,onSelectionChanged:eY,onMaybeShowAutocomplete:e7,onHideAutocomplete:e4,promptToUpload:B,fontSize:eH,spellcheckEnabled:eW,canOnlyUseTextCommands:ty,className:r()({[tR.QI]:j===e$.oU.THREAD_CREATION,[tR.AV]:j===e$.oU.PROFILE_BIO_INPUT,[tR.GR]:j===e$.oU.OVERLAY_INLINE_REPLY},h),"aria-labelledby":X,showValueWhenDisabled:er})}),tF,tG]})]}),(0,l.jsx)(tB,{channel:T,type:j,pendingScheduledMessage:es}),eG?null:(0,l.jsx)(eh,{ref:eu,channel:T,canOnlyUseTextCommands:ty}),(0,l.jsx)(ef.A,{ref:e3,channel:T,canMentionRoles:K,canMentionChannels:z,useNewSlashCommands:eP,canOnlyUseTextCommands:ty,canSendStickers:j.stickers?.allowSending,canSendSoundmoji:j.soundmoji?.allowSending,textValue:s,focused:b,expressionPickerView:tu,type:j,targetRef:ec,editorRef:em,onSendMessage:e2,onSendSticker:e9,onVisibilityChange:tx,editorScrollerRef:eE,editorHeight:tl,barsHeight:40*tw.floating.length,setValue:(e,t)=>e0?.(null,e,t),position:ee}),(0,l.jsx)(eM,{textValue:s,editorHeight:tl,channelId:T.id}),tH,et]}),(0,l.jsx)(g.U,{error:R}),td?null:(0,l.jsx)(eC.A,{positionTargetRef:ec,type:j,onSelectGIF:e8,onSelectEmoji:e5,onSelectSticker:e9,onSelectSound:te,onSelectKaomoji:tt,channel:T,closeOnModalOuterClick:el,parentModalKey:ei,position:"top",align:"right",positionLayerClassName:tR.BD})]})})}))}