Loading
function(e,n,t){t.d(n,{A:()=>C});var i=t(477900),l=t(582128),o=t(855986),a=t(452027),s=t(265872),u=t(862301),r=t(834730),d=t(565645),m=t(414079),c=t(713517),j=t(375499),p=t(863576),f=t(808728),h=t(284009),N=t.n(h),A=t(121681),x=t(7584),E=t(307731),g=t(792996),v=t(411559);function C(e){let{className:n,guildId:t,error:h,emojiId:C,emojiName:b,isRequiredField:I=!0,shouldUpdateBothEmojiFields:y=!1,setEmojiId:D,setEmojiName:k}=e,B=function(e){let{emojiId:n,emojiName:t}=e,i=(0,o.bG)([A.Ay],()=>null!=n?A.Ay.getCustomEmojiById(n):null);if(null!=i||null!=t)if(null==n)return N()(null!=t,"emojiName must be defined if emojiId is not defined"),x.Ay.convertSurrogateToName(t,!1);else return i?.name}({emojiId:C,emojiName:b}),S=(0,o.bG)([f.A],()=>null!=t?f.A.getDefaultChannel(t):null),w=l.useRef(null),{isHoveringOrFocusing:M}=(0,c.A)(w);function O(){k(void 0),D(void 0)}function P(e){e.stopPropagation(),O()}let R=l.useMemo(()=>{let e=null!=C&&""!==C,n=null!=b&&""!==b,t=null!=B&&""!==B,i=n&&!Number.isNaN(parseInt(b))&&!t&&!e;return{hasEmojiId:e,hasEmojiName:n,hasEmojiDisplayName:t,isDeletedCustomEmoji:i}},[C,b,B]),T=!R.isDeletedCustomEmoji&&R.hasEmojiDisplayName;return(0,i.jsx)("div",{className:n,children:(0,i.jsx)(a.D,{required:I,label:g.intl.string(g.t["3BQmiC"]),errorMessage:h??void 0,children:(0,i.jsx)(s.Y,{targetElementRef:w,animation:s.Y.Animation.NONE,position:"top",renderPopout:e=>{let{closePopout:n}=e;return(0,i.jsx)(p.default,{closePopout:n,pickerIntention:E.EmojiIntention.SOUNDBOARD,onNavigateAway:n,onSelectEmoji:e=>{let{emoji:t,willClose:i}=e,l=t?.id==null;O(),l?k(t?.optionallyDiverseSequence):(y&&k(t?.name),D(t?.id)),i&&n()},guildId:t,channel:S})},children:(e,n)=>{let{isShown:t}=n;return(0,i.jsxs)(u.F,{...e,className:v.LM,ref:w,children:[(0,i.jsx)(j.A,{active:t,tabIndex:0,renderButtonContents:!R.isDeletedCustomEmoji&&(R.hasEmojiId||R.hasEmojiName)?()=>(0,i.jsx)(d.A,{emojiName:b,emojiId:C}):null}),(0,i.jsx)(r.E,{variant:"body-md/normal",lineClamp:1,color:T?"text-default":"text-muted",children:T?`:${B}:`:g.intl.string(g.t.QTK0TJ)}),T&&M&&(0,i.jsx)(m.A,{...e,onClick:P})]})}})})})}}