Module 337371

11,129 characters · in f0d5d18b83222ab5.js
Dependencies
Source Raw
function(e,t,n){n.d(t,{Bx:()=>eA,Ay:()=>eh,Gm:()=>eo,Q_:()=>ea,zF:()=>ed,zR:()=>eu}),n(321073);var i,l=n(966597),r=n(774603),s=n(176522),a=n(735438),o=n.n(a),d=n(691540),c=n(857250),u=n(97483),A=n(734057),h=n(309010),E=n(871237),g=n(957565),C=n(375708);let _=(0,a.throttle)(()=>(0,d.P0)((0,c.o)(C.intl.string(C.t["+5kSoW"]),u.Ck.SUCCESS)),3e3,{leading:!0,trailing:!1});var I=n(265422),T=n(967198),p=n(625494),S=n(652215),N=n(192308),L=n(272613),m=n(819638),O=n(723702),f=n(186111),b=n(763827),R=n(64460),v=n(92960),U=n(739008),D=n(314519),G=n(837057),M=n(310419),y=n(488995),x=n(675704),P=n(806964),V=n(552049),w=n(877991),j=n(332779),H=n(274794),B=n(928531),F=n(251494),k=n(82038),W=n(14214),K=n(151199),Y=n(975571),Z=n(28647),z=n(851109);let X={binds:["mod+shift+e"],comboKeysBindGlobal:!0,action:o().debounce(()=>{if(p._.hasSubscribers(S.jej.MARK_TOP_INBOX_CHANNEL_READ))return p._.dispatch(S.jej.MARK_TOP_INBOX_CHANNEL_READ),!1},100,{leading:!0})};var J=n(478437),Q=n(367513),q=n(604681),$=n(313961),ee=n(47675),et=n(999291),en=n(761640),ei=n(467691),el=n(674272),er=n(431804),es=n(406975),ea=((i={}).NAVIGATION="NAVIGATION",i.CHAT="CHAT",i.VOICE_AND_VIDEO="VOICE_AND_VIDEO",i.MISCELLANEOUS="MISCELLANEOUS",i.MESSAGE="MESSAGE",i.DND="DND",i);function eo(e){switch(e){case"NAVIGATION":return C.intl.string(C.t["yGE+jg"]);case"VOICE_AND_VIDEO":return C.intl.string(C.t.bI8F5u);case"CHAT":return C.intl.string(C.t.hDhbb3);case"MISCELLANEOUS":return C.intl.string(C.t.cBdwqs);case"MESSAGE":return C.intl.string(C.t["5fpmX9"]);case"DND":return C.intl.string(C.t["69j6+4"])}}function ed(e){switch(e){case"MESSAGE":return C.intl.string(C.t.iepGDn);case"DND":return C.intl.string(C.t.LBsB0a);default:return}}function ec(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.map(e=>{let t=eu[e];if(null==t)throw Error(`getBindsFor(...): No bind for ${t}`);return t.binds[0]})}let eu={[S.IWg.SERVER_NEXT]:B.yx,[S.IWg.SERVER_PREV]:B.yv,[S.IWg.CHANNEL_NEXT]:s.kF,[S.IWg.CHANNEL_PREV]:s.Oc,[S.IWg.NAVIGATE_BACK]:s.GY,[S.IWg.NAVIGATE_FORWARD]:s.M$,[S.IWg.UNREAD_NEXT]:ei.mH,[S.IWg.UNREAD_PREV]:ei.US,[S.IWg.MENTION_CHANNEL_NEXT]:ei.BD,[S.IWg.MENTION_CHANNEL_PREV]:ei.X8,[S.IWg.TOGGLE_PREVIOUS_GUILD]:s.Fv,[S.IWg.JUMP_TO_GUILD]:R.J,[S.IWg.SUBMIT]:F.X,[S.IWg.TEXTAREA_FOCUS]:k.c,[S.IWg.MARK_CHANNEL_READ]:v.Df,[S.IWg.MARK_SERVER_READ]:U.P,[S.IWg.TOGGLE_CHANNEL_PINS]:{binds:["mod+p"],comboKeysBindGlobal:!0,action:()=>(p._.dispatch(S.jej.TOGGLE_CHANNEL_PINS),!1)},[S.IWg.TOGGLE_FOR_LATER]:{binds:["mod+l"],comboKeysBindGlobal:!0,action(){let{enabled:e,inInbox:t}=l.A.getConfig({location:"keybinds"});if(e&&!t)return p._.dispatch(S.jej.TOGGLE_FOR_LATER),!1}},[S.IWg.TOGGLE_INBOX]:{binds:["mod+i"],comboKeysBindGlobal:!0,action:()=>!(f.A.getLayers().length>0)&&((()=>{let{notificationCenterVariant:e}=(0,z.GE)({location:"TOGGLE_INBOX"});if("sidebar"!==e)return;let t=h.A.getChannelId(),n=A.A.getChannel(t);return window.location.pathname.startsWith(S.BVt.CHANNEL(S.gNP))&&null!=n?(0,I.i)(n.guild_id,t):(0,I.a)(S.BVt.CHANNEL(S.gNP,t??void 0))})(),p._.dispatch(S.jej.TOGGLE_INBOX),!1)},[S.IWg.MARK_TOP_INBOX_CHANNEL_READ]:X,[S.IWg.TOGGLE_USERS]:{binds:["mod+u"],comboKeysBindGlobal:!0,action(){let e=T.A.getGuildId(),t=h.A.getChannelId(e),n=A.A.getChannel(t),i=null!=t&&n?.isVocalThread()===!0&&$.A.getUserParticipantCount(t)>0;if(null!=t&&null!=n&&(n.type===J.r.GUILD_VOICE||i))return Q.A.updateChatOpen(t,!$.A.getChatOpen(t),"toggle users keybind"),!1;if(null!=t&&null!=n&&n.type===J.r.DM){let e=en.Ay.getSection(t,n?.isDM()),i=(0,et.AP)(n.getRecipientId()),l=e===S.YvQ.PROFILE;return(0,ee.am)({displayProfile:i,isProfileOpen:!l}),q.A.toggleUserProfileSidebarSection(),!1}return q.A.toggleMembersSection(),!1}},[S.IWg.TOGGLE_HELP]:{binds:["mod+shift+h","f1"],comboKeysBindGlobal:!0,action:()=>(window.open(Y.C),!1)},[S.IWg.VIBE_WITH_WUMPUS]:{binds:["mod+alt+shift+w"],comboKeysBindGlobal:!0,action:()=>((0,el.A)({source:er.y.KEYBIND,onClose:N.closeAllModals}),!1)},[S.IWg.TOGGLE_MUTE]:W.VT,[S.IWg.TOGGLE_DEAFEN]:W.rR,[S.IWg.TOGGLE_CATEGORY_COLLAPSED]:K.y,[S.IWg.SEARCH_SOUNDBOARD]:{binds:["mod+shift+b"],comboKeysBindGlobal:!0,action:()=>(p._.dispatch(S.jej.TOGGLE_SOUNDBOARD),!1)},[S.IWg.SCROLL_UP]:V.U5,[S.IWg.SCROLL_DOWN]:V.fz,[S.IWg.QUICKSWITCHER_SHOW]:x.R,[S.IWg.CREATE_DM_GROUP]:{binds:["mod+shift+t"],comboKeysBindGlobal:!0,action:()=>(null!=T.A.getGuildId()&&(0,I.i)(S.ME),p._.safeDispatch(S.jej.TOGGLE_DM_CREATE),!1)},[S.IWg.SEARCH_EMOJIS]:w.L,[S.IWg.SEARCH_GIFS]:j.T,[S.IWg.SEARCH_STICKERS]:H.w,[S.IWg.TOGGLE_HOTKEYS]:Z.z,[S.IWg.JUMP_TO_FIRST_UNREAD]:D.s,[S.IWg.CREATE_GUILD]:{binds:["mod+shift+n"],comboKeysBindGlobal:!0,action(){(0,N.hasModalOpen)(m.fc)?L.A.updateCreateGuildModal({slide:m.oS.JOIN_GUILD,location:"Keyboard Shortcut"}):L.A.openCreateGuildModal({location:"Keyboard Shortcut"})}},[S.IWg.UPLOAD_FILE]:{binds:["mod+shift+u"],comboKeysBindGlobal:!0,action(){let e=A.A.getChannel(h.A.getChannelId());return null==e||e.isManaged()||p._.dispatch(S.jej.UPLOAD_FILE,{channelId:e.id}),!1}},[S.IWg.RETURN_TO_AUDIO_CHANNEL]:P.u,[S.IWg.CALL_ACCEPT]:r.Yo,[S.IWg.CALL_START]:r.OX,[S.IWg.FOCUS_SEARCH]:{binds:["mod+f","mod+shift+f"],comboKeysBindGlobal:!0,action(e,t){if(f.A.hasLayers()||(0,N.hasAnyModalOpen)())return;let n=!t.includes("shift");return p._.dispatch(S.jej.FOCUS_SEARCH,{prefillCurrentChannel:n}),!1}},[S.IWg.JUMP_TO_CURRENT_CALL]:{binds:["mod+shift+alt+v"],comboKeysBindGlobal:!0,action(e){e.preventDefault(),e.stopPropagation();let t=b.A.getGuildId(),n=b.A.getChannelId();return null!=n&&(0,I.i)(t??S.ME,n),!1}},[S.IWg.ZOOM_IN]:es.Ur,[S.IWg.ZOOM_OUT]:es.hU,[S.IWg.ZOOM_RESET]:es.O$,[S.IWg.OPEN_APP_DIRECTORY]:{binds:["mod+ctrl+a"],comboKeysBindGlobal:!0,action(){let e=T.A.getGuildId()??void 0;(0,G.transitionToGlobalDiscovery)({tab:y.GlobalDiscoveryTab.APPS,newSessionState:{guildId:e??null,entrypoint:{name:M.sW.KEYBOARD_SHORTCUT}}})}},[S.IWg.BROWSER_DEVTOOLS]:{binds:["mod+alt+i"],comboKeysBindGlobal:!0,action(e){if((0,O.isWeb)()&&"discord.com"===location.host)return e.preventDefault(),e.stopPropagation(),!1}},[S.IWg.OPEN_CONTEXT_MENU]:{binds:["shift+f10"],comboKeysBindGlobal:!0,action(){let e=document.activeElement;return null!=e&&e!==document.body&&(e.dispatchEvent(new MouseEvent("contextmenu",{bubbles:!0,cancelable:!0,view:window,clientX:0,clientY:0})),!1)}},[S.IWg.COPY_CHANNEL_LINK]:{binds:["mod+shift+l"],comboKeysBindGlobal:!0,action(){let e=h.A.getChannelId();if(null==e)return!1;let t=A.A.getChannel(e);if(null==t)return!1;let n=A.A.getChannel(t.parent_id),i=(0,E.af)(t,n);return(0,g.C)(i,_),!1}}};function eA(){let e=[{description:C.intl.string(C.t.bx4Uyz),binds:ec(S.IWg.SERVER_PREV,S.IWg.SERVER_NEXT),group:"NAVIGATION"},{description:C.intl.string(C.t["+Wem6h"]),binds:ec(S.IWg.CHANNEL_PREV,S.IWg.CHANNEL_NEXT),group:"NAVIGATION"},{description:C.intl.string(C.t["+2fcdz"]),binds:ec(S.IWg.NAVIGATE_BACK,S.IWg.NAVIGATE_FORWARD),group:"NAVIGATION"},{description:C.intl.string(C.t.eVmj1H),binds:ec(S.IWg.UNREAD_PREV,S.IWg.UNREAD_NEXT),group:"NAVIGATION"},{description:C.intl.string(C.t.EcqS7Y),binds:ec(S.IWg.MENTION_CHANNEL_PREV,S.IWg.MENTION_CHANNEL_NEXT),group:"NAVIGATION"},{description:C.intl.string(C.t["4I3pwW"]),binds:ec(S.IWg.JUMP_TO_CURRENT_CALL),group:"NAVIGATION"},{description:C.intl.string(C.t.Bqss72),binds:ec(S.IWg.TOGGLE_PREVIOUS_GUILD),group:"NAVIGATION"},{description:C.intl.string(C.t.yYsRlD),binds:ec(S.IWg.QUICKSWITCHER_SHOW),group:"NAVIGATION"},{description:C.intl.string(C.t.O7ouXO),binds:ec(S.IWg.CREATE_GUILD),group:"NAVIGATION",groupEnd:!0},{description:C.intl.string(C.t.Lns0Fc),binds:["mod+d"],group:"DND"},{description:C.intl.string(C.t.dmMqay),binds:["up","down"],group:"DND"},{description:C.intl.string(C.t["cs/HVH"]),binds:["spacebar","enter"],group:"DND"},{description:C.intl.string(C.t["1ioMJQ"]),binds:["esc"],group:"DND",groupEnd:!0},{description:C.intl.string(C.t.UaXAPx),binds:ec(S.IWg.MARK_SERVER_READ),group:"CHAT"},{description:C.intl.string(C.t["5X9vFj"]),binds:ec(S.IWg.MARK_CHANNEL_READ),group:"CHAT"},{description:C.intl.string(C.t.wxQFsl),binds:ec(S.IWg.CREATE_DM_GROUP),group:"CHAT"},{description:C.intl.string(C.t["C+XV7f"]),binds:ec(S.IWg.TOGGLE_CHANNEL_PINS),group:"CHAT"},{description:C.intl.string(C.t["Q+YV/T"]),binds:ec(S.IWg.TOGGLE_INBOX),group:"CHAT"},{description:C.intl.string(C.t["YEjV+W"]),binds:ec(S.IWg.MARK_TOP_INBOX_CHANNEL_READ),group:"CHAT"},{description:C.intl.string(C.t.AcBI9S),binds:ec(S.IWg.TOGGLE_USERS),group:"CHAT"},{description:C.intl.string(C.t.JoxNnl),binds:ec(S.IWg.SEARCH_EMOJIS),group:"CHAT"},{description:C.intl.string(C.t["3PHxo8"]),binds:ec(S.IWg.SEARCH_GIFS),group:"CHAT"},{description:C.intl.string(C.t.YFl7eb),binds:ec(S.IWg.SEARCH_STICKERS),group:"CHAT"},{description:C.intl.string(C.t.L3RYYJ),binds:ec(S.IWg.SCROLL_UP,S.IWg.SCROLL_DOWN),group:"CHAT"},{description:C.intl.string(C.t["3HAurM"]),binds:ec(S.IWg.JUMP_TO_FIRST_UNREAD),group:"CHAT"},{description:C.intl.string(C.t.rrYBEu),binds:ec(S.IWg.TEXTAREA_FOCUS),group:"CHAT"},{description:C.intl.string(C.t.sUJlPL),binds:ec(S.IWg.UPLOAD_FILE),group:"CHAT"},{description:C.intl.string(C.t["A+Fv0R"]),binds:ec(S.IWg.COPY_CHANNEL_LINK),group:"CHAT",groupEnd:!0},{description:C.intl.string(C.t.tL6eVW),binds:ec(S.IWg.TOGGLE_MUTE),group:"VOICE_AND_VIDEO"},{description:C.intl.string(C.t["QXe/7T"]),binds:ec(S.IWg.TOGGLE_DEAFEN),group:"VOICE_AND_VIDEO"},{description:C.intl.string(C.t.d6UIii),binds:ec(S.IWg.CALL_ACCEPT),group:"VOICE_AND_VIDEO"},{description:C.intl.string(C.t.IcEW06),binds:ec(S.IWg.MARK_CHANNEL_READ),group:"VOICE_AND_VIDEO"},{description:C.intl.string(C.t.WN2dsS),binds:ec(S.IWg.CALL_START),group:"VOICE_AND_VIDEO",groupEnd:!0},{description:C.intl.string(C.t.rUK0kk),binds:ec(S.IWg.SEARCH_SOUNDBOARD),group:"VOICE_AND_VIDEO"},{description:C.intl.string(C.t.vkGkSn),binds:ec(S.IWg.TOGGLE_HELP),group:"MISCELLANEOUS"},{description:C.intl.string(C.t.FJvZ87),binds:ec(S.IWg.FOCUS_SEARCH),group:"MISCELLANEOUS"},{description:C.intl.string(C.t["FiWl/T"]),binds:ec(S.IWg.OPEN_CONTEXT_MENU),group:"MISCELLANEOUS"},{description:C.intl.string(C.t.HnNtEI),binds:["h+h+right+n+k"],group:"MISCELLANEOUS",groupEnd:!0},{description:C.intl.string(C.t.fsBWmS),binds:["e"],group:"MESSAGE"},{description:C.intl.string(C.t.xwMqD7),binds:["backspace"],group:"MESSAGE"},{description:C.intl.string(C.t.CvQ18w),binds:["p"],group:"MESSAGE"},{description:C.intl.string(C.t.lfIHs4),binds:["plus"],group:"MESSAGE"},{description:C.intl.string(C.t["5IEsGx"]),binds:["r"],group:"MESSAGE"},{description:C.intl.string(C.t.zSyDdA),binds:["f"],group:"MESSAGE"},{description:C.intl.string(C.t.yGLjXF),binds:["s"],group:"MESSAGE"},{description:C.intl.string(C.t.JrGD7E),binds:["mod+c"],group:"MESSAGE"},{description:C.intl.string(C.t.RpE9k7),binds:["alt+enter"],group:"MESSAGE"},{description:C.intl.string(C.t.rrYBEu),binds:["escape"],group:"MESSAGE",groupEnd:!0},{description:C.intl.string(C.t.z9c6mt),binds:ec(S.IWg.VIBE_WITH_WUMPUS),group:"MISCELLANEOUS"}],{enabled:t,inInbox:n}=l.A.getConfig({location:"keybinds"});return t&&!n&&e.push({description:C.intl.string(C.t.IWNSoH),binds:ec(S.IWg.TOGGLE_FOR_LATER),group:"CHAT"}),e}let eh=21552==n.j?eu:null}