Module 822123

8,248 characters · in no known chunk
Dependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{C5:()=>k,CQ:()=>b,D6:()=>W,DA:()=>K,EG:()=>L,Fj:()=>B,Nu:()=>F,O7:()=>Y,QZ:()=>H,Wf:()=>M,Wi:()=>w,XI:()=>j,_7:()=>U,bo:()=>P,sL:()=>V,ss:()=>R,wT:()=>z,wt:()=>G,xf:()=>D,yB:()=>x}),n(667532),n(321073),n(801541);var i=n(64700),r=n(735438),s=n(889137),a=n(17928),o=n(95561),l=n(159273),u=n(7584),c=n(17591),d=n(926972),_=n(594061),f=n(71393),h=n(711014),p=n(287809),E=n(174459),m=n(927813),g=n(690521),A=n(474090),I=n(818645),T=n(316884),S=n(732139),N=n(652215),y=n(307731),C=n(698279),v=n(788868),O=n(375708);let R=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t?.getGuildId(),r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(0,c.V)(n);let s=(0,y.isExternalEmojiAllowedForIntention)(e),o=B(n),u=H(n),_=j(n),{topEmojis:E,newlyAddedEmojis:m}=(0,T.A)(n,e),{allEmojis:N}=(0,I.A)({topEmojis:E,newlyAddedEmojis:m}),C=(0,a.bG)([l.Ay],()=>l.Ay.getDisambiguatedEmojiContext(n),[n]),v=(0,a.bG)([f.A],()=>f.A.getGuild(n)?.name),R=(0,a.bG)([p.default],()=>p.default.getCurrentUser()),b=(0,A.ki)(R),D=(0,d.Ym)({location:"useEmojiCategories"});return i.useMemo(()=>{let i=C.getGroupedCustomEmoji(),a=h.Ay.getFlattenedGuildIds(),c=[],d={type:S.s.SOUNDMOJI,name:O.intl.string(O.t.f0Ezmv),id:S.R2.SOUNDMOJI,isNitroLocked:!1},p=i=>g.Ay.getEmojiUnavailableReasons({categoryEmojis:i,channel:t,guildId:n,intention:e});return((e,t)=>{for(let r of e){let e;if(t===S.s.GUILD&&(e=f.A.getGuild(r)),null==e)continue;let s=i.get(e.id);if(null==s||0===s.length)continue;let{emojisDisabled:a,emojisUnfiltered:o,emojisPremiumLockedCount:u,emojiNitroLocked:d}=p(s);if(0===o.length)continue;let _=l.Ay.getHiddenEmojiIds(e.id),h=null;t===S.s.GUILD&&(h={type:S.s.GUILD,guild:e,isNitroLocked:!b&&d&&u===s.length,emojis:s,emojisDisabled:a,emojisHidden:_}),null!=h&&(e.id===n?c.unshift(h):c.push(h))}})(a,S.s.GUILD),l.Ay.categories.reduce((t,i)=>{if(i===S.R2.TOP_GUILD_EMOJI){let{emojisDisabled:e,emojisUnfiltered:n}=p(N);if(null==n||0===n.length)return t;t.push({type:S.s.TOP_GUILD_EMOJI,id:i,name:O.intl.formatToPlainString(O.t.W6Wi1X,{guildName:v}),isNitroLocked:!1,emojis:n,emojisDisabled:e})}else if(i===S.R2.RECENT){let{emojisDisabled:n,emojisUnfiltered:r}=p([y.EmojiIntention.REACTION,y.EmojiIntention.DEFAULT_REACT_EMOJI].includes(e)?u:o);if(null==r||0===r.length)return t;t.push({type:S.s.RECENT,id:i,name:O.intl.string(O.t["5TvaSm"]),isNitroLocked:!1,emojis:r,emojisDisabled:n})}else if(i===S.R2.FAVORITES){let{emojisDisabled:e,emojisUnfiltered:n}=p(_);if(null==n||0===n.length)return t;t.push({type:S.s.FAVORITES,id:i,name:O.intl.string(O.t.y3LQCG),isNitroLocked:!1,emojis:n,emojisDisabled:e})}else if(i===S.R2.CUSTOM){let e=c;s||(e=c.filter(e=>e.type===S.s.GUILD&&e.guild.id===n)),t.push(...e)}else t.push({type:S.s.UNICODE,id:i,name:i,isNitroLocked:!1});return t},D&&r?[d]:[])},[C,t,n,e,b,N,v,u,o,_,s,D,r])},b=()=>u.Ay.getCategories().map(e=>({type:S.s.UNICODE,id:e,name:e,isNitroLocked:!1})),D=e=>{let t=e?.getGuildId()!=null;E.default.track(N.HAw.PREMIUM_PROMOTION_OPENED,{location_page:t?N.liQ.GUILD_CHANNEL:N.liQ.DM_CHANNEL,location_section:null!=e?N.JJy.EMOJI_PICKER_POPOUT:N.JJy.CUSTOM_STATUS_MODAL})},L=(e,t)=>{o.Ay.trackWithMetadata(N.HAw.SEARCH_STARTED,{search_type:null!=t&&t===y.EmojiIntention.REACTION?N.I4_.EMOJI_REACTION:N.I4_.EMOJI,location:e})},w=(e,t,n,i,r)=>{o.Ay.trackWithMetadata(N.HAw.SEARCH_RESULT_VIEWED,{search_type:null!=r&&r===y.EmojiIntention.REACTION?N.I4_.EMOJI_REACTION:N.I4_.EMOJI,total_results:e,num_results_locked:t,query:i,location:n})},M=e=>{let{emoji:t,emojiSuggestions:n,searchQuery:i,isLocked:r,location:a,intention:l,index:u,messageId:c}=e,d=t.uniqueName??t.name,_=(0,s.YW)(l).with(y.EmojiIntention.REACTION,()=>N.I4_.EMOJI_REACTION).with(y.EmojiIntention.AUTO_SUGGESTION,()=>N.I4_.EMOJI_AUTO_SUGGESTION).otherwise(()=>N.I4_.EMOJI);o.Ay.trackWithMetadata(N.HAw.SEARCH_RESULT_SELECTED,{search_type:_,location:a,expression_guild_id:t.guildId,emoji_id:t.id,emoji_name:d,is_custom:null!=t.id,is_animated:t.animated,is_locked:r,query:i,index_num:u,load_id:n?.loadId,total_results:n?.results?.length,emoji_suggestion_ids:n?.results?.map(e=>{let{emoji:t}=e;return t.id}).filter(e=>null!=e),message_id:c})},P=(e,t)=>{o.Ay.trackWithMetadata(N.HAw.SEARCH_RESULT_EMPTY,{search_type:N.I4_.EMOJI,query:t,location:e})},x=e=>{let{emoji:t,subCategory:n,position:i,newlyAddedHighlight:r}=e;o.Ay.trackWithMetadata(N.HAw.EXPRESSION_PICKER_EXPRESSION_FOCUS,{expression_section:n?.toString(),newly_added_highlight:r,emoji_id:t.id,emoji_name:t.name,emoji_animated:t.animated,emoji_position:i})},U=e=>{let t,{emoji:n,location:i,pickerIntention:r,category:s,subCategory:a=S.tm.NONE,position:l,newlyAddedHighlight:u,isBurstReaction:c,messageId:d}=e;switch(r){case y.EmojiIntention.REACTION:t=c?v.e.EMOJI_PICKER_SUPER_REACTION_EMOJI_CLICKED:v.e.EMOJI_PICKER_REACTION_EMOJI_CLICKED;break;case y.EmojiIntention.STATUS:t=v.e.EMOJI_PICKER_STATUS_EMOJI_CLICKED;break;default:t=v.e.EMOJI_PICKER_EMOJI_CLICKED}let _=n.uniqueName??n.name;o.Ay.trackWithMetadata(N.HAw.EXPRESSION_PICKER_EXPRESSION_SELECTED,{type:t,location:i,expression_id:n.id,expression_name:_,expression_guild_id:n.guildId,is_custom:null!=n.id,is_animated:n.animated,expression_picker_section:s,expression_section:a?.toString(),emoji_position:l,newly_added_highlight:u,is_burst:c,message_id:d})},k=e=>{let{emoji:t,location:n}=e,i=t.uniqueName??t.name;o.Ay.trackWithMetadata(N.HAw.EXPRESSION_FAVORITED,{location:n,expression_type:C.kx.EMOJI,expression_id:t.id,expression_name:i,expression_guild_id:t.guildId,is_custom:null!=t.id,is_animated:t.animated})};(0,r.throttle)(e=>{let{emojiSuggestions:t,analyticsLocation:n}=e;o.Ay.trackWithMetadata(N.HAw.AUTO_SUGGEST_DISPLAYED,{suggestion_type:N.ndy.EMOJI,suggestion_quantity:t.results.length,custom_quantity:t.results.filter(e=>{let{emoji:t}=e;return null!=t.id}).length,load_id:t.loadId,location:n})},m.A.Millis.HALF_SECOND,{leading:!1,trailing:!0});let G=(e,t)=>e.type!==S.s.GUILD?e.id:null!=t?t.name:"",F=(e,t)=>{switch(e){case S.R2.TOP_GUILD_EMOJI:return O.intl.formatToPlainString(O.t.W6Wi1X,{guildName:t});case S.R2.RECENT:return O.intl.string(O.t["5TvaSm"]);case S.R2.FAVORITES:return O.intl.string(O.t.y3LQCG);case S.R2.ACTIVITY:return O.intl.string(O.t.O783tR);case S.R2.FLAGS:return O.intl.string(O.t.vvaizu);case S.R2.FOOD:return O.intl.string(O.t.ldm9aY);case S.R2.NATURE:return O.intl.string(O.t.egIBDH);case S.R2.OBJECTS:return O.intl.string(O.t.gWm7Mk);case S.R2.PEOPLE:return O.intl.string(O.t.GX594D);case S.R2.SYMBOLS:return O.intl.string(O.t.QXMYAb);case S.R2.TRAVEL:return O.intl.string(O.t.w33hIP);case S.R2.PREMIUM_UPSELL:return O.intl.string(O.t.pAF6xE);case S.R2.SOUNDMOJI:return O.intl.string(O.t.f0Ezmv);default:return t??e}};function V(e,t,n,r){i.useEffect(()=>{_.bW.loadIfNecessary()},[]);let s=(0,y.isExternalEmojiAllowedForIntention)(n);return(0,a.bG)([l.Ay],()=>{let i=e.replace(/^:/,"").replace(/:$/,"");return""===i?null:l.Ay.searchWithoutFetchingLatest({channel:t,query:i,count:0,intention:n,includeExternalGuilds:s,showOnlyUnicode:r})},[e,t,n,s,r],a.My)}function B(e){return i.useEffect(()=>{_.bW.loadIfNecessary()},[]),(0,a.yK)([l.Ay],()=>l.Ay.getDisambiguatedEmojiContext(e).getFrequentlyUsedEmojisWithoutFetchingLatest())}function H(e){return i.useEffect(()=>{_.bW.loadIfNecessary()},[]),(0,a.yK)([l.Ay],()=>l.Ay.getDisambiguatedEmojiContext(e).getFrequentlyUsedReactionEmojisWithoutFetchingLatest())}function j(e){return i.useEffect(()=>{_.bW.loadIfNecessary()},[]),(0,a.yK)([l.Ay],()=>l.Ay.getDisambiguatedEmojiContext(e).favoriteEmojisWithoutFetchingLatest)}function Y(e,t){return i.useEffect(()=>{_.bW.loadIfNecessary()},[]),(0,a.bG)([l.Ay],()=>null!=t&&l.Ay.getDisambiguatedEmojiContext(e).isFavoriteEmojiWithoutFetchingLatest(t))}function W(e){return i.useEffect(()=>{_.bW.loadIfNecessary()},[]),(0,a.yK)([l.Ay],()=>l.Ay.getDisambiguatedEmojiContext(e).getEmojiInPriorityOrderWithoutFetchingLatest())}function K(e,t,n){if(null==n)return S.tm.NONE;let i=e.map(e=>e.id??e.uniqueName??e.name),r=t.map(e=>e.id);return i.includes(n)?S.tm.TOP_GUILD_EMOJI:r.includes(n)?S.tm.NEWLY_ADDED_EMOJI:S.tm.NONE}function z(e,t){return e===y.EmojiIntention.REACTION?t?O.intl.string(O.t["h7ES+n"]):O.intl.string(O.t["6any2A"]):O.intl.string(O.t.KgK5qg)}}